Skip to content

Commit

Permalink
Refactor code slightly. Make code compiled with llvmgcc use the warni…
Browse files Browse the repository at this point in the history
…ng options

as well.  Compile with -fshort-enums whether in debug or release mode, because it breaks the ABI


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8164 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
lattner committed Aug 27, 2003
1 parent 88d942d commit bb3dd47
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,9 @@ endif
# Allow gnu extensions...
CPPFLAGS += -D_GNU_SOURCE

CompileCommonOpts := -Wall -W -Wwrite-strings -Wno-unused -I$(LEVEL)/include
CompileOptimizeOpts := -O3 -DNDEBUG -finline-functions -fshort-enums
CompileWarnings := -Wall -W -Wwrite-strings -Wno-unused
CompileCommonOpts := $(CompileWarnings) -I$(LEVEL)/include -fshort-enums
CompileOptimizeOpts := -O3 -DNDEBUG -finline-functions

#
# Compile commands with libtool.
Expand Down Expand Up @@ -739,11 +740,11 @@ $(BUILD_OBJ_DIR)/Debug/%.lo: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Debug/.dir

$(BUILD_OBJ_DIR)/Bytecode/%.bc: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Bytecode/.dir $(LCC1XX)
@echo "Compiling $< to bytecode"
$(VERB) $(LLVMGXX) $(CPPFLAGS) -c $< -o $@
$(VERB) $(LLVMGXX) $(CompileWarnings) $(CPPFLAGS) -c $< -o $@

$(BUILD_OBJ_DIR)/Bytecode/%.bc: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Bytecode/.dir $(LCC1)
@echo "Compiling $< to bytecode"
$(VERB) $(LLVMGCC) $(CPPFLAGS) -c $< -o $@
$(VERB) $(LLVMGCC) $(CompileWarnings) $(CPPFLAGS) -c $< -o $@

$(BUILD_OBJ_DIR)/Bytecode/%.bc: $(SourceDir)%.ll $(BUILD_OBJ_DIR)/Bytecode/.dir $(LLVMAS)
@echo "Compiling $< to bytecode"
Expand Down
9 changes: 5 additions & 4 deletions Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,9 @@ endif
# Allow gnu extensions...
CPPFLAGS += -D_GNU_SOURCE

CompileCommonOpts := -Wall -W -Wwrite-strings -Wno-unused -I$(LEVEL)/include
CompileOptimizeOpts := -O3 -DNDEBUG -finline-functions -fshort-enums
CompileWarnings := -Wall -W -Wwrite-strings -Wno-unused
CompileCommonOpts := $(CompileWarnings) -I$(LEVEL)/include -fshort-enums
CompileOptimizeOpts := -O3 -DNDEBUG -finline-functions

#
# Compile commands with libtool.
Expand Down Expand Up @@ -739,11 +740,11 @@ $(BUILD_OBJ_DIR)/Debug/%.lo: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Debug/.dir

$(BUILD_OBJ_DIR)/Bytecode/%.bc: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Bytecode/.dir $(LCC1XX)
@echo "Compiling $< to bytecode"
$(VERB) $(LLVMGXX) $(CPPFLAGS) -c $< -o $@
$(VERB) $(LLVMGXX) $(CompileWarnings) $(CPPFLAGS) -c $< -o $@

$(BUILD_OBJ_DIR)/Bytecode/%.bc: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Bytecode/.dir $(LCC1)
@echo "Compiling $< to bytecode"
$(VERB) $(LLVMGCC) $(CPPFLAGS) -c $< -o $@
$(VERB) $(LLVMGCC) $(CompileWarnings) $(CPPFLAGS) -c $< -o $@

$(BUILD_OBJ_DIR)/Bytecode/%.bc: $(SourceDir)%.ll $(BUILD_OBJ_DIR)/Bytecode/.dir $(LLVMAS)
@echo "Compiling $< to bytecode"
Expand Down

0 comments on commit bb3dd47

Please sign in to comment.