LLVM 20.0.0git
|
Canonicalizer for mangled names. More...
#include "llvm/ProfileData/ItaniumManglingCanonicalizer.h"
Classes | |
struct | Impl |
Public Types | |
enum class | EquivalenceError { Success , ManglingAlreadyUsed , InvalidFirstMangling , InvalidSecondMangling } |
enum class | FragmentKind { Name , Type , Encoding } |
using | Key = uintptr_t |
Public Member Functions | |
ItaniumManglingCanonicalizer () | |
ItaniumManglingCanonicalizer (const ItaniumManglingCanonicalizer &)=delete | |
void | operator= (const ItaniumManglingCanonicalizer &)=delete |
~ItaniumManglingCanonicalizer () | |
EquivalenceError | addEquivalence (FragmentKind Kind, StringRef First, StringRef Second) |
Add an equivalence between First and Second . | |
Key | canonicalize (StringRef Mangling) |
Form a canonical key for the specified mangling. | |
Key | lookup (StringRef Mangling) |
Find a canonical key for the specified mangling, if one has already been formed. | |
Canonicalizer for mangled names.
This class allows specifying a list of "equivalent" manglings. For example, you can specify that Ss is equivalent to NSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE and then manglings that refer to libstdc++'s 'std::string' will be considered equivalent to manglings that are the same except that they refer to libc++'s 'std::string'.
This can be used when data (eg, profiling data) is available for a version of a program built in a different configuration, with correspondingly different manglings.
Definition at line 35 of file ItaniumManglingCanonicalizer.h.
using llvm::ItaniumManglingCanonicalizer::Key = uintptr_t |
Definition at line 71 of file ItaniumManglingCanonicalizer.h.
|
strong |
Definition at line 42 of file ItaniumManglingCanonicalizer.h.
|
strong |
Enumerator | |
---|---|
Name | The mangling fragment is a <name> (or a predefined <substitution>). |
Type | The mangling fragment is a <type>. |
Encoding | The mangling fragment is an <encoding>. |
Definition at line 57 of file ItaniumManglingCanonicalizer.h.
ItaniumManglingCanonicalizer::ItaniumManglingCanonicalizer | ( | ) |
Definition at line 203 of file ItaniumManglingCanonicalizer.cpp.
|
delete |
ItaniumManglingCanonicalizer::~ItaniumManglingCanonicalizer | ( | ) |
Definition at line 204 of file ItaniumManglingCanonicalizer.cpp.
References P.
ItaniumManglingCanonicalizer::EquivalenceError ItaniumManglingCanonicalizer::addEquivalence | ( | FragmentKind | Kind, |
StringRef | First, | ||
StringRef | Second | ||
) |
Add an equivalence between First
and Second
.
Both manglings must live at least as long as the canonicalizer.
Definition at line 207 of file ItaniumManglingCanonicalizer.cpp.
References llvm::Alloc, Encoding, llvm::First, InvalidFirstMangling, InvalidSecondMangling, ManglingAlreadyUsed, N, Name, P, Success, and Type.
Referenced by llvm::SymbolRemappingReader::read().
ItaniumManglingCanonicalizer::Key ItaniumManglingCanonicalizer::canonicalize | ( | StringRef | Mangling | ) |
Form a canonical key for the specified mangling.
They key will be the same for all equivalent manglings, and different for any two non-equivalent manglings, but is otherwise unspecified.
Returns Key() if (and only if) the mangling is not a valid Itanium C++ ABI mangling.
The string denoted by Mangling must live as long as the canonicalizer.
Definition at line 302 of file ItaniumManglingCanonicalizer.cpp.
References P, and parseMaybeMangledName().
Referenced by llvm::SymbolRemappingReader::insert().
ItaniumManglingCanonicalizer::Key ItaniumManglingCanonicalizer::lookup | ( | StringRef | Mangling | ) |
Find a canonical key for the specified mangling, if one has already been formed.
Otherwise returns Key().
Definition at line 307 of file ItaniumManglingCanonicalizer.cpp.
References P, and parseMaybeMangledName().
Referenced by llvm::SymbolRemappingReader::lookup().
|
delete |