[llvm-objdump] - Remove one overload of reportError. NFCI.
[llvm-complete.git] / bindings / go / llvm / transforms_instrumentation.go
blob68e0ed6967979f4d77217341481a6ab7fef4b33b
1 //===- transforms_instrumentation.go - Bindings for instrumentation -------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines bindings for the instrumentation component.
11 //===----------------------------------------------------------------------===//
13 package llvm
16 #include "InstrumentationBindings.h"
17 #include <stdlib.h>
19 import "C"
20 import "unsafe"
22 func (pm PassManager) AddAddressSanitizerFunctionPass() {
23 C.LLVMAddAddressSanitizerFunctionPass(pm.C)
26 func (pm PassManager) AddAddressSanitizerModulePass() {
27 C.LLVMAddAddressSanitizerModulePass(pm.C)
30 func (pm PassManager) AddThreadSanitizerPass() {
31 C.LLVMAddThreadSanitizerPass(pm.C)
34 func (pm PassManager) AddMemorySanitizerLegacyPassPass() {
35 C.LLVMAddMemorySanitizerLegacyPassPass(pm.C)
38 func (pm PassManager) AddDataFlowSanitizerPass(abilist []string) {
39 abiliststrs := make([]*C.char, len(abilist))
40 for i, arg := range abilist {
41 abiliststrs[i] = C.CString(arg)
42 defer C.free(unsafe.Pointer(abiliststrs[i]))
44 C.LLVMAddDataFlowSanitizerPass(pm.C, C.int(len(abilist)), &abiliststrs[0])