llvm-project/llvm/lib/MC
Rafael Espindola 9f92995781 Don't pass the code model to MC
I was surprised to see the code model being passed to MC. After all,
it assembles code, it doesn't create it.

The one place it is used is in the expansion of .cfi directives to
handle .eh_frame being more that 2gb away from the code.

As far as I can tell, gnu assembler doesn't even have an option to
enable this. Compiling a c file with gcc -mcmodel=large produces a
regular looking .eh_frame. This is probably because in practice linker
parse and recreate .eh_frames.

In llvm this is used because the JIT can place the code and .eh_frame
very far apart. Ideally we would fix the jit and delete this
option. This is hard.

Apart from confusion another problem with the current interface is
that most callers pass CodeModel::Default, which is bad since MC has
no way to map it to the target default if it actually needed to.

This patch then replaces the argument with a boolean with a default
value. The vast majority of users don't ever need to look at it. In
fact, only CodeGen and llvm-mc use it and llvm-mc just to enable more
testing.

llvm-svn: 309884
2017-08-02 20:32:26 +00:00
..
MCDisassembler Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCParser [AsmParser][GAS-compatibility] Ignore an empty 'p2align' directive 2017-08-02 17:36:10 +00:00
CMakeLists.txt Rename WinCOFFStreamer.cpp -> MCWinCOFFStreamer.cpp 2017-06-21 20:58:17 +00:00
ConstantPools.cpp Re-apply r302416: [ARM] Clear the constant pool cache on explicit .ltorg directives 2017-05-22 09:42:07 +00:00
ELFObjectWriter.cpp Simplify interface now that we don't need to pass IsPCRel. NFC. 2017-07-11 23:56:10 +00:00
LLVMBuild.txt
MCAsmBackend.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCAsmInfo.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MCAsmInfoCOFF.cpp [MC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-02-11 00:27:28 +00:00
MCAsmInfoDarwin.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MCAsmInfoELF.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MCAsmInfoWasm.cpp [WebAssembly] Add skeleton MC support for the Wasm container format 2017-02-22 01:23:18 +00:00
MCAsmStreamer.cpp MC: add support for cfi_return_column 2017-07-28 03:39:19 +00:00
MCAssembler.cpp Simplify interface now that we don't need to pass IsPCRel. NFC. 2017-07-11 23:56:10 +00:00
MCCodeEmitter.cpp [MC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-02-08 22:23:19 +00:00
MCCodeView.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MCContext.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MCDwarf.cpp MC: simplify internal function call parameter 2017-07-29 20:03:02 +00:00
MCELFObjectTargetWriter.cpp [MC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-02-07 23:02:00 +00:00
MCELFStreamer.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MCExpr.cpp [MachO] Fix codegen of alias of alias. 2017-06-08 20:49:03 +00:00
MCFragment.cpp [MC] Fix const qualifier warning 2017-06-22 19:08:30 +00:00
MCInst.cpp [MC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-02-11 00:27:28 +00:00
MCInstPrinter.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCInstrAnalysis.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCInstrDesc.cpp
MCLabel.cpp [MC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-02-08 22:23:19 +00:00
MCLinkerOptimizationHint.cpp [MC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-02-11 00:27:28 +00:00
MCMachOStreamer.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCMachObjectTargetWriter.cpp [MC] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-02-11 00:27:28 +00:00
MCNullStreamer.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCObjectFileInfo.cpp Don't pass the code model to MC 2017-08-02 20:32:26 +00:00
MCObjectStreamer.cpp MCObjectStreamer : fail with a diagnostic when emitting an out of range value. 2017-05-15 08:43:27 +00:00
MCObjectWriter.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCRegisterInfo.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCSchedule.cpp
MCSection.cpp Mark dump() methods as const. NFC 2017-06-21 22:19:17 +00:00
MCSectionCOFF.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MCSectionELF.cpp MC, Object: Reserve a section type, SHT_LLVM_ODRTAB, for the ODR table. 2017-06-14 18:52:12 +00:00
MCSectionMachO.cpp Fix the GCC build. 2017-01-30 19:05:09 +00:00
MCSectionWasm.cpp [WebAssembly] Add skeleton MC support for the Wasm container format 2017-02-22 01:23:18 +00:00
MCStreamer.cpp MC: add support for cfi_return_column 2017-07-28 03:39:19 +00:00
MCSubtargetInfo.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCSymbol.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCSymbolELF.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MCTargetOptions.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCValue.cpp Cleanup dump() functions. 2017-01-28 02:02:38 +00:00
MCWasmObjectTargetWriter.cpp [WebAssembly] Remove unused methods from MCWasmObjectTargetWriter 2017-06-06 16:38:59 +00:00
MCWasmStreamer.cpp [WebAssembly] Add support for weak symbols in the binary format 2017-06-20 04:04:59 +00:00
MCWin64EH.cpp
MCWinCOFFStreamer.cpp [MC] Allow assembling .secidx and .secrel32 for undefined symbols 2017-06-22 21:02:14 +00:00
MCWinEH.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
MachObjectWriter.cpp Simplify interface now that we don't need to pass IsPCRel. NFC. 2017-07-11 23:56:10 +00:00
StringTableBuilder.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
SubtargetFeature.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
WasmObjectWriter.cpp Simplify interface now that we don't need to pass IsPCRel. NFC. 2017-07-11 23:56:10 +00:00
WinCOFFObjectWriter.cpp Simplify interface now that we don't need to pass IsPCRel. NFC. 2017-07-11 23:56:10 +00:00