jmorse wrote:

>  Regarding the direction of the patch, it seems a little unfortunate to 
> completely remove getFirstNonPHI() - sometimes we want the instruction and 
> sometimes we want the iterator, and forcing all of them to go through 
> getFirstNonPHIIt() may increase the chances that the iterator and instruction 
> are viewed as interchangeable and lead to people using 
> &*BB->getFirstNonPHIIt() as an insertion point. 

Indeed, this is the sharp end of RemoveDIs, we can't force all behaviours to be 
correct by using the type system, we have to accept some scope for 
misbehaviour. All things considered, I think having the type system bark at you 
beats relying on people to get it right each time. There's also some scope for 
static-analysis and dynamic instrumentation if we end up needing to scan for 
errors / risky behaviours.

(Pushing up rebased version then merging)

https://github.com/llvm/llvm-project/pull/123737
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to