File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,10 @@ class MachineBasicBlock : public ilist_node<MachineBasicBlock> {
117
117
// / "(null)".
118
118
StringRef getName () const ;
119
119
120
+ // / getFullName - Return a formatted string to identify this block and its
121
+ // / parent function.
122
+ std::string getFullName () const ;
123
+
120
124
// / hasAddressTaken - Test whether this block is potentially the target
121
125
// / of an indirect branch.
122
126
bool hasAddressTaken () const { return AddressTaken; }
Original file line number Diff line number Diff line change @@ -238,6 +238,18 @@ StringRef MachineBasicBlock::getName() const {
238
238
return " (null)" ;
239
239
}
240
240
241
+ // / Return a hopefully unique identifier for this block.
242
+ std::string MachineBasicBlock::getFullName () const {
243
+ std::string Name;
244
+ if (getParent ())
245
+ Name = (getParent ()->getFunction ()->getName () + " :" ).str ();
246
+ if (getBasicBlock ())
247
+ Name += getBasicBlock ()->getName ();
248
+ else
249
+ Name += (Twine (" BB" ) + Twine (getNumber ())).str ();
250
+ return Name;
251
+ }
252
+
241
253
void MachineBasicBlock::print (raw_ostream &OS, SlotIndexes *Indexes) const {
242
254
const MachineFunction *MF = getParent ();
243
255
if (!MF) {
You can’t perform that action at this time.
0 commit comments