diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2017-01-12 11:13:51 +0000 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2017-01-12 11:13:51 +0000 |
| commit | 8ed570571934f79026fd33c02c865858c8c68de6 (patch) | |
| tree | eb220b6db2907f96c195043912fbd5c307522afe /llvm/tools/llvm-xray | |
| parent | 3284684dd14c2bf8c5d2b7c3354074701026ac7e (diff) | |
| download | bcm5719-llvm-8ed570571934f79026fd33c02c865858c8c68de6.tar.gz bcm5719-llvm-8ed570571934f79026fd33c02c865858c8c68de6.zip | |
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
llvm-svn: 291760
Diffstat (limited to 'llvm/tools/llvm-xray')
| -rw-r--r-- | llvm/tools/llvm-xray/xray-account.cc | 10 | ||||
| -rw-r--r-- | llvm/tools/llvm-xray/xray-account.h | 11 |
2 files changed, 13 insertions, 8 deletions
diff --git a/llvm/tools/llvm-xray/xray-account.cc b/llvm/tools/llvm-xray/xray-account.cc index 7c2b88cb790..747b4d18000 100644 --- a/llvm/tools/llvm-xray/xray-account.cc +++ b/llvm/tools/llvm-xray/xray-account.cc @@ -428,11 +428,11 @@ static CommandRegistration Unused(&Account, []() -> Error { 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); diff --git a/llvm/tools/llvm-xray/xray-account.h b/llvm/tools/llvm-xray/xray-account.h index 763ea011de0..cc9ba897e53 100644 --- a/llvm/tools/llvm-xray/xray-account.h +++ b/llvm/tools/llvm-xray/xray-account.h @@ -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; |

