summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index eeaa197cf3b..c8d3d634d3f 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -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);
OpenPOWER on IntegriCloud