[PATCH] Extract the load/store type verification to a separate function.

Filipe Cabecinhas filcab+llvm.phabricator at gmail.com
Thu May 14 18:39:37 PDT 2015


Hi dblaikie, rafael,

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).

http://reviews.llvm.org/D9785

Files:
  include/llvm/IR/DerivedTypes.h
  lib/Bitcode/Reader/BitcodeReader.cpp
  lib/IR/Type.cpp
  test/Bitcode/Inputs/invalid-load-ptr-type.bc
  test/Bitcode/invalid.test

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9785.25834.patch
Type: text/x-patch
Size: 6618 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150515/1a92db11/attachment.bin>


More information about the llvm-commits mailing list