Skip to content

Commit 90b53e1

Browse files
committed
Only escape type in IR dump
1 parent 8a4ac20 commit 90b53e1

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/glow/IR/IR.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -474,18 +474,26 @@ void Module::dump() {
474474
llvm::outs() << sb.str();
475475
}
476476

477-
static std::string getDottyDesc(const Value *v) {
477+
static std::string getEscapedDottyType(const TypeRef& type) {
478478
std::string buffer;
479479
llvm::raw_string_ostream stream(buffer);
480-
stream << v->getKindName() << " | " << v->getName() << " | " << *v->getType();
480+
stream << type;
481481
return escapeDottyString(stream.str());
482482
}
483483

484+
static std::string getDottyDesc(const Value *v) {
485+
std::string buffer;
486+
llvm::raw_string_ostream stream(buffer);
487+
stream << v->getKindName() << " | " << v->getName() << " | "
488+
<< getEscapedDottyType(v->getType());
489+
return stream.str();
490+
}
491+
484492
static std::string getDottyDesc(const Instruction *II) {
485493
std::string buffer;
486494
llvm::raw_string_ostream stream(buffer);
487495
stream << II->getKindName();
488-
stream << "|" << II->getType() << "|";
496+
stream << "|" << getEscapedDottyType(II->getType()) << "|";
489497

490498
// Print operands:
491499
for (int i = 0, e = II->getNumOperands(); i < e; i++) {
@@ -497,7 +505,7 @@ static std::string getDottyDesc(const Instruction *II) {
497505
stream << op.first->getName();
498506
}
499507

500-
return escapeDottyString(stream.str());
508+
return stream.str();
501509
}
502510

503511
/// \returns the arrow property for the operand kind \p k. This method is used

0 commit comments

Comments
 (0)