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


C++ DIType::isType方法代码示例

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


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

示例1: createFriend

DIDerivedType DIBuilder::createFriend(DIType Ty, DIType FriendTy) {
  // typedefs are encoded in DIDerivedType format.
  assert(Ty.isType() && "Invalid type!");
  assert(FriendTy.isType() && "Invalid friend type!");
  Value *Elts[] = {HeaderBuilder::get(dwarf::DW_TAG_friend)
                       .concat(StringRef()) // Name
                       .concat(0)           // Line
                       .concat(0)           // Size
                       .concat(0)           // Align
                       .concat(0)           // Offset
                       .concat(0)           // Flags
                       .get(VMContext),
                   nullptr, Ty.getRef(), FriendTy.getRef()};
  return DIDerivedType(MDNode::get(VMContext, Elts));
}
开发者ID:MessiahAndrw,项目名称:Perception,代码行数:15,代码来源:DIBuilder.cpp

示例2: createLocalVariable

/// createVariable - Create a new descriptor for the specified variable.
DIVariable DIBuilder::createLocalVariable(unsigned Tag, DIDescriptor Scope,
                                          StringRef Name, DIFile File,
                                          unsigned LineNo, DIType Ty,
                                          bool AlwaysPreserve, unsigned Flags,
                                          unsigned ArgNo) {
  DIDescriptor Context(getNonCompileUnitScope(Scope));
  assert((!Context || Context.isScope()) &&
         "createLocalVariable should be called with a valid Context");
  assert(Ty.isType() &&
         "createLocalVariable should be called with a valid type");
  Value *Elts[] = {
    GetTagConstant(VMContext, Tag),
    getNonCompileUnitScope(Scope),
    MDString::get(VMContext, Name),
    File,
    ConstantInt::get(Type::getInt32Ty(VMContext), (LineNo | (ArgNo << 24))),
    Ty,
    ConstantInt::get(Type::getInt32Ty(VMContext), Flags),
    Constant::getNullValue(Type::getInt32Ty(VMContext))
  };
  MDNode *Node = MDNode::get(VMContext, Elts);
  if (AlwaysPreserve) {
    // The optimizer may remove local variable. If there is an interest
    // to preserve variable info in such situation then stash it in a
    // named mdnode.
    DISubprogram Fn(getDISubprogram(Scope));
    NamedMDNode *FnLocals = getOrInsertFnSpecificMDNode(M, Fn);
    FnLocals->addOperand(Node);
  }
  DIVariable RetVar(Node);
  assert(RetVar.isVariable() &&
         "createLocalVariable should return a valid DIVariable");
  return RetVar;
}
开发者ID:Dr15Jones,项目名称:root,代码行数:35,代码来源:DIBuilder.cpp

示例3: createFriend

/// createFriend - Create debugging information entry for a 'friend'.
DIDerivedType DIBuilder::createFriend(DIType Ty, DIType FriendTy) {
  // typedefs are encoded in DIDerivedType format.
  assert(Ty.isType() && "Invalid type!");
  assert(FriendTy.isType() && "Invalid friend type!");
  Value *Elts[] = {
    GetTagConstant(VMContext, dwarf::DW_TAG_friend),
    NULL,
    Ty.generateRef(),
    NULL, // Name
    ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Line
    ConstantInt::get(Type::getInt64Ty(VMContext), 0), // Size
    ConstantInt::get(Type::getInt64Ty(VMContext), 0), // Align
    ConstantInt::get(Type::getInt64Ty(VMContext), 0), // Offset
    ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags
    FriendTy
  };
  return DIDerivedType(MDNode::get(VMContext, Elts));
}
开发者ID:Dr15Jones,项目名称:root,代码行数:19,代码来源:DIBuilder.cpp

示例4: createInheritance

DIDerivedType DIBuilder::createInheritance(DIType Ty, DIType BaseTy,
                                           uint64_t BaseOffset,
                                           unsigned Flags) {
  assert(Ty.isType() && "Unable to create inheritance");
  // TAG_inheritance is encoded in DIDerivedType format.
  Value *Elts[] = {HeaderBuilder::get(dwarf::DW_TAG_inheritance)
                       .concat(StringRef()) // Name
                       .concat(0)           // Line
                       .concat(0)           // Size
                       .concat(0)           // Align
                       .concat(BaseOffset)
                       .concat(Flags)
                       .get(VMContext),
                   nullptr, Ty.getRef(), BaseTy.getRef()};
  return DIDerivedType(MDNode::get(VMContext, Elts));
}
开发者ID:MessiahAndrw,项目名称:Perception,代码行数:16,代码来源:DIBuilder.cpp

