about summary refs log tree commit diff
path: root/src/rustllvm/PassWrapper.cpp
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-08-30 17:56:04 -0700
committerAlex Crichton <alex@alexcrichton.com>2013-08-30 17:56:04 -0700
commit8d12673c825c2785e375e12295a7bdc24a625114 (patch)
tree88c7fe74000f22f71d466c805080cf4ccebaa963 /src/rustllvm/PassWrapper.cpp
parent974f854bb528c9a94af62990965ac62a1aa0dbed (diff)
downloadrust-8d12673c825c2785e375e12295a7bdc24a625114.tar.gz
rust-8d12673c825c2785e375e12295a7bdc24a625114.zip
Tweak pass management and add some more options
The only changes to the default passes is that O1 now doesn't run the inline
pass, just always-inline with lifetime intrinsics. O2 also now has a threshold
of 225 instead of 275. Otherwise the default passes being run is the same.

I've also added a few more options for configuring the pass pipeline. Namely you
can now specify arguments to LLVM directly via the `--llvm-args` command line
option which operates similarly to `--passes`. I also added the ability to turn
off pre-population of the pass manager in case you want to run *only* your own
passes.
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
-rw-r--r--src/rustllvm/PassWrapper.cpp25
1 files changed, 2 insertions, 23 deletions
diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp
index 431b620e68f..615c2cc61cb 100644
--- a/src/rustllvm/PassWrapper.cpp
+++ b/src/rustllvm/PassWrapper.cpp
@@ -143,36 +143,15 @@ LLVMRustRunFunctionPassManager(LLVMPassManagerRef PM, LLVMModuleRef M) {
 }
 
 extern "C" void
-LLVMRustSetLLVMOptions(bool PrintPasses,
-                       bool VectorizeLoops,
-                       bool VectorizeSLP,
-                       bool TimePasses) {
+LLVMRustSetLLVMOptions(int Argc, char **Argv) {
     // Initializing the command-line options more than once is not allowed. So,
     // check if they've already been initialized.  (This could happen if we're
     // being called from rustpkg, for example). If the arguments change, then
     // that's just kinda unfortunate.
     static bool initialized = false;
     if (initialized) return;
-
-    int argc = 3;
-    const char *argv[20] = {"rustc",
-                            "-arm-enable-ehabi",
-                            "-arm-enable-ehabi-descriptors"};
-    if (PrintPasses) {
-        argv[argc++] = "-debug-pass";
-        argv[argc++] = "Structure";
-    }
-    if (VectorizeLoops) {
-        argv[argc++] = "-vectorize-loops";
-    }
-    if (VectorizeSLP) {
-        argv[argc++] = "-vectorize-slp";
-    }
-    if (TimePasses) {
-        argv[argc++] = "-time-passes";
-    }
-    cl::ParseCommandLineOptions(argc, argv);
     initialized = true;
+    cl::ParseCommandLineOptions(Argc, Argv);
 }
 
 extern "C" bool