Minor cleanup from yesterday's -fms-extension commit. Move __int* MS keywords to predefined macros. This removes some of the MS-madness from Parser::ParseDeclarationSpecifiers().

llvm-svn: 46852
This commit is contained in:
Steve Naroff 2008-02-07 15:26:07 +00:00
parent e187d0511f
commit 6936a08704
3 changed files with 4 additions and 8 deletions

View File

@ -430,6 +430,10 @@ static void InitializePredefinedMacros(Preprocessor &PP,
DefineBuiltinMacro(Buf, "_cdecl=");
DefineBuiltinMacro(Buf, "__ptr64=");
DefineBuiltinMacro(Buf, "__forceinline=");
DefineBuiltinMacro(Buf, "__int8=char");
DefineBuiltinMacro(Buf, "__int16=short");
DefineBuiltinMacro(Buf, "__int32=int");
DefineBuiltinMacro(Buf, "__int64=long");
}
// FIXME: Should emit a #line directive here.
}

View File

@ -516,11 +516,9 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS) {
break;
// type-specifiers
case tok::kw___int16:
case tok::kw_short:
isInvalid = DS.SetTypeSpecWidth(DeclSpec::TSW_short, Loc, PrevSpec);
break;
case tok::kw___int64:
case tok::kw_long:
if (DS.getTypeSpecWidth() != DeclSpec::TSW_long)
isInvalid = DS.SetTypeSpecWidth(DeclSpec::TSW_long, Loc, PrevSpec);
@ -542,11 +540,9 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS) {
case tok::kw_void:
isInvalid = DS.SetTypeSpecType(DeclSpec::TST_void, Loc, PrevSpec);
break;
case tok::kw___int8:
case tok::kw_char:
isInvalid = DS.SetTypeSpecType(DeclSpec::TST_char, Loc, PrevSpec);
break;
case tok::kw___int32:
case tok::kw_int:
isInvalid = DS.SetTypeSpecType(DeclSpec::TST_int, Loc, PrevSpec);
break;

View File

@ -302,10 +302,6 @@ KEYWORD(__private_extern__ , EXTC90|EXTC99|NOTCPP)
// Microsoft Extensions.
KEYWORD(__w64 , EXTC90|EXTC99|NOTCPP)
KEYWORD(__declspec , EXTC90|EXTC99|NOTCPP)
KEYWORD(__int8 , EXTC90|EXTC99|NOTCPP)
KEYWORD(__int16 , EXTC90|EXTC99|NOTCPP)
KEYWORD(__int32 , EXTC90|EXTC99|NOTCPP)
KEYWORD(__int64 , EXTC90|EXTC99|NOTCPP)
// Alternate spelling for various tokens. There are GCC extensions in all
// languages, but should not be disabled in strict conformance mode.