[cfe-commits] r59603 - in /cfe/trunk/lib/Parse: ParseDecl.cpp ParseExpr.cpp ParseObjc.cpp
Chris Lattner
sabre at nondot.org
Tue Nov 18 23:37:42 PST 2008
Author: lattner
Date: Wed Nov 19 01:37:42 2008
New Revision: 59603
URL: http://llvm.org/viewvc/llvm-project?rev=59603&view=rev
Log:
remove uses of IdentifierInfo::getName()
Modified:
cfe/trunk/lib/Parse/ParseDecl.cpp
cfe/trunk/lib/Parse/ParseExpr.cpp
cfe/trunk/lib/Parse/ParseObjc.cpp
Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=59603&r1=59602&r2=59603&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Wed Nov 19 01:37:42 2008
@@ -1372,8 +1372,12 @@
// C++ [dcl.ref]p4: There shall be no references to references.
DeclaratorChunk& InnerChunk = D.getTypeObject(D.getNumTypeObjects() - 1);
if (InnerChunk.Kind == DeclaratorChunk::Reference) {
- Diag(InnerChunk.Loc, diag::err_illegal_decl_reference_to_reference)
- << (D.getIdentifier() ? D.getIdentifier()->getName() : "type name");
+ if (const IdentifierInfo *II = D.getIdentifier())
+ Diag(InnerChunk.Loc, diag::err_illegal_decl_reference_to_reference)
+ << II;
+ else
+ Diag(InnerChunk.Loc, diag::err_illegal_decl_reference_to_reference)
+ << "type name";
// Once we've complained about the reference-to-referwnce, we
// can go ahead and build the (technically ill-formed)
@@ -1832,11 +1836,11 @@
// Reject 'typedef int y; int test(x, y)', but continue parsing.
if (Actions.isTypeName(*ParmII, CurScope))
- Diag(Tok, diag::err_unexpected_typedef_ident) << ParmII->getName();
+ Diag(Tok, diag::err_unexpected_typedef_ident) << ParmII;
// Verify that the argument identifier has not already been mentioned.
if (!ParamsSoFar.insert(ParmII)) {
- Diag(Tok, diag::err_param_redefinition) <<ParmII->getName();
+ Diag(Tok, diag::err_param_redefinition) << ParmII;
} else {
// Remember this identifier in ParamInfo.
ParamInfo.push_back(DeclaratorChunk::ParamInfo(ParmII,
@@ -1936,7 +1940,7 @@
if (Tok.isNot(tok::l_paren)) {
if (!getLang().CPlusPlus) {
- Diag(Tok, diag::err_expected_lparen_after) << BuiltinII->getName();
+ Diag(Tok, diag::err_expected_lparen_after) << BuiltinII;
return;
}
Modified: cfe/trunk/lib/Parse/ParseExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExpr.cpp?rev=59603&r1=59602&r2=59603&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseExpr.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExpr.cpp Wed Nov 19 01:37:42 2008
@@ -808,7 +808,7 @@
// All of these start with an open paren.
if (Tok.isNot(tok::l_paren)) {
- Diag(Tok, diag::err_expected_lparen_after) << BuiltinII->getName();
+ Diag(Tok, diag::err_expected_lparen_after) << BuiltinII;
return ExprResult(true);
}
Modified: cfe/trunk/lib/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=59603&r1=59602&r2=59603&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Wed Nov 19 01:37:42 2008
@@ -209,8 +209,7 @@
memcpy(&SelectorName[3], Name->getName(), N);
SelectorName[3] = toupper(SelectorName[3]);
- IdentifierInfo *Setter =
- &Idents.get(SelectorName, &SelectorName[3 + N]);
+ IdentifierInfo *Setter = &Idents.get(SelectorName, &SelectorName[3 + N]);
delete[] SelectorName;
return Setter;
}
More information about the cfe-commits
mailing list