authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-02-25 18:09:39-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-02-25 18:09:39-05:00
logb018c64ca2c92f5d6a4d3e5dcdfdc0cf70680027
tree76425a06065c2726dabdc7f020667c5a8cc973db
parentfe354ebb5c71aa6c5600251d2c3db53b8c5dc8eb

add coroutine LLVM passes


1 files changed, 3 insertions(+), 0 deletions(-)

src/zig_llvm.cpp+3
...@@ -32,6 +32,7 @@...@@ -32,6 +32,7 @@
32#include <llvm/Support/TargetParser.h>32#include <llvm/Support/TargetParser.h>
33#include <llvm/Support/raw_ostream.h>33#include <llvm/Support/raw_ostream.h>
34#include <llvm/Target/TargetMachine.h>34#include <llvm/Target/TargetMachine.h>
35#include <llvm/Transforms/Coroutines.h>
35#include <llvm/Transforms/IPO.h>36#include <llvm/Transforms/IPO.h>
36#include <llvm/Transforms/IPO/PassManagerBuilder.h>37#include <llvm/Transforms/IPO/PassManagerBuilder.h>
37#include <llvm/Transforms/IPO/AlwaysInliner.h>38#include <llvm/Transforms/IPO/AlwaysInliner.h>
...@@ -129,6 +130,8 @@ bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machine_ref, LLVMM...@@ -129,6 +130,8 @@ bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machine_ref, LLVMM
129 PMBuilder->Inliner = createFunctionInliningPass(PMBuilder->OptLevel, PMBuilder->SizeLevel, false);130 PMBuilder->Inliner = createFunctionInliningPass(PMBuilder->OptLevel, PMBuilder->SizeLevel, false);
130 }131 }
131132
133 addCoroutinePassesToExtensionPoints(*PMBuilder);
134
132 // Set up the per-function pass manager.135 // Set up the per-function pass manager.
133 legacy::FunctionPassManager FPM = legacy::FunctionPassManager(module);136 legacy::FunctionPassManager FPM = legacy::FunctionPassManager(module);
134 auto tliwp = new(std::nothrow) TargetLibraryInfoWrapperPass(tlii);137 auto tliwp = new(std::nothrow) TargetLibraryInfoWrapperPass(tlii);