[cfe-dev] preserving type signatures

Daniel Dunbar daniel at zuster.org
Wed Mar 24 11:43:30 PDT 2010


On Wed, Mar 24, 2010 at 12:34 AM, Naoya Maruyama
<naoya.maruyama at gmail.com> wrote:
> Hi there,
>
> I'm currently using Clang/LLVM for static analysis of C programs, and
> I want to get the exactly same type signatures as in the original
> source programs. However, for example, with Clang, if a function
> returns struct {float, float}, then the compiled function in the llvm
> bitcode returns a double that aggregates the two floats. I wonder
> there are any ways to prevent Clang to do this type transformation.
> Thanks for any help.

Yes, as Chris mentioned, you can write your own target to do this.

However, my intuition is that you should "not be trying to do this in
the first place". Clang's type system is richer than LLVM's, you can
only map one direction. It sounds like you are trying to map back from
LLVM types to Clang types, and I wouldn't recommend that.

 - Daniel

>
> Naoya
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>



More information about the cfe-dev mailing list