Re: r290171 - [OpenCL] Enabling the usage of CLK_NULL_QUEUE as compare operand.
Reverted in rL290173. On Tue, Dec 20, 2016 at 11:02 AM, Daniel Jasperwrote: > This triggers a bunch of warnings: > > lib/AST/Expr.cpp:1519:11: error: enumeration value 'CK_ZeroToOCLQueue' > not handled in switch [-Werror,-Wswitch] > lib/CodeGen/CGExprConstant.cpp:654:13: error: enumeration value > 'CK_ZeroToOCLQueue' not handled in switch [-Werror,-Wswitch] > lib/Edit/RewriteObjCFoundationAPI.cpp:1000:13: error: enumeration value > 'CK_ZeroToOCLQueue' not handled in switch [-Werror,-Wswitch] > lib/StaticAnalyzer/Core/ExprEngineC.cpp:314:13: error: enumeration > value 'CK_ZeroToOCLQueue' not handled in switch [-Werror,-Wswitch] > > Can you please fix or roll back quickly? > > On Tue, Dec 20, 2016 at 10:15 AM, Egor Churaev via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> Author: echuraev >> Date: Tue Dec 20 03:15:21 2016 >> New Revision: 290171 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=290171=rev >> Log: >> [OpenCL] Enabling the usage of CLK_NULL_QUEUE as compare operand. >> >> Summary: Enabling the compression of CLK_NULL_QUEUE to variable of type >> queue_t. >> >> Reviewers: Anastasia >> >> Subscribers: cfe-commits, yaxunl, bader >> >> Differential Revision: https://reviews.llvm.org/D27569 >> >> Added: >> cfe/trunk/test/CodeGenOpenCL/null_queue.cl >> cfe/trunk/test/SemaOpenCL/null_queue.cl >> cfe/trunk/test/SemaOpenCL/queue_t_overload.cl >> Modified: >> cfe/trunk/include/clang/AST/OperationKinds.def >> cfe/trunk/include/clang/Sema/Initialization.h >> cfe/trunk/include/clang/Sema/Overload.h >> cfe/trunk/lib/AST/ExprConstant.cpp >> cfe/trunk/lib/CodeGen/CGExprAgg.cpp >> cfe/trunk/lib/CodeGen/CGExprComplex.cpp >> cfe/trunk/lib/CodeGen/CGExprScalar.cpp >> cfe/trunk/lib/Sema/SemaExpr.cpp >> cfe/trunk/lib/Sema/SemaExprCXX.cpp >> cfe/trunk/lib/Sema/SemaInit.cpp >> cfe/trunk/lib/Sema/SemaOverload.cpp >> >> Modified: cfe/trunk/include/clang/AST/OperationKinds.def >> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/ >> AST/OperationKinds.def?rev=290171=290170=290171=diff >> >> == >> --- cfe/trunk/include/clang/AST/OperationKinds.def (original) >> +++ cfe/trunk/include/clang/AST/OperationKinds.def Tue Dec 20 03:15:21 >> 2016 >> @@ -321,6 +321,9 @@ CAST_OPERATION(BuiltinFnToFnPtr) >> // Convert a zero value for OpenCL event_t initialization. >> CAST_OPERATION(ZeroToOCLEvent) >> >> +// Convert a zero value for OpenCL queue_t initialization. >> +CAST_OPERATION(ZeroToOCLQueue) >> + >> // Convert a pointer to a different address space. >> CAST_OPERATION(AddressSpaceConversion) >> >> >> Modified: cfe/trunk/include/clang/Sema/Initialization.h >> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/ >> Sema/Initialization.h?rev=290171=290170=290171=diff >> >> == >> --- cfe/trunk/include/clang/Sema/Initialization.h (original) >> +++ cfe/trunk/include/clang/Sema/Initialization.h Tue Dec 20 03:15:21 >> 2016 >> @@ -751,6 +751,8 @@ public: >> SK_StdInitializerListConstructorCall, >> /// \brief Initialize an OpenCL sampler from an integer. >> SK_OCLSamplerInit, >> +/// \brief Initialize queue_t from 0. >> +SK_OCLZeroQueue, >> /// \brief Passing zero to a function where OpenCL event_t is >> expected. >> SK_OCLZeroEvent >>}; >> @@ -1148,6 +1150,9 @@ public: >>/// constant. >>void AddOCLZeroEventStep(QualType T); >> >> + /// \brief Add a step to initialize an OpenCL queue_t from 0. >> + void AddOCLZeroQueueStep(QualType T); >> + >>/// \brief Add steps to unwrap a initializer list for a reference >> around a >>/// single element and rewrap it at the end. >>void RewrapReferenceInitList(QualType T, InitListExpr *Syntactic); >> >> Modified: cfe/trunk/include/clang/Sema/Overload.h >> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/ >> Sema/Overload.h?rev=290171=290170=290171=diff >> >> == >> --- cfe/trunk/include/clang/Sema/Overload.h (original) >> +++ cfe/trunk/include/clang/Sema/Overload.h Tue Dec 20 03:15:21 2016 >> @@ -83,6 +83,7 @@ namespace clang { >> ICK_TransparentUnionConversion, ///< Transparent Union Conversions >> ICK_Writeback_Conversion, ///< Objective-C ARC writeback conversion >> ICK_Zero_Event_Conversion, ///< Zero constant to event (OpenCL1.2 >> 6.12.10) >> +ICK_Zero_Queue_Conversion, ///< Zero constant to queue >> ICK_C_Only_Conversion, ///< Conversions allowed in C, but not C++ >> ICK_Incompatible_Pointer_Conversion, ///< C-only conversion between >> pointers >> /// with incompatible types >> >> Modified: cfe/trunk/lib/AST/ExprConstant.cpp >> URL:
Re: r290171 - [OpenCL] Enabling the usage of CLK_NULL_QUEUE as compare operand.
This triggers a bunch of warnings: lib/AST/Expr.cpp:1519:11: error: enumeration value 'CK_ZeroToOCLQueue' not handled in switch [-Werror,-Wswitch] lib/CodeGen/CGExprConstant.cpp:654:13: error: enumeration value 'CK_ZeroToOCLQueue' not handled in switch [-Werror,-Wswitch] lib/Edit/RewriteObjCFoundationAPI.cpp:1000:13: error: enumeration value 'CK_ZeroToOCLQueue' not handled in switch [-Werror,-Wswitch] lib/StaticAnalyzer/Core/ExprEngineC.cpp:314:13: error: enumeration value 'CK_ZeroToOCLQueue' not handled in switch [-Werror,-Wswitch] Can you please fix or roll back quickly? On Tue, Dec 20, 2016 at 10:15 AM, Egor Churaev via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Author: echuraev > Date: Tue Dec 20 03:15:21 2016 > New Revision: 290171 > > URL: http://llvm.org/viewvc/llvm-project?rev=290171=rev > Log: > [OpenCL] Enabling the usage of CLK_NULL_QUEUE as compare operand. > > Summary: Enabling the compression of CLK_NULL_QUEUE to variable of type > queue_t. > > Reviewers: Anastasia > > Subscribers: cfe-commits, yaxunl, bader > > Differential Revision: https://reviews.llvm.org/D27569 > > Added: > cfe/trunk/test/CodeGenOpenCL/null_queue.cl > cfe/trunk/test/SemaOpenCL/null_queue.cl > cfe/trunk/test/SemaOpenCL/queue_t_overload.cl > Modified: > cfe/trunk/include/clang/AST/OperationKinds.def > cfe/trunk/include/clang/Sema/Initialization.h > cfe/trunk/include/clang/Sema/Overload.h > cfe/trunk/lib/AST/ExprConstant.cpp > cfe/trunk/lib/CodeGen/CGExprAgg.cpp > cfe/trunk/lib/CodeGen/CGExprComplex.cpp > cfe/trunk/lib/CodeGen/CGExprScalar.cpp > cfe/trunk/lib/Sema/SemaExpr.cpp > cfe/trunk/lib/Sema/SemaExprCXX.cpp > cfe/trunk/lib/Sema/SemaInit.cpp > cfe/trunk/lib/Sema/SemaOverload.cpp > > Modified: cfe/trunk/include/clang/AST/OperationKinds.def > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/ > clang/AST/OperationKinds.def?rev=290171=290170=290171=diff > > == > --- cfe/trunk/include/clang/AST/OperationKinds.def (original) > +++ cfe/trunk/include/clang/AST/OperationKinds.def Tue Dec 20 03:15:21 > 2016 > @@ -321,6 +321,9 @@ CAST_OPERATION(BuiltinFnToFnPtr) > // Convert a zero value for OpenCL event_t initialization. > CAST_OPERATION(ZeroToOCLEvent) > > +// Convert a zero value for OpenCL queue_t initialization. > +CAST_OPERATION(ZeroToOCLQueue) > + > // Convert a pointer to a different address space. > CAST_OPERATION(AddressSpaceConversion) > > > Modified: cfe/trunk/include/clang/Sema/Initialization.h > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/ > clang/Sema/Initialization.h?rev=290171=290170=290171=diff > > == > --- cfe/trunk/include/clang/Sema/Initialization.h (original) > +++ cfe/trunk/include/clang/Sema/Initialization.h Tue Dec 20 03:15:21 2016 > @@ -751,6 +751,8 @@ public: > SK_StdInitializerListConstructorCall, > /// \brief Initialize an OpenCL sampler from an integer. > SK_OCLSamplerInit, > +/// \brief Initialize queue_t from 0. > +SK_OCLZeroQueue, > /// \brief Passing zero to a function where OpenCL event_t is > expected. > SK_OCLZeroEvent >}; > @@ -1148,6 +1150,9 @@ public: >/// constant. >void AddOCLZeroEventStep(QualType T); > > + /// \brief Add a step to initialize an OpenCL queue_t from 0. > + void AddOCLZeroQueueStep(QualType T); > + >/// \brief Add steps to unwrap a initializer list for a reference > around a >/// single element and rewrap it at the end. >void RewrapReferenceInitList(QualType T, InitListExpr *Syntactic); > > Modified: cfe/trunk/include/clang/Sema/Overload.h > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/ > clang/Sema/Overload.h?rev=290171=290170=290171=diff > > == > --- cfe/trunk/include/clang/Sema/Overload.h (original) > +++ cfe/trunk/include/clang/Sema/Overload.h Tue Dec 20 03:15:21 2016 > @@ -83,6 +83,7 @@ namespace clang { > ICK_TransparentUnionConversion, ///< Transparent Union Conversions > ICK_Writeback_Conversion, ///< Objective-C ARC writeback conversion > ICK_Zero_Event_Conversion, ///< Zero constant to event (OpenCL1.2 > 6.12.10) > +ICK_Zero_Queue_Conversion, ///< Zero constant to queue > ICK_C_Only_Conversion, ///< Conversions allowed in C, but not C++ > ICK_Incompatible_Pointer_Conversion, ///< C-only conversion between > pointers > /// with incompatible types > > Modified: cfe/trunk/lib/AST/ExprConstant.cpp > URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ > ExprConstant.cpp?rev=290171=290170=290171=diff > > == > --- cfe/trunk/lib/AST/ExprConstant.cpp (original) > +++ cfe/trunk/lib/AST/ExprConstant.cpp Tue Dec
r290171 - [OpenCL] Enabling the usage of CLK_NULL_QUEUE as compare operand.
Author: echuraev Date: Tue Dec 20 03:15:21 2016 New Revision: 290171 URL: http://llvm.org/viewvc/llvm-project?rev=290171=rev Log: [OpenCL] Enabling the usage of CLK_NULL_QUEUE as compare operand. Summary: Enabling the compression of CLK_NULL_QUEUE to variable of type queue_t. Reviewers: Anastasia Subscribers: cfe-commits, yaxunl, bader Differential Revision: https://reviews.llvm.org/D27569 Added: cfe/trunk/test/CodeGenOpenCL/null_queue.cl cfe/trunk/test/SemaOpenCL/null_queue.cl cfe/trunk/test/SemaOpenCL/queue_t_overload.cl Modified: cfe/trunk/include/clang/AST/OperationKinds.def cfe/trunk/include/clang/Sema/Initialization.h cfe/trunk/include/clang/Sema/Overload.h cfe/trunk/lib/AST/ExprConstant.cpp cfe/trunk/lib/CodeGen/CGExprAgg.cpp cfe/trunk/lib/CodeGen/CGExprComplex.cpp cfe/trunk/lib/CodeGen/CGExprScalar.cpp cfe/trunk/lib/Sema/SemaExpr.cpp cfe/trunk/lib/Sema/SemaExprCXX.cpp cfe/trunk/lib/Sema/SemaInit.cpp cfe/trunk/lib/Sema/SemaOverload.cpp Modified: cfe/trunk/include/clang/AST/OperationKinds.def URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/OperationKinds.def?rev=290171=290170=290171=diff == --- cfe/trunk/include/clang/AST/OperationKinds.def (original) +++ cfe/trunk/include/clang/AST/OperationKinds.def Tue Dec 20 03:15:21 2016 @@ -321,6 +321,9 @@ CAST_OPERATION(BuiltinFnToFnPtr) // Convert a zero value for OpenCL event_t initialization. CAST_OPERATION(ZeroToOCLEvent) +// Convert a zero value for OpenCL queue_t initialization. +CAST_OPERATION(ZeroToOCLQueue) + // Convert a pointer to a different address space. CAST_OPERATION(AddressSpaceConversion) Modified: cfe/trunk/include/clang/Sema/Initialization.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Initialization.h?rev=290171=290170=290171=diff == --- cfe/trunk/include/clang/Sema/Initialization.h (original) +++ cfe/trunk/include/clang/Sema/Initialization.h Tue Dec 20 03:15:21 2016 @@ -751,6 +751,8 @@ public: SK_StdInitializerListConstructorCall, /// \brief Initialize an OpenCL sampler from an integer. SK_OCLSamplerInit, +/// \brief Initialize queue_t from 0. +SK_OCLZeroQueue, /// \brief Passing zero to a function where OpenCL event_t is expected. SK_OCLZeroEvent }; @@ -1148,6 +1150,9 @@ public: /// constant. void AddOCLZeroEventStep(QualType T); + /// \brief Add a step to initialize an OpenCL queue_t from 0. + void AddOCLZeroQueueStep(QualType T); + /// \brief Add steps to unwrap a initializer list for a reference around a /// single element and rewrap it at the end. void RewrapReferenceInitList(QualType T, InitListExpr *Syntactic); Modified: cfe/trunk/include/clang/Sema/Overload.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Overload.h?rev=290171=290170=290171=diff == --- cfe/trunk/include/clang/Sema/Overload.h (original) +++ cfe/trunk/include/clang/Sema/Overload.h Tue Dec 20 03:15:21 2016 @@ -83,6 +83,7 @@ namespace clang { ICK_TransparentUnionConversion, ///< Transparent Union Conversions ICK_Writeback_Conversion, ///< Objective-C ARC writeback conversion ICK_Zero_Event_Conversion, ///< Zero constant to event (OpenCL1.2 6.12.10) +ICK_Zero_Queue_Conversion, ///< Zero constant to queue ICK_C_Only_Conversion, ///< Conversions allowed in C, but not C++ ICK_Incompatible_Pointer_Conversion, ///< C-only conversion between pointers /// with incompatible types Modified: cfe/trunk/lib/AST/ExprConstant.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprConstant.cpp?rev=290171=290170=290171=diff == --- cfe/trunk/lib/AST/ExprConstant.cpp (original) +++ cfe/trunk/lib/AST/ExprConstant.cpp Tue Dec 20 03:15:21 2016 @@ -8340,6 +8340,7 @@ bool IntExprEvaluator::VisitCastExpr(con case CK_IntegralComplexToFloatingComplex: case CK_BuiltinFnToFnPtr: case CK_ZeroToOCLEvent: + case CK_ZeroToOCLQueue: case CK_NonAtomicToAtomic: case CK_AddressSpaceConversion: case CK_IntToOCLSampler: @@ -8837,6 +8838,7 @@ bool ComplexExprEvaluator::VisitCastExpr case CK_CopyAndAutoreleaseBlockObject: case CK_BuiltinFnToFnPtr: case CK_ZeroToOCLEvent: + case CK_ZeroToOCLQueue: case CK_NonAtomicToAtomic: case CK_AddressSpaceConversion: case CK_IntToOCLSampler: Modified: cfe/trunk/lib/CodeGen/CGExprAgg.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprAgg.cpp?rev=290171=290170=290171=diff == --- cfe/trunk/lib/CodeGen/CGExprAgg.cpp (original) +++