[OpenMP] Add a flag for embedding a file into the module
authorJoseph Huber <jhuber6@vols.utk.edu>
Fri, 3 Dec 2021 20:48:36 +0000 (15:48 -0500)
committerJoseph Huber <jhuber6@vols.utk.edu>
Mon, 31 Jan 2022 20:56:00 +0000 (15:56 -0500)
commit551b1774524428aae5692ed3d41f969288ecd5a2
treeefefd1b1577ce31fb99353a801bf4d2cbf790c4a
parent2f9ace9e9a5816684b3c19528bd4a3908b2b8ac0
[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
clang/include/clang/Basic/CodeGenOptions.h
clang/include/clang/CodeGen/BackendUtil.h
clang/include/clang/Driver/Options.td
clang/lib/CodeGen/BackendUtil.cpp
clang/lib/CodeGen/CodeGenAction.cpp
clang/test/Frontend/embed-object.ll [new file with mode: 0644]
llvm/include/llvm/Bitcode/BitcodeWriter.h
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
llvm/lib/Bitcode/Writer/CMakeLists.txt