diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-24 03:54:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-24 03:54:41 +0000 |
commit | 8ec03f58c33c33a917f54bb7f2cd61b6d7ffe0ca (patch) | |
tree | ab82837deaf7ca40831de4b7467d2d3c1982c9ff /lib/AST/DeclObjC.cpp | |
parent | bb49c3ee5d270485f4b273691fd14bc97403fa5d (diff) |
Rename NamedDecl::getIdentifierName() to ::getNameAsCString() and make it
assert if the name is not an identifier. Update callers to do the right
thing and avoid this method in unsafe cases. This also fixes an objc
warning that was missing a space, and migrates a couple more to taking
IdentifierInfo and QualTypes instead of std::strings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59936 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclObjC.cpp')
-rw-r--r-- | lib/AST/DeclObjC.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index e69526e241..040a921908 100644 --- a/lib/AST/DeclObjC.cpp +++ b/lib/AST/DeclObjC.cpp @@ -758,11 +758,11 @@ unsigned ObjCMethodDecl::getSynthesizedMethodSize() const { // syntesized method name is a concatenation of -/+[class-name selector] // Get length of this name. unsigned length = 3; // _I_ or _C_ - length += strlen(getClassInterface()->getIdentifierName()) +1; // extra for _ + length += getClassInterface()->getNameAsString().size()+1; // extra for _ NamedDecl *MethodContext = getMethodContext(); if (ObjCCategoryImplDecl *CID = dyn_cast<ObjCCategoryImplDecl>(MethodContext)) - length += strlen(CID->getIdentifierName()) +1; + length += CID->getNameAsString().size()+1; length += getSelector().getAsString().size(); // selector name return length; } |