From a7235ea7245028a0723e8ab7fd011386b3900777 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Fri, 31 Jul 2009 20:28:14 +0000 Subject: Move a few more APIs back to 2.5 forms. The only remaining ones left to change back are metadata related, which I'm waiting on to avoid conflicting with Devang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77721 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Instrumentation/ProfilingUtils.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'lib/Transforms/Instrumentation/ProfilingUtils.cpp') diff --git a/lib/Transforms/Instrumentation/ProfilingUtils.cpp b/lib/Transforms/Instrumentation/ProfilingUtils.cpp index 6e5b523d6c..dc34bf70a3 100644 --- a/lib/Transforms/Instrumentation/ProfilingUtils.cpp +++ b/lib/Transforms/Instrumentation/ProfilingUtils.cpp @@ -23,7 +23,6 @@ void llvm::InsertProfilingInitCall(Function *MainFn, const char *FnName, GlobalValue *Array) { - LLVMContext &Context = MainFn->getContext(); const Type *ArgVTy = PointerType::getUnqual(PointerType::getUnqual(Type::Int8Ty)); const PointerType *UIntPtr = PointerType::getUnqual(Type::Int32Ty); @@ -35,15 +34,15 @@ void llvm::InsertProfilingInitCall(Function *MainFn, const char *FnName, // This could force argc and argv into programs that wouldn't otherwise have // them, but instead we just pass null values in. std::vector Args(4); - Args[0] = Context.getNullValue(Type::Int32Ty); - Args[1] = Context.getNullValue(ArgVTy); + Args[0] = Constant::getNullValue(Type::Int32Ty); + Args[1] = Constant::getNullValue(ArgVTy); // Skip over any allocas in the entry block. BasicBlock *Entry = MainFn->begin(); BasicBlock::iterator InsertPos = Entry->begin(); while (isa(InsertPos)) ++InsertPos; - std::vector GEPIndices(2, Context.getNullValue(Type::Int32Ty)); + std::vector GEPIndices(2, Constant::getNullValue(Type::Int32Ty)); unsigned NumElements = 0; if (Array) { Args[2] = ConstantExpr::getGetElementPtr(Array, &GEPIndices[0], @@ -101,8 +100,6 @@ void llvm::InsertProfilingInitCall(Function *MainFn, const char *FnName, void llvm::IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum, GlobalValue *CounterArray) { - LLVMContext &Context = BB->getContext(); - // Insert the increment after any alloca or PHI instructions... BasicBlock::iterator InsertPos = BB->getFirstNonPHI(); while (isa(InsertPos)) @@ -110,7 +107,7 @@ void llvm::IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum, // Create the getelementptr constant expression std::vector Indices(2); - Indices[0] = Context.getNullValue(Type::Int32Ty); + Indices[0] = Constant::getNullValue(Type::Int32Ty); Indices[1] = ConstantInt::get(Type::Int32Ty, CounterNum); Constant *ElementPtr = ConstantExpr::getGetElementPtr(CounterArray, &Indices[0], -- cgit v1.2.3