[cfe-commits] r59497 - /cfe/trunk/lib/Analysis/BugReporter.cpp
Chris Lattner
sabre at nondot.org
Mon Nov 17 22:07:40 PST 2008
Author: lattner
Date: Tue Nov 18 00:07:40 2008
New Revision: 59497
URL: http://llvm.org/viewvc/llvm-project?rev=59497&view=rev
Log:
eliminate dependence of strange "Diagnostic::Report" method,
delete huge trailing whitespace to fit in 80 cols.
Modified:
cfe/trunk/lib/Analysis/BugReporter.cpp
Modified: cfe/trunk/lib/Analysis/BugReporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/BugReporter.cpp?rev=59497&r1=59496&r2=59497&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/BugReporter.cpp (original)
+++ cfe/trunk/lib/Analysis/BugReporter.cpp Tue Nov 18 00:07:40 2008
@@ -576,9 +576,7 @@
// 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 @@
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);
More information about the cfe-commits
mailing list