diff options
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/AST/DeclBase.h | 5 | ||||
-rw-r--r-- | include/clang/AST/DeclarationName.h | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index 6382bf3694..6aef681d75 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -15,6 +15,7 @@ #define LLVM_CLANG_AST_DECLBASE_H #include "clang/AST/Attr.h" +#include "clang/AST/DeclarationName.h" #include "clang/AST/Type.h" #include "clang/Basic/Specifiers.h" #include "llvm/ADT/PointerUnion.h" @@ -1411,7 +1412,9 @@ public: /// and enumerator names preceding any tag name. Note that this /// routine will not look into parent contexts. lookup_result lookup(DeclarationName Name); - lookup_const_result lookup(DeclarationName Name) const; + lookup_const_result lookup(DeclarationName Name) const { + return const_cast<DeclContext*>(this)->lookup(Name); + } /// \brief A simplistic name lookup mechanism that performs name lookup /// into this declaration context without consulting the external source. diff --git a/include/clang/AST/DeclarationName.h b/include/clang/AST/DeclarationName.h index 6349d9c001..928a85c63b 100644 --- a/include/clang/AST/DeclarationName.h +++ b/include/clang/AST/DeclarationName.h @@ -155,7 +155,13 @@ private: /// getFETokenInfoAsVoid - Retrieves the front end-specified pointer /// for this name as a void pointer. - void *getFETokenInfoAsVoid() const; + void *getFETokenInfoAsVoid() const { + if (getNameKind() == Identifier) + return getAsIdentifierInfo()->getFETokenInfo<void>(); + return getFETokenInfoAsVoidSlow(); + } + + void *getFETokenInfoAsVoidSlow() const; public: /// DeclarationName - Used to create an empty selector. |