Index: src/IceInstMIPS32.cpp |
diff --git a/src/IceInstMIPS32.cpp b/src/IceInstMIPS32.cpp |
index dcd977df56d31b3d958d530b8a2da803f6c4374a..63cfc83c0eb1b8be3c1e5df391f278972e8acdf0 100644 |
--- a/src/IceInstMIPS32.cpp |
+++ b/src/IceInstMIPS32.cpp |
@@ -114,26 +114,28 @@ InstMIPS32Br::InstMIPS32Br(Cfg *Func, const CfgNode *TargetTrue, |
InstMIPS32Label::InstMIPS32Label(Cfg *Func, TargetMIPS32 *Target) |
: InstMIPS32(Func, InstMIPS32::Label, 0, nullptr), |
- Number(Target->makeNextLabelNumber()) {} |
- |
-IceString InstMIPS32Label::getName(const Cfg *Func) const { |
- if (!BuildDefs::dump()) |
- return ""; |
- return ".L" + Func->getFunctionName() + "$local$__" + std::to_string(Number); |
+ Number(Target->makeNextLabelNumber()) { |
+ if (BuildDefs::dump()) { |
+ Name = GlobalString(Func->getContext(), ".L" + Func->getFunctionName() + |
+ "$local$__" + |
+ std::to_string(Number)); |
+ } else { |
+ Name = GlobalString(Func->getContext()); |
+ } |
} |
void InstMIPS32Label::dump(const Cfg *Func) const { |
if (!BuildDefs::dump()) |
return; |
Ostream &Str = Func->getContext()->getStrDump(); |
- Str << getName(Func) << ":"; |
+ Str << getLabelName() << ":"; |
} |
void InstMIPS32Label::emit(const Cfg *Func) const { |
if (!BuildDefs::dump()) |
return; |
Ostream &Str = Func->getContext()->getStrEmit(); |
- Str << getName(Func) << ":"; |
+ Str << getLabelName() << ":"; |
} |
void InstMIPS32Label::emitIAS(const Cfg *Func) const { |
@@ -268,7 +270,7 @@ void InstMIPS32Br::emit(const Cfg *Func) const { |
"b" |
<< "\t"; |
if (Label) { |
- Str << Label->getName(Func); |
+ Str << Label->getLabelName(); |
} else { |
if (isUnconditionalBranch()) { |
Str << getTargetFalse()->getAsmName(); |