Use an early exit in DIBuilder::finalize() to improve readability.

llvm-svn: 241465
This commit is contained in:
Adrian Prantl 2015-07-06 16:22:12 +00:00
parent 4afc1f4225
commit 0e224a646c
1 changed files with 34 additions and 30 deletions

View File

@ -73,7 +73,12 @@ void DIBuilder::trackIfUnresolved(MDNode *N) {
}
void DIBuilder::finalize() {
if (CUNode) {
if (!CUNode) {
assert(!AllowUnresolvedNodes &&
"creating type nodes without a CU is not supported");
return;
}
CUNode->replaceEnumTypes(MDTuple::get(VMContext, AllEnumTypes));
SmallVector<Metadata *, 16> RetainValues;
@ -103,7 +108,6 @@ void DIBuilder::finalize() {
CUNode->replaceImportedEntities(MDTuple::get(
VMContext, SmallVector<Metadata *, 16>(AllImportedModules.begin(),
AllImportedModules.end())));
}
// Now that all temp nodes have been replaced or deleted, resolve remaining
// cycles.