[llvm-commits] [LLVMdev] How to identify LLVM version? [updated patch]

Duncan Sands baldrick at free.fr
Fri Jul 1 05:44:01 PDT 2011


Hi Yuri,

> +/*===-- Version -----------------------------------------------------------===*/
> +
> +typedef enum {
> +  /* Terminator Instructions */

^ Strange comment

> +  LLVMVersionNumber     = 1,
> +  LLVMVersionRepository = 2
> +} LLVMVersion;
> +
> +const char* LLVMGetVersion(LLVMVersion VN);

I think it would be better to get rid of the enum and have two functions.

> +SVNVERSION   := $(shell cd $(PROJ_SRC_ROOT)&&  (LC_ALL=C svnversion -cn . 2>/dev/null | sed -e "s/.*://" -e "s/\([0-9]*\).*/\1/" | grep "[0-9]" || LC_ALL=C svn info . 2>/dev/null | awk '/^Revision:/ {print $$2 }' | grep "[0-9]" || LC_ALL=C git svn info . 2>/dev/null | awk '/^Revision:/ {print $$2 }' | grep "[0-9]" || echo unknown))
> +CPPFLAGS     += -DREPOSITORY_REVISION="\"$(SVNVERSION)\""

I don't much like this.  Probably there should be some helper for determining
the revision.  And does everyone have sed and awk?  And what about when building
a release so there is no repository, no svn or git?

Ciao, Duncan.



More information about the llvm-commits mailing list