aconfig: update c/c++ codegen
Two major changes to c/c++ codegen (1) explicit setter for each flag instead of a generic flag setter void override_flag(std::string name, bool val) is replaced with void <flag name>(bool val) for each flag name This has several advantages: (a) generated code is more c++ idomatic (b) no longer need to create flag name string constants (c) any typo in the code is caught early in the build time (2) remove flag setter and flag override reset methods/functions when generating code targets for production. If developers want to update their main function to take command line arg for flag overrides, they can use compile time macros to decide if the flag override code should be included. Bug: b/279483801 Test: atest aconfig.test Change-Id: I6141f7f979b32fe0426154d578edeb997ae5ff7c
Loading
Please register or sign in to comment