[llvm] r225362 - [CodeGen] Add MVT::FIRST_VALUETYPE to avoid explicit 0. NFC.

Ahmed Bougacha ahmed.bougacha at gmail.com
Wed Jan 7 10:39:00 PST 2015


Author: ab
Date: Wed Jan  7 12:39:00 2015
New Revision: 225362

URL: http://llvm.org/viewvc/llvm-project?rev=225362&view=rev
Log:
[CodeGen] Add MVT::FIRST_VALUETYPE to avoid explicit 0. NFC.

Many places reference MVT::LAST_VALUETYPE when iterating over all
valid MVTs, but they usually start with 0.
With FIRST_VALUETYPE, we can avoid explicit constants when we really
should be using MVT::SimpleValueType.

Modified:
    llvm/trunk/include/llvm/CodeGen/MachineValueType.h

Modified: llvm/trunk/include/llvm/CodeGen/MachineValueType.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineValueType.h?rev=225362&r1=225361&r2=225362&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineValueType.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineValueType.h Wed Jan  7 12:39:00 2015
@@ -118,6 +118,7 @@ namespace llvm {
                               // unspecified type.  The register class
                               // will be determined by the opcode.
 
+      FIRST_VALUETYPE = 0,    // This is always the beginning of the list.
       LAST_VALUETYPE =  58,   // This always remains at the end of the list.
 
       // This is the current maximum for LAST_VALUETYPE.





More information about the llvm-commits mailing list