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


C++ CompoundConstantEmitter类代码示例

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


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

示例1: run

void EDEmitter::run(raw_ostream &o) {
    unsigned int i = 0;

    CompoundConstantEmitter infoArray;
    CodeGenTarget target;

    populateInstInfo(infoArray, target);

    o << "InstInfo instInfo" << target.getName().c_str() << "[] = ";
    infoArray.emit(o, i);
    o << ";" << "\n";
}
开发者ID:sungsujo,项目名称:nacl-llvm-branches.llvm-trunk,代码行数:12,代码来源:EDEmitter.cpp

示例2: EmitEnhancedDisassemblerInfo

void EmitEnhancedDisassemblerInfo(RecordKeeper &RK, raw_ostream &OS) {
  emitSourceFileHeader("Enhanced Disassembler Info", OS);
  unsigned int i = 0;

  CompoundConstantEmitter infoArray;
  CodeGenTarget target(RK);

  populateInstInfo(infoArray, target);

  emitCommonEnums(OS, i);

  OS << "static const llvm::EDInstInfo instInfo"
     << target.getName() << "[] = ";
  infoArray.emit(OS, i);
  OS << ";" << "\n";
}
开发者ID:CSRedRat,项目名称:llvm-mirror,代码行数:16,代码来源:EDEmitter.cpp

示例3: run

void EDEmitter::run(raw_ostream &o) {
  unsigned int i = 0;

  CompoundConstantEmitter infoArray;
  CodeGenTarget target(Records);

  populateInstInfo(infoArray, target);

  emitCommonEnums(o, i);

  o << "namespace {\n";

  o << "llvm::EDInstInfo instInfo" << target.getName().c_str() << "[] = ";
  infoArray.emit(o, i);
  o << ";" << "\n";

  o << "}\n";
}
开发者ID:nobled,项目名称:llvm,代码行数:18,代码来源:EDEmitter.cpp

示例4: populateInstInfo

/// populateInstInfo - Fills an array of InstInfos with information about each
///   instruction in a target
///
/// \param infoArray The array of InstInfo objects to populate
/// \param target    The CodeGenTarget to use as a source of instructions
static void populateInstInfo(CompoundConstantEmitter &infoArray,
                             CodeGenTarget &target) {
  const std::vector<const CodeGenInstruction*> &numberedInstructions =
    target.getInstructionsByEnumValue();

  unsigned int index;
  unsigned int numInstructions = numberedInstructions.size();

  for (index = 0; index < numInstructions; ++index) {
    const CodeGenInstruction& inst = *numberedInstructions[index];

    CompoundConstantEmitter *infoStruct = new CompoundConstantEmitter;
    infoArray.addEntry(infoStruct);

    LiteralConstantEmitter *instType = new LiteralConstantEmitter;
    infoStruct->addEntry(instType);

    LiteralConstantEmitter *numOperandsEmitter =
      new LiteralConstantEmitter(inst.Operands.size());
    infoStruct->addEntry(numOperandsEmitter);

    CompoundConstantEmitter *operandTypeArray = new CompoundConstantEmitter;
    infoStruct->addEntry(operandTypeArray);

    LiteralConstantEmitter *operandTypes[EDIS_MAX_OPERANDS];

    CompoundConstantEmitter *operandFlagArray = new CompoundConstantEmitter;
    infoStruct->addEntry(operandFlagArray);

    FlagsConstantEmitter *operandFlags[EDIS_MAX_OPERANDS];

    for (unsigned operandIndex = 0;
         operandIndex < EDIS_MAX_OPERANDS;
         ++operandIndex) {
      operandTypes[operandIndex] = new LiteralConstantEmitter;
      operandTypeArray->addEntry(operandTypes[operandIndex]);

      operandFlags[operandIndex] = new FlagsConstantEmitter;
      operandFlagArray->addEntry(operandFlags[operandIndex]);
    }

    unsigned numSyntaxes = 0;

    // We don't need to do anything for pseudo-instructions, as we'll never
    // see them here. We'll only see real instructions.
    // We still need to emit null initializers for everything.
    if (!inst.isPseudo) {
      if (target.getName() == "X86") {
        X86PopulateOperands(operandTypes, inst);
        X86ExtractSemantics(*instType, operandFlags, inst);
        numSyntaxes = 2;
      }
      else if (target.getName() == "ARM") {
        ARMPopulateOperands(operandTypes, inst);
        ARMExtractSemantics(*instType, operandTypes, operandFlags, inst);
        numSyntaxes = 1;
      }
    }

    CompoundConstantEmitter *operandOrderArray = new CompoundConstantEmitter;

    infoStruct->addEntry(operandOrderArray);

    for (unsigned syntaxIndex = 0;
         syntaxIndex < EDIS_MAX_SYNTAXES;
         ++syntaxIndex) {
      CompoundConstantEmitter *operandOrder =
        new CompoundConstantEmitter(EDIS_MAX_OPERANDS);

      operandOrderArray->addEntry(operandOrder);

      if (syntaxIndex < numSyntaxes) {
        populateOperandOrder(operandOrder, inst, syntaxIndex);
      }
    }

    infoStruct = NULL;
  }
}
开发者ID:CSRedRat,项目名称:llvm-mirror,代码行数:84,代码来源:EDEmitter.cpp


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