summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-02-03 07:49:15 +0000
committerChris Lattner <sabre@nondot.org>2002-02-03 07:49:15 +0000
commit0752167009a95c4551df0d411ac05c6b1aa35e16 (patch)
tree859814451afa6cf20a04e8184d8169902bc426e7 /llvm/lib
parente772d2886231bd70e8a48b860daee51c27f0e16a (diff)
downloadbcm5719-llvm-0752167009a95c4551df0d411ac05c6b1aa35e16.tar.gz
bcm5719-llvm-0752167009a95c4551df0d411ac05c6b1aa35e16.zip
* Swithc to new MachineCodeForInstruction model
* Implement memory freeing for instruction temporaries llvm-svn: 1653
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/Sparc/Sparc.cpp27
1 files changed, 22 insertions, 5 deletions
diff --git a/llvm/lib/Target/Sparc/Sparc.cpp b/llvm/lib/Target/Sparc/Sparc.cpp
index dd9e3304746..a457abeb1ca 100644
--- a/llvm/lib/Target/Sparc/Sparc.cpp
+++ b/llvm/lib/Target/Sparc/Sparc.cpp
@@ -14,8 +14,9 @@
#include "llvm/Target/Sparc.h"
#include "llvm/CodeGen/InstrScheduling.h"
#include "llvm/CodeGen/InstrSelection.h"
+#include "llvm/CodeGen/MachineCodeForInstruction.h"
+#include "llvm/CodeGen/MachineCodeForMethod.h"
#include "llvm/CodeGen/PhyRegAlloc.h"
-#include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h"
#include "llvm/Method.h"
#include <iostream>
using std::cerr;
@@ -102,11 +103,11 @@ InsertEpilogCode(Method* method, TargetMachine& target)
unsigned N = GetInstructionsForEpilog(exitBB, target, minstrVec);
MachineCodeForBasicBlock& bbMvec = exitBB->getMachineInstrVec();
- MachineCodeForVMInstr& termMvec =
- exitBB->getTerminator()->getMachineInstrVec();
+ MachineCodeForInstruction &termMvec =
+ MachineCodeForInstruction::get(exitBB->getTerminator());
// Remove the NOPs in the delay slots of the return instruction
- const MachineInstrInfo& mii = target.getInstrInfo();
+ const MachineInstrInfo &mii = target.getInstrInfo();
unsigned numNOPs = 0;
while (termMvec.back()->getOpCode() == NOP)
{
@@ -283,7 +284,7 @@ bool
UltraSparc::compileMethod(Method *method)
{
// Construct and initialize the MachineCodeForMethod object for this method.
- (void) MachineCodeForMethod::construct(method, *this);
+ MachineCodeForMethod::construct(method, *this);
if (SelectInstructionsForMethod(method, *this))
{
@@ -310,3 +311,19 @@ UltraSparc::compileMethod(Method *method)
return false;
}
+
+static void freeMachineCode(Instruction *I) {
+ MachineCodeForInstruction::destroy(I);
+}
+
+//
+// freeCompiledMethod - Release all memory associated with the compiled image
+// for this method.
+//
+void
+UltraSparc::freeCompiledMethod(Method *M)
+{
+ for_each(M->inst_begin(), M->inst_end(), freeMachineCode);
+ // Don't destruct MachineCodeForMethod - The global printer needs it
+ //MachineCodeForMethod::destruct(M);
+}
OpenPOWER on IntegriCloud