blob: 6041c5d45448bd63b69654c7893791dafe7ba80b [file] [log] [blame]
Andrew Lenharthaa38ce42005-09-02 18:46:02 +00001//===-- AlphaISelLowering.h - Alpha DAG Lowering Interface ------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file was developed by Andrew Lenharth and is distributed under
6// the University of Illinois Open Source License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file defines the interfaces that Alpha uses to lower LLVM code into a
11// selection DAG.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_TARGET_ALPHA_ALPHAISELLOWERING_H
16#define LLVM_TARGET_ALPHA_ALPHAISELLOWERING_H
17
18#include "llvm/Target/TargetLowering.h"
19#include "llvm/CodeGen/SelectionDAG.h"
20#include "Alpha.h"
21
22namespace llvm {
23
24 class AlphaTargetLowering : public TargetLowering {
25 int VarArgsOffset; // What is the offset to the first vaarg
26 int VarArgsBase; // What is the base FrameIndex
27 unsigned GP; //GOT vreg
28 unsigned RA; //Return Address
29 public:
30 AlphaTargetLowering(TargetMachine &TM);
31
32 /// LowerArguments - This hook must be implemented to indicate how we should
33 /// lower the arguments for the specified function, into the specified DAG.
34 virtual std::vector<SDOperand>
35 LowerArguments(Function &F, SelectionDAG &DAG);
36
37 /// LowerCallTo - This hook lowers an abstract call to a function into an
38 /// actual call.
39 virtual std::pair<SDOperand, SDOperand>
40 LowerCallTo(SDOperand Chain, const Type *RetTy, bool isVarArg, unsigned CC,
41 bool isTailCall, SDOperand Callee, ArgListTy &Args,
42 SelectionDAG &DAG);
43
44 virtual SDOperand LowerVAStart(SDOperand Chain, SDOperand VAListP,
45 Value *VAListV, SelectionDAG &DAG);
46 virtual SDOperand LowerVACopy(SDOperand Chain, SDOperand SrcP, Value *SrcV,
47 SDOperand DestP, Value *DestV,
48 SelectionDAG &DAG);
49 virtual std::pair<SDOperand,SDOperand>
50 LowerVAArg(SDOperand Chain, SDOperand VAListP, Value *VAListV,
51 const Type *ArgTy, SelectionDAG &DAG);
52
53 void restoreGP(MachineBasicBlock* BB);
54 void restoreRA(MachineBasicBlock* BB);
55 };
56}
57
58#endif // LLVM_TARGET_ALPHA_ALPHAISELLOWERING_H