LLVM
8.0.1
|
Canonicalizer for mangled names. More...
#include "llvm/Support/ItaniumManglingCanonicalizer.h"
Classes | |
struct | Impl |
Public Types | |
enum | EquivalenceError { EquivalenceError::Success, EquivalenceError::ManglingAlreadyUsed, EquivalenceError::InvalidFirstMangling, EquivalenceError::InvalidSecondMangling } |
enum | FragmentKind { FragmentKind::Name, FragmentKind::Type, FragmentKind::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 . More... | |
Key | canonicalize (StringRef Mangling) |
Form a canonical key for the specified mangling. More... | |
Key | lookup (StringRef Mangling) |
Find a canonical key for the specified mangling, if one has already been formed. More... | |
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.
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 232 of file ItaniumManglingCanonicalizer.cpp.
|
delete |
ItaniumManglingCanonicalizer::~ItaniumManglingCanonicalizer | ( | ) |
Definition at line 233 of file ItaniumManglingCanonicalizer.cpp.
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 236 of file ItaniumManglingCanonicalizer.cpp.
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 311 of file ItaniumManglingCanonicalizer.cpp.
References llvm::StringRef::begin(), and llvm::StringRef::end().
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 318 of file ItaniumManglingCanonicalizer.cpp.
References llvm::StringRef::begin(), and llvm::StringRef::end().
|
delete |