| 97 | constexpr std::string_view BlowUpMsg = "Blow-up Amt: "; |
| 98 | |
| 99 | static std::string_view SanitizeDisassembly(std::string_view Message) { |
| 100 | auto it = Message.find(" (addr"); |
| 101 | // If it contains an address calculation, strip it out. |
| 102 | Message = Message.substr(0, it); |
| 103 | if (Message.find("adrp ") != std::string_view::npos || Message.find("adr ") != std::string_view::npos) { |
| 104 | Message = Message.substr(0, Message.find(" #")); |
| 105 | } |
| 106 | return Message; |
| 107 | } |
| 108 | |
| 109 | bool CodeSizeValidation::ParseMessage(const char* Message) { |
| 110 | // std::string_view doesn't have contains until c++23. |