diff options
author | Francois Pichet <pichet2000@gmail.com> | 2011-04-28 01:59:37 +0000 |
---|---|---|
committer | Francois Pichet <pichet2000@gmail.com> | 2011-04-28 01:59:37 +0000 |
commit | 84133e41bea2ff64b5d9ded1b78b14800fe4bce8 (patch) | |
tree | bf5191c01f42ed62a4c4199009c680826ebd3780 /clang/lib/Parse/ParseDecl.cpp | |
parent | b5fabb2f9fd53621ffd6afe27b20937f36993b3d (diff) | |
download | bcm5719-llvm-84133e41bea2ff64b5d9ded1b78b14800fe4bce8.tar.gz bcm5719-llvm-84133e41bea2ff64b5d9ded1b78b14800fe4bce8.zip |
Upgrade Microsoft's __int8, __int16, __int32 and __int64 types from builtin defines to real types.
Otherwise statements like:
__int64 var = __int64(0);
would be expanded to:
long long var = long long(0);
and fail to compile.
llvm-svn: 130369
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index dabb7565cb0..24a487c89c3 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -171,6 +171,7 @@ void Parser::ParseGNUAttributes(ParsedAttributes &attrs, case tok::kw_short: case tok::kw_int: case tok::kw_long: + case tok::kw___int64: case tok::kw_signed: case tok::kw_unsigned: case tok::kw_float: @@ -1688,6 +1689,10 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, isInvalid = DS.SetTypeSpecWidth(DeclSpec::TSW_longlong, Loc, PrevSpec, DiagID); break; + case tok::kw___int64: + isInvalid = DS.SetTypeSpecWidth(DeclSpec::TSW_longlong, Loc, PrevSpec, + DiagID); + break; case tok::kw_signed: isInvalid = DS.SetTypeSpecSign(DeclSpec::TSS_signed, Loc, PrevSpec, DiagID); @@ -1986,6 +1991,10 @@ bool Parser::ParseOptionalTypeSpecifier(DeclSpec &DS, bool& isInvalid, isInvalid = DS.SetTypeSpecWidth(DeclSpec::TSW_longlong, Loc, PrevSpec, DiagID); break; + case tok::kw___int64: + isInvalid = DS.SetTypeSpecWidth(DeclSpec::TSW_longlong, Loc, PrevSpec, + DiagID); + break; case tok::kw_signed: isInvalid = DS.SetTypeSpecSign(DeclSpec::TSS_signed, Loc, PrevSpec, DiagID); break; @@ -2704,6 +2713,7 @@ bool Parser::isKnownToBeTypeSpecifier(const Token &Tok) const { // type-specifiers case tok::kw_short: case tok::kw_long: + case tok::kw___int64: case tok::kw_signed: case tok::kw_unsigned: case tok::kw__Complex: @@ -2772,6 +2782,7 @@ bool Parser::isTypeSpecifierQualifier() { // type-specifiers case tok::kw_short: case tok::kw_long: + case tok::kw___int64: case tok::kw_signed: case tok::kw_unsigned: case tok::kw__Complex: @@ -2895,6 +2906,7 @@ bool Parser::isDeclarationSpecifier(bool DisambiguatingWithExpression) { // type-specifiers case tok::kw_short: case tok::kw_long: + case tok::kw___int64: case tok::kw_signed: case tok::kw_unsigned: case tok::kw__Complex: |