1 //===- transforms_instrumentation.go - Bindings for instrumentation -------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines bindings for the instrumentation component.
12 //===----------------------------------------------------------------------===//
17 #include "InstrumentationBindings.h"
23 func (pm PassManager) AddAddressSanitizerFunctionPass() {
24 C.LLVMAddAddressSanitizerFunctionPass(pm.C)
27 func (pm PassManager) AddAddressSanitizerModulePass() {
28 C.LLVMAddAddressSanitizerModulePass(pm.C)
31 func (pm PassManager) AddThreadSanitizerPass() {
32 C.LLVMAddThreadSanitizerPass(pm.C)
35 func (pm PassManager) AddMemorySanitizerPass() {
36 C.LLVMAddMemorySanitizerPass(pm.C)
39 func (pm PassManager) AddDataFlowSanitizerPass(abilist []string) {
40 abiliststrs := make([]*C.char, len(abilist))
41 for i, arg := range abilist {
42 abiliststrs[i] = C.CString(arg)
43 defer C.free(unsafe.Pointer(abiliststrs[i]))
45 C.LLVMAddDataFlowSanitizerPass(pm.C, C.int(len(abilist)), &abiliststrs[0])