Revert "Compute but do not generate code for dependencies"
This reverts commit 9e4d8bc6d9321fd487ca3af9b11d86a54b346727.
diff --git a/main.cpp b/main.cpp
index be1ddf9..4059202 100644
--- a/main.cpp
+++ b/main.cpp
@@ -3,7 +3,6 @@
#include "FQName.h"
#include <android-base/logging.h>
-#include <set>
#include <stdio.h>
#include <string>
#include <unistd.h>
@@ -19,9 +18,6 @@
fprintf(stderr, " -o output path\n");
fprintf(stderr,
- " -A auto-generate code for dependencies as well\n");
-
- fprintf(stderr,
" -r package:path root "
"(e.g., android.hardware:hardware/interfaces)\n");
}
@@ -30,12 +26,11 @@
std::string outputDir;
std::vector<std::string> packageRootPaths;
std::vector<std::string> packageRoots;
- bool transitiveEmit = false;
const char *me = argv[0];
int res;
- while ((res = getopt(argc, argv, "Aho:r:")) >= 0) {
+ while ((res = getopt(argc, argv, "ho:r:")) >= 0) {
switch (res) {
case 'o':
{
@@ -43,12 +38,6 @@
break;
}
- case 'A':
- {
- transitiveEmit = true;
- break;
- }
-
case 'r':
{
std::string val(optarg);
@@ -104,8 +93,6 @@
Coordinator coordinator(packageRootPaths, packageRoots);
- std::set<AST *> topLevelASTs;
-
for (int i = 0; i < argc; ++i) {
FQName fqName(argv[i]);
CHECK(fqName.isValid() && fqName.isFullyQualified());
@@ -119,21 +106,13 @@
exit(1);
}
-
- topLevelASTs.insert(ast);
}
// Now that we've found the transitive hull of all necessary interfaces
// and types to process, go ahead and do the work.
status_t err = coordinator.forEachAST(
- [&](const AST *ast) -> status_t {
- if (transitiveEmit
- || (topLevelASTs.find(const_cast<AST *>(ast)) !=
- topLevelASTs.end())) {
- return ast->generateCpp(outputDir);
- }
-
- return OK;
+ [&](const AST *ast) {
+ return ast->generateCpp(outputDir);
});
return (err == OK) ? 0 : 1;