当前位置: 首页>>代码示例>>C++>>正文


C++ PMStack类代码示例

本文整理汇总了C++中PMStack的典型用法代码示例。如果您正苦于以下问题:C++ PMStack类的具体用法?C++ PMStack怎么用?C++ PMStack使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了PMStack类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: preparePassManager

void MachineModulePass::preparePassManager(PMStack &PMS) {
  assert(!PMS.empty() && "No pass manager found, should not happen.");

  MachineFunctionAnalysis *MFA = (MachineFunctionAnalysis*)
                PMS.top()->findAnalysisPass(&MachineFunctionAnalysis::ID, true);
  if (MFA) {
    MFA->preserveMF();
  }
  ModulePass::preparePassManager(PMS);
}
开发者ID:alexjordan,项目名称:patmos-llvm,代码行数:10,代码来源:MachineModulePass.cpp

示例2: assignPassManager

/// Assign pass manager to manage this pass.
void LoopPass::assignPassManager(PMStack &PMS,
                                 PassManagerType PreferredType) {
    // Find LPPassManager
    while (!PMS.empty() &&
            PMS.top()->getPassManagerType() > PMT_LoopPassManager)
        PMS.pop();

    LPPassManager *LPPM;
    if (PMS.top()->getPassManagerType() == PMT_LoopPassManager)
        LPPM = (LPPassManager*)PMS.top();
    else {
        // Create new Loop Pass Manager if it does not exist.
        assert (!PMS.empty() && "Unable to create Loop Pass Manager");
        PMDataManager *PMD = PMS.top();

        // [1] Create new Loop Pass Manager
        LPPM = new LPPassManager();
        LPPM->populateInheritedAnalysis(PMS);

        // [2] Set up new manager's top level manager
        PMTopLevelManager *TPM = PMD->getTopLevelManager();
        TPM->addIndirectPassManager(LPPM);

        // [3] Assign manager to manage this new manager. This may create
        // and push new managers into PMS
        Pass *P = LPPM->getAsPass();
        TPM->schedulePass(P);

        // [4] Push new manager into PMS
        PMS.push(LPPM);
    }

    LPPM->add(this);
}
开发者ID:Celtoys,项目名称:clReflect,代码行数:35,代码来源:LoopPass.cpp

示例3: assignPassManager

/// Assign pass manager to manage this pass.
void CallGraphSCCPass::assignPassManager(PMStack &PMS,
                                         PassManagerType PreferredType) {
  // Find CGPassManager 
  while (!PMS.empty() &&
         PMS.top()->getPassManagerType() > PMT_CallGraphPassManager)
    PMS.pop();

  assert (!PMS.empty() && "Unable to handle Call Graph Pass");
  CGPassManager *CGP = dynamic_cast<CGPassManager *>(PMS.top());

  // Create new Call Graph SCC Pass Manager if it does not exist. 
  if (!CGP) {

    assert (!PMS.empty() && "Unable to create Call Graph Pass Manager");
    PMDataManager *PMD = PMS.top();

    // [1] Create new Call Graph Pass Manager
    CGP = new CGPassManager(PMD->getDepth() + 1);

    // [2] Set up new manager's top level manager
    PMTopLevelManager *TPM = PMD->getTopLevelManager();
    TPM->addIndirectPassManager(CGP);

    // [3] Assign manager to manage this new manager. This may create
    // and push new managers into PMS
    Pass *P = dynamic_cast<Pass *>(CGP);
    TPM->schedulePass(P);

    // [4] Push new manager into PMS
    PMS.push(CGP);
  }

  CGP->add(this);
}
开发者ID:aosm,项目名称:clang,代码行数:35,代码来源:CallGraphSCCPass.cpp

示例4: preparePassManager

// Check if this pass is suitable for the current LPPassManager, if
// available. This pass P is not suitable for a LPPassManager if P
// is not preserving higher level analysis info used by other
// LPPassManager passes. In such case, pop LPPassManager from the
// stack. This will force assignPassManager() to create new
// LPPassManger as expected.
void LoopPass::preparePassManager(PMStack &PMS) {

  // Find LPPassManager 
  while (!PMS.empty() &&
         PMS.top()->getPassManagerType() > PMT_LoopPassManager)
    PMS.pop();

  LPPassManager *LPPM = dynamic_cast<LPPassManager *>(PMS.top());

  // If this pass is destroying high level information that is used
  // by other passes that are managed by LPM then do not insert
  // this pass in current LPM. Use new LPPassManager.
  if (LPPM && !LPPM->preserveHigherLevelAnalysis(this)) 
    PMS.pop();
}
开发者ID:aosm,项目名称:clang,代码行数:21,代码来源:LoopPass.cpp

示例5: preparePassManager

 void preparePassManager(PMStack &Stack) override {
     (void)jl_init_llvm();
     PMTopLevelManager *TPM = Stack.top()->getTopLevelManager();
     TPMAdapter Adapter(TPM);
     addTargetPasses(&Adapter, jl_TargetMachine);
     addOptimizationPasses(&Adapter, OptLevel);
 }
开发者ID:davidanthoff,项目名称:julia,代码行数:7,代码来源:jitlayers.cpp


注:本文中的PMStack类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。