History log of /system/tools/hidl/ArrayType.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
368e46077eb9fbe52242e037a5b9de91693fe70f 16-Feb-2018 Steven Moreland <smoreland@google.com> Do all validation during validation phase.

When hidl-gen was originally written, validation occured
at two different times: parsing and generation.

Since then, hidl-gen was re-written to be a multi-pass compiler.
The basic phases are now (see main + AST::postParse):
parse, process, validate, generate

However, some validation still exists during the generation phase.
This validation code has been gradually cleaned up, but, here, I am
cleaning up all the rest.

By moving the code to validation, we are fixing several classes
of problems:
1. generate functions almost exclusively (except for the few exceptions
that this CL cleans up) always return status OK. We have a bunch of
data flow logic which exists solely to propagate "return OK". This
is just plain silly.
2. a large number of the returns from emit/generate functions are not
actually checked. We've had a several bugs from this and also many
CLs just to fix this when they've been discovered. This causes problems
where hidl-gen fails but nothing notices.
3. sometimes files are written before things are validated. This is
extremely frustrating and also the cause of other bugs. One common
case of this (while developing) is when updating makefiles, the hidl-gen
compiler complains something is wrong with an interface, but it has
already partially written new but invalid makefiles. This means that
they have to be manually fixed before another build can begin.
4. having status_t returns from generate functions indicates to someone
working on hidl-gen that they can return an error here, but they
should always return an error from the correct validation function.
Removing the ability to return ERROR makes sure that new errors are
caught/validated in the correct place. One instance in this CL of
this happening is that annotations are also checked on isHidlReserved
methods whereas before, these were incorrectly only checked on regular
methods.

(note, breaking text to avoid pinging these)
B ug: 65636464 (forward declarations, made this possible)
B ug: 34807779 (better tools for java compatibility, closer to being solved)
B ug: 32573681 (instance of 2 above).

Test: hidl's run_all_host_tests.sh
Change-Id: I8988e1fdf16e15b925c0a613122c41e6a41bd4dd
/system/tools/hidl/ArrayType.cpp
a23f1ae530383d3a0d0e5178a0bf988da789e893 31-Oct-2017 Andreas Huber <andih@google.com> Optimize array marshaling to copy linear ranges of memory instead of

doing per-element copies if the array element type corresponds to a primitive
java type.

Bug: 68654583
Test: hidl_test_java
Change-Id: Idb0fee0331de9bd5b3e18252312d86fa5714f633
/system/tools/hidl/ArrayType.cpp
5dc72fe4f6f1d2c03c75307a9bd80f055f752ed3 08-Sep-2017 Timur Iskhakov <iskhakovt@google.com> 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
/system/tools/hidl/ArrayType.cpp
e8ee6a005bee05611c9ac6b4d29850a191152021 06-Sep-2017 Timur Iskhakov <iskhakovt@google.com> Adds missing '#include <iostream>' to a few files.

Removes '#include <iostream>' from Location.h which leads to
necessity to add missing imports.

Test: mma
Change-Id: I1b562ce1a08b7612c55f7eb62e41ca54d3292f80
/system/tools/hidl/ArrayType.cpp
0737c2a4a10731188ee9a94f864b0c7b462d55db 31-Aug-2017 Timur Iskhakov <iskhakovt@google.com> Extending existing arrays is moved from parsing

Moves setting array exact element type and size from
parsing to post parse pass.

Fixed an issue about incorrect output array dimension:

input:
typedef int32_t[2][3] x;
typedef x[4][5] y;
output:
typedef ::android::hardware::hidl_array<int32_t, 4, 2, 3, 5> y;
fixed output:
typedef ::android::hardware::hidl_array<int32_t, 4, 5, 2, 3> y;

Addes test for the described case.

Fixes: 65257916

Test: mma
Test: /hardware/interfaces output is unchanged, however
CL changes the behavior

Change-Id: I91a63e3c5749b092a8dad942c4cf6f294b79eda9
/system/tools/hidl/ArrayType.cpp
24e605b5194d969a1558d94896d69cc554881e46 30-Aug-2017 Timur Iskhakov <iskhakovt@google.com> Make Reference::get follow const rules

