[PATCH] D108478: [llvm][IR] Add no_cfi constant

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 6 11:30:26 PST 2021


nickdesaulniers accepted this revision.
nickdesaulniers added a comment.
This revision is now accepted and ready to land.

LGTM. @pcc do you have any additional feedback?



================
Comment at: llvm/lib/IR/Constants.cpp:1992
+
+  auto *ToObj = To->stripPointerCasts();
+  assert(isa<GlobalValue>(ToObj) &&
----------------
I wouldn't use `auto` here. If we don't reuse `To`, then perhaps simply

```
To = To->stripPointerCasts();
```
would do.


================
Comment at: llvm/lib/IR/Constants.cpp:1993-1996
+  assert(isa<GlobalValue>(ToObj) &&
+         "Can only replace the operands with a global value");
+
+  auto *GV = cast<GlobalValue>(ToObj);
----------------
or you could do:

```
auto *GV =  dyn_cast<GlobalValue>(To);
assert(GV && "Can only replace the operands with a global value");
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108478



More information about the llvm-commits mailing list