本文整理汇总了C++中DIFile::getFileNode方法的典型用法代码示例。如果您正苦于以下问题:C++ DIFile::getFileNode方法的具体用法?C++ DIFile::getFileNode怎么用?C++ DIFile::getFileNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIFile
的用法示例。
在下文中一共展示了DIFile::getFileNode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createMethod
DISubprogram DIBuilder::createMethod(DIDescriptor Context, StringRef Name,
StringRef LinkageName, DIFile F,
unsigned LineNo, DICompositeType Ty,
bool isLocalToUnit, bool isDefinition,
unsigned VK, unsigned VIndex,
DIType VTableHolder, unsigned Flags,
bool isOptimized, Function *Fn,
MDNode *TParam) {
assert(Ty.getTag() == dwarf::DW_TAG_subroutine_type &&
"function types should be subroutines");
assert(getNonCompileUnitScope(Context) &&
"Methods should have both a Context and a context that isn't "
"the compile unit.");
Value *Elts[] = {HeaderBuilder::get(dwarf::DW_TAG_subprogram)
.concat(Name)
.concat(Name)
.concat(LinkageName)
.concat(LineNo)
.concat(isLocalToUnit)
.concat(isDefinition)
.concat(VK)
.concat(VIndex)
.concat(Flags)
.concat(isOptimized)
.concat(LineNo)
// FIXME: Do we want to use different scope/lines?
.get(VMContext),
F.getFileNode(), DIScope(Context).getRef(), Ty,
VTableHolder.getRef(), Fn, TParam, nullptr, nullptr};
MDNode *Node = MDNode::get(VMContext, Elts);
if (isDefinition)
AllSubprograms.push_back(Node);
DISubprogram S(Node);
assert(S.isSubprogram() && "createMethod should return a valid DISubprogram");
return S;
}
示例2: createEnumerationType
/// createEnumerationType - Create debugging information entry for an
/// enumeration.
DICompositeType DIBuilder::createEnumerationType(
DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNumber,
uint64_t SizeInBits, uint64_t AlignInBits, DIArray Elements,
DIType UnderlyingType) {
// TAG_enumeration_type is encoded in DICompositeType format.
Value *Elts[] = {
GetTagConstant(VMContext, dwarf::DW_TAG_enumeration_type),
File.getFileNode(),
getNonCompileUnitScope(Scope),
MDString::get(VMContext, Name),
ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber),
ConstantInt::get(Type::getInt64Ty(VMContext), SizeInBits),
ConstantInt::get(Type::getInt64Ty(VMContext), AlignInBits),
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
UnderlyingType,
Elements,
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
Constant::getNullValue(Type::getInt32Ty(VMContext))
};
MDNode *Node = MDNode::get(VMContext, Elts);
AllEnumTypes.push_back(Node);
return DICompositeType(Node);
}