mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-02 23:29:41 +00:00
Move checkInterfaceFunction
to ModuleUtils
Summary: Instead of making a local copy of `checkInterfaceFunction` for each sanitizer, move the function in a common place. Reviewers: kcc, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8775 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234220 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include "llvm/IR/Function.h"
|
||||
#include "llvm/IR/IRBuilder.h"
|
||||
#include "llvm/IR/Module.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
@@ -93,3 +94,13 @@ llvm::collectUsedGlobalVariables(Module &M, SmallPtrSetImpl<GlobalValue *> &Set,
|
||||
}
|
||||
return GV;
|
||||
}
|
||||
|
||||
Function *llvm::checkSanitizerInterfaceFunction(Constant *FuncOrBitcast) {
|
||||
if (isa<Function>(FuncOrBitcast))
|
||||
return cast<Function>(FuncOrBitcast);
|
||||
FuncOrBitcast->dump();
|
||||
std::string Err;
|
||||
raw_string_ostream Stream(Err);
|
||||
Stream << "Sanitizer interface function redefined: " << *FuncOrBitcast;
|
||||
report_fatal_error(Err);
|
||||
}
|
||||
|
Reference in New Issue
Block a user