aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CompilerDriver/Action.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/CompilerDriver/Action.h')
-rw-r--r--include/llvm/CompilerDriver/Action.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/include/llvm/CompilerDriver/Action.h b/include/llvm/CompilerDriver/Action.h
new file mode 100644
index 0000000000..c3b31d4e55
--- /dev/null
+++ b/include/llvm/CompilerDriver/Action.h
@@ -0,0 +1,42 @@
+//===--- 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.
+//
+//===----------------------------------------------------------------------===//
+//
+// Action - encapsulates a single shell command.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_TOOLS_LLVMC2_ACTION_H
+#define LLVM_TOOLS_LLVMC2_ACTION_H
+
+#include <string>
+#include <vector>
+
+namespace llvmc {
+
+ typedef std::vector<std::string> StrVector;
+
+ /// Action - A class that encapsulates a single shell command.
+ class Action {
+ /// Command_ - The actual command (for example, 'ls').
+ std::string Command_;
+ /// Args_ - Command arguments. Stdout redirection ("> file") is allowed.
+ std::vector<std::string> Args_;
+ public:
+ Action() {}
+ Action (const std::string& C, const StrVector& A)
+ : Command_(C), Args_(A)
+ {}
+
+ /// Execute - Executes the represented action.
+ int Execute() const;
+ };
+
+}
+
+#endif // LLVM_TOOLS_LLVMC2_ACTION_H