[cfe-commits] r67362 - in /cfe/trunk: include/clang/Driver/Options.def lib/Driver/Driver.cpp
Daniel Dunbar
daniel at zuster.org
Thu Mar 19 21:37:21 PDT 2009
Author: ddunbar
Date: Thu Mar 19 23:37:21 2009
New Revision: 67362
URL: http://llvm.org/viewvc/llvm-project?rev=67362&view=rev
Log:
Driver: Implement -print-search-dirs.
Modified:
cfe/trunk/include/clang/Driver/Options.def
cfe/trunk/lib/Driver/Driver.cpp
Modified: cfe/trunk/include/clang/Driver/Options.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.def?rev=67362&r1=67361&r2=67362&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.def (original)
+++ cfe/trunk/include/clang/Driver/Options.def Thu Mar 19 23:37:21 2009
@@ -472,7 +472,7 @@
OPTION("-print-multi-lib", print_multi_lib, Flag, INVALID, INVALID, "u", 0)
OPTION("-print-multi-os-directory", print_multi_os_directory, Flag, INVALID, INVALID, "u", 0)
OPTION("-print-prog-name=", print_prog_name_EQ, Joined, INVALID, INVALID, "", 0)
-OPTION("-print-search-dirs", print_search_dirs, Flag, INVALID, INVALID, "u", 0)
+OPTION("-print-search-dirs", print_search_dirs, Flag, INVALID, INVALID, "", 0)
OPTION("-private_bundle", private__bundle, Flag, INVALID, INVALID, "", 0)
OPTION("-pthreads", pthreads, Flag, INVALID, INVALID, "", 0)
OPTION("-pthread", pthread, Flag, INVALID, INVALID, "", 0)
Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=67362&r1=67361&r2=67362&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Thu Mar 19 23:37:21 2009
@@ -247,6 +247,25 @@
}
const ToolChain &TC = C.getDefaultToolChain();
+ if (C.getArgs().hasArg(options::OPT_print_search_dirs)) {
+ llvm::outs() << "programs: =";
+ for (ToolChain::path_list::const_iterator it = TC.getProgramPaths().begin(),
+ ie = TC.getProgramPaths().end(); it != ie; ++it) {
+ if (it != TC.getProgramPaths().begin())
+ llvm::outs() << ':';
+ llvm::outs() << *it;
+ }
+ llvm::outs() << "\n";
+ llvm::outs() << "libraries: =";
+ for (ToolChain::path_list::const_iterator it = TC.getFilePaths().begin(),
+ ie = TC.getFilePaths().end(); it != ie; ++it) {
+ if (it != TC.getFilePaths().begin())
+ llvm::outs() << ':';
+ llvm::outs() << *it;
+ }
+ llvm::outs() << "\n";
+ }
+
// FIXME: The following handlers should use a callback mechanism, we
// don't know what the client would like to do.
if (Arg *A = C.getArgs().getLastArg(options::OPT_print_file_name_EQ)) {
More information about the cfe-commits
mailing list