aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/BugReporter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-18 06:07:40 +0000
committerChris Lattner <sabre@nondot.org>2008-11-18 06:07:40 +0000
commit470e5fc7b4e03105950ad62cf7582b14ca939ec4 (patch)
tree275ecc167e48c364fd22b581a51afab25bee7fbf /lib/Analysis/BugReporter.cpp
parent5917fe1189ee7cbb6f61b804b1f1ab6ef16a94cb (diff)
eliminate dependence of strange "Diagnostic::Report" method,
delete huge trailing whitespace to fit in 80 cols. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59497 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/BugReporter.cpp')
-rw-r--r--lib/Analysis/BugReporter.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Analysis/BugReporter.cpp b/lib/Analysis/BugReporter.cpp
index 0663ddde41..bf99e6ba63 100644
--- a/lib/Analysis/BugReporter.cpp
+++ b/lib/Analysis/BugReporter.cpp
@@ -576,9 +576,7 @@ void GRBugReporter::GeneratePathDiagnostic(PathDiagnostic& PD,
// FIXME: Maybe this should be an assertion. Are there cases
// were it is not an EnumConstantDecl?
-
- EnumConstantDecl* D = dyn_cast<EnumConstantDecl>(DR->getDecl());
-
+ EnumConstantDecl* D = dyn_cast<EnumConstantDecl>(DR->getDecl());
if (D) {
GetRawInt = false;
os << D->getName();
@@ -806,9 +804,13 @@ void BugReporter::EmitBasicReport(const char* name, const char* category,
SimpleBugType BT(name, category, 0);
DiagCollector C(BT);
Diagnostic& Diag = getDiagnostic();
- Diag.Report(&C, getContext().getFullLoc(Loc),
+
+ DiagnosticClient *OldClient = Diag.getClient();
+ Diag.setClient(&C);
+ Diag.Report(getContext().getFullLoc(Loc),
Diag.getCustomDiagID(Diagnostic::Warning, str),
0, 0, RBeg, NumRanges);
+ Diag.setClient(OldClient);
for (DiagCollector::iterator I = C.begin(), E = C.end(); I != E; ++I)
EmitWarning(*I);