LLVM  7.0.0
DwarfStringPool.h
Go to the documentation of this file.
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"
16 #include "llvm/Support/Allocator.h"
17 
18 namespace llvm {
19 
20 class AsmPrinter;
21 class MCSection;
22 class MCSymbol;
23 
24 // Collection of strings for this unit and assorted symbols.
25 // A String->Symbol mapping of strings used by indirect
26 // references.
29 
31  StringRef Prefix;
32  unsigned NumBytes = 0;
33  bool ShouldCreateSymbols;
34 
35 public:
37 
39 
41  MCSymbol *StartSym);
42 
43  void emit(AsmPrinter &Asm, MCSection *StrSection,
44  MCSection *OffsetSection = nullptr,
45  bool UseRelativeOffsets = false);
46 
47  bool empty() const { return Pool.empty(); }
48 
49  unsigned size() const { return Pool.size(); }
50 
51  /// Get a reference to an entry in the string pool.
53 };
54 
55 } // end namespace llvm
56 
57 #endif // LLVM_LIB_CODEGEN_ASMPRINTER_DWARFSTRINGPOOL_H
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:39
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:42
void emit(AsmPrinter &Asm, MCSection *StrSection, MCSection *OffsetSection=nullptr, bool UseRelativeOffsets=false)
This file defines the MallocAllocator and BumpPtrAllocator interfaces.
unsigned size() const
Definition: StringMap.h:112
String pool entry reference.
Data for a string pool entry.
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:140
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:78
unsigned size() const
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
Definition: StringMap.h:220
void emitStringOffsetsTableHeader(AsmPrinter &Asm, MCSection *OffsetSection, MCSymbol *StartSym)
EntryRef getEntry(AsmPrinter &Asm, StringRef Str)
Get a reference to an entry in the string pool.
bool empty() const
Definition: StringMap.h:111
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
DwarfStringPool(BumpPtrAllocator &A, AsmPrinter &Asm, StringRef Prefix)