1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 03:28:20 +02:00

Trimmed trailing whitespace

This commit is contained in:
Brian Fiete 2022-07-27 12:26:36 -04:00
parent 4f2fd58284
commit 602c7f318f
13 changed files with 1049 additions and 1113 deletions

View file

@ -972,7 +972,6 @@ int BeCOFFObject::DbgGetTypeId(BeDbgType* dbgType, bool doDefine)
else else
BF_FATAL("NotImpl"); BF_FATAL("NotImpl");
BF_FATAL("Invalid type"); BF_FATAL("Invalid type");
return -1; return -1;
} }
@ -1082,7 +1081,6 @@ void BeCOFFObject::DbgStartVarDefRange(BeDbgFunction* dbgFunc, BeDbgVariable* db
outS.Write((int16)range); // Range outS.Write((int16)range); // Range
} }
void BeCOFFObject::DbgEndLineBlock(BeDbgFunction* dbgFunc, const Array<BeDbgCodeEmission>& emissions, int blockStartPos, int emissionStartIdx, int lineCount) void BeCOFFObject::DbgEndLineBlock(BeDbgFunction* dbgFunc, const Array<BeDbgCodeEmission>& emissions, int blockStartPos, int emissionStartIdx, int lineCount)
{ {
auto& outS = mDebugSSect.mData; auto& outS = mDebugSSect.mData;

View file

@ -234,4 +234,3 @@ bool BeContext::AreTypesEqual(BeType* lhs, BeType* rhs)
} }
return false; return false;
} }

View file

@ -88,7 +88,6 @@ public:
virtual ~BeType() virtual ~BeType()
{ {
} }
int GetStride() int GetStride()
@ -121,7 +120,6 @@ public:
return (mTypeCode == BeTypeCode_Float) || (mTypeCode == BeTypeCode_Double); return (mTypeCode == BeTypeCode_Float) || (mTypeCode == BeTypeCode_Double);
} }
bool IsStruct() bool IsStruct()
{ {
return (mTypeCode == BeTypeCode_Struct); return (mTypeCode == BeTypeCode_Struct);

View file

@ -8,4 +8,3 @@
NS_BF_BEGIN NS_BF_BEGIN
NS_BF_END NS_BF_END

View file

@ -549,7 +549,6 @@ int64 BeIRCodeGen::ReadSLEB128()
byteVal = mStream->Read(); byteVal = mStream->Read();
val |= ((int64)(byteVal & 0x7f)) << shift; val |= ((int64)(byteVal & 0x7f)) << shift;
shift += 7; shift += 7;
} while (byteVal >= 128); } while (byteVal >= 128);
// Sign extend negative numbers. // Sign extend negative numbers.
if ((byteVal & 0x40) && (shift < 64)) if ((byteVal & 0x40) && (shift < 64))
@ -2309,7 +2308,6 @@ void BeIRCodeGen::HandleNextCmd()
break; break;
case BfIRCmd_EnsureFunctionPatchable: case BfIRCmd_EnsureFunctionPatchable:
{ {
} }
break; break;
case BfIRCmd_RemapBindFunction: case BfIRCmd_RemapBindFunction:
@ -2728,7 +2726,6 @@ void BeIRCodeGen::HandleNextCmd()
break; break;
case BfIRCmd_StatementStart: case BfIRCmd_StatementStart:
{ {
} }
break; break;
case BfIRCmd_ObjectAccessCheck: case BfIRCmd_ObjectAccessCheck:
@ -2831,7 +2828,6 @@ void BeIRCodeGen::HandleNextCmd()
typeEntry.mInstDIType->resolveCycles(); typeEntry.mInstDIType->resolveCycles();
} }
mDIBuilder->finalize();*/ mDIBuilder->finalize();*/
} }
break; break;
case BfIRCmd_DbgCreateCompileUnit: case BfIRCmd_DbgCreateCompileUnit:
@ -3430,7 +3426,6 @@ void BeIRCodeGen::HandleNextCmd()
} }
else else
{ {
}*/ }*/
if (dbgFunc->mValue != NULL) if (dbgFunc->mValue != NULL)
dbgFunc->mValue->mDbgFunction = dbgFunc; dbgFunc->mValue->mDbgFunction = dbgFunc;

