aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-08-13 21:58:54 +0000
committerOwen Anderson <resistor@mac.com>2009-08-13 21:58:54 +0000
commit1d0be15f89cb5056e20e2d24faa8d6afb1573bca (patch)
tree2cdabe223bfce83bd12e10dd557147a2f68c9bf8 /lib
parentd163e8b14c8aa5bbbb129e3f0dffdbe7213a3c72 (diff)
Push LLVMContexts through the IntegerType APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/BasicAliasAnalysis.cpp25
-rw-r--r--lib/Analysis/CaptureTracking.cpp2
-rw-r--r--lib/Analysis/ConstantFolding.cpp31
-rw-r--r--lib/Analysis/DebugInfo.cpp72
-rw-r--r--lib/Analysis/LoopDependenceAnalysis.cpp2
-rw-r--r--lib/Analysis/LoopVR.cpp6
-rw-r--r--lib/Analysis/PointerTracking.cpp25
-rw-r--r--lib/Analysis/ScalarEvolution.cpp22
-rw-r--r--lib/Analysis/ScalarEvolutionExpander.cpp5
-rw-r--r--lib/Analysis/ValueTracking.cpp11
-rw-r--r--lib/AsmParser/LLLexer.cpp18
-rw-r--r--lib/AsmParser/LLParser.cpp116
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.cpp84
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.h2
-rw-r--r--lib/Bitcode/Writer/BitcodeWriter.cpp12
-rw-r--r--lib/Bitcode/Writer/ValueEnumerator.cpp7
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinter.cpp16
-rw-r--r--lib/CodeGen/DwarfEHPrepare.cpp15
-rw-r--r--lib/CodeGen/ELFWriter.cpp16
-rw-r--r--lib/CodeGen/IntrinsicLowering.cpp84
-rw-r--r--lib/CodeGen/MachineFunction.cpp3
-rw-r--r--lib/CodeGen/MachineInstr.cpp2
-rw-r--r--lib/CodeGen/PseudoSourceValue.cpp7
-rw-r--r--lib/CodeGen/SelectionDAG/FastISel.cpp3
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp5
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp22
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp28
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp2
-rw-r--r--lib/CodeGen/SelectionDAG/TargetLowering.cpp5
-rw-r--r--lib/CodeGen/ShadowStackGC.cpp33
-rw-r--r--lib/CodeGen/StackProtector.cpp11
-rw-r--r--lib/ExecutionEngine/ExecutionEngine.cpp45
-rw-r--r--lib/ExecutionEngine/Interpreter/Execution.cpp25
-rw-r--r--lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp21
-rw-r--r--lib/ExecutionEngine/JIT/JIT.cpp24
-rw-r--r--lib/Target/ARM/ARMBaseRegisterInfo.cpp3
-rw-r--r--lib/Target/ARM/ARMCodeEmitter.cpp4
-rw-r--r--lib/Target/ARM/ARMConstantPoolValue.cpp7
-rw-r--r--lib/Target/ARM/ARMConstantPoolValue.h3
-rw-r--r--lib/Target/ARM/ARMISelDAGToDAG.cpp3
-rw-r--r--lib/Target/ARM/ARMISelLowering.cpp13
-rw-r--r--lib/Target/ARM/ARMLoadStoreOptimizer.cpp5
-rw-r--r--lib/Target/ARM/Thumb1RegisterInfo.cpp3
-rw-r--r--lib/Target/ARM/Thumb2RegisterInfo.cpp3
-rw-r--r--lib/Target/Alpha/AlphaISelDAGToDAG.cpp3
-rw-r--r--lib/Target/CBackend/CBackend.cpp77
-rw-r--r--lib/Target/CppBackend/CPPBackend.cpp12
-rw-r--r--lib/Target/MSIL/MSILWriter.cpp10
-rw-r--r--lib/Target/PowerPC/PPCISelLowering.cpp3
-rw-r--r--lib/Target/Target.cpp2
-rw-r--r--lib/Target/TargetData.cpp7
-rw-r--r--lib/Target/X86/X86FastISel.cpp27
-rw-r--r--lib/Target/X86/X86FloatingPointRegKill.cpp5
-rw-r--r--lib/Target/X86/X86ISelLowering.cpp19
-rw-r--r--lib/Target/X86/X86InstrInfo.cpp3
-rw-r--r--lib/Target/XCore/XCoreISelDAGToDAG.cpp3
-rw-r--r--lib/Target/XCore/XCoreISelLowering.cpp6
-rw-r--r--lib/Transforms/IPO/ArgumentPromotion.cpp21
-rw-r--r--lib/Transforms/IPO/DeadArgumentElimination.cpp20
-rw-r--r--lib/Transforms/IPO/ExtractGV.cpp3
-rw-r--r--lib/Transforms/IPO/GlobalOpt.cpp45
-rw-r--r--lib/Transforms/IPO/IPConstantPropagation.cpp2
-rw-r--r--lib/Transforms/IPO/IndMemRemoval.cpp13
-rw-r--r--lib/Transforms/IPO/LowerSetJmp.cpp62
-rw-r--r--lib/Transforms/IPO/MergeFunctions.cpp10
-rw-r--r--lib/Transforms/IPO/PruneEH.cpp2
-rw-r--r--lib/Transforms/IPO/RaiseAllocations.cpp43
-rw-r--r--lib/Transforms/IPO/StructRetPromotion.cpp7
-rw-r--r--lib/Transforms/Instrumentation/BlockProfiling.cpp5
-rw-r--r--lib/Transforms/Instrumentation/EdgeProfiling.cpp2
-rw-r--r--lib/Transforms/Instrumentation/ProfilingUtils.cpp35
-rw-r--r--lib/Transforms/Instrumentation/RSProfiling.cpp36
-rw-r--r--lib/Transforms/Scalar/CodeGenPrepare.cpp3
-rw-r--r--lib/Transforms/Scalar/CondPropagate.cpp2
-rw-r--r--lib/Transforms/Scalar/GVN.cpp3
-rw-r--r--lib/Transforms/Scalar/IndVarSimplify.cpp18
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp212
-rw-r--r--lib/Transforms/Scalar/JumpThreading.cpp11
-rw-r--r--lib/Transforms/Scalar/LICM.cpp2
-rw-r--r--lib/Transforms/Scalar/LoopIndexSplit.cpp3
-rw-r--r--lib/Transforms/Scalar/LoopRotation.cpp3
-rw-r--r--lib/Transforms/Scalar/LoopStrengthReduce.cpp21
-rw-r--r--lib/Transforms/Scalar/LoopUnswitch.cpp20
-rw-r--r--lib/Transforms/Scalar/MemCpyOptimizer.cpp20
-rw-r--r--lib/Transforms/Scalar/PredicateSimplifier.cpp9
-rw-r--r--lib/Transforms/Scalar/Reg2Mem.cpp3
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp12
-rw-r--r--lib/Transforms/Scalar/ScalarReplAggregates.cpp59
-rw-r--r--lib/Transforms/Scalar/SimplifyCFGPass.cpp2
-rw-r--r--lib/Transforms/Scalar/SimplifyLibCalls.cpp183
-rw-r--r--lib/Transforms/Scalar/TailRecursionElimination.cpp2
-rw-r--r--lib/Transforms/Utils/BasicBlockUtils.cpp8
-rw-r--r--lib/Transforms/Utils/BreakCriticalEdges.cpp4
-rw-r--r--lib/Transforms/Utils/CloneFunction.cpp4
-rw-r--r--lib/Transforms/Utils/CodeExtractor.cpp54
-rw-r--r--lib/Transforms/Utils/InlineFunction.cpp12
-rw-r--r--lib/Transforms/Utils/InstructionNamer.cpp4
-rw-r--r--lib/Transforms/Utils/LoopSimplify.cpp5
-rw-r--r--lib/Transforms/Utils/LowerAllocations.cpp13
-rw-r--r--lib/Transforms/Utils/LowerInvoke.cpp71
-rw-r--r--lib/Transforms/Utils/LowerSwitch.cpp6
-rw-r--r--lib/Transforms/Utils/SSI.cpp2
-rw-r--r--lib/Transforms/Utils/SimplifyCFG.cpp30
-rw-r--r--lib/Transforms/Utils/UnifyFunctionExitNodes.cpp18
-rw-r--r--lib/VMCore/AsmWriter.cpp16
-rw-r--r--lib/VMCore/AutoUpgrade.cpp41
-rw-r--r--lib/VMCore/BasicBlock.cpp7
-rw-r--r--lib/VMCore/ConstantFold.cpp92
-rw-r--r--lib/VMCore/Constants.cpp71
-rw-r--r--lib/VMCore/ConstantsContext.h2
-rw-r--r--lib/VMCore/Core.cpp68
-rw-r--r--lib/VMCore/Function.cpp2
-rw-r--r--lib/VMCore/InlineAsm.cpp2
-rw-r--r--lib/VMCore/Instructions.cpp100
-rw-r--r--lib/VMCore/Metadata.cpp16
-rw-r--r--lib/VMCore/Module.cpp7
-rw-r--r--lib/VMCore/Type.cpp148
-rw-r--r--lib/VMCore/Value.cpp9
-rw-r--r--lib/VMCore/ValueTypes.cpp66
-rw-r--r--lib/VMCore/Verifier.cpp34
120 files changed, 1596 insertions, 1238 deletions
diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp
index a89505549f..286f12a1ba 100644
--- a/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/lib/Analysis/BasicAliasAnalysis.cpp
@@ -502,10 +502,10 @@ static bool IndexOperandsEqual(Value *V1, Value *V2, LLVMContext &Context) {
if (Constant *C1 = dyn_cast<Constant>(V1))
if (Constant *C2 = dyn_cast<Constant>(V2)) {
// Sign extend the constants to long types, if necessary
- if (C1->getType() != Type::Int64Ty)
- C1 = ConstantExpr::getSExt(C1, Type::Int64Ty);
- if (C2->getType() != Type::Int64Ty)
- C2 = ConstantExpr::getSExt(C2, Type::Int64Ty);
+ if (C1->getType() != Type::getInt64Ty(Context))
+ C1 = ConstantExpr::getSExt(C1, Type::getInt64Ty(Context));
+ if (C2->getType() != Type::getInt64Ty(Context))
+ C2 = ConstantExpr::getSExt(C2, Type::getInt64Ty(Context));
return C1 == C2;
}
return false;
@@ -600,10 +600,10 @@ BasicAliasAnalysis::CheckGEPInstructions(
if (Constant *G2OC = dyn_cast<ConstantInt>(const_cast<Value*>(G2Oper))){
if (G1OC->getType() != G2OC->getType()) {
// Sign extend both operands to long.
- if (G1OC->getType() != Type::Int64Ty)
- G1OC = ConstantExpr::getSExt(G1OC, Type::Int64Ty);
- if (G2OC->getType() != Type::Int64Ty)
- G2OC = ConstantExpr::getSExt(G2OC, Type::Int64Ty);
+ if (G1OC->getType() != Type::getInt64Ty(Context))
+ G1OC = ConstantExpr::getSExt(G1OC, Type::getInt64Ty(Context));
+ if (G2OC->getType() != Type::getInt64Ty(Context))
+ G2OC = ConstantExpr::getSExt(G2OC, Type::getInt64Ty(Context));
GEP1Ops[FirstConstantOper] = G1OC;
GEP2Ops[FirstConstantOper] = G2OC;
}
@@ -738,7 +738,8 @@ BasicAliasAnalysis::CheckGEPInstructions(
const Type *ZeroIdxTy = GEPPointerTy;
for (unsigned i = 0; i != FirstConstantOper; ++i) {
if (!isa<StructType>(ZeroIdxTy))
- GEP1Ops[i] = GEP2Ops[i] = Constant::getNullValue(Type::Int32Ty);
+ GEP1Ops[i] = GEP2Ops[i] =
+ Constant::getNullValue(Type::getInt32Ty(Context));
if (const CompositeType *CT = dyn_cast<CompositeType>(ZeroIdxTy))
ZeroIdxTy = CT->getTypeAtIndex(GEP1Ops[i]);
@@ -780,10 +781,12 @@ BasicAliasAnalysis::CheckGEPInstructions(
//
if (const ArrayType *AT = dyn_cast<ArrayType>(BasePtr1Ty))
GEP1Ops[i] =
- ConstantInt::get(Type::Int64Ty,AT->getNumElements()-1);
+ ConstantInt::get(Type::getInt64Ty(Context),
+ AT->getNumElements()-1);
else if (const VectorType *VT = dyn_cast<VectorType>(BasePtr1Ty))
GEP1Ops[i] =
- ConstantInt::get(Type::Int64Ty,VT->getNumElements()-1);
+ ConstantInt::get(Type::getInt64Ty(Context),
+ VT->getNumElements()-1);
}
}
diff --git a/lib/Analysis/CaptureTracking.cpp b/lib/Analysis/CaptureTracking.cpp
index a19b8e4f94..b30ac719ae 100644
--- a/lib/Analysis/CaptureTracking.cpp
+++ b/lib/Analysis/CaptureTracking.cpp
@@ -54,7 +54,7 @@ bool llvm::PointerMayBeCaptured(const Value *V, bool ReturnCaptures) {
// its return value and doesn't unwind (a readonly function can leak bits
// by throwing an exception or not depending on the input value).
if (CS.onlyReadsMemory() && CS.doesNotThrow() &&
- I->getType() == Type::VoidTy)
+ I->getType() == Type::getVoidTy(V->getContext()))
break;
// Not captured if only passed via 'nocapture' arguments. Note that
diff --git a/lib/Analysis/ConstantFolding.cpp b/lib/Analysis/ConstantFolding.cpp
index 57e781615a..9234f2aaf9 100644
--- a/lib/Analysis/ConstantFolding.cpp
+++ b/lib/Analysis/ConstantFolding.cpp
@@ -151,7 +151,7 @@ static Constant *SymbolicallyEvaluateGEP(Constant* const* Ops, unsigned NumOps,
uint64_t Offset = TD->getIndexedOffset(Ptr->getType(),
(Value**)Ops+1, NumOps-1);
- Constant *C = Const