Refactor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78851 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp
index b65c6b3..80781ad 100644
--- a/lib/CodeGen/CGCXX.cpp
+++ b/lib/CodeGen/CGCXX.cpp
@@ -699,7 +699,10 @@
methods.push_back(rtti);
}
- if (!isPrimary && RD)
+ if (!isPrimary) {
+ if (!RD)
+ return;
+
for (meth_iter mi = RD->method_begin(), me = RD->method_end(); mi != me;
++mi) {
if (mi->isVirtual()) {
@@ -708,8 +711,8 @@
methods.push_back(m);
}
}
- if (!isPrimary)
return;
+ }
// And add the virtuals for the class to the primary vtable.
for (meth_iter mi = Class->method_begin(), me = Class->method_end(); mi != me;