//===-- tools/bugpoint/ToolRunner.h -----------------------------*- C++ -*-===// // // 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 file exposes an abstraction around a platform C compiler, used to // compile C and assembly code. It also exposes an "AbstractIntepreter" // interface, which is used to execute code using one of the LLVM execution // engines. // //===----------------------------------------------------------------------===// #ifndef LLVM_TOOLS_BUGPOINT_TOOLRUNNER_H #define LLVM_TOOLS_BUGPOINT_TOOLRUNNER_H #include "llvm/Support/CommandLine.h" #include "llvm/Support/Error.h" #include "llvm/Support/Path.h" #include "llvm/Support/SystemUtils.h" #include "llvm/TargetParser/Triple.h" #include <exception> #include <vector> namespace llvm { extern cl::opt<bool> SaveTemps; extern Triple TargetTriple; class LLC; //===---------------------------------------------------------------------===// // CC abstraction // class CC { … }; //===---------------------------------------------------------------------===// /// AbstractInterpreter Class - Subclasses of this class are used to execute /// LLVM bitcode in a variety of ways. This abstract interface hides this /// complexity behind a simple interface. /// class AbstractInterpreter { … }; //===---------------------------------------------------------------------===// // LLC Implementation of AbstractIntepreter interface // class LLC : public AbstractInterpreter { … }; /// Find the first executable file \ExeName, either in the user's PATH or, /// failing that, in the same directory as argv[0]. This allows us to find /// another LLVM tool if it is built in the same directory. If no executable is /// found, an error is returned. ErrorOr<std::string> FindProgramByName(const std::string &ExeName, const char *Argv0, void *MainAddr); } // End llvm namespace #endif