mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
Add wrapper methods, use LLVM-transforms directly.
This commit is contained in:
committed by
Christoffer Lerno
parent
8285720180
commit
9dfe7ddbde
@@ -8,17 +8,9 @@
|
||||
#include <llvm-c/Error.h>
|
||||
#include <llvm-c/Comdat.h>
|
||||
#include <llvm-c/Linker.h>
|
||||
|
||||
#include <llvm-c/Transforms/PassBuilder.h>
|
||||
const char *varargslots_name = "varargslots";
|
||||
const char *temp_name = "$$temp";
|
||||
typedef struct LLVMOpaquePassBuilderOptions *LLVMPassBuilderOptionsRef;
|
||||
LLVMErrorRef LLVMRunPasses(LLVMModuleRef M, const char *Passes,
|
||||
LLVMTargetMachineRef TM,
|
||||
LLVMPassBuilderOptionsRef Options);
|
||||
LLVMPassBuilderOptionsRef LLVMCreatePassBuilderOptions(void);
|
||||
void LLVMPassBuilderOptionsSetVerifyEach(LLVMPassBuilderOptionsRef Options, LLVMBool VerifyEach);
|
||||
void LLVMPassBuilderOptionsSetDebugLogging(LLVMPassBuilderOptionsRef Options, LLVMBool DebugLogging);
|
||||
void LLVMDisposePassBuilderOptions(LLVMPassBuilderOptionsRef Options);
|
||||
|
||||
static void llvm_emit_constructors_and_destructors(GenContext *c);
|
||||
static void llvm_codegen_setup();
|
||||
|
||||
@@ -296,6 +296,7 @@ void gencontext_end_module(GenContext *context);
|
||||
// Patched functions
|
||||
LLVMValueRef LLVMConstBswap(LLVMValueRef ConstantVal);
|
||||
void LLVMBuilderSetFastMathFlags(LLVMBuilderRef Builder, FpOpt option);
|
||||
void LLVMSetDSOLocal(LLVMValueRef Global, bool value);
|
||||
|
||||
#ifndef LLVMCreateTypeAttribute
|
||||
LLVMAttributeRef LLVMCreateTypeAttribute(LLVMContextRef C, unsigned KindID,
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user