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


C++ PassRegistry类代码示例

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


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

示例1: LLVMRustPrintPasses

extern "C" void LLVMRustPrintPasses() {
  LLVMInitializePasses();
  struct MyListener : PassRegistrationListener {
    void passEnumerate(const PassInfo *Info) {
#if LLVM_VERSION_GE(4, 0)
      StringRef PassArg = Info->getPassArgument();
      StringRef PassName = Info->getPassName();
      if (!PassArg.empty()) {
        // These unsigned->signed casts could theoretically overflow, but
        // realistically never will (and even if, the result is implementation
        // defined rather plain UB).
        printf("%15.*s - %.*s\n", (int)PassArg.size(), PassArg.data(),
               (int)PassName.size(), PassName.data());
      }
#else
      if (Info->getPassArgument() && *Info->getPassArgument()) {
        printf("%15s - %s\n", Info->getPassArgument(), Info->getPassName());
      }
#endif
    }
  } Listener;

  PassRegistry *PR = PassRegistry::getPassRegistry();
  PR->enumerateWith(&Listener);
}
开发者ID:DiamondLovesYou,项目名称:rust,代码行数:25,代码来源:PassWrapper.cpp

示例2: LLVMRustFindAndCreatePass

extern "C" LLVMPassRef LLVMRustFindAndCreatePass(const char *PassName) {
  StringRef SR(PassName);
  PassRegistry *PR = PassRegistry::getPassRegistry();

  const PassInfo *PI = PR->getPassInfo(SR);
  if (PI) {
    return wrap(PI->createPass());
  }
  return nullptr;
}
开发者ID:DiamondLovesYou,项目名称:rust,代码行数:10,代码来源:PassWrapper.cpp

示例3: LLVMCreatePass

extern "C" LLVMPassRef LLVMCreatePass(const char * PassName) {
    StringRef SR(PassName);
    PassRegistry * PR = PassRegistry::getPassRegistry();

    const PassInfo * PI = PR->getPassInfo(SR);
    if (PI) {
        return wrap(PI->createPass());
    } else {
        return (LLVMPassRef)0;
    }
}
开发者ID:joris-r,项目名称:rust,代码行数:11,代码来源:PassWrapper.cpp

示例4: LLVMRustFindAndCreatePass

extern "C" Pass*
LLVMRustFindAndCreatePass(const char *PassName) {
    StringRef SR(PassName);
    PassRegistry *PR = PassRegistry::getPassRegistry();

    const PassInfo *PI = PR->getPassInfo(SR);
    if (PI) {
        return PI->createPass();
    }
    return NULL;
}
开发者ID:1989tianlong,项目名称:rust,代码行数:11,代码来源:PassWrapper.cpp

示例5: LLVMRustAddPass

extern "C" bool
LLVMRustAddPass(LLVMPassManagerRef PM, const char *PassName) {
    PassManagerBase *pm = unwrap(PM);

    StringRef SR(PassName);
    PassRegistry *PR = PassRegistry::getPassRegistry();

    const PassInfo *PI = PR->getPassInfo(SR);
    if (PI) {
        pm->add(PI->createPass());
        return true;
    }
    return false;
}
开发者ID:Aaron1011,项目名称:rust,代码行数:14,代码来源:PassWrapper.cpp

示例6: LLVMRustPrintPasses

extern "C" void
LLVMRustPrintPasses() {
    LLVMInitializePasses();
    struct MyListener : PassRegistrationListener {
        void passEnumerate(const PassInfo *info) {
            if (info->getPassArgument() && *info->getPassArgument()) {
                printf("%15s - %s\n", info->getPassArgument(),
                       info->getPassName());
            }
        }
    } listener;

    PassRegistry *PR = PassRegistry::getPassRegistry();
    PR->enumerateWith(&listener);
}
开发者ID:AveryOS,项目名称:rust,代码行数:15,代码来源:PassWrapper.cpp

示例7: initializePassOnce

static void initializePassOnce(PassRegistry &Registry) {
  const char *Name = "Hexagon Expand Predicate Spill Code";
  PassInfo *PI = new PassInfo(Name, "hexagon-spill-pred",
                              &HexagonExpandPredSpillCode::ID,
                              nullptr, false, false);
  Registry.registerPass(*PI, true);
}
开发者ID:eGit,项目名称:llvm,代码行数:7,代码来源:HexagonExpandPredSpillCode.cpp

示例8: initializePassOnce

static void initializePassOnce(PassRegistry &Registry) {
  PassInfo *PI = new PassInfo("Hexagon CFG Optimizer", "hexagon-cfg",
                              &HexagonCFGOptimizer::ID, nullptr, false, false);
  Registry.registerPass(*PI, true);
}
开发者ID:8l,项目名称:SPIRV-LLVM,代码行数:5,代码来源:HexagonCFGOptimizer.cpp

示例9: initializePassOnce

static void initializePassOnce(PassRegistry &Registry) {
  const char *Name = "Hexagon Expand Condsets";
  PassInfo *PI = new PassInfo(Name, "expand-condsets",
        &HexagonExpandCondsets::ID, 0, false, false);
  Registry.registerPass(*PI, true);
}
开发者ID:AnachroNia,项目名称:llvm,代码行数:6,代码来源:HexagonExpandCondsets.cpp


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