MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / toLLVMLevel

Function toLLVMLevel

lib/llvm/compiler.cpp:64–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62// Translate Compiler::OptimizationLevel to llvm::PassBuilder version
63#if LLVM_VERSION_MAJOR >= 13
64static inline const char *
65toLLVMLevel(WasmEdge::CompilerConfigure::OptimizationLevel Level) noexcept {
66 using OL = WasmEdge::CompilerConfigure::OptimizationLevel;
67 switch (Level) {
68 case OL::O0:
69 return "default<O0>,function(tailcallelim)";
70 case OL::O1:
71 return "default<O1>,function(tailcallelim)";
72 case OL::O2:
73 return "default<O2>";
74 case OL::O3:
75 return "default<O3>";
76 case OL::Os:
77 return "default<Os>";
78 case OL::Oz:
79 return "default<Oz>";
80 default:
81 assumingUnreachable();
82 }
83}
84#else
85static inline std::pair<unsigned int, unsigned int>
86toLLVMLevel(WasmEdge::CompilerConfigure::OptimizationLevel Level) noexcept {

Callers 1

compileMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected