Page MenuHomePhabricator

[MemoryBuiltins] Remove isOperatorNewLike by consolidating non-null inference handling
ClosedPublic

Authored by reames on Dec 29 2015, 6:06 PM.

Details

Summary

This patch removes the isOperatorNewLike predicate since it was only being used to establish a non-null return value and we have attributes specifically for that purpose with generic handling. To keep approximate the same behaviour for existing frontends, I added the various operator new like (i.e. instances of operator new) to InferFunctionAttrs. It's not really clear to me why this isn't handled in Clang, but I didn't want to break existing code and any subtle assumptions it might have.

Once this patch is in, I'm going to start separating the isAllocLike family of predicates. These appear to be being used for a mixture of things which should be more clearly separated and documented. Today, they're being used to indicate (at least) aliasing facts, CSE-ability, and default values from an allocation site.

Diff Detail

Repository
rL LLVM

Event Timeline

reames updated this revision to Diff 43771.Dec 29 2015, 6:06 PM
reames retitled this revision from to [MemoryBuiltins] Remove isOperatorNewLike by consolidating non-null inference handling.
reames updated this object.
reames added reviewers: chandlerc, majnemer, nlopes.
reames added a subscriber: llvm-commits.
nlopes edited edge metadata.Dec 30 2015, 2:25 PM

LGTM.
I agree with you re InferFunctionAttrs. I don't see any reason why we have InferFunctionAttrs recognize all those library functions instead of having the frontend doing it. But removing it at this point may break someone's code..

This revision was automatically updated to reflect the committed changes.