summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2021-08-24 15:12:18 -0400
committerPeter LaFosse <peter@vector35.com>2021-09-05 10:09:10 -0400
commit19fa73a2593d730b47e6b54f76762fcac109e25d (patch)
treed72484dbb1b4ec23e2f73c069280d9ab7dd42ec5
parent827749ef27bd994644158c0a8f76a52df7f773b3 (diff)
Remove CreateEnumerationBuilderOfWidth instead just use the normal API and pass nullptr as arch
-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,