diff options
author | Lang Hames <lhames@gmail.com> | 2016-09-04 17:53:30 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2016-09-04 17:53:30 +0000 |
commit | 38c7927b6f6c54ea48144b3d39aaffb18c31aee4 (patch) | |
tree | 543b728c8cb130d52afad5b90e35ca47cd3d0823 /llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp | |
parent | 128047fde5b1a559d12c241de88be183ce8f42eb (diff) | |
download | llvm-38c7927b6f6c54ea48144b3d39aaffb18c31aee4.zip llvm-38c7927b6f6c54ea48144b3d39aaffb18c31aee4.tar.gz llvm-38c7927b6f6c54ea48144b3d39aaffb18c31aee4.tar.bz2 |
[ORC] Clone module flags metadata into the globals module in the
CompileOnDemandLayer.
Also contains a tweak to the orc-lazy jit in LLI to enable the test case.
llvm-svn: 280632
Diffstat (limited to 'llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp b/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp index 7e2e873..711b887 100644 --- a/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp +++ b/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp @@ -241,5 +241,14 @@ GlobalAlias* cloneGlobalAliasDecl(Module &Dst, const GlobalAlias &OrigA, return NewA; } +void cloneModuleFlagsMetadata(Module &Dst, const Module &Src, + ValueToValueMapTy &VMap) { + auto *MFs = Src.getModuleFlagsMetadata(); + if (!MFs) + return; + for (auto *MF : MFs->operands()) + Dst.addModuleFlag(MapMetadata(MF, VMap)); +} + } // End namespace orc. } // End namespace llvm. |