ahatanak added inline comments.
================ Comment at: clang/lib/CodeGen/Address.h:97 + llvm::Value * + getPointer(KnownNonNull_t KnownNonNull = KnownNonNull_t::False) const { assert(isValid()); ---------------- rjmccall wrote: > Apologies if this rehashes a conversation we had earlier, but does it make > more sense to track this internally in `Address`? Some `Address` sources > definitely known that they're non-null, and the places where we only know > that *contextually* could definitely just pass it down to e.g. > `EmitPointerWithAlignment`. That would make it a less invasive change for > all the clients of `getPointer()`. Yes, tracking it in `Address` and `LValue` is another way to fix the problem. The implementation in my local branch currently adds an `IsKnownNonNull` flag to the constructor of `Address` and method `setKnownNonNull` to both `Address` and `LValue`. The method is called when the pointer is known not to be null contextually. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142584/new/ https://reviews.llvm.org/D142584 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits