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

Trailing whitespace trimming

This commit is contained in:
Brian Fiete 2022-07-26 13:27:03 -04:00
parent 06425735d9
commit 7f328385db
88 changed files with 9577 additions and 9850 deletions

View file

@ -7,7 +7,6 @@ struct CV_LVAR_ADDR_GAP;
NS_BF_BEGIN
#define PE_SIZEOF_SHORT_NAME 8
#define PE_DIRECTORY_ENTRY_EXPORT 0 // Export Directory
#define PE_NUMBEROF_DIRECTORY_ENTRIES 16
@ -17,7 +16,6 @@ NS_BF_BEGIN
#define PE_MACHINE_X86 0x14c
#define PE_MACHINE_X64 0x8664
// DOS .EXE header
struct PEHeader
{

View file

@ -1098,7 +1098,6 @@ bool BfAstNode::Equals(const char* str)
}
}
//////////////////////////////////////////////////////////////////////////
void BfBlock::Init(const SizedArrayImpl<BfAstNode*>& vec, BfAstAllocator* alloc)
@ -1929,7 +1928,6 @@ bool Beefy::BfCanOverloadOperator(BfUnaryOp unaryOp)
}
}
BfAssignmentOp Beefy::BfTokenToAssignmentOp(BfToken token)
{
switch (token)

View file

@ -1477,7 +1477,6 @@ public:
}
#endif
#ifdef BF_AST_HAS_PARENT_MEMBER
template <typename T>
T* FindParentOfType()
@ -2379,7 +2378,6 @@ public:
BfTokenNode* mColonToken;
BfSizedArray<ASTREF(BfTypeReference*)> mBaseClasses;
BfSizedArray<ASTREF(BfAstNode*)> mBaseClassCommas;
}; BF_AST_DECL(BfTypeDeclaration, BfAstNode);
class BfTypeAliasDeclaration : public BfTypeDeclaration
@ -2390,7 +2388,6 @@ public:
BfTokenNode* mEqualsToken;
BfTypeReference* mAliasToType;
BfTokenNode* mEndSemicolon;
}; BF_AST_DECL(BfTypeAliasDeclaration, BfTypeDeclaration);
class BfTypeReference : public BfAstNode
@ -2401,7 +2398,6 @@ public:
bool IsNamedTypeReference();
bool IsTypeDefTypeReference();
String ToCleanAttributeString();
}; BF_AST_DECL(BfTypeReference, BfAstNode);
class BfDirectTypeReference : public BfTypeReference
@ -2415,7 +2411,6 @@ public:
mType = type;
InitEmpty();
}
}; BF_AST_DECL(BfDirectTypeReference, BfAstNode);
class BfDirectTypeDefReference : public BfTypeReference
@ -2429,7 +2424,6 @@ public:
mTypeDef = type;
InitEmpty();
}
}; BF_AST_DECL(BfDirectTypeDefReference, BfTypeReference);
// class BfTypeDefTypeReference : public BfTypeReference
@ -2720,7 +2714,6 @@ public:
BF_AST_TYPE(BfStrideOfExpression, BfTypeAttrExpression);
}; BF_AST_DECL(BfStrideOfExpression, BfTypeAttrExpression);
class BfOffsetOfExpression : public BfTypeAttrExpression
{
public:
@ -3133,7 +3126,6 @@ public:
BfTokenNode* mInitializerColonToken;
BfExpression* mInitializer;
}; BF_AST_DECL(BfConstructorDeclaration, BfMethodDeclaration);
class BfAutoConstructorDeclaration : public BfConstructorDeclaration
@ -3195,7 +3187,6 @@ class BfEnumEntryDeclaration : public BfFieldDeclaration
{
public:
BF_AST_TYPE(BfEnumEntryDeclaration, BfFieldDeclaration);
}; BF_AST_DECL(BfEnumEntryDeclaration, BfFieldDeclaration);
class BfPropertyMethodDeclaration : public BfAstNode

View file

@ -24,7 +24,6 @@ void BfBitSet::Init(int numBits)
memset(mBits, 0, numInts * 4);
}
bool BfBitSet::IsSet(int idx)
{
return (mBits[idx / 32] & (1 << (idx % 32))) != 0;

View file

@ -56,7 +56,6 @@ public:
class BfAstAllocChunk;
class BfAstAllocManager;
struct BfAstFreePage
{
BfAstFreePage* mNext;
@ -218,5 +217,3 @@ public:
};
NS_BF_END

View file

@ -521,7 +521,6 @@ BfTypedValue BfAutoComplete::LookupTypeRefOrIdentifier(BfAstNode* node, bool* is
}
return BfTypedValue();
}
void BfAutoComplete::SetDefinitionLocation(BfAstNode* astNode, bool force)
@ -1635,7 +1634,6 @@ void BfAutoComplete::CheckIdentifier(BfAstNode* identifierNode, bool isInExpress
{
if (CheckDocumentation(entryAdded, prop->GetFieldDeclaration()->mDocumentation))
{
}
if (mIsGetDefinition)
SetDefinitionLocation(prop->GetFieldDeclaration()->mNameNode);
@ -1648,7 +1646,6 @@ void BfAutoComplete::CheckIdentifier(BfAstNode* identifierNode, bool isInExpress
{
if (CheckDocumentation(entryAdded, field->GetFieldDeclaration()->mDocumentation))
{
}
if (mIsGetDefinition)
SetDefinitionLocation(field->GetFieldDeclaration()->mNameNode);
@ -2224,7 +2221,6 @@ bool BfAutoComplete::CheckExplicitInterface(BfTypeInstance* interfaceType, BfAst
}
}
return false;
}
@ -2768,7 +2764,6 @@ void BfAutoComplete::AddOverrides(const StringImpl& filter)
void BfAutoComplete::UpdateReplaceData()
{
}
void BfAutoComplete::CheckMethod(BfMethodDeclaration* methodDeclaration, bool isLocalMethod)

View file

@ -57,7 +57,6 @@
USING_NS_BF;
using namespace llvm;
String BfCodeGenDirectoryData::GetDataFileName()
{
return mDirectoryName + "/build.dat";
@ -223,7 +222,6 @@ void BfCodeGenDirectoryData::ClearHash(const StringImpl& fileName)
mFileMap.Remove(fileName);
}
void BfCodeGenDirectoryData::FileFailed()
{
mFileFailed = true;
@ -349,7 +347,6 @@ void BfCodeGenThread::RunLoop()
}
#endif
}
#endif
@ -1147,4 +1144,3 @@ BF_EXPORT void BF_CALLTYPE BfCodeGen_GenerateObj(const void* ptr, int size, cons
codeGenRequest->mOptions = options;
gExternCodeGen->DoWriteObjectFile(codeGenRequest, ptr, size, outFileName, resultPtr);
}

View file

@ -45,7 +45,6 @@ public:
Array<String> mErrorMessages;
};
class BfCodeGenRequest
{
public:

View file

@ -205,7 +205,6 @@ GlobalVariable* AllocGlobalVariable(Module &M, Type *Ty, bool isConstant,
GlobalValue::ThreadLocalMode tlm = GlobalValue::NotThreadLocal, unsigned AddressSpace = 0,
bool isExternallyInitialized = false);
#include "BeefySysLib/util/AllocDebug.h"
//////////////////////////////////////////////////////////////////////////
@ -313,7 +312,6 @@ BfHotVirtualDeclaration* BfCompiler::HotData::GetVirtualDeclaration(BfHotMethod*
BfCompiler::HotState::~HotState()
{
}
bool BfCompiler::HotState::HasPendingChanges(BfTypeInstance* type)
@ -907,7 +905,6 @@ void BfCompiler::GetTestMethods(BfVDataModule* bfModule, Array<TestMethod>& test
vdataHashCtx.Mixin(methodInstance->mMethodDef->mIdx);
};
for (auto type : mContext->mResolvedTypes)
{
auto typeInstance = type->ToTypeInstance();
@ -2496,7 +2493,6 @@ void BfCompiler::UpdateDependencyMap(bool deleteUnusued, bool& didWork)
}
#endif
BP_ZONE("UpdateDependencyMap QueuedSpecializedMethodRebuildTypes");
HashSet<BfTypeInstance*> specializerSet;
@ -4266,7 +4262,6 @@ void BfCompiler::ProcessAutocompleteTempType()
}
}
}
}
if (autoComplete->mResolveType == BfResolveType_GetSymbolInfo)
@ -5173,7 +5168,6 @@ void BfCompiler::GetSymbolReferences()
}
}
if (mResolvePassData->mGetSymbolReferenceKind == BfGetSymbolReferenceKind_Type)
{
for (auto baseTypeRef : typeDef->mBaseTypes)
@ -5590,7 +5584,6 @@ BfMangler::MangleKind BfCompiler::GetMangleKind()
//////////////////////////////////////////////////////////////////////////
int ArrTest()
{
//SizedArray<int, 8> intArr;
@ -6993,7 +6986,6 @@ bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
}
}
if (IsHotCompile())
{
mContext->EnsureHotMangledVirtualMethodNames();
@ -7042,7 +7034,6 @@ bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
return typeDef;
};
_GetRequiredType("System.Void");
_GetRequiredType("System.Boolean");
_GetRequiredType("System.Int");
@ -7973,7 +7964,6 @@ void BfCompiler::ReportMemory(MemReporter* memReporter)
type->ReportMemory(memReporter);
}
for (auto module : mContext->mModules)
{
AutoMemReporter autoMemReporter(memReporter, "Modules");

View file

@ -561,4 +561,3 @@ public:
};
NS_BF_END

