aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2011-01-19 00:11:41 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2011-01-19 00:11:41 +0000
commit6e5658dc89671a55a0d0f9514db385d752d6ac08 (patch)
tree6fc5229b2b3959dfa06ce858f83fbe1c87a11601 /lib/Sema/SemaExpr.cpp
parentff8be0e08e409af53130d12ce36019b35288fb78 (diff)
lib/Sema/SemaExpr.cpp: __null should be LongLongTy on LLP64 Win64.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123791 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index e2e802c790..687d459787 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -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));
}