diff options
| author | Dan Gohman <gohman@apple.com> | 2010-05-26 22:28:53 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-05-26 22:28:53 +0000 |
| commit | 084bcb1322e5e8f5e71bd2e8eab1ae541e9aeaff (patch) | |
| tree | 0ca88266ab4984fa8e0a717a20c34b0b56b46b6e | |
| parent | c0b69020cd4401b357d77af974dbb018dd87d5ab (diff) | |
| download | bcm5719-llvm-084bcb1322e5e8f5e71bd2e8eab1ae541e9aeaff.tar.gz bcm5719-llvm-084bcb1322e5e8f5e71bd2e8eab1ae541e9aeaff.zip | |
Fix Lint printing warnings multiple times. Remove the ErrorStr
option from lintModule, which was an artifact from being
based on Verifier code.
llvm-svn: 104765
| -rw-r--r-- | llvm/include/llvm/Analysis/Lint.h | 3 | ||||
| -rw-r--r-- | llvm/lib/Analysis/Lint.cpp | 7 |
2 files changed, 3 insertions, 7 deletions
diff --git a/llvm/include/llvm/Analysis/Lint.h b/llvm/include/llvm/Analysis/Lint.h index 2f0136608d3..eb65d223644 100644 --- a/llvm/include/llvm/Analysis/Lint.h +++ b/llvm/include/llvm/Analysis/Lint.h @@ -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. diff --git a/llvm/lib/Analysis/Lint.cpp b/llvm/lib/Analysis/Lint.cpp index 1fae14f8011..a031cbc65b5 100644 --- a/llvm/lib/Analysis/Lint.cpp +++ b/llvm/lib/Analysis/Lint.cpp @@ -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(); } |

