mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Ignore profile counter instructions in the dihole verifier.
rdar://107764966
This commit is contained in:
@@ -6257,6 +6257,10 @@ public:
|
||||
for (SILInstruction &SI : *BB) {
|
||||
if (SI.isMetaInstruction())
|
||||
continue;
|
||||
// FIXME: Profile counters for loop bodies may be emitted before the
|
||||
// instructions for the loop variable, but in a deeper scope.
|
||||
if (isa<IncrementProfilerCounterInst>(SI))
|
||||
continue;
|
||||
if (SI.getLoc().getKind() == SILLocation::CleanupKind)
|
||||
continue;
|
||||
// FIXME: These still leave holes in the scopes. We should make them
|
||||
|
||||
13
test/DebugInfo/profile_counter.swift
Normal file
13
test/DebugInfo/profile_counter.swift
Normal file
@@ -0,0 +1,13 @@
|
||||
// RUN: %target-swift-frontend %s -g -emit-sil -profile-generate -profile-coverage-mapping -parse-as-library -o - | %FileCheck %s
|
||||
|
||||
func consume<T>(_ t: T) {}
|
||||
|
||||
public func f<T>(collection : [T]) {
|
||||
for element in collection {
|
||||
// CHECK: increment_profiler_counter {{.*}}:[[@LINE-1]]:29, scope [[SCOPE:[0-9]+]]
|
||||
// FIXME: Ideally, these would share the same scope, or the increment should come below the variable initialization code.
|
||||
// CHECK: unchecked_take_enum_data_addr {{.*}}:[[@LINE-3]]:3, scope
|
||||
// CHECK: copy_addr {{.*}}:[[@LINE-4]]:29, scope [[SCOPE]]
|
||||
consume(element)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user