View file

@ -1332,7 +1332,6 @@ void BfContext::RebuildDependentTypes_MidCompile(BfDependedType* dType, const St
mCompiler->mNeedsFullRefresh = true;
mCompiler->mLastMidCompileRefreshRevision = mCompiler->mRevision;
}
}
BfLogSysM("Rebuilding dependent types MidCompile Type:%p Reason:%s\n", dType, reason.c_str());
RebuildDependentTypes(dType);
@ -2092,7 +2091,6 @@ void BfContext::PreUpdateRevisedTypes()
// }
}
// Note that this method can also cause modules to be build in other contexts.
// That's why we do our UpdateAfterDeletingTypes after all the contexts' UpdateRevisedTypes
void BfContext::UpdateRevisedTypes()
@ -3339,7 +3337,6 @@ void BfContext::MarkUsedModules(BfProject* project, BfModule* module)
void BfContext::Finish()
{
}
void BfContext::Cleanup()
@ -3456,4 +3453,3 @@ void BfContext::Cleanup()
for (auto module : mModules)
module->Cleanup();
}

View file

@ -2291,7 +2291,6 @@ void BfDefBuilder::FinishTypeDef(bool wantsToString)
methodDef->mIsMutating = true;
}
bool isAutocomplete = false;
if ((mResolvePassData != NULL) && (mResolvePassData->mAutoComplete != NULL))
isAutocomplete = true;

View file

@ -63,7 +63,6 @@ void BfDeferEvalChecker::Visit(BfLiteralExpression* literalExpr)
default:
mNeedsDeferEval = false;
}
}
void BfDeferEvalChecker::Visit(BfCastExpression* castExpr)
@ -198,4 +197,3 @@ void BfDeferEvalChecker::Visit(BfVariableDeclaration* varDecl)
if (varDecl != mRootNode)
mNeedsDeferEval = true;
}

View file

@ -38,5 +38,4 @@ public:
virtual void Visit(BfVariableDeclaration* varDecl) override;
};
NS_BF_END

View file

@ -151,7 +151,6 @@ bool DwDemangler::DemangleArrayType(StringImpl& outName)
{
case 'A':
{
}
break;
default:
@ -447,7 +446,6 @@ bool DwDemangler::DemangleNestedName(StringImpl& outName)
{
case 'N':
{
}
break;
}
@ -486,7 +484,6 @@ bool DwDemangler::DemangleRefQualifier(StringImpl& outName)
return false;
}
bool DwDemangler::DemangleOperatorName(StringImpl& outName)
{
auto firstChar = SafeGetChar(mMangledName, mCurIdx++);
@ -704,7 +701,6 @@ bool DwDemangler::DemangleExprPriamry(StringImpl& outName)
return false;
}
bool DwDemangler::DemangleTemplateArg(StringImpl& outName)
{
if (DemangleType(outName))
@ -1185,7 +1181,6 @@ bool MsDemangler::DemangleTemplateName(StringImpl& outName, String* primaryName)
return true;
}
bool MsDemangler::DemangleScopedName(StringImpl& outName, String* primaryName)
{
for (int nameIdx = 0; true; nameIdx++)
@ -1236,7 +1231,6 @@ bool MsDemangler::DemangleScopedName(StringImpl& outName, String* primaryName)
int num = DemangleNumber();
outName = StrFormat("%d", num);
}
}
else if ((c >= '0') && (c <= '9'))
{
@ -1435,7 +1429,6 @@ bool MsDemangler::DemangleType(StringImpl& outName)
}
break;
}
}
break;
@ -2071,7 +2064,6 @@ String MsDemangler::Demangle(const StringImpl& mangledName)
return outName;
}
//////////////////////////////////////////////////////////////////////////
MsDemangleScanner::MsDemangleScanner()
@ -2108,7 +2100,6 @@ bool MsDemangleScanner::DemangleTemplateName()
return true;
}
bool MsDemangleScanner::DemangleScopedName()
{
for (int nameIdx = 0; true; nameIdx++)
@ -2136,7 +2127,6 @@ bool MsDemangleScanner::DemangleScopedName()
mCurIdx--;
int num = DemangleNumber();
}
}
else if ((c >= '0') && (c <= '9'))
{
@ -2263,7 +2253,6 @@ bool MsDemangleScanner::DemangleType()
}
break;
}
}
break;
@ -2526,4 +2515,3 @@ bool BfDemangler::IsData(const StringImpl& mangledName)
}
return false;
}

View file

@ -6,7 +6,6 @@ USING_NS_BF;
BfElementVisitor::BfElementVisitor()
{
}
void BfElementVisitor::Visit(BfTypedValueExpression* typedValueExpr)
@ -849,7 +848,6 @@ void BfElementVisitor::Visit(BfUsingStatement* usingStmt)
VisitChild(usingStmt->mVariableDeclaration);
VisitChild(usingStmt->mCloseParen);
VisitChild(usingStmt->mEmbeddedStatement);
}
void BfElementVisitor::Visit(BfDoStatement* doStmt)
@ -1221,7 +1219,6 @@ void BfElementVisitor::Visit(BfTypeDeclaration* typeDeclaration)
for (auto& member : *typeDeclaration->mDefineBlock)
VisitChild(member);
}*/
}
void BfElementVisitor::Visit(BfTypeAliasDeclaration* typeDeclaration)

View file

