Skip to content

Commit 4df8bf9

Browse files
committed
Merge remote-tracking branch 'github/master' into HEAD
2 parents 0998e42 + 028c59b commit 4df8bf9

File tree

21 files changed

+76
-103
lines changed

21 files changed

+76
-103
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ if(POLICY CMP0067)
1212
cmake_policy(SET CMP0067 NEW)
1313
endif()
1414

15+
# Convert relative paths to absolute for subdirectory `target_sources`
16+
if(POLICY CMP0076)
17+
cmake_policy(SET CMP0076 NEW)
18+
endif()
19+
1520
# Add path for custom CMake modules.
1621
list(APPEND CMAKE_MODULE_PATH
1722
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")

lib/SIL/CMakeLists.txt

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,16 @@
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-
291
add_swift_host_library(swiftSIL STATIC
30-
${SIL_SOURCES})
2+
SIL.cpp)
313
target_link_libraries(swiftSIL PUBLIC
324
swiftDemangling)
335
target_link_libraries(swiftSIL PRIVATE
346
swiftSema
357
swiftSerialization)
368

9+
add_subdirectory(IR)
10+
add_subdirectory(Utils)
11+
add_subdirectory(Verifier)
12+
add_subdirectory(Parser)
13+
3714
# intrinsics_gen is the LLVM tablegen target that generates the include files
3815
# where intrinsics and attributes are declared. swiftSIL depends on these
3916
# headers.

