[PATCH] D62122: [NFC] Introduce SwitchInst wrapper for prof branch_weights handling

Yevgeny Rouban via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 22 08:10:26 PDT 2019


yrouban marked 5 inline comments as done.
yrouban added inline comments.


================
Comment at: llvm/include/llvm/IR/Instructions.h:3455
+  SwitchInst *operator->() { return &SI; }
+  SwitchInst &operator*() { return SI; }
+  operator SwitchInst *() { return &SI; }
----------------
davidxl wrote:
> nit: is it necessary to have 3 things doing the same thing?
This is a //syntax sugar// which allows us to minimize code changes in subsequent patches.
E.g. 
SwitchInst *SI = x; is changed to SwitchInstProfBranchWeightsWrapper SI = x;
Then we can keep unchanged calls like //SI->methods()// or sending parameters of type SwitchInst* or SwitchInst&.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62122





More information about the llvm-commits mailing list