stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: [PATCH] Expensive assignments
Date Wed, 29 Nov 2006 21:27:36 GMT
Andrew Black wrote:
> Greetings all.
> 
> Attached is a patch that converts several expensive assignments from 
> recursive to simple expansion.  These assignments involve the CCVER 
> variable.

This looks good. Thanks a lot for the cleanup!
Martin

> 
> --Andrew Black
> 
> Changelog:
>     * acc.config (CCVER, aCC_MAJOR, aCC_MINOR): Convert expensive
>     assignments from recursive to simple expansion.
>     * como.config (CCVER, CC_MAJOR, CC_MINOR): Ditto.
>     * eccp.config (CCVER, ECCP_MAJOR, ECCP_MINOR): Ditto.
>     * icc.config (CCVER): Ditto.
>     * osf_cxx.config (CCVER): Ditto.
>     * reliant_cds.config (CCVER): Ditto.
>     * sunpro.config (CCVER): Ditto.
>     * vacpp.config (CCVER, CXX_MAJOR, CXX_MINOR): Ditto.
> 
> 
> ------------------------------------------------------------------------
> 
> Index: etc/config/sunpro.config
> ===================================================================
> --- etc/config/sunpro.config	(revision 480680)
> +++ etc/config/sunpro.config	(working copy)
> @@ -9,7 +9,7 @@
>  
>  # extract the "C++ m.n" substring from version string (whcih changes
>  # from one release of the compiler to another)
> -CCVER           = $(shell $(CXX) -V 2>&1 | head -n1 | sed 's/.*C\+\+ *\([^ ]*\).*/\1/')
> +CCVER          := $(shell $(CXX) -V 2>&1 | head -n1 | sed 's/.*C\+\+ *\([^ ]*\).*/\1/')
>  WARNFLAGS       = +w
>  DEPENDFLAGS     = -xM
>  PICFLAGS        = -KPIC
> Index: etc/config/acc.config
> ===================================================================
> --- etc/config/acc.config	(revision 480680)
> +++ etc/config/acc.config	(working copy)
> @@ -7,9 +7,9 @@
>  
>  CXX       = aCC
>  
> -CCVER     = $(shell $(CXX) -V 2>&1 | awk '{ print $$6 }')
> -aCC_MAJOR = $(shell echo $(CCVER) | sed "s/[^.]*\.\([0-9]*\)\..*/\1/")
> -aCC_MINOR = $(shell echo $(CCVER) | sed "s/[^.]*\.[^.]*\.\([0-9]*\)/\1/")
> +CCVER     := $(shell $(CXX) -V 2>&1 | awk '{ print $$6 }')
> +aCC_MAJOR := $(shell echo $(CCVER) | sed "s/[^.]*\.\([0-9]*\)\..*/\1/")
> +aCC_MINOR := $(shell echo $(CCVER) | sed "s/[^.]*\.[^.]*\.\([0-9]*\)/\1/")
>  
>  WARNFLAGS = +w +W392 +W655 +W684 +W818 +W819 +W849
>  
> Index: etc/config/reliant_cds.config
> ===================================================================
> --- etc/config/reliant_cds.config	(revision 480680)
> +++ etc/config/reliant_cds.config	(working copy)
> @@ -6,7 +6,7 @@
>  ##############################################################################
>  
>  CXX             = CC
> -CCVER           = $(shell $(CXX) -V /bogus/file.cpp 2>&1 | head -1 | awk '{ print
$4 }')
> +CCVER          := $(shell $(CXX) -V /bogus/file.cpp 2>&1 | head -1 | awk '{ print
$4 }')
>  CXXFLAGS        = -Xe
>  WARNFLAGS       =
>  DEPENDFLAGS     = -M
> Index: etc/config/como.config
> ===================================================================
> --- etc/config/como.config	(revision 480680)
> +++ etc/config/como.config	(working copy)
> @@ -6,9 +6,9 @@
>  ##############################################################################
>  
>  CXX             = como
> -CCVER           = $(shell $(CXX) -v foo.c 2>&1 | head -1 | awk '{ print $$3'})
> -CC_MAJOR        = $(shell echo "$(CCVER)" | sed -n "s/^\([^\.]*\).*/\1/p")
> -CC_MINOR        = $(shell echo "$(CCVER)" | sed -n "s/^.*\.\([0-9]*\).*/\1/p")
> +CCVER          := $(shell $(CXX) -v foo.c 2>&1 | head -1 | awk '{ print $$3'})
> +CC_MAJOR       := $(shell echo "$(CCVER)" | sed -n "s/^\([^\.]*\).*/\1/p")
> +CC_MINOR       := $(shell echo "$(CCVER)" | sed -n "s/^.*\.\([0-9]*\).*/\1/p")
>  
>  ifeq ($(CC_MINOR),2)
>  CPPFLAGS        = -I$(TOPDIR)/include/ansi --incl_suffixes ::
> Index: etc/config/icc.config
> ===================================================================
> --- etc/config/icc.config	(revision 480680)
> +++ etc/config/icc.config	(working copy)
> @@ -14,7 +14,7 @@
>    endif
>  endif
>  
> -CCVER           = $(shell $(CXX) -V foo.c 2>&1 | sed -n "s/.*Version *\([0-9.]*\).*/\1/p")
> +CCVER          := $(shell $(CXX) -V foo.c 2>&1 | sed -n "s/.*Version *\([0-9.]*\).*/\1/p")
>  CPPFLAGS        = -I$(TOPDIR)/include/ansi
>  CXXFLAGS        = -Xc -no_cpprt
>  
> Index: etc/config/osf_cxx.config
> ===================================================================
> --- etc/config/osf_cxx.config	(revision 480680)
> +++ etc/config/osf_cxx.config	(working copy)
> @@ -6,7 +6,7 @@
>  ##############################################################################
>  
>  CXX             = cxx
> -CCVER           = $(shell $(CXX) -V 2>&1 | awk '{ print $$3 }')
> +CCVER          := $(shell $(CXX) -V 2>&1 | awk '{ print $$3 }')
>  CXXFLAGS        = -x cxx -nocxxstd -std strict_ansi_errors
>  WARNFLAGS       = -w1 -msg_disable 450
>  DEPENDFLAGS     = -M -noimplicit_include
> Index: etc/config/vacpp.config
> ===================================================================
> --- etc/config/vacpp.config	(revision 480680)
> +++ etc/config/vacpp.config	(working copy)
> @@ -35,11 +35,11 @@
>  endif
>  
>  # invoke a script to determine the exact version
> -CCVER = $(shell etc/config/xlC_version.sh)
> +CCVER := $(shell etc/config/xlC_version.sh)
>  
>  # determine the major and minor version of the compiler
> -CXX_MAJOR       = $(shell echo "$(CCVER)" | sed "s/^\([1-9][0-9]*\).*/\1/")
> -CXX_MINOR       = $(shell echo "$(CCVER)" | sed "s/[1-9]*\.\([0-9]*\).*/\1/")
> +CXX_MAJOR    := $(shell echo "$(CCVER)" | sed "s/^\([1-9][0-9]*\).*/\1/")
> +CXX_MINOR    := $(shell echo "$(CCVER)" | sed "s/[1-9]*\.\([0-9]*\).*/\1/")
>  
>  # determine the major and minor version of the OS on AIX
>  ifeq ($(OSNAME),AIX)
> Index: etc/config/eccp.config
> ===================================================================
> --- etc/config/eccp.config	(revision 480680)
> +++ etc/config/eccp.config	(working copy)
> @@ -6,9 +6,9 @@
>  ##############################################################################
>  
>  CXX             = eccp
> -CCVER           = $(shell eccp -v foo.c 2>&1 | head -1 | awk '{ print $$8'})
> -ECCP_MAJOR      = $(shell echo "$(CCVER)" | sed -n "s/^\([^\.]*\).*/\1/p")
> -ECCP_MINOR      = $(shell echo "$(CCVER)" | sed -n "s/^.*\.\([0-9]*\).*/\1/p")
> +CCVER          := $(shell eccp -v foo.c 2>&1 | head -1 | awk '{ print $$8'})
> +ECCP_MAJOR     := $(shell echo "$(CCVER)" | sed -n "s/^\([^\.]*\).*/\1/p")
> +ECCP_MINOR     := $(shell echo "$(CCVER)" | sed -n "s/^.*\.\([0-9]*\).*/\1/p")
>  
>  ifeq ($(ECCP_MAJOR),2)
>      CPPFLAGS        = -I$(TOPDIR)/include/ansi --incl_suffixes ::


Mime
View raw message