diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-01-20 16:28:04 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-01-20 16:28:04 +0000 |
commit | 1f6b2b5c82b2d2d3935b0db76352a04e9877b73f (patch) | |
tree | 3e13bde8bfb2c3bab74a8c5062361b750429dee6 /include/clang/Frontend/FrontendOptions.h | |
parent | b7ff74a6764ad837ce348bc7dd0f0804e4dbf492 (diff) |
Extract the (InputKind, std::string) pair used to describe inputs to
the front end into its own class, FrontendInputFile, to make it easier
to introduce new per-input data. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148546 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Frontend/FrontendOptions.h')
-rw-r--r-- | include/clang/Frontend/FrontendOptions.h | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/include/clang/Frontend/FrontendOptions.h b/include/clang/Frontend/FrontendOptions.h index fa6d044ce0..637ceff578 100644 --- a/include/clang/Frontend/FrontendOptions.h +++ b/include/clang/Frontend/FrontendOptions.h @@ -11,7 +11,6 @@ #define LLVM_CLANG_FRONTEND_FRONTENDOPTIONS_H #include "clang/Frontend/CommandLineSourceLoc.h" -#include "clang/Frontend/FrontendAction.h" #include "llvm/ADT/StringRef.h" #include <string> #include <vector> @@ -51,6 +50,37 @@ namespace frontend { }; } +enum InputKind { + IK_None, + IK_Asm, + IK_C, + IK_CXX, + IK_ObjC, + IK_ObjCXX, + IK_PreprocessedC, + IK_PreprocessedCXX, + IK_PreprocessedObjC, + IK_PreprocessedObjCXX, + IK_OpenCL, + IK_CUDA, + IK_AST, + IK_LLVM_IR +}; + + +/// \brief An input file for the front end. +struct FrontendInputFile { + /// \brief The file name, or "-" to read from standard input. + std::string File; + + /// \brief The kind of input, e.g., C source, AST file, LLVM IR. + InputKind Kind; + + FrontendInputFile() : Kind(IK_None) { } + FrontendInputFile(StringRef File, InputKind Kind) + : File(File.str()), Kind(Kind) { } +}; + /// FrontendOptions - Options for controlling the behavior of the frontend. class FrontendOptions { public: @@ -86,7 +116,7 @@ public: std::string ARCMTMigrateReportOut; /// The input files and their types. - std::vector<std::pair<InputKind, std::string> > Inputs; + std::vector<FrontendInputFile> Inputs; /// The output file, if any. std::string OutputFile; |