Add wrapper methods, use LLVM-transforms directly.

This commit is contained in:
Christoffer Lerno
2024-07-18 12:04:02 +02:00
committed by Christoffer Lerno
parent 8285720180
commit 9dfe7ddbde
3 changed files with 7 additions and 9 deletions

View File

@@ -8,6 +8,7 @@
#include "llvm-c/TargetMachine.h"
#include "llvm/Target/TargetMachine.h"
#include "lld/Common/CommonLinkerContext.h"
#include "llvm/IR/GlobalValue.h"
#define LINK_SIG \
bool link(llvm::ArrayRef<const char *> args, llvm::raw_ostream &stdoutOS, \
@@ -183,6 +184,10 @@ extern "C" {
auto machine = reinterpret_cast<llvm::TargetMachine *>(ref);
machine->Options.UseInitArray = use_init_array;
}
void LLVMSetDSOLocal(LLVMValueRef Global, bool value)
{
llvm::unwrap<llvm::GlobalValue>(Global)->setDSOLocal(value);
}
void LLVMBuilderSetFastMathFlags(LLVMBuilderRef Builder, FastMathOption option)
{