diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-03-09 08:37:16 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-03-09 08:37:16 +0000 |
commit | 3a5032b89df601ab2e0c5c7e9667db2301bf10cf (patch) | |
tree | 0a10005d35f407fbd895deec316270874c399ae8 /lib/AST/DeclarationName.cpp | |
parent | a9e88b2549add9766382c70d270dfd89fa33f7cf (diff) |
Literal operator suffixes and regular names live in separate namespaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152395 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclarationName.cpp')
-rw-r--r-- | lib/AST/DeclarationName.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/AST/DeclarationName.cpp b/lib/AST/DeclarationName.cpp index a5488e67ca..64924ad950 100644 --- a/lib/AST/DeclarationName.cpp +++ b/lib/AST/DeclarationName.cpp @@ -53,7 +53,7 @@ public: void *FETokenInfo; }; -/// CXXLiberalOperatorName - Contains the actual identifier that makes up the +/// CXXLiteralOperatorName - Contains the actual identifier that makes up the /// name. /// /// This identifier is stored here rather than directly in DeclarationName so as @@ -64,6 +64,10 @@ class CXXLiteralOperatorIdName public: IdentifierInfo *ID; + /// FETokenInfo - Extra information associated with this operator + /// name that can be used by the front end. + void *FETokenInfo; + void Profile(llvm::FoldingSetNodeID &FSID) { FSID.AddPointer(ID); } @@ -333,7 +337,7 @@ void *DeclarationName::getFETokenInfoAsVoid() const { return getAsCXXOperatorIdName()->FETokenInfo; case CXXLiteralOperatorName: - return getCXXLiteralIdentifier()->getFETokenInfo<void>(); + return getAsCXXLiteralOperatorIdName()->FETokenInfo; default: llvm_unreachable("Declaration name has no FETokenInfo"); @@ -357,7 +361,7 @@ void DeclarationName::setFETokenInfo(void *T) { break; case CXXLiteralOperatorName: - getCXXLiteralIdentifier()->setFETokenInfo(T); + getAsCXXLiteralOperatorIdName()->FETokenInfo = T; break; default: @@ -471,6 +475,7 @@ DeclarationNameTable::getCXXLiteralOperatorName(IdentifierInfo *II) { CXXLiteralOperatorIdName *LiteralName = new (Ctx) CXXLiteralOperatorIdName; LiteralName->ExtraKindOrNumArgs = DeclarationNameExtra::CXXLiteralOperator; LiteralName->ID = II; + LiteralName->FETokenInfo = 0; LiteralNames->InsertNode(LiteralName, InsertPos); return DeclarationName(LiteralName); |