aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm/lib/Support/CodeGenCoverage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/lib/Support/CodeGenCoverage.cpp')
-rw-r--r--contrib/llvm/lib/Support/CodeGenCoverage.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/contrib/llvm/lib/Support/CodeGenCoverage.cpp b/contrib/llvm/lib/Support/CodeGenCoverage.cpp
index ebfe65a398c3..f0a53db4e32a 100644
--- a/contrib/llvm/lib/Support/CodeGenCoverage.cpp
+++ b/contrib/llvm/lib/Support/CodeGenCoverage.cpp
@@ -12,7 +12,7 @@
#include "llvm/Support/CodeGenCoverage.h"
-#include "llvm/Config/config.h"
+#include "llvm/Config/llvm-config.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
@@ -22,7 +22,7 @@
#if LLVM_ON_UNIX
#include <unistd.h>
-#elif LLVM_ON_WIN32
+#elif _WIN32
#include <windows.h>
#endif
@@ -38,12 +38,17 @@ void CodeGenCoverage::setCovered(uint64_t RuleID) {
RuleCoverage[RuleID] = true;
}
-bool CodeGenCoverage::isCovered(uint64_t RuleID) {
+bool CodeGenCoverage::isCovered(uint64_t RuleID) const {
if (RuleCoverage.size() <= RuleID)
return false;
return RuleCoverage[RuleID];
}
+iterator_range<CodeGenCoverage::const_covered_iterator>
+CodeGenCoverage::covered() const {
+ return RuleCoverage.set_bits();
+}
+
bool CodeGenCoverage::parse(MemoryBuffer &Buffer, StringRef BackendName) {
const char *CurPtr = Buffer.getBufferStart();
@@ -88,7 +93,7 @@ bool CodeGenCoverage::emit(StringRef CoveragePrefix,
std::string Pid =
#if LLVM_ON_UNIX
llvm::to_string(::getpid());
-#elif LLVM_ON_WIN32
+#elif _WIN32
llvm::to_string(::GetCurrentProcessId());
#else
"";