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.
This commit is contained in:
parent
def3fd8e92
commit
20f597ffcd
4 changed files with 28 additions and 1 deletions
|
@ -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)));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue