diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2007-02-16 19:11:07 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2007-02-16 19:11:07 +0000 |
commit | d01defedf6fb29fd939cd04544f1a4df863c5b1a (patch) | |
tree | 733a2dc8defcffee4d3f267bfee7926ae8789a36 /llvm/tools/bugpoint/bugpoint.cpp | |
parent | 66cb162f92c156717c7800dbc9d636cc57ec15ab (diff) | |
download | bcm5719-llvm-d01defedf6fb29fd939cd04544f1a4df863c5b1a.tar.gz bcm5719-llvm-d01defedf6fb29fd939cd04544f1a4df863c5b1a.zip |
Add possibility to set memory limit for binaries run via libSystem. This
is especially needed for bugpoint. This partly implements PR688
llvm-svn: 34349
Diffstat (limited to 'llvm/tools/bugpoint/bugpoint.cpp')
-rw-r--r-- | llvm/tools/bugpoint/bugpoint.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/tools/bugpoint/bugpoint.cpp b/llvm/tools/bugpoint/bugpoint.cpp index 0cdbfd45adb..c345143a901 100644 --- a/llvm/tools/bugpoint/bugpoint.cpp +++ b/llvm/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()); |