diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-18 04:56:44 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-18 04:56:44 +0000 |
commit | 16ba91396a16f4f0e66ac1db37423a78f7dd3221 (patch) | |
tree | c480c7ef5b2a274e4bbb717f7d915afbe69e13ab /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 95d3d1094f03b6183bd9eacb36e2b1525a195644 (diff) | |
download | bcm5719-llvm-16ba91396a16f4f0e66ac1db37423a78f7dd3221.tar.gz bcm5719-llvm-16ba91396a16f4f0e66ac1db37423a78f7dd3221.zip |
Change the diagnostics interface to take an array of pointers to
strings instead of array of strings. This reduces string copying
in some not-very-important cases, but paves the way for future
improvements.
llvm-svn: 59494
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index a101e389b28..d7d732997b6 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -108,8 +108,9 @@ void CodeGenModule::ErrorUnsupported(const Stmt *S, const char *Type, "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, - &Msg, 1, &Range, 1); + Strs, 1, &Range, 1); } /// ErrorUnsupported - Print out an error that codegen doesn't support the @@ -121,8 +122,8 @@ void CodeGenModule::ErrorUnsupported(const Decl *D, const char *Type, unsigned DiagID = getDiags().getCustomDiagID(Diagnostic::Error, "cannot codegen this %0 yet"); std::string Msg = Type; - getDiags().Report(Context.getFullLoc(D->getLocation()), DiagID, - &Msg, 1); + const std::string *Strs[] = { &Msg }; + getDiags().Report(Context.getFullLoc(D->getLocation()), DiagID, Strs, 1); } /// setGlobalVisibility - Set the visibility for the given LLVM |