LLVM 22.0.0git
StringEntryToDwarfStringPoolEntryMap.h
Go to the documentation of this file.
1//===- StringEntryToDwarfStringPoolEntryMap.h -------------------*- C++ -*-===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_LIB_DWARFLINKER_PARALLEL_STRINGENTRYTODWARFSTRINGPOOLENTRYMAP_H
10#define LLVM_LIB_DWARFLINKER_PARALLEL_STRINGENTRYTODWARFSTRINGPOOLENTRYMAP_H
11
15
16namespace llvm {
17namespace dwarf_linker {
18namespace parallel {
19
20/// This class creates a DwarfStringPoolEntry for the corresponding StringEntry.
22public:
26
27 /// Create DwarfStringPoolEntry for specified StringEntry if necessary.
28 /// Initialize DwarfStringPoolEntry with initial values.
31
32 if (it == DwarfStringPoolEntries.end()) {
34 GlobalData.getAllocator()
36 DataPtr->String = String->getKey();
38 DataPtr->Offset = 0;
39 DataPtr->Symbol = nullptr;
40 it = DwarfStringPoolEntries.insert(std::make_pair(String, DataPtr)).first;
41 }
42
43 assert(it->second != nullptr);
44 return it->second;
45 }
46
47 /// Returns already existed DwarfStringPoolEntry for the specified
48 /// StringEntry.
53
54 assert(it != DwarfStringPoolEntries.end());
55 assert(it->second != nullptr);
56 return it->second;
57 }
58
59 /// Erase contents of StringsForEmission.
60 void clear() { DwarfStringPoolEntries.clear(); }
61
62protected:
66
68};
69
70} // end of namespace parallel
71} // end of namespace dwarf_linker
72} // end of namespace llvm
73
74#endif // LLVM_LIB_DWARFLINKER_PARALLEL_STRINGENTRYTODWARFSTRINGPOOLENTRYMAP_H
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the SmallVector class.
DenseMapIterator< KeyT, ValueT, KeyInfoT, BucketT > iterator
Definition DenseMap.h:74
DenseMapIterator< KeyT, ValueT, KeyInfoT, BucketT, true > const_iterator
Definition DenseMap.h:75
This class keeps data and services common for the whole linking process.
DenseMap< const StringEntry *, DwarfStringPoolEntryWithExtString * > DwarfStringPoolEntriesTy
DwarfStringPoolEntryWithExtString * getExistingEntry(const StringEntry *String) const
Returns already existed DwarfStringPoolEntry for the specified StringEntry.
DwarfStringPoolEntryWithExtString * add(const StringEntry *String)
Create DwarfStringPoolEntry for specified StringEntry if necessary.
StringMapEntry< std::nullopt_t > StringEntry
StringEntry keeps data of the string: the length, external offset and a string body which is placed r...
Definition StringPool.h:23
This is an optimization pass for GlobalISel generic memory operations.
DwarfStringPoolEntry with string keeping externally.
static constexpr unsigned NotIndexed