summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/tools/llvm-split/llvm-split.cpp
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2020-08-03 15:06:44 +0000
committerpatrick <patrick@openbsd.org>2020-08-03 15:06:44 +0000
commitb64793999546ed8adebaeebd9d8345d18db8927d (patch)
tree4357c27b561d73b0e089727c6ed659f2ceff5f47 /gnu/llvm/tools/llvm-split/llvm-split.cpp
parentAdd support for UTF-8 DISPLAY-HINTs with octet length. For now only (diff)
downloadwireguard-openbsd-b64793999546ed8adebaeebd9d8345d18db8927d.tar.xz
wireguard-openbsd-b64793999546ed8adebaeebd9d8345d18db8927d.zip
Remove LLVM 8.0.1 files.
Diffstat (limited to 'gnu/llvm/tools/llvm-split/llvm-split.cpp')
-rw-r--r--gnu/llvm/tools/llvm-split/llvm-split.cpp73
1 files changed, 0 insertions, 73 deletions
diff --git a/gnu/llvm/tools/llvm-split/llvm-split.cpp b/gnu/llvm/tools/llvm-split/llvm-split.cpp
deleted file mode 100644
index a6204dc156d..00000000000
--- a/gnu/llvm/tools/llvm-split/llvm-split.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-//===-- llvm-split: command line tool for testing module splitter ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This program can be used to test the llvm::SplitModule function.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/Bitcode/BitcodeWriter.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"
-#include "llvm/Support/SourceMgr.h"
-#include "llvm/Support/ToolOutputFile.h"
-#include "llvm/Support/raw_ostream.h"
-#include "llvm/Transforms/Utils/SplitModule.h"
-
-using namespace llvm;
-
-static cl::opt<std::string>
-InputFilename(cl::Positional, cl::desc("<input bitcode file>"),
- cl::init("-"), cl::value_desc("filename"));
-
-static cl::opt<std::string>
-OutputFilename("o", cl::desc("Override output filename"),
- cl::value_desc("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;
- SMDiagnostic Err;
- cl::ParseCommandLineOptions(argc, argv, "LLVM module splitter\n");
-
- std::unique_ptr<Module> M = parseIRFile(InputFilename, Err, Context);
-
- if (!M) {
- Err.print(argv[0], errs());
- return 1;
- }
-
- unsigned I = 0;
- SplitModule(std::move(M), NumOutputs, [&](std::unique_ptr<Module> MPart) {
- std::error_code EC;
- std::unique_ptr<ToolOutputFile> Out(
- new ToolOutputFile(OutputFilename + utostr(I++), EC, sys::fs::F_None));
- if (EC) {
- errs() << EC.message() << '\n';
- exit(1);
- }
-
- verifyModule(*MPart);
- WriteBitcodeToFile(*MPart, Out->os());
-
- // Declare success.
- Out->keep();
- }, PreserveLocals);
-
- return 0;
-}