[PATCH] D98668: Support !heapallocsite attachments in StripDebugInfo().

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 16 09:59:05 PDT 2021


vsk added inline comments.


================
Comment at: llvm/lib/IR/DebugInfo.cpp:350
+      if (I.hasMetadataOtherThanDebugLoc())
+        I.setMetadata("heapallocsite", nullptr);
     }
----------------
Is it possible to reach this when the instruction has no heapallocsite metadata?

If so, we might want a narrower change, like:
```
if (auto *MD = I.getMetadata("heapallocsite"))
  I.setMetadata("heapallocsite", nullptr);
```

Or we might want to guarantee that we drop non-debug metadata, like:
```
I.dropUnknownNonDebugMetadata();
```

Ditto for D98667.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98668/new/

https://reviews.llvm.org/D98668



More information about the llvm-commits mailing list