diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-10-21 03:57:52 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-10-21 03:57:52 +0000 |
commit | 60060d6f8fd1a9e50d6c635d99736e70328ab6f3 (patch) | |
tree | b4e183db3e4167c2ed50000c9297cc6c8498c88d /clang/lib/Parse/Parser.cpp | |
parent | 99cc8c01ee6421d634b4cb47ac0c89d952e36785 (diff) | |
download | bcm5719-llvm-60060d6f8fd1a9e50d6c635d99736e70328ab6f3.tar.gz bcm5719-llvm-60060d6f8fd1a9e50d6c635d99736e70328ab6f3.zip |
Treat the Microsoft/Borland keyword "__except" as a context-sensitive
keyword, because both libstdc++ and libc++ use "__except" as an
identifier. Fixes <rdar://problem/10322555>.
llvm-svn: 142636
Diffstat (limited to 'clang/lib/Parse/Parser.cpp')
-rw-r--r-- | clang/lib/Parse/Parser.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp index 2e0c46dbdbf..2face304c0a 100644 --- a/clang/lib/Parse/Parser.cpp +++ b/clang/lib/Parse/Parser.cpp @@ -23,6 +23,14 @@ #include "clang/AST/ASTConsumer.h" using namespace clang; +IdentifierInfo *Parser::getSEHExceptKeyword() { + // __except is accepted as a (contextual) keyword + if (!Ident__except && (getLang().MicrosoftExt || getLang().Borland)) + Ident__except = PP.getIdentifierInfo("__except"); + + return Ident__except; +} + Parser::Parser(Preprocessor &pp, Sema &actions) : PP(pp), Actions(actions), Diags(PP.getDiagnostics()), GreaterThanIsOperator(true), ColonIsSacred(false), @@ -431,6 +439,8 @@ void Parser::Initialize() { Ident_obsoleted = 0; Ident_unavailable = 0; + Ident__except = 0; + Ident__exception_code = Ident__exception_info = Ident__abnormal_termination = 0; Ident___exception_code = Ident___exception_info = Ident___abnormal_termination = 0; Ident_GetExceptionCode = Ident_GetExceptionInfo = Ident_AbnormalTermination = 0; |