summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-lto2/llvm-lto2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-lto2/llvm-lto2.cpp')
-rw-r--r--llvm/tools/llvm-lto2/llvm-lto2.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/tools/llvm-lto2/llvm-lto2.cpp b/llvm/tools/llvm-lto2/llvm-lto2.cpp
index 042f874596f..b48f6c1993e 100644
--- a/llvm/tools/llvm-lto2/llvm-lto2.cpp
+++ b/llvm/tools/llvm-lto2/llvm-lto2.cpp
@@ -26,6 +26,11 @@ using namespace llvm;
using namespace lto;
using namespace object;
+static cl::opt<char>
+ OptLevel("O", cl::desc("Optimization level. [-O0, -O1, -O2, or -O3] "
+ "(default = '-O2')"),
+ cl::Prefix, cl::ZeroOrMore, cl::init('2'));
+
static cl::list<std::string> InputFilenames(cl::Positional, cl::OneOrMore,
cl::desc("<input bitcode files>"));
@@ -145,6 +150,8 @@ int main(int argc, char **argv) {
Conf.OptPipeline = OptPipeline;
Conf.AAPipeline = AAPipeline;
+ Conf.OptLevel = OptLevel - '0';
+
ThinBackend Backend;
if (ThinLTODistributedIndexes)
Backend = createWriteIndexesThinBackend("", "", true, "");
OpenPOWER on IntegriCloud