diff options
author | Chris Lattner <sabre@nondot.org> | 2009-04-19 07:32:03 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-04-19 07:32:03 +0000 |
commit | aa269c2e9c242a2fdf1f47ea400f58823ae9e395 (patch) | |
tree | 46ad9d67c5031bd0430c13949afbfeba74345570 | |
parent | 2135619d9302224d26292906d286d6bdaa9ab0f2 (diff) |
invalid directives can occur in #if 0 code, just pass them
through like other directives PTH doesn't care about. This
should fix rdar://6804029
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69524 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | tools/clang-cc/CacheTokens.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/clang-cc/CacheTokens.cpp b/tools/clang-cc/CacheTokens.cpp index c417eb4902..2b08818f8f 100644 --- a/tools/clang-cc/CacheTokens.cpp +++ b/tools/clang-cc/CacheTokens.cpp @@ -490,12 +490,15 @@ PTHEntry PTHWriter::LexTokens(Lexer& L) { Tok.setIdentifierInfo(II); tok::PPKeywordKind K = II->getPPKeywordID(); - assert(K != tok::pp_not_keyword); ParsingPreprocessorDirective = true; switch (K) { + case tok::pp_not_keyword: + // Invalid directives "#foo" can occur in #if 0 blocks etc, just pass + // them through. default: break; + case tok::pp_include: case tok::pp_import: case tok::pp_include_next: { |