aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Support/Allocator.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/llvm/Support/Allocator.h b/include/llvm/Support/Allocator.h
index 9ca02efb1f..4a04ccc382 100644
--- a/include/llvm/Support/Allocator.h
+++ b/include/llvm/Support/Allocator.h
@@ -77,7 +77,7 @@ public:
template <typename T>
T *Allocate(size_t Num, unsigned Alignment) {
// Round EltSize up to the specified alignment.
- unsigned EltSize = (sizeof(T)+Alignment-1)&~Alignment;
+ unsigned EltSize = (sizeof(T)+Alignment-1)&(-Alignment);
return static_cast<T*>(Allocate(Num * EltSize, Alignment));
}