summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-lto2/llvm-lto2.cpp
diff options
context:
space:
mode:
authorTim Shen <timshen91@gmail.com>2017-06-01 23:13:44 +0000
committerTim Shen <timshen91@gmail.com>2017-06-01 23:13:44 +0000
commit4e912aa5af44b3f3024cfcb4a3bfb932c49fc225 (patch)
tree3e44bb19b341237548315ba0a7f55bf2ea667a9b /llvm/tools/llvm-lto2/llvm-lto2.cpp
parentc3688315805825576527f238f8dd9a6def90a4ee (diff)
downloadbcm5719-llvm-4e912aa5af44b3f3024cfcb4a3bfb932c49fc225.tar.gz
bcm5719-llvm-4e912aa5af44b3f3024cfcb4a3bfb932c49fc225.zip
[ThinLTO] Move -lto-use-new-pm to llvm-lto2, and change it to -use-new-pm.
Summary: As we teach Clang to use ThinkLTO + new PM, it's good for the users to inject through Config, instead of setting a flag in the LTOBackend library. Move the flag to llvm-lto2. As it moves to llvm-lto2, a new name -use-new-pm seems simpler and as clear. Reviewers: davide, tejohnson Subscribers: mehdi_amini, Prazek, inglorion, eraman, chandlerc, llvm-commits Differential Revision: https://reviews.llvm.org/D33799 llvm-svn: 304492
Diffstat (limited to 'llvm/tools/llvm-lto2/llvm-lto2.cpp')
-rw-r--r--llvm/tools/llvm-lto2/llvm-lto2.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/tools/llvm-lto2/llvm-lto2.cpp b/llvm/tools/llvm-lto2/llvm-lto2.cpp
index 3d2643db85b..89f85157e1d 100644
--- a/llvm/tools/llvm-lto2/llvm-lto2.cpp
+++ b/llvm/tools/llvm-lto2/llvm-lto2.cpp
@@ -99,6 +99,11 @@ static cl::opt<bool> OptRemarksWithHotness(
cl::desc("Whether to include hotness informations in the remarks.\n"
"Has effect only if -pass-remarks-output is specified."));
+static cl::opt<bool>
+ UseNewPM("use-new-pm",
+ cl::desc("Run LTO passes using the new pass manager"),
+ cl::init(false), cl::Hidden);
+
static void check(Error E, std::string Msg) {
if (!E)
return;
@@ -196,6 +201,7 @@ static int run(int argc, char **argv) {
Conf.AAPipeline = AAPipeline;
Conf.OptLevel = OptLevel - '0';
+ Conf.UseNewPM = UseNewPM;
switch (CGOptLevel) {
case '0':
Conf.CGOptLevel = CodeGenOpt::None;
@@ -351,7 +357,7 @@ int main(int argc, char **argv) {
// FIXME: This should use llvm::cl subcommands, but it isn't currently
// possible to pass an argument not associated with a subcommand to a
- // subcommand (e.g. -lto-use-new-pm).
+ // subcommand (e.g. -use-new-pm).
if (argc < 2)
return usage();
OpenPOWER on IntegriCloud