<div class="gmail_quote">On Fri Oct 10 2014 at 6:51:06 PM David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Oct 10, 2014 at 9:44 AM, Frédéric Riss <span dir="ltr"><<a href="mailto:friss@apple.com" target="_blank">friss@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><span><blockquote type="cite"><div>On 10 Oct 2014, at 09:32, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 10, 2014 at 8:51 AM, Frederic Riss <span dir="ltr"><<a href="mailto:friss@apple.com" target="_blank">friss@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: friss<br>
Date: Fri Oct 10 10:51:10 2014<br>
New Revision: 219507<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=219507&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=219507&view=rev</a><br>
Log:<br>
[dwarfdump] Prettyprint DW_AT_APPLE_property_attribute bitfield values.<br>
<br>
This change depends on the ApplePropertyString helper that I sent spearately.<br>
Not sure how you want this tested: as a tool test by adding a binary to dump, or as an llvm test starting from an IR file?<br></blockquote><div><br></div><div>^ probably worth updating the commit message before committing when it contains comments more intended for review rather than for the commit itself. (just for next time)</div></div></div></div></div></blockquote><div><br></div></span><div>I’ve seen that just after having the ‘git svn dcommit’ finishing… I usually ‘git log HEAD…origin/master’ just before pushing to check that everything’s fine, don’t I didn’t this time. I’d really prefer that phab/arc had a way to differentiate the commit log from the review comments/questions (in the original submission), it would prevent this sort of errors.</div></div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Yep, that would be nice. (and/or a way to set a default option for arc that will open the commit message in an editor every time rather than just using what you put in for the review - but maybe there's ano ption for that already, I haven't looked)</div></div></div></div></blockquote><div><br></div><div>I'm not sure which features are wished for here exactly, but usually the best way to get them is to just file an upstream phabricator feature request :)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div><br></div><div>Fred</div><div><div><div><br></div><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Reviewers: dblaikie, samsonov<br>
<br>
Subscribers: llvm-commits<br></blockquote><div><br></div><div>I usually at least drop the "Subscribers" line from the commit message too. Sometimes even the Reviewers, since someone can consult the review thread for that context. (but sometimes it's nice/useful to note the reviewers)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Differential Revision: <a href="http://reviews.llvm.org/D5689" target="_blank">http://reviews.llvm.org/D5689</a><br>
<br>
Added:<br>
    llvm/trunk/test/DebugInfo/Inputs/dwarfdump-objc.m<br>
    llvm/trunk/test/DebugInfo/Inputs/dwarfdump-objc.x86_64.o<br>
    llvm/trunk/test/DebugInfo/dwarfdump-objc.test<br>
Modified:<br>
    llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.cpp<br>
<br>
Modified: llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.cpp?rev=219507&r1=219506&r2=219507&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.cpp?rev=219507&r1=219506&r2=219507&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.cpp (original)<br>
+++ llvm/trunk/lib/DebugInfo/DWARFDebugInfoEntry.cpp Fri Oct 10 10:51:10 2014<br>
@@ -12,6 +12,7 @@<br>
 #include "DWARFContext.h"<br>
 #include "DWARFDebugAbbrev.h"<br>
 #include "llvm/DebugInfo/DWARFFormValue.h"<br>
+#include "llvm/Support/DataTypes.h"<br>
 #include "llvm/Support/Debug.h"<br>
 #include "llvm/Support/Dwarf.h"<br>
 #include "llvm/Support/Format.h"<br>
@@ -72,6 +73,21 @@ void DWARFDebugInfoEntryMinimal::dump(ra<br>
   }<br>
 }<br>
<br>
+static void dumpApplePropertyAttribute(raw_ostream &OS, uint64_t Val) {<br>
+  OS << " (";<br>
+  do {<br>
+    uint64_t Bit = 1ULL << countTrailingZeros(Val);<br>
+    if (const char *PropName = ApplePropertyString(Bit))<br>
+      OS << PropName;<br>
+    else<br>
+      OS << format("DW_APPLE_PROPERTY_0x%" PRIx64, Bit);<br>
+    if (!(Val ^= Bit))<br>
+      break;<br>
+    OS << ", ";<br>
+  } while (true);<br>
+  OS << ")";<br>
+}<br>
+<br>
 void DWARFDebugInfoEntryMinimal::dumpAttribute(raw_ostream &OS,<br>
                                                DWARFUnit *u,<br>
                                                uint32_t *offset_ptr,<br>
@@ -130,6 +146,9 @@ void DWARFDebugInfoEntryMinimal::dumpAtt<br>
     if (const DWARFUnit *RefU = findUnitAndExtractFast(DIE, u, &Ref))<br>
       if (const char *Ref = DIE.getName(RefU, DINameKind::LinkageName))<br>
         OS << " \"" << Ref << '\"';<br>
+  } else if (attr == DW_AT_APPLE_property_attribute) {<br>
+    if (Optional<uint64_t> OptVal = formValue.getAsUnsignedConstant())<br>
+      dumpApplePropertyAttribute(OS, *OptVal);<br>
   }<br>
