Index: src/IceOperand.h |
diff --git a/src/IceOperand.h b/src/IceOperand.h |
index 99bbd39dbcb442bc8d5ebb3d8bf05e429f44361a..e4f6bba5350d04a5f0155eb43a8c16e039bbaf63 100644 |
--- a/src/IceOperand.h |
+++ b/src/IceOperand.h |
@@ -388,18 +388,17 @@ class Variable : public Operand { |
Variable(Variable &&V) = default; |
public: |
- static Variable *create(Cfg *Func, Type Ty, SizeT Index, |
- const IceString &Name) { |
- return new (Func->allocate<Variable>()) |
- Variable(kVariable, Ty, Index, Name); |
+ static Variable *create(Cfg *Func, Type Ty, SizeT Index) { |
+ return new (Func->allocate<Variable>()) Variable(kVariable, Ty, Index); |
} |
SizeT getIndex() const { return Number; } |
- IceString getName() const; |
- void setName(IceString &NewName) { |
+ IceString getName(const Cfg *Func) const; |
+ void setName(Cfg *Func, const IceString &NewName) { |
// Make sure that the name can only be set once. |
- assert(Name.empty()); |
- Name = NewName; |
+ assert(NameIndex < 0); |
+ if (!NewName.empty()) |
+ NameIndex = Func->addIdentifierName(NewName); |
} |
bool getIsArg() const { return IsArgument; } |
@@ -484,8 +483,8 @@ public: |
~Variable() override {} |
protected: |
- Variable(OperandKind K, Type Ty, SizeT Index, const IceString &Name) |
- : Operand(K, Ty), Number(Index), Name(Name), IsArgument(false), |
+ Variable(OperandKind K, Type Ty, SizeT Index) |
+ : Operand(K, Ty), Number(Index), NameIndex(-1), IsArgument(false), |
IsImplicitArgument(false), IgnoreLiveness(false), StackOffset(0), |
RegNum(NoRegister), RegNumTmp(NoRegister), Weight(1), LoVar(NULL), |
HiVar(NULL) { |
@@ -496,8 +495,7 @@ protected: |
// Number is unique across all variables, and is used as a |
// (bit)vector index for liveness analysis. |
const SizeT Number; |
- // Name is optional. |
- IceString Name; |
+ int32_t NameIndex; |
bool IsArgument; |
bool IsImplicitArgument; |
// IgnoreLiveness means that the variable should be ignored when |