[PATCH] D103953: Sanitizers.h - remove MathExtras.h include dependency
Simon Pilgrim via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 9 06:38:38 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG206a66de5902: Sanitizers.h - remove MathExtras.h include dependency (authored by RKSimon).
Changed prior to commit:
https://reviews.llvm.org/D103953?vs=350845&id=350882#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103953/new/
https://reviews.llvm.org/D103953
Files:
clang/include/clang/Basic/Sanitizers.h
clang/lib/Basic/Sanitizers.cpp
Index: clang/lib/Basic/Sanitizers.cpp
===================================================================
--- clang/lib/Basic/Sanitizers.cpp
+++ clang/lib/Basic/Sanitizers.cpp
@@ -14,6 +14,7 @@
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringSwitch.h"
+#include "llvm/Support/MathExtras.h"
using namespace clang;
@@ -57,6 +58,13 @@
}
namespace clang {
+unsigned SanitizerMask::countPopulation() const {
+ unsigned total = 0;
+ for (const auto &Val : maskLoToHigh)
+ total += llvm::countPopulation(Val);
+ return total;
+}
+
llvm::hash_code hash_value(const clang::SanitizerMask &Arg) {
return Arg.hash_value();
}
Index: clang/include/clang/Basic/Sanitizers.h
===================================================================
--- clang/include/clang/Basic/Sanitizers.h
+++ clang/include/clang/Basic/Sanitizers.h
@@ -16,7 +16,6 @@
#include "clang/Basic/LLVM.h"
#include "llvm/ADT/StringRef.h"
-#include "llvm/Support/MathExtras.h"
#include "llvm/Transforms/Instrumentation/AddressSanitizerOptions.h"
#include <cassert>
#include <cstdint>
@@ -60,12 +59,7 @@
return SanitizerMask(mask1, mask2);
}
- unsigned countPopulation() const {
- unsigned total = 0;
- for (const auto &Val : maskLoToHigh)
- total += llvm::countPopulation(Val);
- return total;
- }
+ unsigned countPopulation() const;
void flipAllBits() {
for (auto &Val : maskLoToHigh)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103953.350882.patch
Type: text/x-patch
Size: 1448 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210609/a5c99dc2/attachment.bin>
More information about the cfe-commits
mailing list