llvm-project/clang/docs
Richard Smith 64c045e25b Treat `std::move`, `forward`, and `move_if_noexcept` as builtins.
We still require these functions to be declared before they can be used,
but don't instantiate their definitions unless their addresses are
taken. Instead, code generation, constant evaluation, and static
analysis are given direct knowledge of their effect.

This change aims to reduce various costs associated with these functions
-- per-instantiation memory costs, compile time and memory costs due to
creating out-of-line copies and inlining them, code size at -O0, and so
on -- so that they are not substantially more expensive than a cast.
Most of these improvements are very small, but I measured a 3% decrease
in -O0 object file size for a simple C++ source file using the standard
library after this change.

We now automatically infer the `const` and `nothrow` attributes on these
now-builtin functions, in particular meaning that we get a warning for
an unused call to one of these functions.

In C++20 onwards, we disallow taking the addresses of these functions,
per the C++20 "addressable function" rule. In earlier language modes, a
compatibility warning is produced but the address can still be taken.

The same infrastructure is extended to the existing MSVC builtin
`__GetExceptionInfo`, which is now only recognized in namespace `std`
like it always should have been.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D123345
2022-04-15 14:09:45 -07:00
..
CommandGuide Treat `std::move`, `forward`, and `move_if_noexcept` as builtins. 2022-04-15 14:09:45 -07:00
DataFlowAnalysisIntroImages [clang][docs][dataflow] Added an introduction to dataflow analysis 2021-12-06 12:16:35 +01:00
analyzer [analyzer][ctu] Fix wrong 'multiple definitions' errors caused by space characters in lookup names when parsing the ctu index file 2022-03-22 10:28:42 +08:00
tools [AVR] Merge AVRRelaxMemOperations into AVRExpandPseudoInsts 2022-04-11 02:42:13 +00:00
APINotes.rst docs: add documentation describing API Notes 2020-10-05 18:29:13 +00:00
AddressSanitizer.rst [asan] Add support for disable_sanitizer_instrumentation attribute 2022-02-18 09:51:54 +01:00
AutomaticReferenceCounting.rst [clang] Document objc_unsafeClaimAutoreleasedReturnValue. 2022-02-08 14:30:39 -08:00
Block-ABI-Apple.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
BlockLanguageSpec.rst
CMakeLists.txt
ClangCheck.rst
ClangCommandLineReference.rst [OpenMP] Remove help and documentation for old flag 2022-04-08 10:16:33 -04:00
ClangFormat.rst [clang-format] [doc] Add script to automatically update help output in ClangFormat.rst. 2022-03-23 13:17:50 +01:00
ClangFormatStyleOptions.rst [clang-format][docs] Fix incorrect 'clang-format 11' option markers 2022-04-06 18:38:30 -07:00
ClangFormattedStatus.rst [clang-format] NFC update LLVM overall clang-formatted status 2022-03-06 20:03:27 +00:00
ClangLinkerWrapper.rst [Clang][Docs] Add documention for new OpenMP offloading driver 2022-02-03 13:09:49 -05:00
ClangNvlinkWrapper.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
ClangOffloadBundler.rst [clang][NFC] Fix Typo 2022-01-28 11:55:46 -08:00
ClangOffloadWrapper.rst [Doc] Fix wrong indentation 2022-01-19 11:15:31 +00:00
ClangPlugins.rst [docs] Add note about interaction between clang plugins and -clear-ast-before-backend 2022-02-28 12:53:09 -08:00
ClangStaticAnalyzer.rst
ClangTools.rst [Branch-Rename] Fix some links 2021-02-01 16:43:21 +05:30
ClangTransformerTutorial.rst Add a clang-transformer tutorial 2021-11-17 13:40:46 +00:00
ConstantInterpreter.rst
ControlFlowIntegrity.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
ControlFlowIntegrityDesign.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
CrossCompilation.rst
DataFlowAnalysisIntro.md [analyzer][NFC] Merge similar conditional paths 2022-03-07 22:05:27 +05:30
DataFlowSanitizer.rst Update all LLVM documentation mentioning runtimes in LLVM_ENABLE_PROJECTS 2022-02-10 15:05:23 -05:00
DataFlowSanitizerDesign.rst [clang] Fix typos in documentation (NFC) 2021-08-21 12:17:58 -07:00
DriverArchitecture.png
DriverInternals.rst
ExternalClangExamples.rst
FAQ.rst
HLSLSupport.rst [Clang] [Docs] Add HLSLSupport page 2022-04-08 12:17:45 -05:00
HardwareAssistedAddressSanitizerDesign.rst [HWASan] Mention x86_64 aliasing mode in design doc. 2021-03-25 14:22:20 -07:00
HowToSetupToolingForLLVM.rst [tooling] Explain how to create a compilation database on Windows [NFC] 2022-03-04 13:06:08 -07:00
InternalsManual.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
IntroductionToTheClangAST.rst [clang] Fix typos in documentation (NFC) 2021-08-21 12:17:58 -07:00
ItaniumMangleAbiTags.rst
JSONCompilationDatabase.rst [docs] [clang] Small documentation change for compilation databases 2022-01-22 17:30:34 -08:00
LTOVisibility.rst
LanguageExtensions.rst [Clang] Implement __builtin_source_location. 2022-03-28 18:29:02 -04:00
LeakSanitizer.rst [lsan][docs] Clarify supported platforms 2021-04-21 10:27:55 -07:00
LibASTImporter.rst
LibASTMatchers.rst
LibASTMatchersReference.html [ASTMatchers] Expand isInline matcher to VarDecl 2022-02-23 08:34:00 +00:00
LibASTMatchersTutorial.rst [docs] Fix linking issues in LibASTMatchers tutorial 2021-07-05 12:11:25 +03:00
LibFormat.rst [NFC] Inclusive language: Remove instances of master in URLs 2021-11-05 08:48:41 -05:00
LibTooling.rst [Branch-Rename] Fix some links 2021-02-01 16:43:21 +05:30
MSVCCompatibility.rst
MatrixTypes.rst [Matrix] Add missing newline to appease sphinx. 2021-03-12 09:33:36 +00:00
MemorySanitizer.rst [msan] Add link to the lifetime definition 2022-03-29 14:42:36 -07:00
Modules.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
ObjectiveCLiterals.rst
OffloadingDesign.rst [Clang][Docs] Fix some typos in offloading design documentation 2022-02-07 15:24:17 -05:00
OpenCLSupport.rst [Docs][OpenCL] Update OpenCL 3.0 status in docs. 2022-02-16 12:32:20 +00:00
OpenMPSupport.rst [OpenMP][NFC] update status for 5.1 'nothing' directive to 'worked on' 2022-02-10 09:22:44 -06:00
PCHInternals.rst
PCHLayout.graffle
PCHLayout.png
RAVFrontendAction.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
README.txt
RefactoringEngine.rst
ReleaseNotes.rst Treat `std::move`, `forward`, and `move_if_noexcept` as builtins. 2022-04-15 14:09:45 -07:00
SYCLSupport.rst [SYCL] Enable `opencl_global_[host,device]` attributes for SYCL 2021-05-18 10:27:35 +03:00
SafeStack.rst
SanitizerCoverage.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
SanitizerSpecialCaseList.rst [clang] accept -fsanitize-ignorelist= in addition to -fsanitize-blacklist= 2021-05-04 10:24:00 -04:00
SanitizerStats.rst
ShadowCallStack.rst
SourceBasedCodeCoverage.rst Coverage: Document how to collect a profile without a filesystem 2021-04-22 11:29:39 -07:00
ThinLTO.rst [clang] Fix sentence in the usage section of ThinLTO docs. 2021-09-30 07:26:19 +05:30
ThreadSafetyAnalysis.rst [clang][docs] Inclusive language: remove use of sanity check in option description 2021-11-30 15:07:43 -05:00
ThreadSanitizer.rst [tsan] Add support for disable_sanitizer_instrumentation attribute 2021-08-23 12:38:33 +02:00
Toolchain.rst Update all LLVM documentation mentioning runtimes in LLVM_ENABLE_PROJECTS 2022-02-10 15:05:23 -05:00
Tooling.rst
UndefinedBehaviorSanitizer.rst Improve UBSan documentation 2021-08-02 15:10:21 -07:00
UsersManual.rst [docs] Remove outdated -fexperimental-new-pass-manager for profile data remapping support 2022-04-11 13:49:06 -07:00
conf.py [docs] Remove hard-coded version numbers from sphinx configs 2022-02-01 23:14:12 -08:00
doxygen-mainpage.dox
doxygen.cfg.in [NFC] Inclusive Language: change master to main for .chm files 2021-11-08 08:23:04 -06:00
index.rst [Clang] [Docs] Add HLSLSupport page 2022-04-08 12:17:45 -05:00
make.bat

README.txt

See llvm/docs/README.txt