cleanup: removed unused -m option
-m was introduced to support "direct import" without searching them in
import dirs (-I), which was the case of compiling API dump.
But now we use -I (import dirs) -p (imported preprocessed modules), but
do not use -m any longer.
Bug: n/a
Test: m
Change-Id: I3943e4d992213fdaa48693bd2539d544019fa802
diff --git a/aidl.cpp b/aidl.cpp
index 18eb2f5..fe4ae3f 100644
--- a/aidl.cpp
+++ b/aidl.cpp
@@ -431,20 +431,6 @@
return err;
}
- for (const auto& imported_file : options.ImportFiles()) {
- import_paths.emplace_back(imported_file);
-
- auto impoted_doc = Parser::Parse(imported_file, io_delegate, *typenames);
- if (impoted_doc == nullptr) {
- AIDL_ERROR(imported_file) << "error while importing " << imported_file;
- err = AidlError::BAD_IMPORT;
- continue;
- }
- }
- if (err != AidlError::OK) {
- return err;
- }
-
TypeResolver resolver = [&](const AidlDefinedType* scope, AidlTypeSpecifier* type) {
if (type->Resolve(*typenames)) return true;
diff --git a/options.cpp b/options.cpp
index b383052..d06276f 100644
--- a/options.cpp
+++ b/options.cpp
@@ -79,8 +79,6 @@
sstr << "OPTION:" << endl
<< " -I DIR, --include=DIR" << endl
<< " Use DIR as a search path for import statements." << endl
- << " -m FILE, --import=FILE" << endl
- << " Import FILE directly without searching in the search paths." << endl
<< " -p FILE, --preprocessed=FILE" << endl
<< " Include FILE which is created by --preprocess." << endl
<< " -d FILE, --dep=FILE" << endl
@@ -220,7 +218,6 @@
#endif
{"apimapping", required_argument, 0, 'i'},
{"include", required_argument, 0, 'I'},
- {"import", required_argument, 0, 'm'},
{"preprocessed", required_argument, 0, 'p'},
{"dep", required_argument, 0, 'd'},
{"out", required_argument, 0, 'o'},
@@ -237,7 +234,7 @@
{0, 0, 0, 0},
};
const int c = getopt_long(argc, const_cast<char* const*>(argv.data()),
- "I:m:p:d:o:h:abtv:", long_options, nullptr);
+ "I:p:d:o:h:abtv:", long_options, nullptr);
if (c == -1) {
// no more options
break;
@@ -306,10 +303,6 @@
import_dirs_.emplace(Trim(optarg));
break;
}
- case 'm': {
- import_files_.emplace(Trim(optarg));
- break;
- }
case 'p':
preprocessed_files_.emplace_back(Trim(optarg));
break;
diff --git a/options.h b/options.h
index 7d338bd..ebbd004 100644
--- a/options.h
+++ b/options.h
@@ -112,8 +112,6 @@
const set<string>& ImportDirs() const { return import_dirs_; }
- const set<string>& ImportFiles() const { return import_files_; }
-
const vector<string>& PreprocessedFiles() const { return preprocessed_files_; }
string DependencyFile() const {
@@ -177,7 +175,6 @@
Task task_ = Task::COMPILE;
CheckApiLevel check_api_level_ = CheckApiLevel::COMPATIBLE;
set<string> import_dirs_;
- set<string> import_files_;
vector<string> preprocessed_files_;
string dependency_file_;
bool gen_traces_ = false;