http://llvm.org/bugs/show_bug.cgi?id=20128

            Bug ID: 20128
           Summary: magic numbers in MachineInstr.cpp
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Around line 318:
        if (TiedTo != 15)

Not even a comment about what that '15' means, but later:

Around line 1162:
// MachineOperand::TiedTo is 4 bits wide.
const unsigned TiedMax = 15;

How about defining this constant in MachineOperand.h where the bitfield is
defined? 

Is there a way to determine bitfield size at compile-time?

If not, then do something like this?

#define BITS_IN_TIEDTO_FIELD 4
static const unsigned TiedMax = (1 << BITS_IN_TIEDTO_FIELD) - 1;

...and then use that const value in MachineInstr.cpp.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to