Index: include/llvm/IR/DataLayout.h =================================================================== --- include/llvm/IR/DataLayout.h +++ include/llvm/IR/DataLayout.h @@ -309,19 +309,13 @@ } /// Layout pointer alignment - /// FIXME: The defaults need to be removed once all of - /// the backends/clients are updated. - unsigned getPointerABIAlignment(unsigned AS = 0) const; + unsigned getPointerABIAlignment(unsigned AS) const; /// Return target's alignment for stack-based pointers - /// FIXME: The defaults need to be removed once all of - /// the backends/clients are updated. - unsigned getPointerPrefAlignment(unsigned AS = 0) const; + unsigned getPointerPrefAlignment(unsigned AS) const; /// Layout pointer size - /// FIXME: The defaults need to be removed once all of - /// the backends/clients are updated. - unsigned getPointerSize(unsigned AS = 0) const; + unsigned getPointerSize(unsigned AS) const; /// Return the address spaces containing non-integral pointers. Pointers in /// this address space don't have a well-defined bitwise representation. Index: include/llvm/Target/TargetMachine.h =================================================================== --- include/llvm/Target/TargetMachine.h +++ include/llvm/Target/TargetMachine.h @@ -135,7 +135,7 @@ /// Get the pointer size for this target. /// /// This is the only time the DataLayout in the TargetMachine is used. - unsigned getPointerSize() const { return DL.getPointerSize(); } + unsigned getPointerSize() const { return DL.getPointerSize(0); } /// \brief Reset the target options based on the function's attributes. // FIXME: Remove TargetOptions that affect per-function code generation Index: lib/CodeGen/AsmPrinter/AddressPool.cpp =================================================================== --- lib/CodeGen/AsmPrinter/AddressPool.cpp +++ lib/CodeGen/AsmPrinter/AddressPool.cpp @@ -39,5 +39,5 @@ : MCSymbolRefExpr::create(I.first, Asm.OutContext); for (const MCExpr *Entry : Entries) - Asm.OutStreamer->EmitValue(Entry, Asm.getDataLayout().getPointerSize()); + Asm.OutStreamer->EmitValue(Entry, Asm.getDataLayout().getPointerSize(0)); } Index: lib/CodeGen/AsmPrinter/AsmPrinter.cpp =================================================================== --- lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -1300,7 +1300,7 @@ for (const auto &Stub : Stubs) { OutStreamer->EmitLabel(Stub.first); OutStreamer->EmitSymbolValue(Stub.second.getPointer(), - DL.getPointerSize()); + DL.getPointerSize(0)); } } } @@ -1762,7 +1762,7 @@ } // Emit the function pointers in the target-specific order - unsigned Align = Log2_32(DL.getPointerPrefAlignment()); + unsigned Align = Log2_32(DL.getPointerPrefAlignment(0)); std::stable_sort(Structors.begin(), Structors.end(), [](const Structor &L, const Structor &R) { return L.Priority < R.Priority; }); Index: lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp =================================================================== --- lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp +++ lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp @@ -122,7 +122,7 @@ default: llvm_unreachable("Invalid encoded value."); case dwarf::DW_EH_PE_absptr: - return MF->getDataLayout().getPointerSize(); + return MF->getDataLayout().getPointerSize(0); case dwarf::DW_EH_PE_udata2: return 2; case dwarf::DW_EH_PE_udata4: Index: lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp =================================================================== --- lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -177,7 +177,7 @@ // TODO: add debug info for emulated thread local mode. } else { // FIXME: Make this work with -gsplit-dwarf. - unsigned PointerSize = Asm->getDataLayout().getPointerSize(); + unsigned PointerSize = Asm->getDataLayout().getPointerSize(0); assert((PointerSize == 4 || PointerSize == 8) && "Add support for other sizes if necessary"); // Based on GCC's support for TLS: Index: lib/CodeGen/AsmPrinter/EHStreamer.cpp =================================================================== --- lib/CodeGen/AsmPrinter/EHStreamer.cpp +++ lib/CodeGen/AsmPrinter/EHStreamer.cpp @@ -398,7 +398,7 @@ // that we're omitting that bit. TTypeEncoding = dwarf::DW_EH_PE_omit; // dwarf::DW_EH_PE_absptr - TypeFormatSize = Asm->getDataLayout().getPointerSize(); + TypeFormatSize = Asm->getDataLayout().getPointerSize(0); } else { // Okay, we have actual filters or typeinfos to emit. As such, we need to // pick a type encoding for them. We're about to emit a list of pointers to Index: lib/CodeGen/AsmPrinter/ErlangGCPrinter.cpp =================================================================== --- lib/CodeGen/AsmPrinter/ErlangGCPrinter.cpp +++ lib/CodeGen/AsmPrinter/ErlangGCPrinter.cpp @@ -45,7 +45,7 @@ void ErlangGCPrinter::finishAssembly(Module &M, GCModuleInfo &Info, AsmPrinter &AP) { MCStreamer &OS = *AP.OutStreamer; - unsigned IntPtrSize = M.getDataLayout().getPointerSize(); + unsigned IntPtrSize = M.getDataLayout().getPointerSize(0); // Put this in a custom .note section. OS.SwitchSection( Index: lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp =================================================================== --- lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp +++ lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp @@ -98,7 +98,7 @@ /// void OcamlGCMetadataPrinter::finishAssembly(Module &M, GCModuleInfo &Info, AsmPrinter &AP) { - unsigned IntPtrSize = M.getDataLayout().getPointerSize(); + unsigned IntPtrSize = M.getDataLayout().getPointerSize(0); AP.OutStreamer->SwitchSection(AP.getObjFileLowering().getTextSection()); EmitCamlGlobal(M, AP, "code_end"); Index: lib/CodeGen/GlobalISel/CallLowering.cpp =================================================================== --- lib/CodeGen/GlobalISel/CallLowering.cpp +++ lib/CodeGen/GlobalISel/CallLowering.cpp @@ -136,7 +136,7 @@ Handler.assignValueToReg(Args[i].Reg, VA.getLocReg(), VA); else if (VA.isMemLoc()) { unsigned Size = VA.getValVT() == MVT::iPTR - ? DL.getPointerSize() + ? DL.getPointerSize(0) : alignTo(VA.getValVT().getSizeInBits(), 8) / 8; unsigned Offset = VA.getLocMemOffset(); MachinePointerInfo MPO; Index: lib/CodeGen/GlobalISel/IRTranslator.cpp =================================================================== --- lib/CodeGen/GlobalISel/IRTranslator.cpp +++ lib/CodeGen/GlobalISel/IRTranslator.cpp @@ -559,7 +559,7 @@ MachineMemOperand::MODereferenceable; *MemRefs = MF->getMachineMemOperand(MPInfo, Flags, DL->getPointerSizeInBits() / 8, - DL->getPointerABIAlignment()); + DL->getPointerABIAlignment(0)); MIB.setMemRefs(MemRefs, MemRefs + 1); } Index: lib/CodeGen/MachineFunction.cpp =================================================================== --- lib/CodeGen/MachineFunction.cpp +++ lib/CodeGen/MachineFunction.cpp @@ -763,7 +763,7 @@ // address of a block, in which case it is the pointer size. switch (getEntryKind()) { case MachineJumpTableInfo::EK_BlockAddress: - return TD.getPointerSize(); + return TD.getPointerSize(0); case MachineJumpTableInfo::EK_GPRel64BlockAddress: return 8; case MachineJumpTableInfo::EK_GPRel32BlockAddress: @@ -783,7 +783,7 @@ // alignment. switch (getEntryKind()) { case MachineJumpTableInfo::EK_BlockAddress: - return TD.getPointerABIAlignment(); + return TD.getPointerABIAlignment(0); case MachineJumpTableInfo::EK_GPRel64BlockAddress: return TD.getABIIntegerTypeAlignment(64); case MachineJumpTableInfo::EK_GPRel32BlockAddress: Index: lib/CodeGen/TargetLoweringBase.cpp =================================================================== --- lib/CodeGen/TargetLoweringBase.cpp +++ lib/CodeGen/TargetLoweringBase.cpp @@ -1287,7 +1287,7 @@ } MachineMemOperand *MMO = MF.getMachineMemOperand( MachinePointerInfo::getFixedStack(MF, FI), Flags, - MF.getDataLayout().getPointerSize(), MFI.getObjectAlignment(FI)); + MF.getDataLayout().getPointerSize(0), MFI.getObjectAlignment(FI)); MIB->addMemOperand(MF, MMO); // Replace the instruction and update the operand index. Index: lib/CodeGen/TargetLoweringObjectFileImpl.cpp =================================================================== --- lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -132,9 +132,9 @@ unsigned Flags = ELF::SHF_ALLOC | ELF::SHF_WRITE | ELF::SHF_GROUP; MCSection *Sec = getContext().getELFNamedSection(".data", Label->getName(), ELF::SHT_PROGBITS, Flags, 0); - unsigned Size = DL.getPointerSize(); + unsigned Size = DL.getPointerSize(0); Streamer.SwitchSection(Sec); - Streamer.EmitValueToAlignment(DL.getPointerABIAlignment()); + Streamer.EmitValueToAlignment(DL.getPointerABIAlignment(0)); Streamer.EmitSymbolAttribute(Label, MCSA_ELF_TypeObject); const MCExpr *E = MCConstantExpr::create(Size, getContext()); Streamer.emitELFSize(Label, E); Index: lib/ExecutionEngine/ExecutionEngine.cpp =================================================================== --- lib/ExecutionEngine/ExecutionEngine.cpp +++ lib/ExecutionEngine/ExecutionEngine.cpp @@ -341,7 +341,7 @@ const std::vector &InputArgv) { Values.clear(); // Free the old contents. Values.reserve(InputArgv.size()); - unsigned PtrSize = EE->getDataLayout().getPointerSize(); + unsigned PtrSize = EE->getDataLayout().getPointerSize(0); Array = make_unique((InputArgv.size()+1)*PtrSize); DEBUG(dbgs() << "JIT: ARGV = " << (void*)Array.get() << "\n"); @@ -416,7 +416,7 @@ #ifndef NDEBUG /// isTargetNullPtr - Return whether the target pointer stored at Loc is null. static bool isTargetNullPtr(ExecutionEngine *EE, void *Loc) { - unsigned PtrSize = EE->getDataLayout().getPointerSize(); + unsigned PtrSize = EE->getDataLayout().getPointerSize(0); for (unsigned i = 0; i < PtrSize; ++i) if (*(i + (uint8_t*)Loc)) return false; Index: lib/IR/Mangler.cpp =================================================================== --- lib/IR/Mangler.cpp +++ lib/IR/Mangler.cpp @@ -99,7 +99,7 @@ if (AI->hasByValOrInAllocaAttr()) Ty = cast(Ty)->getElementType(); // Size should be aligned to pointer size. - unsigned PtrSize = DL.getPointerSize(); + unsigned PtrSize = DL.getPointerSize(0); ArgWords += alignTo(DL.getTypeAllocSize(Ty), PtrSize); } Index: lib/Target/MSP430/MSP430ISelLowering.cpp =================================================================== --- lib/Target/MSP430/MSP430ISelLowering.cpp +++ lib/Target/MSP430/MSP430ISelLowering.cpp @@ -1222,7 +1222,7 @@ if (ReturnAddrIndex == 0) { // Set up a frame object for the return address. - uint64_t SlotSize = MF.getDataLayout().getPointerSize(); + uint64_t SlotSize = MF.getDataLayout().getPointerSize(0); ReturnAddrIndex = MF.getFrameInfo().CreateFixedObject(SlotSize, -SlotSize, true); FuncInfo->setRAIndex(ReturnAddrIndex); @@ -1246,7 +1246,7 @@ if (Depth > 0) { SDValue FrameAddr = LowerFRAMEADDR(Op, DAG); SDValue Offset = - DAG.getConstant(DAG.getDataLayout().getPointerSize(), dl, MVT::i16); + DAG.getConstant(DAG.getDataLayout().getPointerSize(0), dl, MVT::i16); return DAG.getLoad(PtrVT, dl, DAG.getEntryNode(), DAG.getNode(ISD::ADD, dl, PtrVT, FrameAddr, Offset), MachinePointerInfo()); Index: lib/Target/NVPTX/NVPTXAsmPrinter.cpp =================================================================== --- lib/Target/NVPTX/NVPTXAsmPrinter.cpp +++ lib/Target/NVPTX/NVPTXAsmPrinter.cpp @@ -1481,7 +1481,7 @@ auto *FTy = dyn_cast(Ty); if (FTy) - return DL.getPointerPrefAlignment(); + return DL.getPointerPrefAlignment(0); return DL.getPrefTypeAlignment(Ty); } Index: lib/Target/X86/X86FastISel.cpp =================================================================== --- lib/Target/X86/X86FastISel.cpp +++ lib/Target/X86/X86FastISel.cpp @@ -3772,7 +3772,7 @@ addDirectMem(MIB, AddrReg); MachineMemOperand *MMO = FuncInfo.MF->getMachineMemOperand( MachinePointerInfo::getConstantPool(*FuncInfo.MF), - MachineMemOperand::MOLoad, DL.getPointerSize(), Align); + MachineMemOperand::MOLoad, DL.getPointerSize(0), Align); MIB->addMemOperand(*FuncInfo.MF, MMO); return ResultReg; } Index: lib/Target/X86/X86ISelLowering.cpp =================================================================== --- lib/Target/X86/X86ISelLowering.cpp +++ lib/Target/X86/X86ISelLowering.cpp @@ -14887,7 +14887,7 @@ auto &DL = DAG.getDataLayout(); SDValue Scale = - DAG.getConstant(Log2_64_Ceil(DL.getPointerSize()), dl, PtrVT); + DAG.getConstant(Log2_64_Ceil(DL.getPointerSize(0)), dl, PtrVT); IDX = DAG.getNode(ISD::SHL, dl, PtrVT, IDX, Scale); res = DAG.getNode(ISD::ADD, dl, PtrVT, ThreadPointer, IDX); Index: lib/Transforms/IPO/WholeProgramDevirt.cpp =================================================================== --- lib/Transforms/IPO/WholeProgramDevirt.cpp +++ lib/Transforms/IPO/WholeProgramDevirt.cpp @@ -1030,7 +1030,7 @@ return; // Align each byte array to pointer width. - unsigned PointerSize = M.getDataLayout().getPointerSize(); + unsigned PointerSize = M.getDataLayout().getPointerSize(0); B.Before.Bytes.resize(alignTo(B.Before.Bytes.size(), PointerSize)); B.After.Bytes.resize(alignTo(B.After.Bytes.size(), PointerSize));