mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
Remove the C backend.
llvm-svn: 153307
This commit is contained in:
parent
224bb6fa26
commit
3839c1ffd3
@ -72,7 +72,6 @@ set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name
|
||||
|
||||
set(LLVM_ALL_TARGETS
|
||||
ARM
|
||||
CBackend
|
||||
CellSPU
|
||||
CppBackend
|
||||
Hexagon
|
||||
|
@ -632,7 +632,7 @@ if test "$enableval" = host-only ; then
|
||||
enableval=host
|
||||
fi
|
||||
case "$enableval" in
|
||||
all) TARGETS_TO_BUILD="X86 Sparc PowerPC ARM Mips CellSPU XCore MSP430 CBackend CppBackend MBlaze PTX Hexagon" ;;
|
||||
all) TARGETS_TO_BUILD="X86 Sparc PowerPC ARM Mips CellSPU XCore MSP430 CppBackend MBlaze PTX Hexagon" ;;
|
||||
*)for a_target in `echo $enableval|sed -e 's/,/ /g' ` ; do
|
||||
case "$a_target" in
|
||||
x86) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
|
||||
@ -645,7 +645,6 @@ case "$enableval" in
|
||||
spu) TARGETS_TO_BUILD="CellSPU $TARGETS_TO_BUILD" ;;
|
||||
xcore) TARGETS_TO_BUILD="XCore $TARGETS_TO_BUILD" ;;
|
||||
msp430) TARGETS_TO_BUILD="MSP430 $TARGETS_TO_BUILD" ;;
|
||||
cbe) TARGETS_TO_BUILD="CBackend $TARGETS_TO_BUILD" ;;
|
||||
cpp) TARGETS_TO_BUILD="CppBackend $TARGETS_TO_BUILD" ;;
|
||||
hexagon) TARGETS_TO_BUILD="Hexagon $TARGETS_TO_BUILD" ;;
|
||||
mblaze) TARGETS_TO_BUILD="MBlaze $TARGETS_TO_BUILD" ;;
|
||||
@ -723,21 +722,6 @@ AC_SUBST(LLVM_ENUM_ASM_PRINTERS)
|
||||
AC_SUBST(LLVM_ENUM_ASM_PARSERS)
|
||||
AC_SUBST(LLVM_ENUM_DISASSEMBLERS)
|
||||
|
||||
dnl Prevent the CBackend from using printf("%a") for floating point so older
|
||||
dnl C compilers that cannot deal with the 0x0p+0 hex floating point format
|
||||
dnl can still compile the CBE's output
|
||||
AC_ARG_ENABLE([cbe-printf-a],AS_HELP_STRING([--enable-cbe-printf-a],
|
||||
[Enable C Backend output with hex floating point via %a (default is YES)]),,
|
||||
enableval=default)
|
||||
case "$enableval" in
|
||||
yes) AC_SUBST(ENABLE_CBE_PRINTF_A,[1]) ;;
|
||||
no) AC_SUBST(ENABLE_CBE_PRINTF_A,[0]) ;;
|
||||
default) AC_SUBST(ENABLE_CBE_PRINTF_A,[1]) ;;
|
||||
*) AC_MSG_ERROR([Invalid setting for --enable-cbe-printf-a. Use "yes" or "no"]) ;;
|
||||
esac
|
||||
AC_DEFINE_UNQUOTED([ENABLE_CBE_PRINTF_A],$ENABLE_CBE_PRINTF_A,
|
||||
[Define if CBE is enabled for printf %a output])
|
||||
|
||||
dnl Override the option to use for optimized builds.
|
||||
AC_ARG_WITH(optimize-option,
|
||||
AS_HELP_STRING([--with-optimize-option],
|
||||
|
36
configure
vendored
36
configure
vendored
@ -705,7 +705,6 @@ LLVM_ENUM_TARGETS
|
||||
LLVM_ENUM_ASM_PRINTERS
|
||||
LLVM_ENUM_ASM_PARSERS
|
||||
LLVM_ENUM_DISASSEMBLERS
|
||||
ENABLE_CBE_PRINTF_A
|
||||
OPTIMIZE_OPTION
|
||||
EXTRA_OPTIONS
|
||||
EXTRA_LD_OPTIONS
|
||||
@ -1422,8 +1421,6 @@ Optional Features:
|
||||
target1,target2,... Valid targets are: host, x86,
|
||||
x86_64, sparc, powerpc, arm, mips, spu, hexagon,
|
||||
xcore, msp430, ptx, cbe, and cpp (default=all)
|
||||
--enable-cbe-printf-a Enable C Backend output with hex floating point via
|
||||
%a (default is YES)
|
||||
--enable-bindings Build specific language bindings:
|
||||
all,auto,none,{binding-name} (default=auto)
|
||||
--enable-libffi Check for the presence of libffi (default is NO)
|
||||
@ -5310,7 +5307,7 @@ if test "$enableval" = host-only ; then
|
||||
enableval=host
|
||||
fi
|
||||
case "$enableval" in
|
||||
all) TARGETS_TO_BUILD="X86 Sparc PowerPC ARM Mips CellSPU XCore MSP430 CBackend CppBackend MBlaze PTX Hexagon" ;;
|
||||
all) TARGETS_TO_BUILD="X86 Sparc PowerPC ARM Mips CellSPU XCore MSP430 CppBackend MBlaze PTX Hexagon" ;;
|
||||
*)for a_target in `echo $enableval|sed -e 's/,/ /g' ` ; do
|
||||
case "$a_target" in
|
||||
x86) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
|
||||
@ -5323,7 +5320,6 @@ case "$enableval" in
|
||||
spu) TARGETS_TO_BUILD="CellSPU $TARGETS_TO_BUILD" ;;
|
||||
xcore) TARGETS_TO_BUILD="XCore $TARGETS_TO_BUILD" ;;
|
||||
msp430) TARGETS_TO_BUILD="MSP430 $TARGETS_TO_BUILD" ;;
|
||||
cbe) TARGETS_TO_BUILD="CBackend $TARGETS_TO_BUILD" ;;
|
||||
cpp) TARGETS_TO_BUILD="CppBackend $TARGETS_TO_BUILD" ;;
|
||||
hexagon) TARGETS_TO_BUILD="Hexagon $TARGETS_TO_BUILD" ;;
|
||||
mblaze) TARGETS_TO_BUILD="MBlaze $TARGETS_TO_BUILD" ;;
|
||||
@ -5420,30 +5416,6 @@ done
|
||||
|
||||
|
||||
|
||||
# Check whether --enable-cbe-printf-a was given.
|
||||
if test "${enable_cbe_printf_a+set}" = set; then
|
||||
enableval=$enable_cbe_printf_a;
|
||||
else
|
||||
enableval=default
|
||||
fi
|
||||
|
||||
case "$enableval" in
|
||||
yes) ENABLE_CBE_PRINTF_A=1
|
||||
;;
|
||||
no) ENABLE_CBE_PRINTF_A=0
|
||||
;;
|
||||
default) ENABLE_CBE_PRINTF_A=1
|
||||
;;
|
||||
*) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-cbe-printf-a. Use \"yes\" or \"no\"" >&5
|
||||
echo "$as_me: error: Invalid setting for --enable-cbe-printf-a. Use \"yes\" or \"no\"" >&2;}
|
||||
{ (exit 1); exit 1; }; } ;;
|
||||
esac
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define ENABLE_CBE_PRINTF_A $ENABLE_CBE_PRINTF_A
|
||||
_ACEOF
|
||||
|
||||
|
||||
|
||||
# Check whether --with-optimize-option was given.
|
||||
if test "${with_optimize_option+set}" = set; then
|
||||
@ -10402,7 +10374,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 10405 "configure"
|
||||
#line 10377 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -13686,7 +13658,6 @@ echo "$as_me: error:
|
||||
/* | [A-Za-z]:[\\/]*) INTEL_JITEVENTS_INCDIR=$withval/include
|
||||
INTEL_JITEVENTS_LIBDIR=$withval/$llvm_intel_jitevents_archdir ;;
|
||||
*) ;;
|
||||
|
||||
esac
|
||||
|
||||
|
||||
@ -22186,7 +22157,6 @@ LLVM_ENUM_TARGETS!$LLVM_ENUM_TARGETS$ac_delim
|
||||
LLVM_ENUM_ASM_PRINTERS!$LLVM_ENUM_ASM_PRINTERS$ac_delim
|
||||
LLVM_ENUM_ASM_PARSERS!$LLVM_ENUM_ASM_PARSERS$ac_delim
|
||||
LLVM_ENUM_DISASSEMBLERS!$LLVM_ENUM_DISASSEMBLERS$ac_delim
|
||||
ENABLE_CBE_PRINTF_A!$ENABLE_CBE_PRINTF_A$ac_delim
|
||||
OPTIMIZE_OPTION!$OPTIMIZE_OPTION$ac_delim
|
||||
EXTRA_OPTIONS!$EXTRA_OPTIONS$ac_delim
|
||||
EXTRA_LD_OPTIONS!$EXTRA_LD_OPTIONS$ac_delim
|
||||
@ -22275,7 +22245,7 @@ LIBOBJS!$LIBOBJS$ac_delim
|
||||
LTLIBOBJS!$LTLIBOBJS$ac_delim
|
||||
_ACEOF
|
||||
|
||||
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 93; then
|
||||
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 92; then
|
||||
break
|
||||
elif $ac_last_try; then
|
||||
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
|
||||
|
@ -105,19 +105,6 @@ function and then be turned into an instruction if warranted.</p>
|
||||
support for it. Generally you must do the following steps:</p>
|
||||
|
||||
<dl>
|
||||
<dt>Add support to the C backend in <tt>lib/Target/CBackend/</tt></dt>
|
||||
|
||||
<dd>Depending on the intrinsic, there are a few ways to implement this. For
|
||||
most intrinsics, it makes sense to add code to lower your intrinsic in
|
||||
<tt>LowerIntrinsicCall</tt> in <tt>lib/CodeGen/IntrinsicLowering.cpp</tt>.
|
||||
Second, if it makes sense to lower the intrinsic to an expanded sequence of
|
||||
C code in all cases, just emit the expansion in <tt>visitCallInst</tt> in
|
||||
<tt>Writer.cpp</tt>. If the intrinsic has some way to express it with GCC
|
||||
(or any other compiler) extensions, it can be conditionally supported based
|
||||
on the compiler compiling the CBE output (see <tt>llvm.prefetch</tt> for an
|
||||
example). Third, if the intrinsic really has no way to be lowered, just
|
||||
have the code generator emit code that prints an error message and calls
|
||||
abort if executed.</dd>
|
||||
|
||||
<dt>Add support to the .td file for the target(s) of your choice in
|
||||
<tt>lib/Target/*/*.td</tt>.</dt>
|
||||
|
@ -1389,7 +1389,7 @@ different <a href="#tools">tools</a>.</p>
|
||||
<dd> This directory contains files that describe various target architectures
|
||||
for code generation. For example, the <tt>llvm/lib/Target/X86</tt>
|
||||
directory holds the X86 machine description while
|
||||
<tt>llvm/lib/Target/CBackend</tt> implements the LLVM-to-C converter.</dd>
|
||||
<tt>llvm/lib/Target/ARM</tt> implements the ARM backend.</dd>
|
||||
|
||||
<dt><tt><b>llvm/lib/CodeGen/</b></tt></dt>
|
||||
<dd> This directory contains the major parts of the code generator: Instruction
|
||||
|
@ -12,9 +12,6 @@
|
||||
/* Directories clang will search for headers */
|
||||
#undef C_INCLUDE_DIRS
|
||||
|
||||
/* Define if CBE is enabled for printf %a output */
|
||||
#undef ENABLE_CBE_PRINTF_A
|
||||
|
||||
/* Define if position independent code is enabled */
|
||||
#undef ENABLE_PIC
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +0,0 @@
|
||||
add_llvm_target(CBackendCodeGen
|
||||
CBackend.cpp
|
||||
)
|
||||
|
||||
add_subdirectory(TargetInfo)
|
@ -1,42 +0,0 @@
|
||||
//===-- CTargetMachine.h - TargetMachine for the C backend ------*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file declares the TargetMachine that is used by the C backend.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef CTARGETMACHINE_H
|
||||
#define CTARGETMACHINE_H
|
||||
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "llvm/Target/TargetData.h"
|
||||
|
||||
namespace llvm {
|
||||
|
||||
struct CTargetMachine : public TargetMachine {
|
||||
CTargetMachine(const Target &T, StringRef TT,
|
||||
StringRef CPU, StringRef FS, const TargetOptions &Options,
|
||||
Reloc::Model RM, CodeModel::Model CM,
|
||||
CodeGenOpt::Level OL)
|
||||
: TargetMachine(T, TT, CPU, FS, Options) { }
|
||||
|
||||
virtual bool addPassesToEmitFile(PassManagerBase &PM,
|
||||
formatted_raw_ostream &Out,
|
||||
CodeGenFileType FileType,
|
||||
bool DisableVerify);
|
||||
|
||||
virtual const TargetData *getTargetData() const { return 0; }
|
||||
};
|
||||
|
||||
extern Target TheCBackendTarget;
|
||||
|
||||
} // End llvm namespace
|
||||
|
||||
|
||||
#endif
|
@ -1,31 +0,0 @@
|
||||
;===- ./lib/Target/CBackend/LLVMBuild.txt ----------------------*- Conf -*--===;
|
||||
;
|
||||
; The LLVM Compiler Infrastructure
|
||||
;
|
||||
; This file is distributed under the University of Illinois Open Source
|
||||
; License. See LICENSE.TXT for details.
|
||||
;
|
||||
;===------------------------------------------------------------------------===;
|
||||
;
|
||||
; This is an LLVMBuild description file for the components in this subdirectory.
|
||||
;
|
||||
; For more information on the LLVMBuild system, please see:
|
||||
;
|
||||
; http://llvm.org/docs/LLVMBuild.html
|
||||
;
|
||||
;===------------------------------------------------------------------------===;
|
||||
|
||||
[common]
|
||||
subdirectories = TargetInfo
|
||||
|
||||
[component_0]
|
||||
type = TargetGroup
|
||||
name = CBackend
|
||||
parent = Target
|
||||
|
||||
[component_1]
|
||||
type = Library
|
||||
name = CBackendCodeGen
|
||||
parent = CBackend
|
||||
required_libraries = Analysis CBackendInfo CodeGen Core MC Scalar Support Target TransformUtils
|
||||
add_to_library_groups = CBackend
|
@ -1,16 +0,0 @@
|
||||
##===- lib/Target/CBackend/Makefile ------------------------*- Makefile -*-===##
|
||||
#
|
||||
# The LLVM Compiler Infrastructure
|
||||
#
|
||||
# This file is distributed under the University of Illinois Open Source
|
||||
# License. See LICENSE.TXT for details.
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
|
||||
LEVEL = ../../..
|
||||
LIBRARYNAME = LLVMCBackendCodeGen
|
||||
DIRS = TargetInfo
|
||||
|
||||
include $(LEVEL)/Makefile.common
|
||||
|
||||
CompileCommonOpts += -Wno-format
|
@ -1,21 +0,0 @@
|
||||
//===-- CBackendTargetInfo.cpp - CBackend Target Implementation -----------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "CTargetMachine.h"
|
||||
#include "llvm/Module.h"
|
||||
#include "llvm/Support/TargetRegistry.h"
|
||||
using namespace llvm;
|
||||
|
||||
Target llvm::TheCBackendTarget;
|
||||
|
||||
extern "C" void LLVMInitializeCBackendTargetInfo() {
|
||||
RegisterTarget<> X(TheCBackendTarget, "c", "C backend");
|
||||
}
|
||||
|
||||
extern "C" void LLVMInitializeCBackendTargetMC() {}
|
@ -1,5 +0,0 @@
|
||||
include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. )
|
||||
|
||||
add_llvm_library(LLVMCBackendInfo
|
||||
CBackendTargetInfo.cpp
|
||||
)
|
@ -1,23 +0,0 @@
|
||||
;===- ./lib/Target/CBackend/TargetInfo/LLVMBuild.txt -----------*- Conf -*--===;
|
||||
;
|
||||
; The LLVM Compiler Infrastructure
|
||||
;
|
||||
; This file is distributed under the University of Illinois Open Source
|
||||
; License. See LICENSE.TXT for details.
|
||||
;
|
||||
;===------------------------------------------------------------------------===;
|
||||
;
|
||||
; This is an LLVMBuild description file for the components in this subdirectory.
|
||||
;
|
||||
; For more information on the LLVMBuild system, please see:
|
||||
;
|
||||
; http://llvm.org/docs/LLVMBuild.html
|
||||
;
|
||||
;===------------------------------------------------------------------------===;
|
||||
|
||||
[component_0]
|
||||
type = Library
|
||||
name = CBackendInfo
|
||||
parent = CBackend
|
||||
required_libraries = MC Support Target
|
||||
add_to_library_groups = CBackend
|
@ -1,15 +0,0 @@
|
||||
##===- lib/Target/CBackend/TargetInfo/Makefile -------------*- Makefile -*-===##
|
||||
#
|
||||
# The LLVM Compiler Infrastructure
|
||||
#
|
||||
# This file is distributed under the University of Illinois Open Source
|
||||
# License. See LICENSE.TXT for details.
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
LEVEL = ../../../..
|
||||
LIBRARYNAME = LLVMCBackendInfo
|
||||
|
||||
# Hack: we need to include 'main' target directory to grab private headers
|
||||
CPPFLAGS = -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/..
|
||||
|
||||
include $(LEVEL)/Makefile.common
|
@ -16,7 +16,7 @@
|
||||
;===------------------------------------------------------------------------===;
|
||||
|
||||
[common]
|
||||
subdirectories = ARM CBackend CellSPU CppBackend Hexagon MBlaze MSP430 Mips PTX PowerPC Sparc X86 XCore
|
||||
subdirectories = ARM CellSPU CppBackend Hexagon MBlaze MSP430 Mips PTX PowerPC Sparc X86 XCore
|
||||
|
||||
; This is a special group whose required libraries are extended (by llvm-build)
|
||||
; with the best execution engine (the native JIT, if available, or the
|
||||
|
@ -554,7 +554,7 @@ if test "$enableval" = host-only ; then
|
||||
enableval=host
|
||||
fi
|
||||
case "$enableval" in
|
||||
all) TARGETS_TO_BUILD="X86 Sparc PowerPC ARM Mips CellSPU XCore MSP430 Hexagon CBackend CppBackend MBlaze PTX" ;;
|
||||
all) TARGETS_TO_BUILD="X86 Sparc PowerPC ARM Mips CellSPU XCore MSP430 Hexagon CppBackend MBlaze PTX" ;;
|
||||
*)for a_target in `echo $enableval|sed -e 's/,/ /g' ` ; do
|
||||
case "$a_target" in
|
||||
x86) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
|
||||
@ -567,7 +567,6 @@ case "$enableval" in
|
||||
xcore) TARGETS_TO_BUILD="XCore $TARGETS_TO_BUILD" ;;
|
||||
msp430) TARGETS_TO_BUILD="MSP430 $TARGETS_TO_BUILD" ;;
|
||||
hexagon) TARGETS_TO_BUILD="Hexagon $TARGETS_TO_BUILD" ;;
|
||||
cbe) TARGETS_TO_BUILD="CBackend $TARGETS_TO_BUILD" ;;
|
||||
cpp) TARGETS_TO_BUILD="CppBackend $TARGETS_TO_BUILD" ;;
|
||||
mblaze) TARGETS_TO_BUILD="MBlaze $TARGETS_TO_BUILD" ;;
|
||||
ptx) TARGETS_TO_BUILD="PTX $TARGETS_TO_BUILD" ;;
|
||||
@ -644,21 +643,6 @@ AC_SUBST(LLVM_ENUM_ASM_PRINTERS)
|
||||
AC_SUBST(LLVM_ENUM_ASM_PARSERS)
|
||||
AC_SUBST(LLVM_ENUM_DISASSEMBLERS)
|
||||
|
||||
dnl Prevent the CBackend from using printf("%a") for floating point so older
|
||||
dnl C compilers that cannot deal with the 0x0p+0 hex floating point format
|
||||
dnl can still compile the CBE's output
|
||||
AC_ARG_ENABLE([cbe-printf-a],AS_HELP_STRING([--enable-cbe-printf-a],
|
||||
[Enable C Backend output with hex floating point via %a (default is YES)]),,
|
||||
enableval=default)
|
||||
case "$enableval" in
|
||||
yes) AC_SUBST(ENABLE_CBE_PRINTF_A,[1]) ;;
|
||||
no) AC_SUBST(ENABLE_CBE_PRINTF_A,[0]) ;;
|
||||
default) AC_SUBST(ENABLE_CBE_PRINTF_A,[1]) ;;
|
||||
*) AC_MSG_ERROR([Invalid setting for --enable-cbe-printf-a. Use "yes" or "no"]) ;;
|
||||
esac
|
||||
AC_DEFINE_UNQUOTED([ENABLE_CBE_PRINTF_A],$ENABLE_CBE_PRINTF_A,
|
||||
[Define if CBE is enabled for printf %a output])
|
||||
|
||||
dnl Override the option to use for optimized builds.
|
||||
AC_ARG_WITH(optimize-option,
|
||||
AS_HELP_STRING([--with-optimize-option],
|
||||
|
35
projects/sample/configure
vendored
35
projects/sample/configure
vendored
@ -704,7 +704,6 @@ LLVM_ENUM_TARGETS
|
||||
LLVM_ENUM_ASM_PRINTERS
|
||||
LLVM_ENUM_ASM_PARSERS
|
||||
LLVM_ENUM_DISASSEMBLERS
|
||||
ENABLE_CBE_PRINTF_A
|
||||
OPTIMIZE_OPTION
|
||||
EXTRA_OPTIONS
|
||||
EXTRA_LD_OPTIONS
|
||||
@ -1402,8 +1401,6 @@ Optional Features:
|
||||
target1,target2,... Valid targets are: host, x86,
|
||||
x86_64, sparc, powerpc, arm, mips, spu, hexagon,
|
||||
xcore, msp430, ptx, cbe, and cpp (default=all)
|
||||
--enable-cbe-printf-a Enable C Backend output with hex floating point via
|
||||
%a (default is YES)
|
||||
--enable-bindings Build specific language bindings:
|
||||
all,auto,none,{binding-name} (default=auto)
|
||||
--enable-libffi Check for the presence of libffi (default is NO)
|
||||
@ -5229,7 +5226,7 @@ if test "$enableval" = host-only ; then
|
||||
enableval=host
|
||||
fi
|
||||
case "$enableval" in
|
||||
all) TARGETS_TO_BUILD="X86 Sparc PowerPC ARM Mips CellSPU XCore MSP430 Hexagon CBackend CppBackend MBlaze PTX" ;;
|
||||
all) TARGETS_TO_BUILD="X86 Sparc PowerPC ARM Mips CellSPU XCore MSP430 Hexagon CppBackend MBlaze PTX" ;;
|
||||
*)for a_target in `echo $enableval|sed -e 's/,/ /g' ` ; do
|
||||
case "$a_target" in
|
||||
x86) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;;
|
||||
@ -5242,7 +5239,6 @@ case "$enableval" in
|
||||
xcore) TARGETS_TO_BUILD="XCore $TARGETS_TO_BUILD" ;;
|
||||
msp430) TARGETS_TO_BUILD="MSP430 $TARGETS_TO_BUILD" ;;
|
||||
hexagon) TARGETS_TO_BUILD="Hexagon $TARGETS_TO_BUILD" ;;
|
||||
cbe) TARGETS_TO_BUILD="CBackend $TARGETS_TO_BUILD" ;;
|
||||
cpp) TARGETS_TO_BUILD="CppBackend $TARGETS_TO_BUILD" ;;
|
||||
mblaze) TARGETS_TO_BUILD="MBlaze $TARGETS_TO_BUILD" ;;
|
||||
ptx) TARGETS_TO_BUILD="PTX $TARGETS_TO_BUILD" ;;
|
||||
@ -5342,30 +5338,6 @@ done
|
||||
|
||||
|
||||
|
||||
# Check whether --enable-cbe-printf-a was given.
|
||||
if test "${enable_cbe_printf_a+set}" = set; then
|
||||
enableval=$enable_cbe_printf_a;
|
||||
else
|
||||
enableval=default
|
||||
fi
|
||||
|
||||
case "$enableval" in
|
||||
yes) ENABLE_CBE_PRINTF_A=1
|
||||
;;
|
||||
no) ENABLE_CBE_PRINTF_A=0
|
||||
;;
|
||||
default) ENABLE_CBE_PRINTF_A=1
|
||||
;;
|
||||
*) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-cbe-printf-a. Use \"yes\" or \"no\"" >&5
|
||||
echo "$as_me: error: Invalid setting for --enable-cbe-printf-a. Use \"yes\" or \"no\"" >&2;}
|
||||
{ (exit 1); exit 1; }; } ;;
|
||||
esac
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define ENABLE_CBE_PRINTF_A $ENABLE_CBE_PRINTF_A
|
||||
_ACEOF
|
||||
|
||||
|
||||
|
||||
# Check whether --with-optimize-option was given.
|
||||
if test "${with_optimize_option+set}" = set; then
|
||||
@ -10297,7 +10269,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 10300 "configure"
|
||||
#line 10272 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -21692,7 +21664,6 @@ LLVM_ENUM_TARGETS!$LLVM_ENUM_TARGETS$ac_delim
|
||||
LLVM_ENUM_ASM_PRINTERS!$LLVM_ENUM_ASM_PRINTERS$ac_delim
|
||||
LLVM_ENUM_ASM_PARSERS!$LLVM_ENUM_ASM_PARSERS$ac_delim
|
||||
LLVM_ENUM_DISASSEMBLERS!$LLVM_ENUM_DISASSEMBLERS$ac_delim
|
||||
ENABLE_CBE_PRINTF_A!$ENABLE_CBE_PRINTF_A$ac_delim
|
||||
OPTIMIZE_OPTION!$OPTIMIZE_OPTION$ac_delim
|
||||
EXTRA_OPTIONS!$EXTRA_OPTIONS$ac_delim
|
||||
EXTRA_LD_OPTIONS!$EXTRA_LD_OPTIONS$ac_delim
|
||||
@ -21776,7 +21747,7 @@ LIBOBJS!$LIBOBJS$ac_delim
|
||||
LTLIBOBJS!$LTLIBOBJS$ac_delim
|
||||
_ACEOF
|
||||
|
||||
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 89; then
|
||||
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 88; then
|
||||
break
|
||||
elif $ac_last_try; then
|
||||
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
|
||||
|
@ -28,8 +28,7 @@ namespace {
|
||||
// for miscompilation.
|
||||
//
|
||||
enum OutputType {
|
||||
AutoPick, RunLLI, RunJIT, RunLLC, RunLLCIA, RunCBE, CBE_bug, LLC_Safe,
|
||||
CompileCustom, Custom
|
||||
AutoPick, RunLLI, RunJIT, RunLLC, RunLLCIA, LLC_Safe, CompileCustom, Custom
|
||||
};
|
||||
|
||||
cl::opt<double>
|
||||
@ -48,8 +47,6 @@ namespace {
|
||||
clEnumValN(RunLLC, "run-llc", "Compile with LLC"),
|
||||
clEnumValN(RunLLCIA, "run-llc-ia",
|
||||
"Compile with LLC with integrated assembler"),
|
||||
clEnumValN(RunCBE, "run-cbe", "Compile with CBE"),
|
||||
clEnumValN(CBE_bug,"cbe-bug", "Find CBE bugs"),
|
||||
clEnumValN(LLC_Safe, "llc-safe", "Use LLC for all"),
|
||||
clEnumValN(CompileCustom, "compile-custom",
|
||||
"Use -compile-command to define a command to "
|
||||
@ -64,7 +61,6 @@ namespace {
|
||||
SafeInterpreterSel(cl::desc("Specify \"safe\" i.e. known-good backend:"),
|
||||
cl::values(clEnumValN(AutoPick, "safe-auto", "Use best guess"),
|
||||
clEnumValN(RunLLC, "safe-run-llc", "Compile with LLC"),
|
||||
clEnumValN(RunCBE, "safe-run-cbe", "Compile with CBE"),
|
||||
clEnumValN(Custom, "safe-run-custom",
|
||||
"Use -exec-command to define a command to execute "
|
||||
"the bitcode. Useful for cross-compilation."),
|
||||
@ -154,10 +150,6 @@ bool BugDriver::initializeExecutionEnvironment() {
|
||||
|
||||
switch (InterpreterSel) {
|
||||
case AutoPick:
|
||||
InterpreterSel = RunCBE;
|
||||
Interpreter =
|
||||
AbstractInterpreter::createCBE(getToolName(), Message, GCCBinary,
|
||||
&ToolArgv, &GCCToolArgv);
|
||||
if (!Interpreter) {
|
||||
InterpreterSel = RunJIT;
|
||||
Interpreter = AbstractInterpreter::createJIT(getToolName(), Message,
|
||||
@ -195,12 +187,6 @@ bool BugDriver::initializeExecutionEnvironment() {
|
||||
Interpreter = AbstractInterpreter::createJIT(getToolName(), Message,
|
||||
&ToolArgv);
|
||||
break;
|
||||
case RunCBE:
|
||||
case CBE_bug:
|
||||
Interpreter = AbstractInterpreter::createCBE(getToolName(), Message,
|
||||
GCCBinary, &ToolArgv,
|
||||
&GCCToolArgv);
|
||||
break;
|
||||
case CompileCustom:
|
||||
Interpreter =
|
||||
AbstractInterpreter::createCustomCompiler(Message, CustomCompileCommand);
|
||||
@ -221,17 +207,6 @@ bool BugDriver::initializeExecutionEnvironment() {
|
||||
std::vector<std::string> SafeToolArgs = SafeToolArgv;
|
||||
switch (SafeInterpreterSel) {
|
||||
case AutoPick:
|
||||
// In "cbe-bug" mode, default to using LLC as the "safe" backend.
|
||||
if (!SafeInterpreter &&
|
||||
InterpreterSel == CBE_bug) {
|
||||
SafeInterpreterSel = RunLLC;
|
||||
SafeToolArgs.push_back("--relocation-model=pic");
|
||||
SafeInterpreter = AbstractInterpreter::createLLC(Path.c_str(), Message,
|
||||
GCCBinary,
|
||||
&SafeToolArgs,
|
||||
&GCCToolArgv);
|
||||
}
|
||||
|
||||
// In "llc-safe" mode, default to using LLC as the "safe" backend.
|
||||
if (!SafeInterpreter &&
|
||||
InterpreterSel == LLC_Safe) {
|
||||
@ -243,17 +218,6 @@ bool BugDriver::initializeExecutionEnvironment() {
|
||||
&GCCToolArgv);
|
||||
}
|
||||
|
||||
// Pick a backend that's different from the test backend. The JIT and
|
||||
// LLC backends share a lot of code, so prefer to use the CBE as the
|
||||
// safe back-end when testing them.
|
||||
if (!SafeInterpreter &&
|
||||
InterpreterSel != RunCBE) {
|
||||
SafeInterpreterSel = RunCBE;
|
||||
SafeInterpreter = AbstractInterpreter::createCBE(Path.c_str(), Message,
|
||||
GCCBinary,
|
||||
&SafeToolArgs,
|
||||
&GCCToolArgv);
|
||||
}
|
||||
if (!SafeInterpreter &&
|
||||
InterpreterSel != RunLLC &&
|
||||
InterpreterSel != RunJIT) {
|
||||
@ -277,11 +241,6 @@ bool BugDriver::initializeExecutionEnvironment() {
|
||||
&GCCToolArgv,
|
||||
SafeInterpreterSel == RunLLCIA);
|
||||
break;
|
||||
case RunCBE:
|
||||
SafeInterpreter = AbstractInterpreter::createCBE(Path.c_str(), Message,
|
||||
GCCBinary, &SafeToolArgs,
|
||||
&GCCToolArgv);
|
||||
break;
|
||||
case Custom:
|
||||
SafeInterpreter =
|
||||
AbstractInterpreter::createCustomExecutor(Message, CustomExecCommand);
|
||||
@ -459,8 +418,8 @@ bool BugDriver::createReferenceFile(Module *M, const std::string &Filename) {
|
||||
errs() << Error;
|
||||
if (Interpreter != SafeInterpreter) {
|
||||
errs() << "*** There is a bug running the \"safe\" backend. Either"
|
||||
<< " debug it (for example with the -run-cbe bugpoint option,"
|
||||
<< " if CBE is being used as the \"safe\" backend), or fix the"
|
||||
<< " debug it (for example with the -run-jit bugpoint option,"
|
||||
<< " if JIT is being used as the \"safe\" backend), or fix the"
|
||||
<< " error some other way.\n";
|
||||
}
|
||||
return false;
|
||||
|
@ -623,94 +623,6 @@ AbstractInterpreter *AbstractInterpreter::createJIT(const char *Argv0,
|
||||
return 0;
|
||||
}
|
||||
|
||||
GCC::FileType CBE::OutputCode(const std::string &Bitcode,
|
||||
sys::Path &OutputCFile, std::string &Error,
|
||||
unsigned Timeout, unsigned MemoryLimit) {
|
||||
sys::Path uniqueFile(Bitcode+".cbe.c");
|
||||
std::string ErrMsg;
|
||||
if (uniqueFile.makeUnique(true, &ErrMsg)) {
|
||||
errs() << "Error making unique filename: " << ErrMsg << "\n";
|
||||
exit(1);
|
||||
}
|
||||
OutputCFile = uniqueFile;
|
||||
std::vector<const char *> LLCArgs;
|
||||
LLCArgs.push_back(LLCPath.c_str());
|
||||
|
||||
// Add any extra LLC args.
|
||||
for (unsigned i = 0, e = ToolArgs.size(); i != e; ++i)
|
||||
LLCArgs.push_back(ToolArgs[i].c_str());
|
||||
|
||||
LLCArgs.push_back("-o");
|
||||
LLCArgs.push_back(OutputCFile.c_str()); // Output to the C file
|
||||
LLCArgs.push_back("-march=c"); // Output C language
|
||||
LLCArgs.push_back(Bitcode.c_str()); // This is the input bitcode
|
||||
LLCArgs.push_back(0);
|
||||
|
||||
outs() << "<cbe>"; outs().flush();
|
||||
DEBUG(errs() << "\nAbout to run:\t";
|
||||
for (unsigned i = 0, e = LLCArgs.size()-1; i != e; ++i)
|
||||
errs() << " " << LLCArgs[i];
|
||||
errs() << "\n";
|
||||
);
|
||||
if (RunProgramWithTimeout(LLCPath, &LLCArgs[0], sys::Path(), sys::Path(),
|
||||
sys::Path(), Timeout, MemoryLimit))
|
||||
Error = ProcessFailure(LLCPath, &LLCArgs[0], Timeout, MemoryLimit);
|
||||
return GCC::CFile;
|
||||
}
|
||||
|
||||
void CBE::compileProgram(const std::string &Bitcode, std::string *Error,
|
||||
unsigned Timeout, unsigned MemoryLimit) {
|
||||
sys::Path OutputCFile;
|
||||
OutputCode(Bitcode, OutputCFile, *Error, Timeout, MemoryLimit);
|
||||
OutputCFile.eraseFromDisk();
|
||||
}
|
||||
|
||||
int CBE::ExecuteProgram(const std::string &Bitcode,
|
||||
const std::vector<std::string> &Args,
|
||||
const std::string &InputFile,
|
||||
const std::string &OutputFile,
|
||||
std::string *Error,
|
||||
const std::vector<std::string> &ArgsForGCC,
|
||||
const std::vector<std::string> &SharedLibs,
|
||||
unsigned Timeout,
|
||||
unsigned MemoryLimit) {
|
||||
sys::Path OutputCFile;
|
||||
OutputCode(Bitcode, OutputCFile, *Error, Timeout, MemoryLimit);
|
||||
|
||||
FileRemover CFileRemove(OutputCFile.str(), !SaveTemps);
|
||||
|
||||
std::vector<std::string> GCCArgs(ArgsForGCC);
|
||||
GCCArgs.insert(GCCArgs.end(), SharedLibs.begin(), SharedLibs.end());
|
||||
|
||||
return gcc->ExecuteProgram(OutputCFile.str(), Args, GCC::CFile,
|
||||
InputFile, OutputFile, Error, GCCArgs,
|
||||
Timeout, MemoryLimit);
|
||||
}
|
||||
|
||||
/// createCBE - Try to find the 'llc' executable
|
||||
///
|
||||
CBE *AbstractInterpreter::createCBE(const char *Argv0,
|
||||
std::string &Message,
|
||||
const std::string &GCCBinary,
|
||||
const std::vector<std::string> *Args,
|
||||
const std::vector<std::string> *GCCArgs) {
|
||||
sys::Path LLCPath =
|
||||
PrependMainExecutablePath("llc", Argv0, (void *)(intptr_t)&createCBE);
|
||||
if (LLCPath.isEmpty()) {
|
||||
Message =
|
||||
"Cannot find `llc' in executable directory!\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
Message = "Found llc: " + LLCPath.str() + "\n";
|
||||
GCC *gcc = GCC::create(Message, GCCBinary, GCCArgs);
|
||||
if (!gcc) {
|
||||
errs() << Message << "\n";
|
||||
exit(1);
|
||||
}
|
||||
return new CBE(LLCPath, gcc, Args);
|
||||
}
|
||||
|
||||
//===---------------------------------------------------------------------===//
|
||||
// GCC abstraction
|
||||
//
|
||||
|
@ -96,7 +96,6 @@ if ($PEROBJ) {
|
||||
$libpath =~ s/^AsmPrinter/CodeGen\/AsmPrinter/;
|
||||
$libpath =~ s/^BitReader/Bitcode\/Reader/;
|
||||
$libpath =~ s/^BitWriter/Bitcode\/Writer/;
|
||||
$libpath =~ s/^CBackend/Target\/CBackend/;
|
||||
$libpath =~ s/^CppBackend/Target\/CppBackend/;
|
||||
$libpath =~ s/^MSIL/Target\/MSIL/;
|
||||
$libpath =~ s/^Core/VMCore/;
|
||||
@ -138,7 +137,6 @@ if ($PEROBJ) {
|
||||
$libpath =~ s/^AsmPrinter/CodeGen\/AsmPrinter/;
|
||||
$libpath =~ s/^BitReader/Bitcode\/Reader/;
|
||||
$libpath =~ s/^BitWriter/Bitcode\/Writer/;
|
||||
$libpath =~ s/^CBackend/Target\/CBackend/;
|
||||
$libpath =~ s/^CppBackend/Target\/CppBackend/;
|
||||
$libpath =~ s/^MSIL/Target\/MSIL/;
|
||||
$libpath =~ s/^Core/VMCore/;
|
||||
|
@ -2,7 +2,7 @@
|
||||
# Do not edit here. If you wish to override these values
|
||||
# edit the last section
|
||||
set target_triplet "x86_64-apple-darwin10"
|
||||
set TARGETS_TO_BUILD "X86 Sparc PowerPC ARM Mips CellSPU PIC16 XCore MSP430 Blackfin CBackend MSIL CppBackend"
|
||||
set TARGETS_TO_BUILD "X86 Sparc PowerPC ARM Mips CellSPU PIC16 XCore MSP430 Blackfin MSIL CppBackend"
|
||||
set srcroot "/Volumes/Data/ddunbar/llvm"
|
||||
set objroot "/Volumes/Data/ddunbar/llvm.obj.64"
|
||||
set srcdir "/Volumes/Data/ddunbar/llvm/test"
|
||||
|
@ -2,7 +2,7 @@
|
||||
# Do not edit here. If you wish to override these values
|
||||
# edit the last section
|
||||
set target_triplet "x86_64-apple-darwin10"
|
||||
set TARGETS_TO_BUILD "X86 Sparc PowerPC ARM Mips CellSPU PIC16 XCore MSP430 Blackfin CBackend MSIL CppBackend"
|
||||
set TARGETS_TO_BUILD "X86 Sparc PowerPC ARM Mips CellSPU PIC16 XCore MSP430 Blackfin MSIL CppBackend"
|
||||
set srcroot "/Volumes/Data/ddunbar/llvm"
|
||||
set objroot "/Volumes/Data/ddunbar/llvm.obj.64"
|
||||
set srcdir "/Volumes/Data/ddunbar/llvm/test"
|
||||
|
Loading…
x
Reference in New Issue
Block a user