LLVM 22.0.0git
Mangling.h
Go to the documentation of this file.
1//===------ Mangling.h -- Name Mangling Utilities for ORC -------*- 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// Name mangling utilities for ORC.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_EXECUTIONENGINE_ORC_MANGLING_H
14#define LLVM_EXECUTIONENGINE_ORC_MANGLING_H
15
18#include "llvm/IR/Module.h"
21
22namespace llvm {
23namespace orc {
24
25/// Mangles symbol names then uniques them in the context of an
26/// ExecutionSession.
28public:
31
32private:
34 const DataLayout &DL;
35};
36
37/// Maps IR global values to their linker symbol names / flags.
38///
39/// This utility can be used when adding new IR globals in the JIT.
41public:
43 bool EmulatedTLS = false;
44 };
45
46 using SymbolNameToDefinitionMap = std::map<SymbolStringPtr, GlobalValue *>;
47
48 /// Add mangled symbols for the given GlobalValues to SymbolFlags.
49 /// If a SymbolToDefinitionMap pointer is supplied then it will be populated
50 /// with Name-to-GlobalValue* mappings. Note that this mapping is not
51 /// necessarily one-to-one: thread-local GlobalValues, for example, may
52 /// produce more than one symbol, in which case the map will contain duplicate
53 /// values.
54 LLVM_ABI static void
57 SymbolNameToDefinitionMap *SymbolToDefinition = nullptr);
58};
59
60} // End namespace orc
61} // End namespace llvm
62
63#endif // LLVM_EXECUTIONENGINE_ORC_MANGLING_H
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
#define LLVM_ABI
Definition: Compiler.h:213
std::string Name
Module.h This file contains the declarations for the Module class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
A parsed version of the target data layout string in and methods for querying it.
Definition: DataLayout.h:63
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:55
An ExecutionSession represents a running JIT program.
Definition: Core.h:1355
Maps IR global values to their linker symbol names / flags.
Definition: Mangling.h:40
static LLVM_ABI void add(ExecutionSession &ES, const ManglingOptions &MO, ArrayRef< GlobalValue * > GVs, SymbolFlagsMap &SymbolFlags, SymbolNameToDefinitionMap *SymbolToDefinition=nullptr)
Add mangled symbols for the given GlobalValues to SymbolFlags.
Definition: Mangling.cpp:30
std::map< SymbolStringPtr, GlobalValue * > SymbolNameToDefinitionMap
Definition: Mangling.h:46
Mangles symbol names then uniques them in the context of an ExecutionSession.
Definition: Mangling.h:27
LLVM_ABI SymbolStringPtr operator()(StringRef Name)
Definition: Mangling.cpp:21
Pointer to a pooled string representing a symbol name.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18