[ORC] Add a LLJITWithThinLTOSummaries example in OrcV2Examples
authorStefan Gränitz <stefan.graenitz@gmail.com>
Fri, 14 Aug 2020 15:03:26 +0000 (17:03 +0200)
committerStefan Gränitz <stefan.graenitz@gmail.com>
Sun, 23 Aug 2020 12:02:10 +0000 (14:02 +0200)
commitb014cc0f655da5094302c326d6d0576fdb652e58
tree5753ba2b777ec3adddb517fc4cc7e5ec39d43c39
parentf76adc2603f6cc466dd809142388ffb56a1c3e31
[ORC] Add a LLJITWithThinLTOSummaries example in OrcV2Examples

The example demonstrates how to use a module summary index file produced for ThinLTO to:
* find the module that defines the main entry point
* find all extra modules that are required for the build

A LIT test runs the example as part of the LLVM test suite [1] and shows how to create a module summary index file.
The code also provides two Error types that can be useful when working with ThinLTO summaries.

[1] if LLVM_BUILD_EXAMPLES=ON and platform is not Windows

Differential Revision: https://reviews.llvm.org/D85974
llvm/examples/OrcV2Examples/CMakeLists.txt
llvm/examples/OrcV2Examples/LLJITWithThinLTOSummaries/CMakeLists.txt [new file with mode: 0644]
llvm/examples/OrcV2Examples/LLJITWithThinLTOSummaries/LLJITWithThinLTOSummaries.cpp [new file with mode: 0644]
llvm/test/Examples/OrcV2Examples/Inputs/bar-mod.ll [new file with mode: 0644]
llvm/test/Examples/OrcV2Examples/Inputs/foo-mod.ll [new file with mode: 0644]
llvm/test/Examples/OrcV2Examples/Inputs/main-mod.ll [new file with mode: 0644]
llvm/test/Examples/OrcV2Examples/lljit-with-thinlto-summaries.test [new file with mode: 0644]
llvm/test/Examples/lit.local.cfg