diff options
author | Douglas Gregor <dgregor@apple.com> | 2008-11-17 14:58:09 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2008-11-17 14:58:09 +0000 |
commit | 77324f385482d592ef54b286ffbb00f47b9259ac (patch) | |
tree | 7c60f2f71c6e87fbc3242d87e24cf4b23cd9d435 /clang/Driver/RewriteBlocks.cpp | |
parent | d1f5e5d30458080f3591251d29bd6758f667a448 (diff) | |
download | bcm5719-llvm-77324f385482d592ef54b286ffbb00f47b9259ac.tar.gz bcm5719-llvm-77324f385482d592ef54b286ffbb00f47b9259ac.zip |
Introduction the DeclarationName class, as a single, general method of
representing the names of declarations in the C family of
languages. DeclarationName is used in NamedDecl to store the name of
the declaration (naturally), and ObjCMethodDecl is now a NamedDecl.
llvm-svn: 59441
Diffstat (limited to 'clang/Driver/RewriteBlocks.cpp')
-rw-r--r-- | clang/Driver/RewriteBlocks.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/Driver/RewriteBlocks.cpp b/clang/Driver/RewriteBlocks.cpp index d8e347fafba..535915344c6 100644 --- a/clang/Driver/RewriteBlocks.cpp +++ b/clang/Driver/RewriteBlocks.cpp @@ -618,7 +618,7 @@ void RewriteBlocks::SynthesizeBlockLiterals(SourceLocation FunLocStart, void RewriteBlocks::InsertBlockLiteralsWithinFunction(FunctionDecl *FD) { SourceLocation FunLocStart = FD->getTypeSpecStartLoc(); - const char *FuncName = FD->getName(); + const char *FuncName = FD->getIdentifierName(); SynthesizeBlockLiterals(FunLocStart, FuncName); } @@ -675,13 +675,13 @@ std::string RewriteBlocks::SynthesizeBlockCall(CallExpr *Exp) { const BlockPointerType *CPT = 0; if (const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(Exp->getCallee())) { - closureName = DRE->getDecl()->getName(); + closureName = DRE->getDecl()->getIdentifierName(); CPT = DRE->getType()->getAsBlockPointerType(); } else if (BlockDeclRefExpr *CDRE = dyn_cast<BlockDeclRefExpr>(Exp->getCallee())) { - closureName = CDRE->getDecl()->getName(); + closureName = CDRE->getDecl()->getIdentifierName(); CPT = CDRE->getType()->getAsBlockPointerType(); } else if (MemberExpr *MExpr = dyn_cast<MemberExpr>(Exp->getCallee())) { - closureName = MExpr->getMemberDecl()->getName(); + closureName = MExpr->getMemberDecl()->getIdentifierName(); CPT = MExpr->getType()->getAsBlockPointerType(); } else { assert(1 && "RewriteBlockClass: Bad type"); @@ -1109,7 +1109,8 @@ void RewriteBlocks::HandleDeclInMainFile(Decl *D) { std::string Init = SynthesizeBlockInitExpr(CBE, VD); // Do the rewrite, using S.size() which contains the rewritten size. ReplaceText(CBE->getLocStart(), S.size(), Init.c_str(), Init.size()); - SynthesizeBlockLiterals(VD->getTypeSpecStartLoc(), VD->getName()); + SynthesizeBlockLiterals(VD->getTypeSpecStartLoc(), + VD->getIdentifierName()); } else if (CastExpr *CE = dyn_cast<CastExpr>(VD->getInit())) { RewriteCastExpr(CE); } |