From e4569bc84e3f4ba6c8ec768aef9860e60fd965af Mon Sep 17 00:00:00 2001 From: Chris Kitching Date: Wed, 25 Oct 2017 19:44:21 +0100 Subject: [PATCH] Inline updateCountersExt [ROCm/hip commit: 50448aec3ba6ea7852308f9cd9be35d76920e58f] --- projects/hip/hipify-clang/src/Cuda2Hip.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/projects/hip/hipify-clang/src/Cuda2Hip.cpp b/projects/hip/hipify-clang/src/Cuda2Hip.cpp index af44f84ba2..5c3e41d58d 100644 --- a/projects/hip/hipify-clang/src/Cuda2Hip.cpp +++ b/projects/hip/hipify-clang/src/Cuda2Hip.cpp @@ -174,24 +174,16 @@ protected: llvm::errs() << "[HIPIFY] " << getMsgType(msgType) << ": " << mainFileName << ":" << fullSL.getExpansionLineNumber() << ":" << fullSL.getExpansionColumnNumber() << ": " << message << "\n"; } - void updateCountersExt(const hipCounter &counter, const std::string &cudaName) { + virtual void updateCounters(const hipCounter &counter, const std::string &cudaName) { + if (!PrintStats) { + return; + } + std::map& map = cuda2hipConverted; std::map& mapTotal = cuda2hipConvertedTotal; if (counter.unsupported) { map = cuda2hipUnconverted; mapTotal = cuda2hipUnconvertedTotal; - } - - map[cudaName]++; - mapTotal[cudaName]++; - } - - virtual void updateCounters(const hipCounter &counter, const std::string &cudaName) { - if (!PrintStats) { - return; - } - updateCountersExt(counter, cudaName); - if (counter.unsupported) { countRepsUnsupported[counter.countType]++; countRepsTotalUnsupported[counter.countType]++; countApiRepsUnsupported[counter.countApiType]++; @@ -202,6 +194,9 @@ protected: countApiReps[counter.countApiType]++; countApiRepsTotal[counter.countApiType]++; } + + map[cudaName]++; + mapTotal[cudaName]++; } void processString(StringRef s, SourceManager &SM, SourceLocation start) {