aboutsummaryrefslogtreecommitdiff
path: root/lib/Target
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-02-09 04:37:31 +0000
committerChris Lattner <sabre@nondot.org>2004-02-09 04:37:31 +0000
commitd21cd809b656d3011ec089536857e048e037159c (patch)
tree131bf120f81f62962ffbb7520d785b63cf8d4b16 /lib/Target
parent037b8b70d04ce214464c89d2480811484f9ec13d (diff)
Adjust to the changed StructType interface. In particular, getElementTypes() is gone.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11228 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/CBackend/CBackend.cpp10
-rw-r--r--lib/Target/CBackend/Writer.cpp10
-rw-r--r--lib/Target/TargetData.cpp7
-rw-r--r--lib/Target/X86/InstSelectSimple.cpp2
-rw-r--r--lib/Target/X86/X86ISelSimple.cpp2
5 files changed, 13 insertions, 18 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index a4b7d8f4db..be6d4355fc 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -222,9 +222,8 @@ std::ostream &CWriter::printType(std::ostream &Out, const Type *Ty,
const StructType *STy = cast<StructType>(Ty);
Out << NameSoFar + " {\n";
unsigned Idx = 0;
- for (StructType::ElementTypes::const_iterator
- I = STy->getElementTypes().begin(),
- E = STy->getElementTypes().end(); I != E; ++I) {
+ for (StructType::element_iterator I = STy->element_begin(),
+ E = STy->element_end(); I != E; ++I) {
Out << " ";
printType(Out, *I, "field" + utostr(Idx++));
Out << ";\n";
@@ -888,9 +887,8 @@ void CWriter::printContainedStructs(const Type *Ty,
//Check to see if we have already printed this struct
if (StructPrinted.count(STy) == 0) {
// Print all contained types first...
- for (StructType::ElementTypes::const_iterator
- I = STy->getElementTypes().begin(),
- E = STy->getElementTypes().end(); I != E; ++I) {
+ for (StructType::element_iterator I = STy->element_begin(),
+ E = STy->element_end(); I != E; ++I) {
const Type *Ty1 = I->get();
if (isa<StructType>(Ty1) || isa<ArrayType>(Ty1))
printContainedStructs(*I, StructPrinted);
diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp
index a4b7d8f4db..be6d4355fc 100644
--- a/lib/Target/CBackend/Writer.cpp
+++ b/lib/Target/CBackend/Writer.cpp
@@ -222,9 +222,8 @@ std::ostream &CWriter::printType(std::ostream &Out, const Type *Ty,
const StructType *STy = cast<StructType>(Ty);
Out << NameSoFar + " {\n";
unsigned Idx = 0;
- for (StructType::ElementTypes::const_iterator
- I = STy->getElementTypes().begin(),
- E = STy->getElementTypes().end(); I != E; ++I) {
+ for (StructType::element_iterator I = STy->element_begin(),
+ E = STy->element_end(); I != E; ++I) {
Out << " ";
printType(Out, *I, "field" + utostr(Idx++));
Out << ";\n";
@@ -888,9 +887,8 @@ void CWriter::printContainedStructs(const Type *Ty,
//Check to see if we have already printed this struct
if (StructPrinted.count(STy) == 0) {
// Print all contained types first...
- for (StructType::ElementTypes::const_iterator
- I = STy->getElementTypes().begin(),
- E = STy->getElementTypes().end(); I != E; ++I) {
+ for (StructType::element_iterator I = STy->element_begin(),
+ E = STy->element_end(); I != E; ++I) {
const Type *Ty1 = I->get();
if (isa<StructType>(Ty1) || isa<ArrayType>(Ty1))
printContainedStructs(*I, StructPrinted);
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp
index 91c9d01198..9142f1dfc1 100644
--- a/lib/Target/TargetData.cpp
+++ b/lib/Target/TargetData.cpp
@@ -42,9 +42,8 @@ StructLayout::StructLayout(const StructType *ST, const TargetData &TD)
StructSize = 0;
// Loop over each of the elements, placing them in memory...
- for (StructType::ElementTypes::const_iterator
- TI = ST->getElementTypes().begin(),
- TE = ST->getElementTypes().end(); TI != TE; ++TI) {
+ for (StructType::element_iterator TI = ST->element_begin(),
+ TE = ST->element_end(); TI != TE; ++TI) {
const Type *Ty = *TI;
unsigned char A;
unsigned TyAlign;
@@ -227,7 +226,7 @@ uint64_t TargetData::getIndexedOffset(const Type *ptrTy,
Result += Layout->MemberOffsets[FieldNo];
// Update Ty to refer to current element
- Ty = STy->getElementTypes()[FieldNo];
+ Ty = STy->getElementType(FieldNo);
}
}
diff --git a/lib/Target/X86/InstSelectSimple.cpp b/lib/Target/X86/InstSelectSimple.cpp
index 45df82906b..af2544f17d 100644
--- a/lib/Target/X86/InstSelectSimple.cpp
+++ b/lib/Target/X86/InstSelectSimple.cpp
@@ -2103,7 +2103,7 @@ void ISel::emitGEPOperation(MachineBasicBlock *MBB,
}
// The next type is the member of the structure selected by the
// index.
- Ty = StTy->getElementTypes()[idxValue];
+ Ty = StTy->getElementType(idxValue);
} else if (const SequentialType *SqTy = cast<SequentialType>(Ty)) {
// It's an array or pointer access: [ArraySize x ElementType].
diff --git a/lib/Target/X86/X86ISelSimple.cpp b/lib/Target/X86/X86ISelSimple.cpp
index 45df82906b..af2544f17d 100644
--- a/lib/Target/X86/X86ISelSimple.cpp
+++ b/lib/Target/X86/X86ISelSimple.cpp
@@ -2103,7 +2103,7 @@ void ISel::emitGEPOperation(MachineBasicBlock *MBB,
}
// The next type is the member of the structure selected by the
// index.
- Ty = StTy->getElementTypes()[idxValue];
+ Ty = StTy->getElementType(idxValue);
} else if (const SequentialType *SqTy = cast<SequentialType>(Ty)) {
// It's an array or pointer access: [ArraySize x ElementType].