aboutsummaryrefslogtreecommitdiffstats
path: root/Reference.h
Commit message (Collapse)AuthorAgeFilesLines
* hidl-gen: understand doc commentsSteven Moreland2018-05-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Doc comments were used by hidl-doc in order to generate documentation. However, because hidl-doc tokenizes the entire file including the comments some of the information is lost. Rather than refactor hidl-doc, we are going to use 3rd party doc generation tools in order to generate docs from the output of hidl-gen. This has a couple of benefits: - people automatically get the documentation if they are using an IDE which pulls the documentation - hidl-doc/hidl-gen won't get out of sync - documentation will be closer to actual usage This will require ABI-safe changes to some HAL interfaces. Bug: 78135149 Test: manually inspect hidl-gen output. Test: (sanity) run_all_host_tests.sh Test: (sanity) run_all_device_tests.sh Change-Id: I9a09ed48e2e3834fab7e032e29c48f466510e51f
* Track imported types more granularly than before, add types referred toAndreas Huber2017-11-291-1/+1
| | | | | | | | from within enum value constants to the referenced types. Bug: 68343606 Test: make, hidl-gen Change-Id: I120c5be273fe14119429b738c4d2540a6953f46d
* Fix NamedReference locationTimur Iskhakov2017-09-111-3/+8
| | | | | Test: manual test of error message Change-Id: I22ade1f240bff0b8089361ffdce17597c7c99a28
* Do not unwrap typedefs on lookupsTimur Iskhakov2017-09-051-1/+14
| | | | | | | | | | | | | | | | | TypeDefs were replaced with actual types in lookups, so package containing typedef could be not included. This change keeps typedef declarations and imports package with typedef declaration. Bug: 65266511 Test: mma Test: manual check that include became correct Test: /hardware/interfaces output is unchanged, however CL changes the behavior Change-Id: Iee78228c9acfa4dbd16c3ca4ec0d9568a927d0f6
* Make Reference::get follow const rulesTimur Iskhakov2017-08-311-2/+7
| | | | | | | | | Instead of having T* Reference::get() const, this change brings const T* Reference::get() const and T* Reference::get() Test: mma Change-Id: I1c8834467acffd426c25aa9c0661c290a05d7a52
* Remove Reference::operator*Timur Iskhakov2017-08-311-2/+0
| | | | | | | Reference::operator* is unclear, replaced with get() call. Test: mma Change-Id: I8b2f0e56964a2a45ac2d7f460aec5633765c77eb
* Build AST graph explicitly for simpler post-parsing passesTimur Iskhakov2017-08-241-1/+2
| | | | | | | | | | Puts all of AST parent-child dependencies into a graph. This change also makes it able to not care about such case: Type -> (non Type) -> Type (ex. Interface -> Method -> Type) and to store only Type -> Type relations. Test: hidl_test Change-Id: Ic67d9833d9519d7bd6cbae603c556c5bd905167a
* Move type-related stuff ouside of parsingTimur Iskhakov2017-08-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 3 new passes: resolving inheritance, evaluating constant expressions and validation. `resolveInheritance` completes type fields definition which depends on type base class (so it needs to be looked up before this pass). That includes interface method serial autofill and enum value autofill. `evaluate` evaluates constant expressions. This pass depends on the previous one as enum autofill creates new expressions (+1s). `validate` proceedes all type-related checks. `callForReference` is a special way of calling passes for types: it is used for types that are defined in reference. Currently that is only array type (size is defined in reference only) and template type as it could contain an array. We need such special way to avoid cyclic evaluate call: struct S { S[42] arr; }; Test: full build, device boot Test: hidl_test Test: full build on mac Test: generated files differ only in constant expression comments Change-Id: I499e62ae41c52cc86b13d0014eed790454137af6
* Make NamedReference be child class for ReferenceTimur Iskhakov2017-08-151-7/+6
| | | | | | | | | NamedReference is actually a reference with added name, if we keep it to be a tuple, we will need to copy most of Reference methods to NamedReference for lookup (ex.: getFqName, set) Test: build hidl-gen, hidl_test Change-Id: I1e9e22f6ef3698e709056a09eec7cb75e3175f2f
* Make Reference struct simplerTimur Iskhakov2017-08-141-9/+0
| | | | | | | | | Remake exceptional case for Reference cast (which is used to add additional type restrictions) Test: build hidl-gen, hidl_test Change-Id: Ib6376c946d9afe6f9bbdb2e7a880eb18162db27e
* Merge structures with duplication featuresTimur Iskhakov2017-08-101-0/+16
| | | | | | | | | | TypedVar (function argument) and CompoundField (struct/union field) have exactly same features: they store Reference<Type> type and string name, so they are merged into one "Named Reference" type. Test: compiles, hidl_test Change-Id: I6135075e5a4e2d19589af16581ceac8ab430ecc9
* Revert "Revert "Add Reference type""Timur Iskhakov2017-08-041-0/+110
| | | | | | | | | | | | | | | | | | | | | | This reverts commit 6f2f2c026b0b6e372194794e171208a91d74f852. Reason for revert: mac build problem could be easily fixed Mac build failure was caused by not declaring template specialization in header file. Unfortunately, it cannot be easily declared there, as that would cause cyclic declaration. The reason why Reference<T>(Reference<O>) constructor could get only unresolved references is because there is no way to check that the requested conversion is valid (without specialization or rtti). However, the appeared messy solution is to be deleted with moving lookup calls outside of the parser. Test: builds, hidl_test Test: builds on mac Change-Id: Icb24e2ad52563f659e758a186d90e414ab7f1c59
* Revert "Add Reference type"Steven Moreland2017-08-051-108/+0
| | | | | | | | This reverts commit 4b80bc4402ec88504265e6fdbcdb8a803d67eb64. Reason for revert: breaking mac build Change-Id: I38b4a6e67173d87d7d78ff191aa26d4a980d2e39
* Add Reference typeTimur Iskhakov2017-08-031-0/+108
Add Reference placeholder which keeps Type, FQName and Location. This type is necessary for adding forward reference support: it stores FQName until lookup happens, then stores resolved Type; it stores Location, as all type-related checks are to be moved outside of the parsing, so we need to keep Location for future error messages. Reference type has overwritten operators to make it work as Type*, providing additional checks that Type is resolved before being using. Reference type is also useful for adding forward reference support as it checks that every Type member call appears after lookup. ConstantExpression is to support Reference (and to not be evaluated during parsing) in future CL. Test: links, compiles, hidl_test Change-Id: I7a031b541e678032af1190209e9d2aaf4999bf1b