diff --git a/include/vast/Frontend/GenAction.hpp b/include/vast/Frontend/GenAction.hpp index 6941375d10..5e68c27f5a 100644 --- a/include/vast/Frontend/GenAction.hpp +++ b/include/vast/Frontend/GenAction.hpp @@ -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"; diff --git a/lib/vast/Frontend/GenAction.cpp b/lib/vast/Frontend/GenAction.cpp index a8a248656e..c4ba3568a5 100644 --- a/lib/vast/Frontend/GenAction.cpp +++ b/lib/vast/Frontend/GenAction.cpp @@ -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); }