Function isNonEscapingLocalObject is a static one within BasicAliasAnalysis.cpp. It wraps around PointerMayBeCaptured of CaptureTracking, checking whether a pointer is to a function-local object, which never escapes from the function. Although at the moment, isNonEscapingLocalObject is used only by BasicAliasAnalysis, its functionality can be used by other pass(es), one of which I will put up for review very soon.
Instead of copying the contents of this static function, I propose that we move it to llvm scope, and place it amongst other functions with similar functionality in CaptureTracking. The rationale for the location are:
- Pointer escape and pointer being captured are actually two sides of the same coin
- isNonEscapingLocalObject is wrapping around another function in CaptureTracking
I have built and tested this change with check-all: there is no regression as I had expected.