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 NS_BF_BEGIN
#define PE_SIZEOF_SHORT_NAME 8 #define PE_SIZEOF_SHORT_NAME 8
#define PE_DIRECTORY_ENTRY_EXPORT 0 // Export Directory #define PE_DIRECTORY_ENTRY_EXPORT 0 // Export Directory
#define PE_NUMBEROF_DIRECTORY_ENTRIES 16 #define PE_NUMBEROF_DIRECTORY_ENTRIES 16
@ -17,7 +16,6 @@ NS_BF_BEGIN
#define PE_MACHINE_X86 0x14c #define PE_MACHINE_X86 0x14c
#define PE_MACHINE_X64 0x8664 #define PE_MACHINE_X64 0x8664
// DOS .EXE header // DOS .EXE header
struct PEHeader struct PEHeader
{ {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -731,7 +731,6 @@ int64 BfIRCodeGen::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))
@ -1355,7 +1354,6 @@ llvm::Type* BfIRCodeGen::GetElemType(llvm::Value* value)
return NULL; return NULL;
} }
bool BfIRCodeGen::TryMemCpy(llvm::Value* ptr, llvm::Value* val) bool BfIRCodeGen::TryMemCpy(llvm::Value* ptr, llvm::Value* val)
{ {
auto valType = val->getType(); auto valType = val->getType();
@ -1776,7 +1774,6 @@ void BfIRCodeGen::InitTarget()
Options, relocModel, cmModel, optLvl); Options, relocModel, cmModel, optLvl);
mLLVMModule->setDataLayout(mLLVMTargetMachine->createDataLayout()); mLLVMModule->setDataLayout(mLLVMTargetMachine->createDataLayout());
} }
void BfIRCodeGen::HandleNextCmd() void BfIRCodeGen::HandleNextCmd()
@ -5360,7 +5357,6 @@ static void PopulateModulePassManager(llvm::legacy::PassManagerBase &MPM, const
} }
} }
namespace namespace
{ {
struct BfPass : public llvm::MachineFunctionPass struct BfPass : public llvm::MachineFunctionPass

View file

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

View file

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

View file

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

View file

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

View file

@ -1,6 +1,5 @@
#pragma warning(disable:4996) #pragma warning(disable:4996)
#include "BfParser.h" #include "BfParser.h"
#include "BfReducer.h" #include "BfReducer.h"
#include "BfPrinter.h" #include "BfPrinter.h"
@ -182,7 +181,6 @@ static int DecodeInt(uint8* buf, int& idx)
curByte = buf[idx++]; curByte = buf[idx++];
value |= ((curByte & 0x7f) << shift); value |= ((curByte & 0x7f) << shift);
shift += 7; shift += 7;
} while (curByte >= 128); } while (curByte >= 128);
// Sign extend negative numbers. // Sign extend negative numbers.
if (((curByte & 0x40) != 0) && (shift < 64)) if (((curByte & 0x40) != 0) && (shift < 64))
@ -397,7 +395,6 @@ BfParser::BfParser(BfSystem* bfSystem, BfProject* bfProject) : BfSource(bfSystem
} }
} }
//static std::set<BfAstNode*> gFoundNodes; //static std::set<BfAstNode*> gFoundNodes;
BfParser::~BfParser() BfParser::~BfParser()
@ -406,7 +403,6 @@ BfParser::~BfParser()
if (mParserData == NULL) if (mParserData == NULL)
{ {
} }
else if (mParserData->mRefCount == -1) else if (mParserData->mRefCount == -1)
{ {
@ -925,12 +921,10 @@ MaybeBool BfParser::HandleProcessorCondition(BfBlock* paramNode)
void BfParser::HandleInclude(BfAstNode* paramNode) void BfParser::HandleInclude(BfAstNode* paramNode)
{ {
} }
void BfParser::HandleIncludeNext(BfAstNode* paramNode) void BfParser::HandleIncludeNext(BfAstNode* paramNode)
{ {
} }
bool BfParser::HandlePreprocessor() bool BfParser::HandlePreprocessor()
@ -1370,7 +1364,6 @@ struct StrHashT<4>
{ {
const static int HASH = (StrHashT<3>::HASH) ^ Str[4]; const static int HASH = (StrHashT<3>::HASH) ^ Str[4];
}; };
}; };
// This is little endian only // This is little endian only
@ -3763,7 +3756,6 @@ void BfParser::HadSrcRealloc()
mParserData->mJumpTable = mJumpTable; mParserData->mJumpTable = mJumpTable;
mParserData->mJumpTableSize = mJumpTableSize; mParserData->mJumpTableSize = mJumpTableSize;
} }
} }
void BfParser::GenerateAutoCompleteFrom(int srcPosition) 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_RemoveDefs(BfParser* bfParser)
{ {
} }
BF_EXPORT void BF_CALLTYPE BfParser_ClassifySource(BfParser* bfParser, BfSourceClassifier::CharData* charData, bool preserveFlags) 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; spaceCount = 0;
spaceTriviaStart = -1; spaceTriviaStart = -1;
} }
} }
if ((canUseTrivia) && (spaceCount > 1) && (spaceTriviaStart != -1)) if ((canUseTrivia) && (spaceCount > 1) && (spaceTriviaStart != -1))
@ -1018,7 +1017,6 @@ void BfPrinter::Visit(BfNewNode* newNode)
} }
} }
void BfPrinter::Visit(BfExpression* expr) void BfPrinter::Visit(BfExpression* expr)
{ {
Visit(expr->ToBase()); Visit(expr->ToBase());
@ -1335,7 +1333,6 @@ void BfPrinter::Visit(BfLiteralExpression* literalExpr)
} }
} }
if (isMultiLine) if (isMultiLine)
{ {
int srcLineStart = 0; int srcLineStart = 0;
@ -1594,7 +1591,6 @@ void BfPrinter::Visit(BfArrayTypeRef* arrayTypeRef)
{ {
if (auto tokenNode = BfNodeDynCast<BfTokenNode>(param)) if (auto tokenNode = BfNodeDynCast<BfTokenNode>(param))
{ {
} }
else else
{ {
@ -1612,7 +1608,6 @@ void BfPrinter::Visit(BfArrayTypeRef* arrayTypeRef)
_VisitElements(arrayTypeRef); _VisitElements(arrayTypeRef);
_VisitBrackets(arrayTypeRef); _VisitBrackets(arrayTypeRef);
} }
void BfPrinter::Visit(BfGenericInstanceTypeRef* genericInstTypeRef) void BfPrinter::Visit(BfGenericInstanceTypeRef* genericInstTypeRef)
@ -1957,7 +1952,6 @@ void BfPrinter::Visit(BfDeleteStatement* deleteStmt)
ExpectSpace(); ExpectSpace();
VisitChild(deleteStmt->mExpression); VisitChild(deleteStmt->mExpression);
VisitChild(deleteStmt->mTrailingSemicolon); VisitChild(deleteStmt->mTrailingSemicolon);
} }
@ -2112,7 +2106,6 @@ void BfPrinter::Visit(BfSwitchStatement* switchStmt)
VisitChild(switchStmt->mTrailingSemicolon); VisitChild(switchStmt->mTrailingSemicolon);
} }
void BfPrinter::Visit(BfTryStatement* tryStmt) void BfPrinter::Visit(BfTryStatement* tryStmt)
{ {
Visit(tryStmt->ToBase()); Visit(tryStmt->ToBase());
@ -2543,7 +2536,6 @@ void BfPrinter::Visit(BfDestructorDeclaration* dtorDeclaration)
FlushVisitChild(); FlushVisitChild();
} }
void BfPrinter::QueueMethodDeclaration(BfMethodDeclaration* methodDeclaration) void BfPrinter::QueueMethodDeclaration(BfMethodDeclaration* methodDeclaration)
{ {
if (methodDeclaration->mAttributes != NULL) if (methodDeclaration->mAttributes != NULL)
@ -2973,7 +2965,6 @@ void BfPrinter::Visit(BfTypeDeclaration* typeDeclaration)
{ {
if (auto enumEntryDecl = BfNodeDynCast<BfEnumEntryDeclaration>(defineBlock->GetFirst())) if (auto enumEntryDecl = BfNodeDynCast<BfEnumEntryDeclaration>(defineBlock->GetFirst()))
{ {
} }
else else
{ {
@ -3222,5 +3213,4 @@ void BfPrinter::Visit(BfRootNode* rootNode)
void BfPrinter::Visit(BfInlineAsmStatement* asmStmt) void BfPrinter::Visit(BfInlineAsmStatement* asmStmt)
{ {
} }

View file

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

View file

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

View file

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

View file

@ -337,7 +337,6 @@ public:
} }
}; };
class BfHotDevirtualizedMethod : public BfHotDepData class BfHotDevirtualizedMethod : public BfHotDepData
{ {
public: public:
@ -1909,7 +1908,6 @@ public:
} }
}; };
class BfGenericExtensionEntry class BfGenericExtensionEntry
{ {
public: public:
@ -2476,7 +2474,6 @@ public:
//virtual BfType* GetUnderlyingType() override { return mOwner; } //virtual BfType* GetUnderlyingType() override { return mOwner; }
}; };
class BfRefType : public BfType class BfRefType : public BfType
{ {
public: public:
@ -2668,7 +2665,6 @@ public:
class BfResolvedTypeSetFuncs : public MultiHashSetFuncs class BfResolvedTypeSetFuncs : public MultiHashSetFuncs
{ {
}; };
class BfResolvedTypeSet : public MultiHashSet<BfType*, BfResolvedTypeSetFuncs> 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(BfAstNode* node)
{ {
} }
void BfSourceClassifier::Visit(BfErrorNode* errorNode) void BfSourceClassifier::Visit(BfErrorNode* errorNode)

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -148,7 +148,6 @@ public:
#define defer const auto& CONCAT(defer__, __LINE__) = ExitScopeHelp() + [&]() #define defer const auto& CONCAT(defer__, __LINE__) = ExitScopeHelp() + [&]()
// COM objects for the ridiculous Microsoft craziness. // COM objects for the ridiculous Microsoft craziness.
struct DECLSPEC_UUID("B41463C3-8866-43B5-BC33-2B0676F7F42E") DECLSPEC_NOVTABLE ISetupInstance : public IUnknown 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; STDMETHOD(GetInstanceForPath)(_In_z_ LPCWSTR wzPath, _Out_ ISetupInstance** ppInstance) = 0;
}; };
// The beginning of the actual code that does things. // The beginning of the actual code that does things.
struct Version_Data { 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); 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) { 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 // 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 // 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. // 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; return true;
} }
wchar_t *find_windows_kit_root(HKEY key, wchar_t *version) { wchar_t *find_windows_kit_root(HKEY key, wchar_t *version) {
// Given a key to an already opened registry entry, // Given a key to an already opened registry entry,
// get the value stored under the 'version' subkey. // 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. // If we get here, we failed to find anything.
} }
void find_visual_studio_by_fighting_through_microsoft_craziness(Find_Result *result) { void find_visual_studio_by_fighting_through_microsoft_craziness(Find_Result *result) {
// The name of this procedure is kind of cryptic. Its purpose is // The name of this procedure is kind of cryptic. Its purpose is
// to fight through Microsoft craziness. The things that the fine // 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. // If we get here, we failed to find anything.
} }
Find_Result find_visual_studio_and_windows_sdk() { Find_Result find_visual_studio_and_windows_sdk() {
Find_Result result; Find_Result result;

View file

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

View file

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

View file

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