MCPcopy Create free account
hub / github.com/MegEngine/MegCC / parseMLIRInput

Function parseMLIRInput

compiler/tools/dump-kernel/dump-kernel.cpp:32–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30 cl::NormalFormatting, cl::Optional, cl::desc("<output file path, default>"));
31
32static OwningOpRef<ModuleOp> parseMLIRInput(
33 StringRef inputFilename, MLIRContext* context) {
34 // Set up the input file.
35 std::string errorMessage;
36 auto file = openInputFile(inputFilename, &errorMessage);
37 if (!file) {
38 llvm::errs() << errorMessage << "\n";
39 return nullptr;
40 }
41 llvm::SourceMgr sourceMgr;
42 sourceMgr.AddNewSourceBuffer(std::move(file), SMLoc());
43 return OwningOpRef<ModuleOp>(parseSourceFile(sourceMgr, context));
44}
45
46int main(int argc, char** argv) {
47 cl::ParseCommandLineOptions(argc, argv);

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected