]> granicus.if.org Git - clang/commitdiff
While generating debug info ignore unnamed fields.
authorDevang Patel <dpatel@apple.com>
Mon, 27 Apr 2009 22:40:36 +0000 (22:40 +0000)
committerDevang Patel <dpatel@apple.com>
Mon, 27 Apr 2009 22:40:36 +0000 (22:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70266 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index eeaa197cf3bd953b5cfb2cd78fef2ab3f1c5cf74..c8d3d634d3fd3cd45484a793e6d3b90c15c57889 100644 (file)
@@ -304,6 +304,10 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty,
 
     std::string FieldName = Field->getNameAsString();
 
+    // Ignore unnamed fields.
+    if (FieldName.empty())
+      continue;
+
     // Get the location for the field.
     SourceLocation FieldDefLoc = Field->getLocation();
     llvm::DICompileUnit FieldDefUnit = getOrCreateCompileUnit(FieldDefLoc);
@@ -414,6 +418,10 @@ llvm::DIType CGDebugInfo::CreateType(const ObjCInterfaceType *Ty,
 
     std::string FieldName = Field->getNameAsString();
 
+    // Ignore unnamed fields.
+    if (FieldName.empty())
+      continue;
+
     // Get the location for the field.
     SourceLocation FieldDefLoc = Field->getLocation();
     llvm::DICompileUnit FieldDefUnit = getOrCreateCompileUnit(FieldDefLoc);