mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Refactor the code that erases sil functions into a new method, eraseFunction, and remember to clean the function table.
Swift SVN r11999
This commit is contained in:
@@ -157,6 +157,12 @@ public:
|
||||
return Types.getTypeLowering(t);
|
||||
}
|
||||
|
||||
/// Erase a function from the module.
|
||||
void eraseFunction(SILFunction *F) {
|
||||
getFunctionList().erase(F);
|
||||
FunctionTable.erase(F->getName());
|
||||
}
|
||||
|
||||
/// Construct a SIL module from an AST module.
|
||||
///
|
||||
/// The module will be constructed in the Raw stage. The provided AST module
|
||||
|
||||
@@ -786,7 +786,7 @@ bool tryToRemoveFunction(SILFunction *F) {
|
||||
return false;
|
||||
|
||||
DEBUG(llvm::dbgs() << "SC: Erasing:" << F->getName() << "\n");
|
||||
F->getModule().getFunctionList().erase(F);
|
||||
F->getModule().eraseFunction(F);
|
||||
NumDeadFunc++;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user