示例5: createReferenceType

DIDerivedType DIBuilder::createReferenceType(unsigned Tag, DIType RTy) {
  assert(RTy.isType() && "Unable to create reference type");
  // References are encoded in DIDerivedType format.
  Value *Elts[] = {HeaderBuilder::get(Tag)
                       .concat(StringRef()) // Name
                       .concat(0)           // Line
                       .concat(0)           // Size
                       .concat(0)           // Align
                       .concat(0)           // Offset
                       .concat(0)           // Flags
                       .get(VMContext),
                   nullptr, // Filename
                   nullptr, // TheCU,
                   RTy.getRef()};
  return DIDerivedType(MDNode::get(VMContext, Elts));
}
开发者ID:MessiahAndrw,项目名称:Perception,代码行数:16,代码来源:DIBuilder.cpp

示例6: createReferenceType

/// createReferenceType - Create debugging information entry for a reference
/// type.
DIDerivedType DIBuilder::createReferenceType(unsigned Tag, DIType RTy) {
  assert(RTy.isType() && "Unable to create reference type");
  // References are encoded in DIDerivedType format.
  Value *Elts[] = {
    GetTagConstant(VMContext, Tag),
    NULL, // Filename
    NULL, // TheCU,
    NULL, // Name
    ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Line
    ConstantInt::get(Type::getInt64Ty(VMContext), 0), // Size
    ConstantInt::get(Type::getInt64Ty(VMContext), 0), // Align
    ConstantInt::get(Type::getInt64Ty(VMContext), 0), // Offset
    ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags
    RTy
  };
  return DIDerivedType(MDNode::get(VMContext, Elts));
}
开发者ID:Dr15Jones,项目名称:root,代码行数:19,代码来源:DIBuilder.cpp

示例7: createInheritance

/// createInheritance - Create debugging information entry to establish
/// inheritance relationship between two types.
DIDerivedType DIBuilder::createInheritance(
    DIType Ty, DIType BaseTy, uint64_t BaseOffset, unsigned Flags) {
  assert(Ty.isType() && "Unable to create inheritance");
  // TAG_inheritance is encoded in DIDerivedType format.
  Value *Elts[] = {
    GetTagConstant(VMContext, dwarf::DW_TAG_inheritance),
    NULL,
    Ty.generateRef(),
    NULL, // Name
    ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Line
    ConstantInt::get(Type::getInt64Ty(VMContext), 0), // Size
    ConstantInt::get(Type::getInt64Ty(VMContext), 0), // Align
    ConstantInt::get(Type::getInt64Ty(VMContext), BaseOffset),
    ConstantInt::get(Type::getInt32Ty(VMContext), Flags),
    BaseTy
  };
  return DIDerivedType(MDNode::get(VMContext, Elts));
}
开发者ID:Dr15Jones,项目名称:root,代码行数:20,代码来源:DIBuilder.cpp

示例8: createTypedef

/// createTypedef - Create debugging information entry for a typedef.
DIDerivedType DIBuilder::createTypedef(DIType Ty, StringRef Name, DIFile File,
                                       unsigned LineNo, DIDescriptor Context) {
  // typedefs are encoded in DIDerivedType format.
  assert(Ty.isType() && "Invalid typedef type!");
  Value *Elts[] = {
    GetTagConstant(VMContext, dwarf::DW_TAG_typedef),
    File.getFileNode(),
    getNonCompileUnitScope(Context),
    MDString::get(VMContext, Name),
    ConstantInt::get(Type::getInt32Ty(VMContext), LineNo),
    ConstantInt::get(Type::getInt64Ty(VMContext), 0), // Size
    ConstantInt::get(Type::getInt64Ty(VMContext), 0), // Align
    ConstantInt::get(Type::getInt64Ty(VMContext), 0), // Offset
    ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags
    Ty
  };
  return DIDerivedType(MDNode::get(VMContext, Elts));
}
开发者ID:Dr15Jones,项目名称:root,代码行数:19,代码来源:DIBuilder.cpp


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