From 9bef28eb9e224d641ce31a423e215ccf82bf1d43 Mon Sep 17 00:00:00 2001
From: rdivacky
Date: Sat, 6 Mar 2010 09:22:29 +0000
Subject: Update LLVM to r97873.
---
CMakeLists.txt | 1 +
Makefile.config.in | 16 +-
Makefile.rules | 46 +-
bindings/ocaml/bitwriter/bitwriter_ocaml.c | 15 +
bindings/ocaml/bitwriter/llvm_bitwriter.ml | 7 +
bindings/ocaml/bitwriter/llvm_bitwriter.mli | 12 +
.../ocaml/executionengine/executionengine_ocaml.c | 10 +-
.../ocaml/executionengine/llvm_executionengine.ml | 8 +-
.../ocaml/executionengine/llvm_executionengine.mli | 65 +--
bindings/ocaml/llvm/llvm.ml | 2 +
bindings/ocaml/llvm/llvm.mli | 2 +
.../ocaml/transforms/scalar/llvm_scalar_opts.ml | 59 ++-
.../ocaml/transforms/scalar/llvm_scalar_opts.mli | 91 +++-
.../ocaml/transforms/scalar/scalar_opts_ocaml.c | 96 +++-
docs/CommandGuide/Makefile | 6 +-
docs/LangRef.html | 19 +-
docs/Makefile | 24 +-
docs/tutorial/Makefile | 2 +-
include/llvm-c/BitWriter.h | 13 +-
include/llvm-c/Core.h | 4 +-
include/llvm/ADT/ScopedHashTable.h | 2 +-
include/llvm/Analysis/ValueTracking.h | 4 +
include/llvm/CodeGen/MachineInstr.h | 24 +
include/llvm/CodeGen/MachineRegisterInfo.h | 8 +
include/llvm/CodeGen/SelectionDAGISel.h | 1 -
include/llvm/CodeGen/SelectionDAGNodes.h | 16 +-
include/llvm/CompilerDriver/Common.td | 1 +
include/llvm/GlobalValue.h | 82 ++-
include/llvm/Support/Compiler.h | 4 +-
include/llvm/Support/IRBuilder.h | 4 +
include/llvm/Transforms/Utils/BuildLibCalls.h | 96 ++++
lib/Analysis/InstructionSimplify.cpp | 7 +-
lib/Analysis/ScalarEvolutionExpander.cpp | 22 +-
lib/Analysis/ValueTracking.cpp | 129 +++++
lib/Bitcode/Writer/BitWriter.cpp | 14 +-
lib/CodeGen/BranchFolding.cpp | 6 +-
lib/CodeGen/CriticalAntiDepBreaker.cpp | 4 +
lib/CodeGen/LLVMTargetMachine.cpp | 20 +-
lib/CodeGen/LiveVariables.cpp | 42 +-
lib/CodeGen/MachineCSE.cpp | 254 +++++----
lib/CodeGen/MachineInstr.cpp | 86 ++-
lib/CodeGen/MachineRegisterInfo.cpp | 13 +
lib/CodeGen/MachineSink.cpp | 14 +-
lib/CodeGen/PHIElimination.cpp | 31 --
lib/CodeGen/PHIElimination.h | 10 +-
lib/CodeGen/PostRASchedulerList.cpp | 2 +
lib/CodeGen/PseudoSourceValue.cpp | 37 +-
lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 10 +-
lib/CodeGen/SelectionDAG/InstrEmitter.cpp | 51 ++
lib/CodeGen/SelectionDAG/InstrEmitter.h | 11 +
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 25 +
lib/CodeGen/SelectionDAG/SDDbgValue.h | 67 +++
lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 49 +-
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 80 +--
lib/CodeGen/SjLjEHPrepare.cpp | 67 +--
lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 8 +-
lib/CodeGen/TwoAddressInstructionPass.cpp | 9 +-
lib/CompilerDriver/Action.cpp | 15 +-
lib/ExecutionEngine/JIT/JITEmitter.cpp | 345 ++++++-------
lib/Support/raw_ostream.cpp | 1 +
lib/Target/ARM/ARMBaseRegisterInfo.cpp | 4 +-
lib/Target/ARM/ARMInstrThumb.td | 2 +-
lib/Target/ARM/ARMInstrThumb2.td | 141 ++++-
lib/Target/ARM/ARMLoadStoreOptimizer.cpp | 5 +
lib/Target/ARM/Thumb1RegisterInfo.cpp | 22 +-
lib/Target/Alpha/AlphaCallingConv.td | 3 +-
lib/Target/CellSPU/SPUMCAsmInfo.cpp | 3 +
lib/Target/PIC16/TargetInfo/PIC16TargetInfo.cpp | 3 +-
lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp | 13 +-
lib/Target/X86/X86FastISel.cpp | 10 +-
lib/Target/X86/X86ISelDAGToDAG.cpp | 1 +
lib/Target/X86/X86ISelLowering.cpp | 91 +---
lib/Target/X86/X86InstrInfo.td | 19 +-
lib/Transforms/InstCombine/InstCombine.h | 12 +-
lib/Transforms/InstCombine/InstCombineAndOrXor.cpp | 294 ++++-------
lib/Transforms/InstCombine/InstCombineCalls.cpp | 32 +-
lib/Transforms/InstCombine/InstCombineCompares.cpp | 17 +-
lib/Transforms/InstCombine/InstCombinePHI.cpp | 2 +
lib/Transforms/Scalar/Reassociate.cpp | 26 +-
lib/Transforms/Scalar/SimplifyLibCalls.cpp | 575 ++-------------------
lib/Transforms/Utils/BuildLibCalls.cpp | 324 ++++++++++++
lib/Transforms/Utils/CMakeLists.txt | 1 +
lib/VMCore/ConstantFold.cpp | 31 +-
lib/VMCore/LLVMContextImpl.h | 5 +
lib/VMCore/Makefile | 4 +-
runtime/Makefile | 4 +
test/Bindings/Ocaml/bitwriter.ml | 34 +-
test/Bindings/Ocaml/scalar_opts.ml | 23 +-
test/CodeGen/ARM/2010-03-04-eabi-fp-spill.ll | 65 +++
test/CodeGen/ARM/2010-03-04-stm-undef-addr.ll | 54 ++
test/CodeGen/CellSPU/bss.ll | 5 +
test/CodeGen/Thumb2/thumb2-uxtb.ll | 20 +-
test/CodeGen/X86/2008-08-05-SpillerBug.ll | 2 +-
test/CodeGen/X86/2010-03-04-Mul8Bug.ll | 25 +
test/CodeGen/X86/2010-03-05-ConstantFoldCFG.ll | 42 ++
test/CodeGen/X86/2010-03-05-EFLAGS-Redef.ll | 49 ++
test/CodeGen/X86/bswap-inline-asm.ll | 67 ++-
test/CodeGen/X86/crash.ll | 20 +
test/CodeGen/X86/global-sections.ll | 3 +-
test/CodeGen/X86/lsr-reuse-trunc.ll | 15 +-
test/CodeGen/X86/sink-hoist.ll | 1 +
test/CodeGen/X86/tailcall2.ll | 21 +
test/CodeGen/X86/use-add-flags.ll | 12 +-
test/FrontendC/2010-03-5-LexicalScope.c | 10 +
.../InstCombine/2006-12-08-ICmp-Combining.ll | 18 -
test/Transforms/InstCombine/2010-03-03-ExtElim.ll | 18 +
test/Transforms/InstCombine/JavaCompare.ll | 2 +-
test/Transforms/InstCombine/crash.ll | 15 +
test/Transforms/InstCombine/icmp.ll | 12 +-
test/Transforms/InstCombine/load-cmp.ll | 8 +-
test/Transforms/InstCombine/objsize.ll | 20 +
test/Transforms/InstCombine/or.ll | 20 +-
test/Transforms/InstCombine/phi.ll | 40 ++
test/Transforms/Reassociate/crash.ll | 15 +-
test/Transforms/SimplifyLibCalls/memset_chk.ll | 18 +
test/lit.cfg | 3 +
tools/Makefile | 26 +-
tools/llvm-config/Makefile | 4 +-
tools/llvmc/doc/LLVMC-Reference.rst | 26 +-
tools/llvmc/plugins/Base/Base.td.in | 8 +-
unittests/ExecutionEngine/JIT/JITTest.cpp | 50 ++
unittests/VMCore/MetadataTest.cpp | 29 +-
utils/TableGen/DAGISelMatcher.h | 26 +-
utils/TableGen/DAGISelMatcherEmitter.cpp | 59 ++-
utils/TableGen/DAGISelMatcherGen.cpp | 102 ++--
utils/TableGen/LLVMCConfigurationEmitter.cpp | 76 ++-
utils/lit/ExampleTests.ObjDir/lit.site.cfg | 15 -
utils/lit/ExampleTests/Clang/fsyntax-only.c | 4 -
utils/lit/ExampleTests/Clang/lit.cfg | 80 ---
.../ExampleTests/LLVM.InTree/test/Bar/bar-test.ll | 3 -
utils/lit/ExampleTests/LLVM.InTree/test/Bar/dg.exp | 6 -
utils/lit/ExampleTests/LLVM.InTree/test/lit.cfg | 151 ------
.../lit/ExampleTests/LLVM.InTree/test/lit.site.cfg | 10 -
utils/lit/ExampleTests/LLVM.InTree/test/site.exp | 30 --
.../lit/ExampleTests/LLVM.OutOfTree/lit.local.cfg | 1 -
.../LLVM.OutOfTree/obj/test/Foo/lit.local.cfg | 0
.../LLVM.OutOfTree/obj/test/lit.site.cfg | 11 -
.../ExampleTests/LLVM.OutOfTree/obj/test/site.exp | 30 --
.../LLVM.OutOfTree/src/test/Foo/data.txt | 1 -
.../LLVM.OutOfTree/src/test/Foo/dg.exp | 6 -
.../LLVM.OutOfTree/src/test/Foo/pct-S.ll | 1 -
.../ExampleTests/LLVM.OutOfTree/src/test/lit.cfg | 151 ------
utils/lit/ExampleTests/ShExternal/lit.local.cfg | 6 -
utils/lit/ExampleTests/ShInternal/lit.local.cfg | 6 -
utils/lit/ExampleTests/TclTest/lit.local.cfg | 5 -
utils/lit/ExampleTests/TclTest/stderr-pipe.ll | 1 -
utils/lit/ExampleTests/TclTest/tcl-redir-1.ll | 7 -
utils/lit/ExampleTests/fail.c | 2 -
utils/lit/ExampleTests/lit.cfg | 23 -
utils/lit/ExampleTests/pass.c | 1 -
utils/lit/ExampleTests/xfail.c | 2 -
utils/lit/ExampleTests/xpass.c | 2 -
utils/lit/LitConfig.py | 95 ----
utils/lit/LitFormats.py | 3 -
utils/lit/ProgressBar.py | 267 ----------
utils/lit/ShCommands.py | 85 ---
utils/lit/ShUtil.py | 346 -------------
utils/lit/TclUtil.py | 322 ------------
utils/lit/Test.py | 79 ---
utils/lit/TestFormats.py | 189 -------
utils/lit/TestRunner.py | 517 ------------------
utils/lit/TestingConfig.py | 97 ----
utils/lit/Util.py | 124 -----
utils/lit/lit/TestRunner.py | 18 +
utils/lit/lit/TestingConfig.py | 9 +-
utils/unittest/googletest/tempfile.tmp | 0
166 files changed, 3230 insertions(+), 4352 deletions(-)
create mode 100644 include/llvm/Transforms/Utils/BuildLibCalls.h
create mode 100644 lib/CodeGen/SelectionDAG/SDDbgValue.h
create mode 100644 lib/Transforms/Utils/BuildLibCalls.cpp
create mode 100644 test/CodeGen/ARM/2010-03-04-eabi-fp-spill.ll
create mode 100644 test/CodeGen/ARM/2010-03-04-stm-undef-addr.ll
create mode 100644 test/CodeGen/CellSPU/bss.ll
create mode 100644 test/CodeGen/X86/2010-03-04-Mul8Bug.ll
create mode 100644 test/CodeGen/X86/2010-03-05-ConstantFoldCFG.ll
create mode 100644 test/CodeGen/X86/2010-03-05-EFLAGS-Redef.ll
create mode 100644 test/CodeGen/X86/crash.ll
create mode 100644 test/FrontendC/2010-03-5-LexicalScope.c
delete mode 100644 test/Transforms/InstCombine/2006-12-08-ICmp-Combining.ll
create mode 100644 test/Transforms/InstCombine/2010-03-03-ExtElim.ll
create mode 100644 test/Transforms/SimplifyLibCalls/memset_chk.ll
delete mode 100644 utils/lit/ExampleTests.ObjDir/lit.site.cfg
delete mode 100644 utils/lit/ExampleTests/Clang/fsyntax-only.c
delete mode 100644 utils/lit/ExampleTests/Clang/lit.cfg
delete mode 100644 utils/lit/ExampleTests/LLVM.InTree/test/Bar/bar-test.ll
delete mode 100644 utils/lit/ExampleTests/LLVM.InTree/test/Bar/dg.exp
delete mode 100644 utils/lit/ExampleTests/LLVM.InTree/test/lit.cfg
delete mode 100644 utils/lit/ExampleTests/LLVM.InTree/test/lit.site.cfg
delete mode 100644 utils/lit/ExampleTests/LLVM.InTree/test/site.exp
delete mode 100644 utils/lit/ExampleTests/LLVM.OutOfTree/lit.local.cfg
delete mode 100644 utils/lit/ExampleTests/LLVM.OutOfTree/obj/test/Foo/lit.local.cfg
delete mode 100644 utils/lit/ExampleTests/LLVM.OutOfTree/obj/test/lit.site.cfg
delete mode 100644 utils/lit/ExampleTests/LLVM.OutOfTree/obj/test/site.exp
delete mode 100644 utils/lit/ExampleTests/LLVM.OutOfTree/src/test/Foo/data.txt
delete mode 100644 utils/lit/ExampleTests/LLVM.OutOfTree/src/test/Foo/dg.exp
delete mode 100644 utils/lit/ExampleTests/LLVM.OutOfTree/src/test/Foo/pct-S.ll
delete mode 100644 utils/lit/ExampleTests/LLVM.OutOfTree/src/test/lit.cfg
delete mode 100644 utils/lit/ExampleTests/ShExternal/lit.local.cfg
delete mode 100644 utils/lit/ExampleTests/ShInternal/lit.local.cfg
delete mode 100644 utils/lit/ExampleTests/TclTest/lit.local.cfg
delete mode 100644 utils/lit/ExampleTests/TclTest/stderr-pipe.ll
delete mode 100644 utils/lit/ExampleTests/TclTest/tcl-redir-1.ll
delete mode 100644 utils/lit/ExampleTests/fail.c
delete mode 100644 utils/lit/ExampleTests/lit.cfg
delete mode 100644 utils/lit/ExampleTests/pass.c
delete mode 100644 utils/lit/ExampleTests/xfail.c
delete mode 100644 utils/lit/ExampleTests/xpass.c
delete mode 100644 utils/lit/LitConfig.py
delete mode 100644 utils/lit/LitFormats.py
delete mode 100644 utils/lit/ProgressBar.py
delete mode 100644 utils/lit/ShCommands.py
delete mode 100644 utils/lit/ShUtil.py
delete mode 100644 utils/lit/TclUtil.py
delete mode 100644 utils/lit/Test.py
delete mode 100644 utils/lit/TestFormats.py
delete mode 100644 utils/lit/TestRunner.py
delete mode 100644 utils/lit/TestingConfig.py
delete mode 100644 utils/lit/Util.py
delete mode 100644 utils/unittest/googletest/tempfile.tmp
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 216e0f6..96e0608 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,6 +52,7 @@ set(LLVM_ALL_TARGETS
CellSPU
CppBackend
Mips
+ MBlaze
MSIL
MSP430
PIC16
diff --git a/Makefile.config.in b/Makefile.config.in
index aca21e5..1b61f09 100644
--- a/Makefile.config.in
+++ b/Makefile.config.in
@@ -76,14 +76,14 @@ endif
LLVMMAKE := $(LLVM_SRC_ROOT)/make
-PROJ_bindir := $(DESTDIR)$(PROJ_prefix)/bin
-PROJ_libdir := $(DESTDIR)$(PROJ_prefix)/lib
-PROJ_datadir := $(DESTDIR)$(PROJ_prefix)/share
-PROJ_docsdir := $(DESTDIR)$(PROJ_prefix)/docs/llvm
-PROJ_etcdir := $(DESTDIR)$(PROJ_prefix)/etc/llvm
-PROJ_includedir := $(DESTDIR)$(PROJ_prefix)/include
-PROJ_infodir := $(DESTDIR)$(PROJ_prefix)/info
-PROJ_mandir := $(DESTDIR)$(PROJ_prefix)/share/man
+PROJ_bindir := $(PROJ_prefix)/bin
+PROJ_libdir := $(PROJ_prefix)/lib
+PROJ_datadir := $(PROJ_prefix)/share
+PROJ_docsdir := $(PROJ_prefix)/docs/llvm
+PROJ_etcdir := $(PROJ_prefix)/etc/llvm
+PROJ_includedir := $(PROJ_prefix)/include
+PROJ_infodir := $(PROJ_prefix)/info
+PROJ_mandir := $(PROJ_prefix)/share/man
# Determine if we're on a unix type operating system
LLVM_ON_UNIX:=@LLVM_ON_UNIX@
diff --git a/Makefile.rules b/Makefile.rules
index b5b3525..fcddd50 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -781,7 +781,7 @@ ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc)
# in the file so they get built before dependencies
#---------------------------------------------------------
-$(PROJ_bindir) $(PROJ_libdir) $(PROJ_includedir) $(PROJ_etcdir)::
+$(DESTDIR)$(PROJ_bindir) $(DESTDIR)$(PROJ_libdir) $(DESTDIR)$(PROJ_includedir) $(DESTDIR)$(PROJ_etcdir)::
$(Verb) $(MKDIR) $@
# To create other directories, as needed, and timestamp their creation
@@ -904,22 +904,22 @@ install-local::
uninstall-local::
$(Echo) UnInstall circumvented with NO_INSTALL
else
-install-local:: $(PROJ_etcdir) $(CONFIG_FILES)
- $(Echo) Installing Configuration Files To $(PROJ_etcdir)
+install-local:: $(DESTDIR)$(PROJ_etcdir) $(CONFIG_FILES)
+ $(Echo) Installing Configuration Files To $(DESTDIR)$(PROJ_etcdir)
$(Verb)for file in $(CONFIG_FILES); do \
if test -f $(PROJ_OBJ_DIR)/$${file} ; then \
- $(DataInstall) $(PROJ_OBJ_DIR)/$${file} $(PROJ_etcdir) ; \
+ $(DataInstall) $(PROJ_OBJ_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
elif test -f $(PROJ_SRC_DIR)/$${file} ; then \
- $(DataInstall) $(PROJ_SRC_DIR)/$${file} $(PROJ_etcdir) ; \
+ $(DataInstall) $(PROJ_SRC_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
else \
$(ECHO) Error: cannot find config file $${file}. ; \
fi \
done
uninstall-local::
- $(Echo) Uninstalling Configuration Files From $(PROJ_etcdir)
+ $(Echo) Uninstalling Configuration Files From $(DESTDIR)$(PROJ_etcdir)
$(Verb)for file in $(CONFIG_FILES); do \
- $(RM) -f $(PROJ_etcdir)/$${file} ; \
+ $(RM) -f $(DESTDIR)$(PROJ_etcdir)/$${file} ; \
done
endif
@@ -1011,7 +1011,7 @@ endif
ifdef BYTECODE_DESTINATION
ModuleDestDir := $(BYTECODE_DESTINATION)
else
-ModuleDestDir := $(PROJ_libdir)
+ModuleDestDir := $(DESTDIR)$(PROJ_libdir)
endif
ifdef NO_INSTALL
@@ -1090,17 +1090,17 @@ install-local::
uninstall-local::
$(Echo) Uninstall circumvented with NO_INSTALL
else
-DestSharedLib = $(PROJ_libdir)/lib$(LIBRARYNAME)$(SHLIBEXT)
+DestSharedLib = $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME)$(SHLIBEXT)
install-local:: $(DestSharedLib)
-$(DestSharedLib): $(LibName.SO) $(PROJ_libdir)
+$(DestSharedLib): $(LibName.SO) $(DESTDIR)$(PROJ_libdir)
$(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib)
$(Verb) $(INSTALL) $(LibName.SO) $(DestSharedLib)
uninstall-local::
$(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib)
- -$(Verb) $(RM) -f $(PROJ_libdir)/lib$(LIBRARYNAME).*
+ -$(Verb) $(RM) -f $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME).*
endif
endif
@@ -1144,7 +1144,7 @@ endif
ifdef BYTECODE_DESTINATION
BytecodeDestDir := $(BYTECODE_DESTINATION)
else
-BytecodeDestDir := $(PROJ_libdir)
+BytecodeDestDir := $(DESTDIR)$(PROJ_libdir)
endif
DestBytecodeLib = $(BytecodeDestDir)/lib$(LIBRARYNAME).bca
@@ -1209,13 +1209,13 @@ install-local::
uninstall-local::
$(Echo) Uninstall circumvented with NO_INSTALL
else
-DestArchiveLib := $(PROJ_libdir)/lib$(LIBRARYNAME).a
+DestArchiveLib := $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME).a
install-local:: $(DestArchiveLib)
-$(DestArchiveLib): $(LibName.A) $(PROJ_libdir)
+$(DestArchiveLib): $(LibName.A) $(DESTDIR)$(PROJ_libdir)
$(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib)
- $(Verb) $(MKDIR) $(PROJ_libdir)
+ $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_libdir)
$(Verb) $(INSTALL) $(LibName.A) $(DestArchiveLib)
uninstall-local::
@@ -1315,11 +1315,11 @@ install-local::
uninstall-local::
$(Echo) Uninstall circumvented with NO_INSTALL
else
-DestTool = $(PROJ_bindir)/$(TOOLEXENAME)
+DestTool = $(DESTDIR)$(PROJ_bindir)/$(TOOLEXENAME)
install-local:: $(DestTool)
-$(DestTool): $(ToolBuildPath) $(PROJ_bindir)
+$(DestTool): $(ToolBuildPath) $(DESTDIR)$(PROJ_bindir)
$(Echo) Installing $(BuildMode) $(DestTool)
$(Verb) $(ProgInstall) $(ToolBuildPath) $(DestTool)
@@ -1964,25 +1964,25 @@ uninstall-local::
else
install-local::
$(Echo) Installing include files
- $(Verb) $(MKDIR) $(PROJ_includedir)
+ $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_includedir)
$(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \
cd $(PROJ_SRC_ROOT)/include && \
for hdr in `find . -type f '!' '(' -name '*~' \
-o -name '.#*' -o -name '*.in' ')' -print | grep -v CVS | \
grep -v .svn` ; do \
- instdir=`dirname "$(PROJ_includedir)/$$hdr"` ; \
+ instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
if test \! -d "$$instdir" ; then \
$(EchoCmd) Making install directory $$instdir ; \
$(MKDIR) $$instdir ;\
fi ; \
- $(DataInstall) $$hdr $(PROJ_includedir)/$$hdr ; \
+ $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
done ; \
fi
ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
$(Verb) if test -d "$(PROJ_OBJ_ROOT)/include" ; then \
cd $(PROJ_OBJ_ROOT)/include && \
for hdr in `find . -type f -print | grep -v CVS` ; do \
- $(DataInstall) $$hdr $(PROJ_includedir)/$$hdr ; \
+ $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
done ; \
fi
endif
@@ -1994,10 +1994,10 @@ uninstall-local::
$(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \
'!' '(' -name '*~' -o -name '.#*' \
-o -name '*.in' ')' -print ')' | \
- grep -v CVS | sed 's#^#$(PROJ_includedir)/#'` ; \
+ grep -v CVS | sed 's#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
cd $(PROJ_SRC_ROOT)/include && \
$(RM) -f `find . -path '*/Internal' -prune -o '(' -type f -name '*.in' \
- -print ')' | sed 's#\.in$$##;s#^#$(PROJ_includedir)/#'` ; \
+ -print ')' | sed 's#\.in$$##;s#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
fi
endif
endif
diff --git a/bindings/ocaml/bitwriter/bitwriter_ocaml.c b/bindings/ocaml/bitwriter/bitwriter_ocaml.c
index 41aca25..53c93cb 100644
--- a/bindings/ocaml/bitwriter/bitwriter_ocaml.c
+++ b/bindings/ocaml/bitwriter/bitwriter_ocaml.c
@@ -28,3 +28,18 @@ CAMLprim value llvm_write_bitcode_file(value M, value Path) {
int res = LLVMWriteBitcodeToFile((LLVMModuleRef) M, String_val(Path));
return Val_bool(res == 0);
}
+
+/* ?unbuffered:bool -> Llvm.llmodule -> Unix.file_descr -> bool */
+CAMLprim value llvm_write_bitcode_to_fd(value U, value M, value FD) {
+ int Unbuffered;
+ int res;
+
+ if (U == Val_int(0)) {
+ Unbuffered = 0;
+ } else {
+ Unbuffered = Bool_val(Field(U,0));
+ }
+
+ res = LLVMWriteBitcodeToFD((LLVMModuleRef) M, Int_val(FD), 0, Unbuffered);
+ return Val_bool(res == 0);
+}
diff --git a/bindings/ocaml/bitwriter/llvm_bitwriter.ml b/bindings/ocaml/bitwriter/llvm_bitwriter.ml
index 7b45c53..3e69a3c 100644
--- a/bindings/ocaml/bitwriter/llvm_bitwriter.ml
+++ b/bindings/ocaml/bitwriter/llvm_bitwriter.ml
@@ -16,3 +16,10 @@
(* Writes the bitcode for module the given path. Returns true if successful. *)
external write_bitcode_file : Llvm.llmodule -> string -> bool
= "llvm_write_bitcode_file"
+
+external write_bitcode_to_fd : ?unbuffered:bool -> Llvm.llmodule
+ -> Unix.file_descr -> bool
+ = "llvm_write_bitcode_to_fd"
+
+let output_bitcode ?unbuffered channel m =
+ write_bitcode_to_fd ?unbuffered m (Unix.descr_of_out_channel channel)
diff --git a/bindings/ocaml/bitwriter/llvm_bitwriter.mli b/bindings/ocaml/bitwriter/llvm_bitwriter.mli
index 2f782a1..ea9a876 100644
--- a/bindings/ocaml/bitwriter/llvm_bitwriter.mli
+++ b/bindings/ocaml/bitwriter/llvm_bitwriter.mli
@@ -16,3 +16,15 @@
[path]. Returns [true] if successful, [false] otherwise. *)
external write_bitcode_file : Llvm.llmodule -> string -> bool
= "llvm_write_bitcode_file"
+
+(** [write_bitcode_to_fd ~unbuffered fd m] writes the bitcode for module
+ [m] to the channel [c]. If [unbuffered] is [true], after every write the fd
+ will be flushed. Returns [true] if successful, [false] otherwise. *)
+external write_bitcode_to_fd : ?unbuffered:bool -> Llvm.llmodule
+ -> Unix.file_descr -> bool
+ = "llvm_write_bitcode_to_fd"
+
+(** [output_bitcode ~unbuffered c m] writes the bitcode for module [m]
+ to the channel [c]. If [unbuffered] is [true], after every write the fd
+ will be flushed. Returns [true] if successful, [false] otherwise. *)
+val output_bitcode : ?unbuffered:bool -> out_channel -> Llvm.llmodule -> bool
diff --git a/bindings/ocaml/executionengine/executionengine_ocaml.c b/bindings/ocaml/executionengine/executionengine_ocaml.c
index 1d3e57a..5b1e32e 100644
--- a/bindings/ocaml/executionengine/executionengine_ocaml.c
+++ b/bindings/ocaml/executionengine/executionengine_ocaml.c
@@ -91,7 +91,7 @@ CAMLprim value llvm_genericvalue_of_float(LLVMTypeRef Ty, value N) {
}
/* 'a -> t */
-CAMLprim value llvm_genericvalue_of_value(value V) {
+CAMLprim value llvm_genericvalue_of_pointer(value V) {
CAMLparam1(V);
CAMLreturn(alloc_generic_value(LLVMCreateGenericValueOfPointer(Op_val(V))));
}
@@ -130,7 +130,7 @@ CAMLprim value llvm_genericvalue_as_float(LLVMTypeRef Ty, value GenVal) {
}
/* t -> 'a */
-CAMLprim value llvm_genericvalue_as_value(value GenVal) {
+CAMLprim value llvm_genericvalue_as_pointer(value GenVal) {
return Val_op(LLVMGenericValueToPointer(Genericvalue_val(GenVal)));
}
@@ -204,14 +204,14 @@ CAMLprim value llvm_ee_dispose(LLVMExecutionEngineRef EE) {
}
/* llmodule -> ExecutionEngine.t -> unit */
-CAMLprim value llvm_ee_add_mp(LLVMModuleRef M, LLVMExecutionEngineRef EE) {
+CAMLprim value llvm_ee_add_module(LLVMModuleRef M, LLVMExecutionEngineRef EE) {
LLVMAddModule(EE, M);
return Val_unit;
}
/* llmodule -> ExecutionEngine.t -> llmodule */
-CAMLprim LLVMModuleRef llvm_ee_remove_mp(LLVMModuleRef M,
- LLVMExecutionEngineRef EE) {
+CAMLprim LLVMModuleRef llvm_ee_remove_module(LLVMModuleRef M,
+ LLVMExecutionEngineRef EE) {
LLVMModuleRef RemovedModule;
char *Error;
if (LLVMRemoveModule(EE, M, &RemovedModule, &Error))
diff --git a/bindings/ocaml/executionengine/llvm_executionengine.ml b/bindings/ocaml/executionengine/llvm_executionengine.ml
index 95faa58..a8535b2 100644
--- a/bindings/ocaml/executionengine/llvm_executionengine.ml
+++ b/bindings/ocaml/executionengine/llvm_executionengine.ml
@@ -20,7 +20,7 @@ module GenericValue = struct
external of_float: Llvm.lltype -> float -> t
= "llvm_genericvalue_of_float"
external of_pointer: 'a -> t
- = "llvm_genericvalue_of_value"
+ = "llvm_genericvalue_of_pointer"
external of_int32: Llvm.lltype -> int32 -> t
= "llvm_genericvalue_of_int32"
external of_int: Llvm.lltype -> int -> t
@@ -33,7 +33,7 @@ module GenericValue = struct
external as_float: Llvm.lltype -> t -> float
= "llvm_genericvalue_as_float"
external as_pointer: t -> 'a
- = "llvm_genericvalue_as_value"
+ = "llvm_genericvalue_as_pointer"
external as_int32: t -> int32
= "llvm_genericvalue_as_int32"
external as_int: t -> int
@@ -65,9 +65,9 @@ module ExecutionEngine = struct
external dispose: t -> unit
= "llvm_ee_dispose"
external add_module: Llvm.llmodule -> t -> unit
- = "llvm_ee_add_mp"
+ = "llvm_ee_add_module"
external remove_module: Llvm.llmodule -> t -> Llvm.llmodule
- = "llvm_ee_remove_mp"
+ = "llvm_ee_remove_module"
external find_function: string -> t -> Llvm.llvalue option
= "llvm_ee_find_function"
external run_function: Llvm.llvalue -> GenericValue.t array -> t ->
diff --git a/bindings/ocaml/executionengine/llvm_executionengine.mli b/bindings/ocaml/executionengine/llvm_executionengine.mli
index ac6665b..ce25f9d 100644
--- a/bindings/ocaml/executionengine/llvm_executionengine.mli
+++ b/bindings/ocaml/executionengine/llvm_executionengine.mli
@@ -25,57 +25,58 @@ module GenericValue: sig
(** [of_float fpty n] boxes the float [n] in a float-valued generic value
according to the floating point type [fpty]. See the fields
[llvm::GenericValue::DoubleVal] and [llvm::GenericValue::FloatVal]. *)
- val of_float: Llvm.lltype -> float -> t
+ external of_float : Llvm.lltype -> float -> t = "llvm_genericvalue_of_float"
(** [of_pointer v] boxes the pointer value [v] in a generic value. See the
field [llvm::GenericValue::PointerVal]. *)
- val of_pointer: 'a -> t
+ external of_pointer : 'a -> t = "llvm_genericvalue_of_pointer"
(** [of_int32 n w] boxes the int32 [i] in a generic value with the bitwidth
[w]. See the field [llvm::GenericValue::IntVal]. *)
- val of_int32: Llvm.lltype -> int32 -> t
+ external of_int32 : Llvm.lltype -> int32 -> t = "llvm_genericvalue_of_int32"
(** [of_int n w] boxes the int [i] in a generic value with the bitwidth
[w]. See the field [llvm::GenericValue::IntVal]. *)
- val of_int: Llvm.lltype -> int -> t
+ external of_int : Llvm.lltype -> int -> t = "llvm_genericvalue_of_int"
(** [of_natint n w] boxes the native int [i] in a generic value with the
bitwidth [w]. See the field [llvm::GenericValue::IntVal]. *)
- val of_nativeint: Llvm.lltype -> nativeint -> t
-
+ external of_nativeint : Llvm.lltype -> nativeint -> t
+ = "llvm_genericvalue_of_nativeint"
+
(** [of_int64 n w] boxes the int64 [i] in a generic value with the bitwidth
[w]. See the field [llvm::GenericValue::IntVal]. *)
- val of_int64: Llvm.lltype -> int64 -> t
-
+ external of_int64 : Llvm.lltype -> int64 -> t = "llvm_genericvalue_of_int64"
+
(** [as_float fpty gv] unboxes the floating point-valued generic value [gv] of
floating point type [fpty]. See the fields [llvm::GenericValue::DoubleVal]
and [llvm::GenericValue::FloatVal]. *)
- val as_float: Llvm.lltype -> t -> float
+ external as_float : Llvm.lltype -> t -> float = "llvm_genericvalue_as_float"
(** [as_pointer gv] unboxes the pointer-valued generic value [gv]. See the
field [llvm::GenericValue::PointerVal]. *)
- val as_pointer: t -> 'a
+ external as_pointer : t -> 'a = "llvm_genericvalue_as_pointer"
(** [as_int32 gv] unboxes the integer-valued generic value [gv] as an [int32].
Is invalid if [gv] has a bitwidth greater than 32 bits. See the field
[llvm::GenericValue::IntVal]. *)
- val as_int32: t -> int32
+ external as_int32 : t -> int32 = "llvm_genericvalue_as_int32"
(** [as_int gv] unboxes the integer-valued generic value [gv] as an [int].
Is invalid if [gv] has a bitwidth greater than the host bit width (but the
most significant bit may be lost). See the field
[llvm::GenericValue::IntVal]. *)
- val as_int: t -> int
+ external as_int : t -> int = "llvm_genericvalue_as_int"
(** [as_natint gv] unboxes the integer-valued generic value [gv] as a
[nativeint]. Is invalid if [gv] has a bitwidth greater than
[nativeint]. See the field [llvm::GenericValue::IntVal]. *)
- val as_nativeint: t -> nativeint
+ external as_nativeint : t -> nativeint = "llvm_genericvalue_as_nativeint"
(** [as_int64 gv] returns the integer-valued generic value [gv] as an [int64].
Is invalid if [gv] has a bitwidth greater than [int64]. See the field
[llvm::GenericValue::IntVal]. *)
- val as_int64: t -> int64
+ external as_int64 : t -> int64 = "llvm_genericvalue_as_int64"
end
@@ -90,66 +91,72 @@ module ExecutionEngine: sig
interpreter. Raises [Error msg] if an error occurrs. The execution engine
is not garbage collected and must be destroyed with [dispose ee].
See the function [llvm::EngineBuilder::create]. *)
- val create: Llvm.llmodule -> t
+ external create : Llvm.llmodule -> t = "llvm_ee_create"
(** [create_interpreter m] creates a new interpreter, taking ownership of the
module [m] if successful. Raises [Error msg] if an error occurrs. The
execution engine is not garbage collected and must be destroyed with
[dispose ee].
See the function [llvm::EngineBuilder::create]. *)
- val create_interpreter: Llvm.llmodule -> t
+ external create_interpreter : Llvm.llmodule -> t = "llvm_ee_create_interpreter"
(** [create_jit m optlevel] creates a new JIT (just-in-time compiler), taking
ownership of the module [m] if successful with the desired optimization
level [optlevel]. Raises [Error msg] if an error occurrs. The execution
engine is not garbage collected and must be destroyed with [dispose ee].
See the function [llvm::EngineBuilder::create]. *)
- val create_jit : Llvm.llmodule -> int -> t
+ external create_jit : Llvm.llmodule -> int -> t = "llvm_ee_create_jit"
(** [dispose ee] releases the memory used by the execution engine and must be
invoked to avoid memory leaks. *)
- val dispose: t -> unit
+ external dispose : t -> unit = "llvm_ee_dispose"
(** [add_module m ee] adds the module [m] to the execution engine [ee]. *)
- val add_module: Llvm.llmodule -> t -> unit
+ external add_module : Llvm.llmodule -> t -> unit = "llvm_ee_add_module"
(** [remove_module m ee] removes the module [m] from the execution engine
[ee], disposing of [m] and the module referenced by [mp]. Raises
[Error msg] if an error occurs. *)
- val remove_module: Llvm.llmodule -> t -> Llvm.llmodule
+ external remove_module : Llvm.llmodule -> t -> Llvm.llmodule
+ = "llvm_ee_remove_module"
(** [find_function n ee] finds the function named [n] defined in any of the
modules owned by the execution engine [ee]. Returns [None] if the function
is not found and [Some f] otherwise. *)
- val find_function: string -> t -> Llvm.llvalue option
+ external find_function : string -> t -> Llvm.llvalue option
+ = "llvm_ee_find_function"
(** [run_function f args ee] synchronously executes the function [f] with the
arguments [args], which must be compatible with the parameter types. *)
- val run_function: Llvm.llvalue -> GenericValue.t array -> t ->
- GenericValue.t
+ external run_function : Llvm.llvalue -> GenericValue.t array -> t ->
+ GenericValue.t
+ = "llvm_ee_run_function"
(** [run_static_ctors ee] executes the static constructors of each module in
the execution engine [ee]. *)
- val run_static_ctors: t -> unit
+ external run_static_ctors : t -> unit = "llvm_ee_run_static_ctors"
(** [run_static_dtors ee] executes the static destructors of each module in
the execution engine [ee]. *)
- val run_static_dtors: t -> unit
+ external run_static_dtors : t -> unit = "llvm_ee_run_static_dtors"
(** [run_function_as_main f args env ee] executes the function [f] as a main
function, passing it [argv] and [argc] according to the string array
[args], and [envp] as specified by the array [env]. Returns the integer
return value of the function. *)
- val run_function_as_main: Llvm.llvalue -> string array ->
- (string * string) array -> t -> int
+ external run_function_as_main : Llvm.llvalue -> string array ->
+ (string * string) array -> t -> int
+ = "llvm_ee_run_function_as_main"
(** [free_machine_code f ee] releases the memory in the execution engine [ee]
used to store the machine code for the function [f]. *)
- val free_machine_code: Llvm.llvalue -> t -> unit
+ external free_machine_code : Llvm.llvalue -> t -> unit
+ = "llvm_ee_free_machine_code"
(** [target_data ee] is the target data owned by the execution engine
[ee]. *)
- val target_data: t -> Llvm_target.TargetData.t
+ external target_data : t -> Llvm_target.TargetData.t
+ = "LLVMGetExecutionEngineTargetData"
end
external initialize_native_target : unit -> bool
diff --git a/bindings/ocaml/llvm/llvm.ml b/bindings/ocaml/llvm/llvm.ml
index 407c1fc..e801c49 100644
--- a/bindings/ocaml/llvm/llvm.ml
+++ b/bindings/ocaml/llvm/llvm.ml
@@ -90,11 +90,13 @@ module Attribute = struct
| Optsize
| Ssp
| Sspreq
+ | Alignment
| Nocapture
| Noredzone
| Noimplicitfloat
| Naked
| Inlinehint
+ | Stackalignment
end
module Icmp = struct
diff --git a/bindings/ocaml/llvm/llvm.mli b/bindings/ocaml/llvm/llvm.mli
index aa5ea76..4b0c06d 100644
--- a/bindings/ocaml/llvm/llvm.mli
+++ b/bindings/ocaml/llvm/llvm.mli
@@ -139,11 +139,13 @@ module Attribute : sig
| Optsize
| Ssp
| Sspreq
+ | Alignment
| Nocapture
| Noredzone
| Noimplicitfloat
| Naked
| Inlinehint
+ | Stackalignment
end
(** The predicate for an integer comparison ([icmp]) instruction.
diff --git a/bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml b/bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml
index b4563b7..5699152 100644
--- a/bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml
+++ b/bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml
@@ -10,9 +10,38 @@
external add_constant_propagation : [ unit
= "llvm_add_constant_propagation"
-external add_instruction_combining : [ unit
- = "llvm_add_instruction_combining"
+external add_sccp : [ unit
+ = "llvm_add_sccp"
+external add_dead_store_elimination : [ unit
+ = "llvm_add_dead_store_elimination"
+external add_aggressive_dce : [ unit
+ = "llvm_add_aggressive_dce"
+external
+add_scalar_repl_aggregation : [ unit
+ = "llvm_add_scalar_repl_aggregation"
+external add_ind_var_simplification : [ unit
+ = "llvm_add_ind_var_simplification"
+external
+add_instruction_combination : [ unit
+ = "llvm_add_instruction_combination"
+external add_licm : [ unit
+ = "llvm_add_licm"
+external add_loop_unswitch : [ unit
+ = "llvm_add_loop_unswitch"
+external add_loop_unroll : [ unit
+ = "llvm_add_loop_unroll"
+external add_loop_rotation : [ unit
+ = "llvm_add_loop_rotation"
+external add_loop_index_split : [ unit
+ = "llvm_add_loop_index_split"
external
add_memory_to_register_promotion : [ unit
@@ -21,12 +50,26 @@ external
add_memory_to_register_demotion : [ unit
= "llvm_add_memory_to_register_demotion"
-external add_reassociation : [ unit
+external add_reassociation : [ unit
= "llvm_add_reassociation"
-external add_gvn : [ unit
- = "llvm_add_gvn"
+external add_jump_threading : [ unit
+ = "llvm_add_jump_threading"
external add_cfg_simplification : [ unit
= "llvm_add_cfg_simplification"
+external
+add_tail_call_elimination : [ unit
+ = "llvm_add_tail_call_elimination"
+external add_gvn : [ unit
+ = "llvm_add_gvn"
+external add_memcpy_opt : [ unit
+ = "llvm_add_memcpy_opt"
+external add_loop_deletion : [ unit
+ = "llvm_add_loop_deletion"
+external
+add_lib_call_simplification : [ unit
+ = "llvm_add_lib_call_simplification"
diff --git a/bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli b/bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli
index 6fcce043..9f95fbc 100644
--- a/bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli
+++ b/bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli
@@ -17,10 +17,59 @@ external add_constant_propagation : [ unit
= "llvm_add_constant_propagation"
+(** See the [llvm::createSCCPPass] function. *)
+external add_sccp : [ unit
+ = "llvm_add_sccp"
+
+(** See [llvm::createDeadStoreEliminationPass] function. *)
+external add_dead_store_elimination : [ unit
+ = "llvm_add_dead_store_elimination"
+
+(** See The [llvm::createAggressiveDCEPass] function. *)
+external add_aggressive_dce : [ unit
+ = "llvm_add_aggressive_dce"
+
+(** See the [llvm::createScalarReplAggregatesPass] function. *)
+external
+add_scalar_repl_aggregation : [ unit
+ = "llvm_add_scalar_repl_aggregation"
+
+(** See the [llvm::createIndVarSimplifyPass] function. *)
+external add_ind_var_simplification : [ unit
+ = "llvm_add_ind_var_simplification"
+
(** See the [llvm::createInstructionCombiningPass] function. *)
-external add_instruction_combining : [ unit
- = "llvm_add_instruction_combining"
+external
+add_instruction_combination : [ unit
+ = "llvm_add_instruction_combination"
+
+(** See the [llvm::createLICMPass] function. *)
+external add_licm : [ unit
+ = "llvm_add_licm"
+
+(** See the [llvm::createLoopUnswitchPass] function. *)
+external add_loop_unswitch : [ unit
+ = "llvm_add_loop_unswitch"
+
+(** See the [llvm::createLoopUnrollPass] function. *)
+external add_loop_unroll : [ unit
+ = "llvm_add_loop_unroll"
+
+(** See the [llvm::createLoopRotatePass] function. *)
+external add_loop_rotation : [ unit
+ = "llvm_add_loop_rotation"
+
+(** See the [llvm::createLoopIndexSplitPass] function. *)
+external add_loop_index_split : [ unit
+ = "llvm_add_loop_index_split"
(** See the [llvm::createPromoteMemoryToRegisterPass] function. *)
external
@@ -35,16 +84,40 @@ add_memory_to_register_demotion : [ unit
+external add_reassociation : [ unit
= "llvm_add_reassociation"
-(** See the [llvm::createGVNPass] function. *)
-external add_gvn : [ unit
- = "llvm_add_gvn"
+(** See the [llvm::createJumpThreadingPass] function. *)
+external add_jump_threading : [ unit
+ = "llvm_add_jump_threading"
(** See the [llvm::createCFGSimplificationPass] function. *)
external add_cfg_simplification : [ unit
= "llvm_add_cfg_simplification"
+
+(** See the [llvm::createTailCallEliminationPass] function. *)
+external
+add_tail_call_elimination : [ unit
+ = "llvm_add_tail_call_elimination"
+
+(** See the [llvm::createGVNPass] function. *)
+external add_gvn : [ unit
+ = "llvm_add_gvn"
+
+(** See the [llvm::createMemCpyOptPass] function. *)
+external add_memcpy_opt : [ unit
+ = "llvm_add_memcpy_opt"
+
+(** See the [llvm::createLoopDeletionPass] function. *)
+external add_loop_deletion : [ unit
+ = "llvm_add_loop_deletion"
+
+(** See the [llvm::createSimplifyLibCallsPass] function. *)
+external
+add_lib_call_simplification : [ unit
+ = "llvm_add_lib_call_simplification"
diff --git a/bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c b/bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c
index 87c1060..c20bdde 100644
--- a/bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c
+++ b/bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c
@@ -26,12 +26,72 @@ CAMLprim value llvm_add_constant_propagation(LLVMPassManagerRef PM) {
}
/* [ unit */
-CAMLprim value llvm_add_instruction_combining(LLVMPassManagerRef PM) {
+CAMLprim value llvm_add_sccp(LLVMPassManagerRef PM) {
+ LLVMAddSCCPPass(PM);
+ return Val_unit;
+}
+
+/* [ unit */
+CAMLprim value llvm_add_dead_store_elimination(LLVMPassManagerRef PM) {
+ LLVMAddDeadStoreEliminationPass(PM);
+ return Val_unit;
+}
+
+/* [ unit */
+CAMLprim value llvm_add_aggressive_dce(LLVMPassManagerRef PM) {
+ LLVMAddAggressiveDCEPass(PM);
+ return Val_unit;
+}
+
+/* [ unit */
+CAMLprim value llvm_add_scalar_repl_aggregation(LLVMPassManagerRef PM) {
+ LLVMAddScalarReplAggregatesPass(PM);
+ return Val_unit;
+}
+
+/* [ unit */
+CAMLprim value llvm_add_ind_var_simplification(LLVMPassManagerRef PM) {
+ LLVMAddIndVarSimplifyPass(PM);
+ return Val_unit;
+}
+
+/* [ unit */
+CAMLprim value llvm_add_instruction_combination(LLVMPassManagerRef PM) {
LLVMAddInstructionCombiningPass(PM);
return Val_unit;
}
/* [ unit */
+CAMLprim value llvm_add_licm(LLVMPassManagerRef PM) {
+ LLVMAddLICMPass(PM);
+ return Val_unit;
+}
+
+/* [ unit */
+CAMLprim value llvm_add_loop_unswitch(LLVMPassManagerRef PM) {
+ LLVMAddLoopUnrollPass(PM);
+ return Val_unit;
+}
+
+/* [ unit */
+CAMLprim value llvm_add_loop_unroll(LLVMPassManagerRef PM) {
+ LLVMAddLoopUnrollPass(PM);
+ return Val_unit;
+}
+
+/* [ unit */
+CAMLprim value llvm_add_loop_rotation(LLVMPassManagerRef PM) {
+ LLVMAddLoopRotatePass(PM);
+ return Val_unit;
+}
+
+/* [ unit */
+CAMLprim value llvm_add_loop_index_split(LLVMPassManagerRef PM) {
+ LLVMAddLoopIndexSplitPass(PM);
+ return Val_unit;
+}
+
+/* [ unit */
CAMLprim value llvm_add_memory_to_register_promotion(LLVMPassManagerRef PM) {
LLVMAddPromoteMemoryToRegisterPass(PM);
return Val_unit;
@@ -50,8 +110,8 @@ CAMLprim value llvm_add_reassociation(LLVMPassManagerRef PM) {
}
/* [ unit */
-CAMLprim value llvm_add_gvn(LLVMPassManagerRef PM) {
- LLVMAddGVNPass(PM);
+CAMLprim value llvm_add_jump_threading(LLVMPassManagerRef PM) {
+ LLVMAddJumpThreadingPass(PM);
return Val_unit;
}
@@ -60,3 +120,33 @@ CAMLprim value llvm_add_cfg_simplification(LLVMPassManagerRef PM) {
LLVMAddCFGSimplificationPass(PM);
return Val_unit;
}
+
+/* [ unit */
+CAMLprim value llvm_add_tail_call_elimination(LLVMPassManagerRef PM) {
+ LLVMAddTailCallEliminationPass(PM);
+ return Val_unit;
+}
+
+/* [ unit */
+CAMLprim value llvm_add_gvn(LLVMPassManagerRef PM) {
+ LLVMAddGVNPass(PM);
+ return Val_unit;
+}
+
+/* [ unit */
+CAMLprim value llvm_add_memcpy_opt(LLVMPassManagerRef PM) {
+ LLVMAddMemCpyOptPass(PM);
+ return Val_unit;
+}
+
+/* [ unit */
+CAMLprim value llvm_add_loop_deletion(LLVMPassManagerRef PM) {
+ LLVMAddLoopDeletionPass(PM);
+ return Val_unit;
+}
+
+/* [ unit */
+CAMLprim value llvm_add_lib_call_simplification(LLVMPassManagerRef PM) {
+ LLVMAddSimplifyLibCallsPass(PM);
+ return Val_unit;
+}
diff --git a/docs/CommandGuide/Makefile b/docs/CommandGuide/Makefile
index 3b65183..2c2d076 100644
--- a/docs/CommandGuide/Makefile
+++ b/docs/CommandGuide/Makefile
@@ -77,9 +77,9 @@ EXTRA_DIST := $(POD) index.html
clean-local::
$(Verb) $(RM) -f pod2htm*.*~~ $(HTML) $(MAN) $(PS)
-HTML_DIR := $(PROJ_docsdir)/html/CommandGuide
-MAN_DIR := $(PROJ_mandir)/man1
-PS_DIR := $(PROJ_docsdir)/ps
+HTML_DIR := $(DESTDIR)$(PROJ_docsdir)/html/CommandGuide
+MAN_DIR := $(DESTDIR)$(PROJ_mandir)/man1
+PS_DIR := $(DESTDIR)$(PROJ_docsdir)/ps
install-local:: $(HTML) $(INSTALL_MANS) $(PS)
$(Echo) Installing HTML CommandGuide Documentation
diff --git a/docs/LangRef.html b/docs/LangRef.html
index f3f73fa..f7ecb76 100644
--- a/docs/LangRef.html
+++ b/docs/LangRef.html
@@ -2520,6 +2520,23 @@ call void asm alignstack "eieio", ""()
metadata nodes, which can be looked up in the module symbol table. For
example: "!foo = metadata !{!4, !3}".
+Metadata can be used as function arguments. Here llvm.dbg.value
+ function is using two metadata arguments.
+
+
+
+ call void @llvm.dbg.value(metadata !24, i64 0, metadata !25)
+
+
+
+Metadata can be attached with an instruction. Here metadata !21 is
+ attached with add instruction using !dbg identifier.
+
+
+
+ %indvar.next = add i64 %indvar, 1, !dbg !21
+
+
@@ -7453,7 +7470,7 @@ LLVM.
Chris Lattner
The LLVM Compiler Infrastructure
- Last modified: $Date: 2010-03-02 07:36:51 +0100 (Tue, 02 Mar 2010) $
+ Last modified: $Date: 2010-03-05 00:44:48 +0100 (Fri, 05 Mar 2010) $