Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: src/IceOperand.cpp

Issue 798693003: Subzero: Don't store std::string objects inside Variable. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/IceOperand.h ('K') | « src/IceOperand.h ('k') | src/IceRegAlloc.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceOperand.cpp
diff --git a/src/IceOperand.cpp b/src/IceOperand.cpp
index 63571290411020576bac28cfa8e83fe6c1569ca1..615c81c4389e83b314fdabee8088d4541d196cbd 100644
--- a/src/IceOperand.cpp
+++ b/src/IceOperand.cpp
@@ -131,16 +131,17 @@ void LiveRange::trim(InstNumberT Lower) {
++TrimmedBegin;
}
-IceString Variable::getName() const {
- if (!Name.empty())
- return Name;
+IceString Variable::getName(const Cfg *Func) const {
+ if (Func && NameIndex >= 0)
+ return Func->getIdentifierName(NameIndex);
return "__" + std::to_string(getIndex());
}
Variable Variable::asType(Type Ty) {
// Note: This returns a Variable, even if the "this" object is a
// subclass of Variable.
- Variable V(kVariable, Ty, Number, Name);
+ Variable V(kVariable, Ty, Number);
+ V.NameIndex = NameIndex;
V.RegNum = RegNum;
V.StackOffset = StackOffset;
return V;
@@ -405,12 +406,12 @@ void Variable::dump(const Cfg *Func, Ostream &Str) const {
if (!ALLOW_DUMP)
return;
if (Func == NULL) {
- Str << "%" << getName();
+ Str << "%" << getName(Func);
return;
}
if (Func->getContext()->isVerbose(IceV_RegOrigins) ||
(!hasReg() && !Func->getTarget()->hasComputedFrame()))
- Str << "%" << getName();
+ Str << "%" << getName(Func);
if (hasReg()) {
if (Func->getContext()->isVerbose(IceV_RegOrigins))
Str << ":";
« src/IceOperand.h ('K') | « src/IceOperand.h ('k') | src/IceRegAlloc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698