davidxl added a comment. Since the unlock is the common path, why not replacing goto with a helper as well? lprofUnlockIfNeeded(profileRequiresUnlock, File); return; CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69586/new/ https://reviews.llvm.org/D69586