[llvm-commits] [llvm] r69351 - in /llvm/trunk: Makefile.config.in Makefile.rules autoconf/configure.ac
David Greene
greened at obbligato.org
Fri Apr 17 07:49:22 PDT 2009
Author: greened
Date: Fri Apr 17 09:49:22 2009
New Revision: 69351
URL: http://llvm.org/viewvc/llvm-project?rev=69351&view=rev
Log:
Add a --enable-profiling option to configure to build Debug+Profile and
Opt+Profile tools. Now we can profile any kind of flavor we build.
Modified:
llvm/trunk/Makefile.config.in
llvm/trunk/Makefile.rules
llvm/trunk/autoconf/configure.ac
Modified: llvm/trunk/Makefile.config.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.config.in?rev=69351&r1=69350&r2=69351&view=diff
==============================================================================
--- llvm/trunk/Makefile.config.in (original)
+++ llvm/trunk/Makefile.config.in Fri Apr 17 09:49:22 2009
@@ -215,7 +215,15 @@
#ENABLE_OPTIMIZED = 1
@ENABLE_OPTIMIZED@
-# When DISABLE_ASSERTIONS is enabled, builds of all of the LLVM code will
+# When ENABLE_PROFILING is enabled, profile instrumentation is done
+# and output is put into the "<Flavor>+Profile" directories, where
+# <Flavor> is either Debug or Release depending on how other builkd
+# flags are set.. Otherwise, output is put in the <Flavor>
+# directories.
+#ENABLE_PROFILING = 1
+ at ENABLE_PROFILING@
+
+# When DISABLE_ASSERTIONS is enabled, builds of all of the LLVM code will
# exclude assertion checks, otherwise they are included.
#DISABLE_ASSERTIONS = 1
@DISABLE_ASSERTIONS@
Modified: llvm/trunk/Makefile.rules
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=69351&r1=69350&r2=69351&view=diff
==============================================================================
--- llvm/trunk/Makefile.rules (original)
+++ llvm/trunk/Makefile.rules Fri Apr 17 09:49:22 2009
@@ -237,37 +237,36 @@
OPTIMIZE_OPTION := -O3
endif
-ifdef ENABLE_PROFILING
- BuildMode := Profile
- CXX.Flags += $(OPTIMIZE_OPTION) -pg -g
- C.Flags += $(OPTIMIZE_OPTION) -pg -g
- LD.Flags += $(OPTIMIZE_OPTION) -pg -g
- KEEP_SYMBOLS := 1
-else
- ifeq ($(ENABLE_OPTIMIZED),1)
- BuildMode := Release
- # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
- ifneq ($(OS),FreeBSD)
- ifneq ($(OS),Darwin)
- OmitFramePointer := -fomit-frame-pointer
- endif
- endif
-
- # Darwin requires -fstrict-aliasing to be explicitly enabled.
- ifeq ($(OS),Darwin)
- EXTRA_OPTIONS += -fstrict-aliasing -Wstrict-aliasing
- endif
+ifeq ($(ENABLE_OPTIMIZED),1)
+ BuildMode := Release
+ # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
+ ifneq ($(OS),FreeBSD)
+ ifneq ($(OS),Darwin)
+ OmitFramePointer := -fomit-frame-pointer
+ endif
+ endif
- CXX.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
- C.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
- LD.Flags += $(OPTIMIZE_OPTION)
- else
- BuildMode := Debug
- CXX.Flags += -g
- C.Flags += -g
- LD.Flags += -g
- KEEP_SYMBOLS := 1
+ # Darwin requires -fstrict-aliasing to be explicitly enabled.
+ ifeq ($(OS),Darwin)
+ EXTRA_OPTIONS += -fstrict-aliasing -Wstrict-aliasing
endif
+ CXX.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
+ C.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
+ LD.Flags += $(OPTIMIZE_OPTION)
+else
+ BuildMode := Debug
+ CXX.Flags += -g
+ C.Flags += -g
+ LD.Flags += -g
+ KEEP_SYMBOLS := 1
+endif
+
+ifeq ($(ENABLE_PROFILING),1)
+ BuildMode := $(BuildMode)+Profile
+ CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags)) -pg -g
+ C.Flags := $(filter-out -fomit-frame-pointer,$(C.Flags)) -pg -g
+ LD.Flags := $(filter-out -fomit-frame-pointer,$(LD.Flags)) -pg -g
+ KEEP_SYMBOLS := 1
endif
#ifeq ($(ENABLE_VISIBILITY_INLINES_HIDDEN),1)
Modified: llvm/trunk/autoconf/configure.ac
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=69351&r1=69350&r2=69351&view=diff
==============================================================================
--- llvm/trunk/autoconf/configure.ac (original)
+++ llvm/trunk/autoconf/configure.ac Fri Apr 17 09:49:22 2009
@@ -285,6 +285,15 @@
AC_SUBST(ENABLE_OPTIMIZED,[[ENABLE_OPTIMIZED=1]])
fi
+dnl --enable-profiling : check whether they want to do a profile build:
+AC_ARG_ENABLE(profiling, AS_HELP_STRING(
+ [--enable-profiling,Compile with profiling enabled (default is NO)]),,enableval="no")
+if test ${enableval} = "no" ; then
+ AC_SUBST(ENABLE_PROFILING,[[]])
+else
+ AC_SUBST(ENABLE_PROFILING,[[ENABLE_PROFILING=1]])
+fi
+
dnl --enable-assertions : check whether they want to turn on assertions or not:
AC_ARG_ENABLE(assertions,AS_HELP_STRING(
[--enable-assertions,Compile with assertion checks enabled (default is YES)]),, enableval="yes")
More information about the llvm-commits
mailing list