Instead of having T* Reference::get() const, this change brings
const T* Reference::get() const and
T* Reference::get()

Test: mma
Change-Id: I1c8834467acffd426c25aa9c0661c290a05d7a52
/system/tools/hidl/ArrayType.cpp
63f399021d053453704d41845d4ebcc06fe01738 30-Aug-2017 Timur Iskhakov <iskhakovt@google.com> Add parent to every type

Parent is needed for lookups:
scope = isScope() ? this : parent()
for ref : getReferences() {
AST->lookup...(ref, scope)
}

Bug: 31827278
Test: mma
Change-Id: I1bde29de43d224634d80949d719adc8de9cc8896
/system/tools/hidl/ArrayType.cpp
b3f8bcb56965177f8064679150497b6e586df2ee 31-Aug-2017 Timur Iskhakov <iskhakovt@google.com> Remove Reference::operator*

Reference::operator* is unclear, replaced with get() call.

Test: mma
Change-Id: I8b2f0e56964a2a45ac2d7f460aec5633765c77eb
/system/tools/hidl/ArrayType.cpp
b58f4185934a93fc511c03a8a970b31c5ea0dfca 30-Aug-2017 Timur Iskhakov <iskhakovt@google.com> Make Type::getReferences return pointer

This change makes it able to add lookups as one more tree pass,
as it requires to change Type inside of references.

This change require getReferences to become non-const, so from now
we maintain const and non-const versions of recursive pass and getting
dependencies.

Bug: 31827278
Test: mma
Change-Id: I201533db5ca0bd30fbad34ef71ed2bd210c607e4
/system/tools/hidl/ArrayType.cpp
891a866402345777c7e746cf8d0e4ffd0bd28ca2 26-Aug-2017 Timur Iskhakov <iskhakovt@google.com> Constant Expressions have same tree structure as Type

Makes constant expressions tree structures and type signatures
be similar to AST (type declarations and references).

This change is useful for making same structure for calling
constant expressions evaluation and lookup (they depend on local
identifiers).

Bug: 31827278

Test: mma

Change-Id: I901284009d8b845358788b8c9e3de083a2f63f3f
/system/tools/hidl/ArrayType.cpp
33431e6cd425c6cd179080442a8616e2baa20aae 22-Aug-2017 Timur Iskhakov <iskhakovt@google.com> Build AST graph explicitly for simpler post-parsing passes

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
/system/tools/hidl/ArrayType.cpp
cec46c48853a8c1246656d0095a9faa3fad5c4f9 09-Aug-2017 Timur Iskhakov <iskhakovt@google.com> 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
/system/tools/hidl/ArrayType.cpp
505316c499a4dbb95f6567e8531fb6f1e74c3ded 05-Aug-2017 Timur Iskhakov <iskhakovt@google.com> Revert "Revert "Add Reference type""

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
/system/tools/hidl/ArrayType.cpp
6f2f2c026b0b6e372194794e171208a91d74f852 05-Aug-2017 Steven Moreland <smoreland@google.com> Revert "Add Reference type"

This reverts commit 4b80bc4402ec88504265e6fdbcdb8a803d67eb64.

Reason for revert: breaking mac build

Change-Id: I38b4a6e67173d87d7d78ff191aa26d4a980d2e39
/system/tools/hidl/ArrayType.cpp
4b80bc4402ec88504265e6fdbcdb8a803d67eb64 29-Jul-2017 Timur Iskhakov <iskhakovt@google.com> Add Reference type

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
/system/tools/hidl/ArrayType.cpp
0ecc7b8aca24a5618512610bb6371bdb91b5fdc2 19-Jul-2017 Steven Moreland <smoreland@google.com> Add typeName() to all types.

Fixes some possible empty error messages (from
vec<unsupported type> at least). Also, will be useful
in the future to describe types.

Bug: 34807779
Test: manual
Change-Id: I52898f854e5747a65a4ca0c7a6ada0277feca761
/system/tools/hidl/ArrayType.cpp
e30ee9b06ac578006161e84633db91289f889068 09-May-2017 Steven Moreland <smoreland@google.com> -Lc++-impl: better namespace handling

