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 /// \file | 10 /// \file |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
436 // Make sure it's only called once. | 436 // Make sure it's only called once. |
437 assert(Limit == 0); | 437 assert(Limit == 0); |
438 assert(Value != 0); | 438 assert(Value != 0); |
439 Limit = Value; | 439 Limit = Value; |
440 } | 440 } |
441 // Define NoRegisterValue as an enum value so that it can be used as an | 441 // Define NoRegisterValue as an enum value so that it can be used as an |
442 // argument for the public ctor if desired. | 442 // argument for the public ctor if desired. |
443 enum { NoRegisterValue = std::numeric_limits<BaseType>::max() }; | 443 enum { NoRegisterValue = std::numeric_limits<BaseType>::max() }; |
444 const static RegNumT NoRegister /* = NoRegisterValue */; | 444 const static RegNumT NoRegister /* = NoRegisterValue */; |
445 | 445 |
446 bool hasValue() const {return Value == NoRegisterValue;} | |
Jim Stichnoth
2016/02/12 03:16:51
You really need "return Value != NoRegisterValue;"
| |
447 | |
446 private: | 448 private: |
447 BaseType Value = NoRegisterValue; | 449 BaseType Value = NoRegisterValue; |
448 static BaseType Limit; | 450 static BaseType Limit; |
449 /// Private ctor called only by fromInt() and fixme(). | 451 /// Private ctor called only by fromInt() and fixme(). |
450 RegNumT(BaseType Value) : Value(Value) { validate(Value); } | 452 RegNumT(BaseType Value) : Value(Value) { validate(Value); } |
451 /// The ctor calls this to validate against the target-supplied limit. | 453 /// The ctor calls this to validate against the target-supplied limit. |
452 static void validate(BaseType Value) { | 454 static void validate(BaseType Value) { |
453 (void)Value; | 455 (void)Value; |
454 assert(Value == NoRegisterValue || Value < Limit); | 456 assert(Value == NoRegisterValue || Value < Limit); |
455 } | 457 } |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
923 private: | 925 private: |
924 const Cfg *Func; | 926 const Cfg *Func; |
925 MetadataKind Kind; | 927 MetadataKind Kind; |
926 CfgVector<VariableTracking> Metadata; | 928 CfgVector<VariableTracking> Metadata; |
927 const static InstDefList NoDefinitions; | 929 const static InstDefList NoDefinitions; |
928 }; | 930 }; |
929 | 931 |
930 } // end of namespace Ice | 932 } // end of namespace Ice |
931 | 933 |
932 #endif // SUBZERO_SRC_ICEOPERAND_H | 934 #endif // SUBZERO_SRC_ICEOPERAND_H |
OLD | NEW |