|
36 | 36 | #include "llvm/ADT/StringRef.h" |
37 | 37 | #include "llvm/BinaryFormat/MachO.h" |
38 | 38 | #include "llvm/BinaryFormat/Magic.h" |
39 | | -#include "llvm/CGData/CodeGenDataWriter.h" |
40 | 39 | #include "llvm/Config/llvm-config.h" |
41 | 40 | #include "llvm/LTO/LTO.h" |
42 | 41 | #include "llvm/Object/Archive.h" |
@@ -1323,37 +1322,6 @@ static void gatherInputSections() { |
1323 | 1322 | } |
1324 | 1323 | } |
1325 | 1324 |
|
1326 | | -static void codegenDataGenerate() { |
1327 | | - TimeTraceScope timeScope("Generating codegen data"); |
1328 | | - |
1329 | | - OutlinedHashTreeRecord globalOutlineRecord; |
1330 | | - for (ConcatInputSection *isec : inputSections) |
1331 | | - if (isec->getSegName() == segment_names::data && |
1332 | | - isec->getName() == section_names::outlinedHashTree) { |
1333 | | - // Read outlined hash tree from each section. |
1334 | | - OutlinedHashTreeRecord localOutlineRecord; |
1335 | | - auto *data = isec->data.data(); |
1336 | | - localOutlineRecord.deserialize(data); |
1337 | | - |
1338 | | - // Merge it to the global hash tree. |
1339 | | - globalOutlineRecord.merge(localOutlineRecord); |
1340 | | - } |
1341 | | - |
1342 | | - CodeGenDataWriter Writer; |
1343 | | - if (!globalOutlineRecord.empty()) |
1344 | | - Writer.addRecord(globalOutlineRecord); |
1345 | | - |
1346 | | - std::error_code EC; |
1347 | | - auto fileName = config->codegenDataGeneratePath; |
1348 | | - assert(!fileName.empty()); |
1349 | | - raw_fd_ostream Output(fileName, EC, sys::fs::OF_None); |
1350 | | - if (EC) |
1351 | | - error("fail to create " + fileName + ": " + EC.message()); |
1352 | | - |
1353 | | - if (auto E = Writer.write(Output)) |
1354 | | - error("fail to write CGData: " + toString(std::move(E))); |
1355 | | -} |
1356 | | - |
1357 | 1325 | static void foldIdenticalLiterals() { |
1358 | 1326 | TimeTraceScope timeScope("Fold identical literals"); |
1359 | 1327 | // We always create a cStringSection, regardless of whether dedupLiterals is |
@@ -1791,8 +1759,6 @@ bool link(ArrayRef<const char *> argsArr, llvm::raw_ostream &stdoutOS, |
1791 | 1759 | config->ignoreAutoLinkOptions.insert(arg->getValue()); |
1792 | 1760 | config->strictAutoLink = args.hasArg(OPT_strict_auto_link); |
1793 | 1761 | config->ltoDebugPassManager = args.hasArg(OPT_lto_debug_pass_manager); |
1794 | | - config->codegenDataGeneratePath = |
1795 | | - args.getLastArgValue(OPT_codegen_data_generate_path); |
1796 | 1762 | config->csProfileGenerate = args.hasArg(OPT_cs_profile_generate); |
1797 | 1763 | config->csProfilePath = args.getLastArgValue(OPT_cs_profile_path); |
1798 | 1764 | config->pgoWarnMismatch = |
@@ -2137,10 +2103,6 @@ bool link(ArrayRef<const char *> argsArr, llvm::raw_ostream &stdoutOS, |
2137 | 2103 | } |
2138 | 2104 |
|
2139 | 2105 | gatherInputSections(); |
2140 | | - |
2141 | | - if (!config->codegenDataGeneratePath.empty()) |
2142 | | - codegenDataGenerate(); |
2143 | | - |
2144 | 2106 | if (config->callGraphProfileSort) |
2145 | 2107 | priorityBuilder.extractCallGraphProfile(); |
2146 | 2108 |
|
|
0 commit comments