commit | cec46c48853a8c1246656d0095a9faa3fad5c4f9 | [log] [tgz] |
---|---|---|
author | Timur Iskhakov <iskhakovt@google.com> | Wed Aug 09 00:22:02 2017 -0700 |
committer | Timur Iskhakov <iskhakovt@google.com> | Tue Aug 15 18:03:42 2017 -0700 |
tree | 42ffd1b245d908404e3be321fc620bc1c91774c2 | |
parent | 58d4b79e36dbdf70411621235793ea7ae579e174 [diff] |
Move type-related stuff ouside of parsing 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
croot make hidl-gen
hidl-gen -o output-path -L language (-r interface-root) fqname output-path: directory to store the output files. language: output file for given language. e.g.c++, vts.. fqname: fully qualified name of the input files. For singe file input, follow the format: package@version::fileName For directory input, follow the format: package@version interface-root(optional): prefix and root path for fqname. If not set, use the default prefix: android.hardware and default root path defined in $TOP. examples: croot hidl-gen -o output -L c++ -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport android.hardware.nfc@1.0::INfc.hal hidl-gen -o output -L vts -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport android.hardware.nfc@1.0 hidl-gen -o test -L c++ -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport android.hardware.nfc@1.0 hidl-gen -L hash -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport android.hardware.nfc@1.0