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
diff --git a/Driver/RewriteBlocks.cpp b/Driver/RewriteBlocks.cpp
index 5359153..11d7e36 100644
--- a/Driver/RewriteBlocks.cpp
+++ b/Driver/RewriteBlocks.cpp
@@ -625,7 +625,7 @@
void RewriteBlocks::InsertBlockLiteralsWithinMethod(ObjCMethodDecl *MD) {
SourceLocation FunLocStart = MD->getLocStart();
- std::string FuncName = std::string(MD->getSelector().getName());
+ std::string FuncName = MD->getSelector().getAsString();
// Convert colons to underscores.
std::string::size_type loc = 0;
while ((loc = FuncName.find(":", loc)) != std::string::npos)
@@ -920,7 +920,7 @@
if (CurFunctionDef)
FuncName = std::string(CurFunctionDef->getName());
else if (CurMethodDef) {
- FuncName = std::string(CurMethodDef->getSelector().getName());
+ FuncName = CurMethodDef->getSelector().getAsString();
// Convert colons to underscores.
std::string::size_type loc = 0;
while ((loc = FuncName.find(":", loc)) != std::string::npos)