forked from OSchip/llvm-project
[ConstantFolding] Remove unused ConstantFoldLoadThroughGEPConstantExpr()
This API is no longer used since bbeaf2aac6
.
This commit is contained in:
parent
2a92efd0a2
commit
71b2c4a3cf
|
@ -148,13 +148,6 @@ Constant *ConstantFoldLoadFromConstPtr(Constant *C, Type *Ty, APInt Offset,
|
|||
Constant *ConstantFoldLoadFromConstPtr(Constant *C, Type *Ty,
|
||||
const DataLayout &DL);
|
||||
|
||||
/// ConstantFoldLoadThroughGEPConstantExpr - Given a constant and a
|
||||
/// getelementptr constantexpr, return the constant value being addressed by the
|
||||
/// constant expression, or null if something is funny and we can't decide.
|
||||
Constant *ConstantFoldLoadThroughGEPConstantExpr(Constant *C, ConstantExpr *CE,
|
||||
Type *Ty,
|
||||
const DataLayout &DL);
|
||||
|
||||
/// canConstantFoldCallTo - Return true if its even possible to fold a call to
|
||||
/// the specified function.
|
||||
bool canConstantFoldCallTo(const CallBase *Call, const Function *F);
|
||||
|
|
|
@ -1368,23 +1368,6 @@ Constant *llvm::ConstantFoldCastOperand(unsigned Opcode, Constant *C,
|
|||
}
|
||||
}
|
||||
|
||||
Constant *llvm::ConstantFoldLoadThroughGEPConstantExpr(Constant *C,
|
||||
ConstantExpr *CE,
|
||||
Type *Ty,
|
||||
const DataLayout &DL) {
|
||||
if (!CE->getOperand(1)->isNullValue())
|
||||
return nullptr; // Do not allow stepping over the value!
|
||||
|
||||
// Loop over all of the operands, tracking down which value we are
|
||||
// addressing.
|
||||
for (unsigned i = 2, e = CE->getNumOperands(); i != e; ++i) {
|
||||
C = C->getAggregateElement(CE->getOperand(i));
|
||||
if (!C)
|
||||
return nullptr;
|
||||
}
|
||||
return ConstantFoldLoadThroughBitcast(C, Ty, DL);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Constant Folding for Calls
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue