[llvm-branch-commits] [llvm] [llvm-profgen][NFC] Factor out parseAddress (PR #191594)

Amir Ayupov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Apr 10 22:44:05 PDT 2026


================
@@ -656,6 +656,13 @@ void HybridPerfReader::unwindSamples() {
                      "frame to match.");
 }
 
+/// Parse a hex address from \p Str.
+static bool parseAddress(StringRef Str, uint64_t &Addr, bool HasPrefix) {
+  if (Str.consume_front("0x") != HasPrefix)
+    return false;
----------------
aaupov wrote:

```suggestion
    return true;
```
to align with `getAsInteger` returning true on error and false on success

https://github.com/llvm/llvm-project/pull/191594


More information about the llvm-branch-commits mailing list