[llvm] aa2ba67 - [NFC][regalloc] type LiveInterval::reg() as Register

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 14:11:38 PDT 2020


Author: Mircea Trofin
Date: 2020-09-16T14:11:26-07:00
New Revision: aa2ba67a8137040b9146d0383c74f0b75ac9683a

URL: https://github.com/llvm/llvm-project/commit/aa2ba67a8137040b9146d0383c74f0b75ac9683a
DIFF: https://github.com/llvm/llvm-project/commit/aa2ba67a8137040b9146d0383c74f0b75ac9683a.diff

LOG: [NFC][regalloc] type LiveInterval::reg() as Register

We have the Register type which precisely captures the role of this
member. Storage-wise, it's an unsigned.

This helps readability & maintainability.

Differential Revision: https://reviews.llvm.org/D87768

Added: 
    

Modified: 
    llvm/include/llvm/CodeGen/LiveInterval.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/CodeGen/LiveInterval.h b/llvm/include/llvm/CodeGen/LiveInterval.h
index a63eaac44063..4fa7afaefc64 100644
--- a/llvm/include/llvm/CodeGen/LiveInterval.h
+++ b/llvm/include/llvm/CodeGen/LiveInterval.h
@@ -25,6 +25,7 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/iterator_range.h"
+#include "llvm/CodeGen/Register.h"
 #include "llvm/CodeGen/SlotIndexes.h"
 #include "llvm/MC/LaneBitmask.h"
 #include "llvm/Support/Allocator.h"
@@ -704,11 +705,11 @@ namespace llvm {
   private:
     SubRange *SubRanges = nullptr; ///< Single linked list of subregister live
                                    /// ranges.
-    const unsigned Reg; // the register or stack slot of this interval.
+    const Register Reg; // the register or stack slot of this interval.
     float Weight = 0.0; // weight of this interval
 
   public:
-    unsigned reg() const { return Reg; }
+    Register reg() const { return Reg; }
     float weight() const { return Weight; }
     void incrementWeight(float Inc) { Weight += Inc; }
     void setWeight(float Value) { Weight = Value; }


        


More information about the llvm-commits mailing list