While generating debug info ignore unnamed fields.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70266 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index eeaa197..c8d3d63 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -304,6 +304,10 @@
 
     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 @@
 
     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);