aboutsummaryrefslogtreecommitdiff
path: root/include/clang
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-11 10:07:22 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-11 10:07:22 +0000
commit775bee71ad21c84bc130af22ac47c1c8e0f9e72f (patch)
tree2552c42ca1c5837ff2e825fd0d814a6bbbdfa897 /include/clang
parent29a790ba422cfeeea9546b6e76777d98fa73cd67 (diff)
Add PreprocessorOutputOptions, for things like -dM, -C, -CC which control -E
mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86827 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r--include/clang/Frontend/PreprocessorOutputOptions.h40
-rw-r--r--include/clang/Frontend/Utils.h11
2 files changed, 43 insertions, 8 deletions
diff --git a/include/clang/Frontend/PreprocessorOutputOptions.h b/include/clang/Frontend/PreprocessorOutputOptions.h
new file mode 100644
index 0000000000..e375a8545f
--- /dev/null
+++ b/include/clang/Frontend/PreprocessorOutputOptions.h
@@ -0,0 +1,40 @@
+//===--- PreprocessorOutputOptions.h ----------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_FRONTEND_PREPROCESSOROUTPUTOPTIONS_H
+#define LLVM_CLANG_FRONTEND_PREPROCESSOROUTPUTOPTIONS_H
+
+#include <string>
+#include <vector>
+
+namespace clang {
+
+/// PreprocessorOutputOptions - Options for controlling the C preprocessor
+/// output (e.g., -E).
+class PreprocessorOutputOptions {
+public:
+ unsigned ShowCPP : 1; ///< Print normal preprocessed output.
+ unsigned ShowMacros : 1; ///< Print macro definitions.
+ unsigned ShowLineMarkers : 1; ///< Show #line markers.
+ unsigned ShowComments : 1; /// Show comments.
+ unsigned ShowMacroComments : 1; /// Show comments, even in macros.
+
+public:
+ PreprocessorOutputOptions() {
+ ShowCPP = 1;
+ ShowMacros = 0;
+ ShowLineMarkers = 1;
+ ShowComments = 0;
+ ShowMacroComments = 0;
+ }
+};
+
+} // end namespace clang
+
+#endif
diff --git a/include/clang/Frontend/Utils.h b/include/clang/Frontend/Utils.h
index f0d61c7ae2..ffaaaea30b 100644
--- a/include/clang/Frontend/Utils.h
+++ b/include/clang/Frontend/Utils.h
@@ -1,4 +1,4 @@
-//===--- Utils.h - Misc utilities for the front-end------------------------===//
+//===--- Utils.h - Misc utilities for the front-end -------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -34,6 +34,7 @@ class LangOptions;
class MinimalAction;
class Preprocessor;
class PreprocessorOptions;
+class PreprocessorOutputOptions;
class SourceManager;
class Stmt;
class TargetInfo;
@@ -56,15 +57,9 @@ bool ProcessWarningOptions(Diagnostic &Diags,
bool Pedantic, bool PedanticErrors,
bool NoWarnings);
-/// DoPrintPreprocessedInput - Implement -E -dM mode.
-void DoPrintMacros(Preprocessor &PP, llvm::raw_ostream* OS);
-
/// DoPrintPreprocessedInput - Implement -E mode.
void DoPrintPreprocessedInput(Preprocessor &PP, llvm::raw_ostream* OS,
- bool EnableCommentOutput,
- bool EnableMacroCommentOutput,
- bool DisableLineMarkers,
- bool DumpDefines);
+ PreprocessorOutputOptions &Opts);
/// RewriteMacrosInInput - Implement -rewrite-macros mode.
void RewriteMacrosInInput(Preprocessor &PP, llvm::raw_ostream* OS);