From ea5b2dd11c0526581803e7eb58224a2eabf191e6 Mon Sep 17 00:00:00 2001
From: Roman Divacky
Date: Wed, 10 Mar 2010 17:45:15 +0000
Subject: [PATCH] Update LLVM to r98164.
---
bindings/ocaml/Makefile.ocaml | 123 ++-
docs/CodeGenerator.html | 47 +-
docs/LangRef.html | 9 +-
docs/SourceLevelDebugging.html | 200 ++---
docs/WritingAnLLVMPass.html | 16 +-
docs/tutorial/OCamlLangImpl3.html | 8 +-
docs/tutorial/OCamlLangImpl4.html | 39 +-
docs/tutorial/OCamlLangImpl5.html | 34 +-
docs/tutorial/OCamlLangImpl6.html | 26 +-
docs/tutorial/OCamlLangImpl7.html | 26 +-
examples/Makefile | 4 +
include/llvm/ADT/APFloat.h | 2 +-
include/llvm/ADT/DenseMap.h | 7 +
include/llvm/ADT/DenseSet.h | 16 +
include/llvm/Analysis/DebugInfo.h | 190 +++--
include/llvm/Analysis/InlineCost.h | 5 +
include/llvm/Analysis/PostDominators.h | 4 +
include/llvm/CodeGen/AsmPrinter.h | 8 +
include/llvm/CodeGen/DwarfWriter.h | 9 +-
include/llvm/CodeGen/MachineModuleInfo.h | 25 +-
include/llvm/MC/MCAsmInfo.h | 21 -
include/llvm/MC/MCContext.h | 13 +-
include/llvm/MC/MCExpr.h | 4 +
include/llvm/MC/MCStreamer.h | 5 +
include/llvm/Metadata.h | 6 +-
include/llvm/Support/Dwarf.h | 3 +-
include/llvm/Target/TargetLowering.h | 4 +-
.../llvm/Target/TargetLoweringObjectFile.h | 23 +-
include/llvm/Target/TargetRegisterInfo.h | 3 +-
include/llvm/Transforms/IPO/InlinerPass.h | 4 +
lib/Analysis/DebugInfo.cpp | 236 +++---
lib/Analysis/InlineCost.cpp | 47 +-
lib/Analysis/LoopInfo.cpp | 17 +-
lib/Analysis/ScalarEvolution.cpp | 11 +-
lib/Analysis/ScalarEvolutionExpander.cpp | 2 +
lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 75 +-
lib/CodeGen/AsmPrinter/CMakeLists.txt | 1 -
lib/CodeGen/AsmPrinter/DIE.cpp | 71 +-
lib/CodeGen/AsmPrinter/DIE.h | 58 +-
lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 737 +++++++++---------
lib/CodeGen/AsmPrinter/DwarfDebug.h | 41 +-
lib/CodeGen/AsmPrinter/DwarfException.cpp | 160 ++--
lib/CodeGen/AsmPrinter/DwarfLabel.cpp | 32 -
lib/CodeGen/AsmPrinter/DwarfLabel.h | 52 --
lib/CodeGen/AsmPrinter/DwarfPrinter.cpp | 205 ++---
lib/CodeGen/AsmPrinter/DwarfPrinter.h | 76 +-
lib/CodeGen/AsmPrinter/DwarfWriter.cpp | 12 +-
lib/CodeGen/BranchFolding.cpp | 97 ++-
lib/CodeGen/LLVMTargetMachine.cpp | 8 +-
lib/CodeGen/LiveIntervalAnalysis.cpp | 9 +-
lib/CodeGen/MachineBasicBlock.cpp | 9 +-
lib/CodeGen/MachineCSE.cpp | 120 ++-
lib/CodeGen/MachineFunction.cpp | 4 +-
lib/CodeGen/MachineInstr.cpp | 2 +-
lib/CodeGen/MachineModuleInfo.cpp | 12 +-
lib/CodeGen/PrologEpilogInserter.cpp | 14 +-
lib/CodeGen/PrologEpilogInserter.h | 3 +-
lib/CodeGen/SelectionDAG/SDDbgValue.h | 14 +-
lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 8 +-
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 9 +-
lib/CodeGen/SimpleRegisterCoalescing.cpp | 12 +
lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 42 +-
lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp | 10 +-
lib/MC/MCAsmInfo.cpp | 3 -
lib/MC/MCAsmInfoDarwin.cpp | 11 -
lib/MC/MCAssembler.cpp | 90 ++-
lib/MC/MCContext.cpp | 21 +-
lib/MC/MCExpr.cpp | 5 +
lib/MC/MCNullStreamer.cpp | 6 +-
lib/MC/MCParser/AsmParser.cpp | 8 +-
lib/MC/MCStreamer.cpp | 5 +
lib/Support/APFloat.cpp | 2 +-
lib/Target/ARM/ARMBaseInstrInfo.h | 2 +-
lib/Target/ARM/ARMBaseRegisterInfo.cpp | 9 +-
lib/Target/ARM/ARMBaseRegisterInfo.h | 2 +-
lib/Target/ARM/ARMCodeEmitter.cpp | 2 +-
lib/Target/ARM/ARMISelLowering.cpp | 5 +-
lib/Target/ARM/ARMInstrInfo.td | 87 ++-
lib/Target/ARM/ARMInstrNEON.td | 25 +-
lib/Target/ARM/ARMInstrThumb2.td | 14 +-
lib/Target/ARM/ARMInstrVFP.td | 48 +-
lib/Target/ARM/ARMMCAsmInfo.cpp | 1 -
lib/Target/ARM/ARMSubtarget.cpp | 40 +-
lib/Target/ARM/ARMSubtarget.h | 4 +-
lib/Target/ARM/ARMTargetObjectFile.cpp | 54 ++
lib/Target/ARM/ARMTargetObjectFile.h | 38 +-
lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp | 38 +-
lib/Target/ARM/AsmPrinter/ARMMCInstLower.cpp | 4 +-
lib/Target/ARM/CMakeLists.txt | 1 +
lib/Target/ARM/Thumb1RegisterInfo.cpp | 12 +-
lib/Target/ARM/Thumb1RegisterInfo.h | 2 +-
lib/Target/ARM/Thumb2InstrInfo.cpp | 28 +-
lib/Target/Alpha/AlphaInstrInfo.td | 2 +-
lib/Target/Alpha/AlphaRegisterInfo.cpp | 2 +-
lib/Target/Alpha/AlphaRegisterInfo.h | 2 +-
lib/Target/Blackfin/BlackfinRegisterInfo.cpp | 2 +-
lib/Target/Blackfin/BlackfinRegisterInfo.h | 2 +-
lib/Target/CellSPU/CellSDKIntrinsics.td | 1 +
lib/Target/CellSPU/SPUInstrInfo.td | 2 +-
lib/Target/CellSPU/SPUMathInstr.td | 6 +-
lib/Target/CellSPU/SPUNodes.td | 2 +-
lib/Target/CellSPU/SPURegisterInfo.cpp | 3 +-
lib/Target/CellSPU/SPURegisterInfo.h | 2 +-
lib/Target/MBlaze/MBlazeCallingConv.td | 15 -
lib/Target/MBlaze/MBlazeISelDAGToDAG.cpp | 8 +-
lib/Target/MBlaze/MBlazeISelLowering.cpp | 166 +++-
lib/Target/MBlaze/MBlazeISelLowering.h | 3 +
lib/Target/MBlaze/MBlazeRegisterInfo.cpp | 59 +-
lib/Target/MBlaze/MBlazeRegisterInfo.h | 8 +-
.../MSP430/AsmPrinter/MSP430AsmPrinter.cpp | 23 +-
.../MSP430/AsmPrinter/MSP430InstPrinter.cpp | 23 +-
.../MSP430/AsmPrinter/MSP430MCInstLower.cpp | 4 +-
lib/Target/MSP430/MSP430RegisterInfo.cpp | 2 +-
lib/Target/MSP430/MSP430RegisterInfo.h | 2 +-
lib/Target/Mips/MipsRegisterInfo.cpp | 2 +-
lib/Target/Mips/MipsRegisterInfo.h | 2 +-
lib/Target/PIC16/PIC16DebugInfo.cpp | 2 +-
lib/Target/PIC16/PIC16RegisterInfo.cpp | 2 +-
lib/Target/PIC16/PIC16RegisterInfo.h | 2 +-
.../PowerPC/AsmPrinter/PPCAsmPrinter.cpp | 8 +-
lib/Target/PowerPC/PPCISelLowering.cpp | 10 +
lib/Target/PowerPC/PPCInstrAltivec.td | 14 +-
lib/Target/PowerPC/PPCRegisterInfo.cpp | 2 +-
lib/Target/PowerPC/PPCRegisterInfo.h | 2 +-
lib/Target/Sparc/SparcRegisterInfo.cpp | 2 +-
lib/Target/Sparc/SparcRegisterInfo.h | 2 +-
lib/Target/SystemZ/SystemZInstrInfo.td | 3 +-
lib/Target/SystemZ/SystemZOperands.td | 4 +
lib/Target/SystemZ/SystemZRegisterInfo.cpp | 2 +-
lib/Target/SystemZ/SystemZRegisterInfo.h | 2 +-
lib/Target/TargetLoweringObjectFile.cpp | 11 +-
lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp | 8 +-
lib/Target/X86/AsmPrinter/X86MCInstLower.cpp | 11 +-
lib/Target/X86/X86ISelLowering.cpp | 47 +-
lib/Target/X86/X86ISelLowering.h | 13 +-
lib/Target/X86/X86Instr64bit.td | 2 +-
lib/Target/X86/X86InstrInfo.cpp | 5 +
lib/Target/X86/X86InstrInfo.td | 70 +-
lib/Target/X86/X86InstrMMX.td | 9 +-
lib/Target/X86/X86InstrSSE.td | 20 +-
lib/Target/X86/X86MCAsmInfo.cpp | 2 -
lib/Target/X86/X86RegisterInfo.cpp | 8 +-
lib/Target/X86/X86RegisterInfo.h | 2 +-
lib/Target/X86/X86TargetObjectFile.cpp | 9 +-
lib/Target/XCore/XCoreISelDAGToDAG.cpp | 18 +
lib/Target/XCore/XCoreISelLowering.cpp | 282 ++++++-
lib/Target/XCore/XCoreISelLowering.h | 19 +
lib/Target/XCore/XCoreRegisterInfo.cpp | 2 +-
lib/Target/XCore/XCoreRegisterInfo.h | 2 +-
lib/Transforms/IPO/InlineAlways.cpp | 5 +-
lib/Transforms/IPO/InlineSimple.cpp | 3 +
lib/Transforms/IPO/Inliner.cpp | 15 +-
lib/Transforms/InstCombine/InstCombine.h | 1 +
.../InstCombine/InstCombineCalls.cpp | 141 +++-
lib/Transforms/Scalar/SimplifyLibCalls.cpp | 134 ----
lib/Transforms/Utils/CloneFunction.cpp | 6 +-
lib/Transforms/Utils/LoopSimplify.cpp | 2 +-
lib/VMCore/Metadata.cpp | 9 -
lib/VMCore/Verifier.cpp | 9 +
runtime/Makefile | 2 +-
.../ScalarEvolution/unreachable-code.ll | 13 +
test/CodeGen/ARM/armv4.ll | 13 +
test/CodeGen/ARM/indirectbr.ll | 4 +-
test/CodeGen/MBlaze/cc.ll | 28 +-
test/CodeGen/MSP430/AddrMode-bis-rx.ll | 4 +-
test/CodeGen/MSP430/AddrMode-bis-xr.ll | 4 +-
test/CodeGen/MSP430/AddrMode-mov-rx.ll | 4 +-
test/CodeGen/MSP430/AddrMode-mov-xr.ll | 4 +-
.../PowerPC/2010-03-09-indirect-call.ll | 19 +
test/CodeGen/PowerPC/indirectbr.ll | 12 +-
test/CodeGen/Thumb/2009-08-20-ISelBug.ll | 2 +-
.../CodeGen/Thumb2/2010-03-08-addi12-ccout.ll | 266 +++++++
test/CodeGen/Thumb2/machine-licm.ll | 6 +-
test/CodeGen/X86/2007-10-16-IllegalAsm.ll | 272 -------
test/CodeGen/X86/2009-08-06-inlineasm.ll | 10 +-
test/CodeGen/X86/aliases.ll | 4 +-
test/CodeGen/X86/machine-cse.ll | 39 +
test/CodeGen/X86/pre-split6.ll | 2 +-
test/CodeGen/X86/{tailcall2.ll => sibcall.ll} | 0
test/CodeGen/X86/stack-color-with-reg.ll | 3 +-
test/CodeGen/XCore/addsub64.ll | 38 +-
test/CodeGen/XCore/ladd_lsub_combine.ll | 67 ++
test/CodeGen/XCore/mul64.ll | 39 +
.../2010-02-17-DbgArtificialArg.cpp | 2 +-
test/MC/AsmParser/X86/x86_32-new-encoder.s | 10 +-
test/MC/Disassembler/simple-tests.txt | 11 +-
test/MC/MachO/reloc-diff.s | 55 ++
test/MC/MachO/reloc-pcrel.s | 62 ++
test/MC/MachO/zerofill-4.s | 35 +
test/MC/MachO/zerofill-sect-align.s | 15 +
.../memset_chk.ll | 2 +-
test/Transforms/InstCombine/objsize.ll | 20 +-
.../strcpy_chk.ll | 2 +-
test/Transforms/LCSSA/unreachable-use.ll | 27 +
test/lit.cfg | 3 -
tools/Makefile | 3 +-
unittests/Makefile.unittest | 18 +-
utils/TableGen/CodeGenDAGPatterns.cpp | 8 +
utils/TableGen/DAGISelMatcher.cpp | 55 ++
utils/TableGen/DAGISelMatcher.h | 44 ++
utils/TableGen/DAGISelMatcherGen.cpp | 14 +-
utils/TableGen/DAGISelMatcherOpt.cpp | 132 +++-
utils/lit/lit/TestRunner.py | 18 -
utils/lit/lit/TestingConfig.py | 8 +-
utils/unittest/UnitTestMain/Makefile | 6 +
utils/unittest/googletest/Makefile | 10 +
206 files changed, 3945 insertions(+), 2392 deletions(-)
delete mode 100644 lib/CodeGen/AsmPrinter/DwarfLabel.cpp
delete mode 100644 lib/CodeGen/AsmPrinter/DwarfLabel.h
create mode 100644 lib/Target/ARM/ARMTargetObjectFile.cpp
create mode 100644 test/Analysis/ScalarEvolution/unreachable-code.ll
create mode 100644 test/CodeGen/ARM/armv4.ll
create mode 100644 test/CodeGen/PowerPC/2010-03-09-indirect-call.ll
create mode 100644 test/CodeGen/Thumb2/2010-03-08-addi12-ccout.ll
delete mode 100644 test/CodeGen/X86/2007-10-16-IllegalAsm.ll
create mode 100644 test/CodeGen/X86/machine-cse.ll
rename test/CodeGen/X86/{tailcall2.ll => sibcall.ll} (100%)
create mode 100644 test/CodeGen/XCore/ladd_lsub_combine.ll
create mode 100644 test/CodeGen/XCore/mul64.ll
create mode 100644 test/MC/MachO/reloc-diff.s
create mode 100644 test/MC/MachO/reloc-pcrel.s
create mode 100644 test/MC/MachO/zerofill-4.s
create mode 100644 test/MC/MachO/zerofill-sect-align.s
rename test/Transforms/{SimplifyLibCalls => InstCombine}/memset_chk.ll (92%)
rename test/Transforms/{SimplifyLibCalls => InstCombine}/strcpy_chk.ll (89%)
create mode 100644 test/Transforms/LCSSA/unreachable-use.ll
diff --git a/bindings/ocaml/Makefile.ocaml b/bindings/ocaml/Makefile.ocaml
index 4e5de802640..1cff422c28d 100644
--- a/bindings/ocaml/Makefile.ocaml
+++ b/bindings/ocaml/Makefile.ocaml
@@ -66,35 +66,64 @@ Archive.CMA := $(strip $(OCAMLC) -a -custom $(OCAMLAFLAGS) $(OCAMLDEBUGFLAG) \
Compile.CMX := $(strip $(OCAMLOPT) -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o)
Archive.CMXA := $(strip $(OCAMLOPT) -a $(OCAMLAFLAGS) $(OCAMLDEBUGFLAG) -o)
+ifdef OCAMLOPT
+Archive.EXE := $(strip $(OCAMLOPT) -cc $(CXX) $(OCAMLCFLAGS) $(UsedOcamLibs:%=%.cmxa) $(OCAMLDEBUGFLAG) -o)
+else
+Archive.EXE := $(strip $(OCAMLC) -cc $(CXX) $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG:%=%.cma) -o)
+endif
+
# Source files
OcamlSources1 := $(sort $(wildcard $(PROJ_SRC_DIR)/*.ml))
-OcamlHeaders1 := $(OcamlSources1:.ml=.mli)
+OcamlHeaders1 := $(sort $(wildcard $(PROJ_SRC_DIR)/*.mli))
-OcamlSources := $(OcamlSources1:$(PROJ_SRC_DIR)/%=$(ObjDir)/%)
-OcamlHeaders := $(OcamlHeaders1:$(PROJ_SRC_DIR)/%=$(ObjDir)/%)
+OcamlSources2 := $(filter-out $(ExcludeSources),$(OcamlSources1))
+OcamlHeaders2 := $(filter-out $(ExcludeHeaders),$(OcamlHeaders1))
+
+OcamlSources := $(OcamlSources2:$(PROJ_SRC_DIR)/%=$(ObjDir)/%)
+OcamlHeaders := $(OcamlHeaders2:$(PROJ_SRC_DIR)/%=$(ObjDir)/%)
# Intermediate files
-LibraryCMA := $(ObjDir)/$(LIBRARYNAME).cma
-LibraryCMXA := $(ObjDir)/$(LIBRARYNAME).cmxa
ObjectsCMI := $(OcamlSources:%.ml=%.cmi)
ObjectsCMO := $(OcamlSources:%.ml=%.cmo)
ObjectsCMX := $(OcamlSources:%.ml=%.cmx)
+ifdef LIBRARYNAME
+LibraryCMA := $(ObjDir)/$(LIBRARYNAME).cma
+LibraryCMXA := $(ObjDir)/$(LIBRARYNAME).cmxa
+endif
+
+ifdef TOOLNAME
+ToolEXE := $(ObjDir)/$(TOOLNAME)$(EXEEXT)
+endif
+
# Output files
# The .cmo files are the only intermediates; all others are to be installed.
-LibraryA := $(OcamlDir)/lib$(LIBRARYNAME).a
-OutputCMA := $(LibraryCMA:$(ObjDir)/%.cma=$(OcamlDir)/%.cma)
-OutputCMXA := $(LibraryCMXA:$(ObjDir)/%.cmxa=$(OcamlDir)/%.cmxa)
OutputsCMI := $(ObjectsCMI:$(ObjDir)/%.cmi=$(OcamlDir)/%.cmi)
OutputsCMX := $(ObjectsCMX:$(ObjDir)/%.cmx=$(OcamlDir)/%.cmx)
OutputLibs := $(UsedLibNames:%=$(OcamlDir)/%)
+ifdef LIBRARYNAME
+LibraryA := $(OcamlDir)/lib$(LIBRARYNAME).a
+OutputCMA := $(LibraryCMA:$(ObjDir)/%.cma=$(OcamlDir)/%.cma)
+OutputCMXA := $(LibraryCMXA:$(ObjDir)/%.cmxa=$(OcamlDir)/%.cmxa)
+endif
+
+ifdef TOOLNAME
+ifdef EXAMPLE_TOOL
+OutputEXE := $(ExmplDir)/$(strip $(TOOLNAME))$(EXEEXT)
+else
+OutputEXE := $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT)
+endif
+endif
+
# Installation targets
+DestLibs := $(UsedLibNames:%=$(PROJ_libocamldir)/%)
+
+ifdef LIBRARYNAME
DestA := $(PROJ_libocamldir)/lib$(LIBRARYNAME).a
DestCMA := $(PROJ_libocamldir)/$(LIBRARYNAME).cma
DestCMXA := $(PROJ_libocamldir)/$(LIBRARYNAME).cmxa
-DestLibs := $(UsedLibNames:%=$(PROJ_libocamldir)/%)
-
+endif
##===- Dependencies -------------------------------------------------------===##
# Copy the sources into the intermediate directory because older ocamlc doesn't
@@ -106,18 +135,27 @@ $(ObjDir)/%.mli: $(PROJ_SRC_DIR)/%.mli $(ObjDir)/.dir
$(ObjDir)/%.ml: $(PROJ_SRC_DIR)/%.ml $(ObjDir)/.dir
$(Verb) $(CP) -f $< $@
+$(ObjectsCMI): $(UsedOcamlInterfaces:%=$(OcamlDir)/%.cmi)
+
+ifdef LIBRARYNAME
$(ObjDir)/$(LIBRARYNAME).ocamldep: $(OcamlSources) $(OcamlHeaders) \
$(OcamlDir)/.dir $(ObjDir)/.dir
$(Verb) $(OCAMLDEP) $(OCAMLCFLAGS) $(OcamlSources) $(OcamlHeaders) > $@
-$(ObjectsCMI): $(UsedOcamlInterfaces:%=$(OcamlDir)/%.cmi)
-
-include $(ObjDir)/$(LIBRARYNAME).ocamldep
+endif
+ifdef TOOLNAME
+$(ObjDir)/$(TOOLNAME).ocamldep: $(OcamlSources) $(OcamlHeaders) \
+ $(OcamlDir)/.dir $(ObjDir)/.dir
+ $(Verb) $(OCAMLDEP) $(OCAMLCFLAGS) $(OcamlSources) $(OcamlHeaders) > $@
+
+-include $(ObjDir)/$(TOOLNAME).ocamldep
+endif
##===- Build static library from C sources --------------------------------===##
-ifneq ($(ObjectsO),)
+ifdef LibraryA
all-local:: $(LibraryA)
clean-local:: clean-a
install-local:: install-a
@@ -160,7 +198,7 @@ $(OcamlDir)/%.o: $(LibDir)/%.o
$(Verb) ln -sf $< $@
clean-deplibs:
- $(Verb) rm -f $(OutputLibs)
+ $(Verb) $(RM) -f $(OutputLibs)
install-deplibs:
$(Verb) $(MKDIR) $(PROJ_libocamldir)
@@ -169,11 +207,12 @@ install-deplibs:
done
uninstall-deplibs:
- $(Verb) rm -f $(DestLibs)
+ $(Verb) $(RM) -f $(DestLibs)
##===- Build ocaml interfaces (.mli's -> .cmi's) --------------------------===##
+ifneq ($(OcamlHeaders),)
all-local:: build-cmis
clean-local:: clean-cmis
install-local:: install-cmis
@@ -212,10 +251,16 @@ uninstall-cmis::
$(EchoCmd) "Uninstalling $(PROJ_libocamldir)/$$i"; \
$(RM) -f "$(PROJ_libocamldir)/$$i"; \
done
+endif
##===- Build ocaml bytecode archive (.ml's -> .cmo's -> .cma) -------------===##
+$(ObjDir)/%.cmo: $(ObjDir)/%.ml
+ $(Echo) "Compiling $(notdir $<) for $(BuildMode) build"
+ $(Verb) $(Compile.CMO) $@ $<
+
+ifdef LIBRARYNAME
all-local:: $(OutputCMA)
clean-local:: clean-cma
install-local:: install-cma
@@ -228,10 +273,6 @@ $(LibraryCMA): $(ObjectsCMO) $(OcamlDir)/.dir
$(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
$(Verb) $(Archive.CMA) $@ $(ObjectsCMO)
-$(ObjDir)/%.cmo: $(ObjDir)/%.ml
- $(Echo) "Compiling $(notdir $<) for $(BuildMode) build"
- $(Verb) $(Compile.CMO) $@ $<
-
clean-cma::
$(Verb) $(RM) -f $(OutputCMA) $(UsedLibNames:%=$(OcamlDir)/%)
@@ -243,7 +284,7 @@ install-cma:: $(OutputCMA)
uninstall-cma::
$(Echo) "Uninstalling $(DestCMA)"
-$(Verb) $(RM) -f $(DestCMA)
-
+endif
##===- Build optimized ocaml archive (.ml's -> .cmx's -> .cmxa, .a) -------===##
@@ -251,6 +292,14 @@ uninstall-cma::
# If unavailable, 'configure' will not define OCAMLOPT in Makefile.config.
ifdef OCAMLOPT
+$(OcamlDir)/%.cmx: $(ObjDir)/%.cmx
+ $(Verb) $(CP) -f $< $@
+
+$(ObjDir)/%.cmx: $(ObjDir)/%.ml
+ $(Echo) "Compiling optimized $(notdir $<) for $(BuildMode) build"
+ $(Verb) $(Compile.CMX) $@ $<
+
+ifdef LIBRARYNAME
all-local:: $(OutputCMXA) $(OutputsCMX)
clean-local:: clean-cmxa
install-local:: install-cmxa
@@ -260,18 +309,11 @@ $(OutputCMXA): $(LibraryCMXA)
$(Verb) $(CP) -f $< $@
$(Verb) $(CP) -f $(<:.cmxa=.a) $(@:.cmxa=.a)
-$(OcamlDir)/%.cmx: $(ObjDir)/%.cmx
- $(Verb) $(CP) -f $< $@
-
$(LibraryCMXA): $(ObjectsCMX)
$(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
$(Verb) $(Archive.CMXA) $@ $(ObjectsCMX)
$(Verb) $(RM) -f $(@:.cmxa=.o)
-$(ObjDir)/%.cmx: $(ObjDir)/%.ml
- $(Echo) "Compiling optimized $(notdir $<) for $(BuildMode) build"
- $(Verb) $(Compile.CMX) $@ $<
-
clean-cmxa::
$(Verb) $(RM) -f $(OutputCMXA) $(OutputCMXA:.cmxa=.a) $(OutputsCMX)
@@ -295,7 +337,27 @@ uninstall-cmxa::
$(EchoCmd) "Uninstalling $(PROJ_libocamldir)/$$i"; \
$(RM) -f $(PROJ_libocamldir)/$$i; \
done
+endif
+endif
+##===- Build executables --------------------------------------------------===##
+
+ifdef TOOLNAME
+all-local:: $(OutputEXE)
+clean-local:: clean-exe
+
+$(OutputEXE): $(ToolEXE) $(OcamlDir)/.dir
+ $(Verb) $(CP) -f $< $@
+
+ifndef OCAMLOPT
+$(ToolEXE): $(ObjectsCMO) $(OcamlDir)/.dir
+ $(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
+ $(Verb) $(Archive.EXE) $@ $<
+else
+$(ToolEXE): $(ObjectsCMX) $(OcamlDir)/.dir
+ $(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
+ $(Verb) $(Archive.EXE) $@ $<
+endif
endif
##===- Generate documentation ---------------------------------------------===##
@@ -325,7 +387,10 @@ printcamlvars::
$(Echo) "LibraryCMA : " '$(LibraryCMA)'
$(Echo) "LibraryCMXA : " '$(LibraryCMXA)'
$(Echo) "OcamlSources1: " '$(OcamlSources1)'
+ $(Echo) "OcamlSources2: " '$(OcamlSources2)'
$(Echo) "OcamlSources : " '$(OcamlSources)'
+ $(Echo) "OcamlHeaders1: " '$(OcamlHeaders1)'
+ $(Echo) "OcamlHeaders2: " '$(OcamlHeaders2)'
$(Echo) "OcamlHeaders : " '$(OcamlHeaders)'
$(Echo) "ObjectsCMI : " '$(ObjectsCMI)'
$(Echo) "ObjectsCMO : " '$(ObjectsCMO)'
@@ -340,4 +405,6 @@ printcamlvars::
.PHONY: printcamlvars build-cmis \
clean-a clean-cmis clean-cma clean-cmxa \
install-a install-cmis install-cma install-cmxa \
- uninstall-a uninstall-cmis uninstall-cma uninstall-cmxa
+ install-exe \
+ uninstall-a uninstall-cmis uninstall-cma uninstall-cmxa \
+ uninstall-exe
diff --git a/docs/CodeGenerator.html b/docs/CodeGenerator.html
index ad6222d6430..dcfe7941c55 100644
--- a/docs/CodeGenerator.html
+++ b/docs/CodeGenerator.html
@@ -86,6 +86,7 @@
Target-specific Implementation Notes
+
+
+
+
+
+
+
Sibling call optimization is a restricted form of tail call optimization.
+ Unlike tail call optimization described in the previous section, it can be
+ performed automatically on any tail calls when -tailcallopt option
+ is not specified.
+
+
Sibling call optimization is currently performed on x86/x86-64 when the
+ following constraints are met:
+
+
+ - Caller and callee have the same calling convention. It can be either
+ c or fastcc.
+
+
- The call is a tail call - in tail position (ret immediately follows call
+ and ret uses value of call or is void).
+
+ - Caller and callee have matching return type or the callee result is not
+ used.
+
+
- If any of the callee arguments are being passed in stack, they must be
+ available in caller's own incoming argument stack and the frame offsets
+ must be the same.
+
+
+
Example:
+
+
+declare i32 @bar(i32, i32)
+
+define i32 @foo(i32 %a, i32 %b, i32 %c) {
+entry:
+ %0 = tail call i32 @bar(i32 %a, i32 %b)
+ ret i32 %0
+}
+
+
+
@@ -2116,7 +2161,7 @@ MOVSX32rm16 -> movsx, 32-bit register, 16-bit memory
Chris Lattner
The LLVM Compiler Infrastructure
- Last modified: $Date: 2010-03-02 02:11:08 +0100 (Tue, 02 Mar 2010) $
+ Last modified: $Date: 2010-03-08 22:05:02 +0100 (Mon, 08 Mar 2010) $