<div dir="ltr">I think so but currently we disable only builtins marked with 'f'<div><div><br></div><div>//  f -> this is a libc/libm function without the '__builtin_' prefix. It can</div><div>//       be followed by ':headername:' to state which header this function</div>
<div>//       comes from.</div></div><div><br></div><div>-ffreestanding will also disable builtins but many test using -ffreestanding are using target specific intrinsics builtins. Not sure how to handle this.</div><div><br>
</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 18, 2013 at 8:10 PM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com" target="_blank">rjmccall@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="h5"><div>
<div>On Jun 9, 2013, at 5:15 PM, Francois Pichet <<a href="mailto:pichet2000@gmail.com" target="_blank">pichet2000@gmail.com</a>> wrote:</div><blockquote type="cite"><div dir="ltr"><div>Hi, I would like to propose this patch to makes it possible to compile any builtin if -fno-builtin is passed.</div>
<div><br></div>Here is the problem I am trying to get around.<div><br></div><div>I am working on a out-of-tree target where atomic operations are expanded to function calls.</div>
<div>for example:</div><div>  setOperationAction(ISD::ATOMIC_SWAP,  MVT::i32, Expand);</div><div><br></div><div><br></div><div>The backend will replace some atomic operations when compiling libc++ with function calls. Now if I try to actually compile the function calls with clang I'll get errors like:</div>

<div>       definition of builtin function '__sync_lock_test_and_set_4'<br></div><div><br></div><div>Just as if I was trying to compile a file similar to <a href="http://www.opensource.apple.com/source/Libc/Libc-583/arm/sys/gcc_atomic.c" target="_blank">http://www.opensource.apple.com/source/Libc/Libc-583/arm/sys/gcc_atomic.c</a> with clang. </div>

<div><br></div><div>Any objection? Or any possible workaround?<br></div></div></blockquote><div><br></div></div></div></div>Should we even be recognizing this as a builtin under -fno-builtin?<span class=""><font color="#888888"><div>
<br></div><div>John.</div></font></span></div>
</blockquote></div><br></div></div>