diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-11-20 01:29:45 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-11-20 01:29:45 +0000 |
commit | 452e37837a48b2f0ced144784277fd4d28cbede9 (patch) | |
tree | 6c53176393b527ab5656def9eb71104b898cfcb4 /include/clang | |
parent | 4d35da2e41941965bbee8ed7e8c30e7c21000d71 (diff) |
- Default initialize ParsingPreprocessorDirective, ParsingFilename, and
LexingRawMode in the ctor of PreprocessorLexer.
- PTHLexer: Use "LastToken" instead of "NumToken"
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59690 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/Lex/PTHLexer.h | 23 | ||||
-rw-r--r-- | include/clang/Lex/PreprocessorLexer.h | 7 |
2 files changed, 12 insertions, 18 deletions
diff --git a/include/clang/Lex/PTHLexer.h b/include/clang/Lex/PTHLexer.h index da1db2d165..96049b74f2 100644 --- a/include/clang/Lex/PTHLexer.h +++ b/include/clang/Lex/PTHLexer.h @@ -11,29 +11,24 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_PTHLexer_H -#define LLVM_CLANG_PTHLexer_H +#ifndef LLVM_CLANG_PTHLEXER_H +#define LLVM_CLANG_PTHLEXER_H #include "clang/Lex/PreprocessorLexer.h" namespace clang { class PTHLexer : public PreprocessorLexer { - /// FileLoc - Location for the start of the file. - /// - SourceLocation FileLoc; - /// Tokens - This is the pointer to an array of tokens that the macro is /// defined to, with arguments expanded for function-like macros. If this is /// a token stream, these are the tokens we are returning. const Token *Tokens; - /// NumTokens - This is the length of the Tokens array. - /// - unsigned NumTokens; + /// LastTokenIdx - The index of the last token in Tokens. This token + /// will be an eof token. + unsigned LastToken; - /// CurToken - This is the next token that Lex will return. - /// + /// CurToken - This is the index of the next token that Lex will return. unsigned CurToken; PTHLexer(const PTHLexer&); // DO NOT IMPLEMENT @@ -51,12 +46,6 @@ public: void setEOF(Token &Tok); - /// getFileLoc - Return the File Location for the file we are lexing out of. - /// The physical location encodes the location where the characters come from, - /// the virtual location encodes where we should *claim* the characters came - /// from. Currently this is only used by _Pragma handling. - SourceLocation getFileLoc() const { return FileLoc; } - /// DiscardToEndOfLine - Read the rest of the current preprocessor line as an /// uninterpreted string. This switches the lexer out of directive mode. void DiscardToEndOfLine(); diff --git a/include/clang/Lex/PreprocessorLexer.h b/include/clang/Lex/PreprocessorLexer.h index df8049e214..5d976ff08d 100644 --- a/include/clang/Lex/PreprocessorLexer.h +++ b/include/clang/Lex/PreprocessorLexer.h @@ -68,7 +68,12 @@ protected: friend class Preprocessor; PreprocessorLexer(Preprocessor* pp, SourceLocation L); - PreprocessorLexer() : PP(0), FileID(0) {} + + PreprocessorLexer() + : PP(0), FileID(0), + ParsingPreprocessorDirective(false), + ParsingFilename(false), + LexingRawMode(false) {} virtual ~PreprocessorLexer(); |