<div dir="ltr">A followup question.<br><br>Langref says: "LLVM explicitly allows declarations of global variables to be marked constant, even if the final definition of the global is not. This capability can be used to enable slightly better optimization of the program, but requires the language definition to guarantee that optimizations based on the ‘constantness’ are valid for the translation units that do not include the definition."<div><br></div><div>Am I correct in surmising that means it's OK to claim globals in other translation units are constant if they don't change after the initial definition?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 30, 2017 at 11:04 PM, Nikodemus Siivola <span dir="ltr"><<a href="mailto:nikodemus@random-state.net" target="_blank">nikodemus@random-state.net</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">No, thanks for the hint!<div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 30, 2017 at 10:58 PM, Tim Northover <span dir="ltr"><<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 30 May 2017 at 12:39, Nikodemus Siivola via llvm-dev<br>
<span><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
> The docs are pretty vague about this. After digging into the examples I got<br>
> the following to work with JIT to gain a pointer to variable elsewhere in<br>
> the runtime, but I'd like to understand what is going on here, and if there<br>
> is a, um, nicer API that I'm missing?<br>
<br>
</span>Have you looked at Module::getOrInsertGlobal? It seems to be pretty<br>
much exactly what you're doing.<br>
<br>
Cheers.<br>
<span class="m_6280292531552055610HOEnZb"><font color="#888888"><br>
Tim.<br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>