From 01095a5d43bbfde13731688ddcf6048ebb8b7721 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 23 Jul 2016 20:41:05 +0000 Subject: Vendor import of llvm release_39 branch r276489: https://llvm.org/svn/llvm-project/llvm/branches/release_39@276489 --- tools/llvm-split/llvm-split.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tools/llvm-split/llvm-split.cpp') 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 NumOutputs("j", cl::Prefix, cl::init(2), cl::desc("Number of output files")); +static cl::opt + 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; } -- cgit v1.3