summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/SparseSet.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/ADT/SparseSet.h')
-rw-r--r--include/llvm/ADT/SparseSet.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/llvm/ADT/SparseSet.h b/include/llvm/ADT/SparseSet.h
index 25ade8831922..74cc6dab8c74 100644
--- a/include/llvm/ADT/SparseSet.h
+++ b/include/llvm/ADT/SparseSet.h
@@ -22,6 +22,7 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Allocator.h"
#include <cassert>
#include <cstdint>
#include <cstdlib>
@@ -163,7 +164,7 @@ public:
// The Sparse array doesn't actually need to be initialized, so malloc
// would be enough here, but that will cause tools like valgrind to
// complain about branching on uninitialized data.
- Sparse = reinterpret_cast<SparseT*>(calloc(U, sizeof(SparseT)));
+ Sparse = static_cast<SparseT*>(safe_calloc(U, sizeof(SparseT)));
Universe = U;
}