View file

@ -1,4 +1,3 @@
#pragma warning(disable:4996) #pragma warning(disable:4996)
#include "BeLibManger.h" #include "BeLibManger.h"
#include "BeefySysLib/util/BeefPerf.h" #include "BeefySysLib/util/BeefPerf.h"
@ -93,7 +92,6 @@ bool BeLibFile::ReadLib()
} }
else else
{ {
} }
} }
else if (strncmp(header.mName, "// ", 3) == 0) else if (strncmp(header.mName, "// ", 3) == 0)
@ -296,7 +294,6 @@ bool BeLibFile::Finish()
int tabStartPos = mFileStream.GetPos(); int tabStartPos = mFileStream.GetPos();
BeLibMemberHeader header; BeLibMemberHeader header;
header.Init("/", "0", tabSize); header.Init("/", "0", tabSize);
mFileStream.WriteT(header); mFileStream.WriteT(header);
@ -534,4 +531,3 @@ BeLibManager* BeLibManager::Get()
{ {
return &gBfLibManager; return &gBfLibManager;
} }

View file

@ -121,5 +121,4 @@ public:
static BeLibManager* Get(); static BeLibManager* Get();
}; };
NS_BF_END NS_BF_END

View file

@ -251,7 +251,6 @@ BeVTrackingList* BeVTrackingContext::AddFiltered(BeVTrackingList* list, SizedArr
else else
newList->mNumChanges = 0; newList->mNumChanges = 0;
return newList; return newList;
} }
@ -301,7 +300,6 @@ BeVTrackingList* BeVTrackingContext::AddFiltered(BeVTrackingList* list, int idx,
else else
newList->mNumChanges = 0; newList->mNumChanges = 0;
return newList; return newList;
} }
@ -460,7 +458,6 @@ BeVTrackingList* BeVTrackingContext::SetChanges(BeVTrackingList* prevDestEntry,
return newList; return newList;
} }
BeVTrackingList* BeVTrackingContext::ClearFiltered(BeVTrackingList* list, const SizedArrayImpl<int>& indices) BeVTrackingList* BeVTrackingContext::ClearFiltered(BeVTrackingList* list, const SizedArrayImpl<int>& indices)
{ {
/*int newSize = list->mSize - indices.size(); /*int newSize = list->mSize - indices.size();
@ -1504,7 +1501,6 @@ void BeMCColorizer::AssignRegs(RegKind regKind)
dbgStr += StrFormat("VReg %d ", vregIdx); dbgStr += StrFormat("VReg %d ", vregIdx);
}*/ }*/
BeMCVRegInfo* vregInfo = mContext->mVRegInfo[vregIdx]; BeMCVRegInfo* vregInfo = mContext->mVRegInfo[vregIdx];
Node* node = &mNodes[vregIdx]; Node* node = &mNodes[vregIdx];
@ -2388,7 +2384,6 @@ BeMCOperand BeMCContext::GetOperand(BeValue* value, bool allowMetaResult, bool a
break; break;
case BeDbgVariable::TypeId: case BeDbgVariable::TypeId:
{ {
} }
} }
@ -2791,7 +2786,6 @@ void BeMCContext::RemoveInst(BeMCBlock* block, int instIdx, bool needChangesMerg
block->mInstructions.RemoveAt(instIdx); block->mInstructions.RemoveAt(instIdx);
} }
BeMCOperand BeMCContext::GetCallArgVReg(int argIdx, BeTypeCode typeCode) BeMCOperand BeMCContext::GetCallArgVReg(int argIdx, BeTypeCode typeCode)
{ {
int pIdx = argIdx; int pIdx = argIdx;
@ -3610,7 +3604,6 @@ void BeMCContext::CreateCondBr(BeMCBlock* mcBlock, BeMCOperand& testVal, const B
isFalseCmpResult = true; isFalseCmpResult = true;
} }
} }
} }
} }
}; };
@ -5913,7 +5906,6 @@ void BeMCContext::GetRMParams(const BeMCOperand& operand, BeRMParamsInfo& rmInfo
// A deref can only stand alone, and no double-derefs // A deref can only stand alone, and no double-derefs
if ((vregInfo->mRelOffset) || (vregInfo->mRelOffsetScale != 1) || (operand.mKind == BeMCOperandKind_VRegLoad)) if ((vregInfo->mRelOffset) || (vregInfo->mRelOffsetScale != 1) || (operand.mKind == BeMCOperandKind_VRegLoad))
{ {
BF_ASSERT(vregInfo->mRelTo.IsVRegAny()); BF_ASSERT(vregInfo->mRelTo.IsVRegAny());
rmInfo.mErrorVReg = vregInfo->mRelTo.mVRegIdx; rmInfo.mErrorVReg = vregInfo->mRelTo.mVRegIdx;
// For some reason we had changed this to: // For some reason we had changed this to:
@ -6116,7 +6108,6 @@ void BeMCContext::GetValAddr(const BeMCOperand& operand, X64CPURegister& reg, in
offset = mStackSize + vregInfo->mFrameOffset; offset = mStackSize + vregInfo->mFrameOffset;
} }
int BeMCContext::GetHighestVRegRef(const BeMCOperand& operand) int BeMCContext::GetHighestVRegRef(const BeMCOperand& operand)
{ {
if (!operand.IsVRegAny()) if (!operand.IsVRegAny())
@ -6668,7 +6659,6 @@ void BeMCContext::InitializedPassHelper(BeMCBlock* mcBlock, BeVTrackingGenContex
} }
} }
if ((inst->mResult) && (inst->mResult.mKind == BeMCOperandKind_CmpResult)) if ((inst->mResult) && (inst->mResult.mKind == BeMCOperandKind_CmpResult))
{ {
auto& cmpResult = mCmpResults[inst->mResult.mCmpResultIdx]; auto& cmpResult = mCmpResults[inst->mResult.mCmpResultIdx];
@ -6715,7 +6705,6 @@ void BeMCContext::InitializedPassHelper(BeMCBlock* mcBlock, BeVTrackingGenContex
} }
} }
if (inst->mKind == BeMCInstKind_LifetimeEnd) if (inst->mKind == BeMCInstKind_LifetimeEnd)
{ {
// In some cases we can have a dbg variable that actually points to a global variable (due to macros/inlining/etc), so this check is for that case: // In some cases we can have a dbg variable that actually points to a global variable (due to macros/inlining/etc), so this check is for that case:
@ -6965,7 +6954,6 @@ void BeMCContext::ReplaceVRegsInit(BeMCBlock* mcBlock, int startInstIdx, BeVTrac
// This pass does bottom-up initialization for "simple" vregs (ie: not variables) // This pass does bottom-up initialization for "simple" vregs (ie: not variables)
void BeMCContext::SimpleInitializedPass() void BeMCContext::SimpleInitializedPass()
{ {
} }
void BeMCContext::GenerateVRegInitFlags(BeVTrackingGenContext& genCtx) void BeMCContext::GenerateVRegInitFlags(BeVTrackingGenContext& genCtx)
@ -7357,7 +7345,6 @@ void BeMCContext::DoSplitLargeBlocks()
} }
} }
} }
} }
void BeMCContext::DetectLoops() void BeMCContext::DetectLoops()
@ -8015,7 +8002,6 @@ void BeMCContext::DoInstCombinePass()
} }
} }
// For the form // For the form
// <BinOp> %vreg0, %vreg1 // <BinOp> %vreg0, %vreg1
// Test %vreg0, 1 // Test %vreg0, 1
@ -8221,7 +8207,6 @@ void BeMCContext::DoInstCombinePass()
int* prevBestVRegIdxPtr = NULL; int* prevBestVRegIdxPtr = NULL;
if (defMap.TryGetValue(remapTo, &prevBestVRegIdxPtr)) if (defMap.TryGetValue(remapTo, &prevBestVRegIdxPtr))
{ {
} }
else else
defMap[remapTo] = bestVRegIdx; defMap[remapTo] = bestVRegIdx;
@ -8457,7 +8442,6 @@ void BeMCContext::DoRegAssignPass()
#endif #endif
} }
void BeMCContext::DoFrameObjPass() void BeMCContext::DoFrameObjPass()
{ {
BF_ASSERT(mBlocks.size() == 1); BF_ASSERT(mBlocks.size() == 1);
@ -9426,7 +9410,6 @@ bool BeMCContext::DoLegalization()
if (inst->mKind == BeMCInstKind_Call) if (inst->mKind == BeMCInstKind_Call)
{ {
// Convert from // Convert from
// Mov %reg0, <x> // Mov %reg0, <x>
// .. // ..
@ -9850,8 +9833,6 @@ bool BeMCContext::DoLegalization()
break; break;
} }
if (!mVRegInitializedContext.IsSet(inst->mVRegsInitialized, vregIdx)) if (!mVRegInitializedContext.IsSet(inst->mVRegsInitialized, vregIdx))
{ {
if ((dbgVar->mPendingInitType != BfIRInitType_NotNeeded) && (dbgVar->mPendingInitType != BfIRInitType_NotNeeded_AliveOnDecl)) if ((dbgVar->mPendingInitType != BfIRInitType_NotNeeded) && (dbgVar->mPendingInitType != BfIRInitType_NotNeeded_AliveOnDecl))
@ -10327,7 +10308,6 @@ bool BeMCContext::DoLegalization()
case BeMCInstKind_Add: case BeMCInstKind_Add:
case BeMCInstKind_Sub: case BeMCInstKind_Sub:
{ {
} }
break; break;
case BeMCInstKind_Shl: case BeMCInstKind_Shl:
@ -10615,7 +10595,6 @@ bool BeMCContext::DoLegalization()
OutputDebugStrF(" Mov MemCpy\n"); OutputDebugStrF(" Mov MemCpy\n");
break; break;
} }
} }
if ((arg0Type->IsFloat()) && (arg1Type->IsIntable())) if ((arg0Type->IsFloat()) && (arg1Type->IsIntable()))
@ -11446,7 +11425,6 @@ void BeMCContext::DoRegFinalization()
{ {
if (inst->mArg1.IsNativeReg()) if (inst->mArg1.IsNativeReg())
{ {
} }
}*/ }*/
@ -13042,7 +13020,6 @@ void BeMCContext::DoCodeEmission()
dbgStr += StrFormat("#### %d Dbg End Gap %s\n", funcCodePos, dbgVar->mName.c_str()); dbgStr += StrFormat("#### %d Dbg End Gap %s\n", funcCodePos, dbgVar->mName.c_str());
} }
} }
} }
} }
else // Removed else // Removed
@ -13921,7 +13898,6 @@ void BeMCContext::DoCodeEmission()
} }
else if ((arg0Type->mTypeCode == BeTypeCode_Int32) || (arg0Type->mTypeCode == BeTypeCode_Int64)) else if ((arg0Type->mTypeCode == BeTypeCode_Int32) || (arg0Type->mTypeCode == BeTypeCode_Int64))
{ {
// For 64-bit writes, we would like to use 32-bit zero extension but we resort to the full // For 64-bit writes, we would like to use 32-bit zero extension but we resort to the full
// 64-bits if necessary // 64-bits if necessary
auto arg0 = inst->mArg0; auto arg0 = inst->mArg0;
@ -14168,7 +14144,6 @@ void BeMCContext::DoCodeEmission()
if (inst->mArg1.IsSymbol()) if (inst->mArg1.IsSymbol())
{ {
BF_ASSERT(inst->mArg0.IsNativeReg()); BF_ASSERT(inst->mArg0.IsNativeReg());
} }
switch (instForm) switch (instForm)
@ -15215,7 +15190,6 @@ void BeMCContext::DoCodeEmission()
} }
break; break;
} }
} }
//mOut.Write((uint8)0xC3); //mOut.Write((uint8)0xC3);
break; break;
@ -15301,7 +15275,6 @@ void BeMCContext::DoCodeEmission()
codeVec[jump.mCodeOffset + 1 + textSectStartPos] = GetJumpOpCode(jump.mCmpKind, true); codeVec[jump.mCodeOffset + 1 + textSectStartPos] = GetJumpOpCode(jump.mCmpKind, true);
} }
#define CODE_OFFSET_ADJUST(val) if (val >= adjustFrom) val += adjustBytes #define CODE_OFFSET_ADJUST(val) if (val >= adjustFrom) val += adjustBytes
for (auto& labelPosition : labelPositions) for (auto& labelPosition : labelPositions)
CODE_OFFSET_ADJUST(labelPosition); CODE_OFFSET_ADJUST(labelPosition);
@ -16144,7 +16117,7 @@ void BeMCContext::Generate(BeFunction* function)
mDbgPreferredRegs[32] = X64Reg_R8;*/ mDbgPreferredRegs[32] = X64Reg_R8;*/
//mDbgPreferredRegs[8] = X64Reg_RAX; //mDbgPreferredRegs[8] = X64Reg_RAX;
mDebugging = (function->mName == "?CheckMatch@?$StringSplitEnumeratorBase@D@System@bf@@IEAA_NXZ"); mDebugging = (function->mName == "?stbi__gif_load_next@6$StbImage@StbImageBeef@bf@@SAPEAEPEAVstbi__context@123@PEAVstbi__gif@123@PEAHHPEAE@Z");
// || (function->mName == "?MethodA@TestProgram@BeefTest@bf@@CAXXZ"); // || (function->mName == "?MethodA@TestProgram@BeefTest@bf@@CAXXZ");
// || (function->mName == "?Hey@Blurg@bf@@SAXXZ") // || (function->mName == "?Hey@Blurg@bf@@SAXXZ")
// ; // ;
@ -17166,7 +17139,6 @@ void BeMCContext::Generate(BeFunction* function)
CreateDefineVReg(result); CreateDefineVReg(result);
//TODO: Always correct? //TODO: Always correct?
result.mKind = BeMCOperandKind_VReg; result.mKind = BeMCOperandKind_VReg;
} }
else else
SoftFail("Invalid GEP", inst->mDbgLoc); SoftFail("Invalid GEP", inst->mDbgLoc);
@ -17308,7 +17280,6 @@ void BeMCContext::Generate(BeFunction* function)
} }
}*/ }*/
result.mKind = BeMCOperandKind_Phi; result.mKind = BeMCOperandKind_Phi;
result.mPhi = mcPhi; result.mPhi = mcPhi;

