llvm/unittests/DebugInfo/DWARF
Rafael Espindola 2600a677c9 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309884 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02 20:32:26 +00:00
..
CMakeLists.txt [DWARF] Don't include TestingSupport in LLVM_LINK_COMPONENTS. 2017-06-30 16:50:51 +00:00
DWARFDebugInfoTest.cpp Remove some leftover DWARFContextInMemory. 2017-07-19 23:34:59 +00:00
DWARFFormValueTest.cpp [DWARF] NFC: DWARFDataExtractor combines relocs with DataExtractor. 2017-06-29 16:52:08 +00:00
DwarfGenerator.cpp Don't pass the code model to MC 2017-08-02 20:32:26 +00:00
DwarfGenerator.h Recommit "[ELF] - Add ability for DWARFContextInMemory to exit early when any error happen." 2017-06-28 08:21:19 +00:00