Skip to content

Commit 4536cee

Browse files
committed
---
yaml --- r: 348023 b: refs/heads/master c: 2f6c7cb h: refs/heads/master i: 348021: a2dec45 348019: 6538d73 348015: 9a3c849
1 parent e357548 commit 4536cee

15 files changed

+172
-208
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 5c3714f972dd3bd168288e5505132d660bdc4ee2
2+
refs/heads/master: 2f6c7cbf1302a8503bf396924c4f2a9b6b7b08c7
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/include/swift/SIL/SILFunction.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "swift/Basic/ProfileCounter.h"
2323
#include "swift/SIL/SILBasicBlock.h"
2424
#include "swift/SIL/SILDebugScope.h"
25+
#include "swift/SIL/SILDeclRef.h"
2526
#include "swift/SIL/SILLinkage.h"
2627
#include "swift/SIL/SILPrintContext.h"
2728
#include "llvm/ADT/StringMap.h"
@@ -362,7 +363,8 @@ class SILFunction
362363
Profiler = InheritedProfiler;
363364
}
364365

365-
void createProfiler(ASTNode Root, ForDefinition_t forDefinition);
366+
void createProfiler(ASTNode Root, SILDeclRef forDecl,
367+
ForDefinition_t forDefinition);
366368

367369
void discardProfiler() { Profiler = nullptr; }
368370

trunk/include/swift/SIL/SILProfiler.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ class SILProfiler : public SILAllocated<SILProfiler> {
4141

4242
ASTNode Root;
4343

44+
SILDeclRef forDecl;
45+
4446
bool EmitCoverageMapping;
4547

4648
SILCoverageMap *CovMap = nullptr;
@@ -61,12 +63,14 @@ class SILProfiler : public SILAllocated<SILProfiler> {
6163

6264
std::vector<std::tuple<std::string, uint64_t, std::string>> CoverageData;
6365

64-
SILProfiler(SILModule &M, ASTNode Root, bool EmitCoverageMapping)
65-
: M(M), Root(Root), EmitCoverageMapping(EmitCoverageMapping) {}
66+
SILProfiler(SILModule &M, ASTNode Root, SILDeclRef forDecl,
67+
bool EmitCoverageMapping)
68+
: M(M), Root(Root), forDecl(forDecl),
69+
EmitCoverageMapping(EmitCoverageMapping) {}
6670

6771
public:
6872
static SILProfiler *create(SILModule &M, ForDefinition_t forDefinition,
69-
ASTNode N);
73+
ASTNode N, SILDeclRef forDecl);
7074

7175
/// Check if the function is set up for profiling.
7276
bool hasRegionCounters() const { return NumRegionCounters != 0; }

trunk/lib/SIL/SILFunction.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,10 @@ SILFunction::~SILFunction() {
151151
"Function cannot be deleted while function_ref's still exist");
152152
}
153153

154-
void SILFunction::createProfiler(ASTNode Root, ForDefinition_t forDefinition) {
154+
void SILFunction::createProfiler(ASTNode Root, SILDeclRef forDecl,
155+
ForDefinition_t forDefinition) {
155156
assert(!Profiler && "Function already has a profiler");
156-
Profiler = SILProfiler::create(Module, forDefinition, Root);
157+
Profiler = SILProfiler::create(Module, forDefinition, Root, forDecl);
157158
}
158159

159160
bool SILFunction::hasForeignBody() const {

0 commit comments

Comments
 (0)