summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2015-01-26 19:03:15 +0000
committerEric Christopher <echristo@gmail.com>2015-01-26 19:03:15 +0000
commit04bcc11905d2f07de49807556fa42923dbb64b03 (patch)
tree5ccc809879a631084e8471ddf50a2a190c40eab4 /tools
parentcce3c83917c2486928bb334bbb7aa501edda7c40 (diff)
Move DataLayout back to the TargetMachine from TargetSubtargetInfo
derived classes. Since global data alignment, layout, and mangling is often based on the DataLayout, move it to the TargetMachine. This ensures that global data is going to be layed out and mangled consistently if the subtarget changes on a per function basis. Prior to this all targets(*) have had subtarget dependent code moved out and onto the TargetMachine. *One target hasn't been migrated as part of this change: R600. The R600 port has, as a subtarget feature, the size of pointers and this affects global data layout. I've currently hacked in a FIXME to enable progress, but the port needs to be updated to either pass the 64-bitness to the TargetMachine, or fix the DataLayout to avoid subtarget dependent features. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227113 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/llc/llc.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp
index 94199ddd107..5565fb3b3ac 100644
--- a/tools/llc/llc.cpp
+++ b/tools/llc/llc.cpp
@@ -304,7 +304,7 @@ static int compileModule(char **argv, LLVMContext &Context) {
PM.add(new TargetLibraryInfoWrapperPass(TLII));
// Add the target data from the target machine, if it exists, or the module.
- if (const DataLayout *DL = Target->getSubtargetImpl()->getDataLayout())
+ if (const DataLayout *DL = Target->getDataLayout())
M->setDataLayout(DL);
PM.add(new DataLayoutPass());