diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-24 03:33:13 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-24 03:33:13 +0000 |
commit | 077bf5e2f48acfa9e7d69429b6e4ba86ea14896d (patch) | |
tree | 55c540d3cfe45fb990f27b56635fcec5865bcc16 /lib/CodeGen/CGCXX.cpp | |
parent | d0fd3b747c46211c481021ffb9cabd5635f918ed (diff) |
Rename Selector::getName() to Selector::getAsString(), and add
a new NamedDecl::getAsString() method.
Change uses of Selector::getName() to just pass in a Selector
where possible (e.g. to diagnostics) instead of going through
an std::string.
This also adds new formatters for objcinstance and objcclass
as described in the dox.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59933 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCXX.cpp')
-rw-r--r-- | lib/CodeGen/CGCXX.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp index 70eeb942b7..d55d0f81bc 100644 --- a/lib/CodeGen/CGCXX.cpp +++ b/lib/CodeGen/CGCXX.cpp @@ -19,12 +19,9 @@ #include "clang/AST/Decl.h" #include "clang/AST/DeclObjC.h" #include "llvm/ADT/StringExtras.h" - using namespace clang; using namespace CodeGen; -using llvm::utostr; - // FIXME: Name mangling should be moved to a separate class. @@ -35,7 +32,7 @@ static void mangleDeclContextInternal(const DeclContext *D, std::string &S) "Only one level of decl context mangling is currently supported!"); if (const FunctionDecl* FD = dyn_cast<FunctionDecl>(D)) { - S += utostr(FD->getIdentifier()->getLength()); + S += llvm::utostr(FD->getIdentifier()->getLength()); S += FD->getIdentifier()->getName(); if (FD->param_size() == 0) @@ -48,11 +45,11 @@ static void mangleDeclContextInternal(const DeclContext *D, std::string &S) std::string Name; Name += MD->isInstance() ? '-' : '+'; Name += '['; - Name += MD->getClassInterface()->getName(); + Name += MD->getClassInterface()->getNameAsString(); Name += ' '; - Name += MD->getSelector().getName(); + Name += MD->getSelector().getAsString(); Name += ']'; - S += utostr(Name.length()); + S += llvm::utostr(Name.length()); S += Name; } else assert(0 && "Unsupported decl type!"); @@ -64,7 +61,7 @@ static void mangleVarDeclInternal(const VarDecl &D, std::string &S) mangleDeclContextInternal(D.getDeclContext(), S); S += 'E'; - S += utostr(D.getIdentifier()->getLength()); + S += llvm::utostr(D.getIdentifier()->getLength()); S += D.getIdentifier()->getName(); } |