[flang-commits] [flang] [flang] Show types in DumpEvExpr (PR #143743)
Krzysztof Parzyszek via flang-commits
flang-commits at lists.llvm.org
Mon Jun 16 09:46:39 PDT 2025
================
@@ -38,6 +39,39 @@ class DumpEvaluateExpr {
}
private:
+ template <typename T> struct TypeOf {
+ static constexpr std::string_view get() {
+#if defined(__GNUC__)
+ std::string_view v(__PRETTY_FUNCTION__);
+ // Extract the "xyz" from the "pretty function" string:
+ // "... [with T = xyz; std::string_view = ...]"
+ std::string_view front("with T = ");
+ std::string_view back("; std::string_view =");
+
+#elif defined(_MSC_VER)
+ std::string_view v(__FUNCSIG__);
+ // Extract the "xyz" from the "pretty function" string:
+ // "... TypeOf<xyz>::get(void)"
+ std::string_view front(" TypeOf<");
+ std::string_view back(">::get(void)");
+
+#else
+ return "";
+#endif
+
+ if (auto fpos{v.find(front)}; fpos != v.npos) {
----------------
kparzysz wrote:
That is fixed now.
https://github.com/llvm/llvm-project/pull/143743
More information about the flang-commits
mailing list