summaryrefslogtreecommitdiff
path: root/tools/opt/opt.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2011-04-05 18:54:36 +0000
committerAndrew Trick <atrick@apple.com>2011-04-05 18:54:36 +0000
commitce96902d88d473697f05c0465952dae374be564e (patch)
tree8dc714413e3a45a808e238a9091a6059d4575638 /tools/opt/opt.cpp
parent5dc0c503725c56aa74656b7c1221340f238bfa3f (diff)
downloadllvm-ce96902d88d473697f05c0465952dae374be564e.tar.gz
llvm-ce96902d88d473697f05c0465952dae374be564e.tar.bz2
llvm-ce96902d88d473697f05c0465952dae374be564e.tar.xz
Added *hidden* flags -print-options and -print-all-options so
developers can see if their driver changed any cl::Option's. The current implementation isn't perfect but handles most kinds of options. This is nice to have when decomposing the stages of compilation and moving between different drivers. It's also a good sanity check when comparing results produced by different command line invocations that are expected to produce the comparable results. Note: This is not an attempt to prolong the life of cl::Option. On the contrary, it's a placeholder for a feature that must exist when cl::Option is replaced by a more appropriate framework. A new framework needs: a central option registry, dynamic name lookup, non-global containers of option values (e.g. per-module, per-function), *and* the ability to print options values and their defaults at any point during compilation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128910 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/opt/opt.cpp')
-rw-r--r--tools/opt/opt.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp
index 3f60126b0d..25474c44a6 100644
--- a/tools/opt/opt.cpp
+++ b/tools/opt/opt.cpp
@@ -701,6 +701,9 @@ int main(int argc, char **argv) {
Passes.add(createBitcodeWriterPass(Out->os()));
}
+ // Before executing passes, print the final values of the LLVM options.
+ cl::PrintOptionValues();
+
// Now that we have all of the passes ready, run them.
Passes.run(*M.get());