[cfe-commits] r128911 - /cfe/trunk/lib/CodeGen/BackendUtil.cpp

Andrew Trick atrick at apple.com
Tue Apr 5 11:56:55 PDT 2011


Author: atrick
Date: Tue Apr  5 13:56:55 2011
New Revision: 128911

URL: http://llvm.org/viewvc/llvm-project?rev=128911&view=rev
Log:
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.

Modified:
    cfe/trunk/lib/CodeGen/BackendUtil.cpp

Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=128911&r1=128910&r2=128911&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Tue Apr  5 13:56:55 2011
@@ -323,6 +323,9 @@
       return;
   }
 
+  // Before executing passes, print the final values of the LLVM options.
+  cl::PrintOptionValues();
+
   // Run passes. For now we do all passes at once, but eventually we
   // would like to have the option of streaming code generation.
 





More information about the cfe-commits mailing list