summaryrefslogtreecommitdiff
path: root/function.cpp
diff options
context:
space:
mode:
authorkat <katherine@vector35.com>2022-09-22 09:25:01 -0400
committerkat <katherine@vector35.com>2022-09-22 09:25:01 -0400
commite95b220ef18c9dd9e1aecab32b735ff47237f9c7 (patch)
treee302ace94bc5c8707edbc037c1fea55cfabc73cd /function.cpp
parent07be3689f173e7a55af5e795c10377e0afdd594f (diff)
Add the Components API
Diffstat (limited to 'function.cpp')
-rw-r--r--function.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/function.cpp b/function.cpp
index 96795ef0..12c9d241 100644
--- a/function.cpp
+++ b/function.cpp
@@ -1446,6 +1446,24 @@ set<SSAVariable> Function::GetHighLevelILSSAVariablesIfAvailable()
}
+std::vector<Ref<Component>> Function::GetParentComponents() const
+{
+ std::vector<Ref<Component>> components;
+
+ size_t count;
+ BNComponent** list = BNGetFunctionParentComponents(m_object, &count);
+
+ components.reserve(count);
+ for (size_t i = 0; i < count; i++)
+ {
+ Ref<Component> component = new Component(list[i]);
+ components.push_back(component);
+ }
+
+ return components;
+}
+
+
void Function::CreateAutoVariable(
const Variable& var, const Confidence<Ref<Type>>& type, const string& name, bool ignoreDisjointUses)
{