History log of /system/tools/hidl/Scope.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
2639fa32c9d9cc37a15e771b26aaa6cea415b499 30-Mar-2017 Andreas Huber <andih@google.com> More stringently verify expected alignment of fields in hidl compound types.

Bug: 33846034
Test: make
Change-Id: Iaadddeabe04e0c721aa9398a1bb748fd6adcac51
/system/tools/hidl/Scope.cpp
244e82d34bf0ef5d8d5b0730a9dea3e3fc4de7c5 11-Nov-2016 Yifan Hong <elsk@google.com> move read/writeEmbedded[References]From/ToParcel out

from hidl_string, hidl_vec, and structs.

* Add a hwtypes.h in the autogenerated files, which
contains the read/writeEmbeddedFrom/ToParcel
methods for structs defined in types.h.

* Fixes the hack that remove the warnings when compiling
the generated code (useParentInEmitResolveReferencesEmbedded())
and add one more hack (useNameInEmitReaderWriterEmbedded())

* Some clean-up on Scope.cpp (add a forEachType function)

Test: mma
Test: hidl_test

Bug: 32756130

Change-Id: Icfd116b5d92fef78d257337c3f2ef02071f7600b
/system/tools/hidl/Scope.cpp
a4b53d0da8c1c6889c361fd30b913adc364163bc 01-Nov-2016 Yifan Hong <elsk@google.com> Add location info to named types.

Bug: 31827278

Test: hidl_test
Change-Id: I1922d5c309c9706cef37ab34d28e1193d1e247cd
/system/tools/hidl/Scope.cpp
6a2fedf6d86fe32d5d005dd3b87f296f23ed6a11 11-Oct-2016 Yifan Hong <elsk@google.com> hidl-gen: remove support for anonymous enums.

* There is no anonymous things allow in HIDL.
Scope::pickUniqueAnonymousName is removed.

Test: hidl_test
Test: cd system/tools/hidl && mma
Test: cd hardware/interfaces && mma

Change-Id: Iebcb001b34e05b32378dbcb8b2b06e045d8c221a
/system/tools/hidl/Scope.cpp
e3f769aa75dd6be6bb1ba83904def47d9e464769 10-Oct-2016 Andreas Huber <andih@google.com> Enum types now emit operator| and operator|= for easier bitset manipulation.

Bug: 31702236
Change-Id: I166da2fe0019493c81151914ebabf591b705a713
Test: visual check, mma
/system/tools/hidl/Scope.cpp
019d21db821ee4ae6dd3858174a0a5cee4d33c25 03-Oct-2016 Andreas Huber <andih@google.com> Yet another backend for hidl-gen, this one generates a C-compatible header file

containing those enum types annotated in the package like so:

@export
enum Foo {
...
};

Optionally, the name to be used for the type declaration in the header file
can be different from that used in the .hal interface description by specifying

@export(name="foo_t")
enum Foo {
...
};

Finally, overriding the name to be empty, i.e.

@export(name="")
enum Foo {
...
};

will cause the generator to emit an anonymous enum.

Bug: 31800672
Change-Id: Idffb2c1700af1c7fd312941d80c3373add8ae558
Test: make
/system/tools/hidl/Scope.cpp
327cfe12d51908469e1544db14a9232e0ddc6855 03-Oct-2016 Yifan Hong <elsk@google.com> hidl-gen: Fix nested type cannot be found.

Bug: 31821285

Test: `mma`
Test: `make hidl_test && adb sync && adb shell hidl_test`
Change-Id: I4a407e65973d85f76b43adff668155f15b783946
/system/tools/hidl/Scope.cpp
7c5ddfb41a806a7bf71581952d06b637a7670cf7 29-Sep-2016 Andreas Huber <andih@google.com> Allow struct, union and enum type declarations to be annotated.

Change-Id: Idce594b47c324d8420638e2e8853da3c99150672
Bug: 31800672
Test: hidl_test, hidl_test_java
/system/tools/hidl/Scope.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/Scope.cpp
ae16eeda35e175dbc3cb0651121854c5788e522e 23-Sep-2016 Yifan Hong <elsk@google.com> Redefine fqname in hidl-gen_y.yy

There is an inconsistency in hidl-gen_y.yy that fqname does not
mean an FQName object, but a Type object. Redefined fqname to create
an FQName object only, and rename the original fqname rule to fqtype.

This also propagates to AST::lookupType and Scope::lookupType to
take an FQName object instead of a plain string.

Test: `mma`
Test: `make hidl_test && adb sync && adb shell hidl_test`
Change-Id: I5d35192fa5fa9752b10bd9e7d339eadc5cdb78c0
/system/tools/hidl/Scope.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/Scope.cpp
d537ab02e1707597d70665fd8c75ca1ec9f57326 12-Sep-2016 Steven Moreland <smoreland@google.com> Remove dependency on libutils.

