diff --git a/clang/docs/tools/clang-formatted-files.txt b/clang/docs/tools/clang-formatted-files.txt --- a/clang/docs/tools/clang-formatted-files.txt +++ b/clang/docs/tools/clang-formatted-files.txt @@ -4935,7 +4935,6 @@ lldb/utils/TableGen/LLDBTableGenBackends.h lldb/utils/TableGen/LLDBTableGenUtils.cpp lldb/utils/TableGen/LLDBTableGenUtils.h -llvm/bindings/go/llvm/InstrumentationBindings.h llvm/bindings/go/llvm/SupportBindings.cpp llvm/bindings/go/llvm/SupportBindings.h llvm/bindings/ocaml/llvm/llvm_ocaml.h diff --git a/llvm/bindings/go/llvm/InstrumentationBindings.h b/llvm/bindings/go/llvm/InstrumentationBindings.h deleted file mode 100644 --- a/llvm/bindings/go/llvm/InstrumentationBindings.h +++ /dev/null @@ -1,33 +0,0 @@ -//===- InstrumentationBindings.h - instrumentation bindings -----*- C++ -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// This file defines C bindings for the Transforms/Instrumentation component. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_BINDINGS_GO_LLVM_INSTRUMENTATIONBINDINGS_H -#define LLVM_BINDINGS_GO_LLVM_INSTRUMENTATIONBINDINGS_H - -#include "llvm-c/Core.h" - -#ifdef __cplusplus -extern "C" { -#endif - -// FIXME: These bindings shouldn't be Go-specific and should eventually move to -// a (somewhat) less stable collection of C APIs for use in creating bindings of -// LLVM in other languages. - -void LLVMAddDataFlowSanitizerPass(LLVMPassManagerRef PM, int ABIListFilesNum, - const char **ABIListFiles); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/llvm/bindings/go/llvm/InstrumentationBindings.cpp b/llvm/bindings/go/llvm/InstrumentationBindings.cpp deleted file mode 100644 --- a/llvm/bindings/go/llvm/InstrumentationBindings.cpp +++ /dev/null @@ -1,30 +0,0 @@ -//===- InstrumentationBindings.cpp - instrumentation bindings -------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// This file defines C bindings for the instrumentation component. -// -//===----------------------------------------------------------------------===// - -#include "InstrumentationBindings.h" -#include "llvm-c/Core.h" -#include "llvm/IR/LegacyPassManager.h" -#include "llvm/IR/Module.h" -#include "llvm/Pass.h" -#include "llvm/Transforms/Instrumentation.h" - -using namespace llvm; - -void LLVMAddDataFlowSanitizerPass(LLVMPassManagerRef PM, - int ABIListFilesNum, - const char **ABIListFiles) { - std::vector ABIListFilesVec; - for (int i = 0; i != ABIListFilesNum; ++i) { - ABIListFilesVec.push_back(ABIListFiles[i]); - } - unwrap(PM)->add(createDataFlowSanitizerLegacyPassPass(ABIListFilesVec)); -} diff --git a/llvm/bindings/go/llvm/transforms_instrumentation.go b/llvm/bindings/go/llvm/transforms_instrumentation.go deleted file mode 100644 --- a/llvm/bindings/go/llvm/transforms_instrumentation.go +++ /dev/null @@ -1,29 +0,0 @@ -//===- transforms_instrumentation.go - Bindings for instrumentation -------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// This file defines bindings for the instrumentation component. -// -//===----------------------------------------------------------------------===// - -package llvm - -/* -#include "InstrumentationBindings.h" -#include -*/ -import "C" -import "unsafe" - -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]) -} diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h --- a/llvm/include/llvm/InitializePasses.h +++ b/llvm/include/llvm/InitializePasses.h @@ -123,7 +123,6 @@ void initializeDCELegacyPassPass(PassRegistry&); void initializeDFAJumpThreadingLegacyPassPass(PassRegistry &); void initializeDSELegacyPassPass(PassRegistry&); -void initializeDataFlowSanitizerLegacyPassPass(PassRegistry &); void initializeDeadMachineInstructionElimPass(PassRegistry&); void initializeDebugifyMachineModulePass(PassRegistry &); void initializeDelinearizationPass(PassRegistry&); diff --git a/llvm/include/llvm/Transforms/Instrumentation.h b/llvm/include/llvm/Transforms/Instrumentation.h --- a/llvm/include/llvm/Transforms/Instrumentation.h +++ b/llvm/include/llvm/Transforms/Instrumentation.h @@ -129,10 +129,6 @@ ModulePass *createInstrOrderFilePass(); -// Insert DataFlowSanitizer (dynamic data flow analysis) instrumentation -ModulePass *createDataFlowSanitizerLegacyPassPass( - const std::vector &ABIListFiles = std::vector()); - // Options for sanitizer coverage instrumentation. struct SanitizerCoverageOptions { enum Type { diff --git a/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp --- a/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp @@ -3104,34 +3104,6 @@ DFSF.PHIFixups.push_back({&PN, ShadowPN, OriginPN}); } -namespace { -class DataFlowSanitizerLegacyPass : public ModulePass { -private: - std::vector ABIListFiles; - -public: - static char ID; - - DataFlowSanitizerLegacyPass( - const std::vector &ABIListFiles = std::vector()) - : ModulePass(ID), ABIListFiles(ABIListFiles) {} - - bool runOnModule(Module &M) override { - return DataFlowSanitizer(ABIListFiles).runImpl(M); - } -}; -} // namespace - -char DataFlowSanitizerLegacyPass::ID; - -INITIALIZE_PASS(DataFlowSanitizerLegacyPass, "dfsan", - "DataFlowSanitizer: dynamic data flow analysis.", false, false) - -ModulePass *llvm::createDataFlowSanitizerLegacyPassPass( - const std::vector &ABIListFiles) { - return new DataFlowSanitizerLegacyPass(ABIListFiles); -} - PreservedAnalyses DataFlowSanitizerPass::run(Module &M, ModuleAnalysisManager &AM) { if (DataFlowSanitizer(ABIListFiles).runImpl(M)) { diff --git a/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp b/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp --- a/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp +++ b/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp @@ -99,7 +99,6 @@ initializeInstrOrderFileLegacyPassPass(Registry); initializeInstrProfilingLegacyPassPass(Registry); initializeModuleSanitizerCoverageLegacyPassPass(Registry); - initializeDataFlowSanitizerLegacyPassPass(Registry); } /// LLVMInitializeInstrumentation - C binding for