summaryrefslogtreecommitdiff
path: root/tools/bugpoint/bugpoint.cpp
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2007-02-16 19:11:07 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2007-02-16 19:11:07 +0000
commit9ba8a76f8baaa1092d60ccfbc04e7efdc207c98f (patch)
treea4d2b47d47b30c9f7416757f798b092bf1ea6909 /tools/bugpoint/bugpoint.cpp
parentbdf44b929f6bd0983b0f0df0d2ae66610e81e149 (diff)
downloadllvm-9ba8a76f8baaa1092d60ccfbc04e7efdc207c98f.tar.gz
llvm-9ba8a76f8baaa1092d60ccfbc04e7efdc207c98f.tar.bz2
llvm-9ba8a76f8baaa1092d60ccfbc04e7efdc207c98f.tar.xz
Add possibility to set memory limit for binaries run via libSystem. This
is especially needed for bugpoint. This partly implements PR688 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34349 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/bugpoint.cpp')
-rw-r--r--tools/bugpoint/bugpoint.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/bugpoint/bugpoint.cpp b/tools/bugpoint/bugpoint.cpp
index 0cdbfd45ad..c345143a90 100644
--- a/tools/bugpoint/bugpoint.cpp
+++ b/tools/bugpoint/bugpoint.cpp
@@ -46,6 +46,10 @@ TimeoutValue("timeout", cl::init(300), cl::value_desc("seconds"),
cl::desc("Number of seconds program is allowed to run before it "
"is killed (default is 300s), 0 disables timeout"));
+static cl::opt<unsigned>
+MemoryLimit("mlimit", cl::init(100), cl::value_desc("MBytes"),
+ cl::desc("Maximum amount of memory to use. 0 disables check."));
+
// The AnalysesList is automatically populated with registered Passes by the
// PassNameParser.
//
@@ -68,7 +72,7 @@ int main(int argc, char **argv) {
sys::PrintStackTraceOnErrorSignal();
sys::SetInterruptFunction(BugpointInterruptFunction);
- BugDriver D(argv[0],AsChild,FindBugs,TimeoutValue);
+ BugDriver D(argv[0], AsChild, FindBugs, TimeoutValue, MemoryLimit);
if (D.addSources(InputFilenames)) return 1;
D.addPasses(PassList.begin(), PassList.end());