| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[clang] Use StringRef::{starts,ends}_with (NFC) (#75149) This patch replaces uses of StringRef::{starts,ends}with with StringRef::{starts,ends}_with for consistency with std::{string,string_view}::{starts,ends}_with in C++20. I'm planning to deprecate and eventually remove StringRef::{starts,ends}with. | 2 年前 | |
[clang] Add #include <optional> (NFC) This patch adds #include <optional> to those files containing llvm::Optional<...> or Optional<...>. I'll post a separate patch to actually replace llvm::Optional with std::optional. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716 | 3 年前 | |
[clang] Revise IDE folder structure (#89743) Update the folder titles for targets in the monorepository that have not seen taken care of for some time. These are the folders that targets are organized in Visual Studio and XCode ( set_property(TARGET <target> PROPERTY FOLDER "<title>")) when using the respective CMake's IDE generator. * Ensure that every target is in a folder * Use a folder hierarchy with each LLVM subproject as a top-level folder * Use consistent folder names between subprojects * When using target-creating functions from AddLLVM.cmake, automatically deduce the folder. This reduces the number of set_property/set_target_property, but are still necessary when add_custom_target, add_executable, add_library, etc. are used. A LLVM_SUBPROJECT_TITLE definition is used for that in each subproject's root CMakeLists.txt. | 2 年前 | |
[clang] Optimize castToDeclContext for 2% improvement in build times (#76825) Optimize castToDeclContext for 2% improvement in build times castToDeclContext is a heavily used function, and as such, it needs to be kept as slim as feasible to preserve as much performance as possible. To this end, it was observed that the function was generating suboptimal assembly code, and putting the most common execution path in the longest sequence of instructions. This patch addresses this by guiding the compiler towards generating a lookup table of offsets, which can be used to perform an addition on the pointer. This results in a 1-2% improvement on debug builds (and a negligible improvement on release). To achieve this, the switch was simplified to flatten the if statements in the default branch. In order to make the values of the switch more compact, encouraging LLVM to generate a look-up table instead of a jump table, the AST TableGen generator was modified so it can take order priority based on class inheritance. This combination allowed for a more optimal generation of the function. Of note, 2 other functions with an equivalent structure also needed to be modified. Fixes #76824 | 2 年前 | |
[llvm][tblgen] Add Source Filename for emitSourceFileHeader (#65744) I think this is very helpful for reading generated .inc files. | 2 年前 | |
[clang] Avoid 'raw_string_ostream::str' (NFC) Since raw_string_ostream doesn't own the string buffer, it is desirable (in terms of memory safety) for users to directly reference the string buffer rather than use raw_string_ostream::str(). Work towards TODO item to remove raw_string_ostream::str(). | 2 年前 | |
[clang][Builtins] Parse clang extended vectors types. (#83584) Clang extended vector types are mangled as follows: '_ExtVector<' <lanes> ',' <scalar type> '>' This is used to defetmine the builtins signature for builtins that use parameters defined as typedef <scalar type> ext_vector_type_<lanes>_<scalar type> __attribute__((ext_vector_type(<lanes>))) or template <unsigned N, class T> using _ExtVector __attribute__((ext_vector_type(N))) = T; For example: typedef double ext_vector_type_4_double __attribute__((ext_vector_type(4))) | 2 年前 | |
[Clang][Comments] Support for parsing headers in Doxygen \par commands (#91100) ### Background Doxygen's \par command ([link](https://www.doxygen.nl/manual/commands.html#cmdpar)) has an optional argument, which denotes the header of the paragraph started by a given \par command. In short, the paragraph command can be used with a heading, or without one. The code block below shows both forms and how the current version of LLVM/Clang parses this code: `` $ cat test.cpp /// \par User defined paragraph: /// Contents of the paragraph. /// /// \par /// New paragraph under the same heading. /// /// \par /// A second paragraph. class A {}; $ clang++ -cc1 -ast-dump -fcolor-diagnostics -std=c++20 test.cpp -CXXRecordDecl 0x1530f3a78 <test.cpp:11:1, col:10> col:7 class A definition |-FullComment 0x1530fea38 <line:2:4, line:9:23> | |-ParagraphComment 0x1530fe7e0 <line:2:4> | | -TextComment 0x1530fe7b8 <col:4> Text=" " | |-BlockCommandComment 0x1530fe800 <col:5, line:3:30> Name="par" | | -ParagraphComment 0x1530fe878 <line:2:9, line:3:30> | | |-TextComment 0x1530fe828 <line:2:9, col:32> Text=" User defined paragraph:" | | -TextComment 0x1530fe848 <line:3:4, col:30> Text=" Contents of the paragraph." | |-ParagraphComment 0x1530fe8c0 <line:5:4> | | -TextComment 0x1530fe898 <col:4> Text=" " | |-BlockCommandComment 0x1530fe8e0 <col:5, line:6:41> Name="par" | | -ParagraphComment 0x1530fe930 <col:4, col:41> | | -TextComment 0x1530fe908 <col:4, col:41> Text=" New paragraph under the same heading." | |-ParagraphComment 0x1530fe978 <line:8:4> | | -TextComment 0x1530fe950 <col:4> Text=" " | -BlockCommandComment 0x1530fe998 <col:5, line:9:23> Name="par" | -ParagraphComment 0x1530fe9e8 <col:4, col:23> | -TextComment 0x1530fe9c0 <col:4, col:23> Text=" A second paragraph." -CXXRecordDecl 0x1530f3bb0 <line:11:1, col:7> col:7 implicit class A ` As we can see above, the optional paragraph heading ("User defined paragraph") is not an argument of the \par BlockCommandComment, but instead a child TextComment. For documentation generators like [hdoc](https://hdoc.io/), it would be ideal if we could parse Doxygen documentation comments with these semantics in mind. Currently that's not possible. ### Change This change parses \par command according to how Doxygen parses them, making an optional header available as a an argument if it is present. In addition: - AST unit tests are defined to test this functionality when an argument is present, isn't present, with additional spacing, etc. - TableGen is updated with an IsParCommand to support this functionality - lit` tests are updated where needed | 2 年前 | |
[clang] Use SmallString::operator std::string (NFC) | 2 年前 | |
[llvm][tblgen] Add Source Filename for emitSourceFileHeader (#65744) I think this is very helpful for reading generated .inc files. | 2 年前 | |
Use scope qualifiers in Clang's tblgen backends to get useful redeclaration checking. NFC. llvm-svn: 373406 | 6 年前 | |
[clang] Diagnose problematic diagnostic messages (#93229) Clang has some unwritten rules about diagnostic wording regarding things like punctuation and capitalization. This patch documents those rules and adds some tablegen support for checking diagnostics follow the rules. Specifically: tablegen now checks that a diagnostic does not start with a capital letter or end with punctuation, except for the usual exceptions like proper nouns or ending with a question. Now that the code base is clean of such issues, the diagnostics are emitted as an error rather than a warning to ensure that failure to follow these rules is either addressed by an author, or a new exception is added to the checking logic. | 2 年前 | |
[clang][Interp][NFC] Add [[nodiscard]] attribute to emit functions | 2 年前 | |
[llvm][tblgen] Add Source Filename for emitSourceFileHeader (#65744) I think this is very helpful for reading generated .inc files. | 2 年前 | |
Reland "[flang][clang] Add Visibility specific help text for options (#81869)" This reverts commit 67d20412b448533c77f54ac7a1e5d0775d273729. This includes fixes for clanginstallapi. | 2 年前 | |
Fix duplicate word typos; NFC This revision fixes typos where there are 2 consecutive words which are duplicated. There should be no code changes in this revision (only changes to comments and docs). Do let me know if there are any undesirable changes in this revision. Thanks. | 3 年前 | |
[llvm][tblgen] Add Source Filename for emitSourceFileHeader (#65744) I think this is very helpful for reading generated .inc files. | 2 年前 | |
[llvm][tblgen] Add Source Filename for emitSourceFileHeader (#65744) I think this is very helpful for reading generated .inc files. | 2 年前 | |
[clang] Introduce target-specific Sema components (#93179) This patch introduces SemaAMDGPU, SemaARM, SemaBPF, SemaHexagon, SemaLoongArch, SemaMIPS, SemaNVPTX, SemaPPC, SemaSystemZ, SemaWasm. This continues previous efforts to split Sema up. Additional context can be found in #84184 and #92682. I decided to bundle target-specific components together because of their low impact on Sema. That said, their impact on SemaChecking.cpp is far from low, and I consider it a success. Somewhat accidentally, I also moved Wasm- and AMDGPU-specific function from SemaDeclAttr.cpp, because they were exposed in Sema. That went well, and I consider it a success, too. I'd like to move the rest of static target-specific functions out of SemaDeclAttr.cpp like we're doing with built-ins in SemaChecking.cpp . | 2 年前 | |
[Clang][NEON] Add neon target guard to intrinsics (#99870) This patch improves reported error when NEON intrinsics are used without neon target feature. | 2 年前 | |
[RISCV] Remove unused RequiredFeatures argument from RVVIntrinsic constructor. NFC (#98067) Looks like the usage was removed by 7a5cb15ea6facd82756adafae76d60f36a0b60fd | 2 年前 | |
[Clang][SveEmitter] Split up TargetGuard into SVE and SME component. (#96482) One reason to want to split this up is to simplify the code added in #93802, where it checks the SME streaming-mode requirements for a builtin by checking for the absence of SVE. If the target guards are separate, we can generate a table and make the Sema code to verify the runtime mode simpler. Another reason is to avoid an issue with a check in SveEmitter.cpp where it ensures that the 'VerifyRuntimeMode' is set correctly for functions that have both SVE and SME target guards: if (!Def->isFlagSet(VerifyRuntimeMode) && Def->getGuard().contains("sve") && Def->getGuard().contains("sme")) llvm_unreachable("Missing VerifyRuntimeMode flag"); However, if we ever add a new feature with "sme" in the name, even though it is unrelated to FEAT_SME, then this code no longer works. Note that the arm_sve.td and arm_sme.td files could do with a bit of restructuring after this but it seems better to follow that up in an NFC patch. | 2 年前 | |
Reland "Rework the printing of attributes (#87281)" Original commit message: " Commit https://github.com/llvm/llvm-project/commit/46f3ade introduced a notion of printing the attributes on the left to improve the printing of attributes attached to variable declarations. The intent was to produce more GCC compatible code because clang tends to print the attributes on the right hand side which is not accepted by gcc. This approach has increased the complexity in tablegen and the attrubutes themselves as now the are supposed to know where they could appear. That lead to mishandling of the override keyword which is modelled as an attribute in clang. This patch takes an inspiration from the existing approach and tries to keep the position of the attributes as they were written. To do so we use simpler heuristic which checks if the source locations of the attribute precedes the declaration. If so, it is considered to be printed before the declaration. Fixes https://github.com/llvm/llvm-project/issues/87151 " The reason for the bot breakage is that attributes coming from ApiNotes are not marked implicit even though they do not have source locations. This caused an assert to trigger. This patch forces attributes with no source location information to be printed on the left. That change is consistent to the overall intent of the change to increase the chances for attributes to compile across toolchains and at the same time the produced code to be as close as possible to the one written by the user. | 2 年前 | |
Reland "Rework the printing of attributes (#87281)" Original commit message: " Commit https://github.com/llvm/llvm-project/commit/46f3ade introduced a notion of printing the attributes on the left to improve the printing of attributes attached to variable declarations. The intent was to produce more GCC compatible code because clang tends to print the attributes on the right hand side which is not accepted by gcc. This approach has increased the complexity in tablegen and the attrubutes themselves as now the are supposed to know where they could appear. That lead to mishandling of the override keyword which is modelled as an attribute in clang. This patch takes an inspiration from the existing approach and tries to keep the position of the attributes as they were written. To do so we use simpler heuristic which checks if the source locations of the attribute precedes the declaration. If so, it is considered to be printed before the declaration. Fixes https://github.com/llvm/llvm-project/issues/87151 " The reason for the bot breakage is that attributes coming from ApiNotes are not marked implicit even though they do not have source locations. This caused an assert to trigger. This patch forces attributes with no source location information to be printed on the left. That change is consistent to the overall intent of the change to increase the chances for attributes to compile across toolchains and at the same time the produced code to be as close as possible to the one written by the user. | 2 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 2 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 6 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 |