[llvm] [GSYM] Callsites: Add data format support and loading from YAML (PR #109781)

Kyungwoo Lee via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 14 09:49:07 PST 2024


================
@@ -385,6 +385,12 @@ uint32_t GsymCreator::insertString(StringRef S, bool Copy) {
   return StrOff;
 }
 
+StringRef GsymCreator::getString(uint32_t offset) {
----------------
kyulee-com wrote:

I'm fine with not using optional value.
As for the assertion below, you could do this way.
```
  auto I = StringOffsetMap.find(offset);
  assert(I != StringOffsetMap.end() && 
         "GsymCreator::getString expects a valid offset as parameter.");
  return I->second.val();
  ```

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


More information about the llvm-commits mailing list