summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-06 19:49:39 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-06 19:49:39 +0000
commita5099dce6263405d72d19f3783156492e436d31f (patch)
treeb2113541075bc3e904dc47815b091560c8d853b2 /llvm/lib/IR/DebugInfo.cpp
parent62e93623548b0eed5be7a5aa3b49b09a1d775604 (diff)
downloadbcm5719-llvm-a5099dce6263405d72d19f3783156492e436d31f.tar.gz
bcm5719-llvm-a5099dce6263405d72d19f3783156492e436d31f.zip
DebugInfo: Remove DIDescriptor::Verify()
Remove `DIDescriptor::Verify()` and the `Verify()`s from subclasses. They had already been gutted, and just did an `isa<>` check. In a couple of cases I've temporarily dropped the check entirely, but subsequent commits are going to disallow conversions to the `DIDescriptor`s directly from `MDNode`, so the checks will come back in another form soon enough. llvm-svn: 234201
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp61
1 files changed, 0 insertions, 61 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index f92d0b6bce2..1ad9dcae3ad 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -80,22 +80,6 @@ unsigned DIDescriptor::splitFlags(unsigned Flags,
return Flags;
}
-bool DIDescriptor::Verify() const {
- return DbgNode &&
- (DIDerivedType(DbgNode).Verify() ||
- DICompositeType(DbgNode).Verify() || DIBasicType(DbgNode).Verify() ||
- DIVariable(DbgNode).Verify() || DISubprogram(DbgNode).Verify() ||
- DIGlobalVariable(DbgNode).Verify() || DIFile(DbgNode).Verify() ||
- DICompileUnit(DbgNode).Verify() || DINameSpace(DbgNode).Verify() ||
- DILexicalBlock(DbgNode).Verify() ||
- DILexicalBlockFile(DbgNode).Verify() ||
- DISubrange(DbgNode).Verify() || DIEnumerator(DbgNode).Verify() ||
- DIObjCProperty(DbgNode).Verify() ||
- DITemplateTypeParameter(DbgNode).Verify() ||
- DITemplateValueParameter(DbgNode).Verify() ||
- DIImportedEntity(DbgNode).Verify());
-}
-
static Metadata *getField(const MDNode *DbgNode, unsigned Elt) {
if (!DbgNode || Elt >= DbgNode->getNumOperands())
return nullptr;
@@ -175,9 +159,6 @@ void DIDescriptor::replaceAllUsesWith(MDNode *D) {
Node->replaceAllUsesWith(D);
}
-bool DICompileUnit::Verify() const { return isCompileUnit(); }
-bool DIObjCProperty::Verify() const { return isObjCProperty(); }
-
#ifndef NDEBUG
/// \brief Check if a value can be a reference to a type.
static bool isTypeRef(const Metadata *MD) {
@@ -207,43 +188,6 @@ static bool isDescriptorRef(const Metadata *MD) {
}
#endif
-bool DIType::Verify() const { return isType(); }
-bool DIBasicType::Verify() const { return isBasicType(); }
-bool DIDerivedType::Verify() const { return isDerivedType(); }
-bool DICompositeType::Verify() const { return isCompositeType(); }
-bool DISubprogram::Verify() const { return isSubprogram(); }
-bool DIGlobalVariable::Verify() const { return isGlobalVariable(); }
-bool DIVariable::Verify() const { return isVariable(); }
-
-bool DILocation::Verify() const {
- return dyn_cast_or_null<MDLocation>(DbgNode);
-}
-bool DINameSpace::Verify() const {
- return dyn_cast_or_null<MDNamespace>(DbgNode);
-}
-bool DIFile::Verify() const { return dyn_cast_or_null<MDFile>(DbgNode); }
-bool DIEnumerator::Verify() const {
- return dyn_cast_or_null<MDEnumerator>(DbgNode);
-}
-bool DISubrange::Verify() const {
- return dyn_cast_or_null<MDSubrange>(DbgNode);
-}
-bool DILexicalBlock::Verify() const {
- return dyn_cast_or_null<MDLexicalBlock>(DbgNode);
-}
-bool DILexicalBlockFile::Verify() const {
- return dyn_cast_or_null<MDLexicalBlockFile>(DbgNode);
-}
-bool DITemplateTypeParameter::Verify() const {
- return dyn_cast_or_null<MDTemplateTypeParameter>(DbgNode);
-}
-bool DITemplateValueParameter::Verify() const {
- return dyn_cast_or_null<MDTemplateValueParameter>(DbgNode);
-}
-bool DIImportedEntity::Verify() const {
- return dyn_cast_or_null<MDImportedEntity>(DbgNode);
-}
-
void DICompositeType::setArraysHelper(MDNode *Elements, MDNode *TParams) {
TypedTrackingMDRef<MDCompositeTypeBase> N(get());
if (Elements)
@@ -342,18 +286,15 @@ StringRef DIScope::getDirectory() const {
}
void DICompileUnit::replaceSubprograms(DIArray Subprograms) {
- assert(Verify() && "Expected compile unit");
get()->replaceSubprograms(cast_or_null<MDTuple>(Subprograms.get()));
}
void DICompileUnit::replaceGlobalVariables(DIArray GlobalVariables) {
- assert(Verify() && "Expected compile unit");
get()->replaceGlobalVariables(cast_or_null<MDTuple>(GlobalVariables.get()));
}
DILocation DILocation::copyWithNewScope(LLVMContext &Ctx,
DILexicalBlockFile NewScope) {
- assert(Verify());
assert(NewScope && "Expected valid scope");
const auto *Old = cast<MDLocation>(DbgNode);
@@ -368,13 +309,11 @@ unsigned DILocation::computeNewDiscriminator(LLVMContext &Ctx) {
DIVariable llvm::createInlinedVariable(MDNode *DV, MDNode *InlinedScope,
LLVMContext &VMContext) {
- assert(DIVariable(DV).Verify() && "Expected a DIVariable");
return cast<MDLocalVariable>(DV)
->withInline(cast_or_null<MDLocation>(InlinedScope));
}
DIVariable llvm::cleanseInlinedVariable(MDNode *DV, LLVMContext &VMContext) {
- assert(DIVariable(DV).Verify() && "Expected a DIVariable");
return cast<MDLocalVariable>(DV)->withoutInline();
}
OpenPOWER on IntegriCloud