diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-08-15 14:01:01 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-15 14:01:01 -0700 |
| commit | 8b97a1aee2b161b9604d3b0c88166d0f0aef7e64 (patch) | |
| tree | 7a8d65ad3ef59679cf4318a2fea88b6979207de4 /src/zig_llvm.cpp | |
| parent | 729807203a4ef162f39656be062dd11a428af8e3 (diff) | |
| parent | d3672493cc6ad5085f202df1859b13b4ae4dec96 (diff) | |
| download | zig-8b97a1aee2b161b9604d3b0c88166d0f0aef7e64.tar.gz zig-8b97a1aee2b161b9604d3b0c88166d0f0aef7e64.zip | |
Merge pull request #3033 from ziglang/rewrite-coroutines
rework async function semantics
Diffstat (limited to 'src/zig_llvm.cpp')
| -rw-r--r-- | src/zig_llvm.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp index c51c9e1a50..695f8b18ef 100644 --- a/src/zig_llvm.cpp +++ b/src/zig_llvm.cpp @@ -42,7 +42,6 @@ #include <llvm/Support/TargetRegistry.h> #include <llvm/Target/TargetMachine.h> #include <llvm/Target/CodeGenCWrappers.h> -#include <llvm/Transforms/Coroutines.h> #include <llvm/Transforms/IPO.h> #include <llvm/Transforms/IPO/AlwaysInliner.h> #include <llvm/Transforms/IPO/PassManagerBuilder.h> @@ -203,8 +202,6 @@ bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machine_ref, LLVMM PMBuilder->Inliner = createFunctionInliningPass(PMBuilder->OptLevel, PMBuilder->SizeLevel, false); } - addCoroutinePassesToExtensionPoints(*PMBuilder); - // Set up the per-function pass manager. legacy::FunctionPassManager FPM = legacy::FunctionPassManager(module); auto tliwp = new(std::nothrow) TargetLibraryInfoWrapperPass(tlii); @@ -898,6 +895,14 @@ LLVMValueRef ZigLLVMBuildAShrExact(LLVMBuilderRef builder, LLVMValueRef LHS, LLV return wrap(unwrap(builder)->CreateAShr(unwrap(LHS), unwrap(RHS), name, true)); } +void ZigLLVMSetTailCall(LLVMValueRef Call) { + unwrap<CallInst>(Call)->setTailCallKind(CallInst::TCK_MustTail); +} + +void ZigLLVMFunctionSetPrefixData(LLVMValueRef function, LLVMValueRef data) { + unwrap<Function>(function)->setPrefixData(unwrap<Constant>(data)); +} + class MyOStream: public raw_ostream { public: |