@ -762,7 +762,6 @@ void BfMethodMatcher::CompareMethods(BfMethodInstance* prevMethodInstance, BfTyp
return;
}
if (newMethodDef->mExplicitInterface != prevMethodDef->mExplicitInterface)
{
if (mModule->CompareMethodSignatures(newMethodInstance, prevMethodInstance))
@ -1594,7 +1593,6 @@ bool BfMethodMatcher::InferFromGenericConstraints(BfMethodInstance* methodInstan
if (checkOpConstraint.mCastToken == BfToken_Implicit)
{
}
else
{
@ -1603,7 +1601,6 @@ bool BfMethodMatcher::InferFromGenericConstraints(BfMethodInstance* methodInstan
if (checkOpConstraint.mCastToken == BfToken_Explicit)
{
}
else
{
@ -1755,7 +1752,6 @@ bool BfMethodMatcher::CheckMethod(BfTypeInstance* targetTypeInstance, BfTypeInst
}
}
if (mHasArgNames)
{
checkMethod->BuildParamNameMap();
@ -1788,7 +1784,6 @@ bool BfMethodMatcher::CheckMethod(BfTypeInstance* targetTypeInstance, BfTypeInst
}
}
for (auto& checkGenericArgRef : mCheckMethodGenericArguments)
checkGenericArgRef = NULL;
@ -3068,7 +3063,6 @@ void BfMethodMatcher::TryDevirtualizeCall(BfTypedValue target, BfTypedValue* ori
// Failed
mFakeConcreteTarget = true;
}
}
}
}
@ -3796,7 +3790,6 @@ void BfExprEvaluator::Visit(BfCaseExpression* caseExpr)
if (mResult)
return;
}
if ((caseValAddr) && (IsVar(caseValAddr.mType)))
@ -5523,7 +5516,6 @@ BfTypedValue BfExprEvaluator::LookupField(BfAstNode* targetSrc, BfTypedValue tar
else
findName.Reference(fieldName);
auto activeTypeDef = mModule->GetActiveTypeDef();
for (int pass = 0; pass < 2; pass++)
{
@ -6990,8 +6982,6 @@ BfTypedValue BfExprEvaluator::CreateCall(BfAstNode* targetSrc, BfMethodInstance*
return result;
}
BfTypedValue BfExprEvaluator::CreateCall(BfMethodMatcher* methodMatcher, BfTypedValue target)
{
auto moduleMethodInstance = GetSelectedMethod(*methodMatcher);
@ -7273,7 +7263,6 @@ void BfExprEvaluator::PushThis(BfAstNode* targetSrc, BfTypedValue argVal, BfMeth
}
}
}
}
if (argVal.mType->IsValuelessType())
@ -7921,7 +7910,6 @@ BfTypedValue BfExprEvaluator::CreateCall(BfAstNode* targetSrc, const BfTypedValu
mModule->Warn(BfWarning_BF4205_StringInterpolationParam, "Expanded string interpolation argument not used as 'params'. If string allocation was intended then consider adding a specifier such as 'scope'.", errorRef);
}
// if ((arg == NULL) && (argValues[argExprIdx].mExpression != NULL))
// hadMissingArg = true;
@ -8009,7 +7997,6 @@ BfTypedValue BfExprEvaluator::CreateCall(BfAstNode* targetSrc, const BfTypedValu
if (auto typerDecl = BfNodeDynCast<BfTypeDeclaration>(mModule->mParentNodeEntry->mNode))
showCtorError = true;
if (showCtorError)
{
if (mModule->PreFail())
@ -8848,7 +8835,6 @@ BfTypedValue BfExprEvaluator::ResolveArgValue(BfResolvedArg& resolvedArg, BfType
}
}
if (wantType->IsRef())
{
auto refType = (BfRefType*)wantType;
@ -9587,7 +9573,6 @@ BfTypedValue BfExprEvaluator::MatchMethod(BfAstNode* targetSrc, BfMethodBoundExp
else if (isUnboundCall)
{
//auto resolvedType = mModule->ResolveGenericType(lookupType);
}
else if (lookupType->IsGenericParam())
{
@ -9869,7 +9854,6 @@ BfTypedValue BfExprEvaluator::MatchMethod(BfAstNode* targetSrc, BfMethodBoundExp
if (resolvedType != NULL)
resolvedTypeInstance = resolvedType->ToTypeInstance();
}
}
else
{
@ -10198,7 +10182,6 @@ BfTypedValue BfExprEvaluator::MatchMethod(BfAstNode* targetSrc, BfMethodBoundExp
if (methodDef == NULL)
{
}
// This will flush out any new ambiguity errors from extension methods
@ -10587,7 +10570,6 @@ BfTypedValue BfExprEvaluator::MatchMethod(BfAstNode* targetSrc, BfMethodBoundExp
mModule->MethodToString(moduleMethodInstance.mMethodInstance).c_str(), mModule->MethodToString(mModule->mCurMethodInstance).c_str()), targetSrc);
}
BfTypedValue result;
BfTypedValue argCascade;
@ -10950,7 +10932,6 @@ void BfExprEvaluator::LookupQualifiedName(BfAstNode* nameNode, BfIdentifierNode*
{
if (mResult.mType->IsSizedArray())
{
if (mResult.mType->IsValuelessType())
{
mResult.mType = mModule->GetWrappedStructType(mResult.mType);
@ -12935,7 +12916,6 @@ BfTypedValue BfExprEvaluator::DoImplicitArgCapture(BfAstNode* refNode, BfIdentif
BfLocalVarEntry* entry;
if (checkMethodState->mLocalVarSet.TryGetWith<StringImpl&>(findName, &entry))
{
auto varDecl = entry->mLocalVar;
while (varDecl != NULL)
@ -12961,7 +12941,6 @@ BfTypedValue BfExprEvaluator::DoImplicitArgCapture(BfAstNode* refNode, BfIdentif
varDecl = varDecl->mShadowedLocal;
}
}
// Check for the captured locals. It's important we do it here so we get local-first precedence still
@ -13233,7 +13212,6 @@ void BfExprEvaluator::Visit(BfDelegateBindExpression* delegateBindExpr)
else
delegateTypeInstance = mExpectingType->ToTypeInstance();
if ((delegateTypeInstance == NULL) ||
((!delegateTypeInstance->IsDelegate()) && (!delegateTypeInstance->IsFunction())))
{
@ -14713,7 +14691,6 @@ BfLambdaInstance* BfExprEvaluator::GetLambdaInstance(BfLambdaBindExpression* lam
mModule->mBfIRBuilder->PopulateType(useTypeInstance);
mModule->PopulateType(useTypeInstance);
methodDef->mIsStatic = closureTypeInst == NULL;
SizedArray<BfIRType, 8> origParamTypes;
@ -14860,7 +14837,6 @@ BfLambdaInstance* BfExprEvaluator::GetLambdaInstance(BfLambdaBindExpression* lam
mModule->mBfIRBuilder->SaveDebugLocation();
//
{
BfGetSymbolReferenceKind prevSymbolRefKind = BfGetSymbolReferenceKind_None;
if (mModule->mCompiler->mResolvePassData != NULL)
{
@ -15642,7 +15618,6 @@ void BfExprEvaluator::CreateObject(BfObjectCreateExpression* objCreateExpr, BfAs
BfInitContext(BfModule* module, BfType* resultType, int dimensions, SizedArray<BfIRValue, 2>& dimLengthVals, BfIRValue arraySize, int& writeIdx) :
mModule(module), resultType(resultType), dimensions(dimensions), dimLengthVals(dimLengthVals), arraySize(arraySize), writeIdx(writeIdx)
{
}
void Handle(BfIRValue addr, int curDim, const BfSizedArray<BfExpression*>& valueExprs)
@ -16160,7 +16135,6 @@ void BfExprEvaluator::CreateObject(BfObjectCreateExpression* objCreateExpr, BfAs
/*if (typeInstance != NULL)
{
mModule->InitTypeInst(mResult, scopeData, true);
}
if (isStackAlloc)
@ -18089,11 +18063,9 @@ void BfExprEvaluator::DoInvocation(BfAstNode* target, BfMethodBoundExpression* m
{
if (mExpectingType->IsVar())
{
}
mResult = BfTypedValue(mExpectingType);
}
else if (!gaveUnqualifiedDotError)
mModule->Fail("Unqualified dot syntax can only be used when the result type can be inferred", memberRefExpression->mDotToken);
@ -18135,7 +18107,6 @@ void BfExprEvaluator::DoInvocation(BfAstNode* target, BfMethodBoundExpression* m
thisValue = mResult;
mResult = BfTypedValue();
}
}
if (mPropDef != NULL)
thisValue = GetResult(true);
@ -18220,7 +18191,6 @@ void BfExprEvaluator::DoInvocation(BfAstNode* target, BfMethodBoundExpression* m
flags = (BfEvalExprFlags)(flags | BfEvalExprFlags_AllowRefExpr);
expr = paranExpr->mExpression;
}
}
if (expr != NULL)
mResult = mModule->CreateValueFromExpression(expr, expectingTargetType, flags);
@ -18349,7 +18319,6 @@ void BfExprEvaluator::DoInvocation(BfAstNode* target, BfMethodBoundExpression* m
mResult = BfTypedValue();
}
}
}
if (mPropDef != NULL)
thisValue = GetResult(true);
@ -18940,7 +18909,6 @@ BfMethodDef* BfExprEvaluator::GetPropertyMethodDef(BfPropertyDef* propDef, BfMet
if (methodDef->mMethodType != methodType)
continue;
if (methodDef->mCheckedKind == checkedKind)
{
matchedMethod = methodDef;
@ -19623,8 +19591,6 @@ bool BfExprEvaluator::CheckModifyResult(BfTypedValue& typedVal, BfAstNode* refNo
break;
}
}
}
}
@ -20098,7 +20064,6 @@ BfTypedValue BfExprEvaluator::PerformAssignment_CheckOp(BfAssignmentExpression*
return leftValue;
}
checkTypeInst = mModule->GetBaseType(checkTypeInst);
}
@ -21945,7 +21910,6 @@ void BfExprEvaluator::Visit(BfIndexerExpression* indexerExpr)
}
else
{
auto indexResult = mModule->CreateIndexedValue(underlyingType, target.mValue, indexArgument.mValue);
mResult = BfTypedValue(indexResult, underlyingType, target.IsReadOnly() ? BfTypedValueKind_ReadOnlyAddr : BfTypedValueKind_Addr);
}
@ -22037,7 +22001,6 @@ void BfExprEvaluator::PerformUnaryOperation(BfExpression* unaryOpExpr, BfUnaryOp
mExpectingType = prevExpedcting;
}
BfExprEvaluator::PerformUnaryOperation_OnResult(unaryOpExpr, unaryOp, opToken, opFlags);
}
@ -22998,7 +22961,6 @@ bool BfExprEvaluator::PerformBinaryOperation_NullCoalesce(BfTokenNode* opToken,
mModule->AddBasicBlock(rhsBB);
BfTypedValue rightValue;
if (assignTo != NULL)
rightValue = mModule->CreateValueFromExpression(rightExpression, wantType, (BfEvalExprFlags)((mBfEvalExprFlags & BfEvalExprFlags_InheritFlags) | BfEvalExprFlags_CreateConditionalScope));
else

View file

@ -135,7 +135,6 @@ public:
}
void HandleFixits(BfModule* module);
};
class BfGenericInferContext

View file

@ -585,7 +585,6 @@ const char* BfIRConstHolder::AllocStr(const StringImpl& str)
return strCopy;
}
BfConstant* BfIRConstHolder::GetConstantById(int id)
{
return (BfConstant*)mTempAlloc.GetChunkedPtr(id);
@ -2810,7 +2809,6 @@ void BfIRBuilder::CreateTypeDeclaration(BfType* type, bool forceDbgDefine)
if (wantDIData)
{
diType = DbgGetType(concreteInterfaceType->mInterface);
}
}
else if (type->IsMethodRef())
@ -3153,7 +3151,6 @@ void BfIRBuilder::CreateDbgTypeDefinition(BfType* type)
if (typeInstance->IsBoxed())
{
}
else
{
@ -3746,7 +3743,6 @@ void BfIRBuilder::CreateTypeDefinition_Data(BfModule* populateModule, BfTypeInst
orderedFields.push_back(NULL);
orderedFields[fieldInstance->mDataIdx] = fieldInstance;
}
}
}
}
@ -3821,7 +3817,6 @@ void BfIRBuilder::CreateTypeDefinition_Data(BfModule* populateModule, BfTypeInst
if (typeInstance->mIsUnion)
{
}
else if ((typeInstance->IsEnum()) && (typeInstance->IsStruct()))
{
@ -3960,10 +3955,8 @@ void BfIRBuilder::ReplaceDITemporaryTypes()
mDITemporaryTypes.Clear();
}
void BfIRBuilder::PushDbgLoc(BfTypeInstance* typeInst)
{
}
BfIRPopulateType BfIRBuilder::GetPopulateTypeState(BfType* type)
@ -4396,7 +4389,6 @@ BfIRValue BfIRBuilder::CreateCmpLT(BfIRValue lhs, BfIRValue rhs, bool isSigned)
return CreateConst(BfTypeCode_Boolean, 0);
}
auto retVal = WriteCmd(isSigned ? BfIRCmd_CmpSLT : BfIRCmd_CmpULT, lhs, rhs);
NEW_CMD_INSERTED_IRVALUE;
return retVal;

View file

@ -1424,4 +1424,3 @@ public:
};
NS_BF_END

View file

@ -731,7 +731,6 @@ int64 BfIRCodeGen::ReadSLEB128()
byteVal = mStream->Read();
val |= ((int64)(byteVal & 0x7f)) << shift;
shift += 7;
} while (byteVal >= 128);
// Sign extend negative numbers.
if ((byteVal & 0x40) && (shift < 64))
@ -1355,7 +1354,6 @@ llvm::Type* BfIRCodeGen::GetElemType(llvm::Value* value)
return NULL;
}
bool BfIRCodeGen::TryMemCpy(llvm::Value* ptr, llvm::Value* val)
{
auto valType = val->getType();
@ -1776,7 +1774,6 @@ void BfIRCodeGen::InitTarget()
Options, relocModel, cmModel, optLvl);
mLLVMModule->setDataLayout(mLLVMTargetMachine->createDataLayout());
}
void BfIRCodeGen::HandleNextCmd()
@ -5360,7 +5357,6 @@ static void PopulateModulePassManager(llvm::legacy::PassManagerBase &MPM, const
}
}
namespace
{
struct BfPass : public llvm::MachineFunctionPass

View file

@ -242,4 +242,3 @@ public:
};
NS_BF_END

View file

@ -2259,7 +2259,6 @@ void BfMSMangler::Mangle(StringImpl& name, bool is64Bit, BfMethodInstance* metho
BfLog2(" Demangled %d: %s\n", mangleIdx, demangled.c_str());
}
}
}
void BfMSMangler::Mangle(StringImpl& name, bool is64Bit, BfFieldInstance* fieldInstance)

View file

@ -3476,8 +3476,6 @@ void BfModule::CheckRangeError(BfType* type, BfAstNode* refNode)
Fail(StrFormat("Result out of range for type '%s'", TypeToString(type).c_str()), refNode);
}
void BfModule::FatalError(const StringImpl& error, const char* file, int line)
{
static bool sHadFatalError = false;
@ -4179,7 +4177,6 @@ void BfModule::ResolveConstField(BfTypeInstance* typeInstance, BfFieldInstance*
}
}
mContext->mFieldResolveReentrys.push_back(fieldInstance);
AutoPopBack<decltype (mContext->mFieldResolveReentrys)> popTypeResolveReentry(&mContext->mFieldResolveReentrys);
if (fieldInstance == NULL)
@ -4436,11 +4433,9 @@ BfType* BfModule::ResolveVarFieldType(BfTypeInstance* typeInstance, BfFieldInsta
if (field->mIsStatic)
{
}
else if (fieldInstance->mDataIdx >= 0)
{
}
else
{
@ -4693,7 +4688,6 @@ void BfModule::AppendedObjectInit(BfFieldInstance* fieldInst)
void BfModule::CheckInterfaceMethod(BfMethodInstance* methodInstance)
{
}
void BfModule::FindSubTypes(BfTypeInstance* classType, SizedArrayImpl<int>* outVals, SizedArrayImpl<BfTypeInstance*>* exChecks, bool isInterfacePass)
@ -5467,7 +5461,6 @@ BfIRValue BfModule::CreateClassVDataExtGlobal(BfTypeInstance* declTypeInst, BfTy
if (implTypeInst->mVirtualMethodTable[virtIdx].mDeclaringMethod.mMethodNum == -1)
break; // Start of an ext entry for another type
BfIRValue vValue;
auto& entry = implTypeInst->mVirtualMethodTable[virtIdx];
BfMethodInstance* declaringMethodInstance = (BfMethodInstance*)entry.mDeclaringMethod;
@ -6634,7 +6627,6 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary<int, int>& usedStrin
int idx = checkIFace.mStartVirtualIdx + ifaceMethodInstance->mVirtualTableIdx;
vData[iFaceMethodStartIdx + idx] = funcPtr;
}
}
}
}
@ -8641,7 +8633,6 @@ bool BfModule::CheckGenericConstraints(const BfGenericParamSource& genericParamS
}
return false;
}
}
else
{
@ -9392,7 +9383,6 @@ BfIRValue BfModule::AllocFromType(BfType* type, const BfAllocTarget& allocTarget
mBfIRBuilder->SetInsertPoint(prevInsertBlock);
}
auto byteType = GetPrimitiveType(BfTypeCode_Int8);
auto bytePtrType = CreatePointerType(byteType);
@ -10993,7 +10983,6 @@ BfModuleMethodInstance BfModule::GetMethodByName(BfTypeInstance* typeInstance, c
methodDef = methodDef->mNextWithSameName;
}
if (!checkBase)
break;
typeInstance = typeInstance->mBaseType;
@ -13006,7 +12995,6 @@ void BfModule::AggregateSplatIntoAddr(BfTypedValue typedValue, BfIRValue addrVal
auto val = ExtractSplatValue(typedValue, elementIdx++, checkType);
mBfIRBuilder->CreateStore(val, curAddrVal);
}
};
checkTypeLambda(typedValue.mType, addrVal);
@ -13810,7 +13798,6 @@ BfModuleMethodInstance BfModule::GetMethodInstance(BfTypeInstance* typeInst, BfM
BF_ASSERT(methodDef->mMethodType != BfMethodType_Ignore);
// We need to do the 'mNeedsMethodProcessing' check because we want to do a proper initial "awaiting reference" population
// on the methods before we handle an on-demand situation. This also ensures that our type options are set before doing
// a FinishInit
@ -14891,7 +14878,6 @@ BfTypedValue BfModule::GetCompilerFieldValue(BfTypedValue typedValue)
return BfTypedValue();
}
BfTypedValue BfModule::ReferenceStaticField(BfFieldInstance* fieldInstance)
{
BfIRValue globalValue;
@ -15248,7 +15234,6 @@ bool BfModule::IsInUnspecializedGeneric()
//////////////////////////////////////////////////////////////////////////
BfIRValue BfModule::AllocLocalVariable(BfType* type, const StringImpl& name, bool doLifetimeEnd)
{
//if ((type->IsValuelessType()) || (type->IsMethodRef()))
@ -15317,7 +15302,6 @@ void BfModule::DoLocalVariableDebugInfo(BfLocalVariable* localVarDef, bool doAli
if (localVarDef->mResolvedType->IsValuelessType())
{
}
else
{
@ -16509,7 +16493,6 @@ bool BfModule::IsInterestedInMethod(BfTypeInstance* typeInstance, BfMethodDef* m
auto typeDef = typeInstance->mTypeDef;
auto methodDeclaration = methodDef->mMethodDeclaration;
if (!mCompiler->mIsResolveOnly)
return true;
@ -16763,7 +16746,6 @@ BfTypedValue BfModule::CallBaseCtorCalc(bool constOnly)
//
{
}
BfFunctionBindResult bindResult;
bindResult.mSkipThis = true;
@ -16827,7 +16809,6 @@ BfTypedValue BfModule::CallBaseCtorCalc(bool constOnly)
BF_ASSERT(calcAppendMethodModule.mFunc);
appendSizeTypedValue = exprEvaluator.CreateCall(NULL, calcAppendMethodModule.mMethodInstance, calcAppendMethodModule.mFunc, false, calcAppendArgs);
BF_ASSERT(appendSizeTypedValue.mType == GetPrimitiveType(BfTypeCode_IntPtr));
return appendSizeTypedValue;
}
@ -20420,7 +20401,6 @@ void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup,
llvm::dwarf::DW_VIRTUALITY_none,
0,
BfIRMDNode(), flags, IsOptimized(), llvmFunction, genericArgs, genericConstValueArgs);
}
else
{
@ -20953,7 +20933,6 @@ void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup,
{
if ((!paramVar->mValue) || (paramVar->mValue.IsFake()))
{
if ((!paramVar->mIsThis) && (mCompiler->mOptions.mToolsetType != BfToolsetType_GNU)) // DWARF chokes on this:
{
// We don't need to set the location for this
@ -21284,7 +21263,6 @@ void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup,
mImportFileNames.Add(importStrNum);
}
}
}
}
else if (methodInstance->GetImportKind() == BfImportKind_Import_Dynamic)
@ -21538,7 +21516,6 @@ void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup,
}
else if (!mCurTypeInstance->IsObject())
{
}
}
else if (methodDef->mName == BF_METHODNAME_FIND_TLS_MEMBERS)
@ -21805,7 +21782,6 @@ void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup,
}
}
if ((mCurMethodInstance->mReturnType == NULL) || (mCurMethodInstance->mReturnType->IsValuelessType()))
{
if ((!mCurMethodState->mHadReturn) && (!mCurMethodState->mIRExitBlock))
@ -23699,7 +23675,6 @@ void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool
methodInstance->mMethodDef->mParams.Reserve((int)methodDef->mParams.size());
bool hadDelegateParams = false;
bool hadParams = false;
for (int paramIdx = 0; paramIdx < (int)methodDef->mParams.size() + implicitParamCount; paramIdx++)
@ -25554,7 +25529,6 @@ bool BfModule::SlotInterfaceMethod(BfMethodInstance* methodInstance)
}
}
// for (int methodIdx = 0; methodIdx < typeInstance->mMethodInstanceGroups.size(); methodIdx++)
// {
// auto ifaceMethod = typeInstance->mMethodInstanceGroups[methodIdx].mDefault;
@ -25840,7 +25814,6 @@ bool BfModule::Finish()
mHadHotObjectWrites = true;
}
//TODO: Testing VDATA
/*if (mModuleName == "vdata")
{
@ -26025,4 +25998,3 @@ void BfModule::ClearModule()
if (mNextAltModule != NULL)
mNextAltModule->ClearModule();
}

View file

@ -2106,7 +2106,6 @@ public:
}
};
class BfVDataModule : public BfModule
{
public:

View file

@ -2920,7 +2920,6 @@ void BfModule::DoCEEmit(BfMethodInstance* methodInstance)
mBfIRBuilder->CreateConstAggZero(mBfIRBuilder->MapType(methodInfoType->ToTypeInstance()->mBaseType, BfIRPopulateType_Identity)),
mBfIRBuilder->CreateTypeOf(mCurTypeInstance), // mTypeInstance
GetConstValue((int64)methodInstance, GetPrimitiveType(BfTypeCode_Int64)), // mNativeMethodInstance
};
FixConstValueParams(methodInfoType->ToTypeInstance(), methodData, true);
auto fieldDataAgg = mBfIRBuilder->CreateConstAgg(mBfIRBuilder->MapType(methodInfoType, BfIRPopulateType_Identity), methodData);
@ -4208,7 +4207,6 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
}
}
if (checkTypeInst != NULL)
{
baseType = checkTypeInst;
@ -5411,7 +5409,6 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
{
Fail(StrFormat("Append constructor '%s' does not result in a constant size", MethodToString(bindResult.mMethodInstance).c_str()), nameRefNode);
}
}
}
else if (fieldDef->mIsAppend)
@ -6097,7 +6094,6 @@ void BfModule::DoTypeInstanceMethodProcessing(BfTypeInstance* typeInstance)
//BF_ASSERT((methodInstanceGroup->mOnDemandKind == BfMethodOnDemandKind_NotSet) || (methodInstanceGroup->mOnDemandKind == BfMethodOnDemandKind_AlwaysInclude));
}
if (typeInstance == mContext->mBfObjectType)
{
BF_ASSERT(typeInstance->mInterfaceMethodTable.size() == 0);
@ -6677,7 +6673,6 @@ void BfModule::DoTypeInstanceMethodProcessing(BfTypeInstance* typeInstance)
}
}
BF_ASSERT(typeInstance->mVirtualMethodTable.size() == typeInstance->mVirtualMethodTableSize);
if ((isBoxed) && (!typeInstance->IsUnspecializedTypeVariation()))
@ -7313,7 +7308,6 @@ void BfModule::AddMethodToWorkList(BfMethodInstance* methodInstance)
specMethodInstance->mDeclModule->AddMethodToWorkList(specMethodInstance);
}
}
}
}
else
@ -9123,7 +9117,6 @@ BfType* BfModule::ResolveGenericType(BfType* unspecializedType, BfTypeVector* ty
methodDef->mIsMutating = unspecializedInvokeMethodDef->mIsMutating;
}
//
if (typeDef->mIsDelegate)
@ -9228,7 +9221,6 @@ BfType* BfModule::ResolveType(BfType* lookupType, BfPopulateType populateType, B
return lookupType;
}
bool BfModule::IsUnboundGeneric(BfType* type)
{
if (type->IsVar())
@ -9919,7 +9911,6 @@ BfTypeDef* BfModule::GetActiveTypeDef(BfTypeInstance* typeInstanceOverride, bool
useTypeDef = mCurMethodState->mMixinState->mMixinMethodInstance->mMethodDef->mDeclaringType->GetDefinition();
else if ((mCurMethodInstance != NULL) && (mCurMethodInstance->mMethodDef->mDeclaringType != NULL))
{
auto declTypeDef = mCurMethodInstance->mMethodDef->mDeclaringType;
useTypeDef = declTypeDef->GetDefinition();
if ((declTypeDef->IsEmitted()) && (useTypeDef->mIsCombinedPartial))
@ -10290,7 +10281,6 @@ BfTypeDef* BfModule::FindTypeDef(BfTypeReference* typeRef, BfTypeInstance* typeI
return NULL;
}
#ifdef BF_AST_HAS_PARENT_MEMBER
if (auto parentGenericTypeRef = BfNodeDynCast<BfGenericInstanceTypeRef>(typeRef->mParent))
{
@ -15829,4 +15819,3 @@ void BfModule::DoTypeToString(StringImpl& str, BfType* resolvedType, BfTypeNameF
str += "???";
return;
}

View file

@ -6,7 +6,6 @@ USING_NS_BF;
//////////////////////////////////////////////////////////////////////////
void BfNamespaceVisitor::Visit(BfUsingDirective* usingDirective)
{
if (usingDirective->mNamespace == NULL)

View file

@ -1,6 +1,5 @@
#pragma warning(disable:4996)
#include "BfParser.h"
#include "BfReducer.h"
#include "BfPrinter.h"
@ -182,7 +181,6 @@ static int DecodeInt(uint8* buf, int& idx)
curByte = buf[idx++];
value |= ((curByte & 0x7f) << shift);
shift += 7;
} while (curByte >= 128);
// Sign extend negative numbers.
if (((curByte & 0x40) != 0) && (shift < 64))
@ -397,7 +395,6 @@ BfParser::BfParser(BfSystem* bfSystem, BfProject* bfProject) : BfSource(bfSystem
}
}
//static std::set<BfAstNode*> gFoundNodes;
BfParser::~BfParser()
@ -406,7 +403,6 @@ BfParser::~BfParser()
if (mParserData == NULL)
{
}
else if (mParserData->mRefCount == -1)
{
@ -925,12 +921,10 @@ MaybeBool BfParser::HandleProcessorCondition(BfBlock* paramNode)
void BfParser::HandleInclude(BfAstNode* paramNode)
{
}
void BfParser::HandleIncludeNext(BfAstNode* paramNode)
{
}
bool BfParser::HandlePreprocessor()
@ -1370,7 +1364,6 @@ struct StrHashT<4>
{
const static int HASH = (StrHashT<3>::HASH) ^ Str[4];
};
};
// This is little endian only
@ -3763,7 +3756,6 @@ void BfParser::HadSrcRealloc()
mParserData->mJumpTable = mJumpTable;
mParserData->mJumpTableSize = mJumpTableSize;
}
}
void BfParser::GenerateAutoCompleteFrom(int srcPosition)
@ -4108,7 +4100,6 @@ BF_EXPORT bool BF_CALLTYPE BfParser_BuildDefs(BfParser* bfParser, BfPassInstance
BF_EXPORT void BF_CALLTYPE BfParser_RemoveDefs(BfParser* bfParser)
{
}
BF_EXPORT void BF_CALLTYPE BfParser_ClassifySource(BfParser* bfParser, BfSourceClassifier::CharData* charData, bool preserveFlags)

View file

@ -905,7 +905,6 @@ void BfPrinter::Visit(BfAstNode* bfAstNode)
spaceCount = 0;
spaceTriviaStart = -1;
}
}
if ((canUseTrivia) && (spaceCount > 1) && (spaceTriviaStart != -1))
@ -1018,7 +1017,6 @@ void BfPrinter::Visit(BfNewNode* newNode)
}
}
void BfPrinter::Visit(BfExpression* expr)
{
Visit(expr->ToBase());
@ -1335,7 +1333,6 @@ void BfPrinter::Visit(BfLiteralExpression* literalExpr)
}
}
if (isMultiLine)
{
int srcLineStart = 0;
@ -1594,7 +1591,6 @@ void BfPrinter::Visit(BfArrayTypeRef* arrayTypeRef)
{
if (auto tokenNode = BfNodeDynCast<BfTokenNode>(param))
{
}
else
{
@ -1612,7 +1608,6 @@ void BfPrinter::Visit(BfArrayTypeRef* arrayTypeRef)
_VisitElements(arrayTypeRef);
_VisitBrackets(arrayTypeRef);
}
void BfPrinter::Visit(BfGenericInstanceTypeRef* genericInstTypeRef)
@ -1957,7 +1952,6 @@ void BfPrinter::Visit(BfDeleteStatement* deleteStmt)
ExpectSpace();
VisitChild(deleteStmt->mExpression);
VisitChild(deleteStmt->mTrailingSemicolon);
}
@ -2112,7 +2106,6 @@ void BfPrinter::Visit(BfSwitchStatement* switchStmt)
VisitChild(switchStmt->mTrailingSemicolon);
}
void BfPrinter::Visit(BfTryStatement* tryStmt)
{
Visit(tryStmt->ToBase());
@ -2543,7 +2536,6 @@ void BfPrinter::Visit(BfDestructorDeclaration* dtorDeclaration)
FlushVisitChild();
}
void BfPrinter::QueueMethodDeclaration(BfMethodDeclaration* methodDeclaration)
{
if (methodDeclaration->mAttributes != NULL)
@ -2973,7 +2965,6 @@ void BfPrinter::Visit(BfTypeDeclaration* typeDeclaration)
{
if (auto enumEntryDecl = BfNodeDynCast<BfEnumEntryDeclaration>(defineBlock->GetFirst()))
{
}
else
{
@ -3222,5 +3213,4 @@ void BfPrinter::Visit(BfRootNode* rootNode)
void BfPrinter::Visit(BfInlineAsmStatement* asmStmt)
{
}

View file

@ -5,7 +5,6 @@
NS_BF_BEGIN
class BfPrinter : public BfElementVisitor
{
public:

View file

@ -224,7 +224,6 @@ void BfReducer::AddErrorNode(BfAstNode* astNode, bool removeNode)
astNode->RemoveSelf();
}
bool BfReducer::IsTypeReference(BfAstNode* checkNode, BfToken successToken, int endNode, int* retryNode, int* outEndNode, bool* couldBeExpr, bool* isGenericType, bool* isTuple)
{
AssertCurrentNode(checkNode);
@ -575,7 +574,6 @@ bool BfReducer::IsTypeReference(BfAstNode* checkNode, BfToken successToken, int
return false;
}
}
}
else if ((checkToken == BfToken_Const) && (chevronDepth > 0))
{
@ -911,7 +909,6 @@ bool BfReducer::IsTypeReference(BfAstNode* checkNode, BfToken successToken, int
else if (checkToken != BfToken_LBracket)
isDone = true;
if (isDone)
{
if (outEndNode != NULL)
@ -1063,7 +1060,6 @@ bool BfReducer::IsLocalMethod(BfAstNode* nameNode)
}
else
{
}
checkIdx++;
@ -1823,7 +1819,6 @@ BfExpression* BfReducer::CreateExpression(BfAstNode* node, CreateExprFlags creat
bool isLambdaBind = false;
bool isBoxing = false;
auto nextNode = mVisitorPos.GetNext();
if (auto nextTokenNode = BfNodeDynCast<BfTokenNode>(nextNode))
{
@ -2242,7 +2237,6 @@ BfExpression* BfReducer::CreateExpression(BfAstNode* node, CreateExprFlags creat
}
}
if (isCastExpr)
{
BfCastExpression* bfCastExpr = NULL;
@ -6992,7 +6986,6 @@ BfAstNode* BfReducer::ReadTypeMember(BfAstNode* node, bool declStarted, int dept
node = typeRef;
auto nextNode = mVisitorPos.GetNext();
if (auto tokenNode = BfNodeDynCast<BfTokenNode>(nextNode))
{
@ -8017,7 +8010,6 @@ BfAstNode* BfReducer::CreateAllocNode(BfTokenNode* allocToken)
MEMBER_SET(newNode, mAllocNode, identifier);
mVisitorPos.MoveNext();
}
}
}
@ -8822,8 +8814,6 @@ BfAstNode* BfReducer::CreateTopLevelObject(BfTokenNode* tokenNode, BfAttributeDi
//MEMBER_SET(methodDecl, mReturnType, retType);
return typeDeclaration;
}
break;

View file

@ -281,7 +281,6 @@ BfType::BfType()
//mLastUsedRevision = -1;
mDefineState = BfTypeDefineState_Undefined;
//mDICallbackVH = NULL;
//mInnerDICallbackVH = NULL;
@ -535,7 +534,6 @@ BfPropertyRef::operator BfPropertyDef*() const
return mTypeInstance->mTypeDef->mProperties[mPropIdx];
}
//////////////////////////////////////////////////////////////////////////
/*BfMethodInstance* BfTypeInstance::GetVTableMethodInstance(int vtableIdx)
@ -1560,7 +1558,6 @@ bool BfMethodInstance::IsExactMatch(BfMethodInstance* other, bool ignoreImplicit
if (HasExplicitThis())
{
}
// if (other->HasExplicitThis())
@ -3072,7 +3069,6 @@ BfCustomAttribute* BfCustomAttributes::Get(int idx)
BfResolvedTypeSet::~BfResolvedTypeSet()
{
}
#define HASH_MIX(origHashVal, newHashVal) ((((origHashVal) << 5) - (origHashVal)) ^ (newHashVal))
@ -5255,7 +5251,6 @@ void BfHotMethod::Clear(bool keepDupMethods)
}
mReferences.Clear();
}
}
BfHotMethod::~BfHotMethod()

View file

@ -337,7 +337,6 @@ public:
}
};
class BfHotDevirtualizedMethod : public BfHotDepData
{
public:
@ -1909,7 +1908,6 @@ public:
}
};
class BfGenericExtensionEntry
{
public:
@ -2476,7 +2474,6 @@ public:
//virtual BfType* GetUnderlyingType() override { return mOwner; }
};
class BfRefType : public BfType
{
public:
@ -2668,7 +2665,6 @@ public:
class BfResolvedTypeSetFuncs : public MultiHashSetFuncs
{
};
class BfResolvedTypeSet : public MultiHashSet<BfType*, BfResolvedTypeSetFuncs>

View file

@ -140,7 +140,6 @@ void BfSourceClassifier::HandleLeafNode(BfAstNode* node)
void BfSourceClassifier::Visit(BfAstNode* node)
{
}
void BfSourceClassifier::Visit(BfErrorNode* errorNode)

View file

@ -2027,7 +2027,6 @@ BfLocalVariable* BfModule::HandleVariableDeclaration(BfVariableDeclaration* varD
if ((type->IsVar()) || (type->IsLet()))
{
}
if (isRef)
@ -3075,7 +3074,6 @@ BfTypedValue BfModule::HandleCaseBind(BfTypedValue enumVal, const BfTypedValue&
{
type = ResolveTypeRef(typeRef);
}
}
targetNode = memberExpr->mTarget;
@ -3525,7 +3523,6 @@ void BfModule::VisitCodeBlock(BfBlock* block)
continue;
}
if ((mCurMethodState != NULL) && (mCurMethodState->mLeftBlockUncond)) // mLeftBlock is cleared after conditional block is completed
{
if (mCurMethodState->mHadReturn)
@ -3710,7 +3707,6 @@ void BfModule::Visit(BfTypeReference* typeRef)
void BfModule::Visit(BfEmptyStatement* astNode)
{
}
void BfModule::Visit(BfTryStatement* tryStmt)
@ -3898,7 +3894,6 @@ void BfModule::DoIfStatement(BfIfStatement* ifStmt, bool includeTrueStmt, bool i
}
if ((!mCurMethodState->mLeftBlockUncond) && (!ignoredLastBlock))
{
if (IsTargetingBeefBackend())
{
// If we don't do this, then with:
@ -4150,7 +4145,6 @@ void BfModule::Visit(BfDeleteStatement* deleteStmt)
bool mayBeSentinel = false;
if (checkType->IsPointer())
{
auto innerType = checkType->GetUnderlyingType();
@ -5802,7 +5796,6 @@ void BfModule::Visit(BfRepeatStatement* repeatStmt)
mBfIRBuilder->AddBlock(endBB);
mBfIRBuilder->SetInsertPoint(endBB);
}
}
RestoreScopeState();
@ -6092,7 +6085,6 @@ void BfModule::DoForLess(BfForEachStatement* forEachStmt)
if (varType == NULL)
varType = GetPrimitiveType(BfTypeCode_IntPtr);
BfDeferredLocalAssignData deferredLocalAssignData(mCurMethodState->mCurScope);
deferredLocalAssignData.mIsIfCondition = true;
deferredLocalAssignData.ExtendFrom(mCurMethodState->mDeferredLocalAssignData, true);
@ -6163,7 +6155,6 @@ void BfModule::DoForLess(BfForEachStatement* forEachStmt)
// We may have a call in the loop body
mCurMethodState->mMayNeedThisAccessCheck = true;
// Cond
auto valueScopeStart = ValueScopeStart();
auto localVal = mBfIRBuilder->CreateAlignedLoad(localDef->mAddr, localDef->mResolvedType->mAlign);
@ -6450,7 +6441,6 @@ void BfModule::Visit(BfForEachStatement* forEachStmt)
if (varType->IsPointer())
varType = CreateRefType(varType->GetUnderlyingType());
}
}
}
};
@ -6556,7 +6546,6 @@ void BfModule::Visit(BfForEachStatement* forEachStmt)
Array<_TupleBind> tupleBinds;
if (forEachStmt->mVariableName != NULL)
{
if (auto tupleExpr = BfNodeDynCast<BfTupleExpression>(forEachStmt->mVariableName))

View file

@ -1510,7 +1510,6 @@ BfError* BfPassInstance::FailAt(const StringImpl& error, BfSourceData* bfSource,
return errorVal;
}
void BfPassInstance::FixSrcStartAndEnd(BfSourceData* bfSource, int& startIdx, int& endIdx)
{
auto bfParser = bfSource->ToParserData();
@ -2428,7 +2427,6 @@ BfTypeReference* BfSystem::GetTypeRefElement(BfTypeReference* typeRef)
return (BfTypeReference*)typeRef;
}
void BfSystem::AddNamespaceUsage(const BfAtomComposite& namespaceStr, BfProject* bfProject)
{
if (namespaceStr.IsEmpty())
@ -4250,7 +4248,6 @@ BF_EXPORT void BF_CALLTYPE BfSystem_ReportMemory(BfSystem* bfSystem)
MemReporter memReporter;
for (auto compiler : bfSystem->mCompilers)
{
AutoMemReporter autoMemReporter(&memReporter, "Compiler");
@ -4297,7 +4294,6 @@ BF_EXPORT void BF_CALLTYPE BfSystem_DbgPrintTimings()
gPerfManager->DbgPrint();
}
BF_EXPORT const char* BF_CALLTYPE BfSystem_GetNamespaceSearch(BfSystem* bfSystem, const char* typeName, BfProject* project)
{
auto typeDef = bfSystem->FindTypeDef(typeName, project);
@ -4702,5 +4698,3 @@ BF_EXPORT void BF_CALLTYPE BfSystem_Log(BfSystem* bfSystem, char* str)
BfLogSys(bfSystem, str);
BfLogSys(bfSystem, "\n");
}

View file

@ -524,7 +524,6 @@ struct BfCodeGenOptions
}
};
enum BfParamKind : uint8
{
BfParamKind_Normal,
@ -1635,7 +1634,6 @@ enum BfOptionFlags
BfOptionFlags_Reflect_MethodMask = BfOptionFlags_ReflectStaticMethods | BfOptionFlags_ReflectNonStaticMethods | BfOptionFlags_ReflectConstructors,
BfOptionFlags_Mask = 0x3FFF
};
enum BfFieldFlags
@ -1855,7 +1853,6 @@ public:
BfTypeDef* GetCombinedPartial(BfTypeDef* typeDef);
BfTypeDef* GetOuterTypeNonPartial(BfTypeDef* typeDef);
int GetGenericParamIdx(const Array<BfGenericParamDef*>& genericParams, const StringImpl& name);
int GetGenericParamIdx(const Array<BfGenericParamDef*>& genericParams, BfTypeReference* typeRef);
@ -1921,7 +1918,6 @@ public:
}
};
#ifdef _DEBUG
#ifdef BF_PLATFORM_WINDOWS
@ -1959,7 +1955,6 @@ public:
#define BfLogX(logIdx, fmt, ...) {} // Nothing
#endif
#ifdef BF_WANTS_LOG_SYS
#define BfLogSys(sys, fmt, ...) DoBfLog((sys)->mIsResolveOnly ? 1 : 2, fmt, ##__VA_ARGS__)
#define BfLogSysM(fmt, ...) DoBfLog(mSystem->mIsResolveOnly ? 1 : 2, fmt, ##__VA_ARGS__)
@ -2035,7 +2030,6 @@ namespace std
};
}
namespace std
{
template<>

View file

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

View file

@ -267,7 +267,6 @@ inline int64_t DecodeSLEB128(const uint8*& p)
curByte = (uint8_t)*p++;
value |= ((curByte & 0x7f) << shift);
shift += 7;
} while (curByte >= 128);
// Sign extend negative numbers.
if (((curByte & 0x40) != 0) && (shift < 64))

View file

@ -17,5 +17,4 @@ public:
virtual void Visit(BfVariableDeclaration* binOpExpr) override;
};
NS_BF_END

View file

@ -60,7 +60,6 @@ CePendingExpr::~CePendingExpr()
//////////////////////////////////////////////////////////////////////////
CeEvaluationContext::CeEvaluationContext(CeDebugger* winDebugger, const StringImpl& expr, CeFormatInfo* formatInfo, BfTypedValue contextValue)
{
Init(winDebugger, expr, formatInfo, contextValue);
@ -451,7 +450,6 @@ bool CeDebugger::CheckConditionalBreakpoint(CeBreakpoint* breakpoint)
{
if (!error->mIsWarning)
errorStr = error->mError;
}
String condError = StrFormat("error Conditional breakpoint expression '%s' failed: %s", conditional->mExpr.c_str(), errorStr.c_str());
mDebugManager->mOutMessages.push_back(condError);
@ -572,7 +570,6 @@ void CeDebugger::CheckBreakpoint(Breakpoint* breakpoint)
void CeDebugger::HotBindBreakpoint(Breakpoint* breakpoint, int lineNum, int hotIdx)
{
}
int64 CeDebugger::ValueToInt(addr_ce addr, BfType* type)
@ -727,7 +724,6 @@ void CeDebugger::BreakAll()
{
mCeMachine->mSpecialCheck = true;
mCeMachine->mDbgWantBreak = true;
}
bool CeDebugger::TryRunContinue()
@ -1466,7 +1462,6 @@ CeDbgTypeInfo* CeDebugger::GetDbgTypeInfo(int typeId)
}
}
}
}
return dbgTypeInfo;
}
@ -1514,7 +1509,6 @@ static String IntTypeToString(T val, const StringImpl& name, DwDisplayInfo* disp
binary = "'" + binary;
binary = ((val & ((T)1 << i)) ? "1" : "0") + binary;
}
return StrFormat("0b'%s\n%s", binary.c_str(), name.c_str());
}
@ -3132,7 +3126,6 @@ String CeDebugger::TypedValueToString(const BfTypedValue& origTypedValue, const
retVal += ", refid=" + MaybeQuoteFormatInfoParam(formatInfo.mReferenceId);
retVal += StrFormat(", this=%d@0x%X", innerType->mTypeId, ptrVal);
}
retVal += "\n:canEdit\n:editVal\t" + EncodeDataPtr((uint32)addr, true);
@ -4626,7 +4619,6 @@ String CeDebugger::GetStackFrameInfo(int stackFrameIdx, intptr* addr, String* ou
}
}
CeDbgScope* ceScope = NULL;
if (dbgCallstackInfo.mScopeIdx != -1)
ceScope = &ceFunction->mDbgScopes[dbgCallstackInfo.mScopeIdx];

View file

@ -439,7 +439,6 @@ int CeFunction::SafeGetId()
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
}
return 0;
#else
@ -4405,7 +4404,6 @@ bool CeContext::WriteConstant(BfModule* module, addr_ce addr, BfConstant* consta
return false;
}
#define CE_CREATECONST_CHECKPTR(PTR, SIZE) \
if ((((uint8*)(PTR) - memStart) - 0x10000) + (SIZE) > (memSize - 0x10000)) \
{ \
@ -4798,7 +4796,6 @@ BfIRValue CeContext::CreateAttribute(BfAstNode* targetSrc, BfModule* module, BfI
return ceAttrVal;
}
BfTypedValue CeContext::Call(CeCallSource callSource, BfModule* module, BfMethodInstance* methodInstance, const BfSizedArray<BfIRValue>& args, CeEvalFlags flags, BfType* expectingType)
{
// DISABLED
@ -5578,7 +5575,6 @@ bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8*
mCeMachine->mDbgPaused = true;
}
mCeMachine->mDebugEvent.WaitFor();
CePendingExpr* pendingExpr = NULL;
@ -7337,7 +7333,6 @@ bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8*
CeSetAddrVal(&result, valueAddr, ptrSize);
else
CeSetAddrVal(&result, 0, ptrSize);
}
}
break;
@ -8724,7 +8719,6 @@ CeMachine::CeMachine(BfCompiler* compiler)
BfLogSys(mCompiler->mSystem, "CeMachine::CeMachine %p\n", this);
}
CeMachine::~CeMachine()
{
BF_ASSERT(mDebugger == NULL);
@ -9032,7 +9026,6 @@ CeErrorKind CeMachine::WriteConstant(CeConstStructData& data, BeConstant* constV
// return CeErrorKind_GlobalVariable;
}
BF_ASSERT(!data.mQueueFixups);
CeConstStructData gvData;
@ -9667,7 +9660,6 @@ CeFunction* CeMachine::GetFunction(BfMethodInstance* methodInstance, BfIRValue f
MapFunctionId(ceFunction);
}
return ceFunction;
}
@ -9836,5 +9828,3 @@ BfTypedValue CeMachine::Call(CeCallSource callSource, BfModule* module, BfMethod
ReleaseContext(ceContext);
return result;
}

View file

@ -123,7 +123,6 @@ public:
void EndSection();
void Report();
template <typename T>
void AddBumpAlloc(const StringView& name, const T& alloc)
{

View file

@ -109,7 +109,6 @@ DebugManager::~DebugManager()
delete mDebugger32;
/*for (auto stepFilter : mStepFilters)
{
}*/
delete mDebugVisualizers;
}
@ -144,7 +143,6 @@ void DebugManager::SetSourceServerCacheDir()
#endif
}
//#define CAPTURE_ALLOC_BACKTRACE
//#define CAPTURE_ALLOC_SOURCES
@ -206,10 +204,8 @@ static void RemoveAllocEntry(long lRequest)
}
}
//const LOC_HASHES
#endif
static int gBfNumAllocs = 0;
@ -317,7 +313,6 @@ static int BfAllocHook(int nAllocType, void *pvData,
if ((captureAllocLoc->mIsEndpoint) && (foundSym))
{
}
gHashCaptureAllocSize[hashVal] = captureAllocLoc;
@ -330,7 +325,6 @@ static int BfAllocHook(int nAllocType, void *pvData,
continue;
}
captureAllocLoc->mTotalSize += (int)nSize;
CaptureAllocEntry entry;
@ -433,7 +427,6 @@ static int BfAllocHook(int nAllocType, void *pvData,
#endif //BF_PLATFORM_WINDOWS
void BfReportMemory()
{
BfLogDbg("Used: %.2fM NumAllocs: %d Allocs: %.2fM\n", (gBfAllocCount - gBfFreeCount) / (1024.0 * 1024.0), gBfNumAllocs, gBfAllocCount / (1024.0 * 1024.0));
@ -592,8 +585,6 @@ BOOL WINAPI DllMain(
DWORD dwReason,
LPVOID lpreserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
BpInit("127.0.0.1", "Beef IDE");
@ -672,7 +663,6 @@ BF_EXPORT void BF_CALLTYPE Debugger_Create()
BF_EXPORT void BF_CALLTYPE Debugger_SetCallbacks(void* callback)
{
}
BF_EXPORT void BF_CALLTYPE Debugger_FullReportMemory()
@ -834,7 +824,6 @@ BF_EXPORT void BF_CALLTYPE Debugger_SetSymSrvOptions(const char* symCacheDir, co
}
gDebugManager->SetSourceServerCacheDir();
}
BF_EXPORT bool BF_CALLTYPE Debugger_OpenMiniDump(const char* fileName)
@ -848,7 +837,6 @@ BF_EXPORT bool BF_CALLTYPE Debugger_OpenMiniDump(const char* fileName)
return false;
}
if (dbgMiniDump->GetTargetBitCount() == 32)
gDebugger = CreateDebugger32(gDebugManager, dbgMiniDump);
else
@ -1317,12 +1305,10 @@ BF_EXPORT const char* BF_CALLTYPE Debugger_GetCollectionContinuation(const char*
return outString.c_str();
}
BF_EXPORT void BF_CALLTYPE Debugger_ForegroundTarget()
{
gDebugger->ForegroundTarget();
//BOOL worked = EnumThreadWindows(gDebugger->mProcessInfo.dwThreadId, WdEnumWindowsProc, 0);
//BF_ASSERT(worked);
}
@ -1570,7 +1556,6 @@ BF_EXPORT void BF_CALLTYPE Debugger_InitiateHotResolve(int flags)
gDebugger->InitiateHotResolve((DbgHotResolveFlags)flags);
}
BF_EXPORT intptr BF_CALLTYPE Debugger_GetDbgAllocHeapSize()
{
AutoCrit autoCrit(gDebugManager->mCritSect);

View file

@ -394,7 +394,6 @@ bool DebugVisualizers::Load(const StringImpl& fileNamesStr)
return success;
}
DebugVisualizerEntry* DebugVisualizers::FindEntryForType(const StringImpl& typeName, DbgFlavor wantFlavor, Array<String>* wildcardCaptures)
{
//TODO: Do smarter name matching. Right now we just compare up to the '*'

View file

@ -62,7 +62,6 @@ public:
virtual bool IsMemoryBreakpointBound() = 0;
};
enum DbgTypeKindFlags
{
DbgTypeKindFlag_None = 0,
@ -204,7 +203,6 @@ class DbgModuleMemoryCache
{
public:
public:
uintptr mAddr;
int mSize;

View file

@ -402,7 +402,6 @@ void NetRequest::Perform()
void NetRequest::Cleanup()
{
}
#else
@ -414,7 +413,6 @@ void NetRequest::Perform()
void NetRequest::Cleanup()
{
}
#endif
@ -464,7 +462,6 @@ void NetRequest::ShowTracking()
void NetManagerThread()
{
}
NetManager::NetManager() : mThreadPool(8, 1*1024*1024)

View file

@ -138,4 +138,3 @@ public:
};
NS_BF_DBG_END

View file

@ -197,5 +197,4 @@ public:
}
};
NS_BF_DBG_END

View file

@ -148,7 +148,6 @@ public:
#define defer const auto& CONCAT(defer__, __LINE__) = ExitScopeHelp() + [&]()
// COM objects for the ridiculous Microsoft craziness.
struct DECLSPEC_UUID("B41463C3-8866-43B5-BC33-2B0676F7F42E") DECLSPEC_NOVTABLE ISetupInstance : public IUnknown
@ -178,7 +177,6 @@ struct DECLSPEC_UUID("42843719-DB4C-46C2-8E7C-64F1816EFD5B") DECLSPEC_NOVTABLE I
STDMETHOD(GetInstanceForPath)(_In_z_ LPCWSTR wzPath, _Out_ ISetupInstance** ppInstance) = 0;
};
// The beginning of the actual code that does things.
struct Version_Data {
@ -224,7 +222,6 @@ wchar_t *concat(wchar_t *a, wchar_t *b, wchar_t *c = nullptr, wchar_t *d = nullp
typedef void(*Visit_Proc_W)(wchar_t *short_name, wchar_t *full_name, Version_Data *data);
bool visit_files_w(wchar_t *dir_name, Version_Data *data, Visit_Proc_W proc) {
// Visit everything in one folder (non-recursively). If it's a directory
// that doesn't start with ".", call the visit proc on it. The visit proc
// will see if the filename conforms to the expected versioning pattern.
@ -253,7 +250,6 @@ bool visit_files_w(wchar_t *dir_name, Version_Data *data, Visit_Proc_W proc) {
return true;
}
wchar_t *find_windows_kit_root(HKEY key, wchar_t *version) {
// Given a key to an already opened registry entry,
// get the value stored under the 'version' subkey.
@ -386,7 +382,6 @@ void find_windows_kit_root(Find_Result *result) {
// If we get here, we failed to find anything.
}
void find_visual_studio_by_fighting_through_microsoft_craziness(Find_Result *result) {
// The name of this procedure is kind of cryptic. Its purpose is
// to fight through Microsoft craziness. The things that the fine
@ -562,7 +557,6 @@ void find_visual_studio_by_fighting_through_microsoft_craziness(Find_Result *res
// If we get here, we failed to find anything.
}
Find_Result find_visual_studio_and_windows_sdk() {
Find_Result result;

View file

@ -939,7 +939,6 @@ void X64CPU::GetNextPC(uint64 baseAddress, const uint8* dataBase, int dataLength
mDisAsm->CommentStream = &nulls();
ArrayRef<uint8_t> dataArrayRef(dataPtr, dataLength - (dataPtr - dataBase));
MCDisassembler::DecodeStatus S = mDisAsm->getInstruction(mcInst, size, dataArrayRef, address, nulls());
}
bool X64CPU::IsReturnInstruction(X64Instr* inst)

View file

@ -476,7 +476,6 @@ public:
bool PartialSimulate(Debugger* debugger, X64CPURegisters* registers);
};
class X64CPU
{
public:

View file

@ -535,7 +535,6 @@ void X86CPU::GetNextPC(uint32 baseAddress, const uint8* dataBase, int dataLength
mDisAsm->CommentStream = &nulls();
ArrayRef<uint8_t> dataArrayRef(dataPtr, dataLength - (dataPtr - dataBase));
MCDisassembler::DecodeStatus S = mDisAsm->getInstruction(mcInst, size, dataArrayRef, address, nulls());
}
bool X86CPU::IsReturnInstruction(X86Instr* inst)