Skip to content

Commit 565fdc4

Browse files
committed
Changes to after rebase
1 parent 1352a40 commit 565fdc4

File tree

9 files changed

+27
-26
lines changed

9 files changed

+27
-26
lines changed

clang/include/clang/Basic/DiagnosticFrontendKinds.td

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -268,23 +268,23 @@ def err_test_module_file_extension_version : Error<
268268
"(%3.%4)">;
269269

270270
// Module Build Daemon
271-
def err_basepath_length :
272-
Error<"BasePath '%0' is longer then the max length of %1">,
271+
def err_path_length :
272+
Error<"path '%0' is longer then the max length of %1">,
273273
DefaultFatal;
274274
def err_mbd_handshake :
275-
Error<"Attempt to handshake with module build daemon has failed: %0">,
275+
Error<"attempt to handshake with module build daemon has failed: %0">,
276276
DefaultFatal;
277277
def err_mbd_connect :
278-
Error<"Attempt to connect to module build daemon has failed: %0">,
278+
Error<"attempt to connect to module build daemon has failed: %0">,
279279
DefaultFatal;
280280
def remark_mbd_spawn :
281-
Remark<"Successfully spawned module build daemon">,
281+
Remark<"successfully spawned module build daemon">,
282282
InGroup<ModuleBuildDaemon>;
283283
def remark_mbd_connection :
284-
Remark<"Successfully connected to module build daemon at %0">,
284+
Remark<"successfully connected to module build daemon at %0">,
285285
InGroup<ModuleBuildDaemon>;
286286
def remark_mbd_handshake :
287-
Remark<"Clang invocation responsible for %0 successfully completed handshake "
287+
Remark<"clang invocation responsible for %0 successfully completed handshake "
288288
"with module build daemon">,
289289
InGroup<ModuleBuildDaemon>;
290290

clang/lib/Tooling/ModuleBuildDaemon/Frontend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void spawnModuleBuildDaemonAndHandshake(const CompilerInvocation &Clang,
127127
// Get user provided BasePath and confirm it is short enough
128128
BasePath = Clang.getFrontendOpts().ModuleBuildDaemonPath;
129129
if (!validBasePathLength(BasePath)) {
130-
Diag.Report(diag::err_basepath_length) << BasePath << BasePathMaxLength;
130+
Diag.Report(diag::err_path_length) << BasePath << BasePathMaxLength;
131131
return;
132132
}
133133
}

