if (!Node->getName().empty())
return Node->getName().str();
- string_ostream OS;
+ std::string Str;
+ raw_string_ostream OS(Str);
+
Node->printAsOperand(OS, false);
return OS.str();
}
static std::string getCompleteNodeLabel(const BasicBlock *Node,
const Function *) {
enum { MaxColumns = 80 };
- string_ostream OS;
+ std::string Str;
+ raw_string_ostream OS(Str);
if (Node->getName().empty()) {
Node->printAsOperand(OS, false);
OutStr.erase(OutStr.begin()+i, OutStr.begin()+Idx);
--i;
} else if (ColNum == MaxColumns) { // Wrap lines.
- if (LastSpace) {
- OutStr.insert(LastSpace, "\\l...");
- ColNum = i - LastSpace;
- LastSpace = 0;
- i += 3; // The loop will advance 'i' again.
- }
- // Else keep trying to find a space.
+ // Wrap very long names even though we can't find a space.
+ if (!LastSpace)
+ LastSpace = i;
+ OutStr.insert(LastSpace, "\\l...");
+ ColNum = i - LastSpace;
+ LastSpace = 0;
+ i += 3; // The loop will advance 'i' again.
}
else
++ColNum;
if (SuccNo == 0) return "def";
- string_ostream OS;
+ std::string Str;
+ raw_string_ostream OS(Str);
SwitchInst::ConstCaseIt Case =
SwitchInst::ConstCaseIt::fromSuccessorIndex(SI, SuccNo);
OS << Case.getCaseValue()->getValue();