File tree Expand file tree Collapse file tree 4 files changed +14
-13
lines changed Expand file tree Collapse file tree 4 files changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -2878,10 +2878,10 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
28782878 // Handle /call-graph-ordering-file and /call-graph-profile-sort (default on).
28792879 if (config->callGraphProfileSort ) {
28802880 llvm::TimeTraceScope timeScope (" Call graph" );
2881- if (auto *arg = args.getLastArg (OPT_call_graph_ordering_file)) {
2881+ if (auto *arg = args.getLastArg (OPT_call_graph_ordering_file))
28822882 parseCallGraphFile (arg->getValue ());
2883- }
2884- readCallGraphsFromObjectFiles (ctx);
2883+ else
2884+ readCallGraphsFromObjectFiles (ctx);
28852885 }
28862886
28872887 // Handle /print-symbol-order.
Original file line number Diff line number Diff line change @@ -3215,11 +3215,12 @@ template <class ELFT> void LinkerDriver::link(opt::InputArgList &args) {
32153215
32163216 // Read the callgraph now that we know what was gced or icfed
32173217 if (ctx.arg .callGraphProfileSort != CGProfileSortKind::None) {
3218- if (auto *arg = args.getLastArg (OPT_call_graph_ordering_file))
3218+ if (auto *arg = args.getLastArg (OPT_call_graph_ordering_file)) {
32193219 if (std::optional<MemoryBufferRef> buffer =
32203220 readFile (ctx, arg->getValue ()))
32213221 readCallGraph (ctx, *buffer);
3222- readCallGraphsFromObjectFiles<ELFT>(ctx);
3222+ } else
3223+ readCallGraphsFromObjectFiles<ELFT>(ctx);
32233224 }
32243225
32253226 // Write the result to the file.
Original file line number Diff line number Diff line change 4646# NO-CG: 140001002 T B
4747# NO-CG: 140001003 T A
4848
49- # CG-OBJ-OF: 140001000 T C
50- # CG-OBJ-OF: 140001001 t D
51- # CG-OBJ-OF: 140001002 T A
52- # CG-OBJ-OF: 140001003 T B
49+ # CG-OBJ-OF: 140001000 t D
50+ # CG-OBJ-OF: 140001001 T A
51+ # CG-OBJ-OF: 140001004 T C
52+ # CG-OBJ-OF: 140001005 T B
Original file line number Diff line number Diff line change 4949# NO-CG: 0000000000201122 T B
5050# NO-CG: 0000000000201123 T A
5151
52- # CG-OBJ-OF: 0000000000201121 t D
53- # CG-OBJ-OF: 0000000000201120 T C
54- # CG-OBJ-OF: 0000000000201123 T B
55- # CG-OBJ-OF: 0000000000201122 T A
52+ # CG-OBJ-OF: 0000000000201120 t D
53+ # CG-OBJ-OF: 0000000000201124 T C
54+ # CG-OBJ-OF: 0000000000201125 T B
55+ # CG-OBJ-OF: 0000000000201121 T A
You can’t perform that action at this time.
0 commit comments