llvm.org GIT mirror llvm / 7a50202
Cosmetic changes, as per Nick's review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140785 91177308-0d34-0410-b5e6-96231b3b80d8 Devang Patel 8 years ago
5 changed file(s) with 17 addition(s) and 21 deletion(s). Raw diff Collapse all Expand all
1919 #include "llvm/ADT/DenseMap.h"
2020 #include "llvm/ADT/SmallPtrSet.h"
2121 #include "llvm/ADT/StringMap.h"
22 #include "llvm/Function.h"
2223 #include
2324
2425 using namespace llvm;
99 // GCOVReader implements the interface to read coverage files that use 'gcov'
1010 // format.
1111 //
12 //
1312 //===----------------------------------------------------------------------===//
1413
1514 #include "GCOVReader.h"
15 #include "llvm/ADT/OwningPtr.h"
1616 #include "llvm/ADT/STLExtras.h"
17 #include "llvm/ADT/OwningPtr.h"
1817 #include "llvm/Support/MemoryObject.h"
1918 #include "llvm/Support/system_error.h"
2019 using namespace llvm;
3433 return false;
3534
3635 unsigned i = 0;
37 while(1) {
36 while (1) {
3837 GCOVFunction *GFun = NULL;
39 if(Format == GCDA_402 || Format == GCDA_404) {
38 if (Format == GCDA_402 || Format == GCDA_404) {
4039 if (i < Functions.size())
4140 GFun = Functions[i];
4241 } else
4342 GFun = new GCOVFunction();
4443
4544 if (GFun && GFun->read(Buffer, Format)) {
46 if(Format == GCNO_402 || Format == GCNO_404)
45 if (Format == GCNO_402 || Format == GCNO_404)
4746 Functions.push_back(GFun);
4847 }
4948 else {
9291 Buff.readInt(); // Checksum #2
9392
9493 Name = Buff.readString();
95 if(Format == GCNO_402 || Format == GCNO_404)
94 if (Format == GCNO_402 || Format == GCNO_404)
9695 Filename = Buff.readString();
9796
98 if(Format == GCDA_402 || Format == GCDA_404) {
97 if (Format == GCDA_402 || Format == GCDA_404) {
9998 Buff.readArcTag();
10099 uint32_t Count = Buff.readInt() / 2;
101100 for (unsigned i = 0, e = Count; i != e; ++i) {
None //===-- tools/cov/GCOVReader.h - LLVM coverage tool -------------*- C++ -*-===//
0 //===-- tools/llvm-cov/GCOVReader.h - LLVM coverage tool --------*- C++ -*-===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
None ##===- tools/llvm-gcov/Makefile ----------------------------*- Makefile -*-===##
0 ##===- tools/llvm-cov/Makefile -----------------------------*- Makefile -*-===##
11 #
22 # The LLVM Compiler Infrastructure
33 #
66 //
77 //===----------------------------------------------------------------------===//
88 //
9 //
109 // llvm-cov is a command line tools to analyze and report coverage information.
11 //
1210 //
1311 //===----------------------------------------------------------------------===//
1412
4644 if (InputGCNO.empty())
4745 errs() << " " << argv[0] << ": No gcov input file!\n";
4846
49 OwningPtr Buff;
50 if (error_code ec = MemoryBuffer::getFileOrSTDIN(InputGCNO, Buff)) {
47 OwningPtr GCNO_Buff;
48 if (error_code ec = MemoryBuffer::getFileOrSTDIN(InputGCNO, GCNO_Buff)) {
5149 errs() << InputGCNO << ": " << ec.message() << "\n";
5250 return 1;
5351 }
54 GCOVBuffer GB(Buff.take());
55
56 if (!GF.read(GB)) {
52 GCOVBuffer GCNO_GB(GCNO_Buff.take());
53 if (!GF.read(GCNO_GB)) {
5754 errs() << "Invalid .gcno File!\n";
5855 return 1;
5956 }
6057
6158 if (!InputGCDA.empty()) {
62 OwningPtr Buff2;
63 if (error_code ec = MemoryBuffer::getFileOrSTDIN(InputGCDA, Buff2)) {
59 OwningPtr GCDA_Buff;
60 if (error_code ec = MemoryBuffer::getFileOrSTDIN(InputGCDA, GCDA_Buff)) {
6461 errs() << InputGCDA << ": " << ec.message() << "\n";
6562 return 1;
6663 }
67 GCOVBuffer GB2(Buff2.take());
68
69 if (!GF.read(GB2)) {
64 GCOVBuffer GCDA_GB(GCDA_Buff.take());
65 if (!GF.read(GCDA_GB)) {
7066 errs() << "Invalid .gcda File!\n";
7167 return 1;
7268 }