Skip to content

Commit 53d82fe

Browse files
committed
cc: Add option to produce minimal crash reports and disable multithreading.
1 parent 9e6ffc2 commit 53d82fe

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

include/vast/Frontend/Options.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ namespace vast::cc
7373
constexpr string_ref emit_mlir = "emit-mlir";
7474

7575
constexpr string_ref print_pipeline = "print-pipeline";
76+
constexpr string_ref emit_crash_reproducer = "emit-crash-reproducer";
7677

78+
constexpr string_ref disable_multithreading = "disable-multithreading";
7779
constexpr string_ref debug = "debug";
7880

7981
constexpr string_ref simplify = "simplify";

lib/vast/Frontend/Consumer.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,6 @@ namespace vast::cc {
214214
);
215215
VAST_CHECK(pipeline, "failed to setup pipeline");
216216

217-
if (vargs.has_option(opt::print_pipeline)) {
218-
pipeline->dump();
219-
}
220-
221217
auto result = pipeline->run(mod.get());
222218
VAST_CHECK(mlir::succeeded(result), "MLIR pass manager failed when running vast passes");
223219

lib/vast/Frontend/Pipelines.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,20 @@ namespace vast::cc {
128128
*passes << std::move(step);
129129
}
130130

131+
if (vargs.has_option(opt::print_pipeline)) {
132+
passes->dump();
133+
}
134+
135+
if (vargs.has_option(opt::disable_multithreading) || vargs.has_option(opt::emit_crash_reproducer)) {
136+
mctx.disableMultithreading();
137+
}
138+
139+
if (vargs.has_option(opt::emit_crash_reproducer)) {
140+
auto reproducer_path = vargs.get_option(opt::emit_crash_reproducer);
141+
VAST_CHECK(reproducer_path.has_value(), "expected path to reproducer");
142+
passes->enableCrashReproducerGeneration(reproducer_path.value(), true /* local reproducer */);
143+
}
144+
131145
return passes;
132146
}
133147

0 commit comments

Comments
 (0)