<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Le 20.03.2015 15:33, Duncan Exon Smith a écrit :</p>
<blockquote style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0;">
<div class="pre" style="margin: 0; padding: 0; font-family: monospace;">AFK right now, but IIRC, this function is supposed to be internal to replaceAllUsesWith() and it's not really supposed to be called directly.  Constants aren't supposed to change. <br /><br /> Why can't you just call replaceAllUsesWith()?<br /><br /> -- dpnes</div>
</blockquote>
<p>Because it does not do what I want. Basically, my algorithm is interested in some GlobalVariable that are used by constant expression. My goal is to replace the GlobalVariable reference inside the constant expression by another GlobalVariable. If I use <strong>replaceAllUsesWith(...)</strong> on the constant expression, I should pass as argument a constant expression recreated from scratch. In the other hand, if I call <strong>replaceAllUsesWith(...)</strong> on the GlobalVariable "a" with the new GlobalVariable "b", it will replace all variables "a" with "b" in the whole module and I still need the "a" for my algorithm.</p>
<p>The best solution would be the first but, during my research, I found the function <strong>replaceUsesOfWithOnConstant(...)</strong> that does exactly the job (with some improvment like the "in-place" replacement) and started using it.</p>
<p>But now, it doesn't work anymore in LLVM 3.6... So, I was interested in the change made between the two versions. And, apart for my algorithm, I think that maybe the new implementation was not very logical. Like I said, the <strong>replaceOperandsInPlace(...)</strong> seems designed to work with and without a given Use/NumUpdated argument (using an improvment for the first case). So, for me, it makes no sense to force using an Use argument for <strong>replaceUsesOfWithOnConstant(...)</strong> because it can handle both cases with minor changes.</p>
<p>Gael</p>
</body></html>