[opt-remark] Have OptEmitter store a SILFunction instead of a SILModule.

In all of these cases, we already had a SILFunction and were just grabbing its
SILModule instead of passing it in. So this is just an NFC change.

The reason why I am doing this is so that I can force emit opt-remarks on
functions with the semantics attribute "optremark", so I need to be able to
access the SILFunction in the optimization remark infrastructure.
This commit is contained in:
Michael Gottesman
2020-07-24 17:06:54 -07:00
parent 3cb8f9b6fc
commit 750c8d32ac
7 changed files with 27 additions and 26 deletions

View File

@@ -60,7 +60,7 @@ class Devirtualizer : public SILFunctionTransform {
void Devirtualizer::devirtualizeAppliesInFunction(SILFunction &F,
ClassHierarchyAnalysis *CHA) {
llvm::SmallVector<ApplySite, 8> NewApplies;
OptRemark::Emitter ORE(DEBUG_TYPE, F.getModule());
OptRemark::Emitter ORE(DEBUG_TYPE, F);
SmallVector<ApplySite, 16> Applies;
for (auto &BB : F) {