mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
[ORC] Rename IRMaterializationUnit's Discardable member to SymbolToDefinition,
and make it protected rather than private. The new name reflects the actual information in the map, and this information can be useful to derived classes (for example, to quickly look up the IR definition of a requested symbol). llvm-svn: 333683
This commit is contained in:
parent
592b4f92eb
commit
cf0da17e5c
@ -63,11 +63,10 @@ public:
|
||||
|
||||
protected:
|
||||
std::unique_ptr<Module> M;
|
||||
std::map<SymbolStringPtr, GlobalValue *> SymbolToDefinition;
|
||||
|
||||
private:
|
||||
void discard(const VSO &V, SymbolStringPtr Name) override;
|
||||
|
||||
std::map<SymbolStringPtr, GlobalValue *> Discardable;
|
||||
};
|
||||
|
||||
/// MaterializationUnit that materializes modules by calling the 'emit' method
|
||||
|
@ -46,17 +46,19 @@ IRMaterializationUnit::IRMaterializationUnit(ExecutionSession &ES,
|
||||
!G.hasAvailableExternallyLinkage()) {
|
||||
auto MangledName = Mangle(G.getName());
|
||||
SymbolFlags[MangledName] = JITSymbolFlags::fromGlobalValue(G);
|
||||
Discardable[MangledName] = &G;
|
||||
SymbolToDefinition[MangledName] = &G;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void IRMaterializationUnit::discard(const VSO &V, SymbolStringPtr Name) {
|
||||
auto I = Discardable.find(Name);
|
||||
assert(I != Discardable.end() &&
|
||||
auto I = SymbolToDefinition.find(Name);
|
||||
assert(I != SymbolToDefinition.end() &&
|
||||
"Symbol not provided by this MU, or previously discarded");
|
||||
assert(!I->second->isDeclaration() &&
|
||||
"Discard should only apply to definitions");
|
||||
I->second->setLinkage(GlobalValue::AvailableExternallyLinkage);
|
||||
Discardable.erase(I);
|
||||
SymbolToDefinition.erase(I);
|
||||
}
|
||||
|
||||
BasicIRLayerMaterializationUnit::BasicIRLayerMaterializationUnit(
|
||||
|
Loading…
Reference in New Issue
Block a user