Skip to content

Commit ad09f43

Browse files
authored
Merge pull request swiftlang#30721 from gottesmm/pr-9bd61b5e1ce86b9720bc31742b334cc1dcc06bf8
[sil] Split library into subfolders, while still building as a single library still.
2 parents 963c7fc + e1a19e4 commit ad09f43

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+87
-57
lines changed

lib/SIL/CMakeLists.txt

Lines changed: 28 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,32 @@
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+
128
add_swift_host_library(swiftSIL STATIC
2-
AbstractionPattern.cpp
3-
BasicBlockUtils.cpp
4-
Bridging.cpp
5-
DebugUtils.cpp
6-
Dominance.cpp
7-
DynamicCasts.cpp
8-
InstructionUtils.cpp
9-
MemAccessUtils.cpp
10-
Linker.cpp
11-
LinearLifetimeChecker.cpp
12-
LoopInfo.cpp
13-
MemoryLifetime.cpp
14-
Notifications.cpp
15-
OperandOwnership.cpp
16-
OptimizationRemark.cpp
17-
OwnershipUtils.cpp
18-
PrettyStackTrace.cpp
19-
Projection.cpp
20-
SIL.cpp
21-
SILArgument.cpp
22-
SILBasicBlock.cpp
23-
SILBuilder.cpp
24-
SILConstants.cpp
25-
SILCoverageMap.cpp
26-
SILDebugScope.cpp
27-
SILDeclRef.cpp
28-
SILDefaultWitnessTable.cpp
29-
SILDifferentiabilityWitness.cpp
30-
SILFunction.cpp
31-
SILFunctionType.cpp
32-
SILGlobalVariable.cpp
33-
SILInstruction.cpp
34-
SILInstructions.cpp
35-
SILInstructionWorklist.cpp
36-
SILLocation.cpp
37-
SILModule.cpp
38-
SILFunctionBuilder.cpp
39-
SILOpenedArchetypesTracker.cpp
40-
SILPrinter.cpp
41-
SILProfiler.cpp
42-
SILRemarkStreamer.cpp
43-
SILSuccessor.cpp
44-
SILType.cpp
45-
SILUndef.cpp
46-
SILValue.cpp
47-
SILVerifier.cpp
48-
SILOwnershipVerifier.cpp
49-
SILVTable.cpp
50-
SILWitnessTable.cpp
51-
TypeLowering.cpp
52-
ValueOwnership.cpp
53-
ValueUtils.cpp)
29+
${SIL_SOURCES})
5430
target_link_libraries(swiftSIL PRIVATE
5531
swiftSema
5632
swiftSerialization)
File renamed without changes.
File renamed without changes.

lib/SIL/IR/CMakeLists.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
sil_register_sources(
2+
AbstractionPattern.cpp
3+
Bridging.cpp
4+
Linker.cpp
5+
Notifications.cpp
6+
OperandOwnership.cpp
7+
SIL.cpp
8+
SILArgument.cpp
9+
SILBasicBlock.cpp
10+
SILBuilder.cpp
11+
SILConstants.cpp
12+
SILCoverageMap.cpp
13+
SILDebugScope.cpp
14+
SILDeclRef.cpp
15+
SILDefaultWitnessTable.cpp
16+
SILDifferentiabilityWitness.cpp
17+
SILFunction.cpp
18+
SILFunctionBuilder.cpp
19+
SILFunctionType.cpp
20+
SILGlobalVariable.cpp
21+
SILInstruction.cpp
22+
SILInstructions.cpp
23+
SILLocation.cpp
24+
SILModule.cpp
25+
SILPrinter.cpp
26+
SILProfiler.cpp
27+
SILSuccessor.cpp
28+
SILType.cpp
29+
SILUndef.cpp
30+
SILVTable.cpp
31+
SILValue.cpp
32+
SILWitnessTable.cpp
33+
TypeLowering.cpp
34+
ValueOwnership.cpp
35+
)
File renamed without changes.
File renamed without changes.
File renamed without changes.

lib/SIL/OperandOwnership.cpp renamed to lib/SIL/IR/OperandOwnership.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#include "LinearLifetimeCheckerPrivate.h"
1413
#include "swift/SIL/ApplySite.h"
1514
#include "swift/SIL/OwnershipUtils.h"
1615
#include "swift/SIL/SILBuiltinVisitor.h"
@@ -36,7 +35,6 @@ class OperandOwnershipKindClassifier
3635
LLVM_ATTRIBUTE_UNUSED SILModule &mod;
3736

3837
const Operand &op;
39-
LinearLifetimeChecker::ErrorBehaviorKind errorBehavior;
4038
bool checkingSubObject;
4139

4240
public:
@@ -49,9 +47,8 @@ class OperandOwnershipKindClassifier
4947
/// like struct_extract.
5048
OperandOwnershipKindClassifier(
5149
SILModule &mod, const Operand &op,
52-
LinearLifetimeChecker::ErrorBehaviorKind errorBehavior,
5350
bool checkingSubObject)
54-
: mod(mod), op(op), errorBehavior(errorBehavior),
51+
: mod(mod), op(op),
5552
checkingSubObject(checkingSubObject) {}
5653

5754
bool isCheckingSubObject() const { return checkingSubObject; }
@@ -1050,7 +1047,6 @@ OperandOwnershipKindMap
10501047
Operand::getOwnershipKindMap(bool isForwardingSubValue) const {
10511048
OperandOwnershipKindClassifier classifier(
10521049
getUser()->getModule(), *this,
1053-
LinearLifetimeChecker::ErrorBehaviorKind::ReturnFalse,
10541050
isForwardingSubValue);
10551051
return classifier.visit(const_cast<SILInstruction *>(getUser()));
10561052
}
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)