Skip to content

Commit 82f424f

Browse files
committed
Revert "[clang][modules] Print library module manifest path. (llvm#76451)"
This reverts commit a301fb1. The changes caused failures like: https://lab.llvm.org/buildbot/#/builders/91/builds/22189
1 parent 5daf674 commit 82f424f

File tree

4 files changed

+0
-93
lines changed

4 files changed

+0
-93
lines changed

clang/include/clang/Driver/Driver.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -602,16 +602,6 @@ class Driver {
602602
// FIXME: This should be in CompilationInfo.
603603
std::string GetProgramPath(StringRef Name, const ToolChain &TC) const;
604604

605-
/// Lookup the path to the Standard library module manifest.
606-
///
607-
/// \param C - The compilation.
608-
/// \param TC - The tool chain for additional information on
609-
/// directories to search.
610-
//
611-
// FIXME: This should be in CompilationInfo.
612-
std::string GetStdModuleManifestPath(const Compilation &C,
613-
const ToolChain &TC) const;
614-
615605
/// HandleAutocompletions - Handle --autocomplete by searching and printing
616606
/// possible flags, descriptions, and its arguments.
617607
void HandleAutocompletions(StringRef PassedFlags) const;

clang/include/clang/Driver/Options.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5310,9 +5310,6 @@ def print_resource_dir : Flag<["-", "--"], "print-resource-dir">,
53105310
def print_search_dirs : Flag<["-", "--"], "print-search-dirs">,
53115311
HelpText<"Print the paths used for finding libraries and programs">,
53125312
Visibility<[ClangOption, CLOption]>;
5313-
def print_std_module_manifest_path : Flag<["-", "--"], "print-library-module-manifest-path">,
5314-
HelpText<"Print the path for the C++ Standard library module manifest">,
5315-
Visibility<[ClangOption, CLOption]>;
53165313
def print_targets : Flag<["-", "--"], "print-targets">,
53175314
HelpText<"Print the registered targets">,
53185315
Visibility<[ClangOption, CLOption]>;

clang/lib/Driver/Driver.cpp

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2194,12 +2194,6 @@ bool Driver::HandleImmediateArgs(const Compilation &C) {
21942194
return false;
21952195
}
21962196

2197-
if (C.getArgs().hasArg(options::OPT_print_std_module_manifest_path)) {
2198-
llvm::outs() << GetStdModuleManifestPath(C, C.getDefaultToolChain())
2199-
<< '\n';
2200-
return false;
2201-
}
2202-
22032197
if (C.getArgs().hasArg(options::OPT_print_runtime_dir)) {
22042198
if (std::optional<std::string> RuntimePath = TC.getRuntimePath())
22052199
llvm::outs() << *RuntimePath << '\n';
@@ -6172,44 +6166,6 @@ std::string Driver::GetProgramPath(StringRef Name, const ToolChain &TC) const {
61726166
return std::string(Name);
61736167
}
61746168

6175-
std::string Driver::GetStdModuleManifestPath(const Compilation &C,
6176-
const ToolChain &TC) const {
6177-
std::string error = "<NOT PRESENT>";
6178-
6179-
switch (TC.GetCXXStdlibType(C.getArgs())) {
6180-
case ToolChain::CST_Libcxx: {
6181-
std::string lib = GetFilePath("libc++.so", TC);
6182-
6183-
// Note when there are multiple flavours of libc++ the module json needs to
6184-
// look at the command-line arguments for the proper json.
6185-
// These flavours do not exist at the moment, but there are plans to
6186-
// provide a variant that is built with sanitizer instrumentation enabled.
6187-
6188-
// For example
6189-
// StringRef modules = [&] {
6190-
// const SanitizerArgs &Sanitize = TC.getSanitizerArgs(C.getArgs());
6191-
// if (Sanitize.needsAsanRt())
6192-
// return "modules-asan.json";
6193-
// return "modules.json";
6194-
// }();
6195-
6196-
SmallString<128> path(lib.begin(), lib.end());
6197-
llvm::sys::path::remove_filename(path);
6198-
llvm::sys::path::append(path, "modules.json");
6199-
if (TC.getVFS().exists(path))
6200-
return static_cast<std::string>(path);
6201-
6202-
return error;
6203-
}
6204-
6205-
case ToolChain::CST_Libstdcxx:
6206-
// libstdc++ does not provide Standard library modules yet.
6207-
return error;
6208-
}
6209-
6210-
return error;
6211-
}
6212-
62136169
std::string Driver::GetTemporaryPath(StringRef Prefix, StringRef Suffix) const {
62146170
SmallString<128> Path;
62156171
std::error_code EC = llvm::sys::fs::createTemporaryFile(Prefix, Suffix, Path);

clang/test/Driver/modules-print-library-module-manifest-path.cpp

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)