<br>
   OS << ")\n";<br>
<br>
Added: llvm/trunk/test/DebugInfo/Inputs/dwarfdump-objc.m<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/dwarfdump-objc.m?rev=219507&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/dwarfdump-objc.m?rev=219507&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/Inputs/dwarfdump-objc.m (added)<br>
+++ llvm/trunk/test/DebugInfo/Inputs/dwarfdump-objc.m Fri Oct 10 10:51:10 2014<br>
@@ -0,0 +1,16 @@<br>
+// Compile with clang -g dwarfdump-objc.m -c -Wno-objc-root-class<br>
+<br>
+@interface NSObject {} @end<br>
+<br>
+<br>
+@interface TestInterface<br>
+@property (readonly) int ReadOnly;<br>
+@property (assign) int Assign;<br>
+@property (readwrite) int ReadWrite;<br>
+@property (retain) NSObject *Retain;<br>
+@property (copy) NSObject *Copy;<br>
+@property (nonatomic) int NonAtomic;<br>
+@end<br>
+<br>
+@implementation TestInterface<br>
+@end<br>
<br>
Added: llvm/trunk/test/DebugInfo/Inputs/dwarfdump-objc.x86_64.o<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/dwarfdump-objc.x86_64.o?rev=219507&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/dwarfdump-objc.x86_64.o?rev=219507&view=auto</a><br>
==============================================================================<br>
Binary files llvm/trunk/test/DebugInfo/Inputs/dwarfdump-objc.x86_64.o (added) and llvm/trunk/test/DebugInfo/Inputs/dwarfdump-objc.x86_64.o Fri Oct 10 10:51:10 2014 differ<br>
<br>
Added: llvm/trunk/test/DebugInfo/dwarfdump-objc.test<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/dwarfdump-objc.test?rev=219507&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/dwarfdump-objc.test?rev=219507&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/dwarfdump-objc.test (added)<br>
+++ llvm/trunk/test/DebugInfo/dwarfdump-objc.test Fri Oct 10 10:51:10 2014<br>
@@ -0,0 +1,40 @@<br>
+RUN: llvm-dwarfdump %p/Inputs/dwarfdump-objc.x86_64.o | FileCheck %s<br>
+<br>
+CHECK:      .debug_info contents:<br>
+<br>
+CHECK: DW_TAG_APPLE_property<br>
+CHECK-NOT: TAG<br>
+CHECK:    DW_AT_APPLE_property_name {{.*}} "ReadOnly"<br>
+CHECK-NOT: TAG<br>
+CHECK:    DW_AT_APPLE_property_attribute {{.*}} (0x01 (DW_APPLE_PROPERTY_readonly))<br>
+<br>
+CHECK: DW_TAG_APPLE_property<br>
+CHECK-NOT: TAG<br>
+CHECK:   DW_AT_APPLE_property_name {{.*}} "Assign"<br>
+CHECK-NOT: TAG<br>
+CHECK:   DW_AT_APPLE_property_attribute {{.*}} (0x0c (DW_APPLE_PROPERTY_assign, DW_APPLE_PROPERTY_readwrite))<br>
+<br>
+CHECK: DW_TAG_APPLE_property<br>
+CHECK-NOT: TAG<br>
+CHECK:   DW_AT_APPLE_property_name {{.*}} "ReadWrite"<br>
+CHECK-NOT: TAG<br>
+CHECK:   DW_AT_APPLE_property_attribute {{.*}} (0x0c (DW_APPLE_PROPERTY_assign, DW_APPLE_PROPERTY_readwrite))<br>
+<br>
+CHECK: DW_TAG_APPLE_property<br>
+CHECK-NOT: TAG<br>
+CHECK:   DW_AT_APPLE_property_name {{.*}} "Retain"<br>
+CHECK-NOT: TAG<br>
+CHECK:   DW_AT_APPLE_property_attribute {{.*}} (0x18 (DW_APPLE_PROPERTY_readwrite, DW_APPLE_PROPERTY_retain))<br>
+<br>
+CHECK: DW_TAG_APPLE_property<br>
+CHECK-NOT: TAG<br>
+CHECK:   DW_AT_APPLE_property_name {{.*}} "Copy"<br>
+CHECK-NOT: TAG<br>
+CHECK:   DW_AT_APPLE_property_attribute {{.*}} (0x28 (DW_APPLE_PROPERTY_readwrite, DW_APPLE_PROPERTY_copy))<br>
+<br>
+CHECK: DW_TAG_APPLE_property<br>
+CHECK-NOT: TAG<br>
+CHECK:   DW_AT_APPLE_property_name {{.*}} "NonAtomic"<br>
+CHECK-NOT: TAG<br>
+CHECK:   DW_AT_APPLE_property_attribute {{.*}} (0x4c (DW_APPLE_PROPERTY_assign, DW_APPLE_PROPERTY_readwrite, DW_APPLE_PROPERTY_nonatomic))<br>
+<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>
</div></blockquote></div></div></div><br></div></blockquote></div></div></div></blockquote></div>