[prev in list] [next in list] [prev in thread] [next in thread] 

List:       llvm-dev
Subject:    Re: [LLVMdev] Naming of types by DragonEgg vs. LLVM-GCC
From:       Duncan Sands <baldrick () free ! fr>
Date:       2011-04-28 14:11:34
Message-ID: 4DB97596.6050408 () free ! fr
[Download RAW message or body]

Hi Teemu,

> I used to use llvm-g++ to transform C++ source to LLVM IR. Now I am trying to
> switch to using DragonEgg, but I faced some problems because of the way DragonEgg
> is naming types in the resulting IR file. An example:
>
> LLVM-GCC:
>
> %"struct.Vector<ARPResponder::Entry>" = type { %"struct.ARPResponder::Entry"*, i32, i32 }
> %"struct.Vector<String>" = type { %struct.String*, i32, i32 }
> %"struct.Vector<int>" = type { i32*, i32, i32 }
>
> DragonEgg:
>
> %struct.Vector = type { %struct.Entry*, i32, i32 }
> %2 = type { %struct.String*, i32, i32 }
> %3 = type { i32*, i32, i32 }
>
> With the LLVM-GCC version I could easily get type for "struct.Vector<String>". With the
> DragonEgg version I would need another mapping from that name to "2". The same problem
> can be seen with the "struct.ARPResponder::Entry" becoming just "struct.Entry".
>
> Is there a way to make DragonEgg name the types the same way LLVM-GCC does, preserving
> C++ naming a bit more?

no, it is not possible.  Modern gcc's have a special pass that destroys all
language specific information, thus ensuring that the middle end is only
using generic information and not accidentally using language specific stuff
(this matters for link time optimization).  The extra detail in type names
produced by llvm-gcc comes from language specific data and has been destroyed
in gcc-4.5 before reaching the dragonegg plugin.  I suggest you use debug info
instead.

Ciao, Duncan.
_______________________________________________
LLVM Developers mailing list
LLVMdev@cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic