diff options
author | Kate Stone <katherine.stone@apple.com> | 2014-07-22 00:18:52 +0000 |
---|---|---|
committer | Kate Stone <katherine.stone@apple.com> | 2014-07-22 00:18:52 +0000 |
commit | bb1321a7befee0bc6f19101ae415d288eaf9b5d7 (patch) | |
tree | a502cbe59280ff6de6fb82207f10664a5369326f | |
parent | d6906e4ffe57bcee64e928e1204e0efd84423037 (diff) | |
download | bcm5719-llvm-bb1321a7befee0bc6f19101ae415d288eaf9b5d7.tar.gz bcm5719-llvm-bb1321a7befee0bc6f19101ae415d288eaf9b5d7.zip |
Improve LLDB's embedded C++ demangler by addressing the following two issues:
1) Preserve ref qualification state in a local variable while parsing a nested name. Previously, the state was recorded in the shared db reference and could therefore be overwritten when parsing multiple levels of nested names (e.g.: when a qualified name has qualified template args.)
2) Address an off-by-one error when testing whether or not a thunk is non-virtual. This resulted in the demangled identifying all thunks as non-virtual.
llvm-svn: 213591
-rw-r--r-- | lldb/source/Core/Mangled.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lldb/source/Core/Mangled.cpp b/lldb/source/Core/Mangled.cpp index 60cd80fa2ee..8df9fb8a239 100644 --- a/lldb/source/Core/Mangled.cpp +++ b/lldb/source/Core/Mangled.cpp @@ -3932,15 +3932,15 @@ parse_nested_name(const char* first, const char* last, C& db) const char* t0 = parse_cv_qualifiers(first+1, last, cv); if (t0 == last) return first; - db.ref = 0; + unsigned ref = 0; if (*t0 == 'R') { - db.ref = 1; + ref = 1; ++t0; } else if (*t0 == 'O') { - db.ref = 2; + ref = 2; ++t0; } db.names.emplace_back(); @@ -4054,6 +4054,7 @@ parse_nested_name(const char* first, const char* last, C& db) } } first = t0 + 1; + db.ref = ref; db.cv = cv; if (pop_subs && !db.subs.empty()) db.subs.pop_back(); @@ -4413,7 +4414,7 @@ parse_special_name(const char* first, const char* last, C& db) { if (db.names.empty()) return first; - if (first[2] == 'v') + if (first[1] == 'v') { db.names.back().first.insert(0, "virtual thunk to "); first = t; |