Refactoring the x86 and x86-64 calling convention implementations,

unifying the copied algorithms and saving over 500 LOC. There should
be no functionality change, but please test on your favorite x86
target.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45627 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Gordon Henriksen 2008-01-05 16:56:59 +00:00
parent df303bd7f2
commit 86737665b8
2 changed files with 372 additions and 879 deletions

File diff suppressed because it is too large Load Diff

View File

@ -17,6 +17,7 @@
#include "X86Subtarget.h"
#include "X86RegisterInfo.h"
#include "X86MachineFunctionInfo.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/CodeGen/CallingConvLower.h"
@ -438,22 +439,11 @@ namespace llvm {
const CCValAssign &VA, SDOperand Chain,
SDOperand Arg);
// C and StdCall Calling Convention implementation.
SDOperand LowerCCCArguments(SDOperand Op, SelectionDAG &DAG,
bool isStdCall = false);
SDOperand LowerCCCCallTo(SDOperand Op, SelectionDAG &DAG, unsigned CC);
// X86-64 C Calling Convention implementation.
SDOperand LowerX86_64CCCArguments(SDOperand Op, SelectionDAG &DAG);
SDOperand LowerX86_64CCCCallTo(SDOperand Op, SelectionDAG &DAG,unsigned CC);
// fast calling convention (tail call) implementation for 32/64bit
SDOperand LowerX86_TailCallTo(SDOperand Op,
SelectionDAG & DAG, unsigned CC);
// Call lowering helpers.
bool IsCalleePop(SDOperand Op);
CCAssignFn *CCAssignFnForNode(SDOperand Op) const;
NameDecorationStyle NameDecorationForFORMAL_ARGUMENTS(SDOperand Op);
unsigned GetAlignedArgumentStackSize(unsigned StackSize, SelectionDAG &DAG);
// Fast and FastCall Calling Convention implementation.
SDOperand LowerFastCCArguments(SDOperand Op, SelectionDAG &DAG);
SDOperand LowerFastCCCallTo(SDOperand Op, SelectionDAG &DAG, unsigned CC);
std::pair<SDOperand,SDOperand> FP_TO_SINTHelper(SDOperand Op,
SelectionDAG &DAG);