Skip to content

Commit 269f1b9

Browse files
committed
Add host-specific include for getpid() in FrontendTool.
1 parent e5d86d4 commit 269f1b9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/Basic/ParseableOutput.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,6 @@ namespace {
7979

8080
Action::Kind
8181
mapFrontendInvocationToActionKind(const CompilerInvocation &Invocation) {
82-
auto Executable = llvm::sys::path::filename(
83-
Invocation.getFrontendOptions().MainExecutablePath);
84-
assert(Executable.str() == "swift-frontend" &&
85-
"Expected a swift-frontend invocation.");
86-
8782
Action::Kind ActionKind;
8883
FrontendOptions::ActionType ActionType =
8984
Invocation.getFrontendOptions().RequestedAction;

lib/FrontendTool/FrontendTool.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@
7979
#include "llvm/Support/Path.h"
8080
#include "llvm/Support/raw_ostream.h"
8181

82+
#if __has_include(<unistd.h>)
83+
#include <unistd.h>
84+
#elif defined(_WIN32)
85+
#include <process.h>
86+
#endif
8287
#include <algorithm>
8388
#include <memory>
8489
#include <unordered_set>

0 commit comments

Comments
 (0)