Vendor import of llvm tags/RELEASE_33/final r183502 (effectively, 3.3

release):
http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_33/final@183502
This commit is contained in:
Dimitry Andric 2013-06-10 20:36:52 +00:00
parent 4a16efa3e4
commit 59d6cff90e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/vendor/llvm/dist/; revision=251607
svn path=/vendor/llvm/llvm-release_33-r183502/; revision=251608; tag=vendor/llvm/llvm-release_33-r183502
2476 changed files with 107390 additions and 24186 deletions

View File

@ -84,20 +84,16 @@ set(LLVM_ALL_TARGETS
NVPTX
PowerPC
Sparc
SystemZ
X86
XCore
)
# List of targets with JIT support:
set(LLVM_TARGETS_WITH_JIT X86 PowerPC ARM Mips)
set(LLVM_TARGETS_WITH_JIT X86 PowerPC ARM Mips SystemZ)
if( MSVC )
set(LLVM_TARGETS_TO_BUILD X86
set(LLVM_TARGETS_TO_BUILD "all"
CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
else( MSVC )
set(LLVM_TARGETS_TO_BUILD "all"
CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
endif( MSVC )
set(LLVM_EXPERIMENTAL_TARGETS_TO_BUILD ""
CACHE STRING "Semicolon-separated list of experimental targets to build.")
@ -129,6 +125,8 @@ set(LLVM_TARGET_ARCH "host"
option(LLVM_ENABLE_THREADS "Use threads if available." ON)
option(LLVM_ENABLE_ZLIB "Use zlib for compression/decompression if available." ON)
if( LLVM_TARGETS_TO_BUILD STREQUAL "all" )
set( LLVM_TARGETS_TO_BUILD ${LLVM_ALL_TARGETS} )
endif()
@ -419,7 +417,6 @@ add_subdirectory(utils/count)
add_subdirectory(utils/not)
add_subdirectory(utils/llvm-lit)
add_subdirectory(utils/yaml-bench)
add_subdirectory(utils/yaml2obj)
add_subdirectory(projects)

View File

@ -23,7 +23,7 @@ D: Gold plugin (tools/gold/*)
N: Chandler Carruth
E: chandlerc@gmail.com
E: chandlerc@google.com
D: Config, ADT, Support, inlining & related passse, SROA/mem2reg & related passes, CMake, library layering
D: Config, ADT, Support, inlining & related passes, SROA/mem2reg & related passes, CMake, library layering
N: Evan Cheng
E: evan.cheng@apple.com
@ -109,6 +109,10 @@ N: Nadav Rotem
E: nrotem@apple.com
D: X86 Backend, Loop Vectorizer
N: Richard Sandiford
E: rsandifo@linux.vnet.ibm.com
D: SystemZ Backend
N: Duncan Sands
E: baldrick@free.fr
D: DragonEgg
@ -128,4 +132,4 @@ D: IndVar Simplify, Loop Strength Reduction, Instruction Scheduling
N: Bill Wendling
E: wendling@apple.com
D: libLTO & IR Linker
D: libLTO, IR Linker

View File

@ -251,6 +251,12 @@ D: The initial llvm-ar tool, converted regression testsuite to dejagnu
D: Modulo scheduling in the SparcV9 backend
D: Release manager (1.7+)
N: Sylvestre Ledru
E: sylvestre@debian.org
W: http://sylvesre.ledru.info/
D: Debian and Ubuntu packaging
D: Continous integration with jenkins
N: Andrew Lenharth
E: alenhar2@cs.uiuc.edu
W: http://www.lenharth.org/~andrewl/
@ -423,6 +429,7 @@ D: Thread Local Storage implementation
N: Bill Wendling
E: wendling@apple.com
D: Release manager
D: Bunches of stuff
N: Bob Wilson

View File

@ -302,6 +302,9 @@ ENABLE_DOXYGEN = @ENABLE_DOXYGEN@
# Do we want to enable threads?
ENABLE_THREADS := @LLVM_ENABLE_THREADS@
# Do we want to enable zlib?
ENABLE_ZLIB := @LLVM_ENABLE_ZLIB@
# Do we want to build with position independent code?
ENABLE_PIC := @ENABLE_PIC@

View File

@ -1515,6 +1515,8 @@ $(ToolBuildPath): $(ToolDir)/.dir
endif
ifdef CODESIGN_TOOLS
TOOL_CODESIGN_IDENTITY ?= -
$(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
$(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
$(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \
@ -1522,7 +1524,7 @@ $(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
$(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) \
$(StripWarnMsg)
$(Echo) ======= Code-Signing $(BuildMode) Executable $(TOOLNAME)
$(Verb) codesign -s - $@
$(Verb) codesign -s $(TOOL_CODESIGN_IDENTITY) $@
else
$(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths)
$(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg)
@ -1967,7 +1969,7 @@ endif
# CHECK: Running the test suite
###############################################################################
check::
check:: all
$(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
$(EchoCmd) Running test suite ; \

View File

@ -15,3 +15,4 @@ documentation setup.
If you're writing a package for LLVM, see docs/Packaging.rst for our
suggestions.

View File

@ -31,7 +31,7 @@ dnl===
dnl===-----------------------------------------------------------------------===
dnl Initialize autoconf and define the package name, version number and
dnl address for reporting bugs.
AC_INIT([LLVM],[3.3svn],[http://llvm.org/bugs/])
AC_INIT([LLVM],[3.3],[http://llvm.org/bugs/])
AC_DEFINE([LLVM_VERSION_MAJOR], [3], [Major version of the LLVM API])
AC_DEFINE([LLVM_VERSION_MINOR], [3], [Minor version of the LLVM API])
@ -402,6 +402,7 @@ AC_CACHE_CHECK([target architecture],[llvm_cv_target_arch],
hexagon-*) llvm_cv_target_arch="Hexagon" ;;
mblaze-*) llvm_cv_target_arch="MBlaze" ;;
nvptx-*) llvm_cv_target_arch="NVPTX" ;;
s390x-*) llvm_cv_target_arch="SystemZ" ;;
*) llvm_cv_target_arch="Unknown" ;;
esac])
@ -435,6 +436,7 @@ case $host in
msp430-*) host_arch="MSP430" ;;
hexagon-*) host_arch="Hexagon" ;;
mblaze-*) host_arch="MBlaze" ;;
s390x-*) host_arch="SystemZ" ;;
*) host_arch="Unknown" ;;
esac
@ -654,6 +656,7 @@ else
Hexagon) AC_SUBST(TARGET_HAS_JIT,0) ;;
MBlaze) AC_SUBST(TARGET_HAS_JIT,0) ;;
NVPTX) AC_SUBST(TARGET_HAS_JIT,0) ;;
SystemZ) AC_SUBST(TARGET_HAS_JIT,1) ;;
*) AC_SUBST(TARGET_HAS_JIT,0) ;;
esac
fi
@ -708,6 +711,21 @@ case "$enableval" in
*) AC_MSG_ERROR([Invalid setting for --enable-pthreads. Use "yes" or "no"]) ;;
esac
dnl Allow disablement of zlib
AC_ARG_ENABLE(zlib,
AS_HELP_STRING([--enable-zlib],
[Use zlib for compression/decompression if
available (default is YES)]),,
enableval=default)
case "$enableval" in
yes) AC_SUBST(LLVM_ENABLE_ZLIB,[1]) ;;
no) AC_SUBST(LLVM_ENABLE_ZLIB,[0]) ;;
default) AC_SUBST(LLVM_ENABLE_ZLIB,[1]) ;;
*) AC_MSG_ERROR([Invalid setting for --enable-zlib. Use "yes" or "no"]) ;;
esac
AC_DEFINE_UNQUOTED([LLVM_ENABLE_ZLIB],$LLVM_ENABLE_ZLIB,
[Define if zlib is enabled])
dnl Allow building without position independent code
AC_ARG_ENABLE(pic,
AS_HELP_STRING([--enable-pic],
@ -780,13 +798,13 @@ TARGETS_TO_BUILD=""
AC_ARG_ENABLE([targets],AS_HELP_STRING([--enable-targets],
[Build specific host targets: all or target1,target2,... Valid targets are:
host, x86, x86_64, sparc, powerpc, arm, aarch64, mips, hexagon,
xcore, msp430, nvptx, and cpp (default=all)]),,
xcore, msp430, nvptx, systemz, and cpp (default=all)]),,
enableval=all)
if test "$enableval" = host-only ; then
enableval=host
fi
case "$enableval" in
all) TARGETS_TO_BUILD="X86 Sparc PowerPC AArch64 ARM Mips XCore MSP430 CppBackend MBlaze NVPTX Hexagon" ;;
all) TARGETS_TO_BUILD="X86 Sparc PowerPC AArch64 ARM Mips XCore MSP430 CppBackend MBlaze NVPTX Hexagon SystemZ" ;;
*)for a_target in `echo $enableval|sed -e 's/,/ /g' ` ; do
case "$a_target" in
x86) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
@ -805,11 +823,13 @@ case "$enableval" in
hexagon) TARGETS_TO_BUILD="Hexagon $TARGETS_TO_BUILD" ;;
mblaze) TARGETS_TO_BUILD="MBlaze $TARGETS_TO_BUILD" ;;
nvptx) TARGETS_TO_BUILD="NVPTX $TARGETS_TO_BUILD" ;;
systemz) TARGETS_TO_BUILD="SystemZ $TARGETS_TO_BUILD" ;;
host) case "$llvm_cv_target_arch" in
x86) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
x86_64) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
Sparc) TARGETS_TO_BUILD="Sparc $TARGETS_TO_BUILD" ;;
PowerPC) TARGETS_TO_BUILD="PowerPC $TARGETS_TO_BUILD" ;;
AArch64) TARGETS_TO_BUILD="AArch64 $TARGETS_TO_BUILD" ;;
ARM) TARGETS_TO_BUILD="ARM $TARGETS_TO_BUILD" ;;
Mips) TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;;
MBlaze) TARGETS_TO_BUILD="MBlaze $TARGETS_TO_BUILD" ;;
@ -817,6 +837,7 @@ case "$enableval" in
MSP430) TARGETS_TO_BUILD="MSP430 $TARGETS_TO_BUILD" ;;
Hexagon) TARGETS_TO_BUILD="Hexagon $TARGETS_TO_BUILD" ;;
NVPTX) TARGETS_TO_BUILD="NVPTX $TARGETS_TO_BUILD" ;;
SystemZ) TARGETS_TO_BUILD="SystemZ $TARGETS_TO_BUILD" ;;
*) AC_MSG_ERROR([Can not set target to build]) ;;
esac ;;
*) AC_MSG_ERROR([Unrecognized target $a_target]) ;;
@ -1367,6 +1388,11 @@ if test "$LLVM_ENABLE_THREADS" -eq 1 && test "$ENABLE_PTHREADS" -eq 1 ; then
[Have pthread_getspecific]))
fi
dnl zlib is optional; used for compression/uncompression
if test "$LLVM_ENABLE_ZLIB" -eq 1 ; then
AC_CHECK_LIB(z, compress2)
fi
dnl Allow extra x86-disassembler library
AC_ARG_WITH(udis86,
AS_HELP_STRING([--with-udis86=<path>],
@ -1486,6 +1512,9 @@ AC_HEADER_STAT
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
AC_LANG_PUSH([C++])
AC_CHECK_HEADERS([cxxabi.h])
AC_LANG_POP([C++])
AC_CHECK_HEADERS([dlfcn.h execinfo.h fcntl.h inttypes.h limits.h link.h])
AC_CHECK_HEADERS([malloc.h setjmp.h signal.h stdint.h termios.h unistd.h])
AC_CHECK_HEADERS([utime.h windows.h])
@ -1501,6 +1530,13 @@ if test "$LLVM_ENABLE_THREADS" -eq 1 && test "$ENABLE_PTHREADS" -eq 1 ; then
else
AC_SUBST(HAVE_PTHREAD, 0)
fi
if test "$LLVM_ENABLE_ZLIB" -eq 1 ; then
AC_CHECK_HEADERS(zlib.h,
AC_SUBST(HAVE_LIBZ, 1),
AC_SUBST(HAVE_LIBZ, 0))
else
AC_SUBST(HAVE_LIBZ, 0)
fi
dnl Try to find ffi.h.
if test "$llvm_cv_enable_libffi" = "yes" ; then
@ -1746,7 +1782,7 @@ AC_DEFINE_UNQUOTED(LLVM_MANDIR, "$LLVM_MANDIR",
[Installation directory for man pages])
AC_DEFINE_UNQUOTED(LLVM_CONFIGTIME, "$LLVM_CONFIGTIME",
[Time at which LLVM was configured])
AC_DEFINE_UNQUOTED(LLVM_HOSTTRIPLE, "$host",
AC_DEFINE_UNQUOTED(LLVM_HOST_TRIPLE, "$host",
[Host triple LLVM will be executed on])
AC_DEFINE_UNQUOTED(LLVM_DEFAULT_TARGET_TRIPLE, "$target",
[Target triple LLVM will generate code for by default])

View File

@ -4,6 +4,7 @@ if( WIN32 AND NOT CYGWIN )
endif()
include(CheckIncludeFile)
include(CheckIncludeFileCXX)
include(CheckLibraryExists)
include(CheckSymbolExists)
include(CheckFunctionExists)
@ -37,6 +38,7 @@ endfunction()
check_include_file(argz.h HAVE_ARGZ_H)
check_include_file(assert.h HAVE_ASSERT_H)
check_include_file(ctype.h HAVE_CTYPE_H)
check_include_file_cxx(cxxabi.h HAVE_CXXABI_H)
check_include_file(dirent.h HAVE_DIRENT_H)
check_include_file(dl.h HAVE_DL_H)
check_include_file(dld.h HAVE_DLD_H)
@ -79,6 +81,7 @@ check_include_file(unistd.h HAVE_UNISTD_H)
check_include_file(utime.h HAVE_UTIME_H)
check_include_file(valgrind/valgrind.h HAVE_VALGRIND_VALGRIND_H)
check_include_file(windows.h HAVE_WINDOWS_H)
check_include_file(zlib.h HAVE_ZLIB_H)
check_include_file(fenv.h HAVE_FENV_H)
check_symbol_exists(FE_ALL_EXCEPT "fenv.h" HAVE_DECL_FE_ALL_EXCEPT)
check_symbol_exists(FE_INEXACT "fenv.h" HAVE_DECL_FE_INEXACT)
@ -104,6 +107,11 @@ if( NOT PURE_WINDOWS )
endif()
check_library_exists(dl dlopen "" HAVE_LIBDL)
check_library_exists(rt clock_gettime "" HAVE_LIBRT)
if (LLVM_ENABLE_ZLIB)
check_library_exists(z compress2 "" HAVE_LIBZ)
else()
set(HAVE_LIBZ 0)
endif()
endif()
# function checks
@ -332,12 +340,13 @@ if (CMAKE_COMPILER_IS_GNUCXX)
endif()
endif()
include(GetHostTriple)
get_host_triple(LLVM_HOST_TRIPLE)
# By default, we target the host, but this can be overridden at CMake
# invocation time.
set(LLVM_HOSTTRIPLE "${LLVM_HOST_TRIPLE}")
include(GetHostTriple)
get_host_triple(LLVM_INFERRED_HOST_TRIPLE)
set(LLVM_HOST_TRIPLE "${LLVM_INFERRED_HOST_TRIPLE}" CACHE STRING
"Host on which LLVM binaries will run")
# Determine the native architecture.
string(TOLOWER "${LLVM_TARGET_ARCH}" LLVM_NATIVE_ARCH)
@ -357,6 +366,8 @@ elseif (LLVM_NATIVE_ARCH MATCHES "sparc")
set(LLVM_NATIVE_ARCH Sparc)
elseif (LLVM_NATIVE_ARCH MATCHES "powerpc")
set(LLVM_NATIVE_ARCH PowerPC)
elseif (LLVM_NATIVE_ARCH MATCHES "aarch64")
set(LLVM_NATIVE_ARCH AArch64)
elseif (LLVM_NATIVE_ARCH MATCHES "arm")
set(LLVM_NATIVE_ARCH ARM)
elseif (LLVM_NATIVE_ARCH MATCHES "mips")
@ -367,6 +378,8 @@ elseif (LLVM_NATIVE_ARCH MATCHES "msp430")
set(LLVM_NATIVE_ARCH MSP430)
elseif (LLVM_NATIVE_ARCH MATCHES "hexagon")
set(LLVM_NATIVE_ARCH Hexagon)
elseif (LLVM_NATIVE_ARCH MATCHES "s390x")
set(LLVM_NATIVE_ARCH SystemZ)
else ()
message(FATAL_ERROR "Unknown architecture ${LLVM_NATIVE_ARCH}")
endif ()
@ -450,4 +463,11 @@ else( LLVM_ENABLE_THREADS )
message(STATUS "Threads disabled.")
endif()
if (LLVM_ENABLE_ZLIB )
# Check if zlib is available in the system.
if ( NOT HAVE_ZLIB_H OR NOT HAVE_LIBZ )
set(LLVM_ENABLE_ZLIB 0)
endif()
endif()
set(LLVM_PREFIX ${CMAKE_INSTALL_PREFIX})

View File

@ -21,6 +21,9 @@ if( LLVM_ENABLE_ASSERTIONS )
# explicitly undefine it:
if( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )
add_definitions( -UNDEBUG )
# Also remove /D NDEBUG to avoid MSVC warnings about conflicting defines.
string (REGEX REPLACE "(^| )[/-]D *NDEBUG($| )" " "
CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
endif()
else()
if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )
@ -249,8 +252,6 @@ if(LLVM_USE_SANITIZER)
elseif (LLVM_USE_SANITIZER MATCHES "Memory(WithOrigins)?")
append_common_sanitizer_flags()
add_flag_or_print_warning("-fsanitize=memory")
# -pie is required for MSan.
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
if(LLVM_USE_SANITIZER STREQUAL "MemoryWithOrigins")
add_flag_or_print_warning("-fsanitize-memory-track-origins")
endif()

View File

@ -13,6 +13,9 @@ function(get_system_libs return_var)
if( LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD )
set(system_libs ${system_libs} pthread)
endif()
if ( LLVM_ENABLE_ZLIB AND HAVE_LIBZ )
set(system_libs ${system_libs} z)
endif()
endif( MINGW )
endif( NOT MSVC )
set(${return_var} ${system_libs} PARENT_SCOPE)

View File

@ -22,12 +22,15 @@ set(LLVM_TOOLS_BINARY_DIR @LLVM_TOOLS_BINARY_DIR@)
set(LLVM_ENABLE_THREADS @LLVM_ENABLE_THREADS@)
set(LLVM_ENABLE_ZLIB @LLVM_ENABLE_ZLIB@)
set(LLVM_NATIVE_ARCH @LLVM_NATIVE_ARCH@)
set(LLVM_ENABLE_PIC @LLVM_ENABLE_PIC@)
set(HAVE_LIBDL @HAVE_LIBDL@)
set(HAVE_LIBPTHREAD @HAVE_LIBPTHREAD@)
set(HAVE_LIBZ @HAVE_LIBZ@)
set(LLVM_ON_UNIX @LLVM_ON_UNIX@)
set(LLVM_ON_WIN32 @LLVM_ON_WIN32@)

781
configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.60 for LLVM 3.3svn.
# Generated by GNU Autoconf 2.60 for LLVM 3.3.
#
# Report bugs to <http://llvm.org/bugs/>.
#
@ -561,8 +561,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='LLVM'
PACKAGE_TARNAME='llvm'
PACKAGE_VERSION='3.3svn'
PACKAGE_STRING='LLVM 3.3svn'
PACKAGE_VERSION='3.3'
PACKAGE_STRING='LLVM 3.3'
PACKAGE_BUGREPORT='http://llvm.org/bugs/'
ac_unique_file="lib/IR/Module.cpp"
@ -703,6 +703,7 @@ ENABLE_DOCS
ENABLE_DOXYGEN
LLVM_ENABLE_THREADS
ENABLE_PTHREADS
LLVM_ENABLE_ZLIB
ENABLE_PIC
ENABLE_SHARED
ENABLE_EMBED_STDCXX
@ -776,7 +777,9 @@ USE_INTEL_JITEVENTS
XML2CONFIG
LIBXML2_LIBS
LIBXML2_INC
CXXCPP
HAVE_PTHREAD
HAVE_LIBZ
HUGE_VAL_SANITY
MMAP_FILE
SHLIBEXT
@ -811,7 +814,8 @@ CPPFLAGS
CXX
CXXFLAGS
CCC
CPP'
CPP
CXXCPP'
ac_subdirs_all='projects/llvm-gcc
projects/test-suite
projects/llvm-test
@ -1327,7 +1331,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures LLVM 3.3svn to adapt to many kinds of systems.
\`configure' configures LLVM 3.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1393,7 +1397,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of LLVM 3.3svn:";;
short | recursive ) echo "Configuration of LLVM 3.3:";;
esac
cat <<\_ACEOF
@ -1426,6 +1430,8 @@ Optional Features:
--enable-doxygen Build doxygen documentation (default is NO)
--enable-threads Use threads if available (default is YES)
--enable-pthreads Use pthreads if available (default is YES)
--enable-zlib Use zlib for compression/decompression if available
(default is YES)
--enable-pic Build LLVM with Position Independent Code (default
is YES)
--enable-shared Build a shared library and link tools against it
@ -1439,7 +1445,7 @@ Optional Features:
--enable-targets Build specific host targets: all or
target1,target2,... Valid targets are: host, x86,
x86_64, sparc, powerpc, arm, aarch64, mips, hexagon,
xcore, msp430, nvptx, and cpp (default=all)
xcore, msp430, nvptx, systemz, and cpp (default=all)
--enable-experimental-targets
Build experimental host targets: disable or
target1,target2,... (default=disable)
@ -1487,6 +1493,7 @@ Some influential environment variables:
CXX C++ compiler command
CXXFLAGS C++ compiler flags
CPP C preprocessor
CXXCPP C++ preprocessor
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
@ -1552,7 +1559,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
LLVM configure 3.3svn
LLVM configure 3.3
generated by GNU Autoconf 2.60
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@ -1568,7 +1575,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by LLVM $as_me 3.3svn, which was
It was created by LLVM $as_me 3.3, which was
generated by GNU Autoconf 2.60. Invocation command line was
$ $0 $@
@ -4019,6 +4026,7 @@ else
hexagon-*) llvm_cv_target_arch="Hexagon" ;;
mblaze-*) llvm_cv_target_arch="MBlaze" ;;
nvptx-*) llvm_cv_target_arch="NVPTX" ;;
s390x-*) llvm_cv_target_arch="SystemZ" ;;
*) llvm_cv_target_arch="Unknown" ;;
esac
fi
@ -4052,6 +4060,7 @@ case $host in
msp430-*) host_arch="MSP430" ;;
hexagon-*) host_arch="Hexagon" ;;
mblaze-*) host_arch="MBlaze" ;;
s390x-*) host_arch="SystemZ" ;;
*) host_arch="Unknown" ;;
esac
@ -5391,6 +5400,8 @@ else
MBlaze) TARGET_HAS_JIT=0
;;
NVPTX) TARGET_HAS_JIT=0
;;
SystemZ) TARGET_HAS_JIT=1
;;
*) TARGET_HAS_JIT=0
;;
@ -5478,6 +5489,30 @@ echo "$as_me: error: Invalid setting for --enable-pthreads. Use \"yes\" or \"no\
{ (exit 1); exit 1; }; } ;;
esac
# Check whether --enable-zlib was given.
if test "${enable_zlib+set}" = set; then
enableval=$enable_zlib;
else
enableval=default
fi
case "$enableval" in
yes) LLVM_ENABLE_ZLIB=1
;;
no) LLVM_ENABLE_ZLIB=0
;;
default) LLVM_ENABLE_ZLIB=1
;;
*) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-zlib. Use \"yes\" or \"no\"" >&5
echo "$as_me: error: Invalid setting for --enable-zlib. Use \"yes\" or \"no\"" >&2;}
{ (exit 1); exit 1; }; } ;;
esac
cat >>confdefs.h <<_ACEOF
#define LLVM_ENABLE_ZLIB $LLVM_ENABLE_ZLIB
_ACEOF
# Check whether --enable-pic was given.
if test "${enable_pic+set}" = set; then
enableval=$enable_pic;
@ -5601,7 +5636,7 @@ if test "$enableval" = host-only ; then
enableval=host
fi
case "$enableval" in
all) TARGETS_TO_BUILD="X86 Sparc PowerPC AArch64 ARM Mips XCore MSP430 CppBackend MBlaze NVPTX Hexagon" ;;
all) TARGETS_TO_BUILD="X86 Sparc PowerPC AArch64 ARM Mips XCore MSP430 CppBackend MBlaze NVPTX Hexagon SystemZ" ;;
*)for a_target in `echo $enableval|sed -e 's/,/ /g' ` ; do
case "$a_target" in
x86) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
@ -5620,11 +5655,13 @@ case "$enableval" in
hexagon) TARGETS_TO_BUILD="Hexagon $TARGETS_TO_BUILD" ;;
mblaze) TARGETS_TO_BUILD="MBlaze $TARGETS_TO_BUILD" ;;
nvptx) TARGETS_TO_BUILD="NVPTX $TARGETS_TO_BUILD" ;;
systemz) TARGETS_TO_BUILD="SystemZ $TARGETS_TO_BUILD" ;;
host) case "$llvm_cv_target_arch" in
x86) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
x86_64) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
Sparc) TARGETS_TO_BUILD="Sparc $TARGETS_TO_BUILD" ;;
PowerPC) TARGETS_TO_BUILD="PowerPC $TARGETS_TO_BUILD" ;;
AArch64) TARGETS_TO_BUILD="AArch64 $TARGETS_TO_BUILD" ;;
ARM) TARGETS_TO_BUILD="ARM $TARGETS_TO_BUILD" ;;
Mips) TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;;
MBlaze) TARGETS_TO_BUILD="MBlaze $TARGETS_TO_BUILD" ;;
@ -5632,6 +5669,7 @@ case "$enableval" in
MSP430) TARGETS_TO_BUILD="MSP430 $TARGETS_TO_BUILD" ;;
Hexagon) TARGETS_TO_BUILD="Hexagon $TARGETS_TO_BUILD" ;;
NVPTX) TARGETS_TO_BUILD="NVPTX $TARGETS_TO_BUILD" ;;
SystemZ) TARGETS_TO_BUILD="SystemZ $TARGETS_TO_BUILD" ;;
*) { { echo "$as_me:$LINENO: error: Can not set target to build" >&5
echo "$as_me: error: Can not set target to build" >&2;}
{ (exit 1); exit 1; }; } ;;
@ -10497,7 +10535,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 10500 "configure"
#line 10538 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -13440,6 +13478,96 @@ fi
fi
if test "$LLVM_ENABLE_ZLIB" -eq 1 ; then
{ echo "$as_me:$LINENO: checking for compress2 in -lz" >&5
echo $ECHO_N "checking for compress2 in -lz... $ECHO_C" >&6; }
if test "${ac_cv_lib_z_compress2+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lz $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char compress2 ();
int
main ()
{
return compress2 ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest$ac_exeext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_z_compress2=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_z_compress2=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_z_compress2" >&5
echo "${ECHO_T}$ac_cv_lib_z_compress2" >&6; }
if test $ac_cv_lib_z_compress2 = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBZ 1
_ACEOF
LIBS="-lz $LIBS"
fi
fi
# Check whether --with-udis86 was given.
if test "${with_udis86+set}" = set; then
@ -14743,6 +14871,442 @@ _ACEOF
fi
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; }
if test -z "$CXXCPP"; then
if test "${ac_cv_prog_CXXCPP+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
# Double quotes because CXXCPP needs to be expanded
for CXXCPP in "$CXX -E" "/lib/cpp"
do
ac_preproc_ok=false
for ac_cxx_preproc_warn_flag in '' yes
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
# Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
# <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
Syntax error
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_cxx_preproc_warn_flag
ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
else
ac_cpp_err=
fi
else
ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
:
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
# Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_cxx_preproc_warn_flag
ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
else
ac_cpp_err=
fi
else
ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
# Broken: success on invalid input.
continue
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
# Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then
break
fi
done
ac_cv_prog_CXXCPP=$CXXCPP
fi
CXXCPP=$ac_cv_prog_CXXCPP
else
ac_cv_prog_CXXCPP=$CXXCPP
fi
{ echo "$as_me:$LINENO: result: $CXXCPP" >&5
echo "${ECHO_T}$CXXCPP" >&6; }
ac_preproc_ok=false
for ac_cxx_preproc_warn_flag in '' yes
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
# Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
# <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
Syntax error
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_cxx_preproc_warn_flag
ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
else
ac_cpp_err=
fi
else
ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
:
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
# Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_cxx_preproc_warn_flag
ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
else
ac_cpp_err=
fi
else
ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
# Broken: success on invalid input.
continue
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
# Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then
:
else
{ { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
See \`config.log' for more details." >&5
echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
fi
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
for ac_header in cxxabi.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
{ echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
ac_res=`eval echo '${'$as_ac_Header'}'`
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
else
# Is the header compilable?
{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <$ac_header>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_cxx_preproc_warn_flag
ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
else
ac_cpp_err=
fi
else
ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
yes:no: )
{ echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ------------------------------------ ##
## Report this to http://llvm.org/bugs/ ##
## ------------------------------------ ##
_ASBOX
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
{ echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
eval "$as_ac_Header=\$ac_header_preproc"
fi
ac_res=`eval echo '${'$as_ac_Header'}'`
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
done
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
@ -16293,6 +16857,184 @@ done
else
HAVE_PTHREAD=0
fi
if test "$LLVM_ENABLE_ZLIB" -eq 1 ; then
for ac_header in zlib.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
{ echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
ac_res=`eval echo '${'$as_ac_Header'}'`
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
else
# Is the header compilable?
{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <$ac_header>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
else
ac_cpp_err=
fi
else
ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
( cat <<\_ASBOX
## ------------------------------------ ##
## Report this to http://llvm.org/bugs/ ##
## ------------------------------------ ##
_ASBOX
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
{ echo "$as_me:$LINENO: checking for $ac_header" >&5
echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
eval "$as_ac_Header=\$ac_header_preproc"
fi
ac_res=`eval echo '${'$as_ac_Header'}'`
{ echo "$as_me:$LINENO: result: $ac_res" >&5
echo "${ECHO_T}$ac_res" >&6; }
fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
HAVE_LIBZ=1
else
HAVE_LIBZ=0
fi
done
else
HAVE_LIBZ=0
fi
if test "$llvm_cv_enable_libffi" = "yes" ; then
@ -21639,7 +22381,7 @@ _ACEOF
cat >>confdefs.h <<_ACEOF
#define LLVM_HOSTTRIPLE "$host"
#define LLVM_HOST_TRIPLE "$host"
_ACEOF
@ -22294,7 +23036,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by LLVM $as_me 3.3svn, which was
This file was extended by LLVM $as_me 3.3, which was
generated by GNU Autoconf 2.60. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -22347,7 +23089,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
LLVM config.status 3.3svn
LLVM config.status 3.3
configured by $0, generated by GNU Autoconf 2.60,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
@ -22691,6 +23433,7 @@ ENABLE_DOCS!$ENABLE_DOCS$ac_delim
ENABLE_DOXYGEN!$ENABLE_DOXYGEN$ac_delim
LLVM_ENABLE_THREADS!$LLVM_ENABLE_THREADS$ac_delim
ENABLE_PTHREADS!$ENABLE_PTHREADS$ac_delim
LLVM_ENABLE_ZLIB!$LLVM_ENABLE_ZLIB$ac_delim
ENABLE_PIC!$ENABLE_PIC$ac_delim
ENABLE_SHARED!$ENABLE_SHARED$ac_delim
ENABLE_EMBED_STDCXX!$ENABLE_EMBED_STDCXX$ac_delim
@ -22764,7 +23507,9 @@ USE_INTEL_JITEVENTS!$USE_INTEL_JITEVENTS$ac_delim
XML2CONFIG!$XML2CONFIG$ac_delim
LIBXML2_LIBS!$LIBXML2_LIBS$ac_delim
LIBXML2_INC!$LIBXML2_INC$ac_delim
CXXCPP!$CXXCPP$ac_delim
HAVE_PTHREAD!$HAVE_PTHREAD$ac_delim
HAVE_LIBZ!$HAVE_LIBZ$ac_delim
HUGE_VAL_SANITY!$HUGE_VAL_SANITY$ac_delim
MMAP_FILE!$MMAP_FILE$ac_delim
SHLIBEXT!$SHLIBEXT$ac_delim
@ -22781,9 +23526,6 @@ LLVM_MANDIR!$LLVM_MANDIR$ac_delim
LLVM_CONFIGTIME!$LLVM_CONFIGTIME$ac_delim
BINDINGS_TO_BUILD!$BINDINGS_TO_BUILD$ac_delim
ALL_BINDINGS!$ALL_BINDINGS$ac_delim
OCAML_LIBDIR!$OCAML_LIBDIR$ac_delim
ENABLE_VISIBILITY_INLINES_HIDDEN!$ENABLE_VISIBILITY_INLINES_HIDDEN$ac_delim
RPATH!$RPATH$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@ -22825,13 +23567,16 @@ _ACEOF
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
OCAML_LIBDIR!$OCAML_LIBDIR$ac_delim
ENABLE_VISIBILITY_INLINES_HIDDEN!$ENABLE_VISIBILITY_INLINES_HIDDEN$ac_delim
RPATH!$RPATH$ac_delim
RDYNAMIC!$RDYNAMIC$ac_delim
program_prefix!$program_prefix$ac_delim
LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 4; then
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 7; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5

View File

@ -168,8 +168,8 @@ LLVM-specific variables
**LLVM_TARGETS_TO_BUILD**:STRING
Semicolon-separated list of targets to build, or *all* for building all
targets. Case-sensitive. For Visual C++ defaults to *X86*. On the other cases
defaults to *all*. Example: ``-DLLVM_TARGETS_TO_BUILD="X86;PowerPC"``.
targets. Case-sensitive. Defaults to *all*. Example:
``-DLLVM_TARGETS_TO_BUILD="X86;PowerPC"``.
**LLVM_BUILD_TOOLS**:BOOL
Build LLVM tools. Defaults to ON. Targets for building each tool are generated
@ -271,6 +271,10 @@ LLVM-specific variables
**LLVM_USE_INTEL_JITEVENTS**:BOOL
Enable building support for Intel JIT Events API. Defaults to OFF
**LLVM_ENABLE_ZLIB**:BOOL
Build with zlib to support compression/uncompression in LLVM tools.
Defaults to ON.
Executing the test suite
========================

View File

@ -1794,6 +1794,7 @@ Here is the table:
:raw-html:`<th>NVPTX</th>`
:raw-html:`<th>PowerPC</th>`
:raw-html:`<th>Sparc</th>`
:raw-html:`<th>SystemZ</th>`
:raw-html:`<th>X86</th>`
:raw-html:`<th>XCore</th>`
:raw-html:`</tr>`
@ -1808,8 +1809,9 @@ Here is the table:
:raw-html:`<td class="yes"></td> <!-- NVPTX -->`
:raw-html:`<td class="yes"></td> <!-- PowerPC -->`
:raw-html:`<td class="yes"></td> <!-- Sparc -->`
:raw-html:`<td class="yes"></td> <!-- SystemZ -->`
:raw-html:`<td class="yes"></td> <!-- X86 -->`
:raw-html:`<td class="unknown"></td> <!-- XCore -->`
:raw-html:`<td class="yes"></td> <!-- XCore -->`
:raw-html:`</tr>`
:raw-html:`<tr>`
@ -1822,6 +1824,7 @@ Here is the table:
:raw-html:`<td class="no"></td> <!-- NVPTX -->`
:raw-html:`<td class="no"></td> <!-- PowerPC -->`
:raw-html:`<td class="no"></td> <!-- Sparc -->`
:raw-html:`<td class="yes"></td> <!-- SystemZ -->`
:raw-html:`<td class="yes"></td> <!-- X86 -->`
:raw-html:`<td class="no"></td> <!-- XCore -->`
:raw-html:`</tr>`
@ -1835,9 +1838,10 @@ Here is the table:
:raw-html:`<td class="no"></td> <!-- Mips -->`
:raw-html:`<td class="na"></td> <!-- NVPTX -->`
:raw-html:`<td class="no"></td> <!-- PowerPC -->`
:raw-html:`<td class="no"></td> <!-- SystemZ -->`
:raw-html:`<td class="no"></td> <!-- Sparc -->`
:raw-html:`<td class="yes"></td> <!-- X86 -->`
:raw-html:`<td class="no"></td> <!-- XCore -->`
:raw-html:`<td class="yes"></td> <!-- XCore -->`
:raw-html:`</tr>`
:raw-html:`<tr>`
@ -1850,8 +1854,9 @@ Here is the table:
:raw-html:`<td class="yes"></td> <!-- NVPTX -->`
:raw-html:`<td class="yes"></td> <!-- PowerPC -->`
:raw-html:`<td class="unknown"></td> <!-- Sparc -->`
:raw-html:`<td class="yes"></td> <!-- SystemZ -->`
:raw-html:`<td class="yes"></td> <!-- X86 -->`
:raw-html:`<td class="unknown"></td> <!-- XCore -->`
:raw-html:`<td class="yes"></td> <!-- XCore -->`
:raw-html:`</tr>`
:raw-html:`<tr>`
@ -1864,8 +1869,9 @@ Here is the table:
:raw-html:`<td class="na"></td> <!-- NVPTX -->`
:raw-html:`<td class="yes"></td> <!-- PowerPC -->`
:raw-html:`<td class="unknown"></td> <!-- Sparc -->`
:raw-html:`<td class="yes"></td> <!-- SystemZ -->`
:raw-html:`<td class="yes"></td> <!-- X86 -->`
:raw-html:`<td class="unknown"></td> <!-- XCore -->`
:raw-html:`<td class="no"></td> <!-- XCore -->`
:raw-html:`</tr>`
:raw-html:`<tr>`
@ -1878,6 +1884,7 @@ Here is the table:
:raw-html:`<td class="na"></td> <!-- NVPTX -->`
:raw-html:`<td class="no"></td> <!-- PowerPC -->`
:raw-html:`<td class="no"></td> <!-- Sparc -->`
:raw-html:`<td class="yes"></td> <!-- SystemZ -->`
:raw-html:`<td class="yes"></td> <!-- X86 -->`
:raw-html:`<td class="no"></td> <!-- XCore -->`
:raw-html:`</tr>`
@ -1892,8 +1899,9 @@ Here is the table:
:raw-html:`<td class="no"></td> <!-- NVPTX -->`
:raw-html:`<td class="yes"></td> <!-- PowerPC -->`
:raw-html:`<td class="unknown"></td> <!-- Sparc -->`
:raw-html:`<td class="no"></td> <!-- SystemZ -->`
:raw-html:`<td class="yes"></td> <!-- X86 -->`
:raw-html:`<td class="unknown"></td> <!-- XCore -->`
:raw-html:`<td class="no"></td> <!-- XCore -->`
:raw-html:`</tr>`
:raw-html:`<tr>`
@ -1906,6 +1914,7 @@ Here is the table:
:raw-html:`<td class="no"></td> <!-- NVPTX -->`
:raw-html:`<td class="no"></td> <!-- PowerPC -->`
:raw-html:`<td class="no"></td> <!-- Sparc -->`
:raw-html:`<td class="no"></td> <!-- SystemZ -->`
:raw-html:`<td class="partial"><a href="#feat_segstacks_x86">*</a></td> <!-- X86 -->`
:raw-html:`<td class="no"></td> <!-- XCore -->`
:raw-html:`</tr>`

View File

@ -50,3 +50,4 @@ Developer Tools
tblgen
lit
llvm-build
llvm-readobj

View File

@ -69,6 +69,14 @@ End-user Options
llvm-as < /dev/null | llc -march=xyz -mcpu=help
.. option:: -filetype=<output file type>
Specify what kind of output ``llc`` should generated. Options are: ``asm``
for textual assembly ( ``'.s'``), ``obj`` for native object files (``'.o'``)
and ``null`` for not emitting anything (for performance testing).
Note that not all targets support all options.
.. option:: -mattr=a1,+a2,-a3,...
Override or control specific attributes of the target, such as whether SIMD

View File

@ -0,0 +1,86 @@
llvm-readobj - LLVM Object Reader
=================================
SYNOPSIS
--------
:program:`llvm-readobj` [*options*] [*input...*]
DESCRIPTION
-----------
The :program:`llvm-readobj` tool displays low-level format-specific information
about one or more object files. The tool and its output is primarily designed
for use in FileCheck-based tests.
OPTIONS
-------
If ``input`` is "``-``" or omitted, :program:`llvm-readobj` reads from standard
input. Otherwise, it will read from the specified ``filenames``.
.. option:: -help
Print a summary of command line options.
.. option:: -version
Display the version of this program
.. option:: -file-headers, -h
Display file headers.
.. option:: -sections, -s
Display all sections.
.. option:: -section-data, -sd
When used with ``-sections``, display section data for each section shown.
.. option:: -section-relocations, -sr
When used with ``-sections``, display relocations for each section shown.
.. option:: -section-symbols, -st
When used with ``-sections``, display symbols for each section shown.
.. option:: -relocations, -r
Display the relocation entries in the file.
.. option:: -symbols, -t
Display the symbol table.
.. option:: -dyn-symbols
Display the dynamic symbol table (only for ELF object files).
.. option:: -unwind, -u
Display unwind information.
.. option:: -expand-relocs
When used with ``-relocations``, display each relocation in an expanded
multi-line format.
.. option:: -dynamic-table
Display the ELF .dynamic section table (only for ELF object files).
.. option:: -needed-libs
Display the needed libraries (only for ELF object files).
.. option:: -program-headers
Display the ELF program headers (only for ELF object files).
EXIT STATUS
-----------
:program:`llvm-readobj` returns 0.

View File

@ -23,6 +23,8 @@ file to read as input.
OPTIONS
-------
.. program:: tblgen
.. option:: -help
Print a summary of command line options.
@ -56,7 +58,7 @@ OPTIONS
.. option:: -print-enums
Print enumeration values for a class
Print enumeration values for a class.
.. option:: -print-sets

View File

@ -2,6 +2,9 @@
CommandLine 2.0 Library Manual
==============================
.. contents::
:local:
Introduction
============
@ -615,6 +618,55 @@ would yield the help output:
-help - display available options (-help-hidden for more)
-o <filename> - Specify output filename
.. _grouping options into categories:
Grouping options into categories
--------------------------------
If our program has a large number of options it may become difficult for users
of our tool to navigate the output of ``-help``. To alleviate this problem we
can put our options into categories. This can be done by declaring option
categories (`cl::OptionCategory`_ objects) and then placing our options into
these categories using the `cl::cat`_ option attribute. For example:
.. code-block:: c++
cl::OptionCategory StageSelectionCat("Stage Selection Options",
"These control which stages are run.");
cl::opt<bool> Preprocessor("E",cl::desc("Run preprocessor stage."),
cl::cat(StageSelectionCat));
cl::opt<bool> NoLink("c",cl::desc("Run all stages except linking."),
cl::cat(StageSelectionCat));
The output of ``-help`` will become categorized if an option category is
declared. The output looks something like ::
OVERVIEW: This is a small program to demo the LLVM CommandLine API
USAGE: Sample [options]
OPTIONS:
General options:
-help - Display available options (-help-hidden for more)
-help-list - Display list of available options (-help-list-hidden for more)
Stage Selection Options:
These control which stages are run.
-E - Run preprocessor stage.
-c - Run all stages except linking.
In addition to the behaviour of ``-help`` changing when an option category is
declared, the command line option ``-help-list`` becomes visible which will
print the command line options as uncategorized list.
Note that Options that are not explicitly categorized will be placed in the
``cl::GeneralCategory`` category.
.. _Reference Guide:
Reference Guide
@ -943,6 +995,11 @@ This section describes the basic attributes that you can specify on options.
of the usual modifiers on multi-valued options (besides
``cl::ValueDisallowed``, obviously).
.. _cl::cat:
* The **cl::cat** attribute specifies the option category that the option
belongs to. The category should be a `cl::OptionCategory`_ object.
Option Modifiers
----------------
@ -1212,6 +1269,57 @@ only consists of one function `cl::ParseCommandLineOptions`_) and three main
classes: `cl::opt`_, `cl::list`_, and `cl::alias`_. This section describes
these three classes in detail.
.. _cl::getRegisteredOptions:
The ``cl::getRegisteredOptions`` function
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The ``cl::getRegisteredOptions`` function is designed to give a programmer
access to declared non positional command line options so that how they appear
in ``-help`` can be modified prior to calling `cl::ParseCommandLineOptions`_.
Note this method should not be called during any static initialisation because
it cannot be guaranteed that all options will have been initialised. Hence it
should be called from ``main``.
This function can be used to gain access to options declared in libraries that
the tool writter may not have direct access to.
The function retrieves a :ref:`StringMap <dss_stringmap>` that maps the option
string (e.g. ``-help``) to an ``Option*``.
Here is an example of how the function could be used:
.. code-block:: c++
using namespace llvm;
int main(int argc, char **argv) {
cl::OptionCategory AnotherCategory("Some options");
StringMap<cl::Option*> Map;
cl::getRegisteredOptions(Map);
//Unhide useful option and put it in a different category
assert(Map.count("print-all-options") > 0);
Map["print-all-options"]->setHiddenFlag(cl::NotHidden);
Map["print-all-options"]->setCategory(AnotherCategory);
//Hide an option we don't want to see
assert(Map.count("enable-no-infs-fp-math") > 0);
Map["enable-no-infs-fp-math"]->setHiddenFlag(cl::Hidden);
//Change --version to --show-version
assert(Map.count("version") > 0);
Map["version"]->setArgStr("show-version");
//Change --help description
assert(Map.count("help") > 0);
Map["help"]->setDescription("Shows help");
cl::ParseCommandLineOptions(argc, argv, "This is a small program to demo the LLVM CommandLine API");
...
}
.. _cl::ParseCommandLineOptions:
The ``cl::ParseCommandLineOptions`` function
@ -1382,6 +1490,29 @@ For example:
cl::extrahelp("\nADDITIONAL HELP:\n\n This is the extra help\n");
.. _cl::OptionCategory:
The ``cl::OptionCategory`` class
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The ``cl::OptionCategory`` class is a simple class for declaring
option categories.
.. code-block:: c++
namespace cl {
class OptionCategory;
}
An option category must have a name and optionally a description which are
passed to the constructor as ``const char*``.
Note that declaring an option category and associating it with an option before
parsing options (e.g. statically) will change the output of ``-help`` from
uncategorized to categorized. If an option category is declared but not
associated with an option then it will be hidden from the output of ``-help``
but will be shown in the output of ``-help-hidden``.
.. _different parser:
.. _discussed previously:

View File

@ -20,11 +20,15 @@ ARM
* `ABI <http://www.arm.com/products/DevTools/ABI.html>`_
* `ARM C Language Extensions <http://infocenter.arm.com/help/topic/com.arm.doc.ihi0053a/IHI0053A_acle.pdf>`_
AArch64
-------
* `ARMv8 Instruction Set Overview <http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.genc010197a/index.html>`_
* `ARM C Language Extensions <http://infocenter.arm.com/help/topic/com.arm.doc.ihi0053a/IHI0053A_acle.pdf>`_
Itanium (ia64)
--------------

View File

@ -260,7 +260,7 @@ quality patches. If you would like commit access, please send an email to
from, e.g. "J. Random Hacker <hacker@yoyodyne.com>".
#. A "password hash" of the password you want to use, e.g. "``2ACR96qjUqsyM``".
Note that you don't ever tell us what your password is, you just give it to
Note that you don't ever tell us what your password is; you just give it to
us in an encrypted form. To get this, run "``htpasswd``" (a utility that
comes with apache) in crypt mode (often enabled with "``-d``"), or find a web
page that will do it for you.
@ -269,17 +269,17 @@ Once you've been granted commit access, you should be able to check out an LLVM
tree with an SVN URL of "https://username@llvm.org/..." instead of the normal
anonymous URL of "http://llvm.org/...". The first time you commit you'll have
to type in your password. Note that you may get a warning from SVN about an
untrusted key, you can ignore this. To verify that your commit access works,
untrusted key; you can ignore this. To verify that your commit access works,
please do a test commit (e.g. change a comment or add a blank line). Your first
commit to a repository may require the autogenerated email to be approved by a
mailing list. This is normal, and will be done when the mailing list owner has
mailing list. This is normal and will be done when the mailing list owner has
time.
If you have recently been granted commit access, these policies apply:
#. You are granted *commit-after-approval* to all parts of LLVM. To get
approval, submit a `patch`_ to `llvm-commits
<http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits>`_. When approved
<http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits>`_. When approved,
you may commit it yourself.
#. You are allowed to commit patches without approval which you think are
@ -291,7 +291,7 @@ If you have recently been granted commit access, these policies apply:
#. You are allowed to commit patches without approval to those portions of LLVM
that you have contributed or maintain (i.e., have been assigned
responsibility for), with the proviso that such commits must not break the
build. This is a "trust but verify" policy and commits of this nature are
build. This is a "trust but verify" policy, and commits of this nature are
reviewed after they are committed.
#. Multiple violations of these policies or a single egregious violation may
@ -300,7 +300,7 @@ If you have recently been granted commit access, these policies apply:
In any case, your changes are still subject to `code review`_ (either before or
after they are committed, depending on the nature of the change). You are
encouraged to review other peoples' patches as well, but you aren't required
to.
to do so.
.. _discuss the change/gather consensus:

View File

@ -45,7 +45,7 @@ function and then be turned into an instruction if warranted.
what the restrictions are. Talk to other people about it so that you are
sure it's a good idea.
#. ``llvm/include/llvm/Intrinsics*.td``:
#. ``llvm/include/llvm/IR/Intrinsics*.td``:
Add an entry for your intrinsic. Describe its memory access characteristics
for optimization (this controls whether it will be DCE'd, CSE'd, etc). Note

39
docs/Extensions.rst Normal file
View File

@ -0,0 +1,39 @@
===============
LLVM Extensions
===============
.. contents::
:local:
:depth: 1
.. toctree::
:hidden:
Introduction
============
This document describes extensions to tools and formats LLVM seeks compatibility
with.
Machine-specific Assembly Syntax
================================
X86/COFF-Dependent
------------------
The following additional relocation type is supported:
**@IMGREL** (AT&T syntax only) generates an image-relative relocation that
corresponds to the COFF relocation types ``IMAGE_REL_I386_DIR32NB`` (32-bit) or
``IMAGE_REL_AMD64_ADDR32NB`` (64-bit).
.. code-block:: gas
.text
fun:
mov foo@IMGREL(%ebx, %ecx, 4), %eax
.section .pdata
.long fun@IMGREL
.long (fun@imgrel + 0x3F)
.long $unwind$fun@imgrel

View File

@ -229,6 +229,8 @@ uses the package and provides other details.
+--------------------------------------------------------------+-----------------+---------------------------------------------+
| `libtool <http://savannah.gnu.org/projects/libtool>`_ | 1.5.22 | Shared library manager\ :sup:`4` |
+--------------------------------------------------------------+-----------------+---------------------------------------------+
| `zlib <http://zlib.net>`_ | >=1.2.3.4 | Compression library\ :sup:`5` |
+--------------------------------------------------------------+-----------------+---------------------------------------------+
.. note::
@ -243,6 +245,8 @@ uses the package and provides other details.
#. If you want to make changes to the configure scripts, you will need GNU
autoconf (2.60), and consequently, GNU M4 (version 1.4 or higher). You
will also need automake (1.9.6). We only use aclocal from that package.
#. Optional, adds compression/uncompression capabilities to selected LLVM
tools.
Additionally, your compilation host is expected to have the usual plethora of
Unix utilities. Specifically:
@ -659,35 +663,20 @@ This leaves your working directories on their master branches, so you'll need to
``checkout`` each working branch individually and ``rebase`` it on top of its
parent branch.
For those who wish to be able to update an llvm repo in a simpler fashion,
consider placing the following Git script in your path under the name
``git-svnup``:
For those who wish to be able to update an llvm repo/revert patches easily using
git-svn, please look in the directory for the scripts ``git-svnup`` and
``git-svnrevert``.
.. code-block:: bash
To perform the aforementioned update steps go into your source directory and
just type ``git-svnup`` or ``git svnup`` and everything will just work.
#!/bin/bash
If one wishes to revert a commit with git-svn, but do not want the git hash to
escape into the commit message, one can use the script ``git-svnrevert`` or
``git svnrevert`` which will take in the git hash for the commit you want to
revert, look up the appropriate svn revision, and output a message where all
references to the git hash have been replaced with the svn revision.
STATUS=$(git status -s | grep -v "??")
if [ ! -z "$STATUS" ]; then
STASH="yes"
git stash >/dev/null
fi
git fetch
OLD_BRANCH=$(git rev-parse --abbrev-ref HEAD)
git checkout master 2> /dev/null
git svn rebase -l
git checkout $OLD_BRANCH 2> /dev/null
if [ ! -z $STASH ]; then
git stash pop >/dev/null
fi
Then to perform the aforementioned update steps go into your source directory
and just type ``git-svnup`` or ``git svnup`` and everything will just work.
To commit back changes via git-svn, use ``dcommit``:
To commit back changes via git-svn, use ``git svn dcommit``:
.. code-block:: console
@ -770,7 +759,7 @@ The following options can be used to set or enable LLVM specific options:
case. The current set of targets is:
``arm, cpp, hexagon, mblaze, mips, mipsel, msp430, powerpc, ptx, sparc, spu,
x86, x86_64, xcore``.
systemz, x86, x86_64, xcore``.
``--enable-doxygen``

View File

@ -137,15 +137,18 @@ Here's the short story for getting up and running quickly with LLVM:
.. code-block:: bat
C:\..\llvm> llvm-lit test
C:\..\llvm> python ..\build\bin\llvm-lit --param build_config=Win32 --param build_mode=Debug --param llvm_site_config=../build/test/lit.site.cfg test
Note that quite a few of these test will fail.
This example assumes that Python is in your PATH variable, you
have built a Win32 Debug version of llvm with a standard out of
line build. You should not see any unexpected failures, but will
see many unsupported tests and expected failures.
A specific test or test directory can be run with:
.. code-block:: bat
C:\..\llvm> llvm-lit test/path/to/test
C:\..\llvm> python ..\build\bin\llvm-lit --param build_config=Win32 --param build_mode=Debug --param llvm_site_config=../build/test/lit.site.cfg test/path/to/test
An Example Using the LLVM Tool Chain

View File

@ -123,8 +123,8 @@ the file format is below:
boolean_property_name = 1 (or 0)
LLVMBuild files are expected to define a strict set of sections and
properties. An typical component description file for a library
component would look typically look like the following example:
properties. A typical component description file for a library
component would look like the following example:
.. code-block:: ini

View File

@ -719,12 +719,17 @@ Currently, only the following parameter attributes are defined:
``nest``
This indicates that the pointer parameter can be excised using the
:ref:`trampoline intrinsics <int_trampoline>`. This is not a valid
attribute for return values.
``nobuiltin``
This indicates that the callee function at a call site is not
recognized as a built-in function. LLVM will retain the original call
and not replace it with equivalent code based on the semantics of the
built-in function.
attribute for return values and can only be applied to one parameter.
``returned``
This indicates that the value of the function always returns the value
of the parameter as its return value. This is an optimization hint to
the code generator when generating the caller, allowing tail call
optimization and omission of register saves and restores in some cases;
it is not checked or enforced when generating the callee. The parameter
and the function return type must be valid operands for the
:ref:`bitcast instruction <i_bitcast>`. This is not a valid attribute for
return values and can only be applied to one parameter.
.. _gc:
@ -764,10 +769,10 @@ inlined, has a stack alignment of 4, and which shouldn't use SSE instructions:
.. code-block:: llvm
; Target-independent attributes:
#0 = attributes { alwaysinline alignstack=4 }
attributes #0 = { alwaysinline alignstack=4 }
; Target-dependent attributes:
#1 = attributes { "no-sse" }
attributes #1 = { "no-sse" }
; Function @f has attributes: alwaysinline, alignstack=4, and "no-sse".
define void @f() #0 #1 { ... }
@ -814,6 +819,12 @@ example:
``naked``
This attribute disables prologue / epilogue emission for the
function. This can have very system-specific consequences.
``nobuiltin``
This indicates that the callee function at a call site is not
recognized as a built-in function. LLVM will retain the original call
and not replace it with equivalent code based on the semantics of the
built-in function. This is only valid at call sites, not on function
declarations or definitions.
``noduplicate``
This attribute indicates that calls to the function cannot be
duplicated. A call to a ``noduplicate`` function may be moved
@ -1843,11 +1854,11 @@ double, and there are three forms of long double. The 80-bit format used
by x86 is represented as ``0xK`` followed by 20 hexadecimal digits. The
128-bit format used by PowerPC (two adjacent doubles) is represented by
``0xM`` followed by 32 hexadecimal digits. The IEEE 128-bit format is
represented by ``0xL`` followed by 32 hexadecimal digits; no currently
supported target uses this format. Long doubles will only work if they
match the long double format on your target. The IEEE 16-bit format
(half precision) is represented by ``0xH`` followed by 4 hexadecimal
digits. All hexadecimal formats are big-endian (sign bit at the left).
represented by ``0xL`` followed by 32 hexadecimal digits. Long doubles
will only work if they match the long double format on your target.
The IEEE 16-bit format (half precision) is represented by ``0xH``
followed by 4 hexadecimal digits. All hexadecimal formats are big-endian
(sign bit at the left).
There are no constants of type x86mmx.
@ -2857,11 +2868,10 @@ All globals of this sort should have a section specified as
The '``llvm.used``' Global Variable
-----------------------------------
The ``@llvm.used`` global is an array with i8\* element type which has
:ref:`appending linkage <linkage_appending>`. This array contains a list of
pointers to global variables and functions which may optionally have a
pointer cast formed of bitcast or getelementptr. For example, a legal
use of it is:
The ``@llvm.used`` global is an array which has :ref:`appending linkage
<linkage_appending>`. This array contains a list of pointers to global
variables, functions and aliases which may optionally have a pointer cast formed
of bitcast or getelementptr. For example, a legal use of it is:
.. code-block:: llvm
@ -2873,13 +2883,13 @@ use of it is:
i8* bitcast (i32* @Y to i8*)
], section "llvm.metadata"
If a global variable appears in the ``@llvm.used`` list, then the
compiler, assembler, and linker are required to treat the symbol as if
there is a reference to the global that it cannot see. For example, if a
variable has internal linkage and no references other than that from the
``@llvm.used`` list, it cannot be deleted. This is commonly used to
represent references from inline asms and other things the compiler
cannot "see", and corresponds to "``attribute((used))``" in GNU C.
If a symbol appears in the ``@llvm.used`` list, then the compiler, assembler,
and linker are required to treat the symbol as if there is a reference to the
symbol that it cannot see. For example, if a variable has internal linkage and
no references other than that from the ``@llvm.used`` list, it cannot be
deleted. This is commonly used to represent references from inline asms and
other things the compiler cannot "see", and corresponds to
"``attribute((used))``" in GNU C.
On some targets, the code generator must emit a directive to the
assembler or object file to prevent the assembler and linker from
@ -4534,7 +4544,7 @@ The '``load``' instruction is used to read from memory.
Arguments:
""""""""""
The argument to the '``load``' instruction specifies the memory address
The argument to the ``load`` instruction specifies the memory address
from which to load. The pointer must point to a :ref:`first
class <t_firstclass>` type. If the ``load`` is marked as ``volatile``,
then the optimizer is not allowed to modify the number or order of
@ -4555,14 +4565,14 @@ any defined semantics for atomic loads.
The optional constant ``align`` argument specifies the alignment of the
operation (that is, the alignment of the memory address). A value of 0
or an omitted ``align`` argument means that the operation has the abi
or an omitted ``align`` argument means that the operation has the ABI
alignment for the target. It is the responsibility of the code emitter
to ensure that the alignment information is correct. Overestimating the
alignment results in undefined behavior. Underestimating the alignment
may produce less efficient code. An alignment of 1 is always safe.
The optional ``!nontemporal`` metadata must reference a single
metatadata name <index> corresponding to a metadata node with one
metatadata name ``<index>`` corresponding to a metadata node with one
``i32`` entry of value 1. The existence of the ``!nontemporal``
metatadata on the instruction tells the optimizer and code generator
that this load is not expected to be reused in the cache. The code
@ -4570,7 +4580,7 @@ generator may select special instructions to save cache bandwidth, such
as the ``MOVNT`` instruction on x86.
The optional ``!invariant.load`` metadata must reference a single
metatadata name <index> corresponding to a metadata node with no
metatadata name ``<index>`` corresponding to a metadata node with no
entries. The existence of the ``!invariant.load`` metatadata on the
instruction tells the optimizer and code generator that this load
address points to memory which does not change value during program
@ -4618,10 +4628,10 @@ The '``store``' instruction is used to write to memory.
Arguments:
""""""""""
There are two arguments to the '``store``' instruction: a value to store
and an address at which to store it. The type of the '``<pointer>``'
There are two arguments to the ``store`` instruction: a value to store
and an address at which to store it. The type of the ``<pointer>``
operand must be a pointer to the :ref:`first class <t_firstclass>` type of
the '``<value>``' operand. If the ``store`` is marked as ``volatile``,
the ``<value>`` operand. If the ``store`` is marked as ``volatile``,
then the optimizer is not allowed to modify the number or order of
execution of this ``store`` with other :ref:`volatile
operations <volatile>`.
@ -4638,18 +4648,18 @@ has undefined behavior if the alignment is not set to a value which is
at least the size in bytes of the pointee. ``!nontemporal`` does not
have any defined semantics for atomic stores.
The optional constant "align" argument specifies the alignment of the
The optional constant ``align`` argument specifies the alignment of the
operation (that is, the alignment of the memory address). A value of 0
or an omitted "align" argument means that the operation has the abi
or an omitted ``align`` argument means that the operation has the ABI
alignment for the target. It is the responsibility of the code emitter
to ensure that the alignment information is correct. Overestimating the
alignment results in an undefined behavior. Underestimating the
alignment results in undefined behavior. Underestimating the
alignment may produce less efficient code. An alignment of 1 is always
safe.
The optional !nontemporal metadata must reference a single metatadata
name <index> corresponding to a metadata node with one i32 entry of
value 1. The existence of the !nontemporal metatadata on the instruction
The optional ``!nontemporal`` metadata must reference a single metatadata
name ``<index>`` corresponding to a metadata node with one ``i32`` entry of
value 1. The existence of the ``!nontemporal`` metatadata on the instruction
tells the optimizer and code generator that this load is not expected to
be reused in the cache. The code generator may select special
instructions to save cache bandwidth, such as the MOVNT instruction on
@ -4658,8 +4668,8 @@ x86.
Semantics:
""""""""""
The contents of memory are updated to contain '``<value>``' at the
location specified by the '``<pointer>``' operand. If '``<value>``' is
The contents of memory are updated to contain ``<value>`` at the
location specified by the ``<pointer>`` operand. If ``<value>`` is
of scalar type then the number of bytes written does not exceed the
minimum number of bytes needed to hold all bits of the type. For
example, storing an ``i24`` writes at most three bytes. When writing a

View File

@ -5,12 +5,6 @@ LLVM 3.3 Release Notes
.. contents::
:local:
.. warning::
These are in-progress notes for the upcoming LLVM 3.3 release. You may
prefer the `LLVM 3.2 Release Notes <http://llvm.org/releases/3.2/docs
/ReleaseNotes.html>`_.
Introduction
============
@ -34,13 +28,6 @@ page <http://llvm.org/releases/>`_.
Non-comprehensive list of changes in this release
=================================================
.. NOTE
For small 1-3 sentence descriptions, just add an entry at the end of
this list. If your description won't fit comfortably in one bullet
point (e.g. maybe you would like to give an example of the
functionality, or simply have a lot to talk about), see the `NOTE` below
for adding a new subsection.
* The CellSPU port has been removed. It can still be found in older versions.
* The IR-level extended linker APIs (for example, to link bitcode files out of
@ -70,17 +57,15 @@ Non-comprehensive list of changes in this release
examples of the new syntax. The old syntax using register classes still
works, but it will be removed in a future LLVM release.
* ... next change ...
* MCJIT now supports exception handling. Support for it in the old jit will be
removed in the 3.4 release.
.. NOTE
If you would like to document a larger change, then you can add a
subsection about it right here. You can copy the following boilerplate
and un-indent it (the indentation causes it to be inside this comment).
* Command line options can now be grouped into categories which are shown in
the output of ``-help``. See :ref:`grouping options into categories`.
Special New Feature
-------------------
Makes programs 10x faster by doing Special New Thing.
* The appearance of command line options in ``-help`` that are inherited by
linking with libraries that use the LLVM Command line support library can now
be modified at runtime. See :ref:`cl::getRegisteredOptions`.
AArch64 target
--------------
@ -99,9 +84,59 @@ GNU-style thread local storage and inline assembly.
Hexagon Target
--------------
- Removed support for legacy hexagonv2 and hexagonv3 processor
architectures which are no longer in use. Currently supported
architectures are hexagonv4 and hexagonv5.
Removed support for legacy hexagonv2 and hexagonv3 processor architectures which
are no longer in use. Currently supported architectures are hexagonv4 and
hexagonv5.
Mips target
--------------
New features and improvements:
- Clang driver
- Support for Sourcery CodeBench Mips toolchain directories tree.
- Support for new command line options including:
- -mxgot/-mno-xgot
- -EL / -EB
- -mmicromips / -mno-micromips
- -msingle-float / -mdouble-float
- -mabi=32 (o32 abi) and -mabi=64 (n64 abi)
- Previously, options such as -mips16, -mmicromips, -mdsp and -mdspr2 were
not passed to the assembler. This issue has been fixed.
- A number of changes have been made to improve the quality of DSP-ASE code
generation.
- Multiply and multiply-accumulate instructions can now use all four
accumulators.
- Instruction selection patterns have been added so that DSP instructions
are emitted without having to use builtins.
- Delay slot filler pass can now search successor blocks for instructions to
fill delay slots (use option -disable-mips-df-succbb-search=false).
PowerPC Target
--------------
New features and improvements:
- PowerPC now supports an assembly parser.
- Support added for thread-local storage. 64-bit ELF subtarget only.
- Support added for medium and large code model (-mcmodel=medium,large).
Medium code model is now the default. 64-bit ELF subtarget only.
- Improved register allocation (fewer reserved registers).
- 64-bit atomic load and store are now supported.
- Improved code generation for unaligned memory accesses of scalar types.
- Improved performance of floating-point divide and square root
with -ffast-math.
- Support for predicated returns.
- Improved code generation for comparisons.
- Support added for inline setjmp and longjmp.
- Support added for many instructions introduced in PowerISA 2.04, 2.05,
and 2.06.
- Improved spill code for vector registers.
- Support added for -mno-altivec.
- ABI compatibility fixes for complex parameters, 128-bit integer parameters,
and varargs functions. 64-bit ELF subtarget only.
Loop Vectorizer
---------------
@ -109,24 +144,164 @@ Loop Vectorizer
We've continued the work on the loop vectorizer. The loop vectorizer now
has the following features:
- Loops with unknown trip count.
- Runtime checks of pointers
- Reductions, Inductions
- If Conversion
- Pointer induction variables
- Reverse iterators
- Vectorization of mixed types
- Vectorization of function calls
- Partial unrolling during vectorization
- Loops with unknown trip counts.
- Runtime checks of pointers.
- Reductions, Inductions.
- Min/Max reductions of integers.
- If Conversion.
- Pointer induction variables.
- Reverse iterators.
- Vectorization of mixed types.
- Vectorization of function calls.
- Partial unrolling during vectorization.
The loop vectorizer is now enabled by default for -O3.
SLP Vectorizer
--------------
LLVM now has a new SLP vectorizer. The new SLP vectorizer is not enabled by
default but can be enabled using the clang flag ``-fslp-vectorize``. The
BB-vectorizer can also be enabled using the command line flag
``-fslp-vectorize-aggressive``.
R600 Backend
------------
The R600 backend was added in this release, it supports AMD GPUs
(HD2XXX - HD7XXX). This backend is used in AMD's Open Source
graphics / compute drivers which are developed as part of the `Mesa3D
<http://www.mesa3d.org>`_ project.
The R600 backend was added in this release, it supports AMD GPUs (HD2XXX -
HD7XXX). This backend is used in AMD's Open Source graphics / compute drivers
which are developed as part of the `Mesa3D <http://www.mesa3d.org>`_ project.
SystemZ/s390x Backend
---------------------
LLVM and clang now support IBM's z/Architecture. At present this support
is restricted to GNU/Linux (GNU triplet s390x-linux-gnu) and requires
z10 or greater.
Sub-project Status Update
=========================
In addition to the core LLVM 3.3 distribution of production-quality compiler
infrastructure, the LLVM project includes sub-projects that use the LLVM core
and share the same distribution license. This section provides updates on these
sub-projects.
DragonEgg: GCC front-ends, LLVM back-end
----------------------------------------
`DragonEgg <http://dragonegg.llvm.org/>`_ is a
`GCC plugin <http://gcc.gnu.org/wiki/plugins>`_ that replaces GCC's optimizers
and code generators with LLVM's. It works with gcc-4.5, 4.6, 4.7 and 4.8, can
target the x86-32/x86-64 and ARM processor families, and has been successfully
used on the Darwin, FreeBSD, KFreeBSD, Linux and OpenBSD platforms. It fully
supports Ada, C, C++ and Fortran. It has partial support for Go, Java, Obj-C
and Obj-C++. Note that gcc-4.6 is the best supported version, and that Ada in
particular doesn't work well with gcc-4.7 and newer.
The `3.3 release <http://llvm.org/apt/>`_ has the following notable changes.
- supports gcc-4.8 (requires gcc-4.8.1 or newer)
- object files can be written directly using LLVM's integrated assembler
- produces saner debug info
- bitfields can now contain arbitrary scalar types (useful for Ada)
LLDB: Low Level Debugger
------------------------
`LLDB <http://lldb.llvm.org/>`_ is a ground-up implementation of a command-line
debugger, as well as a debugger API that can be used from scripts and other
applications. LLDB uses the following components of the LLVM core distribution
to support the latest language features and target support:
- the Clang parser for high-quality parsing of C, C++ and Objective C
- the LLVM disassembler
- the LLVM JIT compiler (MCJIT) for expression evaluation
The `3.3 release <http://llvm.org/apt/>`_ has the following notable changes.
Linux Features:
- Support for watchpoints
- vim integration for lldb commands and program status using a `vim plug-in
<http://llvm.org/svn/llvm-project/lldb/trunk/utils/vim-lldb/README>`_
- Improved register support including vector registers
- Builds with cmake/ninja/auto-tools/clang 3.3/gcc 4.6
Linux Improvements:
- Debugging multi-threaded programs
- Debugging i386 programs
- Process list, attach and fork
- Expression evaluation
External Open Source Projects Using LLVM 3.3
============================================
An exciting aspect of LLVM is that it is used as an enabling technology for a
lot of other language and tools projects. This section lists some of the
projects that have already been updated to work with LLVM 3.3.
Portable Computing Language (pocl)
----------------------------------
In addition to producing an easily portable open source OpenCL implementation,
another major goal of `pocl <http://pocl.sourceforge.net/>`_ is improving
performance portability of OpenCL programs with compiler optimizations, reducing
the need for target-dependent manual optimizations. An important part of pocl is
a set of LLVM passes used to statically parallelize multiple work-items with the
kernel compiler, even in the presence of work-group barriers. This enables
static parallelization of the fine-grained static concurrency in the work groups
in multiple ways.
TTA-based Co-design Environment (TCE)
-------------------------------------
`TCE <http://tce.cs.tut.fi/>`_ is a toolset for designing new processors based
on the Transport triggered architecture (TTA). The toolset provides a complete
co-design flow from C/C++ programs down to synthesizable VHDL/Verilog and
parallel program binaries. Processor customization points include the register
files, function units, supported operations, and the interconnection network.
TCE uses Clang and LLVM for C/C++/OpenCL C language support, target independent
optimizations and also for parts of code generation. It generates new LLVM-based
code generators "on the fly" for the designed TTA processors and loads them in
to the compiler backend as runtime libraries to avoid per-target recompilation
of larger parts of the compiler chain.
Just-in-time Adaptive Decoder Engine (Jade)
-------------------------------------------
`Jade <https://github.com/orcc/jade>`_ (Just-in-time Adaptive Decoder Engine) is
a generic video decoder engine using LLVM for just-in-time compilation of video
decoder configurations. Those configurations are designed by MPEG Reconfigurable
Video Coding (RVC) committee. MPEG RVC standard is built on a stream-based
dataflow representation of decoders. It is composed of a standard library of
coding tools written in RVC-CAL language and a dataflow configuration --- block
diagram --- of a decoder.
Jade project is hosted as part of the Open RVC-CAL Compiler (`Orcc
<http://orcc.sf.net>`_) and requires it to translate the RVC-CAL standard
library of video coding tools into an LLVM assembly code.
LDC - the LLVM-based D compiler
-------------------------------
`D <http://dlang.org>`_ is a language with C-like syntax and static typing. It
pragmatically combines efficiency, control, and modeling power, with safety and
programmer productivity. D supports powerful concepts like Compile-Time Function
Execution (CTFE) and Template Meta-Programming, provides an innovative approach
to concurrency and offers many classical paradigms.
`LDC <http://wiki.dlang.org/LDC>`_ uses the frontend from the reference compiler
combined with LLVM as backend to produce efficient native code. LDC targets
x86/x86_64 systems like Linux, OS X and Windows and also Linux/PPC64. Ports to
other architectures like ARM are underway.
Additional Information

View File

@ -6,10 +6,10 @@ Auto-Vectorization in LLVM
:local:
LLVM has two vectorizers: The :ref:`Loop Vectorizer <loop-vectorizer>`,
which operates on Loops, and the :ref:`Basic Block Vectorizer
<bb-vectorizer>`, which optimizes straight-line code. These vectorizers
which operates on Loops, and the :ref:`SLP Vectorizer
<slp-vectorizer>`, which optimizes straight-line code. These vectorizers
focus on different optimization opportunities and use different techniques.
The BB vectorizer merges multiple scalars that are found in the code into
The SLP vectorizer merges multiple scalars that are found in the code into
vectors while the Loop Vectorizer widens instructions in the original loop
to operate on multiple consecutive loop iterations.
@ -21,19 +21,13 @@ The Loop Vectorizer
Usage
-----
LLVM's Loop Vectorizer is now available and will be useful for many people.
It is not enabled by default, but can be enabled through clang using the
command line flag:
LLVM's Loop Vectorizer is now enabled by default for -O3.
We plan to enable parts of the Loop Vectorizer on -O2 and -Os in future releases.
The vectorizer can be disabled using the command line:
.. code-block:: console
$ clang -fvectorize -O3 file.c
If the ``-fvectorize`` flag is used then the loop vectorizer will be enabled
when running with ``-O3``, ``-O2``. When ``-Os`` is used, the loop vectorizer
will only vectorize loops that do not require a major increase in code size.
We plan to enable the Loop Vectorizer by default as part of the LLVM 3.3 release.
$ clang ... -fno-vectorize file.c
Command line flags
^^^^^^^^^^^^^^^^^^
@ -299,25 +293,15 @@ And Linpack-pc with the same configuration. Result is Mflops, higher is better.
.. image:: linpack-pc.png
.. _bb-vectorizer:
.. _slp-vectorizer:
The Basic Block Vectorizer
==========================
Usage
------
The Basic Block Vectorizer is not enabled by default, but it can be enabled
through clang using the command line flag:
.. code-block:: console
$ clang -fslp-vectorize file.c
The SLP Vectorizer
==================
Details
-------
The goal of basic-block vectorization (a.k.a. superword-level parallelism) is
The goal of SLP vectorization (a.k.a. superword-level parallelism) is
to combine similar independent instructions within simple control-flow regions
into vector instructions. Memory accesses, arithemetic operations, comparison
operations and some math functions can all be vectorized using this technique
@ -329,10 +313,50 @@ into vector operations.
.. code-block:: c++
int foo(int a1, int a2, int b1, int b2) {
int r1 = a1*(a1 + b1)/b1 + 50*b1/a1;
int r2 = a2*(a2 + b2)/b2 + 50*b2/a2;
return r1 + r2;
void foo(int a1, int a2, int b1, int b2, int *A) {
A[0] = a1*(a1 + b1)/b1 + 50*b1/a1;
A[1] = a2*(a2 + b2)/b2 + 50*b2/a2;
}
The SLP-vectorizer has two phases, bottom-up, and top-down. The top-down vectorization
phase is more aggressive, but takes more time to run.
Usage
------
The SLP Vectorizer is not enabled by default, but it can be enabled
through clang using the command line flag:
.. code-block:: console
$ clang -fslp-vectorize file.c
LLVM has a second basic block vectorization phase
which is more compile-time intensive (The BB vectorizer). This optimization
can be enabled through clang using the command line flag:
.. code-block:: console
$ clang -fslp-vectorize-aggressive file.c
The SLP vectorizer is in early development stages but can already vectorize
and accelerate many programs in the LLVM test suite.
======================= ============
Benchmark Name Gain
======================= ============
Misc/flops-7 -32.70%
Misc/matmul_f64_4x4 -23.23%
Olden/power -21.45%
Misc/flops-4 -14.90%
ASC_Sequoia/AMGmk -13.85%
TSVC/LoopRerolling-flt -11.76%
Misc/flops-6 -9.70%
Misc/flops-5 -8.54%
Misc/flops -8.12%
TSVC/NodeSplitting-dbl -6.96%
Misc-C++/sphereflake -6.74%
Ptrdist/yacr2 -6.31%
======================= ============

View File

@ -160,6 +160,7 @@ For developers of applications which use LLVM as a library.
ExtendingLLVM
HowToSetUpLLVMStyleRTTI
ProgrammersManual
Extensions
:doc:`LLVM Language Reference Manual <LangRef>`
Defines the LLVM intermediate representation and the assembly form of the
@ -172,6 +173,9 @@ For developers of applications which use LLVM as a library.
Introduction to the general layout of the LLVM sourcebase, important classes
and APIs, and some tips & tricks.
:doc:`Extensions`
LLVM-specific extensions to tools and formats LLVM seeks compatibility with.
:doc:`CommandLine`
Provides information on using the command line parsing library.

View File

@ -55,7 +55,7 @@ in the various pieces. The structure of the tutorial is:
- Because a lot of people are interested in using LLVM as a JIT,
we'll dive right into it and show you the 3 lines it takes to add JIT
support. LLVM is also useful in many other ways, but this is one
simple and "sexy" way to shows off its power. :)
simple and "sexy" way to show off its power. :)
- `Chapter #5 <LangImpl5.html>`_: Extending the Language: Control
Flow - With the language up and running, we show how to extend it
with control flow operations (if/then/else and a 'for' loop). This

View File

@ -1,6 +1,8 @@
set(LLVM_LINK_COMPONENTS jit nativecodegen)
set(LLVM_LINK_COMPONENTS jit mcjit nativecodegen)
set(LLVM_REQUIRES_EH 1)
add_llvm_example(ExceptionDemo
ExceptionDemo.cpp
)
set_target_properties(ExceptionDemo PROPERTIES ENABLE_EXPORTS 1)

View File

@ -49,8 +49,8 @@
//===----------------------------------------------------------------------===//
#include "llvm/Analysis/Verifier.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/JIT.h"
#include "llvm/ExecutionEngine/MCJIT.h"
#include "llvm/ExecutionEngine/SectionMemoryManager.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/IRBuilder.h"
@ -418,6 +418,30 @@ static uintptr_t readSLEB128(const uint8_t **data) {
return result;
}
unsigned getEncodingSize(uint8_t Encoding) {
if (Encoding == llvm::dwarf::DW_EH_PE_omit)
return 0;
switch (Encoding & 0x0F) {
case llvm::dwarf::DW_EH_PE_absptr:
return sizeof(uintptr_t);
case llvm::dwarf::DW_EH_PE_udata2:
return sizeof(uint16_t);
case llvm::dwarf::DW_EH_PE_udata4:
return sizeof(uint32_t);
case llvm::dwarf::DW_EH_PE_udata8:
return sizeof(uint64_t);
case llvm::dwarf::DW_EH_PE_sdata2:
return sizeof(int16_t);
case llvm::dwarf::DW_EH_PE_sdata4:
return sizeof(int32_t);
case llvm::dwarf::DW_EH_PE_sdata8:
return sizeof(int64_t);
default:
// not supported
abort();
}
}
/// Read a pointer encoded value and advance pointer
/// See Variable Length Data in:
@ -523,7 +547,8 @@ static uintptr_t readEncodedPointer(const uint8_t **data, uint8_t encoding) {
/// @returns whether or not a type info was found. False is returned if only
/// a cleanup was found
static bool handleActionValue(int64_t *resultAction,
struct OurExceptionType_t **classInfo,
uint8_t TTypeEncoding,
const uint8_t *ClassInfo,
uintptr_t actionEntry,
uint64_t exceptionClass,
struct _Unwind_Exception *exceptionObject) {
@ -572,16 +597,22 @@ static bool handleActionValue(int64_t *resultAction,
// Note: A typeOffset == 0 implies that a cleanup llvm.eh.selector
// argument has been matched.
if ((typeOffset > 0) &&
(type == (classInfo[-typeOffset])->type)) {
if (typeOffset > 0) {
#ifdef DEBUG
fprintf(stderr,
"handleActionValue(...):actionValue <%d> found.\n",
i);
#endif
*resultAction = i + 1;
ret = true;
break;
unsigned EncSize = getEncodingSize(TTypeEncoding);
const uint8_t *EntryP = ClassInfo - typeOffset * EncSize;
uintptr_t P = readEncodedPointer(&EntryP, TTypeEncoding);
struct OurExceptionType_t *ThisClassInfo =
reinterpret_cast<struct OurExceptionType_t *>(P);
if (ThisClassInfo->type == type) {
*resultAction = i + 1;
ret = true;
break;
}
}
#ifdef DEBUG
@ -633,7 +664,7 @@ static _Unwind_Reason_Code handleLsda(int version,
// emitted dwarf code)
uintptr_t funcStart = _Unwind_GetRegionStart(context);
uintptr_t pcOffset = pc - funcStart;
struct OurExceptionType_t **classInfo = NULL;
const uint8_t *ClassInfo = NULL;
// Note: See JITDwarfEmitter::EmitExceptionTable(...) for corresponding
// dwarf emission
@ -653,7 +684,7 @@ static _Unwind_Reason_Code handleLsda(int version,
// were flagged by type info arguments to llvm.eh.selector
// intrinsic
classInfoOffset = readULEB128(&lsda);
classInfo = (struct OurExceptionType_t**) (lsda + classInfoOffset);
ClassInfo = lsda + classInfoOffset;
}
// Walk call-site table looking for range that
@ -714,7 +745,8 @@ static _Unwind_Reason_Code handleLsda(int version,
if (actionEntry) {
exceptionMatched = handleActionValue(&actionValue,
classInfo,
ttypeEncoding,
ClassInfo,
actionEntry,
exceptionClass,
exceptionObject);
@ -1921,17 +1953,22 @@ int main(int argc, char *argv[]) {
Opts.JITExceptionHandling = true;
llvm::InitializeNativeTarget();
llvm::InitializeNativeTargetAsmPrinter();
llvm::LLVMContext &context = llvm::getGlobalContext();
llvm::IRBuilder<> theBuilder(context);
// Make the module, which holds all the code.
llvm::Module *module = new llvm::Module("my cool jit", context);
llvm::JITMemoryManager *MemMgr = new llvm::SectionMemoryManager();
// Build engine with JIT
llvm::EngineBuilder factory(module);
factory.setEngineKind(llvm::EngineKind::JIT);
factory.setAllocateGVsWithCode(false);
factory.setTargetOptions(Opts);
factory.setJITMemoryManager(MemMgr);
factory.setUseMCJIT(true);
llvm::ExecutionEngine *executionEngine = factory.create();
{
@ -1975,6 +2012,8 @@ int main(int argc, char *argv[]) {
fpm,
"throwCppException");
executionEngine->finalizeObject();
fprintf(stderr, "\nBegin module dump:\n\n");
module->dump();

View File

@ -18,13 +18,6 @@
#include "llvm/Support/DataTypes.h"
#ifdef __cplusplus
/* Need these includes to support the LLVM 'cast' template for the C++ 'wrap'
and 'unwrap' conversion functions. */
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Module.h"
#include "llvm/PassRegistry.h"
extern "C" {
#endif
@ -60,11 +53,6 @@ extern "C" {
* with C++ due to name mangling. So in addition to C, this interface enables
* tools written in such languages.
*
* When included into a C++ source file, also declares 'wrap' and 'unwrap'
* helpers to perform opaque reference<-->pointer conversions. These helpers
* are shorter and more tightly typed than writing the casts by hand when
* authoring bindings. In assert builds, they will do runtime type checking.
*
* @{
*/
@ -352,6 +340,63 @@ typedef enum {
LLVMLandingPadFilter /**< A filter clause */
} LLVMLandingPadClauseTy;
typedef enum {
LLVMNotThreadLocal = 0,
LLVMGeneralDynamicTLSModel,
LLVMLocalDynamicTLSModel,
LLVMInitialExecTLSModel,
LLVMLocalExecTLSModel
} LLVMThreadLocalMode;
typedef enum {
LLVMAtomicOrderingNotAtomic = 0, /**< A load or store which is not atomic */
LLVMAtomicOrderingUnordered = 1, /**< Lowest level of atomicity, guarantees
somewhat sane results, lock free. */
LLVMAtomicOrderingMonotonic = 2, /**< guarantees that if you take all the
operations affecting a specific address,
a consistent ordering exists */
LLVMAtomicOrderingAcquire = 4, /**< Acquire provides a barrier of the sort
necessary to acquire a lock to access other
memory with normal loads and stores. */
LLVMAtomicOrderingRelease = 5, /**< Release is similar to Acquire, but with
a barrier of the sort necessary to release
a lock. */
LLVMAtomicOrderingAcquireRelease = 6, /**< provides both an Acquire and a
Release barrier (for fences and
operations which both read and write
memory). */
LLVMAtomicOrderingSequentiallyConsistent = 7 /**< provides Acquire semantics
for loads and Release
semantics for stores.
Additionally, it guarantees
that a total ordering exists
between all
SequentiallyConsistent
operations. */
} LLVMAtomicOrdering;
typedef enum {
LLVMAtomicRMWBinOpXchg, /**< Set the new value and return the one old */
LLVMAtomicRMWBinOpAdd, /**< Add a value and return the old one */
LLVMAtomicRMWBinOpSub, /**< Subtract a value and return the old one */
LLVMAtomicRMWBinOpAnd, /**< And a value and return the old one */
LLVMAtomicRMWBinOpNand, /**< Not-And a value and return the old one */
LLVMAtomicRMWBinOpOr, /**< OR a value and return the old one */
LLVMAtomicRMWBinOpXor, /**< Xor a value and return the old one */
LLVMAtomicRMWBinOpMax, /**< Sets the value if it's greater than the
original using a signed comparison and return
the old one */
LLVMAtomicRMWBinOpMin, /**< Sets the value if it's Smaller than the
original using a signed comparison and return
the old one */
LLVMAtomicRMWBinOpUMax, /**< Sets the value if it's greater than the
original using an unsigned comparison and return
the old one */
LLVMAtomicRMWBinOpUMin /**< Sets the value if it's greater than the
original using an unsigned comparison and return
the old one */
} LLVMAtomicRMWBinOp;
/**
* @}
*/
@ -1057,24 +1102,24 @@ LLVMTypeRef LLVMX86MMXType(void);
macro(SwitchInst) \
macro(UnreachableInst) \
macro(ResumeInst) \
macro(UnaryInstruction) \
macro(AllocaInst) \
macro(CastInst) \
macro(BitCastInst) \
macro(FPExtInst) \
macro(FPToSIInst) \
macro(FPToUIInst) \
macro(FPTruncInst) \
macro(IntToPtrInst) \
macro(PtrToIntInst) \
macro(SExtInst) \
macro(SIToFPInst) \
macro(TruncInst) \
macro(UIToFPInst) \
macro(ZExtInst) \
macro(ExtractValueInst) \
macro(LoadInst) \
macro(VAArgInst)
macro(UnaryInstruction) \
macro(AllocaInst) \
macro(CastInst) \
macro(BitCastInst) \
macro(FPExtInst) \
macro(FPToSIInst) \
macro(FPToUIInst) \
macro(FPTruncInst) \
macro(IntToPtrInst) \
macro(PtrToIntInst) \
macro(SExtInst) \
macro(SIToFPInst) \
macro(TruncInst) \
macro(UIToFPInst) \
macro(ZExtInst) \
macro(ExtractValueInst) \
macro(LoadInst) \
macro(VAArgInst)
/**
* @defgroup LLVMCCoreValueGeneral General APIs
@ -1606,6 +1651,10 @@ LLVMBool LLVMIsThreadLocal(LLVMValueRef GlobalVar);
void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal);
LLVMBool LLVMIsGlobalConstant(LLVMValueRef GlobalVar);
void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, LLVMBool IsConstant);
LLVMThreadLocalMode LLVMGetThreadLocalMode(LLVMValueRef GlobalVar);
void LLVMSetThreadLocalMode(LLVMValueRef GlobalVar, LLVMThreadLocalMode Mode);
LLVMBool LLVMIsExternallyInitialized(LLVMValueRef GlobalVar);
void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit);
/**
* @}
@ -1693,6 +1742,13 @@ void LLVMSetGC(LLVMValueRef Fn, const char *Name);
*/
void LLVMAddFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA);
/**
* Add a target-dependent attribute to a fuction
* @see llvm::AttrBuilder::addAttribute()
*/
void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn, const char *A,
const char *V);
/**
* Obtain an attribute from a function.
*
@ -2515,6 +2571,10 @@ LLVMValueRef LLVMBuildIsNotNull(LLVMBuilderRef, LLVMValueRef Val,
const char *Name);
LLVMValueRef LLVMBuildPtrDiff(LLVMBuilderRef, LLVMValueRef LHS,
LLVMValueRef RHS, const char *Name);
LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B,LLVMAtomicRMWBinOp op,
LLVMValueRef PTR, LLVMValueRef Val,
LLVMAtomicOrdering ordering,
LLVMBool singleThread);
/**
* @}
@ -2560,6 +2620,8 @@ LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRange(const char *InputData,
LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRangeCopy(const char *InputData,
size_t InputDataLength,
const char *BufferName);
const char *LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf);
size_t LLVMGetBufferSize(LLVMMemoryBufferRef MemBuf);
void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf);
/**
@ -2669,100 +2731,6 @@ LLVMBool LLVMIsMultithreaded();
#ifdef __cplusplus
}
namespace llvm {
class MemoryBuffer;
class PassManagerBase;
#define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref) \
inline ty *unwrap(ref P) { \
return reinterpret_cast<ty*>(P); \
} \
\
inline ref wrap(const ty *P) { \
return reinterpret_cast<ref>(const_cast<ty*>(P)); \
}
#define DEFINE_ISA_CONVERSION_FUNCTIONS(ty, ref) \
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref) \
\
template<typename T> \
inline T *unwrap(ref P) { \
return cast<T>(unwrap(P)); \
}
#define DEFINE_STDCXX_CONVERSION_FUNCTIONS(ty, ref) \
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref) \
\
template<typename T> \
inline T *unwrap(ref P) { \
T *Q = (T*)unwrap(P); \
assert(Q && "Invalid cast!"); \
return Q; \
}
DEFINE_ISA_CONVERSION_FUNCTIONS (Type, LLVMTypeRef )
DEFINE_ISA_CONVERSION_FUNCTIONS (Value, LLVMValueRef )
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(Module, LLVMModuleRef )
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(BasicBlock, LLVMBasicBlockRef )
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(IRBuilder<>, LLVMBuilderRef )
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(MemoryBuffer, LLVMMemoryBufferRef )
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(LLVMContext, LLVMContextRef )
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(Use, LLVMUseRef )
DEFINE_STDCXX_CONVERSION_FUNCTIONS(PassManagerBase, LLVMPassManagerRef )
DEFINE_STDCXX_CONVERSION_FUNCTIONS(PassRegistry, LLVMPassRegistryRef )
/* LLVMModuleProviderRef exists for historical reasons, but now just holds a
* Module.
*/
inline Module *unwrap(LLVMModuleProviderRef MP) {
return reinterpret_cast<Module*>(MP);
}
#undef DEFINE_STDCXX_CONVERSION_FUNCTIONS
#undef DEFINE_ISA_CONVERSION_FUNCTIONS
#undef DEFINE_SIMPLE_CONVERSION_FUNCTIONS
/* Specialized opaque context conversions.
*/
inline LLVMContext **unwrap(LLVMContextRef* Tys) {
return reinterpret_cast<LLVMContext**>(Tys);
}
inline LLVMContextRef *wrap(const LLVMContext **Tys) {
return reinterpret_cast<LLVMContextRef*>(const_cast<LLVMContext**>(Tys));
}
/* Specialized opaque type conversions.
*/
inline Type **unwrap(LLVMTypeRef* Tys) {
return reinterpret_cast<Type**>(Tys);
}
inline LLVMTypeRef *wrap(Type **Tys) {
return reinterpret_cast<LLVMTypeRef*>(const_cast<Type**>(Tys));
}
/* Specialized opaque value conversions.
*/
inline Value **unwrap(LLVMValueRef *Vals) {
return reinterpret_cast<Value**>(Vals);
}
template<typename T>
inline T **unwrap(LLVMValueRef *Vals, unsigned Length) {
#ifdef DEBUG
for (LLVMValueRef *I = Vals, *E = Vals + Length; I != E; ++I)
cast<T>(*I);
#endif
(void)Length;
return reinterpret_cast<T**>(Vals);
}
inline LLVMValueRef *wrap(const Value **Vals) {
return reinterpret_cast<LLVMValueRef*>(const_cast<Value**>(Vals));
}
}
#endif /* !defined(__cplusplus) */
#endif /* !defined(LLVM_C_CORE_H) */

View File

@ -21,6 +21,7 @@
#include "llvm-c/Core.h"
#include "llvm-c/Target.h"
#include "llvm-c/TargetMachine.h"
#ifdef __cplusplus
extern "C" {
@ -34,11 +35,19 @@ extern "C" {
*/
void LLVMLinkInJIT(void);
void LLVMLinkInMCJIT(void);
void LLVMLinkInInterpreter(void);
typedef struct LLVMOpaqueGenericValue *LLVMGenericValueRef;
typedef struct LLVMOpaqueExecutionEngine *LLVMExecutionEngineRef;
struct LLVMMCJITCompilerOptions {
unsigned OptLevel;
LLVMCodeModel CodeModel;
LLVMBool NoFramePointerElim;
LLVMBool EnableFastISel;
};
/*===-- Operations on generic values --------------------------------------===*/
LLVMGenericValueRef LLVMCreateGenericValueOfInt(LLVMTypeRef Ty,
@ -75,6 +84,31 @@ LLVMBool LLVMCreateJITCompilerForModule(LLVMExecutionEngineRef *OutJIT,
unsigned OptLevel,
char **OutError);
void LLVMInitializeMCJITCompilerOptions(
struct LLVMMCJITCompilerOptions *Options, size_t SizeOfOptions);
/**
* Create an MCJIT execution engine for a module, with the given options. It is
* the responsibility of the caller to ensure that all fields in Options up to
* the given SizeOfOptions are initialized. It is correct to pass a smaller
* value of SizeOfOptions that omits some fields. The canonical way of using
* this is:
*
* LLVMMCJITCompilerOptions options;
* LLVMInitializeMCJITCompilerOptions(&options, sizeof(options));
* ... fill in those options you care about
* LLVMCreateMCJITCompilerForModule(&jit, mod, &options, sizeof(options),
* &error);
*
* Note that this is also correct, though possibly suboptimal:
*
* LLVMCreateMCJITCompilerForModule(&jit, mod, 0, 0, &error);
*/
LLVMBool LLVMCreateMCJITCompilerForModule(
LLVMExecutionEngineRef *OutJIT, LLVMModuleRef M,
struct LLVMMCJITCompilerOptions *Options, size_t SizeOfOptions,
char **OutError);
/** Deprecated: Use LLVMCreateExecutionEngineForModule instead. */
LLVMBool LLVMCreateExecutionEngine(LLVMExecutionEngineRef *OutEE,
LLVMModuleProviderRef MP,
@ -123,7 +157,8 @@ LLVMBool LLVMRemoveModuleProvider(LLVMExecutionEngineRef EE,
LLVMBool LLVMFindFunction(LLVMExecutionEngineRef EE, const char *Name,
LLVMValueRef *OutFn);
void *LLVMRecompileAndRelinkFunction(LLVMExecutionEngineRef EE, LLVMValueRef Fn);
void *LLVMRecompileAndRelinkFunction(LLVMExecutionEngineRef EE,
LLVMValueRef Fn);
LLVMTargetDataRef LLVMGetExecutionEngineTargetData(LLVMExecutionEngineRef EE);
@ -137,27 +172,7 @@ void *LLVMGetPointerToGlobal(LLVMExecutionEngineRef EE, LLVMValueRef Global);
*/
#ifdef __cplusplus
}
namespace llvm {
struct GenericValue;
class ExecutionEngine;
#define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref) \
inline ty *unwrap(ref P) { \
return reinterpret_cast<ty*>(P); \
} \
\
inline ref wrap(const ty *P) { \
return reinterpret_cast<ref>(const_cast<ty*>(P)); \
}
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(GenericValue, LLVMGenericValueRef )
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ExecutionEngine, LLVMExecutionEngineRef)
#undef DEFINE_SIMPLE_CONVERSION_FUNCTIONS
}
}
#endif /* defined(__cplusplus) */
#endif

View File

@ -23,8 +23,6 @@
#include "llvm/Config/llvm-config.h"
#ifdef __cplusplus
#include "llvm/Object/ObjectFile.h"
extern "C" {
#endif
@ -99,50 +97,6 @@ const char *LLVMGetRelocationValueString(LLVMRelocationIteratorRef RI);
#ifdef __cplusplus
}
namespace llvm {
namespace object {
inline ObjectFile *unwrap(LLVMObjectFileRef OF) {
return reinterpret_cast<ObjectFile*>(OF);
}
inline LLVMObjectFileRef wrap(const ObjectFile *OF) {
return reinterpret_cast<LLVMObjectFileRef>(const_cast<ObjectFile*>(OF));
}
inline section_iterator *unwrap(LLVMSectionIteratorRef SI) {
return reinterpret_cast<section_iterator*>(SI);
}
inline LLVMSectionIteratorRef
wrap(const section_iterator *SI) {
return reinterpret_cast<LLVMSectionIteratorRef>
(const_cast<section_iterator*>(SI));
}
inline symbol_iterator *unwrap(LLVMSymbolIteratorRef SI) {
return reinterpret_cast<symbol_iterator*>(SI);
}
inline LLVMSymbolIteratorRef
wrap(const symbol_iterator *SI) {
return reinterpret_cast<LLVMSymbolIteratorRef>
(const_cast<symbol_iterator*>(SI));
}
inline relocation_iterator *unwrap(LLVMRelocationIteratorRef SI) {
return reinterpret_cast<relocation_iterator*>(SI);
}
inline LLVMRelocationIteratorRef
wrap(const relocation_iterator *SI) {
return reinterpret_cast<LLVMRelocationIteratorRef>
(const_cast<relocation_iterator*>(SI));
}
}
}
#endif /* defined(__cplusplus) */
#endif

View File

@ -235,29 +235,6 @@ void LLVMDisposeTargetData(LLVMTargetDataRef);
#ifdef __cplusplus
}
namespace llvm {
class DataLayout;
class TargetLibraryInfo;
inline DataLayout *unwrap(LLVMTargetDataRef P) {
return reinterpret_cast<DataLayout*>(P);
}
inline LLVMTargetDataRef wrap(const DataLayout *P) {
return reinterpret_cast<LLVMTargetDataRef>(const_cast<DataLayout*>(P));
}
inline TargetLibraryInfo *unwrap(LLVMTargetLibraryInfoRef P) {
return reinterpret_cast<TargetLibraryInfo*>(P);
}
inline LLVMTargetLibraryInfoRef wrap(const TargetLibraryInfo *P) {
TargetLibraryInfo *X = const_cast<TargetLibraryInfo*>(P);
return reinterpret_cast<LLVMTargetLibraryInfoRef>(X);
}
}
#endif /* defined(__cplusplus) */
#endif

View File

@ -25,7 +25,7 @@
#ifdef __cplusplus
extern "C" {
#endif
typedef struct LLVMTargetMachine *LLVMTargetMachineRef;
typedef struct LLVMOpaqueTargetMachine *LLVMTargetMachineRef;
typedef struct LLVMTarget *LLVMTargetRef;
typedef enum {
@ -114,30 +114,11 @@ LLVMTargetDataRef LLVMGetTargetMachineData(LLVMTargetMachineRef T);
LLVMBool LLVMTargetMachineEmitToFile(LLVMTargetMachineRef T, LLVMModuleRef M,
char *Filename, LLVMCodeGenFileType codegen, char **ErrorMessage);
/** Compile the LLVM IR stored in \p M and store the result in \p OutMemBuf. */
LLVMBool LLVMTargetMachineEmitToMemoryBuffer(LLVMTargetMachineRef T, LLVMModuleRef M,
LLVMCodeGenFileType codegen, char** ErrorMessage, LLVMMemoryBufferRef *OutMemBuf);
#ifdef __cplusplus
}
namespace llvm {
class TargetMachine;
class Target;
inline TargetMachine *unwrap(LLVMTargetMachineRef P) {
return reinterpret_cast<TargetMachine*>(P);
}
inline Target *unwrap(LLVMTargetRef P) {
return reinterpret_cast<Target*>(P);
}
inline LLVMTargetMachineRef wrap(const TargetMachine *P) {
return reinterpret_cast<LLVMTargetMachineRef>(
const_cast<TargetMachine*>(P));
}
inline LLVMTargetRef wrap(const Target * P) {
return reinterpret_cast<LLVMTargetRef>(const_cast<Target*>(P));
}
}
#endif
#endif

View File

@ -86,16 +86,6 @@ void LLVMPassManagerBuilderPopulateLTOPassManager(LLVMPassManagerBuilderRef PMB,
#ifdef __cplusplus
}
namespace llvm {
inline PassManagerBuilder *unwrap(LLVMPassManagerBuilderRef P) {
return reinterpret_cast<PassManagerBuilder*>(P);
}
inline LLVMPassManagerBuilderRef wrap(PassManagerBuilder *P) {
return reinterpret_cast<LLVMPassManagerBuilderRef>(P);
}
}
#endif
#endif

View File

@ -39,6 +39,9 @@ void LLVMAddBBVectorizePass(LLVMPassManagerRef PM);
/** See llvm::createLoopVectorizePass function. */
void LLVMAddLoopVectorizePass(LLVMPassManagerRef PM);
/** See llvm::createSLPVectorizerPass function. */
void LLVMAddSLPVectorizePass(LLVMPassManagerRef PM);
/**
* @}
*/

View File

@ -10,6 +10,7 @@
#ifndef LLVM_ADT_ARRAYREF_H
#define LLVM_ADT_ARRAYREF_H
#include "llvm/ADT/None.h"
#include "llvm/ADT/SmallVector.h"
#include <vector>
@ -49,6 +50,9 @@ namespace llvm {
/// Construct an empty ArrayRef.
/*implicit*/ ArrayRef() : Data(0), Length(0) {}
/// Construct an empty ArrayRef from None.
/*implicit*/ ArrayRef(NoneType) : Data(0), Length(0) {}
/// Construct an ArrayRef from a single element.
/*implicit*/ ArrayRef(const T &OneElt)
: Data(&OneElt), Length(1) {}
@ -174,9 +178,12 @@ namespace llvm {
public:
typedef T *iterator;
/// Construct an empty ArrayRef.
/// Construct an empty MutableArrayRef.
/*implicit*/ MutableArrayRef() : ArrayRef<T>() {}
/// Construct an empty MutableArrayRef from None.
/*implicit*/ MutableArrayRef(NoneType) : ArrayRef<T>() {}
/// Construct an MutableArrayRef from a single element.
/*implicit*/ MutableArrayRef(T &OneElt) : ArrayRef<T>(OneElt) {}

View File

@ -618,7 +618,7 @@ class DenseMap
unsigned OldNumBuckets = NumBuckets;
BucketT *OldBuckets = Buckets;
allocateBuckets(std::max<unsigned>(64, NextPowerOf2(AtLeast-1)));
allocateBuckets(std::max<unsigned>(64, static_cast<unsigned>(NextPowerOf2(AtLeast-1))));
assert(Buckets);
if (!OldBuckets) {
this->BaseT::initEmpty();

View File

@ -151,7 +151,7 @@ namespace detail {
inline uint64_t fetch64(const char *p) {
uint64_t result;
memcpy(&result, p, sizeof(result));
if (sys::isBigEndianHost())
if (sys::IsBigEndianHost)
return sys::SwapByteOrder(result);
return result;
}
@ -159,7 +159,7 @@ inline uint64_t fetch64(const char *p) {
inline uint32_t fetch32(const char *p) {
uint32_t result;
memcpy(&result, p, sizeof(result));
if (sys::isBigEndianHost())
if (sys::IsBigEndianHost)
return sys::SwapByteOrder(result);
return result;
}

View File

@ -1,77 +0,0 @@
//===- InMemoryStruct.h - Indirect Struct Access Smart Pointer --*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_ADT_INMEMORYSTRUCT_H
#define LLVM_ADT_INMEMORYSTRUCT_H
#include <cassert>
namespace llvm {
/// \brief Helper object for abstracting access to an in-memory structure which
/// may require some kind of temporary storage.
///
/// This class is designed to be used for accessing file data structures which
/// in the common case can be accessed from a direct pointer to a memory mapped
/// object, but which in some cases may require indirect access to a temporary
/// structure (which, for example, may have undergone endianness translation).
template<typename T>
class InMemoryStruct {
typedef T value_type;
typedef value_type &reference;
typedef value_type *pointer;
typedef const value_type &const_reference;
typedef const value_type *const_pointer;
/// \brief The smart pointer target.
value_type *Target;
/// \brief A temporary object which can be used as a target of the smart
/// pointer.
value_type Contents;
private:
public:
InMemoryStruct() : Target(0) {}
InMemoryStruct(reference Value) : Target(&Contents), Contents(Value) {}
InMemoryStruct(pointer Value) : Target(Value) {}
InMemoryStruct(const InMemoryStruct<T> &Value) { *this = Value; }
void operator=(const InMemoryStruct<T> &Value) {
if (Value.Target != &Value.Contents) {
Target = Value.Target;
} else {
Target = &Contents;
Contents = Value.Contents;
}
}
const_reference operator*() const {
assert(Target && "Cannot dereference null pointer");
return *Target;
}
reference operator*() {
assert(Target && "Cannot dereference null pointer");
return *Target;
}
const_pointer operator->() const {
return Target;
}
pointer operator->() {
return Target;
}
operator bool() const { return Target != 0; }
};
}
#endif

View File

@ -29,7 +29,7 @@ struct DenseMapInfo;
/// on the number of bits available according to PointerLikeTypeTraits for the
/// type.
///
/// Note that PointerIntPair always puts the Int part in the highest bits
/// Note that PointerIntPair always puts the IntVal part in the highest bits
/// possible. For example, PointerIntPair<void*, 1, bool> will put the bit for
/// the bool into bit #2, not bit #0, which allows the low two bits to be used
/// for something else. For example, this allows:
@ -57,13 +57,13 @@ class PointerIntPair {
};
public:
PointerIntPair() : Value(0) {}
PointerIntPair(PointerTy Ptr, IntType Int) {
PointerIntPair(PointerTy PtrVal, IntType IntVal) {
assert(IntBits <= PtrTraits::NumLowBitsAvailable &&
"PointerIntPair formed with integer size too large for pointer");
setPointerAndInt(Ptr, Int);
setPointerAndInt(PtrVal, IntVal);
}
explicit PointerIntPair(PointerTy Ptr) {
initWithPointer(Ptr);
explicit PointerIntPair(PointerTy PtrVal) {
initWithPointer(PtrVal);
}
PointerTy getPointer() const {
@ -75,41 +75,41 @@ class PointerIntPair {
return (IntType)((Value >> IntShift) & IntMask);
}
void setPointer(PointerTy Ptr) {
intptr_t PtrVal
= reinterpret_cast<intptr_t>(PtrTraits::getAsVoidPointer(Ptr));
assert((PtrVal & ((1 << PtrTraits::NumLowBitsAvailable)-1)) == 0 &&
void setPointer(PointerTy PtrVal) {
intptr_t PtrWord
= reinterpret_cast<intptr_t>(PtrTraits::getAsVoidPointer(PtrVal));
assert((PtrWord & ((1 << PtrTraits::NumLowBitsAvailable)-1)) == 0 &&
"Pointer is not sufficiently aligned");
// Preserve all low bits, just update the pointer.
Value = PtrVal | (Value & ~PointerBitMask);
Value = PtrWord | (Value & ~PointerBitMask);
}
void setInt(IntType Int) {
intptr_t IntVal = Int;
assert(IntVal < (1 << IntBits) && "Integer too large for field");
void setInt(IntType IntVal) {
intptr_t IntWord = static_cast<intptr_t>(IntVal);
assert(IntWord < (1 << IntBits) && "Integer too large for field");
// Preserve all bits other than the ones we are updating.
Value &= ~ShiftedIntMask; // Remove integer field.
Value |= IntVal << IntShift; // Set new integer.
Value |= IntWord << IntShift; // Set new integer.
}
void initWithPointer(PointerTy Ptr) {
intptr_t PtrVal
= reinterpret_cast<intptr_t>(PtrTraits::getAsVoidPointer(Ptr));
assert((PtrVal & ((1 << PtrTraits::NumLowBitsAvailable)-1)) == 0 &&
void initWithPointer(PointerTy PtrVal) {
intptr_t PtrWord
= reinterpret_cast<intptr_t>(PtrTraits::getAsVoidPointer(PtrVal));
assert((PtrWord & ((1 << PtrTraits::NumLowBitsAvailable)-1)) == 0 &&
"Pointer is not sufficiently aligned");
Value = PtrVal;
Value = PtrWord;
}
void setPointerAndInt(PointerTy Ptr, IntType Int) {
intptr_t PtrVal
= reinterpret_cast<intptr_t>(PtrTraits::getAsVoidPointer(Ptr));
assert((PtrVal & ((1 << PtrTraits::NumLowBitsAvailable)-1)) == 0 &&
void setPointerAndInt(PointerTy PtrVal, IntType IntVal) {
intptr_t PtrWord
= reinterpret_cast<intptr_t>(PtrTraits::getAsVoidPointer(PtrVal));
assert((PtrWord & ((1 << PtrTraits::NumLowBitsAvailable)-1)) == 0 &&
"Pointer is not sufficiently aligned");
intptr_t IntVal = Int;
assert(IntVal < (1 << IntBits) && "Integer too large for field");
intptr_t IntWord = static_cast<intptr_t>(IntVal);
assert(IntWord < (1 << IntBits) && "Integer too large for field");
Value = PtrVal | (IntVal << IntShift);
Value = PtrWord | (IntWord << IntShift);
}
PointerTy const *getAddrOfPointer() const {

View File

@ -260,7 +260,7 @@ namespace llvm {
/// Find the first character in the string that is \p C, or npos if not
/// found. Same as find.
size_type find_first_of(char C, size_t From = 0) const {
size_t find_first_of(char C, size_t From = 0) const {
return find(C, From);
}
@ -268,21 +268,21 @@ namespace llvm {
/// not found.
///
/// Complexity: O(size() + Chars.size())
size_type find_first_of(StringRef Chars, size_t From = 0) const;
size_t find_first_of(StringRef Chars, size_t From = 0) const;
/// Find the first character in the string that is not \p C or npos if not
/// found.
size_type find_first_not_of(char C, size_t From = 0) const;
size_t find_first_not_of(char C, size_t From = 0) const;
/// Find the first character in the string that is not in the string
/// \p Chars, or npos if not found.
///
/// Complexity: O(size() + Chars.size())
size_type find_first_not_of(StringRef Chars, size_t From = 0) const;
size_t find_first_not_of(StringRef Chars, size_t From = 0) const;
/// Find the last character in the string that is \p C, or npos if not
/// found.
size_type find_last_of(char C, size_t From = npos) const {
size_t find_last_of(char C, size_t From = npos) const {
return rfind(C, From);
}
@ -290,17 +290,17 @@ namespace llvm {
/// found.
///
/// Complexity: O(size() + Chars.size())
size_type find_last_of(StringRef Chars, size_t From = npos) const;
size_t find_last_of(StringRef Chars, size_t From = npos) const;
/// Find the last character in the string that is not \p C, or npos if not
/// found.
size_type find_last_not_of(char C, size_t From = npos) const;
size_t find_last_not_of(char C, size_t From = npos) const;
/// Find the last character in the string that is not in \p Chars, or
/// npos if not found.
///
/// Complexity: O(size() + Chars.size())
size_type find_last_not_of(StringRef Chars, size_t From = npos) const;
size_t find_last_not_of(StringRef Chars, size_t From = npos) const;
/// @}
/// @name Helpful Algorithms
@ -390,14 +390,14 @@ namespace llvm {
/// Return a StringRef equal to 'this' but with the first \p N elements
/// dropped.
StringRef drop_front(unsigned N = 1) const {
StringRef drop_front(size_t N = 1) const {
assert(size() >= N && "Dropping more elements than exist");
return substr(N);
}
/// Return a StringRef equal to 'this' but with the last \p N elements
/// dropped.
StringRef drop_back(unsigned N = 1) const {
StringRef drop_back(size_t N = 1) const {
assert(size() >= N && "Dropping more elements than exist");
return substr(0, size()-N);
}

View File

@ -43,7 +43,7 @@ class Triple {
enum ArchType {
UnknownArch,
arm, // ARM; arm, armv.*, xscale
arm, // ARM: arm, armv.*, xscale
aarch64, // AArch64: aarch64
hexagon, // Hexagon: hexagon
mips, // MIPS: mips, mipsallegrex
@ -56,6 +56,7 @@ class Triple {
r600, // R600: AMD GPUs HD2XXX - HD6XXX
sparc, // Sparc: sparc
sparcv9, // Sparcv9: Sparcv9
systemz, // SystemZ: s390x
tce, // TCE (http://tce.cs.tut.fi/): tce
thumb, // Thumb: thumb, thumbv.*
x86, // X86: i[3-9]86

View File

@ -236,7 +236,7 @@ namespace llvm {
/// getLHSKind - Get the NodeKind of the left-hand side.
NodeKind getLHSKind() const { return (NodeKind) LHSKind; }
/// getRHSKind - Get the NodeKind of the left-hand side.
/// getRHSKind - Get the NodeKind of the right-hand side.
NodeKind getRHSKind() const { return (NodeKind) RHSKind; }
/// printOneChild - Print one child from a twine.

View File

@ -146,14 +146,6 @@ static inline CallInst *isFreeCall(Value *I, const TargetLibraryInfo *TLI) {
bool getObjectSize(const Value *Ptr, uint64_t &Size, const DataLayout *TD,
const TargetLibraryInfo *TLI, bool RoundToAlign = false);
/// \brief Compute the size of the underlying object pointed by Ptr. Returns
/// true and the object size in Size if successful, and false otherwise.
/// If RoundToAlign is true, then Size is rounded up to the aligment of allocas,
/// byval arguments, and global variables.
bool getUnderlyingObjectSize(const Value *Ptr, uint64_t &Size,
const DataLayout *TD, const TargetLibraryInfo *TLI,
bool RoundToAlign = false);
typedef std::pair<APInt, APInt> SizeOffsetType;
@ -163,14 +155,12 @@ typedef std::pair<APInt, APInt> SizeOffsetType;
class ObjectSizeOffsetVisitor
: public InstVisitor<ObjectSizeOffsetVisitor, SizeOffsetType> {
typedef DenseMap<const Value*, SizeOffsetType> CacheMapTy;
const DataLayout *TD;
const TargetLibraryInfo *TLI;
bool RoundToAlign;
unsigned IntTyBits;
APInt Zero;
CacheMapTy CacheMap;
SmallPtrSet<Instruction *, 8> SeenInsts;
APInt align(APInt Size, uint64_t Align);

View File

@ -266,6 +266,24 @@ class Region : public RegionNode {
/// @param BB The new exit basic block of the region.
void replaceExit(BasicBlock *BB);
/// @brief Recursively replace the entry basic block of the region.
///
/// This function replaces the entry basic block with a new basic block. It
/// also updates all child regions that have the same entry basic block as
/// this region.
///
/// @param NewEntry The new entry basic block.
void replaceEntryRecursive(BasicBlock *NewEntry);
/// @brief Recursively replace the exit basic block of the region.
///
/// This function replaces the exit basic block with a new basic block. It
/// also updates all child regions that have the same exit basic block as
/// this region.
///
/// @param NewExit The new exit basic block.
void replaceExitRecursive(BasicBlock *NewExit);
/// @brief Get the exit BasicBlock of the Region.
/// @return The exit BasicBlock of the Region, NULL if this is the TopLevel
/// Region.

View File

@ -453,7 +453,8 @@ namespace llvm {
ExitLimit ComputeExitLimitFromCond(const Loop *L,
Value *ExitCond,
BasicBlock *TBB,
BasicBlock *FBB);
BasicBlock *FBB,
bool IsSubExpr);
/// ComputeExitLimitFromICmp - Compute the number of times the backedge of
/// the specified loop will execute if its exit condition were a conditional
@ -461,7 +462,8 @@ namespace llvm {
ExitLimit ComputeExitLimitFromICmp(const Loop *L,
ICmpInst *ExitCond,
BasicBlock *TBB,
BasicBlock *FBB);
BasicBlock *FBB,
bool IsSubExpr);
/// ComputeLoadConstantCompareExitLimit - Given an exit condition
/// of 'icmp op load X, cst', try to see if we can compute the
@ -483,7 +485,7 @@ namespace llvm {
/// HowFarToZero - Return the number of times an exit condition comparing
/// the specified value to zero will execute. If not computable, return
/// CouldNotCompute.
ExitLimit HowFarToZero(const SCEV *V, const Loop *L);
ExitLimit HowFarToZero(const SCEV *V, const Loop *L, bool IsSubExpr);
/// HowFarToNonZero - Return the number of times an exit condition checking
/// the specified value for nonzero will execute. If not computable, return
@ -495,7 +497,7 @@ namespace llvm {
/// computable, return CouldNotCompute. isSigned specifies whether the
/// less-than is signed.
ExitLimit HowManyLessThans(const SCEV *LHS, const SCEV *RHS,
const Loop *L, bool isSigned);
const Loop *L, bool isSigned, bool IsSubExpr);
/// getPredecessorWithUniqueSuccessorForBB - Return a predecessor of BB
/// (which may not be an immediate predecessor) which has exactly one

View File

@ -25,6 +25,7 @@ namespace llvm {
class BlockAddress;
class GCStrategy;
class Constant;
class ConstantArray;
class GCMetadataPrinter;
class GlobalValue;
class GlobalVariable;
@ -134,6 +135,9 @@ namespace llvm {
/// getDataLayout - Return information about data layout.
const DataLayout &getDataLayout() const;
/// getTargetTriple - Return the target triple string.
StringRef getTargetTriple() const;
/// getCurrentSection() - Return the current section we are emitting to.
const MCSection *getCurrentSection() const;
@ -480,7 +484,7 @@ namespace llvm {
void EmitJumpTableEntry(const MachineJumpTableInfo *MJTI,
const MachineBasicBlock *MBB,
unsigned uid) const;
void EmitLLVMUsedList(const Constant *List);
void EmitLLVMUsedList(const ConstantArray *InitList);
void EmitXXStructorList(const Constant *List, bool isCtor);
GCMetadataPrinter *GetOrCreateGCPrinter(GCStrategy *C);
};

View File

@ -163,8 +163,56 @@ class CCState {
unsigned StackOffset;
SmallVector<uint32_t, 16> UsedRegs;
unsigned FirstByValReg;
bool FirstByValRegValid;
// ByValInfo and SmallVector<ByValInfo, 4> ByValRegs:
//
// Vector of ByValInfo instances (ByValRegs) is introduced for byval registers
// tracking.
// Or, in another words it tracks byval parameters that are stored in
// general purpose registers.
//
// For 4 byte stack alignment,
// instance index means byval parameter number in formal
// arguments set. Assume, we have some "struct_type" with size = 4 bytes,
// then, for function "foo":
//
// i32 foo(i32 %p, %struct_type* %r, i32 %s, %struct_type* %t)
//
// ByValRegs[0] describes how "%r" is stored (Begin == r1, End == r2)
// ByValRegs[1] describes how "%t" is stored (Begin == r3, End == r4).
//
// In case of 8 bytes stack alignment,
// ByValRegs may also contain information about wasted registers.
// In function shown above, r3 would be wasted according to AAPCS rules.
// And in that case ByValRegs[1].Waste would be "true".
// ByValRegs vector size still would be 2,
// while "%t" goes to the stack: it wouldn't be described in ByValRegs.
//
// Supposed use-case for this collection:
// 1. Initially ByValRegs is empty, InRegsParamsProceed is 0.
// 2. HandleByVal fillups ByValRegs.
// 3. Argument analysis (LowerFormatArguments, for example). After
// some byval argument was analyzed, InRegsParamsProceed is increased.
struct ByValInfo {
ByValInfo(unsigned B, unsigned E, bool IsWaste = false) :
Begin(B), End(E), Waste(IsWaste) {}
// First register allocated for current parameter.
unsigned Begin;
// First after last register allocated for current parameter.
unsigned End;
// Means that current range of registers doesn't belong to any
// parameters. It was wasted due to stack alignment rules.
// For more information see:
// AAPCS, 5.5 Parameter Passing, Stage C, C.3.
bool Waste;
};
SmallVector<ByValInfo, 4 > ByValRegs;
// InRegsParamsProceed - shows how many instances of ByValRegs was proceed
// during argument analysis.
unsigned InRegsParamsProceed;
protected:
ParmContext CallOrPrologue;
@ -306,12 +354,45 @@ class CCState {
MVT LocVT, CCValAssign::LocInfo LocInfo,
int MinSize, int MinAlign, ISD::ArgFlagsTy ArgFlags);
// First GPR that carries part of a byval aggregate that's split
// between registers and memory.
unsigned getFirstByValReg() const { return FirstByValRegValid ? FirstByValReg : 0; }
void setFirstByValReg(unsigned r) { FirstByValReg = r; FirstByValRegValid = true; }
void clearFirstByValReg() { FirstByValReg = 0; FirstByValRegValid = false; }
bool isFirstByValRegValid() const { return FirstByValRegValid; }
// Returns count of byval arguments that are to be stored (even partly)
// in registers.
unsigned getInRegsParamsCount() const { return ByValRegs.size(); }
// Returns count of byval in-regs arguments proceed.
unsigned getInRegsParamsProceed() const { return InRegsParamsProceed; }
// Get information about N-th byval parameter that is stored in registers.
// Here "ByValParamIndex" is N.
void getInRegsParamInfo(unsigned InRegsParamRecordIndex,
unsigned& BeginReg, unsigned& EndReg) const {
assert(InRegsParamRecordIndex < ByValRegs.size() &&
"Wrong ByVal parameter index");
const ByValInfo& info = ByValRegs[InRegsParamRecordIndex];
BeginReg = info.Begin;
EndReg = info.End;
}
// Add information about parameter that is kept in registers.
void addInRegsParamInfo(unsigned RegBegin, unsigned RegEnd) {
ByValRegs.push_back(ByValInfo(RegBegin, RegEnd));
}
// Goes either to next byval parameter (excluding "waste" record), or
// to the end of collection.
// Returns false, if end is reached.
bool nextInRegsParam() {
unsigned e = ByValRegs.size();
if (InRegsParamsProceed < e)
++InRegsParamsProceed;
return InRegsParamsProceed < e;
}
// Clear byval registers tracking info.
void clearByValRegsInfo() {
InRegsParamsProceed = 0;
ByValRegs.clear();
}
ParmContext getCallOrPrologue() const { return CallOrPrologue; }

View File

@ -123,12 +123,28 @@ class FastISel {
/// index value.
std::pair<unsigned, bool> getRegForGEPIndex(const Value *V);
/// TryToFoldLoad - The specified machine instr operand is a vreg, and that
/// \brief We're checking to see if we can fold \p LI into \p FoldInst.
/// Note that we could have a sequence where multiple LLVM IR instructions
/// are folded into the same machineinstr. For example we could have:
/// A: x = load i32 *P
/// B: y = icmp A, 42
/// C: br y, ...
///
/// In this scenario, \p LI is "A", and \p FoldInst is "C". We know
/// about "B" (and any other folded instructions) because it is between
/// A and C.
///
/// If we succeed folding, return true.
///
bool tryToFoldLoad(const LoadInst *LI, const Instruction *FoldInst);
/// \brief The specified machine instr operand is a vreg, and that
/// vreg is being provided by the specified load instruction. If possible,
/// try to fold the load as an operand to the instruction, returning true if
/// possible.
virtual bool TryToFoldLoad(MachineInstr * /*MI*/, unsigned /*OpNo*/,
const LoadInst * /*LI*/) {
/// This method should be implemented by targets.
virtual bool tryToFoldLoadIntoMI(MachineInstr * /*MI*/, unsigned /*OpNo*/,
const LoadInst * /*LI*/) {
return false;
}

View File

@ -602,14 +602,6 @@ namespace ISD {
/// specifier.
PREFETCH,
/// OUTCHAIN = MEMBARRIER(INCHAIN, load-load, load-store, store-load,
/// store-store, device)
/// This corresponds to the memory.barrier intrinsic.
/// it takes an input chain, 4 operands to specify the type of barrier, an
/// operand specifying if the barrier applies to device and uncached memory
/// and produces an output chain.
MEMBARRIER,
/// OUTCHAIN = ATOMIC_FENCE(INCHAIN, ordering, scope)
/// This corresponds to the fence instruction. It takes an input chain, and
/// two integer constants: an AtomicOrdering and a SynchronizationScope.

View File

@ -399,6 +399,15 @@ namespace llvm {
return r != end() && r->containsRange(Start, End);
}
/// True iff this live range is a single segment that lies between the
/// specified boundaries, exclusively. Vregs live across a backedge are not
/// considered local. The boundaries are expected to lie within an extended
/// basic block, so vregs that are not live out should contain no holes.
bool isLocal(SlotIndex Start, SlotIndex End) const {
return beginIndex() > Start.getBaseIndex() &&
endIndex() < End.getBoundaryIndex();
}
/// removeRange - Remove the specified range from this interval. Note that
/// the range must be a single LiveRange in its entirety.
void removeRange(SlotIndex Start, SlotIndex End,

View File

@ -196,8 +196,7 @@ class LiveRangeEdit {
/// allocator. These registers should not be split into new intervals
/// as currently those new intervals are not guaranteed to spill.
void eliminateDeadDefs(SmallVectorImpl<MachineInstr*> &Dead,
ArrayRef<unsigned> RegsBeingSpilled
= ArrayRef<unsigned>());
ArrayRef<unsigned> RegsBeingSpilled = None);
/// calculateRegClassAndHint - Recompute register class and hint for each new
/// register.

View File

@ -71,7 +71,6 @@ class MachineBasicBlock : public ilist_node<MachineBasicBlock> {
std::vector<MachineBasicBlock *> Predecessors;
std::vector<MachineBasicBlock *> Successors;
/// Weights - Keep track of the weights to the successors. This vector
/// has the same order as Successors, or it is empty if we don't use it
/// (disable optimization).
@ -96,6 +95,10 @@ class MachineBasicBlock : public ilist_node<MachineBasicBlock> {
/// target of an indirect branch.
bool AddressTaken;
/// \brief since getSymbol is a relatively heavy-weight operation, the symbol
/// is only computed once and is cached.
mutable MCSymbol *CachedMCSymbol;
// Intrusive list support
MachineBasicBlock() {}

View File

@ -352,8 +352,8 @@ class MachineFunction {
// Internal functions used to automatically number MachineBasicBlocks
//
/// getNextMBBNumber - Returns the next unique number to be assigned
/// to a MachineBasicBlock in this MachineFunction.
/// \brief Adds the MBB to the internal numbering. Returns the unique number
/// assigned to the MBB.
///
unsigned addToMBBNumbering(MachineBasicBlock *MBB) {
MBBNumbering.push_back(MBB);

View File

@ -34,22 +34,22 @@ struct MachinePointerInfo {
/// If this is null, then the access is to a pointer in the default address
/// space.
const Value *V;
/// Offset - This is an offset from the base Value*.
int64_t Offset;
explicit MachinePointerInfo(const Value *v = 0, int64_t offset = 0)
: V(v), Offset(offset) {}
MachinePointerInfo getWithOffset(int64_t O) const {
if (V == 0) return MachinePointerInfo(0, 0);
return MachinePointerInfo(V, Offset+O);
}
/// getAddrSpace - Return the LLVM IR address space number that this pointer
/// points into.
unsigned getAddrSpace() const;
/// getConstantPool - Return a MachinePointerInfo record that refers to the
/// constant pool.
static MachinePointerInfo getConstantPool();
@ -57,20 +57,20 @@ struct MachinePointerInfo {
/// getFixedStack - Return a MachinePointerInfo record that refers to the
/// the specified FrameIndex.
static MachinePointerInfo getFixedStack(int FI, int64_t offset = 0);
/// getJumpTable - Return a MachinePointerInfo record that refers to a
/// jump table entry.
static MachinePointerInfo getJumpTable();
/// getGOT - Return a MachinePointerInfo record that refers to a
/// GOT entry.
static MachinePointerInfo getGOT();
/// getStack - stack pointer relative access.
static MachinePointerInfo getStack(int64_t Offset);
};
//===----------------------------------------------------------------------===//
/// MachineMemOperand - A description of a memory reference used in the backend.
/// Instead of holding a StoreInst or LoadInst, this class holds the address
@ -99,8 +99,11 @@ class MachineMemOperand {
MONonTemporal = 8,
/// The memory access is invariant.
MOInvariant = 16,
// Target hints allow target passes to annotate memory operations.
MOTargetStartBit = 5,
MOTargetNumBits = 3,
// This is the number of bits we need to represent flags.
MOMaxBits = 5
MOMaxBits = 8
};
/// MachineMemOperand - Construct an MachineMemOperand object with the
@ -110,7 +113,7 @@ class MachineMemOperand {
const MDNode *Ranges = 0);
const MachinePointerInfo &getPointerInfo() const { return PtrInfo; }
/// getValue - Return the base address of the memory access. This may either
/// be a normal LLVM IR Value, or one of the special values used in CodeGen.
/// Special values are those obtained via
@ -123,6 +126,9 @@ class MachineMemOperand {
/// getFlags - Return the raw flags of the source value, \see MemOperandFlags.
unsigned int getFlags() const { return Flags & ((1 << MOMaxBits) - 1); }
/// Bitwise OR the current flags with the given flags.
void setFlags(unsigned f) { Flags |= (f & ((1 << MOMaxBits) - 1)); }
/// getOffset - For normal values, this is a byte offset added to the base
/// address. For PseudoSourceValue::FPRel values, this is the FrameIndex
/// number.

View File

@ -157,6 +157,12 @@ class MachineRegisterInfo {
// Strictly for use by MachineInstr.cpp.
void moveOperands(MachineOperand *Dst, MachineOperand *Src, unsigned NumOps);
/// Verify the sanity of the use list for Reg.
void verifyUseList(unsigned Reg) const;
/// Verify the use list of all registers.
void verifyUseLists() const;
/// reg_begin/reg_end - Provide iteration support to walk over all definitions
/// and uses of a register within the MachineFunction that corresponds to this
/// MachineRegisterInfo object.

View File

@ -274,6 +274,10 @@ class ScheduleDAGMI : public ScheduleDAGInstrs {
Mutations.push_back(Mutation);
}
/// \brief True if an edge can be added from PredSU to SuccSU without creating
/// a cycle.
bool canAddEdge(SUnit *SuccSU, SUnit *PredSU);
/// \brief Add a DAG edge to the given SU with the given predecessor
/// dependence data.
///
@ -297,6 +301,10 @@ class ScheduleDAGMI : public ScheduleDAGInstrs {
/// reorderable instructions.
virtual void schedule();
/// Change the position of an instruction within the basic block and update
/// live ranges and region boundary iterators.
void moveInstruction(MachineInstr *MI, MachineBasicBlock::iterator InsertPos);
/// Get current register pressure for the top scheduled instructions.
const IntervalPressure &getTopPressure() const { return TopPressure; }
const RegPressureTracker &getTopRPTracker() const { return TopRPTracker; }
@ -362,7 +370,6 @@ class ScheduleDAGMI : public ScheduleDAGInstrs {
void updateScheduledPressure(const std::vector<unsigned> &NewMaxPressure);
void moveInstruction(MachineInstr *MI, MachineBasicBlock::iterator InsertPos);
bool checkSchedLimit();
void findRootsAndBiasEdges(SmallVectorImpl<SUnit*> &TopRoots,

View File

@ -260,9 +260,12 @@ class MachineTraceMetrics : public MachineFunctionPass {
/// independent, exposing the maximum instruction-level parallelism.
///
/// Any blocks in Extrablocks are included as if they were part of the
/// trace.
unsigned getResourceLength(ArrayRef<const MachineBasicBlock*> Extrablocks =
ArrayRef<const MachineBasicBlock*>()) const;
/// trace. Likewise, extra resources required by the specified scheduling
/// classes are included. For the caller to account for extra machine
/// instructions, it must first resolve each instruction's scheduling class.
unsigned getResourceLength(
ArrayRef<const MachineBasicBlock*> Extrablocks = None,
ArrayRef<const MCSchedClassDesc*> ExtraInstrs = None) const;
/// Return the length of the (data dependency) critical path through the
/// trace.

View File

@ -35,6 +35,48 @@ namespace llvm {
class PassConfigImpl;
/// Discriminated union of Pass ID types.
///
/// The PassConfig API prefers dealing with IDs because they are safer and more
/// efficient. IDs decouple configuration from instantiation. This way, when a
/// pass is overriden, it isn't unnecessarily instantiated. It is also unsafe to
/// refer to a Pass pointer after adding it to a pass manager, which deletes
/// redundant pass instances.
///
/// However, it is convient to directly instantiate target passes with
/// non-default ctors. These often don't have a registered PassInfo. Rather than
/// force all target passes to implement the pass registry boilerplate, allow
/// the PassConfig API to handle either type.
///
/// AnalysisID is sadly char*, so PointerIntPair won't work.
class IdentifyingPassPtr {
union {
AnalysisID ID;
Pass *P;
};
bool IsInstance;
public:
IdentifyingPassPtr() : P(0), IsInstance(false) {}
IdentifyingPassPtr(AnalysisID IDPtr) : ID(IDPtr), IsInstance(false) {}
IdentifyingPassPtr(Pass *InstancePtr) : P(InstancePtr), IsInstance(true) {}
bool isValid() const { return P; }
bool isInstance() const { return IsInstance; }
AnalysisID getID() const {
assert(!IsInstance && "Not a Pass ID");
return ID;
}
Pass *getInstance() const {
assert(IsInstance && "Not a Pass Instance");
return P;
}
};
template <> struct isPodLike<IdentifyingPassPtr> {
static const bool value = true;
};
/// Target-Independent Code Generator Pass Configuration Options.
///
/// This is an ImmutablePass solely for the purpose of exposing CodeGen options
@ -117,20 +159,22 @@ class TargetPassConfig : public ImmutablePass {
/// Allow the target to override a specific pass without overriding the pass
/// pipeline. When passes are added to the standard pipeline at the
/// point where StandardID is expected, add TargetID in its place.
void substitutePass(AnalysisID StandardID, AnalysisID TargetID);
void substitutePass(AnalysisID StandardID, IdentifyingPassPtr TargetID);
/// Insert InsertedPassID pass after TargetPassID pass.
void insertPass(AnalysisID TargetPassID, AnalysisID InsertedPassID);
void insertPass(AnalysisID TargetPassID, IdentifyingPassPtr InsertedPassID);
/// Allow the target to enable a specific standard pass by default.
void enablePass(AnalysisID PassID) { substitutePass(PassID, PassID); }
/// Allow the target to disable a specific standard pass by default.
void disablePass(AnalysisID PassID) { substitutePass(PassID, 0); }
void disablePass(AnalysisID PassID) {
substitutePass(PassID, IdentifyingPassPtr());
}
/// Return the pass substituted for StandardID by the target.
/// If no substitution exists, return StandardID.
AnalysisID getPassSubstitution(AnalysisID StandardID) const;
IdentifyingPassPtr getPassSubstitution(AnalysisID StandardID) const;
/// Return true if the optimized regalloc pipeline is enabled.
bool getOptimizeRegAlloc() const;
@ -222,17 +266,6 @@ class TargetPassConfig : public ImmutablePass {
return false;
}
/// addFinalizeRegAlloc - This method may be implemented by targets that want
/// to run passes within the regalloc pipeline, immediately after the register
/// allocation pass itself. These passes run as soon as virtual regisiters
/// have been rewritten to physical registers but before and other postRA
/// optimization happens. Targets that have marked instructions for bundling
/// must have finalized those bundles by the time these passes have run,
/// because subsequent passes are not guaranteed to be bundle-aware.
virtual bool addFinalizeRegAlloc() {
return false;
}
/// addPostRegAlloc - This method may be implemented by targets that want to
/// run passes after register allocation pass pipeline but before
/// prolog-epilog insertion. This should return true if -print-machineinstrs

View File

@ -29,6 +29,7 @@ namespace llvm {
class MachineFunction;
class MachineLoopInfo;
class TargetRegisterInfo;
template<class T> class OwningPtr;
/// This class wraps up a PBQP instance representing a register allocation
/// problem, plus the structures necessary to map back from the PBQP solution
@ -123,11 +124,9 @@ namespace llvm {
/// Build a PBQP instance to represent the register allocation problem for
/// the given MachineFunction.
virtual std::auto_ptr<PBQPRAProblem> build(
MachineFunction *mf,
const LiveIntervals *lis,
const MachineLoopInfo *loopInfo,
const RegSet &vregs);
virtual PBQPRAProblem *build(MachineFunction *mf, const LiveIntervals *lis,
const MachineLoopInfo *loopInfo,
const RegSet &vregs);
private:
void addSpillCosts(PBQP::Vector &costVec, PBQP::PBQPNum spillCost);
@ -144,11 +143,9 @@ namespace llvm {
/// Build a PBQP instance to represent the register allocation problem for
/// the given MachineFunction.
virtual std::auto_ptr<PBQPRAProblem> build(
MachineFunction *mf,
const LiveIntervals *lis,
const MachineLoopInfo *loopInfo,
const RegSet &vregs);
virtual PBQPRAProblem *build(MachineFunction *mf, const LiveIntervals *lis,
const MachineLoopInfo *loopInfo,
const RegSet &vregs);
private:
@ -161,7 +158,7 @@ namespace llvm {
PBQP::PBQPNum benefit);
};
FunctionPass* createPBQPRegisterAllocator(std::auto_ptr<PBQPBuilder> builder,
FunctionPass* createPBQPRegisterAllocator(OwningPtr<PBQPBuilder> &builder,
char *customPassID=0);
}

View File

@ -302,6 +302,7 @@ namespace llvm {
bool isCallOp : 1; // Is a function call operand.
bool isTwoAddress : 1; // Is a two-address instruction.
bool isCommutable : 1; // Is a commutable instruction.
bool hasPhysRegUses : 1; // Has physreg uses.
bool hasPhysRegDefs : 1; // Has physreg defs that are being used.
bool hasPhysRegClobbers : 1; // Has any physreg defs, used or not.
bool isPending : 1; // True once pending.
@ -331,10 +332,10 @@ namespace llvm {
NodeQueueId(0), NumPreds(0), NumSuccs(0), NumPredsLeft(0),
NumSuccsLeft(0), WeakPredsLeft(0), WeakSuccsLeft(0), NumRegDefsLeft(0),
Latency(0), isVRegCycle(false), isCall(false), isCallOp(false),
isTwoAddress(false), isCommutable(false), hasPhysRegDefs(false),
hasPhysRegClobbers(false), isPending(false), isAvailable(false),
isScheduled(false), isScheduleHigh(false), isScheduleLow(false),
isCloned(false), SchedulingPref(Sched::None),
isTwoAddress(false), isCommutable(false), hasPhysRegUses(false),
hasPhysRegDefs(false), hasPhysRegClobbers(false), isPending(false),
isAvailable(false), isScheduled(false), isScheduleHigh(false),
isScheduleLow(false), isCloned(false), SchedulingPref(Sched::None),
isDepthCurrent(false), isHeightCurrent(false), Depth(0), Height(0),
TopReadyCycle(0), BotReadyCycle(0), CopyDstRC(NULL), CopySrcRC(NULL) {}
@ -345,10 +346,10 @@ namespace llvm {
NodeQueueId(0), NumPreds(0), NumSuccs(0), NumPredsLeft(0),
NumSuccsLeft(0), WeakPredsLeft(0), WeakSuccsLeft(0), NumRegDefsLeft(0),
Latency(0), isVRegCycle(false), isCall(false), isCallOp(false),
isTwoAddress(false), isCommutable(false), hasPhysRegDefs(false),
hasPhysRegClobbers(false), isPending(false), isAvailable(false),
isScheduled(false), isScheduleHigh(false), isScheduleLow(false),
isCloned(false), SchedulingPref(Sched::None),
isTwoAddress(false), isCommutable(false), hasPhysRegUses(false),
hasPhysRegDefs(false), hasPhysRegClobbers(false), isPending(false),
isAvailable(false), isScheduled(false), isScheduleHigh(false),
isScheduleLow(false), isCloned(false), SchedulingPref(Sched::None),
isDepthCurrent(false), isHeightCurrent(false), Depth(0), Height(0),
TopReadyCycle(0), BotReadyCycle(0), CopyDstRC(NULL), CopySrcRC(NULL) {}
@ -358,10 +359,10 @@ namespace llvm {
NodeQueueId(0), NumPreds(0), NumSuccs(0), NumPredsLeft(0),
NumSuccsLeft(0), WeakPredsLeft(0), WeakSuccsLeft(0), NumRegDefsLeft(0),
Latency(0), isVRegCycle(false), isCall(false), isCallOp(false),
isTwoAddress(false), isCommutable(false), hasPhysRegDefs(false),
hasPhysRegClobbers(false), isPending(false), isAvailable(false),
isScheduled(false), isScheduleHigh(false), isScheduleLow(false),
isCloned(false), SchedulingPref(Sched::None),
isTwoAddress(false), isCommutable(false), hasPhysRegUses(false),
hasPhysRegDefs(false), hasPhysRegClobbers(false), isPending(false),
isAvailable(false), isScheduled(false), isScheduleHigh(false),
isScheduleLow(false), isCloned(false), SchedulingPref(Sched::None),
isDepthCurrent(false), isHeightCurrent(false), Depth(0), Height(0),
TopReadyCycle(0), BotReadyCycle(0), CopyDstRC(NULL), CopySrcRC(NULL) {}
@ -726,9 +727,8 @@ namespace llvm {
/// IsReachable - Checks if SU is reachable from TargetSU.
bool IsReachable(const SUnit *SU, const SUnit *TargetSU);
/// WillCreateCycle - Returns true if adding an edge from SU to TargetSU
/// will create a cycle.
bool WillCreateCycle(SUnit *SU, SUnit *TargetSU);
/// WillCreateCycle - Return true if addPred(TargetSU, SU) creates a cycle.
bool WillCreateCycle(SUnit *TargetSU, SUnit *SU);
/// AddPred - Updates the topological ordering to accommodate an edge
/// to be added from SUnit X to SUnit Y.

View File

@ -105,6 +105,10 @@ namespace llvm {
MachineBasicBlock::iterator RegionEnd;
/// The index in BB of RegionEnd.
///
/// This is the instruction number from the top of the current block, not
/// the SlotIndex. It is only used by the AntiDepBreaker and should be
/// removed once that client is obsolete.
unsigned EndIndex;
/// After calling BuildSchedGraph, each machine instruction in the current
@ -146,6 +150,9 @@ namespace llvm {
virtual ~ScheduleDAGInstrs() {}
/// \brief Expose LiveIntervals for use in DAG mutators and such.
LiveIntervals *getLIS() const { return LIS; }
/// \brief Get the machine model for instruction scheduling.
const TargetSchedModel *getSchedModel() const { return &SchedModel; }

View File

@ -810,31 +810,32 @@ class SelectionDAG {
MachineSDNode *getMachineNode(unsigned Opcode, DebugLoc dl, EVT VT,
SDValue Op1, SDValue Op2);
MachineSDNode *getMachineNode(unsigned Opcode, DebugLoc dl, EVT VT,
SDValue Op1, SDValue Op2, SDValue Op3);
SDValue Op1, SDValue Op2, SDValue Op3);
MachineSDNode *getMachineNode(unsigned Opcode, DebugLoc dl, EVT VT,
const SDValue *Ops, unsigned NumOps);
ArrayRef<SDValue> Ops);
MachineSDNode *getMachineNode(unsigned Opcode, DebugLoc dl, EVT VT1, EVT VT2);
MachineSDNode *getMachineNode(unsigned Opcode, DebugLoc dl, EVT VT1, EVT VT2,
SDValue Op1);
MachineSDNode *getMachineNode(unsigned Opcode, DebugLoc dl, EVT VT1,
EVT VT2, SDValue Op1, SDValue Op2);
MachineSDNode *getMachineNode(unsigned Opcode, DebugLoc dl, EVT VT1,
EVT VT2, SDValue Op1, SDValue Op2, SDValue Op3);
SDValue Op1);
MachineSDNode *getMachineNode(unsigned Opcode, DebugLoc dl, EVT VT1, EVT VT2,
const SDValue *Ops, unsigned NumOps);
SDValue Op1, SDValue Op2);
MachineSDNode *getMachineNode(unsigned Opcode, DebugLoc dl, EVT VT1, EVT VT2,
EVT VT3, SDValue Op1, SDValue Op2);
SDValue Op1, SDValue Op2, SDValue Op3);
MachineSDNode *getMachineNode(unsigned Opcode, DebugLoc dl, EVT VT1, EVT VT2,
EVT VT3, SDValue Op1, SDValue Op2, SDValue Op3);
ArrayRef<SDValue> Ops);
MachineSDNode *getMachineNode(unsigned Opcode, DebugLoc dl, EVT VT1, EVT VT2,
EVT VT3, const SDValue *Ops, unsigned NumOps);
EVT VT3, SDValue Op1, SDValue Op2);
MachineSDNode *getMachineNode(unsigned Opcode, DebugLoc dl, EVT VT1, EVT VT2,
EVT VT3, EVT VT4, const SDValue *Ops, unsigned NumOps);
EVT VT3, SDValue Op1, SDValue Op2,
SDValue Op3);
MachineSDNode *getMachineNode(unsigned Opcode, DebugLoc dl, EVT VT1, EVT VT2,
EVT VT3, ArrayRef<SDValue> Ops);
MachineSDNode *getMachineNode(unsigned Opcode, DebugLoc dl, EVT VT1, EVT VT2,
EVT VT3, EVT VT4, ArrayRef<SDValue> Ops);
MachineSDNode *getMachineNode(unsigned Opcode, DebugLoc dl,
ArrayRef<EVT> ResultTys, const SDValue *Ops,
unsigned NumOps);
ArrayRef<EVT> ResultTys,
ArrayRef<SDValue> Ops);
MachineSDNode *getMachineNode(unsigned Opcode, DebugLoc dl, SDVTList VTs,
const SDValue *Ops, unsigned NumOps);
ArrayRef<SDValue> Ops);
/// getTargetExtractSubreg - A convenience function for creating
/// TargetInstrInfo::EXTRACT_SUBREG nodes.

View File

@ -259,9 +259,6 @@ class SelectionDAGISel : public MachineFunctionPass {
void SelectBasicBlock(BasicBlock::const_iterator Begin,
BasicBlock::const_iterator End,
bool &HadTailCall);
bool TryToFoldFastISelLoad(const LoadInst *LI, const Instruction *FoldInst,
FastISel *FastIS);
void FinishBasicBlock();
void CodeGenAndEmitDAG();

View File

@ -53,6 +53,20 @@ namespace llvm {
this->index = index;
}
#ifdef EXPENSIVE_CHECKS
// When EXPENSIVE_CHECKS is defined, "erased" index list entries will
// actually be moved to a "graveyard" list, and have their pointers
// poisoned, so that dangling SlotIndex access can be reliably detected.
void setPoison() {
intptr_t tmp = reinterpret_cast<intptr_t>(mi);
assert(((tmp & 0x1) == 0x0) && "Pointer already poisoned?");
tmp |= 0x1;
mi = reinterpret_cast<MachineInstr*>(tmp);
}
bool isPoisoned() const { return (reinterpret_cast<intptr_t>(mi) & 0x1) == 0x1; }
#endif // EXPENSIVE_CHECKS
};
template <>
@ -109,6 +123,10 @@ namespace llvm {
IndexListEntry* listEntry() const {
assert(isValid() && "Attempt to compare reserved index.");
#ifdef EXPENSIVE_CHECKS
assert(!lie.getPointer()->isPoisoned() &&
"Attempt to access deleted list-entry.");
#endif // EXPENSIVE_CHECKS
return lie.getPointer();
}
@ -282,7 +300,6 @@ namespace llvm {
template <> struct isPodLike<SlotIndex> { static const bool value = true; };
inline raw_ostream& operator<<(raw_ostream &os, SlotIndex li) {
li.print(os);
return os;
@ -313,6 +330,10 @@ namespace llvm {
typedef ilist<IndexListEntry> IndexList;
IndexList indexList;
#ifdef EXPENSIVE_CHECKS
IndexList graveyardList;
#endif // EXPENSIVE_CHECKS
MachineFunction *mf;
typedef DenseMap<const MachineInstr*, SlotIndex> Mi2IndexMap;
@ -643,6 +664,32 @@ namespace llvm {
std::sort(idx2MBBMap.begin(), idx2MBBMap.end(), Idx2MBBCompare());
}
/// \brief Free the resources that were required to maintain a SlotIndex.
///
/// Once an index is no longer needed (for instance because the instruction
/// at that index has been moved), the resources required to maintain the
/// index can be relinquished to reduce memory use and improve renumbering
/// performance. Any remaining SlotIndex objects that point to the same
/// index are left 'dangling' (much the same as a dangling pointer to a
/// freed object) and should not be accessed, except to destruct them.
///
/// Like dangling pointers, access to dangling SlotIndexes can cause
/// painful-to-track-down bugs, especially if the memory for the index
/// previously pointed to has been re-used. To detect dangling SlotIndex
/// bugs, build with EXPENSIVE_CHECKS=1. This will cause "erased" indexes to
/// be retained in a graveyard instead of being freed. Operations on indexes
/// in the graveyard will trigger an assertion.
void eraseIndex(SlotIndex index) {
IndexListEntry *entry = index.listEntry();
#ifdef EXPENSIVE_CHECKS
indexList.remove(entry);
graveyardList.push_back(entry);
entry->setPoison();
#else
indexList.erase(entry);
#endif
}
};

View File

@ -128,6 +128,12 @@ class TargetLoweringObjectFileCOFF : public TargetLoweringObjectFile {
virtual const MCSection *
SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
Mangler *Mang, const TargetMachine &TM) const;
/// emitModuleFlags - Emit Obj-C garbage collection and linker options. Only
/// linker option emission is implemented for COFF.
virtual void emitModuleFlags(MCStreamer &Streamer,
ArrayRef<Module::ModuleFlagEntry> ModuleFlags,
Mangler *Mang, const TargetMachine &TM) const;
};
} // end namespace llvm

View File

@ -44,13 +44,13 @@ def v4i8 : ValueType<32 , 20>; // 4 x i8 vector value
def v8i8 : ValueType<64 , 21>; // 8 x i8 vector value
def v16i8 : ValueType<128, 22>; // 16 x i8 vector value
def v32i8 : ValueType<256, 23>; // 32 x i8 vector value
def v64i8 : ValueType<256, 24>; // 64 x i8 vector value
def v64i8 : ValueType<512, 24>; // 64 x i8 vector value
def v1i16 : ValueType<16 , 25>; // 1 x i16 vector value
def v2i16 : ValueType<32 , 26>; // 2 x i16 vector value
def v4i16 : ValueType<64 , 27>; // 4 x i16 vector value
def v8i16 : ValueType<128, 28>; // 8 x i16 vector value
def v16i16 : ValueType<256, 29>; // 16 x i16 vector value
def v32i16 : ValueType<256, 30>; // 32 x i16 vector value
def v32i16 : ValueType<512, 30>; // 32 x i16 vector value
def v1i32 : ValueType<32 , 31>; // 1 x i32 vector value
def v2i32 : ValueType<64 , 32>; // 2 x i32 vector value
def v4i32 : ValueType<128, 33>; // 4 x i32 vector value

View File

@ -69,6 +69,9 @@
/* Define to 1 if you have the `closedir' function. */
#cmakedefine HAVE_CLOSEDIR ${HAVE_CLOSEDIR}
/* Define to 1 if you have the <cxxabi.h> header file. */
#cmakedefine HAVE_CXXABI_H ${HAVE_CXXABI_H}
/* Define to 1 if you have the <CrashReporterClient.h> header file. */
#undef HAVE_CRASHREPORTERCLIENT_H
@ -230,6 +233,9 @@
/* Define to 1 if you have the `udis86' library (-ludis86). */
#undef HAVE_LIBUDIS86
/* Define to 1 if you have the 'z' library (-lz). */
#cmakedefine HAVE_LIBZ ${HAVE_LIBZ}
/* Define to 1 if you have the <limits.h> header file. */
#cmakedefine HAVE_LIMITS_H ${HAVE_LIMITS_H}
@ -498,6 +504,9 @@
/* Define if the xdot.py program is available */
#cmakedefine HAVE_XDOT_PY ${HAVE_XDOT_PY}
/* Define to 1 if you have the <zlib.h> header file. */
#cmakedefine HAVE_ZLIB_H ${HAVE_ZLIB_H}
/* Have host's _alloca */
#cmakedefine HAVE__ALLOCA ${HAVE__ALLOCA}
@ -570,6 +579,9 @@
/* Define if threads enabled */
#cmakedefine01 LLVM_ENABLE_THREADS
/* Define if zlib compression is available */
#cmakedefine01 LLVM_ENABLE_ZLIB
/* Installation directory for config files */
#cmakedefine LLVM_ETCDIR "${LLVM_ETCDIR}"
@ -577,7 +589,7 @@
#cmakedefine01 LLVM_HAS_ATOMICS
/* Host triple LLVM will be executed on */
#cmakedefine LLVM_HOSTTRIPLE "${LLVM_HOSTTRIPLE}"
#cmakedefine LLVM_HOST_TRIPLE "${LLVM_HOST_TRIPLE}"
/* Installation directory for include files */
#cmakedefine LLVM_INCLUDEDIR "${LLVM_INCLUDEDIR}"

View File

@ -78,6 +78,9 @@
/* Define to 1 if you have the <ctype.h> header file. */
#undef HAVE_CTYPE_H
/* Define to 1 if you have the <cxxabi.h> header file. */
#undef HAVE_CXXABI_H
/* Define to 1 if you have the declaration of `FE_ALL_EXCEPT', and to 0 if you
don't. */
#undef HAVE_DECL_FE_ALL_EXCEPT
@ -226,6 +229,9 @@
/* Define to 1 if you have the `udis86' library (-ludis86). */
#undef HAVE_LIBUDIS86
/* Define to 1 if you have the `z' library (-lz). */
#undef HAVE_LIBZ
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
@ -503,6 +509,9 @@
/* Define if the xdot.py program is available */
#undef HAVE_XDOT_PY
/* Define to 1 if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H
/* Have host's _alloca */
#undef HAVE__ALLOCA
@ -575,6 +584,9 @@
/* Define if threads enabled */
#undef LLVM_ENABLE_THREADS
/* Define if zlib is enabled */
#undef LLVM_ENABLE_ZLIB
/* Installation directory for config files */
#undef LLVM_ETCDIR
@ -582,7 +594,7 @@
#undef LLVM_HAS_ATOMICS
/* Host triple LLVM will be executed on */
#undef LLVM_HOSTTRIPLE
#undef LLVM_HOST_TRIPLE
/* Installation directory for include files */
#undef LLVM_INCLUDEDIR

View File

@ -41,7 +41,7 @@
#cmakedefine01 LLVM_HAS_ATOMICS
/* Host triple LLVM will be executed on */
#cmakedefine LLVM_HOSTTRIPLE "${LLVM_HOSTTRIPLE}"
#cmakedefine LLVM_HOST_TRIPLE "${LLVM_HOST_TRIPLE}"
/* Installation directory for include files */
#cmakedefine LLVM_INCLUDEDIR "${LLVM_INCLUDEDIR}"

View File

@ -41,7 +41,7 @@
#undef LLVM_HAS_ATOMICS
/* Host triple LLVM will be executed on */
#undef LLVM_HOSTTRIPLE
#undef LLVM_HOST_TRIPLE
/* Installation directory for include files */
#undef LLVM_INCLUDEDIR

View File

@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
// This file defines a DIBuilder that is useful for creating debugging
// This file defines a DIBuilder that is useful for creating debugging
// information entries in LLVM IR form.
//
//===----------------------------------------------------------------------===//
@ -37,11 +37,13 @@ namespace llvm {
class DIType;
class DIArray;
class DIGlobalVariable;
class DIImportedModule;
class DINameSpace;
class DIVariable;
class DISubrange;
class DILexicalBlockFile;
class DILexicalBlock;
class DIScope;
class DISubprogram;
class DITemplateTypeParameter;
class DITemplateValueParameter;
@ -57,6 +59,7 @@ namespace llvm {
MDNode *TempRetainTypes;
MDNode *TempSubprograms;
MDNode *TempGVs;
MDNode *TempImportedModules;
Function *DeclareFn; // llvm.dbg.declare
Function *ValueFn; // llvm.dbg.value
@ -65,6 +68,7 @@ namespace llvm {
SmallVector<Value *, 4> AllRetainTypes;
SmallVector<Value *, 4> AllSubprograms;
SmallVector<Value *, 4> AllGVs;
SmallVector<Value *, 4> AllImportedModules;
DIBuilder(const DIBuilder &) LLVM_DELETED_FUNCTION;
void operator=(const DIBuilder &) LLVM_DELETED_FUNCTION;
@ -82,18 +86,18 @@ namespace llvm {
/// @param Lang Source programming language, eg. dwarf::DW_LANG_C99
/// @param File File name
/// @param Dir Directory
/// @param Producer String identify producer of debugging information.
/// @param Producer String identify producer of debugging information.
/// Usuall this is a compiler version string.
/// @param isOptimized A boolean flag which indicates whether optimization
/// is ON or not.
/// @param Flags This string lists command line options. This string is
/// @param Flags This string lists command line options. This string is
/// directly embedded in debug info output which may be used
/// by a tool analyzing generated debugging information.
/// @param RV This indicates runtime version for languages like
/// @param RV This indicates runtime version for languages like
/// Objective-C.
/// @param SplitName The name of the file that we'll split debug info out
/// into.
void createCompileUnit(unsigned Lang, StringRef File, StringRef Dir,
void createCompileUnit(unsigned Lang, StringRef File, StringRef Dir,
StringRef Producer, bool isOptimized,
StringRef Flags, unsigned RV,
StringRef SplitName = StringRef());
@ -101,14 +105,14 @@ namespace llvm {
/// createFile - Create a file descriptor to hold debugging information
/// for a file.
DIFile createFile(StringRef Filename, StringRef Directory);
/// createEnumerator - Create a single enumerator value.
DIEnumerator createEnumerator(StringRef Name, uint64_t Val);
/// createNullPtrType - Create C++0x nullptr type.
DIType createNullPtrType(StringRef Name);
/// createBasicType - Create debugging information entry for a basic
/// createBasicType - Create debugging information entry for a basic
/// type.
/// @param Name Type name.
/// @param SizeInBits Size of the type.
@ -158,7 +162,7 @@ namespace llvm {
/// @param Ty Original type.
/// @param BaseTy Base type. Ty is inherits from base.
/// @param BaseOffset Base offset.
/// @param Flags Flags to describe inheritance attribute,
/// @param Flags Flags to describe inheritance attribute,
/// e.g. private
DIDerivedType createInheritance(DIType Ty, DIType BaseTy,
uint64_t BaseOffset, unsigned Flags);
@ -209,8 +213,8 @@ namespace llvm {
/// selector.
/// @param PropertyAttributes Objective C property attributes.
DIType createObjCIVar(StringRef Name, DIFile File,
unsigned LineNo, uint64_t SizeInBits,
uint64_t AlignInBits, uint64_t OffsetInBits,
unsigned LineNo, uint64_t SizeInBits,
uint64_t AlignInBits, uint64_t OffsetInBits,
unsigned Flags, DIType Ty,
StringRef PropertyName = StringRef(),
StringRef PropertyGetterName = StringRef(),
@ -229,8 +233,8 @@ namespace llvm {
/// @param Ty Parent type.
/// @param PropertyNode Property associated with this ivar.
DIType createObjCIVar(StringRef Name, DIFile File,
unsigned LineNo, uint64_t SizeInBits,
uint64_t AlignInBits, uint64_t OffsetInBits,
unsigned LineNo, uint64_t SizeInBits,
uint64_t AlignInBits, uint64_t OffsetInBits,
unsigned Flags, DIType Ty,
MDNode *PropertyNode);
@ -249,7 +253,7 @@ namespace llvm {
StringRef SetterName,
unsigned PropertyAttributes,
DIType Ty);
/// createClassType - Create debugging information entry for a class.
/// @param Scope Scope in which this class is defined.
/// @param Name class name.
@ -261,7 +265,7 @@ namespace llvm {
/// @param Flags Flags to encode member attribute, e.g. private
/// @param Elements class members.
/// @param VTableHolder Debug info of the base class that contains vtable
/// for this type. This is used in
/// for this type. This is used in
/// DW_AT_containing_type. See DWARF documentation
/// for more info.
/// @param TemplateParms Template type parameters.
@ -346,22 +350,25 @@ namespace llvm {
/// @param AlignInBits Alignment.
/// @param Ty Element type.
/// @param Subscripts Subscripts.
DIType createVectorType(uint64_t Size, uint64_t AlignInBits,
DIType createVectorType(uint64_t Size, uint64_t AlignInBits,
DIType Ty, DIArray Subscripts);
/// createEnumerationType - Create debugging information entry for an
/// createEnumerationType - Create debugging information entry for an
/// enumeration.
/// @param Scope Scope in which this enumeration is defined.
/// @param Name Union name.
/// @param File File where this member is defined.
/// @param LineNumber Line number.
/// @param SizeInBits Member size.
/// @param AlignInBits Member alignment.
/// @param Elements Enumeration elements.
DICompositeType createEnumerationType(
DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNumber,
uint64_t SizeInBits, uint64_t AlignInBits, DIArray Elements,
DIType ClassType);
/// @param Scope Scope in which this enumeration is defined.
/// @param Name Union name.
/// @param File File where this member is defined.
/// @param LineNumber Line number.
/// @param SizeInBits Member size.
/// @param AlignInBits Member alignment.
/// @param Elements Enumeration elements.
/// @param UnderlyingType Underlying type of a C++11/ObjC fixed enum.
DICompositeType createEnumerationType(DIDescriptor Scope, StringRef Name,
DIFile File, unsigned LineNumber,
uint64_t SizeInBits,
uint64_t AlignInBits,
DIArray Elements,
DIType UnderlyingType);
/// createSubroutineType - Create subroutine type.
/// @param File File in which this subroutine is defined.
@ -381,7 +388,7 @@ namespace llvm {
DIFile F, unsigned Line, unsigned RuntimeLang = 0,
uint64_t SizeInBits = 0, uint64_t AlignInBits = 0);
/// retainType - Retain DIType in a module even if it is not referenced
/// retainType - Retain DIType in a module even if it is not referenced
/// through debug info anchors.
void retainType(DIType T);
@ -422,7 +429,7 @@ namespace llvm {
unsigned LineNo, DIType Ty, bool isLocalToUnit,
llvm::Value *Val);
/// createStaticVariable - Create a new descriptor for the specified
/// createStaticVariable - Create a new descriptor for the specified
/// variable.
/// @param Context Variable scope.
/// @param Name Name of the variable.
@ -435,13 +442,13 @@ namespace llvm {
/// @param Val llvm::Value of the variable.
/// @param Decl Reference to the corresponding declaration.
DIGlobalVariable
createStaticVariable(DIDescriptor Context, StringRef Name,
StringRef LinkageName, DIFile File, unsigned LineNo,
createStaticVariable(DIDescriptor Context, StringRef Name,
StringRef LinkageName, DIFile File, unsigned LineNo,
DIType Ty, bool isLocalToUnit, llvm::Value *Val,
MDNode *Decl = NULL);
/// createLocalVariable - Create a new descriptor for the specified
/// createLocalVariable - Create a new descriptor for the specified
/// local variable.
/// @param Tag Dwarf TAG. Usually DW_TAG_auto_variable or
/// DW_TAG_arg_variable.
@ -518,7 +525,7 @@ namespace llvm {
/// @param Ty Function type.
/// @param isLocalToUnit True if this function is not externally visible..
/// @param isDefinition True if this is a function definition.
/// @param Virtuality Attributes describing virtualness. e.g. pure
/// @param Virtuality Attributes describing virtualness. e.g. pure
/// virtual function.
/// @param VTableIndex Index no of this method in virtual table.
/// @param VTableHolder Type that holds vtable.
@ -556,7 +563,7 @@ namespace llvm {
/// @param File Source file.
DILexicalBlockFile createLexicalBlockFile(DIDescriptor Scope,
DIFile File);
/// createLexicalBlock - This creates a descriptor for a lexical block
/// with the specified parent context.
/// @param Scope Parent lexical scope.
@ -566,6 +573,13 @@ namespace llvm {
DILexicalBlock createLexicalBlock(DIDescriptor Scope, DIFile File,
unsigned Line, unsigned Col);
/// \brief Create a descriptor for an imported module.
/// @param Context The scope this module is imported into
/// @param NS The namespace being imported here
/// @param Line Line number
DIImportedModule createImportedModule(DIScope Context, DINameSpace NS,
unsigned Line);
/// insertDeclare - Insert a new llvm.dbg.declare intrinsic call.
/// @param Storage llvm::Value of the variable
/// @param VarInfo Variable's debug info descriptor.
@ -587,16 +601,16 @@ namespace llvm {
/// @param VarInfo Variable's debug info descriptor.
/// @param InsertAtEnd Location for the new intrinsic.
Instruction *insertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset,
DIVariable VarInfo,
DIVariable VarInfo,
BasicBlock *InsertAtEnd);
/// insertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call.
/// @param Val llvm::Value of the variable
/// @param Offset Offset
/// @param VarInfo Variable's debug info descriptor.
/// @param InsertBefore Location for the new intrinsic.
Instruction *insertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset,
DIVariable VarInfo,
DIVariable VarInfo,
Instruction *InsertBefore);
};

View File

@ -125,6 +125,7 @@ namespace llvm {
bool isTemplateTypeParameter() const;
bool isTemplateValueParameter() const;
bool isObjCProperty() const;
bool isImportedModule() const;
/// print - print descriptor.
void print(raw_ostream &OS) const;
@ -199,8 +200,9 @@ namespace llvm {
DIArray getRetainedTypes() const;
DIArray getSubprograms() const;
DIArray getGlobalVariables() const;
DIArray getImportedModules() const;
StringRef getSplitDebugFilename() const { return getStringField(11); }
StringRef getSplitDebugFilename() const { return getStringField(12); }
/// Verify - Verify that a compile unit is well formed.
bool Verify() const;
@ -342,7 +344,10 @@ namespace llvm {
/// DICompositeType - This descriptor holds a type that can refer to multiple
/// other types, like a function or struct.
/// FIXME: Why is this a DIDerivedType??
/// DICompositeType is derived from DIDerivedType because some
/// composite types (such as enums) can be derived from basic types
// FIXME: Make this derive from DIType directly & just store the
// base type in a single DIType field.
class DICompositeType : public DIDerivedType {
friend class DIDescriptor;
void printInternal(raw_ostream &OS) const;
@ -678,6 +683,18 @@ namespace llvm {
bool Verify() const;
};
/// \brief An imported module (C++ using directive or similar).
class DIImportedModule : public DIDescriptor {
friend class DIDescriptor;
void printInternal(raw_ostream &OS) const;
public:
explicit DIImportedModule(const MDNode *N) : DIDescriptor(N) { }
DIScope getContext() const { return getFieldAs<DIScope>(1); }
DINameSpace getNameSpace() const { return getFieldAs<DINameSpace>(2); }
unsigned getLineNumber() const { return getUnsignedField(3); }
bool Verify() const;
};
/// getDISubprogram - Find subprogram that is enclosing this scope.
DISubprogram getDISubprogram(const MDNode *Scope);

View File

@ -74,7 +74,7 @@ class DWARFFormValue {
uint32_t *offset_ptr, const DWARFCompileUnit *cu);
static bool isBlockForm(uint16_t form);
static bool isDataForm(uint16_t form);
static const uint8_t *getFixedFormSizesForAddressSize(uint8_t addr_size);
static const uint8_t *getFixedFormSizes(uint8_t AddrSize, uint16_t Version);
};
}

View File

@ -15,6 +15,7 @@
#ifndef LLVM_EXECUTIONENGINE_EXECUTIONENGINE_H
#define LLVM_EXECUTIONENGINE_EXECUTIONENGINE_H
#include "llvm-c/ExecutionEngine.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
@ -42,6 +43,7 @@ class JITMemoryManager;
class MachineCodeInfo;
class Module;
class MutexGuard;
class ObjectCache;
class DataLayout;
class Triple;
class Type;
@ -371,6 +373,12 @@ class ExecutionEngine {
virtual void RegisterJITEventListener(JITEventListener *) {}
virtual void UnregisterJITEventListener(JITEventListener *) {}
/// Sets the pre-compiled object cache. The ownership of the ObjectCache is
/// not changed. Supported by MCJIT but not JIT.
virtual void setObjectCache(ObjectCache *) {
llvm_unreachable("No support for an object cache");
}
/// DisableLazyCompilation - When lazy compilation is off (the default), the
/// JIT will eagerly compile every function reachable from the argument to
/// getPointerToFunction. If lazy compilation is turned on, the JIT will only
@ -625,6 +633,9 @@ class EngineBuilder {
ExecutionEngine *create(TargetMachine *TM);
};
// Create wrappers for C Binding types (see CBindingWrapping.h).
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ExecutionEngine, LLVMExecutionEngineRef)
} // End llvm namespace
#endif

View File

@ -0,0 +1,54 @@
//===-- ObjectCache.h - Class definition for the ObjectCache -----C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIB_EXECUTIONENGINE_OBJECTCACHE_H
#define LLVM_LIB_EXECUTIONENGINE_OBJECTCACHE_H
#include "llvm/Support/MemoryBuffer.h"
namespace llvm {
class Module;
/// This is the base ObjectCache type which can be provided to an
/// ExecutionEngine for the purpose of avoiding compilation for Modules that
/// have already been compiled and an object file is available.
class ObjectCache {
public:
ObjectCache() { }
virtual ~ObjectCache() { }
/// notifyObjectCompiled - Provides a pointer to compiled code for Module M.
virtual void notifyObjectCompiled(const Module *M, const MemoryBuffer *Obj) = 0;
/// getObjectCopy - Returns a pointer to a newly allocated MemoryBuffer that
/// contains the object which corresponds with Module M, or 0 if an object is
/// not available. The caller owns the MemoryBuffer returned by this function.
MemoryBuffer* getObjectCopy(const Module* M) {
const MemoryBuffer* Obj = getObject(M);
if (Obj)
return MemoryBuffer::getMemBufferCopy(Obj->getBuffer());
else
return 0;
}
protected:
/// getObject - Returns a pointer to a MemoryBuffer that contains an object
/// that corresponds with Module M, or 0 if an object is not available.
/// The pointer returned by this function is not suitable for loading because
/// the memory is read-only and owned by the ObjectCache. To retrieve an
/// owning pointer to a MemoryBuffer (which is suitable for calling
/// RuntimeDyld::loadObject() with) use getObjectCopy() instead.
virtual const MemoryBuffer* getObject(const Module* M) = 0;
};
}
#endif

View File

@ -66,6 +66,11 @@ class RTDyldMemoryManager {
///
/// Returns true if an error occurred, false otherwise.
virtual bool applyPermissions(std::string *ErrMsg = 0) = 0;
/// Register the EH frames with the runtime so that c++ exceptions work. The
/// default implementation does nothing. Look at SectionMemoryManager for one
/// that uses __register_frame.
virtual void registerEHFrames(StringRef SectionData);
};
class RuntimeDyld {
@ -109,6 +114,8 @@ class RuntimeDyld {
void mapSectionAddress(const void *LocalAddress, uint64_t TargetAddress);
StringRef getErrorString();
StringRef getEHFrameSection();
};
} // end namespace llvm

View File

@ -72,6 +72,8 @@ class SectionMemoryManager : public JITMemoryManager {
/// \returns true if an error occurred, false otherwise.
virtual bool applyPermissions(std::string *ErrMsg = 0);
void registerEHFrames(StringRef SectionData);
/// This method returns the address of the specified function. As such it is
/// only useful for resolving library symbols, not code generated symbols.
///
@ -87,9 +89,7 @@ class SectionMemoryManager : public JITMemoryManager {
/// explicit cache flush, otherwise JIT code manipulations (like resolved
/// relocations) will get to the data cache but not to the instruction cache.
///
/// This method is not called by RuntimeDyld or MCJIT during the load
/// process. Clients may call this function when needed. See the lli
/// tool for example use.
/// This method is called from applyPermissions.
virtual void invalidateInstructionCache();
private:

View File

@ -78,6 +78,10 @@ class Argument : public Value, public ilist_node<Argument> {
/// containing function.
bool hasStructRetAttr() const;
/// \brief Return true if this argument has the returned attribute on it in
/// its containing function.
bool hasReturnedAttr() const;
/// \brief Add a Attribute to an argument.
void addAttr(AttributeSet AS);

View File

@ -87,6 +87,7 @@ class Attribute {
OptimizeForSize, ///< opt_size
ReadNone, ///< Function does not access memory
ReadOnly, ///< Function only reads from memory
Returned, ///< Return value is always equal to this argument
ReturnsTwice, ///< Function can return twice
SExt, ///< Sign extended before/after call
StackAlignment, ///< Alignment of stack for function (3 bits)
@ -209,7 +210,7 @@ class AttributeSet {
AttributeSetImpl *pImpl;
/// \brief The attributes for the specified index are returned.
AttributeSetNode *getAttributes(unsigned Idx) const;
AttributeSetNode *getAttributes(unsigned Index) const;
/// \brief Create an AttributeSet with the specified parameters in it.
static AttributeSet get(LLVMContext &C,
@ -233,35 +234,35 @@ class AttributeSet {
/// \brief Return an AttributeSet with the specified parameters in it.
static AttributeSet get(LLVMContext &C, ArrayRef<AttributeSet> Attrs);
static AttributeSet get(LLVMContext &C, unsigned Idx,
static AttributeSet get(LLVMContext &C, unsigned Index,
ArrayRef<Attribute::AttrKind> Kind);
static AttributeSet get(LLVMContext &C, unsigned Idx, AttrBuilder &B);
static AttributeSet get(LLVMContext &C, unsigned Index, AttrBuilder &B);
/// \brief Add an attribute to the attribute set at the given index. Since
/// attribute sets are immutable, this returns a new set.
AttributeSet addAttribute(LLVMContext &C, unsigned Idx,
AttributeSet addAttribute(LLVMContext &C, unsigned Index,
Attribute::AttrKind Attr) const;
/// \brief Add an attribute to the attribute set at the given index. Since
/// attribute sets are immutable, this returns a new set.
AttributeSet addAttribute(LLVMContext &C, unsigned Idx,
AttributeSet addAttribute(LLVMContext &C, unsigned Index,
StringRef Kind) const;
/// \brief Add attributes to the attribute set at the given index. Since
/// attribute sets are immutable, this returns a new set.
AttributeSet addAttributes(LLVMContext &C, unsigned Idx,
AttributeSet addAttributes(LLVMContext &C, unsigned Index,
AttributeSet Attrs) const;
/// \brief Remove the specified attribute at the specified index from this
/// attribute list. Since attribute lists are immutable, this returns the new
/// list.
AttributeSet removeAttribute(LLVMContext &C, unsigned Idx,
AttributeSet removeAttribute(LLVMContext &C, unsigned Index,
Attribute::AttrKind Attr) const;
/// \brief Remove the specified attributes at the specified index from this
/// attribute list. Since attribute lists are immutable, this returns the new
/// list.
AttributeSet removeAttributes(LLVMContext &C, unsigned Idx,
AttributeSet removeAttributes(LLVMContext &C, unsigned Index,
AttributeSet Attrs) const;
//===--------------------------------------------------------------------===//
@ -272,7 +273,7 @@ class AttributeSet {
LLVMContext &getContext() const;
/// \brief The attributes for the specified index are returned.
AttributeSet getParamAttributes(unsigned Idx) const;
AttributeSet getParamAttributes(unsigned Index) const;
/// \brief The attributes for the ret value are returned.
AttributeSet getRetAttributes() const;
@ -300,7 +301,7 @@ class AttributeSet {
Attribute getAttribute(unsigned Index, StringRef Kind) const;
/// \brief Return the alignment for the specified function parameter.
unsigned getParamAlignment(unsigned Idx) const;
unsigned getParamAlignment(unsigned Index) const;
/// \brief Get the stack alignment.
unsigned getStackAlignment(unsigned Index) const;
@ -310,8 +311,8 @@ class AttributeSet {
typedef ArrayRef<Attribute>::iterator iterator;
iterator begin(unsigned Idx) const;
iterator end(unsigned Idx) const;
iterator begin(unsigned Slot) const;
iterator end(unsigned Slot) const;
/// operator==/!= - Provide equality predicates.
bool operator==(const AttributeSet &RHS) const {
@ -344,7 +345,7 @@ class AttributeSet {
unsigned getNumSlots() const;
/// \brief Return the index for the given slot.
uint64_t getSlotIndex(unsigned Slot) const;
unsigned getSlotIndex(unsigned Slot) const;
/// \brief Return the attributes at the given slot.
AttributeSet getSlotAttributes(unsigned Slot) const;
@ -473,9 +474,6 @@ class AttrBuilder {
bool td_empty() const { return TargetDepAttrs.empty(); }
/// \brief Remove attributes that are used on functions only.
void removeFunctionOnlyAttrs();
bool operator==(const AttrBuilder &B);
bool operator!=(const AttrBuilder &B) {
return !(*this == B);

View File

@ -18,6 +18,7 @@
#include "llvm/ADT/ilist.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/SymbolTableListTraits.h"
#include "llvm/Support/CBindingWrapping.h"
#include "llvm/Support/DataTypes.h"
namespace llvm {
@ -298,6 +299,9 @@ class BasicBlock : public Value, // Basic blocks are data objects also
}
};
// Create wrappers for C Binding types (see CBindingWrapping.h).
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(BasicBlock, LLVMBasicBlockRef)
} // End llvm namespace
#endif

View File

@ -26,6 +26,7 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/OperandTraits.h"
#include "llvm/IR/DerivedTypes.h"
namespace llvm {
@ -138,7 +139,7 @@ class ConstantInt : public Constant {
/// which reduces the amount of casting needed in parts of the compiler.
///
inline IntegerType *getType() const {
return reinterpret_cast<IntegerType*>(Value::getType());
return cast<IntegerType>(Value::getType());
}
/// This static method returns true if the type Ty is big enough to
@ -354,7 +355,7 @@ class ConstantArray : public Constant {
/// which reduces the amount of casting needed in parts of the compiler.
///
inline ArrayType *getType() const {
return reinterpret_cast<ArrayType*>(Value::getType());
return cast<ArrayType>(Value::getType());
}
virtual void destroyConstant();
@ -412,7 +413,7 @@ class ConstantStruct : public Constant {
/// getType() specialization - Reduce amount of casting...
///
inline StructType *getType() const {
return reinterpret_cast<StructType*>(Value::getType());
return cast<StructType>(Value::getType());
}
virtual void destroyConstant();
@ -455,7 +456,7 @@ class ConstantVector : public Constant {
/// which reduces the amount of casting needed in parts of the compiler.
///
inline VectorType *getType() const {
return reinterpret_cast<VectorType*>(Value::getType());
return cast<VectorType>(Value::getType());
}
/// getSplatValue - If this is a splat constant, meaning that all of the
@ -486,7 +487,7 @@ class ConstantPointerNull : public Constant {
ConstantPointerNull(const ConstantPointerNull &) LLVM_DELETED_FUNCTION;
protected:
explicit ConstantPointerNull(PointerType *T)
: Constant(reinterpret_cast<Type*>(T),
: Constant(T,
Value::ConstantPointerNullVal, 0, 0) {}
protected:
@ -504,7 +505,7 @@ class ConstantPointerNull : public Constant {
/// which reduces the amount of casting needed in parts of the compiler.
///
inline PointerType *getType() const {
return reinterpret_cast<PointerType*>(Value::getType());
return cast<PointerType>(Value::getType());
}
/// Methods for support type inquiry through isa, cast, and dyn_cast:
@ -580,7 +581,7 @@ class ConstantDataSequential : public Constant {
/// SequentialType, which reduces the amount of casting needed in parts of the
/// compiler.
inline SequentialType *getType() const {
return reinterpret_cast<SequentialType*>(Value::getType());
return cast<SequentialType>(Value::getType());
}
/// getElementType - Return the element type of the array/vector.
@ -679,7 +680,7 @@ class ConstantDataArray : public ConstantDataSequential {
/// which reduces the amount of casting needed in parts of the compiler.
///
inline ArrayType *getType() const {
return reinterpret_cast<ArrayType*>(Value::getType());
return cast<ArrayType>(Value::getType());
}
/// Methods for support type inquiry through isa, cast, and dyn_cast:
@ -732,7 +733,7 @@ class ConstantDataVector : public ConstantDataSequential {
/// which reduces the amount of casting needed in parts of the compiler.
///
inline VectorType *getType() const {
return reinterpret_cast<VectorType*>(Value::getType());
return cast<VectorType>(Value::getType());
}
/// Methods for support type inquiry through isa, cast, and dyn_cast:

View File

@ -171,13 +171,13 @@ class DataLayout : public ImmutablePass {
/// Initialize target data from properties stored in the module.
explicit DataLayout(const Module *M);
DataLayout(const DataLayout &TD) :
DataLayout(const DataLayout &DL) :
ImmutablePass(ID),
LittleEndian(TD.isLittleEndian()),
StackNaturalAlign(TD.StackNaturalAlign),
LegalIntWidths(TD.LegalIntWidths),
Alignments(TD.Alignments),
Pointers(TD.Pointers),
LittleEndian(DL.isLittleEndian()),
StackNaturalAlign(DL.StackNaturalAlign),
LegalIntWidths(DL.LegalIntWidths),
Alignments(DL.Alignments),
Pointers(DL.Pointers),
LayoutMap(0)
{ }
@ -426,7 +426,7 @@ class StructLayout {
private:
friend class DataLayout; // Only DataLayout can create this class
StructLayout(StructType *ST, const DataLayout &TD);
StructLayout(StructType *ST, const DataLayout &DL);
};

View File

@ -117,7 +117,7 @@ class FunctionType : public Type {
/// argument type.
static bool isValidArgumentType(Type *ArgTy);
bool isVarArg() const { return getSubclassData(); }
bool isVarArg() const { return getSubclassData()!=0; }
Type *getReturnType() const { return ContainedTys[0]; }
typedef Type::subtype_iterator param_iterator;

View File

@ -19,6 +19,7 @@
#define LLVM_IR_GLOBALVALUE_H
#include "llvm/IR/Constant.h"
#include "llvm/IR/DerivedTypes.h"
namespace llvm {
@ -105,7 +106,7 @@ class GlobalValue : public Constant {
/// getType - Global values are always pointers.
inline PointerType *getType() const {
return reinterpret_cast<PointerType*>(User::getType());
return cast<PointerType>(User::getType());
}
static LinkageTypes getLinkOnceLinkage(bool ODR) {

View File

@ -23,6 +23,7 @@
#include "llvm/IR/Instructions.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Operator.h"
#include "llvm/Support/CBindingWrapping.h"
#include "llvm/Support/ConstantFolder.h"
namespace llvm {
@ -48,6 +49,10 @@ class IRBuilderDefaultInserter {
class IRBuilderBase {
DebugLoc CurDbgLocation;
protected:
/// Save the current debug location here while we are suppressing
/// line table entries.
llvm::DebugLoc SavedDbgLocation;
BasicBlock *BB;
BasicBlock::iterator InsertPt;
LLVMContext &Context;
@ -112,6 +117,23 @@ class IRBuilderBase {
CurDbgLocation = L;
}
/// \brief Temporarily suppress DebugLocations from being attached
/// to emitted instructions, until the next call to
/// SetCurrentDebugLocation() or EnableDebugLocations(). Use this
/// if you want an instruction to be counted towards the prologue or
/// if there is no useful source location.
void DisableDebugLocations() {
llvm::DebugLoc Empty;
SavedDbgLocation = getCurrentDebugLocation();
SetCurrentDebugLocation(Empty);
}
/// \brief Restore the previously saved DebugLocation.
void EnableDebugLocations() {
assert(CurDbgLocation.isUnknown());
SetCurrentDebugLocation(SavedDbgLocation);
}
/// \brief Get location information used by debugging information.
DebugLoc getCurrentDebugLocation() const { return CurDbgLocation; }
@ -1396,6 +1418,9 @@ class IRBuilder : public IRBuilderBase, public Inserter {
}
};
// Create wrappers for C Binding types (see CBindingWrapping.h).
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(IRBuilder<>, LLVMBuilderRef)
}
#endif

View File

@ -45,12 +45,12 @@ namespace Intrinsic {
/// Intrinsic::getName(ID) - Return the LLVM name for an intrinsic, such as
/// "llvm.ppc.altivec.lvx".
std::string getName(ID id, ArrayRef<Type*> Tys = ArrayRef<Type*>());
std::string getName(ID id, ArrayRef<Type*> Tys = None);
/// Intrinsic::getType(ID) - Return the function type for an intrinsic.
///
FunctionType *getType(LLVMContext &Context, ID id,
ArrayRef<Type*> Tys = ArrayRef<Type*>());
ArrayRef<Type*> Tys = None);
/// Intrinsic::isOverloaded(ID) - Returns true if the intrinsic can be
/// overloaded.
@ -63,14 +63,12 @@ namespace Intrinsic {
/// Intrinsic::getDeclaration(M, ID) - Create or insert an LLVM Function
/// declaration for an intrinsic, and return it.
///
/// The Tys and numTys parameters are for intrinsics with overloaded types
/// (e.g., those using iAny, fAny, vAny, or iPTRAny). For a declaration for an
/// overloaded intrinsic, Tys should point to an array of numTys pointers to
/// Type, and must provide exactly one type for each overloaded type in the
/// intrinsic.
Function *getDeclaration(Module *M, ID id,
ArrayRef<Type*> Tys = ArrayRef<Type*>());
/// The Tys parameter is for intrinsics with overloaded types (e.g., those
/// using iAny, fAny, vAny, or iPTRAny). For a declaration of an overloaded
/// intrinsic, Tys must provide exactly one type for each overloaded type in
/// the intrinsic.
Function *getDeclaration(Module *M, ID id, ArrayRef<Type*> Tys = None);
/// Map a GCC builtin name to an intrinsic ID.
ID getIntrinsicForGCCBuiltin(const char *Prefix, const char *BuiltinName);

View File

@ -195,21 +195,21 @@ def int_mips_dpsq_sa_l_w: GCCBuiltin<"__builtin_mips_dpsq_sa_l_w">,
def int_mips_cmpu_eq_qb: GCCBuiltin<"__builtin_mips_cmpu_eq_qb">,
Intrinsic<[], [llvm_v4i8_ty, llvm_v4i8_ty], [Commutative]>;
def int_mips_cmpu_lt_qb: GCCBuiltin<"__builtin_mips_cmpu_lt_qb">,
Intrinsic<[], [llvm_v4i8_ty, llvm_v4i8_ty], [Commutative]>;
Intrinsic<[], [llvm_v4i8_ty, llvm_v4i8_ty], []>;
def int_mips_cmpu_le_qb: GCCBuiltin<"__builtin_mips_cmpu_le_qb">,
Intrinsic<[], [llvm_v4i8_ty, llvm_v4i8_ty], [Commutative]>;
Intrinsic<[], [llvm_v4i8_ty, llvm_v4i8_ty], []>;
def int_mips_cmpgu_eq_qb: GCCBuiltin<"__builtin_mips_cmpgu_eq_qb">,
Intrinsic<[llvm_i32_ty], [llvm_v4i8_ty, llvm_v4i8_ty], [Commutative]>;
def int_mips_cmpgu_lt_qb: GCCBuiltin<"__builtin_mips_cmpgu_lt_qb">,
Intrinsic<[llvm_i32_ty], [llvm_v4i8_ty, llvm_v4i8_ty], [Commutative]>;
Intrinsic<[llvm_i32_ty], [llvm_v4i8_ty, llvm_v4i8_ty], []>;
def int_mips_cmpgu_le_qb: GCCBuiltin<"__builtin_mips_cmpgu_le_qb">,
Intrinsic<[llvm_i32_ty], [llvm_v4i8_ty, llvm_v4i8_ty], [Commutative]>;
Intrinsic<[llvm_i32_ty], [llvm_v4i8_ty, llvm_v4i8_ty], []>;
def int_mips_cmp_eq_ph: GCCBuiltin<"__builtin_mips_cmp_eq_ph">,
Intrinsic<[], [mips_v2q15_ty, mips_v2q15_ty], [Commutative]>;
def int_mips_cmp_lt_ph: GCCBuiltin<"__builtin_mips_cmp_lt_ph">,
Intrinsic<[], [mips_v2q15_ty, mips_v2q15_ty], [Commutative]>;
Intrinsic<[], [mips_v2q15_ty, mips_v2q15_ty], []>;
def int_mips_cmp_le_ph: GCCBuiltin<"__builtin_mips_cmp_le_ph">,
Intrinsic<[], [mips_v2q15_ty, mips_v2q15_ty], [Commutative]>;
Intrinsic<[], [mips_v2q15_ty, mips_v2q15_ty], []>;
//===----------------------------------------------------------------------===//
// Extracting
@ -307,9 +307,9 @@ def int_mips_balign: GCCBuiltin<"__builtin_mips_balign">,
def int_mips_cmpgdu_eq_qb: GCCBuiltin<"__builtin_mips_cmpgdu_eq_qb">,
Intrinsic<[llvm_i32_ty], [llvm_v4i8_ty, llvm_v4i8_ty], [Commutative]>;
def int_mips_cmpgdu_lt_qb: GCCBuiltin<"__builtin_mips_cmpgdu_lt_qb">,
Intrinsic<[llvm_i32_ty], [llvm_v4i8_ty, llvm_v4i8_ty], [Commutative]>;
Intrinsic<[llvm_i32_ty], [llvm_v4i8_ty, llvm_v4i8_ty], []>;
def int_mips_cmpgdu_le_qb: GCCBuiltin<"__builtin_mips_cmpgdu_le_qb">,
Intrinsic<[llvm_i32_ty], [llvm_v4i8_ty, llvm_v4i8_ty], [Commutative]>;
Intrinsic<[llvm_i32_ty], [llvm_v4i8_ty, llvm_v4i8_ty], []>;
def int_mips_dpa_w_ph: GCCBuiltin<"__builtin_mips_dpa_w_ph">,
Intrinsic<[llvm_i64_ty], [llvm_i64_ty, llvm_v2i16_ty, llvm_v2i16_ty],

View File

@ -405,6 +405,8 @@ def llvm_anyi64ptr_ty : LLVMAnyPointerType<llvm_i64_ty>; // (space)i64*
// Sqrt
//
def int_nvvm_sqrt_f : GCCBuiltin<"__nvvm_sqrt_f">,
Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
def int_nvvm_sqrt_rn_ftz_f : GCCBuiltin<"__nvvm_sqrt_rn_ftz_f">,
Intrinsic<[llvm_float_ty], [llvm_float_ty], [IntrNoMem]>;
def int_nvvm_sqrt_rn_f : GCCBuiltin<"__nvvm_sqrt_rn_f">,

View File

@ -117,28 +117,33 @@ let TargetPrefix = "ppc" in { // All intrinsics start with "llvm.ppc.".
// Loads. These don't map directly to GCC builtins because they represent the
// source address with a single pointer.
def int_ppc_altivec_lvx :
Intrinsic<[llvm_v4i32_ty], [llvm_ptr_ty], [IntrReadMem]>;
Intrinsic<[llvm_v4i32_ty], [llvm_ptr_ty], [IntrReadArgMem]>;
def int_ppc_altivec_lvxl :
Intrinsic<[llvm_v4i32_ty], [llvm_ptr_ty], [IntrReadMem]>;
Intrinsic<[llvm_v4i32_ty], [llvm_ptr_ty], [IntrReadArgMem]>;
def int_ppc_altivec_lvebx :
Intrinsic<[llvm_v16i8_ty], [llvm_ptr_ty], [IntrReadMem]>;
Intrinsic<[llvm_v16i8_ty], [llvm_ptr_ty], [IntrReadArgMem]>;
def int_ppc_altivec_lvehx :
Intrinsic<[llvm_v8i16_ty], [llvm_ptr_ty], [IntrReadMem]>;
Intrinsic<[llvm_v8i16_ty], [llvm_ptr_ty], [IntrReadArgMem]>;
def int_ppc_altivec_lvewx :
Intrinsic<[llvm_v4i32_ty], [llvm_ptr_ty], [IntrReadMem]>;
Intrinsic<[llvm_v4i32_ty], [llvm_ptr_ty], [IntrReadArgMem]>;
// Stores. These don't map directly to GCC builtins because they represent the
// source address with a single pointer.
def int_ppc_altivec_stvx :
Intrinsic<[], [llvm_v4i32_ty, llvm_ptr_ty], []>;
Intrinsic<[], [llvm_v4i32_ty, llvm_ptr_ty],
[IntrReadWriteArgMem]>;
def int_ppc_altivec_stvxl :
Intrinsic<[], [llvm_v4i32_ty, llvm_ptr_ty], []>;
Intrinsic<[], [llvm_v4i32_ty, llvm_ptr_ty],
[IntrReadWriteArgMem]>;
def int_ppc_altivec_stvebx :
Intrinsic<[], [llvm_v16i8_ty, llvm_ptr_ty], []>;
Intrinsic<[], [llvm_v16i8_ty, llvm_ptr_ty],
[IntrReadWriteArgMem]>;
def int_ppc_altivec_stvehx :
Intrinsic<[], [llvm_v8i16_ty, llvm_ptr_ty], []>;
Intrinsic<[], [llvm_v8i16_ty, llvm_ptr_ty],
[IntrReadWriteArgMem]>;
def int_ppc_altivec_stvewx :
Intrinsic<[], [llvm_v4i32_ty, llvm_ptr_ty], []>;
Intrinsic<[], [llvm_v4i32_ty, llvm_ptr_ty],
[IntrReadWriteArgMem]>;
// Comparisons setting a vector.
def int_ppc_altivec_vcmpbfp : GCCBuiltin<"__builtin_altivec_vcmpbfp">,

View File

@ -15,7 +15,9 @@
#ifndef LLVM_IR_LLVMCONTEXT_H
#define LLVM_IR_LLVMCONTEXT_H
#include "llvm/Support/CBindingWrapping.h"
#include "llvm/Support/Compiler.h"
#include "llvm-c/Core.h"
namespace llvm {
@ -109,6 +111,19 @@ class LLVMContext {
/// only care about operating on a single thread.
extern LLVMContext &getGlobalContext();
// Create wrappers for C Binding types (see CBindingWrapping.h).
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(LLVMContext, LLVMContextRef)
/* Specialized opaque context conversions.
*/
inline LLVMContext **unwrap(LLVMContextRef* Tys) {
return reinterpret_cast<LLVMContext**>(Tys);
}
inline LLVMContextRef *wrap(const LLVMContext **Tys) {
return reinterpret_cast<LLVMContextRef*>(const_cast<LLVMContext**>(Tys));
}
}
#endif

View File

@ -157,19 +157,31 @@ class MDBuilder {
}
/// \brief Return metadata for a TBAA struct node in the type DAG
/// with the given name, parents in the TBAA DAG.
/// with the given name, a list of pairs (offset, field type in the type DAG).
MDNode *createTBAAStructTypeNode(StringRef Name,
ArrayRef<std::pair<uint64_t, MDNode*> > Fields) {
ArrayRef<std::pair<MDNode*, uint64_t> > Fields) {
SmallVector<Value *, 4> Ops(Fields.size() * 2 + 1);
Type *Int64 = IntegerType::get(Context, 64);
Ops[0] = createString(Name);
for (unsigned i = 0, e = Fields.size(); i != e; ++i) {
Ops[i * 2 + 1] = ConstantInt::get(Int64, Fields[i].first);
Ops[i * 2 + 2] = Fields[i].second;
Ops[i * 2 + 1] = Fields[i].first;
Ops[i * 2 + 2] = ConstantInt::get(Int64, Fields[i].second);
}
return MDNode::get(Context, Ops);
}
/// \brief Return metadata for a TBAA scalar type node with the
/// given name, an offset and a parent in the TBAA type DAG.
MDNode *createTBAAScalarTypeNode(StringRef Name, MDNode *Parent,
uint64_t Offset = 0) {
SmallVector<Value *, 4> Ops(3);
Type *Int64 = IntegerType::get(Context, 64);
Ops[0] = createString(Name);
Ops[1] = Parent;
Ops[2] = ConstantInt::get(Int64, Offset);
return MDNode::get(Context, Ops);
}
/// \brief Return metadata for a TBAA tag node with the given
/// base type, access type and offset relative to the base type.
MDNode *createTBAAStructTagNode(MDNode *BaseType, MDNode *AccessType,

View File

@ -20,6 +20,7 @@
#include "llvm/IR/GlobalAlias.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/Metadata.h"
#include "llvm/Support/CBindingWrapping.h"
#include "llvm/Support/DataTypes.h"
namespace llvm {
@ -584,6 +585,16 @@ inline raw_ostream &operator<<(raw_ostream &O, const Module &M) {
return O;
}
// Create wrappers for C Binding types (see CBindingWrapping.h).
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(Module, LLVMModuleRef)
/* LLVMModuleProviderRef exists for historical reasons, but now just holds a
* Module.
*/
inline Module *unwrap(LLVMModuleProviderRef MP) {
return reinterpret_cast<Module*>(MP);
}
} // End llvm namespace
#endif

View File

@ -17,8 +17,10 @@
#include "llvm/ADT/APFloat.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CBindingWrapping.h"
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm-c/Core.h"
namespace llvm {
@ -467,6 +469,19 @@ template <> struct GraphTraits<const Type*> {
}
};
// Create wrappers for C Binding types (see CBindingWrapping.h).
DEFINE_ISA_CONVERSION_FUNCTIONS(Type, LLVMTypeRef)
/* Specialized opaque type conversions.
*/
inline Type **unwrap(LLVMTypeRef* Tys) {
return reinterpret_cast<Type**>(Tys);
}
inline LLVMTypeRef *wrap(Type **Tys) {
return reinterpret_cast<LLVMTypeRef*>(const_cast<Type**>(Tys));
}
} // End llvm namespace
#endif

View File

@ -26,7 +26,9 @@
#define LLVM_IR_USE_H
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/Support/CBindingWrapping.h"
#include "llvm/Support/Compiler.h"
#include "llvm-c/Core.h"
#include <cstddef>
#include <iterator>
@ -214,6 +216,9 @@ class value_use_iterator : public std::iterator<std::forward_iterator_tag,
unsigned getOperandNo() const;
};
// Create wrappers for C Binding types (see CBindingWrapping.h).
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(Use, LLVMUseRef)
} // End llvm namespace
#endif

Some files were not shown because too many files have changed in this diff Show More