[PATCH] D154119: Fix: Distinguish CFI Metadata Checks in MergeFunctions Pass

Kyungwoo Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 24 20:59:29 PDT 2023


kyulee added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/FunctionComparator.cpp:802
+  if (auto *MDL = dyn_cast<MetadataAsValue>(L)) {
+    auto *MDR = cast<MetadataAsValue>(R);
+
----------------
kyulee wrote:
> Like the below Constant case below, can you run dyn_cast more explicit to ensure they're not null?.
>  ```
> auto *MDL = cast<MetadataAsValue>(L);
> auto *MDR = cast<MetadataAsValue>(R);
> if (MDL && MDR) {
> ```
Sorry. I meant `dyn_cast` not `cast`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154119



More information about the llvm-commits mailing list