llvm.org GIT mirror llvm / 8ffb6b1
[ThinLTO] PrintStatistics when we exit early for thinlto-index-only Summary: This is necessary to get stats from the ThinLink printed before the early exit when compiling in a distributed build. Reviewers: mehdi_amini Subscribers: Prazek, llvm-commits Differential Revision: https://reviews.llvm.org/D29461 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293908 91177308-0d34-0410-b5e6-96231b3b80d8 Teresa Johnson 3 years ago
2 changed file(s) with 10 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
44 ; RUN: -m elf_x86_64 \
55 ; RUN: -plugin-opt=-stats %t.o -o %t2 2>&1 | FileCheck %s
66
7 ; RUN: llvm-as %s -o %t.o
8 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so -shared \
9 ; RUN: -m elf_x86_64 \
10 ; RUN: -plugin-opt=thinlto \
11 ; RUN: -plugin-opt=thinlto-index-only \
12 ; RUN: -plugin-opt=-stats %t.o -o %t2 2>&1 | FileCheck %s
13
714 ; CHECK: Statistics Collected
815
916 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
1111 //
1212 //===----------------------------------------------------------------------===//
1313
14 #include "llvm/ADT/Statistic.h"
1415 #include "llvm/Bitcode/BitcodeReader.h"
1516 #include "llvm/Bitcode/BitcodeWriter.h"
1617 #include "llvm/CodeGen/CommandFlags.h"
843844 return LDPS_OK;
844845
845846 if (options::thinlto_index_only) {
847 if (llvm::AreStatisticsEnabled())
848 llvm::PrintStatistics();
846849 cleanup_hook();
847850 exit(0);
848851 }