File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ class SILModule {
164
164
using CoverageMapCollectionType =
165
165
llvm::MapVector<StringRef, SILCoverageMap *>;
166
166
using BasicBlockNameMapType =
167
- llvm::DenseMap<const SILBasicBlock *, llvm::StringRef >;
167
+ llvm::DenseMap<const SILBasicBlock *, std::string >;
168
168
169
169
enum class LinkingMode : uint8_t {
170
170
// / Link functions with non-public linkage. Used by the mandatory pipeline.
@@ -455,7 +455,7 @@ class SILModule {
455
455
456
456
void setBasicBlockName (const SILBasicBlock *block, StringRef name) {
457
457
#if NDEBUG
458
- basicBlockNames[block] = name;
458
+ basicBlockNames[block] = name. str () ;
459
459
#endif
460
460
}
461
461
Optional<StringRef> getBasicBlockName (const SILBasicBlock *block) {
@@ -464,7 +464,7 @@ class SILModule {
464
464
if (Known == basicBlockNames.end ())
465
465
return None;
466
466
467
- return Known->second ;
467
+ return StringRef ( Known->second ) ;
468
468
#else
469
469
return None;
470
470
#endif
Original file line number Diff line number Diff line change @@ -791,6 +791,12 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
791
791
// the block header.
792
792
printBlockArgumentUses (BB);
793
793
794
+ // If the basic block has a name available, print it as well
795
+ auto debugName = BB->getDebugName ();
796
+ if (debugName.hasValue ()) {
797
+ *this << " // " << debugName.getValue () << ' \n ' ;
798
+ }
799
+
794
800
// Then print the name of our block, the arguments, and the block colon.
795
801
*this << Ctx.getID (BB);
796
802
printBlockArguments (BB);
@@ -816,12 +822,6 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
816
822
for (auto Id : PredIDs)
817
823
*this << ' ' << Id;
818
824
}
819
-
820
- // If the basic block has a name available, print it as well
821
- auto debugName = BB->getDebugName ();
822
- if (debugName.hasValue ()) {
823
- *this << " /// " << debugName.getValue ();
824
- }
825
825
*this << ' \n ' ;
826
826
827
827
const auto &SM = BB->getModule ().getASTContext ().SourceMgr ;
You can’t perform that action at this time.
0 commit comments