1 //===- transforms_instrumentation.go - Bindings for instrumentation -------===//
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
7 //===----------------------------------------------------------------------===//
9 // This file defines bindings for the instrumentation component.
11 //===----------------------------------------------------------------------===//
16 #include "InstrumentationBindings.h"
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])