summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGObjC.cpp5
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp9
2 files changed, 5 insertions, 9 deletions
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp
index 058278cfa4e..044368c6998 100644
--- a/clang/lib/CodeGen/CGObjC.cpp
+++ b/clang/lib/CodeGen/CGObjC.cpp
@@ -303,10 +303,9 @@ void CodeGenFunction::EmitObjCPropertySet(const ObjCPropertyRefExpr *E,
S = Setter->getSelector();
} else {
// FIXME: This should be diagnosed by sema.
- SourceRange Range = E->getSourceRange();
CGM.getDiags().Report(getContext().getFullLoc(E->getLocStart()),
- diag::err_typecheck_assign_const, 0, 0,
- &Range, 1);
+ diag::err_typecheck_assign_const)
+ << E->getSourceRange();
return;
}
} else {
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index d7d732997b6..3e146215f48 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -106,11 +106,9 @@ void CodeGenModule::ErrorUnsupported(const Stmt *S, const char *Type,
return;
unsigned DiagID = getDiags().getCustomDiagID(Diagnostic::Error,
"cannot codegen this %0 yet");
- SourceRange Range = S->getSourceRange();
std::string Msg = Type;
- const std::string *Strs[] = { &Msg };
- getDiags().Report(Context.getFullLoc(S->getLocStart()), DiagID,
- Strs, 1, &Range, 1);
+ getDiags().Report(Context.getFullLoc(S->getLocStart()), DiagID)
+ << Msg << S->getSourceRange();
}
/// ErrorUnsupported - Print out an error that codegen doesn't support the
@@ -122,8 +120,7 @@ void CodeGenModule::ErrorUnsupported(const Decl *D, const char *Type,
unsigned DiagID = getDiags().getCustomDiagID(Diagnostic::Error,
"cannot codegen this %0 yet");
std::string Msg = Type;
- const std::string *Strs[] = { &Msg };
- getDiags().Report(Context.getFullLoc(D->getLocation()), DiagID, Strs, 1);
+ getDiags().Report(Context.getFullLoc(D->getLocation()), DiagID) << Msg;
}
/// setGlobalVisibility - Set the visibility for the given LLVM
OpenPOWER on IntegriCloud