[PATCH] D34011: [IR] Remove getNumSuccessorsV/getSuccessorV/setSuccessorV from the TerminatorInst subclasses as much as possible now that Value has been de-virtualized

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 7 13:49:40 PDT 2017


craig.topper created this revision.

These used to be virtual methods that would enable doing the right thing with only a TerminatorInst pointer. I believe they were also acting as vtable anchors in my cases. I think the fact that they had a separate name ending in V was to allow a version without V to be called without a virtual call in a pre-C++11 final keyword world.

Now that that the value hierarchy has been de-virtualized we can clean this up.

Where possible the base methods in TerminatorInst dispatch directly to the public methods in the classes that have the same signature. For some classes this wasn't possible so I've left private method versions that match the name and signature of the version in TerminatorInst. All versions have been moved into the class definitions since we no longer need vtable anchors here.


https://reviews.llvm.org/D34011

Files:
  include/llvm/IR/Instructions.h
  lib/IR/Instructions.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34011.101808.patch
Type: text/x-patch
Size: 9659 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170607/c50bc9db/attachment.bin>


More information about the llvm-commits mailing list