<div dir="ltr">To prevent optnone from being added you can replace -O0 with "-O1 -Xclang -disable-llvm-passes". The -O1 will prevent the optnone, and the rest will stop clang from performing any optimizations.</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature">~Craig</div></div>
<br><div class="gmail_quote">On Sun, Sep 17, 2017 at 10:12 PM, Diptorup Deb 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><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
We have a research LLVM-based domain-specific code generator that we want to upgrade form LLVM 4.0 to 5.0. The code generator is written as an out-of-tree loadable module for opt.<br>
<br>
Till Clang 4.0 we were compiling the front-end code (annotated C++) using -O0. The generated bitcode was further processed using opt with our module loaded. In Clang 5.0 we see that using -O0 adds the optnone attribute to all functions, making it impossible to use any existing LLVM passes in our code generator.<br>
<br>
We also tried using -<br>
"clang -Xclang -load -Xclang <module>.so -mllvm <custom options>"<br>
<br>
, but this caused a segfault at llvm::legacy::FunctionPassMana<wbr>gerImpl::doInitialization(<wbr>llvm::Module&).<br>
<br>
What is the right way to get around this issue?<br>
<br>
Dipto<br>
<br>
______________________________<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>
</blockquote></div><br></div>