[PATCH] D56184: [CallSite removal] Move the rest of IR implementation code away from `CallSite`.

Saleem Abdulrasool via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 6 22:48:29 PST 2019


compnerd accepted this revision.
compnerd added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/include/llvm/IR/PatternMatch.h:1489
+    // FIXME: Should likely be switched to use `CallBase`.
+    auto *CI = dyn_cast<CallInst>(V);
+    return CI && Val.match(CI->getArgOperand(OpI));
----------------
Would be nicer as:

```
  if (const auto *CI = dyn_cast<CallInst>(V))
    if (Val.match(CI->getArgOperand(OpI))
      return true;
  return false;
```

I wish there was more context as to why an invoke is being ignored.


================
Comment at: llvm/lib/IR/Function.cpp:1294
+    const auto *Call = dyn_cast<CallBase>(&*I);
+    if (Call && Call->hasFnAttr(Attribute::ReturnsTwice))
       return true;
----------------
I think this would be nicer as:

```
  if (const auto *Call = dyn_cast<CallBase>(&*I))
    if (Call->hasFnAttr(Attribute::ReturnsTwice))
      return true;
```


Repository:
  rL LLVM

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

https://reviews.llvm.org/D56184





More information about the llvm-commits mailing list