clang/lib/Tooling/ModuleBuildDaemon/SocketSupport.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ namespace clang::tooling::cc1modbuildd {
1818
llvm::Expected<std::string>
1919
readBufferFromSocket(llvm::raw_socket_stream &Socket) {
2020
constexpr unsigned short MAX_BUFFER = 4096;
21+
constexpr std::chrono::milliseconds TIMEOUT(5000);
2122
char Buffer[MAX_BUFFER];
2223
std::string ReturnBuffer;
2324

2425
ssize_t n = 0;
25-
while ((n = Socket.read(Buffer, MAX_BUFFER)) > 0) {
26+
while ((n = Socket.read(Buffer, MAX_BUFFER, TIMEOUT)) > 0) {
2627
ReturnBuffer.append(Buffer, n);
2728
// Read until \n... encountered which is the last line of a YAML document
2829
if (ReturnBuffer.find("\n...") != std::string::npos)

clang/test/ModuleBuildDaemon/daemon-crash.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
// RUN: cat mbd-crash/mbd.out | sed 's:\\\\\?:/:g' | FileCheck %s
1212

1313
// There should only be one shutdown log line due to the crash
14-
// CHECK: MBD created and binded to socket at: mbd-crash/mbd.sock
14+
// CHECK: MBD created and bound to socket at: mbd-crash/mbd.sock
1515
// CHECK-NEXT: Removing ineligible file: mbd-crash/mbd.sock
16-
// CHECK-NEXT: MBD created and binded to socket at: mbd-crash/mbd.sock
16+
// CHECK-NEXT: MBD created and bound to socket at: mbd-crash/mbd.sock
1717
// CHECK-NEXT: Signal received, shutting down
1818

1919
// Make sure mbd.err is empty

clang/test/ModuleBuildDaemon/daemon-launch.c

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

55
// timeout should exit with status 124 which is treated as a failure by lit on
66
// windows. Ideally we would like to check the exit code and only return true
7-
// if it equals 124 but lit does not support global bash sysmbols like $?
7+
// if it equals 124 but lit does not support global bash symbols like $?
88

99
// RUN: timeout --signal=SIGTERM 2 %clang -cc1modbuildd mbd-launch -v || true
1010
// RUN: cat mbd-launch/mbd.out | sed 's:\\\\\?:/:g' | FileCheck %s
1111

12-
// CHECK: MBD created and binded to socket at: mbd-launch/mbd.sock
12+
// CHECK: MBD created and bound to socket at: mbd-launch/mbd.sock
1313
// CHECK-NEXT: Signal received, shutting down
1414

1515
// Make sure mbd.err is empty

clang/test/ModuleBuildDaemon/handshake.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ int main() {return 0;}
1515
// RUN: cat %t/output-new | sed 's:\\\\\?:/:g' | FileCheck %s
1616
// RUN: cat %t/output-existing | sed 's:\\\\\?:/:g' | FileCheck %s --check-prefix=CHECK-EXIST
1717

18-
// CHECK: remark: Successfully spawned module build daemon [-Rmodule-build-daemon]
19-
// CHECK-NEXT: remark: Successfully connected to module build daemon at mbd-handshake/mbd.sock [-Rmodule-build-daemon]
20-
// CHECK-NEXT: remark: Clang invocation responsible for {{.*main.c}} successfully completed handshake with module build daemon [-Rmodule-build-daemon]
18+
// CHECK: remark: successfully spawned module build daemon [-Rmodule-build-daemon]
19+
// CHECK-NEXT: remark: successfully connected to module build daemon at mbd-handshake/mbd.sock [-Rmodule-build-daemon]
20+
// CHECK-NEXT: remark: clang invocation responsible for {{.*main.c}} successfully completed handshake with module build daemon [-Rmodule-build-daemon]
2121

2222
// Check that a clang invocation can handshake with an existing module build daemon
23-
// CHECK-EXIST: remark: Clang invocation responsible for {{.*main.c}} successfully completed handshake with module build daemon [-Rmodule-build-daemon]
23+
// CHECK-EXIST: remark: clang invocation responsible for {{.*main.c}} successfully completed handshake with module build daemon [-Rmodule-build-daemon]
2424

2525
// Make sure mbd.err is empty
2626
// RUN: [ ! -s "mbd-launch/mbd.err" ] && true || false

clang/test/ModuleBuildDaemon/multiple-tu.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ int main() {return foo();}
1818

1919
// RUN: cat %t/output | sed 's:\\\\\?:/:g' | FileCheck %s
2020

21-
// CHECK: remark: Successfully spawned module build daemon [-Rmodule-build-daemon]
22-
// CHECK-NEXT: remark: Successfully connected to module build daemon at mbd-multiple-tu/mbd.sock [-Rmodule-build-daemon]
23-
// CHECK-DAG: remark: Clang invocation responsible for {{.*main.c}} successfully completed handshake with module build daemon [-Rmodule-build-daemon]
24-
// CHECK-DAG: remark: Clang invocation responsible for {{.*foo.c}} successfully completed handshake with module build daemon [-Rmodule-build-daemon]
21+
// CHECK: remark: successfully spawned module build daemon [-Rmodule-build-daemon]
22+
// CHECK-NEXT: remark: successfully connected to module build daemon at mbd-multiple-tu/mbd.sock [-Rmodule-build-daemon]
23+
// CHECK-DAG: remark: clang invocation responsible for {{.*main.c}} successfully completed handshake with module build daemon [-Rmodule-build-daemon]
24+
// CHECK-DAG: remark: clang invocation responsible for {{.*foo.c}} successfully completed handshake with module build daemon [-Rmodule-build-daemon]
2525

2626
// Make sure mbd.err is empty
2727
// RUN: [ ! -s "mbd-launch/mbd.err" ] && true || false

clang/tools/driver/cc1modbuildd_main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ void ModuleBuildDaemonServer::createDaemonSocket() {
154154
exit(EXIT_FAILURE);
155155
}
156156
// If a previous module build daemon invocation crashes, the socket
157-
// file will need to be removed before the address can be binded to
157+
// file will need to be removed before the address can be bound to
158158
logVerbose("Removing ineligible file: " + SocketPath);
159159
} else {
160160
llvm::errs() << "MBD failed to create unix socket: "
@@ -163,7 +163,7 @@ void ModuleBuildDaemonServer::createDaemonSocket() {
163163
}
164164
});
165165
} else {
166-
logVerbose("MBD created and binded to socket at: " + SocketPath);
166+
logVerbose("MBD created and bound to socket at: " + SocketPath);
167167
ServerListener.emplace(std::move(*MaybeServerListener));
168168
break;
169169
}
@@ -209,7 +209,7 @@ void ModuleBuildDaemonServer::listenForClients() {
209209
if (EC == std::errc::timed_out) {
210210
RunServiceLoop = false;
211211
logVerbose("ListeningServer::accept timed out, shutting down");
212-
} else if (EC == std::errc::bad_file_descriptor &&
212+
} else if (EC == std::errc::operation_canceled &&
213213
RunServiceLoop == false) {
214214
logVerbose("Signal received, shutting down");
215215
} else

llvm/lib/Support/raw_socket_stream.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ Expected<ListeningSocket> ListeningSocket::createUnix(StringRef SocketPath,
184184
// that when written to will cause poll to return. Typically CancelFD is the
185185
// read end of a unidirectional pipe.
186186
//
187-
// Timeout should be -1 to block indefinitly
187+
// Timeout should be -1 to block indefinitely
188188
//
189189
// getActiveFD is a callback to handle ActiveFD's of std::atomic<int> and int
190190
static std::error_code
@@ -207,7 +207,7 @@ manageTimeout(const std::chrono::milliseconds &Timeout,
207207
}
208208

209209
// Keep track of how much time has passed in case ::poll or WSAPoll are
210-
// interupted by a signal and need to be recalled
210+
// interrupted by a signal and need to be recalled
211211
auto Start = std::chrono::steady_clock::now();
212212
auto RemainingTimeout = Timeout;
213213
int PollStatus = 0;

0 commit comments

Comments
 (0)