[llvm] r225186 - SymbolRewriter: use iplist::splice

Saleem Abdulrasool compnerd at compnerd.org
Mon Jan 5 18:56:54 PST 2015


On Mon, Jan 5, 2015 at 10:27 AM, David Blaikie <dblaikie at gmail.com> wrote:

>
>
> On Mon, Jan 5, 2015 at 9:56 AM, Saleem Abdulrasool <compnerd at compnerd.org>
> wrote:
>
>> Author: compnerd
>> Date: Mon Jan  5 11:56:32 2015
>> New Revision: 225186
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=225186&view=rev
>> Log:
>> SymbolRewriter: use iplist::splice
>>
>> The swap implementation for iplist is currently unsupported.  Simply
>> splice the
>> old list into place, which achieves the same purpose.  This is needed in
>> order
>> to thread the -frewrite-map-file frontend option correctly.  NFC.
>>
>> Modified:
>>     llvm/trunk/lib/Transforms/Utils/SymbolRewriter.cpp
>>
>> Modified: llvm/trunk/lib/Transforms/Utils/SymbolRewriter.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SymbolRewriter.cpp?rev=225186&r1=225185&r2=225186&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/lib/Transforms/Utils/SymbolRewriter.cpp (original)
>> +++ llvm/trunk/lib/Transforms/Utils/SymbolRewriter.cpp Mon Jan  5
>> 11:56:32 2015
>> @@ -494,7 +494,7 @@ RewriteSymbols::RewriteSymbols() : Modul
>>
>>  RewriteSymbols::RewriteSymbols(SymbolRewriter::RewriteDescriptorList &DL)
>>      : ModulePass(ID) {
>> -  std::swap(Descriptors, DL);
>> +  Descriptors.splice(Descriptors.begin(), DL);
>>
>
> Could we just implement swap with splice, or does that not work?
>

I can get away with it here, since I don't really care about the swap,
merely that the contents of the provided list are moved over (cheaply).
Splice moves the range from one list to the other.  I suppose that we could
use that and a temporary to do the swap.


>  }
>>
>>  bool RewriteSymbols::runOnModule(Module &M) {
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>
>


-- 
Saleem Abdulrasool
compnerd (at) compnerd (dot) org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150105/37a04d51/attachment.html>


More information about the llvm-commits mailing list