14#define DEBUG_TYPE "orc"
23 std::string MangledName;
28 return ES.
intern(MangledName);
40 assert(
G &&
"GVs cannot contain null elements");
41 if (!
G->hasName() ||
G->isDeclaration() ||
G->hasLocalLinkage() ||
42 G->hasAvailableExternallyLinkage() ||
G->hasAppendingLinkage())
46 auto *GV = cast<GlobalVariable>(
G);
50 auto EmuTLSV = Mangle((
"__emutls_v." + GV->getName()).str());
51 SymbolFlags[EmuTLSV] = Flags;
52 if (SymbolToDefinition)
53 (*SymbolToDefinition)[EmuTLSV] = GV;
57 if (GV->hasInitializer()) {
58 const auto *InitVal = GV->getInitializer();
61 if (isa<ConstantAggregateZero>(InitVal))
63 const auto *InitIntValue = dyn_cast<ConstantInt>(InitVal);
64 if (InitIntValue && InitIntValue->isZero())
67 auto EmuTLST = Mangle((
"__emutls_t." + GV->getName()).str());
68 SymbolFlags[EmuTLST] = Flags;
69 if (SymbolToDefinition)
70 (*SymbolToDefinition)[EmuTLST] = GV;
76 auto MangledName = Mangle(
G->getName());
78 if (SymbolToDefinition)
79 (*SymbolToDefinition)[MangledName] =
G;
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
This file contains the declarations for the subclasses of Constant, which represent the different fla...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
bool empty() const
empty - Check if the array is empty.
A parsed version of the target data layout string in and methods for querying it.
static JITSymbolFlags fromGlobalValue(const GlobalValue &GV)
Construct a JITSymbolFlags value based on the flags of the given global value.
void getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV, bool CannotUsePrivateLabel) const
Print the appropriate prefix and the specified global variable's name.
StringRef - Represent a constant reference to a string, i.e.
An ExecutionSession represents a running JIT program.
SymbolStringPtr intern(StringRef SymName)
Add a symbol name to the SymbolStringPool and return a pointer to it.
static void add(ExecutionSession &ES, const ManglingOptions &MO, ArrayRef< GlobalValue * > GVs, SymbolFlagsMap &SymbolFlags, SymbolNameToDefinitionMap *SymbolToDefinition=nullptr)
Add mangled symbols for the given GlobalValues to SymbolFlags.
std::map< SymbolStringPtr, GlobalValue * > SymbolNameToDefinitionMap
Mangles symbol names then uniques them in the context of an ExecutionSession.
SymbolStringPtr operator()(StringRef Name)
MangleAndInterner(ExecutionSession &ES, const DataLayout &DL)
Pointer to a pooled string representing a symbol name.
A raw_ostream that writes to an std::string.
This is an optimization pass for GlobalISel generic memory operations.