[clang] [clang-format] Add SpacesInParensOption for filtering repeated parens (PR #77522)

2024-05-26 Thread Owen Pan via cfe-commits
https://github.com/owenca commented: I think we can simply check if a sequence of two `l_parens` have a matching sequence of two `r_parens` and insert spaces only if `ExceptDoubleParentheses` is false. https://github.com/llvm/llvm-project/pull/77522 ___

[clang] [clang-format] Add SpacesInParensOption for filtering repeated parens (PR #77522)

2024-05-26 Thread Owen Pan via cfe-commits
@@ -17265,6 +17317,268 @@ TEST_F(FormatTest, ConfigurableSpacesInParens) { verifyFormat("size_t idx = (a->foo)(a - 1);", Spaces); verifyFormat("size_t idx = (*foo)(a - 1);", Spaces); verifyFormat("size_t idx = (*(foo))(a - 1);", Spaces); + + // Check ExceptDoubleParenthe

[clang] Code implementing the SpacesInParensOptions.ExceptDoubleParentheses l… (PR #93439)

2024-05-26 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/93439 …ogic >From ac03e1506b5ea0d00038501c4f41d5b30c8fa2b3 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 26 May 2024 22:01:48 -0700 Subject: [PATCH] Code implementing the SpacesInParensOptions.ExceptDoubleParenth

[clang] Code implementing the SpacesInParensOptions.ExceptDoubleParentheses l… (PR #93439)

2024-05-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-format Author: Owen Pan (owenca) Changes …ogic --- Full diff: https://github.com/llvm/llvm-project/pull/93439.diff 1 Files Affected: - (modified) clang/lib/Format/TokenAnnotator.cpp (+8) ``diff diff --git a/clang/lib/Format/TokenAnno

[clang] Code implementing the SpacesInParensOptions.ExceptDoubleParentheses l… (PR #93439)

2024-05-26 Thread Owen Pan via cfe-commits
https://github.com/owenca converted_to_draft https://github.com/llvm/llvm-project/pull/93439 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AMDGPU] Extend readlane, writelane and readfirstlane intrinsic lowering for generic types (PR #89217)

2024-05-26 Thread Vikram Hegde via cfe-commits
@@ -5456,43 +5444,32 @@ bool AMDGPULegalizerInfo::legalizeLaneOp(LegalizerHelper &Helper, if ((Size % 32) == 0) { SmallVector PartialRes; unsigned NumParts = Size / 32; -auto IsS16Vec = Ty.isVector() && Ty.getElementType() == S16; +bool IsS16Vec = Ty.isVector

[clang] [clang-format] Add SpacesInParensOption for filtering repeated parens (PR #77522)

2024-05-26 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/77522 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] e73e495 - [NFC] Fix typo unalighed_decl_id_t

2024-05-26 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-05-27T13:48:00+08:00 New Revision: e73e4951b20c70f24354e2a2820876c818dcaee3 URL: https://github.com/llvm/llvm-project/commit/e73e4951b20c70f24354e2a2820876c818dcaee3 DIFF: https://github.com/llvm/llvm-project/commit/e73e4951b20c70f24354e2a2820876c818dcaee3.diff LO

[clang] b590ba7 - [NFC] Rename 'DependentModules' in ModuleFile to `TransitiveImports`

2024-05-26 Thread Chuanqi Xu via cfe-commits
Author: Chuanqi Xu Date: 2024-05-27T13:53:38+08:00 New Revision: b590ba73a76609bace9949ea8195d2ee8213cb3f URL: https://github.com/llvm/llvm-project/commit/b590ba73a76609bace9949ea8195d2ee8213cb3f DIFF: https://github.com/llvm/llvm-project/commit/b590ba73a76609bace9949ea8195d2ee8213cb3f.diff LO

[clang] [serialization] no transitive decl change (PR #92083)

2024-05-26 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 updated https://github.com/llvm/llvm-project/pull/92083 >From 8b7a650e128d6f2bfec9b0768169cf4aaa4af337 Mon Sep 17 00:00:00 2001 From: Chuanqi Xu Date: Fri, 10 May 2024 15:36:31 +0800 Subject: [PATCH] [serialization] no transitive decl change --- clang/include/cla

[clang] [clang][CodeComplete] Recurse into the subexpression of deref operator in getApproximateType (PR #93404)

2024-05-26 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 edited https://github.com/llvm/llvm-project/pull/93404 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeComplete] Recurse into the subexpression of deref operator in getApproximateType (PR #93404)

2024-05-26 Thread Nathan Ridge via cfe-commits
https://github.com/HighCommander4 approved this pull request. Thank you! Looks good with one suggested change. https://github.com/llvm/llvm-project/pull/93404 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [clang][CodeComplete] Recurse into the subexpression of deref operator in getApproximateType (PR #93404)

2024-05-26 Thread Nathan Ridge via cfe-commits
@@ -5680,8 +5680,16 @@ QualType getApproximateType(const Expr *E) { } } if (const auto *UO = llvm::dyn_cast(E)) { -if (UO->getOpcode() == UnaryOperatorKind::UO_Deref) - return UO->getSubExpr()->getType()->getPointeeType(); +if (UO->getOpcode() == UnaryOpera

[clang] [serialization] no transitive decl change (PR #92083)

2024-05-26 Thread Chuanqi Xu via cfe-commits
@@ -124,6 +130,15 @@ class DeclIDBase { bool isInvalid() const { return ID == PREDEF_DECL_NULL_ID; } + unsigned getModuleFileIndex() const { return ID >> 32; } + + unsigned getLocalDeclIndex() const { +// Implement it directly instead of calling `llvm::maskTrailingOne

[clang] [serialization] no transitive decl change (PR #92083)

2024-05-26 Thread Chuanqi Xu via cfe-commits
@@ -255,6 +255,12 @@ class DeclOffset { } }; +// The unaligned decl ID used in the Blobs of bistreams. +using unalighed_decl_id_t = ChuanqiXu9 wrote: Nice catch! Done in https://github.com/llvm/llvm-project/commit/e73e4951b20c70f24354e2a2820876c818dcaee3

[clang] [serialization] no transitive decl change (PR #92083)

2024-05-26 Thread Chuanqi Xu via cfe-commits
@@ -7802,20 +7800,31 @@ Decl *ASTReader::GetDecl(GlobalDeclID ID) { LocalDeclID ASTReader::mapGlobalIDToModuleFileGlobalID(ModuleFile &M, GlobalDeclID GlobalID) { - DeclID ID = GlobalID.get(); - if (ID < NUM_PREDEF_DECL_

[clang] [serialization] no transitive decl change (PR #92083)

2024-05-26 Thread Chuanqi Xu via cfe-commits
@@ -111,6 +109,28 @@ void *Decl::operator new(std::size_t Size, const ASTContext &Ctx, return ::operator new(Size + Extra, Ctx); } +GlobalDeclID Decl::getGlobalID() const { + if (!isFromASTFile()) +return GlobalDeclID(); + uint64_t ID = *((const uint64_t *)this - 1);

[clang] [serialization] no transitive decl change (PR #92083)

2024-05-26 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: Thanks for reviewing : ) https://github.com/llvm/llvm-project/pull/92083 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][CodeComplete] Recurse into the subexpression of deref operator in getApproximateType (PR #93404)

2024-05-26 Thread Younan Zhang via cfe-commits
https://github.com/zyn0217 updated https://github.com/llvm/llvm-project/pull/93404 >From 7639cb738dfb876c7abdf7337fad3aa80e912736 Mon Sep 17 00:00:00 2001 From: Younan Zhang Date: Sun, 26 May 2024 15:52:31 +0800 Subject: [PATCH 1/2] [clang][CodeComplete] Recurse into the subexpression of deref

[clang] [clang][CodeComplete] Recurse into the subexpression of deref operator in getApproximateType (PR #93404)

2024-05-26 Thread Younan Zhang via cfe-commits
@@ -5680,8 +5680,16 @@ QualType getApproximateType(const Expr *E) { } } if (const auto *UO = llvm::dyn_cast(E)) { -if (UO->getOpcode() == UnaryOperatorKind::UO_Deref) - return UO->getSubExpr()->getType()->getPointeeType(); +if (UO->getOpcode() == UnaryOpera

[clang] [clang][CodeComplete] Recurse into the subexpression of deref operator in getApproximateType (PR #93404)

2024-05-26 Thread Younan Zhang via cfe-commits
zyn0217 wrote: (I'll merge it shortly if CI turns green because I encountered the bug the other day in our codebase. Apologies I didn't point it out in my review for https://github.com/llvm/llvm-project/commit/bc31be7949a3d5382be0e15e3957fa957da9de45) https://github.com/llvm/llvm-project/pull/

[clang] [llvm] [AMDGPU][WIP] Extend permlane16, permlanex16 and permlane64 intrinsic lowering for generic types (PR #92725)

2024-05-26 Thread Vikram Hegde via cfe-commits
@@ -18479,6 +18479,25 @@ Value *CodeGenFunction::EmitAMDGPUBuiltinExpr(unsigned BuiltinID, CGM.getIntrinsic(Intrinsic::amdgcn_update_dpp, Args[0]->getType()); return Builder.CreateCall(F, Args); } + case AMDGPU::BI__builtin_amdgcn_permlane16: + case AMDGPU::BI_

[clang] [llvm] [AMDGPU][WIP] Extend permlane16, permlanex16 and permlane64 intrinsic lowering for generic types (PR #92725)

2024-05-26 Thread Vikram Hegde via cfe-commits
@@ -5433,7 +5450,16 @@ bool AMDGPULegalizerInfo::legalizeLaneOp(LegalizerHelper &Helper, ? Src0 : B.buildBitcast(LLT::scalar(Size), Src0).getReg(0); Src0 = B.buildAnyExt(S32, Src0Cast).getReg(0); -if (Src2.isVali

<    1   2