1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-01 16:33:37 +01:00
llvm-mirror/include/llvm/CompilerDriver/Action.h

51 lines
1.5 KiB
C
Raw Normal View History

//===--- Action.h - The LLVM Compiler Driver --------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open
// Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
2008-05-06 18:34:12 +02:00
// Action - encapsulates a single shell command.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_INCLUDE_COMPILER_DRIVER_ACTION_H
#define LLVM_INCLUDE_COMPILER_DRIVER_ACTION_H
2008-05-06 18:34:12 +02:00
#include <string>
#include <vector>
namespace llvmc {
typedef std::vector<std::string> StrVector;
/// Action - A class that encapsulates a single shell command.
2008-05-06 18:34:12 +02:00
class Action {
/// Command_ - The actual command (for example, 'ls').
2008-05-06 18:34:12 +02:00
std::string Command_;
/// Args_ - Command arguments. Stdout redirection ("> file") is allowed.
2008-05-06 18:34:12 +02:00
std::vector<std::string> Args_;
/// StopCompilation_ - Should we stop compilation after executing
/// this action?
bool StopCompilation_;
/// OutFile_ - The output file name.
std::string OutFile_;
2008-05-06 18:34:12 +02:00
public:
Action (const std::string& C, const StrVector& A,
bool S, const std::string& O)
: Command_(C), Args_(A), StopCompilation_(S), OutFile_(O)
2008-05-06 18:34:12 +02:00
{}
/// Execute - Executes the represented action.
int Execute () const;
bool StopCompilation () const { return StopCompilation_; }
const std::string& OutFile() { return OutFile_; }
2008-05-06 18:34:12 +02:00
};
}
#endif // LLVM_INCLUDE_COMPILER_DRIVER_ACTION_H