Nuno Lopes | a2f6cec | 2012-05-22 17:19:09 +0000 | [diff] [blame] | 1 | //===- BoundsChecking.cpp - Instrumentation for run-time bounds checking --===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
Nuno Lopes | a2f6cec | 2012-05-22 17:19:09 +0000 | [diff] [blame] | 9 | |
Chandler Carruth | 00a301d | 2017-11-14 01:30:04 +0000 | [diff] [blame] | 10 | #include "llvm/Transforms/Instrumentation/BoundsChecking.h" |
Chandler Carruth | ed0881b | 2012-12-03 16:50:05 +0000 | [diff] [blame] | 11 | #include "llvm/ADT/Statistic.h" |
Eugene Zelenko | bff0ef0 | 2017-10-19 22:07:16 +0000 | [diff] [blame] | 12 | #include "llvm/ADT/Twine.h" |
Chandler Carruth | ed0881b | 2012-12-03 16:50:05 +0000 | [diff] [blame] | 13 | #include "llvm/Analysis/MemoryBuiltins.h" |
Joel Galenson | 8dbcc58 | 2018-07-24 15:21:54 +0000 | [diff] [blame^] | 14 | #include "llvm/Analysis/ScalarEvolution.h" |
Chandler Carruth | 452a007 | 2014-03-04 11:59:06 +0000 | [diff] [blame] | 15 | #include "llvm/Analysis/TargetFolder.h" |
Benjamin Kramer | 799003b | 2015-03-23 19:32:43 +0000 | [diff] [blame] | 16 | #include "llvm/Analysis/TargetLibraryInfo.h" |
Eugene Zelenko | bff0ef0 | 2017-10-19 22:07:16 +0000 | [diff] [blame] | 17 | #include "llvm/IR/BasicBlock.h" |
| 18 | #include "llvm/IR/Constants.h" |
Chandler Carruth | 9fb823b | 2013-01-02 11:36:10 +0000 | [diff] [blame] | 19 | #include "llvm/IR/DataLayout.h" |
Eugene Zelenko | bff0ef0 | 2017-10-19 22:07:16 +0000 | [diff] [blame] | 20 | #include "llvm/IR/Function.h" |
Chandler Carruth | 9fb823b | 2013-01-02 11:36:10 +0000 | [diff] [blame] | 21 | #include "llvm/IR/IRBuilder.h" |
Chandler Carruth | 8394857 | 2014-03-04 10:30:26 +0000 | [diff] [blame] | 22 | #include "llvm/IR/InstIterator.h" |
Eugene Zelenko | bff0ef0 | 2017-10-19 22:07:16 +0000 | [diff] [blame] | 23 | #include "llvm/IR/InstrTypes.h" |
| 24 | #include "llvm/IR/Instruction.h" |
| 25 | #include "llvm/IR/Instructions.h" |
Chandler Carruth | 9fb823b | 2013-01-02 11:36:10 +0000 | [diff] [blame] | 26 | #include "llvm/IR/Intrinsics.h" |
Eugene Zelenko | bff0ef0 | 2017-10-19 22:07:16 +0000 | [diff] [blame] | 27 | #include "llvm/IR/Value.h" |
Chandler Carruth | aafe091 | 2012-06-29 12:38:19 +0000 | [diff] [blame] | 28 | #include "llvm/Pass.h" |
Eugene Zelenko | bff0ef0 | 2017-10-19 22:07:16 +0000 | [diff] [blame] | 29 | #include "llvm/Support/Casting.h" |
Nuno Lopes | 288e86ff6 | 2012-05-31 22:58:48 +0000 | [diff] [blame] | 30 | #include "llvm/Support/CommandLine.h" |
Nuno Lopes | a2f6cec | 2012-05-22 17:19:09 +0000 | [diff] [blame] | 31 | #include "llvm/Support/Debug.h" |
Eugene Zelenko | bff0ef0 | 2017-10-19 22:07:16 +0000 | [diff] [blame] | 32 | #include "llvm/Support/ErrorHandling.h" |
Chandler Carruth | aafe091 | 2012-06-29 12:38:19 +0000 | [diff] [blame] | 33 | #include "llvm/Support/raw_ostream.h" |
Eugene Zelenko | bff0ef0 | 2017-10-19 22:07:16 +0000 | [diff] [blame] | 34 | #include <cstdint> |
| 35 | #include <vector> |
| 36 | |
Nuno Lopes | a2f6cec | 2012-05-22 17:19:09 +0000 | [diff] [blame] | 37 | using namespace llvm; |
| 38 | |
Chandler Carruth | 964daaa | 2014-04-22 02:55:47 +0000 | [diff] [blame] | 39 | #define DEBUG_TYPE "bounds-checking" |
| 40 | |
Nuno Lopes | 0e967e0 | 2012-06-21 15:59:53 +0000 | [diff] [blame] | 41 | static cl::opt<bool> SingleTrapBB("bounds-checking-single-trap", |
| 42 | cl::desc("Use one trap block per function")); |
Nuno Lopes | 288e86ff6 | 2012-05-31 22:58:48 +0000 | [diff] [blame] | 43 | |
Nuno Lopes | a2f6cec | 2012-05-22 17:19:09 +0000 | [diff] [blame] | 44 | STATISTIC(ChecksAdded, "Bounds checks added"); |
| 45 | STATISTIC(ChecksSkipped, "Bounds checks skipped"); |
| 46 | STATISTIC(ChecksUnable, "Bounds checks unable to add"); |
| 47 | |
Eugene Zelenko | bff0ef0 | 2017-10-19 22:07:16 +0000 | [diff] [blame] | 48 | using BuilderTy = IRBuilder<TargetFolder>; |
Nuno Lopes | a2f6cec | 2012-05-22 17:19:09 +0000 | [diff] [blame] | 49 | |
Chandler Carruth | 1594fee | 2017-11-14 01:13:59 +0000 | [diff] [blame] | 50 | /// Adds run-time bounds checks to memory accessing instructions. |
| 51 | /// |
| 52 | /// \p Ptr is the pointer that will be read/written, and \p InstVal is either |
| 53 | /// the result from the load or the value being stored. It is used to determine |
| 54 | /// the size of memory block that is touched. |
| 55 | /// |
| 56 | /// \p GetTrapBB is a callable that returns the trap BB to use on failure. |
| 57 | /// |
Nuno Lopes | 59e9df7 | 2012-05-22 22:02:19 +0000 | [diff] [blame] | 58 | /// Returns true if any change was made to the IR, false otherwise. |
Chandler Carruth | 1594fee | 2017-11-14 01:13:59 +0000 | [diff] [blame] | 59 | template <typename GetTrapBBT> |
| 60 | static bool instrumentMemAccess(Value *Ptr, Value *InstVal, |
| 61 | const DataLayout &DL, TargetLibraryInfo &TLI, |
| 62 | ObjectSizeOffsetEvaluator &ObjSizeEval, |
Joel Galenson | 8dbcc58 | 2018-07-24 15:21:54 +0000 | [diff] [blame^] | 63 | BuilderTy &IRB, GetTrapBBT GetTrapBB, |
| 64 | ScalarEvolution &SE) { |
Mehdi Amini | a28d91d | 2015-03-10 02:37:25 +0000 | [diff] [blame] | 65 | uint64_t NeededSize = DL.getTypeStoreSize(InstVal->getType()); |
Nicola Zaghen | d34e60c | 2018-05-14 12:53:11 +0000 | [diff] [blame] | 66 | LLVM_DEBUG(dbgs() << "Instrument " << *Ptr << " for " << Twine(NeededSize) |
| 67 | << " bytes\n"); |
Nuno Lopes | a2f6cec | 2012-05-22 17:19:09 +0000 | [diff] [blame] | 68 | |
Chandler Carruth | 1594fee | 2017-11-14 01:13:59 +0000 | [diff] [blame] | 69 | SizeOffsetEvalType SizeOffset = ObjSizeEval.compute(Ptr); |
Nuno Lopes | a2f6cec | 2012-05-22 17:19:09 +0000 | [diff] [blame] | 70 | |
Chandler Carruth | 1594fee | 2017-11-14 01:13:59 +0000 | [diff] [blame] | 71 | if (!ObjSizeEval.bothKnown(SizeOffset)) { |
Nuno Lopes | a2f6cec | 2012-05-22 17:19:09 +0000 | [diff] [blame] | 72 | ++ChecksUnable; |
| 73 | return false; |
| 74 | } |
Nuno Lopes | a2f6cec | 2012-05-22 17:19:09 +0000 | [diff] [blame] | 75 | |
Nuno Lopes | 0e967e0 | 2012-06-21 15:59:53 +0000 | [diff] [blame] | 76 | Value *Size = SizeOffset.first; |
| 77 | Value *Offset = SizeOffset.second; |
Nuno Lopes | 1e8dffd | 2012-07-03 17:30:18 +0000 | [diff] [blame] | 78 | ConstantInt *SizeCI = dyn_cast<ConstantInt>(Size); |
Nuno Lopes | 0e967e0 | 2012-06-21 15:59:53 +0000 | [diff] [blame] | 79 | |
Mehdi Amini | a28d91d | 2015-03-10 02:37:25 +0000 | [diff] [blame] | 80 | Type *IntTy = DL.getIntPtrType(Ptr->getType()); |
Nuno Lopes | 0e967e0 | 2012-06-21 15:59:53 +0000 | [diff] [blame] | 81 | Value *NeededSizeVal = ConstantInt::get(IntTy, NeededSize); |
| 82 | |
Joel Galenson | 8dbcc58 | 2018-07-24 15:21:54 +0000 | [diff] [blame^] | 83 | auto SizeRange = SE.getUnsignedRange(SE.getSCEV(Size)); |
| 84 | auto OffsetRange = SE.getUnsignedRange(SE.getSCEV(Offset)); |
| 85 | auto NeededSizeRange = SE.getUnsignedRange(SE.getSCEV(NeededSizeVal)); |
| 86 | |
Nuno Lopes | 7d00061 | 2012-05-31 22:45:40 +0000 | [diff] [blame] | 87 | // three checks are required to ensure safety: |
| 88 | // . Offset >= 0 (since the offset is given from the base ptr) |
| 89 | // . Size >= Offset (unsigned) |
| 90 | // . Size - Offset >= NeededSize (unsigned) |
Nuno Lopes | 1e8dffd | 2012-07-03 17:30:18 +0000 | [diff] [blame] | 91 | // |
| 92 | // optimization: if Size >= 0 (signed), skip 1st check |
Nuno Lopes | 7d00061 | 2012-05-31 22:45:40 +0000 | [diff] [blame] | 93 | // FIXME: add NSW/NUW here? -- we dont care if the subtraction overflows |
Chandler Carruth | 1594fee | 2017-11-14 01:13:59 +0000 | [diff] [blame] | 94 | Value *ObjSize = IRB.CreateSub(Size, Offset); |
Joel Galenson | 8dbcc58 | 2018-07-24 15:21:54 +0000 | [diff] [blame^] | 95 | Value *Cmp2 = SizeRange.getUnsignedMin().uge(OffsetRange.getUnsignedMax()) |
| 96 | ? ConstantInt::getFalse(Ptr->getContext()) |
| 97 | : IRB.CreateICmpULT(Size, Offset); |
| 98 | Value *Cmp3 = SizeRange.sub(OffsetRange) |
| 99 | .getUnsignedMin() |
| 100 | .uge(NeededSizeRange.getUnsignedMax()) |
| 101 | ? ConstantInt::getFalse(Ptr->getContext()) |
| 102 | : IRB.CreateICmpULT(ObjSize, NeededSizeVal); |
Chandler Carruth | 1594fee | 2017-11-14 01:13:59 +0000 | [diff] [blame] | 103 | Value *Or = IRB.CreateOr(Cmp2, Cmp3); |
Joel Galenson | 8dbcc58 | 2018-07-24 15:21:54 +0000 | [diff] [blame^] | 104 | if ((!SizeCI || SizeCI->getValue().slt(0)) && |
| 105 | !SizeRange.getSignedMin().isNonNegative()) { |
Chandler Carruth | 1594fee | 2017-11-14 01:13:59 +0000 | [diff] [blame] | 106 | Value *Cmp1 = IRB.CreateICmpSLT(Offset, ConstantInt::get(IntTy, 0)); |
| 107 | Or = IRB.CreateOr(Cmp1, Or); |
Nuno Lopes | 1e8dffd | 2012-07-03 17:30:18 +0000 | [diff] [blame] | 108 | } |
Nuno Lopes | a2f6cec | 2012-05-22 17:19:09 +0000 | [diff] [blame] | 109 | |
Chandler Carruth | 3f0e056 | 2017-10-18 22:42:36 +0000 | [diff] [blame] | 110 | // check if the comparison is always false |
| 111 | ConstantInt *C = dyn_cast_or_null<ConstantInt>(Or); |
| 112 | if (C) { |
| 113 | ++ChecksSkipped; |
| 114 | // If non-zero, nothing to do. |
| 115 | if (!C->getZExtValue()) |
| 116 | return true; |
| 117 | } |
| 118 | ++ChecksAdded; |
| 119 | |
Chandler Carruth | 1594fee | 2017-11-14 01:13:59 +0000 | [diff] [blame] | 120 | BasicBlock::iterator SplitI = IRB.GetInsertPoint(); |
Chandler Carruth | 3f0e056 | 2017-10-18 22:42:36 +0000 | [diff] [blame] | 121 | BasicBlock *OldBB = SplitI->getParent(); |
| 122 | BasicBlock *Cont = OldBB->splitBasicBlock(SplitI); |
| 123 | OldBB->getTerminator()->eraseFromParent(); |
| 124 | |
| 125 | if (C) { |
| 126 | // If we have a constant zero, unconditionally branch. |
| 127 | // FIXME: We should really handle this differently to bypass the splitting |
| 128 | // the block. |
Chandler Carruth | 1594fee | 2017-11-14 01:13:59 +0000 | [diff] [blame] | 129 | BranchInst::Create(GetTrapBB(IRB), OldBB); |
Chandler Carruth | 3f0e056 | 2017-10-18 22:42:36 +0000 | [diff] [blame] | 130 | return true; |
| 131 | } |
| 132 | |
| 133 | // Create the conditional branch. |
Chandler Carruth | 1594fee | 2017-11-14 01:13:59 +0000 | [diff] [blame] | 134 | BranchInst::Create(GetTrapBB(IRB), Cont, Or, OldBB); |
Nuno Lopes | a2f6cec | 2012-05-22 17:19:09 +0000 | [diff] [blame] | 135 | return true; |
| 136 | } |
| 137 | |
Joel Galenson | 8dbcc58 | 2018-07-24 15:21:54 +0000 | [diff] [blame^] | 138 | static bool addBoundsChecking(Function &F, TargetLibraryInfo &TLI, |
| 139 | ScalarEvolution &SE) { |
Mehdi Amini | a28d91d | 2015-03-10 02:37:25 +0000 | [diff] [blame] | 140 | const DataLayout &DL = F.getParent()->getDataLayout(); |
Chandler Carruth | 1594fee | 2017-11-14 01:13:59 +0000 | [diff] [blame] | 141 | ObjectSizeOffsetEvaluator ObjSizeEval(DL, &TLI, F.getContext(), |
Nuno Lopes | 340b046 | 2013-10-24 09:17:24 +0000 | [diff] [blame] | 142 | /*RoundToAlign=*/true); |
Nuno Lopes | a2f6cec | 2012-05-22 17:19:09 +0000 | [diff] [blame] | 143 | |
| 144 | // check HANDLE_MEMORY_INST in include/llvm/Instruction.def for memory |
| 145 | // touching instructions |
Eugene Zelenko | bff0ef0 | 2017-10-19 22:07:16 +0000 | [diff] [blame] | 146 | std::vector<Instruction *> WorkList; |
Chandler Carruth | 1594fee | 2017-11-14 01:13:59 +0000 | [diff] [blame] | 147 | for (Instruction &I : instructions(F)) { |
Nuno Lopes | a2f6cec | 2012-05-22 17:19:09 +0000 | [diff] [blame] | 148 | if (isa<LoadInst>(I) || isa<StoreInst>(I) || isa<AtomicCmpXchgInst>(I) || |
| 149 | isa<AtomicRMWInst>(I)) |
Chandler Carruth | 1594fee | 2017-11-14 01:13:59 +0000 | [diff] [blame] | 150 | WorkList.push_back(&I); |
Nuno Lopes | a2f6cec | 2012-05-22 17:19:09 +0000 | [diff] [blame] | 151 | } |
| 152 | |
Chandler Carruth | 1594fee | 2017-11-14 01:13:59 +0000 | [diff] [blame] | 153 | // Create a trapping basic block on demand using a callback. Depending on |
| 154 | // flags, this will either create a single block for the entire function or |
| 155 | // will create a fresh block every time it is called. |
| 156 | BasicBlock *TrapBB = nullptr; |
| 157 | auto GetTrapBB = [&TrapBB](BuilderTy &IRB) { |
| 158 | if (TrapBB && SingleTrapBB) |
| 159 | return TrapBB; |
Nuno Lopes | a2f6cec | 2012-05-22 17:19:09 +0000 | [diff] [blame] | 160 | |
Chandler Carruth | 1594fee | 2017-11-14 01:13:59 +0000 | [diff] [blame] | 161 | Function *Fn = IRB.GetInsertBlock()->getParent(); |
| 162 | // FIXME: This debug location doesn't make a lot of sense in the |
| 163 | // `SingleTrapBB` case. |
| 164 | auto DebugLoc = IRB.getCurrentDebugLocation(); |
| 165 | IRBuilder<>::InsertPointGuard Guard(IRB); |
| 166 | TrapBB = BasicBlock::Create(Fn->getContext(), "trap", Fn); |
| 167 | IRB.SetInsertPoint(TrapBB); |
| 168 | |
| 169 | auto *F = Intrinsic::getDeclaration(Fn->getParent(), Intrinsic::trap); |
| 170 | CallInst *TrapCall = IRB.CreateCall(F, {}); |
| 171 | TrapCall->setDoesNotReturn(); |
| 172 | TrapCall->setDoesNotThrow(); |
| 173 | TrapCall->setDebugLoc(DebugLoc); |
| 174 | IRB.CreateUnreachable(); |
| 175 | |
| 176 | return TrapBB; |
| 177 | }; |
| 178 | |
| 179 | bool MadeChange = false; |
| 180 | for (Instruction *Inst : WorkList) { |
| 181 | BuilderTy IRB(Inst->getParent(), BasicBlock::iterator(Inst), TargetFolder(DL)); |
Nuno Lopes | de8c6fb | 2012-06-23 00:12:34 +0000 | [diff] [blame] | 182 | if (LoadInst *LI = dyn_cast<LoadInst>(Inst)) { |
Chandler Carruth | 1594fee | 2017-11-14 01:13:59 +0000 | [diff] [blame] | 183 | MadeChange |= instrumentMemAccess(LI->getPointerOperand(), LI, DL, TLI, |
Joel Galenson | 8dbcc58 | 2018-07-24 15:21:54 +0000 | [diff] [blame^] | 184 | ObjSizeEval, IRB, GetTrapBB, SE); |
Nuno Lopes | de8c6fb | 2012-06-23 00:12:34 +0000 | [diff] [blame] | 185 | } else if (StoreInst *SI = dyn_cast<StoreInst>(Inst)) { |
Mehdi Amini | a28d91d | 2015-03-10 02:37:25 +0000 | [diff] [blame] | 186 | MadeChange |= |
Chandler Carruth | 1594fee | 2017-11-14 01:13:59 +0000 | [diff] [blame] | 187 | instrumentMemAccess(SI->getPointerOperand(), SI->getValueOperand(), |
Joel Galenson | 8dbcc58 | 2018-07-24 15:21:54 +0000 | [diff] [blame^] | 188 | DL, TLI, ObjSizeEval, IRB, GetTrapBB, SE); |
Nuno Lopes | de8c6fb | 2012-06-23 00:12:34 +0000 | [diff] [blame] | 189 | } else if (AtomicCmpXchgInst *AI = dyn_cast<AtomicCmpXchgInst>(Inst)) { |
Mehdi Amini | a28d91d | 2015-03-10 02:37:25 +0000 | [diff] [blame] | 190 | MadeChange |= |
Chandler Carruth | 1594fee | 2017-11-14 01:13:59 +0000 | [diff] [blame] | 191 | instrumentMemAccess(AI->getPointerOperand(), AI->getCompareOperand(), |
Joel Galenson | 8dbcc58 | 2018-07-24 15:21:54 +0000 | [diff] [blame^] | 192 | DL, TLI, ObjSizeEval, IRB, GetTrapBB, SE); |
Nuno Lopes | de8c6fb | 2012-06-23 00:12:34 +0000 | [diff] [blame] | 193 | } else if (AtomicRMWInst *AI = dyn_cast<AtomicRMWInst>(Inst)) { |
Mehdi Amini | a28d91d | 2015-03-10 02:37:25 +0000 | [diff] [blame] | 194 | MadeChange |= |
Chandler Carruth | 1594fee | 2017-11-14 01:13:59 +0000 | [diff] [blame] | 195 | instrumentMemAccess(AI->getPointerOperand(), AI->getValOperand(), DL, |
Joel Galenson | 8dbcc58 | 2018-07-24 15:21:54 +0000 | [diff] [blame^] | 196 | TLI, ObjSizeEval, IRB, GetTrapBB, SE); |
Nuno Lopes | a2f6cec | 2012-05-22 17:19:09 +0000 | [diff] [blame] | 197 | } else { |
| 198 | llvm_unreachable("unknown Instruction type"); |
| 199 | } |
| 200 | } |
| 201 | return MadeChange; |
| 202 | } |
| 203 | |
Chandler Carruth | 00a301d | 2017-11-14 01:30:04 +0000 | [diff] [blame] | 204 | PreservedAnalyses BoundsCheckingPass::run(Function &F, FunctionAnalysisManager &AM) { |
| 205 | auto &TLI = AM.getResult<TargetLibraryAnalysis>(F); |
Joel Galenson | 8dbcc58 | 2018-07-24 15:21:54 +0000 | [diff] [blame^] | 206 | auto &SE = AM.getResult<ScalarEvolutionAnalysis>(F); |
Chandler Carruth | 00a301d | 2017-11-14 01:30:04 +0000 | [diff] [blame] | 207 | |
Joel Galenson | 8dbcc58 | 2018-07-24 15:21:54 +0000 | [diff] [blame^] | 208 | if (!addBoundsChecking(F, TLI, SE)) |
Chandler Carruth | 00a301d | 2017-11-14 01:30:04 +0000 | [diff] [blame] | 209 | return PreservedAnalyses::all(); |
| 210 | |
| 211 | return PreservedAnalyses::none(); |
| 212 | } |
| 213 | |
| 214 | namespace { |
| 215 | struct BoundsCheckingLegacyPass : public FunctionPass { |
| 216 | static char ID; |
| 217 | |
| 218 | BoundsCheckingLegacyPass() : FunctionPass(ID) { |
| 219 | initializeBoundsCheckingLegacyPassPass(*PassRegistry::getPassRegistry()); |
| 220 | } |
| 221 | |
| 222 | bool runOnFunction(Function &F) override { |
| 223 | auto &TLI = getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(); |
Joel Galenson | 8dbcc58 | 2018-07-24 15:21:54 +0000 | [diff] [blame^] | 224 | auto &SE = getAnalysis<ScalarEvolutionWrapperPass>().getSE(); |
| 225 | return addBoundsChecking(F, TLI, SE); |
Chandler Carruth | 00a301d | 2017-11-14 01:30:04 +0000 | [diff] [blame] | 226 | } |
| 227 | |
| 228 | void getAnalysisUsage(AnalysisUsage &AU) const override { |
| 229 | AU.addRequired<TargetLibraryInfoWrapperPass>(); |
Joel Galenson | 8dbcc58 | 2018-07-24 15:21:54 +0000 | [diff] [blame^] | 230 | AU.addRequired<ScalarEvolutionWrapperPass>(); |
Chandler Carruth | 00a301d | 2017-11-14 01:30:04 +0000 | [diff] [blame] | 231 | } |
| 232 | }; |
| 233 | } // namespace |
| 234 | |
| 235 | char BoundsCheckingLegacyPass::ID = 0; |
| 236 | INITIALIZE_PASS_BEGIN(BoundsCheckingLegacyPass, "bounds-checking", |
| 237 | "Run-time bounds checking", false, false) |
| 238 | INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfoWrapperPass) |
| 239 | INITIALIZE_PASS_END(BoundsCheckingLegacyPass, "bounds-checking", |
| 240 | "Run-time bounds checking", false, false) |
| 241 | |
| 242 | FunctionPass *llvm::createBoundsCheckingLegacyPass() { |
| 243 | return new BoundsCheckingLegacyPass(); |
Nuno Lopes | a2f6cec | 2012-05-22 17:19:09 +0000 | [diff] [blame] | 244 | } |