This is an archive of the discontinued LLVM Phabricator instance.

[NFC][CaptureTracking] Move static function isNonEscapingLocalObject to llvm namespace so that it can be used by other pass(es)
ClosedPublic

Authored by anhtuyen on Oct 15 2020, 7:08 AM.

Details

Summary

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.

Diff Detail

Event Timeline

anhtuyen created this revision.Oct 15 2020, 7:08 AM
anhtuyen requested review of this revision.Oct 15 2020, 7:08 AM
anhtuyen updated this revision to Diff 298423.Oct 15 2020, 11:04 AM

Address comment by Lint: Pre-merge checks related to clang-format

jdoerfert accepted this revision.Oct 15 2020, 11:09 AM
jdoerfert added a subscriber: jdoerfert.

LGTM

This revision is now accepted and ready to land.Oct 15 2020, 11:09 AM