Intelligent namespace handling requires much more work
so using Formatter like the rest of hidl-gen.

Test: manual with -Lc++-impl
Fixes: 37294618
Change-Id: I9593ec31b8b8dd19b09750acf10c0330f5628a58
/system/tools/hidl/ArrayType.cpp
b2a861cf36ba30b0365d42b33fca0188d543c73c 19-Apr-2017 Martijn Coenen <maco@google.com> Generate correct Parcel verification code.

Make sure we pass in correct sizes into readBuffer()
and readEmbeddedBuffer() calls.

Same thing for HwBlob.readBuffer() and
HwBlob.readEmbeddedBuffer().

Bug: 30498700
Test: hidl_test, hidl_test_java, Youtube, Maps, Netflix, Camera

Change-Id: Ied2d9dc46538da3fcf5b1acbf1e7558e0743d3a2
Merged-In: Ied2d9dc46538da3fcf5b1acbf1e7558e0743d3a2
/system/tools/hidl/ArrayType.cpp
30b5d1ffe964d0b82008bfc8f4b8e61ab3bac86f 03-Apr-2017 Yifan Hong <elsk@google.com> Add getHashChain() to IBase.

Each interface has a getHashChain() method that
returns the hash of all .hal files from the rtti
of the interface up to IBase.

Test: hidl_test

Bug: 36602587
Change-Id: I13f2e54bd45593c70064dff05fa934d5cd01996a
/system/tools/hidl/ArrayType.cpp
60d3b22101e911242d2d41c8dc8309e8706f1fe1 30-Mar-2017 Andreas Huber <andih@google.com> More stringently verify expected alignment of fields in hidl compound types.

Change-Id: I222d78163ac5d7cc5af405b0c3d0586ed7528213
Bug: 33846034
Test: make
/system/tools/hidl/ArrayType.cpp
e45b5303e072043679483a70606f6c00dde17382 22-Feb-2017 Yifan Hong <elsk@google.com> Add toString to Java code

* toString is mainly for debugging purposes.
* For structs and interfaces, add Object.toString.
* For enums, add MyEnum.toString(int) and MyEnum.dumpBitfield(int).

Use them as follows:
* For enums, use the static method E.toString(int).
* For bitfields, use the static method E.dumpBitfield(int).
* For all arrays, use java.utils.Arrays.deepToString(o)
* For everything else, use one of the following:
* o.toString(), if o is not null
* Object.toString(o)
* String.valueOf(o)
* Note that for array / vec of enums / bitfields, the raw integer
value is dumped.

Bug: 33459772
Test: hidl_test_java

Change-Id: Ifb1ed519770b907e0a4e345b2c3109dc322a23b2
/system/tools/hidl/ArrayType.cpp
3b23fa32af9d8f04e89e08c60aafc7f2ef1b27d3 24-Jan-2017 Zhuoyao Zhang <zhuoyao@google.com> Fix the vts file generator for TYPE_ARRAY.

* vector_size should be defined out of vector_value.

Test: make hidl-gen
Change-Id: I5d19570d61152cc11a8555fa76d115d6f90bdb1f
/system/tools/hidl/ArrayType.cpp
f5cc2f74e86504f7904a0a24e7fcc00fa19cd579 05-Jan-2017 Yifan Hong <elsk@google.com> Emit toString functions for all types.

* toString() is mainly for debugging purposes only.

* For HIDL internal types (hidl_string, hidl_vec, etc.)
toString() is found in ::android::hardware::details.

* For a user defined type
android.hardware.foo@1.0::IFoo.Type,
toString() is found in ::android::hardware::foo::V1_0.

* For bitfield<::anroid::hardware::foo::V1_0::T>
that gets translated to the underlying
numeric type of T, it doesn't make sense to override toString().
A templated toString() function for each user-defined HIDL enum \
is introduced into the same namespace; call it with
using namespace ::android::hardware::foo::V1_0;
toString<IFoo::MyEnumType>(value);

Test: hidl_test and look at the output of logcat

Bug: 33459772

