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

Anh Tuyen Tran via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 15 07:08:36 PDT 2020


anhtuyen created this revision.
anhtuyen added reviewers: nikic, hfinkel, skatkov, asbirlea, etiotto.
anhtuyen added a project: LLVM.
Herald added subscribers: llvm-commits, hiraditya.
anhtuyen requested review of this revision.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D89465

Files:
  llvm/include/llvm/Analysis/CaptureTracking.h
  llvm/lib/Analysis/BasicAliasAnalysis.cpp
  llvm/lib/Analysis/CaptureTracking.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89465.298364.patch
Type: text/x-patch
Size: 5111 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201015/28130a1d/attachment.bin>


More information about the llvm-commits mailing list