aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-18 04:56:44 +0000
committerChris Lattner <sabre@nondot.org>2008-11-18 04:56:44 +0000
commit2383b7f6aea2cb2bf2b5bfc0ec730f9354fecbbf (patch)
tree13bdae5f244e4365dc659a6d5c94e84e910b626f /lib/CodeGen/CodeGenModule.cpp
parentc5c8d7d57dbfb2ecb7c7db51711e3b198e379d6a (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59494 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index a101e389b2..d7d732997b 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/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