[LLVMbugs] [Bug 1026] NEW: InstVisit duplicates instruction visitors

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Nov 29 13:29:52 PST 2006


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

           Summary: InstVisit duplicates instruction visitors
           Product: libraries
           Version: 1.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Support Libraries
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: rspencer at x10sys.com


The InstVisitor class currently defines the individual instruction visitors
twice, with one defaulting to a delegation to the other. This is a bit silly and
should be corrected. However, it might mean cleanup up the users of InstVisitor
as well.

The change is fairly simple. In Instruction.def, change the various
HANDLE_*_INST macros to take three arguments. From:

HANDLE_*_INST(num, opcode, CLASS)

to

HANDLE_*_INT(num, opcode, CLASS, BASE_CLASS)

for example:

HANDLE_TERM_INST(1, Ret, ReturnInst, TerminatorInst)

The HANDLE_INST class would also need to change.

Then the macro in InstVisitor.h could then be defined as:

#define HANDLE_INST(NUM, OPCODE, CLASS, BASECLASS) \
    RetTy visit##CLASS(CLASS &I) { DELEGATE(BASECLASS); }

and the duplicates deleted.



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



More information about the llvm-bugs mailing list