Skip to content

Commit 3540c01

Browse files
committed
rename initializeLibSwift -> InitializeSwiftModules
and some updates in comments.
1 parent 48f5cba commit 3540c01

File tree

21 files changed

+51
-53
lines changed

21 files changed

+51
-53
lines changed

SwiftCompilerSources/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import PackageDescription
44

55
let package = Package(
6-
name: "libswift",
6+
name: "SwiftCompilerSources",
77
platforms: [
88
.macOS("10.9"),
99
],

SwiftCompilerSources/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ This makes the SIL API easy to use and it allows to program in a "Swifty" style.
111111

112112
Bridging SIL classes is implemented by including a two word Swift object header (`SwiftObjectHeader`) in the C++ definition of a class, like in `SILFunction`, `SILBasicBlock` or `SILNode`. This enables to use SIL objects on both, the C++ and the Swift, side.
113113

114-
The Swift class metatypes are "registered" by `registerClass()`, called from `initializeLibSwift()`. On the C++ side, they are stored in static global variables (see `registerBridgedClass()`) and then used to initialize the object headers in the class constructors.
114+
The Swift class metatypes are "registered" by `registerClass()`, called from `initializeSwiftModules()`. On the C++ side, they are stored in static global variables (see `registerBridgedClass()`) and then used to initialize the object headers in the class constructors.
115115

116116
The reference counts in the object header are initialized to "immortal", which let's all ARC operations on SIL objects be no-ops.
117117

SwiftCompilerSources/Sources/Optimizer/PassManager/PassRegistration.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import OptimizerBridging
1717
import ExperimentalRegex
1818
#endif
1919

20-
@_cdecl("initializeLibSwift")
21-
public func initializeLibSwift() {
20+
@_cdecl("initializeSwiftModules")
21+
public func initializeSwiftModules() {
2222
registerSILClasses()
2323
registerSwiftPasses()
2424

SwiftCompilerSources/stubs.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
extern "C" {
1414

15-
void initializeLibSwift();
15+
void initializeSwiftModules();
1616

1717
}
1818

19-
void initializeLibSwift() {}
19+
void initializeSwiftModules() {}
2020

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- InitializeLibSwift.h -----------------------------------*- C++ -*-===//
1+
//===--- InitializeSwiftModules.h -------------------------------*- C++ -*-===//
22
//
33
// This source file is part of the Swift.org open source project
44
//
@@ -10,17 +10,17 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#ifndef SWIFT_BASIC_INITIALIZELIBSWIFT_H
14-
#define SWIFT_BASIC_INITIALIZELIBSWIFT_H
13+
#ifndef SWIFT_BASIC_INITIALIZE_SWIFT_MODULES_H
14+
#define SWIFT_BASIC_INITIALIZE_SWIFT_MODULES_H
1515

1616
#ifdef __cplusplus
1717
extern "C" {
1818
#endif
1919

20-
void initializeLibSwift();
20+
void initializeSwiftModules();
2121

2222
#ifdef __cplusplus
2323
}
2424
#endif
2525

26-
#endif // SWIFT_BASIC_INITIALIZELIBSWIFT_H
26+
#endif // SWIFT_BASIC_INITIALIZE_SWIFT_MODULES_H

include/swift/SIL/SILBridgingUtils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ inline StringRef getStringRef(BridgedStringRef str) {
3434
/// freeing it.
3535
inline BridgedStringRef getCopiedBridgedStringRef(std::string str,
3636
bool removeTrailingNewline = false) {
37-
// A couple of mallocs are needed for passing a std::string to libswift. But
37+
// A couple of mallocs are needed for passing a std::string to Swift. But
3838
// it's currently only used or debug descriptions. So, its' maybe not so bad -
3939
// for now.
40-
// TODO: find a better way to pass std::strings to libswift.
40+
// TODO: find a better way to pass std::strings to Swift.
4141
StringRef strRef(str);
4242
if (removeTrailingNewline)
4343
strRef.consume_back("\n");

include/swift/SIL/SILBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class SILBuilder {
123123
setInsertionPoint(I);
124124
}
125125

126-
// Used by libswift bridging.
126+
// Used by swift bridging.
127127
explicit SILBuilder(SILInstruction *I, const SILDebugScope *debugScope)
128128
: TempContext(I->getFunction()->getModule()),
129129
C(TempContext), F(I->getFunction()), CurDebugScope(debugScope) {

include/swift/SIL/SILInstructionWorklist.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ template <typename VectorT = std::vector<SILInstruction *>,
6767
class SILInstructionWorklist : SILInstructionWorklistBase {
6868
BlotSetVector<SILInstruction *, VectorT, MapT> worklist;
6969

70-
/// For invoking Swift instruction passes in libswift.
70+
/// For invoking Swift instruction passes in Swift.
7171
LibswiftPassInvocation *libswiftPassInvocation = nullptr;
7272

7373
void operator=(const SILInstructionWorklist &rhs) = delete;

include/swift/SIL/SILModule.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ class Output;
5959
namespace swift {
6060

6161
/// The payload for the FixedSizeSlab.
62-
/// This is a super-class rather than a member of FixedSizeSlab to make bridging
63-
/// with libswift easier.
62+
/// This is a super-class rather than a member of FixedSizeSlab to make swift
63+
/// bridging easier.
6464
class FixedSizeSlabPayload {
6565
public:
6666
/// The capacity of the payload.

include/swift/SIL/SILNode.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ class SILNodePointer {
116116
/// ValueBase subobject, the cast will yield a corrupted value.
117117
/// Always use the LLVM casts (cast<>, dyn_cast<>, etc.) instead.
118118
class alignas(8) SILNode :
119-
// SILNode contains a swift object header for bridging with libswift.
120-
// For details see libswift/README.md.
119+
// SILNode contains a swift object header for bridging with Swift.
120+
// For details see SwiftCompilerSources/README.md.
121121
public SwiftObjectHeader {
122122
public:
123123
enum { NumVOKindBits = 3 };

0 commit comments

Comments
 (0)