aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Frontend/FrontendOptions.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-13 02:06:12 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-13 02:06:12 +0000
commitfbe2fafe317a757031e4f24026a77dd305607d32 (patch)
tree958a345ed173eaa14c0f2bad584b7c9660f6847b /include/clang/Frontend/FrontendOptions.h
parentf0d8fff0783e92ce0e4333d0fee2fe481d16ddd7 (diff)
Move input kind identification (-x) into FrontendOptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87066 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Frontend/FrontendOptions.h')
-rw-r--r--include/clang/Frontend/FrontendOptions.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/include/clang/Frontend/FrontendOptions.h b/include/clang/Frontend/FrontendOptions.h
index 0674c0bb40..5131166324 100644
--- a/include/clang/Frontend/FrontendOptions.h
+++ b/include/clang/Frontend/FrontendOptions.h
@@ -11,6 +11,7 @@
#define LLVM_CLANG_FRONTEND_FRONTENDOPTIONS_H
#include "clang/Frontend/CommandLineSourceLoc.h"
+#include "llvm/ADT/StringRef.h"
#include <string>
#include <vector>
@@ -19,6 +20,21 @@ namespace clang {
/// FrontendOptions - Options for controlling the behavior of the frontend.
class FrontendOptions {
public:
+ 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_AST
+ };
+
unsigned DebugCodeCompletionPrinter : 1; ///< Use the debug printer for code
/// completion results.
unsigned DisableFree : 1; ///< Disable memory freeing on exit.
@@ -44,8 +60,8 @@ public:
/// If given, the name of the target ABI to use.
std::string TargetABI;
- /// The input files.
- std::vector<std::string> InputFilenames;
+ /// The input files and their types.
+ std::vector<std::pair<InputKind, std::string> > Inputs;
/// The output file, if any.
std::string OutputFile;
@@ -70,6 +86,13 @@ public:
ShowStats = 0;
ShowTimers = 0;
}
+
+ /// getInputKindForExtension - Return the appropriate input kind for a file
+ /// extension. For example, "c" would return IK_C.
+ ///
+ /// \return The input kind for the extension, or IK_None if the extension is
+ /// not recognized.
+ static InputKind getInputKindForExtension(llvm::StringRef Extension);
};
} // end namespace clang