mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-03-06 03:19:50 +00:00
If the basic block has no name, make sure to print the % number of it
llvm-svn: 9375
This commit is contained in:
parent
8476f4bb56
commit
dd7d5d8172
@ -21,6 +21,7 @@
|
||||
#include "llvm/Pass.h"
|
||||
#include "llvm/Function.h"
|
||||
#include "llvm/iTerminators.h"
|
||||
#include "llvm/Assembly/Writer.h"
|
||||
#include "llvm/Support/CFG.h"
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
@ -39,9 +40,14 @@ struct DOTGraphTraits<const Function*> : public DefaultDOTGraphTraits {
|
||||
|
||||
static std::string getNodeLabel(const BasicBlock *Node,
|
||||
const Function *Graph) {
|
||||
if (CFGOnly) return Node->getName() + ":";
|
||||
if (CFGOnly && !Node->getName().empty()) return Node->getName() + ":";
|
||||
|
||||
std::ostringstream Out;
|
||||
if (CFGOnly) {
|
||||
WriteAsOperand(Out, Node, false, true);
|
||||
return Out.str();
|
||||
}
|
||||
|
||||
Out << *Node;
|
||||
std::string OutStr = Out.str();
|
||||
if (OutStr[0] == '\n') OutStr.erase(OutStr.begin());
|
||||
|
Loading…
x
Reference in New Issue
Block a user