Skip to content

Commit f424286

Browse files
authored
Keep InitLLVM around until we exit so that we can use -debug-only= (#303)
1 parent bcd804b commit f424286

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tools/cgeist/driver.cc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ int emitBinary(char *Argv0, const char *filename,
264264

265265
const char *binary = Argv0;
266266
const unique_ptr<Driver> driver(new Driver(binary, TargetTriple, Diags));
267-
driver->CC1Main = &ExecuteCC1Tool;
268267
mlirclang::ArgumentList Argv;
269268
Argv.push_back(Argv0);
270269
// Argv.push_back("-x");
@@ -392,16 +391,15 @@ int main(int argc, char **argv) {
392391
}
393392
using namespace mlir;
394393

394+
MLIRArgs.push_back("-opaque-pointers=0");
395+
int size = MLIRArgs.size();
396+
const char **data = MLIRArgs.data();
397+
InitLLVM y(size, data);
395398
std::vector<std::string> files;
396399
{
397400
cl::list<std::string> inputFileName(cl::Positional, cl::OneOrMore,
398401
cl::desc("<Specify input file>"),
399402
cl::cat(toolOptions));
400-
401-
MLIRArgs.push_back("-opaque-pointers=0");
402-
int size = MLIRArgs.size();
403-
const char **data = MLIRArgs.data();
404-
InitLLVM y(size, data);
405403
cl::ParseCommandLineOptions(size, data);
406404
assert(inputFileName.size());
407405
for (auto inp : inputFileName) {

0 commit comments

Comments
 (0)