mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
teach valuetracking about ConstantDataSequential
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148790 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -624,6 +624,15 @@ Constant *ConstantAggregateZero::getElementValue(Constant *C) {
|
||||
return getStructElement(cast<ConstantInt>(C)->getZExtValue());
|
||||
}
|
||||
|
||||
/// getElementValue - Return a zero of the right value for the specified GEP
|
||||
/// index.
|
||||
Constant *ConstantAggregateZero::getElementValue(unsigned Idx) {
|
||||
if (isa<SequentialType>(getType()))
|
||||
return getSequentialElement();
|
||||
return getStructElement(Idx);
|
||||
}
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// UndefValue Implementation
|
||||
//===----------------------------------------------------------------------===//
|
||||
@@ -648,6 +657,15 @@ UndefValue *UndefValue::getElementValue(Constant *C) {
|
||||
return getStructElement(cast<ConstantInt>(C)->getZExtValue());
|
||||
}
|
||||
|
||||
/// getElementValue - Return an undef of the right value for the specified GEP
|
||||
/// index.
|
||||
UndefValue *UndefValue::getElementValue(unsigned Idx) {
|
||||
if (isa<SequentialType>(getType()))
|
||||
return getSequentialElement();
|
||||
return getStructElement(Idx);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// ConstantXXX Classes
|
||||
|
Reference in New Issue
Block a user