[llvm-dev] Adding new a new type

Jason Ott via llvm-dev llvm-dev at lists.llvm.org
Mon May 14 16:38:03 PDT 2018


Ok, so I can use the structure-type to represent base or acid or salts.  My
next question is how union-typing works in LLVM.  After reading a bit
about, it's unclear to me if it is a "thing" anymore; my intuition -- and
poking around in the sources is that it's a "no", it's been deprecated.

Which then means that it doesn't much matter about typing LLVM.  I can pass
that up to a python script and handle typing up there.

I just want to make sure this is accurate.

On Mon, May 14, 2018 at 4:27 PM, Friedman, Eli <efriedma at codeaurora.org>
wrote:

> On 5/14/2018 4:18 PM, Jason Ott via llvm-dev wrote:
>
>> I was reading: https://llvm.org/docs/ExtendingLLVM.html
>>
>> And am heeding the warnings that come with new (derived) types.
>>
>> I'm trying to use LLVM to model chemicals.  More specifically, there are
>> several reactive groups that exist: salts, bases, acids, etc. that
>> adequately represent their respective values.  I, for obvious reasons, want
>> to manifest those types in LLVM so I can type check a given input and use
>> LLVM for all my compilation needs.
>>
>> I'm uncertain what I should do with respect to LLVM and the guidance the
>> documentation provides for adding new types.
>>
>
> You almost certainly don't want a new type in that sense.  Try
> https://llvm.org/docs/LangRef.html#structure-type instead.
>
> -Eli
>
> --
> Employee of Qualcomm Innovation Center, Inc.
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux
> Foundation Collaborative Project
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180514/a0e5fd51/attachment.html>


More information about the llvm-dev mailing list