Make SetMCJITOptimizationLevel more of a method and pass options
[oota-llvm.git] / bindings / go / llvm / InstrumentationBindings.cpp
1 //===- InstrumentationBindings.cpp - instrumentation bindings -------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines C bindings for the instrumentation component.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "InstrumentationBindings.h"
15
16 #include "llvm-c/Core.h"
17 #include "llvm/IR/Module.h"
18 #include "llvm/PassManager.h"
19 #include "llvm/Transforms/Instrumentation.h"
20
21 using namespace llvm;
22
23 void LLVMAddAddressSanitizerFunctionPass(LLVMPassManagerRef PM) {
24   unwrap(PM)->add(createAddressSanitizerFunctionPass());
25 }
26
27 void LLVMAddAddressSanitizerModulePass(LLVMPassManagerRef PM) {
28   unwrap(PM)->add(createAddressSanitizerModulePass());
29 }
30
31 void LLVMAddThreadSanitizerPass(LLVMPassManagerRef PM) {
32   unwrap(PM)->add(createThreadSanitizerPass());
33 }
34
35 void LLVMAddMemorySanitizerPass(LLVMPassManagerRef PM) {
36   unwrap(PM)->add(createMemorySanitizerPass());
37 }
38
39 void LLVMAddDataFlowSanitizerPass(LLVMPassManagerRef PM,
40                                   const char *ABIListFile) {
41   unwrap(PM)->add(createDataFlowSanitizerPass(ABIListFile));
42 }