lib/Sema/SemaExpr.cpp: __null should be LongLongTy on LLP64 Win64.

llvm-svn: 123791
This commit is contained in:
NAKAMURA Takumi 2011-01-19 00:11:41 +00:00
parent e03c603624
commit 0d13fd3c94
1 changed files with 9 additions and 2 deletions

View File

@ -8582,10 +8582,17 @@ ExprResult Sema::ActOnGNUNullExpr(SourceLocation TokenLoc) {
// The type of __null will be int or long, depending on the size of
// pointers on the target.
QualType Ty;
if (Context.Target.getPointerWidth(0) == Context.Target.getIntWidth())
unsigned pw = Context.Target.getPointerWidth(0);
if (pw == Context.Target.getIntWidth())
Ty = Context.IntTy;
else
else if (pw == Context.Target.getLongWidth())
Ty = Context.LongTy;
else if (pw == Context.Target.getLongLongWidth())
Ty = Context.LongLongTy;
else {
assert(!"I don't know size of pointer!");
Ty = Context.IntTy;
}
return Owned(new (Context) GNUNullExpr(Ty, TokenLoc));
}