chill added a comment. FWIW, probably a single CALLSITE_DELAGATE macro could be used all over: #define CALLSITE_DELEGATE(METHOD) \ InstrTy *II = getInstruction(); \ return isCall() \ ? cast<CallInst>(II)->METHOD \ : cast<InvokeInst>(II)->METHOD https://reviews.llvm.org/D34406