1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-14 22:34:09 +02:00

More Fail info, better fail on OperandToAddr

This commit is contained in:
Brian Fiete 2020-08-03 10:00:32 -07:00
parent 99c7a9fe1f
commit 7e843bb402
2 changed files with 5783 additions and 5768 deletions

File diff suppressed because it is too large Load diff

View file

@ -388,20 +388,6 @@ public:
return loadedOperand; return loadedOperand;
} }
static BeMCOperand ToAddr(const BeMCOperand& operand)
{
BeMCOperand loadedOperand = operand;
if (loadedOperand.mKind == BeMCOperandKind_VRegLoad)
loadedOperand.mKind = BeMCOperandKind_VReg;
else if (loadedOperand.mKind == BeMCOperandKind_VReg)
loadedOperand.mKind = BeMCOperandKind_VRegAddr;
else if (loadedOperand.mKind == BeMCOperandKind_Symbol)
loadedOperand.mKind = BeMCOperandKind_SymbolAddr;
else
BF_FATAL("Bad");
return loadedOperand;
}
static BeMCOperand FromVReg(int vregIdx) static BeMCOperand FromVReg(int vregIdx)
{ {
BeMCOperand operand; BeMCOperand operand;
@ -874,7 +860,7 @@ public:
bool IsDirectRelTo() bool IsDirectRelTo()
{ {
return ((mRelTo.mKind == BeMCOperandKind_VReg) || (mRelTo.mKind == BeMCOperandKind_NativeReg)) && return ((mRelTo.mKind == BeMCOperandKind_VReg) || (mRelTo.mKind == BeMCOperandKind_NativeReg)) &&
(mRelOffset.IsZero()) && (mRelOffsetScale == 1); (mRelOffset.IsZero()) && (mRelOffsetScale == 1);
} }
bool IsDirectRelToAny() bool IsDirectRelToAny()
@ -1322,6 +1308,7 @@ public:
BeType* mNativeIntType; BeType* mNativeIntType;
BeModule* mModule; BeModule* mModule;
BeMCBlock* mActiveBlock; BeMCBlock* mActiveBlock;
BeMCInst* mActiveInst;
int* mInsertInstIdxRef; int* mInsertInstIdxRef;
BeBlock* mActiveBeBlock; BeBlock* mActiveBeBlock;
BeFunction* mBeFunction; BeFunction* mBeFunction;
@ -1383,6 +1370,7 @@ public:
void CreateCondBr(BeMCBlock* mcBlock, BeMCOperand& testVal, const BeMCOperand& trueBlock, const BeMCOperand& falseBlock); void CreateCondBr(BeMCBlock* mcBlock, BeMCOperand& testVal, const BeMCOperand& trueBlock, const BeMCOperand& falseBlock);
void CreatePhiAssign(BeMCBlock* mcBlock, const BeMCOperand& testVal, const BeMCOperand& result, const BeMCOperand& doneLabel); void CreatePhiAssign(BeMCBlock* mcBlock, const BeMCOperand& testVal, const BeMCOperand& result, const BeMCOperand& doneLabel);
BeMCOperand GetImmediate(int64 val); BeMCOperand GetImmediate(int64 val);
BeMCOperand OperandToAddr(const BeMCOperand& operand);
BeMCOperand GetVReg(int regNum); BeMCOperand GetVReg(int regNum);
BeMCOperand AllocVirtualReg(BeType* type, int refCount = -1, bool mustBeReg = false); BeMCOperand AllocVirtualReg(BeType* type, int refCount = -1, bool mustBeReg = false);
int GetUnderlyingVReg(int vregIdx); int GetUnderlyingVReg(int vregIdx);