clang_generator: Remove `.isystem` parameter file support
The corresponding command-line option `sapi_isystem` will be ignored for
compatibility.
PiperOrigin-RevId: 439806387
Change-Id: I8ad6d7feed2fba5fca9940281f03cfc757ada5be
diff --git a/sandboxed_api/tools/clang_generator/generator_tool.cc b/sandboxed_api/tools/clang_generator/generator_tool.cc
index f476482..0078119 100644
--- a/sandboxed_api/tools/clang_generator/generator_tool.cc
+++ b/sandboxed_api/tools/clang_generator/generator_tool.cc
@@ -61,11 +61,12 @@
llvm::cl::cat(*g_tool_category));
static auto* g_sapi_in = new llvm::cl::list<std::string>(
"sapi_in", llvm::cl::CommaSeparated,
- llvm::cl::desc("List of input files to analyze."),
+ llvm::cl::desc("List of input files to analyze (deprecated)"),
llvm::cl::cat(*g_tool_category));
static auto* g_sapi_isystem = new llvm::cl::opt<std::string>(
"sapi_isystem",
- llvm::cl::desc("Parameter file with extra system include paths"),
+ llvm::cl::desc("Parameter file with extra system include paths (ignored "
+ "for compatibility)"),
llvm::cl::cat(*g_tool_category));
static auto* g_sapi_limit_scan_depth = new llvm::cl::opt<bool>(
"sapi_limit_scan_depth",
@@ -127,19 +128,10 @@
NonOwningCompileCommands(opt_parser.getCompilations()));
clang::tooling::ClangTool tool(*db, sources);
- // TODO(cblichmann): Rmove the .isystem files. CMake does not need them, and
- // we can get the information in Bazel from the toolchain.
- if (!sapi::g_sapi_isystem->empty()) {
- std::string isystem_lines;
- SAPI_RETURN_IF_ERROR(sapi::file::GetContents(
- *sapi::g_sapi_isystem, &isystem_lines, sapi::file::Defaults()));
- std::vector<std::string> isystem =
- absl::StrSplit(isystem_lines, '\n', absl::SkipWhitespace());
- for (std::string& line : isystem) {
- line.insert(0, "-isystem");
- }
- tool.appendArgumentsAdjuster(clang::tooling::getInsertArgumentAdjuster(
- isystem, clang::tooling::ArgumentInsertPosition::BEGIN));
+ if (!g_sapi_isystem->empty()) {
+ absl::FPrintF(
+ stderr,
+ "Note: Ignoring deprecated command-line option: sapi_isystem\n");
}
if (int result = tool.run(