MCPcopy Create free account
hub / github.com/ccache/ccache / parse_inlined_from_msg

Function parse_inlined_from_msg

src/ccache/core/common.cpp:104–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104inline bool
105parse_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
128inline bool
129parse_in_file_included_from_msg(std::string_view& line, std::string& result)

Callers 1

Calls 2

dataMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected