summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PTHLexer.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-11-20 01:16:50 +0000
committerTed Kremenek <kremenek@apple.com>2008-11-20 01:16:50 +0000
commit61915f5d4ac343f537a0eb2e11c3e99165ecf9a1 (patch)
tree992e272f932b998def8795727b8ecd9821f152ab /clang/lib/Lex/PTHLexer.cpp
parent678f8d7992b6516138af35735dcefcb2b28e9486 (diff)
downloadbcm5719-llvm-61915f5d4ac343f537a0eb2e11c3e99165ecf9a1.tar.gz
bcm5719-llvm-61915f5d4ac343f537a0eb2e11c3e99165ecf9a1.zip
Add (untested) implementation of PTHLexer::isNextPPTokenLParen() and PTHLexer::DiscardToEndOfLine().
llvm-svn: 59687
Diffstat (limited to 'clang/lib/Lex/PTHLexer.cpp')
-rw-r--r--clang/lib/Lex/PTHLexer.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/clang/lib/Lex/PTHLexer.cpp b/clang/lib/Lex/PTHLexer.cpp
index e9d6d4794f9..5adcd9f6a14 100644
--- a/clang/lib/Lex/PTHLexer.cpp
+++ b/clang/lib/Lex/PTHLexer.cpp
@@ -80,11 +80,21 @@ void PTHLexer::setEOF(Token& Tok) {
void PTHLexer::DiscardToEndOfLine() {
assert(ParsingPreprocessorDirective && ParsingFilename == false &&
"Must be in a preprocessing directive!");
- assert (0 && "Not implemented.");
+
+ // Already at end-of-file?
+ if (CurToken == NumTokens)
+ return;
+
+ // Find the first token that is not the start of the *current* line.
+ for ( ++CurToken; CurToken != NumTokens ; ++CurToken )
+ if (Tokens[CurToken].isAtStartOfLine())
+ return;
}
-unsigned PTHLexer::isNextPPTokenLParen() {
- assert (0 && "Not implemented.");
- return 0;
+unsigned PTHLexer::isNextPPTokenLParen() {
+ if (CurToken == NumTokens)
+ return 2;
+
+ return Tokens[CurToken].is(tok::l_paren);
}
OpenPOWER on IntegriCloud