[llvm-commits] [llvm] r51781 - in /llvm/trunk/tools/llvmc2: Action.cpp llvmc.cpp
Mikhail Glushenkov
foldr at codedgers.com
Fri May 30 11:48:52 PDT 2008
Author: foldr
Date: Fri May 30 13:48:52 2008
New Revision: 51781
URL: http://llvm.org/viewvc/llvm-project?rev=51781&view=rev
Log:
Add a --dry-run option to llvmc2. Patch by Holger Schurig.
Modified:
llvm/trunk/tools/llvmc2/Action.cpp
llvm/trunk/tools/llvmc2/llvmc.cpp
Modified: llvm/trunk/tools/llvmc2/Action.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc2/Action.cpp?rev=51781&r1=51780&r2=51781&view=diff
==============================================================================
--- llvm/trunk/tools/llvmc2/Action.cpp (original)
+++ llvm/trunk/tools/llvmc2/Action.cpp Fri May 30 13:48:52 2008
@@ -22,6 +22,7 @@
using namespace llvm;
using namespace llvmc;
+extern cl::opt<bool> DryRun;
extern cl::opt<bool> VerboseMode;
namespace {
@@ -65,10 +66,13 @@
}
int llvmc::Action::Execute() const {
- if (VerboseMode) {
+ if (DryRun || VerboseMode) {
std::cerr << Command_ << " ";
std::for_each(Args_.begin(), Args_.end(), print_string);
std::cerr << '\n';
}
- return ExecuteProgram(Command_, Args_);
+ if (DryRun)
+ return 0;
+ else
+ return ExecuteProgram(Command_, Args_);
}
Modified: llvm/trunk/tools/llvmc2/llvmc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvmc2/llvmc.cpp?rev=51781&r1=51780&r2=51781&view=diff
==============================================================================
--- llvm/trunk/tools/llvmc2/llvmc.cpp (original)
+++ llvm/trunk/tools/llvmc2/llvmc.cpp Fri May 30 13:48:52 2008
@@ -41,6 +41,8 @@
cl::list<std::string> Languages("x",
cl::desc("Specify the language of the following input files"),
cl::ZeroOrMore);
+cl::opt<bool> DryRun("dry-run",
+ cl::desc("only pretend to run commands"));
cl::opt<bool> VerboseMode("v",
cl::desc("Enable verbose mode"));
cl::opt<bool> WriteGraph("write-graph",
More information about the llvm-commits
mailing list