Change-Id: I70eee018e31d700bf1376334276dbd343af5615f
/system/tools/hidl/ArrayType.cpp
6a082c63904f274c45d5eede313e0ef77ec70f86 11-Jan-2017 Martijn Coenen <maco@google.com> Use new read(Embedded)Buffer API.

Bug: 34134129
Test: hidl_test
Change-Id: Iad3f9d4dd30b4b8b92295816fbed25c56e52fb0a
/system/tools/hidl/ArrayType.cpp
c6752dcea3b5dae1e99960b5beb6af394280b393 20-Dec-2016 Yifan Hong <elsk@google.com> Add operator== and != for some structs.

operator== and != are defined for type T where T is
one of the following:
* scalars
* strings
* enums
* U[] where U is in this list
* vec<U> where U is in this list
* structs that contain only types in this list.

If a struct contains a handle, an MQDescriptor,
or a union, for example, then == and != is not generated.

Bug: 32834072

Test: hidl_test
Change-Id: Icac73a14f81274ee6592e2b8fadf26d629151d9f
/system/tools/hidl/ArrayType.cpp
2f69a5b157e9c5c41847e55bf3e7dbb01b7de99d 18-Nov-2016 Martijn Coenen <maco@google.com> Map handle to hidl_handle in all cases.

Instead of having inconsistent types for HIDLs 'handle' type
dependent on where the handle is used (eg native_handle_t*
in function parameters, but hidl_pointer<native_handle_t>
in compound structures), make it consistent by always using
hidl_handle. Copy constructors and conversion operators will
still make it easy to use for clients/servers.

Bug: 32089785
Test: builds, hidl_test32/64 passes
Change-Id: I2eb60cb56c4c62ad9479fd57f801349ce0f4b7ef
/system/tools/hidl/ArrayType.cpp
ac5878945afde379e41d9c93de44c32537f868b1 17-Nov-2016 Martijn Coenen <maco@google.com> Wrap compound native_handle_t* in hidl_pointer.

When transferring a handle in a compound type,
we need to use hidl_pointer<> to ensure that we
allocate enough space for the pointer. But we want
to hide the hidl_pointer<> type from client/server
code as much as we can, so we only use this type
when necessary (eg when the handle is embedded in
a struct).

Bug: 32089785
Test: builds
Change-Id: I30c9aa9f1348fd5e72cd6d1e71d9ac3b4bd8ea8e
/system/tools/hidl/ArrayType.cpp
1af73531ba32b3dfc6ef23a8bf0172dd00be43cc 09-Nov-2016 Yifan Hong <elsk@google.com> Resolve some name conflict in auto-gen'd Java code.

HIDL can now use ArrayList, HwBlob etc. as type names.

Bug: 31527497

Test: mma
Change-Id: I76c62d14d4f19a73bbc1de76e88e5be6a7df5542
/system/tools/hidl/ArrayType.cpp
4ed1347cd29e6e07acad368891bb03078c798aba 02-Nov-2016 Yifan Hong <elsk@google.com> Remove extra from getJavaType.

Bug: 32559427
Test: hidl_test_java

Change-Id: I1a96630eed1b61ab4ff2959ced2e83f94e8fb36d
/system/tools/hidl/ArrayType.cpp
3b320f8a60e4343bf06319bca3fc949c95eaf326 01-Nov-2016 Yifan Hong <elsk@google.com> Remove extra from getCppType.

The argument is used for array type originally. We
now use hidl_array instead of T[], so there is no
need to use extra.

Renamed the convenience getCppType to getCppStackType
to avoid casting to (Type *) before using this
method (which makes it inconvenient)

Also fixes:
* RefType::getCppType ignores specifyNamespaces
* ConstantExpression.cpp emits a C-style cast instead
of static_cast

Bug: 32559427

Test: mma passes
Test: hidl_test

Change-Id: I7e2e31c34c1ca1aa83c4a5a4dbdf7fd6b9aff30c
/system/tools/hidl/ArrayType.cpp
5706a43b2955b30f5611588dadfb9e33c7aa4c89 02-Nov-2016 Yifan Hong <elsk@google.com> Clean up ArrayType.cpp

