llvm-project/clang/lib/Sema
Artem Belevich 64135c35f7 [CUDA] Ignore implicit target attributes during function template instantiation.
Some functions and templates are treated as __host__ __device__ even
when they don't have explicitly specified target attributes.
What's worse, this treatment may change depending on command line
options (-fno-cuda-host-device-constexpr) or
#pragma clang force_cuda_host_device.

Combined with strict checking for matching function target that comes
with D25809(r288962), it makes it hard to write code which would
explicitly instantiate or specialize some functions regardless of
pragmas or command line options in effect.

This patch changes the way we match target attributes of base template
vs attributes used in explicit instantiation or specialization so that
only explicitly specified attributes are considered. This makes base
template selection behave consistently regardless of pragma of command
line options that may affect CUDA target.

Differential Revision: https://reviews.llvm.org/D25845

llvm-svn: 289091
2016-12-08 19:38:13 +00:00
..
AnalysisBasedWarnings.cpp [coroutines] Build fallthrough and set_exception statements. 2016-10-27 07:30:31 +00:00
AttributeList.cpp Retire llvm::alignOf in favor of C++11 alignof. 2016-10-20 14:27:22 +00:00
CMakeLists.txt It seems we need to add SemaExpr.cpp to the /bigobj list; I am getting consistent failures of hitting the section count limit. 2016-06-01 15:17:54 +00:00
CodeCompleteConsumer.cpp Retire llvm::alignOf in favor of C++11 alignof. 2016-10-20 14:27:22 +00:00
DeclSpec.cpp Fixes for r287241. Use placement new. Apply clang-format. 2016-11-17 21:00:09 +00:00
DelayedDiagnostic.cpp [Sema] Delay partial availability diagnostics, just like deprecated 2016-10-28 21:39:27 +00:00
IdentifierResolver.cpp [modules] Separately track whether an identifier's preprocessor information and 2016-02-05 19:03:40 +00:00
JumpDiagnostics.cpp [Sema] Handle CaseStmt and DefaultStmt as SwitchCase 2016-10-26 02:00:00 +00:00
MultiplexExternalSemaSource.cpp [Sema] Use unique_ptr instead of raw pointers in the late-parsed templates map. 2016-10-10 16:26:08 +00:00
Scope.cpp [Parser] Clear the TemplateParamScope bit of the current scope's flag 2016-04-29 02:24:14 +00:00
ScopeInfo.cpp [Sema][NFC] Reset HasFallthroughStmt when clearing FunctionScopeInfo 2016-11-09 22:52:23 +00:00
Sema.cpp DR1213: element access on an array xvalue or prvalue produces an xvalue. In the 2016-12-05 07:49:14 +00:00
SemaAccess.cpp P0136R1, DR1573, DR1645, DR1715, DR1736, DR1903, DR1941, DR1959, DR1991: 2016-06-28 19:03:57 +00:00
SemaAttr.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
SemaCUDA.cpp [CUDA] Ignore implicit target attributes during function template instantiation. 2016-12-08 19:38:13 +00:00
SemaCXXScopeSpec.cpp [ObjC++] Don't enter a C++ declarator scope when the current context is 2016-12-07 10:24:44 +00:00
SemaCast.cpp Mass-rename the handful of error_* diagnostics to err_*. 2016-12-02 22:38:31 +00:00
SemaChecking.cpp Clean up some Sema checking code. NFC 2016-12-06 01:42:28 +00:00
SemaCodeComplete.cpp [CodeCompletion][ObjC] Use a parameterized NSSet return type for 2016-12-08 16:49:05 +00:00
SemaConsumer.cpp
SemaCoroutine.cpp [coroutines] Add diagnostics for copy/move assignment operators and functions with deduced return types. 2016-10-27 18:43:28 +00:00
SemaDecl.cpp [CUDA] Ignore implicit target attributes during function template instantiation. 2016-12-08 19:38:13 +00:00
SemaDeclAttr.cpp [Sema] Range-ify for loop, add period to comment. NFC. 2016-11-10 21:47:12 +00:00
SemaDeclCXX.cpp [c++1z] P0490R0, NB comment GB 20: if std::tuple_size<T> is complete, use the 2016-12-08 03:24:55 +00:00
SemaDeclObjC.cpp Mass-rename the handful of error_* diagnostics to err_*. 2016-12-02 22:38:31 +00:00
SemaExceptionSpec.cpp PR31244: Use the exception specification from the callee's type directly to 2016-12-03 00:29:06 +00:00
SemaExpr.cpp DR1213: element access on an array xvalue or prvalue produces an xvalue. In the 2016-12-05 07:49:14 +00:00
SemaExprCXX.cpp [c++17] P0135R1: Guaranteed copy elision. 2016-12-06 23:52:28 +00:00
SemaExprMember.cpp DR616, and part of P0135R1: member access (or pointer-to-member access) on a 2016-12-03 01:14:32 +00:00
SemaExprObjC.cpp More diagnostic name fixups: w_ -> warn_, warning_ -> warn_, not_ -> note_. 2016-12-02 23:00:28 +00:00
SemaFixItUtils.cpp Wire a SourceLocation into IsDerivedFrom and move the RequireCompleteType call 2015-12-18 21:45:41 +00:00
SemaInit.cpp [c++17] P0135R1: Guaranteed copy elision. 2016-12-06 23:52:28 +00:00
SemaLambda.cpp [OPENMP] Fix for PR30632: Name mangling issue. 2016-11-15 13:15:20 +00:00
SemaLookup.cpp [Frontend] Allow attaching an external sema source to compiler instance and extra diags to TypoCorrections 2016-11-16 18:15:26 +00:00
SemaObjCProperty.cpp Mass-rename the handful of error_* diagnostics to err_*. 2016-12-02 22:38:31 +00:00
SemaOpenMP.cpp [OpenMP] Sema and parsing for 'teams distribute parallel for simd' pragma 2016-11-30 23:51:03 +00:00
SemaOverload.cpp [CUDA] Improve target attribute checking for function templates. 2016-12-07 19:27:16 +00:00
SemaPseudoObject.cpp More diagnostic name fixups: w_ -> warn_, warning_ -> warn_, not_ -> note_. 2016-12-02 23:00:28 +00:00
SemaStmt.cpp [Sema] Avoid "case value not in enumerated type" warning for C++11 opaque enums 2016-12-08 14:46:05 +00:00
SemaStmtAsm.cpp Address review feedback by adding comments about ${:uid} 2016-12-07 00:17:18 +00:00
SemaStmtAttr.cpp Add loop pragma for Loop Distribution 2016-06-14 12:04:26 +00:00
SemaTemplate.cpp [CUDA] Ignore implicit target attributes during function template instantiation. 2016-12-08 19:38:13 +00:00
SemaTemplateDeduction.cpp PR31081: ignore exception specifications when deducing function template 2016-12-01 02:11:49 +00:00
SemaTemplateInstantiate.cpp Make diagnostic for use of default member initializer before enclosing class is 2016-11-22 22:55:12 +00:00
SemaTemplateInstantiateDecl.cpp [Sema] Set range end of constructors and destructors in template instantiations 2016-11-28 11:11:34 +00:00
SemaTemplateVariadic.cpp PR26276: Fix detection of non-cast-expressions as operands of fold-expressions. 2016-10-20 00:55:15 +00:00
SemaType.cpp Implement the -Wstrict-prototypes warning 2016-12-07 10:52:18 +00:00
TreeTransform.h [OpenMP] Sema and parsing for 'teams distribute parallel for simd' pragma 2016-11-30 23:51:03 +00:00
TypeLocBuilder.cpp [Sema] Fix bug in TypeLocBuilder::pushImpl 2016-02-18 21:05:09 +00:00
TypeLocBuilder.h Retire llvm::alignOf in favor of C++11 alignof. 2016-10-20 14:27:22 +00:00