Author: Dimitry Andric
Date: 2021-08-10T01:01:42-07:00
New Revision: 19ee94d36b93dd1f5e277640c192ceb9b8236b0a

URL: 
https://github.com/llvm/llvm-project/commit/19ee94d36b93dd1f5e277640c192ceb9b8236b0a
DIFF: 
https://github.com/llvm/llvm-project/commit/19ee94d36b93dd1f5e277640c192ceb9b8236b0a.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

(cherry picked from commit ab4b4684a26c31b1eb507a7eb6d2f4ac30764c3d)

Added: 
    

Modified: 
    mlir/lib/ExecutionEngine/CRunnerUtils.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/ExecutionEngine/CRunnerUtils.cpp 
b/mlir/lib/ExecutionEngine/CRunnerUtils.cpp
index 0207232871f87..5307d08eebae5 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"


        
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to