]> granicus.if.org Git - clang/commitdiff
lib/Sema/SemaExpr.cpp: __null should be LongLongTy on LLP64 Win64.
authorNAKAMURA Takumi <geek4civic@gmail.com>
Wed, 19 Jan 2011 00:11:41 +0000 (00:11 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Wed, 19 Jan 2011 00:11:41 +0000 (00:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123791 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp

index e2e802c7901c586a5b4894e322f0654daf3f3d1e..687d4597872b78d573d3c6c8592ade7c028ae3e6 100644 (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));
 }