diff options
Diffstat (limited to 'include/clang/AST/Decl.h')
-rw-r--r-- | include/clang/AST/Decl.h | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index 46cbe7ab54..00bfac37eb 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -79,15 +79,12 @@ public: /// name (C++ constructor, Objective-C selector, etc.). IdentifierInfo *getIdentifier() const { return Name.getAsIdentifierInfo(); } - /// getIdentifierName - Get the name of identifier for this - /// declaration as a string. If the declaration has no name, or if - /// the name is a special name (C++ constructor, Objective-C - /// selector, etc.), returns NULL. - const char *getIdentifierName() const { - if (IdentifierInfo *II = getIdentifier()) - return II->getName(); - else - return 0; + /// getNameAsCString - Get the name of identifier for this declaration as a + /// C string (const char*). This requires that the declaration have a name + /// and that it be a simple identifier. + const char *getNameAsCString() const { + assert(getIdentifier() && "Name is not a simple identifier"); + return getIdentifier()->getName(); } /// getDeclName - Get the actual, stored name of the declaration, |