diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-05-18 16:57:00 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-05-18 16:57:00 +0000 |
commit | f813a2c03fcb05381b3252010435f557eb6b3cde (patch) | |
tree | 63c5ee667ae6620d0fa3bc013ee08a32cd6e722e /lib/Parse/ParseDecl.cpp | |
parent | a83fb4bf8119b980ccf7de0795dff250a799ea58 (diff) |
Add support for Microsoft's __thiscall, from Steven Watanabe!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104026 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 28d9dd021c..929b20cc3d 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -277,8 +277,8 @@ AttributeList* Parser::ParseMicrosoftTypeAttributes(AttributeList *CurrAttr) { // Treat these like attributes // FIXME: Allow Sema to distinguish between these and real attributes! while (Tok.is(tok::kw___fastcall) || Tok.is(tok::kw___stdcall) || - Tok.is(tok::kw___cdecl) || Tok.is(tok::kw___ptr64) || - Tok.is(tok::kw___w64)) { + Tok.is(tok::kw___thiscall) || Tok.is(tok::kw___cdecl) || + Tok.is(tok::kw___ptr64) || Tok.is(tok::kw___w64)) { IdentifierInfo *AttrName = Tok.getIdentifierInfo(); SourceLocation AttrNameLoc = ConsumeToken(); if (Tok.is(tok::kw___ptr64) || Tok.is(tok::kw___w64)) @@ -1143,6 +1143,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, case tok::kw___cdecl: case tok::kw___stdcall: case tok::kw___fastcall: + case tok::kw___thiscall: DS.AddAttributes(ParseMicrosoftTypeAttributes()); continue; @@ -1622,6 +1623,7 @@ bool Parser::ParseOptionalTypeSpecifier(DeclSpec &DS, bool& isInvalid, case tok::kw___cdecl: case tok::kw___stdcall: case tok::kw___fastcall: + case tok::kw___thiscall: DS.AddAttributes(ParseMicrosoftTypeAttributes()); return true; @@ -2198,6 +2200,7 @@ bool Parser::isTypeSpecifierQualifier() { case tok::kw___cdecl: case tok::kw___stdcall: case tok::kw___fastcall: + case tok::kw___thiscall: case tok::kw___w64: case tok::kw___ptr64: return true; @@ -2304,6 +2307,7 @@ bool Parser::isDeclarationSpecifier() { case tok::kw___cdecl: case tok::kw___stdcall: case tok::kw___fastcall: + case tok::kw___thiscall: case tok::kw___w64: case tok::kw___ptr64: case tok::kw___forceinline: @@ -2401,6 +2405,7 @@ void Parser::ParseTypeQualifierListOpt(DeclSpec &DS, bool GNUAttributesAllowed, case tok::kw___cdecl: case tok::kw___stdcall: case tok::kw___fastcall: + case tok::kw___thiscall: if (GNUAttributesAllowed) { DS.AddAttributes(ParseMicrosoftTypeAttributes()); continue; @@ -2785,8 +2790,8 @@ void Parser::ParseParenDeclarator(Declarator &D) { } // Eat any Microsoft extensions. if (Tok.is(tok::kw___cdecl) || Tok.is(tok::kw___stdcall) || - Tok.is(tok::kw___fastcall) || Tok.is(tok::kw___w64) || - Tok.is(tok::kw___ptr64)) { + Tok.is(tok::kw___thiscall) || Tok.is(tok::kw___fastcall) || + Tok.is(tok::kw___w64) || Tok.is(tok::kw___ptr64)) { AttrList.reset(ParseMicrosoftTypeAttributes(AttrList.take())); } |