Add support for function_entry_count Profile counter

This commit is contained in:
Joe Shajrawi
2017-09-11 16:51:17 -07:00
parent 72c66cab9a
commit 2c03144436
29 changed files with 153 additions and 137 deletions

View File

@@ -57,7 +57,8 @@ SILFunction *SILFunction::create(
SILModule &M, SILLinkage linkage, StringRef name,
CanSILFunctionType loweredType, GenericEnvironment *genericEnv,
Optional<SILLocation> loc, IsBare_t isBareSILFunction,
IsTransparent_t isTrans, IsSerialized_t isSerialized, IsThunk_t isThunk,
IsTransparent_t isTrans, IsSerialized_t isSerialized,
Optional<uint64_t> entryCount, IsThunk_t isThunk,
SubclassScope classSubclassScope, Inline_t inlineStrategy, EffectsKind E,
SILFunction *insertBefore, const SILDebugScope *debugScope) {
// Get a StringMapEntry for the function. As a sop to error cases,
@@ -72,8 +73,8 @@ SILFunction *SILFunction::create(
auto fn = new (M) SILFunction(M, linkage, name, loweredType, genericEnv, loc,
isBareSILFunction, isTrans, isSerialized,
isThunk, classSubclassScope, inlineStrategy, E,
insertBefore, debugScope);
entryCount, isThunk, classSubclassScope,
inlineStrategy, E, insertBefore, debugScope);
if (entry) entry->setValue(fn);
return fn;
@@ -84,18 +85,18 @@ SILFunction::SILFunction(SILModule &Module, SILLinkage Linkage, StringRef Name,
GenericEnvironment *genericEnv,
Optional<SILLocation> Loc, IsBare_t isBareSILFunction,
IsTransparent_t isTrans, IsSerialized_t isSerialized,
IsThunk_t isThunk, SubclassScope classSubclassScope,
Optional<uint64_t> entryCount, IsThunk_t isThunk,
SubclassScope classSubclassScope,
Inline_t inlineStrategy, EffectsKind E,
SILFunction *InsertBefore,
const SILDebugScope *DebugScope)
: Module(Module), Name(Name), LoweredType(LoweredType),
GenericEnv(genericEnv), SpecializationInfo(nullptr),
DebugScope(DebugScope), Bare(isBareSILFunction),
Transparent(isTrans), Serialized(isSerialized), Thunk(isThunk),
DebugScope(DebugScope), Bare(isBareSILFunction), Transparent(isTrans),
Serialized(isSerialized), Thunk(isThunk),
ClassSubclassScope(unsigned(classSubclassScope)), GlobalInitFlag(false),
InlineStrategy(inlineStrategy), Linkage(unsigned(Linkage)),
KeepAsPublic(false), EffectsKindAttr(E) {
KeepAsPublic(false), EffectsKindAttr(E), EntryCount(entryCount) {
if (InsertBefore)
Module.functions.insert(SILModule::iterator(InsertBefore), this);
else