Coverage Report

Created: 2017-10-03 07:32

/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.h
Line
Count
Source (jump to first uncovered line)
1
//===- llvm/CodeGen/DwarfStringPool.h - Dwarf Debug Framework ---*- 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_LIB_CODEGEN_ASMPRINTER_DWARFSTRINGPOOL_H
11
#define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFSTRINGPOOL_H
12
13
#include "llvm/ADT/StringMap.h"
14
#include "llvm/ADT/StringRef.h"
15
#include "llvm/CodeGen/DwarfStringPoolEntry.h"
16
#include "llvm/Support/Allocator.h"
17
18
namespace llvm {
19
20
class AsmPrinter;
21
class MCSection;
22
23
// Collection of strings for this unit and assorted symbols.
24
// A String->Symbol mapping of strings used by indirect
25
// references.
26
class DwarfStringPool {
27
  using EntryTy = DwarfStringPoolEntry;
28
29
  StringMap<EntryTy, BumpPtrAllocator &> Pool;
30
  StringRef Prefix;
31
  unsigned NumBytes = 0;
32
  bool ShouldCreateSymbols;
33
34
public:
35
  using EntryRef = DwarfStringPoolEntryRef;
36
37
  DwarfStringPool(BumpPtrAllocator &A, AsmPrinter &Asm, StringRef Prefix);
38
39
  void emit(AsmPrinter &Asm, MCSection *StrSection,
40
            MCSection *OffsetSection = nullptr);
41
42
0
  bool empty() const { return Pool.empty(); }
43
44
  /// Get a reference to an entry in the string pool.
45
  EntryRef getEntry(AsmPrinter &Asm, StringRef Str);
46
};
47
48
} // end namespace llvm
49
50
#endif // LLVM_LIB_CODEGEN_ASMPRINTER_DWARFSTRINGPOOL_H