mSizeComments are removed
mSizes are now a vector of ConstantExpression's

Bug: 32559427 clean up hidl-gen
Bug: 32592564 Remove extraneous comments from array type's sizes.

Test: hidl_test
Test: make hidl_test_java
Change-Id: I2a0dbf7e31a425ce851c9be3b413accdfcb79789
/system/tools/hidl/ArrayType.cpp
bd33e3854555589f312c4d6d89491e2f5cc2f782 02-Nov-2016 Yifan Hong <elsk@google.com> Fix array size orders.

Note that the following code in HIDL:
typedef int32_t[3] ThreeInts;
struct T {
ThreeInts[5] matrix5x3;
int32_t[3][5] matrix3x5;
}

will generate this C++ code:
struct T {
hidl_array<int32_t, 5, 3> matrix5x3; // notice 3 is after 5
hidl_array<int32_t, 3, 5> matrix3x5;
}
and this Java code:
public final static class T {
public final int[][] matrix5x3 = new int[5][3];
public final int[][] matrix3x5 = new int[3][5];
}

Bug: 31438033
Test: hidl_test
Test: hidl_test_java
Change-Id: I3ac91c461293848e6efb3ae8c11a6a8d932ed79a
/system/tools/hidl/ArrayType.cpp
c46e9842bd82d9c70e08b37a4507b448b285d6c6 02-Nov-2016 Steven Moreland <smoreland@google.com> Break ::android::hardware namespace assumption.

Test: make test.vendor@1.0
Bug: 32579492
Change-Id: I7afd1d83af5f4c0d1c49b828b9e489c111937dcd
/system/tools/hidl/ArrayType.cpp
eb355ee0b307d651497f606271a15fbb3dcd2e47 21-Oct-2016 Zhuoyao Zhang <zhuoyao@google.com> Update hidl-gen to support generating vts files for multi-dimentional array.

Test: generated and checked vts fils for android.hardware.tests.foo@1.0.
Change-Id: I148f44b113cf8ceb15338cd967f954f68ecffa01
/system/tools/hidl/ArrayType.cpp
c5ea9f589cc7cce0b5e97bd4ac6a8561eb313a02 07-Oct-2016 Zhuoyao Zhang <zhuoyao@google.com> Update hidl-gen support for vts.

* Support the new Enum type (based on scalar_data)
* Support sub_struct/sub_union defined within compound type.
* Code cleanup: use getVtsType() instead of hard code ones.

Test: make hidl-gen, locally run make hidl_gen_test.
Bug: 30762234
Change-Id: I9a21b5757e0a9fc6cd1bf829ab123565a7990ad5
/system/tools/hidl/ArrayType.cpp
be2a3737675b83dd61b52c11f0d7549fa1276739 05-Oct-2016 Yifan Hong <elsk@google.com> hidl-gen: add sanitizedName to emitReaderWriterEmbedded.

* Fix weird variable names in autogenerated code for vec<vec<T>>.

Bug: 31955917

Test: hidl_test
Change-Id: I83363a6d12babae1aba8e118451e1ec80492012c
/system/tools/hidl/ArrayType.cpp
bf459bcedc2ab1a22a9cc290fbcc0a5462e63690 24-Aug-2016 Yifan Hong <elsk@google.com> Pointer support and embedded types in HIDL.

* Pointers work per transaction. Don't work
across transactions.
* ref<T> in HIDL translates to T const* in C++.
* No Java support.
* Embedded types like ref<vec<vec<int32_t>>>
or vec<ref<T>> is supported. Pointers to
pointers like ref<ref<ref<T>>> is supported.
* Array of pointers and pointer to array supported.
* Pointer inside a union is NOT supported.

Test: `mma`
Test: `make hidl_test && adb sync && adb shell hidl_test`
Note that this only works with a kernel patch.

Bug: 31300815
Bug: 31349114

Change-Id: I15b74ca74a801009cc8bdc7132bd53d0185dbcbf
/system/tools/hidl/ArrayType.cpp
f03332ac955bc6cb22873e236868eacfc3bf78cc 23-Sep-2016 Andreas Huber <andih@google.com> Arrays in .hal files are now exposed to C++ as hidl_array<T, SIZE ...>

