diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-27 22:29:26 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-27 22:29:26 +0000 |
commit | 8fa3338ed2400c1352b137613d2c2c70d1ead695 (patch) | |
tree | 4e170be384fe7fcc54a6f686a6087729fc52ac0c /include | |
parent | f08583b5323801b001175c2a62ac3e3d258723ac (diff) | |
download | external_llvm-8fa3338ed2400c1352b137613d2c2c70d1ead695.zip external_llvm-8fa3338ed2400c1352b137613d2c2c70d1ead695.tar.gz external_llvm-8fa3338ed2400c1352b137613d2c2c70d1ead695.tar.bz2 |
Move ConstantStruct back to 2.5 API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77266 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Constants.h | 7 | ||||
-rw-r--r-- | include/llvm/LLVMContext.h | 12 |
2 files changed, 7 insertions, 12 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index f7b785a..af7187d 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -385,10 +385,15 @@ class ConstantStruct : public Constant { friend struct ConstantCreator<ConstantStruct, StructType, std::vector<Constant*> >; ConstantStruct(const ConstantStruct &); // DO NOT IMPLEMENT - friend class LLVMContextImpl; protected: ConstantStruct(const StructType *T, const std::vector<Constant*> &Val); public: + // ConstantStruct accessors + static Constant* get(const StructType* T, const std::vector<Constant*>& V); + static Constant* get(const std::vector<Constant*>& V, bool Packed = false); + static Constant* get(Constant* const *Vals, unsigned NumVals, + bool Packed = false); + /// Transparently provide more efficient getOperand methods. DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant); diff --git a/include/llvm/LLVMContext.h b/include/llvm/LLVMContext.h index 37f0cd1..8465e4d 100644 --- a/include/llvm/LLVMContext.h +++ b/include/llvm/LLVMContext.h @@ -57,6 +57,7 @@ class LLVMContext { friend class ConstantInt; friend class ConstantFP; + friend class ConstantStruct; public: LLVMContext(); ~LLVMContext(); @@ -78,14 +79,6 @@ public: // ConstantPointerNull accessors ConstantPointerNull* getConstantPointerNull(const PointerType* T); - - // ConstantStruct accessors - Constant* getConstantStruct(const StructType* T, - const std::vector<Constant*>& V); - Constant* getConstantStruct(const std::vector<Constant*>& V, - bool Packed = false); - Constant* getConstantStruct(Constant* const *Vals, unsigned NumVals, - bool Packed = false); // ConstantAggregateZero accessors ConstantAggregateZero* getConstantAggregateZero(const Type* Ty); @@ -233,14 +226,11 @@ public: void erase(MDNode *M); void erase(ConstantAggregateZero *Z); void erase(ConstantArray *Z); - void erase(ConstantStruct *S); void erase(ConstantVector *V); // RAUW helpers Constant *replaceUsesOfWithOnConstant(ConstantArray *CA, Value *From, Value *To, Use *U); - Constant *replaceUsesOfWithOnConstant(ConstantStruct *CS, Value *From, - Value *To, Use *U); }; /// FOR BACKWARDS COMPATIBILITY - Returns a global context. |