As part of this, TypeDef has also been converted to a NamedType. This is
because originally, Scope contained just a KeyedVector<localname, idx> of
types which it contained, and an std::vector<type> which idx indexes into
(KeyedVector<localname, type> alone would have also worked). However, now
it contains a std::map<localname, idx> instead. Because of this, we have lost
the ability to iterate over the keys (localnames) in O(n). By converting
TypeDef to a NamedType, name => idx => type such that name == type->name.
This also means that in function hierarchy calling Scope::addType, we no
longer have to pass around the tuple (name, type) since type->name == name,
and we can pass around only type.

Change-Id: I8f85afe0e389979a2fd98ff5eeccf47e3fcc8307
/system/tools/hidl/Scope.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/Scope.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/Scope.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/Scope.cpp
1aec397b1fdea7db4120dbe55b6995bb2a9d9138 26-Aug-2016 Andreas Huber <andih@google.com> Adds (C)opyright headers everywhere.

Change-Id: I453af702f80aa4159ef6c3d29d9514b4897adc0a
/system/tools/hidl/Scope.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/Scope.cpp
80b217fa80694377cc0ad043e2385467dae2e179 24-Aug-2016 Andreas Huber <andih@google.com> Merge "Fix nested structure/union name handling."
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/Scope.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/Scope.cpp
39fa71827738f6c1340e4523946fe9bf704eef3a 19-Aug-2016 Andreas Huber <andih@google.com> Improved name lookup in order to allow partial names to refer to external

(imported) packages.

Bug: 30977424
Change-Id: I0a3757d6c3b10229627e2c1d6bc6176f88e13151
/system/tools/hidl/Scope.cpp
0d0f9a2e0195a8609f1939c35bd8907253b68249 17-Aug-2016 Andreas Huber <andih@google.com> Switch to 'glr' skeleton parser, better diagnostics through location tracking.

Change-Id: I34f510f3bf8d1e6da06de350456bd2804ca236db
Bug: 28679009
/system/tools/hidl/Scope.cpp
edad10fc2fa1435eb3a19a0ba119eb90c16d91b5 18-Aug-2016 Andreas Huber <andih@google.com> Remove support for "const" in hidl.

Bug: 30453525
Change-Id: Ia146bec538ae44d7987057e90b6c36c85d31ef0a
/system/tools/hidl/Scope.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/Scope.cpp
c7dfef3fda2061dcaeeb144c10eef3cf7360b03c 16-Aug-2016 Andreas Huber <andih@google.com> Better diagnostics if an attempt is made to redeclare a type under the same name

as an existing type in that scope. Support for anonymous struct/unions.

Change-Id: I0122cfae4da848419956c7b27bacaca66f8021d5
Bug: 30896059
/system/tools/hidl/Scope.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/Scope.cpp
2831d5145675ead9f2fb767bf5fe4ae56b88349f 15-Aug-2016 Andreas Huber <andih@google.com> Initial commit of Java backend to hidl-gen.

Change-Id: I38b62637df74d3e5daf702a8996502d0d5726033
/system/tools/hidl/Scope.cpp
0e00de41d11a83ce3becb0dbd20b799acceb19a7 03-Aug-2016 Andreas Huber <andih@google.com> Simplify overly long fully specified type names by stripping out the current

namespace prefix if possible. Properly include "types.h" for regular
(non-interface) types. Emit full names where appropriate.
/system/tools/hidl/Scope.cpp
31629bcd51ab30bc0aadc69f3fc8ce4893eca900 03-Aug-2016 Andreas Huber <andih@google.com> Saner determination of a declared type's name (now short + full name)

at the time the type is introduced to a scope.
/system/tools/hidl/Scope.cpp
867fcb63af8c3ac96ed1b3f3950525aa70393bdf 03-Aug-2016 Andreas Huber <andih@google.com> bye bye, dump(), RefType no longer gets a name.
/system/tools/hidl/Scope.cpp
881227d860c59471eee31d39946e96ce2daa35d6 02-Aug-2016 Andreas Huber <andih@google.com> generate C++ interface header, proxy and stub headers and sources.
/system/tools/hidl/Scope.cpp
a2723d26427f7db19777dfed330047253e7a4e1b 30-Jul-2016 Andreas Huber <andih@google.com> Enforce naming conventions and allow empty (except for the header) types.hal files.
/system/tools/hidl/Scope.cpp
5345ec2b1b7e4126b77aa2131b231a9eb5ee811d 29-Jul-2016 Andreas Huber <andih@google.com> Recursively parse imported .hal files and perform global type lookup.
/system/tools/hidl/Scope.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/Scope.cpp