mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-18 12:29:21 +00:00
add a new CreateStackTemporary helper method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42994 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cfc24007b1
commit
37ce9df0da
@ -492,6 +492,10 @@ public:
|
||||
|
||||
void dump() const;
|
||||
|
||||
/// CreateStackTemporary - Create a stack temporary, suitable for holding the
|
||||
/// specified value type.
|
||||
SDOperand CreateStackTemporary(MVT::ValueType VT);
|
||||
|
||||
/// FoldSetCC - Constant fold a setcc to true or false.
|
||||
SDOperand FoldSetCC(MVT::ValueType VT, SDOperand N1,
|
||||
SDOperand N2, ISD::CondCode Cond);
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "llvm/Assembly/Writer.h"
|
||||
#include "llvm/CodeGen/MachineBasicBlock.h"
|
||||
#include "llvm/CodeGen/MachineConstantPool.h"
|
||||
#include "llvm/CodeGen/MachineFrameInfo.h"
|
||||
#include "llvm/Support/MathExtras.h"
|
||||
#include "llvm/Target/MRegisterInfo.h"
|
||||
#include "llvm/Target/TargetData.h"
|
||||
@ -913,6 +914,18 @@ SDOperand SelectionDAG::getSrcValue(const Value *V, int Offset) {
|
||||
return SDOperand(N, 0);
|
||||
}
|
||||
|
||||
/// CreateStackTemporary - Create a stack temporary, suitable for holding the
|
||||
/// specified value type.
|
||||
SDOperand SelectionDAG::CreateStackTemporary(MVT::ValueType VT) {
|
||||
MachineFrameInfo *FrameInfo = getMachineFunction().getFrameInfo();
|
||||
unsigned ByteSize = MVT::getSizeInBits(VT)/8;
|
||||
const Type *Ty = MVT::getTypeForValueType(VT);
|
||||
unsigned StackAlign = (unsigned)TLI.getTargetData()->getPrefTypeAlignment(Ty);
|
||||
int FrameIdx = FrameInfo->CreateStackObject(ByteSize, StackAlign);
|
||||
return getFrameIndex(FrameIdx, TLI.getPointerTy());
|
||||
}
|
||||
|
||||
|
||||
SDOperand SelectionDAG::FoldSetCC(MVT::ValueType VT, SDOperand N1,
|
||||
SDOperand N2, ISD::CondCode Cond) {
|
||||
// These setcc operations always fold.
|
||||
|
Loading…
Reference in New Issue
Block a user