Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/DebugInfo/PDB/Native/NativeEnumModules.cpp
Line
Count
Source
1
//==- NativeEnumModules.cpp - Native Symbol Enumerator impl ------*- C++ -*-==//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#include "llvm/DebugInfo/PDB/Native/NativeEnumModules.h"
10
11
#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
12
#include "llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h"
13
#include "llvm/DebugInfo/PDB/Native/NativeExeSymbol.h"
14
#include "llvm/DebugInfo/PDB/Native/NativeSession.h"
15
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
16
#include "llvm/DebugInfo/PDB/PDBSymbolCompiland.h"
17
#include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
18
19
namespace llvm {
20
namespace pdb {
21
22
NativeEnumModules::NativeEnumModules(NativeSession &PDBSession, uint32_t Index)
23
6
    : Session(PDBSession), Index(Index) {}
24
25
71
uint32_t NativeEnumModules::getChildCount() const {
26
71
  return Session.getSymbolCache().getNumCompilands();
27
71
}
28
29
std::unique_ptr<PDBSymbol>
30
62
NativeEnumModules::getChildAtIndex(uint32_t N) const {
31
62
  return Session.getSymbolCache().getOrCreateCompiland(N);
32
62
}
33
34
67
std::unique_ptr<PDBSymbol> NativeEnumModules::getNext() {
35
67
  if (Index >= getChildCount())
36
7
    return nullptr;
37
60
  return getChildAtIndex(Index++);
38
60
}
39
40
1
void NativeEnumModules::reset() { Index = 0; }
41
42
}
43
}