mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
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
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user