[llvm-branch-commits] [mlir] c643956 - [mlir] Fix building CRunnerUtils on OpenBSD with 15.x
Tobias Hieta via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Sep 12 03:55:07 PDT 2022
Author: Brad Smith
Date: 2022-09-12T12:54:35+02:00
New Revision: c643956d69b1813cc2caf938207f073d28b7b72c
URL: https://github.com/llvm/llvm-project/commit/c643956d69b1813cc2caf938207f073d28b7b72c
DIFF: https://github.com/llvm/llvm-project/commit/c643956d69b1813cc2caf938207f073d28b7b72c.diff
LOG: [mlir] Fix building CRunnerUtils on OpenBSD with 15.x
CRunnerUtils builds as C++11. 9c1d133c3a0256cce7f40e2e06966f84e8b99ffe broke
the build on OpenBSD. aligned_alloc() was only introduced in C++17.
Added:
Modified:
mlir/lib/ExecutionEngine/CRunnerUtils.cpp
Removed:
################################################################################
diff --git a/mlir/lib/ExecutionEngine/CRunnerUtils.cpp b/mlir/lib/ExecutionEngine/CRunnerUtils.cpp
index f2a43a5de95f0..323e6d5b51878 100644
--- a/mlir/lib/ExecutionEngine/CRunnerUtils.cpp
+++ b/mlir/lib/ExecutionEngine/CRunnerUtils.cpp
@@ -127,14 +127,10 @@ extern "C" void *_mlir_alloc(uint64_t size) { return malloc(size); }
extern "C" void *_mlir_aligned_alloc(uint64_t alignment, uint64_t size) {
#ifdef _WIN32
return _aligned_malloc(size, alignment);
-#elif defined(__APPLE__)
- // aligned_alloc was added in MacOS 10.15. Fall back to posix_memalign to also
- // support older versions.
+#else
void *result = nullptr;
(void)::posix_memalign(&result, alignment, size);
return result;
-#else
- return aligned_alloc(alignment, size);
#endif
}
More information about the llvm-branch-commits
mailing list