instead of as native arrays. This allows them to be copied which in turn lets
them exist in vectors. In the Java backend, vectors are limited to
one-dimensional arrays and scalar arrays are properly wrapped,
i.e. vec<uint8_t[]> => Vector<Byte[]>

Change-Id: I47524ec8423dfb41a436df36af8fa05eb8b3c0cc
Bug: 31682327
Test: hidl_test and hidl_test_java
/system/tools/hidl/ArrayType.cpp
e77ca13d32e329fb1e516c27831b082082ef83c3 27-Sep-2016 Yifan Hong <elsk@google.com> Fix the bug that cast should not be public.

cast is a templated function and should
not be public.

Test: `mma`
Change-Id: I30193e022c210c78b16fdf3b5f331a0ef3cbbb27
/system/tools/hidl/ArrayType.cpp
f24fa85b362d7eb66c7b880f48e1e2e9916bc8a9 23-Sep-2016 Yifan Hong <elsk@google.com> Resolve constant expressions for external constants.

* Allow constant expressions to be used as array sizes
and as annotation values.

Bug: 31592132 allow constant expressions to be used as array sizes.
Bug: 31628863 Autofill values for enum type

Test: `make android.hardware.tests.expression@1.0` compiles
and generates enum class Color with autofilled values.
Test: `make hidl_test_java` succeeds.
Test: `make hidl_test && adb sync && adb shell hidl_test` succeeds.
Test: `mma`

Change-Id: I57377ec608503d4741d305e98144264b07973055
/system/tools/hidl/ArrayType.cpp
90e8fc2f8b9430e1dea9267a01e9a85bf1d7ffa9 22-Sep-2016 Andreas Huber <andih@google.com> Don't redeclare _hidl_array_offset_* locally, instead put each

field-reader/writer into a local scope.

Change-Id: I8bdadad4c3c5ab48d2d1664ccc31ebe59eea3552
Bug: 31675085
Test: run hidl_test, hidl_test_java
/system/tools/hidl/ArrayType.cpp
709b62dbda6184770bb34470ff550e02c1643e67 19-Sep-2016 Andreas Huber <andih@google.com> Arrays of arrays are now coalesced into a single multi-dimensional array type.

This is natively stored as a flat array of the element type.

Change-Id: I1b0eee51b496648a9c8445b835635deff1a90aab
Bug: 31438033
Test: run updated "hidl_test" and "hidl_test_java"
/system/tools/hidl/ArrayType.cpp
4c865b72b320a46f326a335cfd326b66b0e10f67 15-Sep-2016 Andreas Huber <andih@google.com> [Java hidl-gen] Fix multi-dimensional arrays (used within structures, not

as method arguments).

Bug: 31438033
Change-Id: I8e29ae8eca2a9ef8a320e37ca0bb79dcfa8a9b9a
/system/tools/hidl/ArrayType.cpp
f9d49f1468bd65595f6f0ae5f4d7300f4e95edf8 12-Sep-2016 Andreas Huber <andih@google.com> [C++ hidl-gen] Fix multi-dimensional arrays, vectors of arrays.

Bug: 31438033
Change-Id: I254e8bfeb8fbf665dd3836825aa271603be6d14c
/system/tools/hidl/ArrayType.cpp
a72e0d2be173cebf62f728b9d215808bd862f219 09-Sep-2016 Iliyan Malchev <malchev@google.com> Revert "Revert "Split out libhidl-gen and libhidl-gen-utils.""

Shared code between hidl-gen, c2hal, and VTS.

Also build for device, as we might use libhidl-gen reflectively in
future (for profiling and instrumentation).

Change-Id: Ia56901f4afbc12b7c2abee693e0ebea97ba76a8b
/system/tools/hidl/ArrayType.cpp
f630bc8736003dcf4aac3dfe47167beb6beb6c6a 09-Sep-2016 Andreas Huber <andih@google.com> Java support for passing vec<STRUCT-TYPE> and STRUCT-TYPE[] to and from methods.

