diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-20 06:38:18 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-20 06:38:18 +0000 |
commit | f3a41af4d5c98a72a1d6720bbbfd658e57ef2541 (patch) | |
tree | 5823148d0d979d990d06938aa79f08c342d02ca8 /lib/Sema/SemaStmt.cpp | |
parent | 5dc266abe0e8de69788ba67e38047a919f4bc383 (diff) |
remove the last old-fashioned Diag method. Transition complete!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59714 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaStmt.cpp')
-rw-r--r-- | lib/Sema/SemaStmt.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index 10ca53f86b..17495a837a 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -182,7 +182,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->getName(); Diag(LabelDecl->getIdentLoc(), diag::err_previous_definition); return SubStmt; } @@ -572,8 +572,9 @@ Sema::ActOnForStmt(SourceLocation ForLoc, SourceLocation LParenLoc, if (!getLangOptions().CPlusPlus) { if (DeclStmt *DS = dyn_cast_or_null<DeclStmt>(First)) { - // C99 6.8.5p3: The declaration part of a 'for' statement shall only declare - // identifiers for objects having storage class 'auto' or 'register'. + // C99 6.8.5p3: The declaration part of a 'for' statement shall only + // declare identifiers for objects having storage class 'auto' or + // 'register'. for (DeclStmt::decl_iterator DI=DS->decl_begin(), DE=DS->decl_end(); DI!=DE; ++DI) { VarDecl *VD = dyn_cast<VarDecl>(*DI); @@ -616,8 +617,9 @@ Sema::ActOnObjCForCollectionStmt(SourceLocation ForLoc, ScopedDecl *D = DS->getSolitaryDecl(); FirstType = cast<ValueDecl>(D)->getType(); - // C99 6.8.5p3: The declaration part of a 'for' statement shall only declare - // identifiers for objects having storage class 'auto' or 'register'. + // C99 6.8.5p3: The declaration part of a 'for' statement shall only + // declare identifiers for objects having storage class 'auto' or + // 'register'. VarDecl *VD = cast<VarDecl>(D); if (VD->isBlockVarDecl() && !VD->hasLocalStorage()) return Diag(VD->getLocation(), diag::err_non_variable_decl_in_for); @@ -836,7 +838,7 @@ Sema::StmtResult Sema::ActOnAsmStmt(SourceLocation AsmLoc, if (!Context.Target.validateOutputConstraint(OutputConstraint.c_str(),info)) // FIXME: We currently leak memory here. return Diag(Literal->getLocStart(), - diag::err_asm_invalid_output_constraint, OutputConstraint); + diag::err_asm_invalid_output_constraint) << OutputConstraint; // Check that the output exprs are valid lvalues. ParenExpr *OutputExpr = cast<ParenExpr>(Exprs[i]); @@ -894,7 +896,7 @@ Sema::StmtResult Sema::ActOnAsmStmt(SourceLocation AsmLoc, if (!Context.Target.isValidGCCRegisterName(Clobber.c_str())) // FIXME: We currently leak memory here. return Diag(Literal->getLocStart(), - diag::err_asm_unknown_register_name, Clobber.c_str()); + diag::err_asm_unknown_register_name) << Clobber.c_str(); } return new AsmStmt(AsmLoc, IsSimple, IsVolatile, NumOutputs, NumInputs, |