Added transfer function support for sizeof(void)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47443 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Analysis/GRExprEngine.cpp b/Analysis/GRExprEngine.cpp
index fb6dc80..1ca3761 100644
--- a/Analysis/GRExprEngine.cpp
+++ b/Analysis/GRExprEngine.cpp
@@ -528,18 +528,22 @@
   QualType T = Ex->getArgumentType();
   
   // FIXME: Implement alignof
-  // FIXME: Add support for sizeof(void)
-  // FIXME: Add support for VLAs.
 
+  // FIXME: Add support for VLAs.
   if (!T.getTypePtr()->isConstantSizeType())
     return;
   
-  SourceLocation Loc = Ex->getExprLoc();
-  uint64_t size = getContext().getTypeSize(T, Loc) / 8;
+  
+  uint64_t size = 1;  // Handle sizeof(void)
+  
+  if (T != getContext().VoidTy) {
+    SourceLocation Loc = Ex->getExprLoc();
+    size = getContext().getTypeSize(T, Loc) / 8;
+  }
   
   Nodify(Dst, Ex, Pred,
          SetRVal(Pred->getState(), Ex,
-                  NonLVal::MakeVal(ValMgr, size, Ex->getType(), Loc)));
+                  NonLVal::MakeVal(ValMgr, size, Ex->getType())));
   
 }