Bug: 31380705
Change-Id: I7374538d0bc2b3562c997710bfa4ed1f95950589
/system/tools/hidl/ArrayType.cpp
979e099f1163ff75beed5776cd01fb409b90a0cd 07-Sep-2016 Steven Moreland <smoreland@google.com> Added knowledge of namespacing into generation.

This is the first step in making code aware of namespacing. Currently,
the solution to generate symbols which are properly namespaced is to
post-process text after it is being outputed by a Formatter. Ideally
objects will know what namespace they are in and be able to print
themselves out accordingly. This change specifically will allow
generated code to remove namespaces from symbols that don't need
to be qualified entirely without relying on post-processing to remove
the namespace.

Change-Id: Ie535d05a64eb3d6c7d3b5451abdaa289c574170f
/system/tools/hidl/ArrayType.cpp
cd5e666ab52890842304b5778d438129693a5f39 31-Aug-2016 Andreas Huber <andih@google.com> struct fields of type "array" should be declared "final".

Change-Id: I1d1d85439d090a88a9b6ac0539de6452876775d0
/system/tools/hidl/ArrayType.cpp
1aec397b1fdea7db4120dbe55b6995bb2a9d9138 26-Aug-2016 Andreas Huber <andih@google.com> Adds (C)opyright headers everywhere.

Change-Id: I453af702f80aa4159ef6c3d29d9514b4897adc0a
/system/tools/hidl/ArrayType.cpp
85eabdbe56720dcdcf130e5ca83129d47b143768 25-Aug-2016 Andreas Huber <andih@google.com> The hidl-gen Java backend now supports structures (NOT unions) and types.hal

files.

Bug: 30575790
Change-Id: I6461235a1c469ce1bdb279bfa3d531113c5788f9
/system/tools/hidl/ArrayType.cpp
864c771ca4ec8a01e31c7c243625b7a5f6316768 17-Aug-2016 Zhuoyao Zhang <zhuoyao@google.com> Enhanced hidl-gen support for generating vts files.

*Support callflow from mehtod annotations.
*Support inheritance for interfaces and types.
*Support Array and Union type.

b/30762234

Change-Id: I059b780d6362a557bb9cfd70d6c5ec0e73916ce3
/system/tools/hidl/ArrayType.cpp
70a59e1dc3dcf32f791d2dd7966111d4adf32eca 16-Aug-2016 Andreas Huber <andih@google.com> Validate upfront that an interface is compatible with our Java backend,

emit diagnostics if it is not. Also cleans up all other error messages to
clearly indicate an error condition.

Bug: 30876839
Change-Id: I18bcd723107ab93abcad38c976f3c38dda60a743
/system/tools/hidl/ArrayType.cpp
5158db484e5ab302368f191d75d5b1334c270e52 10-Aug-2016 Zhuoyao Zhang <zhuoyao@google.com> Extend hidl-gen to support generate vts file.

b/30762234

TODO: add regression test.

Change-Id: I1c31fd9a85805cd450ea03cc0ccc750a756d1009
/system/tools/hidl/ArrayType.cpp
2831d5145675ead9f2fb767bf5fe4ae56b88349f 15-Aug-2016 Andreas Huber <andih@google.com> Initial commit of Java backend to hidl-gen.

Change-Id: I38b62637df74d3e5daf702a8996502d0d5726033
/system/tools/hidl/ArrayType.cpp
549e2598843dcc092a6049bbd9e209c249b1b11a 10-Aug-2016 Iliyan Malchev <malchev@google.com> hidl-gen: remove references to AIDL

git grep -l _aidl_ . | xargs sed -i -e 's/_aidl_/_hidl_/g'

b/30778629 Generated code has many references to AIDL

