rename fields of constant pool entries

llvm-svn: 26076
This commit is contained in:
Chris Lattner 2006-02-09 04:22:52 +00:00
parent 10af703b36
commit 1111a4b76d
4 changed files with 12 additions and 14 deletions

View File

@ -106,16 +106,16 @@ void AsmPrinter::SetupMachineFunction(MachineFunction &MF) {
/// the code generator.
///
void AsmPrinter::EmitConstantPool(MachineConstantPool *MCP) {
const std::vector<std::pair<Constant*, unsigned> > &CP = MCP->getConstants();
const std::vector<MachineConstantPoolEntry> &CP = MCP->getConstants();
if (CP.empty()) return;
const TargetData &TD = TM.getTargetData();
SwitchSection(ConstantPoolSection, 0);
for (unsigned i = 0, e = CP.size(); i != e; ++i) {
EmitAlignment(CP[i].second);
EmitAlignment(CP[i].Alignment);
O << PrivateGlobalPrefix << "CPI" << getFunctionNumber() << '_' << i
<< ":\t\t\t\t\t" << CommentString << *CP[i].first << '\n';
EmitGlobalConstant(CP[i].first);
<< ":\t\t\t\t\t" << CommentString << *CP[i].Val << '\n';
EmitGlobalConstant(CP[i].Val);
}
}

View File

@ -347,8 +347,8 @@ void MachineFrameInfo::dump(const MachineFunction &MF) const {
void MachineConstantPool::print(std::ostream &OS) const {
for (unsigned i = 0, e = Constants.size(); i != e; ++i) {
OS << " <cp #" << i << "> is" << *(Value*)Constants[i].first;
if (Constants[i].second != 0) OS << " , align=" << Constants[i].second;
OS << " <cp #" << i << "> is" << *(Value*)Constants[i].Val;
OS << " , align=" << Constants[i].Alignment;
OS << "\n";
}
}

View File

@ -566,18 +566,16 @@ void JITEmitter::finishFunction(MachineFunction &F) {
}
void JITEmitter::emitConstantPool(MachineConstantPool *MCP) {
const std::vector<std::pair<Constant*,unsigned> > &Constants = MCP->getConstants();
const std::vector<MachineConstantPoolEntry> &Constants = MCP->getConstants();
if (Constants.empty()) return;
for (unsigned i = 0, e = Constants.size(); i != e; ++i) {
const Type *Ty = Constants[i].first->getType();
const Type *Ty = Constants[i].Val->getType();
unsigned Size = (unsigned)TheJIT->getTargetData().getTypeSize(Ty);
unsigned Alignment = (Constants[i].second == 0)
? TheJIT->getTargetData().getTypeAlignment(Ty)
: Constants[i].second;
unsigned Alignment = Constants[i].Alignment;
void *Addr = MemMgr.allocateConstant(Size, Alignment);
TheJIT->InitializeMemory(Constants[i].first, Addr);
TheJIT->InitializeMemory(Constants[i].Val, Addr);
ConstantPoolAddresses.push_back(Addr);
}
}

View File

@ -724,12 +724,12 @@ void SparcV9AsmPrinter::emitFunction(const Function &F) {
// Emit constant pool for this function
const MachineConstantPool *MCP = MF.getConstantPool();
const std::vector<std::pair<Constant*, unsigned> > &CP = MCP->getConstants();
const std::vector<MachineConstantPoolEntry> &CP = MCP->getConstants();
enterSection(ReadOnlyData);
for (unsigned i = 0, e = CP.size(); i != e; ++i) {
std::string cpiName = ".CPI_" + CurrentFnName + "_" + utostr(i);
printConstant(CP[i].first, CP[i].second, cpiName);
printConstant(CP[i].Val, CP[i].Alignment, cpiName);
}
enterSection(Text);