mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Improved generic constraint const conversion handling
This commit is contained in:
parent
c750ed076c
commit
e5c4321440
4 changed files with 35 additions and 3 deletions
|
@ -461,6 +461,18 @@ int BfIRConstHolder::IsZero(BfIRValue value)
|
|||
return -1;
|
||||
}
|
||||
|
||||
bool BfIRConstHolder::IsConstValue(BfIRValue value)
|
||||
{
|
||||
auto constant = GetConstant(value);
|
||||
if (constant == NULL)
|
||||
return false;
|
||||
|
||||
if (constant->mConstType == BfConstType_GlobalVar)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int BfIRConstHolder::CheckConstEquality(BfIRValue lhs, BfIRValue rhs)
|
||||
{
|
||||
auto constLHS = GetConstant(lhs);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue