aboutsummaryrefslogtreecommitdiff
path: root/clang/docs
AgeCommit message (Collapse)AuthorFilesLines
2023-07-25Clear release notes for 18.xllvmorg-18-initTobias Hieta1-927/+0
2023-07-25[clang][analyzer] Improved documentation for TaintPropagation CheckerDaniel Krupp1-35/+215
The usage of the taint analysis is described through a command injection attack example. It is explained how to make a variable sanitized through configuration. Differential Revision: https://reviews.llvm.org/D145229
2023-07-25[docs] Add llvm & clang release notes for LoongArchWeining Lu1-0/+3
Differential Revision: https://reviews.llvm.org/D156195
2023-07-25[X86] Support -march=graniterapids-d and update -march=graniterapidsFreddy Ye1-0/+1
Reviewed By: pengfei, RKSimon, skan Differential Revision: https://reviews.llvm.org/D155798
2023-07-24Add new option -fkeep-persistent-storage-variables to Clang release notesZheng Qian1-0/+5
This patch updates the Clang release notes with the new option -fkeep-persistent-storage-variables added in bb6ab91b1dcd. Reviewed By: hubert.reinterpretcast Differential Revision: https://reviews.llvm.org/D155501
2023-07-24[clang-format] Add SpacesInParens with SpacesInParensOptionsGedare Bloom2-26/+103
This is a refactoring of: - SpacesInConditionalStatement - SpacesInCStyleCastParentheses - SpaceInEmptyParentheses - SpacesInParentheses These are now options under the new Style Option: SpacesInParens. The existing options are maintained for backward compatibility. Within SpacesInParens, there are currently options for: - Never - Custom The currently available options for Custom are: - InConditionalStatements - InCStyleCasts - InEmptyParentheses - Other Setting InConditionalStatements and Other to true enables the same space additions as SpacesInParentheses. This refactoring does not add or remove any existing features, but it makes it possible to more easily extend and maintain the addition of spaces within parentheses. Related to #55428. Differential Revision: https://reviews.llvm.org/D155239
2023-07-24[clang-format] Add AlignConsecutiveShortCaseStatementsGalen Elias2-0/+100
This adds a new AlignConsecutiveShortCaseStatements option in line with the existing AlignConsecutive* options , which when AllowShortCaseLabelsOnASingleLine is enabled will align the tokens after the case statement's colon. This also adds a AlignCaseColons option to allow aligning the case label colon itself rather than the token after it. Fixes #55475. Differential Revision: https://reviews.llvm.org/D151761
2023-07-24Revert "[clang-format] Add AlignConsecutiveShortCaseStatements"Owen Pan2-100/+0
This reverts commit 4ba00844174db562d2bd8b15dab6aac605eddf57.
2023-07-24Revert "Revert "[clang-format] Add AlignConsecutiveShortCaseStatements""Owen Pan2-0/+100
This reverts commit 4f093b31669a4f8e417259583141159586a05b28.
2023-07-24Revert "[clang-format] Add AlignConsecutiveShortCaseStatements"Owen Pan2-100/+0
This reverts commit 4ba00844174db562d2bd8b15dab6aac605eddf57 due to missing authorship.
2023-07-25Revert "[Clang][LoongArch] Fix ABI handling of empty structs in C++ to match ↵Weining Lu1-2/+0
GCC behaviour" This reverts commit c299efbf284fae92bb8d7d29110f76912f089daf. Reason to revert: D142327 has been reverted which is depended by this change.
2023-07-24[clang-format] Add AlignConsecutiveShortCaseStatementsOwen Pan2-0/+100
This adds a new AlignConsecutiveShortCaseStatements option in line with the existing AlignConsecutive* options , which when AllowShortCaseLabelsOnASingleLine is enabled will align the tokens after the case statement's colon. This also adds a AlignCaseColons option to allow aligning the case label colon itself rather than the token after it. Fixes #55475. Differential Revision: https://reviews.llvm.org/D151761
2023-07-25[Clang][LoongArch] Fix ABI handling of empty structs in C++ to match GCC ↵Weining Lu1-0/+2
behaviour GCC doesn't ignore non-zero-length array of empty structures in C++ while clang does. What this patch did is to match GCC's behaviour although this rule is not documented in psABI. Similar to D142327 for RISCV. Reviewed By: xry111, xen0n Differential Revision: https://reviews.llvm.org/D156116
2023-07-24 clang: Add elementwise pow builtinJoshua Batista2-0/+2
Add codegen for llvm pow elementwise builtin The pow elementwise builtin is necessary for HLSL codegen. Tests were added to make sure that the expected errors are encountered when these functions are given inputs of incompatible types, or too many inputs. The new builtin is restricted to floating point types only. Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D153310
2023-07-25[Clang] Reject programs declaring namespace std to be inlinePo-yao Chang1-0/+1
Fixes #64041 Differential Revision: https://reviews.llvm.org/D156063
2023-07-24[clang] Fix specialization of non-templated member classes of class templatesPodchishchaeva, Mariya1-0/+2
Explicit specialization doesn't increase depth of template parameters, so need to be careful when gathering template parameters for instantiation. For the case: ``` template<typename T> struct X { struct impl; }; template <> struct X<int>::impl { template<int ct> int f() { return ct; }; }; ``` instantiation of `f` used to crash because type template parameter `int` of explicit specialization was taken into account, but non-type template parameter `ct` had zero depth and index so wrong parameter ended up inside of a wrong handler. Fixes https://github.com/llvm/llvm-project/issues/61159 Reviewed By: aaron.ballman, shafik Differential Revision: https://reviews.llvm.org/D155705
2023-07-24Revert "[clang][RISCV] Fix ABI handling of empty structs with hard FP ↵Alex Bradbury1-3/+0
calling conventions in C++" This reverts commit 17a58b3ca7ec18585e9ea8ed8b39d72fe36fb6cb and the minor documentation fix 569e99a471f618b7fdf045d5e96f21d3e3a7f898. An issue was reported in https://reviews.llvm.org/D142327#inline-1510301 so reverting until it can be investigated and fixed.
2023-07-24Fix the Clang sphinx buildAaron Ballman1-1/+1
This addresses issues found by: https://lab.llvm.org/buildbot/#/builders/92/builds/47783
2023-07-24[OPENMP][NFC] Editing OpenMP support pageSandeep Kosuri1-1/+1
2023-07-24[clang][ASTDumper] Remove redundant dump of BlockDecl's ParmVarDecldingfei1-1/+2
ParmVarDecl of BlockDecl is unnecessarily dumped twice. Remove this duplication as other FunctionDecls. Fixes https://github.com/llvm/llvm-project/issues/64005 (#2) Differential Revision: https://reviews.llvm.org/D155985
2023-07-24[Sema][ObjC] Invalidate BlockDecl with invalid ParmVarDecldingfei1-0/+2
BlockDecl should be invalidated because of its invalid ParmVarDecl. Fixes #1 of https://github.com/llvm/llvm-project/issues/64005 Differential Revision: https://reviews.llvm.org/D155984
2023-07-24[Sema][ObjC] Invalidate BlockDecl with invalid return expr & its parent ↵dingfei1-0/+4
BlockExpr Invalidate BlockDecl with implicit return type, in case any of the return value exprs is invalid. Propagating the error info up by replacing BlockExpr with a RecoveryExpr. The idea of this fix is given by @hokein(Haojian Wu) Fix https://github.com/llvm/llvm-project/issues/63863. Differential Revision: https://reviews.llvm.org/D155396
2023-07-24[clang][docs] Attempt to fix warning when building ReleaseNotesAlex Bradbury1-1/+1
I believe my previous patch, 17a58b3ca7ec18585e9ea8ed8b39d72fe36fb6cb introduced a warning here.
2023-07-24[clang][RISCV] Fix ABI handling of empty structs with hard FP calling ↵Alex Bradbury1-0/+3
conventions in C++ As reported in <https://github.com/llvm/llvm-project/issues/58929>, Clang's handling of empty structs in the case of small structs that may be eligible to be passed using the hard FP calling convention doesn't match g++. In general, C++ record fields are never empty unless [[no_unique_address]] is used, but the RISC-V FP ABI overrides this. After this patch, fields of structs that contain empty records will be ignored, even in C++, when considering eligibility for the FP calling convention ('flattening'). See also the relevant psABI issue <https://github.com/riscv-non-isa/riscv-elf-psabi-doc/issues/358> which seeks to clarify the documentation. Fixes https://github.com/llvm/llvm-project/issues/58929 Differential Revision: https://reviews.llvm.org/D142327
2023-07-24[analyzer][docs] Add CSA release notesBalazs Benics1-0/+63
We'll soon branch off, and start releasing clang-17. Here is a patch, adjusting the release notes for what we achieved since the last release. I used this command to inspect the interesting commits: ``` git log --oneline llvmorg-16.0.0..llvm/main \ clang/{lib/StaticAnalyzer,include/clang/StaticAnalyzer} | \ grep -v NFC | grep -v -i revert ``` This filters in CSA directories and filters out NFC and revert commits. Given that in the release-notes, we usually don't put links to commits, I'll remove them from this patch as well. I just put them there to make it easier to review for you. I tried to group the changes into meaningful chunks, and dropped some of the uninteresting commits. I've also dropped the commits that were backported to clang-16. Check out how it looks, and propose changes like usual. --- FYI the `ninja docs-clang-html` produces the html docs, including the `ReleaseNotes`. And the produced artifact will be at `build/tools/clang/docs/html/ReleaseNotes.html`. Differential Revision: https://reviews.llvm.org/D155445
2023-07-23[Clang][NFC] Restore changelog entry incorrectly removed by 02bb2beeefCorentin Jabot1-0/+2
2023-07-23[clang] Fix diagnostics for defaulted, implicitly deleted 'operator=='.Amirreza Ashouri1-2/+4
https://godbolt.org/z/cMKE3o1aG According to the issue https://github.com/llvm/llvm-project/issues/63960 , compiler falsely complains that no viable `operator<=>` was found while we are actually looking for a `operator==`. This bug has been fixed through adding a check of the `OverloadedOperatorKind` type's object, `OO`, to see if it is `OO_EqualEqual` in addition to `OO_ExclaimEqual`. Reviewed By: #clang-language-wg, cor3ntin Differential Revision: https://reviews.llvm.org/D155714
2023-07-22[clang] Enable C++11-style attributes in all language modesNikolas Klauser2-6/+10
This also ignores and deprecates the `-fdouble-square-bracket-attributes` command line flag, which seems to not be used anywhere. At least a code search exclusively found mentions of it in documentation: https://sourcegraph.com/search?q=context:global+-fdouble-square-bracket-attributes+-file:clang/*+-file:test/Sema/*+-file:test/Parser/*+-file:test/AST/*+-file:test/Preprocessor/*+-file:test/Misc/*+archived:yes&patternType=standard&sm=0&groupBy=repo RFC: https://discourse.llvm.org/t/rfc-enable-c-11-c2x-attributes-in-all-standard-modes-as-an-extension-and-remove-fdouble-square-bracket-attributes This enables `[[]]` attributes in all C and C++ language modes without warning by default. `-Wc++-extensions` does warn. GCC has enabled this extension in all C modes since GCC 10. Reviewed By: aaron.ballman, MaskRay Spies: #clang-vendors, beanz, JDevlieghere, Michael137, MaskRay, sstefan1, jplehr, cfe-commits, lldb-commits, dmgreen, jdoerfert, wenlei, wlei Differential Revision: https://reviews.llvm.org/D151683
2023-07-21[Clang] Diagnose jumps into statement expressionsCorentin Jabot1-1/+4
Such jumps are not allowed by GCC and allowing them can lead to situations where we jumps into unevaluated statements. Fixes #63682 Reviewed By: aaron.ballman, #clang-language-wg Differential Revision: https://reviews.llvm.org/D154696
2023-07-21[Clang] Fix constraint checking of non-generic lambdas.Corentin Jabot1-0/+2
A lambda call operator can be a templated entity - and therefore have constraints while not being a function template template<class T> void f() { []() requires false { }(); } In that case, we would check the constraints of the call operator which is non-viable. However, we would find a viable candidate: the conversion operator to function pointer, and use it to perform a surrogate call. These constraints were not checked because: * We never check the constraints of surrogate functions * The lambda conversion operator has non constraints. From the wording, it is not clear what the intent is but it seems reasonable to expect the constraints of the lambda conversion operator to be checked and it is consistent with GCC and MSVC. This patch also improve the diagnostics for constraint failure on surrogate calls. Fixes #63181 Reviewed By: #clang-language-wg, aaron.ballman Differential Revision: https://reviews.llvm.org/D154368
2023-07-20[clang][JumpDiagnostics] ignore non-asm goto target scopesNick Desaulniers1-0/+3
The current behavior of JumpScopeChecker::VerifyIndirectOrAsmJumps was to cross validate the scope of every jumping statement (goto, asm goto) against the scope of every label (even if the label was not even a possible target of the asm goto). When we have multiple asm goto's with unique targets, we could trigger false positive build errors complaining that labels that weren't even in the asm goto's label list could not be jumped to. Example: error: cannot jump from this asm goto statement to one of its possible targets asm goto(""::::foo); note: possible target of asm goto statement bar: ^ Fixes: https://github.com/ClangBuiltLinux/linux/issues/1886 Reviewed By: void, jyu2, rjmccall Differential Revision: https://reviews.llvm.org/D155342
2023-07-20[clang] adds `conceptDecl` as an ASTMatcherChristopher Di Bella2-0/+10
Closes #63934 Differential Revision: https://reviews.llvm.org/D155549
2023-07-20[WIP][-Wunsafe-buffer-usage] Handle lambda expressions within a method.Rashmi Mudduluru2-0/+39
Differential Revision: https://reviews.llvm.org/D150386
2023-07-20Reland "[CUDA][HIP] Use the same default language std as C++""Yaxun (Sam) Liu1-0/+3
Reland after fixing regression in lldb. Differential Revision: https://reviews.llvm.org/D155539
2023-07-20Revert "[CUDA][HIP] Use the same default language std as C++"Sylvestre Ledru1-3/+0
This reverts commit 2d1d07152bd26b001dedec3400b4b01d3bb11622.
2023-07-20[Clang] Implement P2741R3 - user-generated static_assert messagesCorentin Jabot1-0/+1
Reviewed By: #clang-language-wg, aaron.ballman Differential Revision: https://reviews.llvm.org/D154290
2023-07-20[X86] Add AVX-VNNI-INT16 instructions.Freddy Ye1-0/+4
For more details about these instructions, please refer to the latest ISE document: https://www.intel.com/content/www/us/en/develop/download/intel-architecture-instruction-set-extensions-programming-reference.html Reviewed By: pengfei, skan Differential Revision: https://reviews.llvm.org/D155145
2023-07-20[X86] Add SM4 instructions.Freddy Ye1-0/+3
For more details about these instructions, please refer to the latest ISE document: https://www.intel.com/content/www/us/en/develop/download/intel-architecture-instruction-set-extensions-programming-reference.html Reviewed By: pengfei, skan Differential Revision: https://reviews.llvm.org/D155148
2023-07-19[CUDA][HIP] Use the same default language std as C++Yaxun (Sam) Liu1-0/+3
Currently CUDA/HIP defines their own language standards in LanguageStandards.def but they are redundant. They are the same as stdc++14. The fact that CUDA/HIP uses c++* in option -std= indicates that they have the same language standards as C++. The CUDA/HIP specific language features are conveyed through language options, not language standards features. It makes sense to let CUDA/HIP uses the same default language standard as C++. Reviewed by: Siu Chi Chan, Artem Belevich Differential Revision: https://reviews.llvm.org/D155539 Fixes: SWDEV-407685
2023-07-20[X86] Add SM3 instructions.Freddy Ye1-0/+4
For more details about these instructions, please refer to the latest ISE document: https://www.intel.com/content/www/us/en/develop/download/intel-architecture-instruction-set-extensions-programming-reference.html Reviewed By: pengfei Differential Revision: https://reviews.llvm.org/D155147
2023-07-20[X86] Add SHA512 instructions.Freddy Ye1-0/+4
For more details about this instruction, please refer to the latest ISE document: https://www.intel.com/content/www/us/en/develop/download/intel-architecture-instruction-set-extensions-programming-reference.html Reviewed By: RKSimon, skan Differential Revision: https://reviews.llvm.org/D155146
2023-07-19[OpenMP][Docs] Add some things to the OpenMP supportJoseph Huber1-4/+4
This patch adds some information that we have support for in the OpenMP clang support page. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D155727
2023-07-19[clang][Docs] Added release note for D142609Shivam Gupta1-0/+3
2023-07-19[NFC] Add a blank line after directives in StandardCPlusPlusModules.rstChuanqi Xu1-0/+1
2023-07-19[NFC] [C++20] [Modules] Add a performance tip to the documentChuanqi Xu1-0/+89
It is a known problem that the compiler isn't efficiency when there are a lot of duplications in the modules to developers. But it may not be verbose to the (potential) new users of C++20 modules. It may be necessary to mention this in the document.
2023-07-19[Clang] Fix the location of default init expressionsCorentin Jabot1-0/+3
Default member initializations constructed from a parenthesized aggregate initialization should be constructed at the location of the left paren, to be consistent with brace initialization. Otherwise we get diagmostics and source_location in the wrong places. Fixes #63903 Reviewed By: aaron.ballman, #clang-language-wg Differential Revision: https://reviews.llvm.org/D155573
2023-07-19[NFC] [C++20] [Modules] Add C++20 modules related changes to Release NoteChuanqi Xu1-0/+41
Given LLVM17 is going to be branched, add some uncovered C++20 modules related changes to the Release Notes.
2023-07-19Revert "[NFC] [C++20] [Modules] Add C++20 modules related changes to Release ↵Chuanqi Xu1-43/+0
Note" This reverts commit 95bdd6eed6f3f4b8a95523516120068ac18eccff. The bot shows there are some grammar issues.
2023-07-19[NFC] [C++20] [Modules] Add C++20 modules related changes to Release NoteChuanqi Xu1-0/+43
Given LLVM17 is going to be branched, add some uncovered C++20 modules related changes to the Release Notes.
2023-07-18[clang-format][doc] Replace single back quotes with double onesOwen Pan1-25/+27