This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGef37504879ee: [Instrumentation] Remove legacy passes 
(authored by aeubanks).

Changed prior to commit:
  https://reviews.llvm.org/D136615?vs=470185&id=470602#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136615/new/

https://reviews.llvm.org/D136615

Files:
  clang/tools/clang-fuzzer/fuzzer-initialize/fuzzer_initialize.cpp
  llvm/bindings/python/llvm/core.py
  llvm/include/llvm-c/Initialization.h
  llvm/include/llvm/InitializePasses.h
  llvm/include/llvm/LinkAllPasses.h
  llvm/include/llvm/Transforms/Instrumentation/BoundsChecking.h
  llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp
  llvm/lib/Transforms/Instrumentation/Instrumentation.cpp
  llvm/lib/Transforms/Instrumentation/MemProfiler.cpp
  llvm/tools/bugpoint/bugpoint.cpp
  llvm/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp

Index: llvm/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp
===================================================================
--- llvm/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp
+++ llvm/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp
@@ -198,7 +198,6 @@
   initializeTransformUtils(Registry);
   initializeInstCombine(Registry);
   initializeAggressiveInstCombine(Registry);
-  initializeInstrumentation(Registry);
   initializeTarget(Registry);
 
   // Parse input options
Index: llvm/tools/bugpoint/bugpoint.cpp
===================================================================
--- llvm/tools/bugpoint/bugpoint.cpp
+++ llvm/tools/bugpoint/bugpoint.cpp
@@ -149,7 +149,6 @@
   initializeTransformUtils(Registry);
   initializeInstCombine(Registry);
   initializeAggressiveInstCombine(Registry);
-  initializeInstrumentation(Registry);
   initializeTarget(Registry);
 
   if (std::getenv("bar") == (char*) -1) {
Index: llvm/lib/Transforms/Instrumentation/MemProfiler.cpp
===================================================================
--- llvm/lib/Transforms/Instrumentation/MemProfiler.cpp
+++ llvm/lib/Transforms/Instrumentation/MemProfiler.cpp
@@ -204,22 +204,6 @@
   Value *DynamicShadowOffset = nullptr;
 };
 
-class MemProfilerLegacyPass : public FunctionPass {
-public:
-  static char ID;
-
-  explicit MemProfilerLegacyPass() : FunctionPass(ID) {
-    initializeMemProfilerLegacyPassPass(*PassRegistry::getPassRegistry());
-  }
-
-  StringRef getPassName() const override { return "MemProfilerFunctionPass"; }
-
-  bool runOnFunction(Function &F) override {
-    MemProfiler Profiler(*F.getParent());
-    return Profiler.instrumentFunction(F);
-  }
-};
-
 class ModuleMemProfiler {
 public:
   ModuleMemProfiler(Module &M) { TargetTriple = Triple(M.getTargetTriple()); }
@@ -232,24 +216,6 @@
   Function *MemProfCtorFunction = nullptr;
 };
 
-class ModuleMemProfilerLegacyPass : public ModulePass {
-public:
-  static char ID;
-
-  explicit ModuleMemProfilerLegacyPass() : ModulePass(ID) {
-    initializeModuleMemProfilerLegacyPassPass(*PassRegistry::getPassRegistry());
-  }
-
-  StringRef getPassName() const override { return "ModuleMemProfiler"; }
-
-  void getAnalysisUsage(AnalysisUsage &AU) const override {}
-
-  bool runOnModule(Module &M) override {
-    ModuleMemProfiler MemProfiler(M);
-    return MemProfiler.instrumentModule(M);
-  }
-};
-
 } // end anonymous namespace
 
 MemProfilerPass::MemProfilerPass() = default;
@@ -273,30 +239,6 @@
   return PreservedAnalyses::all();
 }
 
