Skip to content

Commit

Permalink
Generator: Use an argument to ignore driver warnings
Browse files Browse the repository at this point in the history
So driver errors are not ignored and we can more easily debug why a file
does not get parsed.

Will help for github issue #47
  • Loading branch information
ogoffart committed Sep 19, 2016
1 parent fd485cd commit c64069e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions generator/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ static bool proceedCommand(std::vector<std::string> command, llvm::StringRef Dir
#endif
command.push_back("-isystem");
command.push_back("/builtins");
command.push_back("-Qunused-arguments");
clang::tooling::ToolInvocation Inv(command, new BrowserAction(WasInDatabase), FM);

// Map the builtins includes
Expand All @@ -259,11 +260,6 @@ static bool proceedCommand(std::vector<std::string> command, llvm::StringRef Dir
Inv.mapVirtualFile(f->filename, {f->content , f->size } );
f++;
}

// the BrowserASTConsumer will re-create a new diagnostic consumer,
// but we want to ignore all the driver warnings
clang::IgnoringDiagConsumer consumer;
Inv.setDiagnosticConsumer(&consumer);
bool result = Inv.run();
if (!result) {
std::cerr << "Error: The file was not recognized as source code: " << file.str() << std::endl;
Expand Down

0 comments on commit c64069e

Please sign in to comment.