diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-23 21:45:46 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-23 21:45:46 +0000 |
commit | 08631c5fa053867146b5ee8be658c229f6bf127c (patch) | |
tree | e1938ec851a8ca72ade476e71a10797fdacd12a7 /lib | |
parent | 011bb4edf731d529da1cbf71c7c2696aaf5a054f (diff) |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Basic/Diagnostic.cpp | 17 | ||||
-rw-r--r-- | lib/Lex/PPDirectives.cpp | 2 | ||||
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 2 | ||||
-rw-r--r-- | lib/Parse/ParseExpr.cpp | 2 | ||||
-rw-r--r-- | lib/Parse/ParsePragma.cpp | 10 | ||||
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 5 | ||||
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 23 | ||||
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 8 | ||||
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 8 | ||||
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 17 | ||||
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 4 | ||||
-rw-r--r-- | lib/Sema/SemaExprObjC.cpp | 3 | ||||
-rw-r--r-- | lib/Sema/SemaStmt.cpp | 14 |
13 files changed, 57 insertions, 58 deletions
diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp index efdb329171..8547ef49a0 100644 --- a/lib/Basic/Diagnostic.cpp +++ b/lib/Basic/Diagnostic.cpp @@ -482,6 +482,7 @@ FormatDiagnostic(llvm::SmallVectorImpl<char> &OutStr) const { unsigned ArgNo = *DiagStr++ - '0'; switch (getArgKind(ArgNo)) { + // ---- STRINGS ---- case Diagnostic::ak_std_string: { const std::string &S = getArgStdStr(ArgNo); assert(ModifierLen == 0 && "No modifiers for strings yet"); @@ -494,12 +495,7 @@ FormatDiagnostic(llvm::SmallVectorImpl<char> &OutStr) const { OutStr.append(S, S + strlen(S)); break; } - case Diagnostic::ak_identifierinfo: { - const IdentifierInfo *II = getArgIdentifier(ArgNo); - assert(ModifierLen == 0 && "No modifiers for strings yet"); - OutStr.append(II->getName(), II->getName() + II->getLength()); - break; - } + // ---- INTEGERS ---- case Diagnostic::ak_sint: { int Val = getArgSInt(ArgNo); @@ -535,6 +531,15 @@ FormatDiagnostic(llvm::SmallVectorImpl<char> &OutStr) const { } break; } + // ---- NAMES and TYPES ---- + case Diagnostic::ak_identifierinfo: { + OutStr.push_back('\''); + const IdentifierInfo *II = getArgIdentifier(ArgNo); + assert(ModifierLen == 0 && "No modifiers for strings yet"); + OutStr.append(II->getName(), II->getName() + II->getLength()); + OutStr.push_back('\''); + break; + } case Diagnostic::ak_qualtype: case Diagnostic::ak_declarationname: OutStr.push_back('\''); diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp index 0a7d2dba78..2a33531b64 100644 --- a/lib/Lex/PPDirectives.cpp +++ b/lib/Lex/PPDirectives.cpp @@ -977,7 +977,7 @@ void Preprocessor::HandleDefineDirective(Token &DefineTok) { if (!MI->isIdenticalTo(*OtherMI, *this)) { Diag(MI->getDefinitionLoc(), diag::ext_pp_macro_redef) << MacroNameTok.getIdentifierInfo(); - Diag(OtherMI->getDefinitionLoc(), diag::ext_pp_macro_redef2); + Diag(OtherMI->getDefinitionLoc(), diag::note_previous_definition); } delete OtherMI; } diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 3262c0de1c..1b5a0a5e7a 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -1945,7 +1945,7 @@ void Parser::ParseTypeofSpecifier(DeclSpec &DS) { if (Tok.isNot(tok::l_paren)) { if (!getLang().CPlusPlus) { - Diag(Tok, diag::err_expected_lparen_after) << BuiltinII; + Diag(Tok, diag::err_expected_lparen_after_id) << BuiltinII; return; } diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp index 9f9b306c45..21b3dac038 100644 --- a/lib/Parse/ParseExpr.cpp +++ b/lib/Parse/ParseExpr.cpp @@ -829,7 +829,7 @@ Parser::ExprResult Parser::ParseBuiltinPrimaryExpression() { // All of these start with an open paren. if (Tok.isNot(tok::l_paren)) { - Diag(Tok, diag::err_expected_lparen_after) << BuiltinII; + Diag(Tok, diag::err_expected_lparen_after_id) << BuiltinII; return ExprResult(true); } diff --git a/lib/Parse/ParsePragma.cpp b/lib/Parse/ParsePragma.cpp index d7ecbfa2b9..17eba03c26 100644 --- a/lib/Parse/ParsePragma.cpp +++ b/lib/Parse/ParsePragma.cpp @@ -45,13 +45,13 @@ void PragmaPackHandler::HandlePragma(Preprocessor &PP, Token &PackTok) { PP.Lex(Tok); } else if (Tok.is(tok::identifier)) { const IdentifierInfo *II = Tok.getIdentifierInfo(); - if (II == &PP.getIdentifierTable().get("show")) { + if (II->isStr("show")) { Kind = Action::PPK_Show; PP.Lex(Tok); } else { - if (II == &PP.getIdentifierTable().get("push")) { + if (II->isStr("push")) { Kind = Action::PPK_Push; - } else if (II == &PP.getIdentifierTable().get("pop")) { + } else if (II->isStr("pop")) { Kind = Action::PPK_Pop; } else { PP.Diag(Tok.getLocation(), diag::warn_pragma_pack_invalid_action); @@ -76,7 +76,7 @@ void PragmaPackHandler::HandlePragma(Preprocessor &PP, Token &PackTok) { PP.Lex(Tok); if (Tok.isNot(tok::numeric_constant)) { - PP.Diag(Tok.getLocation(), diag::warn_pragma_pack_malformed)<<II; + PP.Diag(Tok.getLocation(), diag::warn_pragma_pack_malformed); return; } @@ -87,7 +87,7 @@ void PragmaPackHandler::HandlePragma(Preprocessor &PP, Token &PackTok) { PP.Lex(Tok); } } else { - PP.Diag(Tok.getLocation(), diag::warn_pragma_pack_malformed) << II; + PP.Diag(Tok.getLocation(), diag::warn_pragma_pack_malformed); return; } } diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index 09474452a2..09f6efb097 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -719,7 +719,7 @@ Sema::CheckReturnStackAddr(Expr *RetValExp, QualType lhsType, if (lhsType->isPointerType() || lhsType->isBlockPointerType()) { if (DeclRefExpr *DR = EvalAddr(RetValExp)) Diag(DR->getLocStart(), diag::warn_ret_stack_addr) - << DR->getDecl()->getIdentifier() << RetValExp->getSourceRange(); + << DR->getDecl()->getDeclName() << RetValExp->getSourceRange(); // Skip over implicit cast expressions when checking for block expressions. if (ImplicitCastExpr *IcExpr = @@ -735,8 +735,7 @@ Sema::CheckReturnStackAddr(Expr *RetValExp, QualType lhsType, // Check for a reference to the stack if (DeclRefExpr *DR = EvalVal(RetValExp)) Diag(DR->getLocStart(), diag::warn_ret_stack_ref) - << DR->getDecl()->getIdentifier() - << RetValExp->getSourceRange(); + << DR->getDecl()->getDeclName() << RetValExp->getSourceRange(); } } diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index fba9f3328b..c3b130255b 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -325,7 +325,7 @@ TypedefDecl *Sema::MergeTypeDefDecl(TypedefDecl *New, Decl *OldD) { TypedefDecl *Old = dyn_cast<TypedefDecl>(OldD); if (!Old) { Diag(New->getLocation(), diag::err_redefinition_different_kind) - << New->getName(); + << New->getDeclName(); Diag(OldD->getLocation(), diag::err_previous_definition); return New; } @@ -364,7 +364,7 @@ TypedefDecl *Sema::MergeTypeDefDecl(TypedefDecl *New, Decl *OldD) { return New; } - Diag(New->getLocation(), diag::err_redefinition) << New->getName(); + Diag(New->getLocation(), diag::err_redefinition) << New->getDeclName(); Diag(Old->getLocation(), diag::err_previous_definition); return New; } @@ -418,7 +418,7 @@ Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD, bool &Redeclaration) { FunctionDecl *Old = dyn_cast<FunctionDecl>(OldD); if (!Old) { Diag(New->getLocation(), diag::err_redefinition_different_kind) - << New->getName(); + << New->getDeclName(); Diag(OldD->getLocation(), diag::err_previous_definition); return New; } @@ -537,7 +537,7 @@ void Sema::CheckForFileScopedRedefinitions(Scope *S, VarDecl *VD) { OldDecl->getStorageClass() != VarDecl::PrivateExtern && VD->getStorageClass() != VarDecl::Extern && VD->getStorageClass() != VarDecl::PrivateExtern) { - Diag(VD->getLocation(), diag::err_redefinition) << VD->getName(); + Diag(VD->getLocation(), diag::err_redefinition) << VD->getDeclName(); Diag(OldDecl->getLocation(), diag::err_previous_definition); } } @@ -557,7 +557,7 @@ VarDecl *Sema::MergeVarDecl(VarDecl *New, Decl *OldD) { VarDecl *Old = dyn_cast<VarDecl>(OldD); if (!Old) { Diag(New->getLocation(), diag::err_redefinition_different_kind) - << New->getName(); + << New->getDeclName(); Diag(OldD->getLocation(), diag::err_previous_definition); return New; } @@ -568,7 +568,7 @@ VarDecl *Sema::MergeVarDecl(VarDecl *New, Decl *OldD) { QualType OldCType = Context.getCanonicalType(Old->getType()); QualType NewCType = Context.getCanonicalType(New->getType()); if (OldCType != NewCType && !Context.typesAreCompatible(OldCType, NewCType)) { - Diag(New->getLocation(), diag::err_redefinition) << New->getName(); + Diag(New->getLocation(), diag::err_redefinition) << New->getDeclName(); Diag(Old->getLocation(), diag::err_previous_definition); return New; } @@ -589,7 +589,7 @@ VarDecl *Sema::MergeVarDecl(VarDecl *New, Decl *OldD) { } // Variables with external linkage are analyzed in FinalizeDeclaratorGroup. if (New->getStorageClass() != VarDecl::Extern && !New->isFileVarDecl()) { - Diag(New->getLocation(), diag::err_redefinition) << New->getName(); + Diag(New->getLocation(), diag::err_redefinition) << New->getDeclName(); Diag(Old->getLocation(), diag::err_previous_definition); } return New; @@ -849,7 +849,7 @@ Sema::ActOnDeclarator(Scope *S, Declarator &D, DeclTy *lastDecl) { if (PrevDecl == 0) { // No previous declaration in the qualifying scope. Diag(D.getIdentifierLoc(), diag::err_typecheck_no_member) - << Name.getAsString() << D.getCXXScopeSpec().getRange(); + << Name << D.getCXXScopeSpec().getRange(); } else if (!CurContext->Encloses(DC)) { // The qualifying scope doesn't enclose the original declaration. // Emit diagnostic based on current scope. @@ -1987,8 +1987,7 @@ Sema::ActOnParamDeclarator(Scope *S, Declarator &D) { IdentifierInfo *II = D.getIdentifier(); if (Decl *PrevDecl = LookupDecl(II, Decl::IDNS_Ordinary, S)) { if (S->isDeclScope(PrevDecl)) { - Diag(D.getIdentifierLoc(), diag::err_param_redefinition) - << cast<NamedDecl>(PrevDecl)->getName(); + Diag(D.getIdentifierLoc(), diag::err_param_redefinition) << II; // Recover by removing the name II = 0; @@ -2076,7 +2075,7 @@ Sema::DeclTy *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, DeclTy *D) { // See if this is a redefinition. const FunctionDecl *Definition; if (FD->getBody(Definition)) { - Diag(FD->getLocation(), diag::err_redefinition) << FD->getName(); + Diag(FD->getLocation(), diag::err_redefinition) << FD->getDeclName(); Diag(Definition->getLocation(), diag::err_previous_definition); } @@ -2804,7 +2803,7 @@ void Sema::ActOnFields(Scope* S, /// A field cannot be an Objective-c object if (FDTy->isObjCInterfaceType()) { Diag(FD->getLocation(), diag::err_statically_allocated_object) - << FD->getName(); + << FD->getDeclName(); FD->setInvalidDecl(); EnclosingDecl->setInvalidDecl(); continue; diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index e4811dfaa6..ce63d13b4d 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -274,7 +274,7 @@ static void HandlePackedAttr(Decl *d, const AttributeList &Attr, Sema &S) { if (!FD->getType()->isIncompleteType() && S.Context.getTypeAlign(FD->getType()) <= 8) S.Diag(Attr.getLoc(), diag::warn_attribute_ignored_for_field_of_type) - << Attr.getName() << FD->getType().getAsString(); + << Attr.getName() << FD->getType(); else FD->addAttr(new PackedAttr(1)); } else @@ -533,8 +533,7 @@ static void HandleVisibilityAttr(Decl *d, const AttributeList &Attr, Sema &S) { else if (TypeLen == 9 && !memcmp(TypeStr, "protected", 9)) type = VisibilityAttr::ProtectedVisibility; else { - S.Diag(Attr.getLoc(), diag::warn_attribute_type_not_supported) - << "visibility" << TypeStr; + S.Diag(Attr.getLoc(), diag::warn_attribute_unknown_visibility) << TypeStr; return; } @@ -1142,8 +1141,7 @@ static void ProcessDeclAttribute(Decl *D, const AttributeList &Attr, Sema &S) { default: #if 0 // TODO: when we have the full set of attributes, warn about unknown ones. - S.Diag(Attr->getLoc(), diag::warn_attribute_ignored) - << Attr->getName()->getName(); + S.Diag(Attr->getLoc(), diag::warn_attribute_ignored) << Attr->getName(); #endif break; } diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index d65d6fff5e..a92ad9582e 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -75,7 +75,7 @@ namespace { // class member names. return S->Diag(DRE->getSourceRange().getBegin(), diag::err_param_default_argument_references_param) - << Param->getName() << DefaultArg->getSourceRange(); + << Param->getDeclName() << DefaultArg->getSourceRange(); } else if (VarDecl *VDecl = dyn_cast<VarDecl>(Decl)) { // C++ [dcl.fct.default]p7 // Local variables shall not be used in default argument @@ -83,7 +83,7 @@ namespace { if (VDecl->isBlockVarDecl()) return S->Diag(DRE->getSourceRange().getBegin(), diag::err_param_default_argument_references_local) - << VDecl->getName() << DefaultArg->getSourceRange(); + << VDecl->getDeclName() << DefaultArg->getSourceRange(); } return false; @@ -650,7 +650,7 @@ Sema::ActOnMemInitializer(DeclTy *ConstructorD, QualType BaseType = Context.getTypeDeclType((TypeDecl *)BaseTy); if (!BaseType->isRecordType()) return Diag(IdLoc, diag::err_base_init_does_not_name_class) - << BaseType.getAsString() << SourceRange(IdLoc, RParenLoc); + << BaseType << SourceRange(IdLoc, RParenLoc); // C++ [class.base.init]p2: // [...] Unless the mem-initializer-id names a nonstatic data @@ -1271,7 +1271,7 @@ Sema::DeclTy *Sema::ActOnStartNamespaceDef(Scope *NamespcScope, } else { // This is an invalid name redefinition. Diag(Namespc->getLocation(), diag::err_redefinition_different_kind) - << Namespc->getName(); + << Namespc->getDeclName(); Diag(PrevDecl->getLocation(), diag::err_previous_definition); Namespc->setInvalidDecl(); // Continue on to push Namespc as current DeclContext and return it. diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index bac483153c..49bfad7634 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -111,7 +111,7 @@ ActOnStartClassInterface(SourceLocation AtInterfaceLoc, << SuperName << ClassName << SourceRange(AtInterfaceLoc, ClassLoc); else if (SuperClassEntry->isForwardDecl()) Diag(SuperLoc, diag::err_undef_superclass) - << SuperClassEntry->getName() << ClassName + << SuperClassEntry->getDeclName() << ClassName << SourceRange(AtInterfaceLoc, ClassLoc); } IDecl->setSuperClass(SuperClassEntry); @@ -481,7 +481,7 @@ Sema::DeclTy *Sema::ActOnStartClassImplementation( // This implementation and its interface do not have the same // super class. Diag(SuperClassLoc, diag::err_conflicting_super_class) - << SDecl->getName(); + << SDecl->getDeclName(); Diag(SDecl->getLocation(), diag::err_previous_definition); } } @@ -553,17 +553,16 @@ void Sema::CheckImplementationIvars(ObjCImplementationDecl *ImpDecl, if (Context.getCanonicalType(ImplIvar->getType()) != Context.getCanonicalType(ClsIvar->getType())) { Diag(ImplIvar->getLocation(), diag::err_conflicting_ivar_type) - << ImplIvar->getIdentifier(); - Diag(ClsIvar->getLocation(), diag::err_previous_definition) - << ClsIvar->getIdentifier(); + << ImplIvar->getIdentifier() + << ImplIvar->getType() << ClsIvar->getType(); + Diag(ClsIvar->getLocation(), diag::err_previous_definition); } // TODO: Two mismatched (unequal width) Ivar bitfields should be diagnosed // as error. else if (ImplIvar->getIdentifier() != ClsIvar->getIdentifier()) { Diag(ImplIvar->getLocation(), diag::err_conflicting_ivar_name) - << ImplIvar->getIdentifier(); - Diag(ClsIvar->getLocation(), diag::err_previous_definition) - << ClsIvar->getIdentifier(); + << ImplIvar->getIdentifier() << ClsIvar->getIdentifier(); + Diag(ClsIvar->getLocation(), diag::err_previous_definition); return; } --numIvars; @@ -581,7 +580,7 @@ void Sema::WarnUndefinedMethod(SourceLocation ImpLoc, ObjCMethodDecl *method, Diag(ImpLoc, diag::warn_incomplete_impl); IncompleteImpl = true; } - Diag(ImpLoc, diag::warn_undef_method_impl) << method->getSelector().getName(); + Diag(ImpLoc, diag::warn_undef_method_impl) << method->getDeclName(); } /// FIXME: Type hierarchies in Objective-C can be deep. We could most diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index bebde38a18..fd726511fd 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -417,12 +417,12 @@ Sema::ExprResult Sema::ActOnDeclarationNameExpr(Scope *S, SourceLocation Loc, // diagnose the problem. if (SS && !SS->isEmpty()) return Diag(Loc, diag::err_typecheck_no_member) - << Name.getAsString() << SS->getRange(); + << Name << SS->getRange(); else if (Name.getNameKind() == DeclarationName::CXXOperatorName || Name.getNameKind() == DeclarationName::CXXConversionFunctionName) return Diag(Loc, diag::err_undeclared_use) << Name.getAsString(); else - return Diag(Loc, diag::err_undeclared_var_use) << Name.getAsString(); + return Diag(Loc, diag::err_undeclared_var_use) << Name; } } diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index d09279353b..f587dd6ae2 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -214,8 +214,7 @@ Sema::ExprResult Sema::ActOnClassMessage( return ActOnInstanceMessage(ReceiverExpr.Val, Sel, lbrac, rbrac, Args, NumArgs); } - return Diag(receiverLoc, diag::err_undeclared_var_use) - << receiverName->getName(); + return Diag(receiverLoc, diag::err_undeclared_var_use) << receiverName; } } else ClassDecl = getObjCInterfaceDecl(receiverName); diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index 15d955cb7b..204d161f56 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/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, |