llvm-project/clang/lib/Sema
Joshua Haberman 8344675908 Implemented [[clang::musttail]] attribute for guaranteed tail calls.
This is a Clang-only change and depends on the existing "musttail"
support already implemented in LLVM.

The [[clang::musttail]] attribute goes on a return statement, not
a function definition. There are several constraints that the user
must follow when using [[clang::musttail]], and these constraints
are verified by Sema.

Tail calls are supported on regular function calls, calls through a
function pointer, member function calls, and even pointer to member.

Future work would be to throw a warning if a users tries to pass
a pointer or reference to a local variable through a musttail call.

Reviewed By: rsmith

Differential Revision: https://reviews.llvm.org/D99517
2021-04-15 17:12:21 -07:00
..
AnalysisBasedWarnings.cpp [-Wcalled-once-parameter] Harden analysis in terms of block use 2021-03-18 12:12:18 +03:00
CMakeLists.txt [Clang][Attr] Introduce the `assume` function attribute 2020-12-15 16:51:34 -06:00
CodeCompleteConsumer.cpp [Sema] Use isa<> instead of dyn_cast<> as pointer is never dereferenced. NFCI. 2020-11-15 12:58:36 +00:00
CoroutineStmtBuilder.h
DeclSpec.cpp [OpenCL] Refactor diagnostic for OpenCL extension/feature 2021-03-12 11:43:53 +03:00
DelayedDiagnostic.cpp
IdentifierResolver.cpp
JumpDiagnostics.cpp Implemented [[clang::musttail]] attribute for guaranteed tail calls. 2021-04-15 17:12:21 -07:00
MultiplexExternalSemaSource.cpp Make iteration over the DeclContext::lookup_result safe. 2021-03-17 08:59:04 +00:00
OpenCLBuiltins.td [OpenCL] Fix mipmap read_image return types 2021-04-08 09:51:44 +01:00
ParsedAttr.cpp Correct the tablegen for checking mutually exclusive stmt attrs 2021-04-13 15:20:30 -04:00
Scope.cpp
ScopeInfo.cpp [clang] Enable support for #pragma STDC FENV_ACCESS 2020-10-25 06:46:25 -07:00
Sema.cpp Implemented [[clang::musttail]] attribute for guaranteed tail calls. 2021-04-15 17:12:21 -07:00
SemaAccess.cpp [clang] Fix an assertion crash in delayed access check. 2020-11-13 14:02:57 +01:00
SemaAttr.cpp Allow applying attributes to subset of allowed subjects. 2021-04-12 09:33:33 -07:00
SemaAvailability.cpp Prune TargetInfo.h include from ParsedAttr.h, NFC 2020-03-11 20:47:11 -07:00
SemaCUDA.cpp [CUDA][HIP] Fix checking dependent initalizer 2021-02-04 18:04:54 -05:00
SemaCXXScopeSpec.cpp [Clang] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:04:18 +00:00
SemaCast.cpp [Matrix] Implement C-style explicit type conversions for matrix types. 2021-04-10 11:48:41 +01:00
SemaChecking.cpp [Sema] Move 'char-expression-as-unsigned < 0' into a separate diagnostic 2021-04-14 01:01:40 +02:00
SemaCodeComplete.cpp [CodeCompletion] Avoid spurious signature help for init-list args 2021-03-16 12:46:40 +01:00
SemaConcept.cpp [clang] Use decltype((E)) for compound requirement type constraint 2021-03-30 22:00:33 +02:00
SemaConsumer.cpp
SemaCoroutine.cpp [C++20] [P1825] More implicit moves 2021-02-16 17:24:20 -05:00
SemaDecl.cpp [Sema] Fold VLA types in compound literals to constant arrays. 2021-04-14 17:09:59 -07:00
SemaDeclAttr.cpp Handle alloc_size attribute on function pointers 2021-04-09 18:49:38 +01:00
SemaDeclCXX.cpp Don't directly dereference getAs<> casts to avoid potential null dereferences. NFCI. 2021-04-06 12:24:19 +01:00
SemaDeclObjC.cpp [ObjC] Add a command line flag that disables recognition of objc_direct for testability 2021-04-06 11:17:01 -04:00
SemaExceptionSpec.cpp [OpenMP51] Initial support for masked directive and filter clause 2021-04-09 14:00:36 -05:00
SemaExpr.cpp [clang][patch] Modify diagnostic level from err to warn: anyx86_interrupt_regsave 2021-04-15 13:11:33 -04:00
SemaExprCXX.cpp [clang] Use decltype((E)) for compound requirement type constraint 2021-03-30 22:00:33 +02:00
SemaExprMember.cpp [OpenCL] Accept .rgba in OpenCL 3.0 2021-04-12 09:30:06 +01:00
SemaExprObjC.cpp [SemaObjC] Fix a -Wbridge-cast false-positive 2021-04-05 11:41:40 -04:00
SemaFixItUtils.cpp
SemaInit.cpp Remove warning "suggest braces" for aggregate initialization of an empty class with an aggregate base class. 2021-04-13 15:45:09 -04:00
SemaLambda.cpp Recommit of a2fdf9d4d7. 2021-02-05 11:27:30 -05:00
SemaLookup.cpp [OpenCL] Simplify InsertOCLBuiltinDeclarationsFromTable 2021-04-09 11:54:15 +01:00
SemaModule.cpp Change Module::ASTFile and ModuleFile::File => Optional<FileEntryRef>, NFC 2020-11-02 15:11:51 -05:00
SemaObjCProperty.cpp Make iteration over the DeclContext::lookup_result safe. 2021-03-17 08:59:04 +00:00
SemaOpenMP.cpp [OpenMP51] Initial support for masked directive and filter clause 2021-04-09 14:00:36 -05:00
SemaOverload.cpp Don't directly dereference getAs<> casts to avoid potential null dereferences. NFCI. 2021-04-06 12:24:19 +01:00
SemaPseudoObject.cpp Revert "[NFC, Refactor] Modernize StorageClass from Specifiers.h to a scoped enum (II)" 2021-01-04 23:17:45 +01:00
SemaSYCL.cpp Recommit "[CUDA][HIP] Defer overloading resolution diagnostics for host device functions" 2020-10-19 17:48:04 -04:00
SemaStmt.cpp Implemented [[clang::musttail]] attribute for guaranteed tail calls. 2021-04-15 17:12:21 -07:00
SemaStmtAsm.cpp Revert "[NFC, Refactor] Modernize StorageClass from Specifiers.h to a scoped enum (II)" 2021-01-04 23:17:45 +01:00
SemaStmtAttr.cpp Implemented [[clang::musttail]] attribute for guaranteed tail calls. 2021-04-15 17:12:21 -07:00
SemaTemplate.cpp [clang] Fix crash when creating deduction guide. 2021-03-09 16:57:56 +01:00
SemaTemplateDeduction.cpp Don't directly dereference getAs<> casts to avoid potential null dereferences. NFCI. 2021-04-06 12:24:19 +01:00
SemaTemplateInstantiate.cpp Make iteration over the DeclContext::lookup_result safe. 2021-03-17 08:59:04 +00:00
SemaTemplateInstantiateDecl.cpp [clang] Fix a nullptr dereference bug on invalid code 2021-01-25 15:02:25 +01:00
SemaTemplateVariadic.cpp Revert "Following up on PR48517, fix handling of template arguments that refer" 2021-01-20 15:55:35 +01:00
SemaType.cpp [clang] Use decltype((E)) for compound requirement type constraint 2021-03-30 22:00:33 +02:00
TreeTransform.h [OpenMP51] Initial support for masked directive and filter clause 2021-04-09 14:00:36 -05:00
TypeLocBuilder.cpp [NFC] avoid AlignedCharArray in clang 2019-07-29 23:12:48 +00:00
TypeLocBuilder.h [NFC] avoid AlignedCharArray in clang 2019-07-29 23:12:48 +00:00
UsedDeclVisitor.h DeferredDiagnosticsEmitter crashes 2020-10-08 11:42:21 -04:00