mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Coverage] Refactor SIL generation for profiling
This patch moves the ownership of profiling state from SILGenProfiling to SILFunction, where it always belonged. Similarly, it moves ownership of the profile reader from SILGenModule to SILModule. The refactor sets us up to fix a few outstanding code coverage bugs and does away with sad hacks like ProfilerRAII. It also allows us to locally guarantee that a profile counter increment actually corresponds to the SILFunction at hand. That local guarantee causes a bugfix to accidentally fall out of this refactor: we now set up the profiling state for delayed functions correctly. Previously, we would set up a ProfilerRAII for the delayed function, but its counter increment would never be emitted :(. This fix constitutes the only functional change in this patch -- the rest is NFC. As a follow-up, I plan on removing some dead code in the profiling logic and fixing a few naming inconsistencies. I've left that for later to keep this patch simple.
This commit is contained in:
@@ -44,7 +44,7 @@ SILCoverageMap::create(SILModule &M, StringRef Filename, StringRef Name,
|
||||
}
|
||||
|
||||
SILCoverageMap::SILCoverageMap(uint64_t Hash, bool External)
|
||||
: External(External), Hash(Hash) {}
|
||||
: External(External), Hash(Hash), HasSymtabEntry(false) {}
|
||||
|
||||
SILCoverageMap::~SILCoverageMap() {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user