本文整理汇总了C++中DICompileUnit::getDirectory方法的典型用法代码示例。如果您正苦于以下问题:C++ DICompileUnit::getDirectory方法的具体用法?C++ DICompileUnit::getDirectory怎么用?C++ DICompileUnit::getDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DICompileUnit
的用法示例。
在下文中一共展示了DICompileUnit::getDirectory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cmpDICU
bool cmpDICU(const DICompileUnit & CU1, const DICompileUnit & CU2)
{
int cmp = CU1.getDirectory().compare(CU2.getDirectory());
if (cmp == 0)
cmp = CU1.getFilename().compare(CU2.getFilename());
return cmp >= 0 ? false : true;
}
示例2: getLocationInfo
static bool getLocationInfo(const Value *V, std::string &DisplayName,
std::string &Type, unsigned &LineNo,
std::string &File, std::string &Dir) {
DICompileUnit Unit;
DIType TypeD;
if (GlobalVariable *GV = dyn_cast<GlobalVariable>(const_cast<Value*>(V))) {
Value *DIGV = findDbgGlobalDeclare(GV);
if (!DIGV) return false;
DIGlobalVariable Var(cast<MDNode>(DIGV));
StringRef D = Var.getDisplayName();
if (!D.empty())
DisplayName = D;
LineNo = Var.getLineNumber();
Unit = Var.getCompileUnit();
TypeD = Var.getType();
} else if (Function *F = dyn_cast<Function>(const_cast<Value*>(V))){
Value *DIF = findDbgSubprogramDeclare(F);
if (!DIF) return false;
DISubprogram Var(cast<MDNode>(DIF));
StringRef D = Var.getDisplayName();
if (!D.empty())
DisplayName = D;
LineNo = Var.getLineNumber();
Unit = Var.getCompileUnit();
TypeD = Var.getType();
} else {
const DbgDeclareInst *DDI = findDbgDeclare(V);
if (!DDI) return false;
DIVariable Var(cast<MDNode>(DDI->getVariable()));
StringRef D = Var.getName();
if (!D.empty())
DisplayName = D;
LineNo = Var.getLineNumber();
Unit = Var.getCompileUnit();
TypeD = Var.getType();
}
StringRef T = TypeD.getName();
if (!T.empty())
Type = T;
StringRef F = Unit.getFilename();
if (!F.empty())
File = F;
StringRef D = Unit.getDirectory();
if (!D.empty())
Dir = D;
return true;
}
示例3: getLocationInfo
bool getLocationInfo(const Value *V, std::string &DisplayName,
std::string &Type, unsigned &LineNo, std::string &File,
std::string &Dir) {
DICompileUnit Unit;
DIType TypeD;
if (GlobalVariable *GV = dyn_cast<GlobalVariable>(const_cast<Value*>(V))) {
Value *DIGV = findDbgGlobalDeclare(GV);
if (!DIGV) return false;
DIGlobalVariable Var(cast<MDNode>(DIGV));
if (const char *D = Var.getDisplayName())
DisplayName = D;
LineNo = Var.getLineNumber();
Unit = Var.getCompileUnit();
TypeD = Var.getType();
} else {
const DbgDeclareInst *DDI = findDbgDeclare(V);
if (!DDI) return false;
DIVariable Var(cast<MDNode>(DDI->getVariable()));
if (const char *D = Var.getName())
DisplayName = D;
LineNo = Var.getLineNumber();
Unit = Var.getCompileUnit();
TypeD = Var.getType();
}
if (const char *T = TypeD.getName())
Type = T;
if (const char *F = Unit.getFilename())
File = F;
if (const char *D = Unit.getDirectory())
Dir = D;
return true;
}
示例4: ShowCompileUnit
void DIEItem::ShowCompileUnit(DetailsView* detailsView, DICompileUnit cu) {
detailsView->Add(_("CompileUnit"),
toWxStr(cu.getDirectory()) + _("/") + toWxStr(cu.getFilename()));
}