diff options
author | Dan Gohman <gohman@apple.com> | 2009-09-10 23:37:55 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-09-10 23:37:55 +0000 |
commit | e6992f728a94654e43269580a10a667f18dadba9 (patch) | |
tree | 5e6c18363d9917d22eec2a3f54d9c9c24dd37aee /include/llvm | |
parent | 83e3c4f9d796a5da223a3ebd5d4ba985c7ecc39d (diff) | |
download | llvm-e6992f728a94654e43269580a10a667f18dadba9.tar.gz llvm-e6992f728a94654e43269580a10a667f18dadba9.tar.bz2 llvm-e6992f728a94654e43269580a10a667f18dadba9.tar.xz |
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
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Constants.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index 5fadbc251b..86d14912a4 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -713,6 +713,13 @@ public: /// and the getIndices() method may be used. bool hasIndices() const; + /// @brief Return true if this is a getelementptr expression and all + /// the index operands are compile-time known integers within the + /// corresponding notional static array extents. Note that this is + /// not equivalant to, a subset of, or a superset of the "inbounds" + /// property. + bool isGEPWithNoNotionalOverIndexing() const; + /// Select constant expr /// static Constant *getSelect(Constant *C, Constant *V1, Constant *V2) { |