File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
flang/include/flang/Semantics Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -41,17 +41,27 @@ class DumpEvaluateExpr {
4141private:
4242 template <typename T> struct TypeOf {
4343 static constexpr std::string_view get () {
44+ #if defined(__GNUC__)
4445 std::string_view v (__PRETTY_FUNCTION__);
4546 // Extract the "xyz" from the "pretty function" string:
4647 // "... [with T = xyz; std::string_view = ...]"
4748 std::string_view front (" with T = " );
4849 std::string_view back (" ; std::string_view =" );
4950
51+ #elif defined(_MSC_VER)
52+ std::string_view v (__FUNCSIG__);
53+ // Extract the "xyz" from the "pretty function" string:
54+ // "... TypeOf<xyz>::get(void)"
55+ std::string_view front (" TypeOf<" );
56+ std::string_view back (" >::get(void)" );
57+
58+ #else
59+ return " " ;
60+ #endif
61+
5062 if (auto fpos{v.find (front)}; fpos != v.npos ) {
51- // Strip the part "... [with T = "
5263 v.remove_prefix (fpos + front.size ());
5364 if (auto bpos{v.find (back)}; bpos != v.npos ) {
54- // Strip the ending "; std::string_view = ...]"
5565 v.remove_suffix (v.size () - bpos);
5666 return v;
5767 }
You can’t perform that action at this time.
0 commit comments