Devirtualize TagDecl::completeDefinition().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125755 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index 8c55d0e..d5e9dbf 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -2128,13 +2128,6 @@
   return field_iterator(decl_iterator(FirstDecl));
 }
 
-/// completeDefinition - Notes that the definition of this type is now
-/// complete.
-void RecordDecl::completeDefinition() {
-  assert(!isDefinition() && "Cannot redefine record!");
-  TagDecl::completeDefinition();
-}
-
 void RecordDecl::LoadFieldsFromExternalStorage() const {
   ExternalASTSource *Source = getASTContext().getExternalSource();
   assert(hasExternalLexicalStorage() && Source && "No external storage?");
@@ -2160,6 +2153,13 @@
   llvm::tie(FirstDecl, LastDecl) = BuildDeclChain(Decls);
 }
 
+void RecordDecl::completeDefinition() {
+  assert(!isDefinition() && "Cannot redefine record!");
+  TagDecl::completeDefinition();
+  if (CXXRecordDecl *CXXRecord = dyn_cast<CXXRecordDecl>(this))
+    CXXRecord->completeDefinitionImpl(0);
+}
+
 //===----------------------------------------------------------------------===//
 // BlockDecl Implementation
 //===----------------------------------------------------------------------===//