Fix Lint printing warnings multiple times. Remove the ErrorStr
authorDan Gohman <gohman@apple.com>
Wed, 26 May 2010 22:28:53 +0000 (22:28 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 26 May 2010 22:28:53 +0000 (22:28 +0000)
option from lintModule, which was an artifact from being
based on Verifier code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104765 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/Lint.h
lib/Analysis/Lint.cpp

index 2f0136608d3c8752efc396887deadb1d40750e5a..eb65d223644133017db86f350eb78d59b77bb42a 100644 (file)
@@ -38,8 +38,7 @@ FunctionPass *createLintPass();
 /// This should only be used for debugging, because it plays games with
 /// PassManagers and stuff.
 void lintModule(
-  const Module &M,  ///< The module to be checked
-  std::string *ErrorInfo = 0      ///< Information about failures.
+  const Module &M    ///< The module to be checked
 );
 
 // lintFunction - Check a function.
index 1fae14f801191027a93deb68268573892e57e93b..a031cbc65b5bb6c3af3dac8f30548c37191ef1d5 100644 (file)
@@ -179,6 +179,7 @@ bool Lint::runOnFunction(Function &F) {
   TD = getAnalysisIfAvailable<TargetData>();
   visit(F);
   dbgs() << MessagesStr.str();
+  Messages.clear();
   return false;
 }
 
@@ -492,14 +493,10 @@ void llvm::lintFunction(const Function &f) {
 }
 
 /// lintModule - Check a module for errors, printing messages on stderr.
-/// Return true if the module is corrupt.
 ///
-void llvm::lintModule(const Module &M, std::string *ErrorInfo) {
+void llvm::lintModule(const Module &M) {
   PassManager PM;
   Lint *V = new Lint();
   PM.add(V);
   PM.run(const_cast<Module&>(M));
-
-  if (ErrorInfo)
-    *ErrorInfo = V->MessagesStr.str();
 }