From 2383b7f6aea2cb2bf2b5bfc0ec730f9354fecbbf Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 18 Nov 2008 04:56:44 +0000 Subject: 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 --- lib/Lex/Preprocessor.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/Lex/Preprocessor.cpp') diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index c65b546209..dc4dd877b6 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/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); } -- cgit v1.2.3