Re: [PATCH] D23744: driver: Support checking for rlimits via cmake (when bootstrapping)

2016-08-23 Thread Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL279559: driver: Support checking for rlimits via cmake (when 
bootstrapping) (authored by cbieneman).

Changed prior to commit:
  https://reviews.llvm.org/D23744?vs=68775=69028#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D23744

Files:
  cfe/trunk/CMakeLists.txt
  cfe/trunk/include/clang/Config/config.h.cmake
  cfe/trunk/tools/driver/cc1_main.cpp

Index: cfe/trunk/tools/driver/cc1_main.cpp
===
--- cfe/trunk/tools/driver/cc1_main.cpp
+++ cfe/trunk/tools/driver/cc1_main.cpp
@@ -15,6 +15,7 @@
 
 #include "llvm/Option/Arg.h"
 #include "clang/CodeGen/ObjectFilePCHContainerOperations.h"
+#include "clang/Config/config.h"
 #include "clang/Driver/DriverDiagnostic.h"
 #include "clang/Driver/Options.h"
 #include "clang/Frontend/CompilerInstance.h"
@@ -37,12 +38,9 @@
 #include "llvm/Support/raw_ostream.h"
 #include 
 
-#ifdef __has_include
-#if __has_include()
-#define HAVE_RLIMITS
+#ifdef CLANG_HAVE_RLIMITS
 #include 
 #endif
-#endif
 
 using namespace clang;
 using namespace llvm::opt;
@@ -73,7 +71,7 @@
 }
 #endif
 
-#ifdef HAVE_RLIMITS
+#ifdef CLANG_HAVE_RLIMITS
 // The amount of stack we think is "sufficient". If less than this much is
 // available, we may be unable to reach our template instantiation depth
 // limit and other similar limits.
Index: cfe/trunk/include/clang/Config/config.h.cmake
===
--- cfe/trunk/include/clang/Config/config.h.cmake
+++ cfe/trunk/include/clang/Config/config.h.cmake
@@ -35,6 +35,9 @@
 /* Define if we have libxml2 */
 #cmakedefine CLANG_HAVE_LIBXML ${CLANG_HAVE_LIBXML}
 
+/* Define if we have sys/resource.h (rlimits) */
+#cmakedefine CLANG_HAVE_RLIMITS ${CLANG_HAVE_RLIMITS}
+
 /* The LLVM product name and version */
 #define BACKEND_PACKAGE_STRING "${BACKEND_PACKAGE_STRING}"
 
Index: cfe/trunk/CMakeLists.txt
===
--- cfe/trunk/CMakeLists.txt
+++ cfe/trunk/CMakeLists.txt
@@ -177,6 +177,9 @@
   set(CLANG_HAVE_LIBXML 1)
 endif()
 
+include(CheckIncludeFile)
+check_include_file(sys/resource.h CLANG_HAVE_RLIMITS)
+
 set(CLANG_RESOURCE_DIR "" CACHE STRING
   "Relative directory from the Clang binary to its resource files.")
 


Index: cfe/trunk/tools/driver/cc1_main.cpp
===
--- cfe/trunk/tools/driver/cc1_main.cpp
+++ cfe/trunk/tools/driver/cc1_main.cpp
@@ -15,6 +15,7 @@
 
 #include "llvm/Option/Arg.h"
 #include "clang/CodeGen/ObjectFilePCHContainerOperations.h"
+#include "clang/Config/config.h"
 #include "clang/Driver/DriverDiagnostic.h"
 #include "clang/Driver/Options.h"
 #include "clang/Frontend/CompilerInstance.h"
@@ -37,12 +38,9 @@
 #include "llvm/Support/raw_ostream.h"
 #include 
 
-#ifdef __has_include
-#if __has_include()
-#define HAVE_RLIMITS
+#ifdef CLANG_HAVE_RLIMITS
 #include 
 #endif
-#endif
 
 using namespace clang;
 using namespace llvm::opt;
@@ -73,7 +71,7 @@
 }
 #endif
 
-#ifdef HAVE_RLIMITS
+#ifdef CLANG_HAVE_RLIMITS
 // The amount of stack we think is "sufficient". If less than this much is
 // available, we may be unable to reach our template instantiation depth
 // limit and other similar limits.
Index: cfe/trunk/include/clang/Config/config.h.cmake
===
--- cfe/trunk/include/clang/Config/config.h.cmake
+++ cfe/trunk/include/clang/Config/config.h.cmake
@@ -35,6 +35,9 @@
 /* Define if we have libxml2 */
 #cmakedefine CLANG_HAVE_LIBXML ${CLANG_HAVE_LIBXML}
 
+/* Define if we have sys/resource.h (rlimits) */
+#cmakedefine CLANG_HAVE_RLIMITS ${CLANG_HAVE_RLIMITS}
+
 /* The LLVM product name and version */
 #define BACKEND_PACKAGE_STRING "${BACKEND_PACKAGE_STRING}"
 
Index: cfe/trunk/CMakeLists.txt
===
--- cfe/trunk/CMakeLists.txt
+++ cfe/trunk/CMakeLists.txt
@@ -177,6 +177,9 @@
   set(CLANG_HAVE_LIBXML 1)
 endif()
 
+include(CheckIncludeFile)
+check_include_file(sys/resource.h CLANG_HAVE_RLIMITS)
+
 set(CLANG_RESOURCE_DIR "" CACHE STRING
   "Relative directory from the Clang binary to its resource files.")
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D23744: driver: Support checking for rlimits via cmake (when bootstrapping)

2016-08-23 Thread Chris Bieneman via cfe-commits
Landed in r279559!

Thanks,
-Chris

> On Aug 23, 2016, at 10:44 AM, Michał Górny  wrote:
> 
> mgorny added a comment.
> 
> Thanks for the review. Could you commit it for me, please? I don't have 
> commit access.
> 
> 
> https://reviews.llvm.org/D23744
> 
> 
> 

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D23744: driver: Support checking for rlimits via cmake (when bootstrapping)

2016-08-23 Thread Michał Górny via cfe-commits
mgorny added a comment.

Thanks for the review. Could you commit it for me, please? I don't have commit 
access.


https://reviews.llvm.org/D23744



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D23744: driver: Support checking for rlimits via cmake (when bootstrapping)

2016-08-23 Thread Chris Bieneman via cfe-commits
beanz accepted this revision.
beanz added a comment.
This revision is now accepted and ready to land.

Patch LGTM.


https://reviews.llvm.org/D23744



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D23744: driver: Support checking for rlimits via cmake (when bootstrapping)

2016-08-23 Thread Vedant Kumar via cfe-commits
vsk resigned from this revision.
vsk edited reviewers, added: beanz; removed: vsk.
vsk added a comment.

I don't see any issues with this patch, but I'm generally unfamiliar with the 
bootstrapping process and think Chris could give a better review.

(Also, as Richard pointed out earlier, including llvm-config.h might not be the 
right solution.)


https://reviews.llvm.org/D23744



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits