[cfe-commits] r67204 - in /cfe/trunk/lib/Driver: Driver.cpp Makefile

Daniel Dunbar daniel at zuster.org
Wed Mar 18 10:06:19 PDT 2009


Hi Mike,

This isn't right; the Driver library shouldn't have these things embedded in
it. The reason I left it blank was because I was going to do try and provide
a proper version number derived from SVN (at some point). This is something
I personally would really like and some other users have requested.

Also, the use of TARGET_TRIPLE isn't necessary; the Driver already knows
what host it is on (DefaultHostTriple), although probably it should just
query the default tool chain for this information.

 - Daniel

On Wed, Mar 18, 2009 at 7:00 AM, Mike Stump <mrs at apple.com> wrote:

> Author: mrs
> Date: Wed Mar 18 09:00:02 2009
> New Revision: 67204
>
> URL: http://llvm.org/viewvc/llvm-project?rev=67204&view=rev
> Log:
> Improve version number.
>
> Modified:
>    cfe/trunk/lib/Driver/Driver.cpp   (contents, props changed)
>    cfe/trunk/lib/Driver/Makefile
>
> Modified: cfe/trunk/lib/Driver/Driver.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=67204&r1=67203&r2=67204&view=diff
>
>
> ==============================================================================
> --- cfe/trunk/lib/Driver/Driver.cpp (original)
> +++ cfe/trunk/lib/Driver/Driver.cpp Wed Mar 18 09:00:02 2009
> @@ -212,11 +212,22 @@
>  }
>
>  void Driver::PrintVersion() const {
> -  // FIXME: Get a reasonable version number.
> +  static char buf[] = "$URL$";
> +  char *zap = strstr(buf, "/lib/Driver");
> +  if (zap)
> +    *zap = 0;
> +  zap = strstr(buf, "/clang/tools/clang");
> +  if (zap)
> +    *zap = 0;
> +  const char *vers = buf+10;
>
>   // FIXME: The following handlers should use a callback mechanism, we
>   // don't know what the client would like to do.
> -  llvm::errs() << "ccc version 1.0" << "\n";
> +  llvm::errs() << "ccc version 1.0 (" << vers << ")" << "\n";
> +  // FIXME: Add cmake support and remove #ifdef
> +#ifdef TARGET_TRIPLE
> +  llvm::errs() << "Target: " << TARGET_TRIPLE << "\n";
> +#endif
>  }
>
>  bool Driver::HandleImmediateArgs(const Compilation &C) {
>
> Propchange: cfe/trunk/lib/Driver/Driver.cpp
>
>
> ------------------------------------------------------------------------------
>    svn:keywords = URL
>
> Modified: cfe/trunk/lib/Driver/Makefile
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Makefile?rev=67204&r1=67203&r2=67204&view=diff
>
>
> ==============================================================================
> --- cfe/trunk/lib/Driver/Makefile (original)
> +++ cfe/trunk/lib/Driver/Makefile Wed Mar 18 09:00:02 2009
> @@ -12,7 +12,7 @@
>  BUILD_ARCHIVE = 1
>  CXXFLAGS = -fno-rtti
>
> -CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include
> -I$(PROJ_OBJ_DIR)/../../include
> +CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include
> -I$(PROJ_OBJ_DIR)/../../include -DTARGET_TRIPLE='"$(TARGET_TRIPLE)"'
>
>  include $(LEVEL)/Makefile.common
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20090318/b60f151f/attachment.html>


More information about the cfe-commits mailing list