From 78435f6bb7574d3d26f8c5151e2c140c525b7994 Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Fri, 20 Jul 2012 22:39:33 +0000 Subject: [PATCH] move the bounds checking pass to the instrumentation folder, where it belongs. I dunno why in the world I dropped it in the Scalar folder in the first place. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160587 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Transforms/Instrumentation.h | 7 +++++++ include/llvm/Transforms/Scalar.h | 8 -------- .../{Scalar => Instrumentation}/BoundsChecking.cpp | 2 +- lib/Transforms/Instrumentation/CMakeLists.txt | 1 + lib/Transforms/Scalar/CMakeLists.txt | 1 - .../BoundsChecking/lit.local.cfg | 0 .../BoundsChecking/many-trap.ll | 0 .../{Transforms => Instrumentation}/BoundsChecking/phi.ll | 0 .../BoundsChecking/simple.ll | 0 9 files changed, 9 insertions(+), 10 deletions(-) rename lib/Transforms/{Scalar => Instrumentation}/BoundsChecking.cpp (99%) rename test/{Transforms => Instrumentation}/BoundsChecking/lit.local.cfg (100%) rename test/{Transforms => Instrumentation}/BoundsChecking/many-trap.ll (100%) rename test/{Transforms => Instrumentation}/BoundsChecking/phi.ll (100%) rename test/{Transforms => Instrumentation}/BoundsChecking/simple.ll (100%) diff --git a/include/llvm/Transforms/Instrumentation.h b/include/llvm/Transforms/Instrumentation.h index bbf3a69d246..4b0c448acfc 100644 --- a/include/llvm/Transforms/Instrumentation.h +++ b/include/llvm/Transforms/Instrumentation.h @@ -38,6 +38,13 @@ ModulePass *createAddressSanitizerPass(); // Insert ThreadSanitizer (race detection) instrumentation FunctionPass *createThreadSanitizerPass(); + +// BoundsChecking - This pass instruments the code to perform run-time bounds +// checking on loads, stores, and other memory intrinsics. +// Penalty is the maximum run-time that is acceptable for the user. +// +FunctionPass *createBoundsCheckingPass(unsigned Penalty = 5); + } // End llvm namespace #endif diff --git a/include/llvm/Transforms/Scalar.h b/include/llvm/Transforms/Scalar.h index 67f2e377f72..3dce6fe37fd 100644 --- a/include/llvm/Transforms/Scalar.h +++ b/include/llvm/Transforms/Scalar.h @@ -328,14 +328,6 @@ Pass *createLowerAtomicPass(); // Pass *createCorrelatedValuePropagationPass(); -//===----------------------------------------------------------------------===// -// -// BoundsChecking - This pass instruments the code to perform run-time bounds -// checking on loads, stores, and other memory intrinsics. -// Penalty is the maximum run-time that is acceptable for the user. -// -FunctionPass *createBoundsCheckingPass(unsigned Penalty = 5); - //===----------------------------------------------------------------------===// // // ObjCARCAPElim - ObjC ARC autorelease pool elimination. diff --git a/lib/Transforms/Scalar/BoundsChecking.cpp b/lib/Transforms/Instrumentation/BoundsChecking.cpp similarity index 99% rename from lib/Transforms/Scalar/BoundsChecking.cpp rename to lib/Transforms/Instrumentation/BoundsChecking.cpp index ef2f39d8583..09e0f144512 100644 --- a/lib/Transforms/Scalar/BoundsChecking.cpp +++ b/lib/Transforms/Instrumentation/BoundsChecking.cpp @@ -13,7 +13,6 @@ //===----------------------------------------------------------------------===// #define DEBUG_TYPE "bounds-checking" -#include "llvm/Transforms/Scalar.h" #include "llvm/IRBuilder.h" #include "llvm/Intrinsics.h" #include "llvm/Pass.h" @@ -25,6 +24,7 @@ #include "llvm/Support/TargetFolder.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetData.h" +#include "llvm/Transforms/Instrumentation.h" using namespace llvm; static cl::opt SingleTrapBB("bounds-checking-single-trap", diff --git a/lib/Transforms/Instrumentation/CMakeLists.txt b/lib/Transforms/Instrumentation/CMakeLists.txt index eaa3a4000f8..00de882f171 100644 --- a/lib/Transforms/Instrumentation/CMakeLists.txt +++ b/lib/Transforms/Instrumentation/CMakeLists.txt @@ -1,5 +1,6 @@ add_llvm_library(LLVMInstrumentation AddressSanitizer.cpp + BoundsChecking.cpp EdgeProfiling.cpp FunctionBlackList.cpp GCOVProfiling.cpp diff --git a/lib/Transforms/Scalar/CMakeLists.txt b/lib/Transforms/Scalar/CMakeLists.txt index bf9cc66392a..a01e0661b1f 100644 --- a/lib/Transforms/Scalar/CMakeLists.txt +++ b/lib/Transforms/Scalar/CMakeLists.txt @@ -1,7 +1,6 @@ add_llvm_library(LLVMScalarOpts ADCE.cpp BasicBlockPlacement.cpp - BoundsChecking.cpp CodeGenPrepare.cpp ConstantProp.cpp CorrelatedValuePropagation.cpp diff --git a/test/Transforms/BoundsChecking/lit.local.cfg b/test/Instrumentation/BoundsChecking/lit.local.cfg similarity index 100% rename from test/Transforms/BoundsChecking/lit.local.cfg rename to test/Instrumentation/BoundsChecking/lit.local.cfg diff --git a/test/Transforms/BoundsChecking/many-trap.ll b/test/Instrumentation/BoundsChecking/many-trap.ll similarity index 100% rename from test/Transforms/BoundsChecking/many-trap.ll rename to test/Instrumentation/BoundsChecking/many-trap.ll diff --git a/test/Transforms/BoundsChecking/phi.ll b/test/Instrumentation/BoundsChecking/phi.ll similarity index 100% rename from test/Transforms/BoundsChecking/phi.ll rename to test/Instrumentation/BoundsChecking/phi.ll diff --git a/test/Transforms/BoundsChecking/simple.ll b/test/Instrumentation/BoundsChecking/simple.ll similarity index 100% rename from test/Transforms/BoundsChecking/simple.ll rename to test/Instrumentation/BoundsChecking/simple.ll -- 2.34.1