<div dir="rtl"><div dir="ltr">Hi Craig,</div><div dir="ltr"><br></div><div dir="ltr">This fails to compile under VC 2013:</div><div dir="ltr"><br></div><div dir="ltr"><div><div>1>------ Build started: Project: llvm-tblgen, Configuration: RelWithDebInfo Win32 ------</div>
<div>1> FixedLenDecoderEmitter.cpp</div><div>1>..\..\..\utils\TableGen\FixedLenDecoderEmitter.cpp(560): error C2668: 'llvm::make_unique' : ambiguous call to overloaded function</div><div>1> C:\llvm\include\llvm/ADT/STLExtras.h(393): could be 'std::unique_ptr<`anonymous-namespace'::FilterChooser,std::default_delete<`anonymous-namespace'::FilterChooser>> llvm::make_unique<`anonymous-namespace'::FilterChooser,const std::vector<const llvm::CodeGenInstruction *,std::allocator<_Ty>>&,std::vector<unsigned int,std::allocator<char32_t>>&,const std::map<unsigned int,std::vector<`anonymous-namespace'::OperandInfo,std::allocator<`anonymous-namespace'::OperandInfo>>,std::less<_Kty>,std::allocator<std::pair<const _Kty,std::vector<`anonymous-namespace'::OperandInfo,std::allocator<`anonymous-namespace'::OperandInfo>>>>>&,std::vector<bit_value_t,std::allocator<bit_value_t>>&,const `anonymous-namespace'::FilterChooser&>(const std::vector<_Ty,std::allocator<_Ty>> &,std::vector<unsigned int,std::allocator<char32_t>> &,const std::map<_Kty,std::vector<`anonymous-namespace'::OperandInfo,std::allocator<`anonymous-namespace'::OperandInfo>>,std::less<_Kty>,std::allocator<std::pair<const _Kty,std::vector<`anonymous-namespace'::OperandInfo,std::allocator<`anonymous-namespace'::OperandInfo>>>>> &,std::vector<bit_value_t,std::allocator<bit_value_t>> &,const `anonymous-namespace'::FilterChooser &)'</div>
<div>1> with</div><div>1> [</div><div>1> _Ty=const llvm::CodeGenInstruction *</div><div>1> , _Kty=unsigned int</div><div>1> ]</div><div>1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\memory(1637): or 'std::unique_ptr<`anonymous-namespace'::FilterChooser,std::default_delete<`anonymous-namespace'::FilterChooser>> std::make_unique<`anonymous-namespace'::FilterChooser,const std::vector<const llvm::CodeGenInstruction *,std::allocator<_Ty>>&,std::vector<unsigned int,std::allocator<char32_t>>&,const std::map<unsigned int,std::vector<`anonymous-namespace'::OperandInfo,std::allocator<`anonymous-namespace'::OperandInfo>>,std::less<_Kty>,std::allocator<std::pair<const _Kty,std::vector<`anonymous-namespace'::OperandInfo,std::allocator<`anonymous-namespace'::OperandInfo>>>>>&,std::vector<bit_value_t,std::allocator<bit_value_t>>&,const `anonymous-namespace'::FilterChooser&>(const std::vector<_Ty,std::allocator<_Ty>> &,std::vector<unsigned int,std::allocator<char32_t>> &,const std::map<_Kty,std::vector<`anonymous-namespace'::OperandInfo,std::allocator<`anonymous-namespace'::OperandInfo>>,std::less<_Kty>,std::allocator<std::pair<const _Kty,std::vector<`anonymous-namespace'::OperandInfo,std::allocator<`anonymous-namespace'::OperandInfo>>>>> &,std::vector<bit_value_t,std::allocator<bit_value_t>> &,const `anonymous-namespace'::FilterChooser &)' [found using argument-dependent lookup]</div>
<div>1> with</div><div>1> [</div><div>1> _Ty=const llvm::CodeGenInstruction *</div><div>1> , _Kty=unsigned int</div><div>1> ]</div><div>1> while trying to match the argument list '(const std::vector<const llvm::CodeGenInstruction *,std::allocator<_Ty>>, std::vector<unsigned int,std::allocator<char32_t>>, const std::map<unsigned int,std::vector<`anonymous-namespace'::OperandInfo,std::allocator<_Ty>>,std::less<_Kty>,std::allocator<std::pair<const _Kty,std::vector<_Ty,std::allocator<_Ty>>>>>, std::vector<bit_value_t,std::allocator<_Ty>>, const `anonymous-namespace'::FilterChooser)'</div>
<div>1> with</div><div>1> [</div><div>1> _Ty=const llvm::CodeGenInstruction *</div><div>1> ]</div><div>1> and</div><div>1> [</div><div>1> _Ty=`anonymous-namespace'::OperandInfo</div>
<div>1> , _Kty=unsigned int</div><div>1> ]</div><div>1> and</div><div>1> [</div><div>1> _Ty=bit_value_t</div><div>1> ]</div><div>1>..\..\..\utils\TableGen\FixedLenDecoderEmitter.cpp(560): error C2780: 'std::pair<_Unrefwrap<_Ty>::type,_Unrefwrap<_Ty2>::type> std::make_pair(_Ty1 &&,_Ty2 &&)' : expects 2 arguments - 1 provided</div>
<div>1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\utility(267) : see declaration of 'std::make_pair'</div><div>1>..\..\..\utils\TableGen\FixedLenDecoderEmitter.cpp(592): error C2668: 'llvm::make_unique' : ambiguous call to overloaded function</div>
<div>1> C:\llvm\include\llvm/ADT/STLExtras.h(393): could be 'std::unique_ptr<`anonymous-namespace'::FilterChooser,std::default_delete<`anonymous-namespace'::FilterChooser>> llvm::make_unique<`anonymous-namespace'::FilterChooser,const std::vector<const llvm::CodeGenInstruction *,std::allocator<_Ty>>&,const _Ty2&,const std::map<unsigned int,std::vector<`anonymous-namespace'::OperandInfo,std::allocator<`anonymous-namespace'::OperandInfo>>,std::less<_Kty>,std::allocator<std::pair<const _Kty,std::vector<`anonymous-namespace'::OperandInfo,std::allocator<`anonymous-namespace'::OperandInfo>>>>>&,std::vector<bit_value_t,std::allocator<bit_value_t>>&,const `anonymous-namespace'::FilterChooser&>(const std::vector<_Ty,std::allocator<_Ty>> &,const _Ty2 &,const std::map<_Kty,std::vector<`anonymous-namespace'::OperandInfo,std::allocator<`anonymous-namespace'::OperandInfo>>,std::less<_Kty>,std::allocator<std::pair<const _Kty,std::vector<`anonymous-namespace'::OperandInfo,std::allocator<`anonymous-namespace'::OperandInfo>>>>> &,std::vector<bit_value_t,std::allocator<bit_value_t>> &,const `anonymous-namespace'::FilterChooser &)'</div>
<div>1> with</div><div>1> [</div><div>1> _Ty=const llvm::CodeGenInstruction *</div><div>1> , _Ty2=std::vector<unsigned int,std::allocator<char32_t>></div>
<div>1> , _Kty=unsigned int</div><div>1> ]</div><div>1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\memory(1637): or 'std::unique_ptr<`anonymous-namespace'::FilterChooser,std::default_delete<`anonymous-namespace'::FilterChooser>> std::make_unique<`anonymous-namespace'::FilterChooser,const std::vector<const llvm::CodeGenInstruction *,std::allocator<_Ty>>&,const _Ty2&,const std::map<unsigned int,std::vector<`anonymous-namespace'::OperandInfo,std::allocator<`anonymous-namespace'::OperandInfo>>,std::less<_Kty>,std::allocator<std::pair<const _Kty,std::vector<`anonymous-namespace'::OperandInfo,std::allocator<`anonymous-namespace'::OperandInfo>>>>>&,std::vector<bit_value_t,std::allocator<bit_value_t>>&,const `anonymous-namespace'::FilterChooser&>(const std::vector<_Ty,std::allocator<_Ty>> &,const _Ty2 &,const std::map<_Kty,std::vector<`anonymous-namespace'::OperandInfo,std::allocator<`anonymous-namespace'::OperandInfo>>,std::less<_Kty>,std::allocator<std::pair<const _Kty,std::vector<`anonymous-namespace'::OperandInfo,std::allocator<`anonymous-namespace'::OperandInfo>>>>> &,std::vector<bit_value_t,std::allocator<bit_value_t>> &,const `anonymous-namespace'::FilterChooser &)' [found using argument-dependent lookup]</div>
<div>1> with</div><div>1> [</div><div>1> _Ty=const llvm::CodeGenInstruction *</div><div>1> , _Ty2=std::vector<unsigned int,std::allocator<char32_t>></div>
<div>1> , _Kty=unsigned int</div><div>1> ]</div><div>1> while trying to match the argument list '(const std::vector<const llvm::CodeGenInstruction *,std::allocator<_Ty>>, const std::vector<unsigned int,std::allocator<char32_t>>, const std::map<unsigned int,std::vector<`anonymous-namespace'::OperandInfo,std::allocator<_Ty>>,std::less<_Kty>,std::allocator<std::pair<const _Kty,std::vector<_Ty,std::allocator<_Ty>>>>>, std::vector<bit_value_t,std::allocator<_Ty>>, const `anonymous-namespace'::FilterChooser)'</div>
<div>1> with</div><div>1> [</div><div>1> _Ty=const llvm::CodeGenInstruction *</div><div>1> ]</div><div>1> and</div><div>1> [</div><div>1> _Ty=`anonymous-namespace'::OperandInfo</div>
<div>1> , _Kty=unsigned int</div><div>1> ]</div><div>1> and</div><div>1> [</div><div>1> _Ty=bit_value_t</div><div>1> ]</div><div>1>..\..\..\utils\TableGen\FixedLenDecoderEmitter.cpp(592): error C2780: 'std::pair<_Unrefwrap<_Ty>::type,_Unrefwrap<_Ty2>::type> std::make_pair(_Ty1 &&,_Ty2 &&)' : expects 2 arguments - 1 provided</div>
<div>1> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\utility(267) : see declaration of 'std::make_pair'</div><div>========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========</div>
<div><br></div><div><br></div></div></div><div class="gmail_extra" dir="ltr"><br><br><div class="gmail_quote"><div>2014-09-03 9:45 GMT+03:00 Justin Bogner <span dir="ltr"><<a href="mailto:mail@justinbogner.com" target="_blank">mail@justinbogner.com</a>></span>:</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div>Craig Topper <<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@gmail.com</a>> writes:<br>
> Author: ctopper<br>
> Date: Wed Sep 3 01:07:54 2014<br>
> New Revision: 217018<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=217018&view=revLog" target="_blank">http://llvm.org/viewvc/llvm-project?rev=217018&view=revLog</a>:<br>
> Recommit "Use unique_ptr to manager FilterChooser ownership."<br>
><br>
> Just using insert of a pair this time instead of emplace.<br>
><br>
> Modified:<br>
> llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp<br>
><br>
> Modified: llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp<br>
> URL:<br>
> <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp?rev=217018&r1=217017&r2=217018&view=diff==============================================================================" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp?rev=217018&r1=217017&r2=217018&view=diff==============================================================================</a><br>
> --- llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp (original)<br>
> +++ llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp Wed Sep 3 01:07:54 2014<br>
> @@ -230,7 +230,7 @@ protected:<br>
> std::vector<unsigned> VariableInstructions;<br>
><br>
> // Map of well-known segment value to its delegate.<br>
> - std::map<unsigned, const FilterChooser*> FilterChooserMap;<br>
> + std::map<unsigned, std::unique_ptr<const FilterChooser>> FilterChooserMap;<br>
><br>
> // Number of instructions which fall under FilteredInstructions category.<br>
> unsigned NumFiltered;<br>
> @@ -530,12 +530,6 @@ Filter::Filter(FilterChooser &owner, uns<br>
> }<br>
><br>
> Filter::~Filter() {<br>
> - std::map<unsigned, const FilterChooser*>::iterator filterIterator;<br>
> - for (filterIterator = FilterChooserMap.begin();<br>
> - filterIterator != FilterChooserMap.end();<br>
> - filterIterator++) {<br>
> - delete filterIterator->second;<br>
> - }<br>
> }<br>
><br>
> // Divides the decoding task into sub tasks and delegates them to the<br>
> @@ -557,14 +551,13 @@ void Filter::recurse() {<br>
><br>
> // Delegates to an inferior filter chooser for further processing on this<br>
> // group of instructions whose segment values are variable.<br>
> - FilterChooserMap.insert(std::pair<unsigned, const FilterChooser*>(<br>
> - (unsigned)-1,<br>
> - new FilterChooser(Owner->AllInstructions,<br>
> - VariableInstructions,<br>
> - Owner->Operands,<br>
> - BitValueArray,<br>
> - *Owner)<br>
> - ));<br>
> + FilterChooserMap.insert(std::make_pair(<br>
> + -1U,<br>
> + make_unique<FilterChooser>(Owner->AllInstructions,<br>
> + VariableInstructions,<br>
> + Owner->Operands,<br>
> + BitValueArray,<br>
> + *Owner)));<br>
<br>
</div></div>This indentation's a bit out there. Might be nice to clang-format these<br>
while you're here.<br>
<div><div><br>
> }<br>
><br>
> // No need to recurse for a singleton filtered instruction.<br>
> @@ -590,14 +583,13 @@ void Filter::recurse() {<br>
><br>
> // Delegates to an inferior filter chooser for further processing on this<br>
> // category of instructions.<br>
> - FilterChooserMap.insert(std::pair<unsigned, const FilterChooser*>(<br>
> + FilterChooserMap.insert(std::make_pair(<br>
> mapIterator->first,<br>
> - new FilterChooser(Owner->AllInstructions,<br>
> - mapIterator->second,<br>
> - Owner->Operands,<br>
> - BitValueArray,<br>
> - *Owner)<br>
> - ));<br>
> + make_unique<FilterChooser>(Owner->AllInstructions,<br>
> + mapIterator->second,<br>
> + Owner->Operands,<br>
> + BitValueArray,<br>
> + *Owner)));<br>
> }<br>
> }<br>
><br>
> @@ -632,7 +624,8 @@ void Filter::emitTableEntry(DecoderTable<br>
> // A new filter entry begins a new scope for fixup resolution.<br>
> TableInfo.FixupStack.push_back(FixupList());<br>
><br>
> - std::map<unsigned, const FilterChooser*>::const_iterator filterIterator;<br>
> + std::map<unsigned,<br>
> + std::unique_ptr<const FilterChooser>>::const_iterator filterIterator;<br>
><br>
> DecoderTable &Table = TableInfo.Table;<br>
><br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div></div>