Closed nanana37 closed 6 months ago
命令の型を確認してそれに合わせた処理を繰り返す getOrigin()
関数の実装をシンプルにできそう.
Note that the dyn_cast<> operator, like C++’s dynamic_cast<> or Java’s instanceof operator, can be abused. In particular, you should not use big chained if/then/else blocks to check for lots of different variants of classes. If you find yourself wanting to do this, it is much cleaner and more efficient to use the InstVisitor class to dispatch over the instruction type directly.
無事置き換えに成功.返り値を指定することで理想の使い方になりました.
https://github.com/nanana37/eacces-modifier/commit/c41cc6f8a39ceeed40062f6163637ef0bf0097ea
https://llvm.org/doxygen/classllvm_1_1InstVisitor.html