================
Comment at: tools/clang/lib/CodeGen/CGClass.cpp:186
@@ +185,3 @@
+      EmitTypeCheck(TCK_Upcast, Loc, Value, DerivedTy, DerivedAlign,
+                    !NullCheckValue);
+    }
----------------
rsmith wrote:
> I am not sure that the `SkipNullCheck` behavior here is right. If 
> `NullCheckValue` is false, then I think we should be performing a null check 
> inside `EmitTypeCheck` rather than assuming the pointer is non-null.
That is, just pass "false" here? But in some cases we're calling  
CodeGenFunction::GetAddressOfBaseClass on values which are guaranteed to be 
non-null (e.g. on materialized temporaries), as they happen in 
compiler-generated code. I'm not sure we still want to emit null-check in 
EmitTypeCheck in this case.

http://reviews.llvm.org/D5635



_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to