-char MemProfilerLegacyPass::ID = 0;
-
-INITIALIZE_PASS_BEGIN(MemProfilerLegacyPass, "memprof",
-                      "MemProfiler: profile memory allocations and accesses.",
-                      false, false)
-INITIALIZE_PASS_END(MemProfilerLegacyPass, "memprof",
-                    "MemProfiler: profile memory allocations and accesses.",
-                    false, false)
-
-FunctionPass *llvm::createMemProfilerFunctionPass() {
-  return new MemProfilerLegacyPass();
-}
-
-char ModuleMemProfilerLegacyPass::ID = 0;
-
-INITIALIZE_PASS(ModuleMemProfilerLegacyPass, "memprof-module",
-                "MemProfiler: profile memory allocations and accesses."
-                "ModulePass",
-                false, false)
-
-ModulePass *llvm::createModuleMemProfilerLegacyPassPass() {
-  return new ModuleMemProfilerLegacyPass();
-}
-
 Value *MemProfiler::memToShadow(Value *Shadow, IRBuilder<> &IRB) {
   // (Shadow & mask) >> scale
   Shadow = IRB.CreateAnd(Shadow, Mapping.Mask);
Index: llvm/lib/Transforms/Instrumentation/Instrumentation.cpp
===================================================================
--- llvm/lib/Transforms/Instrumentation/Instrumentation.cpp
+++ llvm/lib/Transforms/Instrumentation/Instrumentation.cpp
@@ -88,16 +88,3 @@
   return C;
 }
 
-/// initializeInstrumentation - Initialize all passes in the TransformUtils
-/// library.
-void llvm::initializeInstrumentation(PassRegistry &Registry) {
-  initializeMemProfilerLegacyPassPass(Registry);
-  initializeModuleMemProfilerLegacyPassPass(Registry);
-  initializeBoundsCheckingLegacyPassPass(Registry);
-}
-
-/// LLVMInitializeInstrumentation - C binding for
-/// initializeInstrumentation.
-void LLVMInitializeInstrumentation(LLVMPassRegistryRef R) {
-  initializeInstrumentation(*unwrap(R));
-}
Index: llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp
===================================================================
--- llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp
+++ llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp
@@ -222,35 +222,3 @@
 
   return PreservedAnalyses::none();
 }
-
-namespace {
-struct BoundsCheckingLegacyPass : public FunctionPass {
-  static char ID;
-
-  BoundsCheckingLegacyPass() : FunctionPass(ID) {
-    initializeBoundsCheckingLegacyPassPass(*PassRegistry::getPassRegistry());
-  }
-
-  bool runOnFunction(Function &F) override {
-    auto &TLI = getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(F);
-    auto &SE = getAnalysis<ScalarEvolutionWrapperPass>().getSE();
-    return addBoundsChecking(F, TLI, SE);
-  }
-
-  void getAnalysisUsage(AnalysisUsage &AU) const override {
-    AU.addRequired<TargetLibraryInfoWrapperPass>();
-    AU.addRequired<ScalarEvolutionWrapperPass>();
-  }
-};
-} // namespace
-
-char BoundsCheckingLegacyPass::ID = 0;
-INITIALIZE_PASS_BEGIN(BoundsCheckingLegacyPass, "bounds-checking",
-                      "Run-time bounds checking", false, false)
-INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfoWrapperPass)
-INITIALIZE_PASS_END(BoundsCheckingLegacyPass, "bounds-checking",
-                    "Run-time bounds checking", false, false)
-
-FunctionPass *llvm::createBoundsCheckingLegacyPass() {
-  return new BoundsCheckingLegacyPass();
-}
Index: llvm/include/llvm/Transforms/Instrumentation/BoundsChecking.h
===================================================================
--- llvm/include/llvm/Transforms/Instrumentation/BoundsChecking.h
+++ llvm/include/llvm/Transforms/Instrumentation/BoundsChecking.h
@@ -22,10 +22,6 @@
   static bool isRequired() { return true; }
 };
 
