Patch to BitcodeReader
Joe Abbey
joe.abbey at gmail.com
Thu Sep 12 15:05:43 PDT 2013
Committed in r190634
Joe
On Sep 12, 2013, at 5:49 PM, Joe Abbey <joe.abbey at gmail.com> wrote:
> Sure Tom I can commit this for you.
>
> Joe
>
> On Sep 12, 2013, at 5:26 PM, Tom Roeder <tmroeder at google.com> wrote:
>
>> Thanks!
>>
>> I don't have commit access; could one of you please commit for me?
>>
>> Tom
>>
>>
>> On Thu, Sep 12, 2013 at 2:14 PM, Joe Abbey <joe.abbey at gmail.com> wrote:
>> Tom,
>>
>> This all looks good please review my updates to your patch for LLVM coding style.
>>
>> Joe
>>
>>
>>
>>
>> On Sep 12, 2013, at 5:10 PM, Tobias Grosser <tobias at grosser.es> wrote:
>>
>> > On 09/12/2013 11:03 PM, Tom Roeder wrote:
>> >> Here's a version with a comment and the fixed CHECK statement.
>> >
>> > Nice.
>> >
>> > Just a tiny comment I overlooked before:
>> >
>> >> Index: lib/Bitcode/Reader/BitcodeReader.cpp
>> >> ===================================================================
>> >> --- lib/Bitcode/Reader/BitcodeReader.cpp (revision 190562)
>> >> +++ lib/Bitcode/Reader/BitcodeReader.cpp (working copy)
>> >> @@ -1389,11 +1389,23 @@
>> >> }
>> >> case bitc::CST_CODE_CE_SELECT: // CE_SELECT: [opval#, opval#, opval#]
>> >> if (Record.size() < 3) return Error("Invalid CE_SELECT record");
>> >> - V = ConstantExpr::getSelect(
>> >> - ValueList.getConstantFwdRef(Record[0],
>> >> - Type::getInt1Ty(Context)),
>> >> - ValueList.getConstantFwdRef(Record[1],CurTy),
>> >> - ValueList.getConstantFwdRef(Record[2],CurTy));
>> >> +
>> >> + // If CurTy is a vector of length n, then Record[0] must be a <n x i1>
>> >> + // vector. Otherwise, it must be a single bit.
>> >> + if (VectorType *VTy = dyn_cast<VectorType>(CurTy)) {
>> >> + unsigned int EltCount = VTy->getNumElements();
>> >> + Type *SelectorTy = VectorType::get(Type::getInt1Ty(Context), EltCount);
>> >> +
>> >> + V = ConstantExpr::getSelect(ValueList.getConstantFwdRef(Record[0],
>> >> + SelectorTy),
>> >> + ValueList.getConstantFwdRef(Record[1],CurTy),
>> >> + ValueList.getConstantFwdRef(Record[2],CurTy));
>> >> + } else {
>> >> + V = ConstantExpr::getSelect(ValueList.getConstantFwdRef(Record[0],
>> >> + Type::getInt1Ty(Context)),
>> >> + ValueList.getConstantFwdRef(Record[1],CurTy),
>> >> + ValueList.getConstantFwdRef(Record[2],CurTy));
>> >
>> > ^^ Those lines are not properly
>> > aligned.
>> >
>> > Otherwise, the patch looks good. Can you commit this patch yourself or do you need me to commit it?
>> >
>> > Cheers,
>> > Tobias
>> > _______________________________________________
>> > llvm-commits mailing list
>> > llvm-commits at cs.uiuc.edu
>> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130912/72d8239d/attachment.html>
More information about the llvm-commits
mailing list