llvm.org GIT mirror llvm / f2a3664
Revert "Demangle: only demangle mangled symbols" This reverts SVN r286795. This was incorrect the demangler is expected to be able to demangle types as well as functions. This makes the behaviour of itaniumDemangle similar to __cxa_demangle once more. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292573 91177308-0d34-0410-b5e6-96231b3b80d8 Saleem Abdulrasool 2 years ago
1 changed file(s) with 1 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
42244224 *status = invalid_args;
42254225 return nullptr;
42264226 }
4227
4228 size_t len = std::strlen(mangled_name);
4229 if (len < 2 || strncmp(mangled_name, "_Z", 2)) {
4230 if (len < 4 || strncmp(mangled_name, "___Z", 4)) {
4231 if (status)
4232 *status = invalid_mangled_name;
4233 return nullptr;
4234 }
4235 }
4236
42374227 size_t internal_size = buf != nullptr ? *n : 0;
42384228 Db db;
42394229 db.template_param.emplace_back();
42404230 int internal_status = success;
4231 size_t len = std::strlen(mangled_name);
42414232 demangle(mangled_name, mangled_name + len, db, internal_status);
42424233 if (internal_status == success && db.fix_forward_references &&
42434234 !db.template_param.empty() && !db.template_param.front().empty()) {