[llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Feb 22 21:48:46 PST 2005
Changes in directory llvm-poolalloc/lib/PoolAllocate:
PointerCompress.cpp updated: 1.20 -> 1.21
---
Log message:
Implement some more features, for perimeter, including handling of it's array
of four pointers.
---
Diffs of the changes: (+7 -2)
PointerCompress.cpp | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
Index: llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp
diff -u llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.20 llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.21
--- llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp:1.20 Tue Feb 22 23:33:12 2005
+++ llvm-poolalloc/lib/PoolAllocate/PointerCompress.cpp Tue Feb 22 23:48:30 2005
@@ -180,7 +180,7 @@
NewTy = ComputeCompressedType(Pool->getType(), 0, Nodes);
// Get the compressed type size.
- NewSize = TD.getTypeSize(NewTy);
+ NewSize = NewTy->isSized() ? TD.getTypeSize(NewTy) : 0;
}
@@ -193,7 +193,7 @@
if (const PointerType *PTY = dyn_cast<PointerType>(OrigTy)) {
// FIXME: check to see if this pointer is actually compressed!
return MEMUINTTYPE;
- } else if (OrigTy->isFirstClassType())
+ } else if (OrigTy->isFirstClassType() || OrigTy == Type::VoidTy)
return OrigTy;
// Okay, we have an aggregate type.
@@ -204,7 +204,12 @@
Elements.push_back(ComputeCompressedType(STy->getElementType(i),
NodeOffset, Nodes));
return StructType::get(Elements);
+ } else if (const ArrayType *ATy = dyn_cast<ArrayType>(OrigTy)) {
+ return ArrayType::get(ComputeCompressedType(ATy->getElementType(),
+ NodeOffset, Nodes),
+ ATy->getNumElements());
} else {
+ std::cerr << "TYPE: " << *OrigTy << "\n";
assert(0 && "FIXME: Unhandled aggregate type!");
}
}
More information about the llvm-commits
mailing list