[llvm] r291760 - Fix windows buildbots building llvm-xray

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 12 03:13:51 PST 2017


Author: rksimon
Date: Thu Jan 12 05:13:51 2017
New Revision: 291760

URL: http://llvm.org/viewvc/llvm-project?rev=291760&view=rev
Log:
Fix windows buildbots building llvm-xray

2 issues:
1 - replaced unix-style pid_t with cross-platform llvm::sys::ProcessInfo::ProcessId 
2 - fixed shadow variable warning in lambda expression

Reviewed by @filcab

Modified:
    llvm/trunk/tools/llvm-xray/xray-account.cc
    llvm/trunk/tools/llvm-xray/xray-account.h

Modified: llvm/trunk/tools/llvm-xray/xray-account.cc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-xray/xray-account.cc?rev=291760&r1=291759&r2=291760&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-xray/xray-account.cc (original)
+++ llvm/trunk/tools/llvm-xray/xray-account.cc Thu Jan 12 05:13:51 2017
@@ -428,11 +428,11 @@ static CommandRegistration Unused(&Accou
   xray::InstrumentationMapExtractor Extractor(AccountInstrMap, InstrMapFormat,
                                               Err);
   if (auto E = handleErrors(
-          std::move(Err), [&](std::unique_ptr<StringError> E) -> Error {
-            if (E->convertToErrorCode() == std::errc::no_such_file_or_directory)
-              return Error::success();
-            return Error(std::move(E));
-          }))
+        std::move(Err), [&](std::unique_ptr<StringError> SE) -> Error {
+          if (SE->convertToErrorCode() == std::errc::no_such_file_or_directory)
+            return Error::success();
+          return Error(std::move(SE));
+        }))
     return E;
 
   raw_fd_ostream OS(AccountOutput, EC, sys::fs::OpenFlags::F_Text);

Modified: llvm/trunk/tools/llvm-xray/xray-account.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-xray/xray-account.h?rev=291760&r1=291759&r2=291760&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-xray/xray-account.h (original)
+++ llvm/trunk/tools/llvm-xray/xray-account.h Thu Jan 12 05:13:51 2017
@@ -19,6 +19,7 @@
 #include <vector>
 
 #include "func-id-helper.h"
+#include "llvm/Support/Program.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/XRay/XRayRecord.h"
 
@@ -28,10 +29,13 @@ namespace xray {
 class LatencyAccountant {
 public:
   typedef std::map<int32_t, std::vector<uint64_t>> FunctionLatencyMap;
-  typedef std::map<pid_t, std::pair<uint64_t, uint64_t>> PerThreadMinMaxTSCMap;
+  typedef std::map<llvm::sys::ProcessInfo::ProcessId,
+                   std::pair<uint64_t, uint64_t>>
+      PerThreadMinMaxTSCMap;
   typedef std::map<uint8_t, std::pair<uint64_t, uint64_t>> PerCPUMinMaxTSCMap;
   typedef std::vector<std::pair<int32_t, uint64_t>> FunctionStack;
-  typedef std::map<pid_t, FunctionStack> PerThreadFunctionStackMap;
+  typedef std::map<llvm::sys::ProcessInfo::ProcessId, FunctionStack>
+      PerThreadFunctionStackMap;
 
 private:
   PerThreadFunctionStackMap PerThreadFunctionStack;
@@ -75,7 +79,8 @@ public:
   ///
   bool accountRecord(const XRayRecord &Record);
 
-  const FunctionStack *getThreadFunctionStack(pid_t TId) const {
+  const FunctionStack *
+  getThreadFunctionStack(llvm::sys::ProcessInfo::ProcessId TId) const {
     auto I = PerThreadFunctionStack.find(TId);
     if (I == PerThreadFunctionStack.end())
       return nullptr;




More information about the llvm-commits mailing list