]> granicus.if.org Git - clang/commitdiff
Use ConvertType instead of ConvertTagDeclType, since ConvertType will assign a name...
authorAnders Carlsson <andersca@mac.com>
Wed, 24 Nov 2010 20:05:21 +0000 (20:05 +0000)
committerAnders Carlsson <andersca@mac.com>
Wed, 24 Nov 2010 20:05:21 +0000 (20:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120110 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenTypes.cpp

index fb1a6d8f13d96af7a3ded24fcdfad39ea9788e70..296837baf84adc5e621016ad8e9b9c7037bbf505 100644 (file)
@@ -486,12 +486,14 @@ const llvm::Type *CodeGenTypes::ConvertTagDeclType(const TagDecl *TD) {
 /// getCGRecordLayout - Return record layout info for the given llvm::Type.
 const CGRecordLayout &
 CodeGenTypes::getCGRecordLayout(const RecordDecl *TD) {
-  const Type *Key = Context.getTagDeclType(TD).getTypePtr();
+  QualType T = Context.getTagDeclType(TD);
+  const Type *Key = T.getTypePtr();
 
   const CGRecordLayout *Layout = CGRecordLayouts.lookup(Key);
   if (!Layout) {
-    // Compute the type information.
-    ConvertTagDeclType(TD);
+    // Compute the type information. We use ConvertType here so that we'll
+    // get a name for the type.
+    ConvertType(T);
 
     // Now try again.
     Layout = CGRecordLayouts.lookup(Key);