diff options
author | Chris Lattner <sabre@nondot.org> | 2009-11-06 04:27:31 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-11-06 04:27:31 +0000 |
commit | 7b550ccfc5a3346c17e0390a59e2d6d19bc52705 (patch) | |
tree | 9c3af8482a1eab3d262715e590726e5acf675951 /include | |
parent | 6580da4755cf98aa9b0c32186536e80d7dd41f90 (diff) | |
download | external_llvm-7b550ccfc5a3346c17e0390a59e2d6d19bc52705.tar.gz external_llvm-7b550ccfc5a3346c17e0390a59e2d6d19bc52705.tar.bz2 external_llvm-7b550ccfc5a3346c17e0390a59e2d6d19bc52705.zip |
remove a bunch of extraneous LLVMContext arguments
from various APIs, addressing PR5325.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86231 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Analysis/ConstantFolding.h | 14 | ||||
-rw-r--r-- | include/llvm/Analysis/MemoryBuiltins.h | 24 | ||||
-rw-r--r-- | include/llvm/GlobalVariable.h | 4 | ||||
-rw-r--r-- | include/llvm/Support/TargetFolder.h | 6 |
4 files changed, 19 insertions, 29 deletions
diff --git a/include/llvm/Analysis/ConstantFolding.h b/include/llvm/Analysis/ConstantFolding.h index 78a16daeb7..28402f2cc2 100644 --- a/include/llvm/Analysis/ConstantFolding.h +++ b/include/llvm/Analysis/ConstantFolding.h @@ -26,20 +26,18 @@ namespace llvm { class TargetData; class Function; class Type; - class LLVMContext; /// ConstantFoldInstruction - Attempt to constant fold the specified /// instruction. If successful, the constant result is returned, if not, null /// is returned. Note that this function can only fail when attempting to fold /// instructions like loads and stores, which have no constant expression form. /// -Constant *ConstantFoldInstruction(Instruction *I, LLVMContext &Context, - const TargetData *TD = 0); +Constant *ConstantFoldInstruction(Instruction *I, const TargetData *TD = 0); /// ConstantFoldConstantExpression - Attempt to fold the constant expression /// using the specified TargetData. If successful, the constant result is /// result is returned, if not, null is returned. -Constant *ConstantFoldConstantExpression(ConstantExpr *CE, LLVMContext &Context, +Constant *ConstantFoldConstantExpression(ConstantExpr *CE, const TargetData *TD = 0); /// ConstantFoldInstOperands - Attempt to constant fold an instruction with the @@ -49,8 +47,7 @@ Constant *ConstantFoldConstantExpression(ConstantExpr *CE, LLVMContext &Context, /// form. /// Constant *ConstantFoldInstOperands(unsigned Opcode, const Type *DestTy, - Constant*const * Ops, unsigned NumOps, - LLVMContext &Context, + Constant *const *Ops, unsigned NumOps, const TargetData *TD = 0); /// ConstantFoldCompareInstOperands - Attempt to constant fold a compare @@ -58,8 +55,7 @@ Constant *ConstantFoldInstOperands(unsigned Opcode, const Type *DestTy, /// returns a constant expression of the specified operands. /// Constant *ConstantFoldCompareInstOperands(unsigned Predicate, - Constant*const * Ops, unsigned NumOps, - LLVMContext &Context, + Constant *const *Ops, unsigned NumOps, const TargetData *TD = 0); /// ConstantFoldLoadFromConstPtr - Return the value that a load from C would @@ -79,7 +75,7 @@ bool canConstantFoldCallTo(const Function *F); /// ConstantFoldCall - Attempt to constant fold a call to the specified function /// with the specified arguments, returning null if unsuccessful. Constant * -ConstantFoldCall(Function *F, Constant* const* Operands, unsigned NumOperands); +ConstantFoldCall(Function *F, Constant *const *Operands, unsigned NumOperands); } #endif diff --git a/include/llvm/Analysis/MemoryBuiltins.h b/include/llvm/Analysis/MemoryBuiltins.h index 5fd0bb09db..42721944b3 100644 --- a/include/llvm/Analysis/MemoryBuiltins.h +++ b/include/llvm/Analysis/MemoryBuiltins.h @@ -17,7 +17,6 @@ namespace llvm { class CallInst; -class LLVMContext; class PointerType; class TargetData; class Type; @@ -29,43 +28,42 @@ class Value; /// isMalloc - Returns true if the value is either a malloc call or a bitcast of /// the result of a malloc call -bool isMalloc(const Value* I); +bool isMalloc(const Value *I); /// extractMallocCall - Returns the corresponding CallInst if the instruction /// is a malloc call. Since CallInst::CreateMalloc() only creates calls, we /// ignore InvokeInst here. -const CallInst* extractMallocCall(const Value* I); -CallInst* extractMallocCall(Value* I); +const CallInst* extractMallocCall(const Value *I); +CallInst* extractMallocCall(Value *I); /// extractMallocCallFromBitCast - Returns the corresponding CallInst if the /// instruction is a bitcast of the result of a malloc call. -const CallInst* extractMallocCallFromBitCast(const Value* I); -CallInst* extractMallocCallFromBitCast(Value* I); +const CallInst* extractMallocCallFromBitCast(const Value *I); +CallInst* extractMallocCallFromBitCast(Value *I); /// isArrayMalloc - Returns the corresponding CallInst if the instruction /// is a call to malloc whose array size can be determined and the array size /// is not constant 1. Otherwise, return NULL. -CallInst* isArrayMalloc(Value* I, LLVMContext &Context, const TargetData* TD); -const CallInst* isArrayMalloc(const Value* I, LLVMContext &Context, - const TargetData* TD); +CallInst* isArrayMalloc(Value *I, const TargetData *TD); +const CallInst* isArrayMalloc(const Value *I, + const TargetData *TD); /// getMallocType - Returns the PointerType resulting from the malloc call. /// This PointerType is the result type of the call's only bitcast use. /// If there is no unique bitcast use, then return NULL. -const PointerType* getMallocType(const CallInst* CI); +const PointerType* getMallocType(const CallInst *CI); /// getMallocAllocatedType - Returns the Type allocated by malloc call. This /// Type is the result type of the call's only bitcast use. If there is no /// unique bitcast use, then return NULL. -const Type* getMallocAllocatedType(const CallInst* CI); +const Type* getMallocAllocatedType(const CallInst *CI); /// getMallocArraySize - Returns the array size of a malloc call. If the /// argument passed to malloc is a multiple of the size of the malloced type, /// then return that multiple. For non-array mallocs, the multiple is /// constant 1. Otherwise, return NULL for mallocs whose array size cannot be /// determined. -Value* getMallocArraySize(CallInst* CI, LLVMContext &Context, - const TargetData* TD); +Value* getMallocArraySize(CallInst *CI, const TargetData *TD); //===----------------------------------------------------------------------===// // free Call Utility Functions. diff --git a/include/llvm/GlobalVariable.h b/include/llvm/GlobalVariable.h index 56b2b9d3eb..428ce90fef 100644 --- a/include/llvm/GlobalVariable.h +++ b/include/llvm/GlobalVariable.h @@ -28,7 +28,6 @@ namespace llvm { class Module; class Constant; -class LLVMContext; template<typename ValueSubClass, typename ItemParentClass> class SymbolTableListTraits; @@ -50,8 +49,7 @@ public: } /// GlobalVariable ctor - If a parent module is specified, the global is /// automatically inserted into the end of the specified modules global list. - GlobalVariable(LLVMContext &Context, const Type *Ty, bool isConstant, - LinkageTypes Linkage, + GlobalVariable(const Type *Ty, bool isConstant, LinkageTypes Linkage, Constant *Initializer = 0, const Twine &Name = "", bool ThreadLocal = false, unsigned AddressSpace = 0); /// GlobalVariable ctor - This creates a global and inserts it before the diff --git a/include/llvm/Support/TargetFolder.h b/include/llvm/Support/TargetFolder.h index 18726e2cd5..a4b7d12841 100644 --- a/include/llvm/Support/TargetFolder.h +++ b/include/llvm/Support/TargetFolder.h @@ -26,24 +26,22 @@ namespace llvm { class TargetData; -class LLVMContext; /// TargetFolder - Create constants with target dependent folding. class TargetFolder { const TargetData *TD; - LLVMContext &Context; /// Fold - Fold the constant using target specific information. Constant *Fold(Constant *C) const { if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) - if (Constant *CF = ConstantFoldConstantExpression(CE, Context, TD)) + if (Constant *CF = ConstantFoldConstantExpression(CE, TD)) return CF; return C; } public: explicit TargetFolder(const TargetData *TheTD, LLVMContext &C) : - TD(TheTD), Context(C) {} + TD(TheTD) {} //===--------------------------------------------------------------------===// // Binary Operators |