aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/BackendUtil.cpp')
-rw-r--r--clang/lib/CodeGen/BackendUtil.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index f5edea7..801b49f 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -604,7 +604,10 @@ void EmitAssemblyHelper::EmitAssembly(BackendAction Action,
if (!TM)
TM.reset(CreateTargetMachine(UsesCodeGen));
- if (UsesCodeGen && !TM) return;
+ if (UsesCodeGen && !TM)
+ return;
+ if (TM)
+ TheModule->setDataLayout(*TM->getDataLayout());
CreatePasses();
switch (Action) {