[llvm-dev] Adding new a new type

Bruce Hoult via llvm-dev llvm-dev at lists.llvm.org
Mon May 14 17:01:38 PDT 2018


Silly question .. what do you expect to do driving LLVM directly that you
couldn't do by generating C and compiling that?

It's a lot easier.

On Tue, May 15, 2018 at 11:38 AM, Jason Ott via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> 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
>>
>>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180515/d570519c/attachment.html>


More information about the llvm-dev mailing list