<div dir="ltr">We have a natural-language DSL for a research project I'm on that we had our own custom compiler for; but quickly out grew.  Instead of reinventing the wheel and implementing all the overhead for register allocation, stack frame generation, retargetability, etc., we wanted to use LLVM to do all the heavy lifting for us.<div><br></div><div>I actually have no problem with handling typing in a layer above LLVM.  It works out nicely as 2 other projects I'm on, that are closely related, require it and need the type checker anyways.  And we rely on type inference in most cases, the typing is completely optional.  So in LLVM I can type all materials (acids, bases, etc) as one of the base types in LLVM and then just pass up a json representation of variable interaction and run type inference on that.  From what I've read z3 is *much* easier to use in python than C++ anyways.</div><div><br></div><div>Overall, I think this approach is much easier, I was just curious.</div><div><br></div><div>Thanks!</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 14, 2018 at 5:01 PM, Bruce Hoult <span dir="ltr"><<a href="mailto:brucehoult@sifive.com" target="_blank">brucehoult@sifive.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Silly question .. what do you expect to do driving LLVM directly that you couldn't do by generating C and compiling that?<div><br></div><div>It's a lot easier.</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Tue, May 15, 2018 at 11:38 AM, Jason Ott via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">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.<div><br></div><div>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.</div><div><br></div><div>I just want to make sure this is accurate.</div></div><div class="m_544774809021960802HOEnZb"><div class="m_544774809021960802h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 14, 2018 at 4:27 PM, Friedman, Eli <span dir="ltr"><<a href="mailto:efriedma@codeaurora.org" target="_blank">efriedma@codeaurora.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 5/14/2018 4:18 PM, Jason Ott via llvm-dev wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I was reading: <a href="https://llvm.org/docs/ExtendingLLVM.html" rel="noreferrer" target="_blank">https://llvm.org/docs/Extendin<wbr>gLLVM.html</a><br>
<br>
And am heeding the warnings that come with new (derived) types.<br>
<br>
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.<br>
<br>
I'm uncertain what I should do with respect to LLVM and the guidance the documentation provides for adding new types.<br>
</blockquote>
<br></span>
You almost certainly don't want a new type in that sense.  Try <a href="https://llvm.org/docs/LangRef.html#structure-type" rel="noreferrer" target="_blank">https://llvm.org/docs/LangRef.<wbr>html#structure-type</a> instead.<span class="m_544774809021960802m_-3115389083380794886HOEnZb"><font color="#888888"><br>
<br>
-Eli<br>
<br>
-- <br>
Employee of Qualcomm Innovation Center, Inc.<br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project<br>
<br>
</font></span></blockquote></div><br></div>
</div></div><br></div></div>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>