Skip to content

Commit 38357ad

Browse files
committed
Address comments
1 parent d46859b commit 38357ad

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

compiler-rt/test/profile/Posix/gcov-file-change.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ int main(int argc, char *argv[]) { // CHECK: 1: [[#]]:int main
3232
//--- a.h
3333
/// Apple targets doesn't enable -mconstructor-aliases by default and the count may be 4.
3434
struct A { A() { } }; // CHECK: {{[24]}}: [[#]]:struct A
35-
inline auto *const inl_var_a = // CHECK: 1: [[#]]:
36-
new A; // CHECK: 1: [[#]]:
35+
inline auto *const inl_var_a = // CHECK-NEXT: 1: [[#]]:
36+
new A; // CHECK-NEXT: 1: [[#]]:
3737

3838
//--- a.inc
3939
puts(""); // CHECK: 1: [[#]]:puts

llvm/include/llvm/ProfileData/GCOV.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,10 @@ class GCOVFunction {
271271
DenseSet<const GCOVBlock *> visited;
272272
};
273273

274-
/// GCOVLocation - Represent file of lines same with block_location_info in gcc.
275-
class GCOVLocation {
276-
public:
277-
GCOVLocation(unsigned idx) : srcIdx(idx) {}
274+
/// Represent file of lines same with block_location_info in gcc.
275+
struct GCOVBlockLocation {
276+
GCOVBlockLocation(unsigned idx) : srcIdx(idx) {}
278277

279-
public:
280278
unsigned srcIdx;
281279
SmallVector<uint32_t, 4> lines;
282280
};
@@ -326,7 +324,7 @@ class GCOVBlock {
326324
uint64_t count = 0;
327325
SmallVector<GCOVArc *, 2> pred;
328326
SmallVector<GCOVArc *, 2> succ;
329-
SmallVector<GCOVLocation, 4> locations;
327+
SmallVector<GCOVBlockLocation> locations;
330328
uint32_t lastLine;
331329
bool traversable = false;
332330
GCOVArc *incoming = nullptr;

llvm/lib/ProfileData/GCOV.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ void GCOVBlock::print(raw_ostream &OS) const {
457457
OS << "\n";
458458
}
459459
if (!locations.empty()) {
460-
for (const GCOVLocation &loc : locations) {
460+
for (const GCOVBlockLocation &loc : locations) {
461461
OS << "\tFile: " << loc.srcIdx << ": ";
462462
for (uint32_t N : loc.lines)
463463
OS << (N) << ",";
@@ -705,7 +705,7 @@ void Context::collectFunction(GCOVFunction &f, Summary &summary) {
705705
for (const GCOVBlock &b : f.blocksRange()) {
706706
if (b.locations.empty())
707707
continue;
708-
for (const GCOVLocation &loc : b.locations) {
708+
for (const GCOVBlockLocation &loc : b.locations) {
709709
SourceInfo &locSource = sources[loc.srcIdx];
710710
uint32_t maxLineNum = *llvm::max_element(loc.lines);
711711
if (maxLineNum >= locSource.lines.size())

llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ namespace {
320320
GCOVBlock(GCOVProfiler *P, uint32_t Number)
321321
: GCOVRecord(P), Number(Number) {}
322322

323-
SmallVector<GCOVLines, 4> Lines;
323+
SmallVector<GCOVLines> Lines;
324324
};
325325

326326
// A function has a unique identifier, a checksum (we leave as zero) and a

0 commit comments

Comments
 (0)