Skip to content

Commit

Permalink
Add -x <language> option
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanradanov committed Jul 11, 2023
1 parent 9608d79 commit fd4194b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tools/cgeist/Lib/clang-mlir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5893,6 +5893,12 @@ static bool parseMLIR(const char *Argv0, std::vector<std::string> filenames,
new Driver(binary, llvm::sys::getDefaultTargetTriple(), Diags));
mlirclang::ArgumentList Argv;
Argv.push_back(binary);
// TODO we should probably preserve the order of these args - they matter in
// some cases as is with this one - it has to be before the input file
if (Lang != "") {
Argv.push_back("-x");
Argv.emplace_back(Lang);
}
for (const auto &filename : filenames) {
Argv.emplace_back(filename);
}
Expand Down
3 changes: 3 additions & 0 deletions tools/cgeist/driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ static cl::opt<bool> EarlyVerifier("early-verifier", cl::init(false),

static cl::opt<bool> Verbose("v", cl::init(false), cl::desc("Verbose"));

static cl::opt<std::string> Lang("x", cl::init(""),
cl::desc("Treat input as language"));

static cl::list<std::string> includeDirs("I", cl::desc("include search path"),
cl::cat(toolOptions));

Expand Down

0 comments on commit fd4194b

Please sign in to comment.