}
// Verify that any cached debug info still exists.
- if (V != 0)
- return llvm::DIType(cast<llvm::MDNode>(V));
-
- return llvm::DIType();
+ return llvm::DIType(cast_or_null<llvm::MDNode>(V));
}
void CGDebugInfo::completeFwdDecl(const RecordDecl &RD) {
// Unwrap the type as needed for debug information.
Ty = UnwrapTypeForDebugInfo(Ty, CGM.getContext());
- llvm::DIType T = getCompletedTypeOrNull(Ty);
-
- if (T) {
+ if (llvm::DIType T = getCompletedTypeOrNull(Ty)) {
// If we're looking for a definition, make sure we have definitions of any
// underlying types.
if (const TypedefType* TTy = dyn_cast<TypedefType>(Ty))