https://github.com/zahiraam updated
https://github.com/llvm/llvm-project/pull/67592
>From 55b67a58ef8b9856e5f0a8f535b8617f59711dec Mon Sep 17 00:00:00 2001
From: Ammarguellat
Date: Wed, 27 Sep 2023 11:59:04 -0700
Subject: [PATCH 01/20] Fix value of __FUNCTION__ and __func__ in MSVC mode.
---
zahiraam wrote:
> > struct struct X
>
> Interesting! The LIT test is passing on a debug build on Windows and
> generating the right output:
>
> `VarDecl:{ResultType struct X}{TypedText f1} (50) (deprecated)`
>
> I will try a release build.
It looks like I can reproduce it with the release bu
zahiraam wrote:
> struct struct X
Interesting! The LIT test is passing on a debug build on Windows and
generating the right output:
`VarDecl:{ResultType struct X}{TypedText f1} (50) (deprecated)`
I will try a release build.
https://github.com/llvm/llvm-project/pull/67592
__
https://github.com/AaronBallman commented:
The failure found by CI looks to be related:
```
:422:1: note: possible intended match here
VarDecl:{ResultType struct struct X}{TypedText f1} (50) (deprecated)
```
(note the `struct struct`).
https://github.com/llvm/llvm-project/pull/67592
https://github.com/zahiraam updated
https://github.com/llvm/llvm-project/pull/67592
>From 55b67a58ef8b9856e5f0a8f535b8617f59711dec Mon Sep 17 00:00:00 2001
From: Ammarguellat
Date: Wed, 27 Sep 2023 11:59:04 -0700
Subject: [PATCH 01/19] Fix value of __FUNCTION__ and __func__ in MSVC mode.
---
@@ -2260,10 +2269,15 @@ printTo(raw_ostream &OS, ArrayRef Args, const
PrintingPolicy &Policy,
} else {
if (!FirstArg)
OS << Comma;
- // Tries to print the argument with location info if exists.
- printArgument(Arg, Policy, ArgOS,
-
@@ -1635,6 +1635,15 @@ void TypePrinter::printElaboratedBefore(const
ElaboratedType *T,
if (T->getKeyword() != ElaboratedTypeKeyword::None)
OS << " ";
NestedNameSpecifier *Qualifier = T->getQualifier();
+if (Policy.SuppressTagKeyword && Policy.SuppressScope)
@@ -713,11 +714,21 @@ std::string
PredefinedExpr::ComputeName(PredefinedIdentKind IK,
return std::string(Out.str());
}
if (const FunctionDecl *FD = dyn_cast(CurrentDecl)) {
-if (IK != PredefinedIdentKind::PrettyFunction &&
-IK != PredefinedIdentKind::Pretty
@@ -665,7 +665,8 @@ StringRef
PredefinedExpr::getIdentKindName(PredefinedIdentKind IK) {
// FIXME: Maybe this should use DeclPrinter with a special "print predefined
AaronBallman wrote:
The more complex we make this, the more I think this FIXME sounds like a
s
@@ -3740,7 +3740,11 @@ ExprResult Sema::BuildPredefinedExpr(SourceLocation Loc,
else {
// Pre-defined identifiers are of type char[x], where x is the length of
// the string.
-auto Str = PredefinedExpr::ComputeName(IK, currentDecl);
+bool ForceElaboratedPrinti
zahiraam wrote:
> @AaronBallman I removed the field that I added in the policy and tried to use
> the existing ones. That broke a few LIT tests but before fixing them I want
> to check with you if the combination of policy I have added in the unittest
> is correct. Thanks.
ping?
https://gith
zahiraam wrote:
@AaronBallman I removed the field that I added in the policy and tried to use
the existing ones. That broke a few LIT tests but before fixing them I want to
check with you if the combination of policy I have added in the unittest is
correct. Thanks.
https://github.com/llvm/ll
https://github.com/zahiraam updated
https://github.com/llvm/llvm-project/pull/67592
>From 55b67a58ef8b9856e5f0a8f535b8617f59711dec Mon Sep 17 00:00:00 2001
From: Ammarguellat
Date: Wed, 27 Sep 2023 11:59:04 -0700
Subject: [PATCH 01/18] Fix value of __FUNCTION__ and __func__ in MSVC mode.
---
https://github.com/zahiraam updated
https://github.com/llvm/llvm-project/pull/67592
>From 55b67a58ef8b9856e5f0a8f535b8617f59711dec Mon Sep 17 00:00:00 2001
From: Ammarguellat
Date: Wed, 27 Sep 2023 11:59:04 -0700
Subject: [PATCH 01/17] Fix value of __FUNCTION__ and __func__ in MSVC mode.
---
https://github.com/AaronBallman commented:
Precommit CI has relevant failures.
https://github.com/llvm/llvm-project/pull/67592
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1635,6 +1635,14 @@ void TypePrinter::printElaboratedBefore(const
ElaboratedType *T,
if (T->getKeyword() != ElaboratedTypeKeyword::None)
OS << " ";
NestedNameSpecifier *Qualifier = T->getQualifier();
+if (Policy.FullyQualifiedName) {
Aaron
https://github.com/AaronBallman edited
https://github.com/llvm/llvm-project/pull/67592
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/zahiraam updated
https://github.com/llvm/llvm-project/pull/67592
>From 55b67a58ef8b9856e5f0a8f535b8617f59711dec Mon Sep 17 00:00:00 2001
From: Ammarguellat
Date: Wed, 27 Sep 2023 11:59:04 -0700
Subject: [PATCH 01/16] Fix value of __FUNCTION__ and __func__ in MSVC mode.
---
@@ -326,6 +326,10 @@ struct PrintingPolicy {
LLVM_PREFERRED_TYPE(bool)
unsigned AlwaysIncludeTypeForTemplateArgument : 1;
+ // Whether to print the type as an elaborated type. This is used when
+ // printing a function via the _FUNCTION__ macro in MSVC mode.
+ unsigned
@@ -897,7 +897,8 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) {
D->getBody()->printPrettyControlled(Out, nullptr, SubPolicy,
Indentation, "\n",
&Context);
} else {
- if (!Policy.TerseOutput && isa(*D))
+ if (Po
@@ -1635,6 +1635,13 @@ void TypePrinter::printElaboratedBefore(const
ElaboratedType *T,
if (T->getKeyword() != ElaboratedTypeKeyword::None)
OS << " ";
NestedNameSpecifier *Qualifier = T->getQualifier();
+if (Policy.ForcePrintingAsElaboratedType) {
+ if (
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff d1f510cca8e966bd1742bf17256bfec99dcdf229
09c7dd2f5973a36448dd7ea17664f13c28aa --
https://github.com/zahiraam updated
https://github.com/llvm/llvm-project/pull/67592
>From 55b67a58ef8b9856e5f0a8f535b8617f59711dec Mon Sep 17 00:00:00 2001
From: Ammarguellat
Date: Wed, 27 Sep 2023 11:59:04 -0700
Subject: [PATCH 01/15] Fix value of __FUNCTION__ and __func__ in MSVC mode.
---
https://github.com/zahiraam updated
https://github.com/llvm/llvm-project/pull/67592
>From 55b67a58ef8b9856e5f0a8f535b8617f59711dec Mon Sep 17 00:00:00 2001
From: Ammarguellat
Date: Wed, 27 Sep 2023 11:59:04 -0700
Subject: [PATCH 01/14] Fix value of __FUNCTION__ and __func__ in MSVC mode.
---
https://github.com/zahiraam updated
https://github.com/llvm/llvm-project/pull/67592
>From 55b67a58ef8b9856e5f0a8f535b8617f59711dec Mon Sep 17 00:00:00 2001
From: Ammarguellat
Date: Wed, 27 Sep 2023 11:59:04 -0700
Subject: [PATCH 01/13] Fix value of __FUNCTION__ and __func__ in MSVC mode.
---
https://github.com/zahiraam updated
https://github.com/llvm/llvm-project/pull/67592
>From 55b67a58ef8b9856e5f0a8f535b8617f59711dec Mon Sep 17 00:00:00 2001
From: Ammarguellat
Date: Wed, 27 Sep 2023 11:59:04 -0700
Subject: [PATCH 01/12] Fix value of __FUNCTION__ and __func__ in MSVC mode.
---
https://github.com/zahiraam updated
https://github.com/llvm/llvm-project/pull/67592
>From 55b67a58ef8b9856e5f0a8f535b8617f59711dec Mon Sep 17 00:00:00 2001
From: Ammarguellat
Date: Wed, 27 Sep 2023 11:59:04 -0700
Subject: [PATCH 01/11] Fix value of __FUNCTION__ and __func__ in MSVC mode.
---
https://github.com/zahiraam closed
https://github.com/llvm/llvm-project/pull/67592
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
AaronBallman wrote:
We have unit tests for these that live at:
https://github.com/llvm/llvm-project/blob/32d16b64d3125e76f65d7d88a302a33618eb0e6e/clang/unittests/AST/TypePrinterTest.cpp
and
https://github.com/llvm/llvm-project/blob/32d16b64d3125e76f65d7d88a302a33618eb0e6e/clang/unittests/AST/D
AaronBallman wrote:
> @AaronBallman By pretty printed you mean the use of **PRETTY_FUNCTION** right?
No, I mean using the `DeclPrinter` and `TypePrinter` interfaces that are used
to implement `-ast-print`:
https://github.com/llvm/llvm-project/blob/32d16b64d3125e76f65d7d88a302a33618eb0e6e/clang/
zahiraam wrote:
> struct S { int x; };
> namespace NS {
> class C {};
> }
>
> S foo(S s1, NS::C c1) {
> S s12{12};
> using namespace NS;
> C c;
> }
@AaronBallman By pretty printed you mean the use of __PRETTY_FUNCTION__ right?
In MSVC this macro is not defined. The equivalent one is FUNCS
https://github.com/AaronBallman commented:
I'd appreciate some unit tests showing that we print the elaboration in other
circumstances. e.g.,
```
struct S { int x; };
namespace NS {
class C {};
}
S foo(S s1, NS::C c1) {
S s12{12};
using namespace NS;
C c;
}
```
ensuring that we pretty pri
https://github.com/zahiraam updated
https://github.com/llvm/llvm-project/pull/67592
>From 55b67a58ef8b9856e5f0a8f535b8617f59711dec Mon Sep 17 00:00:00 2001
From: Ammarguellat
Date: Wed, 27 Sep 2023 11:59:04 -0700
Subject: [PATCH 01/11] Fix value of __FUNCTION__ and __func__ in MSVC mode.
---
@@ -463,8 +470,73 @@ void ctor_tests() {
constexpr SL global_sl = SL::current();
static_assert(is_equal(global_sl.function(), ""));
+template
+class TestBI {
+public:
+ TestBI() {
+#ifdef MS
+ static_assert(is_equal(__FUNCTION__, "test_func::TestBI::TestBI"));
+ s
@@ -2218,6 +2219,24 @@ printTo(raw_ostream &OS, ArrayRef Args, const
PrintingPolicy &Policy,
} else {
if (!FirstArg)
OS << Comma;
+
+ if (Policy.UseClassForTemplateArgument &&
+ Argument.getKind() == TemplateArgument::Type &&
+ !Argumen
https://github.com/zahiraam updated
https://github.com/llvm/llvm-project/pull/67592
>From 55b67a58ef8b9856e5f0a8f535b8617f59711dec Mon Sep 17 00:00:00 2001
From: Ammarguellat
Date: Wed, 27 Sep 2023 11:59:04 -0700
Subject: [PATCH 1/7] Fix value of __FUNCTION__ and __func__ in MSVC mode.
---
cl
https://github.com/zahiraam edited
https://github.com/llvm/llvm-project/pull/67592
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
37 matches
Mail list logo