[PATCH] D17993: [CodeGen] Apply 'nonnull' to 'this' pointer arguments.
CJ Johnson via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Oct 31 09:49:10 PDT 2020
CJ-Johnson marked an inline comment as done.
CJ-Johnson added inline comments.
================
Comment at: clang/test/CodeGenCXX/microsoft-abi-multiple-nonvirtual-inheritance.cpp:126
//
-// CHECK: call x86_thiscallcc void %[[VFUN_VALUE]](i8* %[[RIGHT]])
+// CHECK: call x86_thiscallcc void %[[VFUN_VALUE]](i8* nonnull %[[RIGHT]])
// CHECK: ret
----------------
rsmith wrote:
> Why does this call get `nonnull` but not `dereferenceable`? Seems like we should be able to use at least `dereferenceable(sizeof(Right))` here -- but I think we could actually be more aggressive and pass `dereferenceable(sizeof(ChildOverride) - offsetof(ChildOverride, <Right base class>))`.
Fixed! Added a check for `isVoidPointerType()` :)
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D17993/new/
https://reviews.llvm.org/D17993
More information about the cfe-commits
mailing list