mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
* Record each IfConfig clause location info in SourceFile * Update SILProfiler to handle them * Update SwiftLangSupport::findActiveRegionsInFile() to use the recorded regions instead of walking into AST to find #if regions rdar://118082146
20 lines
420 B
Swift
20 lines
420 B
Swift
func foo() -> Int {
|
|
#if true
|
|
#if true
|
|
return 1
|
|
#else
|
|
return 2
|
|
#endif
|
|
#else
|
|
return 3
|
|
#endif
|
|
}
|
|
|
|
// RUN: %sourcekitd-test -req=active-regions %s -- -D FLAG_1 -module-name active_regions %s | %FileCheck -check-prefix=CHECK1 %s
|
|
// CHECK1: START IF CONFIGS
|
|
// CHECK1-NEXT: 2:3 - active
|
|
// CHECK1-NEXT: 3:3 - active
|
|
// CHECK1-NEXT: 5:3 - inactive
|
|
// CHECK1-NEXT: 8:3 - inactive
|
|
// CHECK1-NEXT: END IF CONFIGS
|