-
-/// Legacy pass creation function for the above pass.
-FunctionPass *createBoundsCheckingLegacyPass();
-
 } // end namespace llvm
 
 #endif // LLVM_TRANSFORMS_INSTRUMENTATION_BOUNDSCHECKING_H
Index: llvm/include/llvm/LinkAllPasses.h
===================================================================
--- llvm/include/llvm/LinkAllPasses.h
+++ llvm/include/llvm/LinkAllPasses.h
@@ -80,7 +80,6 @@
       (void) llvm::createSCEVAAWrapperPass();
       (void) llvm::createTypeBasedAAWrapperPass();
       (void) llvm::createScopedNoAliasAAWrapperPass();
-      (void) llvm::createBoundsCheckingLegacyPass();
       (void) llvm::createBreakCriticalEdgesPass();
       (void) llvm::createCallGraphDOTPrinterPass();
       (void) llvm::createCallGraphViewerPass();
Index: llvm/include/llvm/InitializePasses.h
===================================================================
--- llvm/include/llvm/InitializePasses.h
+++ llvm/include/llvm/InitializePasses.h
@@ -39,9 +39,6 @@
 /// Initialize all passes linked into the IPO library.
 void initializeIPO(PassRegistry&);
 
-/// Initialize all passes linked into the Instrumentation library.
-void initializeInstrumentation(PassRegistry&);
-
 /// Initialize all passes linked into the Analysis library.
 void initializeAnalysis(PassRegistry&);
 
Index: llvm/include/llvm-c/Initialization.h
===================================================================
--- llvm/include/llvm-c/Initialization.h
+++ llvm/include/llvm-c/Initialization.h
@@ -37,7 +37,6 @@
 void LLVMInitializeInstCombine(LLVMPassRegistryRef R);
 void LLVMInitializeAggressiveInstCombiner(LLVMPassRegistryRef R);
 void LLVMInitializeIPO(LLVMPassRegistryRef R);
-void LLVMInitializeInstrumentation(LLVMPassRegistryRef R);
 void LLVMInitializeAnalysis(LLVMPassRegistryRef R);
 void LLVMInitializeIPA(LLVMPassRegistryRef R);
 void LLVMInitializeCodeGen(LLVMPassRegistryRef R);
Index: llvm/bindings/python/llvm/core.py
===================================================================
--- llvm/bindings/python/llvm/core.py
+++ llvm/bindings/python/llvm/core.py
@@ -470,9 +470,6 @@
     library.LLVMInitializeIPO.argtypes = [PassRegistry]
     library.LLVMInitializeIPO.restype = None
 
-    library.LLVMInitializeInstrumentation.argtypes = [PassRegistry]
-    library.LLVMInitializeInstrumentation.restype = None
-
     library.LLVMInitializeAnalysis.argtypes = [PassRegistry]
     library.LLVMInitializeAnalysis.restype = None
 
@@ -626,7 +623,6 @@
     lib.LLVMInitializeVectorization(p)
     lib.LLVMInitializeInstCombine(p)
     lib.LLVMInitializeIPO(p)
-    lib.LLVMInitializeInstrumentation(p)
     lib.LLVMInitializeAnalysis(p)
     lib.LLVMInitializeCodeGen(p)
     lib.LLVMInitializeTarget(p)
Index: clang/tools/clang-fuzzer/fuzzer-initialize/fuzzer_initialize.cpp
===================================================================
--- clang/tools/clang-fuzzer/fuzzer-initialize/fuzzer_initialize.cpp
+++ clang/tools/clang-fuzzer/fuzzer-initialize/fuzzer_initialize.cpp
@@ -49,7 +49,6 @@
   initializeTransformUtils(Registry);
   initializeInstCombine(Registry);
   initializeAggressiveInstCombine(Registry);
-  initializeInstrumentation(Registry);
   initializeTarget(Registry);
 
   CLArgs.push_back("-O2");
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to