mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 00:17:01 +00:00
Add some cleanup to the DataLayout changes requested by Chandler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166607 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -126,10 +126,9 @@ const MCExpr *nvptx::LowerConstant(const Constant *CV, AsmPrinter &AP) {
|
||||
return Base;
|
||||
|
||||
// Truncate/sext the offset to the pointer size.
|
||||
unsigned AS = PtrVal->getType()->isPointerTy() ?
|
||||
cast<PointerType>(PtrVal->getType())->getAddressSpace() : 0;
|
||||
if (TD.getPointerSizeInBits(AS) != 64) {
|
||||
int SExtAmount = 64-TD.getPointerSizeInBits(AS);
|
||||
unsigned PtrSize = TD.getPointerTypeSizeInBits(PtrVal->getType());
|
||||
if (PtrSize != 64) {
|
||||
int SExtAmount = 64-PtrSize;
|
||||
Offset = (Offset << SExtAmount) >> SExtAmount;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user