summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Demangle
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2018-11-13 20:18:26 +0000
committerNico Weber <nicolasweber@gmx.de>2018-11-13 20:18:26 +0000
commita92b46395572a1049f4b5aaea0276cfcf9f46252 (patch)
tree6ea01701c140117e48c321fad3c0087ec65749f0 /llvm/lib/Demangle
parentd8fd0ec0329de1181d47eca073843ca2b80e2acc (diff)
downloadbcm5719-llvm-a92b46395572a1049f4b5aaea0276cfcf9f46252.tar.gz
bcm5719-llvm-a92b46395572a1049f4b5aaea0276cfcf9f46252.zip
[MS Demangler] Print public:, protected:, private: if set in FunctionClass or a variable's StorageClass.
undname prints them, and the information is in the decorated name, so we probably shouldn't lose it when undecorating. I spot-checked a few of the funnier-looking outputs, and undname has the same output. Differential Revision: https://reviews.llvm.org/D54396 llvm-svn: 346791
Diffstat (limited to 'llvm/lib/Demangle')
-rw-r--r--llvm/lib/Demangle/MicrosoftDemangleNodes.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/llvm/lib/Demangle/MicrosoftDemangleNodes.cpp b/llvm/lib/Demangle/MicrosoftDemangleNodes.cpp
index bfd40eac50f..c57f0cfaaa5 100644
--- a/llvm/lib/Demangle/MicrosoftDemangleNodes.cpp
+++ b/llvm/lib/Demangle/MicrosoftDemangleNodes.cpp
@@ -368,16 +368,23 @@ void LiteralOperatorIdentifierNode::output(OutputStream &OS,
void FunctionSignatureNode::outputPre(OutputStream &OS,
OutputFlags Flags) const {
+ if (FunctionClass & FC_Public)
+ OS << "public: ";
+ if (FunctionClass & FC_Protected)
+ OS << "protected: ";
+ if (FunctionClass & FC_Private)
+ OS << "private: ";
+
if (!(FunctionClass & FC_Global)) {
if (FunctionClass & FC_Static)
OS << "static ";
}
- if (FunctionClass & FC_ExternC)
- OS << "extern \"C\" ";
-
if (FunctionClass & FC_Virtual)
OS << "virtual ";
+ if (FunctionClass & FC_ExternC)
+ OS << "extern \"C\" ";
+
if (ReturnType) {
ReturnType->outputPre(OS, Flags);
OS << " ";
@@ -554,9 +561,13 @@ void FunctionSymbolNode::output(OutputStream &OS, OutputFlags Flags) const {
void VariableSymbolNode::output(OutputStream &OS, OutputFlags Flags) const {
switch (SC) {
case StorageClass::PrivateStatic:
+ OS << "private: static ";
+ break;
case StorageClass::PublicStatic:
+ OS << "public: static ";
+ break;
case StorageClass::ProtectedStatic:
- OS << "static ";
+ OS << "protected: static ";
break;
default:
break;
OpenPOWER on IntegriCloud