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

           Summary: enum type translation functions generate a lot of code
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


The following code compiles to a jump table instead of a simpler version that
uses the fact that the enum values are the same:

enum bar {
        MROUND, MSQUARE, MBUTT, MTRI, MERROR
};

enum foo { FROUND, FSQUARE, FBUTT, FTRI, FERROR} ;

enum foo t(enum bar m) {
        switch (m) {
                case MROUND:
                        return FROUND;
                case MSQUARE:
                        return FSQUARE;
                case MBUTT:
                        return FBUTT;
                case MTRI:
                        return FTRI;
                default:
                case MERROR:
                        return FERROR;
        }
}

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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