class DirectoryLookup;
class PreprocessingRecord;
class ModuleLoader;
+class PreprocessorOptions;
/// \brief Stores token information for comparing actual tokens with
/// predefined values. Only handles simple tokens and identifiers.
/// like the \#include stack, token expansion, etc.
///
class Preprocessor : public RefCountedBase<Preprocessor> {
+ llvm::IntrusiveRefCntPtr<PreprocessorOptions> PPOpts;
DiagnosticsEngine *Diags;
LangOptions &LangOpts;
const TargetInfo *Target;
MacroInfoChain *MICache;
public:
- Preprocessor(DiagnosticsEngine &diags, LangOptions &opts,
+ Preprocessor(llvm::IntrusiveRefCntPtr<PreprocessorOptions> PPOpts,
+ DiagnosticsEngine &diags, LangOptions &opts,
const TargetInfo *target,
SourceManager &SM, HeaderSearch &Headers,
ModuleLoader &TheModuleLoader,
#include "clang/Serialization/ASTWriter.h"
#include "clang/Lex/HeaderSearch.h"
#include "clang/Lex/Preprocessor.h"
+#include "clang/Lex/PreprocessorOptions.h"
#include "clang/Basic/TargetOptions.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Basic/Diagnostic.h"
OwningPtr<ASTReader> Reader;
- AST->PP = new Preprocessor(AST->getDiagnostics(), AST->ASTFileLangOpts,
+ AST->PP = new Preprocessor(new PreprocessorOptions(),
+ AST->getDiagnostics(), AST->ASTFileLangOpts,
/*Target=*/0, AST->getSourceManager(), HeaderInfo,
*AST,
/*IILookup=*/0,
getDiagnostics(),
getLangOpts(),
&getTarget());
- PP = new Preprocessor(getDiagnostics(), getLangOpts(), &getTarget(),
+ PP = new Preprocessor(&getPreprocessorOpts(),
+ getDiagnostics(), getLangOpts(), &getTarget(),
getSourceManager(), *HeaderInfo, *this, PTHMgr,
/*OwnsHeaderSearch=*/true);
//===----------------------------------------------------------------------===//
#include "clang/Lex/Preprocessor.h"
+#include "clang/Lex/PreprocessorOptions.h"
#include "MacroArgs.h"
#include "clang/Lex/ExternalPreprocessorSource.h"
#include "clang/Lex/HeaderSearch.h"
PPMutationListener::~PPMutationListener() { }
-Preprocessor::Preprocessor(DiagnosticsEngine &diags, LangOptions &opts,
+Preprocessor::Preprocessor(llvm::IntrusiveRefCntPtr<PreprocessorOptions> PPOpts,
+ DiagnosticsEngine &diags, LangOptions &opts,
const TargetInfo *target, SourceManager &SM,
HeaderSearch &Headers, ModuleLoader &TheModuleLoader,
IdentifierInfoLookup* IILookup,
bool OwnsHeaders,
bool DelayInitialization,
bool IncrProcessing)
- : Diags(&diags), LangOpts(opts), Target(target),FileMgr(Headers.getFileMgr()),
+ : PPOpts(PPOpts), Diags(&diags), LangOpts(opts), Target(target),
+ FileMgr(Headers.getFileMgr()),
SourceMgr(SM), HeaderInfo(Headers), TheModuleLoader(TheModuleLoader),
ExternalSource(0), Identifiers(opts, IILookup),
IncrementalProcessing(IncrProcessing), CodeComplete(0),
#include "clang/Lex/HeaderSearch.h"
#include "clang/Lex/HeaderSearchOptions.h"
#include "clang/Lex/Preprocessor.h"
+#include "clang/Lex/PreprocessorOptions.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Config/config.h"
VoidModuleLoader ModLoader;
HeaderSearch HeaderInfo(new HeaderSearchOptions, FileMgr, Diags, LangOpts,
&*Target);
- Preprocessor PP(Diags, LangOpts,
- Target.getPtr(),
+ Preprocessor PP(new PreprocessorOptions(), Diags, LangOpts, Target.getPtr(),
SourceMgr, HeaderInfo, ModLoader,
/*IILookup =*/ 0,
/*OwnsHeaderSearch =*/false,
VoidModuleLoader ModLoader;
HeaderSearch HeaderInfo(new HeaderSearchOptions, FileMgr, Diags, LangOpts,
&*Target);
- Preprocessor PP(Diags, LangOpts,
- Target.getPtr(),
+ Preprocessor PP(new PreprocessorOptions(), Diags, LangOpts, Target.getPtr(),
SourceMgr, HeaderInfo, ModLoader,
/*IILookup =*/ 0,
/*OwnsHeaderSearch =*/false,
VoidModuleLoader ModLoader;
HeaderSearch HeaderInfo(new HeaderSearchOptions, FileMgr, Diags, LangOpts,
&*Target);
- Preprocessor PP(Diags, LangOpts,
- Target.getPtr(),
+ Preprocessor PP(new PreprocessorOptions(), Diags, LangOpts, Target.getPtr(),
SourceMgr, HeaderInfo, ModLoader,
/*IILookup =*/ 0,
/*OwnsHeaderSearch =*/false,
#include "clang/Lex/HeaderSearch.h"
#include "clang/Lex/HeaderSearchOptions.h"
#include "clang/Lex/Preprocessor.h"
+#include "clang/Lex/PreprocessorOptions.h"
#include "llvm/Config/config.h"
#include "gtest/gtest.h"
VoidModuleLoader ModLoader;
HeaderSearch HeaderInfo(new HeaderSearchOptions, FileMgr, Diags, LangOpts,
Target.getPtr());
- Preprocessor PP(Diags, LangOpts,
- Target.getPtr(),
+ Preprocessor PP(new PreprocessorOptions(), Diags, LangOpts, Target.getPtr(),
SourceMgr, HeaderInfo, ModLoader,
/*IILookup =*/ 0,
/*OwnsHeaderSearch =*/false,
#include "clang/Lex/HeaderSearch.h"
#include "clang/Lex/HeaderSearchOptions.h"
#include "clang/Lex/Preprocessor.h"
+#include "clang/Lex/PreprocessorOptions.h"
#include "clang/Lex/PreprocessingRecord.h"
#include "llvm/Config/config.h"
VoidModuleLoader ModLoader;
HeaderSearch HeaderInfo(new HeaderSearchOptions, FileMgr, Diags, LangOpts,
Target.getPtr());
- Preprocessor PP(Diags, LangOpts,
- Target.getPtr(),
+ Preprocessor PP(new PreprocessorOptions(), Diags, LangOpts,Target.getPtr(),
SourceMgr, HeaderInfo, ModLoader,
/*IILookup =*/ 0,
/*OwnsHeaderSearch =*/false,