Update prebuilt Clang to match Android kernel.
Bug: 132428451
Change-Id: I8f6e2cb23f381fc0c02ddea99b867e58e925e5be
diff --git a/linux-x64/clang/include/llvm/Analysis/CaptureTracking.h b/linux-x64/clang/include/llvm/Analysis/CaptureTracking.h
index 7a869a5..ca7abd3 100644
--- a/linux-x64/clang/include/llvm/Analysis/CaptureTracking.h
+++ b/linux-x64/clang/include/llvm/Analysis/CaptureTracking.h
@@ -1,9 +1,8 @@
//===----- llvm/Analysis/CaptureTracking.h - Pointer capture ----*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -22,6 +21,14 @@
class DominatorTree;
class OrderedBasicBlock;
+ /// The default value for MaxUsesToExplore argument. It's relatively small to
+ /// keep the cost of analysis reasonable for clients like BasicAliasAnalysis,
+ /// where the results can't be cached.
+ /// TODO: we should probably introduce a caching CaptureTracking analysis and
+ /// use it where possible. The caching version can use much higher limit or
+ /// don't have this cap at all.
+ unsigned constexpr DefaultMaxUsesToExplore = 20;
+
/// PointerMayBeCaptured - Return true if this pointer value may be captured
/// by the enclosing function (which is required to exist). This routine can
/// be expensive, so consider caching the results. The boolean ReturnCaptures
@@ -29,9 +36,12 @@
/// counts as capturing it or not. The boolean StoreCaptures specified
/// whether storing the value (or part of it) into memory anywhere
/// automatically counts as capturing it or not.
+ /// MaxUsesToExplore specifies how many uses should the analysis explore for
+ /// one value before giving up due too "too many uses".
bool PointerMayBeCaptured(const Value *V,
bool ReturnCaptures,
- bool StoreCaptures);
+ bool StoreCaptures,
+ unsigned MaxUsesToExplore = DefaultMaxUsesToExplore);
/// PointerMayBeCapturedBefore - Return true if this pointer value may be
/// captured by the enclosing function (which is required to exist). If a
@@ -44,10 +54,13 @@
/// or not. Captures by the provided instruction are considered if the
/// final parameter is true. An ordered basic block in \p OBB could be used
/// to speed up capture-tracker queries.
+ /// MaxUsesToExplore specifies how many uses should the analysis explore for
+ /// one value before giving up due too "too many uses".
bool PointerMayBeCapturedBefore(const Value *V, bool ReturnCaptures,
bool StoreCaptures, const Instruction *I,
const DominatorTree *DT, bool IncludeI = false,
- OrderedBasicBlock *OBB = nullptr);
+ OrderedBasicBlock *OBB = nullptr,
+ unsigned MaxUsesToExplore = DefaultMaxUsesToExplore);
/// This callback is used in conjunction with PointerMayBeCaptured. In
/// addition to the interface here, you'll need to provide your own getters
@@ -75,7 +88,10 @@
/// PointerMayBeCaptured - Visit the value and the values derived from it and
/// find values which appear to be capturing the pointer value. This feeds
/// results into and is controlled by the CaptureTracker object.
- void PointerMayBeCaptured(const Value *V, CaptureTracker *Tracker);
+ /// MaxUsesToExplore specifies how many uses should the analysis explore for
+ /// one value before giving up due too "too many uses".
+ void PointerMayBeCaptured(const Value *V, CaptureTracker *Tracker,
+ unsigned MaxUsesToExplore = DefaultMaxUsesToExplore);
} // end namespace llvm
#endif