summaryrefslogtreecommitdiff
path: root/lib/Analysis/ProfileInfoLoaderPass.cpp
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2012-12-24 18:15:21 +0000
committerBob Wilson <bob.wilson@apple.com>2012-12-24 18:15:21 +0000
commita0be09f511c68a88ee95b73c8f0ebd78156a559e (patch)
tree678964cde398eea6351973aba975ccec327aad3b /lib/Analysis/ProfileInfoLoaderPass.cpp
parentfa45cdf646572cf11b03cfdaa63f75fd74fc7d34 (diff)
downloadllvm-a0be09f511c68a88ee95b73c8f0ebd78156a559e.tar.gz
llvm-a0be09f511c68a88ee95b73c8f0ebd78156a559e.tar.bz2
llvm-a0be09f511c68a88ee95b73c8f0ebd78156a559e.tar.xz
Add LLVMContext::emitWarning methods and use them. <rdar://problem/12867368>
When the backend is used from clang, it should produce proper diagnostics instead of just printing messages to errs(). Other clients may also want to register their own error handlers with the LLVMContext, and the same handler should work for warnings in the same way as the existing emitError methods. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171041 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ProfileInfoLoaderPass.cpp')
-rw-r--r--lib/Analysis/ProfileInfoLoaderPass.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/Analysis/ProfileInfoLoaderPass.cpp b/lib/Analysis/ProfileInfoLoaderPass.cpp
index 2f3486cb44..8e6d1c2ecb 100644
--- a/lib/Analysis/ProfileInfoLoaderPass.cpp
+++ b/lib/Analysis/ProfileInfoLoaderPass.cpp
@@ -19,6 +19,7 @@
#include "llvm/Analysis/ProfileInfoLoader.h"
#include "llvm/BasicBlock.h"
#include "llvm/InstrTypes.h"
+#include "llvm/LLVMContext.h"
#include "llvm/Module.h"
#include "llvm/Pass.h"
#include "llvm/Support/CFG.h"
@@ -170,8 +171,8 @@ bool LoaderPass::runOnModule(Module &M) {
}
}
if (ReadCount != Counters.size()) {
- errs() << "WARNING: profile information is inconsistent with "
- << "the current program!\n";
+ M.getContext().emitWarning("profile information is inconsistent "
+ "with the current program");
}
NumEdgesRead = ReadCount;
}
@@ -218,8 +219,8 @@ bool LoaderPass::runOnModule(Module &M) {
}
}
if (ReadCount != Counters.size()) {
- errs() << "WARNING: profile information is inconsistent with "
- << "the current program!\n";
+ M.getContext().emitWarning("profile information is inconsistent "
+ "with the current program");
}
NumEdgesRead = ReadCount;
}
@@ -239,8 +240,8 @@ bool LoaderPass::runOnModule(Module &M) {
BlockInformation[F][BB] = (double)Counters[ReadCount++];
}
if (ReadCount != Counters.size()) {
- errs() << "WARNING: profile information is inconsistent with "
- << "the current program!\n";
+ M.getContext().emitWarning("profile information is inconsistent "
+ "with the current program");
}
}
@@ -258,8 +259,8 @@ bool LoaderPass::runOnModule(Module &M) {
FunctionInformation[F] = (double)Counters[ReadCount++];
}
if (ReadCount != Counters.size()) {
- errs() << "WARNING: profile information is inconsistent with "
- << "the current program!\n";
+ M.getContext().emitWarning("profile information is inconsistent "
+ "with the current program");
}
}