LLVM  6.0.0svn
DwarfStringPoolEntry.h
Go to the documentation of this file.
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.
22  unsigned Offset;
23  unsigned Index;
24 };
25 
26 /// String pool entry reference.
29 
30 public:
31  DwarfStringPoolEntryRef() = default;
34  : I(&I) {}
35 
36  explicit operator bool() const { return I; }
37  MCSymbol *getSymbol() const {
38  assert(I->second.Symbol && "No symbol available!");
39  return I->second.Symbol;
40  }
41  unsigned getOffset() const { return I->second.Offset; }
42  unsigned getIndex() const { return I->second.Index; }
43  StringRef getString() const { return I->first(); }
44 
45  bool operator==(const DwarfStringPoolEntryRef &X) const { return I == X.I; }
46  bool operator!=(const DwarfStringPoolEntryRef &X) const { return I != X.I; }
47 };
48 
49 } // end namespace llvm
50 
51 #endif
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
Definition: StringMap.h:126
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:42
String pool entry reference.
Data for a string pool entry.
StringRef first() const
Definition: StringMap.h:151
bool operator!=(const DwarfStringPoolEntryRef &X) const
DwarfStringPoolEntryRef(const StringMapEntry< DwarfStringPoolEntry > &I)
const StringMapEntry< DwarfStringPoolEntry > * I
#define I(x, y, z)
Definition: MD5.cpp:58
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
bool operator==(const DwarfStringPoolEntryRef &X) const