| 102 | } |
| 103 | |
| 104 | inline bool |
| 105 | parse_inlined_from_msg(std::string_view& line, std::string& result) |
| 106 | { |
| 107 | // Reference for GCC: <https://github.com/gcc-mirror/gcc/blob/ |
| 108 | // c7507e395f096240ffa8fa5dfcbfcfd8c5e23bb8/gcc/langhooks.cc#L450-L467> |
| 109 | static const std::string_view inlined_from_msg = " inlined from "; |
| 110 | static const std::string_view inlined_from_msg_separator = " at "; |
| 111 | |
| 112 | if (!line.starts_with(inlined_from_msg)) { |
| 113 | return false; |
| 114 | } |
| 115 | |
| 116 | size_t signature_end = line.find(inlined_from_msg_separator); |
| 117 | if (signature_end == std::string_view::npos) { |
| 118 | return false; |
| 119 | } |
| 120 | |
| 121 | signature_end += inlined_from_msg_separator.size(); |
| 122 | result.append(line.data(), signature_end); |
| 123 | line = line.substr(signature_end); |
| 124 | |
| 125 | return true; |
| 126 | } |
| 127 | |
| 128 | inline bool |
| 129 | parse_in_file_included_from_msg(std::string_view& line, std::string& result) |
no test coverage detected