First Last Prev Next    No search results available
Details
: All tools need a --version command-line switch
Bug#: 413
: tools
: analyze
Status: RESOLVED
Resolution: FIXED
: All
: All
: trunk
: P2
: enhancement
: 1.3

:
: new-feature
:
:
  Show dependency tree - Show dependency graph
People
Reporter: Misha Brukman <brukman+bugs@uiuc.edu>
Assigned To: Reid Spencer <rspencer@reidspencer.com>
:

Attachments


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2004-08-03 16:58
As LLVM progresses and accumulates more versions behind it, I think it is
necessary to allow users to inquire of the version number of the current tools.

An implementation could be just a version.h file which defines the version and
is #included by all tools.  It would be preferrable for releases to have actual
numbers, whereas checking out from CVS gets a version of "cvs", but this adds
extra work at every release... 

Comments welcome.
------- Comment #1 From Chris Lattner 2004-08-03 17:05:38 -------
Sure, sounds good.  This could probably be built into the commandline library
really easily.

-Chris
------- Comment #2 From Reid Spencer 2004-08-03 17:57:26 -------
I don't think we need a version.h file. autoconf already supports this really
well. The include/Config/config.h has a #define in it named PACKAGE_VERSION
which is currently defined as "[1.3]". I think we need to drop the square
brackets, but other than that we could use this value in the command line library.

Want me to implement it? Take about 30 minutes probably.

Reid.
------- Comment #3 From Chris Lattner 2004-08-03 18:01:03 -------
Using PACKAGE_VERSION is clearly the right thing to do, but how exactly do you
want to implement this?  Add --version options to every tool .cpp file, with
code to handle it?  Wouldn't it make more sense to have something like:

cl::version V(PACKAGE_VERSION);

Or pass it in to ParseCommandLineOptions or something?

-Chris
------- Comment #4 From Reid Spencer 2004-08-03 18:20:30 -------
Is supposed to be in EVERY tool, like --help, right?

Why make room for the possibility that a tool implementer forgets to add the option?

I think we should just make it an option within the commandline library and be
done with it.
------- Comment #5 From Chris Lattner 2004-08-03 18:21:50 -------
I totally agree.  Go for it.  What do you propose?
------- Comment #6 From Chris Lattner 2004-08-03 18:22:26 -------
I totally agree.  Go for it.  What do you propose?
------- Comment #7 From Reid Spencer 2004-08-03 18:48:26 -------
I propose that we stop talking about this and I just go do it. Is there some
kind of big design that needs to be done? This is a no brainer, isn't it?
------- Comment #8 From Chris Lattner 2004-08-03 18:50:11 -------
This is a no brainer, go for it.  I just wanted to know what you were going to
do.  Add an option to ParseCommandLineOptions or something?  Or just have
CommandLine.cpp use config.h to get the info itself?

-Chris
------- Comment #9 From Reid Spencer 2004-08-03 18:53:19 -------
I'm just going to #include "llvm/Config/config.h" into CommandLine.cpp and
implement the option directly.

First Last Prev Next    No search results available