[clang] [HLSL] Implement array temporary support (PR #79382)

2024-04-02 Thread Haojian Wu via cfe-commits
@@ -0,0 +1,76 @@ +; ModuleID = '/Users/cbieneman/dev/llvm-project/clang/test/SemaHLSL/ArrayTemporary.hlsl' hokein wrote: IIUC, this file was added unintentionally, sent out https://github.com/llvm/llvm-project/pull/87346 https://github.com/llvm/llvm-project/pu

[clang] [clang] CTAD: Track template template type parameters that referenced in (PR #85405)

2024-04-02 Thread Haojian Wu via cfe-commits
hokein wrote: Ilya is being out currently, I'm going to proceed with it (and happy to address any post comments). https://github.com/llvm/llvm-project/pull/85405 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [clang] CTAD: Track template template type parameters that referenced in (PR #85405)

2024-04-02 Thread Haojian Wu via cfe-commits
https://github.com/hokein closed https://github.com/llvm/llvm-project/pull/85405 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Update FormatToken::isSimpleTypeSpecifier() (PR #80241)

2024-02-12 Thread Haojian Wu via cfe-commits
hokein wrote: This change introduced an asan crash when running the `QualifierFixerTest.IsQualifierType` unittest: ``` $ tools/clang/unittests/Format/FormatTests --gtest_filter="QualifierFixerTest.IsQualifierType" Note: Google Test filter = QualifierFixerTest.IsQualifierType [==] Runni

[clang] 50ed98f - Revert "Reland "[clang-format] Update FormatToken::isSimpleTypeSpecifier() (#80241)""

2024-02-12 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2024-02-12T15:24:27+01:00 New Revision: 50ed98f1cf2516c59de0351fa683639c937782ea URL: https://github.com/llvm/llvm-project/commit/50ed98f1cf2516c59de0351fa683639c937782ea DIFF: https://github.com/llvm/llvm-project/commit/50ed98f1cf2516c59de0351fa683639c937782ea.diff LO

[clang] [clang-format] Update FormatToken::isSimpleTypeSpecifier() (PR #80241)

2024-02-12 Thread Haojian Wu via cfe-commits
hokein wrote: I have reverted it in 50ed98f1cf2516c59de0351fa683639c937782ea, feel free to reland it with a fix. https://github.com/llvm/llvm-project/pull/80241 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] c9afeaa - [format] Remove an unused variable.

2024-02-12 Thread Haojian Wu via cfe-commits
Author: Haojian Wu Date: 2024-02-12T16:19:42+01:00 New Revision: c9afeaa6434a61b3b3a57c8eda6d2cfb25ab675b URL: https://github.com/llvm/llvm-project/commit/c9afeaa6434a61b3b3a57c8eda6d2cfb25ab675b DIFF: https://github.com/llvm/llvm-project/commit/c9afeaa6434a61b3b3a57c8eda6d2cfb25ab675b.diff LO

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-06 Thread Haojian Wu via cfe-commits
@@ -2258,6 +2258,94 @@ class ExtractTypeForDeductionGuide } }; +// Build a deduction guide with the specified parameter types. +FunctionTemplateDecl * +buildDeductionGuide(Sema &SemaRef, TemplateDecl *OriginalTemplate, +TemplateParameterList *TemplatePara

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-06 Thread Haojian Wu via cfe-commits
@@ -2612,44 +2671,309 @@ struct ConvertConstructorToDeductionGuideTransform { SemaRef.CurrentInstantiationScope->InstantiatedLocal(OldParam, NewParam); return NewParam; } +}; - FunctionTemplateDecl *buildDeductionGuide( - TemplateParameterList *TemplateParams,

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-06 Thread Haojian Wu via cfe-commits
hokein wrote: > > @cor3ntin, @erichkeane, thanks for all review comments. I'm not sure you > > have reviewed the whole patch. My feeling is that the core part > > (`DeclareImplicitDeductionGuidesForTypeAlias`) may not have received > > sufficient reviews. It would be great if you can take a cl

[clang-tools-extra] [clangd] Avoid libFormat's objective-c guessing heuristic where possible (PR #84133)

2024-03-06 Thread Haojian Wu via cfe-commits
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/84133 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Avoid libFormat's objective-c guessing heuristic where possible (PR #84133)

2024-03-06 Thread Haojian Wu via cfe-commits
https://github.com/hokein commented: thanks, this looks good in general, just some nits. https://github.com/llvm/llvm-project/pull/84133 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Avoid libFormat's objective-c guessing heuristic where possible (PR #84133)

2024-03-06 Thread Haojian Wu via cfe-commits
@@ -166,14 +166,29 @@ TextEdit toTextEdit(const FixItHint &FixIt, const SourceManager &M, std::optional getCanonicalPath(const FileEntryRef F, FileManager &FileMgr); +/// A flag passed to getFormatStyleForFile() that specifies what

[clang-tools-extra] [clangd] Avoid libFormat's objective-c guessing heuristic where possible (PR #84133)

2024-03-06 Thread Haojian Wu via cfe-commits
@@ -166,14 +166,29 @@ TextEdit toTextEdit(const FixItHint &FixIt, const SourceManager &M, std::optional getCanonicalPath(const FileEntryRef F, FileManager &FileMgr); +/// A flag passed to getFormatStyleForFile() that specifies what

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-06 Thread Haojian Wu via cfe-commits
@@ -10598,10 +10598,34 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (TemplateName.isDependent()) return SubstAutoTypeDependent(TSInfo->getType()); - // We can only perform deduction for class templates. + // We can only perform deduction for class

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-06 Thread Haojian Wu via cfe-commits
@@ -96,6 +96,10 @@ C++20 Feature Support behavior can use the flag '-Xclang -fno-skip-odr-check-in-gmf'. (`#79240 `_). +- Initial support for class template argument deduciton (CTAD) for type alias + templates. --

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-06 Thread Haojian Wu via cfe-commits
@@ -96,6 +96,10 @@ C++20 Feature Support behavior can use the flag '-Xclang -fno-skip-odr-check-in-gmf'. (`#79240 `_). +- Initial support for class template argument deduciton (CTAD) for type alias + templates. + (`#5405

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-06 Thread Haojian Wu via cfe-commits
@@ -10598,10 +10598,38 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (TemplateName.isDependent()) return SubstAutoTypeDependent(TSInfo->getType()); - // We can only perform deduction for class templates. + // We can only perform deduction for class

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-06 Thread Haojian Wu via cfe-commits
@@ -1446,6 +1447,59 @@ namespace { return inherited::TransformFunctionProtoType(TLB, TL); } +QualType TransformInjectedClassNameType(TypeLocBuilder &TLB, +InjectedClassNameTypeLoc TL) { + auto Type = inherited::Tra

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-06 Thread Haojian Wu via cfe-commits
@@ -2612,44 +2669,312 @@ struct ConvertConstructorToDeductionGuideTransform { SemaRef.CurrentInstantiationScope->InstantiatedLocal(OldParam, NewParam); return NewParam; } +}; - FunctionTemplateDecl *buildDeductionGuide( - TemplateParameterList *TemplateParams,

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-06 Thread Haojian Wu via cfe-commits
@@ -2612,44 +2669,312 @@ struct ConvertConstructorToDeductionGuideTransform { SemaRef.CurrentInstantiationScope->InstantiatedLocal(OldParam, NewParam); return NewParam; } +}; - FunctionTemplateDecl *buildDeductionGuide( - TemplateParameterList *TemplateParams,

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-06 Thread Haojian Wu via cfe-commits
@@ -2612,44 +2669,312 @@ struct ConvertConstructorToDeductionGuideTransform { SemaRef.CurrentInstantiationScope->InstantiatedLocal(OldParam, NewParam); return NewParam; } +}; - FunctionTemplateDecl *buildDeductionGuide( - TemplateParameterList *TemplateParams,

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-06 Thread Haojian Wu via cfe-commits
@@ -96,6 +96,10 @@ C++20 Feature Support behavior can use the flag '-Xclang -fno-skip-odr-check-in-gmf'. (`#79240 `_). +- Initial support for class template argument deduciton (CTAD) for type alias + templates. + (`#5405

[clang] [clang] Use getDefaultArgRange instead of getDefaultArg to retrieve the (PR #79296)

2024-03-06 Thread Haojian Wu via cfe-commits
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/79296 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-06 Thread Haojian Wu via cfe-commits
@@ -2612,44 +2669,312 @@ struct ConvertConstructorToDeductionGuideTransform { SemaRef.CurrentInstantiationScope->InstantiatedLocal(OldParam, NewParam); return NewParam; } +}; - FunctionTemplateDecl *buildDeductionGuide( - TemplateParameterList *TemplateParams,

[clang] [clang] Use getDefaultArgRange instead of getDefaultArg to retrieve the (PR #79296)

2024-03-06 Thread Haojian Wu via cfe-commits
https://github.com/hokein closed https://github.com/llvm/llvm-project/pull/79296 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-07 Thread Haojian Wu via cfe-commits
@@ -96,6 +96,10 @@ C++20 Feature Support behavior can use the flag '-Xclang -fno-skip-odr-check-in-gmf'. (`#79240 `_). +- Initial support for class template argument deduciton (CTAD) for type alias hokein

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-07 Thread Haojian Wu via cfe-commits
@@ -10598,10 +10598,38 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (TemplateName.isDependent()) return SubstAutoTypeDependent(TSInfo->getType()); - // We can only perform deduction for class templates. + // We can only perform deduction for class

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-07 Thread Haojian Wu via cfe-commits
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/77890 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-07 Thread Haojian Wu via cfe-commits
@@ -96,6 +96,10 @@ C++20 Feature Support behavior can use the flag '-Xclang -fno-skip-odr-check-in-gmf'. (`#79240 `_). +- Initial support for class template argument deduciton (CTAD) for type alias + templates (`P1814R0 <

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-07 Thread Haojian Wu via cfe-commits
@@ -10598,10 +10598,34 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (TemplateName.isDependent()) return SubstAutoTypeDependent(TSInfo->getType()); - // We can only perform deduction for class templates. + // We can only perform deduction for class

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-07 Thread Haojian Wu via cfe-commits
hokein wrote: Thank you for all the reviews, I will wait 1 or 2 days before merging it in case anyone has more comments. https://github.com/llvm/llvm-project/pull/77890 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-08 Thread Haojian Wu via cfe-commits
hokein wrote: > > Thank you for all the reviews, I will wait 1 or 2 days before merging it in > > case anyone has more comments. > > Sure! Do you plan to keep working on completing this feature? Yeah, I plan to complete this feature before the next clang release. If anyone is willing to help,

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-08 Thread Haojian Wu via cfe-commits
https://github.com/hokein closed https://github.com/llvm/llvm-project/pull/77890 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] CTAD: Respect requires-clause of the original function template (PR #84913)

2024-03-12 Thread Haojian Wu via cfe-commits
https://github.com/hokein created https://github.com/llvm/llvm-project/pull/84913 for the synthesized deduction guide. We ignored the require-clause of the original template when building the deduction guide for type-alias CTAD, this resulted in accepting code which should be rejected (see th

[clang] [clang] CTAD: Respect requires-clause of the original function template (PR #84913)

2024-03-13 Thread Haojian Wu via cfe-commits
hokein wrote: Thanks for the review. https://github.com/llvm/llvm-project/pull/84913 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] CTAD: Respect requires-clause of the original function template (PR #84913)

2024-03-13 Thread Haojian Wu via cfe-commits
https://github.com/hokein closed https://github.com/llvm/llvm-project/pull/84913 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [concepts] Preserve the FoundDecl of ConceptReference properly (PR #85032)

2024-03-13 Thread Haojian Wu via cfe-commits
https://github.com/hokein approved this pull request. Thanks for the investigation and fix! https://github.com/llvm/llvm-project/pull/85032 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-23 Thread Haojian Wu via cfe-commits
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/77890 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-23 Thread Haojian Wu via cfe-commits
@@ -1446,6 +1447,58 @@ namespace { return inherited::TransformFunctionProtoType(TLB, TL); } +QualType TransformInjectedClassNameType(TypeLocBuilder &TLB, +InjectedClassNameTypeLoc TL) { + auto Type = inherited::Tra

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-23 Thread Haojian Wu via cfe-commits
@@ -2612,44 +2671,309 @@ struct ConvertConstructorToDeductionGuideTransform { SemaRef.CurrentInstantiationScope->InstantiatedLocal(OldParam, NewParam); return NewParam; } +}; - FunctionTemplateDecl *buildDeductionGuide( - TemplateParameterList *TemplateParams,

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-23 Thread Haojian Wu via cfe-commits
@@ -2258,6 +2260,94 @@ class ExtractTypeForDeductionGuide } }; +// Build a deduction guide with the specified parameter types. +FunctionTemplateDecl * +buildDeductionGuide(Sema &SemaRef, TemplateDecl *OriginalTemplate, +TemplateParameterList *TemplatePara

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-23 Thread Haojian Wu via cfe-commits
@@ -10598,10 +10598,34 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (TemplateName.isDependent()) return SubstAutoTypeDependent(TSInfo->getType()); - // We can only perform deduction for class templates. + // We can only perform deduction for class

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-23 Thread Haojian Wu via cfe-commits
@@ -2612,44 +2671,309 @@ struct ConvertConstructorToDeductionGuideTransform { SemaRef.CurrentInstantiationScope->InstantiatedLocal(OldParam, NewParam); return NewParam; } +}; - FunctionTemplateDecl *buildDeductionGuide( - TemplateParameterList *TemplateParams,

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-23 Thread Haojian Wu via cfe-commits
@@ -2612,44 +2671,309 @@ struct ConvertConstructorToDeductionGuideTransform { SemaRef.CurrentInstantiationScope->InstantiatedLocal(OldParam, NewParam); return NewParam; } +}; - FunctionTemplateDecl *buildDeductionGuide( - TemplateParameterList *TemplateParams,

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-23 Thread Haojian Wu via cfe-commits
@@ -2612,44 +2671,309 @@ struct ConvertConstructorToDeductionGuideTransform { SemaRef.CurrentInstantiationScope->InstantiatedLocal(OldParam, NewParam); return NewParam; } +}; - FunctionTemplateDecl *buildDeductionGuide( - TemplateParameterList *TemplateParams,

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-23 Thread Haojian Wu via cfe-commits
@@ -2612,44 +2671,309 @@ struct ConvertConstructorToDeductionGuideTransform { SemaRef.CurrentInstantiationScope->InstantiatedLocal(OldParam, NewParam); return NewParam; } +}; - FunctionTemplateDecl *buildDeductionGuide( - TemplateParameterList *TemplateParams,

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-23 Thread Haojian Wu via cfe-commits
@@ -2612,44 +2671,309 @@ struct ConvertConstructorToDeductionGuideTransform { SemaRef.CurrentInstantiationScope->InstantiatedLocal(OldParam, NewParam); return NewParam; } +}; - FunctionTemplateDecl *buildDeductionGuide( - TemplateParameterList *TemplateParams,

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-23 Thread Haojian Wu via cfe-commits
@@ -10525,9 +10534,11 @@ class Sema final { SourceLocation PointOfInstantiation, FunctionDecl *Decl, ArrayRef TemplateArgs, ConstraintSatisfaction &Satisfaction); - FunctionDecl *InstantiateFunctionDeclaration(FunctionTemplateDecl *FTD, -

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-23 Thread Haojian Wu via cfe-commits
@@ -39,6 +40,7 @@ #include "llvm/ADT/SmallBitVector.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringExtras.h" +#include "llvm/Support/Casting.h" hokein wrote: Done. https://github.com/llvm/llvm-project/pull/77890 ___

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-23 Thread Haojian Wu via cfe-commits
https://github.com/hokein commented: Thanks for the initial review. https://github.com/llvm/llvm-project/pull/77890 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-23 Thread Haojian Wu via cfe-commits
@@ -2612,44 +2671,309 @@ struct ConvertConstructorToDeductionGuideTransform { SemaRef.CurrentInstantiationScope->InstantiatedLocal(OldParam, NewParam); return NewParam; } +}; - FunctionTemplateDecl *buildDeductionGuide( - TemplateParameterList *TemplateParams,

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-23 Thread Haojian Wu via cfe-commits
@@ -2612,44 +2671,309 @@ struct ConvertConstructorToDeductionGuideTransform { SemaRef.CurrentInstantiationScope->InstantiatedLocal(OldParam, NewParam); return NewParam; } +}; - FunctionTemplateDecl *buildDeductionGuide( - TemplateParameterList *TemplateParams,

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-23 Thread Haojian Wu via cfe-commits
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/77890 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Thread safety analysis: provide printSCFG definition. (PR #80277)

2024-02-23 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/80277 >From bb1a8f86e0b9ce3748af03625757d20900e053fc Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Thu, 1 Feb 2024 12:41:29 +0100 Subject: [PATCH 1/2] Thread safety analysis: provide printSCFG definition. I'm calling

[clang] Thread safety analysis: provide printSCFG definition. (PR #80277)

2024-02-23 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/80277 >From bb1a8f86e0b9ce3748af03625757d20900e053fc Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Thu, 1 Feb 2024 12:41:29 +0100 Subject: [PATCH 1/2] Thread safety analysis: provide printSCFG definition. I'm calling

[clang] Thread safety analysis: provide printSCFG definition. (PR #80277)

2024-02-23 Thread Haojian Wu via cfe-commits
hokein wrote: > This sounds like a good idea! Done. https://github.com/llvm/llvm-project/pull/80277 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [include-cleaner] Dont apply name-match for non-owning headers (PR #82625)

2024-02-23 Thread Haojian Wu via cfe-commits
https://github.com/hokein approved this pull request. https://github.com/llvm/llvm-project/pull/82625 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add __builtin_start_object_lifetime builtin. (PR #82776)

2024-02-23 Thread Haojian Wu via cfe-commits
https://github.com/hokein created https://github.com/llvm/llvm-project/pull/82776 This patch implements a clang builtin `__builtin_start_object_lifetime`, it has the same semantics as C++23's `std::start_lifetime_as`, but without the implicit-lifetime type restriction, it could be used for imp

[clang] Thread safety analysis: provide printSCFG definition. (PR #80277)

2024-02-26 Thread Haojian Wu via cfe-commits
https://github.com/hokein closed https://github.com/llvm/llvm-project/pull/80277 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-26 Thread Haojian Wu via cfe-commits
@@ -2612,44 +2671,309 @@ struct ConvertConstructorToDeductionGuideTransform { SemaRef.CurrentInstantiationScope->InstantiatedLocal(OldParam, NewParam); return NewParam; } +}; - FunctionTemplateDecl *buildDeductionGuide( - TemplateParameterList *TemplateParams,

[clang] [clang] Use getDefaultArgRange instead of getDefaultArg to retrieve the (PR #79296)

2024-02-26 Thread Haojian Wu via cfe-commits
hokein wrote: > Sorry for missing this! > > Would be nice to have a testcase but I see it's hard to get into the crashing > state (maybe even not possible via clang). Seems worthwhile to be robust to > such conditions and getDefaultArgRange appears less fragile. This fix was needed for the in

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-27 Thread Haojian Wu via cfe-commits
@@ -10598,10 +10598,36 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (TemplateName.isDependent()) return SubstAutoTypeDependent(TSInfo->getType()); - // We can only perform deduction for class templates. + // We can only perform deduction for class

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-27 Thread Haojian Wu via cfe-commits
@@ -2258,6 +2258,94 @@ class ExtractTypeForDeductionGuide } }; +// Build a deduction guide with the specified parameter types. +FunctionTemplateDecl * +buildDeductionGuide(Sema &SemaRef, TemplateDecl *OriginalTemplate, +TemplateParameterList *TemplatePara

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-27 Thread Haojian Wu via cfe-commits
@@ -10598,10 +10598,36 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (TemplateName.isDependent()) return SubstAutoTypeDependent(TSInfo->getType()); - // We can only perform deduction for class templates. + // We can only perform deduction for class

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-27 Thread Haojian Wu via cfe-commits
@@ -10598,10 +10598,36 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (TemplateName.isDependent()) return SubstAutoTypeDependent(TSInfo->getType()); - // We can only perform deduction for class templates. + // We can only perform deduction for class

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-27 Thread Haojian Wu via cfe-commits
@@ -2612,44 +2669,313 @@ struct ConvertConstructorToDeductionGuideTransform { SemaRef.CurrentInstantiationScope->InstantiatedLocal(OldParam, NewParam); return NewParam; } +}; - FunctionTemplateDecl *buildDeductionGuide( - TemplateParameterList *TemplateParams,

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-28 Thread Haojian Wu via cfe-commits
@@ -10598,10 +10598,36 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (TemplateName.isDependent()) return SubstAutoTypeDependent(TSInfo->getType()); - // We can only perform deduction for class templates. + // We can only perform deduction for class

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-28 Thread Haojian Wu via cfe-commits
@@ -2258,6 +2258,94 @@ class ExtractTypeForDeductionGuide } }; +// Build a deduction guide with the specified parameter types. +FunctionTemplateDecl * +buildDeductionGuide(Sema &SemaRef, TemplateDecl *OriginalTemplate, +TemplateParameterList *TemplatePara

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-02-28 Thread Haojian Wu via cfe-commits
@@ -10598,10 +10598,36 @@ QualType Sema::DeduceTemplateSpecializationFromInitializer( if (TemplateName.isDependent()) return SubstAutoTypeDependent(TSInfo->getType()); - // We can only perform deduction for class templates. + // We can only perform deduction for class

[clang-tools-extra] [clangd] Remove calls to getFileLoc() in declToSym() (PR #83532)

2024-03-05 Thread Haojian Wu via cfe-commits
https://github.com/hokein approved this pull request. https://github.com/llvm/llvm-project/pull/83532 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-03-05 Thread Haojian Wu via cfe-commits
hokein wrote: @cor3ntin, @erichkeane, thanks for all review comments. I'm not sure you have reviewed the whole patch. My feeling is that the core part (`DeclareImplicitDeductionGuidesForTypeAlias`) may not have received sufficient reviews. It would be great if you can take a closer look at thi

[clang-tools-extra] [clangd] Make all calls to format::getStyle() go through getFormatStyleForFile() (PR #82948)

2024-03-05 Thread Haojian Wu via cfe-commits
https://github.com/hokein approved this pull request. +1, this looks like an improvement. https://github.com/llvm/llvm-project/pull/82948 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [AST] Print the "aggregate" for aggregate deduction guide decl. (PR #84018)

2024-03-05 Thread Haojian Wu via cfe-commits
https://github.com/hokein created https://github.com/llvm/llvm-project/pull/84018 I found this is useful for debugging purpose to identify different kind of deduction guide decl. >From 63e1f39e9580f4b33fcd86572aea70bf46edb264 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Tue, 5 Mar 2024 14:

[clang-tools-extra] [pseudo] remove most of clang-pseudo (PR #80081)

2024-01-31 Thread Haojian Wu via cfe-commits
hokein wrote: We have some internal usages of the library. To make the integration life easier, I think it is better to do an internal cleanup first, and then land this patch. https://github.com/llvm/llvm-project/pull/80081 ___ cfe-commits mailing li

[clang] [coroutine] Suppress unreachable-code warning on coroutine statements. (PR #77454)

2024-01-31 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/77454 >From 43810d2b18e1e31c5f15dc58c847c83b3c34d982 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Tue, 9 Jan 2024 12:29:45 +0100 Subject: [PATCH 1/2] [coroutine] Suppress unreachable-code warning on coroutine statem

[clang] [coroutine] Suppress unreachable-code warning on coroutine statements. (PR #77454)

2024-01-31 Thread Haojian Wu via cfe-commits
@@ -60,6 +61,45 @@ static bool isTrivialDoWhile(const CFGBlock *B, const Stmt *S) { return false; } +// Check if the block starts with a coroutine statement and see if the given +// unreachable 'S' is the substmt of the coroutine statement. +// +// We suppress the unreachab

[clang] [coroutine] Suppress unreachable-code warning on coroutine statements. (PR #77454)

2024-02-01 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/77454 >From 43810d2b18e1e31c5f15dc58c847c83b3c34d982 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Tue, 9 Jan 2024 12:29:45 +0100 Subject: [PATCH 1/2] [coroutine] Suppress unreachable-code warning on coroutine statem

[clang] Thread safety analysis: provide printSCFG definition. (PR #80277)

2024-02-01 Thread Haojian Wu via cfe-commits
https://github.com/hokein created https://github.com/llvm/llvm-project/pull/80277 I called this function when investigating the issue (https://github.com/llvm/llvm-project/issues/78131), and I was surprised to see the definition is commented out. I think it makes sense to provide the definiti

[clang] [coroutine] Suppress unreachable-code warning on coroutine statements. (PR #77454)

2024-02-02 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/77454 >From 43810d2b18e1e31c5f15dc58c847c83b3c34d982 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Tue, 9 Jan 2024 12:29:45 +0100 Subject: [PATCH 1/3] [coroutine] Suppress unreachable-code warning on coroutine statem

[clang] [coroutine] Suppress unreachable-code warning on coroutine statements. (PR #77454)

2024-02-02 Thread Haojian Wu via cfe-commits
@@ -453,26 +454,68 @@ bool DeadCodeScan::isDeadCodeRoot(const clang::CFGBlock *Block) { return isDeadRoot; } -static bool isValidDeadStmt(const Stmt *S) { +// Check if the given `DeadStmt` is a coroutine statement and is a substmt of +// the coroutine statement. +static boo

[clang] [coroutine] Suppress unreachable-code warning on coroutine statements. (PR #77454)

2024-02-02 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/77454 >From 43810d2b18e1e31c5f15dc58c847c83b3c34d982 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Tue, 9 Jan 2024 12:29:45 +0100 Subject: [PATCH 1/4] [coroutine] Suppress unreachable-code warning on coroutine statem

[clang] [coroutine] Suppress unreachable-code warning on coroutine statements. (PR #77454)

2024-02-02 Thread Haojian Wu via cfe-commits
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/77454 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [coroutine] Suppress unreachable-code warning on coroutine statements. (PR #77454)

2024-02-02 Thread Haojian Wu via cfe-commits
@@ -12,6 +12,13 @@ struct task { std::suspend_always yield_value(int) { return {}; } task get_return_object(); void unhandled_exception(); + +struct Awaiter { + bool await_ready(); + void await_suspend(auto); + int await_resume(); +}; +aut

[clang] [coroutine] Suppress unreachable-code warning on coroutine statements. (PR #77454)

2024-02-02 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/77454 >From bcfc755d96379c59f79518ff7764f45e351302b8 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Tue, 9 Jan 2024 12:29:45 +0100 Subject: [PATCH 1/5] [coroutine] Suppress unreachable-code warning on coroutine statem

[clang] [coroutine] Suppress unreachable-code warning on coroutine statements. (PR #77454)

2024-02-02 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/77454 >From bcfc755d96379c59f79518ff7764f45e351302b8 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Tue, 9 Jan 2024 12:29:45 +0100 Subject: [PATCH 1/6] [coroutine] Suppress unreachable-code warning on coroutine statem

[clang] [coroutine] Suppress unreachable-code warning on coroutine statements. (PR #77454)

2024-02-04 Thread Haojian Wu via cfe-commits
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/77454 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [coroutine] Suppress unreachable-code warning on coroutine statements. (PR #77454)

2024-02-04 Thread Haojian Wu via cfe-commits
https://github.com/hokein closed https://github.com/llvm/llvm-project/pull/77454 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Handle IndirectFieldDecl in kindForDecl (PR #80588)

2024-02-05 Thread Haojian Wu via cfe-commits
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/80588 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Handle IndirectFieldDecl in kindForDecl (PR #80588)

2024-02-05 Thread Haojian Wu via cfe-commits
https://github.com/hokein approved this pull request. https://github.com/llvm/llvm-project/pull/80588 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Handle IndirectFieldDecl in kindForDecl (PR #80588)

2024-02-05 Thread Haojian Wu via cfe-commits
@@ -1076,6 +1076,21 @@ sizeof...($TemplateParameter[[Elements]]); using $Class[[Y]]$Bracket[[<]]0$Bracket[[>]]::$Unknown_dependentName[[xxx]]; }; }; +)cpp", + R"cpp( +template $Bracket[[<]]typename $TemplateParameter_def[[T]]$Brac

[clang-tools-extra] [include-cleaner] Check emptiness instead of occurences (PR #79154)

2024-01-23 Thread Haojian Wu via cfe-commits
https://github.com/hokein approved this pull request. https://github.com/llvm/llvm-project/pull/79154 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AST] Mark the fallthrough coreturn statement implicit. (PR #77465)

2024-01-24 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/77465 >From 781201c5c0a526821f51ce6aa0e2c972a9f5f51f Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Tue, 9 Jan 2024 14:02:01 +0100 Subject: [PATCH 1/2] [AST] Mark the fallthrough coreturn statement implicit. --- clan

[clang] [AST] Mark the fallthrough coreturn statement implicit. (PR #77465)

2024-01-24 Thread Haojian Wu via cfe-commits
https://github.com/hokein closed https://github.com/llvm/llvm-project/pull/77465 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Use getDefaultArgRange instead of getDefaultArg to retrieve the (PR #79296)

2024-01-24 Thread Haojian Wu via cfe-commits
https://github.com/hokein created https://github.com/llvm/llvm-project/pull/79296 source location in AliasTemplateDeductionGuideTransform. I don't have a reproducible testcase, but this should be a safe and non-functional change. We have checked the `hasDefaultArg` before calling getDefaultAr

[clang] [clang] WIP: Implement CTAD for type alias template. (PR #77890)

2024-01-29 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/77890 >From 8f7d83aed173688ff1413b7c4445d4576efee872 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Wed, 24 Jan 2024 14:55:03 +0100 Subject: [PATCH] [clang] Implement Class Template Argument Deduction (CTAD) for type

[clang] [clang] WIP: Implement CTAD for type alias template. (PR #77890)

2024-01-29 Thread Haojian Wu via cfe-commits
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/77890 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-01-29 Thread Haojian Wu via cfe-commits
https://github.com/hokein edited https://github.com/llvm/llvm-project/pull/77890 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-01-29 Thread Haojian Wu via cfe-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/77890 >From becb1bdebc8d10296a5c9f1af64ebae5ca9b68b7 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Wed, 24 Jan 2024 14:55:03 +0100 Subject: [PATCH] [clang] Implement Class Template Argument Deduction (CTAD) for type

[clang] [clang] Implement CTAD for type alias template. (PR #77890)

2024-01-29 Thread Haojian Wu via cfe-commits
https://github.com/hokein ready_for_review https://github.com/llvm/llvm-project/pull/77890 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    3   4   5   6   7   8   9   10   11   12   >