mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Better compatibility with LLVM < 13 (#319)
* Update wrapper to add type attribute on LLVM < 13
This commit is contained in:
committed by
GitHub
parent
137b474f44
commit
df0b1df1df
@@ -111,6 +111,20 @@ static bool llvm_link(ObjFormat format, const char **args, int arg_count, const
|
||||
|
||||
extern "C" {
|
||||
|
||||
#if LLVM_VERSION_MAJOR < 13
|
||||
#if _MSC_VER
|
||||
__declspec(selectany)
|
||||
#else
|
||||
__attribute__((weak))
|
||||
#endif
|
||||
LLVMAttributeRef LLVMCreateTypeAttribute(LLVMContextRef C, unsigned KindID,
|
||||
LLVMTypeRef type_ref)
|
||||
{
|
||||
auto &Ctx = *llvm::unwrap(C);
|
||||
auto AttrKind = (llvm::Attribute::AttrKind)KindID;
|
||||
return wrap(llvm::Attribute::get(Ctx, AttrKind, llvm::unwrap(type_ref)));
|
||||
}
|
||||
#endif
|
||||
LLVMValueRef LLVMConstBswap(LLVMValueRef ConstantVal)
|
||||
{
|
||||
llvm::Constant *Val = llvm::unwrap<llvm::Constant>(ConstantVal);
|
||||
|
||||
Reference in New Issue
Block a user