|
LLVM 24.0.0git
|
Applies linker name-mangling for a target. More...
#include "llvm/ExecutionEngine/Orc/Shared/Mangler.h"
Public Types | |
| enum class | Mode { None , ELF , MachO , WinCOFF , WinCOFFX86 , GOFF , Mips , XCOFF } |
| The linker name-mangling scheme for a target, determined by its object format. More... | |
Public Member Functions | |
| Mangler (Mode MM) | |
| Mangler (StringRef DLStr) | |
| Mangler (const Triple &TT, StringRef ABIName="") | |
| template<typename HandlerFn> | |
| decltype(auto) | withMangledNameDo (HandlerFn &&H, const SymbolNameSpec &NameSpec) const |
| Calls the given callback with the mangled version of NameSpec as a StringRef. | |
| std::string | mangledCopy (const SymbolNameSpec &Name) const |
| Construct a mangled version of the given name as a std::string. | |
|
strong |
The linker name-mangling scheme for a target, determined by its object format.
This captures the platform decoration applied to symbol names (e.g. a leading '_' on MachO), independently of any ExecutionSession.
| Enumerator | |
|---|---|
| None | |
| ELF | |
| MachO | |
| WinCOFF | |
| WinCOFFX86 | |
| GOFF | |
| Mips | |
| XCOFF | |
|
inlineexplicit |
|
inline |
Construct a mangled version of the given name as a std::string.
This always produces a copy, even for no-op manglings. Prefer withMangledNameDo in any performance-sensitive context.
Definition at line 72 of file Mangler.h.
References llvm::StringRef::str(), and withMangledNameDo().
|
inline |
Calls the given callback with the mangled version of NameSpec as a StringRef.
The mangled name is only valid for the duration of the callback and must not escape. This allows withMangledNameDo to avoid allocations when mangling is a no-op.
Definition at line 45 of file Mangler.h.
References llvm::SmallString< InternalLen >::append(), llvm::StringRef::empty(), llvm::orc::SymbolNameSpec::getKind(), llvm::orc::SymbolNameSpec::getName(), H, llvm::orc::Linker, MachO, llvm::StringRef::substr(), llvm::orc::Verbatim, and WinCOFFX86.
Referenced by mangledCopy().