[llvm-commits] [llvm] r133412 - in /llvm/trunk: include/llvm/Constants.h lib/Analysis/ConstantFolding.cpp lib/AsmParser/LLParser.cpp lib/Bitcode/Reader/BitcodeReader.cpp lib/CodeGen/ShadowStackGC.cpp lib/Transforms/IPO/GlobalOpt.cpp lib/Transform

John McCall rjmccall at apple.com
Tue Jun 21 10:45:38 PDT 2011


On Jun 21, 2011, at 10:34 AM, Jay Foad wrote:

> On 21 June 2011 18:09, John McCall <rjmccall at apple.com> wrote:
>> On Jun 21, 2011, at 12:22 AM, Jay Foad wrote:
>>>>> Patch 1 extends ConstantUniqueMap with a new template parameter
>>>>> ValRefType, representing a const reference to ValType. Normally this
>>>>> would just be const ValType&, but when ValType is a std::vector, we
>>>>> want to use ArrayRef as the reference type.
>>> 
>>>> Wow, looks great to me Jay
>>> 
>>> Just to double check, are you OK with me adding the conversion operator
>>> 
>>>  ArrayRef<T>::operator std::vector<T>() const;
>> 
>> This is best avoided if possible.
> 
> Any particular reason?

Mostly I'm just skeptical of having an O(n) implicit conversion, but it also seems
odd to privilege std::vector here.

Why is this necessary?  Template metaprogramming in the constants-map
implementation?

John.



More information about the llvm-commits mailing list