mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 08:17:40 +00:00
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
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "llvm/Analysis/ProfileInfo.h"
|
||||
#include "llvm/Analysis/ProfileInfoLoader.h"
|
||||
#include "llvm/Constants.h"
|
||||
#include "llvm/LLVMContext.h"
|
||||
#include "llvm/Module.h"
|
||||
#include "llvm/Pass.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
@@ -75,8 +76,8 @@ inline static void printEdgeCounter(ProfileInfo::Edge e,
|
||||
bool OptimalEdgeProfiler::runOnModule(Module &M) {
|
||||
Function *Main = M.getFunction("main");
|
||||
if (Main == 0) {
|
||||
errs() << "WARNING: cannot insert edge profiling into a module"
|
||||
<< " with no main function!\n";
|
||||
M.getContext().emitWarning("cannot insert edge profiling into a module"
|
||||
" with no main function");
|
||||
return false; // No main, no instrumentation!
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user