[llvm] r280479 - [PM] Try to fix an MSVC2013 failure due to finding a template

Aaron Ballman via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 2 10:43:27 PDT 2016


On Fri, Sep 2, 2016 at 1:40 PM, Robinson, Paul via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
>
>
>> -----Original Message-----
>> From: llvm-commits [mailto:llvm-commits-bounces at lists.llvm.org] On Behalf
>> Of Chandler Carruth via llvm-commits
>> Sent: Friday, September 02, 2016 3:50 AM
>> To: llvm-commits at lists.llvm.org
>> Subject: [llvm] r280479 - [PM] Try to fix an MSVC2013 failure due to
>> finding a template
>>
>> Author: chandlerc
>> Date: Fri Sep  2 05:49:58 2016
>> New Revision: 280479
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=280479&view=rev
>> Log:
>> [PM] Try to fix an MSVC2013 failure due to finding a template
>> constructor when trying to do copy construction by adding an explicit
>> move constructor.
>>
>> Will watch the bots to discover if this is sufficient.
>>
>> Modified:
>>     llvm/trunk/unittests/Analysis/CGSCCPassManagerTest.cpp
>>
>> Modified: llvm/trunk/unittests/Analysis/CGSCCPassManagerTest.cpp
>> URL: http://llvm.org/viewvc/llvm-
>> project/llvm/trunk/unittests/Analysis/CGSCCPassManagerTest.cpp?rev=280479&
>> r1=280478&r2=280479&view=diff
>> ==========================================================================
>> ====
>> --- llvm/trunk/unittests/Analysis/CGSCCPassManagerTest.cpp (original)
>> +++ llvm/trunk/unittests/Analysis/CGSCCPassManagerTest.cpp Fri Sep  2
>> 05:49:58 2016
>> @@ -128,6 +128,13 @@ char TestImmutableFunctionAnalysis::Pass
>>
>>  struct LambdaSCCPass : public PassInfoMixin<LambdaSCCPass> {
>>    template <typename T> LambdaSCCPass(T &&Arg) :
>> Func(std::forward<T>(Arg)) {}
>> +  // We have to explicitly define all the special member functions
>> because MSVC
>
> I think Aaron Ballman prefers that we cite 2013 specifically in the
> comments, in those cases where 2013 specifically is at fault.  Makes
> these things easier to find and clean up later.  (Which hopefully is
> in the not too distant future.)

Yes, please (thank you for catching this, Paul)! Without version
information, the hackish workarounds are more likely to remain in the
project for a long time because it's harder to understand whether it's
still a problem or not (my default assumption is that there's a
builder or an out-of-tree user relying on it unless there's version
information attached).

~Aaron

> Thanks,
> --paulr
>
>> +  // refuses to generate them.
>> +  LambdaSCCPass(LambdaSCCPass &&Arg) : Func(std::move(Arg.Func)) {}
>> +  LambdaSCCPass &operator=(LambdaSCCPass &&RHS) {
>> +    Func = std::move(RHS.Func);
>> +    return *this;
>> +  }
>>
>>    PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM,
>>                          LazyCallGraph &CG, CGSCCUpdateResult &UR) {
>> @@ -141,6 +148,13 @@ struct LambdaSCCPass : public PassInfoMi
>>
>>  struct LambdaFunctionPass : public PassInfoMixin<LambdaFunctionPass> {
>>    template <typename T> LambdaFunctionPass(T &&Arg) :
>> Func(std::forward<T>(Arg)) {}
>> +  // We have to explicitly define all the special member functions
>> because MSVC
>> +  // refuses to generate them.
>> +  LambdaFunctionPass(LambdaFunctionPass &&Arg) :
>> Func(std::move(Arg.Func)) {}
>> +  LambdaFunctionPass &operator=(LambdaFunctionPass &&RHS) {
>> +    Func = std::move(RHS.Func);
>> +    return *this;
>> +  }
>>
>>    PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM) {
>>      return Func(F, AM);
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list