https://github.com/Endilll approved this pull request.
LGTM, but you should wait for other reviewers before merging.
https://github.com/llvm/llvm-project/pull/67213
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/
https://github.com/Endilll edited
https://github.com/llvm/llvm-project/pull/67213
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1488,6 +1491,8 @@ markup::Document HoverInfo::present() const {
llvm::formatv(" (+{0} padding)", formatSize(*Padding)).str());
}
}
+ if (Align)
+Output.addParagraph().appendText("Align: " + formatSize(*Align));
Endilll wrote:
My prefer
Endilll wrote:
On the topic of ABI, Itanium and Microsoft type layouts are not compatible,
even for standard-layout (POD) types. For
[example](https://godbolt.org/z/zxfvMa9nE), bit-fields are
[allowed](http://eel.is/c++draft/class.prop#3) in standard-layout types, but
only Microsoft ABI manda
@@ -1488,6 +1491,8 @@ markup::Document HoverInfo::present() const {
llvm::formatv(" (+{0} padding)", formatSize(*Padding)).str());
}
}
+ if (Align)
+Output.addParagraph().appendText("Align: " + formatSize(*Align));
sr-tream wrote:
> My pre
@@ -1488,6 +1491,8 @@ markup::Document HoverInfo::present() const {
llvm::formatv(" (+{0} padding)", formatSize(*Padding)).str());
}
}
+ if (Align)
+Output.addParagraph().appendText("Align: " + formatSize(*Align));
Endilll wrote:
That woul
@@ -1488,6 +1491,8 @@ markup::Document HoverInfo::present() const {
llvm::formatv(" (+{0} padding)", formatSize(*Padding)).str());
}
}
+ if (Align)
+Output.addParagraph().appendText("Align: " + formatSize(*Align));
sr-tream wrote:
Yeah, it
https://github.com/sr-tream updated
https://github.com/llvm/llvm-project/pull/67213
>From bf024310a4fe796a497880c0e2bd6a27c86ce7f5 Mon Sep 17 00:00:00 2001
From: SR_team
Date: Sat, 21 Oct 2023 21:24:26 +0300
Subject: [PATCH] [clangd] Show alignment for records and fields decls
---
clang-tools
https://github.com/sr-tream updated
https://github.com/llvm/llvm-project/pull/67213
>From b9b5bc27c7ab8c8faca7f8bf66aead59b817b6b7 Mon Sep 17 00:00:00 2001
From: SR_team
Date: Sat, 21 Oct 2023 21:24:26 +0300
Subject: [PATCH] [clangd] Show alignment for records and fields decls
---
clang-tools
sr-tream wrote:
In force-push changed alignment render, to render it in same line with size
![image](https://github.com/llvm/llvm-project/assets/12231048/935beb48-4659-4a56-bc8c-dbea9bf145e2)
https://github.com/llvm/llvm-project/pull/67213
___
cfe-co
https://github.com/sr-tream edited
https://github.com/llvm/llvm-project/pull/67213
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/sr-tream edited
https://github.com/llvm/llvm-project/pull/67213
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
zyn0217 wrote:
Thank you @Endilll for the explanation. The remaining part looks good;
@sr-tream Do you have access to land the PR? If not, I'm glad to help you. :)
https://github.com/llvm/llvm-project/pull/67213
___
cfe-commits mailing list
cfe-commit
sr-tream wrote:
> Do you have access to land the PR
No, help me please to merge this PR
https://github.com/llvm/llvm-project/pull/67213
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Endilll closed
https://github.com/llvm/llvm-project/pull/67213
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/sr-tream created
https://github.com/llvm/llvm-project/pull/67213
Shows align for records and fields declarations in hover information.
Example:
```cpp
struct A {
char a;
short b;
};
```
For this struct hover informations shows:
```
Size: 4 bytes
Align: 2 bytes
```
![ima
llvmbot wrote:
@llvm/pr-subscribers-clangd
Changes
Shows align for records and fields declarations in hover information.
Example:
```cpp
struct A {
char a;
short b;
};
```
For this struct hover informations shows:
```
Size: 4 bytes
Align: 2 bytes
```
![image](https://github.com/llvm/
https://github.com/zyn0217 edited
https://github.com/llvm/llvm-project/pull/67213
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1001,6 +1001,8 @@ void addLayoutInfo(const NamedDecl &ND, HoverInfo &HI) {
if (auto *RD = llvm::dyn_cast(&ND)) {
if (auto Size = Ctx.getTypeSizeInCharsIfKnown(RD->getTypeForDecl()))
HI.Size = Size->getQuantity() * 8;
+if (!RD->isInvalidDecl() && !RD->isDepen
https://github.com/zyn0217 commented:
Thanks! This looks nice, but I think it's better to have more opinions from
others.
Moreover, I have a question regarding the test: It seems the alignment for a
field depends on the ABI spec, i.e., it could be different across MS ABI and
Itanium ABI. Is t
https://github.com/zyn0217 edited
https://github.com/llvm/llvm-project/pull/67213
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/sr-tream updated
https://github.com/llvm/llvm-project/pull/67213
>From df0b44379ab2a4ba50458db0979bddff67c3e4b5 Mon Sep 17 00:00:00 2001
From: SR_team
Date: Sat, 23 Sep 2023 03:49:23 +0300
Subject: [PATCH] [clangd] Show alignment for records and fields decls
---
clang-tools
@@ -1001,6 +1001,8 @@ void addLayoutInfo(const NamedDecl &ND, HoverInfo &HI) {
if (auto *RD = llvm::dyn_cast(&ND)) {
if (auto Size = Ctx.getTypeSizeInCharsIfKnown(RD->getTypeForDecl()))
HI.Size = Size->getQuantity() * 8;
+if (!RD->isInvalidDecl() && !RD->isDepen
sr-tream wrote:
> I'm not an expert on ABI
I too. I use exists function `ASTContext::getTypeAlign` - it must work
correctly, if other functions like `ASTContext::getTypeSizeInCharsIfKnown`
return correct results, because `ASTContext::getTypeSizeInCharsIfKnown` returns
size with paddings for a
https://github.com/sr-tream updated
https://github.com/llvm/llvm-project/pull/67213
>From 678bca64870bdc58882e242696ff548f96a5ec09 Mon Sep 17 00:00:00 2001
From: SR_team
Date: Sat, 23 Sep 2023 03:49:23 +0300
Subject: [PATCH] [clangd] Show alignment for records and fields decls
---
clang-tools
sr-tream wrote:
In force-push fixed clangd crash when hovered forward-declared types
https://github.com/llvm/llvm-project/pull/67213
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/sr-tream updated
https://github.com/llvm/llvm-project/pull/67213
>From 13e43eb68b0172c4db5c0218ad4ba566da535f67 Mon Sep 17 00:00:00 2001
From: SR_team
Date: Wed, 11 Oct 2023 09:49:11 +0300
Subject: [PATCH] [clangd] Show alignment for records and fields decls
---
clang-tools
27 matches
Mail list logo