Convert IdentifierInfo's to be printed the same as DeclarationNames
with implicit quotes around them. This has a bunch of follow-on
effects and requires tweaking to a whole lot of code. This causes
a regression in two tests (xfailed) by causing it to emit things like:
Line 10: duplicate interface declaration for category 'MyClass1' ('Category1')
instead of:
Line 10: duplicate interface declaration for category 'MyClass1(Category1)'
I will fix this in a follow-up commit.
As part of this, I had to start switching stuff to use ->getDeclName() instead
of Decl::getName() for consistency. This is good, but I was planning to do this
as an independent patch. There will be several follow-on patches
to clean up some of the mess, but this patch is already too big.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59917 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp
index 15d955c..204d161 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -62,7 +62,7 @@
return new DeclStmt(DG, StartLoc, EndLoc);
}
else {
- DeclGroupOwningRef DG(DeclGroup::Create(Context, decls.size(), &decls[0]));
+ DeclGroupOwningRef DG(DeclGroup::Create(Context, decls.size(), &decls[0]));
return new DeclStmt(DG, StartLoc, EndLoc);
}
}
@@ -194,7 +194,7 @@
// Otherwise, this label was either forward reference or multiply defined. If
// multiply defined, reject it now.
if (LabelDecl->getSubStmt()) {
- Diag(IdentLoc, diag::err_redefinition_of_label) << LabelDecl->getName();
+ Diag(IdentLoc, diag::err_redefinition_of_label) << LabelDecl->getID();
Diag(LabelDecl->getIdentLoc(), diag::err_previous_definition);
return SubStmt;
}
@@ -773,10 +773,10 @@
if (RetValExp) {// C99 6.8.6.4p1 (ext_ since GCC warns)
if (FunctionDecl *FD = getCurFunctionDecl())
Diag(ReturnLoc, diag::ext_return_has_expr)
- << FD->getIdentifier() << RetValExp->getSourceRange();
+ << FD->getIdentifier() << 0/*function*/<< RetValExp->getSourceRange();
else
Diag(ReturnLoc, diag::ext_return_has_expr)
- << getCurMethodDecl()->getSelector().getName()
+ << getCurMethodDecl()->getDeclName() << 1 /*method*/
<< RetValExp->getSourceRange();
}
return new ReturnStmt(ReturnLoc, RetValExp);
@@ -788,9 +788,9 @@
if (getLangOptions().C99) DiagID = diag::ext_return_missing_expr;
if (FunctionDecl *FD = getCurFunctionDecl())
- Diag(ReturnLoc, DiagID) << FD->getIdentifier();
+ Diag(ReturnLoc, DiagID) << FD->getIdentifier() << 0/*fn*/;
else
- Diag(ReturnLoc, DiagID) << getCurMethodDecl()->getSelector().getName();
+ Diag(ReturnLoc, DiagID) << getCurMethodDecl()->getDeclName() << 1/*meth*/;
return new ReturnStmt(ReturnLoc, (Expr*)0);
}
@@ -813,7 +813,7 @@
}
Sema::StmtResult Sema::ActOnAsmStmt(SourceLocation AsmLoc,
- bool IsSimple,
+ bool IsSimple,
bool IsVolatile,
unsigned NumOutputs,
unsigned NumInputs,