View file

@ -14,7 +14,6 @@ NS_BF_BEGIN
class BeMCAddInst class BeMCAddInst
{ {
public: public:
}; };
struct BeVTrackingBits struct BeVTrackingBits
@ -109,9 +108,7 @@ public:
DiffIterator& operator++() DiffIterator& operator++()
{ {
} }
};*/ };*/
Iterator begin() Iterator begin()
@ -961,7 +958,6 @@ enum BeTrackKind
BeTrackKind_COUNT = 2 BeTrackKind_COUNT = 2
}; };
// BeVTrackingEntry is immutable -- the Set/Clear/Merge methods allocate new entries if // BeVTrackingEntry is immutable -- the Set/Clear/Merge methods allocate new entries if
// the requested change produces a new liveness set // the requested change produces a new liveness set
class BeVTrackingContext class BeVTrackingContext

View file

@ -156,7 +156,6 @@ void BeInliner::Visit(BeBlock* beBlock)
void BeInliner::Visit(BeArgument* beArgument) void BeInliner::Visit(BeArgument* beArgument)
{ {
} }
void BeInliner::Visit(BeInst* beInst) void BeInliner::Visit(BeInst* beInst)
@ -385,7 +384,6 @@ void BeInliner::Visit(BeCondBrInst* condBrInst)
void BeInliner::Visit(BePhiIncoming* phiIncomingInst) void BeInliner::Visit(BePhiIncoming* phiIncomingInst)
{ {
} }
void BeInliner::Visit(BePhiInst* phiInst) void BeInliner::Visit(BePhiInst* phiInst)
@ -399,7 +397,6 @@ void BeInliner::Visit(BePhiInst* phiInst)
destPhiInst->mIncoming.push_back(destPhiIncoming); destPhiInst->mIncoming.push_back(destPhiIncoming);
} }
destPhiInst->mType = phiInst->mType; destPhiInst->mType = phiInst->mType;
} }
@ -717,7 +714,6 @@ BeType * BeValueScopeStartInst::GetType()
return context->GetPrimitiveType(BeTypeCode_Int32); return context->GetPrimitiveType(BeTypeCode_Int32);
} }
BeType* BeGEPInst::GetType() BeType* BeGEPInst::GetType()
{ {
if (mIdx1 == NULL) if (mIdx1 == NULL)
@ -1517,7 +1513,6 @@ void BeDumpContext::ToString(StringImpl& str, BeValue* value, bool showType, boo
} }
} }
BeType* resultType = NULL; BeType* resultType = NULL;
const char* wantNamePtr = NULL; const char* wantNamePtr = NULL;
if (auto instVal = BeValueDynCast<BeInst>(value)) if (auto instVal = BeValueDynCast<BeInst>(value))
@ -2558,7 +2553,6 @@ String BeModule::ToString(BeFunction* wantFunc)
str += "}\n"; str += "}\n";
if (func->mDbgFunction != NULL) if (func->mDbgFunction != NULL)
{ {
str += " DbgFunc: "; str += " DbgFunc: ";
@ -2983,7 +2977,6 @@ void BeModule::DoInlining(BeFunction* func)
return lhsInlinePos->mIdx < rhsInlinePos->mIdx; return lhsInlinePos->mIdx < rhsInlinePos->mIdx;
}); });
}*/ }*/
} }
void BeModule::DoInlining() void BeModule::DoInlining()

