[llvm] f2607df - [TableGen] Use uint8_t for bit_value_t enum. NFC
    Craig Topper via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Mar  7 23:30:03 PST 2025
    
    
  
Author: Craig Topper
Date: 2025-03-07T23:22:45-08:00
New Revision: f2607df291b4a9e6b1a72b3ee0d4e87066421db3
URL: https://github.com/llvm/llvm-project/commit/f2607df291b4a9e6b1a72b3ee0d4e87066421db3
DIFF: https://github.com/llvm/llvm-project/commit/f2607df291b4a9e6b1a72b3ee0d4e87066421db3.diff
LOG: [TableGen] Use uint8_t for bit_value_t enum. NFC
This reduces the amount of space needed for vectors of bit_value_t
and allows the user of memset.
Also reorder the enum values so BIT_FALSE is 0 and BIT_TRUE is 1.
Added: 
    
Modified: 
    llvm/utils/TableGen/DecoderEmitter.cpp
Removed: 
    
################################################################################
diff  --git a/llvm/utils/TableGen/DecoderEmitter.cpp b/llvm/utils/TableGen/DecoderEmitter.cpp
index 80c9fc340c8b0..85eba77097116 100644
--- a/llvm/utils/TableGen/DecoderEmitter.cpp
+++ b/llvm/utils/TableGen/DecoderEmitter.cpp
@@ -190,9 +190,9 @@ class DecoderEmitter {
 //
 // BIT_UNFILTERED is used as the init value for a filter position.  It is used
 // only for filter processings.
-typedef enum {
-  BIT_TRUE,      // '1'
+typedef enum : uint8_t {
   BIT_FALSE,     // '0'
+  BIT_TRUE,      // '1'
   BIT_UNSET,     // '?'
   BIT_UNFILTERED // unfiltered
 } bit_value_t;
        
    
    
More information about the llvm-commits
mailing list