PPCISelLowering.h revision e4bc9ea0a560d8a0ba42f5a2da617e1f1f834710
1//===-- PPC32ISelLowering.cpp - PPC32 DAG Lowering Impl. --------*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file was developed by Chris Lattner 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 PPC uses to lower LLVM code into a
11// selection DAG.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_TARGET_POWERPC_PPC32ISELLOWERING_H
16#define LLVM_TARGET_POWERPC_PPC32ISELLOWERING_H
17
18#include "llvm/Target/TargetLowering.h"
19
20namespace llvm {
21  class PPC32TargetLowering : public TargetLowering {
22    int VarArgsFrameIndex;            // FrameIndex for start of varargs area.
23    int ReturnAddrIndex;              // FrameIndex for return slot.
24  public:
25    PPC32TargetLowering(TargetMachine &TM);
26
27    /// LowerOperation - Provide custom lowering hooks for some operations.
28    ///
29    virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG);
30
31    /// LowerArguments - This hook must be implemented to indicate how we should
32    /// lower the arguments for the specified function, into the specified DAG.
33    virtual std::vector<SDOperand>
34      LowerArguments(Function &F, SelectionDAG &DAG);
35
36    /// LowerCallTo - This hook lowers an abstract call to a function into an
37    /// actual call.
38    virtual std::pair<SDOperand, SDOperand>
39      LowerCallTo(SDOperand Chain, const Type *RetTy, bool isVarArg,
40                  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
47    virtual std::pair<SDOperand,SDOperand>
48      LowerVAArg(SDOperand Chain, SDOperand VAListP, Value *VAListV,
49                 const Type *ArgTy, SelectionDAG &DAG);
50
51    virtual std::pair<SDOperand, SDOperand>
52      LowerFrameReturnAddress(bool isFrameAddr, SDOperand Chain, unsigned Depth,
53                              SelectionDAG &DAG);
54  };
55}
56
57#endif   // LLVM_TARGET_POWERPC_PPC32ISELLOWERING_H
58