Skip to content

Commit 8d59f55

Browse files
zygoloidliujinye-sys
authored andcommitted
Implement demangling support for C++20 lambda expression extensions.
This implements demangling support for the mangling extensions specified in itanium-cxx-abi/cxx-abi#85, much of which is implemented in Clang r359967 and r371004. Specifically, this provides demangling for: * <template-param-decl> in <lambda-sig> * <template-param> with non-zero level * lambda-expression literals (not emitted by Clang yet) * nullptr literals * string literals (The final two seem unrelated, but handling them was necessary in order to disambiguate between lambda expressions and the other forms of literal for which we have a type but no value.) When demangling a <lambda-sig>, we form template parameters with no corresponding argument, so we cannot substitute in the argument in the demangling. Instead we invent synthetic names for the template parameters (eg, '[]<typename $T>($T *x)'). llvm-svn: 371273
1 parent fc2f95e commit 8d59f55

File tree

3 files changed

+429
-31
lines changed

3 files changed

+429
-31
lines changed

src/cxa_demangle.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,16 @@ struct DumpVisitor {
171171
return printStr("SpecialSubKind::iostream");
172172
}
173173
}
174+
void print(TemplateParamKind TPK) {
175+
switch (TPK) {
176+
case TemplateParamKind::Type:
177+
return printStr("TemplateParamKind::Type");
178+
case TemplateParamKind::NonType:
179+
return printStr("TemplateParamKind::NonType");
180+
case TemplateParamKind::Template:
181+
return printStr("TemplateParamKind::Template");
182+
}
183+
}
174184

175185
void newLine() {
176186
printStr("\n");

0 commit comments

Comments
 (0)