From b64793999546ed8adebaeebd9d8345d18db8927d Mon Sep 17 00:00:00 2001 From: patrick Date: Mon, 3 Aug 2020 15:06:44 +0000 Subject: Remove LLVM 8.0.1 files. --- gnu/llvm/tools/llvm-diff/llvm-diff.cpp | 92 ---------------------------------- 1 file changed, 92 deletions(-) delete mode 100644 gnu/llvm/tools/llvm-diff/llvm-diff.cpp (limited to 'gnu/llvm/tools/llvm-diff/llvm-diff.cpp') diff --git a/gnu/llvm/tools/llvm-diff/llvm-diff.cpp b/gnu/llvm/tools/llvm-diff/llvm-diff.cpp deleted file mode 100644 index e449d699478..00000000000 --- a/gnu/llvm/tools/llvm-diff/llvm-diff.cpp +++ /dev/null @@ -1,92 +0,0 @@ -//===-- llvm-diff.cpp - Module comparator command-line driver ---*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the command-line driver for the difference engine. -// -//===----------------------------------------------------------------------===// - -#include "DiffLog.h" -#include "DifferenceEngine.h" -#include "llvm/ADT/StringRef.h" -#include "llvm/IR/LLVMContext.h" -#include "llvm/IR/Module.h" -#include "llvm/IR/Type.h" -#include "llvm/IRReader/IRReader.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/MemoryBuffer.h" -#include "llvm/Support/SourceMgr.h" -#include "llvm/Support/raw_ostream.h" -#include -#include - - -using namespace llvm; - -/// Reads a module from a file. On error, messages are written to stderr -/// and null is returned. -static std::unique_ptr readModule(LLVMContext &Context, - StringRef Name) { - SMDiagnostic Diag; - std::unique_ptr M = parseIRFile(Name, Diag, Context); - if (!M) - Diag.print("llvm-diff", errs()); - return M; -} - -static void diffGlobal(DifferenceEngine &Engine, Module &L, Module &R, - StringRef Name) { - // Drop leading sigils from the global name. - if (Name.startswith("@")) Name = Name.substr(1); - - Function *LFn = L.getFunction(Name); - Function *RFn = R.getFunction(Name); - if (LFn && RFn) - Engine.diff(LFn, RFn); - else if (!LFn && !RFn) - errs() << "No function named @" << Name << " in either module\n"; - else if (!LFn) - errs() << "No function named @" << Name << " in left module\n"; - else - errs() << "No function named @" << Name << " in right module\n"; -} - -static cl::opt LeftFilename(cl::Positional, - cl::desc(""), - cl::Required); -static cl::opt RightFilename(cl::Positional, - cl::desc(""), - cl::Required); -static cl::list GlobalsToCompare(cl::Positional, - cl::desc("")); - -int main(int argc, char **argv) { - cl::ParseCommandLineOptions(argc, argv); - - LLVMContext Context; - - // Load both modules. Die if that fails. - std::unique_ptr LModule = readModule(Context, LeftFilename); - std::unique_ptr RModule = readModule(Context, RightFilename); - if (!LModule || !RModule) return 1; - - DiffConsumer Consumer; - DifferenceEngine Engine(Consumer); - - // If any global names were given, just diff those. - if (!GlobalsToCompare.empty()) { - for (unsigned I = 0, E = GlobalsToCompare.size(); I != E; ++I) - diffGlobal(Engine, *LModule, *RModule, GlobalsToCompare[I]); - - // Otherwise, diff everything in the module. - } else { - Engine.diff(LModule.get(), RModule.get()); - } - - return Consumer.hadDifferences(); -} -- cgit v1.2.3-59-g8ed1b