aboutsummaryrefslogtreecommitdiff
path: root/src/zig_llvm.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-09-19 12:57:58 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-09-19 12:57:58 -0400
commit15301504e2a0f46a482f4d73abe482bd1eb63357 (patch)
treef4714b1f248f338a4941ae41ff119796c6ba5873 /src/zig_llvm.cpp
parent5eeef1f5ed5912d03bb8e744c6618734073af2ed (diff)
parent0ab7cfa023416f2cea22d7b5db1121c938560757 (diff)
downloadzig-15301504e2a0f46a482f4d73abe482bd1eb63357.tar.gz
zig-15301504e2a0f46a482f4d73abe482bd1eb63357.zip
Merge remote-tracking branch 'origin/llvm7'
Diffstat (limited to 'src/zig_llvm.cpp')
-rw-r--r--src/zig_llvm.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp
index 61287f620c..ad8edb4cda 100644
--- a/src/zig_llvm.cpp
+++ b/src/zig_llvm.cpp
@@ -38,6 +38,7 @@
#include <llvm/Transforms/IPO/PassManagerBuilder.h>
#include <llvm/Transforms/IPO/AlwaysInliner.h>
#include <llvm/Transforms/Scalar.h>
+#include <llvm/Transforms/Utils.h>
#include <lld/Common/Driver.h>
@@ -165,7 +166,7 @@ bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machine_ref, LLVMM
abort();
}
- if (target_machine->addPassesToEmitFile(MPM, dest, ft)) {
+ if (target_machine->addPassesToEmitFile(MPM, dest, nullptr, ft)) {
*error_message = strdup("TargetMachine can't emit a file of this type");
return true;
}
@@ -214,6 +215,20 @@ LLVMValueRef ZigLLVMBuildCall(LLVMBuilderRef B, LLVMValueRef Fn, LLVMValueRef *A
return wrap(unwrap(B)->Insert(call_inst));
}
+LLVMValueRef ZigLLVMBuildMemCpy(LLVMBuilderRef B, LLVMValueRef Dst, unsigned DstAlign,
+ LLVMValueRef Src, unsigned SrcAlign, LLVMValueRef Size, bool isVolatile)
+{
+ CallInst *call_inst = unwrap(B)->CreateMemCpy(unwrap(Dst), DstAlign, unwrap(Src), SrcAlign, unwrap(Size), isVolatile);
+ return wrap(call_inst);
+}
+
+LLVMValueRef ZigLLVMBuildMemSet(LLVMBuilderRef B, LLVMValueRef Ptr, LLVMValueRef Val, LLVMValueRef Size,
+ unsigned Align, bool isVolatile)
+{
+ CallInst *call_inst = unwrap(B)->CreateMemSet(unwrap(Ptr), unwrap(Val), unwrap(Size), Align, isVolatile);
+ return wrap(call_inst);
+}
+
void ZigLLVMFnSetSubprogram(LLVMValueRef fn, ZigLLVMDISubprogram *subprogram) {
assert( isa<Function>(unwrap(fn)) );
Function *unwrapped_function = reinterpret_cast<Function*>(unwrap(fn));
@@ -704,6 +719,8 @@ const char *ZigLLVMGetSubArchTypeName(ZigLLVM_SubArchType sub_arch) {
switch (sub_arch) {
case ZigLLVM_NoSubArch:
return "(none)";
+ case ZigLLVM_ARMSubArch_v8_4a:
+ return "v8_4a";
case ZigLLVM_ARMSubArch_v8_3a:
return "v8_3a";
case ZigLLVM_ARMSubArch_v8_2a:
@@ -847,7 +864,7 @@ bool ZigLLDLink(ZigLLVM_ObjectFormatType oformat, const char **args, size_t arg_
return lld::elf::link(array_ref_args, false, diag);
case ZigLLVM_MachO:
- return lld::mach_o::link(array_ref_args, diag);
+ return lld::mach_o::link(array_ref_args, false, diag);
case ZigLLVM_Wasm:
return lld::wasm::link(array_ref_args, false, diag);