mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add support for function_entry_count Profile counter
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user