Skip to content

Commit

Permalink
cg: Add option to emit locations.
Browse files Browse the repository at this point in the history
  • Loading branch information
xlauko committed Oct 25, 2023
1 parent 303cf07 commit 0b9023f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion include/vast/Frontend/GenAction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ namespace vast::cc {
constexpr string_ref emit_obj = "emit-obj";
constexpr string_ref emit_asm = "emit-asm";

constexpr string_ref emit_mlir = "emit-mlir";
constexpr string_ref emit_mlir = "emit-mlir";

constexpr string_ref emit_locs = "emit-locs";

constexpr string_ref opt_pipeline = "pipeline";

Expand Down
5 changes: 4 additions & 1 deletion lib/vast/Frontend/GenAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,10 @@ namespace vast::cc {

// FIXME: we cannot roundtrip prettyForm=true right now.
mlir::OpPrintingFlags flags;
flags.enableDebugInfo(/* prettyForm */ false);
flags.enableDebugInfo(
vargs.has_option(opt::emit_locs), /* prettyForm */ true
);

mod->print(*output_stream, flags);
}

Expand Down

0 comments on commit 0b9023f

Please sign in to comment.