Skip to content

Commit

Permalink
SIL: remove dump and print from SILValue
Browse files Browse the repository at this point in the history
If you want to dump a SILValue from the debugger, use Value->dump()
  • Loading branch information
eeckstein committed Jan 25, 2016
1 parent 845b3fe commit d3c9753
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 16 deletions.
5 changes: 1 addition & 4 deletions include/swift/SIL/SILValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,6 @@ class SILValue {
return Value < RHS.Value;
}

void dump() const;
void print(raw_ostream &os) const;

/// Return true if underlying ValueBase of this SILValue is non-null. Return
/// false otherwise.
explicit operator bool() const { return getDef() != nullptr; }
Expand Down Expand Up @@ -586,7 +583,7 @@ static inline llvm::hash_code hash_value(SILValue V) {
}

inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, SILValue V) {
V.print(OS);
V->print(OS);
return OS;
}

Expand Down
8 changes: 0 additions & 8 deletions lib/SIL/SILPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1510,14 +1510,6 @@ void SILBasicBlock::printAsOperand(raw_ostream &OS, bool PrintType) {
// Printing for SILInstruction, SILBasicBlock, SILFunction, and SILModule
//===----------------------------------------------------------------------===//

void SILValue::dump() const {
print(llvm::errs());
}

void SILValue::print(raw_ostream &OS) const {
SILPrinter(OS).print(*this);
}

void ValueBase::dump() const {
print(llvm::errs());
}
Expand Down
2 changes: 1 addition & 1 deletion lib/SILGen/SILGenApply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1713,7 +1713,7 @@ static SILValue emitRawApply(SILGenFunction &gen,
out << "TYPE MISMATCH IN ARGUMENT " << i << " OF APPLY AT ";
printSILLocationDescription(out, loc, gen.getASTContext());
out << " argument value: ";
argValue.print(out);
argValue->print(out);
out << " parameter type: ";
inputTypes[i].print(out);
out << "\n";
Expand Down
2 changes: 1 addition & 1 deletion lib/SILGen/SILGenPoly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ namespace {
llvm::errs() << "inout writeback in abstraction difference thunk "
"not yet implemented\n";
llvm::errs() << "input value ";
input.getValue().dump();
input.getValue()->dump();
llvm::errs() << "output type " << result.getSILType() << "\n";
abort();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/SILOptimizer/Analysis/EscapeAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ std::string CGForDotView::getNodeLabel(const Node *Node) const {
default: {
std::string Inst;
llvm::raw_string_ostream OI(Inst);
SILValue(Node->OrigNode->V).print(OI);
SILValue(Node->OrigNode->V)->print(OI);
size_t start = Inst.find(" = ");
if (start != std::string::npos) {
start += 3;
Expand Down
2 changes: 1 addition & 1 deletion lib/SILOptimizer/Transforms/SimplifyCFG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2825,7 +2825,7 @@ getSILValueFromCaseResult(SILBuilder &B, SILLocation Loc,
return B.createIntegerLiteral(Loc, Type, Value.getBoolValue());
} else {
llvm::errs() << "Non IntegerLiteralInst switch case result\n";
Val.dump();
Val->dump();
return Val;
}
}
Expand Down

0 comments on commit d3c9753

Please sign in to comment.