On Aug 20, 2007, at 8:43 PM, Chris Lattner wrote:
>> URL: http://llvm.org/viewvc/llvm-project?rev=41207&view=rev
>> Log:
>> Use SmallVector instead of std::vector.
>
> Thanks Devang,
>
> Two minor tweaks:
>
>> /// outside of the loop. These are the blocks _inside of the
>> current loop_
>> /// which branch out. The returned list is always unique.
>> ///
>> - void getExitingBlocks(std::vector<BasicBlock*> &Blocks) const;
>> + void getExitingBlocks(SmallVector<BasicBlock *, 8> &Blocks) const;
>
> One of the nifty but non-obvious features of smallvector is that
> libraries who operate on a smallvector don't have to know the size
> that the client declared it as. Instead of hardcoding 8 in here,
> just declare these as taking "SmallVectorImpl<BasicBlock*>&". This
> will let clients decide "how small small should be". :)
nifty.
>
>> +void Loop::getExitingBlocks(SmallVector<BasicBlock*, 8>
>> &ExitingBlocks) const {
>> std::vector<BasicBlock*> LoopBBs(block_begin(), block_end());
>
>> +void Loop::getExitBlocks(SmallVector<BasicBlock*, 8> &ExitBlocks)
>> const {
>> std::vector<BasicBlock*> LoopBBs(block_begin(), block_end());
>
>> +void Loop::getUniqueExitBlocks(SmallVector<BasicBlock*, 8>
>> &ExitBlocks) const {
>> std::vector<BasicBlock*> LoopBBs(block_begin(), block_end());
>
> Since you're in here, these are good candidates for (large)
> smallvectors also. Try making them SmallVector<, 128> for example.
Yes. I intended to do it as a separate check-in.
-
Devang
_______________________________________________
llvm-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits