summaryrefslogtreecommitdiff
path: root/tools/llvm-split
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-07-23 20:41:05 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-07-23 20:41:05 +0000
commit01095a5d43bbfde13731688ddcf6048ebb8b7721 (patch)
tree4def12e759965de927d963ac65840d663ef9d1ea /tools/llvm-split
parentf0f4822ed4b66e3579e92a89f368f8fb860e218e (diff)
Notes
Diffstat (limited to 'tools/llvm-split')
-rw-r--r--tools/llvm-split/Makefile17
-rw-r--r--tools/llvm-split/llvm-split.cpp10
2 files changed, 8 insertions, 19 deletions
diff --git a/tools/llvm-split/Makefile b/tools/llvm-split/Makefile
deleted file mode 100644
index ef1243dbf1ff..000000000000
--- a/tools/llvm-split/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-##===- tools/llvm-split/Makefile ---------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL := ../..
-TOOLNAME := llvm-split
-LINK_COMPONENTS := transformutils bitwriter core irreader support
-
-# This tool has no plugins, optimize startup time.
-TOOL_NO_EXPORTS := 1
-
-include $(LEVEL)/Makefile.common
diff --git a/tools/llvm-split/llvm-split.cpp b/tools/llvm-split/llvm-split.cpp
index 059770fbf4ac..024363547f93 100644
--- a/tools/llvm-split/llvm-split.cpp
+++ b/tools/llvm-split/llvm-split.cpp
@@ -14,6 +14,7 @@
#include "llvm/ADT/StringExtras.h"
#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/IR/LLVMContext.h"
+#include "llvm/IR/Verifier.h"
#include "llvm/IRReader/IRReader.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileSystem.h"
@@ -35,8 +36,12 @@ OutputFilename("o", cl::desc("Override output filename"),
static cl::opt<unsigned> NumOutputs("j", cl::Prefix, cl::init(2),
cl::desc("Number of output files"));
+static cl::opt<bool>
+ PreserveLocals("preserve-locals", cl::Prefix, cl::init(false),
+ cl::desc("Split without externalizing locals"));
+
int main(int argc, char **argv) {
- LLVMContext &Context = getGlobalContext();
+ LLVMContext Context;
SMDiagnostic Err;
cl::ParseCommandLineOptions(argc, argv, "LLVM module splitter\n");
@@ -57,11 +62,12 @@ int main(int argc, char **argv) {
exit(1);
}
+ verifyModule(*MPart);
WriteBitcodeToFile(MPart.get(), Out->os());
// Declare success.
Out->keep();
- });
+ }, PreserveLocals);
return 0;
}