summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/Preprocessor.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
commit16ba91396a16f4f0e66ac1db37423a78f7dd3221 (patch)
treec480c7ef5b2a274e4bbb717f7d915afbe69e13ab /clang/lib/Lex/Preprocessor.cpp
parent95d3d1094f03b6183bd9eacb36e2b1525a195644 (diff)
downloadbcm5719-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/Lex/Preprocessor.cpp')
-rw-r--r--clang/lib/Lex/Preprocessor.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index c65b5462098..dc4dd877b67 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -124,14 +124,16 @@ void Preprocessor::Diag(SourceLocation Loc, unsigned DiagID) {
void Preprocessor::Diag(SourceLocation Loc, unsigned DiagID,
const std::string &Msg) {
- Diags.Report(getFullLoc(Loc), DiagID, &Msg, 1);
+ const std::string *Strs[] = { &Msg };
+ Diags.Report(getFullLoc(Loc), DiagID, Strs, 1);
}
void Preprocessor::Diag(SourceLocation Loc, unsigned DiagID,
const std::string &Msg,
const SourceRange &R1, const SourceRange &R2) {
+ const std::string *Strs[] = { &Msg };
SourceRange R[] = {R1, R2};
- Diags.Report(getFullLoc(Loc), DiagID, &Msg, 1, R, 2);
+ Diags.Report(getFullLoc(Loc), DiagID, Strs, 1, R, 2);
}
OpenPOWER on IntegriCloud