Added method "EmitBasicReport" to BugReporter to simplify the emission of simple bug diagnostics.
Refactored error reporting in CheckObjCDealloc and CheckObjCInstMethSignature to use this new bug reporting interface (major code simplification).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53560 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/CheckObjCInstMethSignature.cpp b/lib/Analysis/CheckObjCInstMethSignature.cpp
index f5966ec..ffaef42 100644
--- a/lib/Analysis/CheckObjCInstMethSignature.cpp
+++ b/lib/Analysis/CheckObjCInstMethSignature.cpp
@@ -64,16 +64,8 @@
<< "'. These two types are incompatible, and may result in undefined "
"behavior for clients of these classes.";
- // Refactor.
- SimpleBugType BT("incompatible instance method return type");
- DiagCollector C(BT);
- Diagnostic& Diag = BR.getDiagnostic();
- Diag.Report(&C, Ctx.getFullLoc(MethDerived->getLocStart()),
- Diag.getCustomDiagID(Diagnostic::Warning, os.str().c_str()),
- NULL, 0, NULL, 0);
-
- for (DiagCollector::iterator I = C.begin(), E = C.end(); I != E; ++I)
- BR.EmitWarning(*I);
+ BR.EmitBasicReport("incompatible instance method return type",
+ os.str().c_str(), MethDerived->getLocStart());
}
}