Coverage Report

Created: 2018-07-18 22:01

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/CodeGen/DwarfStringPoolEntry.h
Line
Count
Source (jump to first uncovered line)
1
//===- llvm/CodeGen/DwarfStringPoolEntry.h - String pool entry --*- C++ -*-===//
2
//
3
//                     The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
10
#ifndef LLVM_CODEGEN_DWARFSTRINGPOOLENTRY_H
11
#define LLVM_CODEGEN_DWARFSTRINGPOOLENTRY_H
12
13
#include "llvm/ADT/StringMap.h"
14
15
namespace llvm {
16
17
class MCSymbol;
18
19
/// Data for a string pool entry.
20
struct DwarfStringPoolEntry {
21
  MCSymbol *Symbol;
22
  unsigned Offset;
23
  unsigned Index;
24
};
25
26
/// String pool entry reference.
27
struct DwarfStringPoolEntryRef {
28
  const StringMapEntry<DwarfStringPoolEntry> *I = nullptr;
29
30
public:
31
  DwarfStringPoolEntryRef() = default;
32
  explicit DwarfStringPoolEntryRef(
33
      const StringMapEntry<DwarfStringPoolEntry> &I)
34
440k
      : I(&I) {}
35
36
  explicit operator bool() const { return I; }
37
5.91k
  MCSymbol *getSymbol() const {
38
5.91k
    assert(I->second.Symbol && "No symbol available!");
39
5.91k
    return I->second.Symbol;
40
5.91k
  }
41
197k
  unsigned getOffset() const { return I->second.Offset; }
42
16.5k
  unsigned getIndex() const { return I->second.Index; }
43
483k
  StringRef getString() const { return I->first(); }
44
  /// Return the entire string pool entry for convenience.
45
72.5k
  DwarfStringPoolEntry getEntry() const { return I->getValue(); }
46
47
0
  bool operator==(const DwarfStringPoolEntryRef &X) const { return I == X.I; }
48
  bool operator!=(const DwarfStringPoolEntryRef &X) const { return I != X.I; }
49
};
50
51
} // end namespace llvm
52
53
#endif