summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
diff options
context:
space:
mode:
authorJames Y Knight <jyknight@google.com>2016-03-04 19:00:41 +0000
committerJames Y Knight <jyknight@google.com>2016-03-04 19:00:41 +0000
commitb214cbc7852fa1719c5d0bd3ccb9615481e03c55 (patch)
treee5fe189f5192242789a8887dcf64d3af79258831 /clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
parent31f251f1f0acae8864d08a07be4b190cea2ed4b5 (diff)
downloadbcm5719-llvm-b214cbc7852fa1719c5d0bd3ccb9615481e03c55.tar.gz
bcm5719-llvm-b214cbc7852fa1719c5d0bd3ccb9615481e03c55.zip
Make TargetInfo store an actual DataLayout instead of a string.
Use it to calculate UserLabelPrefix, instead of specifying it (often incorrectly). Note that the *actual* user label prefix has always come from the DataLayout, and is handled within LLVM. The main thing clang's TargetInfo::UserLabelPrefix did was to set the #define value. Having these be different from each-other is just silly. Differential Revision: http://reviews.llvm.org/D17183 llvm-svn: 262737
Diffstat (limited to 'clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp')
-rw-r--r--clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp b/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
index 14c30dec755..96752528d71 100644
--- a/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
+++ b/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
@@ -162,7 +162,7 @@ public:
Ctx = &Context;
VMContext.reset(new llvm::LLVMContext());
M.reset(new llvm::Module(MainFileName, *VMContext));
- M->setDataLayout(Ctx->getTargetInfo().getDataLayoutString());
+ M->setDataLayout(Ctx->getTargetInfo().getDataLayout());
Builder.reset(new CodeGen::CodeGenModule(
*Ctx, HeaderSearchOpts, PreprocessorOpts, CodeGenOpts, *M, Diags));
@@ -226,7 +226,7 @@ public:
return;
M->setTargetTriple(Ctx.getTargetInfo().getTriple().getTriple());
- M->setDataLayout(Ctx.getTargetInfo().getDataLayoutString());
+ M->setDataLayout(Ctx.getTargetInfo().getDataLayout());
// PCH files don't have a signature field in the control block,
// but LLVM detects DWO CUs by looking for a non-zero DWO id.
@@ -272,15 +272,15 @@ public:
llvm::SmallString<0> Buffer;
llvm::raw_svector_ostream OS(Buffer);
clang::EmitBackendOutput(Diags, CodeGenOpts, TargetOpts, LangOpts,
- Ctx.getTargetInfo().getDataLayoutString(),
- M.get(), BackendAction::Backend_EmitLL, &OS);
+ Ctx.getTargetInfo().getDataLayout(), M.get(),
+ BackendAction::Backend_EmitLL, &OS);
llvm::dbgs() << Buffer;
});
// Use the LLVM backend to emit the pch container.
clang::EmitBackendOutput(Diags, CodeGenOpts, TargetOpts, LangOpts,
- Ctx.getTargetInfo().getDataLayoutString(),
- M.get(), BackendAction::Backend_EmitObj, OS);
+ Ctx.getTargetInfo().getDataLayout(), M.get(),
+ BackendAction::Backend_EmitObj, OS);
// Make sure the pch container hits disk.
OS->flush();
OpenPOWER on IntegriCloud