File tree 4 files changed +14
-13
lines changed 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) {
2878
2878
// Handle /call-graph-ordering-file and /call-graph-profile-sort (default on).
2879
2879
if (config->callGraphProfileSort ) {
2880
2880
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))
2882
2882
parseCallGraphFile (arg->getValue ());
2883
- }
2884
- readCallGraphsFromObjectFiles (ctx);
2883
+ else
2884
+ readCallGraphsFromObjectFiles (ctx);
2885
2885
}
2886
2886
2887
2887
// 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) {
3215
3215
3216
3216
// Read the callgraph now that we know what was gced or icfed
3217
3217
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)) {
3219
3219
if (std::optional<MemoryBufferRef> buffer =
3220
3220
readFile (ctx, arg->getValue ()))
3221
3221
readCallGraph (ctx, *buffer);
3222
- readCallGraphsFromObjectFiles<ELFT>(ctx);
3222
+ } else
3223
+ readCallGraphsFromObjectFiles<ELFT>(ctx);
3223
3224
}
3224
3225
3225
3226
// Write the result to the file.
Original file line number Diff line number Diff line change 46
46
# NO-CG: 140001002 T B
47
47
# NO-CG: 140001003 T A
48
48
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 49
49
# NO-CG: 0000000000201122 T B
50
50
# NO-CG: 0000000000201123 T A
51
51
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