summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--binaryninjacore.h1
-rw-r--r--type.cpp6
2 files changed, 5 insertions, 2 deletions
diff --git a/binaryninjacore.h b/binaryninjacore.h
index ae2b73e4..59a7141e 100644
--- a/binaryninjacore.h
+++ b/binaryninjacore.h
@@ -4687,7 +4687,6 @@ __attribute__ ((format (printf, 1, 2)))
BINARYNINJACOREAPI BNTypeBuilder* BNCreateStructureTypeBuilderWithBuilder(BNStructureBuilder* s);
BINARYNINJACOREAPI BNTypeBuilder* BNCreateEnumerationTypeBuilder(BNArchitecture* arch, BNEnumeration* e, size_t width, bool isSigned);
BINARYNINJACOREAPI BNTypeBuilder* BNCreateEnumerationTypeBuilderWithBuilder(BNArchitecture* arch, BNEnumerationBuilder* e, size_t width, bool isSigned);
- BINARYNINJACOREAPI BNTypeBuilder* BNCreateEnumerationTypeBuilderOfWidth(BNEnumeration* e, size_t width, bool isSigned);
BINARYNINJACOREAPI BNTypeBuilder* BNCreatePointerTypeBuilder(BNArchitecture* arch, const BNTypeWithConfidence* const type,
BNBoolWithConfidence* cnst, BNBoolWithConfidence* vltl, BNReferenceType refType);
BINARYNINJACOREAPI BNTypeBuilder* BNCreatePointerTypeBuilderOfWidth(size_t width, const BNTypeWithConfidence* const type,
diff --git a/type.cpp b/type.cpp
index 4429bb60..f74782b5 100644
--- a/type.cpp
+++ b/type.cpp
@@ -906,6 +906,10 @@ Confidence<Ref<Type>> Type::WithConfidence(uint8_t conf)
return Confidence<Ref<Type>>(this, conf);
}
+bool Type::IsReferenceOfType(BNNamedTypeReferenceClass refType)
+{
+ return (GetClass() == NamedTypeReferenceClass) && (GetNamedTypeReference()->GetTypeClass() == refType);
+}
QualifiedName Type::GetStructureName() const
{
@@ -1406,7 +1410,7 @@ TypeBuilder TypeBuilder::EnumerationType(Architecture* arch, EnumerationBuilder*
TypeBuilder TypeBuilder::EnumerationType(Enumeration* enm, size_t width, bool isSigned)
{
- return TypeBuilder(BNCreateEnumerationTypeBuilderOfWidth(enm->GetObject(), width, isSigned));
+ return TypeBuilder::EnumerationType(enm, width, isSigned);
}
TypeBuilder TypeBuilder::PointerType(Architecture* arch, const Confidence<Ref<Type>>& type,