[cfe-commits] r130458 - /cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
Fariborz Jahanian
fjahanian at apple.com
Thu Apr 28 16:43:23 PDT 2011
Author: fjahanian
Date: Thu Apr 28 18:43:23 2011
New Revision: 130458
URL: http://llvm.org/viewvc/llvm-project?rev=130458&view=rev
Log:
Fixes debug info generation problem for ms_struct structs.
// rdar://8823265
Modified:
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=130458&r1=130457&r2=130458&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Thu Apr 28 18:43:23 2011
@@ -618,18 +618,31 @@
CollectRecordFields(const RecordDecl *record, llvm::DIFile tunit,
llvm::SmallVectorImpl<llvm::Value *> &elements) {
unsigned fieldNo = 0;
+ const FieldDecl *LastFD = 0;
+ bool IsMsStruct = record->hasAttr<MsStructAttr>();
+
const ASTRecordLayout &layout = CGM.getContext().getASTRecordLayout(record);
for (RecordDecl::field_iterator I = record->field_begin(),
E = record->field_end();
I != E; ++I, ++fieldNo) {
FieldDecl *field = *I;
+ if (IsMsStruct) {
+ // Zero-length bitfields following non-bitfield members are ignored
+ if (CGM.getContext().ZeroBitfieldFollowsNonBitfield((field), LastFD)) {
+ --fieldNo;
+ continue;
+ }
+ LastFD = field;
+ }
llvm::StringRef name = field->getName();
QualType type = field->getType();
// Ignore unnamed fields unless they're anonymous structs/unions.
- if (name.empty() && !type->isRecordType())
+ if (name.empty() && !type->isRecordType()) {
+ LastFD = field;
continue;
+ }
llvm::DIType fieldType
= createFieldType(name, type, field->getBitWidth(),
More information about the cfe-commits
mailing list