本文整理汇总了C++中DIType::Verify方法的典型用法代码示例。如果您正苦于以下问题:C++ DIType::Verify方法的具体用法?C++ DIType::Verify怎么用?C++ DIType::Verify使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIType
的用法示例。
在下文中一共展示了DIType::Verify方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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.Verify()) &&
"createLocalVariable should be called with a valid Context");
assert(Ty.Verify() &&
"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);
}
assert(DIVariable(Node).Verify() &&
"createLocalVariable should return a verifiable DIVariable");
return DIVariable(Node);
}
示例2: createFriend
/// createFriend - Create debugging information entry for a 'friend'.
DIType DIBuilder::createFriend(DIType Ty, DIType FriendTy) {
// typedefs are encoded in DIDerivedType format.
assert(Ty.Verify() && "Invalid type!");
assert(FriendTy.Verify() && "Invalid friend type!");
Value *Elts[] = {
GetTagConstant(VMContext, dwarf::DW_TAG_friend),
Ty,
NULL, // Name
Ty.getFile(),
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 DIType(MDNode::get(VMContext, Elts));
}
示例3: Verify
/// Verify - Verify that an ObjC property is well formed.
bool DIObjCProperty::Verify() const {
if (!isObjCProperty())
return false;
DIType Ty = getType();
if (!Ty.Verify()) return false;
// Don't worry about the rest of the strings for now.
return DbgNode->getNumOperands() == 8;
}
示例4: Verify
/// Verify - Verify that an ObjC property is well formed.
bool DIObjCProperty::Verify() const {
if (!DbgNode)
return false;
unsigned Tag = getTag();
if (Tag != dwarf::DW_TAG_APPLE_property) return false;
DIType Ty = getType();
if (!Ty.Verify()) return false;
// Don't worry about the rest of the strings for now.
return true;
}
示例5: Verify
/// Verify - Verify that a variable descriptor is well formed.
bool DIVariable::Verify() const {
if (!DbgNode)
return false;
if (getContext() && !getContext().Verify())
return false;
DIType Ty = getType();
if (!Ty.Verify())
return false;
return true;
}
示例6: Verify
/// Verify - Verify that a variable descriptor is well formed.
bool DIVariable::Verify() const {
if (isNull())
return false;
if (getContext().isNull())
return false;
DIType Ty = getType();
if (!Ty.Verify())
return false;
return true;
}
示例7: 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);
}
示例8: Verify
/// Verify - Verify that a global variable descriptor is well formed.
bool DIGlobalVariable::Verify() const {
if (!isGlobalVariable())
return false;
if (getDisplayName().empty())
return false;
if (getContext() && !getContext().Verify())
return false;
DIType Ty = getType();
if (!Ty.Verify())
return false;
return DbgNode->getNumOperands() == 13;
}
示例9: createReferenceType
/// createReferenceType - Create debugging information entry for a reference
/// type.
DIType DIBuilder::createReferenceType(unsigned Tag, DIType RTy) {
assert(RTy.Verify() && "Unable to create reference type");
// References are encoded in DIDerivedType format.
Value *Elts[] = {
GetTagConstant(VMContext, Tag),
NULL, // TheCU,
NULL, // Name
NULL, // Filename
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 DIType(MDNode::get(VMContext, Elts));
}
示例10: createInheritance
/// createInheritance - Create debugging information entry to establish
/// inheritance relationship between two types.
DIType DIBuilder::createInheritance(DIType Ty, DIType BaseTy,
uint64_t BaseOffset, unsigned Flags) {
assert(Ty.Verify() && "Unable to create inheritance");
// TAG_inheritance is encoded in DIDerivedType format.
Value *Elts[] = {
GetTagConstant(VMContext, dwarf::DW_TAG_inheritance),
Ty,
NULL, // Name
Ty.getFile(),
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 DIType(MDNode::get(VMContext, Elts));
}
示例11: createTypedef
/// createTypedef - Create debugging information entry for a typedef.
DIType DIBuilder::createTypedef(DIType Ty, StringRef Name, DIFile File,
unsigned LineNo, DIDescriptor Context) {
// typedefs are encoded in DIDerivedType format.
assert(Ty.Verify() && "Invalid typedef type!");
Value *Elts[] = {
GetTagConstant(VMContext, dwarf::DW_TAG_typedef),
getNonCompileUnitScope(Context),
MDString::get(VMContext, Name),
File,
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 DIType(MDNode::get(VMContext, Elts));
}
示例12: addType
/// addType - Add a new type attribute to the specified entity.
void CompileUnit::addType(DIE *Entity, DIType Ty) {
if (!Ty.Verify())
return;
// Check for pre-existence.
DIEEntry *Entry = getDIEEntry(Ty);
// If it exists then use the existing value.
if (Entry) {
Entity->addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, Entry);
return;
}
// Construct type.
DIE *Buffer = getOrCreateTypeDIE(Ty);
// Set up proxy.
Entry = createDIEEntry(Buffer);
insertDIEEntry(Ty, Entry);
Entity->addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, Entry);
// If this is a complete composite type then include it in the
// list of global types.
addGlobalType(Ty);
}