Index: lib/CodeGen/CGDebugInfo.cpp =================================================================== --- lib/CodeGen/CGDebugInfo.cpp +++ lib/CodeGen/CGDebugInfo.cpp @@ -1010,14 +1010,20 @@ const RecordDecl *RD) { StringRef name = field->getName(); QualType type = field->getType(); + bool EmitCodeView = CGM.getCodeGenOpts().EmitCodeView; // Ignore unnamed fields unless they're anonymous structs/unions. if (name.empty() && !type->isRecordType()) - return; + // Do not ignore anonymous bitfield when emitting CodeView. + if(!EmitCodeView || !field->isBitField()) + return; uint64_t SizeInBitsOverride = 0; if (field->isBitField()) { SizeInBitsOverride = field->getBitWidthValue(CGM.getContext()); + if (!SizeInBitsOverride && name.empty()) + // Ignore unnamed 0-width bitfield. + return; assert(SizeInBitsOverride && "found named 0-width bitfield"); }