[llvm-commits] [llvm] r135904 - in /llvm/trunk: docs/ include/llvm/ include/llvm/Support/ lib/Analysis/ lib/AsmParser/ lib/Bitcode/Reader/ lib/CodeGen/ lib/Transforms/IPO/ lib/Transforms/InstCombine/ lib/Transforms/Instrumentation/ lib/Transforms
Jay Foad
jay.foad at gmail.com
Mon Jul 25 07:49:09 PDT 2011
On 25 July 2011 15:36, Frits van Bommel <fvbommel at gmail.com> wrote:
> On 25 July 2011 11:48, Jay Foad <jay.foad at gmail.com> wrote:
>> --- llvm/trunk/lib/Analysis/PHITransAddr.cpp (original)
>> +++ llvm/trunk/lib/Analysis/PHITransAddr.cpp Mon Jul 25 04:48:08 2011
>> @@ -407,9 +407,10 @@
>> }
>>
>> GetElementPtrInst *Result =
>> - GetElementPtrInst::Create(GEPOps[0], GEPOps.begin()+1, GEPOps.end(),
>> - InVal->getName()+".phi.trans.insert",
>> - PredBB->getTerminator());
>> + GetElementPtrInst::Create(GEPOps[0],
>> + makeArrayRef(GEPOps.begin() + 1, GEPOps.end()),
>
> 'makeArrayRef(GEPOps).slice(1)' is nicer, and is the idiom used in
> several other places.
I considered both versions and chose this one. Why? Because I'm not
very familiar with slice(). It isn't in the STL (is it?) and it's not
immediately obvious to me, as a reader, what slice(a) and slice(a,b)
mean.
Feel free to change it if you want.
Jay.
More information about the llvm-commits
mailing list