Factor out the code for checking that all indices in a getelementptr are
authorDan Gohman <gohman@apple.com>
Thu, 10 Sep 2009 23:37:55 +0000 (23:37 +0000)
committerDan Gohman <gohman@apple.com>
Thu, 10 Sep 2009 23:37:55 +0000 (23:37 +0000)
commite6992f728a94654e43269580a10a667f18dadba9
tree5e6c18363d9917d22eec2a3f54d9c9c24dd37aee
parent83e3c4f9d796a5da223a3ebd5d4ba985c7ecc39d
Factor out the code for checking that all indices in a getelementptr are
within the notional bounds of the static type of the getelementptr (which
is not the same as "inbounds") from GlobalOpt into a utility routine,
and use it in ConstantFold.cpp to check whether there are any mis-behaved
indices.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81478 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Constants.h
lib/Transforms/IPO/GlobalOpt.cpp
lib/VMCore/ConstantFold.cpp
lib/VMCore/Constants.cpp
test/Transforms/InstCombine/getelementptr.ll