17#include "mlir/IR/BuiltinOps.h"
18#include "mlir/Tools/mlir-translate/Translation.h"
26 registry.insert<comb::CombDialect>();
27 registry.insert<debug::DebugDialect>();
28 registry.insert<emit::EmitDialect>();
29 registry.insert<hw::HWDialect>();
30 registry.insert<seq::SeqDialect>();
31 registry.insert<sv::SVDialect>();
32 registry.insert<om::OMDialect>();
36 TranslateFromMLIRRegistration reg(
37 "dump-di",
"dump debug information in human-readable form",
38 [](ModuleOp op, raw_ostream &output) {
46 "hgldd-output-dir", llvm::cl::desc(
"Output directory for HGLDD files"),
49 "hgldd-source-prefix", llvm::cl::desc(
"Prefix for source file locations"),
52 "hgldd-output-prefix", llvm::cl::desc(
"Prefix for output file locations"),
55 "hgldd-only-existing-file-locs",
56 llvm::cl::desc(
"Only consider locations in files that exist on disk"),
57 llvm::cl::init(
false));
59 auto getOptions = [] {
68 static TranslateFromMLIRRegistration reg1(
69 "emit-hgldd",
"emit HGLDD debug information",
70 [=](ModuleOp op, raw_ostream &output) {
71 return emitHGLDD(op, output, getOptions());
75 static TranslateFromMLIRRegistration reg2(
76 "emit-split-hgldd",
"emit HGLDD debug information as separate files",
77 [=](ModuleOp op, raw_ostream &output) {
void registerHGLDDTranslation()
LogicalResult emitHGLDD(Operation *module, llvm::raw_ostream &os, const EmitHGLDDOptions &options={})
Serialize the debug information in the given module into the HGLDD format and writes it to output.
void registerTranslations()
Register all debug information emission flavors as from-MLIR translations.
LogicalResult emitSplitHGLDD(Operation *module, const EmitHGLDDOptions &options={})
Serialize the debug information in the given module into the HGLDD format and emit one companion HGLD...
static void registerDialects(DialectRegistry ®istry)
LogicalResult dumpDebugInfo(Operation *module, llvm::raw_ostream &os)
Dump the debug information in the given module in a human-readable format.
void registerDumpTranslation()
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Options for HGLDD emission.
bool onlyExistingFileLocs
Only consider location information for files that actually exist on disk.
StringRef outputDirectory
The directory in which to place HGLDD output files.
StringRef sourceFilePrefix
A prefix prepended to all source file locations.
StringRef outputFilePrefix
A prefix prepended to all output file locations.