llvm/llvm/tools/llvm-cat/llvm-cat.cpp

//===- llvm-cat.cpp - LLVM module concatenation utility -------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This program is for testing features that rely on multi-module bitcode files.
// It takes a list of input modules and uses them to create a multi-module
// bitcode file.
//
//===----------------------------------------------------------------------===//

#include "llvm/ADT/SmallVector.h"
#include "llvm/Bitcode/BitcodeReader.h"
#include "llvm/Bitcode/BitcodeWriter.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/IRReader/IRReader.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <memory>
#include <string>
#include <system_error>
#include <vector>

usingnamespacellvm;

cl::OptionCategory CatCategory("llvm-cat Options");

static cl::opt<bool>
    BinaryCat("b", cl::desc("Whether to perform binary concatenation"),
              cl::cat(CatCategory));

static cl::opt<std::string> OutputFilename("o", cl::Required,
                                           cl::desc("Output filename"),
                                           cl::value_desc("filename"),
                                           cl::cat(CatCategory));

static cl::list<std::string> InputFilenames(cl::Positional,
                                            cl::desc("<input  files>"),
                                            cl::cat(CatCategory));

int main(int argc, char **argv) {}