Skip to content

Commit

Permalink
Merge with LLVM upstream (build is broken now)
Browse files Browse the repository at this point in the history
  • Loading branch information
krasin committed May 11, 2012
2 parents fd04914 + 4949e98 commit 3966d83
Show file tree
Hide file tree
Showing 1,119 changed files with 73,178 additions and 18,982 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Expand Up @@ -41,3 +41,8 @@ tools/clang
# LLDB, which is tracked independently.
tools/lldb
cbuild/
# lld, which is tracked independently.
tools/lld
# Sphinx build tree, if building in-source dir.
docs/_build

28 changes: 16 additions & 12 deletions CMakeLists.txt
Expand Up @@ -11,11 +11,14 @@ set(CMAKE_MODULE_PATH
)

set(LLVM_VERSION_MAJOR 3)
set(LLVM_VERSION_MINOR 1)
set(LLVM_VERSION_MINOR 2)

set(PACKAGE_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}svn")

set_property(GLOBAL PROPERTY USE_FOLDERS ON)
option(LLVM_USE_FOLDERS "Enable solution folders in Visual Studio. Disable for Express versions." ON)
if ( LLVM_USE_FOLDERS )
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
endif()

include(VersionFromVCS)

Expand Down Expand Up @@ -79,6 +82,7 @@ set(LLVM_ALL_TARGETS
MBlaze
MSP430
DCPU16
NVPTX
PowerPC
PTX
Sparc
Expand Down Expand Up @@ -214,15 +218,6 @@ if( WIN32 AND NOT CYGWIN )
set(LLVM_LIT_TOOLS_DIR "" CACHE PATH "Path to GnuWin32 tools")
endif()

# On Win32 using MS tools, provide an option to set the number of parallel jobs
# to use.
if( MSVC_IDE AND ( MSVC90 OR MSVC10 ) )
# Only Visual Studio 2008 and 2010 officially supports /MP. Visual Studio
# 2005 supports it but it is experimental.
set(LLVM_COMPILER_JOBS "0" CACHE STRING
"Number of parallel compiler jobs. 0 means use all processors. Default is 0.")
endif()

# Define options to control the inclusion and default build behavior for
# components which may not strictly be necessary (tools, runtime, examples, and
# tests).
Expand Down Expand Up @@ -278,11 +273,21 @@ set(LLVMCONFIGLIBRARYDEPENDENCIESINC
"${LLVM_BINARY_DIR}/tools/llvm-config/LibraryDependencies.inc")
set(LLVMBUILDCMAKEFRAG
"${LLVM_BINARY_DIR}/LLVMBuild.cmake")

# Create the list of optional components that are enabled
if (LLVM_USE_INTEL_JITEVENTS)
set(LLVMOPTIONALCOMPONENTS IntelJITEvents)
endif (LLVM_USE_INTEL_JITEVENTS)
if (LLVM_USE_OPROFILE)
set(LLVMOPTIONALCOMPONENTS ${LLVMOPTIONALCOMPONENTS} OProfileJIT)
endif (LLVM_USE_OPROFILE)

message(STATUS "Constructing LLVMBuild project information")
execute_process(
COMMAND ${PYTHON_EXECUTABLE} ${LLVMBUILDTOOL}
--native-target "${LLVM_NATIVE_ARCH}"
--enable-targets "${LLVM_TARGETS_TO_BUILD}"
--enable-optional-components "${LLVMOPTIONALCOMPONENTS}"
--write-library-table ${LLVMCONFIGLIBRARYDEPENDENCIESINC}
--write-cmake-fragment ${LLVMBUILDCMAKEFRAG}
ERROR_VARIABLE LLVMBUILDOUTPUT
Expand Down Expand Up @@ -397,7 +402,6 @@ add_subdirectory(utils/FileUpdate)
add_subdirectory(utils/count)
add_subdirectory(utils/not)
add_subdirectory(utils/llvm-lit)
add_subdirectory(utils/json-bench)
add_subdirectory(utils/yaml-bench)

add_subdirectory(projects)
Expand Down
28 changes: 27 additions & 1 deletion CREDITS.TXT
Expand Up @@ -50,9 +50,15 @@ N: Cameron Buschardt
E: buschard@uiuc.edu
D: The `mem2reg' pass - promotes values stored in memory to registers

N: Brendon Cahoon
E: bcahoon@codeaurora.org
D: Loop unrolling with run-time trip counts.

N: Chandler Carruth
E: chandlerc@gmail.com
D: LinkTimeOptimizer for Linux, via binutils integration, and C API
D: Hashing algorithms and interfaces
D: Inline cost analysis
D: Machine block placement pass

N: Casey Carter
E: ccarter@uiuc.edu
Expand Down Expand Up @@ -83,6 +89,10 @@ N: John T. Criswell
E: criswell@uiuc.edu
D: Original Autoconf support, documentation improvements, bug fixes

N: Anshuman Dasgupta
E: adasgupt@codeaurora.org
D: Deterministic finite automaton based infrastructure for VLIW packetization

N: Stefanus Du Toit
E: stefanus.dutoit@rapidmind.com
D: Bug fixes and minor improvements
Expand Down Expand Up @@ -206,6 +216,10 @@ N: Benjamin Kramer
E: benny.kra@gmail.com
D: Miscellaneous bug fixes

N: Sundeep Kushwaha
E: sundeepk@codeaurora.org
D: Implemented DFA-based target independent VLIW packetizer

N: Christopher Lamb
E: christopher.lamb@gmail.com
D: aligned load/store support, parts of noalias and restrict support
Expand Down Expand Up @@ -241,6 +255,10 @@ N: Nick Lewycky
E: nicholas@mxc.ca
D: PredicateSimplifier pass

N: Tony Linthicum, et. al.
E: tlinth@codeaurora.org
D: Backend for Qualcomm's Hexagon VLIW processor.

N: Bruno Cardoso Lopes
E: bruno.cardoso@gmail.com
W: http://www.brunocardoso.org
Expand All @@ -267,6 +285,10 @@ N: Scott Michel
E: scottm@aero.org
D: Added STI Cell SPU backend.

N: Kai Nacke
E: kai@redstar.de
D: Support for implicit TLS model used with MS VC runtime

N: Takumi Nakamura
E: geek4civic@gmail.com
E: chapuni@hf.rim.or.jp
Expand Down Expand Up @@ -320,6 +342,10 @@ W: http://vladimir_prus.blogspot.com
E: ghost@cs.msu.su
D: Made inst_iterator behave like a proper iterator, LowerConstantExprs pass

N: Kalle Raiskila
E: kalle.rasikila@nokia.com
D: Some bugfixes to CellSPU

N: Xerxes Ranby
E: xerxes@zafena.se
D: Cmake dependency chain and various bug fixes
Expand Down
7 changes: 7 additions & 0 deletions Makefile.config.in
Expand Up @@ -351,3 +351,10 @@ INTEL_JITEVENTS_LIBDIR := @INTEL_JITEVENTS_LIBDIR@

# Flags to control building support for OProfile JIT API
USE_OPROFILE := @USE_OPROFILE@

ifeq ($(USE_INTEL_JITEVENTS), 1)
OPTIONAL_COMPONENTS += IntelJITEvents
endif
ifeq ($(USE_OPROFILE), 1)
OPTIONAL_COMPONENTS += OProfileJIT
endif
6 changes: 2 additions & 4 deletions Makefile.rules
Expand Up @@ -100,6 +100,7 @@ $(LLVMBuildMakeFrag): $(PROJ_SRC_ROOT)/Makefile.rules \
$(Verb) $(LLVMBuildTool) \
--native-target "$(TARGET_NATIVE_ARCH)" \
--enable-targets "$(TARGETS_TO_BUILD)" \
--enable-optional-components "$(OPTIONAL_COMPONENTS)" \
--write-library-table $(LLVMConfigLibraryDependenciesInc) \
--write-make-fragment $(LLVMBuildMakeFrag)

Expand Down Expand Up @@ -537,9 +538,6 @@ ifeq ($(LLVM_CROSS_COMPILING),1)
else
LLVM_CONFIG := $(LLVMToolDir)/llvm-config$(EXEEXT)
endif
ifndef LLVMLD
LLVMLD := $(LLVMToolDir)/llvm-ld$(EXEEXT)
endif
ifndef LLVMDIS
LLVMDIS := $(LLVMToolDir)/llvm-dis$(EXEEXT)
endif
Expand Down Expand Up @@ -1432,7 +1430,7 @@ LD.Flags += -Wl,-exported_symbol,_main
endif
endif

ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux NetBSD FreeBSD))
ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux NetBSD FreeBSD GNU))
ifneq ($(ARCH), Mips)
LD.Flags += -Wl,--version-script=$(LLVM_SRC_ROOT)/autoconf/ExportMap.map
endif
Expand Down
23 changes: 16 additions & 7 deletions autoconf/configure.ac
Expand Up @@ -31,9 +31,9 @@ dnl===
dnl===-----------------------------------------------------------------------===
dnl Initialize autoconf and define the package name, version number and
dnl address for reporting bugs.
AC_INIT([LLVM],[3.1svn],[http://llvm.org/bugs/])
AC_INIT([LLVM],[3.2svn],[http://llvm.org/bugs/])
AC_DEFINE([LLVM_VERSION_MAJOR], [3], [Major version of the LLVM API])
AC_DEFINE([LLVM_VERSION_MINOR], [1], [Minor version of the LLVM API])
AC_DEFINE([LLVM_VERSION_MINOR], [2], [Minor version of the LLVM API])

dnl Provide a copyright substitution and ensure the copyright notice is included
dnl in the output of --version option of the generated configure script.
Expand Down Expand Up @@ -371,6 +371,7 @@ AC_CACHE_CHECK([target architecture],[llvm_cv_target_arch],
hexagon-*) llvm_cv_target_arch="Hexagon" ;;
mblaze-*) llvm_cv_target_arch="MBlaze" ;;
ptx-*) llvm_cv_target_arch="PTX" ;;
nvptx-*) llvm_cv_target_arch="NVPTX" ;;
*) llvm_cv_target_arch="Unknown" ;;
esac])

Expand Down Expand Up @@ -519,6 +520,7 @@ else
Hexagon) AC_SUBST(TARGET_HAS_JIT,0) ;;
MBlaze) AC_SUBST(TARGET_HAS_JIT,0) ;;
PTX) AC_SUBST(TARGET_HAS_JIT,0) ;;
NVPTX) AC_SUBST(TARGET_HAS_JIT,0) ;;
*) AC_SUBST(TARGET_HAS_JIT,0) ;;
esac
fi
Expand Down Expand Up @@ -630,13 +632,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, mips, spu, hexagon,
xcore, msp430, dcpu16, ptx, cbe, and cpp (default=all)]),,
xcore, msp430, dcpu16, ptx, nvptx, cbe, 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 ARM Mips CellSPU XCore MSP430 DCPU16 CppBackend MBlaze PTX Hexagon" ;;
all) TARGETS_TO_BUILD="X86 Sparc PowerPC ARM Mips CellSPU XCore MSP430 DCPU16 CppBackend MBlaze PTX NVPTX Hexagon" ;;
*)for a_target in `echo $enableval|sed -e 's/,/ /g' ` ; do
case "$a_target" in
x86) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
Expand All @@ -654,6 +656,7 @@ case "$enableval" in
hexagon) TARGETS_TO_BUILD="Hexagon $TARGETS_TO_BUILD" ;;
mblaze) TARGETS_TO_BUILD="MBlaze $TARGETS_TO_BUILD" ;;
ptx) TARGETS_TO_BUILD="PTX $TARGETS_TO_BUILD" ;;
nvptx) TARGETS_TO_BUILD="NVPTX $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" ;;
Expand All @@ -668,6 +671,7 @@ case "$enableval" in
DCPU16) TARGETS_TO_BUILD="DCPU16 $TARGETS_TO_BUILD" ;;
Hexagon) TARGETS_TO_BUILD="Hexagon $TARGETS_TO_BUILD" ;;
PTX) TARGETS_TO_BUILD="PTX $TARGETS_TO_BUILD" ;;
NVPTX) TARGETS_TO_BUILD="NVPTX $TARGETS_TO_BUILD" ;;
*) AC_MSG_ERROR([Can not set target to build]) ;;
esac ;;
*) AC_MSG_ERROR([Unrecognized target $a_target]) ;;
Expand Down Expand Up @@ -842,6 +846,13 @@ AC_ARG_WITH(gcc-toolchain,
AC_DEFINE_UNQUOTED(GCC_INSTALL_PREFIX,"$withval",
[Directory where gcc is installed.])

AC_ARG_WITH(default-sysroot,
AS_HELP_STRING([--with-default-sysroot],
[Add --sysroot=<path> to all compiler invocations.]),,
withval="")
AC_DEFINE_UNQUOTED(DEFAULT_SYSROOT,"$withval",
[Default <path> to all compiler invocations for --sysroot=<path>.])

dnl Allow linking of LLVM with GPLv3 binutils code.
AC_ARG_WITH(binutils-include,
AS_HELP_STRING([--with-binutils-include],
Expand Down Expand Up @@ -1021,8 +1032,6 @@ AC_PATH_PROG(CAT, [cat])
AC_PATH_PROG(DOXYGEN, [doxygen])
AC_PATH_PROG(GROFF, [groff])
AC_PATH_PROG(GZIPBIN, [gzip])
AC_PATH_PROG(POD2HTML, [pod2html])
AC_PATH_PROG(POD2MAN, [pod2man])
AC_PATH_PROG(PDFROFF, [pdfroff])
AC_PATH_PROG(RUNTEST, [runtest])
DJ_AC_PATH_TCLSH
Expand Down Expand Up @@ -1339,7 +1348,7 @@ AC_CHECK_FUNCS([powf fmodf strtof round ])
AC_CHECK_FUNCS([getpagesize getrusage getrlimit setrlimit gettimeofday ])
AC_CHECK_FUNCS([isatty mkdtemp mkstemp ])
AC_CHECK_FUNCS([mktemp posix_spawn pread realpath sbrk setrlimit strdup ])
AC_CHECK_FUNCS([strerror strerror_r setenv ])
AC_CHECK_FUNCS([strerror strerror_r setenv arc4random ])
AC_CHECK_FUNCS([strtoll strtoq sysconf malloc_zone_statistics ])
AC_CHECK_FUNCS([setjmp longjmp sigsetjmp siglongjmp writev])
AC_C_PRINTF_A
Expand Down
2 changes: 2 additions & 0 deletions cmake/config-ix.cmake
Expand Up @@ -91,6 +91,7 @@ if( NOT PURE_WINDOWS )
endif()

# function checks
check_symbol_exists(arc4random "stdlib.h" HAVE_ARC4RANDOM)
check_symbol_exists(getpagesize unistd.h HAVE_GETPAGESIZE)
check_symbol_exists(getrusage sys/resource.h HAVE_GETRUSAGE)
check_symbol_exists(setrlimit sys/resource.h HAVE_SETRLIMIT)
Expand Down Expand Up @@ -240,6 +241,7 @@ llvm_find_program(fdp)
llvm_find_program(dot)
llvm_find_program(dotty)
llvm_find_program(xdot.py)
llvm_find_program(Graphviz)

if( LLVM_ENABLE_FFI )
find_path(FFI_INCLUDE_PATH ffi.h PATHS ${FFI_INCLUDE_DIR})
Expand Down
18 changes: 18 additions & 0 deletions cmake/modules/AddLLVM.cmake
Expand Up @@ -130,3 +130,21 @@ macro(add_llvm_target target_name)
add_llvm_library(LLVM${target_name} ${ARGN} ${TABLEGEN_OUTPUT})
set( CURRENT_LLVM_TARGET LLVM${target_name} )
endmacro(add_llvm_target)

# Add external project that may want to be built as part of llvm such as Clang,
# lld, and Polly. This adds two options. One for the source directory of the
# project, which defaults to ${CMAKE_CURRENT_SOURCE_DIR}/${name}. Another to
# enable or disable building it with everthing else.
macro(add_llvm_external_project name)
string(TOUPPER ${name} nameUPPER)
set(LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${name}"
CACHE PATH "Path to ${name} source directory")
if (NOT ${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR} STREQUAL ""
AND EXISTS ${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR}/CMakeLists.txt)
option(LLVM_EXTERNAL_${nameUPPER}_BUILD
"Whether to build ${name} as part of LLVM" ON)
if (LLVM_EXTERNAL_${nameUPPER}_BUILD)
add_subdirectory(${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR} ${name})
endif()
endif()
endmacro(add_llvm_external_project)
6 changes: 3 additions & 3 deletions cmake/modules/HandleLLVMOptions.cmake
Expand Up @@ -110,9 +110,9 @@ if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )
endif( LLVM_BUILD_32_BITS )
endif( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )

if( MSVC_IDE AND ( MSVC90 OR MSVC10 ) )
# Only Visual Studio 2008 and 2010 officially supports /MP.
# Visual Studio 2005 do support it but it's experimental there.
# On Win32 using MS tools, provide an option to set the number of parallel jobs
# to use.
if( MSVC_IDE )
set(LLVM_COMPILER_JOBS "0" CACHE STRING
"Number of parallel compiler jobs. 0 means use all processors. Default is 0.")
if( NOT LLVM_COMPILER_JOBS STREQUAL "1" )
Expand Down

0 comments on commit 3966d83

Please sign in to comment.