Skip to content

Commit

Permalink
cc: Add vast-debug option.
Browse files Browse the repository at this point in the history
  • Loading branch information
xlauko committed Jan 23, 2024
1 parent a20f2e6 commit 03fb74a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion include/vast/Frontend/Options.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ namespace vast::cc
constexpr string_ref emit_llvm = "emit-llvm";
constexpr string_ref emit_obj = "emit-obj";
constexpr string_ref emit_asm = "emit-asm";

constexpr string_ref emit_mlir = "emit-mlir";

constexpr string_ref debug = "debug";

constexpr string_ref simplify = "simplify";

constexpr string_ref show_locs = "show-locs";
Expand Down
7 changes: 6 additions & 1 deletion lib/vast/Frontend/Consumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,12 @@ namespace vast::cc {
bool verify_diagnostics = vargs.has_option(opt::vast_verify_diags);

mlir::SourceMgrDiagnosticVerifierHandler src_mgr_handler(mlir_src_mgr, mctx);
mctx->printOpOnDiagnostic(false);

if (vargs.has_option(opt::debug)) {
mctx->printOpOnDiagnostic(true);
mctx->printStackTraceOnDiagnostic(true);
llvm::DebugFlag = true;
}

execute_pipeline(mod.get(), mctx);

Expand Down

0 comments on commit 03fb74a

Please sign in to comment.