[LLVMbugs] [Bug 9442] New: INITIALIZE_AG_PASS and similar macros define new function explicitly in llvm namespace

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Mar 9 12:49:02 PST 2011


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

           Summary: INITIALIZE_AG_PASS and similar macros define new
                    function explicitly in llvm namespace
           Product: libraries
           Version: 2.9
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Miscellaneous Instrumentation passes
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: david at alkaline-solutions.com
                CC: llvmbugs at cs.uiuc.edu


Several macros in <llvm/PassSupport.h> define macros such as the following:

#define INITIALIZE_AG_PASS(passName, agName, arg, name, cfg, analysis, def) \
  static void* initialize##passName##PassOnce(PassRegistry &Registry) { \
    if (!def) initialize##agName##AnalysisGroup(Registry); \
    PassInfo *PI = new PassInfo(name, arg, & passName ::ID, \
      PassInfo::NormalCtor_t(callDefaultCtor< passName >), cfg, analysis); \
    Registry.registerPass(*PI, true); \
    \
    PassInfo *AI = new PassInfo(name, & agName :: ID); \
    Registry.registerAnalysisGroup(& agName ::ID, & passName ::ID, \
                                   *AI, def, true); \
    return AI; \
  } \
  void llvm::initialize##passName##Pass(PassRegistry &Registry) { \
    CALL_ONCE_INITIALIZATION(initialize##passName##PassOnce) \
  }

The llvm::initialize##passName##Pass(PassRegistry &Registry) function is
declared explicitly in a llvm namespace. This makes it much more difficult to
leverage these macros in the creation of custom passes.

-- 
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.



More information about the llvm-bugs mailing list