aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-05-26 22:28:53 +0000
committerDan Gohman <gohman@apple.com>2010-05-26 22:28:53 +0000
commit52d52e021e741477f800f8c49ba5213667d1d6dd (patch)
tree090735b51ca45075a15791563b2ee1b810ead6cf
parent6426855e9b0dae6241a0c564eafc841ca18f7aa5 (diff)
downloadexternal_llvm-52d52e021e741477f800f8c49ba5213667d1d6dd.zip
external_llvm-52d52e021e741477f800f8c49ba5213667d1d6dd.tar.gz
external_llvm-52d52e021e741477f800f8c49ba5213667d1d6dd.tar.bz2
Fix Lint printing warnings multiple times. Remove the ErrorStr
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
-rw-r--r--include/llvm/Analysis/Lint.h3
-rw-r--r--lib/Analysis/Lint.cpp7
2 files changed, 3 insertions, 7 deletions
diff --git a/include/llvm/Analysis/Lint.h b/include/llvm/Analysis/Lint.h
index 2f01366..eb65d22 100644
--- a/include/llvm/Analysis/Lint.h
+++ b/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/lib/Analysis/Lint.cpp b/lib/Analysis/Lint.cpp
index 1fae14f..a031cbc 100644
--- a/lib/Analysis/Lint.cpp
+++ b/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();
}