summaryrefslogtreecommitdiff
path: root/tools/llc
diff options
context:
space:
mode:
Diffstat (limited to 'tools/llc')
-rw-r--r--tools/llc/llc.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp
index 5b311cb617..bb72f252fe 100644
--- a/tools/llc/llc.cpp
+++ b/tools/llc/llc.cpp
@@ -299,9 +299,8 @@ static int compileModule(char **argv, LLVMContext &Context) {
// Add the target data from the target machine, if it exists, or the module.
if (const DataLayout *DL = Target.getDataLayout())
- PM.add(new DataLayoutPass(*DL));
- else
- PM.add(new DataLayoutPass(mod));
+ mod->setDataLayout(DL);
+ PM.add(new DataLayoutPass(mod));
// Override default to generate verbose assembly.
Target.setAsmVerbosityDefault(true);