1//===- llvm/CodeGen/DwarfStringPoolEntry.h - String pool entry --*- C++ -*-===//
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
7//===----------------------------------------------------------------------===//
9#ifndef LLVM_CODEGEN_DWARFSTRINGPOOLENTRY_H
10#define LLVM_CODEGEN_DWARFSTRINGPOOLENTRY_H
19/// Data for a string pool entry.
30/// DwarfStringPoolEntry with string keeping externally.
35/// DwarfStringPoolEntryRef: Dwarf string pool entry reference.
37/// Dwarf string pool entry keeps string value and its data.
38/// There are two variants how data are represented:
40/// 1. String data in pool - StringMapEntry<DwarfStringPoolEntry>.
41/// 2. External string data - DwarfStringPoolEntryWithExtString.
43/// The external data variant allows reducing memory usage for the case
44/// when string pool entry does not have data: string entry does not
45/// keep any data and so no need to waste space for the full
46/// DwarfStringPoolEntry. It is recommended to use external variant if not all
47/// entries of dwarf string pool have corresponding DwarfStringPoolEntry.
50 /// Pointer type for "By value" string entry.
53 /// Pointer type for external string entry.
56 /// Pointer to the dwarf string pool Entry.
62 /// ASSUMPTION: DwarfStringPoolEntryRef keeps pointer to \p Entry,
63 /// thus specified entry mustn`t be reallocated.
67 /// ASSUMPTION: DwarfStringPoolEntryRef keeps pointer to \p Entry,
68 /// thus specified entry mustn`t be reallocated.
72 explicit operator bool()
const {
return !MapEntry.isNull(); }
74 /// \returns symbol for the dwarf string.
80 /// \returns offset for the dwarf string.
83 /// \returns index for the dwarf string.
97 /// \returns the entire string pool entry for convenience.
106 return MapEntry.getOpaqueValue() ==
X.MapEntry.getOpaqueValue();
110 return MapEntry.getOpaqueValue() !=
X.MapEntry.getOpaqueValue();
114}
// end namespace llvm
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the StringMap class.
This file defines the PointerUnion class, which is a discriminated union of pointer types.
static TableGen::Emitter::OptClass< SkeletonEmitter > X("gen-skeleton-class", "Generate example skeleton class")
bool operator!=(const DwarfStringPoolEntryRef &X) const
const DwarfStringPoolEntry & getEntry() const
unsigned getIndex() const
StringRef getString() const
DwarfStringPoolEntryRef()=default
uint64_t getOffset() const
bool operator==(const DwarfStringPoolEntryRef &X) const
DwarfStringPoolEntryRef(const DwarfStringPoolEntryWithExtString &Entry)
ASSUMPTION: DwarfStringPoolEntryRef keeps pointer to Entry, thus specified entry mustn`t be reallocat...
MCSymbol * getSymbol() const
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
A discriminated union of two or more pointer types, with the discriminator in the low bit of the poin...
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
StringRef - Represent a constant reference to a string, i.e.
This is an optimization pass for GlobalISel generic memory operations.
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
DwarfStringPoolEntry with string keeping externally.
Data for a string pool entry.
static constexpr unsigned NotIndexed