View file

@ -228,7 +228,6 @@ public:
virtual ~BeValue() virtual ~BeValue()
{ {
} }
static const int TypeId = 0; static const int TypeId = 0;
@ -246,7 +245,6 @@ public:
} }
virtual int GetTypeId() { return TypeId; } virtual int GetTypeId() { return TypeId; }
public: public:
virtual BeType* GetType() virtual BeType* GetType()
{ {
@ -255,7 +253,6 @@ public:
virtual void SetName(const StringImpl& name) virtual void SetName(const StringImpl& name)
{ {
} }
}; };
@ -619,7 +616,6 @@ public:
virtual void HashContent(BeHashContext& hashCtx) override; virtual void HashContent(BeHashContext& hashCtx) override;
}; };
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
class BeInst : public BeValue class BeInst : public BeValue
@ -1588,7 +1584,6 @@ public:
bool mIsValue; bool mIsValue;
virtual void HashInst(BeHashContext& hashCtx) override; virtual void HashInst(BeHashContext& hashCtx) override;
}; };
class BeMDNode : public BeValue class BeMDNode : public BeValue
@ -1599,7 +1594,6 @@ public:
public: public:
virtual ~BeMDNode() virtual ~BeMDNode()
{ {
} }
virtual void HashContent(BeHashContext& hashCtx) override virtual void HashContent(BeHashContext& hashCtx) override
@ -2414,8 +2408,6 @@ public:
BeSetRetInst* CreateSetRet(BeValue* value, int returnTypeId); BeSetRetInst* CreateSetRet(BeValue* value, int returnTypeId);
BeCallInst* CreateCall(BeValue* func, const SizedArrayImpl<BeValue*>& args); BeCallInst* CreateCall(BeValue* func, const SizedArrayImpl<BeValue*>& args);
BeConstant* GetConstant(BeType* type, double floatVal); BeConstant* GetConstant(BeType* type, double floatVal);
BeConstant* GetConstant(BeType* type, int64 intVal); BeConstant* GetConstant(BeType* type, int64 intVal);
BeConstant* GetConstant(BeType* type, bool boolVal); BeConstant* GetConstant(BeType* type, bool boolVal);