summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenAction.cpp
diff options
context:
space:
mode:
authorSteven Wu <stevenwu@apple.com>2016-05-11 16:26:03 +0000
committerSteven Wu <stevenwu@apple.com>2016-05-11 16:26:03 +0000
commit27fb5227ec1191df23903f15115539796fb17192 (patch)
treef08d909b31ffa5ce3eb45a940c29e84c2309aaac /clang/lib/CodeGen/CodeGenAction.cpp
parent330fb175d457e345c7eb55ce4b3ef89041c6c12e (diff)
downloadbcm5719-llvm-27fb5227ec1191df23903f15115539796fb17192.tar.gz
bcm5719-llvm-27fb5227ec1191df23903f15115539796fb17192.zip
Embed bitcode in object file (clang cc1 part)
Summary: Teach clang to embed bitcode inside bitcode. When -fembed-bitcode cc1 option is used, clang will embed both the input bitcode and cc1 commandline into the bitcode in special sections before compiling to the object file. Using -fembed-bitcode-marker will only introduce a marker in both sections. Depends on D17390 Reviewers: rsmith Subscribers: yaron.keren, vsk, cfe-commits Differential Revision: http://reviews.llvm.org/D17392 llvm-svn: 269202
Diffstat (limited to 'clang/lib/CodeGen/CodeGenAction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenAction.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp
index 98685539d35..848acb4fe07 100644
--- a/clang/lib/CodeGen/CodeGenAction.cpp
+++ b/clang/lib/CodeGen/CodeGenAction.cpp
@@ -173,6 +173,8 @@ namespace clang {
return;
}
+ EmbedBitcode(getModule(), CodeGenOpts, llvm::MemoryBufferRef());
+
EmitBackendOutput(Diags, CodeGenOpts, TargetOpts, LangOpts,
C.getTargetInfo().getDataLayout(),
getModule(), Action, AsmOutStream);
@@ -831,9 +833,13 @@ void CodeGenAction::ExecuteAction() {
TheModule->setTargetTriple(TargetOpts.Triple);
}
+ EmbedBitcode(TheModule.get(), CI.getCodeGenOpts(),
+ MainFile->getMemBufferRef());
+
LLVMContext &Ctx = TheModule->getContext();
Ctx.setInlineAsmDiagnosticHandler(BitcodeInlineAsmDiagHandler,
&CI.getDiagnostics());
+
EmitBackendOutput(CI.getDiagnostics(), CI.getCodeGenOpts(), TargetOpts,
CI.getLangOpts(), CI.getTarget().getDataLayout(),
TheModule.get(), BA, OS);
OpenPOWER on IntegriCloud