https://bugs.llvm.org/show_bug.cgi?id=41958

            Bug ID: 41958
           Summary: TableGen foreach does not support non-literal ranges
           Product: tools
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: TableGen
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

I want to avoid repeating the same constant in multiple places, but TableGen
does not support nontrivial foreach bounds:

class RegisterLimitsImpl {
  int MaxSGPR = 105;
  int MaxVGPR = 255;
}

def RegisterLimits : RegisterLimitsImpl;

foreach Index = 0-RegisterLimits.MaxVGPR in {

}

$ llvm-tblgen foreach-variable-range.td    
foreach-variable-range.td:9:19: error: expected integer value as end of range
foreach Index = 0-RegisterLimits.MaxVGPR in {
                  ^
foreach-variable-range.td:9:19: error: expected declaration in for
foreach Index = 0-RegisterLimits.MaxVGPR in {

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to