mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add a function to remove a global variable from a SILModule.
This API is useful for some global optimizations. If we can prove that a global is not used in the application, we can remove it. Swift SVN r31529
This commit is contained in:
@@ -548,6 +548,12 @@ void SILModule::eraseFunction(SILFunction *F) {
|
||||
}
|
||||
}
|
||||
|
||||
/// Erase a global SIL variable from the module.
|
||||
void SILModule::eraseGlobalVariable(SILGlobalVariable *G) {
|
||||
GlobalVariableTable.erase(G->getName());
|
||||
getSILGlobalList().erase(G);
|
||||
}
|
||||
|
||||
SILVTable *SILModule::lookUpVTable(const ClassDecl *C,
|
||||
std::function<void(SILFunction *)> Callback) {
|
||||
if (!C)
|
||||
|
||||
Reference in New Issue
Block a user