mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 06:33:24 +00:00
Don't use default address space arguments in GlobalOpt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207019 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
99bf4b758f
commit
0f31056e7a
@ -1170,10 +1170,13 @@ static Value *GetHeapSROAValue(Value *V, unsigned FieldNo,
|
||||
} else if (PHINode *PN = dyn_cast<PHINode>(V)) {
|
||||
// PN's type is pointer to struct. Make a new PHI of pointer to struct
|
||||
// field.
|
||||
StructType *ST = cast<StructType>(PN->getType()->getPointerElementType());
|
||||
|
||||
PointerType *PTy = cast<PointerType>(PN->getType());
|
||||
StructType *ST = cast<StructType>(PTy->getElementType());
|
||||
|
||||
unsigned AS = PTy->getAddressSpace();
|
||||
PHINode *NewPN =
|
||||
PHINode::Create(PointerType::getUnqual(ST->getElementType(FieldNo)),
|
||||
PHINode::Create(PointerType::get(ST->getElementType(FieldNo), AS),
|
||||
PN->getNumIncomingValues(),
|
||||
PN->getName()+".f"+Twine(FieldNo), PN);
|
||||
Result = NewPN;
|
||||
@ -1285,9 +1288,10 @@ static GlobalVariable *PerformHeapAllocSRoA(GlobalVariable *GV, CallInst *CI,
|
||||
std::vector<Value*> FieldGlobals;
|
||||
std::vector<Value*> FieldMallocs;
|
||||
|
||||
unsigned AS = GV->getType()->getPointerAddressSpace();
|
||||
for (unsigned FieldNo = 0, e = STy->getNumElements(); FieldNo != e;++FieldNo){
|
||||
Type *FieldTy = STy->getElementType(FieldNo);
|
||||
PointerType *PFieldTy = PointerType::getUnqual(FieldTy);
|
||||
PointerType *PFieldTy = PointerType::get(FieldTy, AS);
|
||||
|
||||
GlobalVariable *NGV =
|
||||
new GlobalVariable(*GV->getParent(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user