forked from OSchip/llvm-project
Use new SDIselParamAttr enumeration. This removes "magick" constants
from formal attributes' flags processing. llvm-svn: 34963
This commit is contained in:
parent
70c3c66e38
commit
e7ec3bc7bc
|
@ -27,6 +27,7 @@
|
||||||
#include "llvm/CodeGen/MachineFunction.h"
|
#include "llvm/CodeGen/MachineFunction.h"
|
||||||
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
||||||
#include "llvm/CodeGen/SelectionDAG.h"
|
#include "llvm/CodeGen/SelectionDAG.h"
|
||||||
|
#include "llvm/CodeGen/SelectionDAGISel.h"
|
||||||
#include "llvm/CodeGen/SSARegMap.h"
|
#include "llvm/CodeGen/SSARegMap.h"
|
||||||
#include "llvm/Target/TargetOptions.h"
|
#include "llvm/Target/TargetOptions.h"
|
||||||
#include "llvm/ADT/VectorExtras.h"
|
#include "llvm/ADT/VectorExtras.h"
|
||||||
|
@ -346,7 +347,7 @@ HowToPassArgument(MVT::ValueType ObjectVT, unsigned NumGPRs,
|
||||||
NeededGPRs = 0;
|
NeededGPRs = 0;
|
||||||
StackPad = 0;
|
StackPad = 0;
|
||||||
GPRPad = 0;
|
GPRPad = 0;
|
||||||
unsigned align = (Flags >> 27);
|
unsigned align = (Flags >> SDISelParamFlags::OrigAlignmentOffs);
|
||||||
GPRPad = NumGPRs % ((align + 3)/4);
|
GPRPad = NumGPRs % ((align + 3)/4);
|
||||||
StackPad = StackOffset % align;
|
StackPad = StackOffset % align;
|
||||||
unsigned firstGPR = NumGPRs + GPRPad;
|
unsigned firstGPR = NumGPRs + GPRPad;
|
||||||
|
|
|
@ -38,7 +38,7 @@ class CCIfCC<string CC, CCAction A>
|
||||||
|
|
||||||
/// CCIfInReg - If this argument is marked with the 'inreg' attribute, apply
|
/// CCIfInReg - If this argument is marked with the 'inreg' attribute, apply
|
||||||
/// the specified action.
|
/// the specified action.
|
||||||
class CCIfInReg<CCAction A> : CCIf<"ArgFlags & 2", A> {}
|
class CCIfInReg<CCAction A> : CCIf<"ArgFlags & SDISelParamFlags::InReg", A> {}
|
||||||
|
|
||||||
|
|
||||||
/// CCAssignToReg - This action matches if there is a register in the specified
|
/// CCAssignToReg - This action matches if there is a register in the specified
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include "llvm/CodeGen/MachineFunction.h"
|
#include "llvm/CodeGen/MachineFunction.h"
|
||||||
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
||||||
#include "llvm/CodeGen/SelectionDAG.h"
|
#include "llvm/CodeGen/SelectionDAG.h"
|
||||||
|
#include "llvm/CodeGen/SelectionDAGISel.h"
|
||||||
#include "llvm/CodeGen/SSARegMap.h"
|
#include "llvm/CodeGen/SSARegMap.h"
|
||||||
#include "llvm/Support/MathExtras.h"
|
#include "llvm/Support/MathExtras.h"
|
||||||
#include "llvm/Target/TargetOptions.h"
|
#include "llvm/Target/TargetOptions.h"
|
||||||
|
@ -665,10 +666,12 @@ SDOperand X86TargetLowering::LowerCCCArguments(SDOperand Op, SelectionDAG &DAG,
|
||||||
BytesToPopOnReturn = StackSize; // Callee pops everything..
|
BytesToPopOnReturn = StackSize; // Callee pops everything..
|
||||||
BytesCallerReserves = 0;
|
BytesCallerReserves = 0;
|
||||||
} else {
|
} else {
|
||||||
BytesToPopOnReturn = 0; // Callee pops hidden struct pointer.
|
BytesToPopOnReturn = 0; // Callee pops nothing.
|
||||||
|
|
||||||
// If this is an sret function, the return should pop the hidden pointer.
|
// If this is an sret function, the return should pop the hidden pointer.
|
||||||
if (NumArgs && (cast<ConstantSDNode>(Op.getOperand(3))->getValue() & 4))
|
if (NumArgs &&
|
||||||
|
(cast<ConstantSDNode>(Op.getOperand(3))->getValue() &
|
||||||
|
SDISelParamFlags::StructReturn))
|
||||||
BytesToPopOnReturn = 4;
|
BytesToPopOnReturn = 4;
|
||||||
|
|
||||||
BytesCallerReserves = StackSize;
|
BytesCallerReserves = StackSize;
|
||||||
|
@ -740,7 +743,9 @@ SDOperand X86TargetLowering::LowerCCCCallTo(SDOperand Op, SelectionDAG &DAG,
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the first argument is an sret pointer, remember it.
|
// If the first argument is an sret pointer, remember it.
|
||||||
bool isSRet = NumOps &&(cast<ConstantSDNode>(Op.getOperand(6))->getValue()&4);
|
bool isSRet = NumOps &&
|
||||||
|
(cast<ConstantSDNode>(Op.getOperand(6))->getValue() &
|
||||||
|
SDISelParamFlags::StructReturn);
|
||||||
|
|
||||||
if (!MemOpChains.empty())
|
if (!MemOpChains.empty())
|
||||||
Chain = DAG.getNode(ISD::TokenFactor, MVT::Other,
|
Chain = DAG.getNode(ISD::TokenFactor, MVT::Other,
|
||||||
|
|
|
@ -123,8 +123,8 @@ void CallingConvEmitter::EmitAction(Record *Action,
|
||||||
} else if (Action->isSubClassOf("CCPromoteToType")) {
|
} else if (Action->isSubClassOf("CCPromoteToType")) {
|
||||||
Record *DestTy = Action->getValueAsDef("DestTy");
|
Record *DestTy = Action->getValueAsDef("DestTy");
|
||||||
O << IndentStr << "LocVT = " << getEnumName(getValueType(DestTy)) <<";\n";
|
O << IndentStr << "LocVT = " << getEnumName(getValueType(DestTy)) <<";\n";
|
||||||
O << IndentStr << "LocInfo = (ArgFlags & 1) ? CCValAssign::SExt"
|
O << IndentStr << "LocInfo = (ArgFlags & SDISelParamFlags::Signed) ? \n"
|
||||||
<< " : CCValAssign::ZExt;\n";
|
<< IndentStr << IndentStr << "CCValAssign::SExt : CCValAssign::ZExt;\n";
|
||||||
} else {
|
} else {
|
||||||
Action->dump();
|
Action->dump();
|
||||||
throw "Unknown CCAction!";
|
throw "Unknown CCAction!";
|
||||||
|
|
Loading…
Reference in New Issue