[Mlir-commits] [mlir] ab4b468 - [mlir] Avoid including <alloca.h> on FreeBSD and NetBSD

Dimitry Andric llvmlistbot at llvm.org
Sun Aug 8 04:33:32 PDT 2021


Author: Dimitry Andric
Date: 2021-08-08T13:32:35+02:00
New Revision: ab4b4684a26c31b1eb507a7eb6d2f4ac30764c3d

URL: https://github.com/llvm/llvm-project/commit/ab4b4684a26c31b1eb507a7eb6d2f4ac30764c3d
DIFF: https://github.com/llvm/llvm-project/commit/ab4b4684a26c31b1eb507a7eb6d2f4ac30764c3d.diff

LOG: [mlir] Avoid including <alloca.h> on FreeBSD and NetBSD

Instead, include `<cstdlib>` which is the canonical header containing
the declaration of `alloca()`.

Reviewed By: bondhugula

Differential Revision: https://reviews.llvm.org/D107699

Added: 
    

Modified: 
    mlir/lib/ExecutionEngine/CRunnerUtils.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/ExecutionEngine/CRunnerUtils.cpp b/mlir/lib/ExecutionEngine/CRunnerUtils.cpp
index f8ca6854c2d6a..9b22a188eb5c3 100644
--- a/mlir/lib/ExecutionEngine/CRunnerUtils.cpp
+++ b/mlir/lib/ExecutionEngine/CRunnerUtils.cpp
@@ -15,7 +15,11 @@
 #include "mlir/ExecutionEngine/CRunnerUtils.h"
 
 #ifndef _WIN32
+#if defined(__FreeBSD__) || defined(__NetBSD__)
+#include <cstdlib>
+#else
 #include <alloca.h>
+#endif
 #include <sys/time.h>
 #else
 #include "malloc.h"


        


More information about the Mlir-commits mailing list