[llvm] 24ab012 - [CodeGen] Rewrite assert in Register::asMCReg() using member functions. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 18 22:40:05 PST 2025


Author: Craig Topper
Date: 2025-01-18T22:10:26-08:00
New Revision: 24ab0125ba86ea49bb046eb434c1b3861b2d3dd2

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

LOG: [CodeGen] Rewrite assert in Register::asMCReg() using member functions. NFC

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/CodeGen/Register.h b/llvm/include/llvm/CodeGen/Register.h
index 4a61ea8af3b461..3412ea4b244607 100644
--- a/llvm/include/llvm/CodeGen/Register.h
+++ b/llvm/include/llvm/CodeGen/Register.h
@@ -108,8 +108,7 @@ class Register {
   /// expected to have already validated that this Register is, indeed,
   /// physical.
   MCRegister asMCReg() const {
-    assert(Reg == MCRegister::NoRegister ||
-           MCRegister::isPhysicalRegister(Reg));
+    assert(!isValid() || isPhysical());
     return MCRegister(Reg);
   }
 


        


More information about the llvm-commits mailing list