Update prebuilt Clang to r416183b from Android.
https://android.googlesource.com/platform/prebuilts/clang/host/
linux-x86/+/06a71ddac05c22edb2d10b590e1769b3f8619bef
clang 12.0.5 (based on r416183b) from build 7284624.
Change-Id: I277a316abcf47307562d8b748b84870f31a72866
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
diff --git a/linux-x64/clang/include/llvm/Pass.h b/linux-x64/clang/include/llvm/Pass.h
index 329f7ea..8aa9ba9 100644
--- a/linux-x64/clang/include/llvm/Pass.h
+++ b/linux-x64/clang/include/llvm/Pass.h
@@ -28,14 +28,12 @@
#ifndef LLVM_PASS_H
#define LLVM_PASS_H
-#include "llvm/ADT/StringRef.h"
#include <string>
namespace llvm {
class AnalysisResolver;
class AnalysisUsage;
-class BasicBlock;
class Function;
class ImmutablePass;
class Module;
@@ -43,6 +41,7 @@
class PMDataManager;
class PMStack;
class raw_ostream;
+class StringRef;
// AnalysisID - Use the PassInfo to identify a pass...
using AnalysisID = const void *;
@@ -57,13 +56,11 @@
PMT_FunctionPassManager, ///< FPPassManager
PMT_LoopPassManager, ///< LPPassManager
PMT_RegionPassManager, ///< RGPassManager
- PMT_BasicBlockPassManager, ///< BBPassManager
PMT_Last
};
// Different types of passes.
enum PassKind {
- PT_BasicBlock,
PT_Region,
PT_Loop,
PT_Function,
@@ -72,6 +69,20 @@
PT_PassManager
};
+/// This enumerates the LLVM full LTO or ThinLTO optimization phases.
+enum class ThinOrFullLTOPhase {
+ /// No LTO/ThinLTO behavior needed.
+ None,
+ /// ThinLTO prelink (summary) phase.
+ ThinLTOPreLink,
+ /// ThinLTO postlink (backend compile) phase.
+ ThinLTOPostLink,
+ /// Full LTO prelink phase.
+ FullLTOPreLink,
+ /// Full LTO postlink (backend compile) phase.
+ FullLTOPostLink
+};
+
//===----------------------------------------------------------------------===//
/// Pass interface - Implemented by all 'passes'. Subclass this if you are an
/// interprocedural optimization or you do not fit into any of the more
@@ -206,14 +217,17 @@
template<typename AnalysisType>
AnalysisType &getAnalysis() const; // Defined in PassAnalysisSupport.h
- template<typename AnalysisType>
- AnalysisType &getAnalysis(Function &F); // Defined in PassAnalysisSupport.h
+ template <typename AnalysisType>
+ AnalysisType &
+ getAnalysis(Function &F,
+ bool *Changed = nullptr); // Defined in PassAnalysisSupport.h
template<typename AnalysisType>
AnalysisType &getAnalysisID(AnalysisID PI) const;
- template<typename AnalysisType>
- AnalysisType &getAnalysisID(AnalysisID PI, Function &F);
+ template <typename AnalysisType>
+ AnalysisType &getAnalysisID(AnalysisID PI, Function &F,
+ bool *Changed = nullptr);
};
//===----------------------------------------------------------------------===//
@@ -305,61 +319,21 @@
bool skipFunction(const Function &F) const;
};
-//===----------------------------------------------------------------------===//
-/// BasicBlockPass class - This class is used to implement most local
-/// optimizations. Optimizations should subclass this class if they
-/// meet the following constraints:
-/// 1. Optimizations are local, operating on either a basic block or
-/// instruction at a time.
-/// 2. Optimizations do not modify the CFG of the contained function, or any
-/// other basic block in the function.
-/// 3. Optimizations conform to all of the constraints of FunctionPasses.
-///
-class BasicBlockPass : public Pass {
-public:
- explicit BasicBlockPass(char &pid) : Pass(PT_BasicBlock, pid) {}
-
- /// createPrinterPass - Get a basic block printer pass.
- Pass *createPrinterPass(raw_ostream &OS,
- const std::string &Banner) const override;
-
- using llvm::Pass::doInitialization;
- using llvm::Pass::doFinalization;
-
- /// doInitialization - Virtual method overridden by BasicBlockPass subclasses
- /// to do any necessary per-function initialization.
- virtual bool doInitialization(Function &);
-
- /// runOnBasicBlock - Virtual method overriden by subclasses to do the
- /// per-basicblock processing of the pass.
- virtual bool runOnBasicBlock(BasicBlock &BB) = 0;
-
- /// doFinalization - Virtual method overriden by BasicBlockPass subclasses to
- /// do any post processing needed after all passes have run.
- virtual bool doFinalization(Function &);
-
- void assignPassManager(PMStack &PMS, PassManagerType T) override;
-
- /// Return what kind of Pass Manager can manage this pass.
- PassManagerType getPotentialPassManagerType() const override;
-
-protected:
- /// Optional passes call this function to check whether the pass should be
- /// skipped. This is the case when Attribute::OptimizeNone is set or when
- /// optimization bisect is over the limit.
- bool skipBasicBlock(const BasicBlock &BB) const;
-};
-
/// If the user specifies the -time-passes argument on an LLVM tool command line
/// then the value of this boolean will be true, otherwise false.
/// This is the storage for the -time-passes option.
extern bool TimePassesIsEnabled;
+/// If TimePassesPerRun is true, there would be one line of report for
+/// each pass invocation.
+/// If TimePassesPerRun is false, there would be only one line of
+/// report for each pass (even there are more than one pass objects).
+/// (For new pass manager only)
+extern bool TimePassesPerRun;
} // end namespace llvm
// Include support files that contain important APIs commonly used by Passes,
// but that we want to separate out to make it easier to read the header files.
-#include "llvm/InitializePasses.h"
#include "llvm/PassAnalysisSupport.h"
#include "llvm/PassSupport.h"