diff options
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/AST/ASTContext.h | 3 | ||||
-rw-r--r-- | include/clang/AST/RecursiveASTVisitor.h | 6 | ||||
-rw-r--r-- | include/clang/AST/Type.h | 37 | ||||
-rw-r--r-- | include/clang/AST/TypeLoc.h | 38 | ||||
-rw-r--r-- | include/clang/AST/TypeNodes.def | 1 | ||||
-rw-r--r-- | include/clang/Parse/Parser.h | 1 | ||||
-rw-r--r-- | include/clang/Sema/ParsedAttr.h | 23 | ||||
-rw-r--r-- | include/clang/Sema/Sema.h | 2 | ||||
-rw-r--r-- | include/clang/Serialization/ASTBitCodes.h | 5 |
9 files changed, 2 insertions, 114 deletions
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index a09157cad0..1cddb6fd29 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -1441,9 +1441,6 @@ public: QualType getParenType(QualType NamedType) const; - QualType getMacroQualifiedType(QualType UnderlyingTy, - const IdentifierInfo *MacroII) const; - QualType getElaboratedType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, QualType NamedType, TagDecl *OwnedTagDecl = nullptr) const; diff --git a/include/clang/AST/RecursiveASTVisitor.h b/include/clang/AST/RecursiveASTVisitor.h index 6096c9c0f4..22ef332dbb 100644 --- a/include/clang/AST/RecursiveASTVisitor.h +++ b/include/clang/AST/RecursiveASTVisitor.h @@ -1065,9 +1065,6 @@ DEF_TRAVERSE_TYPE(AttributedType, DEF_TRAVERSE_TYPE(ParenType, { TRY_TO(TraverseType(T->getInnerType())); }) -DEF_TRAVERSE_TYPE(MacroQualifiedType, - { TRY_TO(TraverseType(T->getUnderlyingType())); }) - DEF_TRAVERSE_TYPE(ElaboratedType, { if (T->getQualifier()) { TRY_TO(TraverseNestedNameSpecifier(T->getQualifier())); @@ -1311,9 +1308,6 @@ DEF_TRAVERSE_TYPELOC(InjectedClassNameType, {}) DEF_TRAVERSE_TYPELOC(ParenType, { TRY_TO(TraverseTypeLoc(TL.getInnerLoc())); }) -DEF_TRAVERSE_TYPELOC(MacroQualifiedType, - { TRY_TO(TraverseTypeLoc(TL.getInnerLoc())); }) - DEF_TRAVERSE_TYPELOC(AttributedType, { TRY_TO(TraverseTypeLoc(TL.getModifiedLoc())); }) diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index 0633924f10..12a0213fdd 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -4184,41 +4184,6 @@ public: static bool classof(const Type *T) { return T->getTypeClass() == Typedef; } }; -/// Sugar type that represents a type that was qualified by a qualifier written -/// as a macro invocation. -class MacroQualifiedType : public Type { - friend class ASTContext; // ASTContext creates these. - - QualType UnderlyingTy; - const IdentifierInfo *MacroII; - - MacroQualifiedType(QualType UnderlyingTy, QualType CanonTy, - const IdentifierInfo *MacroII) - : Type(MacroQualified, CanonTy, UnderlyingTy->isDependentType(), - UnderlyingTy->isInstantiationDependentType(), - UnderlyingTy->isVariablyModifiedType(), - UnderlyingTy->containsUnexpandedParameterPack()), - UnderlyingTy(UnderlyingTy), MacroII(MacroII) { - assert(isa<AttributedType>(UnderlyingTy) && - "Expected a macro qualified type to only wrap attributed types."); - } - -public: - const IdentifierInfo *getMacroIdentifier() const { return MacroII; } - QualType getUnderlyingType() const { return UnderlyingTy; } - - /// Return this attributed type's modified type with no qualifiers attached to - /// it. - QualType getModifiedType() const; - - bool isSugared() const { return true; } - QualType desugar() const; - - static bool classof(const Type *T) { - return T->getTypeClass() == MacroQualified; - } -}; - /// Represents a `typeof` (or __typeof__) expression (a GCC extension). class TypeOfExprType : public Type { Expr *TOExpr; @@ -6840,8 +6805,6 @@ template <typename T> const T *Type::getAsAdjusted() const { Ty = P->desugar().getTypePtr(); else if (const auto *A = dyn_cast<AdjustedType>(Ty)) Ty = A->desugar().getTypePtr(); - else if (const auto *M = dyn_cast<MacroQualifiedType>(Ty)) - Ty = M->desugar().getTypePtr(); else break; } diff --git a/include/clang/AST/TypeLoc.h b/include/clang/AST/TypeLoc.h index 40d17f991f..3b3eb1b6c6 100644 --- a/include/clang/AST/TypeLoc.h +++ b/include/clang/AST/TypeLoc.h @@ -173,9 +173,6 @@ public: TypeLoc IgnoreParens() const; - /// Strips MacroDefinitionTypeLocs from a type location. - TypeLoc IgnoreMacroDefinitions() const; - /// Find a type with the location of an explicit type qualifier. /// /// The result, if non-null, will be one of: @@ -1083,39 +1080,6 @@ public: } }; -struct MacroQualifiedLocInfo { - SourceLocation ExpansionLoc; -}; - -class MacroQualifiedTypeLoc - : public ConcreteTypeLoc<UnqualTypeLoc, MacroQualifiedTypeLoc, - MacroQualifiedType, MacroQualifiedLocInfo> { -public: - void initializeLocal(ASTContext &Context, SourceLocation Loc) { - setExpansionLoc(Loc); - } - - TypeLoc getInnerLoc() const { return getInnerTypeLoc(); } - - const IdentifierInfo *getMacroIdentifier() const { - return getTypePtr()->getMacroIdentifier(); - } - - SourceLocation getExpansionLoc() const { - return this->getLocalData()->ExpansionLoc; - } - - void setExpansionLoc(SourceLocation Loc) { - this->getLocalData()->ExpansionLoc = Loc; - } - - QualType getInnerType() const { return getTypePtr()->getUnderlyingType(); } - - SourceRange getLocalSourceRange() const { - return getInnerLoc().getLocalSourceRange(); - } -}; - struct ParenLocInfo { SourceLocation LParenLoc; SourceLocation RParenLoc; @@ -2325,8 +2289,6 @@ inline T TypeLoc::getAsAdjusted() const { Cur = ETL.getNamedTypeLoc(); else if (auto ATL = Cur.getAs<AdjustedTypeLoc>()) Cur = ATL.getOriginalLoc(); - else if (auto MQL = Cur.getAs<MacroQualifiedTypeLoc>()) - Cur = MQL.getInnerLoc(); else break; } diff --git a/include/clang/AST/TypeNodes.def b/include/clang/AST/TypeNodes.def index 58a5f880cb..d1e4300fea 100644 --- a/include/clang/AST/TypeNodes.def +++ b/include/clang/AST/TypeNodes.def @@ -82,7 +82,6 @@ TYPE(FunctionNoProto, FunctionType) DEPENDENT_TYPE(UnresolvedUsing, Type) NON_CANONICAL_TYPE(Paren, Type) NON_CANONICAL_TYPE(Typedef, Type) -NON_CANONICAL_TYPE(MacroQualified, Type) NON_CANONICAL_TYPE(Adjusted, Type) NON_CANONICAL_TYPE(Decayed, AdjustedType) NON_CANONICAL_UNLESS_DEPENDENT_TYPE(TypeOfExpr, Type) diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h index cb0080f14b..e831e226d4 100644 --- a/include/clang/Parse/Parser.h +++ b/include/clang/Parse/Parser.h @@ -1152,7 +1152,6 @@ private: Parser *Self; CachedTokens Toks; IdentifierInfo &AttrName; - IdentifierInfo *MacroII = nullptr; SourceLocation AttrNameLoc; SmallVector<Decl*, 2> Decls; diff --git a/include/clang/Sema/ParsedAttr.h b/include/clang/Sema/ParsedAttr.h index a42e4547a9..2e0efe452a 100644 --- a/include/clang/Sema/ParsedAttr.h +++ b/include/clang/Sema/ParsedAttr.h @@ -167,8 +167,6 @@ public: private: IdentifierInfo *AttrName; IdentifierInfo *ScopeName; - IdentifierInfo *MacroII = nullptr; - SourceLocation MacroExpansionLoc; SourceRange AttrRange; SourceLocation ScopeLoc; SourceLocation EllipsisLoc; @@ -549,27 +547,6 @@ public: return getPropertyDataBuffer().SetterId; } - /// Set the macro identifier info object that this parsed attribute was - /// declared in if it was declared in a macro. Also set the expansion location - /// of the macro. - void setMacroIdentifier(IdentifierInfo *MacroName, SourceLocation Loc) { - MacroII = MacroName; - MacroExpansionLoc = Loc; - } - - /// Returns true if this attribute was declared in a macro. - bool hasMacroIdentifier() const { return MacroII != nullptr; } - - /// Return the macro identifier if this attribute was declared in a macro. - /// nullptr is returned if it was not declared in a macro. - IdentifierInfo *getMacroIdentifier() const { return MacroII; } - - SourceLocation getMacroExpansionLoc() const { - assert(hasMacroIdentifier() && "Can only get the macro expansion location " - "if this attribute has a macro identifier."); - return MacroExpansionLoc; - } - /// Get an index into the attribute spelling list /// defined in Attr.td. This index is used by an attribute /// to pretty print itself. diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index 0796e99858..64b92d2e7a 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -3516,7 +3516,7 @@ public: // Check if there is an explicit attribute, but only look through parens. // The intent is to look for an attribute on the current declarator, but not // one that came from a typedef. - bool hasExplicitCallingConv(QualType T); + bool hasExplicitCallingConv(QualType &T); /// Get the outermost AttributedType node that sets a calling convention. /// Valid types should not have multiple attributes with different CCs. diff --git a/include/clang/Serialization/ASTBitCodes.h b/include/clang/Serialization/ASTBitCodes.h index 790cdf106f..0365e3a696 100644 --- a/include/clang/Serialization/ASTBitCodes.h +++ b/include/clang/Serialization/ASTBitCodes.h @@ -1173,10 +1173,7 @@ namespace serialization { TYPE_DEPENDENT_ADDRESS_SPACE = 47, /// A dependentSizedVectorType record. - TYPE_DEPENDENT_SIZED_VECTOR = 48, - - /// A type defined in a macro. - TYPE_MACRO_QUALIFIED = 49 + TYPE_DEPENDENT_SIZED_VECTOR = 48 }; /// The type IDs for special types constructed by semantic |