diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-19 06:04:55 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-19 06:04:55 +0000 |
commit | 73d2a1b05bb04ab0136af374ddaa5d4602d4c939 (patch) | |
tree | f6790feb7751573760004a62ed847e8c1d134687 /include/clang/Analysis/PathSensitive/BugReporter.h | |
parent | d064191a2d2932129b636aab66da12ff4e281840 (diff) |
implement a transparent optimization with the diagnostics stuff:
const char*'s are now not converted to std::strings when the diagnostic
is formed, we just hold onto their pointer and format as needed.
This commit makes DiagnosticClient::FormatDiagnostic even more of a
mess, I'll fix it in the next commit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59593 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Analysis/PathSensitive/BugReporter.h')
-rw-r--r-- | include/clang/Analysis/PathSensitive/BugReporter.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/clang/Analysis/PathSensitive/BugReporter.h b/include/clang/Analysis/PathSensitive/BugReporter.h index 98731e1745..72f83bee34 100644 --- a/include/clang/Analysis/PathSensitive/BugReporter.h +++ b/include/clang/Analysis/PathSensitive/BugReporter.h @@ -315,8 +315,16 @@ public: for (unsigned i = 0, e = Info.getNumRanges(); i != e; ++i) R.addRange(Info.getRange(i)); - for (unsigned i = 0, e = Info.getNumArgs(); i != e; ++i) - R.addString(Info.getArgStr(i)); + for (unsigned i = 0, e = Info.getNumArgs(); i != e; ++i) { + switch (Info.getArgKind(i)) { + case DiagnosticInfo::ak_std_string: + R.addString(Info.getArgStdStr(i)); + break; + case DiagnosticInfo::ak_c_string: + R.addString(Info.getArgCStr(i)); + break; + } + } } // Iterators. |