summaryrefslogtreecommitdiffstats
path: root/tools/driver
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2016-08-23 20:07:07 +0000
committerChris Bieneman <beanz@apple.com>2016-08-23 20:07:07 +0000
commite77e46b1d7ea34861e8dd04202714d052a9a5926 (patch)
treea2e4433ae8b2e6f2cf5596938337ab34bc1db9a2 /tools/driver
parent33dc2ec73f002bfee219fc6cbd6b8a9fa7be8c7f (diff)
driver: Support checking for rlimits via cmake (when bootstrapping)
Summary: Add a cmake check for sys/resource.h and replace the __has_include() check with its result, in order to make it possible to use rlimits when building with compilers not supporting __has_include() -- i.e. when bootstrapping. // Please also re-apply dfcd52eb1d8e5d322404b40414cb7331c7380a8c (llvm-config.h fix) Patch by: Michał Górny Reviewers: rsmith, beanz Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23744 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@279559 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/driver')
-rw-r--r--tools/driver/cc1_main.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/tools/driver/cc1_main.cpp b/tools/driver/cc1_main.cpp
index b8cea41e3e..45d44a015e 100644
--- a/tools/driver/cc1_main.cpp
+++ b/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 <cstdio>
-#ifdef __has_include
-#if __has_include(<sys/resource.h>)
-#define HAVE_RLIMITS
+#ifdef CLANG_HAVE_RLIMITS
#include <sys/resource.h>
#endif
-#endif
using namespace clang;
using namespace llvm::opt;
@@ -73,7 +71,7 @@ void initializePollyPasses(llvm::PassRegistry &Registry);
}
#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.