aboutsummaryrefslogtreecommitdiff
path: root/HandleType.h
diff options
context:
space:
mode:
authorTimur Iskhakov <iskhakovt@google.com>2017-09-07 23:13:44 -0700
committerTimur Iskhakov <iskhakovt@google.com>2017-09-11 18:56:36 -0700
commit5dc72fe4f6f1d2c03c75307a9bd80f055f752ed3 (patch)
tree71d0a249ec20f16ef8759cb8fa75765437a53011 /HandleType.h
parenta48a4d968c9e44fae12c69033a4f51cc2aac9c32 (diff)
downloadhidl-5dc72fe4f6f1d2c03c75307a9bd80f055f752ed3.tar.gz
Make recursive methods in Type work with cyclic AST
Fixes Type::canCheckEquality, Type::needsResolveReferences, Type::isJavaCompatible, Type:containsPointer. Adds set of visited Types to these functions to prevent infinite recursion. deep versions of these functions *do not* guarantee the correct return value, but non-deep versions do: We need to find al least one path from requested vertex to "bad" vertex (ie. which is not java compatible). Fixes a bug with containsPointer (containsPointer returned true if inner type contained a pointer), so more structures get __attribute__ aligned and static_assert generated for struct fields. This change is required for forward reference, as current implementations assume that the graph is acyclic. Potential future work: to reduce theoretical complexity of described actions (square to linear). Bug: 31827278 Test: mma Test: output not changed in out/soong/.intermediates/hardware/interfaces Change-Id: I3dbdd1605f9317637241057b12de6031125abf7b
Diffstat (limited to 'HandleType.h')
-rw-r--r--HandleType.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/HandleType.h b/HandleType.h
index af482159..754aad7f 100644
--- a/HandleType.h
+++ b/HandleType.h
@@ -58,7 +58,7 @@ struct HandleType : public Type {
bool needsEmbeddedReadWrite() const override;
- bool isJavaCompatible() const override;
+ bool deepIsJavaCompatible(std::unordered_set<const Type*>* visited) const override;
bool useNameInEmitReaderWriterEmbedded(bool isReader) const override;