[cfe-commits] r135011 - /cfe/trunk/lib/AST/DeclCXX.cpp

Richard Smith richard-llvm at metafoo.co.uk
Tue Jul 12 16:49:11 PDT 2011


Author: rsmith
Date: Tue Jul 12 18:49:11 2011
New Revision: 135011

URL: http://llvm.org/viewvc/llvm-project?rev=135011&view=rev
Log:
Correctly set up the list of virtual base classes for a CXXRecordDecl. Previously we got the source range wrong for everything in the virtual bases list.

Modified:
    cfe/trunk/lib/AST/DeclCXX.cpp

Modified: cfe/trunk/lib/AST/DeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclCXX.cpp?rev=135011&r1=135010&r2=135011&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclCXX.cpp (original)
+++ cfe/trunk/lib/AST/DeclCXX.cpp Tue Jul 12 18:49:11 2011
@@ -244,22 +244,8 @@
   // Create base specifier for any direct or indirect virtual bases.
   data().VBases = new (C) CXXBaseSpecifier[VBases.size()];
   data().NumVBases = VBases.size();
-  for (int I = 0, E = VBases.size(); I != E; ++I) {
-    TypeSourceInfo *VBaseTypeInfo = VBases[I]->getTypeSourceInfo();
-
-    // Skip dependent types; we can't do any checking on them now.
-    if (VBaseTypeInfo->getType()->isDependentType())
-      continue;
-
-    CXXRecordDecl *VBaseClassDecl = cast<CXXRecordDecl>(
-      VBaseTypeInfo->getType()->getAs<RecordType>()->getDecl());
-
-    data().getVBases()[I] =
-      CXXBaseSpecifier(VBaseClassDecl->getSourceRange(), true,
-                       VBaseClassDecl->getTagKind() == TTK_Class,
-                       VBases[I]->getAccessSpecifier(), VBaseTypeInfo,
-                       SourceLocation());
-  }
+  for (int I = 0, E = VBases.size(); I != E; ++I)
+    data().getVBases()[I] = *VBases[I];
 }
 
 /// Callback function for CXXRecordDecl::forallBases that acknowledges





More information about the cfe-commits mailing list