aboutsummaryrefslogtreecommitdiff
path: root/HandleType.h
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2018-02-16 14:21:49 -0800
committerSteven Moreland <smoreland@google.com>2018-02-21 16:54:28 +0000
commit6ec9eb9ae9adedf62fb928e3158f316f838e07dd (patch)
tree29876f77fad415dc5847d8ff402e138eef1aabfe /HandleType.h
parent06a088b75be66cee2b1c5c0d21bc976ea1f601f2 (diff)
downloadhidl-6ec9eb9ae9adedf62fb928e3158f316f838e07dd.tar.gz
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 Merged-In: I8988e1fdf16e15b925c0a613122c41e6a41bd4dd Change-Id: I8988e1fdf16e15b925c0a613122c41e6a41bd4dd
Diffstat (limited to 'HandleType.h')
-rw-r--r--HandleType.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/HandleType.h b/HandleType.h
index 754aad7f..feaddb00 100644
--- a/HandleType.h
+++ b/HandleType.h
@@ -64,7 +64,7 @@ struct HandleType : public Type {
void getAlignmentAndSize(size_t *align, size_t *size) const override;
- status_t emitVtsTypeDeclarations(Formatter &out) const override;
+ void emitVtsTypeDeclarations(Formatter& out) const override;
};
} // namespace android