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

Function parseRunModeArg

lib/driver/runtimeTool.cpp:29–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27
28namespace {
29RunMode parseRunModeArg(std::string_view S) noexcept {
30 std::string Lower(S);
31 std::transform(Lower.begin(), Lower.end(), Lower.begin(),
32 [](unsigned char C) -> char {
33 return static_cast<char>(std::tolower(C));
34 });
35 if (Lower == "jit") {
36 return RunMode::JIT;
37 }
38 if (Lower == "aot") {
39 return RunMode::AOT;
40 }
41 // Default to interpreter on any unrecognised value.
42 return RunMode::Interpreter;
43}
44
45// Helper template to parse numeric arguments and catch conversion exceptions
46template <typename Converter, typename ValVec, typename TypeVec, typename TC>

Callers 1

ToolFunction · 0.85

Calls 3

tolowerFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected