LLVM API Documentation

Classes | Namespaces | Defines | Functions
PassSupport.h File Reference
#include "Pass.h"
#include "llvm/InitializePasses.h"
#include "llvm/PassInfo.h"
#include "llvm/PassRegistry.h"
#include "llvm/Support/Atomic.h"
#include "llvm/Support/Valgrind.h"
#include <vector>
Include dependency graph for PassSupport.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  llvm::RegisterPass< passName >
class  llvm::RegisterAGBase
struct  llvm::RegisterAnalysisGroup< Interface, Default >
struct  llvm::PassRegistrationListener

Namespaces

namespace  llvm
 

List of target independent CodeGen pass IDs.


Defines

#define CALL_ONCE_INITIALIZATION(function)
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)   static void* initialize##passName##PassOnce(PassRegistry &Registry) {
#define INITIALIZE_PASS_DEPENDENCY(depName)   initialize##depName##Pass(Registry);
#define INITIALIZE_AG_DEPENDENCY(depName)   initialize##depName##AnalysisGroup(Registry);
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
#define INITIALIZE_ANALYSIS_GROUP(agName, name, defaultPass)
#define INITIALIZE_AG_PASS(passName, agName, arg, name, cfg, analysis, def)
#define INITIALIZE_AG_PASS_BEGIN(passName, agName, arg, n, cfg, analysis, def)
#define INITIALIZE_AG_PASS_END(passName, agName, arg, n, cfg, analysis, def)

Functions

template<typename PassName >
Passllvm::callDefaultCtor ()
template<typename PassName >
Passllvm::callTargetMachineCtor (TargetMachine *TM)

Define Documentation

Value:
static volatile sys::cas_flag initialized = 0; \
  sys::cas_flag old_val = sys::CompareAndSwap(&initialized, 1, 0); \
  if (old_val == 0) { \
    function(Registry); \
    sys::MemoryFence(); \
    TsanIgnoreWritesBegin(); \
    TsanHappensBefore(&initialized); \
    initialized = 2; \
    TsanIgnoreWritesEnd(); \
  } else { \
    sys::cas_flag tmp = initialized; \
    sys::MemoryFence(); \
    while (tmp != 2) { \
      tmp = initialized; \
      sys::MemoryFence(); \
    } \
  } \
  TsanHappensAfter(&initialized);

Definition at line 36 of file PassSupport.h.

Referenced by llvm::initializeHexagonCFGOptimizerPass(), llvm::initializeHexagonDAGToDAGISelPass(), llvm::initializeHexagonExpandPredSpillCodePass(), llvm::initializeHexagonSplitTFRCondSetsPass(), and llvm::initializePPCDAGToDAGISelPass().

#define INITIALIZE_AG_DEPENDENCY (   depName)    initialize##depName##AnalysisGroup(Registry);

Definition at line 72 of file PassSupport.h.

#define INITIALIZE_AG_PASS (   passName,
  agName,
  arg,
  name,
  cfg,
  analysis,
  def 
)
Value:
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) \
  }

Definition at line 175 of file PassSupport.h.

#define INITIALIZE_AG_PASS_BEGIN (   passName,
  agName,
  arg,
  n,
  cfg,
  analysis,
  def 
)
Value:
static void* initialize##passName##PassOnce(PassRegistry &Registry) { \
    if (!def) initialize##agName##AnalysisGroup(Registry);

Definition at line 192 of file PassSupport.h.

#define INITIALIZE_AG_PASS_END (   passName,
  agName,
  arg,
  n,
  cfg,
  analysis,
  def 
)
Value:
PassInfo *PI = new PassInfo(n, arg, & passName ::ID, \
      PassInfo::NormalCtor_t(callDefaultCtor< passName >), cfg, analysis); \
    Registry.registerPass(*PI, true); \
    \
    PassInfo *AI = new PassInfo(n, & 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) \
  }

Definition at line 196 of file PassSupport.h.

#define INITIALIZE_ANALYSIS_GROUP (   agName,
  name,
  defaultPass 
)
Value:
static void* initialize##agName##AnalysisGroupOnce(PassRegistry &Registry) { \
    initialize##defaultPass##Pass(Registry); \
    PassInfo *AI = new PassInfo(name, & agName :: ID); \
    Registry.registerAnalysisGroup(& agName ::ID, 0, *AI, false, true); \
    return AI; \
  } \
  void llvm::initialize##agName##AnalysisGroup(PassRegistry &Registry) { \
    CALL_ONCE_INITIALIZATION(initialize##agName##AnalysisGroupOnce) \
  }

Definition at line 163 of file PassSupport.h.

#define INITIALIZE_PASS (   passName,
  arg,
  name,
  cfg,
  analysis 
)
Value:
static void* initialize##passName##PassOnce(PassRegistry &Registry) { \
    PassInfo *PI = new PassInfo(name, arg, & passName ::ID, \
      PassInfo::NormalCtor_t(callDefaultCtor< passName >), cfg, analysis); \
    Registry.registerPass(*PI, true); \
    return PI; \
  } \
  void llvm::initialize##passName##Pass(PassRegistry &Registry) { \
    CALL_ONCE_INITIALIZATION(initialize##passName##PassOnce) \
  }

Definition at line 56 of file PassSupport.h.

#define INITIALIZE_PASS_BEGIN (   passName,
  arg,
  name,
  cfg,
  analysis 
)    static void* initialize##passName##PassOnce(PassRegistry &Registry) {

Definition at line 67 of file PassSupport.h.

#define INITIALIZE_PASS_DEPENDENCY (   depName)    initialize##depName##Pass(Registry);

Definition at line 70 of file PassSupport.h.

#define INITIALIZE_PASS_END (   passName,
  arg,
  name,
  cfg,
  analysis 
)
Value:
PassInfo *PI = new PassInfo(name, arg, & passName ::ID, \
      PassInfo::NormalCtor_t(callDefaultCtor< passName >), cfg, analysis); \
    Registry.registerPass(*PI, true); \
    return PI; \
  } \
  void llvm::initialize##passName##Pass(PassRegistry &Registry) { \
    CALL_ONCE_INITIALIZATION(initialize##passName##PassOnce) \
  }

Definition at line 75 of file PassSupport.h.