[llvm-commits] CVS: llvm/lib/CodeGen/ELFWriter.cpp MachOWriter.cpp MachineFunction.cpp
Chris Lattner
sabre at nondot.org
Tue Feb 13 21:52:56 PST 2007
Changes in directory llvm/lib/CodeGen:
ELFWriter.cpp updated: 1.37 -> 1.38
MachOWriter.cpp updated: 1.26 -> 1.27
MachineFunction.cpp updated: 1.108 -> 1.109
---
Log message:
Generalize TargetData strings, to support more interesting forms of data.
Patch by Scott Michel.
---
Diffs of the changes: (+5 -4)
ELFWriter.cpp | 2 +-
MachOWriter.cpp | 4 ++--
MachineFunction.cpp | 3 ++-
3 files changed, 5 insertions(+), 4 deletions(-)
Index: llvm/lib/CodeGen/ELFWriter.cpp
diff -u llvm/lib/CodeGen/ELFWriter.cpp:1.37 llvm/lib/CodeGen/ELFWriter.cpp:1.38
--- llvm/lib/CodeGen/ELFWriter.cpp:1.37 Wed Feb 7 19:35:27 2007
+++ llvm/lib/CodeGen/ELFWriter.cpp Tue Feb 13 23:52:17 2007
@@ -255,7 +255,7 @@
}
const Type *GVType = (const Type*)GV->getType();
- unsigned Align = TM.getTargetData()->getTypeAlignmentPref(GVType);
+ unsigned Align = TM.getTargetData()->getPrefTypeAlignment(GVType);
unsigned Size = TM.getTargetData()->getTypeSize(GVType);
// If this global has a zero initializer, it is part of the .bss or common
Index: llvm/lib/CodeGen/MachOWriter.cpp
diff -u llvm/lib/CodeGen/MachOWriter.cpp:1.26 llvm/lib/CodeGen/MachOWriter.cpp:1.27
--- llvm/lib/CodeGen/MachOWriter.cpp:1.26 Sat Feb 10 14:31:59 2007
+++ llvm/lib/CodeGen/MachOWriter.cpp Tue Feb 13 23:52:17 2007
@@ -147,7 +147,7 @@
// Align the output buffer to the appropriate alignment, power of 2.
unsigned FnAlign = F->getAlignment();
- unsigned TDAlign = TD->getTypeAlignmentPref(F->getType());
+ unsigned TDAlign = TD->getPrefTypeAlignment(F->getType());
unsigned Align = Log2_32(std::max(FnAlign, TDAlign));
assert(!(Align & (Align-1)) && "Alignment is not a power of two!");
@@ -332,7 +332,7 @@
unsigned Size = TM.getTargetData()->getTypeSize(Ty);
unsigned Align = GV->getAlignment();
if (Align == 0)
- Align = TM.getTargetData()->getTypeAlignmentPref(Ty);
+ Align = TM.getTargetData()->getPrefTypeAlignment(Ty);
MachOSym Sym(GV, Mang->getValueName(GV), Sec->Index, TM);
Index: llvm/lib/CodeGen/MachineFunction.cpp
diff -u llvm/lib/CodeGen/MachineFunction.cpp:1.108 llvm/lib/CodeGen/MachineFunction.cpp:1.109
--- llvm/lib/CodeGen/MachineFunction.cpp:1.108 Sat Jan 20 16:35:55 2007
+++ llvm/lib/CodeGen/MachineFunction.cpp Tue Feb 13 23:52:17 2007
@@ -13,6 +13,7 @@
//
//===----------------------------------------------------------------------===//
+#include "llvm/DerivedTypes.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/SSARegMap.h"
@@ -123,7 +124,7 @@
const TargetData &TD = *TM.getTargetData();
bool IsPic = TM.getRelocationModel() == Reloc::PIC_;
unsigned EntrySize = IsPic ? 4 : TD.getPointerSize();
- unsigned Alignment = IsPic ? TD.getIntABIAlignment()
+ unsigned Alignment = IsPic ? TD.getABITypeAlignment(Type::Int32Ty)
: TD.getPointerABIAlignment();
JumpTableInfo = new MachineJumpTableInfo(EntrySize, Alignment);
More information about the llvm-commits
mailing list