summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/TargetLoweringObjectFile.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2017-08-02 20:32:26 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2017-08-02 20:32:26 +0000
commit9f9299578138e3710f22e1ce7ac4b0c7f5125e01 (patch)
treea23a59c862b6e44041d03508bc7db9f0500bbb47 /llvm/lib/Target/TargetLoweringObjectFile.cpp
parent94380ed406bc3269b3c8776b86110f7082851ef1 (diff)
downloadbcm5719-llvm-9f9299578138e3710f22e1ce7ac4b0c7f5125e01.tar.gz
bcm5719-llvm-9f9299578138e3710f22e1ce7ac4b0c7f5125e01.zip
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
Diffstat (limited to 'llvm/lib/Target/TargetLoweringObjectFile.cpp')
-rw-r--r--llvm/lib/Target/TargetLoweringObjectFile.cpp4
1 files changed, 2 insertions, 2 deletions
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() {
OpenPOWER on IntegriCloud