[PATCH] D68917: [Demangle] Add a few more options to the microsoft demangler
Reid Kleckner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 14 14:12:38 PDT 2019
rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.
lgtm
================
Comment at: llvm/lib/Demangle/MicrosoftDemangleNodes.cpp:588
+ if (!(Flags & OF_NoAccessSpecifier)) {
+ switch (SC) {
+ case StorageClass::PrivateStatic:
----------------
mstorsjo wrote:
> rnk wrote:
> > Code golf suggestion:
> > ```
> > StringRef AccessSpec;
> > bool IsStatic = true;
> > switch (SC) {
> > case StorageClass::PrivateStatic:
> > AccessSpec = "private";
> > break;
> > case StorageClass::ProtectedStatic:
> > AccessSpec = "protected";
> > break;
> > case StorageClass::PublicStatic:
> > AccessSpec = "public";
> > break;
> > default:
> > IsStatic = false;
> > break;
> > }
> > if (!(Flags & OF_NoAccessSpecifier) && !AccessSpec.empty())
> > OS << AccessSpec << ": ";
> > if (!(Flags & OF_NoNoMemberType) && IsStatic)
> > OS << "static";
> > ```
> Neat! StringRef isn't really allowed here, but using `const char *` isn't any more cumbersome here.
Right. Wow, I guess the demangler has it's whole own set of operator<< overloads. >_>
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68917/new/
https://reviews.llvm.org/D68917
More information about the llvm-commits
mailing list