[PATCH] D117664: [Support] Remove incorrect noalias return attribute in BumpPtrAllocator
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 20 00:24:30 PST 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG22ee510dac94: [Support] Remove incorrect noalias return attribute in BumpPtrAllocator (authored by nikic).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D117664/new/
https://reviews.llvm.org/D117664
Files:
llvm/include/llvm/Support/Allocator.h
Index: llvm/include/llvm/Support/Allocator.h
===================================================================
--- llvm/include/llvm/Support/Allocator.h
+++ llvm/include/llvm/Support/Allocator.h
@@ -141,8 +141,10 @@
}
/// Allocate space at the specified alignment.
- LLVM_ATTRIBUTE_RETURNS_NONNULL LLVM_ATTRIBUTE_RETURNS_NOALIAS void *
- Allocate(size_t Size, Align Alignment) {
+ // This method is *not* marked noalias, because
+ // SpecificBumpPtrAllocator::DestroyAll() loops over all allocations, and
+ // that loop is not based on the Allocate() return value.
+ LLVM_ATTRIBUTE_RETURNS_NONNULL void *Allocate(size_t Size, Align Alignment) {
// Keep track of how many bytes we've allocated.
BytesAllocated += Size;
@@ -198,7 +200,7 @@
return AlignedPtr;
}
- inline LLVM_ATTRIBUTE_RETURNS_NONNULL LLVM_ATTRIBUTE_RETURNS_NOALIAS void *
+ inline LLVM_ATTRIBUTE_RETURNS_NONNULL void *
Allocate(size_t Size, size_t Alignment) {
assert(Alignment > 0 && "0-byte alignment is not allowed. Use 1 instead.");
return Allocate(Size, Align(Alignment));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117664.401529.patch
Type: text/x-patch
Size: 1096 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220120/6caab17a/attachment.bin>
More information about the llvm-commits
mailing list