aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Passes/PassBuilder.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-04-16 16:01:22 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-04-16 16:01:22 +0000
commit71d5a2540a98c81f5bcaeb48805e0e2881f530ef (patch)
tree5343938942df402b49ec7300a1c25a2d4ccd5821 /include/llvm/Passes/PassBuilder.h
parent31bbf64f3a4974a2d6c8b3b27ad2f519caf74057 (diff)
Diffstat (limited to 'include/llvm/Passes/PassBuilder.h')
-rw-r--r--include/llvm/Passes/PassBuilder.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/llvm/Passes/PassBuilder.h b/include/llvm/Passes/PassBuilder.h
index d76c13984d11..efa36d957fbd 100644
--- a/include/llvm/Passes/PassBuilder.h
+++ b/include/llvm/Passes/PassBuilder.h
@@ -27,6 +27,14 @@ class StringRef;
class AAManager;
class TargetMachine;
+/// A struct capturing PGO tunables.
+struct PGOOptions {
+ std::string ProfileGenFile = "";
+ std::string ProfileUseFile = "";
+ bool RunProfileGen = false;
+ bool SamplePGO = false;
+};
+
/// \brief This class provides access to building LLVM's passes.
///
/// It's members provide the baseline state available to passes during their
@@ -35,6 +43,7 @@ class TargetMachine;
/// construction.
class PassBuilder {
TargetMachine *TM;
+ Optional<PGOOptions> PGOOpt;
public:
/// \brief LLVM-provided high-level optimization levels.
@@ -123,7 +132,9 @@ public:
Oz
};
- explicit PassBuilder(TargetMachine *TM = nullptr) : TM(TM) {}
+ explicit PassBuilder(TargetMachine *TM = nullptr,
+ Optional<PGOOptions> PGOOpt = None)
+ : TM(TM), PGOOpt(PGOOpt) {}
/// \brief Cross register the analysis managers through their proxies.
///