This is an archive of the discontinued LLVM Phabricator instance.

Extract the load/store type verification to a separate function.
ClosedPublic

Authored by filcab on May 14 2015, 6:39 PM.

Details

Summary

Added isLoadableOrStorableType to PointerType.

We were doing some checks in some places, occasionally assert()ing instead
of telling the caller. With this patch, I'm putting all type checking in
the same place for load/store type instructions, and verifying the same
thing every time.

I also added a check for load/store of a function type.

Applied extracted check to Load, Store, and Cmpxcg.

I don't have exhaustive tests for all of these, but all Error() calls in
TypeCheckLoadStoreInst are being tested (in invalid.test).

Diff Detail

Repository
rL LLVM

Event Timeline

filcab updated this revision to Diff 25834.May 14 2015, 6:39 PM
filcab retitled this revision from to Extract the load/store type verification to a separate function..
filcab updated this object.
filcab edited the test plan for this revision. (Show Details)
filcab added reviewers: dblaikie, rafael.
filcab added a subscriber: Unknown Object (MLST).
rnk accepted this revision.May 18 2015, 10:50 AM
rnk added a reviewer: rnk.
rnk added a subscriber: rnk.

lgtm

This revision is now accepted and ready to land.May 18 2015, 10:50 AM
This revision was automatically updated to reflect the committed changes.