aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenAction.cpp
diff options
context:
space:
mode:
authorJoseph Huber <jhuber6@vols.utk.edu>2021-12-03 15:48:36 -0500
committerJoseph Huber <jhuber6@vols.utk.edu>2022-01-31 15:56:00 -0500
commit551b1774524428aae5692ed3d41f969288ecd5a2 (patch)
treeefefd1b1577ce31fb99353a801bf4d2cbf790c4a /clang/lib/CodeGen/CodeGenAction.cpp
parent2f9ace9e9a5816684b3c19528bd4a3908b2b8ac0 (diff)
downloadllvm-551b1774524428aae5692ed3d41f969288ecd5a2.zip
llvm-551b1774524428aae5692ed3d41f969288ecd5a2.tar.gz
llvm-551b1774524428aae5692ed3d41f969288ecd5a2.tar.bz2
[OpenMP] Add a flag for embedding a file into the module
This patch adds support for a flag `-fembed-offload-binary` to embed a file as an ELF section in the output by placing it in a global variable. This can be used to bundle offloading files with the host binary so it can be accessed by the linker. The section is named using the `-fembed-offload-section` option. Depends on D116541 Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D116542
Diffstat (limited to 'clang/lib/CodeGen/CodeGenAction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenAction.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp
index b72b16c..c2c508d 100644
--- a/clang/lib/CodeGen/CodeGenAction.cpp
+++ b/clang/lib/CodeGen/CodeGenAction.cpp
@@ -1134,6 +1134,7 @@ void CodeGenAction::ExecuteAction() {
TheModule->setTargetTriple(TargetOpts.Triple);
}
+ EmbedObject(TheModule.get(), CodeGenOpts, Diagnostics);
EmbedBitcode(TheModule.get(), CodeGenOpts, *MainFile);
LLVMContext &Ctx = TheModule->getContext();