diff options
author | David Majnemer <david.majnemer@gmail.com> | 2016-07-28 21:04:31 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2016-07-28 21:04:31 +0000 |
commit | 3d32b7ed0d811b5ed5267f581cdc40f18c87faab (patch) | |
tree | 4303317f5aee2a3fc855e7b987377f7be8ab846a /llvm/tools/opt/opt.cpp | |
parent | 644f3f066b95f6ba83f636d7738f680a6a9f126a (diff) | |
download | bcm5719-llvm-3d32b7ed0d811b5ed5267f581cdc40f18c87faab.tar.gz bcm5719-llvm-3d32b7ed0d811b5ed5267f581cdc40f18c87faab.zip |
[coroutines] Part 3 of N: Adding Boilerplate for Coroutine Passes
This adds boilerplate code for all coroutine passes,
the passes are no-ops for now.
Also, a small test has been added to verify that passes execute in
the expected order or not at all if coroutine support is disabled.
Patch by Gor Nishanov!
Differential Revision: https://reviews.llvm.org/D22847
llvm-svn: 277033
Diffstat (limited to 'llvm/tools/opt/opt.cpp')
-rw-r--r-- | llvm/tools/opt/opt.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp index 090c04a87d1..ca0f134a612 100644 --- a/llvm/tools/opt/opt.cpp +++ b/llvm/tools/opt/opt.cpp @@ -50,6 +50,7 @@ #include "llvm/Support/TargetSelect.h" #include "llvm/Support/ToolOutputFile.h" #include "llvm/Target/TargetMachine.h" +#include "llvm/Transforms/Coroutines.h" #include "llvm/Transforms/IPO/PassManagerBuilder.h" #include "llvm/Transforms/Utils/Cloning.h" #include <algorithm> @@ -215,6 +216,11 @@ static cl::opt<bool> DiscardValueNames( cl::desc("Discard names from Value (other than GlobalValue)."), cl::init(false), cl::Hidden); +static cl::opt<bool> Coroutines( + "enable-coroutines", + cl::desc("Enable coroutine passes."), + cl::init(false), cl::Hidden); + static cl::opt<bool> PassRemarksWithHotness( "pass-remarks-with-hotness", cl::desc("With PGO, include profile count in optimization remarks"), @@ -274,6 +280,9 @@ static void AddOptimizationPasses(legacy::PassManagerBase &MPM, TM->addEarlyAsPossiblePasses(PM); }); + if (Coroutines) + addCoroutinePassesToExtensionPoints(Builder); + Builder.populateFunctionPassManager(FPM); Builder.populateModulePassManager(MPM); } @@ -348,6 +357,7 @@ int main(int argc, char **argv) { // Initialize passes PassRegistry &Registry = *PassRegistry::getPassRegistry(); initializeCore(Registry); + initializeCoroutines(Registry); initializeScalarOpts(Registry); initializeObjCARCOpts(Registry); initializeVectorization(Registry); |