diff options
| author | James Y Knight <jyknight@google.com> | 2016-03-04 19:00:41 +0000 |
|---|---|---|
| committer | James Y Knight <jyknight@google.com> | 2016-03-04 19:00:41 +0000 |
| commit | e85ad572986c6fbbc45f361b706ea831c5ecf004 (patch) | |
| tree | 54db30acb8783265d490c97c10c0b21056ea194f /lib/CodeGen/ObjectFilePCHContainerOperations.cpp | |
| parent | 0c35e452895ad039178f3a19e90a1c36b4554749 (diff) | |
| download | clang-e85ad572986c6fbbc45f361b706ea831c5ecf004.tar.gz | |
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262737 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/ObjectFilePCHContainerOperations.cpp')
| -rw-r--r-- | lib/CodeGen/ObjectFilePCHContainerOperations.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/CodeGen/ObjectFilePCHContainerOperations.cpp b/lib/CodeGen/ObjectFilePCHContainerOperations.cpp index 14c30dec75..96752528d7 100644 --- a/lib/CodeGen/ObjectFilePCHContainerOperations.cpp +++ b/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(); |
