diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2015-02-04 17:39:48 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2015-02-04 17:39:48 +0000 |
commit | 282314741d9fbd51f99d57cd27ff9c2ae32729d7 (patch) | |
tree | 1be57987ec69749d9e86edccceeb5d7e4e00c817 /bindings | |
parent | 3d82dfa13bf7c88303eb0e0f7ec1f76017302dc3 (diff) |
SpecialCaseList: Add support for parsing multiple input files.
Summary:
This change allows users to create SpecialCaseList objects from
multiple local files. This is needed to implement a proper support
for -fsanitize-blacklist flag (allow users to specify multiple blacklists,
in addition to default blacklist, see PR22431).
DFSan can also benefit from this change, as DFSan instrumentation pass now
accepts ABI-lists both from -fsanitize-blacklist= and -mllvm -dfsan-abilist flags.
Go bindings are fixed accordingly.
Test Plan: regression test suite
Reviewers: pcc
Subscribers: llvm-commits, axw, kcc
Differential Revision: http://reviews.llvm.org/D7367
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228155 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings')
-rw-r--r-- | bindings/go/llvm/InstrumentationBindings.cpp | 9 | ||||
-rw-r--r-- | bindings/go/llvm/InstrumentationBindings.h | 4 | ||||
-rw-r--r-- | bindings/go/llvm/transforms_instrumentation.go | 11 |
3 files changed, 16 insertions, 8 deletions
diff --git a/bindings/go/llvm/InstrumentationBindings.cpp b/bindings/go/llvm/InstrumentationBindings.cpp index b604abb5c70..b7f29499060 100644 --- a/bindings/go/llvm/InstrumentationBindings.cpp +++ b/bindings/go/llvm/InstrumentationBindings.cpp @@ -37,6 +37,11 @@ void LLVMAddMemorySanitizerPass(LLVMPassManagerRef PM) { } void LLVMAddDataFlowSanitizerPass(LLVMPassManagerRef PM, - const char *ABIListFile) { - unwrap(PM)->add(createDataFlowSanitizerPass(ABIListFile)); + int ABIListFilesNum, + const char **ABIListFiles) { + std::vector<std::string> ABIListFilesVec; + for (int i = 0; i != ABIListFilesNum; ++i) { + ABIListFilesVec.push_back(ABIListFiles[i]); + } + unwrap(PM)->add(createDataFlowSanitizerPass(ABIListFilesVec)); } diff --git a/bindings/go/llvm/InstrumentationBindings.h b/bindings/go/llvm/InstrumentationBindings.h index e8dbd59e431..97af2d58c27 100644 --- a/bindings/go/llvm/InstrumentationBindings.h +++ b/bindings/go/llvm/InstrumentationBindings.h @@ -28,8 +28,8 @@ void LLVMAddAddressSanitizerFunctionPass(LLVMPassManagerRef PM); void LLVMAddAddressSanitizerModulePass(LLVMPassManagerRef PM); void LLVMAddThreadSanitizerPass(LLVMPassManagerRef PM); void LLVMAddMemorySanitizerPass(LLVMPassManagerRef PM); -void LLVMAddDataFlowSanitizerPass(LLVMPassManagerRef PM, - const char *ABIListFile); +void LLVMAddDataFlowSanitizerPass(LLVMPassManagerRef PM, int ABIListFilesNum, + const char **ABIListFiles); #ifdef __cplusplus } diff --git a/bindings/go/llvm/transforms_instrumentation.go b/bindings/go/llvm/transforms_instrumentation.go index 9b191b26693..73e2732cbd9 100644 --- a/bindings/go/llvm/transforms_instrumentation.go +++ b/bindings/go/llvm/transforms_instrumentation.go @@ -36,8 +36,11 @@ func (pm PassManager) AddMemorySanitizerPass() { C.LLVMAddMemorySanitizerPass(pm.C) } -func (pm PassManager) AddDataFlowSanitizerPass(abilist string) { - cabilist := C.CString(abilist) - defer C.free(unsafe.Pointer(cabilist)) - C.LLVMAddDataFlowSanitizerPass(pm.C, cabilist) +func (pm PassManager) AddDataFlowSanitizerPass(abilist []string) { + abiliststrs := make([]*C.char, len(abilist)) + for i, arg := range abilist { + abiliststrs[i] = C.CString(arg) + defer C.free(unsafe.Pointer(abiliststrs[i])) + } + C.LLVMAddDataFlowSanitizerPass(pm.C, C.int(len(abilist)), &abiliststrs[0]) } |