diff options
| author | flip1995 <philipp.krones@embecosm.com> | 2022-04-21 13:35:40 +0100 |
|---|---|---|
| committer | Philipp Krones <hello@philkrones.com> | 2022-06-14 14:50:52 +0200 |
| commit | 20f597ffcd29d71d116c617def76291689549d6c (patch) | |
| tree | ef75823552206544327e02a1347a80c4d8996319 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
| parent | def3fd8e9224128ffdf4cb0a7f08306f757a059a (diff) | |
| download | rust-20f597ffcd29d71d116c617def76291689549d6c.tar.gz rust-20f597ffcd29d71d116c617def76291689549d6c.zip | |
Add LLVM module flags required for the VFE opt
To apply the optimization the `Virtual Function Elim` module flag has to be set. To apply this optimization post-link the `LTOPostLink` module flag has to be set.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
| -rw-r--r-- | compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp index f90bb7f2368..a2dd0a7bcdc 100644 --- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp @@ -672,6 +672,11 @@ extern "C" void LLVMRustAddModuleFlag( unwrap(M)->addModuleFlag(MergeBehavior, Name, Value); } +extern "C" bool LLVMRustHasModuleFlag(LLVMModuleRef M, const char *Name, + size_t Len) { + return unwrap(M)->getModuleFlag(StringRef(Name, Len)) != nullptr; +} + extern "C" LLVMValueRef LLVMRustMetadataAsValue(LLVMContextRef C, LLVMMetadataRef MD) { return wrap(MetadataAsValue::get(*unwrap(C), unwrap(MD))); } |
