summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-08-15 04:51:59 +0000
committerChris Lattner <sabre@nondot.org>2003-08-15 04:51:59 +0000
commitf3c274d4a6b59df8dac047bc0749d9539bc73371 (patch)
tree750b4693574d3a913ef431d2571dfc5ad8dde168 /lib
parent51970b27343307c42d4f62703fc93592d8963718 (diff)
downloadllvm-f3c274d4a6b59df8dac047bc0749d9539bc73371.tar.gz
llvm-f3c274d4a6b59df8dac047bc0749d9539bc73371.tar.bz2
llvm-f3c274d4a6b59df8dac047bc0749d9539bc73371.tar.xz
Adjust to new API, add expandCall stub
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7873 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/X86/InstSelectPattern.cpp20
-rw-r--r--lib/Target/X86/X86ISelPattern.cpp20
2 files changed, 20 insertions, 20 deletions
diff --git a/lib/Target/X86/InstSelectPattern.cpp b/lib/Target/X86/InstSelectPattern.cpp
index 680cc8fc6c..74f540a8da 100644
--- a/lib/Target/X86/InstSelectPattern.cpp
+++ b/lib/Target/X86/InstSelectPattern.cpp
@@ -21,12 +21,6 @@
// Include the generated instruction selector...
#include "X86GenInstrSelector.inc"
-
-//===----------------------------------------------------------------------===//
-// User code
-//
-
-
namespace {
struct ISel : public FunctionPass, SelectionDAGTargetBuilder {
TargetMachine &TM;
@@ -49,12 +43,14 @@ namespace {
public: // Implementation of the SelectionDAGTargetBuilder class...
/// expandArguments - Add nodes to the DAG to indicate how to load arguments
/// off of the X86 stack.
- void expandArguments(SelectionDAG &SD, MachineFunction &MF);
+ void expandArguments(SelectionDAG &SD);
+ void expandCall(SelectionDAG &SD, CallInst &CI);
};
}
-void ISel::expandArguments(SelectionDAG &SD, MachineFunction &F) {
+void ISel::expandArguments(SelectionDAG &SD) {
+
// Add DAG nodes to load the arguments... On entry to a function on the X86,
// the stack frame looks like this:
//
@@ -63,10 +59,11 @@ void ISel::expandArguments(SelectionDAG &SD, MachineFunction &F) {
// [ESP + 8] -- second argument, if first argument is four bytes in size
// ...
//
- unsigned ArgOffset = 0; // Frame mechanisms handle retaddr slot
+ MachineFunction &F = SD.getMachineFunction();
MachineFrameInfo *MFI = F.getFrameInfo();
const Function &Fn = *F.getFunction();
+ unsigned ArgOffset = 0; // Frame mechanisms handle retaddr slot
for (Function::const_aiterator I = Fn.abegin(), E = Fn.aend(); I != E; ++I) {
MVT::ValueType ObjectVT = SD.getValueType(I->getType());
unsigned ArgIncrement = 4;
@@ -84,7 +81,6 @@ void ISel::expandArguments(SelectionDAG &SD, MachineFunction &F) {
int FI = MFI->CreateFixedObject(ObjSize, ArgOffset);
// Create the SelectionDAG nodes corresponding to a load from this parameter
- // FIXME:
SelectionDAGNode *FIN = new SelectionDAGNode(ISD::FrameIndex, MVT::i32);
FIN->addValue(new ReducedValue_FrameIndex_i32(FI));
@@ -107,6 +103,10 @@ void ISel::expandArguments(SelectionDAG &SD, MachineFunction &F) {
VarArgsFrameIndex = MFI->CreateFixedObject(1, ArgOffset);
}
+void ISel::expandCall(SelectionDAG &SD, CallInst &CI) {
+ assert(0 && "ISel::expandCall not implemented!");
+}
+
/// createX86PatternInstructionSelector - This pass converts an LLVM function
/// into a machine code representation using pattern matching and a machine
diff --git a/lib/Target/X86/X86ISelPattern.cpp b/lib/Target/X86/X86ISelPattern.cpp
index 680cc8fc6c..74f540a8da 100644
--- a/lib/Target/X86/X86ISelPattern.cpp
+++ b/lib/Target/X86/X86ISelPattern.cpp
@@ -21,12 +21,6 @@
// Include the generated instruction selector...
#include "X86GenInstrSelector.inc"
-
-//===----------------------------------------------------------------------===//
-// User code
-//
-
-
namespace {
struct ISel : public FunctionPass, SelectionDAGTargetBuilder {
TargetMachine &TM;
@@ -49,12 +43,14 @@ namespace {
public: // Implementation of the SelectionDAGTargetBuilder class...
/// expandArguments - Add nodes to the DAG to indicate how to load arguments
/// off of the X86 stack.
- void expandArguments(SelectionDAG &SD, MachineFunction &MF);
+ void expandArguments(SelectionDAG &SD);
+ void expandCall(SelectionDAG &SD, CallInst &CI);
};
}
-void ISel::expandArguments(SelectionDAG &SD, MachineFunction &F) {
+void ISel::expandArguments(SelectionDAG &SD) {
+
// Add DAG nodes to load the arguments... On entry to a function on the X86,
// the stack frame looks like this:
//
@@ -63,10 +59,11 @@ void ISel::expandArguments(SelectionDAG &SD, MachineFunction &F) {
// [ESP + 8] -- second argument, if first argument is four bytes in size
// ...
//
- unsigned ArgOffset = 0; // Frame mechanisms handle retaddr slot
+ MachineFunction &F = SD.getMachineFunction();
MachineFrameInfo *MFI = F.getFrameInfo();
const Function &Fn = *F.getFunction();
+ unsigned ArgOffset = 0; // Frame mechanisms handle retaddr slot
for (Function::const_aiterator I = Fn.abegin(), E = Fn.aend(); I != E; ++I) {
MVT::ValueType ObjectVT = SD.getValueType(I->getType());
unsigned ArgIncrement = 4;
@@ -84,7 +81,6 @@ void ISel::expandArguments(SelectionDAG &SD, MachineFunction &F) {
int FI = MFI->CreateFixedObject(ObjSize, ArgOffset);
// Create the SelectionDAG nodes corresponding to a load from this parameter
- // FIXME:
SelectionDAGNode *FIN = new SelectionDAGNode(ISD::FrameIndex, MVT::i32);
FIN->addValue(new ReducedValue_FrameIndex_i32(FI));
@@ -107,6 +103,10 @@ void ISel::expandArguments(SelectionDAG &SD, MachineFunction &F) {
VarArgsFrameIndex = MFI->CreateFixedObject(1, ArgOffset);
}
+void ISel::expandCall(SelectionDAG &SD, CallInst &CI) {
+ assert(0 && "ISel::expandCall not implemented!");
+}
+
/// createX86PatternInstructionSelector - This pass converts an LLVM function
/// into a machine code representation using pattern matching and a machine