diff options
Diffstat (limited to 'include/clang/Sema')
-rw-r--r-- | include/clang/Sema/AttributeList.h | 11 | ||||
-rw-r--r-- | include/clang/Sema/Sema.h | 6 |
2 files changed, 13 insertions, 4 deletions
diff --git a/include/clang/Sema/AttributeList.h b/include/clang/Sema/AttributeList.h index 5de2cce976..5239044e67 100644 --- a/include/clang/Sema/AttributeList.h +++ b/include/clang/Sema/AttributeList.h @@ -57,7 +57,10 @@ public: enum Syntax { AS_GNU, AS_CXX11, - AS_Declspec + AS_Declspec, + // eg) __w64, __ptr32, etc. It is implied that an MSTypespec is also + // a declspec. + AS_MSTypespec }; private: IdentifierInfo *AttrName; @@ -181,8 +184,12 @@ public: IdentifierInfo *getParameterName() const { return ParmName; } SourceLocation getParameterLoc() const { return ParmLoc; } - bool isDeclspecAttribute() const { return SyntaxUsed == AS_Declspec; } + /// Returns true if the attribute is a pure __declspec or a synthesized + /// declspec representing a type specification (like __w64 or __ptr32). + bool isDeclspecAttribute() const { return SyntaxUsed == AS_Declspec || + SyntaxUsed == AS_MSTypespec; } bool isCXX0XAttribute() const { return SyntaxUsed == AS_CXX11; } + bool isMSTypespecAttribute() const { return SyntaxUsed == AS_MSTypespec; } bool isInvalid() const { return Invalid; } void setInvalid(bool b = true) const { Invalid = b; } diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index c6af1d861a..408763f5cf 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -6338,8 +6338,10 @@ public: void AddCFAuditedAttribute(Decl *D); /// AddAlignedAttr - Adds an aligned attribute to a particular declaration. - void AddAlignedAttr(SourceRange AttrRange, Decl *D, Expr *E); - void AddAlignedAttr(SourceRange AttrRange, Decl *D, TypeSourceInfo *T); + void AddAlignedAttr(SourceRange AttrRange, Decl *D, Expr *E, + bool isDeclSpec); + void AddAlignedAttr(SourceRange AttrRange, Decl *D, TypeSourceInfo *T, + bool isDeclSpec); /// \brief The kind of conversion being performed. enum CheckedConversionKind { |