[llvm] [LLVM Demangler] Set `InConstraintExpr` to `true` when demangling a c… (PR #107385)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 10 00:42:46 PDT 2024
https://github.com/VitaNuo updated https://github.com/llvm/llvm-project/pull/107385
>From c0d56a920b7c9e9f65b568d9694fba6266b305bf Mon Sep 17 00:00:00 2001
From: Viktoriia Bakalova <bakalova at google.com>
Date: Thu, 5 Sep 2024 11:38:23 +0000
Subject: [PATCH 1/2] [LLVM Demangler] Set `InConstraintExpr` to `true` when
demangling a constraint expression. This prevents demangler failures before
the TODO in the
[demangler](https://github.com/llvm/llvm-project/blob/3e070906eff720dc44aee86e533e12aafc8bb14b/llvm/include/llvm/Demangle/ItaniumDemangle.h#L5678).
---
llvm/include/llvm/Demangle/ItaniumDemangle.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/llvm/include/llvm/Demangle/ItaniumDemangle.h b/llvm/include/llvm/Demangle/ItaniumDemangle.h
index fb2060fa07f724..5c044def74e881 100644
--- a/llvm/include/llvm/Demangle/ItaniumDemangle.h
+++ b/llvm/include/llvm/Demangle/ItaniumDemangle.h
@@ -5737,6 +5737,7 @@ Node *AbstractManglingParser<Derived, Alloc>::parseTemplateParamDecl(
}
if (consumeIf("Tk")) {
+ ScopedOverride<bool> SaveInConstraintExpr(InConstraintExpr, true);
Node *Constraint = getDerived().parseName();
if (!Constraint)
return nullptr;
>From 11c7302be96c5c50836aa3d0c128cee3023d8cca Mon Sep 17 00:00:00 2001
From: Viktoriia Bakalova <bakalova at google.com>
Date: Thu, 5 Sep 2024 11:38:23 +0000
Subject: [PATCH 2/2] [ItaniumDemangle] Set `InConstraintExpr` to `true` when
demangling a constraint expression. This prevents demangler failures until
the TODO in the
[demangler](https://github.com/llvm/llvm-project/blob/3e070906eff720dc44aee86e533e12aafc8bb14b/llvm/include/llvm/Demangle/ItaniumDemangle.h#L5678)
is fixed.
---
.../test/tools/llvm-cxxfilt/demangle-constrained-template.test | 3 +++
1 file changed, 3 insertions(+)
create mode 100644 llvm/test/tools/llvm-cxxfilt/demangle-constrained-template.test
diff --git a/llvm/test/tools/llvm-cxxfilt/demangle-constrained-template.test b/llvm/test/tools/llvm-cxxfilt/demangle-constrained-template.test
new file mode 100644
index 00000000000000..7a038ebb77a06d
--- /dev/null
+++ b/llvm/test/tools/llvm-cxxfilt/demangle-constrained-template.test
@@ -0,0 +1,3 @@
+RUN: llvm-cxxfilt -n _ZN3FooIiE6methodITk4TrueIT_EiEEvS3_ | FileCheck %s
+
+CHECK: void Foo<int>::method<int>(T)
\ No newline at end of file
More information about the llvm-commits
mailing list