Skip to content

Commit

Permalink
Revert "[CGData] LLD for MachO (#90166)"
Browse files Browse the repository at this point in the history
This reverts commit 00c0b1a.
  • Loading branch information
Kyungwoo Lee committed Sep 15, 2024
1 parent 00c0b1a commit 9de2603
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 135 deletions.
1 change: 0 additions & 1 deletion lld/MachO/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ struct Configuration {
std::vector<SectionAlign> sectionAlignments;
std::vector<SegmentProtection> segmentProtections;
bool ltoDebugPassManager = false;
llvm::StringRef codegenDataGeneratePath;
bool csProfileGenerate = false;
llvm::StringRef csProfilePath;
bool pgoWarnMismatch;
Expand Down
38 changes: 0 additions & 38 deletions lld/MachO/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/MachO.h"
#include "llvm/BinaryFormat/Magic.h"
#include "llvm/CGData/CodeGenDataWriter.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/LTO/LTO.h"
#include "llvm/Object/Archive.h"
Expand Down Expand Up @@ -1323,37 +1322,6 @@ static void gatherInputSections() {
}
}

static void codegenDataGenerate() {
TimeTraceScope timeScope("Generating codegen data");

OutlinedHashTreeRecord globalOutlineRecord;
for (ConcatInputSection *isec : inputSections)
if (isec->getSegName() == segment_names::data &&
isec->getName() == section_names::outlinedHashTree) {
// Read outlined hash tree from each section.
OutlinedHashTreeRecord localOutlineRecord;
auto *data = isec->data.data();
localOutlineRecord.deserialize(data);

// Merge it to the global hash tree.
globalOutlineRecord.merge(localOutlineRecord);
}

CodeGenDataWriter Writer;
if (!globalOutlineRecord.empty())
Writer.addRecord(globalOutlineRecord);

std::error_code EC;
auto fileName = config->codegenDataGeneratePath;
assert(!fileName.empty());
raw_fd_ostream Output(fileName, EC, sys::fs::OF_None);
if (EC)
error("fail to create " + fileName + ": " + EC.message());

if (auto E = Writer.write(Output))
error("fail to write CGData: " + toString(std::move(E)));
}

static void foldIdenticalLiterals() {
TimeTraceScope timeScope("Fold identical literals");
// We always create a cStringSection, regardless of whether dedupLiterals is
Expand Down Expand Up @@ -1791,8 +1759,6 @@ bool link(ArrayRef<const char *> argsArr, llvm::raw_ostream &stdoutOS,
config->ignoreAutoLinkOptions.insert(arg->getValue());
config->strictAutoLink = args.hasArg(OPT_strict_auto_link);
config->ltoDebugPassManager = args.hasArg(OPT_lto_debug_pass_manager);
config->codegenDataGeneratePath =
args.getLastArgValue(OPT_codegen_data_generate_path);
config->csProfileGenerate = args.hasArg(OPT_cs_profile_generate);
config->csProfilePath = args.getLastArgValue(OPT_cs_profile_path);
config->pgoWarnMismatch =
Expand Down Expand Up @@ -2137,10 +2103,6 @@ bool link(ArrayRef<const char *> argsArr, llvm::raw_ostream &stdoutOS,
}

gatherInputSections();

if (!config->codegenDataGeneratePath.empty())
codegenDataGenerate();

if (config->callGraphProfileSort)
priorityBuilder.extractCallGraphProfile();

Expand Down
1 change: 0 additions & 1 deletion lld/MachO/InputSection.h
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ constexpr const char objcMethname[] = "__objc_methname";
constexpr const char objcNonLazyCatList[] = "__objc_nlcatlist";
constexpr const char objcNonLazyClassList[] = "__objc_nlclslist";
constexpr const char objcProtoList[] = "__objc_protolist";
constexpr const char outlinedHashTree[] = "__llvm_outline";
constexpr const char pageZero[] = "__pagezero";
constexpr const char pointers[] = "__pointers";
constexpr const char rebase[] = "__rebase";
Expand Down
4 changes: 0 additions & 4 deletions lld/MachO/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,6 @@ def no_objc_category_merging : Flag<["-"], "no_objc_category_merging">,
Group<grp_lld>;
def lto_debug_pass_manager: Flag<["--"], "lto-debug-pass-manager">,
HelpText<"Debug new pass manager">, Group<grp_lld>;
def codegen_data_generate_path : Separate<["--"], "codegen-data-generate-path">, Group<grp_lld>;
def codegen_data_generate_path_eq : Joined<["--"], "codegen-data-generate-path=">,
Alias<!cast<Separate>(codegen_data_generate_path)>, MetaVarName<"<cgdata>">,
HelpText<"Write the CG data to the specified path <cgdata>.">, Group<grp_lld>;
def cs_profile_generate: Flag<["--"], "cs-profile-generate">,
HelpText<"Perform context sensitive PGO instrumentation">, Group<grp_lld>;
def cs_profile_path: Joined<["--"], "cs-profile-path=">,
Expand Down
1 change: 0 additions & 1 deletion lld/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ if (NOT LLD_BUILT_STANDALONE)
llvm-ar
llvm-as
llvm-bcanalyzer
llvm-cgdata
llvm-config
llvm-cvtres
llvm-dis
Expand Down
89 changes: 0 additions & 89 deletions lld/test/MachO/cgdata-generate.s

This file was deleted.

1 change: 0 additions & 1 deletion lld/test/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
tool_patterns = [
"llc",
"llvm-as",
"llvm-cgdata",
"llvm-mc",
"llvm-nm",
"llvm-objdump",
Expand Down

0 comments on commit 9de2603

Please sign in to comment.