From cfca06d7963fa0909f90483b42a6d7d194d01e08 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 26 Jul 2020 19:36:28 +0000 Subject: Vendor import of llvm-project master 2e10b7a39b9, the last commit before the llvmorg-12-init tag, from which release/11.x was branched. --- llvm/lib/Support/CodeGenCoverage.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'llvm/lib/Support/CodeGenCoverage.cpp') diff --git a/llvm/lib/Support/CodeGenCoverage.cpp b/llvm/lib/Support/CodeGenCoverage.cpp index 2db4193ce382..93f386b6e23d 100644 --- a/llvm/lib/Support/CodeGenCoverage.cpp +++ b/llvm/lib/Support/CodeGenCoverage.cpp @@ -11,20 +11,14 @@ #include "llvm/Support/CodeGenCoverage.h" -#include "llvm/Config/llvm-config.h" #include "llvm/Support/Endian.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/Mutex.h" +#include "llvm/Support/Process.h" #include "llvm/Support/ScopedPrinter.h" #include "llvm/Support/ToolOutputFile.h" -#if LLVM_ON_UNIX -#include -#elif defined(_WIN32) -#include -#endif - using namespace llvm; static sys::SmartMutex OutputMutex; @@ -89,14 +83,7 @@ bool CodeGenCoverage::emit(StringRef CoveragePrefix, // We can handle locking within a process easily enough but we don't want to // manage it between multiple processes. Use the process ID to ensure no // more than one process is ever writing to the same file at the same time. - std::string Pid = -#if LLVM_ON_UNIX - llvm::to_string(::getpid()); -#elif defined(_WIN32) - llvm::to_string(::GetCurrentProcessId()); -#else - ""; -#endif + std::string Pid = llvm::to_string(sys::Process::getProcessId()); std::string CoverageFilename = (CoveragePrefix + Pid).str(); -- cgit v1.2.3