summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/MC/MCObjectFileInfo.h7
-rw-r--r--llvm/lib/MC/MCObjectFileInfo.cpp33
-rw-r--r--llvm/lib/Object/ModuleSymbolTable.cpp2
-rw-r--r--llvm/lib/Target/TargetLoweringObjectFile.cpp4
-rw-r--r--llvm/test/ExecutionEngine/RuntimeDyld/AArch64/MachO_ARM64_relocations.s2
-rw-r--r--llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_Mips64r2N64_PIC_relocations.s4
-rw-r--r--llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_N32_relocations.s4
-rw-r--r--llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_N64R6_relocations.s4
-rw-r--r--llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_O32R6_relocations.s4
-rw-r--r--llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_O32_PIC_relocations.s4
-rw-r--r--llvm/test/ExecutionEngine/RuntimeDyld/X86/ELF_x86-64_PIC-small-relocations.s2
-rw-r--r--llvm/test/MC/ELF/cfi-large-model.s2
-rw-r--r--llvm/tools/dsymutil/DwarfLinker.cpp2
-rw-r--r--llvm/tools/llvm-dwp/llvm-dwp.cpp2
-rw-r--r--llvm/tools/llvm-mc/llvm-mc.cpp20
-rw-r--r--llvm/tools/llvm-objdump/llvm-objdump.cpp2
-rw-r--r--llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp2
17 files changed, 41 insertions, 59 deletions
diff --git a/llvm/include/llvm/MC/MCObjectFileInfo.h b/llvm/include/llvm/MC/MCObjectFileInfo.h
index 4d634447987..b03fd099c1d 100644
--- a/llvm/include/llvm/MC/MCObjectFileInfo.h
+++ b/llvm/include/llvm/MC/MCObjectFileInfo.h
@@ -191,8 +191,8 @@ protected:
MCSection *SXDataSection;
public:
- void InitMCObjectFileInfo(const Triple &TT, bool PIC, CodeModel::Model CM,
- MCContext &ctx);
+ void InitMCObjectFileInfo(const Triple &TT, bool PIC, MCContext &ctx,
+ bool LargeCodeModel = false);
bool getSupportsWeakOmittedEHFrame() const {
return SupportsWeakOmittedEHFrame;
@@ -350,12 +350,11 @@ public:
private:
Environment Env;
bool PositionIndependent;
- CodeModel::Model CMModel;
MCContext *Ctx;
Triple TT;
void initMachOMCObjectFileInfo(const Triple &T);
- void initELFMCObjectFileInfo(const Triple &T);
+ void initELFMCObjectFileInfo(const Triple &T, bool Large);
void initCOFFMCObjectFileInfo(const Triple &T);
void initWasmMCObjectFileInfo(const Triple &T);
diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp
index 21c5516785e..73288110ad8 100644
--- a/llvm/lib/MC/MCObjectFileInfo.cpp
+++ b/llvm/lib/MC/MCObjectFileInfo.cpp
@@ -274,7 +274,7 @@ void MCObjectFileInfo::initMachOMCObjectFileInfo(const Triple &T) {
TLSExtraDataSection = TLSTLVSection;
}
-void MCObjectFileInfo::initELFMCObjectFileInfo(const Triple &T) {
+void MCObjectFileInfo::initELFMCObjectFileInfo(const Triple &T, bool Large) {
switch (T.getArch()) {
case Triple::mips:
case Triple::mipsel:
@@ -286,8 +286,7 @@ void MCObjectFileInfo::initELFMCObjectFileInfo(const Triple &T) {
break;
case Triple::x86_64:
FDECFIEncoding = dwarf::DW_EH_PE_pcrel |
- ((CMModel == CodeModel::Large) ? dwarf::DW_EH_PE_sdata8
- : dwarf::DW_EH_PE_sdata4);
+ (Large ? dwarf::DW_EH_PE_sdata8 : dwarf::DW_EH_PE_sdata4);
break;
case Triple::bpfel:
case Triple::bpfeb:
@@ -324,23 +323,18 @@ void MCObjectFileInfo::initELFMCObjectFileInfo(const Triple &T) {
break;
case Triple::x86_64:
if (PositionIndependent) {
- PersonalityEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel |
- ((CMModel == CodeModel::Small || CMModel == CodeModel::Medium)
- ? dwarf::DW_EH_PE_sdata4 : dwarf::DW_EH_PE_sdata8);
+ PersonalityEncoding =
+ dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel |
+ (Large ? dwarf::DW_EH_PE_sdata8 : dwarf::DW_EH_PE_sdata4);
LSDAEncoding = dwarf::DW_EH_PE_pcrel |
- (CMModel == CodeModel::Small
- ? dwarf::DW_EH_PE_sdata4 : dwarf::DW_EH_PE_sdata8);
+ (Large ? dwarf::DW_EH_PE_sdata8 : dwarf::DW_EH_PE_sdata4);
TTypeEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel |
- ((CMModel == CodeModel::Small || CMModel == CodeModel::Medium)
- ? dwarf::DW_EH_PE_sdata4 : dwarf::DW_EH_PE_sdata8);
+ (Large ? dwarf::DW_EH_PE_sdata8 : dwarf::DW_EH_PE_sdata4);
} else {
PersonalityEncoding =
- (CMModel == CodeModel::Small || CMModel == CodeModel::Medium)
- ? dwarf::DW_EH_PE_udata4 : dwarf::DW_EH_PE_absptr;
- LSDAEncoding = (CMModel == CodeModel::Small)
- ? dwarf::DW_EH_PE_udata4 : dwarf::DW_EH_PE_absptr;
- TTypeEncoding = (CMModel == CodeModel::Small)
- ? dwarf::DW_EH_PE_udata4 : dwarf::DW_EH_PE_absptr;
+ Large ? dwarf::DW_EH_PE_absptr : dwarf::DW_EH_PE_udata4;
+ LSDAEncoding = Large ? dwarf::DW_EH_PE_absptr : dwarf::DW_EH_PE_udata4;
+ TTypeEncoding = Large ? dwarf::DW_EH_PE_absptr : dwarf::DW_EH_PE_udata4;
}
break;
case Triple::hexagon:
@@ -849,10 +843,9 @@ void MCObjectFileInfo::initWasmMCObjectFileInfo(const Triple &T) {
}
void MCObjectFileInfo::InitMCObjectFileInfo(const Triple &TheTriple, bool PIC,
- CodeModel::Model cm,
- MCContext &ctx) {
+ MCContext &ctx,
+ bool LargeCodeModel) {
PositionIndependent = PIC;
- CMModel = cm;
Ctx = &ctx;
// Common.
@@ -890,7 +883,7 @@ void MCObjectFileInfo::InitMCObjectFileInfo(const Triple &TheTriple, bool PIC,
break;
case Triple::ELF:
Env = IsELF;
- initELFMCObjectFileInfo(TT);
+ initELFMCObjectFileInfo(TT, LargeCodeModel);
break;
case Triple::Wasm:
Env = IsWasm;
diff --git a/llvm/lib/Object/ModuleSymbolTable.cpp b/llvm/lib/Object/ModuleSymbolTable.cpp
index f2e7a218c13..64446525b91 100644
--- a/llvm/lib/Object/ModuleSymbolTable.cpp
+++ b/llvm/lib/Object/ModuleSymbolTable.cpp
@@ -175,7 +175,7 @@ void ModuleSymbolTable::CollectAsmSymbols(
MCObjectFileInfo MOFI;
MCContext MCCtx(MAI.get(), MRI.get(), &MOFI);
- MOFI.InitMCObjectFileInfo(TT, /*PIC*/ false, CodeModel::Default, MCCtx);
+ MOFI.InitMCObjectFileInfo(TT, /*PIC*/ false, MCCtx);
RecordStreamer Streamer(MCCtx);
T->createNullTargetStreamer(Streamer);
diff --git a/llvm/lib/Target/TargetLoweringObjectFile.cpp b/llvm/lib/Target/TargetLoweringObjectFile.cpp
index f941891f318..6417542e115 100644
--- a/llvm/lib/Target/TargetLoweringObjectFile.cpp
+++ b/llvm/lib/Target/TargetLoweringObjectFile.cpp
@@ -46,8 +46,8 @@ void TargetLoweringObjectFile::Initialize(MCContext &ctx,
// `Initialize` can be called more than once.
delete Mang;
Mang = new Mangler();
- InitMCObjectFileInfo(TM.getTargetTriple(), TM.isPositionIndependent(),
- TM.getCodeModel(), *Ctx);
+ InitMCObjectFileInfo(TM.getTargetTriple(), TM.isPositionIndependent(), *Ctx,
+ TM.getCodeModel() == CodeModel::Large);
}
TargetLoweringObjectFile::~TargetLoweringObjectFile() {
diff --git a/llvm/test/ExecutionEngine/RuntimeDyld/AArch64/MachO_ARM64_relocations.s b/llvm/test/ExecutionEngine/RuntimeDyld/AArch64/MachO_ARM64_relocations.s
index 25b3cd9fefe..7b7ee59be1a 100644
--- a/llvm/test/ExecutionEngine/RuntimeDyld/AArch64/MachO_ARM64_relocations.s
+++ b/llvm/test/ExecutionEngine/RuntimeDyld/AArch64/MachO_ARM64_relocations.s
@@ -1,4 +1,4 @@
-# RUN: llvm-mc -triple=arm64-apple-ios7.0.0 -code-model=small -filetype=obj -o %T/foo.o %s
+# RUN: llvm-mc -triple=arm64-apple-ios7.0.0 -filetype=obj -o %T/foo.o %s
# RUN: llvm-rtdyld -triple=arm64-apple-ios7.0.0 -map-section foo.o,__text=0x10bc0 -verify -check=%s %/T/foo.o
.section __TEXT,__text,regular,pure_instructions
diff --git a/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_Mips64r2N64_PIC_relocations.s b/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_Mips64r2N64_PIC_relocations.s
index 688580ddf07..95de5bcdb57 100644
--- a/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_Mips64r2N64_PIC_relocations.s
+++ b/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_Mips64r2N64_PIC_relocations.s
@@ -1,8 +1,8 @@
-# RUN: llvm-mc -triple=mips64el-unknown-linux -code-model=small -filetype=obj -o %T/test_ELF_Mips64N64.o %s
+# RUN: llvm-mc -triple=mips64el-unknown-linux -filetype=obj -o %T/test_ELF_Mips64N64.o %s
# RUN: llc -mtriple=mips64el-unknown-linux -filetype=obj -o %T/test_ELF_ExternalFunction_Mips64N64.o %S/Inputs/ExternalFunction.ll
# RUN: llvm-rtdyld -triple=mips64el-unknown-linux -verify -map-section test_ELF_Mips64N64.o,.text=0x1000 -map-section test_ELF_ExternalFunction_Mips64N64.o,.text=0x10000 -check=%s %/T/test_ELF_Mips64N64.o %T/test_ELF_ExternalFunction_Mips64N64.o
-# RUN: llvm-mc -triple=mips64-unknown-linux -code-model=small -filetype=obj -o %T/test_ELF_Mips64N64.o %s
+# RUN: llvm-mc -triple=mips64-unknown-linux -filetype=obj -o %T/test_ELF_Mips64N64.o %s
# RUN: llc -mtriple=mips64-unknown-linux -filetype=obj -o %T/test_ELF_ExternalFunction_Mips64N64.o %S/Inputs/ExternalFunction.ll
# RUN: llvm-rtdyld -triple=mips64-unknown-linux -verify -map-section test_ELF_Mips64N64.o,.text=0x1000 -map-section test_ELF_ExternalFunction_Mips64N64.o,.text=0x10000 -check=%s %/T/test_ELF_Mips64N64.o %T/test_ELF_ExternalFunction_Mips64N64.o
diff --git a/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_N32_relocations.s b/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_N32_relocations.s
index 98e86859458..168687a2305 100644
--- a/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_N32_relocations.s
+++ b/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_N32_relocations.s
@@ -1,8 +1,8 @@
-# RUN: llvm-mc -triple=mips64el-unknown-linux -target-abi n32 -code-model=small -filetype=obj -o %T/test_ELF_N32.o %s
+# RUN: llvm-mc -triple=mips64el-unknown-linux -target-abi n32 -filetype=obj -o %T/test_ELF_N32.o %s
# RUN: llc -mtriple=mips64el-unknown-linux -target-abi n32 -filetype=obj -o %T/test_ELF_ExternalFunction_N32.o %S/Inputs/ExternalFunction.ll
# RUN: llvm-rtdyld -triple=mips64el-unknown-linux -verify -map-section test_ELF_N32.o,.text=0x1000 -map-section test_ELF_ExternalFunction_N32.o,.text=0x10000 -check=%s %/T/test_ELF_N32.o %T/test_ELF_ExternalFunction_N32.o
-# RUN: llvm-mc -triple=mips64-unknown-linux -target-abi n32 -code-model=small -filetype=obj -o %T/test_ELF_N32.o %s
+# RUN: llvm-mc -triple=mips64-unknown-linux -target-abi n32 -filetype=obj -o %T/test_ELF_N32.o %s
# RUN: llc -mtriple=mips64-unknown-linux -target-abi n32 -filetype=obj -o %T/test_ELF_ExternalFunction_N32.o %S/Inputs/ExternalFunction.ll
# RUN: llvm-rtdyld -triple=mips64-unknown-linux -verify -map-section test_ELF_N32.o,.text=0x1000 -map-section test_ELF_ExternalFunction_N32.o,.text=0x10000 -check=%s %/T/test_ELF_N32.o %T/test_ELF_ExternalFunction_N32.o
diff --git a/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_N64R6_relocations.s b/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_N64R6_relocations.s
index ecd817244c5..8513cef6c56 100644
--- a/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_N64R6_relocations.s
+++ b/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_N64R6_relocations.s
@@ -1,8 +1,8 @@
-# RUN: llvm-mc -triple=mips64el-unknown-linux -mcpu=mips64r6 -code-model=small -filetype=obj -o %T/test_ELF_N64R6.o %s
+# RUN: llvm-mc -triple=mips64el-unknown-linux -mcpu=mips64r6 -filetype=obj -o %T/test_ELF_N64R6.o %s
# RUN: llc -mtriple=mips64el-unknown-linux -mcpu=mips64r6 -filetype=obj -o %T/test_ELF_ExternalFunction_N64R6.o %S/Inputs/ExternalFunction.ll
# RUN: llvm-rtdyld -triple=mips64el-unknown-linux -mcpu=mips64r6 -verify -map-section test_ELF_N64R6.o,.text=0x1000 -map-section test_ELF_ExternalFunction_N64R6.o,.text=0x10000 -check=%s %/T/test_ELF_N64R6.o %T/test_ELF_ExternalFunction_N64R6.o
-# RUN: llvm-mc -triple=mips64-unknown-linux -mcpu=mips64r6 -code-model=small -filetype=obj -o %T/test_ELF_N64R6.o %s
+# RUN: llvm-mc -triple=mips64-unknown-linux -mcpu=mips64r6 -filetype=obj -o %T/test_ELF_N64R6.o %s
# RUN: llc -mtriple=mips64-unknown-linux -mcpu=mips64r6 -filetype=obj -o %T/test_ELF_ExternalFunction_N64R6.o %S/Inputs/ExternalFunction.ll
# RUN: llvm-rtdyld -triple=mips64-unknown-linux -mcpu=mips64r6 -verify -map-section test_ELF_N64R6.o,.text=0x1000 -map-section test_ELF_ExternalFunction_N64R6.o,.text=0x10000 -check=%s %/T/test_ELF_N64R6.o %T/test_ELF_ExternalFunction_N64R6.o
diff --git a/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_O32R6_relocations.s b/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_O32R6_relocations.s
index 941c8b2f916..2d8a48b6991 100644
--- a/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_O32R6_relocations.s
+++ b/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_O32R6_relocations.s
@@ -1,8 +1,8 @@
-# RUN: llvm-mc -triple=mipsel-unknown-linux -mcpu=mips32r6 -code-model=small -filetype=obj -o %T/test_ELF_O32R6.o %s
+# RUN: llvm-mc -triple=mipsel-unknown-linux -mcpu=mips32r6 -filetype=obj -o %T/test_ELF_O32R6.o %s
# RUN: llc -mtriple=mipsel-unknown-linux -mcpu=mips32r6 -filetype=obj -o %T/test_ELF_ExternalFunction_O32R6.o %S/Inputs/ExternalFunction.ll
# RUN: llvm-rtdyld -triple=mipsel-unknown-linux -mcpu=mips32r6 -verify -map-section test_ELF_O32R6.o,.text=0x1000 -map-section test_ELF_ExternalFunction_O32R6.o,.text=0x10000 -check=%s %/T/test_ELF_O32R6.o %T/test_ELF_ExternalFunction_O32R6.o
-# RUN: llvm-mc -triple=mips-unknown-linux -mcpu=mips32r6 -code-model=small -filetype=obj -o %T/test_ELF_O32R6.o %s
+# RUN: llvm-mc -triple=mips-unknown-linux -mcpu=mips32r6 -filetype=obj -o %T/test_ELF_O32R6.o %s
# RUN: llc -mtriple=mips-unknown-linux -mcpu=mips32r6 -filetype=obj -o %T/test_ELF_ExternalFunction_O32R6.o %S/Inputs/ExternalFunction.ll
# RUN: llvm-rtdyld -triple=mips-unknown-linux -mcpu=mips32r6 -verify -map-section test_ELF_O32R6.o,.text=0x1000 -map-section test_ELF_ExternalFunction_O32R6.o,.text=0x10000 -check=%s %/T/test_ELF_O32R6.o %T/test_ELF_ExternalFunction_O32R6.o
diff --git a/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_O32_PIC_relocations.s b/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_O32_PIC_relocations.s
index 086dd92d21c..bee0a94b3d0 100644
--- a/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_O32_PIC_relocations.s
+++ b/llvm/test/ExecutionEngine/RuntimeDyld/Mips/ELF_O32_PIC_relocations.s
@@ -1,8 +1,8 @@
-# RUN: llvm-mc -triple=mipsel-unknown-linux -code-model=small -filetype=obj -o %T/test_ELF_O32.o %s
+# RUN: llvm-mc -triple=mipsel-unknown-linux -filetype=obj -o %T/test_ELF_O32.o %s
# RUN: llc -mtriple=mipsel-unknown-linux -filetype=obj -o %T/test_ELF_ExternalFunction_O32.o %S/Inputs/ExternalFunction.ll
# RUN: llvm-rtdyld -triple=mipsel-unknown-linux -verify -map-section test_ELF_O32.o,"<common symbols>"=0x7FF8 -map-section test_ELF_O32.o,.text=0x1000 -map-section test_ELF_ExternalFunction_O32.o,.text=0x10000 -check=%s %T/test_ELF_O32.o %T/test_ELF_ExternalFunction_O32.o
-# RUN: llvm-mc -triple=mips-unknown-linux -code-model=small -filetype=obj -o %T/test_ELF_O32.o %s
+# RUN: llvm-mc -triple=mips-unknown-linux -filetype=obj -o %T/test_ELF_O32.o %s
# RUN: llc -mtriple=mips-unknown-linux -filetype=obj -o %/T/test_ELF_ExternalFunction_O32.o %S/Inputs/ExternalFunction.ll
# RUN: llvm-rtdyld -triple=mips-unknown-linux -verify -map-section test_ELF_O32.o,"<common symbols>"=0x7FF8 -map-section test_ELF_O32.o,.text=0x1000 -map-section test_ELF_ExternalFunction_O32.o,.text=0x10000 -check=%s %T/test_ELF_O32.o %T/test_ELF_ExternalFunction_O32.o
diff --git a/llvm/test/ExecutionEngine/RuntimeDyld/X86/ELF_x86-64_PIC-small-relocations.s b/llvm/test/ExecutionEngine/RuntimeDyld/X86/ELF_x86-64_PIC-small-relocations.s
index c8d0b009616..909cc4e9c51 100644
--- a/llvm/test/ExecutionEngine/RuntimeDyld/X86/ELF_x86-64_PIC-small-relocations.s
+++ b/llvm/test/ExecutionEngine/RuntimeDyld/X86/ELF_x86-64_PIC-small-relocations.s
@@ -1,4 +1,4 @@
-# RUN: llvm-mc -triple=x86_64-unknown-freebsd -code-model=small -filetype=obj -o %T/testsmall_x86-64.o %s
+# RUN: llvm-mc -triple=x86_64-unknown-freebsd -filetype=obj -o %T/testsmall_x86-64.o %s
# RUN: llvm-rtdyld -triple=x86_64-unknown-freebsd -verify -check=%s %/T/testsmall_x86-64.o
.globl foo
diff --git a/llvm/test/MC/ELF/cfi-large-model.s b/llvm/test/MC/ELF/cfi-large-model.s
index 2fb63d18371..790d75eee1f 100644
--- a/llvm/test/MC/ELF/cfi-large-model.s
+++ b/llvm/test/MC/ELF/cfi-large-model.s
@@ -1,4 +1,4 @@
-// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -code-model=large %s \
+// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -large-code-model %s \
// RUN: -o - | llvm-readobj -s -sd | FileCheck %s
// CHECK: Section {
diff --git a/llvm/tools/dsymutil/DwarfLinker.cpp b/llvm/tools/dsymutil/DwarfLinker.cpp
index 6e3a8ce1ea5..fcbc2680180 100644
--- a/llvm/tools/dsymutil/DwarfLinker.cpp
+++ b/llvm/tools/dsymutil/DwarfLinker.cpp
@@ -591,7 +591,7 @@ bool DwarfStreamer::init(Triple TheTriple, StringRef OutputFilename) {
MOFI.reset(new MCObjectFileInfo);
MC.reset(new MCContext(MAI.get(), MRI.get(), MOFI.get()));
- MOFI->InitMCObjectFileInfo(TheTriple, /*PIC*/ false, CodeModel::Default, *MC);
+ MOFI->InitMCObjectFileInfo(TheTriple, /*PIC*/ false, *MC);
MCTargetOptions Options;
MAB = TheTarget->createMCAsmBackend(*MRI, TripleName, "", Options);
diff --git a/llvm/tools/llvm-dwp/llvm-dwp.cpp b/llvm/tools/llvm-dwp/llvm-dwp.cpp
index 7a6922d8a3f..2297db6097e 100644
--- a/llvm/tools/llvm-dwp/llvm-dwp.cpp
+++ b/llvm/tools/llvm-dwp/llvm-dwp.cpp
@@ -642,7 +642,7 @@ int main(int argc, char **argv) {
MCObjectFileInfo MOFI;
MCContext MC(MAI.get(), MRI.get(), &MOFI);
- MOFI.InitMCObjectFileInfo(TheTriple, /*PIC*/ false, CodeModel::Default, MC);
+ MOFI.InitMCObjectFileInfo(TheTriple, /*PIC*/ false, MC);
MCTargetOptions Options;
auto MAB = TheTarget->createMCAsmBackend(*MRI, TripleName, "", Options);
diff --git a/llvm/tools/llvm-mc/llvm-mc.cpp b/llvm/tools/llvm-mc/llvm-mc.cpp
index 8782588dfdd..ec4c5d542ce 100644
--- a/llvm/tools/llvm-mc/llvm-mc.cpp
+++ b/llvm/tools/llvm-mc/llvm-mc.cpp
@@ -131,20 +131,10 @@ MAttrs("mattr",
static cl::opt<bool> PIC("position-independent",
cl::desc("Position independent"), cl::init(false));
-static cl::opt<llvm::CodeModel::Model>
-CMModel("code-model",
- cl::desc("Choose code model"),
- cl::init(CodeModel::Default),
- cl::values(clEnumValN(CodeModel::Default, "default",
- "Target default code model"),
- clEnumValN(CodeModel::Small, "small",
- "Small code model"),
- clEnumValN(CodeModel::Kernel, "kernel",
- "Kernel code model"),
- clEnumValN(CodeModel::Medium, "medium",
- "Medium code model"),
- clEnumValN(CodeModel::Large, "large",
- "Large code model")));
+static cl::opt<bool>
+ LargeCodeModel("large-code-model",
+ cl::desc("Create cfi directives that assume the code might "
+ "be more than 2gb away"));
static cl::opt<bool>
NoInitialTextSection("n", cl::desc("Don't assume assembly file starts "
@@ -506,7 +496,7 @@ int main(int argc, char **argv) {
// MCObjectFileInfo needs a MCContext reference in order to initialize itself.
MCObjectFileInfo MOFI;
MCContext Ctx(MAI.get(), MRI.get(), &MOFI, &SrcMgr);
- MOFI.InitMCObjectFileInfo(TheTriple, PIC, CMModel, Ctx);
+ MOFI.InitMCObjectFileInfo(TheTriple, PIC, Ctx, LargeCodeModel);
if (SaveTempLabels)
Ctx.setAllowTemporaryLabels(false);
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp
index c772204a8ed..7b1e288a6d8 100644
--- a/llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -1223,7 +1223,7 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) {
MCObjectFileInfo MOFI;
MCContext Ctx(AsmInfo.get(), MRI.get(), &MOFI);
// FIXME: for now initialize MCObjectFileInfo with default values
- MOFI.InitMCObjectFileInfo(Triple(TripleName), false, CodeModel::Default, Ctx);
+ MOFI.InitMCObjectFileInfo(Triple(TripleName), false, Ctx);
std::unique_ptr<MCDisassembler> DisAsm(
TheTarget->createMCDisassembler(*STI, Ctx));
diff --git a/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp b/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
index c32cfa1de9a..dba36e40d34 100644
--- a/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
+++ b/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
@@ -153,7 +153,7 @@ llvm::Error dwarfgen::Generator::init(Triple TheTriple, uint16_t V) {
MOFI.reset(new MCObjectFileInfo);
MC.reset(new MCContext(MAI.get(), MRI.get(), MOFI.get()));
- MOFI->InitMCObjectFileInfo(TheTriple, /*PIC*/ false, CodeModel::Default, *MC);
+ MOFI->InitMCObjectFileInfo(TheTriple, /*PIC*/ false, *MC);
MCTargetOptions Options;
MAB = TheTarget->createMCAsmBackend(*MRI, TripleName, "", Options);
OpenPOWER on IntegriCloud