Change-Id: I3172e7da7acd6ba8c8c332be7316317b0eb59136
Signed-off-by: Iliyan Malchev <malchev@google.com>
/system/tools/hidl/ArrayType.cpp
867fcb63af8c3ac96ed1b3f3950525aa70393bdf 03-Aug-2016 Andreas Huber <andih@google.com> bye bye, dump(), RefType no longer gets a name.
/system/tools/hidl/ArrayType.cpp
881227d860c59471eee31d39946e96ce2daa35d6 02-Aug-2016 Andreas Huber <andih@google.com> generate C++ interface header, proxy and stub headers and sources.
/system/tools/hidl/ArrayType.cpp
c9410c7e62a33fd7599b2f3e025093a2d171577e 28-Jul-2016 Andreas Huber <andih@google.com> initial commit of reimplementation of hidl-gen

commit 56da787631c17276bc987f19649c6c1ea92200c3
Author: Andreas Huber <andih@google.com>
Date: Thu Jul 28 12:18:57 2016 -0700

ast.cpp => AST.cpp

commit 095552aba072152d9c87475895cd2e97c43b7b03
Author: Andreas Huber <andih@google.com>
Date: Thu Jul 28 10:43:04 2016 -0700

TypeContainer => Scope, since it now also holds constants.

commit 89ec1c511e7806037a53e43333c37fdf1b7aa39e
Author: Andreas Huber <andih@google.com>
Date: Thu Jul 28 10:41:05 2016 -0700

initial support for constants

commit b60b7ae588654b634bfdc5c283a25dd6378e1df7
Author: Andreas Huber <andih@google.com>
Date: Thu Jul 28 10:01:46 2016 -0700

Support for typedef, maintain ordering inside TypeContainer

commit 8e83034a077ce2309deeb0e2094079cf6f11d8b4
Author: Andreas Huber <andih@google.com>
Date: Thu Jul 28 09:36:29 2016 -0700

support for optional super interface

commit 9d44b022adb4a68dfca67ba2a6d845b7c8f27b88
Author: Andreas Huber <andih@google.com>
Date: Thu Jul 28 09:28:18 2016 -0700

ast => AST

commit 48fd7f8a4e8ecf230cfc416aec6c8f6115e410af
Author: Andreas Huber <andih@google.com>
Date: Thu Jul 28 09:26:44 2016 -0700

Each type in its own source/header file pair.

commit ca1285ecbcbbb1340eec476e3fd4d1334908d8c1
Author: Andreas Huber <andih@google.com>
Date: Thu Jul 28 08:52:24 2016 -0700

added scalar types "char", "bool" and "opaque"

commit fbb351e5f4392fcbbce77402dfe059a1c8d79fb2
Author: Andreas Huber <andih@google.com>
Date: Wed Jul 27 13:47:32 2016 -0700

some fixes to the parser and ast.

commit 78288216b101349e9364c2d4470ecb5b9a942f5c
Author: Andreas Huber <andih@google.com>
Date: Wed Jul 27 12:34:21 2016 -0700

Formatter, AST::dump(), NamedType

commit 4b8cc5d0a8ff5f70cb53e21b56138124259b8bcb
Author: Andreas Huber <andih@google.com>
Date: Wed Jul 27 11:45:10 2016 -0700

revamp of the parser, scoped type containers

commit 0193fbfa5c7ac3ac1ce306dfb9c55d879f8c02b5
Author: Andreas Huber <andih@google.com>
Date: Wed Jul 27 10:13:35 2016 -0700

store output in AST.

commit 7f53022123978cc7c2a05b0c4aba7a4c5deea93b
Author: Andreas Huber <andih@google.com>
Date: Wed Jul 27 10:06:54 2016 -0700

reentrant lexer/parser

commit 3d3e343d6cea2fb127b203071e8aff08a5715011
Author: Andreas Huber <andih@google.com>
Date: Tue Jul 26 15:27:02 2016 -0700

better typename lookup, comments.

commit 39f13ae860dbd9ffd163a5c99f150170525457ef
Author: Andreas Huber <andih@google.com>
Date: Tue Jul 26 14:29:33 2016 -0700

an actual AST.

commit b1f3f1d94a8d1257426da35ace5bc2af04c433b6
Author: Andreas Huber <andih@google.com>
Date: Tue Jul 26 12:51:34 2016 -0700

initial commit

Change-Id: I44d1d928a5f3dcb908e264d53af09bbe25d8c464
/system/tools/hidl/ArrayType.cpp