mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Fixed enums in debugger, reformatting of operator constraints
This commit is contained in:
parent
533ef0856b
commit
7b8251c311
11 changed files with 65 additions and 22 deletions
|
@ -17981,3 +17981,4 @@ void BfExprEvaluator::Visit(BfBinaryOperatorExpression* binOpExpr)
|
|||
|
||||
PerformBinaryOperation(binOpExpr->mLeft, binOpExpr->mRight, binOpExpr->mOp, binOpExpr->mOpToken, BfBinOpFlag_None);
|
||||
}
|
||||
//
|
|
@ -593,6 +593,7 @@ enum BfIRAttribute
|
|||
BFIRAttribute_NoFramePointerElim,
|
||||
BFIRAttribute_DllImport,
|
||||
BFIRAttribute_DllExport,
|
||||
BFIRAttribute_NoRecurse
|
||||
};
|
||||
|
||||
struct BfIRFunctionType
|
||||
|
|
|
@ -201,6 +201,7 @@ static llvm::Attribute::AttrKind LLVMMapAttribute(BfIRAttribute attr)
|
|||
case BFIRAttribute_NoUnwind: return llvm::Attribute::NoUnwind;
|
||||
case BFIRAttribute_UWTable: return llvm::Attribute::UWTable;
|
||||
case BFIRAttribute_AlwaysInline: return llvm::Attribute::AlwaysInline;
|
||||
case BFIRAttribute_NoRecurse: return llvm::Attribute::NoRecurse;
|
||||
default: break;
|
||||
}
|
||||
return llvm::Attribute::None;
|
||||
|
|
|
@ -13877,7 +13877,9 @@ void BfModule::SetupIRMethod(BfMethodInstance* methodInstance, BfIRFunction func
|
|||
mBfIRBuilder->SetFuncCallingConv(func, callingConv);
|
||||
|
||||
if (isInlined)
|
||||
mBfIRBuilder->Func_AddAttribute(func, -1, BFIRAttribute_AlwaysInline);
|
||||
{
|
||||
mBfIRBuilder->Func_AddAttribute(func, -1, BFIRAttribute_AlwaysInline);
|
||||
}
|
||||
|
||||
int argIdx = 0;
|
||||
int paramIdx = 0;
|
||||
|
|
|
@ -7895,7 +7895,7 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
|
|||
}
|
||||
|
||||
// * -> Valueless
|
||||
if (toType->IsValuelessType())
|
||||
if (toType->IsVoid())
|
||||
return mBfIRBuilder->GetFakeVal();
|
||||
|
||||
// void* -> intptr
|
||||
|
@ -9284,10 +9284,10 @@ BfTypedValue BfModule::Cast(BfAstNode* srcNode, const BfTypedValue& typedVal, Bf
|
|||
}
|
||||
}
|
||||
|
||||
if ((explicitCast) && (toType->IsValuelessType()))
|
||||
/*if ((explicitCast) && (toType->IsValuelessType()))
|
||||
{
|
||||
return BfTypedValue(mBfIRBuilder->GetFakeVal(), toType);
|
||||
}
|
||||
}*/
|
||||
|
||||
BfCastResultFlags castResultFlags = BfCastResultFlags_None;
|
||||
auto castedValue = CastToValue(srcNode, typedVal, toType, castFlags, &castResultFlags);
|
||||
|
|
|
@ -742,6 +742,19 @@ void BfPrinter::Visit(BfGenericParamsDeclaration* genericParams)
|
|||
VisitChild(genericParams->mCloseChevron);
|
||||
}
|
||||
|
||||
void BfPrinter::Visit(BfGenericOperatorConstraint* genericConstraints)
|
||||
{
|
||||
Visit(genericConstraints->ToBase());
|
||||
|
||||
VisitChild(genericConstraints->mOperatorToken);
|
||||
ExpectSpace();
|
||||
VisitChild(genericConstraints->mLeftType);
|
||||
ExpectSpace();
|
||||
VisitChild(genericConstraints->mOpToken);
|
||||
ExpectSpace();
|
||||
VisitChild(genericConstraints->mRightType);
|
||||
}
|
||||
|
||||
void BfPrinter::Visit(BfGenericConstraintsDeclaration* genericConstraints)
|
||||
{
|
||||
Visit(genericConstraints->ToBase());
|
||||
|
@ -1946,6 +1959,12 @@ void BfPrinter::QueueMethodDeclaration(BfMethodDeclaration* methodDeclaration)
|
|||
QueueVisitChild(methodDeclaration->mExplicitInterface);
|
||||
QueueVisitChild(methodDeclaration->mExplicitInterfaceDotToken);
|
||||
QueueVisitChild(methodDeclaration->mNameNode);
|
||||
|
||||
if (auto operatorDecl = BfNodeDynCast<BfOperatorDeclaration>(methodDeclaration))
|
||||
{
|
||||
if ((operatorDecl->mOpTypeToken != NULL) && (operatorDecl->mOpTypeToken->mToken == BfToken_LChevron))
|
||||
ExpectSpace();
|
||||
}
|
||||
QueueVisitChild(methodDeclaration->mGenericParams);
|
||||
|
||||
if (auto operatorDecl = BfNodeDynCast<BfOperatorDeclaration>(methodDeclaration))
|
||||
|
@ -1953,8 +1972,7 @@ void BfPrinter::QueueMethodDeclaration(BfMethodDeclaration* methodDeclaration)
|
|||
ExpectSpace();
|
||||
QueueVisitChild(operatorDecl->mExplicitToken);
|
||||
ExpectSpace();
|
||||
QueueVisitChild(operatorDecl->mOperatorToken);
|
||||
ExpectSpace();
|
||||
QueueVisitChild(operatorDecl->mOperatorToken);
|
||||
QueueVisitChild(operatorDecl->mOpTypeToken);
|
||||
ExpectSpace();
|
||||
QueueVisitChild(methodDeclaration->mReturnType);
|
||||
|
|
|
@ -113,6 +113,7 @@ public:
|
|||
|
||||
virtual void Visit(BfAttributeDirective* attributeDirective) override;
|
||||
virtual void Visit(BfGenericParamsDeclaration* genericParams) override;
|
||||
virtual void Visit(BfGenericOperatorConstraint* genericConstraints) override;
|
||||
virtual void Visit(BfGenericConstraintsDeclaration* genericConstraints) override;
|
||||
virtual void Visit(BfGenericArgumentsNode* genericArgumentsNode) override;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue