forked from OSchip/llvm-project
Initialized arrays can be in any address space.
llvm-svn: 70297
This commit is contained in:
parent
604248e81f
commit
99b1b27dc2
|
@ -390,7 +390,7 @@ namespace llvm {
|
|||
void EmitXXStructorList(Constant *List);
|
||||
void EmitGlobalConstantStruct(const ConstantStruct* CVS,
|
||||
unsigned AddrSpace);
|
||||
void EmitGlobalConstantArray(const ConstantArray* CVA);
|
||||
void EmitGlobalConstantArray(const ConstantArray* CVA, unsigned AddrSpace);
|
||||
void EmitGlobalConstantVector(const ConstantVector* CP);
|
||||
void EmitGlobalConstantFP(const ConstantFP* CFP, unsigned AddrSpace);
|
||||
void EmitGlobalConstantLargeInt(const ConstantInt* CI, unsigned AddrSpace);
|
||||
|
|
|
@ -971,12 +971,13 @@ void AsmPrinter::EmitString(const ConstantArray *CVA) const {
|
|||
O << '\n';
|
||||
}
|
||||
|
||||
void AsmPrinter::EmitGlobalConstantArray(const ConstantArray *CVA) {
|
||||
void AsmPrinter::EmitGlobalConstantArray(const ConstantArray *CVA,
|
||||
unsigned AddrSpace) {
|
||||
if (CVA->isString()) {
|
||||
EmitString(CVA);
|
||||
} else { // Not a string. Print the values in successive locations
|
||||
for (unsigned i = 0, e = CVA->getNumOperands(); i != e; ++i)
|
||||
EmitGlobalConstant(CVA->getOperand(i));
|
||||
EmitGlobalConstant(CVA->getOperand(i), AddrSpace);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1233,7 +1234,7 @@ void AsmPrinter::EmitGlobalConstant(const Constant *CV, unsigned AddrSpace) {
|
|||
EmitZeros(Size, AddrSpace);
|
||||
return;
|
||||
} else if (const ConstantArray *CVA = dyn_cast<ConstantArray>(CV)) {
|
||||
EmitGlobalConstantArray(CVA);
|
||||
EmitGlobalConstantArray(CVA , AddrSpace);
|
||||
return;
|
||||
} else if (const ConstantStruct *CVS = dyn_cast<ConstantStruct>(CV)) {
|
||||
EmitGlobalConstantStruct(CVS, AddrSpace);
|
||||
|
|
Loading…
Reference in New Issue