-
Couldn't load subscription status.
- Fork 36
Closed
Labels
Needs triageUsed in auto labelling of new issuesUsed in auto labelling of new issues
Description
I see that xdemangle.hpp provides the demangle function.
Lines 41 to 42 in e9df705
| const char* demangle(const char* name) noexcept; | |
| const char* demangle(const std::string& name) noexcept; |
This should technically be used in xinspect in the implementation of find_type (as done for xeus-cling)
But we are currently using find_type_slow (the function name suggests this might not be the best approach ?!)
Lines 82 to 99 in e9df705
| std::string find_type_slow(const std::string& expression) { | |
| static unsigned long long var_count = 0; | |
| if (auto *type = Cpp::GetType(expression)) | |
| return Cpp::GetQualifiedName(type); | |
| // Here we might need to deal with integral types such as 3.14. | |
| std::string id = "__Xeus_GetType_" + std::to_string(var_count++); | |
| std::string using_clause = "using " + id + " = __typeof__(" + expression + ");\n"; | |
| if (!Cpp::Declare(using_clause.c_str(), /*silent=*/false)) { | |
| Cpp::TCppScope_t lookup = Cpp::GetNamed(id, nullptr); | |
| Cpp::TCppType_t lookup_ty = Cpp::GetTypeFromScope(lookup); | |
| return Cpp::GetQualifiedCompleteName(Cpp::GetCanonicalType(lookup_ty)); | |
| } | |
| return ""; | |
| } |
But if we are not trying to implement a "find_type_fast" and are comfortable with what we have, let's get rid of xdemangle.hpp ?
Metadata
Metadata
Assignees
Labels
Needs triageUsed in auto labelling of new issuesUsed in auto labelling of new issues