| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[clang] Replace X && isa<Y>(X) with isa_and_nonnull<Y>(X). NFC (#94987) This addresses a clang-tidy suggestion. | 2 年前 | |
[clang][NFC] Move Bounds Safety Sema code to SemaBoundsSafety.cpp (#99330) This patch adds a new SemaBoundsSafety.cpp source file and moves the existing CheckCountedByAttrOnField function and related helper functions and types from SemaDeclAttr.cpp into the new source file. The CheckCountedByAttrOnField function is now a method on the Sema class and now has doxygen comments. The goal behind this refactor is to clearly separate the -fbounds-safety Sema code from everything else. Although counted_by(_or_null) and sized_by(_or_null) attributes have a meaning outside of -fbounds-safety it seems reasonable to also have the Sema logic live in SemaBoundsSafety.cpp since the intention is that the attributes will have the same semantics (but not necessarily the same enforcement). As -fbounds-safety is upstreamed additional Sema checks will be added to SemaBoundsSafety.cpp. rdar://131777237 | 2 年前 | |
Fix lifetimebound for field access (#100197) Fixes: https://github.com/llvm/llvm-project/issues/81589 There is no way to switch this off without -Wno-dangling. | 1 年前 | |
[Clang] Extend lifetime bound analysis to support assignments for the built-in pointer type (#96475) The lifetime bound warning in Clang currently only considers initializations. This patch extends the warning to include assignments. - **Support for assignments of built-in pointer types**: this is done is by reusing the existing statement-local implementation. Clang now warns if the pointer is assigned to a temporary object that being destoryed at the end of the full assignment expression. With this patch, we will detect more cases under the on-by-default diagnostic -Wdangling. I have added a new category for this specific diagnostic so that people can temporarily disable it if their codebase is not yet clean. This is the first step to address #63310, focusing only on pointer types. Support for C++ assignment operators will come in a follow-up patch. Fixes #54492 | 2 年前 | |
[NFC][Clang] Improve const correctness for IdentifierInfo (#79365) The IdentifierInfo isn't typically modified. Use 'const' wherever possible. | 2 年前 | |
Update the file headers across all of the LLVM projects in the monorepo to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636 | 7 年前 | |
[C2y] Remove support for _Imaginary (#97436) WG14 N3274 removed _Imaginary from Annex G. Clang has never fully supported Annex G or _Imaginary, so removal is pretty trivial for us. Note, we are keeping _Imaginary as a keyword so that we get better diagnostic behavior. This is still conforming because _I makes it a reserved identifier, so it's not available for users to use as an identifier anyway. | 2 年前 | |
Update the file headers across all of the LLVM projects in the monorepo to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636 | 7 年前 | |
[HLSL] Remove hlsl::Resource (#98938) This was added in an effort to support resource types before we created the HLSLResource builtin type, but it isn't needed. | 2 年前 | |
[Clang][Sema] Skip RecordDecl when checking scope of declarations (#69432) In non C++ mode, struct definitions does not create a scope for declaration. | 2 年前 | |
[clang][Sema] Preserve the initializer of invalid VarDecls (#88645) Fixes https://github.com/clangd/clangd/issues/1821 | 2 年前 | |
[NFC] [Serialization] Avoid using DeclID directly as much as possible This patch tries to remove all the direct use of DeclID except the real low level reading and writing. All the use of DeclID is converted to the use of LocalDeclID or GlobalDeclID. This is helpful to increase the readability and type safety. | 2 年前 | |
[OpenCL] Add cl_khr_kernel_clock builtins (#91950) | 2 年前 | |
| 2 年前 | ||
[clang][Sema] Add missing scope flags to Scope::dumpImpl (#94529) There were a handlful of scope flags that were not handled in the dump function, which would then lead to an assert. | 2 年前 | |
[Coroutines] Clear FirstVLALoc in time Unlike other *Loc member in FunctionScopeInfo, we didn't clear FirstVLALoc in 'FunctionScopeInfo::Clear()'. Then it will be problematic for the following case: void bar(int n) { int array[n]; return; } coroutine foo(int n) { co_return; } When we parse foo, the FirstVLALoc is still valid, then the compiler will report vla in coroutine error in bar, which is super odd. After this patch, we can fix this. | 2 年前 | |
[Clang] make SVE types known to device targets too (#99446) For the purpose of preprocessing and declarations in header files, ensure clang accepts SVE types for both device and host targets. Co-authored-by: Sander De Smalen <sander.desmalen@arm.com> | 2 年前 | |
Fix -Wunused-variable in SemaAMDGPU.cpp in release build, NFC | 2 年前 | |
[APINotes] Support annotating C++ methods This adds support for adding Clang attributes to C++ methods declared within C++ records by using API Notes. For instance: Tags: - Name: IntWrapper Methods: - Name: getIncremented Availability: none This is the first instance of something within a C++ record being annotated with API Notes, so it adds the necessary infra to make a C++ record an "API Notes context". Notably this does not add support for nested C++ tags. That will be added in a follow-up patch. rdar://131387880 | 2 年前 | |
[clang][ARM] Fix warning for using VFP from interrupts. (#91870) [clang][ARM] Fix warning for using VFP from interrupts. This warning has three issues: - The interrupt attribute causes the function to return using an exception return instruction. This warning allows calls from one function with the interrupt attribute to another, and the diagnostic text suggests that not having the attribute on the callee is a problem. Actually making such a call will lead to a double exception return, which is unpredictable according to the ARM architecture manual section B9.1.1, "Restrictions on exception return instructions". Even on machines where an exception return from user/system mode is tolerated, if the callee's interrupt type is anything other than a supervisor call or secure monitor call, it will also return to a different address than a normal function would. For example, returning from an "IRQ" handler will return to lr - 4, which will generally result in calling the same function again. - The interrupt attribute currently does not cause caller-saved VFP registers to be saved and restored if they are used, so putting __attribute__((interrupt)) on a called function doesn't prevent it from clobbering VFP state. - It is part of the -Wextra diagnostic group and can't be individually disabled when using -Wextra, which also means the diagnostic text of this specific warning appears in the documentation of -Wextra. This change addresses all three issues by instead generating a warning for any interrupt handler where the vfp feature is enabled. The warning is also given its own diagnostic group. Closes #34876. [clang][ARM] Emit an error when an interrupt handler is called. Closes #95359. | 2 年前 | |
[clang] Split up SemaDeclAttr.cpp (#93966) This patch moves language- and target-specific functions out of SemaDeclAttr.cpp. As a consequence, SemaAVR, SemaM68k, SemaMSP430, SemaOpenCL, SemaSwift were created (but they are not the only languages and targets affected). Notable things are that Sema.h actually grew a bit, because of templated helpers that rely on Sema that I had to make available from outside of SemaDeclAttr.cpp. I also had to left CUDA-related in SemaDeclAttr.cpp, because it looks like HIP is building up on top of CUDA attributes. This is a follow-up to #93179 and continuation of efforts to split Sema up. Additional context can be found in #84184 and #92682. | 2 年前 | |
[clang][NFC] Move documentation of Sema functions into Sema.h This patch moves documentation of Sema functions from .cpp files to Sema.h when there was no documentation in the latter, or it can be trivially subsumed. More complicated cases when there's less trivial divergence between documentation attached to declaration and the one attached to implementation are left for a later PR that would require review. It appears that doxygen can find the documentation for a function defined out-of-line even if it's attached to an implementation, and not declaration. But other tools, e.g. clangd, are not as powerful. So this patch significantly improves autocompletion experience for (at least) clangd-based IDEs. | 2 年前 | |
[clang] Add the const to all default lists in SemaAttr.cpp, NFC Address the comment in https://github.com/llvm/llvm-project/pull/99622#issuecomment-2238800532 | 2 年前 | |
[clang] Diagnose use of deprecated template alias (#97619) Issue a warning diagnostic when a template alias with a deprecated attribute is used. | 1 年前 | |
[clang] Split up SemaDeclAttr.cpp (#93966) This patch moves language- and target-specific functions out of SemaDeclAttr.cpp. As a consequence, SemaAVR, SemaM68k, SemaMSP430, SemaOpenCL, SemaSwift were created (but they are not the only languages and targets affected). Notable things are that Sema.h actually grew a bit, because of templated helpers that rely on Sema that I had to make available from outside of SemaDeclAttr.cpp. I also had to left CUDA-related in SemaDeclAttr.cpp, because it looks like HIP is building up on top of CUDA attributes. This is a follow-up to #93179 and continuation of efforts to split Sema up. Additional context can be found in #84184 and #92682. | 2 年前 | |
[clang][NFC] Move PDiag into SemaBase (#93849) This patch moves PDiag into SemaBase, making it readily available everywhere across Sema without SemaRef, like the regular Diag. | 2 年前 | |
[clang][NFC] Move Bounds Safety Sema code to SemaBoundsSafety.cpp (#99330) This patch adds a new SemaBoundsSafety.cpp source file and moves the existing CheckCountedByAttrOnField function and related helper functions and types from SemaDeclAttr.cpp into the new source file. The CheckCountedByAttrOnField function is now a method on the Sema class and now has doxygen comments. The goal behind this refactor is to clearly separate the -fbounds-safety Sema code from everything else. Although counted_by(_or_null) and sized_by(_or_null) attributes have a meaning outside of -fbounds-safety it seems reasonable to also have the Sema logic live in SemaBoundsSafety.cpp since the intention is that the attributes will have the same semantics (but not necessarily the same enforcement). As -fbounds-safety is upstreamed additional Sema checks will be added to SemaBoundsSafety.cpp. rdar://131777237 | 2 年前 | |
[CUDA][HIP] warn incompatible redeclare (#77359) nvcc warns about the following code: void f(); __device__ void f() {} but clang does not since clang allows device function to overload host function. Users want clang to emit similar warning to help code to be compatible with nvcc. Since this may cause regression with existing code, the warning is off by default and can be enabled by -Wnvcc-compat. It won't cause warning in system headers, even with -Wnvcc-compat. | 2 年前 | |
Revert "Reapply "[Clang] Implement resolution for CWG1835 (#92957)" (#98547)" This reverts commit ce4aada6e2135e29839f672a6599db628b53295d and a follow-up patch 8ef26f1289bf069ccc0d6383f2f4c0116a1206c1. This new warning can not be fully suppressed by the -Wno-missing-dependent-template-keyword flag, this gives developer no time to do the cleanup in a large codebase, see https://github.com/llvm/llvm-project/pull/98547#issuecomment-2228250884 | 2 年前 | |
[clang][NFC] Move documentation of Sema functions into Sema.h This patch moves documentation of Sema functions from .cpp files to Sema.h when there was no documentation in the latter, or it can be trivially subsumed. More complicated cases when there's less trivial divergence between documentation attached to declaration and the one attached to implementation are left for a later PR that would require review. It appears that doxygen can find the documentation for a function defined out-of-line even if it's attached to an implementation, and not declaration. But other tools, e.g. clangd, are not as powerful. So this patch significantly improves autocompletion experience for (at least) clangd-based IDEs. | 2 年前 | |
[Clang] Fix definition of layout-compatible to ignore empty classes (#92103) Also changes the behaviour of __builtin_is_layout_compatible None of the historic nor the current definition of layout-compatible classes mention anything about base classes (other than implicitly through being standard-layout) and are defined in terms of members, not direct members. | 1 年前 | |
[Clang][AST] Move NamespaceDecl bits to DeclContext (#98567) Currently, NamespaceDecl has a member AnonOrFirstNamespaceAndFlags which stores a few pieces of data: - a bit indicating whether the namespace was declared inline, and - a bit indicating whether the namespace was declared as a _nested-namespace-definition_, and - a pointer a NamespaceDecl that either stores: - a pointer to the first declaration of that namespace if the declaration is no the first declaration, or - a pointer to the unnamed namespace that inhabits the namespace otherwise. Redeclarable already stores a pointer to the first declaration of an entity, so it's unnecessary to store this in NamespaceDecl. DeclContext has 8 bytes in which various bitfields can be stored for a declaration, so it's not necessary to store these in NamespaceDecl either. We only need to store a pointer to the unnamed namespace that inhabits the first declaration of a namespace. This patch moves the two bits currently stored in NamespaceDecl to DeclContext, and only stores a pointer to the unnamed namespace that inhabits a namespace in the first declaration of that namespace. Since getOriginalNamespace always returns the same NamespaceDecl as getFirstDecl, this function is removed to avoid confusion. | 2 年前 | |
release/19.x: [Clang] Consider outer instantiation scopes for constraint normalization Backport 227afac3 | 1 年前 | |
Update the file headers across all of the LLVM projects in the monorepo to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636 | 7 年前 | |
[Clang][Sema] Make UnresolvedLookupExprs in class scope explicit specializations instantiation dependent (#100392) A class member named by an expression in a member function that may instantiate to a static _or_ non-static member is represented by a UnresolvedLookupExpr in order to defer the implicit transformation to a class member access expression until instantiation. Since ASTContext::getDecltypeType only creates a DecltypeType that has a DependentDecltypeType as its canonical type when the operand is instantiation dependent, and since we do not transform types unless they are instantiation dependent, we need to mark the UnresolvedLookupExpr as instantiation dependent in order to correctly build a DecltypeType using the expression as its operand with a DependentDecltypeType canonical type. Fixes #99873. (cherry picked from commit 55ea36002bd364518c20b3ce282640c920697bf7) | 1 年前 | |
[C++20] [Modules] Treat in class defined member functions in language linkage as implicitly inline Close https://github.com/llvm/llvm-project/issues/108732 This looks liek an oversight mostly. (cherry picked from commit 7046a9fb05f65f4699a2e88abbcb7dad8a21db2d) | 1 年前 | |
[clang][FMV][AArch64] Improve streaming mode compatibility. * Allow arm-streaming if all the functions versions adhere to it. * Allow arm-streaming-compatible if all the functions versions adhere to it. * Allow arm-locally-streaming regardless of the other functions versions. When the caller needs to toggle the streaming mode all the function versions of the callee must adhere to the same mode, otherwise the call will yield a runtime error. Imagine the versions of the callee live in separate TUs. The version that is visible to the caller will determine the calling convention used when generating code for the callsite. Therefore we cannot support mixing streaming with non-streaming function versions. Imagine TU1 has a streaming caller and calls foo._sme which is streaming-compatible. The codegen for the callsite will not switch off the streaming mode. Then in TU2 we have a version which is non-streaming and could potentially be called in streaming mode. Similarly if the caller is non-streaming and the called version is streaming-compatible the codegen for the callsite will not switch on the streaming mode, but other versions may be streaming. | 1 年前 | |
Fix std::initializer_list recognition if it's exported out of a module - Add implementation - Add a regression test - Add release notes | 1 年前 | |
[clang][NFC] Move PDiag into SemaBase (#93849) This patch moves PDiag into SemaBase, making it readily available everywhere across Sema without SemaRef, like the regular Diag. | 2 年前 | |
[Clang][OpenMP] Add interchange directive (#93022) Add the interchange directive which will be introduced in the upcoming OpenMP 6.0 specification. A preview has been published in [Technical Report 12](https://www.openmp.org/wp-content/uploads/openmp-TR12.pdf). | 2 年前 | |
[Clang] Remove the special-casing for RequiresExprBodyDecl in BuildResolvedCallExpr() after fd87d765c0 (#111277) The special-casing for RequiresExprBodyDecl caused a regression, as reported in #110785. The original fix for #84020 has been superseded by fd87d765c0, which establishes a DependentScopeDeclRefExpr instead of a CXXDependentScopeMemberExpr for the case in issue. So the spurious diagnostic in #84020 would no longer occur. This also merges the test for #84020 together with that for #110785 into clang/test/SemaTemplate/instantiate-requires-expr.cpp. No release note because I think this merits a backport. Fixes #110785 (cherry picked from commit 8c1547055eaf65003f3e6fd024195f4926ff2356) | 1 年前 | |
| 1 年前 | ||
[Clang][Sema] Make UnresolvedLookupExprs in class scope explicit specializations instantiation dependent (#100392) A class member named by an expression in a member function that may instantiate to a static _or_ non-static member is represented by a UnresolvedLookupExpr in order to defer the implicit transformation to a class member access expression until instantiation. Since ASTContext::getDecltypeType only creates a DecltypeType that has a DependentDecltypeType as its canonical type when the operand is instantiation dependent, and since we do not transform types unless they are instantiation dependent, we need to mark the UnresolvedLookupExpr as instantiation dependent in order to correctly build a DecltypeType using the expression as its operand with a DependentDecltypeType canonical type. Fixes #99873. (cherry picked from commit 55ea36002bd364518c20b3ce282640c920697bf7) | 1 年前 | |
[clang][NFC] Move more things out of SemaChecking.cpp (#96641) This patch moves some functions out of SemaChecking.cpp. ObjC-, HLSL-, OpenCL-related functions are affected. This patch continues the effort of splitting Sema into parts. Additional context can be found in https://github.com/llvm/llvm-project/pull/84184 and https://github.com/llvm/llvm-project/pull/92682. | 2 年前 | |
Do not suggest taking the address of a const pointer to get void* It's more likely the user needs a const cast, but probably not sure enough that we should suggest that either - so err on the side of caution and offer no suggestion. Fixes pr58958 Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D138426 | 3 年前 | |
[HLSL] Split out resource class data from resource attribute (#98419) The ability to spell out and specify the resource class is necessary for testing various resource binding behaviors. Though it is not intended for users to use this in customized HLSL source code, the ability to specify the resource class via an attribute is immensely helpful for writing thorough tests. This PR introduces a new attribute, hlsl::resource_attribute, that can only be applied on structs. This attribute only has 1 required argument, and must be one of: SRV UAV CBuffer Sampler By applying this attribute to a struct, the struct will have the HLSLResourceClassAttr attribute attached to it in the AST representation, which provides information on the type of resource class the struct is meant to be. The resource class data that was originally contained within the HLSLResourceAttr attribute has been removed in favor of this new attribute, and so certain ast-dump tests need to be modified so that the same information can be represented via 2 attributes instead of one. Fixes #98193 --------- Co-authored-by: Damyan Pepper <damyanp@microsoft.com> | 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] Fix crash when #embed used in a compound literal (#102304) Fixes https://github.com/llvm/llvm-project/issues/102248 (cherry picked from commit 3606d69d0b57dc1d23a4362e376e7ad27f650c27) | 1 年前 | |
| 1 年前 | ||
| 1 年前 | ||
[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] Split up SemaDeclAttr.cpp (#93966) This patch moves language- and target-specific functions out of SemaDeclAttr.cpp. As a consequence, SemaAVR, SemaM68k, SemaMSP430, SemaOpenCL, SemaSwift were created (but they are not the only languages and targets affected). Notable things are that Sema.h actually grew a bit, because of templated helpers that rely on Sema that I had to make available from outside of SemaDeclAttr.cpp. I also had to left CUDA-related in SemaDeclAttr.cpp, because it looks like HIP is building up on top of CUDA attributes. This is a follow-up to #93179 and continuation of efforts to split Sema up. Additional context can be found in #84184 and #92682. | 2 年前 | |
[clang] Split up SemaDeclAttr.cpp (#93966) This patch moves language- and target-specific functions out of SemaDeclAttr.cpp. As a consequence, SemaAVR, SemaM68k, SemaMSP430, SemaOpenCL, SemaSwift were created (but they are not the only languages and targets affected). Notable things are that Sema.h actually grew a bit, because of templated helpers that rely on Sema that I had to make available from outside of SemaDeclAttr.cpp. I also had to left CUDA-related in SemaDeclAttr.cpp, because it looks like HIP is building up on top of CUDA attributes. This is a follow-up to #93179 and continuation of efforts to split Sema up. Additional context can be found in #84184 and #92682. | 2 年前 | |
[clang] Split up SemaDeclAttr.cpp (#93966) This patch moves language- and target-specific functions out of SemaDeclAttr.cpp. As a consequence, SemaAVR, SemaM68k, SemaMSP430, SemaOpenCL, SemaSwift were created (but they are not the only languages and targets affected). Notable things are that Sema.h actually grew a bit, because of templated helpers that rely on Sema that I had to make available from outside of SemaDeclAttr.cpp. I also had to left CUDA-related in SemaDeclAttr.cpp, because it looks like HIP is building up on top of CUDA attributes. This is a follow-up to #93179 and continuation of efforts to split Sema up. Additional context can be found in #84184 and #92682. | 2 年前 | |
[HLSL] Implement export keyword (#96823) Implements export keyword in HLSL. There are two ways the export keyword can be used: 1. On individual function declarations export void f() {} 2. On a group of function declaration: export { void f1(); void f2() {} } Functions declared with the export keyword have external linkage. The implementation does not include validation of when a function can or cannot be exported, such as when it has resource argument or semantic annotations. That will be covered by llvm/llvm-project#93330. Currently all function declarations in global or named namespaces have external linkage by default so there are no specific code changes required right now to make sure exported function have external linkage as well. That will change as part of llvm/llvm-project#92071. Any additional changes to make sure exported functions still have external linkage will be done as part of this work item. Fixes #92812 | 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][NFC] Move more things out of SemaChecking.cpp (#96641) This patch moves some functions out of SemaChecking.cpp. ObjC-, HLSL-, OpenCL-related functions are affected. This patch continues the effort of splitting Sema into parts. Additional context can be found in https://github.com/llvm/llvm-project/pull/84184 and https://github.com/llvm/llvm-project/pull/92682. | 2 年前 | |
[clang] Introduce SemaObjC (#89086) This is continuation of efforts to split Sema up, following the example of OpenMP, OpenACC, etc. Context can be found in https://github.com/llvm/llvm-project/pull/82217 and https://github.com/llvm/llvm-project/pull/84184. I split formatting changes into a separate commit to help reviewing the actual changes. | 2 年前 | |
[Sema] Use llvm::erase_if (NFC) (#96068) While I am at it, I'm constructing SmallVector directly from ArrayRef. | 2 年前 | |
[clang][NFC] Move more things out of SemaChecking.cpp (#96641) This patch moves some functions out of SemaChecking.cpp. ObjC-, HLSL-, OpenCL-related functions are affected. This patch continues the effort of splitting Sema into parts. Additional context can be found in https://github.com/llvm/llvm-project/pull/84184 and https://github.com/llvm/llvm-project/pull/92682. | 2 年前 | |
[Clang][Sema] Make UnresolvedLookupExprs in class scope explicit specializations instantiation dependent (#100392) A class member named by an expression in a member function that may instantiate to a static _or_ non-static member is represented by a UnresolvedLookupExpr in order to defer the implicit transformation to a class member access expression until instantiation. Since ASTContext::getDecltypeType only creates a DecltypeType that has a DependentDecltypeType as its canonical type when the operand is instantiation dependent, and since we do not transform types unless they are instantiation dependent, we need to mark the UnresolvedLookupExpr as instantiation dependent in order to correctly build a DecltypeType using the expression as its operand with a DependentDecltypeType canonical type. Fixes #99873. (cherry picked from commit 55ea36002bd364518c20b3ce282640c920697bf7) | 1 年前 | |
[Clang][Sema] Make UnresolvedLookupExprs in class scope explicit specializations instantiation dependent (#100392) A class member named by an expression in a member function that may instantiate to a static _or_ non-static member is represented by a UnresolvedLookupExpr in order to defer the implicit transformation to a class member access expression until instantiation. Since ASTContext::getDecltypeType only creates a DecltypeType that has a DependentDecltypeType as its canonical type when the operand is instantiation dependent, and since we do not transform types unless they are instantiation dependent, we need to mark the UnresolvedLookupExpr as instantiation dependent in order to correctly build a DecltypeType using the expression as its operand with a DependentDecltypeType canonical type. Fixes #99873. (cherry picked from commit 55ea36002bd364518c20b3ce282640c920697bf7) | 1 年前 | |
[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] Introduce SemaPseudoObject (#92646) This patch moves Sema functions that handle pseudo-objects into the new SemaPseudoObject class. This continues previous efforts to split Sema up. Additional context can be found in #84184. As usual, in order to help reviewing this, formatting changes are split into a separate commit. | 2 年前 | |
[RISCV] Remove experimental for bf16 extensions (#97996) They are already ratified now. | 2 年前 | |
[clang] Split up SemaDeclAttr.cpp (#93966) This patch moves language- and target-specific functions out of SemaDeclAttr.cpp. As a consequence, SemaAVR, SemaM68k, SemaMSP430, SemaOpenCL, SemaSwift were created (but they are not the only languages and targets affected). Notable things are that Sema.h actually grew a bit, because of templated helpers that rely on Sema that I had to make available from outside of SemaDeclAttr.cpp. I also had to left CUDA-related in SemaDeclAttr.cpp, because it looks like HIP is building up on top of CUDA attributes. This is a follow-up to #93179 and continuation of efforts to split Sema up. Additional context can be found in #84184 and #92682. | 2 年前 | |
[clang][NFC] Move documentation of Sema functions into Sema.h This patch moves documentation of Sema functions from .cpp files to Sema.h when there was no documentation in the latter, or it can be trivially subsumed. More complicated cases when there's less trivial divergence between documentation attached to declaration and the one attached to implementation are left for a later PR that would require review. It appears that doxygen can find the documentation for a function defined out-of-line even if it's attached to an implementation, and not declaration. But other tools, e.g. clangd, are not as powerful. So this patch significantly improves autocompletion experience for (at least) clangd-based IDEs. | 2 年前 | |
Revert "Reapply "[Clang] Implement resolution for CWG1835 (#92957)" (#98547)" This reverts commit ce4aada6e2135e29839f672a6599db628b53295d and a follow-up patch 8ef26f1289bf069ccc0d6383f2f4c0116a1206c1. This new warning can not be fully suppressed by the -Wno-missing-dependent-template-keyword flag, this gives developer no time to do the cleanup in a large codebase, see https://github.com/llvm/llvm-project/pull/98547#issuecomment-2228250884 | 2 年前 | |
[HLSL] add loop unroll (#93879) spec: https://github.com/microsoft/hlsl-specs/pull/263 - Attr.td - Define the HLSL loop attribute hints (unroll and loop) - AttrDocs.td - Add documentation for unroll and loop - CGLoopInfo.cpp - Add codegen for HLSL unroll that maps to clang unroll expectations - ParseStmt.cpp - For statements if HLSL define DeclSpecAttrs via MaybeParseMicrosoftAttributes - SemaStmtAttr.cpp - Add the HLSL loop unroll handeling resolves #70114 dxc examples: - for loop: https://hlsl.godbolt.org/z/8EK6Pa139 - while loop: https://hlsl.godbolt.org/z/ebr5MvEcK - do while: https://hlsl.godbolt.org/z/be8cedoTs Documentation:  | 2 年前 | |
[clang] Split up SemaDeclAttr.cpp (#93966) This patch moves language- and target-specific functions out of SemaDeclAttr.cpp. As a consequence, SemaAVR, SemaM68k, SemaMSP430, SemaOpenCL, SemaSwift were created (but they are not the only languages and targets affected). Notable things are that Sema.h actually grew a bit, because of templated helpers that rely on Sema that I had to make available from outside of SemaDeclAttr.cpp. I also had to left CUDA-related in SemaDeclAttr.cpp, because it looks like HIP is building up on top of CUDA attributes. This is a follow-up to #93179 and continuation of efforts to split Sema up. Additional context can be found in #84184 and #92682. | 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][Sema] Make UnresolvedLookupExprs in class scope explicit specializations instantiation dependent (#100392) A class member named by an expression in a member function that may instantiate to a static _or_ non-static member is represented by a UnresolvedLookupExpr in order to defer the implicit transformation to a class member access expression until instantiation. Since ASTContext::getDecltypeType only creates a DecltypeType that has a DependentDecltypeType as its canonical type when the operand is instantiation dependent, and since we do not transform types unless they are instantiation dependent, we need to mark the UnresolvedLookupExpr as instantiation dependent in order to correctly build a DecltypeType using the expression as its operand with a DependentDecltypeType canonical type. Fixes #99873. (cherry picked from commit 55ea36002bd364518c20b3ce282640c920697bf7) | 1 年前 | |
[clang][NFC] Move documentation of Sema functions into Sema.h This patch moves documentation of Sema functions from .cpp files to Sema.h when there was no documentation in the latter, or it can be trivially subsumed. More complicated cases when there's less trivial divergence between documentation attached to declaration and the one attached to implementation are left for a later PR that would require review. It appears that doxygen can find the documentation for a function defined out-of-line even if it's attached to an implementation, and not declaration. But other tools, e.g. clangd, are not as powerful. So this patch significantly improves autocompletion experience for (at least) clangd-based IDEs. | 2 年前 | |
[Clang] Instantiate Typedefs referenced by type alias deduction guides (#111804) TypedefNameDecl referenced by a synthesized CTAD guide for type aliases was not transformed previously, resulting in a substitution failure in BuildDeductionGuideForTypeAlias() when substituting into the right-hand-side deduction guide. This patch fixes it in the way we have been doing since https://reviews.llvm.org/D80743. We transform all the function parameters, parenting referenced TypedefNameDecls with the CXXDeductionGuideDecl. Then we instantiate these declarations in FindInstantiatedDecl() as we build up the eventual deduction guide, using the mechanism introduced in D80743 Fixes #111508 (cherry picked from commit 0bc02b999a9686ba240b7a68d3f1cbbf037d2170) | 1 年前 | |
[Clang][Sema] Revisit the fix for the lambda within a type alias template decl (#89934) In the last patch #82310, we used template depths to tell if such alias decls contain lambdas, which is wrong because the lambda can also appear as a part of the default argument, and that would make getTemplateInstantiationArgs provide extra template arguments in undesired contexts. This leads to issue #89853. Moreover, our approach for https://github.com/llvm/llvm-project/issues/82104 was sadly wrong. We tried to teach DeduceReturnType to consider alias template arguments; however, giving these arguments in the context where they should have been substituted in a TransformCallExpr call is never correct. This patch addresses such problems by using a RecursiveASTVisitor to check if the lambda is contained by an alias Decl, as well as twiddling the lambda dependencies - we should also build a dependent lambda expression if the surrounding alias template arguments were dependent. Fixes #89853 Fixes #102760 Fixes #105885 (cherry picked from commit b412ec5d3924c7570c2c96106f95a92403a4e09b) | 1 年前 | |
Reapply "Add source file name for template instantiations in -ftime-trace" (#99757) Reverts https://github.com/llvm/llvm-project/pull/99731 Remove accidentally added temporary file. Also, fix the uninitialized read of line number. | 1 年前 | |
Reapply [Clang][C++26] Implement "Ordering of constraints involving fold expressions (#99022) Implement https://isocpp.org/files/papers/P2963R3.pdf | 2 年前 | |
| 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] Split up SemaDeclAttr.cpp (#93966) This patch moves language- and target-specific functions out of SemaDeclAttr.cpp. As a consequence, SemaAVR, SemaM68k, SemaMSP430, SemaOpenCL, SemaSwift were created (but they are not the only languages and targets affected). Notable things are that Sema.h actually grew a bit, because of templated helpers that rely on Sema that I had to make available from outside of SemaDeclAttr.cpp. I also had to left CUDA-related in SemaDeclAttr.cpp, because it looks like HIP is building up on top of CUDA attributes. This is a follow-up to #93179 and continuation of efforts to split Sema up. Additional context can be found in #84184 and #92682. | 2 年前 | |
[Clang] Remove the special-casing for RequiresExprBodyDecl in BuildResolvedCallExpr() after fd87d765c0 (#111277) The special-casing for RequiresExprBodyDecl caused a regression, as reported in #110785. The original fix for #84020 has been superseded by fd87d765c0, which establishes a DependentScopeDeclRefExpr instead of a CXXDependentScopeMemberExpr for the case in issue. So the spurious diagnostic in #84020 would no longer occur. This also merges the test for #84020 together with that for #110785 into clang/test/SemaTemplate/instantiate-requires-expr.cpp. No release note because I think this merits a backport. Fixes #110785 (cherry picked from commit 8c1547055eaf65003f3e6fd024195f4926ff2356) | 1 年前 | |
[clang] Implement sugared substitution changes to infrastructure Implements the changes required to perform substitution with non-canonical template arguments, and to 'finalize' them by not placing 'Subst' nodes. A finalized substitution means we won't resugar them later, because these templates themselves were eagerly substituted with the intended arguments at the point of use. We may still resugar other templates used within those, though. This patch does not actually implement any uses of this functionality, those will be added in subsequent patches, so expect no changes to existing tests. Signed-off-by: Matheus Izvekov <mizvekov@gmail.com> Differential Revision: https://reviews.llvm.org/D134604 | 3 年前 | |
[NFC][clang] Fix static analyzer concerns TypeLocBuilder frees resources in the destructor but doesn't have user-written copy c'tor or assignment operator, so copying it using default ones can cause double free. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D156222 | 2 年前 | |
Implement CWG2631 Implement https://cplusplus.github.io/CWG/issues/2631.html. Immediate calls in default arguments and defaults members are not evaluated. Instead, we evaluate them when constructing a CXXDefaultArgExpr/BuildCXXDefaultInitExpr. The immediate calls are executed by doing a transform on the initializing expression. Note that lambdas are not considering subexpressions so we do not need to transform them. As a result of this patch, unused default member initializers are not considered odr-used, and errors about members binding to local variables in an outer scope only surface at the point where a constructor is defined. Reviewed By: aaron.ballman, #clang-language-wg, rupprecht Differential Revision: https://reviews.llvm.org/D136554 | 3 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 2 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 7 年前 | ||
| 2 年前 | ||
| 7 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 7 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 3 年前 |