本文整理汇总了C++中DIType::getContext方法的典型用法代码示例。如果您正苦于以下问题:C++ DIType::getContext方法的具体用法?C++ DIType::getContext怎么用?C++ DIType::getContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIType
的用法示例。
在下文中一共展示了DIType::getContext方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processType
void DebugInfoFinder::processType(DIType DT) {
if (!addType(DT))
return;
processScope(DT.getContext().resolve(TypeIdentifierMap));
if (DT.isCompositeType()) {
DICompositeType DCT(DT);
processType(DCT.getTypeDerivedFrom().resolve(TypeIdentifierMap));
if (DT.isSubroutineType()) {
DITypeArray DTA = DISubroutineType(DT).getTypeArray();
for (unsigned i = 0, e = DTA.getNumElements(); i != e; ++i)
processType(DTA.getElement(i).resolve(TypeIdentifierMap));
return;
}
DIArray DA = DCT.getElements();
for (unsigned i = 0, e = DA.getNumElements(); i != e; ++i) {
DIDescriptor D = DA.getElement(i);
if (D.isType())
processType(DIType(D));
else if (D.isSubprogram())
processSubprogram(DISubprogram(D));
}
} else if (DT.isDerivedType()) {
DIDerivedType DDT(DT);
processType(DDT.getTypeDerivedFrom().resolve(TypeIdentifierMap));
}
}
示例2: addGlobalType
/// addGlobalType - Add a new global type to the compile unit.
///
void CompileUnit::addGlobalType(DIType Ty) {
DIDescriptor Context = Ty.getContext();
if (Ty.isCompositeType() && !Ty.getName().empty() && !Ty.isForwardDecl()
&& (Context.isCompileUnit() || Context.isFile() || Context.isNameSpace()))
if (DIEEntry *Entry = getDIEEntry(Ty))
GlobalTypes[Ty.getName()] = Entry->getEntry();
}
示例3: addSourceLine
/// addSourceLine - Add location information to specified debug information
/// entry.
void CompileUnit::addSourceLine(DIE *Die, DIType Ty) {
// Verify type.
if (!Ty.Verify())
return;
unsigned Line = Ty.getLineNumber();
if (Line == 0 || !Ty.getContext().Verify())
return;
unsigned FileID = DD->GetOrCreateSourceID(Ty.getFilename(), Ty.getDirectory());
assert(FileID && "Invalid file id");
addUInt(Die, dwarf::DW_AT_decl_file, 0, FileID);
addUInt(Die, dwarf::DW_AT_decl_line, 0, Line);
}
示例4: processType
void DebugInfoFinder::processType(DIType DT) {
if (!addType(DT))
return;
processScope(DT.getContext().resolve(TypeIdentifierMap));
if (DICompositeType DCT = dyn_cast<MDCompositeTypeBase>(DT)) {
processType(DCT.getTypeDerivedFrom().resolve(TypeIdentifierMap));
if (DISubroutineType ST = dyn_cast<MDSubroutineType>(DCT)) {
for (MDTypeRef Ref : ST->getTypeArray())
processType(Ref.resolve(TypeIdentifierMap));
return;
}
for (Metadata *D : DCT->getElements()->operands()) {
if (DIType T = dyn_cast<MDType>(D))
processType(T);
else if (DISubprogram SP = dyn_cast<MDSubprogram>(D))
processSubprogram(SP);
}
} else if (DIDerivedType DDT = dyn_cast<MDDerivedTypeBase>(DT)) {
processType(DDT.getTypeDerivedFrom().resolve(TypeIdentifierMap));
}
}