[llvm-commits] [poolalloc] r118298 - /poolalloc/trunk/lib/DSA/Local.cpp
Will Dietz
wdietz2 at illinois.edu
Fri Nov 5 14:43:13 PDT 2010
Author: wdietz2
Date: Fri Nov 5 16:43:13 2010
New Revision: 118298
URL: http://llvm.org/viewvc/llvm-project?rev=118298&view=rev
Log:
Formatting issues, minor code cleanup.
No functionality changes.
Modified:
poolalloc/trunk/lib/DSA/Local.cpp
Modified: poolalloc/trunk/lib/DSA/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Local.cpp?rev=118298&r1=118297&r2=118298&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/Local.cpp (original)
+++ poolalloc/trunk/lib/DSA/Local.cpp Fri Nov 5 16:43:13 2010
@@ -560,40 +560,38 @@
int FieldNo = CUI->getSExtValue();
// increment the offset by the actual byte offset being accessed
Offset += (unsigned)TD.getStructLayout(STy)->getElementOffset(FieldNo);
-
+
if(!Value.getNode()->isArrayNode() || Value.getNode()->getSize() <= 1){
if (TD.getTypeAllocSize(STy) + Value.getOffset() > Value.getNode()->getSize())
Value.getNode()->growSize(TD.getTypeAllocSize(STy) + Value.getOffset());
}
} else if(const ArrayType *ATy = dyn_cast<ArrayType>(*I)) {
- // indexing into an array.
- Value.getNode()->setArrayMarker();
- const Type *CurTy = ATy->getElementType();
+ // indexing into an array.
+ Value.getNode()->setArrayMarker();
+ const Type *CurTy = ATy->getElementType();
if(!isa<ArrayType>(CurTy) &&
- Value.getNode()->getSize() <= 1) {
- Value.getNode()->growSize(TD.getTypeAllocSize(CurTy));
- }
- if(CurTy->isVoidTy()) {
+ Value.getNode()->getSize() <= 1) {
+ Value.getNode()->growSize(TD.getTypeAllocSize(CurTy));
+ } else if(CurTy->isVoidTy()) {
Value.getNode()->growSize(1);
- }
- if(isa<ArrayType>(CurTy) && Value.getNode()->getSize() <= 1){
+ } else if(isa<ArrayType>(CurTy) && Value.getNode()->getSize() <= 1){
const Type *ETy = (cast<ArrayType>(CurTy))->getElementType();
while(isa<ArrayType>(ETy)) {
ETy = (cast<ArrayType>(ETy))->getElementType();
- }
+ }
Value.getNode()->growSize(TD.getTypeAllocSize(ETy));
if(ETy->isVoidTy()) {
Value.getNode()->growSize(1);
}
- }
-// indexing into an array.
-
+ }
+ // indexing into an array.
+
// Find if the DSNode belongs to the array
// If not fold.
- if((Value.getOffset() || Offset != 0)
- || (!isa<ArrayType>(CurTy)
+ if((Value.getOffset() || Offset != 0)
+ || (!isa<ArrayType>(CurTy)
&& (Value.getNode()->getSize() != TD.getTypeAllocSize(CurTy)))) {
Value.getNode()->foldNodeCompletely();
@@ -612,7 +610,7 @@
// Note that we break out of the loop if we fold the node. Once
// something is folded, all values within it are considered to alias.
//
-
+
if (!isa<Constant>(I.getOperand()) ||
!cast<Constant>(I.getOperand())->isNullValue()) {
Value.getNode()->setArrayMarker();
@@ -620,11 +618,9 @@
if(!isa<ArrayType>(CurTy) && Value.getNode()->getSize() <= 1){
Value.getNode()->growSize(TD.getTypeAllocSize(CurTy));
- }
- if(CurTy->isVoidTy()) {
+ } else if(CurTy->isVoidTy()) {
Value.getNode()->growSize(1);
- }
- if(isa<ArrayType>(CurTy) && Value.getNode()->getSize() <= 1){
+ } else if(isa<ArrayType>(CurTy) && Value.getNode()->getSize() <= 1){
const Type *ETy = (cast<ArrayType>(CurTy))->getElementType();
while(isa<ArrayType>(ETy)) {
ETy = (cast<ArrayType>(ETy))->getElementType();
@@ -635,8 +631,8 @@
}
}
if(Value.getOffset() || Offset != 0
- || (!isa<ArrayType>(CurTy)
- && (Value.getNode()->getSize() != TD.getTypeAllocSize(CurTy)))) {
+ || (!isa<ArrayType>(CurTy)
+ && (Value.getNode()->getSize() != TD.getTypeAllocSize(CurTy)))) {
Value.getNode()->foldNodeCompletely();
Value.getNode();
Offset = 0;
More information about the llvm-commits
mailing list