OLD | NEW |
---|---|
1 //===- subzero/src/IceOperand.h - High-level operands -----------*- C++ -*-===// | 1 //===- subzero/src/IceOperand.h - High-level operands -----------*- C++ -*-===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file declares the Operand class and its target-independent | 10 // This file declares the Operand class and its target-independent |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
328 // have a non-negative RegNum field. | 328 // have a non-negative RegNum field. |
329 class Variable : public Operand { | 329 class Variable : public Operand { |
330 public: | 330 public: |
331 static Variable *create(Cfg *Func, Type Ty, const CfgNode *Node, SizeT Index, | 331 static Variable *create(Cfg *Func, Type Ty, const CfgNode *Node, SizeT Index, |
332 const IceString &Name) { | 332 const IceString &Name) { |
333 return new (Func->allocate<Variable>()) Variable(Ty, Node, Index, Name); | 333 return new (Func->allocate<Variable>()) Variable(Ty, Node, Index, Name); |
334 } | 334 } |
335 | 335 |
336 SizeT getIndex() const { return Number; } | 336 SizeT getIndex() const { return Number; } |
337 IceString getName() const; | 337 IceString getName() const; |
338 void setName(IceString &NewName); | |
Jim Stichnoth
2014/09/10 18:44:23
Also consider putting the whole definition here?
Karl
2014/09/10 21:14:33
Done.
| |
338 | 339 |
339 Inst *getDefinition() const { return DefInst; } | 340 Inst *getDefinition() const { return DefInst; } |
340 void setDefinition(Inst *Inst, const CfgNode *Node); | 341 void setDefinition(Inst *Inst, const CfgNode *Node); |
341 void replaceDefinition(Inst *Inst, const CfgNode *Node); | 342 void replaceDefinition(Inst *Inst, const CfgNode *Node); |
342 | 343 |
343 const CfgNode *getLocalUseNode() const { return DefNode; } | 344 const CfgNode *getLocalUseNode() const { return DefNode; } |
344 bool isMultiblockLife() const { return (DefNode == NULL); } | 345 bool isMultiblockLife() const { return (DefNode == NULL); } |
345 void setUse(const Inst *Inst, const CfgNode *Node); | 346 void setUse(const Inst *Inst, const CfgNode *Node); |
346 | 347 |
347 bool getIsArg() const { return IsArgument; } | 348 bool getIsArg() const { return IsArgument; } |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
420 Vars = VarsReal; | 421 Vars = VarsReal; |
421 Vars[0] = this; | 422 Vars[0] = this; |
422 NumVars = 1; | 423 NumVars = 1; |
423 } | 424 } |
424 Variable(const Variable &) LLVM_DELETED_FUNCTION; | 425 Variable(const Variable &) LLVM_DELETED_FUNCTION; |
425 Variable &operator=(const Variable &) LLVM_DELETED_FUNCTION; | 426 Variable &operator=(const Variable &) LLVM_DELETED_FUNCTION; |
426 // Number is unique across all variables, and is used as a | 427 // Number is unique across all variables, and is used as a |
427 // (bit)vector index for liveness analysis. | 428 // (bit)vector index for liveness analysis. |
428 const SizeT Number; | 429 const SizeT Number; |
429 // Name is optional. | 430 // Name is optional. |
430 const IceString Name; | 431 IceString Name; |
431 // DefInst is the instruction that produces this variable as its | 432 // DefInst is the instruction that produces this variable as its |
432 // dest. | 433 // dest. |
433 Inst *DefInst; | 434 Inst *DefInst; |
434 // DefNode is the node where this variable was produced, and is | 435 // DefNode is the node where this variable was produced, and is |
435 // reset to NULL if it is used outside that node. This is used for | 436 // reset to NULL if it is used outside that node. This is used for |
436 // detecting isMultiblockLife(). TODO: Collapse this to a single | 437 // detecting isMultiblockLife(). TODO: Collapse this to a single |
437 // bit and use a separate pass to calculate the values across the | 438 // bit and use a separate pass to calculate the values across the |
438 // Cfg. This saves space in the Variable, and removes the fragility | 439 // Cfg. This saves space in the Variable, and removes the fragility |
439 // of incrementally computing and maintaining the information. | 440 // of incrementally computing and maintaining the information. |
440 const CfgNode *DefNode; | 441 const CfgNode *DefNode; |
(...skipping 28 matching lines...) Expand all Loading... | |
469 Variable *LoVar; | 470 Variable *LoVar; |
470 Variable *HiVar; | 471 Variable *HiVar; |
471 // VarsReal (and Operand::Vars) are set up such that Vars[0] == | 472 // VarsReal (and Operand::Vars) are set up such that Vars[0] == |
472 // this. | 473 // this. |
473 Variable *VarsReal[1]; | 474 Variable *VarsReal[1]; |
474 }; | 475 }; |
475 | 476 |
476 } // end of namespace Ice | 477 } // end of namespace Ice |
477 | 478 |
478 #endif // SUBZERO_SRC_ICEOPERAND_H | 479 #endif // SUBZERO_SRC_ICEOPERAND_H |
OLD | NEW |