<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Yeah, I was sloppy on bridging to C...<div class=""><br class=""></div><div class="">r263885 should be better.</div><div class=""><br class=""></div><div class="">-- </div><div class="">Mehdi</div><div class=""><br class=""><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 19, 2016, at 11:34 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Does LTOObjectBuffer actually need to modify? Or is it just const incorrect/should be constified? (if it does need to modify, perhaps we need to change the API here to expose something other than a MemoryBuffer for use here to document the mutability?)</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Mar 18, 2016 at 6:24 PM, Mehdi Amini via llvm-commits <span dir="ltr" class=""><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: mehdi_amini<br class="">
Date: Fri Mar 18 20:24:23 2016<br class="">
New Revision: 263870<br class="">
<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=263870&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=263870&view=rev</a><br class="">
Log:<br class="">
Fix a const_cast related warning in GCC in the C API for libLTO<br class="">
<br class="">
From: Mehdi Amini <<a href="mailto:mehdi.amini@apple.com" class="">mehdi.amini@apple.com</a>><br class="">
<br class="">
Modified:<br class="">
llvm/trunk/tools/lto/lto.cpp<br class="">
<br class="">
Modified: llvm/trunk/tools/lto/lto.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/lto.cpp?rev=263870&r1=263869&r2=263870&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/lto.cpp?rev=263870&r1=263869&r2=263870&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/tools/lto/lto.cpp (original)<br class="">
+++ llvm/trunk/tools/lto/lto.cpp Fri Mar 18 20:24:23 2016<br class="">
@@ -469,7 +469,7 @@ LTOObjectBuffer thinlto_module_get_objec<br class="">
unsigned int index) {<br class="">
assert(index < unwrap(cg)->getProducedBinaries().size() && "Index overflow");<br class="">
auto &MemBuffer = unwrap(cg)->getProducedBinaries()[index];<br class="">
- return LTOObjectBuffer{(void *)MemBuffer->getBufferStart(),<br class="">
+ return LTOObjectBuffer{const_cast<char *>(MemBuffer->getBufferStart()),<br class="">
MemBuffer->getBufferSize()};<br class="">
}<br class="">
<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class="">
</blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></div></body></html>