Refactor TargetMachine, pushing handling of TargetData into the target-specific subclasses. This has one caller-visible change: getTargetData() now returns a pointer instead of a reference.

This fixes PR 759.

llvm-svn: 28074
This commit is contained in:
Owen Anderson
2006-05-03 01:29:57 +00:00
parent 37c39b9c62
commit 20a631fde7
38 changed files with 145 additions and 149 deletions

View File

@@ -367,11 +367,11 @@ void MachineJumpTableInfo::print(std::ostream &OS) const {
}
unsigned MachineJumpTableInfo::getEntrySize() const {
return TD.getPointerSize();
return TD->getPointerSize();
}
unsigned MachineJumpTableInfo::getAlignment() const {
return TD.getPointerAlignment();
return TD->getPointerAlignment();
}
void MachineJumpTableInfo::dump() const { print(std::cerr); }
@@ -400,7 +400,7 @@ unsigned MachineConstantPool::getConstantPoolIndex(Constant *C,
unsigned Offset = 0;
if (!Constants.empty()) {
Offset = Constants.back().Offset;
Offset += TD.getTypeSize(Constants.back().Val->getType());
Offset += TD->getTypeSize(Constants.back().Val->getType());
Offset = (Offset+AlignMask)&~AlignMask;
}