Stop APInt::shl from generating llvm.trap
authorDerek Schuff <dschuff@google.com>
Fri, 26 Oct 2012 19:52:27 +0000 (19:52 +0000)
committerDerek Schuff <dschuff@google.com>
Fri, 26 Oct 2012 19:52:27 +0000 (19:52 +0000)
commit8f5eff7e76491f39c62455d97cf8f704631e54d7
tree11954f2bb4723614a1b28375bf425ba13006f297
parente0d9db99532c4b8eda0d57a4b3ccc00d2b019a15
Stop APInt::shl from generating llvm.trap

APInt::shl generated llvm.trap to guard against shifts greater than bit-width.
This was already checked with an assert, and there was a special case for
shifts equal to bit-width. Modify this check to catch shifts greater than or
equal to bit-width, so llvm.trap isn't generated.

Patch contributed by JF Bastien

llvm-svn: 166803
llvm/include/llvm/ADT/APInt.h