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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59441 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/RewriteBlocks.cpp b/Driver/RewriteBlocks.cpp
index d8e347f..5359153 100644
--- a/Driver/RewriteBlocks.cpp
+++ b/Driver/RewriteBlocks.cpp
@@ -618,7 +618,7 @@
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 @@
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 @@
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);
}