diff options
| author | Davide Italiano <davide@freebsd.org> | 2016-04-06 18:13:44 +0000 |
|---|---|---|
| committer | Davide Italiano <davide@freebsd.org> | 2016-04-06 18:13:44 +0000 |
| commit | 18c968688e38b27243dc3f2a3308137d9a3eaad8 (patch) | |
| tree | 546d76a2ad0bf75a71a6509044b1ed42fd6415d4 /llvm/lib | |
| parent | bb756dbf3912debc5a54e97c5fba682388507e04 (diff) | |
| download | bcm5719-llvm-18c968688e38b27243dc3f2a3308137d9a3eaad8.tar.gz bcm5719-llvm-18c968688e38b27243dc3f2a3308137d9a3eaad8.zip | |
[IRVerifier] Prefer dyn_cast<> over isa<> + cast<>.
Thanks to Rafael for the suggestion!
llvm-svn: 265579
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/IR/Verifier.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index fe3d6eb6cf4..fad4aacb52d 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -4375,15 +4375,14 @@ void Verifier::verifyTypeRefs() { // Visit all the compile units again to map the type references. SmallDenseMap<const MDString *, const DIType *, 32> TypeRefs; - for (auto *CU : CUs->operands()) - if (isa<DICompileUnit>(CU)) - if (auto Ts = cast<DICompileUnit>(CU)->getRetainedTypes()) - for (DIType *Op : Ts) - if (auto *T = dyn_cast_or_null<DICompositeType>(Op)) - if (auto *S = T->getRawIdentifier()) { - UnresolvedTypeRefs.erase(S); - TypeRefs.insert(std::make_pair(S, T)); - } + for (auto *MD : CUs->operands()) + if (auto *CU = dyn_cast<DICompileUnit>(MD)) + for (DIType *Op : CU->getRetainedTypes()) + if (auto *T = dyn_cast_or_null<DICompositeType>(Op)) + if (auto *S = T->getRawIdentifier()) { + UnresolvedTypeRefs.erase(S); + TypeRefs.insert(std::make_pair(S, T)); + } // Verify debug info intrinsic bit piece expressions. This needs a second // pass through the intructions, since we haven't built TypeRefs yet when |

