[cfe-dev] Fwd: [patch] migrating DragonEgg to DIBuilder

David Blaikie dblaikie at gmail.com
Sun Feb 24 17:22:33 PST 2013


Hi Daniel,

Apparently Eric's corrected/clarified for me that the predominant LLVM
coding convention (which at least my cursory glance seems to suggest is
accurate - though I'm not sure I much like it) for function parameter (&
argument, at call sites)) wrapping is to align to the "(" even in the case
of many line wrapping.

(also - I'm curious: what's the condition under which clang-format will
wrap to one-per-line (for both declarations and calls). The few times I've
seen clang-format do that it didn't seem to be what I wanted it to do (it
seemed too long/wasted space))

- David

---------- Forwarded message ----------
From: Eric Christopher <echristo at gmail.com>
Date: Sun, Feb 24, 2013 at 2:53 PM
Subject: Re: [patch] migrating DragonEgg to DIBuilder
To: David Blaikie <dblaikie at gmail.com>
Cc: Duncan Sands <baldrick at free.fr>, "llvm-commits at cs.uiuc.edu" <
llvm-commits at cs.uiuc.edu>, Nick Lewycky <nlewycky at google.com>


Hi Dave,

Looks pretty good, just a few comments:

-                       DW_TAG_inheritance, findRegion(TYPE_CONTEXT(type)),
+                       DW_TAG_inheritance, findRegion(type),

This seems curious?

+  case dwarf::DW_TAG_typedef:
+    // FIXME: Remove this conditional, it's firing at least for member
pointer
+    // fix getOrCreateType to see through member data pointers

Can you expand on this comment (also needs a period) since it's not obvious
what's going on and why?

+  case dwarf::DW_TAG_structure_type:
+    return Builder.createStructType(Context, Name, F, LineNumber,
SizeInBits, AlignInBits, Flags, DerivedFrom, Elements, 0, ContainingType);

80-col?

+  return Builder.createFunction(
+      SP.getContext(), SP.getName(), SP.getLinkageName(), SP.getFile(),
+      SP.getLineNumber(), SP.getType(), SP.isLocalToUnit(), true, LineNo,
+      SP.getFlags(), SP.isOptimized(), Fn, SP.getTemplateParams(), SP);

Awkward formatting?

+    DICompositeType createStructType(
+        DIDescriptor Scope, StringRef Name, DIFile File, unsigned
LineNumber,
+        uint64_t SizeInBits, uint64_t AlignInBits, unsigned Flags,
+        DIType DerivedFrom, DIArray Elements, unsigned RunTimeLang = 0,
+        MDNode *VTableHolder = 0);

Ditto.

+DICompositeType DIBuilder::createStructType(
+    DIDescriptor Context, StringRef Name, DIFile File, unsigned LineNumber,
+    uint64_t SizeInBits, uint64_t AlignInBits, unsigned Flags,
+    DIType DerivedFrom, DIArray Elements, unsigned RunTimeLang,
+    MDNode *VTableHolder) {

Here too.

Otherwise OK.

-eric


On Sun, Feb 24, 2013 at 10:25 AM, David Blaikie <dblaikie at gmail.com> wrote:

>
>
>
> On Sun, Feb 24, 2013 at 12:23 AM, Duncan Sands <baldrick at free.fr> wrote:
>
>> Hi David, here is the original commit.
>
>
> Ah, I see - you inherited these test cases from llvm-gcc. Makes sense.
>
>
>>  Since dragonegg just uses the provided
>> gcc (i.e. it can't modify gcc), if gcc hasn't set DECL_IGNORED_P then
>> there is
>> nothing that dragonegg can do about it.  I've removed the test case.
>>  Please
>> feel free to apply your debug info patches.
>>
>
> Great - thanks for your time/thoughts/fixes here. I know Eric mentioned he
> had some thoughts on these patches so I'll wait for him to have a chance &
> then commit these & carry on with my debug info refactoring work. (in doing
> so I'll try to keep an eye on the dragonegg test cases too - though
> I apologize in advance if a few breaks slip through & please do let me know
> if that happens)
>
> - David
>
>
>>
>> Ciao, Duncan.
>>
>> r96974 | dpatel | 2010-02-23 20:36:49 +0100 (Tue, 23 Feb 2010) | 4 lines
>>
>> Do not rely on write_symbols to disable debug info for super class added
>> as an invisible member of derived class. write_symbols controls debug_hooks
>> which are used to emit debug info in various formats in gcc. llvm-gcc does
>> not use this debug_hooks interface to emit debugging information.
>>
>> Test case is at llvm/test/FrontendObjC/2010-**02-23-DbgInheritance.m
>>
>>
>> Index: gcc/toplev.c
>> ==============================**==============================**=======
>> --- gcc/toplev.c        (revision 96973)
>> +++ gcc/toplev.c        (revision 96974)
>> @@ -1926,6 +1926,8 @@
>>
>>    /* LLVM LOCAL begin */
>>  #ifdef ENABLE_LLVM
>> +  // write_symbols set up debug_hooks. llvm-gcc does not use this hooks
>> +  // to emit debug info.
>>    write_symbols = NO_DEBUG;
>>  #endif
>>    /* LLVM LOCAL end */
>> Index: gcc/objc/objc-act.c
>> ==============================**==============================**=======
>> --- gcc/objc/objc-act.c (revision 96973)
>> +++ gcc/objc/objc-act.c (revision 96974)
>> @@ -3407,8 +3407,10 @@
>>        DECL_ALIGN (base) = 1;
>>        DECL_FIELD_CONTEXT (base) = s;
>>        /* APPLE LOCAL begin radar 4477797 */
>> -      if (write_symbols == DWARF2_DEBUG)
>> -       DECL_IGNORED_P (base) = 1;
>> +      /* LLVM LOCAL begin */
>> +      /* Do not check write-symbols in llvm-gcc. */
>> +        DECL_IGNORED_P (base) = 1;
>> +      /* LLVM LOCAL end */
>>        /* APPLE LOCAL end radar 4477797 */
>>  #ifdef OBJCPLUS
>>        DECL_FIELD_IS_BASE (base) = 1;
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130224/70dfba63/attachment.html>


More information about the cfe-dev mailing list