diff options
Diffstat (limited to 'tools/llvm-split/llvm-split.cpp')
| -rw-r--r-- | tools/llvm-split/llvm-split.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/llvm-split/llvm-split.cpp b/tools/llvm-split/llvm-split.cpp index 059770fbf4ac3..024363547f937 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; } |
