mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-30 20:24:32 +00:00
Mark BumpPtrAllocator::Allocate as returning a noalias pointer.
The GCC attribute is curiously named 'malloc', but I think it's better to use LLVM terminology for the wrapper macro. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234121 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -203,7 +203,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// \brief Allocate space at the specified alignment.
|
/// \brief Allocate space at the specified alignment.
|
||||||
LLVM_ATTRIBUTE_RETURNS_NONNULL void *Allocate(size_t Size, size_t Alignment) {
|
LLVM_ATTRIBUTE_RETURNS_NONNULL LLVM_ATTRIBUTE_RETURNS_NOALIAS void *
|
||||||
|
Allocate(size_t Size, size_t Alignment) {
|
||||||
assert(Alignment > 0 && "0-byte alignnment is not allowed. Use 1 instead.");
|
assert(Alignment > 0 && "0-byte alignnment is not allowed. Use 1 instead.");
|
||||||
|
|
||||||
// Keep track of how many bytes we've allocated.
|
// Keep track of how many bytes we've allocated.
|
||||||
|
@ -223,6 +223,16 @@
|
|||||||
#define LLVM_ATTRIBUTE_RETURNS_NONNULL
|
#define LLVM_ATTRIBUTE_RETURNS_NONNULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/// \macro LLVM_ATTRIBUTE_RETURNS_NOALIAS Used to mark a function as returning a
|
||||||
|
/// pointer that does not alias any other valid pointer.
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define LLVM_ATTRIBUTE_RETURNS_NOALIAS __attribute__((__malloc__))
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
#define LLVM_ATTRIBUTE_RETURNS_NOALIAS __declspec(restrict)
|
||||||
|
#else
|
||||||
|
#define LLVM_ATTRIBUTE_RETURNS_NOALIAS
|
||||||
|
#endif
|
||||||
|
|
||||||
/// LLVM_EXTENSION - Support compilers where we have a keyword to suppress
|
/// LLVM_EXTENSION - Support compilers where we have a keyword to suppress
|
||||||
/// pedantic diagnostics.
|
/// pedantic diagnostics.
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
|
Reference in New Issue
Block a user