Switch several more Sema Diag methods over. This simplifies the
__builtin_prefetch code to only emit one diagnostic per builtin_prefetch.
While this has nothing to do with the rest of the patch, the code seemed
like overkill when I was updating it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59588 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp
index e7ccdda..70231ec 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -105,13 +105,13 @@
/// a context where the result is unused. Emit a diagnostic to warn about
/// this.
if (const BinaryOperator *BO = dyn_cast<BinaryOperator>(E))
- Diag(BO->getOperatorLoc(), diag::warn_unused_expr,
- BO->getLHS()->getSourceRange(), BO->getRHS()->getSourceRange());
+ Diag(BO->getOperatorLoc(), diag::warn_unused_expr)
+ << BO->getLHS()->getSourceRange() << BO->getRHS()->getSourceRange();
else if (const UnaryOperator *UO = dyn_cast<UnaryOperator>(E))
- Diag(UO->getOperatorLoc(), diag::warn_unused_expr,
- UO->getSubExpr()->getSourceRange());
+ Diag(UO->getOperatorLoc(), diag::warn_unused_expr)
+ << UO->getSubExpr()->getSourceRange();
else
- Diag(E->getExprLoc(), diag::warn_unused_expr, E->getSourceRange());
+ Diag(E->getExprLoc(), diag::warn_unused_expr) << E->getSourceRange();
}
return new CompoundStmt(Elts, NumElts, L, R);
@@ -869,9 +869,9 @@
// FIXME: We currently leak memory here.
return Diag(InputExpr->getSubExpr()->getLocStart(),
- diag::err_asm_invalid_type_in_input,
- InputExpr->getType().getAsString(), InputConstraint,
- InputExpr->getSubExpr()->getSourceRange());
+ diag::err_asm_invalid_type_in_input)
+ << InputExpr->getType().getAsString() << InputConstraint
+ << InputExpr->getSubExpr()->getSourceRange();
}
}