From d63b964850f7051a7a96edd5aa31d9d67edbec68 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 24 May 2006 23:02:40 +0000 Subject: [PATCH] Abstract out the current optimization level into a flag that can be overridden on the make line, to avoid bugs in native compilers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28457 91177308-0d34-0410-b5e6-96231b3b80d8 --- Makefile.rules | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Makefile.rules b/Makefile.rules index c4148be9db8..ac4a6fd66ec 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -198,11 +198,15 @@ install-bytecode:: install-bytecode-local # Variables derived from configuration we are building #-------------------------------------------------------------------- +# OPTIMIZE_OPTION - The optimization level option we want to build LLVM with +# this can be overridden on the make command line. +OPTIMIZE_OPTION := -O3 + ifdef ENABLE_PROFILING BuildMode := Profile - CXX.Flags := -O3 -pg - C.Flags := -O3 -pg - LD.Flags := -O3 -pg + CXX.Flags := $(OPTIMIZE_OPTION) -pg + C.Flags := $(OPTIMIZE_OPTION) -pg + LD.Flags := $(OPTIMIZE_OPTION) -pg else ifdef ENABLE_OPTIMIZED BuildMode := Release @@ -213,9 +217,9 @@ else OmitFramePointer := -fomit-frame-pointer endif endif - CXX.Flags := -O3 $(OmitFramePointer) - C.Flags := -O3 $(OmitFramePointer) - LD.Flags := -O3 + CXX.Flags := $(OPTIMIZE_OPTION) $(OmitFramePointer) + C.Flags := $(OPTIMIZE_OPTION) $(OmitFramePointer) + LD.Flags := $(OPTIMIZE_OPTION) else BuildMode := Debug CXX.Flags := -g -- 2.34.1