diff options
| author | Glenn Smith <glenn@vector35.com> | 2023-07-06 13:40:52 -0400 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2023-07-07 17:42:18 -0400 |
| commit | 7598688466960427890036590239565364310171 (patch) | |
| tree | 1c8680da5ef239926c9dbd78345c4083aed95aba /function.cpp | |
| parent | 94e476e947cf4cb0734fbd0563286e8443c75b96 (diff) | |
Expose function "pure" flag to api and typesystem
Diffstat (limited to 'function.cpp')
| -rw-r--r-- | function.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/function.cpp b/function.cpp index c9314968..298148b6 100644 --- a/function.cpp +++ b/function.cpp @@ -233,6 +233,13 @@ Confidence<bool> Function::CanReturn() const } +Confidence<bool> Function::IsPure() const +{ + BNBoolWithConfidence bc = BNIsFunctionPure(m_object); + return Confidence<bool>(bc.value, bc.confidence); +} + + bool Function::HasExplicitlyDefinedType() const { return BNFunctionHasExplicitlyDefinedType(m_object); @@ -1005,6 +1012,15 @@ void Function::SetAutoCanReturn(const Confidence<bool>& returns) } +void Function::SetAutoPure(const Confidence<bool>& pure) +{ + BNBoolWithConfidence bc; + bc.value = pure.GetValue(); + bc.confidence = pure.GetConfidence(); + BNSetAutoFunctionPure(m_object, &bc); +} + + void Function::SetAutoStackAdjustment(const Confidence<int64_t>& stackAdjust) { BNOffsetWithConfidence oc; @@ -1125,6 +1141,15 @@ void Function::SetCanReturn(const Confidence<bool>& returns) } +void Function::SetPure(const Confidence<bool>& pure) +{ + BNBoolWithConfidence bc; + bc.value = pure.GetValue(); + bc.confidence = pure.GetConfidence(); + BNSetUserFunctionPure(m_object, &bc); +} + + void Function::SetStackAdjustment(const Confidence<int64_t>& stackAdjust) { BNOffsetWithConfidence oc; |