lib/SIL/IR/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
sil_register_sources(
1+
target_sources(swiftSIL PRIVATE
22
AbstractionPattern.cpp
33
Bridging.cpp
44
Linker.cpp
@@ -31,5 +31,4 @@ sil_register_sources(
3131
SILValue.cpp
3232
SILWitnessTable.cpp
3333
TypeLowering.cpp
34-
ValueOwnership.cpp
35-
)
34+
ValueOwnership.cpp)

lib/SIL/Parser/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
sil_register_sources(
2-
ParseSIL.cpp
3-
)
4-
1+
target_sources(swiftSIL PRIVATE
2+
ParseSIL.cpp)

lib/SIL/SIL.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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.

lib/SIL/Utils/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
sil_register_sources(
1+
target_sources(swiftSIL PRIVATE
22
BasicBlockUtils.cpp
33
DebugUtils.cpp
44
Dominance.cpp
@@ -13,5 +13,4 @@ sil_register_sources(
1313
SILInstructionWorklist.cpp
1414
SILOpenedArchetypesTracker.cpp
1515
SILRemarkStreamer.cpp
16-
ValueUtils.cpp
17-
)
16+
ValueUtils.cpp)

lib/SIL/Verifier/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
sil_register_sources(
1+
target_sources(swiftSIL PRIVATE
22
LoadBorrowInvalidationChecker.cpp
33
LinearLifetimeChecker.cpp
44
MemoryLifetime.cpp
55
SILOwnershipVerifier.cpp
6-
SILVerifier.cpp
7-
)
6+
SILVerifier.cpp)

lib/SILOptimizer/ARC/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
silopt_register_sources(
1+
target_sources(swiftSILOptimizer PRIVATE
22
ARCBBState.cpp
33
ARCLoopOpts.cpp
44
ARCMatchingSet.cpp
@@ -8,5 +8,4 @@ silopt_register_sources(
88
GlobalLoopARCSequenceDataflow.cpp
99
RCStateTransition.cpp
1010
RCStateTransitionVisitors.cpp
11-
RefCountState.cpp
12-
)
11+
RefCountState.cpp)

lib/SILOptimizer/Analysis/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
silopt_register_sources(
1+
target_sources(swiftSILOptimizer PRIVATE
22
ARCAnalysis.cpp
33
AccessSummaryAnalysis.cpp
44
AccessedStorageAnalysis.cpp
@@ -25,5 +25,4 @@ silopt_register_sources(
2525
SideEffectAnalysis.cpp
2626
SimplifyInstruction.cpp
2727
TypeExpansionAnalysis.cpp
28-
ValueTracking.cpp
29-
)
28+
ValueTracking.cpp)

lib/SILOptimizer/CMakeLists.txt

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,7 @@
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)
235

246
add_subdirectory(ARC)
257
add_subdirectory(Analysis)
@@ -33,8 +15,3 @@ add_subdirectory(SILCombiner)
3315
add_subdirectory(Transforms)
3416
add_subdirectory(UtilityPasses)
3517
add_subdirectory(Utils)
36-
37-
add_swift_host_library(swiftSILOptimizer STATIC
38-
${SILOPTIMIZER_SOURCES})
39-
target_link_libraries(swiftSILOptimizer PRIVATE
40-
swiftSIL)
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
silopt_register_sources(
1+
target_sources(swiftSILOptimizer PRIVATE
22
ADContext.cpp
33
Common.cpp
44
DifferentiationInvoker.cpp
55
JVPEmitter.cpp
66
LinearMapInfo.cpp
77
PullbackEmitter.cpp
88
Thunk.cpp
9-
VJPEmitter.cpp
10-
)
9+
VJPEmitter.cpp)
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
silopt_register_sources(
1+
target_sources(swiftSILOptimizer PRIVATE
22
FunctionSignatureOpts.cpp
33
DeadArgumentTransform.cpp
44
ArgumentExplosionTransform.cpp
55
OwnedToGuaranteedTransform.cpp
66
ExistentialSpecializer.cpp
7-
ExistentialTransform.cpp
8-
)
7+
ExistentialTransform.cpp)

lib/SILOptimizer/IPO/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
silopt_register_sources(
1+
target_sources(swiftSILOptimizer PRIVATE
22
CapturePromotion.cpp
33
CapturePropagation.cpp
44
ClosureSpecializer.cpp
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
silopt_register_sources(
1+
target_sources(swiftSILOptimizer PRIVATE
22
ArrayBoundsCheckOpts.cpp
33
ArrayPropertyOpt.cpp
44
COWArrayOpt.cpp
55
LoopRotate.cpp
66
LoopUnroll.cpp
77
LICM.cpp
8-
ForEachLoopUnroll.cpp
9-
)
8+
ForEachLoopUnroll.cpp)

lib/SILOptimizer/Mandatory/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
silopt_register_sources(
1+
target_sources(swiftSILOptimizer PRIVATE
22
AccessEnforcementSelection.cpp
33
AccessMarkerElimination.cpp
44
AddressLowering.cpp
@@ -25,5 +25,4 @@ silopt_register_sources(
2525
YieldOnceCheck.cpp
2626
MandatoryCombine.cpp
2727
OSLogOptimization.cpp
28-
OwnershipModelEliminator.cpp
29-
)
28+
OwnershipModelEliminator.cpp)
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
silopt_register_sources(
1+
target_sources(swiftSILOptimizer PRIVATE
22
PassManager.cpp
33
Passes.cpp
44
PassPipeline.cpp
55
PrettyStackTrace.cpp
6-
SILOptimizerRequests.cpp
7-
)
6+
SILOptimizerRequests.cpp)
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
silopt_register_sources(
1+
target_sources(swiftSILOptimizer PRIVATE
22
SILCombine.cpp
33
SILCombinerApplyVisitors.cpp
44
SILCombinerBuiltinVisitors.cpp
55
SILCombinerCastVisitors.cpp
6-
SILCombinerMiscVisitors.cpp
7-
)
6+
SILCombinerMiscVisitors.cpp)

lib/SILOptimizer/SILOptimizer.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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.

lib/SILOptimizer/Transforms/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
silopt_register_sources(
1+
target_sources(swiftSILOptimizer PRIVATE
22
ARCCodeMotion.cpp
33
AccessEnforcementDom.cpp
44
AccessEnforcementOpts.cpp
@@ -37,5 +37,4 @@ silopt_register_sources(
3737
SpeculativeDevirtualizer.cpp
3838
StackPromotion.cpp
3939
TempRValueElimination.cpp
40-
UnsafeGuaranteedPeephole.cpp
41-
)
40+
UnsafeGuaranteedPeephole.cpp)

lib/SILOptimizer/UtilityPasses/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
silopt_register_sources(
1+
target_sources(swiftSILOptimizer PRIVATE
22
AADumper.cpp
33
AccessSummaryDumper.cpp
44
AccessedStorageDumper.cpp
@@ -31,5 +31,4 @@ silopt_register_sources(
3131
SimplifyUnreachableContainingBlocks.cpp
3232
StripDebugInfo.cpp
3333
OwnershipDumper.cpp
34-
OwnershipVerifierTextualErrorDumper.cpp
35-
)
34+
OwnershipVerifierTextualErrorDumper.cpp)

lib/SILOptimizer/Utils/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
silopt_register_sources(
1+
target_sources(swiftSILOptimizer PRIVATE
22
BasicBlockOptUtils.cpp
33
CFGOptUtils.cpp
44
CanonicalizeInstruction.cpp
@@ -21,5 +21,4 @@ silopt_register_sources(
2121
SILSSAUpdater.cpp
2222
SpecializationMangler.cpp
2323
StackNesting.cpp
24-
ValueLifetime.cpp
25-
)
24+
ValueLifetime.cpp)

0 commit comments

Comments
 (0)