Re: [PATCH] D21766: [codeview][clang] Added support for unnamed bitfield type.

2016-07-05 Thread Amjad Aboud via cfe-commits
aaboud abandoned this revision.
aaboud added a comment.

Different implementation was committed at http://reviews.llvm.org/rL274201.


http://reviews.llvm.org/D21766



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D21766: [codeview][clang] Added support for unnamed bitfield type.

2016-06-27 Thread David Majnemer via cfe-commits
majnemer added a comment.

As I said in the other differential, I do not think this is the right approach.
We should use the extraData for the bitfield member to indicate the offset of 
the storage unit.


http://reviews.llvm.org/D21766



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D21766: [codeview][clang] Added support for unnamed bitfield type.

2016-06-27 Thread Amjad Aboud via cfe-commits
aaboud created this revision.
aaboud added reviewers: rnk, majnemer.
aaboud added subscribers: cfe-commits, bwyma.

Allow creating DI metadata for non-zero width unnamed bitfield members when 
emitting CodeView.
This is needed for patch D21489.

http://reviews.llvm.org/D21766

Files:
  lib/CodeGen/CGDebugInfo.cpp

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");
   }
 


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");
   }
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits