-//===--- InitPreprocessor.h - InitializePreprocessor function. --*- C++ -*-===//
+//===--- PreprocessorOptionms.h ---------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-//
-// This file defines the clang::InitializePreprocessor function.
-//
-//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_FRONTEND_INIT_PREPROCESSOR_H_
-#define LLVM_CLANG_FRONTEND_INIT_PREPROCESSOR_H_
+#ifndef LLVM_CLANG_FRONTEND_PREPROCESSOROPTIONS_H_
+#define LLVM_CLANG_FRONTEND_PREPROCESSOROPTIONS_H_
#include <string>
#include <vector>
class Preprocessor;
class LangOptions;
-/// PreprocessorInitOptions - This class is used for passing the various
-/// options used in preprocessor initialization to InitializePreprocessor().
-class PreprocessorInitOptions {
+/// PreprocessorOptions - This class is used for passing the various options
+/// used in preprocessor initialization to InitializePreprocessor().
+class PreprocessorOptions {
std::vector<std::pair<std::string, bool/*isUndef*/> > Macros;
std::vector<std::pair<std::string, bool/*isPTH*/> > Includes;
std::vector<std::string> MacroIncludes;
/// and target specific predefines.
public:
- PreprocessorInitOptions() : UsePredefines(true) {}
+ PreprocessorOptions() : UsePredefines(true) {}
bool getUsePredefines() const { return UsePredefines; }
void setUsePredefines(bool Value) {
imacro_iterator imacro_end() const { return MacroIncludes.end(); }
};
-/// InitializePreprocessor - Initialize the preprocessor getting it and the
-/// environment ready to process a single file.
-///
-void InitializePreprocessor(Preprocessor &PP,
- const PreprocessorInitOptions& InitOptions);
-
} // end namespace clang
#endif
}
namespace clang {
-class Preprocessor;
-class MinimalAction;
-class TargetInfo;
-class Diagnostic;
class ASTConsumer;
+class Decl;
+class Diagnostic;
class IdentifierTable;
-class SourceManager;
class LangOptions;
-class Decl;
+class MinimalAction;
+class Preprocessor;
+class PreprocessorOptions;
+class SourceManager;
class Stmt;
+class TargetInfo;
+
+/// InitializePreprocessor - Initialize the preprocessor getting it and the
+/// environment ready to process a single file.
+///
+void InitializePreprocessor(Preprocessor &PP,
+ const PreprocessorOptions &PPOpts);
/// ProcessWarningOptions - Initialize the diagnostic client and process the
/// warning options specified on the command line.
//
//===----------------------------------------------------------------------===//
-#include "clang/Frontend/InitPreprocessor.h"
+#include "clang/Frontend/Utils.h"
#include "clang/Basic/TargetInfo.h"
+#include "clang/Frontend/PreprocessorOptions.h"
#include "clang/Lex/Preprocessor.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/STLExtras.h"
/// environment ready to process a single file. This returns true on error.
///
void clang::InitializePreprocessor(Preprocessor &PP,
- const PreprocessorInitOptions &InitOpts) {
+ const PreprocessorOptions &InitOpts) {
std::vector<char> PredefineBuffer;
const char *LineDirective = "# 1 \"<built-in>\" 3\n";
LineDirective, LineDirective+strlen(LineDirective));
// Process #define's and #undef's in the order they are given.
- for (PreprocessorInitOptions::macro_iterator I = InitOpts.macro_begin(),
+ for (PreprocessorOptions::macro_iterator I = InitOpts.macro_begin(),
E = InitOpts.macro_end(); I != E; ++I) {
if (I->second) // isUndef
UndefineBuiltinMacro(PredefineBuffer, I->first.c_str());
// If -imacros are specified, include them now. These are processed before
// any -include directives.
- for (PreprocessorInitOptions::imacro_iterator I = InitOpts.imacro_begin(),
+ for (PreprocessorOptions::imacro_iterator I = InitOpts.imacro_begin(),
E = InitOpts.imacro_end(); I != E; ++I)
AddImplicitIncludeMacros(PredefineBuffer, *I);
// Process -include directives.
- for (PreprocessorInitOptions::include_iterator I = InitOpts.include_begin(),
+ for (PreprocessorOptions::include_iterator I = InitOpts.include_begin(),
E = InitOpts.include_end(); I != E; ++I) {
if (I->second) // isPTH
AddImplicitIncludePTH(PredefineBuffer, PP, I->first);
#include "clang/Frontend/FixItRewriter.h"
#include "clang/Frontend/FrontendDiagnostic.h"
#include "clang/Frontend/InitHeaderSearch.h"
-#include "clang/Frontend/InitPreprocessor.h"
-#include "clang/Frontend/PathDiagnosticClients.h"
#include "clang/Frontend/PCHReader.h"
+#include "clang/Frontend/PathDiagnosticClients.h"
+#include "clang/Frontend/PreprocessorOptions.h"
#include "clang/Frontend/TextDiagnosticBuffer.h"
#include "clang/Frontend/TextDiagnosticPrinter.h"
#include "clang/Frontend/CommandLineSourceLoc.h"
Init.Realize();
}
-void InitializePreprocessorInitOptions(PreprocessorInitOptions &InitOpts) {
+void InitializePreprocessorOptions(PreprocessorOptions &InitOpts) {
// Use predefines?
InitOpts.setUsePredefines(!UndefMacros);
PP->setPTHManager(PTHMgr);
}
- PreprocessorInitOptions InitOpts;
- InitializePreprocessorInitOptions(InitOpts);
+ PreprocessorOptions InitOpts;
+ InitializePreprocessorOptions(InitOpts);
InitializePreprocessor(*PP, InitOpts);
return PP;