diff options
author | Chris Lattner <sabre@nondot.org> | 2002-04-07 20:49:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-04-07 20:49:59 +0000 |
commit | 2fbfdcffd3e0cf41422aaa6c526c37cb02b81341 (patch) | |
tree | c1991eac5d23807b38e5909f861609b243562f70 /lib/Target/SparcV9/SparcV9InstrSelection.cpp | |
parent | dcc6d4cada290857ee74164816ec3c502c1db7a4 (diff) | |
download | external_llvm-2fbfdcffd3e0cf41422aaa6c526c37cb02b81341.zip external_llvm-2fbfdcffd3e0cf41422aaa6c526c37cb02b81341.tar.gz external_llvm-2fbfdcffd3e0cf41422aaa6c526c37cb02b81341.tar.bz2 |
Change references to the Method class to be references to the Function
class. The Method class is obsolete (renamed) and all references to it
are being converted over to Function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2144 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SparcV9/SparcV9InstrSelection.cpp')
-rw-r--r-- | lib/Target/SparcV9/SparcV9InstrSelection.cpp | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/lib/Target/SparcV9/SparcV9InstrSelection.cpp b/lib/Target/SparcV9/SparcV9InstrSelection.cpp index 7b6e597..2094f6e 100644 --- a/lib/Target/SparcV9/SparcV9InstrSelection.cpp +++ b/lib/Target/SparcV9/SparcV9InstrSelection.cpp @@ -24,7 +24,7 @@ #include "llvm/iMemory.h" #include "llvm/iOther.h" #include "llvm/BasicBlock.h" -#include "llvm/Method.h" +#include "llvm/Function.h" #include "llvm/ConstantVals.h" #include "Support/MathExtras.h" #include <math.h> @@ -141,20 +141,20 @@ ChooseBFpccInstruction(const InstructionNode* instrNode, // Eventually the entire BURG instruction selection should be put // into a separate class that can hold such information. // The static cache is not too bad because the memory for these -// TmpInstructions will be freed along with the rest of the Method anyway. +// TmpInstructions will be freed along with the rest of the Function anyway. // static TmpInstruction* -GetTmpForCC(Value* boolVal, const Method* method, const Type* ccType) +GetTmpForCC(Value* boolVal, const Function *F, const Type* ccType) { typedef std::hash_map<const Value*, TmpInstruction*> BoolTmpCache; static BoolTmpCache boolToTmpCache; // Map boolVal -> TmpInstruction* - static const Method* lastMethod = NULL; // Use to flush cache between methods + static const Function *lastFunction = 0;// Use to flush cache between funcs assert(boolVal->getType() == Type::BoolTy && "Weird but ok! Delete assert"); - if (lastMethod != method) + if (lastFunction != F) { - lastMethod = method; + lastFunction = F; boolToTmpCache.clear(); } @@ -809,9 +809,9 @@ CreateCodeForVariableSizeAlloca(const TargetMachine& target, // Get the constant offset from SP for dynamically allocated storage // and create a temporary Value to hold it. - assert(result && result->getParent() && "Result value is not part of a method?"); - Method* method = result->getParent()->getParent(); - MachineCodeForMethod& mcInfo = MachineCodeForMethod::get(method); + assert(result && result->getParent() && "Result value is not part of a fn?"); + Function *F = result->getParent()->getParent(); + MachineCodeForMethod& mcInfo = MachineCodeForMethod::get(F); bool growUp; ConstantSInt* dynamicAreaOffset = ConstantSInt::get(Type::IntTy, @@ -853,13 +853,14 @@ CreateCodeForFixedSizeAlloca(const TargetMachine& target, vector<MachineInstr*>& getMvec) { assert(result && result->getParent() && - "Result value is not part of a method?"); - Method* method = result->getParent()->getParent(); - MachineCodeForMethod& mcInfo = MachineCodeForMethod::get(method); - - // Check if the offset would small enough to use as an immediate in load/stores - // (check LDX because all load/stores have the same-size immediate field). - // If not, put the variable in the dynamically sized area of the frame. + "Result value is not part of a function?"); + Function *F = result->getParent()->getParent(); + MachineCodeForMethod &mcInfo = MachineCodeForMethod::get(F); + + // Check if the offset would small enough to use as an immediate in + // load/stores (check LDX because all load/stores have the same-size immediate + // field). If not, put the variable in the dynamically sized area of the + // frame. unsigned int paddedSizeIgnored; int offsetFromFP = mcInfo.computeOffsetforLocalVar(target, result, paddedSizeIgnored, @@ -1148,7 +1149,7 @@ ForwardOperand(InstructionNode* treeNode, void UltraSparcInstrInfo:: CreateCopyInstructionsByType(const TargetMachine& target, - Method* method, + Function *F, Value* src, Instruction* dest, vector<MachineInstr*>& minstrVec) const @@ -1186,8 +1187,8 @@ CreateCopyInstructionsByType(const TargetMachine& target, { // `src' is constant and cannot fit in immed field for the ADD // Insert instructions to "load" the constant into a register vector<TmpInstruction*> tempVec; - target.getInstrInfo().CreateCodeToLoadConst(method, src, dest, - minstrVec,tempVec); + target.getInstrInfo().CreateCodeToLoadConst(F, src, dest, + minstrVec, tempVec); for (unsigned i=0; i < tempVec.size(); i++) MachineCodeForInstruction::get(dest).addTemp(tempVec[i]); } @@ -1235,8 +1236,8 @@ GetInstructionsForProlog(BasicBlock* entryBB, // We will assume that local register `l0' is unused since the SAVE // instruction must be the first instruction in each procedure. // - Method* method = entryBB->getParent(); - MachineCodeForMethod& mcInfo = MachineCodeForMethod::get(method); + Function *F = entryBB->getParent(); + MachineCodeForMethod& mcInfo = MachineCodeForMethod::get(F); unsigned int staticStackSize = mcInfo.getStaticStackSize(); if (staticStackSize < (unsigned) frameInfo.getMinStackFrameSize()) |