Skip to content
Snippets Groups Projects
Commit 52cd96e7 authored by Peter Matta's avatar Peter Matta
Browse files

[dusk-format][Pathc] Pretty print error when cannot find input file

parent c7d8fe68
No related branches found
Tags 1.0.0
No related merge requests found
......@@ -49,6 +49,8 @@ void initCompilerInstance(CompilerInstance &C) {
CompilerInvocation Inv;
Inv.setArgs(C.getSourceManager(), C.getDiags(), InFile, "", IsQuiet,
false);
if (!Inv.getInputFile())
return;
C.reset(std::move(Inv));
}
 
......@@ -57,6 +59,11 @@ int main(int argc, const char *argv[]) {
CompilerInstance Compiler;
initCompilerInstance(Compiler);
 
if (!Compiler.getInputFile()) {
std::cerr << "File '" + InFile + "' not found.";
return 1;
}
Compiler.performParseOnly();
if (Compiler.hasASTContext() && !Compiler.getContext().isError()) {
llvm::raw_os_ostream OS(std::cout);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment