biome: 1.9.2 -> 1.9.3 (#349335)
[NixPkgs.git] / pkgs / development / python-modules / pyside2 / shiboken2-clang-Remove-typedef-expansion.patch
blob142641173639afe24150c67481db76a7c154e7db
1 From: Friedemann Kleint <Friedemann.Kleint@qt.io>
2 Date: Thu, 20 Apr 2023 11:16:15 +0200
3 Subject: shiboken2/clang: Remove typedef expansion
5 The functionality will be re-added by a subsequent change
6 expanding elaborated types.
8 Task-number: PYSIDE-2288
9 Pick-to: 6.5 5.15
10 Change-Id: I3245c6dccba7de0ed1ce0e7820e1edb4567ca3c2
11 Reviewed-by: Christian Tismer <tismer@stackless.com>
12 (cherry picked from commit 24742dca014109bd3c2a9775fc15ca306ab22c9c)
13 ---
14 .../ApiExtractor/clangparser/clangbuilder.cpp | 39 ----------------------
15 1 file changed, 39 deletions(-)
17 diff --git a/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp b/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
18 index 1b4c81c..332f1da 100644
19 --- a/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
20 +++ b/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
21 @@ -140,7 +140,6 @@ static bool isSigned(CXTypeKind kind)
22 class BuilderPrivate {
23 public:
24 using CursorClassHash = QHash<CXCursor, ClassModelItem>;
25 - using CursorTypedefHash = QHash<CXCursor, TypeDefModelItem>;
26 using TypeInfoHash = QHash<CXType, TypeInfo>;
28 explicit BuilderPrivate(BaseVisitor *bv) : m_baseVisitor(bv), m_model(new CodeModel)
29 @@ -197,9 +196,6 @@ public:
30 QString cursorValueExpression(BaseVisitor *bv, const CXCursor &cursor) const;
31 void addBaseClass(const CXCursor &cursor);
33 - template <class Item>
34 - void qualifyTypeDef(const CXCursor &typeRefCursor, const QSharedPointer<Item> &item) const;
36 bool visitHeader(const char *cFileName) const;
38 void setFileName(const CXCursor &cursor, _CodeModelItem *item);
39 @@ -213,7 +209,6 @@ public:
40 // classes can be correctly parented in case of forward-declared inner classes
41 // (QMetaObject::Connection)
42 CursorClassHash m_cursorClassHash;
43 - CursorTypedefHash m_cursorTypedefHash;
45 mutable TypeInfoHash m_typeInfoHash; // Cache type information
46 mutable QHash<QString, TemplateTypeAliasModelItem> m_templateTypeAliases;
47 @@ -561,7 +556,6 @@ void BuilderPrivate::addTypeDef(const CXCursor &cursor, const CXType &cxType)
48 item->setType(createTypeInfo(cxType));
49 item->setScope(m_scope);
50 m_scopeStack.back()->addTypeDef(item);
51 - m_cursorTypedefHash.insert(cursor, item);
54 void BuilderPrivate::startTemplateTypeAlias(const CXCursor &cursor)
55 @@ -703,31 +697,6 @@ static inline CXCursor definitionFromTypeRef(const CXCursor &typeRefCursor)
56 return clang_getTypeDeclaration(clang_getCursorType(typeRefCursor));
59 -// Qualify function arguments or fields that are typedef'ed from another scope:
60 -// enum ConversionFlag {};
61 -// typedef QFlags<ConversionFlag> ConversionFlags;
62 -// class QTextCodec {
63 -// enum ConversionFlag {};
64 -// typedef QFlags<ConversionFlag> ConversionFlags;
65 -// struct ConverterState {
66 -// explicit ConverterState(ConversionFlags);
67 -// ^^ qualify to QTextCodec::ConversionFlags
68 -// ConversionFlags m_flags;
69 -// ^^ ditto
71 -template <class Item> // ArgumentModelItem, VariableModelItem
72 -void BuilderPrivate::qualifyTypeDef(const CXCursor &typeRefCursor, const QSharedPointer<Item> &item) const
74 - TypeInfo type = item->type();
75 - if (type.qualifiedName().size() == 1) { // item's type is unqualified.
76 - const auto it = m_cursorTypedefHash.constFind(definitionFromTypeRef(typeRefCursor));
77 - if (it != m_cursorTypedefHash.constEnd() && !it.value()->scope().isEmpty()) {
78 - type.setQualifiedName(it.value()->scope() + type.qualifiedName());
79 - item->setType(type);
80 - }
81 - }
84 void BuilderPrivate::setFileName(const CXCursor &cursor, _CodeModelItem *item)
86 const SourceRange range = getCursorRange(cursor);
87 @@ -1120,14 +1089,6 @@ BaseVisitor::StartTokenResult Builder::startToken(const CXCursor &cursor)
89 break;
90 case CXCursor_TypeRef:
91 - if (!d->m_currentFunction.isNull()) {
92 - if (d->m_currentArgument.isNull())
93 - d->qualifyTypeDef(cursor, d->m_currentFunction); // return type
94 - else
95 - d->qualifyTypeDef(cursor, d->m_currentArgument);
96 - } else if (!d->m_currentField.isNull()) {
97 - d->qualifyTypeDef(cursor, d->m_currentField);
98 - }
99 break;
100 case CXCursor_CXXFinalAttr:
101 if (!d->m_currentFunction.isNull())