mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-01 13:17:01 +00:00
Debug Info: clean up usage of Verify.
No functionality change. It should suffice to check the type of a debug info metadata, instead of calling Verify. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185383 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -317,7 +317,7 @@ DIDerivedType DIBuilder::createMemberPointerType(DIType PointeeTy,
|
|||||||
/// createReferenceType - Create debugging information entry for a reference
|
/// createReferenceType - Create debugging information entry for a reference
|
||||||
/// type.
|
/// type.
|
||||||
DIDerivedType DIBuilder::createReferenceType(unsigned Tag, DIType RTy) {
|
DIDerivedType DIBuilder::createReferenceType(unsigned Tag, DIType RTy) {
|
||||||
assert(RTy.Verify() && "Unable to create reference type");
|
assert(RTy.isType() && "Unable to create reference type");
|
||||||
// References are encoded in DIDerivedType format.
|
// References are encoded in DIDerivedType format.
|
||||||
Value *Elts[] = {
|
Value *Elts[] = {
|
||||||
GetTagConstant(VMContext, Tag),
|
GetTagConstant(VMContext, Tag),
|
||||||
@@ -338,7 +338,7 @@ DIDerivedType DIBuilder::createReferenceType(unsigned Tag, DIType RTy) {
|
|||||||
DIDerivedType DIBuilder::createTypedef(DIType Ty, StringRef Name, DIFile File,
|
DIDerivedType DIBuilder::createTypedef(DIType Ty, StringRef Name, DIFile File,
|
||||||
unsigned LineNo, DIDescriptor Context) {
|
unsigned LineNo, DIDescriptor Context) {
|
||||||
// typedefs are encoded in DIDerivedType format.
|
// typedefs are encoded in DIDerivedType format.
|
||||||
assert(Ty.Verify() && "Invalid typedef type!");
|
assert(Ty.isType() && "Invalid typedef type!");
|
||||||
Value *Elts[] = {
|
Value *Elts[] = {
|
||||||
GetTagConstant(VMContext, dwarf::DW_TAG_typedef),
|
GetTagConstant(VMContext, dwarf::DW_TAG_typedef),
|
||||||
File.getFileNode(),
|
File.getFileNode(),
|
||||||
@@ -357,8 +357,8 @@ DIDerivedType DIBuilder::createTypedef(DIType Ty, StringRef Name, DIFile File,
|
|||||||
/// createFriend - Create debugging information entry for a 'friend'.
|
/// createFriend - Create debugging information entry for a 'friend'.
|
||||||
DIDerivedType DIBuilder::createFriend(DIType Ty, DIType FriendTy) {
|
DIDerivedType DIBuilder::createFriend(DIType Ty, DIType FriendTy) {
|
||||||
// typedefs are encoded in DIDerivedType format.
|
// typedefs are encoded in DIDerivedType format.
|
||||||
assert(Ty.Verify() && "Invalid type!");
|
assert(Ty.isType() && "Invalid type!");
|
||||||
assert(FriendTy.Verify() && "Invalid friend type!");
|
assert(FriendTy.isType() && "Invalid friend type!");
|
||||||
Value *Elts[] = {
|
Value *Elts[] = {
|
||||||
GetTagConstant(VMContext, dwarf::DW_TAG_friend),
|
GetTagConstant(VMContext, dwarf::DW_TAG_friend),
|
||||||
NULL,
|
NULL,
|
||||||
@@ -378,7 +378,7 @@ DIDerivedType DIBuilder::createFriend(DIType Ty, DIType FriendTy) {
|
|||||||
/// inheritance relationship between two types.
|
/// inheritance relationship between two types.
|
||||||
DIDerivedType DIBuilder::createInheritance(
|
DIDerivedType DIBuilder::createInheritance(
|
||||||
DIType Ty, DIType BaseTy, uint64_t BaseOffset, unsigned Flags) {
|
DIType Ty, DIType BaseTy, uint64_t BaseOffset, unsigned Flags) {
|
||||||
assert(Ty.Verify() && "Unable to create inheritance");
|
assert(Ty.isType() && "Unable to create inheritance");
|
||||||
// TAG_inheritance is encoded in DIDerivedType format.
|
// TAG_inheritance is encoded in DIDerivedType format.
|
||||||
Value *Elts[] = {
|
Value *Elts[] = {
|
||||||
GetTagConstant(VMContext, dwarf::DW_TAG_inheritance),
|
GetTagConstant(VMContext, dwarf::DW_TAG_inheritance),
|
||||||
@@ -596,7 +596,7 @@ DICompositeType DIBuilder::createClassType(DIDescriptor Context, StringRef Name,
|
|||||||
DIArray Elements,
|
DIArray Elements,
|
||||||
MDNode *VTableHolder,
|
MDNode *VTableHolder,
|
||||||
MDNode *TemplateParams) {
|
MDNode *TemplateParams) {
|
||||||
assert((!Context || Context.Verify()) &&
|
assert((!Context || Context.isScope() || Context.isType()) &&
|
||||||
"createClassType should be called with a valid Context");
|
"createClassType should be called with a valid Context");
|
||||||
// TAG_class_type is encoded in DICompositeType format.
|
// TAG_class_type is encoded in DICompositeType format.
|
||||||
Value *Elts[] = {
|
Value *Elts[] = {
|
||||||
@@ -616,7 +616,8 @@ DICompositeType DIBuilder::createClassType(DIDescriptor Context, StringRef Name,
|
|||||||
TemplateParams
|
TemplateParams
|
||||||
};
|
};
|
||||||
DICompositeType R(MDNode::get(VMContext, Elts));
|
DICompositeType R(MDNode::get(VMContext, Elts));
|
||||||
assert(R.Verify() && "createClassType should return a verifiable DIType");
|
assert(R.isCompositeType() &&
|
||||||
|
"createClassType should return a DICompositeType");
|
||||||
return R;
|
return R;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -648,7 +649,8 @@ DICompositeType DIBuilder::createStructType(DIDescriptor Context,
|
|||||||
NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
DICompositeType R(MDNode::get(VMContext, Elts));
|
DICompositeType R(MDNode::get(VMContext, Elts));
|
||||||
assert(R.Verify() && "createStructType should return a verifiable DIType");
|
assert(R.isCompositeType() &&
|
||||||
|
"createStructType should return a DICompositeType");
|
||||||
return R;
|
return R;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -861,8 +863,8 @@ DIType DIBuilder::createForwardDecl(unsigned Tag, StringRef Name,
|
|||||||
ConstantInt::get(Type::getInt32Ty(VMContext), RuntimeLang)
|
ConstantInt::get(Type::getInt32Ty(VMContext), RuntimeLang)
|
||||||
};
|
};
|
||||||
MDNode *Node = MDNode::getTemporary(VMContext, Elts);
|
MDNode *Node = MDNode::getTemporary(VMContext, Elts);
|
||||||
assert(DIType(Node).Verify() &&
|
assert(DIType(Node).isType() &&
|
||||||
"createForwardDecl result should be verifiable");
|
"createForwardDecl result should be a DIType");
|
||||||
return DIType(Node);
|
return DIType(Node);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -953,9 +955,9 @@ DIVariable DIBuilder::createLocalVariable(unsigned Tag, DIDescriptor Scope,
|
|||||||
bool AlwaysPreserve, unsigned Flags,
|
bool AlwaysPreserve, unsigned Flags,
|
||||||
unsigned ArgNo) {
|
unsigned ArgNo) {
|
||||||
DIDescriptor Context(getNonCompileUnitScope(Scope));
|
DIDescriptor Context(getNonCompileUnitScope(Scope));
|
||||||
assert((!Context || Context.Verify()) &&
|
assert((!Context || Context.isScope()) &&
|
||||||
"createLocalVariable should be called with a valid Context");
|
"createLocalVariable should be called with a valid Context");
|
||||||
assert(Ty.Verify() &&
|
assert(Ty.isType() &&
|
||||||
"createLocalVariable should be called with a valid type");
|
"createLocalVariable should be called with a valid type");
|
||||||
Value *Elts[] = {
|
Value *Elts[] = {
|
||||||
GetTagConstant(VMContext, Tag),
|
GetTagConstant(VMContext, Tag),
|
||||||
@@ -976,8 +978,8 @@ DIVariable DIBuilder::createLocalVariable(unsigned Tag, DIDescriptor Scope,
|
|||||||
NamedMDNode *FnLocals = getOrInsertFnSpecificMDNode(M, Fn);
|
NamedMDNode *FnLocals = getOrInsertFnSpecificMDNode(M, Fn);
|
||||||
FnLocals->addOperand(Node);
|
FnLocals->addOperand(Node);
|
||||||
}
|
}
|
||||||
assert(DIVariable(Node).Verify() &&
|
assert(DIVariable(Node).isVariable() &&
|
||||||
"createLocalVariable should return a verifiable DIVariable");
|
"createLocalVariable should return a valid DIVariable");
|
||||||
return DIVariable(Node);
|
return DIVariable(Node);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1046,7 +1048,7 @@ DISubprogram DIBuilder::createFunction(DIDescriptor Context,
|
|||||||
if (isDefinition)
|
if (isDefinition)
|
||||||
AllSubprograms.push_back(Node);
|
AllSubprograms.push_back(Node);
|
||||||
DISubprogram S(Node);
|
DISubprogram S(Node);
|
||||||
assert(S.Verify() && "createFunction should return a valid DISubprogram");
|
assert(S.isSubprogram() && "createFunction should return a valid DISubprogram");
|
||||||
return S;
|
return S;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1094,7 +1096,7 @@ DISubprogram DIBuilder::createMethod(DIDescriptor Context,
|
|||||||
if (isDefinition)
|
if (isDefinition)
|
||||||
AllSubprograms.push_back(Node);
|
AllSubprograms.push_back(Node);
|
||||||
DISubprogram S(Node);
|
DISubprogram S(Node);
|
||||||
assert(S.Verify() && "createMethod should return a valid DISubprogram");
|
assert(S.isSubprogram() && "createMethod should return a valid DISubprogram");
|
||||||
return S;
|
return S;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -219,7 +219,7 @@ public:
|
|||||||
MDNode *Sub = Builder.createFunction(
|
MDNode *Sub = Builder.createFunction(
|
||||||
DICompileUnit(CUNode), F.getName(), MangledName, DIFile(FileNode), Line,
|
DICompileUnit(CUNode), F.getName(), MangledName, DIFile(FileNode), Line,
|
||||||
Sig, Local, IsDefinition, ScopeLine, FuncFlags, IsOptimized, &F);
|
Sig, Local, IsDefinition, ScopeLine, FuncFlags, IsOptimized, &F);
|
||||||
assert(DISubprogram(Sub).Verify());
|
assert(DISubprogram(Sub).isSubprogram());
|
||||||
DEBUG(dbgs() << "create subprogram mdnode " << Sub << ": "
|
DEBUG(dbgs() << "create subprogram mdnode " << Sub << ": "
|
||||||
<< "\n");
|
<< "\n");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user