mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
ConstantArray::get and ConstantStruct::get now just return pointers to
'Constant', instead of specific subclass pointers. In the future, these will return an instance of ConstantAggregateZero if all of the inputs are zeros. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11467 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -321,8 +321,8 @@ protected:
|
|||||||
ConstantArray(const ArrayType *T, const std::vector<Constant*> &Val);
|
ConstantArray(const ArrayType *T, const std::vector<Constant*> &Val);
|
||||||
public:
|
public:
|
||||||
/// get() - Static factory methods - Return objects of the specified value
|
/// get() - Static factory methods - Return objects of the specified value
|
||||||
static ConstantArray *get(const ArrayType *T, const std::vector<Constant*> &);
|
static Constant *get(const ArrayType *T, const std::vector<Constant*> &);
|
||||||
static ConstantArray *get(const std::string &Initializer);
|
static Constant *get(const std::string &Initializer);
|
||||||
|
|
||||||
/// getType - Specialize the getType() method to always return an ArrayType,
|
/// getType - Specialize the getType() method to always return an ArrayType,
|
||||||
/// which reduces the amount of casting needed in parts of the compiler.
|
/// which reduces the amount of casting needed in parts of the compiler.
|
||||||
@ -383,8 +383,7 @@ protected:
|
|||||||
ConstantStruct(const StructType *T, const std::vector<Constant*> &Val);
|
ConstantStruct(const StructType *T, const std::vector<Constant*> &Val);
|
||||||
public:
|
public:
|
||||||
/// get() - Static factory methods - Return objects of the specified value
|
/// get() - Static factory methods - Return objects of the specified value
|
||||||
static ConstantStruct *get(const StructType *T,
|
static Constant *get(const StructType *T, const std::vector<Constant*> &V);
|
||||||
const std::vector<Constant*> &V);
|
|
||||||
|
|
||||||
/// getType() specialization - Reduce amount of casting...
|
/// getType() specialization - Reduce amount of casting...
|
||||||
inline const StructType *getType() const {
|
inline const StructType *getType() const {
|
||||||
|
@ -786,7 +786,7 @@ namespace llvm {
|
|||||||
static ValueMap<std::vector<Constant*>, ArrayType,
|
static ValueMap<std::vector<Constant*>, ArrayType,
|
||||||
ConstantArray> ArrayConstants;
|
ConstantArray> ArrayConstants;
|
||||||
|
|
||||||
ConstantArray *ConstantArray::get(const ArrayType *Ty,
|
Constant *ConstantArray::get(const ArrayType *Ty,
|
||||||
const std::vector<Constant*> &V) {
|
const std::vector<Constant*> &V) {
|
||||||
return ArrayConstants.getOrCreate(Ty, V);
|
return ArrayConstants.getOrCreate(Ty, V);
|
||||||
}
|
}
|
||||||
@ -802,7 +802,7 @@ void ConstantArray::destroyConstant() {
|
|||||||
// contain the specified string. A null terminator is added to the specified
|
// contain the specified string. A null terminator is added to the specified
|
||||||
// string so that it may be used in a natural way...
|
// string so that it may be used in a natural way...
|
||||||
//
|
//
|
||||||
ConstantArray *ConstantArray::get(const std::string &Str) {
|
Constant *ConstantArray::get(const std::string &Str) {
|
||||||
std::vector<Constant*> ElementVals;
|
std::vector<Constant*> ElementVals;
|
||||||
|
|
||||||
for (unsigned i = 0; i < Str.length(); ++i)
|
for (unsigned i = 0; i < Str.length(); ++i)
|
||||||
@ -866,7 +866,7 @@ namespace llvm {
|
|||||||
static ValueMap<std::vector<Constant*>, StructType,
|
static ValueMap<std::vector<Constant*>, StructType,
|
||||||
ConstantStruct> StructConstants;
|
ConstantStruct> StructConstants;
|
||||||
|
|
||||||
ConstantStruct *ConstantStruct::get(const StructType *Ty,
|
Constant *ConstantStruct::get(const StructType *Ty,
|
||||||
const std::vector<Constant*> &V) {
|
const std::vector<Constant*> &V) {
|
||||||
return StructConstants.getOrCreate(Ty, V);
|
return StructConstants.getOrCreate(Ty, V);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user