<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 7, 2015 at 2:27 PM, Mehdi Amini via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: mehdi_amini<br>
Date: Mon Dec 7 16:27:19 2015<br>
New Revision: 254956<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=254956&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=254956&view=rev</a><br>
Log:<br>
Remove useless hack that avoids calling LLVMLinkInInterpreter()<br>
<br>
This is supposed to force-link the Interpreter, by inserting a dead<br>
call to LLVMLinkInInterpreter().<br>
Since it is actually an empty function, there is no reason for the<br>
call to be dead.<br>
<br>
From: Mehdi Amini <<a href="mailto:mehdi.amini@apple.com">mehdi.amini@apple.com</a>><br>
<br>
Modified:<br>
llvm/trunk/include/llvm/ExecutionEngine/Interpreter.h<br>
<br>
Modified: llvm/trunk/include/llvm/ExecutionEngine/Interpreter.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Interpreter.h?rev=254956&r1=254955&r2=254956&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Interpreter.h?rev=254956&r1=254955&r2=254956&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/ExecutionEngine/Interpreter.h (original)<br>
+++ llvm/trunk/include/llvm/ExecutionEngine/Interpreter.h Mon Dec 7 16:27:19 2015<br>
@@ -16,22 +16,12 @@<br>
#define LLVM_EXECUTIONENGINE_INTERPRETER_H<br>
<br>
#include "llvm/ExecutionEngine/ExecutionEngine.h"<br>
-#include <cstdlib><br>
<br>
extern "C" void LLVMLinkInInterpreter();<br>
<br>
namespace {<br>
struct ForceInterpreterLinking {<br>
- ForceInterpreterLinking() {<br>
- // We must reference the interpreter in such a way that compilers will not<br>
- // delete it all as dead code, even with whole program optimization,<br>
- // yet is effectively a NO-OP. As the compiler isn't smart enough<br>
- // to know that getenv() never returns -1, this will do the job.<br>
- if (std::getenv("bar") != (char*) -1)<br>
- return;<br>
-<br>
- LLVMLinkInInterpreter();<br>
- }<br>
+ ForceInterpreterLinking() { LLVMLinkInInterpreter(); }<br>
} ForceInterpreterLinking;<br></blockquote><div><br></div><div>Not sure if you want to, but could possibly simplify this further with something like:<br><br>int i = (LLVMLinkInInterpreter(), 1);<br><br>Maybe? Not sure if that's any better, stylistically, etc.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
}<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>