davidxl added a comment. I suggest adding a new interface 'findBBInfo' returns pointer (which can be null) and use it in context that can do null check. Other users of the getBBInfo won't change. https://reviews.llvm.org/D27280