#include "llvm/CodeGen/InterferenceGraph.h"
#include "Support/STLExtras.h"
#include <iostream>
+#include <algorithm>
using std::cerr;
//-----------------------------------------------------------------------------
//assert(( L1->getTypeID() == L2->getTypeID()) && "Merge:Different types");
- L1->add( *L2It ); // add the var in L2 to L1
+ L1->insert(*L2It); // add the var in L2 to L1
LiveRangeMap[ *L2It ] = L1; // now the elements in L2 should map
//to L1
}
for( ; ArgIt != ArgList.end() ; ++ArgIt) { // for each argument
LiveRange * ArgRange = new LiveRange(); // creates a new LR and
- const Value *const Val = (const Value *) *ArgIt;
+ const Value *Val = (const Value *) *ArgIt;
- assert( Val);
-
- ArgRange->add(Val); // add the arg (def) to it
+ ArgRange->insert(Val); // add the arg (def) to it
LiveRangeMap[Val] = ArgRange;
// create a temp machine op to find the register class of value
}
// create a new LR iff this operand is a def
- if( OpI.isDef() ) {
- const Value *const Def = *OpI;
+ if (OpI.isDef()) {
+ const Value *Def = *OpI;
// Only instruction values are accepted for live ranges here
if( Def->getValueType() != Value::InstructionVal ) {
// see LR already there (because of multiple defs)
if( !DefRange) { // if it is not in LiveRangeMap
DefRange = new LiveRange(); // creates a new live range and
- DefRange->add( Def ); // add the instruction (def) to it
+ DefRange->insert(Def); // add the instruction (def) to it
LiveRangeMap[ Def ] = DefRange; // update the map
- if( DEBUG_RA > 1) {
+ if (DEBUG_RA > 1) {
cerr << " creating a LR for def: ";
printValue(Def); cerr << "\n";
}
}
else {
- DefRange->add( Def ); // add the opearand to def range
+ DefRange->insert(Def); // add the opearand to def range
// update the map - Operand points
// to the merged set
LiveRangeMap[ Def ] = DefRange;
#include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/MachineFrameInfo.h"
+#include "llvm/Method.h"
#include <iostream>
#include <math.h>
using std::cerr;
for( ; ArgIt != ArgList.end() ; ++ArgIt) { // for each argument
- addInterference( *ArgIt, InSet, false ); // add interferences between
+ addInterference((Value*)*ArgIt, InSet, false); // add interferences between
// args and LVars at start
if( DEBUG_RA > 1) {
cerr << " - %% adding interference for argument ";
#include "llvm/CodeGen/InterferenceGraph.h"
#include "Support/STLExtras.h"
#include <iostream>
+#include <algorithm>
using std::cerr;
//-----------------------------------------------------------------------------
//assert(( L1->getTypeID() == L2->getTypeID()) && "Merge:Different types");
- L1->add( *L2It ); // add the var in L2 to L1
+ L1->insert(*L2It); // add the var in L2 to L1
LiveRangeMap[ *L2It ] = L1; // now the elements in L2 should map
//to L1
}
for( ; ArgIt != ArgList.end() ; ++ArgIt) { // for each argument
LiveRange * ArgRange = new LiveRange(); // creates a new LR and
- const Value *const Val = (const Value *) *ArgIt;
+ const Value *Val = (const Value *) *ArgIt;
- assert( Val);
-
- ArgRange->add(Val); // add the arg (def) to it
+ ArgRange->insert(Val); // add the arg (def) to it
LiveRangeMap[Val] = ArgRange;
// create a temp machine op to find the register class of value
}
// create a new LR iff this operand is a def
- if( OpI.isDef() ) {
- const Value *const Def = *OpI;
+ if (OpI.isDef()) {
+ const Value *Def = *OpI;
// Only instruction values are accepted for live ranges here
if( Def->getValueType() != Value::InstructionVal ) {
// see LR already there (because of multiple defs)
if( !DefRange) { // if it is not in LiveRangeMap
DefRange = new LiveRange(); // creates a new live range and
- DefRange->add( Def ); // add the instruction (def) to it
+ DefRange->insert(Def); // add the instruction (def) to it
LiveRangeMap[ Def ] = DefRange; // update the map
- if( DEBUG_RA > 1) {
+ if (DEBUG_RA > 1) {
cerr << " creating a LR for def: ";
printValue(Def); cerr << "\n";
}
}
else {
- DefRange->add( Def ); // add the opearand to def range
+ DefRange->insert(Def); // add the opearand to def range
// update the map - Operand points
// to the merged set
LiveRangeMap[ Def ] = DefRange;
#include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/MachineFrameInfo.h"
+#include "llvm/Method.h"
#include <iostream>
#include <math.h>
using std::cerr;
for( ; ArgIt != ArgList.end() ; ++ArgIt) { // for each argument
- addInterference( *ArgIt, InSet, false ); // add interferences between
+ addInterference((Value*)*ArgIt, InSet, false); // add interferences between
// args and LVars at start
if( DEBUG_RA > 1) {
cerr << " - %% adding interference for argument ";