History log of /system/tools/hidl/ScalarType.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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/ScalarType.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/ScalarType.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/ScalarType.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/ScalarType.cpp
9df5244c1dd4508cc2e25f8a04d363903912d19c 12-Dec-2016 Steven Moreland <smoreland@google.com> Cleanup way elidable types are determined.

After adding the pointer type, it didn't make sense for elidable types
to be specified in canElideCallback. Now the decision as to whether a
specific type is elidable has been moved into 'isElidableType' on the
Type class.

Bug: 33298401
Test: mma in hardware/interfaces
Change-Id: I66cbaed4c533013a52e59fc8e7edcdabc9ab9f20
/system/tools/hidl/ScalarType.cpp
abf73eef7f23f0b0ba0fe85694dcd511f4e69962 06-Dec-2016 Yifan Hong <elsk@google.com> Add is*() functions for more types.

Test: compiles
Change-Id: Ibeba6c814ac17192481935a067b7c835c4008dc7
/system/tools/hidl/ScalarType.cpp
30bb6a869be0f3f82497b7b11c71ec9d47652ed0 30-Nov-2016 Steven Moreland <smoreland@google.com> Add a typeName() method to each type for error printing purposes.

Test: compiles with mma
Change-Id: I1283c395440282fde1106ad47aa185bdeda75880
/system/tools/hidl/ScalarType.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/ScalarType.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/ScalarType.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/ScalarType.cpp
8efccec25e4010829fff42d5d953dfb83549d807 06-Oct-2016 Steven Moreland <smoreland@google.com> Remove opaque type from hidl.

Test: make, hidl_test, make hardware/interfaces.
Bug: 31798800

Change-Id: I45db5baa81d9afa9b05e32fec1152802328ce9d4
/system/tools/hidl/ScalarType.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/ScalarType.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/ScalarType.cpp
5001d93d830fd273178f40e00784e2fc8abe83e5 14-Sep-2016 Andreas Huber <andih@google.com> Fix mistaken Java wrapper type for "int".

Bug: 31485924
Change-Id: I612477c9eb20239dc9ada261aab4fbc38bf7a840
/system/tools/hidl/ScalarType.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/ScalarType.cpp
194c2ffccef2dd1c515397e597f26b184bc1269b 10-Sep-2016 Steven Moreland <smoreland@google.com> Revert "split out libhidl-gen and libhidl-gen-utils"

This reverts commit 1316091aaf89abc73ab11539b61b20f13ee261c4.

Change-Id: I97acad6cadd847cb5540ffe0258b081d7901c1e9
/system/tools/hidl/ScalarType.cpp
1316091aaf89abc73ab11539b61b20f13ee261c4 09-Sep-2016 Iliyan Malchev <malchev@google.com> 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: Iffdcbf99308e1f69a504e89fcbb4c9447a6bbe7e
Signed-off-by: Iliyan Malchev <malchev@google.com>
/system/tools/hidl/ScalarType.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/ScalarType.cpp
5788697381666844eeb23e04e5c6f83ec6ec8b44 17-Aug-2016 Yifan Hong <elsk@google.com> Evaluate constant expressions.

* The rules for evaluating constant expressions are very much
like that in C/C++, in which (u)int32_t are treated as
(unsigned) int and (u)int64_t are treated as (unsigned) long.

* Detailed rules can be found at the end of ConstantExpression.cpp.

* Only bool and integer types are evaluated. float, double
are not evaluated (not even parsed; so a syntax error will
be raised).

* Const-declared identifiers are parsed, but not evaluated.

* Only evaluate expressions for enum types. Array length and
annotation parameter values are not evaluated.

* Original expression is formatted and placed as a trailing comment
(only available in C++ format).

* Tests can be found at Icacba6b6262cc0026a94f64527b80e2c0e35e72e.

Change-Id: Ia33b68a053727747ec87b0e77c361ca19c9f41fd
/system/tools/hidl/ScalarType.cpp
199335277986f45bef3aaf8787d57b4c3c6b6b9a 30-Aug-2016 Zhuoyao Zhang <zhuoyao@google.com> A few fix of hidl-gen for vts generator.

* Remove component_type.
* Use the new VectorDataValueMessage.

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

Change-Id: I453af702f80aa4159ef6c3d29d9514b4897adc0a
/system/tools/hidl/ScalarType.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/ScalarType.cpp
d85a509cf9f192004fecfcb841adf94f6835ce61 25-Aug-2016 Andreas Huber <andih@google.com> Use the new "Bool*" accessor methods for booleans instead of treating them like

int8_t.

Bug: 31045584
Change-Id: Ib9bea2c2ffd0ea21bee09240da29c5e27791c505
/system/tools/hidl/ScalarType.cpp
9ed827c8cd6e8eddb1ad9987ab9413c1de8a27df 22-Aug-2016 Andreas Huber <andih@google.com> Fix nested structure/union name handling.

Local names must be assigned before processing the body.

Change-Id: I9c3e3d4b7575c612148aea89bbd424e59e3c0604
/system/tools/hidl/ScalarType.cpp
3179b22facb8720726e98ae70968df47e2a115d7 18-Aug-2016 Andreas Huber <andih@google.com> 'char' is no longer an acceptable hidl type. Use int8_t or uint8_t instead.

Bug: 30922140
Change-Id: Id21a1e92a5ad6cd38efd6dda3c8bcfe601c63537
/system/tools/hidl/ScalarType.cpp
e0b2867b41543603a170c3e9ca8410b9eb647601 14-Aug-2016 Iliyan Malchev <malchev@google.com> hidl-gen: emit read/writeBool() for booleans

b/30853785 auto-generation for bools is broken

Change-Id: I00f59b0bd645d938d4367ee9205dc3bf625de7dd
Signed-off-by: Iliyan Malchev <malchev@google.com>
/system/tools/hidl/ScalarType.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/ScalarType.cpp
2831d5145675ead9f2fb767bf5fe4ae56b88349f 15-Aug-2016 Andreas Huber <andih@google.com> Initial commit of Java backend to hidl-gen.

Change-Id: I38b62637df74d3e5daf702a8996502d0d5726033
/system/tools/hidl/ScalarType.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/ScalarType.cpp
8d3ac0c6112e02e3a705fd4f9d82e523f10b4287 04-Aug-2016 Andreas Huber <andih@google.com> Be a little smarter about dealing with TypeDefs, resolve to the typedef'd

target at lookup time, so all code ever sees is anything _but_ TypeDefs.
Also verify that the optional Enum storage type is valid (i.e. an enum
or an integer type) and re-emit enum values for derived enum types.
/system/tools/hidl/ScalarType.cpp
867fcb63af8c3ac96ed1b3f3950525aa70393bdf 03-Aug-2016 Andreas Huber <andih@google.com> bye bye, dump(), RefType no longer gets a name.
/system/tools/hidl/ScalarType.cpp
737080baf85882c45bb322ee2191ae5fd9e1283a 03-Aug-2016 Andreas Huber <andih@google.com> Keeping track of imported names, resolve enum storage types, some finetuning.
/system/tools/hidl/ScalarType.cpp
881227d860c59471eee31d39946e96ce2daa35d6 02-Aug-2016 Andreas Huber <andih@google.com> generate C++ interface header, proxy and stub headers and sources.
/system/tools/hidl/ScalarType.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/ScalarType.cpp