Skip to content

Commit fd4194b

Browse files
committed
Add -x <language> option
1 parent 9608d79 commit fd4194b

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

tools/cgeist/Lib/clang-mlir.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5893,6 +5893,12 @@ static bool parseMLIR(const char *Argv0, std::vector<std::string> filenames,
58935893
new Driver(binary, llvm::sys::getDefaultTargetTriple(), Diags));
58945894
mlirclang::ArgumentList Argv;
58955895
Argv.push_back(binary);
5896+
// TODO we should probably preserve the order of these args - they matter in
5897+
// some cases as is with this one - it has to be before the input file
5898+
if (Lang != "") {
5899+
Argv.push_back("-x");
5900+
Argv.emplace_back(Lang);
5901+
}
58965902
for (const auto &filename : filenames) {
58975903
Argv.emplace_back(filename);
58985904
}

tools/cgeist/driver.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ static cl::opt<bool> EarlyVerifier("early-verifier", cl::init(false),
213213

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

216+
static cl::opt<std::string> Lang("x", cl::init(""),
217+
cl::desc("Treat input as language"));
218+
216219
static cl::list<std::string> includeDirs("I", cl::desc("include search path"),
217220
cl::cat(toolOptions));
218221

0 commit comments

Comments
 (0)