From 7598688466960427890036590239565364310171 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Thu, 6 Jul 2023 13:40:52 -0400 Subject: Expose function "pure" flag to api and typesystem --- function.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'function.cpp') diff --git a/function.cpp b/function.cpp index c9314968..298148b6 100644 --- a/function.cpp +++ b/function.cpp @@ -233,6 +233,13 @@ Confidence Function::CanReturn() const } +Confidence Function::IsPure() const +{ + BNBoolWithConfidence bc = BNIsFunctionPure(m_object); + return Confidence(bc.value, bc.confidence); +} + + bool Function::HasExplicitlyDefinedType() const { return BNFunctionHasExplicitlyDefinedType(m_object); @@ -1005,6 +1012,15 @@ void Function::SetAutoCanReturn(const Confidence& returns) } +void Function::SetAutoPure(const Confidence& pure) +{ + BNBoolWithConfidence bc; + bc.value = pure.GetValue(); + bc.confidence = pure.GetConfidence(); + BNSetAutoFunctionPure(m_object, &bc); +} + + void Function::SetAutoStackAdjustment(const Confidence& stackAdjust) { BNOffsetWithConfidence oc; @@ -1125,6 +1141,15 @@ void Function::SetCanReturn(const Confidence& returns) } +void Function::SetPure(const Confidence& pure) +{ + BNBoolWithConfidence bc; + bc.value = pure.GetValue(); + bc.confidence = pure.GetConfidence(); + BNSetUserFunctionPure(m_object, &bc); +} + + void Function::SetStackAdjustment(const Confidence& stackAdjust) { BNOffsetWithConfidence oc; -- cgit v1.3.1