summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-19 05:34:22 +0000
committerChris Lattner <sabre@nondot.org>2008-11-19 05:34:22 +0000
commit5d78c9ab5d24960154445b71bd6e864aac556159 (patch)
treef17639a48d5942fd29a4dac92e5563cb3851f682
parentf490e15729331cd99dcc470754a3ce2fa534415c (diff)
downloadbcm5719-llvm-5d78c9ab5d24960154445b71bd6e864aac556159.tar.gz
bcm5719-llvm-5d78c9ab5d24960154445b71bd6e864aac556159.zip
Address Sebastian and Doug's objections with taking pointers to temporaries.
Instead of doing that, copy the strings into the diagnostic info. llvm-svn: 59590
-rw-r--r--clang/include/clang/Basic/Diagnostic.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/include/clang/Basic/Diagnostic.h b/clang/include/clang/Basic/Diagnostic.h
index 3edf990d24e..ca7c100ee92 100644
--- a/clang/include/clang/Basic/Diagnostic.h
+++ b/clang/include/clang/Basic/Diagnostic.h
@@ -180,7 +180,7 @@ private:
/// DiagArguments - The values for the various substitution positions. It
/// currently only support 10 arguments (%0-%9).
- const std::string *DiagArguments[10];
+ std::string DiagArguments[10];
/// DiagRanges - The list of ranges added to this diagnostic. It currently
/// only support 10 ranges, could easily be extended if needed.
const SourceRange *DiagRanges[10];
@@ -255,7 +255,7 @@ public:
const std::string &getArgStr(unsigned Idx) const {
assert((signed char)Idx < DiagObj->NumDiagArgs &&
"Argument out of range!");
- return *DiagObj->DiagArguments[Idx];
+ return DiagObj->DiagArguments[Idx];
}
/// getNumRanges - Return the number of source ranges associated with this
@@ -273,7 +273,7 @@ public:
assert((unsigned)DiagObj->NumDiagArgs <
sizeof(DiagObj->DiagArguments)/sizeof(DiagObj->DiagArguments[0]) &&
"Too many arguments to diagnostic!");
- DiagObj->DiagArguments[DiagObj->NumDiagArgs++] = &S;
+ DiagObj->DiagArguments[DiagObj->NumDiagArgs++] = S;
return *this;
}
OpenPOWER on IntegriCloud