diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2012-06-19 13:49:26 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2012-06-19 13:49:26 +0000 |
commit | ed35fd1c6db1680b4526ba64c94e5da6ec203be7 (patch) | |
tree | 18ac8c2240de3141ff98114ea78325435b42ab93 /include/clang/Sema/AttributeList.h | |
parent | c20c4e79ae1957ec5a88d7653a0aeda24b67ae3a (diff) |
Improves parsing and semantic analysis for MS __declspec attributes. This includes support for the align (which fixes PR12631).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158717 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Sema/AttributeList.h')
-rw-r--r-- | include/clang/Sema/AttributeList.h | 11 |
1 files changed, 9 insertions, 2 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; } |