[llvm-commits] [123805] Patches to support generalize TargetData strings, to support
clattner at apple.com
clattner at apple.com
Tue Feb 13 21:53:56 PST 2007
Revision: 123805
Author: clattner
Date: 2007-02-13 21:53:55 -0800 (Tue, 13 Feb 2007)
Log Message:
-----------
Patches to support generalize TargetData strings, to support
more interesting forms of data. Patch by Scott Michel, a couple
bugfixes by me.
Modified Paths:
--------------
apple-local/branches/llvm/gcc/llvm-backend.cpp
apple-local/branches/llvm/gcc/llvm-convert.cpp
apple-local/branches/llvm/gcc/llvm-types.cpp
Modified: apple-local/branches/llvm/gcc/llvm-backend.cpp
===================================================================
--- apple-local/branches/llvm/gcc/llvm-backend.cpp 2007-02-14 05:34:58 UTC (rev 123804)
+++ apple-local/branches/llvm/gcc/llvm-backend.cpp 2007-02-14 05:53:55 UTC (rev 123805)
@@ -600,7 +600,7 @@
// Set the alignment for the global.
if (DECL_ALIGN_UNIT(decl) &&
- getTargetData().getTypeAlignmentABI(GV->getType()->getElementType()) !=
+ getTargetData().getABITypeAlignment(GV->getType()->getElementType()) !=
DECL_ALIGN_UNIT(decl))
GV->setAlignment(DECL_ALIGN_UNIT(decl));
Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp
===================================================================
--- apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-02-14 05:34:58 UTC (rev 123804)
+++ apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-02-14 05:53:55 UTC (rev 123805)
@@ -4280,7 +4280,7 @@
// In this case, we know that the alignment of the field is less than
// the size of the field. To get the pointer close enough, add some
// number of alignment units to the pointer.
- unsigned ByteAlignment = TD.getTypeAlignmentABI(FieldTy);
+ unsigned ByteAlignment = TD.getABITypeAlignment(FieldTy);
assert(ByteAlignment*8 <= LLVMValueBitSize && "Unknown overlap case!");
unsigned NumAlignmentUnits = BitStart/(ByteAlignment*8);
assert(NumAlignmentUnits && "Not adjusting pointer?");
@@ -4971,8 +4971,8 @@
}
// Otherwise, we can get away with this initialization.
- assert(TD.getTypeAlignmentABI(FieldTy) >=
- TD.getTypeAlignmentABI(Val->getType()) &&
+ assert(TD.getABITypeAlignment(FieldTy) >=
+ TD.getABITypeAlignment(Val->getType()) &&
"Field initialize is over aligned for LLVM type!");
return Val;
}
Modified: apple-local/branches/llvm/gcc/llvm-types.cpp
===================================================================
--- apple-local/branches/llvm/gcc/llvm-types.cpp 2007-02-14 05:34:58 UTC (rev 123804)
+++ apple-local/branches/llvm/gcc/llvm-types.cpp 2007-02-14 05:53:55 UTC (rev 123805)
@@ -702,7 +702,7 @@
/// getTypeAlignment - Return the alignment of the specified type in bytes.
///
unsigned getTypeAlignment(const Type *Ty) const {
- return TD.getTypeAlignmentABI(Ty);
+ return TD.getABITypeAlignment(Ty);
}
/// getTypeSize - Return the size of the specified type in bytes.
@@ -1178,7 +1178,7 @@
const Type *TheTy = ConvertType(TREE_TYPE(Field));
unsigned Size = TD.getTypeSize(TheTy);
- unsigned Align = TD.getTypeAlignmentABI(TheTy);
+ unsigned Align = TD.getABITypeAlignment(TheTy);
if (UnionTy == 0 || Size>MaxSize || (Size == MaxSize && Align > MaxAlign)) {
UnionTy = TheTy;
MaxSize = Size;
More information about the llvm-commits
mailing list