From d0fe5f57694d5bc23f7afb9f18796f972c6899ab Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 28 Dec 2002 20:15:01 +0000 Subject: [PATCH] * Don't access TargetData directly * Changes because frame info is not in MachineFunction directly anymore git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5171 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/SparcV9/SparcV9AsmPrinter.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/Target/SparcV9/SparcV9AsmPrinter.cpp b/lib/Target/SparcV9/SparcV9AsmPrinter.cpp index 38518eef41c..3ace61c9044 100644 --- a/lib/Target/SparcV9/SparcV9AsmPrinter.cpp +++ b/lib/Target/SparcV9/SparcV9AsmPrinter.cpp @@ -14,6 +14,7 @@ #include "SparcInternals.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineFunction.h" +#include "llvm/CodeGen/MachineFunctionInfo.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Module.h" @@ -193,17 +194,17 @@ public: { // generate a symbolic expression for the byte address const Value* ptrVal = CE->getOperand(0); std::vector idxVec(CE->op_begin()+1, CE->op_end()); + const TargetData &TD = target.getTargetData(); S += "(" + valToExprString(ptrVal, target) + ") + (" - + utostr(target.DataLayout.getIndexedOffset(ptrVal->getType(),idxVec)) - + ")"; + + utostr(TD.getIndexedOffset(ptrVal->getType(),idxVec)) + ")"; break; } case Instruction::Cast: // Support only non-converting casts for now, i.e., a no-op. // This assertion is not a complete check. - assert(target.DataLayout.getTypeSize(CE->getType()) == - target.DataLayout.getTypeSize(CE->getOperand(0)->getType())); + assert(target.getTargetData().getTypeSize(CE->getType()) == + target.getTargetData().getTypeSize(CE->getOperand(0)->getType())); S += "(" + valToExprString(CE->getOperand(0), target) + ")"; break; @@ -489,7 +490,7 @@ SparcFunctionAsmPrinter::emitFunction(const Function &F) // Output code for all of the basic blocks in the function... MachineFunction &MF = MachineFunction::get(&F); - for (MachineFunction::const_iterator I = MF.begin(), E = MF.end(); I != E; ++I) + for (MachineFunction::const_iterator I = MF.begin(), E = MF.end(); I != E;++I) emitBasicBlock(*I); // Output a .size directive so the debugger knows the extents of the function @@ -803,7 +804,7 @@ SparcModuleAsmPrinter::printConstantValueOnly(const Constant* CV, else if (const ConstantStruct *CVS = dyn_cast(CV)) { // Print the fields in successive locations. Pad to align if needed! const StructLayout *cvsLayout = - Target.DataLayout.getStructLayout(CVS->getType()); + Target.getTargetData().getStructLayout(CVS->getType()); const std::vector& constValues = CVS->getValues(); unsigned sizeSoFar = 0; for (unsigned i=0, N = constValues.size(); i < N; i++) @@ -811,7 +812,8 @@ SparcModuleAsmPrinter::printConstantValueOnly(const Constant* CV, const Constant* field = cast(constValues[i].get()); // Check if padding is needed and insert one or more 0s. - unsigned fieldSize = Target.DataLayout.getTypeSize(field->getType()); + unsigned fieldSize = + Target.getTargetData().getTypeSize(field->getType()); int padSize = ((i == N-1? cvsLayout->StructSize : cvsLayout->MemberOffsets[i+1]) - cvsLayout->MemberOffsets[i]) - fieldSize; @@ -864,7 +866,7 @@ void SparcModuleAsmPrinter::FoldConstants(const Module &M, for (Module::const_iterator I = M.begin(), E = M.end(); I != E; ++I) if (!I->isExternal()) { const hash_set &pool = - MachineFunction::get(I).getConstantPoolValues(); + MachineFunction::get(I).getInfo()->getConstantPoolValues(); MC.insert(pool.begin(), pool.end()); } } -- 2.40.0