File tree Expand file tree Collapse file tree 21 files changed +76
-103
lines changed
FunctionSignatureTransforms Expand file tree Collapse file tree 21 files changed +76
-103
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,11 @@ if(POLICY CMP0067)
12
12
cmake_policy (SET CMP0067 NEW )
13
13
endif ()
14
14
15
+ # Convert relative paths to absolute for subdirectory `target_sources`
16
+ if (POLICY CMP0076 )
17
+ cmake_policy (SET CMP0076 NEW )
18
+ endif ()
19
+
15
20
# Add path for custom CMake modules.
16
21
list (APPEND CMAKE_MODULE_PATH
17
22
"${CMAKE_CURRENT_SOURCE_DIR} /cmake/modules" )
Original file line number Diff line number Diff line change 1
-
2
- set (SIL_SOURCES )
3
-
4
- function (_list_transform newvar )
5
- set (sources ${ARGN} )
6
- set (dir ${CMAKE_CURRENT_SOURCE_DIR} )
7
- set (tmp )
8
- foreach (s ${sources} )
9
- list (APPEND tmp "${dir} /${s} " )
10
- endforeach ()
11
- set (${newvar} "${tmp} " PARENT_SCOPE )
12
- endfunction ()
13
-
14
- macro (sil_register_sources )
15
- precondition (new_transformed_sources
16
- NEGATE
17
- MESSAGE "Expected this to be empty since we clear after each run" )
18
- _list_transform (new_transformed_sources ${ARGN} )
19
- list_union ("${SIL_SOURCES} " "${new_transformed_sources} " out )
20
- set (SIL_SOURCES "${out} " PARENT_SCOPE )
21
- set (new_transformed_sources )
22
- endmacro ()
23
-
24
- add_subdirectory (IR )
25
- add_subdirectory (Utils )
26
- add_subdirectory (Verifier )
27
- add_subdirectory (Parser )
28
-
29
1
add_swift_host_library (swiftSIL STATIC
30
- ${SIL_SOURCES} )
2
+ SIL.cpp )
31
3
target_link_libraries (swiftSIL PUBLIC
32
4
swiftDemangling )
33
5
target_link_libraries (swiftSIL PRIVATE
34
6
swiftSema
35
7
swiftSerialization )
36
8
9
+ add_subdirectory (IR )
10
+ add_subdirectory (Utils )
11
+ add_subdirectory (Verifier )
12
+ add_subdirectory (Parser )
13
+
37
14
# intrinsics_gen is the LLVM tablegen target that generates the include files
38
15
# where intrinsics and attributes are declared. swiftSIL depends on these
39
16
# headers.
Original file line number Diff line number Diff line change 1
- sil_register_sources (
1
+ target_sources ( swiftSIL PRIVATE
2
2
AbstractionPattern.cpp
3
3
Bridging.cpp
4
4
Linker.cpp
@@ -31,5 +31,4 @@ sil_register_sources(
31
31
SILValue.cpp
32
32
SILWitnessTable.cpp
33
33
TypeLowering.cpp
34
- ValueOwnership.cpp
35
- )
34
+ ValueOwnership.cpp )
Original file line number Diff line number Diff line change 1
- sil_register_sources (
2
- ParseSIL.cpp
3
- )
4
-
1
+ target_sources (swiftSIL PRIVATE
2
+ ParseSIL.cpp )
Original file line number Diff line number Diff line change
1
+ // ===--- SIL.cpp ---------------------------------------------------------===//
2
+ //
3
+ // This source file is part of the Swift.org open source project
4
+ //
5
+ // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
6
+ // Licensed under Apache License v2.0 with Runtime Library Exception
7
+ //
8
+ // See https://swift.org/LICENSE.txt for license information
9
+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10
+ //
11
+ // ===----------------------------------------------------------------------===//
12
+
13
+ // DO NOT MODIFY THIS FILE!
14
+ // The SIL library is split into sub-components, modify the respective
15
+ // sub-component.
Original file line number Diff line number Diff line change 1
- sil_register_sources (
1
+ target_sources ( swiftSIL PRIVATE
2
2
BasicBlockUtils.cpp
3
3
DebugUtils.cpp
4
4
Dominance.cpp
@@ -13,5 +13,4 @@ sil_register_sources(
13
13
SILInstructionWorklist.cpp
14
14
SILOpenedArchetypesTracker.cpp
15
15
SILRemarkStreamer.cpp
16
- ValueUtils.cpp
17
- )
16
+ ValueUtils.cpp )
Original file line number Diff line number Diff line change 1
- sil_register_sources (
1
+ target_sources ( swiftSIL PRIVATE
2
2
LoadBorrowInvalidationChecker.cpp
3
3
LinearLifetimeChecker.cpp
4
4
MemoryLifetime.cpp
5
5
SILOwnershipVerifier.cpp
6
- SILVerifier.cpp
7
- )
6
+ SILVerifier.cpp )
Original file line number Diff line number Diff line change 1
- silopt_register_sources (
1
+ target_sources ( swiftSILOptimizer PRIVATE
2
2
ARCBBState.cpp
3
3
ARCLoopOpts.cpp
4
4
ARCMatchingSet.cpp
@@ -8,5 +8,4 @@ silopt_register_sources(
8
8
GlobalLoopARCSequenceDataflow.cpp
9
9
RCStateTransition.cpp
10
10
RCStateTransitionVisitors.cpp
11
- RefCountState.cpp
12
- )
11
+ RefCountState.cpp )
Original file line number Diff line number Diff line change 1
- silopt_register_sources (
1
+ target_sources ( swiftSILOptimizer PRIVATE
2
2
ARCAnalysis.cpp
3
3
AccessSummaryAnalysis.cpp
4
4
AccessedStorageAnalysis.cpp
@@ -25,5 +25,4 @@ silopt_register_sources(
25
25
SideEffectAnalysis.cpp
26
26
SimplifyInstruction.cpp
27
27
TypeExpansionAnalysis.cpp
28
- ValueTracking.cpp
29
- )
28
+ ValueTracking.cpp )
Original file line number Diff line number Diff line change 1
-
2
- set (SILOPTIMIZER_SOURCES )
3
-
4
- function (_list_transform newvar )
5
- set (sources ${ARGN} )
6
- set (dir ${CMAKE_CURRENT_SOURCE_DIR} )
7
- set (tmp )
8
- foreach (s ${sources} )
9
- list (APPEND tmp "${dir} /${s} " )
10
- endforeach ()
11
- set (${newvar} "${tmp} " PARENT_SCOPE )
12
- endfunction ()
13
-
14
- macro (silopt_register_sources )
15
- precondition (new_transformed_sources
16
- NEGATE
17
- MESSAGE "Expected this to be empty since we clear after each run" )
18
- _list_transform (new_transformed_sources ${ARGN} )
19
- list_union ("${SILOPTIMIZER_SOURCES} " "${new_transformed_sources} " out )
20
- set (SILOPTIMIZER_SOURCES "${out} " PARENT_SCOPE )
21
- set (new_transformed_sources )
22
- endmacro ()
1
+ add_swift_host_library (swiftSILOptimizer STATIC
2
+ SILOptimizer.cpp )
3
+ target_link_libraries (swiftSILOptimizer PRIVATE
4
+ swiftSIL )
23
5
24
6
add_subdirectory (ARC )
25
7
add_subdirectory (Analysis )
@@ -33,8 +15,3 @@ add_subdirectory(SILCombiner)
33
15
add_subdirectory (Transforms )
34
16
add_subdirectory (UtilityPasses )
35
17
add_subdirectory (Utils )
36
-
37
- add_swift_host_library (swiftSILOptimizer STATIC
38
- ${SILOPTIMIZER_SOURCES} )
39
- target_link_libraries (swiftSILOptimizer PRIVATE
40
- swiftSIL )
Original file line number Diff line number Diff line change 1
- silopt_register_sources (
1
+ target_sources ( swiftSILOptimizer PRIVATE
2
2
ADContext.cpp
3
3
Common.cpp
4
4
DifferentiationInvoker.cpp
5
5
JVPEmitter.cpp
6
6
LinearMapInfo.cpp
7
7
PullbackEmitter.cpp
8
8
Thunk.cpp
9
- VJPEmitter.cpp
10
- )
9
+ VJPEmitter.cpp )
Original file line number Diff line number Diff line change 1
- silopt_register_sources (
1
+ target_sources ( swiftSILOptimizer PRIVATE
2
2
FunctionSignatureOpts.cpp
3
3
DeadArgumentTransform.cpp
4
4
ArgumentExplosionTransform.cpp
5
5
OwnedToGuaranteedTransform.cpp
6
6
ExistentialSpecializer.cpp
7
- ExistentialTransform.cpp
8
- )
7
+ ExistentialTransform.cpp )
Original file line number Diff line number Diff line change 1
- silopt_register_sources (
1
+ target_sources ( swiftSILOptimizer PRIVATE
2
2
CapturePromotion.cpp
3
3
CapturePropagation.cpp
4
4
ClosureSpecializer.cpp
Original file line number Diff line number Diff line change 1
- silopt_register_sources (
1
+ target_sources ( swiftSILOptimizer PRIVATE
2
2
ArrayBoundsCheckOpts.cpp
3
3
ArrayPropertyOpt.cpp
4
4
COWArrayOpt.cpp
5
5
LoopRotate.cpp
6
6
LoopUnroll.cpp
7
7
LICM.cpp
8
- ForEachLoopUnroll.cpp
9
- )
8
+ ForEachLoopUnroll.cpp )
Original file line number Diff line number Diff line change 1
- silopt_register_sources (
1
+ target_sources ( swiftSILOptimizer PRIVATE
2
2
AccessEnforcementSelection.cpp
3
3
AccessMarkerElimination.cpp
4
4
AddressLowering.cpp
@@ -25,5 +25,4 @@ silopt_register_sources(
25
25
YieldOnceCheck.cpp
26
26
MandatoryCombine.cpp
27
27
OSLogOptimization.cpp
28
- OwnershipModelEliminator.cpp
29
- )
28
+ OwnershipModelEliminator.cpp )
Original file line number Diff line number Diff line change 1
- silopt_register_sources (
1
+ target_sources ( swiftSILOptimizer PRIVATE
2
2
PassManager.cpp
3
3
Passes.cpp
4
4
PassPipeline.cpp
5
5
PrettyStackTrace.cpp
6
- SILOptimizerRequests.cpp
7
- )
6
+ SILOptimizerRequests.cpp )
Original file line number Diff line number Diff line change 1
- silopt_register_sources (
1
+ target_sources ( swiftSILOptimizer PRIVATE
2
2
SILCombine.cpp
3
3
SILCombinerApplyVisitors.cpp
4
4
SILCombinerBuiltinVisitors.cpp
5
5
SILCombinerCastVisitors.cpp
6
- SILCombinerMiscVisitors.cpp
7
- )
6
+ SILCombinerMiscVisitors.cpp )
Original file line number Diff line number Diff line change
1
+ // ===--- SILOptimizer.cpp -------------------------------------------------===//
2
+ //
3
+ // This source file is part of the Swift.org open source project
4
+ //
5
+ // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
6
+ // Licensed under Apache License v2.0 with Runtime Library Exception
7
+ //
8
+ // See https://swift.org/LICENSE.txt for license information
9
+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10
+ //
11
+ // ===----------------------------------------------------------------------===//
12
+
13
+ // DO NOT MODIFY THIS FILE!
14
+ // The SILOptimizer library is split into sub-components, modify the respective
15
+ // sub-component.
Original file line number Diff line number Diff line change 1
- silopt_register_sources (
1
+ target_sources ( swiftSILOptimizer PRIVATE
2
2
ARCCodeMotion.cpp
3
3
AccessEnforcementDom.cpp
4
4
AccessEnforcementOpts.cpp
@@ -37,5 +37,4 @@ silopt_register_sources(
37
37
SpeculativeDevirtualizer.cpp
38
38
StackPromotion.cpp
39
39
TempRValueElimination.cpp
40
- UnsafeGuaranteedPeephole.cpp
41
- )
40
+ UnsafeGuaranteedPeephole.cpp )
Original file line number Diff line number Diff line change 1
- silopt_register_sources (
1
+ target_sources ( swiftSILOptimizer PRIVATE
2
2
AADumper.cpp
3
3
AccessSummaryDumper.cpp
4
4
AccessedStorageDumper.cpp
@@ -31,5 +31,4 @@ silopt_register_sources(
31
31
SimplifyUnreachableContainingBlocks.cpp
32
32
StripDebugInfo.cpp
33
33
OwnershipDumper.cpp
34
- OwnershipVerifierTextualErrorDumper.cpp
35
- )
34
+ OwnershipVerifierTextualErrorDumper.cpp )
Original file line number Diff line number Diff line change 1
- silopt_register_sources (
1
+ target_sources ( swiftSILOptimizer PRIVATE
2
2
BasicBlockOptUtils.cpp
3
3
CFGOptUtils.cpp
4
4
CanonicalizeInstruction.cpp
@@ -21,5 +21,4 @@ silopt_register_sources(
21
21
SILSSAUpdater.cpp
22
22
SpecializationMangler.cpp
23
23
StackNesting.cpp
24
- ValueLifetime.cpp
25
- )
24
+ ValueLifetime.cpp )
You can’t perform that action at this time.
0 commit comments