summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaStmt.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-23 21:45:46 +0000
committerChris Lattner <sabre@nondot.org>2008-11-23 21:45:46 +0000
commite3d20d954503fef1256b50977f7e2c9507452c1e (patch)
tree8473d3824da844a9fcc3808aa798a1bdcf5b2b16 /clang/lib/Sema/SemaStmt.cpp
parentf7e69d5a77b21fd98e29df84411506527faa62b3 (diff)
downloadbcm5719-llvm-e3d20d954503fef1256b50977f7e2c9507452c1e.tar.gz
bcm5719-llvm-e3d20d954503fef1256b50977f7e2c9507452c1e.zip
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. llvm-svn: 59917
Diffstat (limited to 'clang/lib/Sema/SemaStmt.cpp')
-rw-r--r--clang/lib/Sema/SemaStmt.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index 15d955cb7b4..204d161f563 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/lib/Sema/SemaStmt.cpp
@@ -62,7 +62,7 @@ Sema::StmtResult Sema::ActOnDeclStmt(DeclTy *decl, SourceLocation StartLoc,
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 @@ Sema::ActOnLabelStmt(SourceLocation IdentLoc, IdentifierInfo *II,
// 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 @@ Sema::ActOnReturnStmt(SourceLocation ReturnLoc, ExprTy *rex) {
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 @@ Sema::ActOnReturnStmt(SourceLocation ReturnLoc, ExprTy *rex) {
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::ActOnReturnStmt(SourceLocation ReturnLoc, ExprTy *rex) {
}
Sema::StmtResult Sema::ActOnAsmStmt(SourceLocation AsmLoc,
- bool IsSimple,
+ bool IsSimple,
bool IsVolatile,
unsigned NumOutputs,
unsigned NumInputs,
OpenPOWER on IntegriCloud