Skip to content

Commit 41f7b11

Browse files
committed
cc: Add vast-debug option.
1 parent dd33534 commit 41f7b11

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

include/vast/Frontend/Options.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ namespace vast::cc
7070
constexpr string_ref emit_llvm = "emit-llvm";
7171
constexpr string_ref emit_obj = "emit-obj";
7272
constexpr string_ref emit_asm = "emit-asm";
73-
7473
constexpr string_ref emit_mlir = "emit-mlir";
7574

75+
constexpr string_ref debug = "debug";
76+
7677
constexpr string_ref simplify = "simplify";
7778

7879
constexpr string_ref show_locs = "show-locs";

lib/vast/Frontend/Consumer.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,12 @@ namespace vast::cc {
200200
bool verify_diagnostics = vargs.has_option(opt::vast_verify_diags);
201201

202202
mlir::SourceMgrDiagnosticVerifierHandler src_mgr_handler(mlir_src_mgr, mctx);
203-
mctx->printOpOnDiagnostic(false);
203+
204+
if (vargs.has_option(opt::debug)) {
205+
mctx->printOpOnDiagnostic(true);
206+
mctx->printStackTraceOnDiagnostic(true);
207+
llvm::DebugFlag = true;
208+
}
204209

205210
execute_pipeline(mod.get(), mctx);
206211

0 commit comments

Comments
 (0)