[PATCH] D80409: [MS ABI] Add mangled type for auto template parameter whose argument kind is Integeral
Reid "Away June-Sep" Kleckner via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 10 14:33:46 PDT 2020
rnk added inline comments.
================
Comment at: clang/lib/AST/MicrosoftMangle.cpp:383
+ const NonTypeTemplateParmDecl *PD = nullptr,
+ QualType *TemplateArgType = nullptr);
+ void mangleExpression(const Expr *E, const NonTypeTemplateParmDecl *PD);
----------------
I see you need an optional QualType here. Can you do this: `QualType TemplateArgType = QualType()`? I believe it will create a null QualType, which you can then check for with `.isNull()`.
QualType is pointer-sized and is generally passed by value. I think it will help make the other call sites shorter, so they don't need to take the address of a local variable.
================
Comment at: clang/lib/AST/MicrosoftMangle.cpp:1390
+ QualType T = E->getType();
+ mangleIntegerLiteral(Value, PD, &T);
return;
----------------
For example, if you can avoid the pointer indirection, you can avoid the local variable here.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80409/new/
https://reviews.llvm.org/D80409
More information about the cfe-commits
mailing list