mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-06 04:31:08 +00:00
Add a --dry-run option to llvmc2. Patch by Holger Schurig.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51781 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3947e4d142
commit
7ef36069c8
@ -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 @@ namespace {
|
||||
}
|
||||
|
||||
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_);
|
||||
}
|
||||
|
@ -41,6 +41,8 @@ cl::opt<std::string> OutputFilename("o", cl::desc("Output file name"),
|
||||
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",
|
||||
|
Loading…
Reference in New Issue
Block a user