Import LLVM/clang from vendor stripped of docs/ test/ website/ www/ examples/

in llvm/ and/or llvm/contrib/clang/ respectively.

Approved by:	ed (mentor)
Approved by:	core
This commit is contained in:
Roman Divacky 2010-06-09 17:59:52 +00:00
commit f22ef01c33
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=208954
3178 changed files with 1198913 additions and 0 deletions

397
contrib/llvm/CMakeLists.txt Normal file
View file

@ -0,0 +1,397 @@
# See docs/CMake.html for instructions about how to build LLVM with CMake.
project(LLVM)
cmake_minimum_required(VERSION 2.6.1)
set(PACKAGE_NAME llvm)
set(PACKAGE_VERSION 2.7svn)
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "llvmbugs@cs.uiuc.edu")
if( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE )
message(FATAL_ERROR "In-source builds are not allowed.
CMake would overwrite the makefiles distributed with LLVM.
Please create a directory and run cmake from there, passing the path
to this source directory as the last argument.
This process created the file `CMakeCache.txt' and the directory `CMakeFiles'.
Please delete them.")
endif()
string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
set(LLVM_MAIN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(LLVM_MAIN_INCLUDE_DIR ${LLVM_MAIN_SRC_DIR}/include)
set(LLVM_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(LLVM_TOOLS_BINARY_DIR ${LLVM_BINARY_DIR}/bin)
set(LLVM_EXAMPLES_BINARY_DIR ${LLVM_BINARY_DIR}/examples)
set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
if( NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR )
file(GLOB_RECURSE
tablegenned_files_on_include_dir
"${LLVM_MAIN_SRC_DIR}/include/llvm/*.gen")
file(GLOB_RECURSE
tablegenned_files_on_lib_dir
"${LLVM_MAIN_SRC_DIR}/lib/Target/*.inc")
if( tablegenned_files_on_include_dir OR tablegenned_files_on_lib_dir)
message(FATAL_ERROR "Apparently there is a previous in-source build,
probably as the result of running `configure' and `make' on
${LLVM_MAIN_SRC_DIR}.
This may cause problems. The suspicious files are:
${tablegenned_files_on_lib_dir}
${tablegenned_files_on_include_dir}
Please clean the source directory.")
endif()
endif()
set(LLVM_ALL_TARGETS
Alpha
ARM
Blackfin
CBackend
CellSPU
CppBackend
Mips
MBlaze
MSIL
MSP430
PIC16
PowerPC
Sparc
SystemZ
X86
XCore
)
if( MSVC )
set(LLVM_TARGETS_TO_BUILD X86
CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
else( MSVC )
set(LLVM_TARGETS_TO_BUILD ${LLVM_ALL_TARGETS}
CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
endif( MSVC )
set(C_INCLUDE_DIRS "" CACHE STRING
"Colon separated list of directories clang will search for headers.")
set(LLVM_TARGET_ARCH "host"
CACHE STRING "Set target to use for LLVM JIT or use \"host\" for automatic detection.")
option(LLVM_ENABLE_THREADS "Use threads if available." ON)
if( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )
option(LLVM_ENABLE_ASSERTIONS "Enable assertions" OFF)
else()
option(LLVM_ENABLE_ASSERTIONS "Enable assertions" ON)
endif()
if( LLVM_ENABLE_ASSERTIONS )
# MSVC doesn't like _DEBUG on release builds. See PR 4379.
if( NOT MSVC )
add_definitions( -D_DEBUG )
endif()
# On Release builds cmake automatically defines NDEBUG, so we
# explicitly undefine it:
if( uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )
add_definitions( -UNDEBUG )
endif()
else()
if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )
add_definitions( -DNDEBUG )
endif()
endif()
if( LLVM_TARGETS_TO_BUILD STREQUAL "all" )
set( LLVM_TARGETS_TO_BUILD ${LLVM_ALL_TARGETS} )
endif()
set(LLVM_ENUM_TARGETS "")
foreach(c ${LLVM_TARGETS_TO_BUILD})
list(FIND LLVM_ALL_TARGETS ${c} idx)
if( idx LESS 0 )
message(FATAL_ERROR "The target `${c}' does not exist.
It should be one of\n${LLVM_ALL_TARGETS}")
else()
set(LLVM_ENUM_TARGETS "${LLVM_ENUM_TARGETS}LLVM_TARGET(${c})\n")
endif()
endforeach(c)
# Produce llvm/Config/Targets.def
configure_file(
${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/Targets.def.in
${LLVM_BINARY_DIR}/include/llvm/Config/Targets.def
)
set(llvm_builded_incs_dir ${LLVM_BINARY_DIR}/include/llvm)
# Add path for custom modules
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
"${LLVM_MAIN_SRC_DIR}/cmake"
"${LLVM_MAIN_SRC_DIR}/cmake/modules"
)
include(AddLLVMDefinitions)
if(WIN32)
if(CYGWIN)
set(LLVM_ON_WIN32 0)
set(LLVM_ON_UNIX 1)
else(CYGWIN)
set(LLVM_ON_WIN32 1)
set(LLVM_ON_UNIX 0)
endif(CYGWIN)
set(LTDL_SHLIB_EXT ".dll")
set(EXEEXT ".exe")
# Maximum path length is 160 for non-unicode paths
set(MAXPATHLEN 160)
else(WIN32)
if(UNIX)
set(LLVM_ON_WIN32 0)
set(LLVM_ON_UNIX 1)
if(APPLE)
set(LTDL_SHLIB_EXT ".dylib")
else(APPLE)
set(LTDL_SHLIB_EXT ".so")
endif(APPLE)
set(EXEEXT "")
# FIXME: Maximum path length is currently set to 'safe' fixed value
set(MAXPATHLEN 2024)
else(UNIX)
MESSAGE(SEND_ERROR "Unable to determine platform")
endif(UNIX)
endif(WIN32)
include(config-ix)
option(LLVM_ENABLE_PIC "Build Position-Independent Code" ON)
set(ENABLE_PIC 0)
if( LLVM_ENABLE_PIC )
if( XCODE )
# Xcode has -mdynamic-no-pic on by default, which overrides -fPIC. I don't
# know how to disable this, so just force ENABLE_PIC off for now.
message(STATUS "Warning: -fPIC not supported with Xcode.")
else( XCODE )
if( SUPPORTS_FPIC_FLAG )
message(STATUS "Building with -fPIC")
add_llvm_definitions(-fPIC)
set(ENABLE_PIC 1)
else( SUPPORTS_FPIC_FLAG )
message(STATUS "Warning: -fPIC not supported.")
endif()
endif()
endif()
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_TOOLS_BINARY_DIR} )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib )
# set(CMAKE_VERBOSE_MAKEFILE true)
add_llvm_definitions( -D__STDC_LIMIT_MACROS )
add_llvm_definitions( -D__STDC_CONSTANT_MACROS )
# MSVC has a gazillion warnings with this.
if( MSVC )
option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." OFF)
else( MSVC )
option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." ON)
endif()
option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
option(LLVM_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )
# TODO: support other platforms and toolchains.
option(LLVM_BUILD_32_BITS "Build 32 bits executables and libraries." OFF)
if( LLVM_BUILD_32_BITS )
message(STATUS "Building 32 bits executables and libraries.")
add_llvm_definitions( -m32 )
list(APPEND CMAKE_EXE_LINKER_FLAGS -m32)
list(APPEND CMAKE_SHARED_LINKER_FLAGS -m32)
endif( LLVM_BUILD_32_BITS )
endif( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )
if( MSVC )
# List of valid CRTs for MSVC
set(MSVC_CRT
MD
MDd
MT
MTd)
set(LLVM_USE_CRT "" CACHE STRING "Specify VC++ CRT to use for debug/release configurations.")
add_llvm_definitions( -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS )
add_llvm_definitions( -D_SCL_SECURE_NO_WARNINGS -DCRT_NONSTDC_NO_WARNINGS )
add_llvm_definitions( -D_SCL_SECURE_NO_DEPRECATE )
add_llvm_definitions( -wd4146 -wd4503 -wd4996 -wd4800 -wd4244 -wd4624 )
add_llvm_definitions( -wd4355 -wd4715 -wd4180 -wd4345 -wd4224 )
# Suppress 'new behavior: elements of array 'array' will be default initialized'
add_llvm_definitions( -wd4351 )
if (NOT ${LLVM_USE_CRT} STREQUAL "")
list(FIND MSVC_CRT ${LLVM_USE_CRT} idx)
if (idx LESS 0)
message(FATAL_ERROR "Invalid value for LLVM_USE_CRT: ${LLVM_USE_CRT}. Valid options are one of: ${MSVC_CRT}")
endif (idx LESS 0)
add_llvm_definitions("/${LLVM_USE_CRT}")
message(STATUS "Using VC++ CRT: ${LLVM_USE_CRT}")
endif (NOT ${LLVM_USE_CRT} STREQUAL "")
# Enable warnings
if (LLVM_ENABLE_WARNINGS)
add_llvm_definitions( /W4 /Wall )
if (LLVM_ENABLE_PEDANTIC)
# No MSVC equivalent available
endif (LLVM_ENABLE_PEDANTIC)
endif (LLVM_ENABLE_WARNINGS)
if (LLVM_ENABLE_WERROR)
add_llvm_definitions( /WX )
endif (LLVM_ENABLE_WERROR)
elseif( CMAKE_COMPILER_IS_GNUCXX )
if (LLVM_ENABLE_WARNINGS)
add_llvm_definitions( -Wall -W -Wno-unused-parameter -Wwrite-strings )
if (LLVM_ENABLE_PEDANTIC)
add_llvm_definitions( -pedantic -Wno-long-long )
endif (LLVM_ENABLE_PEDANTIC)
endif (LLVM_ENABLE_WARNINGS)
if (LLVM_ENABLE_WERROR)
add_llvm_definitions( -Werror )
endif (LLVM_ENABLE_WERROR)
endif( MSVC )
include_directories( ${LLVM_BINARY_DIR}/include ${LLVM_MAIN_INCLUDE_DIR})
if( ${CMAKE_SYSTEM_NAME} MATCHES SunOS )
SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-include llvm/System/Solaris.h")
endif( ${CMAKE_SYSTEM_NAME} MATCHES SunOS )
include(AddLLVM)
include(TableGen)
add_subdirectory(lib/Support)
add_subdirectory(lib/System)
# Everything else depends on Support and System:
set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} ${LLVM_LIBS} )
set(LLVM_TABLEGEN "tblgen" CACHE
STRING "Native TableGen executable. Saves building one when cross-compiling.")
# Effective tblgen executable to be used:
set(LLVM_TABLEGEN_EXE ${LLVM_TABLEGEN})
add_subdirectory(utils/TableGen)
if( CMAKE_CROSSCOMPILING )
# This adds a dependency on target `tblgen', so must go after utils/TableGen
include( CrossCompileLLVM )
endif( CMAKE_CROSSCOMPILING )
add_subdirectory(include/llvm)
add_subdirectory(lib/VMCore)
add_subdirectory(lib/CodeGen)
add_subdirectory(lib/CodeGen/SelectionDAG)
add_subdirectory(lib/CodeGen/AsmPrinter)
add_subdirectory(lib/Bitcode/Reader)
add_subdirectory(lib/Bitcode/Writer)
add_subdirectory(lib/Transforms/Utils)
add_subdirectory(lib/Transforms/Instrumentation)
add_subdirectory(lib/Transforms/InstCombine)
add_subdirectory(lib/Transforms/Scalar)
add_subdirectory(lib/Transforms/IPO)
add_subdirectory(lib/Transforms/Hello)
add_subdirectory(lib/Linker)
add_subdirectory(lib/Analysis)
add_subdirectory(lib/Analysis/IPA)
add_subdirectory(lib/MC)
add_subdirectory(lib/MC/MCParser)
add_subdirectory(test)
add_subdirectory(utils/FileCheck)
add_subdirectory(utils/count)
add_subdirectory(utils/not)
set(LLVM_ENUM_ASM_PRINTERS "")
set(LLVM_ENUM_ASM_PARSERS "")
set(LLVM_ENUM_DISASSEMBLERS "")
foreach(t ${LLVM_TARGETS_TO_BUILD})
message(STATUS "Targeting ${t}")
add_subdirectory(lib/Target/${t})
add_subdirectory(lib/Target/${t}/TargetInfo)
if( EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Target/${t}/AsmPrinter/CMakeLists.txt )
add_subdirectory(lib/Target/${t}/AsmPrinter)
set(LLVM_ENUM_ASM_PRINTERS
"${LLVM_ENUM_ASM_PRINTERS}LLVM_ASM_PRINTER(${t})\n")
endif( EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Target/${t}/AsmPrinter/CMakeLists.txt )
if( EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Target/${t}/AsmParser/CMakeLists.txt )
add_subdirectory(lib/Target/${t}/AsmParser)
set(LLVM_ENUM_ASM_PARSERS
"${LLVM_ENUM_ASM_PARSERS}LLVM_ASM_PARSER(${t})\n")
endif( EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Target/${t}/AsmParser/CMakeLists.txt )
if( EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Target/${t}/Disassembler/CMakeLists.txt )
add_subdirectory(lib/Target/${t}/Disassembler)
set(LLVM_ENUM_DISASSEMBLERS
"${LLVM_ENUM_DISASSEMBLERS}LLVM_DISASSEMBLER(${t})\n")
endif( EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Target/${t}/Disassembler/CMakeLists.txt )
set(CURRENT_LLVM_TARGET)
endforeach(t)
# Produce llvm/Config/AsmPrinters.def
configure_file(
${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/AsmPrinters.def.in
${LLVM_BINARY_DIR}/include/llvm/Config/AsmPrinters.def
)
# Produce llvm/Config/AsmParsers.def
configure_file(
${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/AsmParsers.def.in
${LLVM_BINARY_DIR}/include/llvm/Config/AsmParsers.def
)
# Produce llvm/Config/Disassemblers.def
configure_file(
${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/Disassemblers.def.in
${LLVM_BINARY_DIR}/include/llvm/Config/Disassemblers.def
)
add_subdirectory(lib/ExecutionEngine)
add_subdirectory(lib/ExecutionEngine/Interpreter)
add_subdirectory(lib/ExecutionEngine/JIT)
add_subdirectory(lib/Target)
add_subdirectory(lib/AsmParser)
add_subdirectory(lib/Archive)
add_subdirectory(projects)
option(LLVM_BUILD_TOOLS "Build LLVM tool programs." ON)
add_subdirectory(tools)
option(LLVM_BUILD_EXAMPLES "Build LLVM example programs." OFF)
add_subdirectory(examples)
install(DIRECTORY include/
DESTINATION include
FILES_MATCHING
PATTERN "*.def"
PATTERN "*.h"
PATTERN "*.td"
PATTERN "*.inc"
PATTERN ".svn" EXCLUDE
)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/
DESTINATION include
FILES_MATCHING
PATTERN "*.def"
PATTERN "*.h"
PATTERN "*.gen"
PATTERN "*.inc"
# Exclude include/llvm/CMakeFiles/intrinsics_gen.dir, matched by "*.def"
PATTERN "CMakeFiles" EXCLUDE
PATTERN ".svn" EXCLUDE
)
# TODO: make and install documentation.

342
contrib/llvm/CREDITS.TXT Normal file
View file

@ -0,0 +1,342 @@
This file is a partial list of people who have contributed to the LLVM
project. If you have contributed a patch or made some other contribution to
LLVM, please submit a patch to this file to add yourself, and it will be
done!
The list is sorted by surname and formatted to allow easy grepping and
beautification by scripts. The fields are: name (N), email (E), web-address
(W), PGP key ID and fingerprint (P), description (D), and snail-mail address
(S).
N: Vikram Adve
E: vadve@cs.uiuc.edu
W: http://www.cs.uiuc.edu/~vadve/
D: The Sparc64 backend, provider of much wisdom, and motivator for LLVM
N: Owen Anderson
E: resistor@mac.com
D: LCSSA pass and related LoopUnswitch work
D: GVNPRE pass, TargetData refactoring, random improvements
N: Henrik Bach
D: MingW Win32 API portability layer
N: Nate Begeman
E: natebegeman@mac.com
D: PowerPC backend developer
D: Target-independent code generator and analysis improvements
N: Daniel Berlin
E: dberlin@dberlin.org
D: ET-Forest implementation.
D: Sparse bitmap
N: Neil Booth
E: neil@daikokuya.co.uk
D: APFloat implementation.
N: Misha Brukman
E: brukman+llvm@uiuc.edu
W: http://misha.brukman.net
D: Portions of X86 and Sparc JIT compilers, PowerPC backend
D: Incremental bytecode loader
N: Cameron Buschardt
E: buschard@uiuc.edu
D: The `mem2reg' pass - promotes values stored in memory to registers
N: Chandler Carruth
E: chandlerc@gmail.com
D: LinkTimeOptimizer for Linux, via binutils integration, and C API
N: Casey Carter
E: ccarter@uiuc.edu
D: Fixes to the Reassociation pass, various improvement patches
N: Evan Cheng
E: evan.cheng@apple.com
D: ARM and X86 backends
D: Instruction scheduler improvements
D: Register allocator improvements
D: Loop optimizer improvements
D: Target-independent code generator improvements
N: Dan Villiom Podlaski Christiansen
E: danchr@gmail.com
E: danchr@cs.au.dk
W: http://villiom.dk
D: LLVM Makefile improvements
D: Clang diagnostic & driver tweaks
S: Aarhus, Denmark
N: Jeff Cohen
E: jeffc@jolt-lang.org
W: http://jolt-lang.org
D: Native Win32 API portability layer
N: John T. Criswell
E: criswell@uiuc.edu
D: Original Autoconf support, documentation improvements, bug fixes
N: Stefanus Du Toit
E: stefanus.dutoit@rapidmind.com
D: Bug fixes and minor improvements
N: Rafael Avila de Espindola
E: rafael.espindola@gmail.com
D: The ARM backend
N: Alkis Evlogimenos
E: alkis@evlogimenos.com
D: Linear scan register allocator, many codegen improvements, Java frontend
N: Ryan Flynn
E: pizza@parseerror.com
D: Miscellaneous bug fixes
N: Brian Gaeke
E: gaeke@uiuc.edu
W: http://www.students.uiuc.edu/~gaeke/
D: Portions of X86 static and JIT compilers; initial SparcV8 backend
D: Dynamic trace optimizer
D: FreeBSD/X86 compatibility fixes, the llvm-nm tool
N: Nicolas Geoffray
E: nicolas.geoffray@lip6.fr
W: http://www-src.lip6.fr/homepages/Nicolas.Geoffray/
D: PPC backend fixes for Linux
N: Louis Gerbarg
D: Portions of the PowerPC backend
N: Saem Ghani
E: saemghani@gmail.com
D: Callgraph class cleanups
N: Mikhail Glushenkov
E: foldr@codedgers.com
D: Author of llvmc2
N: Dan Gohman
E: gohman@apple.com
D: Miscellaneous bug fixes
N: David Goodwin
E: david@goodwinz.net
D: Thumb-2 code generator
N: David Greene
E: greened@obbligato.org
D: Miscellaneous bug fixes
D: Register allocation refactoring
N: Gabor Greif
E: ggreif@gmail.com
D: Improvements for space efficiency
N: Lang Hames
E: lhames@gmail.com
D: PBQP-based register allocator
N: Gordon Henriksen
E: gordonhenriksen@mac.com
D: Pluggable GC support
D: C interface
D: Ocaml bindings
N: Raul Fernandes Herbster
E: raul@dsc.ufcg.edu.br
D: JIT support for ARM
N: Paolo Invernizzi
E: arathorn@fastwebnet.it
D: Visual C++ compatibility fixes
N: Patrick Jenkins
E: patjenk@wam.umd.edu
D: Nightly Tester
N: Dale Johannesen
E: dalej@apple.com
D: ARM constant islands improvements
D: Tail merging improvements
D: Rewrite X87 back end
D: Use APFloat for floating point constants widely throughout compiler
D: Implement X87 long double
N: Brad Jones
E: kungfoomaster@nondot.org
D: Support for packed types
N: Rod Kay
E: rkay@auroraux.org
D: Author of LLVM Ada bindings
N: Eric Kidd
W: http://randomhacks.net/
D: llvm-config script
N: Anton Korobeynikov
E: asl@math.spbu.ru
D: Mingw32 fixes, cross-compiling support, stdcall/fastcall calling conv.
D: x86/linux PIC codegen, aliases, regparm/visibility attributes
D: Switch lowering refactoring
N: Sumant Kowshik
E: kowshik@uiuc.edu
D: Author of the original C backend
N: Benjamin Kramer
E: benny.kra@gmail.com
D: Miscellaneous bug fixes
N: Christopher Lamb
E: christopher.lamb@gmail.com
D: aligned load/store support, parts of noalias and restrict support
D: vreg subreg infrastructure, X86 codegen improvements based on subregs
D: address spaces
N: Jim Laskey
E: jlaskey@apple.com
D: Improvements to the PPC backend, instruction scheduling
D: Debug and Dwarf implementation
D: Auto upgrade mangler
D: llvm-gcc4 svn wrangler
N: Chris Lattner
E: sabre@nondot.org
W: http://nondot.org/~sabre/
D: Primary architect of LLVM
N: Tanya Lattner (Tanya Brethour)
E: tonic@nondot.org
W: http://nondot.org/~tonic/
D: The initial llvm-ar tool, converted regression testsuite to dejagnu
D: Modulo scheduling in the SparcV9 backend
D: Release manager (1.7+)
N: Andrew Lenharth
E: alenhar2@cs.uiuc.edu
W: http://www.lenharth.org/~andrewl/
D: Alpha backend
D: Sampling based profiling
N: Nick Lewycky
E: nicholas@mxc.ca
D: PredicateSimplifier pass
N: Bruno Cardoso Lopes
E: bruno.cardoso@gmail.com
W: http://www.brunocardoso.org
D: The Mips backend
N: Duraid Madina
E: duraid@octopus.com.au
W: http://kinoko.c.u-tokyo.ac.jp/~duraid/
D: IA64 backend, BigBlock register allocator
N: Michael McCracken
E: michael.mccracken@gmail.com
D: Line number support for llvmgcc
N: Vladimir Merzliakov
E: wanderer@rsu.ru
D: Test suite fixes for FreeBSD
N: Scott Michel
E: scottm@aero.org
D: Added STI Cell SPU backend.
N: Edward O'Callaghan
E: eocallaghan@auroraux.org
W: http://www.auroraux.org
D: Add Clang support with various other improvements to utils/NewNightlyTest.pl
D: Fix and maintain Solaris & AuroraUX support for llvm, various build warnings
D: and error clean ups.
N: Morten Ofstad
E: morten@hue.no
D: Visual C++ compatibility fixes
N: Jakob Stoklund Olesen
E: stoklund@2pi.dk
D: Machine code verifier
D: Blackfin backend
N: Richard Osborne
E: richard@xmos.com
D: XCore backend
N: Devang Patel
E: dpatel@apple.com
D: LTO tool, PassManager rewrite, Loop Pass Manager, Loop Rotate
D: GCC PCH Integration (llvm-gcc), llvm-gcc improvements
D: Optimizer improvements, Loop Index Split
N: Sandeep Patel
E: deeppatel1987@gmail.com
D: ARM calling conventions rewrite, hard float support
N: Vladimir Prus
W: http://vladimir_prus.blogspot.com
E: ghost@cs.msu.su
D: Made inst_iterator behave like a proper iterator, LowerConstantExprs pass
N: Roman Samoilov
E: roman@codedgers.com
D: MSIL backend
N: Duncan Sands
E: baldrick@free.fr
D: Ada front-end, exception handling improvements
N: Ruchira Sasanka
E: sasanka@uiuc.edu
D: Graph coloring register allocator for the Sparc64 backend
N: Arnold Schwaighofer
E: arnold.schwaighofer@gmail.com
D: Tail call optimization for the x86 backend
N: Shantonu Sen
E: ssen@apple.com
D: Miscellaneous bug fixes
N: Anand Shukla
E: ashukla@cs.uiuc.edu
D: The `paths' pass
N: Reid Spencer
E: rspencer@reidspencer.com
W: http://reidspencer.com/
D: Lots of stuff, see: http://wiki.llvm.org/index.php/User:Reid
N: Edwin Torok
E: edwintorok@gmail.com
D: Miscellaneous bug fixes
N: Adam Treat
E: manyoso@yahoo.com
D: C++ bugs filed, and C++ front-end bug fixes.
N: Lauro Ramos Venancio
E: lauro.venancio@indt.org.br
D: ARM backend improvements
D: Thread Local Storage implementation
N: Xerxes Ranby
E: xerxes@zafena.se
D: Cmake dependency chain and various bug fixes
N: Bill Wendling
E: isanbard@gmail.com
D: Bunches of stuff
N: Bob Wilson
E: bob.wilson@acm.org
D: Advanced SIMD (NEON) support in the ARM backend
N: Wesley Peck
E: peckw@wesleypeck.com
W: http://wesleypeck.com/
D: MicroBlaze backend

69
contrib/llvm/LICENSE.TXT Normal file
View file

@ -0,0 +1,69 @@
==============================================================================
LLVM Release License
==============================================================================
University of Illinois/NCSA
Open Source License
Copyright (c) 2003-2010 University of Illinois at Urbana-Champaign.
All rights reserved.
Developed by:
LLVM Team
University of Illinois at Urbana-Champaign
http://llvm.org
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal with
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimers.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimers in the
documentation and/or other materials provided with the distribution.
* Neither the names of the LLVM Team, University of Illinois at
Urbana-Champaign, nor the names of its contributors may be used to
endorse or promote products derived from this Software without specific
prior written permission.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
SOFTWARE.
==============================================================================
Copyrights and Licenses for Third Party Software Distributed with LLVM:
==============================================================================
The LLVM software contains code written by third parties. Such software will
have its own individual LICENSE.TXT file in the directory in which it appears.
This file will describe the copyrights, license, and restrictions which apply
to that code.
The disclaimer of warranty in the University of Illinois Open Source License
applies to all code in the LLVM Distribution, and nothing in any of the
other licenses gives permission to use the names of the LLVM Team or the
University of Illinois to endorse or promote products derived from this
Software.
The following pieces of software have additional or alternate copyrights,
licenses, and/or restrictions:
Program Directory
------- ---------
Autoconf llvm/autoconf
llvm/projects/ModuleMaker/autoconf
llvm/projects/sample/autoconf
CellSPU backend llvm/lib/Target/CellSPU/README.txt
Google Test llvm/utils/unittest/googletest
OpenBSD regex llvm/lib/Support/{reg*, COPYRIGHT.regex}

241
contrib/llvm/Makefile Normal file
View file

@ -0,0 +1,241 @@
#===- ./Makefile -------------------------------------------*- Makefile -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===------------------------------------------------------------------------===#
LEVEL := .
# Top-Level LLVM Build Stages:
# 1. Build lib/System and lib/Support, which are used by utils (tblgen).
# 2. Build utils, which is used by VMCore.
# 3. Build VMCore, which builds the Intrinsics.inc file used by libs.
# 4. Build libs, which are needed by llvm-config.
# 5. Build llvm-config, which determines inter-lib dependencies for tools.
# 6. Build tools, runtime, docs.
#
# When cross-compiling, there are some things (tablegen) that need to
# be build for the build system first.
# If "RC_ProjectName" exists in the environment, and its value is
# "llvmCore", then this is an "Apple-style" build; search for
# "Apple-style" in the comments for more info. Anything else is a
# normal build.
ifneq ($(findstring llvmCore, $(RC_ProjectName)),llvmCore) # Normal build (not "Apple-style").
ifeq ($(BUILD_DIRS_ONLY),1)
DIRS := lib/System lib/Support utils
OPTIONAL_DIRS :=
else
DIRS := lib/System lib/Support utils lib/VMCore lib tools/llvm-shlib \
tools/llvm-config tools runtime docs unittests
OPTIONAL_DIRS := projects bindings
endif
ifeq ($(BUILD_EXAMPLES),1)
OPTIONAL_DIRS += examples
endif
EXTRA_DIST := test unittests llvm.spec include win32 Xcode
include $(LEVEL)/Makefile.config
ifneq ($(ENABLE_SHARED),1)
DIRS := $(filter-out tools/llvm-shlib, $(DIRS))
endif
ifeq ($(MAKECMDGOALS),libs-only)
DIRS := $(filter-out tools runtime docs, $(DIRS))
OPTIONAL_DIRS :=
endif
ifeq ($(MAKECMDGOALS),install-libs)
DIRS := $(filter-out tools runtime docs, $(DIRS))
OPTIONAL_DIRS := $(filter bindings, $(OPTIONAL_DIRS))
endif
ifeq ($(MAKECMDGOALS),tools-only)
DIRS := $(filter-out runtime docs, $(DIRS))
OPTIONAL_DIRS :=
endif
ifeq ($(MAKECMDGOALS),install-clang)
DIRS := tools/clang/tools/driver tools/clang/lib/Headers \
tools/clang/lib/Runtime tools/clang/docs
OPTIONAL_DIRS :=
NO_INSTALL = 1
endif
ifeq ($(MAKECMDGOALS),install-clang-c)
DIRS := tools/clang/tools/driver tools/clang/lib/Headers \
tools/clang/tools/libclang tools/clang/tools/c-index-test \
tools/clang/include/clang-c
OPTIONAL_DIRS :=
NO_INSTALL = 1
endif
ifeq ($(MAKECMDGOALS),clang-only)
DIRS := $(filter-out tools runtime docs unittests, $(DIRS)) tools/clang
OPTIONAL_DIRS :=
endif
ifeq ($(MAKECMDGOALS),unittests)
DIRS := $(filter-out tools runtime docs, $(DIRS)) utils unittests
OPTIONAL_DIRS :=
endif
# Use NO_INSTALL define of the Makefile of each directory for deciding
# if the directory is installed or not
ifeq ($(MAKECMDGOALS),install)
OPTIONAL_DIRS := $(filter bindings, $(OPTIONAL_DIRS))
endif
# If we're cross-compiling, build the build-hosted tools first
ifeq ($(LLVM_CROSS_COMPILING),1)
all:: cross-compile-build-tools
clean::
$(Verb) rm -rf BuildTools
cross-compile-build-tools:
$(Verb) if [ ! -f BuildTools/Makefile ]; then \
$(MKDIR) BuildTools; \
cd BuildTools ; \
unset CFLAGS ; \
unset CXXFLAGS ; \
$(PROJ_SRC_DIR)/configure --build=$(BUILD_TRIPLE) \
--host=$(BUILD_TRIPLE) --target=$(BUILD_TRIPLE); \
cd .. ; \
fi; \
($(MAKE) -C BuildTools \
BUILD_DIRS_ONLY=1 \
UNIVERSAL= \
ENABLE_OPTIMIZED=$(ENABLE_OPTIMIZED) \
ENABLE_PROFILING=$(ENABLE_PROFILING) \
ENABLE_COVERAGE=$(ENABLE_COVERAGE) \
DISABLE_ASSERTIONS=$(DISABLE_ASSERTIONS) \
ENABLE_EXPENSIVE_CHECKS=$(ENABLE_EXPENSIVE_CHECKS) \
CFLAGS= \
CXXFLAGS= \
) || exit 1;
endif
# Include the main makefile machinery.
include $(LLVM_SRC_ROOT)/Makefile.rules
# Specify options to pass to configure script when we're
# running the dist-check target
DIST_CHECK_CONFIG_OPTIONS = --with-llvmgccdir=$(LLVMGCCDIR)
.PHONY: debug-opt-prof
debug-opt-prof:
$(Echo) Building Debug Version
$(Verb) $(MAKE)
$(Echo)
$(Echo) Building Optimized Version
$(Echo)
$(Verb) $(MAKE) ENABLE_OPTIMIZED=1
$(Echo)
$(Echo) Building Profiling Version
$(Echo)
$(Verb) $(MAKE) ENABLE_PROFILING=1
dist-hook::
$(Echo) Eliminating files constructed by configure
$(Verb) $(RM) -f \
$(TopDistDir)/include/llvm/Config/config.h \
$(TopDistDir)/include/llvm/System/DataTypes.h
clang-only: all
tools-only: all
libs-only: all
install-clang: install
install-clang-c: install
install-libs: install
#------------------------------------------------------------------------
# Make sure the generated headers are up-to-date. This must be kept in
# sync with the AC_CONFIG_HEADER invocations in autoconf/configure.ac
#------------------------------------------------------------------------
FilesToConfig := \
include/llvm/Config/config.h \
include/llvm/Config/Targets.def \
include/llvm/Config/AsmPrinters.def \
include/llvm/Config/AsmParsers.def \
include/llvm/Config/Disassemblers.def \
include/llvm/System/DataTypes.h \
tools/llvmc/plugins/Base/Base.td
FilesToConfigPATH := $(addprefix $(LLVM_OBJ_ROOT)/,$(FilesToConfig))
all-local:: $(FilesToConfigPATH)
$(FilesToConfigPATH) : $(LLVM_OBJ_ROOT)/% : $(LLVM_SRC_ROOT)/%.in
$(Echo) Regenerating $*
$(Verb) cd $(LLVM_OBJ_ROOT) && $(ConfigStatusScript) $*
.PRECIOUS: $(FilesToConfigPATH)
# NOTE: This needs to remain as the last target definition in this file so
# that it gets executed last.
ifneq ($(BUILD_DIRS_ONLY),1)
all::
$(Echo) '*****' Completed $(BuildMode)$(AssertMode) Build
ifeq ($(BuildMode),Debug)
$(Echo) '*****' Note: Debug build can be 10 times slower than an
$(Echo) '*****' optimized build. Use 'make ENABLE_OPTIMIZED=1' to
$(Echo) '*****' make an optimized build. Alternatively you can
$(Echo) '*****' configure with --enable-optimized.
endif
endif
check-llvm2cpp:
$(Verb)$(MAKE) check TESTSUITE=Feature RUNLLVM2CPP=1
check-one:
$(Verb)$(MAKE) -C test check-one TESTONE=$(TESTONE)
srpm: $(LLVM_OBJ_ROOT)/llvm.spec
rpmbuild -bs $(LLVM_OBJ_ROOT)/llvm.spec
rpm: $(LLVM_OBJ_ROOT)/llvm.spec
rpmbuild -bb --target $(TARGET_TRIPLE) $(LLVM_OBJ_ROOT)/llvm.spec
show-footprint:
$(Verb) du -sk $(LibDir)
$(Verb) du -sk $(ToolDir)
$(Verb) du -sk $(ExmplDir)
$(Verb) du -sk $(ObjDir)
build-for-llvm-top:
$(Verb) if test ! -f ./config.status ; then \
./configure --prefix="$(LLVM_TOP)/install" \
--with-llvm-gcc="$(LLVM_TOP)/llvm-gcc" ; \
fi
$(Verb) $(MAKE) tools-only
SVN = svn
SVN-UPDATE-OPTIONS =
AWK = awk
SUB-SVN-DIRS = $(AWK) '/\?\ \ \ \ \ \ / {print $$2}' \
| LC_ALL=C xargs $(SVN) info 2>/dev/null \
| $(AWK) '/Path:\ / {print $$2}'
update:
$(SVN) $(SVN-UPDATE-OPTIONS) update $(LLVM_SRC_ROOT)
@ $(SVN) status $(LLVM_SRC_ROOT) | $(SUB-SVN-DIRS) | xargs $(SVN) $(SVN-UPDATE-OPTIONS) update
happiness: update all check-all
.PHONY: srpm rpm update happiness
# declare all targets at this level to be serial:
.NOTPARALLEL:
else # Building "Apple-style."
# In an Apple-style build, once configuration is done, lines marked
# "Apple-style" are removed with sed! Please don't remove these!
# Look for the string "Apple-style" in utils/buildit/build_llvm.
include $(shell find . -name GNUmakefile) # Building "Apple-style."
endif # Building "Apple-style."

View file

@ -0,0 +1,70 @@
#===-- Makefile.common - Common make rules for LLVM --------*- Makefile -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===------------------------------------------------------------------------===#
#
# This file is included by all of the LLVM makefiles. This file defines common
# rules to do things like compile a .cpp file or generate dependency info.
# These are platform dependent, so this is the file used to specify these
# system dependent operations.
#
# The following functionality can be set by setting incoming variables.
# The variable $(LEVEL) *must* be set:
#
# 1. LEVEL - The level of the current subdirectory from the top of the
# source directory. This level should be expressed as a path, for
# example, ../.. for two levels deep.
#
# 2. DIRS - A list of subdirectories to be built. Fake targets are set up
# so that each of the targets "all", "install", and "clean" each build
# the subdirectories before the local target. DIRS are guaranteed to be
# built in order.
#
# 3. PARALLEL_DIRS - A list of subdirectories to be built, but that may be
# built in any order. All DIRS are built in order before PARALLEL_DIRS are
# built, which are then built in any order.
#
# 4. Source - If specified, this sets the source code filenames. If this
# is not set, it defaults to be all of the .cpp, .c, .y, and .l files
# in the current directory. Also, if you want to build files in addition
# to the local files, you can use the ExtraSource variable
#
# 5. SourceDir - If specified, this specifies a directory that the source files
# are in, if they are not in the current directory. This should include a
# trailing / character.
#
# 6. LLVM_SRC_ROOT - If specified, points to the top of the LLVM source tree.
#
# 8. PROJ_SRC_DIR - The directory which contains the current set of Makefiles
# and usually the source code too (unless SourceDir is set).
#
# 9. PROJ_SRC_ROOT - The root directory of the source code being compiled.
#
# 10. PROJ_OBJ_DIR - The directory where object code should be placed.
#
# 11. PROJ_OBJ_ROOT - The root directory for where object code should be
# placed.
#
# For building,
# LLVM, LLVM_SRC_ROOT = PROJ_SRC_ROOT
#
#===-----------------------------------------------------------------------====
#
# Configuration file to set paths specific to local installation of LLVM
#
ifndef LLVM_OBJ_ROOT
include $(LEVEL)/Makefile.config
else
include $(LLVM_OBJ_ROOT)/Makefile.config
endif
#
# Include all of the build rules used for making LLVM
#
include $(LLVM_SRC_ROOT)/Makefile.rules

View file

@ -0,0 +1,348 @@
#===-- Makefile.config - Local configuration for LLVM ------*- Makefile -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===------------------------------------------------------------------------===#
#
# This file is included by Makefile.common. It defines paths and other
# values specific to a particular installation of LLVM.
#
#===------------------------------------------------------------------------===#
# Define LLVM specific info and directories based on the autoconf variables
LLVMPackageName := @PACKAGE_NAME@
LLVMVersion := @PACKAGE_VERSION@
LLVM_CONFIGTIME := @LLVM_CONFIGTIME@
###########################################################################
# Directory Configuration
# This section of the Makefile determines what is where. To be
# specific, there are several locations that need to be defined:
#
# o LLVM_SRC_ROOT : The root directory of the LLVM source code.
# o LLVM_OBJ_ROOT : The root directory containing the built LLVM code.
#
# o PROJ_SRC_DIR : The directory containing the code to build.
# o PROJ_SRC_ROOT : The root directory of the code to build.
#
# o PROJ_OBJ_DIR : The directory in which compiled code will be placed.
# o PROJ_OBJ_ROOT : The root directory in which compiled code is placed.
#
###########################################################################
PWD := @BINPWD@
# Set the project name to LLVM if its not defined
ifndef PROJECT_NAME
PROJECT_NAME := $(LLVMPackageName)
endif
PROJ_OBJ_DIR := $(shell $(PWD))
PROJ_OBJ_ROOT := $(shell cd $(PROJ_OBJ_DIR)/$(LEVEL); $(PWD))
ifeq ($(PROJECT_NAME),llvm)
LLVM_SRC_ROOT := $(shell cd @abs_top_srcdir@; $(PWD))
LLVM_OBJ_ROOT := $(shell cd @abs_top_builddir@; $(PWD))
PROJ_SRC_ROOT := $(shell cd $(LLVM_SRC_ROOT); $(PWD))
PROJ_SRC_DIR := $(shell cd $(LLVM_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)); $(PWD))
prefix := @prefix@
PROJ_prefix := $(prefix)
PROJ_VERSION := $(LLVMVersion)
else
ifndef PROJ_SRC_ROOT
$(error Projects must define PROJ_SRC_ROOT)
endif
ifndef PROJ_OBJ_ROOT
$(error Projects must define PROJ_OBJ_ROOT)
endif
ifndef PROJ_INSTALL_ROOT
$(error Projects must define PROJ_INSTALL_ROOT)
endif
ifndef LLVM_SRC_ROOT
$(error Projects must define LLVM_SRC_ROOT)
endif
ifndef LLVM_OBJ_ROOT
$(error Projects must define LLVM_OBJ_ROOT)
endif
PROJ_SRC_DIR := $(shell cd $(PROJ_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)); $(PWD))
prefix := $(PROJ_INSTALL_ROOT)
PROJ_prefix := $(prefix)
ifndef PROJ_VERSION
PROJ_VERSION := 1.0
endif
endif
LLVMMAKE := $(LLVM_SRC_ROOT)/make
PROJ_bindir := $(PROJ_prefix)/bin
PROJ_libdir := $(PROJ_prefix)/lib
PROJ_datadir := $(PROJ_prefix)/share
PROJ_docsdir := $(PROJ_prefix)/docs/llvm
PROJ_etcdir := $(PROJ_prefix)/etc/llvm
PROJ_includedir := $(PROJ_prefix)/include
PROJ_infodir := $(PROJ_prefix)/info
PROJ_mandir := $(PROJ_prefix)/share/man
# Determine if we're on a unix type operating system
LLVM_ON_UNIX:=@LLVM_ON_UNIX@
LLVM_ON_WIN32:=@LLVM_ON_WIN32@
# Host operating system for which LLVM will be run.
OS=@OS@
HOST_OS=@HOST_OS@
# Target operating system for which LLVM will compile for.
TARGET_OS=@TARGET_OS@
# Target hardware architecture
ARCH=@ARCH@
# Indicates, whether we're cross-compiling LLVM or not
LLVM_CROSS_COMPILING=@LLVM_CROSS_COMPILING@
# Executable file extension for build platform (mainly for
# tablegen call if we're cross-compiling).
BUILD_EXEEXT=@BUILD_EXEEXT@
# Compilers for the build platflorm (mainly for tablegen
# call if we're cross-compiling).
BUILD_CC=@BUILD_CC@
BUILD_CXX=@BUILD_CXX@
# Triple for configuring build tools when cross-compiling
BUILD_TRIPLE=@build@
# Target triple (cpu-vendor-os) for which we should generate code
TARGET_TRIPLE=@target@
# Extra options to compile LLVM with
EXTRA_OPTIONS=@EXTRA_OPTIONS@
# Endian-ness of the target
ENDIAN=@ENDIAN@
# Path to the C++ compiler to use. This is an optional setting, which defaults
# to whatever your gmake defaults to.
CXX = @CXX@
# Path to the CC binary, which use used by testcases for native builds.
CC := @CC@
# Linker flags.
LDFLAGS+=@LDFLAGS@
# Path to the library archiver program.
AR_PATH = @AR@
AR = @AR@
# Path to the nm program
NM_PATH = @NM@
# The pathnames of the programs we require to build
CMP := @CMP@
CP := @CP@
DATE := @DATE@
FIND := @FIND@
GREP := @GREP@
INSTALL := @INSTALL@
MKDIR := $(LLVM_SRC_ROOT)/autoconf/mkinstalldirs
MV := @MV@
RANLIB := @RANLIB@
RM := @RM@
SED := @SED@
TAR := @TAR@
# Paths to miscellaneous programs we hope are present but might not be
PERL := @PERL@
BZIP2 := @BZIP2@
CAT := @CAT@
DOT := @DOT@
DOXYGEN := @DOXYGEN@
GROFF := @GROFF@
GZIP := @GZIP@
OCAMLC := @OCAMLC@
OCAMLOPT := @OCAMLOPT@
OCAMLDEP := @OCAMLDEP@
OCAMLDOC := @OCAMLDOC@
GAS := @GAS@
POD2HTML := @POD2HTML@
POD2MAN := @POD2MAN@
PDFROFF := @PDFROFF@
RUNTEST := @RUNTEST@
TCLSH := @TCLSH@
ZIP := @ZIP@
HAVE_PERL := @HAVE_PERL@
HAVE_PTHREAD := @HAVE_PTHREAD@
LIBS := @LIBS@
# Targets that we should build
TARGETS_TO_BUILD=@TARGETS_TO_BUILD@
# Path to location for LLVM C/C++ front-end. You can modify this if you
# want to override the value set by configure.
LLVMGCCDIR := @LLVMGCCDIR@
# Full pathnames of LLVM C/C++ front-end 'cc1' and 'cc1plus' binaries:
LLVMGCC := @LLVMGCC@
LLVMGXX := @LLVMGXX@
LLVMCC1 := @LLVMCC1@
LLVMCC1PLUS := @LLVMCC1PLUS@
LLVMGCC_LANGS := @LLVMGCC_LANGS@
# Information on Clang, if configured.
CLANGPATH := @CLANGPATH@
CLANGXXPATH := @CLANGXXPATH@
ENABLE_BUILT_CLANG := @ENABLE_BUILT_CLANG@
# The LLVM capable compiler to use.
LLVMCC_OPTION := @LLVMCC_OPTION@
# Path to directory where object files should be stored during a build.
# Set OBJ_ROOT to "." if you do not want to use a separate place for
# object files.
OBJ_ROOT := .
# What to pass as rpath flag to g++
RPATH := @RPATH@
# What to pass as -rdynamic flag to g++
RDYNAMIC := @RDYNAMIC@
# These are options that can either be enabled here, or can be enabled on the
# make command line (ie, make ENABLE_PROFILING=1):
# When ENABLE_OPTIMIZED is enabled, LLVM code is optimized and output is put
# into the "Release" directories. Otherwise, LLVM code is not optimized and
# output is put in the "Debug" directories.
#ENABLE_OPTIMIZED = 1
@ENABLE_OPTIMIZED@
# When ENABLE_PROFILING is enabled, profile instrumentation is done
# and output is put into the "<Flavor>+Profile" directories, where
# <Flavor> is either Debug or Release depending on how other builkd
# flags are set.. Otherwise, output is put in the <Flavor>
# directories.
#ENABLE_PROFILING = 1
@ENABLE_PROFILING@
# When DISABLE_ASSERTIONS is enabled, builds of all of the LLVM code will
# exclude assertion checks, otherwise they are included.
#DISABLE_ASSERTIONS = 1
@DISABLE_ASSERTIONS@
# When ENABLE_EXPENSIVE_CHECKS is enabled, builds of all of the LLVM
# code will include expensive checks, otherwise they are excluded.
#ENABLE_EXPENSIVE_CHECKS = 0
@ENABLE_EXPENSIVE_CHECKS@
# When DEBUG_RUNTIME is enabled, the runtime libraries will retain debug
# symbols.
#DEBUG_RUNTIME = 1
@DEBUG_RUNTIME@
# When DEBUG_SYMBOLS is enabled, the compiler libraries will retain debug
# symbols.
#DEBUG_SYMBOLS = 1
@DEBUG_SYMBOLS@
# The compiler flags to use for optimized builds.
OPTIMIZE_OPTION := @OPTIMIZE_OPTION@
# When ENABLE_PROFILING is enabled, the llvm source base is built with profile
# information to allow gprof to be used to get execution frequencies.
#ENABLE_PROFILING = 1
# When ENABLE_DOXYGEN is enabled, the doxygen documentation will be built
ENABLE_DOXYGEN = @ENABLE_DOXYGEN@
# Do we want to enable threads?
ENABLE_THREADS := @ENABLE_THREADS@
# Do we want to build with position independent code?
ENABLE_PIC := @ENABLE_PIC@
# Do we want to build a shared library and link the tools with it?
ENABLE_SHARED := @ENABLE_SHARED@
# Use -fvisibility-inlines-hidden?
ENABLE_VISIBILITY_INLINES_HIDDEN := @ENABLE_VISIBILITY_INLINES_HIDDEN@
# Do we want to allow timestamping information into builds?
ENABLE_TIMESTAMPS := @ENABLE_TIMESTAMPS@
# This option tells the Makefiles to produce verbose output.
# It essentially prints the commands that make is executing
#VERBOSE = 1
# Enable JIT for this platform
TARGET_HAS_JIT = @TARGET_HAS_JIT@
# Environment variable to set to change the runtime shared library search path.
SHLIBPATH_VAR = @SHLIBPATH_VAR@
# Shared library extension for host platform.
SHLIBEXT = @SHLIBEXT@
# Executable file extension for host platform.
EXEEXT = @EXEEXT@
# Things we just assume are "there"
ECHO := echo
# Get the options for causing archives to link all their content instead of
# just missing symbols, and the inverse of that. This is used for certain LLVM
# tools that permit loadable modules. It ensures that the LLVM symbols will be
# available to those loadable modules.
LINKALL := @LINKALL@
NOLINKALL := @NOLINKALL@
# Get the value of HUGE_VAL_SANITY which will be either "yes" or "no" depending
# on the check.
HUGE_VAL_SANITY = @HUGE_VAL_SANITY@
# Bindings that we should build
BINDINGS_TO_BUILD := @BINDINGS_TO_BUILD@
ALL_BINDINGS := @ALL_BINDINGS@
OCAML_LIBDIR := @OCAML_LIBDIR@
# When compiling under Mingw/Cygwin, executables such as tblgen
# expect Windows paths, whereas the build system uses Unix paths.
# The function SYSPATH transforms Unix paths into Windows paths.
ifneq (,$(findstring -mno-cygwin, $(CXX)))
SYSPATH = $(shell echo $(1) | cygpath -m -f -)
else
SYSPATH = $(1)
endif
# Location of the plugin header file for gold.
BINUTILS_INCDIR := @BINUTILS_INCDIR@
C_INCLUDE_DIRS := @C_INCLUDE_DIRS@
CXX_INCLUDE_ROOT := @CXX_INCLUDE_ROOT@
CXX_INCLUDE_ARCH := @CXX_INCLUDE_ARCH@
CXX_INCLUDE_32BIT_DIR = @CXX_INCLUDE_32BIT_DIR@
CXX_INCLUDE_64BIT_DIR = @CXX_INCLUDE_64BIT_DIR@
# When ENABLE_LLVMC_DYNAMIC is enabled, LLVMC will link libCompilerDriver
# dynamically. This is needed to make dynamic plugins work on some targets
# (Windows).
ENABLE_LLVMC_DYNAMIC = 0
#@ENABLE_LLVMC_DYNAMIC@
# When ENABLE_LLVMC_DYNAMIC_PLUGINS is enabled, LLVMC will have dynamic plugin
# support (via the -load option).
ENABLE_LLVMC_DYNAMIC_PLUGINS = 1
#@ENABLE_LLVMC_DYNAMIC_PLUGINS@
# Optional flags supported by the compiler
# -Wno-missing-field-initializers
NO_MISSING_FIELD_INITIALIZERS = @NO_MISSING_FIELD_INITIALIZERS@
# -Wno-variadic-macros
NO_VARIADIC_MACROS = @NO_VARIADIC_MACROS@
# Flags supported by the linker.
# bfd ld / gold -retain-symbols-file file
HAVE_LINK_RETAIN_SYMBOLS_FILE = @HAVE_LINK_RETAIN_SYMBOLS_FILE@

2126
contrib/llvm/Makefile.rules Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,4 @@
DepModule:
BuildCmd: ./build-for-llvm-top.sh
CleanCmd: make clean -C ../build.llvm
InstallCmd: make install -C ../build.llvm

15
contrib/llvm/README.txt Normal file
View file

@ -0,0 +1,15 @@
Low Level Virtual Machine (LLVM)
================================
This directory and its subdirectories contain source code for the Low Level
Virtual Machine, a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.
LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.
Please see the HTML documentation provided in docs/index.html for further
assistance with LLVM.
If you're writing a package for LLVM, see docs/Packaging.html for our
suggestions.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@
Xcode project files for LLVM, for Xcode 2.1

View file

@ -0,0 +1,58 @@
#!/bin/bash
die() {
echo "$@" 1>&2
exit 1
}
clean() {
echo $1 | sed -e 's/\\//g'
}
### NOTE: ############################################################
### These variables specify the tool versions we want to use.
### Periods should be escaped with backslash for use by grep.
###
### If you update these, please also update docs/GettingStarted.html
want_autoconf_version='2\.60'
want_autoheader_version=$want_autoconf_version
want_aclocal_version='1\.9\.6'
want_libtool_version='1\.5\.22'
### END NOTE #########################################################
outfile=configure
configfile=configure.ac
want_autoconf_version_clean=$(clean $want_autoconf_version)
want_autoheader_version_clean=$(clean $want_autoheader_version)
want_aclocal_version_clean=$(clean $want_aclocal_version)
want_libtool_version_clean=$(clean $want_libtool_version)
test -d autoconf && test -f autoconf/$configfile && cd autoconf
test -f $configfile || die "Can't find 'autoconf' dir; please cd into it first"
autoconf --version | grep $want_autoconf_version > /dev/null
test $? -eq 0 || die "Your autoconf was not detected as being $want_autoconf_version_clean"
aclocal --version | grep '^aclocal.*'$want_aclocal_version > /dev/null
test $? -eq 0 || die "Your aclocal was not detected as being $want_aclocal_version_clean"
autoheader --version | grep '^autoheader.*'$want_autoheader_version > /dev/null
test $? -eq 0 || die "Your autoheader was not detected as being $want_autoheader_version_clean"
libtool --version | grep $want_libtool_version > /dev/null
test $? -eq 0 || die "Your libtool was not detected as being $want_libtool_version_clean"
echo ""
echo "### NOTE: ############################################################"
echo "### If you get *any* warnings from autoconf below you MUST fix the"
echo "### scripts in the m4 directory because there are future forward"
echo "### compatibility or platform support issues at risk. Please do NOT"
echo "### commit any configure script that was generated with warnings"
echo "### present. You should get just three 'Regenerating..' lines."
echo "######################################################################"
echo ""
echo "Regenerating aclocal.m4 with aclocal $want_aclocal_version_clean"
cwd=`pwd`
aclocal --force -I $cwd/m4 || die "aclocal failed"
echo "Regenerating configure with autoconf $want_autoconf_version_clean"
autoconf --force --warnings=all -o ../$outfile $configfile || die "autoconf failed"
cd ..
echo "Regenerating config.h.in with autoheader $want_autoheader_version_clean"
autoheader --warnings=all -I autoconf -I autoconf/m4 autoconf/$configfile || die "autoheader failed"
exit 0

View file

@ -0,0 +1,7 @@
{
global: main;
__progname;
environ;
local: *;
};

View file

@ -0,0 +1,24 @@
------------------------------------------------------------------------------
Autoconf Files
------------------------------------------------------------------------------
All autoconf files are licensed under the LLVM license with the following
additions:
llvm/autoconf/install-sh:
This script is licensed under the LLVM license, with the following
additional copyrights and restrictions:
Copyright 1991 by the Massachusetts Institute of Technology
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation, and that the name of M.I.T. not be used in advertising or
publicity pertaining to distribution of the software without specific,
written prior permission. M.I.T. makes no representations about the
suitability of this software for any purpose. It is provided "as is"
without express or implied warranty.
Please see the source files for additional copyrights.

View file

@ -0,0 +1,49 @@
Upgrading Libtool
===============================================================================
If you are in the mood to upgrade libtool, you must do the following:
1. Get the new version of libtool and put it in <SRC>
2. configure/build/install libtool with --prefix=<PFX>
3. Copy <SRC>/ltdl.m4 to llvm/autoconf/m4
4. Copy <PFX>/share/aclocal/libtool.m4 to llvm/autoconf/m4/libtool.m4
5. Copy <PFX>/share/libtool/ltmain.sh to llvm/autoconf/ltmain.sh
6. Copy <PFX>/share/libtool/libltdl/ltdl.c to llvm/lib/System
7. Copy <PFX>/share/libtool/libltdl/ltdl.h to llvm/lib/System
8. Edit the ltdl.h file to #include "llvm/Config/config.h" at the very top. You
might also need to resolve some compiler warnings (typically about
comparison of signed vs. unsigned values). But, you won't find out about
those until you build LLVM (step 13).
9. Edit the llvm/autoconf/m4/libtool.m4 file so that:
a) in AC_PROB_LIBTOOL macro, the value of LIBTOOL is set to
$(top_builddir)/mklib, not $(top_builddir)/libtool
b) in AC_LIBTOOL_SETUP macro, the variable default_ofile is set to
"mklib" instead of "libtool"
c) s/AC_ENABLE_SHARED_DEFAULT/enable_shared_default/g
d) s/AC_ENABLE_STATIC_DEFAULT/enable_static_default/g
e) s/AC_ENABLE_FAST_INSTALL_DEFAULT/enable_fast_install_default/g
10. Run "autoupdate libtool.m4 ltdl.m4" in the llvm/autoconf/m4 directory.
This should correctly update the macro definitions in the libtool m4
files to match the version of autoconf that LLVM uses. This converts
AC_HELP_STRING to AS_HELP_STRING and AC_TRY_LINK to AC_LINK_IFELSE, amongst
other things. You may need to manually adjust the files.
11. Run AutoRegen.sh to get the new macros into configure script
12. If there are any warnings from AutoRegen.sh, go to step 9.
13. Rebuild LLVM, making sure it reconfigures
14. Test the JIT which uses libltdl
15. If it all works, only THEN commit the changes.
Upgrading autoconf
===============================================================================
If you are in the mood to upgrade autoconf, you should:
1. Consider not upgrading.
2. No really, this is a hassle, you don't want to do it.
3. Get the new version of autoconf and put it in <SRC>
4. configure/build/install autoconf with --prefix=<PFX>
5. Run autoupdate on all the m4 macros in llvm/autoconf/m4
6. Run autoupdate on llvm/autoconf/configure.ac
7. Regenerate configure script with AutoRegen.sh
8. If there are any warnings from AutoRegen.sh, fix them and go to step 7.
9. Test, test, test.

1498
contrib/llvm/autoconf/config.guess vendored Executable file

File diff suppressed because it is too large Load diff

1702
contrib/llvm/autoconf/config.sub vendored Executable file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

522
contrib/llvm/autoconf/depcomp Executable file
View file

@ -0,0 +1,522 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2004-05-31.23
# Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by `PROGRAMS ARGS'.
object Object file output by `PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputing dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit 0
;;
-v | --v*)
echo "depcomp $scriptversion"
exit 0
;;
esac
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> $depfile
echo >> $depfile
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> $depfile
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts `$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
tmpdepfile="$stripped.u"
if test "$libtool" = yes; then
"$@" -Wc,-M
else
"$@" -M
fi
stat=$?
if test -f "$tmpdepfile"; then :
else
stripped=`echo "$stripped" | sed 's,^.*/,,'`
tmpdepfile="$stripped.u"
fi
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
if test -f "$tmpdepfile"; then
outname="$stripped.o"
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler understands `-MD -MF file'. However on
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using \ :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# Dependencies are output in .lo.d with libtool 1.4.
# With libtool 1.5 they are output both in $dir.libs/$base.o.d
# and in $dir.libs/$base.o.d and $dir$base.o.d. We process the
# latter, because the former will be cleaned when $dir.libs is
# erased.
tmpdepfile1="$dir.libs/$base.lo.d"
tmpdepfile2="$dir$base.o.d"
tmpdepfile3="$dir.libs/$base.d"
"$@" -Wc,-MD
else
tmpdepfile1="$dir$base.o.d"
tmpdepfile2="$dir$base.d"
tmpdepfile3="$dir$base.d"
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
if test -f "$tmpdepfile1"; then
tmpdepfile="$tmpdepfile1"
elif test -f "$tmpdepfile2"; then
tmpdepfile="$tmpdepfile2"
else
tmpdepfile="$tmpdepfile3"
fi
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for `:'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
"$@" $dashmflag |
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no
for arg in "$@"; do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
"$@" || exit $?
IFS=" "
for arg
do
case "$arg" in
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

322
contrib/llvm/autoconf/install-sh Executable file
View file

@ -0,0 +1,322 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2004-09-10.20
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
chmodcmd="$chmodprog 0755"
chowncmd=
chgrpcmd=
stripcmd=
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=
dst=
dir_arg=
dstarg=
no_target_directory=
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
-c (ignored)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
--help display this help and exit.
--version display version info and exit.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
"
while test -n "$1"; do
case $1 in
-c) shift
continue;;
-d) dir_arg=true
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
--help) echo "$usage"; exit 0;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-s) stripcmd=$stripprog
shift
continue;;
-t) dstarg=$2
shift
shift
continue;;
-T) no_target_directory=true
shift
continue;;
--version) echo "$0 $scriptversion"; exit 0;;
*) # When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
test -n "$dir_arg$dstarg" && break
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dstarg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dstarg"
shift # fnord
fi
shift # arg
dstarg=$arg
done
break;;
esac
done
if test -z "$1"; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src ;;
esac
if test -n "$dir_arg"; then
dst=$src
src=
if test -d "$dst"; then
mkdircmd=:
chmodcmd=
else
mkdircmd=$mkdirprog
fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dstarg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dstarg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst ;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dstarg: Is a directory" >&2
exit 1
fi
dst=$dst/`basename "$src"`
fi
fi
# This sed command emulates the dirname command.
dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# Skip lots of stat calls in the usual case.
if test ! -d "$dstdir"; then
defaultIFS='
'
IFS="${IFS-$defaultIFS}"
oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS=$oIFS
pathcomp=
while test $# -ne 0 ; do
pathcomp=$pathcomp$1
shift
if test ! -d "$pathcomp"; then
$mkdirprog "$pathcomp"
# mkdir can fail with a `File exist' error in case several
# install-sh are creating the directory concurrently. This
# is OK.
test -d "$pathcomp" || exit
fi
pathcomp=$pathcomp/
done
fi
if test -n "$dir_arg"; then
$doit $mkdircmd "$dst" \
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
else
dstfile=`basename "$dst"`
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
trap '(exit $?); exit' 1 2 13 15
# Copy the file name to the temp name.
$doit $cpprog "$src" "$dsttmp" &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
# Now rename the file to the real destination.
{ $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
|| {
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
if test -f "$dstdir/$dstfile"; then
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
|| $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
|| {
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
(exit 1); exit
}
else
:
fi
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
}
}
fi || { (exit 1); exit; }
done
# The final little trick to "correctly" pass the exit status to the exit trap.
{
(exit 0); exit
}
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,15 @@
#
# Check for Bison.
#
# This macro verifies that Bison is installed. If successful, then
# 1) YACC is set to bison -y (to emulate YACC calls)
# 2) BISON is set to bison
#
AC_DEFUN([AC_PROG_BISON],
[AC_CACHE_CHECK([],[llvm_cv_has_bison],[AC_PROG_YACC()])
if test "$YACC" != "bison -y"; then
AC_SUBST(BISON,[])
AC_MSG_WARN([bison not found, can't rebuild grammars])
else
AC_SUBST(BISON,[bison])
fi])

View file

@ -0,0 +1,42 @@
# Check for the extension used for executables on build platform.
# This is necessary for cross-compiling where the build platform
# may differ from the host platform.
AC_DEFUN([AC_BUILD_EXEEXT],
[
AC_MSG_CHECKING([for executable suffix on build platform])
AC_CACHE_VAL(ac_cv_build_exeext,
[if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
ac_cv_build_exeext=.exe
else
ac_build_prefix=${build_alias}-
AC_CHECK_PROG(BUILD_CC, ${ac_build_prefix}gcc, ${ac_build_prefix}gcc)
if test -z "$BUILD_CC"; then
AC_CHECK_PROG(BUILD_CC, gcc, gcc)
if test -z "$BUILD_CC"; then
AC_CHECK_PROG(BUILD_CC, cc, cc, , , /usr/ucb/cc)
fi
fi
test -z "$BUILD_CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
ac_build_link='${BUILD_CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AS_MESSAGE_LOG_FD'
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_build_exeext=
if AC_TRY_EVAL(ac_build_link); then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj | *.dSYM) ;;
*) ac_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
esac
done
else
AC_MSG_ERROR([installation or configuration problem: compiler cannot create executables.])
fi
rm -f conftest*
test x"${ac_cv_build_exeext}" = x && ac_cv_build_exeext=blank
fi])
BUILD_EXEEXT=""
test x"${ac_cv_build_exeext}" != xblank && BUILD_EXEEXT=${ac_cv_build_exeext}
AC_MSG_RESULT(${ac_cv_build_exeext})
ac_build_exeext=$BUILD_EXEEXT
AC_SUBST(BUILD_EXEEXT)])

View file

@ -0,0 +1,31 @@
#
# Determine if the printf() functions have the %a format character.
# This is modified from:
# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html
AC_DEFUN([AC_C_PRINTF_A],
[AC_CACHE_CHECK([if printf has the %a format character],[llvm_cv_c_printf_a],
[AC_LANG_PUSH([C])
AC_RUN_IFELSE([
AC_LANG_PROGRAM([[
#include <stdio.h>
#include <stdlib.h>
]],[[
volatile double A, B;
char Buffer[100];
A = 1;
A /= 10.0;
sprintf(Buffer, "%a", A);
B = atof(Buffer);
if (A != B)
return (1);
if (A != 0x1.999999999999ap-4)
return (1);
return (0);]])],
llvm_cv_c_printf_a=yes,
llvmac_cv_c_printf_a=no,
llvmac_cv_c_printf_a=no)
AC_LANG_POP([C])])
if test "$llvm_cv_c_printf_a" = "yes"; then
AC_DEFINE([HAVE_PRINTF_A],[1],[Define to have the %a format string])
fi
])

View file

@ -0,0 +1,26 @@
#
# Check for GNU Make. This is originally from
# http://www.gnu.org/software/ac-archive/htmldoc/check_gnu_make.html
#
AC_DEFUN([AC_CHECK_GNU_MAKE],
[AC_CACHE_CHECK([for GNU make],[llvm_cv_gnu_make_command],
dnl Search all the common names for GNU make
[llvm_cv_gnu_make_command=''
for a in "$MAKE" make gmake gnumake ; do
if test -z "$a" ; then continue ; fi ;
if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null )
then
llvm_cv_gnu_make_command=$a ;
break;
fi
done])
dnl If there was a GNU version, then set @ifGNUmake@ to the empty string,
dnl '#' otherwise
if test "x$llvm_cv_gnu_make_command" != "x" ; then
ifGNUmake='' ;
else
ifGNUmake='#' ;
AC_MSG_RESULT("Not found");
fi
AC_SUBST(ifGNUmake)
])

View file

@ -0,0 +1,9 @@
#
# Configure a Makefile without clobbering it if it exists and is not out of
# date. This macro is unique to LLVM.
#
AC_DEFUN([AC_CONFIG_MAKEFILE],
[AC_CONFIG_COMMANDS($1,
[${llvm_src}/autoconf/mkinstalldirs `dirname $1`
${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/$1 $1])
])

View file

@ -0,0 +1,14 @@
#
# Provide the arguments and other processing needed for an LLVM project
#
AC_DEFUN([LLVM_CONFIG_PROJECT],
[AC_ARG_WITH([llvmsrc],
AS_HELP_STRING([--with-llvmsrc],[Location of LLVM Source Code]),
[llvm_src="$withval"],[llvm_src="]$1["])
AC_SUBST(LLVM_SRC,$llvm_src)
AC_ARG_WITH([llvmobj],
AS_HELP_STRING([--with-llvmobj],[Location of LLVM Object Code]),
[llvm_obj="$withval"],[llvm_obj="]$2["])
AC_SUBST(LLVM_OBJ,$llvm_obj)
AC_CONFIG_COMMANDS([setup],,[llvm_src="${LLVM_SRC}"])
])

View file

@ -0,0 +1,22 @@
#
# Check for bidirectional iterator extension. This is modified from
# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html
#
AC_DEFUN([AC_CXX_HAVE_BI_ITERATOR],
[AC_CACHE_CHECK(whether the compiler has the bidirectional iterator,
ac_cv_cxx_have_bi_iterator,
[AC_REQUIRE([AC_CXX_NAMESPACES])
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <iterator>
#ifdef HAVE_NAMESPACES
using namespace std;
#endif]], [[bidirectional_iterator<int,int> t; return 0;]])],[ac_cv_cxx_have_bi_iterator=yes],[ac_cv_cxx_have_bi_iterator=no])
AC_LANG_POP([C++])
])
if test "$ac_cv_cxx_have_bi_iterator" = yes
then
AC_DEFINE(HAVE_BI_ITERATOR,1,[Have bi-directional iterator])
else
AC_DEFINE(HAVE_BI_ITERATOR,0,[Does not have bi-directional iterator])
fi
])

View file

@ -0,0 +1,2 @@
AC_DEFUN([CXX_FLAG_CHECK],
[AC_SUBST($1, `$CXX $2 -fsyntax-only -xc /dev/null 2>/dev/null && echo $2`)])

View file

@ -0,0 +1,22 @@
# Check for forward iterator extension. This is modified from
# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html
AC_DEFUN([AC_CXX_HAVE_FWD_ITERATOR],
[AC_CACHE_CHECK(whether the compiler has forward iterators,
ac_cv_cxx_have_fwd_iterator,
[AC_REQUIRE([AC_CXX_NAMESPACES])
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <iterator>
#ifdef HAVE_NAMESPACES
using namespace std;
#endif]], [[forward_iterator<int,int> t; return 0;]])],[ac_cv_cxx_have_fwd_iterator=yes],[ac_cv_cxx_have_fwd_iterator=no])
AC_LANG_POP([C++])
])
if test "$ac_cv_cxx_have_fwd_iterator" = yes
then
AC_DEFINE(HAVE_FWD_ITERATOR,1,[Have forward iterator])
else
AC_DEFINE(HAVE_FWD_ITERATOR,0,[Does not have forward iterator])
fi
])

View file

@ -0,0 +1,19 @@
# Check for C++ namespace support. This is from
# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_namespaces.html
#
AC_DEFUN([AC_CXX_NAMESPACES],
[AC_CACHE_CHECK(whether the compiler implements namespaces,
ac_cv_cxx_namespaces,
[AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[namespace Outer { namespace Inner { int i = 0; }}]],
[[using namespace Outer::Inner; return i;]])],
ac_cv_cxx_namespaces=yes,
ac_cv_cxx_namespaces=no)
AC_LANG_POP([C++])
])
if test "$ac_cv_cxx_namespaces" = yes; then
AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces])
fi
])

View file

@ -0,0 +1,26 @@
# Check for standard iterator extension. This is modified from
# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html
AC_DEFUN([AC_CXX_HAVE_STD_ITERATOR],
[AC_CACHE_CHECK(whether the compiler has the standard iterator,
ac_cv_cxx_have_std_iterator,
[AC_REQUIRE([AC_CXX_NAMESPACES])
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <iterator>
#ifdef HAVE_NAMESPACES
using namespace std;
#endif]],
[[iterator<int,int,int> t; return 0;]])],
ac_cv_cxx_have_std_iterator=yes,
ac_cv_cxx_have_std_iterator=no)
AC_LANG_POP([C++])
])
if test "$ac_cv_cxx_have_std_iterator" = yes
then
AC_DEFINE(HAVE_STD_ITERATOR,1,[Have std namespace iterator])
else
AC_DEFINE(HAVE_STD_ITERATOR,0,[Does not have std namespace iterator])
fi
])

View file

@ -0,0 +1,118 @@
dnl Check for a standard program that has a bin, include and lib directory
dnl
dnl Parameters:
dnl $1 - prefix directory to check
dnl $2 - program name to check
dnl $3 - header file to check
dnl $4 - library file to check
AC_DEFUN([CHECK_STD_PROGRAM],
[m4_define([allcapsname],translit($2,a-z,A-Z))
if test -n "$1" -a -d "$1" -a -n "$2" -a -d "$1/bin" -a -x "$1/bin/$2" ; then
AC_SUBST([USE_]allcapsname(),["USE_]allcapsname()[ = 1"])
AC_SUBST(allcapsname(),[$1/bin/$2])
AC_SUBST(allcapsname()[_BIN],[$1/bin])
AC_SUBST(allcapsname()[_DIR],[$1])
if test -n "$3" -a -d "$1/include" -a -f "$1/include/$3" ; then
AC_SUBST(allcapsname()[_INC],[$1/include])
fi
if test -n "$4" -a -d "$1/lib" -a -f "$1/lib/$4" ; then
AC_SUBST(allcapsname()[_LIB],[$1/lib])
fi
fi
])
dnl Find a program via --with options, in the path, or well known places
dnl
dnl Parameters:
dnl $1 - program's executable name
dnl $2 - header file name to check (optional)
dnl $3 - library file name to check (optional)
dnl $4 - alternate (long) name for the program
AC_DEFUN([FIND_STD_PROGRAM],
[m4_define([allcapsname],translit($1,a-z,A-Z))
m4_define([stdprog_long_name],ifelse($4,,translit($1,[ !@#$%^&*()-+={}[]:;"',./?],[-]),translit($4,[ !@#$%^&*()-+={}[]:;"',./?],[-])))
AC_MSG_CHECKING([for ]stdprog_long_name()[ bin/lib/include locations])
AC_ARG_WITH($1,
AS_HELP_STRING([--with-]stdprog_long_name()[=DIR],
[Specify that the ]stdprog_long_name()[ install prefix is DIR]),
$1[pfxdir=$withval],$1[pfxdir=nada])
AC_ARG_WITH($1[-bin],
AS_HELP_STRING([--with-]stdprog_long_name()[-bin=DIR],
[Specify that the ]stdprog_long_name()[ binary is in DIR]),
$1[bindir=$withval],$1[bindir=nada])
AC_ARG_WITH($1[-lib],
AS_HELP_STRING([--with-]stdprog_long_name()[-lib=DIR],
[Specify that ]stdprog_long_name()[ libraries are in DIR]),
$1[libdir=$withval],$1[libdir=nada])
AC_ARG_WITH($1[-inc],
AS_HELP_STRING([--with-]stdprog_long_name()[-inc=DIR],
[Specify that the ]stdprog_long_name()[ includes are in DIR]),
$1[incdir=$withval],$1[incdir=nada])
eval pfxval=\$\{$1pfxdir\}
eval binval=\$\{$1bindir\}
eval incval=\$\{$1incdir\}
eval libval=\$\{$1libdir\}
if test "${pfxval}" != "nada" ; then
CHECK_STD_PROGRAM(${pfxval},$1,$2,$3)
elif test "${binval}" != "nada" ; then
if test "${libval}" != "nada" ; then
if test "${incval}" != "nada" ; then
if test -d "${binval}" ; then
if test -d "${incval}" ; then
if test -d "${libval}" ; then
AC_SUBST(allcapsname(),${binval}/$1)
AC_SUBST(allcapsname()[_BIN],${binval})
AC_SUBST(allcapsname()[_INC],${incval})
AC_SUBST(allcapsname()[_LIB],${libval})
AC_SUBST([USE_]allcapsname(),["USE_]allcapsname()[ = 1"])
AC_MSG_RESULT([found via --with options])
else
AC_MSG_RESULT([failed])
AC_MSG_ERROR([The --with-]$1[-libdir value must be a directory])
fi
else
AC_MSG_RESULT([failed])
AC_MSG_ERROR([The --with-]$1[-incdir value must be a directory])
fi
else
AC_MSG_RESULT([failed])
AC_MSG_ERROR([The --with-]$1[-bindir value must be a directory])
fi
else
AC_MSG_RESULT([failed])
AC_MSG_ERROR([The --with-]$1[-incdir option must be specified])
fi
else
AC_MSG_RESULT([failed])
AC_MSG_ERROR([The --with-]$1[-libdir option must be specified])
fi
else
tmppfxdir=`which $1 2>&1`
if test -n "$tmppfxdir" -a -d "${tmppfxdir%*$1}" -a \
-d "${tmppfxdir%*$1}/.." ; then
tmppfxdir=`cd "${tmppfxdir%*$1}/.." ; pwd`
CHECK_STD_PROGRAM($tmppfxdir,$1,$2,$3)
AC_MSG_RESULT([found in PATH at ]$tmppfxdir)
else
checkresult="yes"
eval checkval=\$\{"USE_"allcapsname()\}
CHECK_STD_PROGRAM([/usr],$1,$2,$3)
if test -z "${checkval}" ; then
CHECK_STD_PROGRAM([/usr/local],$1,$2,$3)
if test -z "${checkval}" ; then
CHECK_STD_PROGRAM([/sw],$1,$2,$3)
if test -z "${checkval}" ; then
CHECK_STD_PROGRAM([/opt],$1,$2,$3)
if test -z "${checkval}" ; then
CHECK_STD_PROGRAM([/],$1,$2,$3)
if test -z "${checkval}" ; then
checkresult="no"
fi
fi
fi
fi
fi
AC_MSG_RESULT($checkresult)
fi
fi
])

View file

@ -0,0 +1,17 @@
#
# Check for FLEX.
#
# This macro verifies that flex is installed. If successful, then
# 1) $LEX is set to "flex" (to emulate lex calls)
# 2) BISON is set to bison
AC_DEFUN([AC_PROG_FLEX],
[AC_CACHE_CHECK(,
ac_cv_has_flex,
[AC_PROG_LEX()
])
if test "$LEX" != "flex"; then
AC_MSG_ERROR([flex not found but required])
else
AC_SUBST(FLEX,[flex],[location of flex])
fi
])

View file

@ -0,0 +1,36 @@
#
# This function determins if the the isinf function isavailable on this
# platform.
#
AC_DEFUN([AC_FUNC_ISINF],[
AC_SINGLE_CXX_CHECK([ac_cv_func_isinf_in_math_h],
[isinf], [<math.h>],
[float f; isinf(f);])
if test "$ac_cv_func_isinf_in_math_h" = "yes" ; then
AC_DEFINE([HAVE_ISINF_IN_MATH_H],1,[Set to 1 if the isinf function is found in <math.h>])
fi
AC_SINGLE_CXX_CHECK([ac_cv_func_isinf_in_cmath],
[isinf], [<cmath>],
[float f; isinf(f);])
if test "$ac_cv_func_isinf_in_cmath" = "yes" ; then
AC_DEFINE([HAVE_ISINF_IN_CMATH],1,[Set to 1 if the isinf function is found in <cmath>])
fi
AC_SINGLE_CXX_CHECK([ac_cv_func_std_isinf_in_cmath],
[std::isinf], [<cmath>],
[float f; std::isinf(f)}])
if test "$ac_cv_func_std_isinf_in_cmath" = "yes" ; then
AC_DEFINE([HAVE_STD_ISINF_IN_CMATH],1,[Set to 1 if the std::isinf function is found in <cmath>])
fi
AC_SINGLE_CXX_CHECK([ac_cv_func_finite_in_ieeefp_h],
[finite], [<ieeefp.h>],
[float f; finite(f);])
if test "$ac_cv_func_finite_in_ieeefp_h" = "yes" ; then
AC_DEFINE([HAVE_FINITE_IN_IEEEFP_H],1,[Set to 1 if the finite function is found in <ieeefp.h>])
fi
])

View file

@ -0,0 +1,27 @@
#
# This function determines if the isnan function is available on this
# platform.
#
AC_DEFUN([AC_FUNC_ISNAN],[
AC_SINGLE_CXX_CHECK([ac_cv_func_isnan_in_math_h],
[isnan], [<math.h>],
[float f; isnan(f);])
if test "$ac_cv_func_isnan_in_math_h" = "yes" ; then
AC_DEFINE([HAVE_ISNAN_IN_MATH_H],1,[Set to 1 if the isnan function is found in <math.h>])
fi
AC_SINGLE_CXX_CHECK([ac_cv_func_isnan_in_cmath],
[isnan], [<cmath>],
[float f; isnan(f);])
if test "$ac_cv_func_isnan_in_cmath" = "yes" ; then
AC_DEFINE([HAVE_ISNAN_IN_CMATH],1,[Set to 1 if the isnan function is found in <cmath>])
fi
AC_SINGLE_CXX_CHECK([ac_cv_func_std_isnan_in_cmath],
[std::isnan], [<cmath>],
[float f; std::isnan(f);])
if test "$ac_cv_func_std_isnan_in_cmath" = "yes" ; then
AC_DEFINE([HAVE_STD_ISNAN_IN_CMATH],1,[Set to 1 if the std::isnan function is found in <cmath>])
fi
])

View file

@ -0,0 +1,26 @@
#
# Check for the ability to mmap a file.
#
AC_DEFUN([AC_FUNC_MMAP_FILE],
[AC_CACHE_CHECK(for mmap of files,
ac_cv_func_mmap_file,
[ AC_LANG_PUSH([C])
AC_RUN_IFELSE([
AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/mman.h>
#include <fcntl.h>
]],[[
int fd;
fd = creat ("foo",0777);
fd = (int) mmap (0, 1, PROT_READ, MAP_SHARED, fd, 0);
unlink ("foo");
return (fd != (int) MAP_FAILED);]])],
[ac_cv_func_mmap_file=yes],[ac_cv_func_mmap_file=no],[ac_cv_func_mmap_file=no])
AC_LANG_POP([C])
])
if test "$ac_cv_func_mmap_file" = yes; then
AC_DEFINE([HAVE_MMAP_FILE],[],[Define if mmap() can map files into memory])
AC_SUBST(MMAP_FILE,[yes])
fi
])

View file

@ -0,0 +1,21 @@
#
# Check for anonymous mmap macros. This is modified from
# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html
#
AC_DEFUN([AC_HEADER_MMAP_ANONYMOUS],
[AC_CACHE_CHECK(for MAP_ANONYMOUS vs. MAP_ANON,
ac_cv_header_mmap_anon,
[ AC_LANG_PUSH([C])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <sys/mman.h>
#include <unistd.h>
#include <fcntl.h>]],
[[mmap (0, 1, PROT_READ, MAP_ANONYMOUS, -1, 0); return (0);]])],
ac_cv_header_mmap_anon=yes,
ac_cv_header_mmap_anon=no)
AC_LANG_POP([C])
])
if test "$ac_cv_header_mmap_anon" = yes; then
AC_DEFINE([HAVE_MMAP_ANONYMOUS],[1],[Define if mmap() uses MAP_ANONYMOUS to map anonymous pages, or undefine if it uses MAP_ANON])
fi
])

View file

@ -0,0 +1,20 @@
#
# This function determins if the the HUGE_VAL macro is compilable with the
# -pedantic switch or not. XCode < 2.4.1 doesn't get it right.
#
AC_DEFUN([AC_HUGE_VAL_CHECK],[
AC_CACHE_CHECK([for HUGE_VAL sanity], [ac_cv_huge_val_sanity],[
AC_LANG_PUSH([C++])
ac_save_CXXFLAGS=$CXXFLAGS
CXXFLAGS=-pedantic
AC_RUN_IFELSE(
AC_LANG_PROGRAM(
[#include <math.h>],
[double x = HUGE_VAL; return x != x; ]),
[ac_cv_huge_val_sanity=yes],[ac_cv_huge_val_sanity=no],
[ac_cv_huge_val_sanity=yes])
CXXFLAGS=$ac_save_CXXFLAGS
AC_LANG_POP([C++])
])
AC_SUBST(HUGE_VAL_SANITY,$ac_cv_huge_val_sanity)
])

6389
contrib/llvm/autoconf/m4/libtool.m4 vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,84 @@
#
# Determine if the system can handle the -R option being passed to the linker.
#
# This macro is specific to LLVM.
#
AC_DEFUN([AC_LINK_USE_R],
[AC_CACHE_CHECK([for compiler -Wl,-R<path> option],[llvm_cv_link_use_r],
[ AC_LANG_PUSH([C])
oldcflags="$CFLAGS"
CFLAGS="$CFLAGS -Wl,-R."
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
[llvm_cv_link_use_r=yes],[llvm_cv_link_use_r=no])
CFLAGS="$oldcflags"
AC_LANG_POP([C])
])
if test "$llvm_cv_link_use_r" = yes ; then
AC_DEFINE([HAVE_LINK_R],[1],[Define if you can use -Wl,-R. to pass -R. to the linker, in order to add the current directory to the dynamic linker search path.])
fi
])
#
# Determine if the system can handle the -R option being passed to the linker.
#
# This macro is specific to LLVM.
#
AC_DEFUN([AC_LINK_EXPORT_DYNAMIC],
[AC_CACHE_CHECK([for compiler -Wl,-export-dynamic option],
[llvm_cv_link_use_export_dynamic],
[ AC_LANG_PUSH([C])
oldcflags="$CFLAGS"
CFLAGS="$CFLAGS -Wl,-export-dynamic"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
[llvm_cv_link_use_export_dynamic=yes],[llvm_cv_link_use_export_dynamic=no])
CFLAGS="$oldcflags"
AC_LANG_POP([C])
])
if test "$llvm_cv_link_use_export_dynamic" = yes ; then
AC_DEFINE([HAVE_LINK_EXPORT_DYNAMIC],[1],[Define if you can use -Wl,-export-dynamic.])
fi
])
#
# Determine if the system can handle the -retain-symbols-file option being
# passed to the linker.
#
# This macro is specific to LLVM.
#
AC_DEFUN([AC_LINK_RETAIN_SYMBOLS_FILE],
[AC_CACHE_CHECK([for compiler -Wl,-retain-symbols-file option],
[llvm_cv_link_use_retain_symbols_file],
[ AC_LANG_PUSH([C])
oldcflags="$CFLAGS"
# The following code is from the autoconf manual,
# "11.13: Limitations of Usual Tools".
# Create a temporary directory $tmp in $TMPDIR (default /tmp).
# Use mktemp if possible; otherwise fall back on mkdir,
# with $RANDOM to make collisions less likely.
: ${TMPDIR=/tmp}
{
tmp=`
(umask 077 && mktemp -d "$TMPDIR/fooXXXXXX") 2>/dev/null
` &&
test -n "$tmp" && test -d "$tmp"
} || {
tmp=$TMPDIR/foo$$-$RANDOM
(umask 077 && mkdir "$tmp")
} || exit $?
echo "main" > "$tmp/exports"
CFLAGS="$CFLAGS -Wl,-retain-symbols-file=$tmp/exports"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
[llvm_cv_link_use_retain_symbols_file=yes],[llvm_cv_link_use_retain_symbols_file=no])
rm "$tmp/exports"
rmdir "$tmp"
CFLAGS="$oldcflags"
AC_LANG_POP([C])
])
if test "$llvm_cv_link_use_retain_symbols_file" = yes ; then
AC_SUBST(HAVE_LINK_RETAIN_SYMBOLS_FILE,1)
fi
])

View file

@ -0,0 +1,17 @@
#
# Some Linux machines run a 64-bit kernel with a 32-bit userspace. 'uname -m'
# shows these as x86_64. Ask the system 'gcc' what it thinks.
#
AC_DEFUN([AC_IS_LINUX_MIXED],
[AC_CACHE_CHECK(for 32-bit userspace on 64-bit system,llvm_cv_linux_mixed,
[ AC_LANG_PUSH([C])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#ifndef __x86_64__
error: Not x86-64 even if uname says so!
#endif
]])],
[llvm_cv_linux_mixed=no],
[llvm_cv_linux_mixed=yes])
AC_LANG_POP([C])
])
])

View file

@ -0,0 +1,418 @@
## ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*-
## Copyright (C) 1999-2000 Free Software Foundation, Inc.
##
## This file is free software; the Free Software Foundation gives
## unlimited permission to copy and/or distribute it, with or without
## modifications, as long as this notice is preserved.
# serial 7 AC_LIB_LTDL
# AC_WITH_LTDL
# ------------
# Clients of libltdl can use this macro to allow the installer to
# choose between a shipped copy of the ltdl sources or a preinstalled
# version of the library.
AC_DEFUN([AC_WITH_LTDL],
[AC_REQUIRE([AC_LIB_LTDL])
AC_SUBST([LIBLTDL])
AC_SUBST([INCLTDL])
# Unless the user asks us to check, assume no installed ltdl exists.
use_installed_libltdl=no
AC_ARG_WITH([included_ltdl],
[ --with-included-ltdl use the GNU ltdl sources included here])
if test "x$with_included_ltdl" != xyes; then
# We are not being forced to use the included libltdl sources, so
# decide whether there is a useful installed version we can use.
AC_CHECK_HEADER([ltdl.h],
[AC_CHECK_LIB([ltdl], [lt_dlcaller_register],
[with_included_ltdl=no],
[with_included_ltdl=yes])
])
fi
if test "x$enable_ltdl_install" != xyes; then
# If the user did not specify an installable libltdl, then default
# to a convenience lib.
AC_LIBLTDL_CONVENIENCE
fi
if test "x$with_included_ltdl" = xno; then
# If the included ltdl is not to be used. then Use the
# preinstalled libltdl we found.
AC_DEFINE([HAVE_LTDL], [1],
[Define this if a modern libltdl is already installed])
LIBLTDL=-lltdl
fi
# Report our decision...
AC_MSG_CHECKING([whether to use included libltdl])
AC_MSG_RESULT([$with_included_ltdl])
AC_CONFIG_SUBDIRS([libltdl])
])# AC_WITH_LTDL
# AC_LIB_LTDL
# -----------
# Perform all the checks necessary for compilation of the ltdl objects
# -- including compiler checks and header checks.
AC_DEFUN([AC_LIB_LTDL],
[AC_PREREQ(2.60)
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_C_CONST])
AC_REQUIRE([AC_HEADER_STDC])
AC_REQUIRE([AC_HEADER_DIRENT])
AC_REQUIRE([_LT_AC_CHECK_DLFCN])
AC_REQUIRE([AC_LTDL_ENABLE_INSTALL])
AC_REQUIRE([AC_LTDL_SHLIBEXT])
AC_REQUIRE([AC_LTDL_SHLIBPATH])
AC_REQUIRE([AC_LTDL_SYSSEARCHPATH])
AC_REQUIRE([AC_LTDL_OBJDIR])
AC_REQUIRE([AC_LTDL_DLPREOPEN])
AC_REQUIRE([AC_LTDL_DLLIB])
AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])
AC_REQUIRE([AC_LTDL_DLSYM_USCORE])
AC_REQUIRE([AC_LTDL_SYS_DLOPEN_DEPLIBS])
AC_REQUIRE([AC_LTDL_FUNC_ARGZ])
AC_CHECK_HEADERS([assert.h ctype.h errno.h malloc.h memory.h stdlib.h \
stdio.h unistd.h])
AC_CHECK_HEADERS([dl.h sys/dl.h dld.h mach-o/dyld.h])
AC_CHECK_HEADERS([string.h strings.h], [break])
AC_CHECK_FUNCS([strchr index], [break])
AC_CHECK_FUNCS([strrchr rindex], [break])
AC_CHECK_FUNCS([memcpy bcopy], [break])
AC_CHECK_FUNCS([memmove strcmp])
AC_CHECK_FUNCS([closedir opendir readdir])
])# AC_LIB_LTDL
# AC_LTDL_ENABLE_INSTALL
# ----------------------
AC_DEFUN([AC_LTDL_ENABLE_INSTALL],
[AC_ARG_ENABLE([ltdl-install],
[AS_HELP_STRING([--enable-ltdl-install],[install libltdl])])
AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)
])# AC_LTDL_ENABLE_INSTALL
# AC_LTDL_SYS_DLOPEN_DEPLIBS
# --------------------------
AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS],
[AC_REQUIRE([AC_CANONICAL_HOST])
AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
[libltdl_cv_sys_dlopen_deplibs],
[# PORTME does your system automatically load deplibs for dlopen?
# or its logical equivalent (e.g. shl_load for HP-UX < 11)
# For now, we just catch OSes we know something about -- in the
# future, we'll try test this programmatically.
libltdl_cv_sys_dlopen_deplibs=unknown
case "$host_os" in
aix3*|aix4.1.*|aix4.2.*)
# Unknown whether this is true for these versions of AIX, but
# we want this `case' here to explicitly catch those versions.
libltdl_cv_sys_dlopen_deplibs=unknown
;;
aix[[45]]*)
libltdl_cv_sys_dlopen_deplibs=yes
;;
darwin*)
# Assuming the user has installed a libdl from somewhere, this is true
# If you are looking for one http://www.opendarwin.org/projects/dlcompat
libltdl_cv_sys_dlopen_deplibs=yes
;;
gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
# GNU and its variants, using gnu ld.so (Glibc)
libltdl_cv_sys_dlopen_deplibs=yes
;;
hpux10*|hpux11*)
libltdl_cv_sys_dlopen_deplibs=yes
;;
interix*)
libltdl_cv_sys_dlopen_deplibs=yes
;;
irix[[12345]]*|irix6.[[01]]*)
# Catch all versions of IRIX before 6.2, and indicate that we don't
# know how it worked for any of those versions.
libltdl_cv_sys_dlopen_deplibs=unknown
;;
irix*)
# The case above catches anything before 6.2, and it's known that
# at 6.2 and later dlopen does load deplibs.
libltdl_cv_sys_dlopen_deplibs=yes
;;
netbsd*)
libltdl_cv_sys_dlopen_deplibs=yes
;;
openbsd*)
libltdl_cv_sys_dlopen_deplibs=yes
;;
osf[[1234]]*)
# dlopen did load deplibs (at least at 4.x), but until the 5.x series,
# it did *not* use an RPATH in a shared library to find objects the
# library depends on, so we explictly say `no'.
libltdl_cv_sys_dlopen_deplibs=no
;;
osf5.0|osf5.0a|osf5.1)
# dlopen *does* load deplibs and with the right loader patch applied
# it even uses RPATH in a shared library to search for shared objects
# that the library depends on, but there's no easy way to know if that
# patch is installed. Since this is the case, all we can really
# say is unknown -- it depends on the patch being installed. If
# it is, this changes to `yes'. Without it, it would be `no'.
libltdl_cv_sys_dlopen_deplibs=unknown
;;
osf*)
# the two cases above should catch all versions of osf <= 5.1. Read
# the comments above for what we know about them.
# At > 5.1, deplibs are loaded *and* any RPATH in a shared library
# is used to find them so we can finally say `yes'.
libltdl_cv_sys_dlopen_deplibs=yes
;;
solaris*)
libltdl_cv_sys_dlopen_deplibs=yes
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
libltdl_cv_sys_dlopen_deplibs=yes
;;
esac
])
if test "$libltdl_cv_sys_dlopen_deplibs" != yes; then
AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1],
[Define if the OS needs help to load dependent libraries for dlopen().])
fi
])# AC_LTDL_SYS_DLOPEN_DEPLIBS
# AC_LTDL_SHLIBEXT
# ----------------
AC_DEFUN([AC_LTDL_SHLIBEXT],
[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER])
AC_CACHE_CHECK([which extension is used for loadable modules],
[libltdl_cv_shlibext],
[
module=yes
eval libltdl_cv_shlibext=$shrext_cmds
])
if test -n "$libltdl_cv_shlibext"; then
AC_DEFINE_UNQUOTED([LTDL_SHLIB_EXT], ["$libltdl_cv_shlibext"],
[Define to the extension used for shared libraries, say, ".so".])
fi
])# AC_LTDL_SHLIBEXT
# AC_LTDL_SHLIBPATH
# -----------------
AC_DEFUN([AC_LTDL_SHLIBPATH],
[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER])
AC_CACHE_CHECK([which variable specifies run-time library path],
[libltdl_cv_shlibpath_var], [libltdl_cv_shlibpath_var="$shlibpath_var"])
if test -n "$libltdl_cv_shlibpath_var"; then
AC_DEFINE_UNQUOTED([LTDL_SHLIBPATH_VAR], ["$libltdl_cv_shlibpath_var"],
[Define to the name of the environment variable that determines the dynamic library search path.])
fi
])# AC_LTDL_SHLIBPATH
# AC_LTDL_SYSSEARCHPATH
# ---------------------
AC_DEFUN([AC_LTDL_SYSSEARCHPATH],
[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER])
AC_CACHE_CHECK([for the default library search path],
[libltdl_cv_sys_search_path],
[libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec"])
if test -n "$libltdl_cv_sys_search_path"; then
sys_search_path=
for dir in $libltdl_cv_sys_search_path; do
if test -z "$sys_search_path"; then
sys_search_path="$dir"
else
sys_search_path="$sys_search_path$PATH_SEPARATOR$dir"
fi
done
AC_DEFINE_UNQUOTED([LTDL_SYSSEARCHPATH], ["$sys_search_path"],
[Define to the system default library search path.])
fi
])# AC_LTDL_SYSSEARCHPATH
# AC_LTDL_OBJDIR
# --------------
AC_DEFUN([AC_LTDL_OBJDIR],
[AC_CACHE_CHECK([for objdir],
[libltdl_cv_objdir],
[libltdl_cv_objdir="$objdir"
if test -n "$objdir"; then
:
else
rm -f .libs 2>/dev/null
mkdir .libs 2>/dev/null
if test -d .libs; then
libltdl_cv_objdir=.libs
else
# MS-DOS does not allow filenames that begin with a dot.
libltdl_cv_objdir=_libs
fi
rmdir .libs 2>/dev/null
fi
])
AC_DEFINE_UNQUOTED([LTDL_OBJDIR], ["$libltdl_cv_objdir/"],
[Define to the sub-directory in which libtool stores uninstalled libraries.])
])# AC_LTDL_OBJDIR
# AC_LTDL_DLPREOPEN
# -----------------
AC_DEFUN([AC_LTDL_DLPREOPEN],
[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])
AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
[libltdl_cv_preloaded_symbols],
[if test -n "$lt_cv_sys_global_symbol_pipe"; then
libltdl_cv_preloaded_symbols=yes
else
libltdl_cv_preloaded_symbols=no
fi
])
if test x"$libltdl_cv_preloaded_symbols" = xyes; then
AC_DEFINE([HAVE_PRELOADED_SYMBOLS], [1],
[Define if libtool can extract symbol lists from object files.])
fi
])# AC_LTDL_DLPREOPEN
# AC_LTDL_DLLIB
# -------------
AC_DEFUN([AC_LTDL_DLLIB],
[LIBADD_DL=
AC_SUBST(LIBADD_DL)
AC_LANG_PUSH([C])
AC_CHECK_FUNC([shl_load],
[AC_DEFINE([HAVE_SHL_LOAD], [1],
[Define if you have the shl_load function.])],
[AC_CHECK_LIB([dld], [shl_load],
[AC_DEFINE([HAVE_SHL_LOAD], [1],
[Define if you have the shl_load function.])
LIBADD_DL="$LIBADD_DL -ldld"],
[AC_CHECK_LIB([dl], [dlopen],
[AC_DEFINE([HAVE_LIBDL], [1],
[Define if you have the libdl library or equivalent.])
LIBADD_DL="-ldl" libltdl_cv_lib_dl_dlopen="yes"],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H
# include <dlfcn.h>
#endif
]], [[dlopen(0, 0);]])],[AC_DEFINE([HAVE_LIBDL], [1],
[Define if you have the libdl library or equivalent.]) libltdl_cv_func_dlopen="yes"],[AC_CHECK_LIB([svld], [dlopen],
[AC_DEFINE([HAVE_LIBDL], [1],
[Define if you have the libdl library or equivalent.])
LIBADD_DL="-lsvld" libltdl_cv_func_dlopen="yes"],
[AC_CHECK_LIB([dld], [dld_link],
[AC_DEFINE([HAVE_DLD], [1],
[Define if you have the GNU dld library.])
LIBADD_DL="$LIBADD_DL -ldld"],
[AC_CHECK_FUNC([_dyld_func_lookup],
[AC_DEFINE([HAVE_DYLD], [1],
[Define if you have the _dyld_func_lookup function.])])
])
])
])
])
])
])
if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes
then
lt_save_LIBS="$LIBS"
LIBS="$LIBS $LIBADD_DL"
AC_CHECK_FUNCS([dlerror])
LIBS="$lt_save_LIBS"
fi
AC_LANG_POP
])# AC_LTDL_DLLIB
# AC_LTDL_SYMBOL_USCORE
# ---------------------
# does the compiler prefix global symbols with an underscore?
AC_DEFUN([AC_LTDL_SYMBOL_USCORE],
[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])
AC_CACHE_CHECK([for _ prefix in compiled symbols],
[ac_cv_sys_symbol_underscore],
[ac_cv_sys_symbol_underscore=no
cat > conftest.$ac_ext <<EOF
void nm_test_func(){}
int main(){nm_test_func;return 0;}
EOF
if AC_TRY_EVAL(ac_compile); then
# Now try to grab the symbols.
ac_nlist=conftest.nm
if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
# See whether the symbols have a leading underscore.
if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
ac_cv_sys_symbol_underscore=yes
else
if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
:
else
echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD
fi
fi
else
echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
fi
else
echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
cat conftest.c >&AS_MESSAGE_LOG_FD
fi
rm -rf conftest*
])
])# AC_LTDL_SYMBOL_USCORE
# AC_LTDL_DLSYM_USCORE
# --------------------
AC_DEFUN([AC_LTDL_DLSYM_USCORE],
[AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])
if test x"$ac_cv_sys_symbol_underscore" = xyes; then
if test x"$libltdl_cv_func_dlopen" = xyes ||
test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then
AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
[libltdl_cv_need_uscore],
[libltdl_cv_need_uscore=unknown
save_LIBS="$LIBS"
LIBS="$LIBS $LIBADD_DL"
_LT_AC_TRY_DLOPEN_SELF(
[libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes],
[], [libltdl_cv_need_uscore=cross])
LIBS="$save_LIBS"
])
fi
fi
if test x"$libltdl_cv_need_uscore" = xyes; then
AC_DEFINE([NEED_USCORE], [1],
[Define if dlsym() requires a leading underscore in symbol names.])
fi
])# AC_LTDL_DLSYM_USCORE
# AC_LTDL_FUNC_ARGZ
# -----------------
AC_DEFUN([AC_LTDL_FUNC_ARGZ],
[AC_CHECK_HEADERS([argz.h])
AC_CHECK_TYPES([error_t],
[],
[AC_DEFINE([error_t], [int],
[Define to a type to use for `error_t' if it is not otherwise available.])],
[#if HAVE_ARGZ_H
# include <argz.h>
#endif])
AC_CHECK_FUNCS([argz_append argz_create_sep argz_insert argz_next argz_stringify])
])# AC_LTDL_FUNC_ARGZ

View file

@ -0,0 +1,17 @@
#
# When allocating RWX memory, check whether we need to use /dev/zero
# as the file descriptor or not.
#
AC_DEFUN([AC_NEED_DEV_ZERO_FOR_MMAP],
[AC_CACHE_CHECK([if /dev/zero is needed for mmap],
ac_cv_need_dev_zero_for_mmap,
[if test "$llvm_cv_os_type" = "Interix" ; then
ac_cv_need_dev_zero_for_mmap=yes
else
ac_cv_need_dev_zero_for_mmap=no
fi
])
if test "$ac_cv_need_dev_zero_for_mmap" = yes; then
AC_DEFINE([NEED_DEV_ZERO_FOR_MMAP],[1],
[Define if /dev/zero should be used when mapping RWX memory, or undefine if its not necessary])
fi])

View file

@ -0,0 +1,16 @@
dnl Check for a reasonable version of Perl.
dnl $1 - Minimum Perl version. Typically 5.006.
dnl
AC_DEFUN([LLVM_PROG_PERL], [
AC_PATH_PROG(PERL, [perl], [none])
if test "$PERL" != "none"; then
AC_MSG_CHECKING(for Perl $1 or newer)
if $PERL -e 'use $1;' 2>&1 > /dev/null; then
AC_MSG_RESULT(yes)
else
PERL=none
AC_MSG_RESULT(not found)
fi
fi
])

View file

@ -0,0 +1,39 @@
dnl This macro checks for tclsh which is required to run dejagnu. On some
dnl platforms (notably FreeBSD), tclsh is named tclshX.Y - this handles
dnl that for us so we can get the latest installed tclsh version.
dnl
AC_DEFUN([DJ_AC_PATH_TCLSH], [
no_itcl=true
AC_MSG_CHECKING(for the tclsh program in tclinclude directory)
AC_ARG_WITH(tclinclude,
AS_HELP_STRING([--with-tclinclude],
[directory where tcl headers are]),
[with_tclinclude=${withval}],[with_tclinclude=''])
AC_CACHE_VAL(ac_cv_path_tclsh,[
dnl first check to see if --with-itclinclude was specified
if test x"${with_tclinclude}" != x ; then
if test -f ${with_tclinclude}/tclsh ; then
ac_cv_path_tclsh=`(cd ${with_tclinclude}; pwd)`
elif test -f ${with_tclinclude}/src/tclsh ; then
ac_cv_path_tclsh=`(cd ${with_tclinclude}/src; pwd)`
else
AC_MSG_ERROR([${with_tclinclude} directory doesn't contain tclsh])
fi
fi])
dnl see if one is installed
if test x"${ac_cv_path_tclsh}" = x ; then
AC_MSG_RESULT(none)
AC_PATH_PROGS([TCLSH],[tclsh8.4 tclsh8.4.8 tclsh8.4.7 tclsh8.4.6 tclsh8.4.5 tclsh8.4.4 tclsh8.4.3 tclsh8.4.2 tclsh8.4.1 tclsh8.4.0 tclsh8.3 tclsh8.3.5 tclsh8.3.4 tclsh8.3.3 tclsh8.3.2 tclsh8.3.1 tclsh8.3.0 tclsh])
if test x"${TCLSH}" = x ; then
ac_cv_path_tclsh='';
else
ac_cv_path_tclsh="${TCLSH}";
fi
else
AC_MSG_RESULT(${ac_cv_path_tclsh})
TCLSH="${ac_cv_path_tclsh}"
AC_SUBST(TCLSH)
fi
])

View file

@ -0,0 +1,12 @@
#
# This function determins if the the srand48,drand48,lrand48 functions are
# available on this platform.
#
AC_DEFUN([AC_FUNC_RAND48],[
AC_SINGLE_CXX_CHECK([ac_cv_func_rand48],
[srand48/lrand48/drand48], [<stdlib.h>],
[srand48(0);lrand48();drand48();])
if test "$ac_cv_func_rand48" = "yes" ; then
AC_DEFINE([HAVE_RAND48],1,[Define to 1 if srand48/lrand48/drand48 exist in <stdlib.h>])
fi
])

View file

@ -0,0 +1,31 @@
dnl Check a program for version sanity. The test runs a program, passes it an
dnl argument to make it print out some identification string, and filters that
dnl output with a regular expression. If the output is non-empty, the program
dnl passes the sanity check.
dnl $1 - Name or full path of the program to run
dnl $2 - Argument to pass to print out identification string
dnl $3 - grep RE to match identification string
dnl $4 - set to 1 to make errors only a warning
AC_DEFUN([CHECK_PROGRAM_SANITY],
[
AC_MSG_CHECKING([sanity for program ]$1)
sanity="0"
sanity_path=`which $1 2>/dev/null`
if test "$?" -eq 0 -a -x "$sanity_path" ; then
sanity=`$1 $2 2>&1 | grep "$3"`
if test -z "$sanity" ; then
AC_MSG_RESULT([no])
sanity="0"
if test "$4" -eq 1 ; then
AC_MSG_WARN([Program ]$1[ failed to pass sanity check.])
else
AC_MSG_ERROR([Program ]$1[ failed to pass sanity check.])
fi
else
AC_MSG_RESULT([yes])
sanity="1"
fi
else
AC_MSG_RESULT([not found])
fi
])

View file

@ -0,0 +1,10 @@
dnl AC_SINGLE_CXX_CHECK(CACHEVAR, FUNCTION, HEADER, PROGRAM)
dnl $1, $2, $3, $4,
dnl
AC_DEFUN([AC_SINGLE_CXX_CHECK],
[AC_CACHE_CHECK([for $2 in $3], [$1],
[AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([#include $3],[$4]),[$1=yes],[$1=no])
AC_LANG_POP([C++])])
])

View file

@ -0,0 +1,22 @@
#
# Determine if the compiler accepts -fvisibility-inlines-hidden
#
# This macro is specific to LLVM.
#
AC_DEFUN([AC_CXX_USE_VISIBILITY_INLINES_HIDDEN],
[AC_CACHE_CHECK([for compiler -fvisibility-inlines-hidden option],
[llvm_cv_cxx_visibility_inlines_hidden],
[ AC_LANG_PUSH([C++])
oldcxxflags="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
[llvm_cv_cxx_visibility_inlines_hidden=yes],[llvm_cv_cxx_visibility_inlines_hidden=no])
CXXFLAGS="$oldcxxflags"
AC_LANG_POP([C++])
])
if test "$llvm_cv_cxx_visibility_inlines_hidden" = yes ; then
AC_SUBST([ENABLE_VISIBILITY_INLINES_HIDDEN],[1])
else
AC_SUBST([ENABLE_VISIBILITY_INLINES_HIDDEN],[0])
fi
])

353
contrib/llvm/autoconf/missing Executable file
View file

@ -0,0 +1,353 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2004-09-07.08
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case "$1" in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Send bug reports to <bug-automake@gnu.org>."
exit 0
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit 0
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
esac
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program).
case "$1" in
lex|yacc)
# Not GNU programs, they don't have --version.
;;
tar)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
exit 1
fi
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case "$1" in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case "$f" in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if [ ! -f y.tab.h ]; then
echo >y.tab.h
fi
if [ ! -f y.tab.c ]; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if [ ! -f lex.yy.c ]; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
fi
if [ -f "$file" ]; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit 1
fi
;;
makeinfo)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
fi
touch $file
;;
tar)
shift
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case "$firstarg" in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case "$firstarg" in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

View file

@ -0,0 +1,150 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
scriptversion=2004-02-15.20
# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain.
#
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
errstatus=0
dirmode=""
usage="\
Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
Create each directory DIR (with mode MODE, if specified), including all
leading file name components.
Report bugs to <bug-automake@gnu.org>."
# process command line arguments
while test $# -gt 0 ; do
case $1 in
-h | --help | --h*) # -h for help
echo "$usage"
exit 0
;;
-m) # -m PERM arg
shift
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
dirmode=$1
shift
;;
--version)
echo "$0 $scriptversion"
exit 0
;;
--) # stop option processing
shift
break
;;
-*) # unknown option
echo "$usage" 1>&2
exit 1
;;
*) # first non-opt arg
break
;;
esac
done
for file
do
if test -d "$file"; then
shift
else
break
fi
done
case $# in
0) exit 0 ;;
esac
# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
# mkdir -p a/c at the same time, both will detect that a is missing,
# one will create a, then the other will try to create a and die with
# a "File exists" error. This is a problem when calling mkinstalldirs
# from a parallel make. We use --version in the probe to restrict
# ourselves to GNU mkdir, which is thread-safe.
case $dirmode in
'')
if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
# echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
else
# On NextStep and OpenStep, the `mkdir' command does not
# recognize any option. It will interpret all options as
# directories to create, and then abort because `.' already
# exists.
test -d ./-p && rmdir ./-p
test -d ./--version && rmdir ./--version
fi
;;
*)
if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
test ! -d ./--version; then
# echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
else
# Clean up after NextStep and OpenStep mkdir.
for d in ./-m ./-p ./--version "./$dirmode";
do
test -d $d && rmdir $d
done
fi
;;
esac
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case $pathcomp in
-*) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
# echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
else
if test ! -z "$dirmode"; then
# echo "chmod $dirmode $pathcomp"
lasterr=""
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
errstatus=$lasterr
fi
fi
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

View file

@ -0,0 +1,16 @@
##===- bindings/Makefile -----------------------------------*- Makefile -*-===##
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
##===----------------------------------------------------------------------===##
LEVEL := ..
include $(LEVEL)/Makefile.config
PARALLEL_DIRS = $(BINDINGS_TO_BUILD)
include $(LEVEL)/Makefile.common

View file

@ -0,0 +1,3 @@
This directory contains bindings for the LLVM compiler infrastructure to allow
programs written in languages other than C or C++ to take advantage of the LLVM
infrastructure--for instance, a self-hosted compiler front-end.

View file

@ -0,0 +1,32 @@
-- This file is generated by SWIG. Do *not* modify by hand.
--
with llvm;
with Interfaces.C.Strings;
package LLVM_Analysis.Binding is
function LLVMVerifyModule
(M : in llvm.LLVMModuleRef;
Action : in LLVM_Analysis.LLVMVerifierFailureAction;
OutMessage : access Interfaces.C.Strings.chars_ptr)
return Interfaces.C.int;
function LLVMVerifyFunction
(Fn : in llvm.LLVMValueRef;
Action : in LLVM_Analysis.LLVMVerifierFailureAction)
return Interfaces.C.int;
procedure LLVMViewFunctionCFG (Fn : in llvm.LLVMValueRef);
procedure LLVMViewFunctionCFGOnly (Fn : in llvm.LLVMValueRef);
private
pragma Import (C, LLVMVerifyModule, "Ada_LLVMVerifyModule");
pragma Import (C, LLVMVerifyFunction, "Ada_LLVMVerifyFunction");
pragma Import (C, LLVMViewFunctionCFG, "Ada_LLVMViewFunctionCFG");
pragma Import (C, LLVMViewFunctionCFGOnly, "Ada_LLVMViewFunctionCFGOnly");
end LLVM_Analysis.Binding;

View file

@ -0,0 +1,30 @@
-- This file is generated by SWIG. Do *not* modify by hand.
--
with Interfaces.C;
package LLVM_Analysis is
-- LLVMVerifierFailureAction
--
type LLVMVerifierFailureAction is (
LLVMAbortProcessAction,
LLVMPrintMessageAction,
LLVMReturnStatusAction);
for LLVMVerifierFailureAction use
(LLVMAbortProcessAction => 0,
LLVMPrintMessageAction => 1,
LLVMReturnStatusAction => 2);
pragma Convention (C, LLVMVerifierFailureAction);
type LLVMVerifierFailureAction_array is
array (Interfaces.C.size_t range <>)
of aliased LLVM_Analysis.LLVMVerifierFailureAction;
type LLVMVerifierFailureAction_view is access all
LLVM_Analysis.LLVMVerifierFailureAction;
end LLVM_Analysis;

View file

@ -0,0 +1,369 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.36
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
* changes to this file unless you know what you are doing--modify the SWIG
* interface file instead.
* ----------------------------------------------------------------------------- */
#ifdef __cplusplus
template<typename T> class SwigValueWrapper {
T *tt;
public:
SwigValueWrapper() : tt(0) { }
SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
SwigValueWrapper(const T& t) : tt(new T(t)) { }
~SwigValueWrapper() { delete tt; }
SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
operator T&() const { return *tt; }
T *operator&() { return tt; }
private:
SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
};
template <typename T> T SwigValueInit() {
return T();
}
#endif
/* -----------------------------------------------------------------------------
* This section contains generic SWIG labels for method/variable
* declarations/attributes, and other compiler dependent labels.
* ----------------------------------------------------------------------------- */
/* template workaround for compilers that cannot correctly implement the C++ standard */
#ifndef SWIGTEMPLATEDISAMBIGUATOR
# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
# define SWIGTEMPLATEDISAMBIGUATOR template
# elif defined(__HP_aCC)
/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
# define SWIGTEMPLATEDISAMBIGUATOR template
# else
# define SWIGTEMPLATEDISAMBIGUATOR
# endif
#endif
/* inline attribute */
#ifndef SWIGINLINE
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
# define SWIGINLINE inline
# else
# define SWIGINLINE
# endif
#endif
/* attribute recognised by some compilers to avoid 'unused' warnings */
#ifndef SWIGUNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
# elif defined(__ICC)
# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
#endif
#ifndef SWIGUNUSEDPARM
# ifdef __cplusplus
# define SWIGUNUSEDPARM(p)
# else
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
# endif
#endif
/* internal SWIG method */
#ifndef SWIGINTERN
# define SWIGINTERN static SWIGUNUSED
#endif
/* internal inline SWIG method */
#ifndef SWIGINTERNINLINE
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
#endif
/* exporting methods */
#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
# ifndef GCC_HASCLASSVISIBILITY
# define GCC_HASCLASSVISIBILITY
# endif
#endif
#ifndef SWIGEXPORT
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# if defined(STATIC_LINKED)
# define SWIGEXPORT
# else
# define SWIGEXPORT __declspec(dllexport)
# endif
# else
# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
# define SWIGEXPORT __attribute__ ((visibility("default")))
# else
# define SWIGEXPORT
# endif
# endif
#endif
/* calling conventions for Windows */
#ifndef SWIGSTDCALL
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# define SWIGSTDCALL __stdcall
# else
# define SWIGSTDCALL
# endif
#endif
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE
#endif
/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
# define _SCL_SECURE_NO_DEPRECATE
#endif
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#if defined(_WIN32) || defined(__CYGWIN32__)
# define DllExport __declspec( dllexport )
# define SWIGSTDCALL __stdcall
#else
# define DllExport
# define SWIGSTDCALL
#endif
#ifdef __cplusplus
# include <new>
#endif
/* Support for throwing Ada exceptions from C/C++ */
typedef enum
{
SWIG_AdaException,
SWIG_AdaOutOfMemoryException,
SWIG_AdaIndexOutOfRangeException,
SWIG_AdaDivideByZeroException,
SWIG_AdaArgumentOutOfRangeException,
SWIG_AdaNullReferenceException
} SWIG_AdaExceptionCodes;
typedef void (SWIGSTDCALL* SWIG_AdaExceptionCallback_t)(const char *);
typedef struct
{
SWIG_AdaExceptionCodes code;
SWIG_AdaExceptionCallback_t callback;
}
SWIG_AdaExceptions_t;
static
SWIG_AdaExceptions_t
SWIG_ada_exceptions[] =
{
{ SWIG_AdaException, NULL },
{ SWIG_AdaOutOfMemoryException, NULL },
{ SWIG_AdaIndexOutOfRangeException, NULL },
{ SWIG_AdaDivideByZeroException, NULL },
{ SWIG_AdaArgumentOutOfRangeException, NULL },
{ SWIG_AdaNullReferenceException, NULL }
};
static
void
SWIG_AdaThrowException (SWIG_AdaExceptionCodes code, const char *msg)
{
SWIG_AdaExceptionCallback_t callback = SWIG_ada_exceptions[SWIG_AdaException].callback;
if (code >=0 && (size_t)code < sizeof(SWIG_ada_exceptions)/sizeof(SWIG_AdaExceptions_t)) {
callback = SWIG_ada_exceptions[code].callback;
}
callback(msg);
}
#ifdef __cplusplus
extern "C"
#endif
DllExport void SWIGSTDCALL SWIGRegisterExceptionCallbacks_LLVM_Analysis (SWIG_AdaExceptionCallback_t systemException,
SWIG_AdaExceptionCallback_t outOfMemory,
SWIG_AdaExceptionCallback_t indexOutOfRange,
SWIG_AdaExceptionCallback_t divideByZero,
SWIG_AdaExceptionCallback_t argumentOutOfRange,
SWIG_AdaExceptionCallback_t nullReference)
{
SWIG_ada_exceptions [SWIG_AdaException].callback = systemException;
SWIG_ada_exceptions [SWIG_AdaOutOfMemoryException].callback = outOfMemory;
SWIG_ada_exceptions [SWIG_AdaIndexOutOfRangeException].callback = indexOutOfRange;
SWIG_ada_exceptions [SWIG_AdaDivideByZeroException].callback = divideByZero;
SWIG_ada_exceptions [SWIG_AdaArgumentOutOfRangeException].callback = argumentOutOfRange;
SWIG_ada_exceptions [SWIG_AdaNullReferenceException].callback = nullReference;
}
/* Callback for returning strings to Ada without leaking memory */
typedef char * (SWIGSTDCALL* SWIG_AdaStringHelperCallback)(const char *);
static SWIG_AdaStringHelperCallback SWIG_ada_string_callback = NULL;
/* probably obsolete ...
#ifdef __cplusplus
extern "C"
#endif
DllExport void SWIGSTDCALL SWIGRegisterStringCallback_LLVM_Analysis(SWIG_AdaStringHelperCallback callback) {
SWIG_ada_string_callback = callback;
}
*/
/* Contract support */
#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_AdaThrowException(SWIG_AdaArgumentOutOfRangeException, msg); return nullreturn; } else
#define protected public
#define private public
#include "llvm-c/Analysis.h"
//#include "llvm-c/BitReader.h"
//#include "llvm-c/BitWriter.h"
//#include "llvm-c/Core.h"
//#include "llvm-c/ExecutionEngine.h"
//#include "llvm-c/LinkTimeOptimizer.h"
//#include "llvm-c/lto.h"
//#include "llvm-c/Target.h"
// struct LLVMCtxt;
#undef protected
#undef private
#ifdef __cplusplus
extern "C" {
#endif
DllExport int SWIGSTDCALL Ada_LLVMVerifyModule (
void * jarg1
,
int jarg2
,
void * jarg3
)
{
int jresult ;
LLVMModuleRef arg1 = (LLVMModuleRef) 0 ;
LLVMVerifierFailureAction arg2 ;
char **arg3 = (char **) 0 ;
int result;
arg1 = (LLVMModuleRef)jarg1;
arg2 = (LLVMVerifierFailureAction) jarg2;
arg3 = (char **)jarg3;
result = (int)LLVMVerifyModule(arg1,arg2,arg3);
jresult = result;
return jresult;
}
DllExport int SWIGSTDCALL Ada_LLVMVerifyFunction (
void * jarg1
,
int jarg2
)
{
int jresult ;
LLVMValueRef arg1 = (LLVMValueRef) 0 ;
LLVMVerifierFailureAction arg2 ;
int result;
arg1 = (LLVMValueRef)jarg1;
arg2 = (LLVMVerifierFailureAction) jarg2;
result = (int)LLVMVerifyFunction(arg1,arg2);
jresult = result;
return jresult;
}
DllExport void SWIGSTDCALL Ada_LLVMViewFunctionCFG (
void * jarg1
)
{
LLVMValueRef arg1 = (LLVMValueRef) 0 ;
arg1 = (LLVMValueRef)jarg1;
LLVMViewFunctionCFG(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMViewFunctionCFGOnly (
void * jarg1
)
{
LLVMValueRef arg1 = (LLVMValueRef) 0 ;
arg1 = (LLVMValueRef)jarg1;
LLVMViewFunctionCFGOnly(arg1);
}
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,52 @@
-- This file is generated by SWIG. Do *not* modify by hand.
--
with llvm;
with Interfaces.C.Strings;
package LLVM_bit_Reader.Binding is
function LLVMParseBitcode
(MemBuf : in llvm.LLVMMemoryBufferRef;
OutModule : access llvm.LLVMModuleRef;
OutMessage : access Interfaces.C.Strings.chars_ptr)
return Interfaces.C.int;
function LLVMParseBitcodeInContext
(MemBuf : in llvm.LLVMMemoryBufferRef;
ContextRef : in llvm.LLVMContextRef;
OutModule : access llvm.LLVMModuleRef;
OutMessage : access Interfaces.C.Strings.chars_ptr)
return Interfaces.C.int;
function LLVMGetBitcodeModuleProvider
(MemBuf : in llvm.LLVMMemoryBufferRef;
OutMP : access llvm.LLVMModuleProviderRef;
OutMessage : access Interfaces.C.Strings.chars_ptr)
return Interfaces.C.int;
function LLVMGetBitcodeModuleProviderInContext
(MemBuf : in llvm.LLVMMemoryBufferRef;
ContextRef : in llvm.LLVMContextRef;
OutMP : access llvm.LLVMModuleProviderRef;
OutMessage : access Interfaces.C.Strings.chars_ptr)
return Interfaces.C.int;
private
pragma Import (C, LLVMParseBitcode, "Ada_LLVMParseBitcode");
pragma Import
(C,
LLVMParseBitcodeInContext,
"Ada_LLVMParseBitcodeInContext");
pragma Import
(C,
LLVMGetBitcodeModuleProvider,
"Ada_LLVMGetBitcodeModuleProvider");
pragma Import
(C,
LLVMGetBitcodeModuleProviderInContext,
"Ada_LLVMGetBitcodeModuleProviderInContext");
end LLVM_bit_Reader.Binding;

View file

@ -0,0 +1,6 @@
-- This file is generated by SWIG. Do *not* modify by hand.
--
package LLVM_bit_Reader is
end LLVM_bit_Reader;

View file

@ -0,0 +1,423 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.36
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
* changes to this file unless you know what you are doing--modify the SWIG
* interface file instead.
* ----------------------------------------------------------------------------- */
#ifdef __cplusplus
template<typename T> class SwigValueWrapper {
T *tt;
public:
SwigValueWrapper() : tt(0) { }
SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
SwigValueWrapper(const T& t) : tt(new T(t)) { }
~SwigValueWrapper() { delete tt; }
SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
operator T&() const { return *tt; }
T *operator&() { return tt; }
private:
SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
};
template <typename T> T SwigValueInit() {
return T();
}
#endif
/* -----------------------------------------------------------------------------
* This section contains generic SWIG labels for method/variable
* declarations/attributes, and other compiler dependent labels.
* ----------------------------------------------------------------------------- */
/* template workaround for compilers that cannot correctly implement the C++ standard */
#ifndef SWIGTEMPLATEDISAMBIGUATOR
# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
# define SWIGTEMPLATEDISAMBIGUATOR template
# elif defined(__HP_aCC)
/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
# define SWIGTEMPLATEDISAMBIGUATOR template
# else
# define SWIGTEMPLATEDISAMBIGUATOR
# endif
#endif
/* inline attribute */
#ifndef SWIGINLINE
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
# define SWIGINLINE inline
# else
# define SWIGINLINE
# endif
#endif
/* attribute recognised by some compilers to avoid 'unused' warnings */
#ifndef SWIGUNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
# elif defined(__ICC)
# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
#endif
#ifndef SWIGUNUSEDPARM
# ifdef __cplusplus
# define SWIGUNUSEDPARM(p)
# else
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
# endif
#endif
/* internal SWIG method */
#ifndef SWIGINTERN
# define SWIGINTERN static SWIGUNUSED
#endif
/* internal inline SWIG method */
#ifndef SWIGINTERNINLINE
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
#endif
/* exporting methods */
#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
# ifndef GCC_HASCLASSVISIBILITY
# define GCC_HASCLASSVISIBILITY
# endif
#endif
#ifndef SWIGEXPORT
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# if defined(STATIC_LINKED)
# define SWIGEXPORT
# else
# define SWIGEXPORT __declspec(dllexport)
# endif
# else
# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
# define SWIGEXPORT __attribute__ ((visibility("default")))
# else
# define SWIGEXPORT
# endif
# endif
#endif
/* calling conventions for Windows */
#ifndef SWIGSTDCALL
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# define SWIGSTDCALL __stdcall
# else
# define SWIGSTDCALL
# endif
#endif
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE
#endif
/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
# define _SCL_SECURE_NO_DEPRECATE
#endif
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#if defined(_WIN32) || defined(__CYGWIN32__)
# define DllExport __declspec( dllexport )
# define SWIGSTDCALL __stdcall
#else
# define DllExport
# define SWIGSTDCALL
#endif
#ifdef __cplusplus
# include <new>
#endif
/* Support for throwing Ada exceptions from C/C++ */
typedef enum
{
SWIG_AdaException,
SWIG_AdaOutOfMemoryException,
SWIG_AdaIndexOutOfRangeException,
SWIG_AdaDivideByZeroException,
SWIG_AdaArgumentOutOfRangeException,
SWIG_AdaNullReferenceException
} SWIG_AdaExceptionCodes;
typedef void (SWIGSTDCALL* SWIG_AdaExceptionCallback_t)(const char *);
typedef struct
{
SWIG_AdaExceptionCodes code;
SWIG_AdaExceptionCallback_t callback;
}
SWIG_AdaExceptions_t;
static
SWIG_AdaExceptions_t
SWIG_ada_exceptions[] =
{
{ SWIG_AdaException, NULL },
{ SWIG_AdaOutOfMemoryException, NULL },
{ SWIG_AdaIndexOutOfRangeException, NULL },
{ SWIG_AdaDivideByZeroException, NULL },
{ SWIG_AdaArgumentOutOfRangeException, NULL },
{ SWIG_AdaNullReferenceException, NULL }
};
static
void
SWIG_AdaThrowException (SWIG_AdaExceptionCodes code, const char *msg)
{
SWIG_AdaExceptionCallback_t callback = SWIG_ada_exceptions[SWIG_AdaException].callback;
if (code >=0 && (size_t)code < sizeof(SWIG_ada_exceptions)/sizeof(SWIG_AdaExceptions_t)) {
callback = SWIG_ada_exceptions[code].callback;
}
callback(msg);
}
#ifdef __cplusplus
extern "C"
#endif
DllExport void SWIGSTDCALL SWIGRegisterExceptionCallbacks_LLVM_bit_Reader (SWIG_AdaExceptionCallback_t systemException,
SWIG_AdaExceptionCallback_t outOfMemory,
SWIG_AdaExceptionCallback_t indexOutOfRange,
SWIG_AdaExceptionCallback_t divideByZero,
SWIG_AdaExceptionCallback_t argumentOutOfRange,
SWIG_AdaExceptionCallback_t nullReference)
{
SWIG_ada_exceptions [SWIG_AdaException].callback = systemException;
SWIG_ada_exceptions [SWIG_AdaOutOfMemoryException].callback = outOfMemory;
SWIG_ada_exceptions [SWIG_AdaIndexOutOfRangeException].callback = indexOutOfRange;
SWIG_ada_exceptions [SWIG_AdaDivideByZeroException].callback = divideByZero;
SWIG_ada_exceptions [SWIG_AdaArgumentOutOfRangeException].callback = argumentOutOfRange;
SWIG_ada_exceptions [SWIG_AdaNullReferenceException].callback = nullReference;
}
/* Callback for returning strings to Ada without leaking memory */
typedef char * (SWIGSTDCALL* SWIG_AdaStringHelperCallback)(const char *);
static SWIG_AdaStringHelperCallback SWIG_ada_string_callback = NULL;
/* probably obsolete ...
#ifdef __cplusplus
extern "C"
#endif
DllExport void SWIGSTDCALL SWIGRegisterStringCallback_LLVM_bit_Reader(SWIG_AdaStringHelperCallback callback) {
SWIG_ada_string_callback = callback;
}
*/
/* Contract support */
#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_AdaThrowException(SWIG_AdaArgumentOutOfRangeException, msg); return nullreturn; } else
#define protected public
#define private public
//#include "llvm-c/Analysis.h"
#include "llvm-c/BitReader.h"
//#include "llvm-c/BitWriter.h"
//#include "llvm-c/Core.h"
//#include "llvm-c/ExecutionEngine.h"
//#include "llvm-c/LinkTimeOptimizer.h"
//#include "llvm-c/lto.h"
//#include "llvm-c/Target.h"
// struct LLVMCtxt;
#undef protected
#undef private
#ifdef __cplusplus
extern "C" {
#endif
DllExport int SWIGSTDCALL Ada_LLVMParseBitcode (
void * jarg1
,
void * jarg2
,
void * jarg3
)
{
int jresult ;
LLVMMemoryBufferRef arg1 = (LLVMMemoryBufferRef) 0 ;
LLVMModuleRef *arg2 = (LLVMModuleRef *) 0 ;
char **arg3 = (char **) 0 ;
int result;
arg1 = (LLVMMemoryBufferRef)jarg1;
arg2 = (LLVMModuleRef *)jarg2;
arg3 = (char **)jarg3;
result = (int)LLVMParseBitcode(arg1,arg2,arg3);
jresult = result;
return jresult;
}
DllExport int SWIGSTDCALL Ada_LLVMParseBitcodeInContext (
void * jarg1
,
void * jarg2
,
void * jarg3
,
void * jarg4
)
{
int jresult ;
LLVMMemoryBufferRef arg1 = (LLVMMemoryBufferRef) 0 ;
LLVMContextRef arg2 = (LLVMContextRef) 0 ;
LLVMModuleRef *arg3 = (LLVMModuleRef *) 0 ;
char **arg4 = (char **) 0 ;
int result;
arg1 = (LLVMMemoryBufferRef)jarg1;
arg2 = (LLVMContextRef)jarg2;
arg3 = (LLVMModuleRef *)jarg3;
arg4 = (char **)jarg4;
result = (int)LLVMParseBitcodeInContext(arg1,arg2,arg3,arg4);
jresult = result;
return jresult;
}
DllExport int SWIGSTDCALL Ada_LLVMGetBitcodeModuleProvider (
void * jarg1
,
void * jarg2
,
void * jarg3
)
{
int jresult ;
LLVMMemoryBufferRef arg1 = (LLVMMemoryBufferRef) 0 ;
LLVMModuleProviderRef *arg2 = (LLVMModuleProviderRef *) 0 ;
char **arg3 = (char **) 0 ;
int result;
arg1 = (LLVMMemoryBufferRef)jarg1;
arg2 = (LLVMModuleProviderRef *)jarg2;
arg3 = (char **)jarg3;
result = (int)LLVMGetBitcodeModuleProvider(arg1,arg2,arg3);
jresult = result;
return jresult;
}
DllExport int SWIGSTDCALL Ada_LLVMGetBitcodeModuleProviderInContext (
void * jarg1
,
void * jarg2
,
void * jarg3
,
void * jarg4
)
{
int jresult ;
LLVMMemoryBufferRef arg1 = (LLVMMemoryBufferRef) 0 ;
LLVMContextRef arg2 = (LLVMContextRef) 0 ;
LLVMModuleProviderRef *arg3 = (LLVMModuleProviderRef *) 0 ;
char **arg4 = (char **) 0 ;
int result;
arg1 = (LLVMMemoryBufferRef)jarg1;
arg2 = (LLVMContextRef)jarg2;
arg3 = (LLVMModuleProviderRef *)jarg3;
arg4 = (char **)jarg4;
result = (int)LLVMGetBitcodeModuleProviderInContext(arg1,arg2,arg3,arg4);
jresult = result;
return jresult;
}
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,28 @@
-- This file is generated by SWIG. Do *not* modify by hand.
--
with llvm;
with Interfaces.C.Strings;
package LLVM_bit_Writer.Binding is
function LLVMWriteBitcodeToFileHandle
(M : in llvm.LLVMModuleRef;
Handle : in Interfaces.C.int)
return Interfaces.C.int;
function LLVMWriteBitcodeToFile
(M : in llvm.LLVMModuleRef;
Path : in Interfaces.C.Strings.chars_ptr)
return Interfaces.C.int;
private
pragma Import
(C,
LLVMWriteBitcodeToFileHandle,
"Ada_LLVMWriteBitcodeToFileHandle");
pragma Import (C, LLVMWriteBitcodeToFile, "Ada_LLVMWriteBitcodeToFile");
end LLVM_bit_Writer.Binding;

View file

@ -0,0 +1,6 @@
-- This file is generated by SWIG. Do *not* modify by hand.
--
package LLVM_bit_Writer is
end LLVM_bit_Writer;

View file

@ -0,0 +1,335 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.36
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
* changes to this file unless you know what you are doing--modify the SWIG
* interface file instead.
* ----------------------------------------------------------------------------- */
#ifdef __cplusplus
template<typename T> class SwigValueWrapper {
T *tt;
public:
SwigValueWrapper() : tt(0) { }
SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
SwigValueWrapper(const T& t) : tt(new T(t)) { }
~SwigValueWrapper() { delete tt; }
SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
operator T&() const { return *tt; }
T *operator&() { return tt; }
private:
SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
};
template <typename T> T SwigValueInit() {
return T();
}
#endif
/* -----------------------------------------------------------------------------
* This section contains generic SWIG labels for method/variable
* declarations/attributes, and other compiler dependent labels.
* ----------------------------------------------------------------------------- */
/* template workaround for compilers that cannot correctly implement the C++ standard */
#ifndef SWIGTEMPLATEDISAMBIGUATOR
# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
# define SWIGTEMPLATEDISAMBIGUATOR template
# elif defined(__HP_aCC)
/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
# define SWIGTEMPLATEDISAMBIGUATOR template
# else
# define SWIGTEMPLATEDISAMBIGUATOR
# endif
#endif
/* inline attribute */
#ifndef SWIGINLINE
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
# define SWIGINLINE inline
# else
# define SWIGINLINE
# endif
#endif
/* attribute recognised by some compilers to avoid 'unused' warnings */
#ifndef SWIGUNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
# elif defined(__ICC)
# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
#endif
#ifndef SWIGUNUSEDPARM
# ifdef __cplusplus
# define SWIGUNUSEDPARM(p)
# else
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
# endif
#endif
/* internal SWIG method */
#ifndef SWIGINTERN
# define SWIGINTERN static SWIGUNUSED
#endif
/* internal inline SWIG method */
#ifndef SWIGINTERNINLINE
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
#endif
/* exporting methods */
#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
# ifndef GCC_HASCLASSVISIBILITY
# define GCC_HASCLASSVISIBILITY
# endif
#endif
#ifndef SWIGEXPORT
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# if defined(STATIC_LINKED)
# define SWIGEXPORT
# else
# define SWIGEXPORT __declspec(dllexport)
# endif
# else
# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
# define SWIGEXPORT __attribute__ ((visibility("default")))
# else
# define SWIGEXPORT
# endif
# endif
#endif
/* calling conventions for Windows */
#ifndef SWIGSTDCALL
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# define SWIGSTDCALL __stdcall
# else
# define SWIGSTDCALL
# endif
#endif
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE
#endif
/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
# define _SCL_SECURE_NO_DEPRECATE
#endif
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#if defined(_WIN32) || defined(__CYGWIN32__)
# define DllExport __declspec( dllexport )
# define SWIGSTDCALL __stdcall
#else
# define DllExport
# define SWIGSTDCALL
#endif
#ifdef __cplusplus
# include <new>
#endif
/* Support for throwing Ada exceptions from C/C++ */
typedef enum
{
SWIG_AdaException,
SWIG_AdaOutOfMemoryException,
SWIG_AdaIndexOutOfRangeException,
SWIG_AdaDivideByZeroException,
SWIG_AdaArgumentOutOfRangeException,
SWIG_AdaNullReferenceException
} SWIG_AdaExceptionCodes;
typedef void (SWIGSTDCALL* SWIG_AdaExceptionCallback_t)(const char *);
typedef struct
{
SWIG_AdaExceptionCodes code;
SWIG_AdaExceptionCallback_t callback;
}
SWIG_AdaExceptions_t;
static
SWIG_AdaExceptions_t
SWIG_ada_exceptions[] =
{
{ SWIG_AdaException, NULL },
{ SWIG_AdaOutOfMemoryException, NULL },
{ SWIG_AdaIndexOutOfRangeException, NULL },
{ SWIG_AdaDivideByZeroException, NULL },
{ SWIG_AdaArgumentOutOfRangeException, NULL },
{ SWIG_AdaNullReferenceException, NULL }
};
static
void
SWIG_AdaThrowException (SWIG_AdaExceptionCodes code, const char *msg)
{
SWIG_AdaExceptionCallback_t callback = SWIG_ada_exceptions[SWIG_AdaException].callback;
if (code >=0 && (size_t)code < sizeof(SWIG_ada_exceptions)/sizeof(SWIG_AdaExceptions_t)) {
callback = SWIG_ada_exceptions[code].callback;
}
callback(msg);
}
#ifdef __cplusplus
extern "C"
#endif
DllExport void SWIGSTDCALL SWIGRegisterExceptionCallbacks_LLVM_bit_Writer (SWIG_AdaExceptionCallback_t systemException,
SWIG_AdaExceptionCallback_t outOfMemory,
SWIG_AdaExceptionCallback_t indexOutOfRange,
SWIG_AdaExceptionCallback_t divideByZero,
SWIG_AdaExceptionCallback_t argumentOutOfRange,
SWIG_AdaExceptionCallback_t nullReference)
{
SWIG_ada_exceptions [SWIG_AdaException].callback = systemException;
SWIG_ada_exceptions [SWIG_AdaOutOfMemoryException].callback = outOfMemory;
SWIG_ada_exceptions [SWIG_AdaIndexOutOfRangeException].callback = indexOutOfRange;
SWIG_ada_exceptions [SWIG_AdaDivideByZeroException].callback = divideByZero;
SWIG_ada_exceptions [SWIG_AdaArgumentOutOfRangeException].callback = argumentOutOfRange;
SWIG_ada_exceptions [SWIG_AdaNullReferenceException].callback = nullReference;
}
/* Callback for returning strings to Ada without leaking memory */
typedef char * (SWIGSTDCALL* SWIG_AdaStringHelperCallback)(const char *);
static SWIG_AdaStringHelperCallback SWIG_ada_string_callback = NULL;
/* probably obsolete ...
#ifdef __cplusplus
extern "C"
#endif
DllExport void SWIGSTDCALL SWIGRegisterStringCallback_LLVM_bit_Writer(SWIG_AdaStringHelperCallback callback) {
SWIG_ada_string_callback = callback;
}
*/
/* Contract support */
#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_AdaThrowException(SWIG_AdaArgumentOutOfRangeException, msg); return nullreturn; } else
#define protected public
#define private public
#include "llvm-c/Analysis.h"
#include "llvm-c/BitReader.h"
#include "llvm-c/BitWriter.h"
#include "llvm-c/Core.h"
#include "llvm-c/ExecutionEngine.h"
#include "llvm-c/LinkTimeOptimizer.h"
#include "llvm-c/lto.h"
#include "llvm-c/Target.h"
// struct LLVMCtxt;
#undef protected
#undef private
#ifdef __cplusplus
extern "C" {
#endif
DllExport int SWIGSTDCALL Ada_LLVMWriteBitcodeToFileHandle (
void * jarg1
,
int jarg2
)
{
int jresult ;
LLVMModuleRef arg1 = (LLVMModuleRef) 0 ;
int arg2 ;
int result;
arg1 = (LLVMModuleRef)jarg1;
arg2 = (int) jarg2;
result = (int)LLVMWriteBitcodeToFileHandle(arg1,arg2);
jresult = result;
return jresult;
}
DllExport int SWIGSTDCALL Ada_LLVMWriteBitcodeToFile (
void * jarg1
,
char * jarg2
)
{
int jresult ;
LLVMModuleRef arg1 = (LLVMModuleRef) 0 ;
char *arg2 = (char *) 0 ;
int result;
arg1 = (LLVMModuleRef)jarg1;
arg2 = jarg2;
result = (int)LLVMWriteBitcodeToFile(arg1,(char const *)arg2);
jresult = result;
return jresult;
}
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,192 @@
-- This file is generated by SWIG. Do *not* modify by hand.
--
with llvm;
with Interfaces.C.Strings;
package LLVM_execution_Engine.Binding is
procedure LLVMLinkInJIT;
procedure LLVMLinkInInterpreter;
function LLVMCreateGenericValueOfInt
(Ty : in llvm.LLVMTypeRef;
N : in Interfaces.C.Extensions.unsigned_long_long;
IsSigned : in Interfaces.C.int)
return LLVM_execution_Engine.LLVMGenericValueRef;
function LLVMCreateGenericValueOfPointer
(P : access Interfaces.C.Extensions.void)
return LLVM_execution_Engine.LLVMGenericValueRef;
function LLVMCreateGenericValueOfFloat
(Ty : in llvm.LLVMTypeRef;
N : in Interfaces.C.double)
return LLVM_execution_Engine.LLVMGenericValueRef;
function LLVMGenericValueIntWidth
(GenValRef : in LLVM_execution_Engine.LLVMGenericValueRef)
return Interfaces.C.unsigned;
function LLVMGenericValueToInt
(GenVal : in LLVM_execution_Engine.LLVMGenericValueRef;
IsSigned : in Interfaces.C.int)
return Interfaces.C.Extensions.unsigned_long_long;
function LLVMGenericValueToPointer
(GenVal : in LLVM_execution_Engine.LLVMGenericValueRef)
return access Interfaces.C.Extensions.void;
function LLVMGenericValueToFloat
(TyRef : in llvm.LLVMTypeRef;
GenVal : in LLVM_execution_Engine.LLVMGenericValueRef)
return Interfaces.C.double;
procedure LLVMDisposeGenericValue
(GenVal : in LLVM_execution_Engine.LLVMGenericValueRef);
function LLVMCreateExecutionEngine
(OutEE : access LLVM_execution_Engine.LLVMExecutionEngineRef;
MP : in llvm.LLVMModuleProviderRef;
OutError : access Interfaces.C.Strings.chars_ptr)
return Interfaces.C.int;
function LLVMCreateInterpreter
(OutInterp : access LLVM_execution_Engine.LLVMExecutionEngineRef;
MP : in llvm.LLVMModuleProviderRef;
OutError : access Interfaces.C.Strings.chars_ptr)
return Interfaces.C.int;
function LLVMCreateJITCompiler
(OutJIT : access LLVM_execution_Engine.LLVMExecutionEngineRef;
MP : in llvm.LLVMModuleProviderRef;
OptLevel : in Interfaces.C.unsigned;
OutError : access Interfaces.C.Strings.chars_ptr)
return Interfaces.C.int;
procedure LLVMDisposeExecutionEngine
(EE : in LLVM_execution_Engine.LLVMExecutionEngineRef);
procedure LLVMRunStaticConstructors
(EE : in LLVM_execution_Engine.LLVMExecutionEngineRef);
procedure LLVMRunStaticDestructors
(EE : in LLVM_execution_Engine.LLVMExecutionEngineRef);
function LLVMRunFunctionAsMain
(EE : in LLVM_execution_Engine.LLVMExecutionEngineRef;
F : in llvm.LLVMValueRef;
ArgC : in Interfaces.C.unsigned;
ArgV : access Interfaces.C.Strings.chars_ptr;
EnvP : access Interfaces.C.Strings.chars_ptr)
return Interfaces.C.int;
function LLVMRunFunction
(EE : in LLVM_execution_Engine.LLVMExecutionEngineRef;
F : in llvm.LLVMValueRef;
NumArgs : in Interfaces.C.unsigned;
Args : access LLVM_execution_Engine.LLVMGenericValueRef)
return LLVM_execution_Engine.LLVMGenericValueRef;
procedure LLVMFreeMachineCodeForFunction
(EE : in LLVM_execution_Engine.LLVMExecutionEngineRef;
F : in llvm.LLVMValueRef);
procedure LLVMAddModuleProvider
(EE : in LLVM_execution_Engine.LLVMExecutionEngineRef;
MP : in llvm.LLVMModuleProviderRef);
function LLVMRemoveModuleProvider
(EE : in LLVM_execution_Engine.LLVMExecutionEngineRef;
MP : in llvm.LLVMModuleProviderRef;
OutMod : access llvm.LLVMModuleRef;
OutError : access Interfaces.C.Strings.chars_ptr)
return Interfaces.C.int;
function LLVMFindFunction
(EE : in LLVM_execution_Engine.LLVMExecutionEngineRef;
Name : in Interfaces.C.Strings.chars_ptr;
OutFn : access llvm.LLVMValueRef)
return Interfaces.C.int;
function LLVMGetExecutionEngineTargetData
(EE : in LLVM_execution_Engine.LLVMExecutionEngineRef)
return LLVM_execution_Engine.LLVMTargetDataRef;
procedure LLVMAddGlobalMapping
(EE : in LLVM_execution_Engine.LLVMExecutionEngineRef;
Global : in llvm.LLVMValueRef;
Addr : access Interfaces.C.Extensions.void);
function LLVMGetPointerToGlobal
(EE : in LLVM_execution_Engine.LLVMExecutionEngineRef;
Global : in llvm.LLVMValueRef)
return access Interfaces.C.Extensions.void;
private
pragma Import (C, LLVMLinkInJIT, "Ada_LLVMLinkInJIT");
pragma Import (C, LLVMLinkInInterpreter, "Ada_LLVMLinkInInterpreter");
pragma Import
(C,
LLVMCreateGenericValueOfInt,
"Ada_LLVMCreateGenericValueOfInt");
pragma Import
(C,
LLVMCreateGenericValueOfPointer,
"Ada_LLVMCreateGenericValueOfPointer");
pragma Import
(C,
LLVMCreateGenericValueOfFloat,
"Ada_LLVMCreateGenericValueOfFloat");
pragma Import
(C,
LLVMGenericValueIntWidth,
"Ada_LLVMGenericValueIntWidth");
pragma Import (C, LLVMGenericValueToInt, "Ada_LLVMGenericValueToInt");
pragma Import
(C,
LLVMGenericValueToPointer,
"Ada_LLVMGenericValueToPointer");
pragma Import (C, LLVMGenericValueToFloat, "Ada_LLVMGenericValueToFloat");
pragma Import (C, LLVMDisposeGenericValue, "Ada_LLVMDisposeGenericValue");
pragma Import
(C,
LLVMCreateExecutionEngine,
"Ada_LLVMCreateExecutionEngine");
pragma Import (C, LLVMCreateInterpreter, "Ada_LLVMCreateInterpreter");
pragma Import (C, LLVMCreateJITCompiler, "Ada_LLVMCreateJITCompiler");
pragma Import
(C,
LLVMDisposeExecutionEngine,
"Ada_LLVMDisposeExecutionEngine");
pragma Import
(C,
LLVMRunStaticConstructors,
"Ada_LLVMRunStaticConstructors");
pragma Import
(C,
LLVMRunStaticDestructors,
"Ada_LLVMRunStaticDestructors");
pragma Import (C, LLVMRunFunctionAsMain, "Ada_LLVMRunFunctionAsMain");
pragma Import (C, LLVMRunFunction, "Ada_LLVMRunFunction");
pragma Import
(C,
LLVMFreeMachineCodeForFunction,
"Ada_LLVMFreeMachineCodeForFunction");
pragma Import (C, LLVMAddModuleProvider, "Ada_LLVMAddModuleProvider");
pragma Import
(C,
LLVMRemoveModuleProvider,
"Ada_LLVMRemoveModuleProvider");
pragma Import (C, LLVMFindFunction, "Ada_LLVMFindFunction");
pragma Import
(C,
LLVMGetExecutionEngineTargetData,
"Ada_LLVMGetExecutionEngineTargetData");
pragma Import (C, LLVMAddGlobalMapping, "Ada_LLVMAddGlobalMapping");
pragma Import (C, LLVMGetPointerToGlobal, "Ada_LLVMGetPointerToGlobal");
end LLVM_execution_Engine.Binding;

View file

@ -0,0 +1,90 @@
-- This file is generated by SWIG. Do *not* modify by hand.
--
with Interfaces.C.Extensions;
package LLVM_execution_Engine is
-- LLVMOpaqueGenericValue
--
type LLVMOpaqueGenericValue is new
Interfaces.C.Extensions.opaque_structure_def;
type LLVMOpaqueGenericValue_array is
array (Interfaces.C.size_t range <>)
of aliased LLVM_execution_Engine.LLVMOpaqueGenericValue;
type LLVMOpaqueGenericValue_view is access all
LLVM_execution_Engine.LLVMOpaqueGenericValue;
-- LLVMGenericValueRef
--
type LLVMGenericValueRef is access all
LLVM_execution_Engine.LLVMOpaqueGenericValue;
type LLVMGenericValueRef_array is
array (Interfaces.C.size_t range <>)
of aliased LLVM_execution_Engine.LLVMGenericValueRef;
type LLVMGenericValueRef_view is access all
LLVM_execution_Engine.LLVMGenericValueRef;
-- LLVMOpaqueExecutionEngine
--
type LLVMOpaqueExecutionEngine is new
Interfaces.C.Extensions.opaque_structure_def;
type LLVMOpaqueExecutionEngine_array is
array (Interfaces.C.size_t range <>)
of aliased LLVM_execution_Engine.LLVMOpaqueExecutionEngine;
type LLVMOpaqueExecutionEngine_view is access all
LLVM_execution_Engine.LLVMOpaqueExecutionEngine;
-- LLVMExecutionEngineRef
--
type LLVMExecutionEngineRef is access all
LLVM_execution_Engine.LLVMOpaqueExecutionEngine;
type LLVMExecutionEngineRef_array is
array (Interfaces.C.size_t range <>)
of aliased LLVM_execution_Engine.LLVMExecutionEngineRef;
type LLVMExecutionEngineRef_view is access all
LLVM_execution_Engine.LLVMExecutionEngineRef;
-- LLVMTargetDataRef
--
type LLVMTargetDataRef is new Interfaces.C.Extensions.opaque_structure_def;
type LLVMTargetDataRef_array is
array (Interfaces.C.size_t range <>)
of aliased LLVM_execution_Engine.LLVMTargetDataRef;
type LLVMTargetDataRef_view is access all
LLVM_execution_Engine.LLVMTargetDataRef;
-- GenericValue
--
type GenericValue is new Interfaces.C.Extensions.opaque_structure_def;
type GenericValue_array is
array (Interfaces.C.size_t range <>)
of aliased LLVM_execution_Engine.GenericValue;
type GenericValue_view is access all LLVM_execution_Engine.GenericValue;
-- ExecutionEngine
--
type ExecutionEngine is new Interfaces.C.Extensions.incomplete_class_def;
type ExecutionEngine_array is
array (Interfaces.C.size_t range <>)
of aliased LLVM_execution_Engine.ExecutionEngine;
type ExecutionEngine_view is access all
LLVM_execution_Engine.ExecutionEngine;
end LLVM_execution_Engine;

View file

@ -0,0 +1,924 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.36
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
* changes to this file unless you know what you are doing--modify the SWIG
* interface file instead.
* ----------------------------------------------------------------------------- */
#ifdef __cplusplus
template<typename T> class SwigValueWrapper {
T *tt;
public:
SwigValueWrapper() : tt(0) { }
SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
SwigValueWrapper(const T& t) : tt(new T(t)) { }
~SwigValueWrapper() { delete tt; }
SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
operator T&() const { return *tt; }
T *operator&() { return tt; }
private:
SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
};
template <typename T> T SwigValueInit() {
return T();
}
#endif
/* -----------------------------------------------------------------------------
* This section contains generic SWIG labels for method/variable
* declarations/attributes, and other compiler dependent labels.
* ----------------------------------------------------------------------------- */
/* template workaround for compilers that cannot correctly implement the C++ standard */
#ifndef SWIGTEMPLATEDISAMBIGUATOR
# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
# define SWIGTEMPLATEDISAMBIGUATOR template
# elif defined(__HP_aCC)
/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
# define SWIGTEMPLATEDISAMBIGUATOR template
# else
# define SWIGTEMPLATEDISAMBIGUATOR
# endif
#endif
/* inline attribute */
#ifndef SWIGINLINE
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
# define SWIGINLINE inline
# else
# define SWIGINLINE
# endif
#endif
/* attribute recognised by some compilers to avoid 'unused' warnings */
#ifndef SWIGUNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
# elif defined(__ICC)
# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
#endif
#ifndef SWIGUNUSEDPARM
# ifdef __cplusplus
# define SWIGUNUSEDPARM(p)
# else
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
# endif
#endif
/* internal SWIG method */
#ifndef SWIGINTERN
# define SWIGINTERN static SWIGUNUSED
#endif
/* internal inline SWIG method */
#ifndef SWIGINTERNINLINE
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
#endif
/* exporting methods */
#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
# ifndef GCC_HASCLASSVISIBILITY
# define GCC_HASCLASSVISIBILITY
# endif
#endif
#ifndef SWIGEXPORT
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# if defined(STATIC_LINKED)
# define SWIGEXPORT
# else
# define SWIGEXPORT __declspec(dllexport)
# endif
# else
# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
# define SWIGEXPORT __attribute__ ((visibility("default")))
# else
# define SWIGEXPORT
# endif
# endif
#endif
/* calling conventions for Windows */
#ifndef SWIGSTDCALL
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# define SWIGSTDCALL __stdcall
# else
# define SWIGSTDCALL
# endif
#endif
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE
#endif
/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
# define _SCL_SECURE_NO_DEPRECATE
#endif
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#if defined(_WIN32) || defined(__CYGWIN32__)
# define DllExport __declspec( dllexport )
# define SWIGSTDCALL __stdcall
#else
# define DllExport
# define SWIGSTDCALL
#endif
#ifdef __cplusplus
# include <new>
#endif
/* Support for throwing Ada exceptions from C/C++ */
typedef enum
{
SWIG_AdaException,
SWIG_AdaOutOfMemoryException,
SWIG_AdaIndexOutOfRangeException,
SWIG_AdaDivideByZeroException,
SWIG_AdaArgumentOutOfRangeException,
SWIG_AdaNullReferenceException
} SWIG_AdaExceptionCodes;
typedef void (SWIGSTDCALL* SWIG_AdaExceptionCallback_t)(const char *);
typedef struct
{
SWIG_AdaExceptionCodes code;
SWIG_AdaExceptionCallback_t callback;
}
SWIG_AdaExceptions_t;
static
SWIG_AdaExceptions_t
SWIG_ada_exceptions[] =
{
{ SWIG_AdaException, NULL },
{ SWIG_AdaOutOfMemoryException, NULL },
{ SWIG_AdaIndexOutOfRangeException, NULL },
{ SWIG_AdaDivideByZeroException, NULL },
{ SWIG_AdaArgumentOutOfRangeException, NULL },
{ SWIG_AdaNullReferenceException, NULL }
};
static
void
SWIG_AdaThrowException (SWIG_AdaExceptionCodes code, const char *msg)
{
SWIG_AdaExceptionCallback_t callback = SWIG_ada_exceptions[SWIG_AdaException].callback;
if (code >=0 && (size_t)code < sizeof(SWIG_ada_exceptions)/sizeof(SWIG_AdaExceptions_t)) {
callback = SWIG_ada_exceptions[code].callback;
}
callback(msg);
}
#ifdef __cplusplus
extern "C"
#endif
DllExport void SWIGSTDCALL SWIGRegisterExceptionCallbacks_LLVM_execution_Engine (SWIG_AdaExceptionCallback_t systemException,
SWIG_AdaExceptionCallback_t outOfMemory,
SWIG_AdaExceptionCallback_t indexOutOfRange,
SWIG_AdaExceptionCallback_t divideByZero,
SWIG_AdaExceptionCallback_t argumentOutOfRange,
SWIG_AdaExceptionCallback_t nullReference)
{
SWIG_ada_exceptions [SWIG_AdaException].callback = systemException;
SWIG_ada_exceptions [SWIG_AdaOutOfMemoryException].callback = outOfMemory;
SWIG_ada_exceptions [SWIG_AdaIndexOutOfRangeException].callback = indexOutOfRange;
SWIG_ada_exceptions [SWIG_AdaDivideByZeroException].callback = divideByZero;
SWIG_ada_exceptions [SWIG_AdaArgumentOutOfRangeException].callback = argumentOutOfRange;
SWIG_ada_exceptions [SWIG_AdaNullReferenceException].callback = nullReference;
}
/* Callback for returning strings to Ada without leaking memory */
typedef char * (SWIGSTDCALL* SWIG_AdaStringHelperCallback)(const char *);
static SWIG_AdaStringHelperCallback SWIG_ada_string_callback = NULL;
/* probably obsolete ...
#ifdef __cplusplus
extern "C"
#endif
DllExport void SWIGSTDCALL SWIGRegisterStringCallback_LLVM_execution_Engine(SWIG_AdaStringHelperCallback callback) {
SWIG_ada_string_callback = callback;
}
*/
/* Contract support */
#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_AdaThrowException(SWIG_AdaArgumentOutOfRangeException, msg); return nullreturn; } else
#define protected public
#define private public
#include "llvm-c/ExecutionEngine.h"
// struct LLVMCtxt;
#undef protected
#undef private
#ifdef __cplusplus
extern "C" {
#endif
DllExport void SWIGSTDCALL Ada_LLVMLinkInJIT (
)
{
LLVMLinkInJIT();
}
DllExport void SWIGSTDCALL Ada_LLVMLinkInInterpreter (
)
{
LLVMLinkInInterpreter();
}
DllExport void * SWIGSTDCALL Ada_LLVMCreateGenericValueOfInt (
void * jarg1
,
unsigned long long jarg2
,
int jarg3
)
{
void * jresult ;
LLVMTypeRef arg1 = (LLVMTypeRef) 0 ;
unsigned long long arg2 ;
int arg3 ;
LLVMGenericValueRef result;
arg1 = (LLVMTypeRef)jarg1;
arg2 = (unsigned long long) jarg2;
arg3 = (int) jarg3;
result = (LLVMGenericValueRef)LLVMCreateGenericValueOfInt(arg1,arg2,arg3);
jresult = (void *) result;
return jresult;
}
DllExport void * SWIGSTDCALL Ada_LLVMCreateGenericValueOfPointer (
void* jarg1
)
{
void * jresult ;
void *arg1 = (void *) 0 ;
LLVMGenericValueRef result;
arg1 = (void *)jarg1;
result = (LLVMGenericValueRef)LLVMCreateGenericValueOfPointer(arg1);
jresult = (void *) result;
return jresult;
}
DllExport void * SWIGSTDCALL Ada_LLVMCreateGenericValueOfFloat (
void * jarg1
,
double jarg2
)
{
void * jresult ;
LLVMTypeRef arg1 = (LLVMTypeRef) 0 ;
double arg2 ;
LLVMGenericValueRef result;
arg1 = (LLVMTypeRef)jarg1;
arg2 = (double) jarg2;
result = (LLVMGenericValueRef)LLVMCreateGenericValueOfFloat(arg1,arg2);
jresult = (void *) result;
return jresult;
}
DllExport unsigned int SWIGSTDCALL Ada_LLVMGenericValueIntWidth (
void * jarg1
)
{
unsigned int jresult ;
LLVMGenericValueRef arg1 = (LLVMGenericValueRef) 0 ;
unsigned int result;
arg1 = (LLVMGenericValueRef)jarg1;
result = (unsigned int)LLVMGenericValueIntWidth(arg1);
jresult = result;
return jresult;
}
DllExport unsigned long long SWIGSTDCALL Ada_LLVMGenericValueToInt (
void * jarg1
,
int jarg2
)
{
unsigned long long jresult ;
LLVMGenericValueRef arg1 = (LLVMGenericValueRef) 0 ;
int arg2 ;
unsigned long long result;
arg1 = (LLVMGenericValueRef)jarg1;
arg2 = (int) jarg2;
result = (unsigned long long)LLVMGenericValueToInt(arg1,arg2);
jresult = result;
return jresult;
}
DllExport void* SWIGSTDCALL Ada_LLVMGenericValueToPointer (
void * jarg1
)
{
void* jresult ;
LLVMGenericValueRef arg1 = (LLVMGenericValueRef) 0 ;
void *result = 0 ;
arg1 = (LLVMGenericValueRef)jarg1;
result = (void *)LLVMGenericValueToPointer(arg1);
jresult = (void *) result;
return jresult;
}
DllExport double SWIGSTDCALL Ada_LLVMGenericValueToFloat (
void * jarg1
,
void * jarg2
)
{
double jresult ;
LLVMTypeRef arg1 = (LLVMTypeRef) 0 ;
LLVMGenericValueRef arg2 = (LLVMGenericValueRef) 0 ;
double result;
arg1 = (LLVMTypeRef)jarg1;
arg2 = (LLVMGenericValueRef)jarg2;
result = (double)LLVMGenericValueToFloat(arg1,arg2);
jresult = result;
return jresult;
}
DllExport void SWIGSTDCALL Ada_LLVMDisposeGenericValue (
void * jarg1
)
{
LLVMGenericValueRef arg1 = (LLVMGenericValueRef) 0 ;
arg1 = (LLVMGenericValueRef)jarg1;
LLVMDisposeGenericValue(arg1);
}
DllExport int SWIGSTDCALL Ada_LLVMCreateExecutionEngine (
void * jarg1
,
void * jarg2
,
void * jarg3
)
{
int jresult ;
LLVMExecutionEngineRef *arg1 = (LLVMExecutionEngineRef *) 0 ;
LLVMModuleProviderRef arg2 = (LLVMModuleProviderRef) 0 ;
char **arg3 = (char **) 0 ;
int result;
arg1 = (LLVMExecutionEngineRef *)jarg1;
arg2 = (LLVMModuleProviderRef)jarg2;
arg3 = (char **)jarg3;
result = (int)LLVMCreateExecutionEngine(arg1,arg2,arg3);
jresult = result;
return jresult;
}
DllExport int SWIGSTDCALL Ada_LLVMCreateInterpreter (
void * jarg1
,
void * jarg2
,
void * jarg3
)
{
int jresult ;
LLVMExecutionEngineRef *arg1 = (LLVMExecutionEngineRef *) 0 ;
LLVMModuleProviderRef arg2 = (LLVMModuleProviderRef) 0 ;
char **arg3 = (char **) 0 ;
int result;
arg1 = (LLVMExecutionEngineRef *)jarg1;
arg2 = (LLVMModuleProviderRef)jarg2;
arg3 = (char **)jarg3;
result = (int)LLVMCreateInterpreter(arg1,arg2,arg3);
jresult = result;
return jresult;
}
DllExport int SWIGSTDCALL Ada_LLVMCreateJITCompiler (
void * jarg1
,
void * jarg2
,
unsigned int jarg3
,
void * jarg4
)
{
int jresult ;
LLVMExecutionEngineRef *arg1 = (LLVMExecutionEngineRef *) 0 ;
LLVMModuleProviderRef arg2 = (LLVMModuleProviderRef) 0 ;
unsigned int arg3 ;
char **arg4 = (char **) 0 ;
int result;
arg1 = (LLVMExecutionEngineRef *)jarg1;
arg2 = (LLVMModuleProviderRef)jarg2;
arg3 = (unsigned int) jarg3;
arg4 = (char **)jarg4;
result = (int)LLVMCreateJITCompiler(arg1,arg2,arg3,arg4);
jresult = result;
return jresult;
}
DllExport void SWIGSTDCALL Ada_LLVMDisposeExecutionEngine (
void * jarg1
)
{
LLVMExecutionEngineRef arg1 = (LLVMExecutionEngineRef) 0 ;
arg1 = (LLVMExecutionEngineRef)jarg1;
LLVMDisposeExecutionEngine(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMRunStaticConstructors (
void * jarg1
)
{
LLVMExecutionEngineRef arg1 = (LLVMExecutionEngineRef) 0 ;
arg1 = (LLVMExecutionEngineRef)jarg1;
LLVMRunStaticConstructors(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMRunStaticDestructors (
void * jarg1
)
{
LLVMExecutionEngineRef arg1 = (LLVMExecutionEngineRef) 0 ;
arg1 = (LLVMExecutionEngineRef)jarg1;
LLVMRunStaticDestructors(arg1);
}
DllExport int SWIGSTDCALL Ada_LLVMRunFunctionAsMain (
void * jarg1
,
void * jarg2
,
unsigned int jarg3
,
void * jarg4
,
void * jarg5
)
{
int jresult ;
LLVMExecutionEngineRef arg1 = (LLVMExecutionEngineRef) 0 ;
LLVMValueRef arg2 = (LLVMValueRef) 0 ;
unsigned int arg3 ;
char **arg4 = (char **) 0 ;
char **arg5 = (char **) 0 ;
int result;
arg1 = (LLVMExecutionEngineRef)jarg1;
arg2 = (LLVMValueRef)jarg2;
arg3 = (unsigned int) jarg3;
arg4 = (char **)jarg4;
arg5 = (char **)jarg5;
result = (int)LLVMRunFunctionAsMain(arg1,arg2,arg3,(char const *const *)arg4,(char const *const *)arg5);
jresult = result;
return jresult;
}
DllExport void * SWIGSTDCALL Ada_LLVMRunFunction (
void * jarg1
,
void * jarg2
,
unsigned int jarg3
,
void * jarg4
)
{
void * jresult ;
LLVMExecutionEngineRef arg1 = (LLVMExecutionEngineRef) 0 ;
LLVMValueRef arg2 = (LLVMValueRef) 0 ;
unsigned int arg3 ;
LLVMGenericValueRef *arg4 = (LLVMGenericValueRef *) 0 ;
LLVMGenericValueRef result;
arg1 = (LLVMExecutionEngineRef)jarg1;
arg2 = (LLVMValueRef)jarg2;
arg3 = (unsigned int) jarg3;
arg4 = (LLVMGenericValueRef *)jarg4;
result = (LLVMGenericValueRef)LLVMRunFunction(arg1,arg2,arg3,arg4);
jresult = (void *) result;
return jresult;
}
DllExport void SWIGSTDCALL Ada_LLVMFreeMachineCodeForFunction (
void * jarg1
,
void * jarg2
)
{
LLVMExecutionEngineRef arg1 = (LLVMExecutionEngineRef) 0 ;
LLVMValueRef arg2 = (LLVMValueRef) 0 ;
arg1 = (LLVMExecutionEngineRef)jarg1;
arg2 = (LLVMValueRef)jarg2;
LLVMFreeMachineCodeForFunction(arg1,arg2);
}
DllExport void SWIGSTDCALL Ada_LLVMAddModuleProvider (
void * jarg1
,
void * jarg2
)
{
LLVMExecutionEngineRef arg1 = (LLVMExecutionEngineRef) 0 ;
LLVMModuleProviderRef arg2 = (LLVMModuleProviderRef) 0 ;
arg1 = (LLVMExecutionEngineRef)jarg1;
arg2 = (LLVMModuleProviderRef)jarg2;
LLVMAddModuleProvider(arg1,arg2);
}
DllExport int SWIGSTDCALL Ada_LLVMRemoveModuleProvider (
void * jarg1
,
void * jarg2
,
void * jarg3
,
void * jarg4
)
{
int jresult ;
LLVMExecutionEngineRef arg1 = (LLVMExecutionEngineRef) 0 ;
LLVMModuleProviderRef arg2 = (LLVMModuleProviderRef) 0 ;
LLVMModuleRef *arg3 = (LLVMModuleRef *) 0 ;
char **arg4 = (char **) 0 ;
int result;
arg1 = (LLVMExecutionEngineRef)jarg1;
arg2 = (LLVMModuleProviderRef)jarg2;
arg3 = (LLVMModuleRef *)jarg3;
arg4 = (char **)jarg4;
result = (int)LLVMRemoveModuleProvider(arg1,arg2,arg3,arg4);
jresult = result;
return jresult;
}
DllExport int SWIGSTDCALL Ada_LLVMFindFunction (
void * jarg1
,
char * jarg2
,
void * jarg3
)
{
int jresult ;
LLVMExecutionEngineRef arg1 = (LLVMExecutionEngineRef) 0 ;
char *arg2 = (char *) 0 ;
LLVMValueRef *arg3 = (LLVMValueRef *) 0 ;
int result;
arg1 = (LLVMExecutionEngineRef)jarg1;
arg2 = jarg2;
arg3 = (LLVMValueRef *)jarg3;
result = (int)LLVMFindFunction(arg1,(char const *)arg2,arg3);
jresult = result;
return jresult;
}
DllExport LLVMTargetDataRef SWIGSTDCALL Ada_LLVMGetExecutionEngineTargetData (
void * jarg1
)
{
LLVMTargetDataRef jresult ;
LLVMExecutionEngineRef arg1 = (LLVMExecutionEngineRef) 0 ;
LLVMTargetDataRef result;
arg1 = (LLVMExecutionEngineRef)jarg1;
result = LLVMGetExecutionEngineTargetData(arg1);
jresult = result;
//jresult = new LLVMTargetDataRef ((LLVMTargetDataRef &) result);
return jresult;
}
DllExport void SWIGSTDCALL Ada_LLVMAddGlobalMapping (
void * jarg1
,
void * jarg2
,
void* jarg3
)
{
LLVMExecutionEngineRef arg1 = (LLVMExecutionEngineRef) 0 ;
LLVMValueRef arg2 = (LLVMValueRef) 0 ;
void *arg3 = (void *) 0 ;
arg1 = (LLVMExecutionEngineRef)jarg1;
arg2 = (LLVMValueRef)jarg2;
arg3 = (void *)jarg3;
LLVMAddGlobalMapping(arg1,arg2,arg3);
}
DllExport void* SWIGSTDCALL Ada_LLVMGetPointerToGlobal (
void * jarg1
,
void * jarg2
)
{
void* jresult ;
LLVMExecutionEngineRef arg1 = (LLVMExecutionEngineRef) 0 ;
LLVMValueRef arg2 = (LLVMValueRef) 0 ;
void *result = 0 ;
arg1 = (LLVMExecutionEngineRef)jarg1;
arg2 = (LLVMValueRef)jarg2;
result = (void *)LLVMGetPointerToGlobal(arg1,arg2);
jresult = (void *) result;
return jresult;
}
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,34 @@
project LLVM is
for Languages use ("Ada", "C++");
for Source_Dirs use (".", "analysis", "bitreader", "bitwriter", "executionengine", "llvm", "target", "transforms");
for Object_Dir use "build";
for Exec_Dir use ".";
for Library_Name use "llvm_ada";
for Library_Dir use "lib";
for Library_Ali_Dir use "objects";
package Naming is
for Specification_Suffix ("c++") use ".h";
for Implementation_Suffix ("c++") use ".cxx";
end Naming;
package Builder is
for Default_Switches ("ada") use ("-g");
end Builder;
package Compiler is
for Default_Switches ("ada") use ("-gnato", "-fstack-check", "-g", "-gnata", "-gnat05", "-I/usr/local/include");
for Default_Switches ("c++") use ("-D__STDC_LIMIT_MACROS", "-D__STDC_CONSTANT_MACROS", "-I../../include", "-g");
end Compiler;
package Binder is
for Default_Switches ("ada") use ("-E");
end Binder;
package Linker is
for Default_Switches ("c++") use ("-g");
end Linker;
end LLVM;

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,493 @@
-- This file is generated by SWIG. Do *not* modify by hand.
--
with Interfaces.C.Extensions;
package llvm is
-- LLVMCtxt
--
type LLVMCtxt is new Interfaces.C.Extensions.opaque_structure_def;
type LLVMCtxt_array is
array (Interfaces.C.size_t range <>) of aliased llvm.LLVMCtxt;
type LLVMCtxt_view is access all llvm.LLVMCtxt;
-- LLVMContextRef
--
type LLVMContextRef is access all llvm.LLVMCtxt;
type LLVMContextRef_array is
array (Interfaces.C.size_t range <>) of aliased llvm.LLVMContextRef;
type LLVMContextRef_view is access all llvm.LLVMContextRef;
-- LLVMOpaqueModule
--
type LLVMOpaqueModule is new Interfaces.C.Extensions.opaque_structure_def;
type LLVMOpaqueModule_array is
array (Interfaces.C.size_t range <>) of aliased llvm.LLVMOpaqueModule;
type LLVMOpaqueModule_view is access all llvm.LLVMOpaqueModule;
-- LLVMModuleRef
--
type LLVMModuleRef is access all llvm.LLVMOpaqueModule;
type LLVMModuleRef_array is
array (Interfaces.C.size_t range <>) of aliased llvm.LLVMModuleRef;
type LLVMModuleRef_view is access all llvm.LLVMModuleRef;
-- LLVMOpaqueType
--
type LLVMOpaqueType is new Interfaces.C.Extensions.opaque_structure_def;
type LLVMOpaqueType_array is
array (Interfaces.C.size_t range <>) of aliased llvm.LLVMOpaqueType;
type LLVMOpaqueType_view is access all llvm.LLVMOpaqueType;
-- LLVMTypeRef
--
type LLVMTypeRef is access all llvm.LLVMOpaqueType;
type LLVMTypeRef_array is
array (Interfaces.C.size_t range <>) of aliased llvm.LLVMTypeRef;
type LLVMTypeRef_view is access all llvm.LLVMTypeRef;
-- LLVMOpaqueTypeHandle
--
type LLVMOpaqueTypeHandle is new
Interfaces.C.Extensions.opaque_structure_def;
type LLVMOpaqueTypeHandle_array is
array (Interfaces.C.size_t range <>)
of aliased llvm.LLVMOpaqueTypeHandle;
type LLVMOpaqueTypeHandle_view is access all llvm.LLVMOpaqueTypeHandle;
-- LLVMTypeHandleRef
--
type LLVMTypeHandleRef is access all llvm.LLVMOpaqueTypeHandle;
type LLVMTypeHandleRef_array is
array (Interfaces.C.size_t range <>)
of aliased llvm.LLVMTypeHandleRef;
type LLVMTypeHandleRef_view is access all llvm.LLVMTypeHandleRef;
-- LLVMOpaqueValue
--
type LLVMOpaqueValue is new Interfaces.C.Extensions.opaque_structure_def;
type LLVMOpaqueValue_array is
array (Interfaces.C.size_t range <>) of aliased llvm.LLVMOpaqueValue;
type LLVMOpaqueValue_view is access all llvm.LLVMOpaqueValue;
-- LLVMValueRef
--
type LLVMValueRef is access all llvm.LLVMOpaqueValue;
type LLVMValueRef_array is
array (Interfaces.C.size_t range <>) of aliased llvm.LLVMValueRef;
type LLVMValueRef_view is access all llvm.LLVMValueRef;
-- LLVMOpaqueBasicBlock
--
type LLVMOpaqueBasicBlock is new
Interfaces.C.Extensions.opaque_structure_def;
type LLVMOpaqueBasicBlock_array is
array (Interfaces.C.size_t range <>)
of aliased llvm.LLVMOpaqueBasicBlock;
type LLVMOpaqueBasicBlock_view is access all llvm.LLVMOpaqueBasicBlock;
-- LLVMBasicBlockRef
--
type LLVMBasicBlockRef is access all llvm.LLVMOpaqueBasicBlock;
type LLVMBasicBlockRef_array is
array (Interfaces.C.size_t range <>)
of aliased llvm.LLVMBasicBlockRef;
type LLVMBasicBlockRef_view is access all llvm.LLVMBasicBlockRef;
-- LLVMOpaqueBuilder
--
type LLVMOpaqueBuilder is new Interfaces.C.Extensions.opaque_structure_def;
type LLVMOpaqueBuilder_array is
array (Interfaces.C.size_t range <>)
of aliased llvm.LLVMOpaqueBuilder;
type LLVMOpaqueBuilder_view is access all llvm.LLVMOpaqueBuilder;
-- LLVMBuilderRef
--
type LLVMBuilderRef is access all llvm.LLVMOpaqueBuilder;
type LLVMBuilderRef_array is
array (Interfaces.C.size_t range <>) of aliased llvm.LLVMBuilderRef;
type LLVMBuilderRef_view is access all llvm.LLVMBuilderRef;
-- LLVMOpaqueModuleProvider
--
type LLVMOpaqueModuleProvider is new
Interfaces.C.Extensions.opaque_structure_def;
type LLVMOpaqueModuleProvider_array is
array (Interfaces.C.size_t range <>)
of aliased llvm.LLVMOpaqueModuleProvider;
type LLVMOpaqueModuleProvider_view is access all
llvm.LLVMOpaqueModuleProvider;
-- LLVMModuleProviderRef
--
type LLVMModuleProviderRef is access all llvm.LLVMOpaqueModuleProvider;
type LLVMModuleProviderRef_array is
array (Interfaces.C.size_t range <>)
of aliased llvm.LLVMModuleProviderRef;
type LLVMModuleProviderRef_view is access all llvm.LLVMModuleProviderRef;
-- LLVMOpaqueMemoryBuffer
--
type LLVMOpaqueMemoryBuffer is new
Interfaces.C.Extensions.opaque_structure_def;
type LLVMOpaqueMemoryBuffer_array is
array (Interfaces.C.size_t range <>)
of aliased llvm.LLVMOpaqueMemoryBuffer;
type LLVMOpaqueMemoryBuffer_view is access all llvm.LLVMOpaqueMemoryBuffer;
-- LLVMMemoryBufferRef
--
type LLVMMemoryBufferRef is access all llvm.LLVMOpaqueMemoryBuffer;
type LLVMMemoryBufferRef_array is
array (Interfaces.C.size_t range <>)
of aliased llvm.LLVMMemoryBufferRef;
type LLVMMemoryBufferRef_view is access all llvm.LLVMMemoryBufferRef;
-- LLVMOpaquePassManager
--
type LLVMOpaquePassManager is new
Interfaces.C.Extensions.opaque_structure_def;
type LLVMOpaquePassManager_array is
array (Interfaces.C.size_t range <>)
of aliased llvm.LLVMOpaquePassManager;
type LLVMOpaquePassManager_view is access all llvm.LLVMOpaquePassManager;
-- LLVMPassManagerRef
--
type LLVMPassManagerRef is access all llvm.LLVMOpaquePassManager;
type LLVMPassManagerRef_array is
array (Interfaces.C.size_t range <>)
of aliased llvm.LLVMPassManagerRef;
type LLVMPassManagerRef_view is access all llvm.LLVMPassManagerRef;
-- LLVMAttribute
--
type LLVMAttribute is (
LLVMZExtAttribute,
LLVMSExtAttribute,
LLVMNoReturnAttribute,
LLVMInRegAttribute,
LLVMStructRetAttribute,
LLVMNoUnwindAttribute,
LLVMNoAliasAttribute,
LLVMByValAttribute,
LLVMNestAttribute,
LLVMReadNoneAttribute,
LLVMReadOnlyAttribute,
LLVMNoInlineAttribute,
LLVMAlwaysInlineAttribute,
LLVMOptimizeForSizeAttribute,
LLVMStackProtectAttribute,
LLVMStackProtectReqAttribute,
LLVMNoCaptureAttribute,
LLVMNoRedZoneAttribute,
LLVMNoImplicitFloatAttribute,
LLVMNakedAttribute);
for LLVMAttribute use
(LLVMZExtAttribute => 1,
LLVMSExtAttribute => 2,
LLVMNoReturnAttribute => 4,
LLVMInRegAttribute => 8,
LLVMStructRetAttribute => 16,
LLVMNoUnwindAttribute => 32,
LLVMNoAliasAttribute => 64,
LLVMByValAttribute => 128,
LLVMNestAttribute => 256,
LLVMReadNoneAttribute => 512,
LLVMReadOnlyAttribute => 1024,
LLVMNoInlineAttribute => 2048,
LLVMAlwaysInlineAttribute => 4096,
LLVMOptimizeForSizeAttribute => 8192,
LLVMStackProtectAttribute => 16384,
LLVMStackProtectReqAttribute => 32768,
LLVMNoCaptureAttribute => 2097152,
LLVMNoRedZoneAttribute => 4194304,
LLVMNoImplicitFloatAttribute => 8388608,
LLVMNakedAttribute => 16777216);
pragma Convention (C, LLVMAttribute);
type LLVMAttribute_array is
array (Interfaces.C.size_t range <>) of aliased llvm.LLVMAttribute;
type LLVMAttribute_view is access all llvm.LLVMAttribute;
-- LLVMTypeKind
--
type LLVMTypeKind is (
LLVMVoidTypeKind,
LLVMFloatTypeKind,
LLVMDoubleTypeKind,
LLVMX86_FP80TypeKind,
LLVMFP128TypeKind,
LLVMPPC_FP128TypeKind,
LLVMLabelTypeKind,
LLVMIntegerTypeKind,
LLVMFunctionTypeKind,
LLVMStructTypeKind,
LLVMArrayTypeKind,
LLVMPointerTypeKind,
LLVMOpaqueTypeKind,
LLVMVectorTypeKind,
LLVMMetadataTypeKind);
for LLVMTypeKind use
(LLVMVoidTypeKind => 0,
LLVMFloatTypeKind => 1,
LLVMDoubleTypeKind => 2,
LLVMX86_FP80TypeKind => 3,
LLVMFP128TypeKind => 4,
LLVMPPC_FP128TypeKind => 5,
LLVMLabelTypeKind => 6,
LLVMIntegerTypeKind => 7,
LLVMFunctionTypeKind => 8,
LLVMStructTypeKind => 9,
LLVMArrayTypeKind => 10,
LLVMPointerTypeKind => 11,
LLVMOpaqueTypeKind => 12,
LLVMVectorTypeKind => 13,
LLVMMetadataTypeKind => 14);
pragma Convention (C, LLVMTypeKind);
type LLVMTypeKind_array is
array (Interfaces.C.size_t range <>) of aliased llvm.LLVMTypeKind;
type LLVMTypeKind_view is access all llvm.LLVMTypeKind;
-- LLVMLinkage
--
type LLVMLinkage is (
LLVMExternalLinkage,
LLVMAvailableExternallyLinkage,
LLVMLinkOnceAnyLinkage,
LLVMLinkOnceODRLinkage,
LLVMWeakAnyLinkage,
LLVMWeakODRLinkage,
LLVMAppendingLinkage,
LLVMInternalLinkage,
LLVMPrivateLinkage,
LLVMDLLImportLinkage,
LLVMDLLExportLinkage,
LLVMExternalWeakLinkage,
LLVMGhostLinkage,
LLVMCommonLinkage,
LLVMLinkerPrivateLinkage);
for LLVMLinkage use
(LLVMExternalLinkage => 0,
LLVMAvailableExternallyLinkage => 1,
LLVMLinkOnceAnyLinkage => 2,
LLVMLinkOnceODRLinkage => 3,
LLVMWeakAnyLinkage => 4,
LLVMWeakODRLinkage => 5,
LLVMAppendingLinkage => 6,
LLVMInternalLinkage => 7,
LLVMPrivateLinkage => 8,
LLVMDLLImportLinkage => 9,
LLVMDLLExportLinkage => 10,
LLVMExternalWeakLinkage => 11,
LLVMGhostLinkage => 12,
LLVMCommonLinkage => 13,
LLVMLinkerPrivateLinkage => 14);
pragma Convention (C, LLVMLinkage);
type LLVMLinkage_array is
array (Interfaces.C.size_t range <>) of aliased llvm.LLVMLinkage;
type LLVMLinkage_view is access all llvm.LLVMLinkage;
-- LLVMVisibility
--
type LLVMVisibility is (
LLVMDefaultVisibility,
LLVMHiddenVisibility,
LLVMProtectedVisibility);
for LLVMVisibility use
(LLVMDefaultVisibility => 0,
LLVMHiddenVisibility => 1,
LLVMProtectedVisibility => 2);
pragma Convention (C, LLVMVisibility);
type LLVMVisibility_array is
array (Interfaces.C.size_t range <>) of aliased llvm.LLVMVisibility;
type LLVMVisibility_view is access all llvm.LLVMVisibility;
-- LLVMCallConv
--
type LLVMCallConv is (
LLVMCCallConv,
LLVMFastCallConv,
LLVMColdCallConv,
LLVMX86StdcallCallConv,
LLVMX86FastcallCallConv);
for LLVMCallConv use
(LLVMCCallConv => 0,
LLVMFastCallConv => 8,
LLVMColdCallConv => 9,
LLVMX86StdcallCallConv => 64,
LLVMX86FastcallCallConv => 65);
pragma Convention (C, LLVMCallConv);
type LLVMCallConv_array is
array (Interfaces.C.size_t range <>) of aliased llvm.LLVMCallConv;
type LLVMCallConv_view is access all llvm.LLVMCallConv;
-- LLVMIntPredicate
--
type LLVMIntPredicate is (
LLVMIntEQ,
LLVMIntNE,
LLVMIntUGT,
LLVMIntUGE,
LLVMIntULT,
LLVMIntULE,
LLVMIntSGT,
LLVMIntSGE,
LLVMIntSLT,
LLVMIntSLE);
for LLVMIntPredicate use
(LLVMIntEQ => 32,
LLVMIntNE => 33,
LLVMIntUGT => 34,
LLVMIntUGE => 35,
LLVMIntULT => 36,
LLVMIntULE => 37,
LLVMIntSGT => 38,
LLVMIntSGE => 39,
LLVMIntSLT => 40,
LLVMIntSLE => 41);
pragma Convention (C, LLVMIntPredicate);
type LLVMIntPredicate_array is
array (Interfaces.C.size_t range <>) of aliased llvm.LLVMIntPredicate;
type LLVMIntPredicate_view is access all llvm.LLVMIntPredicate;
-- LLVMRealPredicate
--
type LLVMRealPredicate is (
LLVMRealPredicateFalse,
LLVMRealOEQ,
LLVMRealOGT,
LLVMRealOGE,
LLVMRealOLT,
LLVMRealOLE,
LLVMRealONE,
LLVMRealORD,
LLVMRealUNO,
LLVMRealUEQ,
LLVMRealUGT,
LLVMRealUGE,
LLVMRealULT,
LLVMRealULE,
LLVMRealUNE,
LLVMRealPredicateTrue);
for LLVMRealPredicate use
(LLVMRealPredicateFalse => 0,
LLVMRealOEQ => 1,
LLVMRealOGT => 2,
LLVMRealOGE => 3,
LLVMRealOLT => 4,
LLVMRealOLE => 5,
LLVMRealONE => 6,
LLVMRealORD => 7,
LLVMRealUNO => 8,
LLVMRealUEQ => 9,
LLVMRealUGT => 10,
LLVMRealUGE => 11,
LLVMRealULT => 12,
LLVMRealULE => 13,
LLVMRealUNE => 14,
LLVMRealPredicateTrue => 15);
pragma Convention (C, LLVMRealPredicate);
type LLVMRealPredicate_array is
array (Interfaces.C.size_t range <>)
of aliased llvm.LLVMRealPredicate;
type LLVMRealPredicate_view is access all llvm.LLVMRealPredicate;
-- ModuleProvider
--
type ModuleProvider is new Interfaces.C.Extensions.incomplete_class_def;
type ModuleProvider_array is
array (Interfaces.C.size_t range <>) of aliased llvm.ModuleProvider;
type ModuleProvider_view is access all llvm.ModuleProvider;
-- MemoryBuffer
--
type MemoryBuffer is new Interfaces.C.Extensions.incomplete_class_def;
type MemoryBuffer_array is
array (Interfaces.C.size_t range <>) of aliased llvm.MemoryBuffer;
type MemoryBuffer_view is access all llvm.MemoryBuffer;
-- PassManagerBase
--
type PassManagerBase is new Interfaces.C.Extensions.incomplete_class_def;
type PassManagerBase_array is
array (Interfaces.C.size_t range <>) of aliased llvm.PassManagerBase;
type PassManagerBase_view is access all llvm.PassManagerBase;
end llvm;

View file

@ -0,0 +1,207 @@
-- This file is generated by SWIG. Do *not* modify by hand.
--
with Interfaces.C.Strings;
package LLVM_link_time_Optimizer.Binding is
LTO_H : constant := 1;
LTO_API_VERSION : constant := 3;
function lto_get_version return Interfaces.C.Strings.chars_ptr;
function lto_get_error_message return Interfaces.C.Strings.chars_ptr;
function lto_module_is_object_file
(path : in Interfaces.C.Strings.chars_ptr)
return Interfaces.C.Extensions.bool;
function lto_module_is_object_file_for_target
(path : in Interfaces.C.Strings.chars_ptr;
target_triple_prefix : in Interfaces.C.Strings.chars_ptr)
return Interfaces.C.Extensions.bool;
function lto_module_is_object_file_in_memory
(mem : access Interfaces.C.Extensions.void;
length : in Interfaces.C.size_t)
return Interfaces.C.Extensions.bool;
function lto_module_is_object_file_in_memory_for_target
(mem : access Interfaces.C.Extensions.void;
length : in Interfaces.C.size_t;
target_triple_prefix : in Interfaces.C.Strings.chars_ptr)
return Interfaces.C.Extensions.bool;
function lto_module_create
(path : in Interfaces.C.Strings.chars_ptr)
return LLVM_link_time_Optimizer.lto_module_t;
function lto_module_create_from_memory
(mem : access Interfaces.C.Extensions.void;
length : in Interfaces.C.size_t)
return LLVM_link_time_Optimizer.lto_module_t;
procedure lto_module_dispose
(the_mod : in LLVM_link_time_Optimizer.lto_module_t);
function lto_module_get_target_triple
(the_mod : in LLVM_link_time_Optimizer.lto_module_t)
return Interfaces.C.Strings.chars_ptr;
function lto_module_get_num_symbols
(the_mod : in LLVM_link_time_Optimizer.lto_module_t)
return Interfaces.C.unsigned;
function lto_module_get_symbol_name
(the_mod : in LLVM_link_time_Optimizer.lto_module_t;
index : in Interfaces.C.unsigned)
return Interfaces.C.Strings.chars_ptr;
function lto_module_get_symbol_attribute
(the_mod : in LLVM_link_time_Optimizer.lto_module_t;
index : in Interfaces.C.unsigned)
return LLVM_link_time_Optimizer.lto_symbol_attributes;
function lto_codegen_create return LLVM_link_time_Optimizer.lto_code_gen_t;
procedure lto_codegen_dispose
(arg_1 : in LLVM_link_time_Optimizer.lto_code_gen_t);
function lto_codegen_add_module
(cg : in LLVM_link_time_Optimizer.lto_code_gen_t;
the_mod : in LLVM_link_time_Optimizer.lto_module_t)
return Interfaces.C.Extensions.bool;
function lto_codegen_set_debug_model
(cg : in LLVM_link_time_Optimizer.lto_code_gen_t;
arg_1 : in LLVM_link_time_Optimizer.lto_debug_model)
return Interfaces.C.Extensions.bool;
function lto_codegen_set_pic_model
(cg : in LLVM_link_time_Optimizer.lto_code_gen_t;
arg_1 : in LLVM_link_time_Optimizer.lto_codegen_model)
return Interfaces.C.Extensions.bool;
procedure lto_codegen_set_gcc_path
(cg : in LLVM_link_time_Optimizer.lto_code_gen_t;
path : in Interfaces.C.Strings.chars_ptr);
procedure lto_codegen_set_assembler_path
(cg : in LLVM_link_time_Optimizer.lto_code_gen_t;
path : in Interfaces.C.Strings.chars_ptr);
procedure lto_codegen_add_must_preserve_symbol
(cg : in LLVM_link_time_Optimizer.lto_code_gen_t;
symbol : in Interfaces.C.Strings.chars_ptr);
function lto_codegen_write_merged_modules
(cg : in LLVM_link_time_Optimizer.lto_code_gen_t;
path : in Interfaces.C.Strings.chars_ptr)
return Interfaces.C.Extensions.bool;
function lto_codegen_compile
(cg : in LLVM_link_time_Optimizer.lto_code_gen_t;
length : access Interfaces.C.size_t)
return access Interfaces.C.Extensions.void;
procedure lto_codegen_debug_options
(cg : in LLVM_link_time_Optimizer.lto_code_gen_t;
arg_1 : in Interfaces.C.Strings.chars_ptr);
function llvm_create_optimizer return
LLVM_link_time_Optimizer.llvm_lto_t;
procedure llvm_destroy_optimizer
(lto : in LLVM_link_time_Optimizer.llvm_lto_t);
function llvm_read_object_file
(lto : in LLVM_link_time_Optimizer.llvm_lto_t;
input_filename : in Interfaces.C.Strings.chars_ptr)
return LLVM_link_time_Optimizer.llvm_lto_status_t;
function llvm_optimize_modules
(lto : in LLVM_link_time_Optimizer.llvm_lto_t;
output_filename : in Interfaces.C.Strings.chars_ptr)
return LLVM_link_time_Optimizer.llvm_lto_status_t;
private
pragma Import (C, lto_get_version, "Ada_lto_get_version");
pragma Import (C, lto_get_error_message, "Ada_lto_get_error_message");
pragma Import
(C,
lto_module_is_object_file,
"Ada_lto_module_is_object_file");
pragma Import
(C,
lto_module_is_object_file_for_target,
"Ada_lto_module_is_object_file_for_target");
pragma Import
(C,
lto_module_is_object_file_in_memory,
"Ada_lto_module_is_object_file_in_memory");
pragma Import
(C,
lto_module_is_object_file_in_memory_for_target,
"Ada_lto_module_is_object_file_in_memory_for_target");
pragma Import (C, lto_module_create, "Ada_lto_module_create");
pragma Import
(C,
lto_module_create_from_memory,
"Ada_lto_module_create_from_memory");
pragma Import (C, lto_module_dispose, "Ada_lto_module_dispose");
pragma Import
(C,
lto_module_get_target_triple,
"Ada_lto_module_get_target_triple");
pragma Import
(C,
lto_module_get_num_symbols,
"Ada_lto_module_get_num_symbols");
pragma Import
(C,
lto_module_get_symbol_name,
"Ada_lto_module_get_symbol_name");
pragma Import
(C,
lto_module_get_symbol_attribute,
"Ada_lto_module_get_symbol_attribute");
pragma Import (C, lto_codegen_create, "Ada_lto_codegen_create");
pragma Import (C, lto_codegen_dispose, "Ada_lto_codegen_dispose");
pragma Import (C, lto_codegen_add_module, "Ada_lto_codegen_add_module");
pragma Import
(C,
lto_codegen_set_debug_model,
"Ada_lto_codegen_set_debug_model");
pragma Import
(C,
lto_codegen_set_pic_model,
"Ada_lto_codegen_set_pic_model");
pragma Import
(C,
lto_codegen_set_gcc_path,
"Ada_lto_codegen_set_gcc_path");
pragma Import
(C,
lto_codegen_set_assembler_path,
"Ada_lto_codegen_set_assembler_path");
pragma Import
(C,
lto_codegen_add_must_preserve_symbol,
"Ada_lto_codegen_add_must_preserve_symbol");
pragma Import
(C,
lto_codegen_write_merged_modules,
"Ada_lto_codegen_write_merged_modules");
pragma Import (C, lto_codegen_compile, "Ada_lto_codegen_compile");
pragma Import
(C,
lto_codegen_debug_options,
"Ada_lto_codegen_debug_options");
pragma Import (C, llvm_create_optimizer, "Ada_llvm_create_optimizer");
pragma Import (C, llvm_destroy_optimizer, "Ada_llvm_destroy_optimizer");
pragma Import (C, llvm_read_object_file, "Ada_llvm_read_object_file");
pragma Import (C, llvm_optimize_modules, "Ada_llvm_optimize_modules");
end LLVM_link_time_Optimizer.Binding;

View file

@ -0,0 +1,184 @@
-- This file is generated by SWIG. Do *not* modify by hand.
--
with Interfaces.C.Extensions;
package LLVM_link_time_Optimizer is
-- lto_symbol_attributes
--
type lto_symbol_attributes is (
LTO_SYMBOL_ALIGNMENT_MASK,
LTO_SYMBOL_PERMISSIONS_RODATA,
LTO_SYMBOL_PERMISSIONS_CODE,
LTO_SYMBOL_PERMISSIONS_DATA,
LTO_SYMBOL_PERMISSIONS_MASK,
LTO_SYMBOL_DEFINITION_REGULAR,
LTO_SYMBOL_DEFINITION_TENTATIVE,
LTO_SYMBOL_DEFINITION_WEAK,
LTO_SYMBOL_DEFINITION_UNDEFINED,
LTO_SYMBOL_DEFINITION_WEAKUNDEF,
LTO_SYMBOL_DEFINITION_MASK,
LTO_SYMBOL_SCOPE_INTERNAL,
LTO_SYMBOL_SCOPE_HIDDEN,
LTO_SYMBOL_SCOPE_DEFAULT,
LTO_SYMBOL_SCOPE_PROTECTED,
LTO_SYMBOL_SCOPE_MASK);
for lto_symbol_attributes use
(LTO_SYMBOL_ALIGNMENT_MASK => 31,
LTO_SYMBOL_PERMISSIONS_RODATA => 128,
LTO_SYMBOL_PERMISSIONS_CODE => 160,
LTO_SYMBOL_PERMISSIONS_DATA => 192,
LTO_SYMBOL_PERMISSIONS_MASK => 224,
LTO_SYMBOL_DEFINITION_REGULAR => 256,
LTO_SYMBOL_DEFINITION_TENTATIVE => 512,
LTO_SYMBOL_DEFINITION_WEAK => 768,
LTO_SYMBOL_DEFINITION_UNDEFINED => 1024,
LTO_SYMBOL_DEFINITION_WEAKUNDEF => 1280,
LTO_SYMBOL_DEFINITION_MASK => 1792,
LTO_SYMBOL_SCOPE_INTERNAL => 2048,
LTO_SYMBOL_SCOPE_HIDDEN => 4096,
LTO_SYMBOL_SCOPE_DEFAULT => 6144,
LTO_SYMBOL_SCOPE_PROTECTED => 8192,
LTO_SYMBOL_SCOPE_MASK => 14336);
pragma Convention (C, lto_symbol_attributes);
type lto_symbol_attributes_array is
array (Interfaces.C.size_t range <>)
of aliased LLVM_link_time_Optimizer.lto_symbol_attributes;
type lto_symbol_attributes_view is access all
LLVM_link_time_Optimizer.lto_symbol_attributes;
-- lto_debug_model
--
type lto_debug_model is (LTO_DEBUG_MODEL_NONE, LTO_DEBUG_MODEL_DWARF);
for lto_debug_model use
(LTO_DEBUG_MODEL_NONE => 0,
LTO_DEBUG_MODEL_DWARF => 1);
pragma Convention (C, lto_debug_model);
type lto_debug_model_array is
array (Interfaces.C.size_t range <>)
of aliased LLVM_link_time_Optimizer.lto_debug_model;
type lto_debug_model_view is access all
LLVM_link_time_Optimizer.lto_debug_model;
-- lto_codegen_model
--
type lto_codegen_model is (
LTO_CODEGEN_PIC_MODEL_STATIC,
LTO_CODEGEN_PIC_MODEL_DYNAMIC,
LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC);
for lto_codegen_model use
(LTO_CODEGEN_PIC_MODEL_STATIC => 0,
LTO_CODEGEN_PIC_MODEL_DYNAMIC => 1,
LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC => 2);
pragma Convention (C, lto_codegen_model);
type lto_codegen_model_array is
array (Interfaces.C.size_t range <>)
of aliased LLVM_link_time_Optimizer.lto_codegen_model;
type lto_codegen_model_view is access all
LLVM_link_time_Optimizer.lto_codegen_model;
-- LTOModule
--
type LTOModule is new Interfaces.C.Extensions.opaque_structure_def;
type LTOModule_array is
array (Interfaces.C.size_t range <>)
of aliased LLVM_link_time_Optimizer.LTOModule;
type LTOModule_view is access all LLVM_link_time_Optimizer.LTOModule;
-- lto_module_t
--
type lto_module_t is access all LLVM_link_time_Optimizer.LTOModule;
type lto_module_t_array is
array (Interfaces.C.size_t range <>)
of aliased LLVM_link_time_Optimizer.lto_module_t;
type lto_module_t_view is access all LLVM_link_time_Optimizer.lto_module_t;
-- LTOCodeGenerator
--
type LTOCodeGenerator is new Interfaces.C.Extensions.opaque_structure_def;
type LTOCodeGenerator_array is
array (Interfaces.C.size_t range <>)
of aliased LLVM_link_time_Optimizer.LTOCodeGenerator;
type LTOCodeGenerator_view is access all
LLVM_link_time_Optimizer.LTOCodeGenerator;
-- lto_code_gen_t
--
type lto_code_gen_t is access all LLVM_link_time_Optimizer.LTOCodeGenerator;
type lto_code_gen_t_array is
array (Interfaces.C.size_t range <>)
of aliased LLVM_link_time_Optimizer.lto_code_gen_t;
type lto_code_gen_t_view is access all
LLVM_link_time_Optimizer.lto_code_gen_t;
-- llvm_lto_status_t
--
type llvm_lto_status_t is (
LLVM_LTO_UNKNOWN,
LLVM_LTO_OPT_SUCCESS,
LLVM_LTO_READ_SUCCESS,
LLVM_LTO_READ_FAILURE,
LLVM_LTO_WRITE_FAILURE,
LLVM_LTO_NO_TARGET,
LLVM_LTO_NO_WORK,
LLVM_LTO_MODULE_MERGE_FAILURE,
LLVM_LTO_ASM_FAILURE,
LLVM_LTO_NULL_OBJECT);
for llvm_lto_status_t use
(LLVM_LTO_UNKNOWN => 0,
LLVM_LTO_OPT_SUCCESS => 1,
LLVM_LTO_READ_SUCCESS => 2,
LLVM_LTO_READ_FAILURE => 3,
LLVM_LTO_WRITE_FAILURE => 4,
LLVM_LTO_NO_TARGET => 5,
LLVM_LTO_NO_WORK => 6,
LLVM_LTO_MODULE_MERGE_FAILURE => 7,
LLVM_LTO_ASM_FAILURE => 8,
LLVM_LTO_NULL_OBJECT => 9);
pragma Convention (C, llvm_lto_status_t);
type llvm_lto_status_t_array is
array (Interfaces.C.size_t range <>)
of aliased LLVM_link_time_Optimizer.llvm_lto_status_t;
type llvm_lto_status_t_view is access all
LLVM_link_time_Optimizer.llvm_lto_status_t;
-- llvm_lto_t
--
type llvm_lto_t is access all Interfaces.C.Extensions.void;
type llvm_lto_t_array is
array (Interfaces.C.size_t range <>)
of aliased LLVM_link_time_Optimizer.llvm_lto_t;
type llvm_lto_t_view is access all
LLVM_link_time_Optimizer.llvm_lto_t;
end LLVM_link_time_Optimizer;

View file

@ -0,0 +1,923 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.36
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
* changes to this file unless you know what you are doing--modify the SWIG
* interface file instead.
* ----------------------------------------------------------------------------- */
#ifdef __cplusplus
template<typename T> class SwigValueWrapper {
T *tt;
public:
SwigValueWrapper() : tt(0) { }
SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
SwigValueWrapper(const T& t) : tt(new T(t)) { }
~SwigValueWrapper() { delete tt; }
SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
operator T&() const { return *tt; }
T *operator&() { return tt; }
private:
SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
};
template <typename T> T SwigValueInit() {
return T();
}
#endif
/* -----------------------------------------------------------------------------
* This section contains generic SWIG labels for method/variable
* declarations/attributes, and other compiler dependent labels.
* ----------------------------------------------------------------------------- */
/* template workaround for compilers that cannot correctly implement the C++ standard */
#ifndef SWIGTEMPLATEDISAMBIGUATOR
# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
# define SWIGTEMPLATEDISAMBIGUATOR template
# elif defined(__HP_aCC)
/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
# define SWIGTEMPLATEDISAMBIGUATOR template
# else
# define SWIGTEMPLATEDISAMBIGUATOR
# endif
#endif
/* inline attribute */
#ifndef SWIGINLINE
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
# define SWIGINLINE inline
# else
# define SWIGINLINE
# endif
#endif
/* attribute recognised by some compilers to avoid 'unused' warnings */
#ifndef SWIGUNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
# elif defined(__ICC)
# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
#endif
#ifndef SWIGUNUSEDPARM
# ifdef __cplusplus
# define SWIGUNUSEDPARM(p)
# else
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
# endif
#endif
/* internal SWIG method */
#ifndef SWIGINTERN
# define SWIGINTERN static SWIGUNUSED
#endif
/* internal inline SWIG method */
#ifndef SWIGINTERNINLINE
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
#endif
/* exporting methods */
#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
# ifndef GCC_HASCLASSVISIBILITY
# define GCC_HASCLASSVISIBILITY
# endif
#endif
#ifndef SWIGEXPORT
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# if defined(STATIC_LINKED)
# define SWIGEXPORT
# else
# define SWIGEXPORT __declspec(dllexport)
# endif
# else
# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
# define SWIGEXPORT __attribute__ ((visibility("default")))
# else
# define SWIGEXPORT
# endif
# endif
#endif
/* calling conventions for Windows */
#ifndef SWIGSTDCALL
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# define SWIGSTDCALL __stdcall
# else
# define SWIGSTDCALL
# endif
#endif
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE
#endif
/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
# define _SCL_SECURE_NO_DEPRECATE
#endif
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#if defined(_WIN32) || defined(__CYGWIN32__)
# define DllExport __declspec( dllexport )
# define SWIGSTDCALL __stdcall
#else
# define DllExport
# define SWIGSTDCALL
#endif
#ifdef __cplusplus
# include <new>
#endif
/* Support for throwing Ada exceptions from C/C++ */
typedef enum
{
SWIG_AdaException,
SWIG_AdaOutOfMemoryException,
SWIG_AdaIndexOutOfRangeException,
SWIG_AdaDivideByZeroException,
SWIG_AdaArgumentOutOfRangeException,
SWIG_AdaNullReferenceException
} SWIG_AdaExceptionCodes;
typedef void (SWIGSTDCALL* SWIG_AdaExceptionCallback_t)(const char *);
typedef struct
{
SWIG_AdaExceptionCodes code;
SWIG_AdaExceptionCallback_t callback;
}
SWIG_AdaExceptions_t;
static
SWIG_AdaExceptions_t
SWIG_ada_exceptions[] =
{
{ SWIG_AdaException, NULL },
{ SWIG_AdaOutOfMemoryException, NULL },
{ SWIG_AdaIndexOutOfRangeException, NULL },
{ SWIG_AdaDivideByZeroException, NULL },
{ SWIG_AdaArgumentOutOfRangeException, NULL },
{ SWIG_AdaNullReferenceException, NULL }
};
static
void
SWIG_AdaThrowException (SWIG_AdaExceptionCodes code, const char *msg)
{
SWIG_AdaExceptionCallback_t callback = SWIG_ada_exceptions[SWIG_AdaException].callback;
if (code >=0 && (size_t)code < sizeof(SWIG_ada_exceptions)/sizeof(SWIG_AdaExceptions_t)) {
callback = SWIG_ada_exceptions[code].callback;
}
callback(msg);
}
#ifdef __cplusplus
extern "C"
#endif
DllExport void SWIGSTDCALL SWIGRegisterExceptionCallbacks_LLVM_link_time_Optimizer (SWIG_AdaExceptionCallback_t systemException,
SWIG_AdaExceptionCallback_t outOfMemory,
SWIG_AdaExceptionCallback_t indexOutOfRange,
SWIG_AdaExceptionCallback_t divideByZero,
SWIG_AdaExceptionCallback_t argumentOutOfRange,
SWIG_AdaExceptionCallback_t nullReference)
{
SWIG_ada_exceptions [SWIG_AdaException].callback = systemException;
SWIG_ada_exceptions [SWIG_AdaOutOfMemoryException].callback = outOfMemory;
SWIG_ada_exceptions [SWIG_AdaIndexOutOfRangeException].callback = indexOutOfRange;
SWIG_ada_exceptions [SWIG_AdaDivideByZeroException].callback = divideByZero;
SWIG_ada_exceptions [SWIG_AdaArgumentOutOfRangeException].callback = argumentOutOfRange;
SWIG_ada_exceptions [SWIG_AdaNullReferenceException].callback = nullReference;
}
/* Callback for returning strings to Ada without leaking memory */
typedef char * (SWIGSTDCALL* SWIG_AdaStringHelperCallback)(const char *);
static SWIG_AdaStringHelperCallback SWIG_ada_string_callback = NULL;
/* probably obsolete ...
#ifdef __cplusplus
extern "C"
#endif
DllExport void SWIGSTDCALL SWIGRegisterStringCallback_LLVM_link_time_Optimizer(SWIG_AdaStringHelperCallback callback) {
SWIG_ada_string_callback = callback;
}
*/
/* Contract support */
#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_AdaThrowException(SWIG_AdaArgumentOutOfRangeException, msg); return nullreturn; } else
#define protected public
#define private public
#include "llvm-c/lto.h"
#include "llvm-c/LinkTimeOptimizer.h"
// struct LLVMCtxt;
#undef protected
#undef private
#ifdef __cplusplus
extern "C" {
#endif
DllExport char * SWIGSTDCALL Ada_lto_get_version (
)
{
char * jresult ;
char *result = 0 ;
result = (char *)lto_get_version();
jresult = result;
return jresult;
}
DllExport char * SWIGSTDCALL Ada_lto_get_error_message (
)
{
char * jresult ;
char *result = 0 ;
result = (char *)lto_get_error_message();
jresult = result;
return jresult;
}
DllExport unsigned int SWIGSTDCALL Ada_lto_module_is_object_file (
char * jarg1
)
{
unsigned int jresult ;
char *arg1 = (char *) 0 ;
bool result;
arg1 = jarg1;
result = (bool)lto_module_is_object_file((char const *)arg1);
jresult = result;
return jresult;
}
DllExport unsigned int SWIGSTDCALL Ada_lto_module_is_object_file_for_target (
char * jarg1
,
char * jarg2
)
{
unsigned int jresult ;
char *arg1 = (char *) 0 ;
char *arg2 = (char *) 0 ;
bool result;
arg1 = jarg1;
arg2 = jarg2;
result = (bool)lto_module_is_object_file_for_target((char const *)arg1,(char const *)arg2);
jresult = result;
return jresult;
}
DllExport unsigned int SWIGSTDCALL Ada_lto_module_is_object_file_in_memory (
void* jarg1
,
size_t jarg2
)
{
unsigned int jresult ;
void *arg1 = (void *) 0 ;
size_t arg2 ;
bool result;
arg1 = (void *)jarg1;
arg2 = (size_t) jarg2;
result = (bool)lto_module_is_object_file_in_memory((void const *)arg1,arg2);
jresult = result;
return jresult;
}
DllExport unsigned int SWIGSTDCALL Ada_lto_module_is_object_file_in_memory_for_target (
void* jarg1
,
size_t jarg2
,
char * jarg3
)
{
unsigned int jresult ;
void *arg1 = (void *) 0 ;
size_t arg2 ;
char *arg3 = (char *) 0 ;
bool result;
arg1 = (void *)jarg1;
arg2 = (size_t) jarg2;
arg3 = jarg3;
result = (bool)lto_module_is_object_file_in_memory_for_target((void const *)arg1,arg2,(char const *)arg3);
jresult = result;
return jresult;
}
DllExport void * SWIGSTDCALL Ada_lto_module_create (
char * jarg1
)
{
void * jresult ;
char *arg1 = (char *) 0 ;
lto_module_t result;
arg1 = jarg1;
result = (lto_module_t)lto_module_create((char const *)arg1);
jresult = (void *) result;
return jresult;
}
DllExport void * SWIGSTDCALL Ada_lto_module_create_from_memory (
void* jarg1
,
size_t jarg2
)
{
void * jresult ;
void *arg1 = (void *) 0 ;
size_t arg2 ;
lto_module_t result;
arg1 = (void *)jarg1;
arg2 = (size_t) jarg2;
result = (lto_module_t)lto_module_create_from_memory((void const *)arg1,arg2);
jresult = (void *) result;
return jresult;
}
DllExport void SWIGSTDCALL Ada_lto_module_dispose (
void * jarg1
)
{
lto_module_t arg1 = (lto_module_t) 0 ;
arg1 = (lto_module_t)jarg1;
lto_module_dispose(arg1);
}
DllExport char * SWIGSTDCALL Ada_lto_module_get_target_triple (
void * jarg1
)
{
char * jresult ;
lto_module_t arg1 = (lto_module_t) 0 ;
char *result = 0 ;
arg1 = (lto_module_t)jarg1;
result = (char *)lto_module_get_target_triple(arg1);
jresult = result;
return jresult;
}
DllExport unsigned int SWIGSTDCALL Ada_lto_module_get_num_symbols (
void * jarg1
)
{
unsigned int jresult ;
lto_module_t arg1 = (lto_module_t) 0 ;
unsigned int result;
arg1 = (lto_module_t)jarg1;
result = (unsigned int)lto_module_get_num_symbols(arg1);
jresult = result;
return jresult;
}
DllExport char * SWIGSTDCALL Ada_lto_module_get_symbol_name (
void * jarg1
,
unsigned int jarg2
)
{
char * jresult ;
lto_module_t arg1 = (lto_module_t) 0 ;
unsigned int arg2 ;
char *result = 0 ;
arg1 = (lto_module_t)jarg1;
arg2 = (unsigned int) jarg2;
result = (char *)lto_module_get_symbol_name(arg1,arg2);
jresult = result;
return jresult;
}
DllExport int SWIGSTDCALL Ada_lto_module_get_symbol_attribute (
void * jarg1
,
unsigned int jarg2
)
{
int jresult ;
lto_module_t arg1 = (lto_module_t) 0 ;
unsigned int arg2 ;
lto_symbol_attributes result;
arg1 = (lto_module_t)jarg1;
arg2 = (unsigned int) jarg2;
result = (lto_symbol_attributes)lto_module_get_symbol_attribute(arg1,arg2);
jresult = result;
return jresult;
}
DllExport void * SWIGSTDCALL Ada_lto_codegen_create (
)
{
void * jresult ;
lto_code_gen_t result;
result = (lto_code_gen_t)lto_codegen_create();
jresult = (void *) result;
return jresult;
}
DllExport void SWIGSTDCALL Ada_lto_codegen_dispose (
void * jarg1
)
{
lto_code_gen_t arg1 = (lto_code_gen_t) 0 ;
arg1 = (lto_code_gen_t)jarg1;
lto_codegen_dispose(arg1);
}
DllExport unsigned int SWIGSTDCALL Ada_lto_codegen_add_module (
void * jarg1
,
void * jarg2
)
{
unsigned int jresult ;
lto_code_gen_t arg1 = (lto_code_gen_t) 0 ;
lto_module_t arg2 = (lto_module_t) 0 ;
bool result;
arg1 = (lto_code_gen_t)jarg1;
arg2 = (lto_module_t)jarg2;
result = (bool)lto_codegen_add_module(arg1,arg2);
jresult = result;
return jresult;
}
DllExport unsigned int SWIGSTDCALL Ada_lto_codegen_set_debug_model (
void * jarg1
,
int jarg2
)
{
unsigned int jresult ;
lto_code_gen_t arg1 = (lto_code_gen_t) 0 ;
lto_debug_model arg2 ;
bool result;
arg1 = (lto_code_gen_t)jarg1;
arg2 = (lto_debug_model) jarg2;
result = (bool)lto_codegen_set_debug_model(arg1,arg2);
jresult = result;
return jresult;
}
DllExport unsigned int SWIGSTDCALL Ada_lto_codegen_set_pic_model (
void * jarg1
,
int jarg2
)
{
unsigned int jresult ;
lto_code_gen_t arg1 = (lto_code_gen_t) 0 ;
lto_codegen_model arg2 ;
bool result;
arg1 = (lto_code_gen_t)jarg1;
arg2 = (lto_codegen_model) jarg2;
result = (bool)lto_codegen_set_pic_model(arg1,arg2);
jresult = result;
return jresult;
}
DllExport void SWIGSTDCALL Ada_lto_codegen_set_gcc_path (
void * jarg1
,
char * jarg2
)
{
lto_code_gen_t arg1 = (lto_code_gen_t) 0 ;
char *arg2 = (char *) 0 ;
arg1 = (lto_code_gen_t)jarg1;
arg2 = jarg2;
lto_codegen_set_gcc_path(arg1,(char const *)arg2);
}
DllExport void SWIGSTDCALL Ada_lto_codegen_set_assembler_path (
void * jarg1
,
char * jarg2
)
{
lto_code_gen_t arg1 = (lto_code_gen_t) 0 ;
char *arg2 = (char *) 0 ;
arg1 = (lto_code_gen_t)jarg1;
arg2 = jarg2;
lto_codegen_set_assembler_path(arg1,(char const *)arg2);
}
DllExport void SWIGSTDCALL Ada_lto_codegen_add_must_preserve_symbol (
void * jarg1
,
char * jarg2
)
{
lto_code_gen_t arg1 = (lto_code_gen_t) 0 ;
char *arg2 = (char *) 0 ;
arg1 = (lto_code_gen_t)jarg1;
arg2 = jarg2;
lto_codegen_add_must_preserve_symbol(arg1,(char const *)arg2);
}
DllExport unsigned int SWIGSTDCALL Ada_lto_codegen_write_merged_modules (
void * jarg1
,
char * jarg2
)
{
unsigned int jresult ;
lto_code_gen_t arg1 = (lto_code_gen_t) 0 ;
char *arg2 = (char *) 0 ;
bool result;
arg1 = (lto_code_gen_t)jarg1;
arg2 = jarg2;
result = (bool)lto_codegen_write_merged_modules(arg1,(char const *)arg2);
jresult = result;
return jresult;
}
DllExport void* SWIGSTDCALL Ada_lto_codegen_compile (
void * jarg1
,
size_t* jarg2
)
{
void* jresult ;
lto_code_gen_t arg1 = (lto_code_gen_t) 0 ;
size_t *arg2 = (size_t *) 0 ;
void *result = 0 ;
arg1 = (lto_code_gen_t)jarg1;
arg2 = (size_t *) jarg2;
result = (void *)lto_codegen_compile(arg1,arg2);
jresult = (void *) result;
return jresult;
}
DllExport void SWIGSTDCALL Ada_lto_codegen_debug_options (
void * jarg1
,
char * jarg2
)
{
lto_code_gen_t arg1 = (lto_code_gen_t) 0 ;
char *arg2 = (char *) 0 ;
arg1 = (lto_code_gen_t)jarg1;
arg2 = jarg2;
lto_codegen_debug_options(arg1,(char const *)arg2);
}
DllExport void* SWIGSTDCALL Ada_llvm_create_optimizer (
)
{
void* jresult ;
llvm_lto_t result;
result = (llvm_lto_t)llvm_create_optimizer();
jresult = (void *) result;
return jresult;
}
DllExport void SWIGSTDCALL Ada_llvm_destroy_optimizer (
void* jarg1
)
{
llvm_lto_t arg1 = (llvm_lto_t) 0 ;
arg1 = (llvm_lto_t)jarg1;
llvm_destroy_optimizer(arg1);
}
DllExport int SWIGSTDCALL Ada_llvm_read_object_file (
void* jarg1
,
char * jarg2
)
{
int jresult ;
llvm_lto_t arg1 = (llvm_lto_t) 0 ;
char *arg2 = (char *) 0 ;
llvm_lto_status_t result;
arg1 = (llvm_lto_t)jarg1;
arg2 = jarg2;
result = (llvm_lto_status_t)llvm_read_object_file(arg1,(char const *)arg2);
jresult = result;
return jresult;
}
DllExport int SWIGSTDCALL Ada_llvm_optimize_modules (
void* jarg1
,
char * jarg2
)
{
int jresult ;
llvm_lto_t arg1 = (llvm_lto_t) 0 ;
char *arg2 = (char *) 0 ;
llvm_lto_status_t result;
arg1 = (llvm_lto_t)jarg1;
arg2 = jarg2;
result = (llvm_lto_status_t)llvm_optimize_modules(arg1,(char const *)arg2);
jresult = result;
return jresult;
}
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,138 @@
-- This file is generated by SWIG. Do *not* modify by hand.
--
with llvm;
with Interfaces.C.Strings;
package LLVM_Target.Binding is
LLVMBigEndian : constant := 0;
LLVMLittleEndian : constant := 1;
procedure LLVMInitializeAllTargets;
function LLVMInitializeNativeTarget return Interfaces.C.int;
function LLVMCreateTargetData
(StringRep : in Interfaces.C.Strings.chars_ptr)
return LLVM_Target.LLVMTargetDataRef;
procedure LLVMAddTargetData
(arg_2_1 : in LLVM_Target.LLVMTargetDataRef;
arg_2_2 : in llvm.LLVMPassManagerRef);
function LLVMCopyStringRepOfTargetData
(arg_1 : in LLVM_Target.LLVMTargetDataRef)
return Interfaces.C.Strings.chars_ptr;
function LLVMByteOrder
(arg_1 : in LLVM_Target.LLVMTargetDataRef)
return LLVM_Target.LLVMByteOrdering;
function LLVMPointerSize
(arg_1 : in LLVM_Target.LLVMTargetDataRef)
return Interfaces.C.unsigned;
function LLVMIntPtrType
(arg_1 : in LLVM_Target.LLVMTargetDataRef)
return llvm.LLVMTypeRef;
function LLVMSizeOfTypeInBits
(arg_2_1 : in LLVM_Target.LLVMTargetDataRef;
arg_2_2 : in llvm.LLVMTypeRef)
return Interfaces.C.Extensions.unsigned_long_long;
function LLVMStoreSizeOfType
(arg_2_1 : in LLVM_Target.LLVMTargetDataRef;
arg_2_2 : in llvm.LLVMTypeRef)
return Interfaces.C.Extensions.unsigned_long_long;
function LLVMABISizeOfType
(arg_2_1 : in LLVM_Target.LLVMTargetDataRef;
arg_2_2 : in llvm.LLVMTypeRef)
return Interfaces.C.Extensions.unsigned_long_long;
function LLVMABIAlignmentOfType
(arg_2_1 : in LLVM_Target.LLVMTargetDataRef;
arg_2_2 : in llvm.LLVMTypeRef)
return Interfaces.C.unsigned;
function LLVMCallFrameAlignmentOfType
(arg_2_1 : in LLVM_Target.LLVMTargetDataRef;
arg_2_2 : in llvm.LLVMTypeRef)
return Interfaces.C.unsigned;
function LLVMPreferredAlignmentOfType
(arg_2_1 : in LLVM_Target.LLVMTargetDataRef;
arg_2_2 : in llvm.LLVMTypeRef)
return Interfaces.C.unsigned;
function LLVMPreferredAlignmentOfGlobal
(arg_1 : in LLVM_Target.LLVMTargetDataRef;
GlobalVar : in llvm.LLVMValueRef)
return Interfaces.C.unsigned;
function LLVMElementAtOffset
(arg_1 : in LLVM_Target.LLVMTargetDataRef;
StructTy : in llvm.LLVMTypeRef;
Offset : in Interfaces.C.Extensions.unsigned_long_long)
return Interfaces.C.unsigned;
function LLVMOffsetOfElement
(arg_1 : in LLVM_Target.LLVMTargetDataRef;
StructTy : in llvm.LLVMTypeRef;
Element : in Interfaces.C.unsigned)
return Interfaces.C.Extensions.unsigned_long_long;
procedure LLVMInvalidateStructLayout
(arg_1 : in LLVM_Target.LLVMTargetDataRef;
StructTy : in llvm.LLVMTypeRef);
procedure LLVMDisposeTargetData
(arg_1 : in LLVM_Target.LLVMTargetDataRef);
private
pragma Import
(C,
LLVMInitializeAllTargets,
"Ada_LLVMInitializeAllTargets");
pragma Import
(C,
LLVMInitializeNativeTarget,
"Ada_LLVMInitializeNativeTarget");
pragma Import (C, LLVMCreateTargetData, "Ada_LLVMCreateTargetData");
pragma Import (C, LLVMAddTargetData, "Ada_LLVMAddTargetData");
pragma Import
(C,
LLVMCopyStringRepOfTargetData,
"Ada_LLVMCopyStringRepOfTargetData");
pragma Import (C, LLVMByteOrder, "Ada_LLVMByteOrder");
pragma Import (C, LLVMPointerSize, "Ada_LLVMPointerSize");
pragma Import (C, LLVMIntPtrType, "Ada_LLVMIntPtrType");
pragma Import (C, LLVMSizeOfTypeInBits, "Ada_LLVMSizeOfTypeInBits");
pragma Import (C, LLVMStoreSizeOfType, "Ada_LLVMStoreSizeOfType");
pragma Import (C, LLVMABISizeOfType, "Ada_LLVMABISizeOfType");
pragma Import (C, LLVMABIAlignmentOfType, "Ada_LLVMABIAlignmentOfType");
pragma Import
(C,
LLVMCallFrameAlignmentOfType,
"Ada_LLVMCallFrameAlignmentOfType");
pragma Import
(C,
LLVMPreferredAlignmentOfType,
"Ada_LLVMPreferredAlignmentOfType");
pragma Import
(C,
LLVMPreferredAlignmentOfGlobal,
"Ada_LLVMPreferredAlignmentOfGlobal");
pragma Import (C, LLVMElementAtOffset, "Ada_LLVMElementAtOffset");
pragma Import (C, LLVMOffsetOfElement, "Ada_LLVMOffsetOfElement");
pragma Import
(C,
LLVMInvalidateStructLayout,
"Ada_LLVMInvalidateStructLayout");
pragma Import (C, LLVMDisposeTargetData, "Ada_LLVMDisposeTargetData");
end LLVM_Target.Binding;

View file

@ -0,0 +1,72 @@
-- This file is generated by SWIG. Do *not* modify by hand.
--
with Interfaces.C.Extensions;
package LLVM_Target is
-- LLVMOpaqueTargetData
--
type LLVMOpaqueTargetData is new
Interfaces.C.Extensions.opaque_structure_def;
type LLVMOpaqueTargetData_array is
array (Interfaces.C.size_t range <>)
of aliased LLVM_Target.LLVMOpaqueTargetData;
type LLVMOpaqueTargetData_view is access all
LLVM_Target.LLVMOpaqueTargetData;
-- LLVMTargetDataRef
--
type LLVMTargetDataRef is access all LLVM_Target.LLVMOpaqueTargetData;
type LLVMTargetDataRef_array is
array (Interfaces.C.size_t range <>)
of aliased LLVM_Target.LLVMTargetDataRef;
type LLVMTargetDataRef_view is access all LLVM_Target.LLVMTargetDataRef;
-- LLVMStructLayout
--
type LLVMStructLayout is new Interfaces.C.Extensions.opaque_structure_def;
type LLVMStructLayout_array is
array (Interfaces.C.size_t range <>)
of aliased LLVM_Target.LLVMStructLayout;
type LLVMStructLayout_view is access all LLVM_Target.LLVMStructLayout;
-- LLVMStructLayoutRef
--
type LLVMStructLayoutRef is access all LLVM_Target.LLVMStructLayout;
type LLVMStructLayoutRef_array is
array (Interfaces.C.size_t range <>)
of aliased LLVM_Target.LLVMStructLayoutRef;
type LLVMStructLayoutRef_view is access all LLVM_Target.LLVMStructLayoutRef;
-- TargetData
--
type TargetData is new Interfaces.C.Extensions.incomplete_class_def;
type TargetData_array is
array (Interfaces.C.size_t range <>)
of aliased LLVM_Target.TargetData;
type TargetData_view is access all LLVM_Target.TargetData;
-- LLVMByteOrdering
--
type LLVMByteOrdering is new Interfaces.C.int;
type LLVMByteOrdering_array is
array (Interfaces.C.size_t range <>)
of aliased LLVM_Target.LLVMByteOrdering;
type LLVMByteOrdering_view is access all LLVM_Target.LLVMByteOrdering;
end LLVM_Target;

View file

@ -0,0 +1,720 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.36
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
* changes to this file unless you know what you are doing--modify the SWIG
* interface file instead.
* ----------------------------------------------------------------------------- */
#ifdef __cplusplus
template<typename T> class SwigValueWrapper {
T *tt;
public:
SwigValueWrapper() : tt(0) { }
SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
SwigValueWrapper(const T& t) : tt(new T(t)) { }
~SwigValueWrapper() { delete tt; }
SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
operator T&() const { return *tt; }
T *operator&() { return tt; }
private:
SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
};
template <typename T> T SwigValueInit() {
return T();
}
#endif
/* -----------------------------------------------------------------------------
* This section contains generic SWIG labels for method/variable
* declarations/attributes, and other compiler dependent labels.
* ----------------------------------------------------------------------------- */
/* template workaround for compilers that cannot correctly implement the C++ standard */
#ifndef SWIGTEMPLATEDISAMBIGUATOR
# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
# define SWIGTEMPLATEDISAMBIGUATOR template
# elif defined(__HP_aCC)
/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
# define SWIGTEMPLATEDISAMBIGUATOR template
# else
# define SWIGTEMPLATEDISAMBIGUATOR
# endif
#endif
/* inline attribute */
#ifndef SWIGINLINE
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
# define SWIGINLINE inline
# else
# define SWIGINLINE
# endif
#endif
/* attribute recognised by some compilers to avoid 'unused' warnings */
#ifndef SWIGUNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
# elif defined(__ICC)
# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
#endif
#ifndef SWIGUNUSEDPARM
# ifdef __cplusplus
# define SWIGUNUSEDPARM(p)
# else
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
# endif
#endif
/* internal SWIG method */
#ifndef SWIGINTERN
# define SWIGINTERN static SWIGUNUSED
#endif
/* internal inline SWIG method */
#ifndef SWIGINTERNINLINE
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
#endif
/* exporting methods */
#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
# ifndef GCC_HASCLASSVISIBILITY
# define GCC_HASCLASSVISIBILITY
# endif
#endif
#ifndef SWIGEXPORT
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# if defined(STATIC_LINKED)
# define SWIGEXPORT
# else
# define SWIGEXPORT __declspec(dllexport)
# endif
# else
# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
# define SWIGEXPORT __attribute__ ((visibility("default")))
# else
# define SWIGEXPORT
# endif
# endif
#endif
/* calling conventions for Windows */
#ifndef SWIGSTDCALL
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# define SWIGSTDCALL __stdcall
# else
# define SWIGSTDCALL
# endif
#endif
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE
#endif
/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
# define _SCL_SECURE_NO_DEPRECATE
#endif
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#if defined(_WIN32) || defined(__CYGWIN32__)
# define DllExport __declspec( dllexport )
# define SWIGSTDCALL __stdcall
#else
# define DllExport
# define SWIGSTDCALL
#endif
#ifdef __cplusplus
# include <new>
#endif
/* Support for throwing Ada exceptions from C/C++ */
typedef enum
{
SWIG_AdaException,
SWIG_AdaOutOfMemoryException,
SWIG_AdaIndexOutOfRangeException,
SWIG_AdaDivideByZeroException,
SWIG_AdaArgumentOutOfRangeException,
SWIG_AdaNullReferenceException
} SWIG_AdaExceptionCodes;
typedef void (SWIGSTDCALL* SWIG_AdaExceptionCallback_t)(const char *);
typedef struct
{
SWIG_AdaExceptionCodes code;
SWIG_AdaExceptionCallback_t callback;
}
SWIG_AdaExceptions_t;
static
SWIG_AdaExceptions_t
SWIG_ada_exceptions[] =
{
{ SWIG_AdaException, NULL },
{ SWIG_AdaOutOfMemoryException, NULL },
{ SWIG_AdaIndexOutOfRangeException, NULL },
{ SWIG_AdaDivideByZeroException, NULL },
{ SWIG_AdaArgumentOutOfRangeException, NULL },
{ SWIG_AdaNullReferenceException, NULL }
};
static
void
SWIG_AdaThrowException (SWIG_AdaExceptionCodes code, const char *msg)
{
SWIG_AdaExceptionCallback_t callback = SWIG_ada_exceptions[SWIG_AdaException].callback;
if (code >=0 && (size_t)code < sizeof(SWIG_ada_exceptions)/sizeof(SWIG_AdaExceptions_t)) {
callback = SWIG_ada_exceptions[code].callback;
}
callback(msg);
}
#ifdef __cplusplus
extern "C"
#endif
DllExport void SWIGSTDCALL SWIGRegisterExceptionCallbacks_LLVM_Target (SWIG_AdaExceptionCallback_t systemException,
SWIG_AdaExceptionCallback_t outOfMemory,
SWIG_AdaExceptionCallback_t indexOutOfRange,
SWIG_AdaExceptionCallback_t divideByZero,
SWIG_AdaExceptionCallback_t argumentOutOfRange,
SWIG_AdaExceptionCallback_t nullReference)
{
SWIG_ada_exceptions [SWIG_AdaException].callback = systemException;
SWIG_ada_exceptions [SWIG_AdaOutOfMemoryException].callback = outOfMemory;
SWIG_ada_exceptions [SWIG_AdaIndexOutOfRangeException].callback = indexOutOfRange;
SWIG_ada_exceptions [SWIG_AdaDivideByZeroException].callback = divideByZero;
SWIG_ada_exceptions [SWIG_AdaArgumentOutOfRangeException].callback = argumentOutOfRange;
SWIG_ada_exceptions [SWIG_AdaNullReferenceException].callback = nullReference;
}
/* Callback for returning strings to Ada without leaking memory */
typedef char * (SWIGSTDCALL* SWIG_AdaStringHelperCallback)(const char *);
static SWIG_AdaStringHelperCallback SWIG_ada_string_callback = NULL;
/* probably obsolete ...
#ifdef __cplusplus
extern "C"
#endif
DllExport void SWIGSTDCALL SWIGRegisterStringCallback_LLVM_Target(SWIG_AdaStringHelperCallback callback) {
SWIG_ada_string_callback = callback;
}
*/
/* Contract support */
#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_AdaThrowException(SWIG_AdaArgumentOutOfRangeException, msg); return nullreturn; } else
#define protected public
#define private public
#include "llvm-c/Target.h"
// struct LLVMCtxt;
#undef protected
#undef private
#ifdef __cplusplus
extern "C" {
#endif
DllExport void SWIGSTDCALL Ada_LLVMInitializeAllTargets (
)
{
LLVMInitializeAllTargets();
}
DllExport int SWIGSTDCALL Ada_LLVMInitializeNativeTarget (
)
{
int jresult ;
int result;
result = (int)LLVMInitializeNativeTarget();
jresult = result;
return jresult;
}
DllExport void * SWIGSTDCALL Ada_LLVMCreateTargetData (
char * jarg1
)
{
void * jresult ;
char *arg1 = (char *) 0 ;
LLVMTargetDataRef result;
arg1 = jarg1;
result = (LLVMTargetDataRef)LLVMCreateTargetData((char const *)arg1);
jresult = (void *) result;
return jresult;
}
DllExport void SWIGSTDCALL Ada_LLVMAddTargetData (
void * jarg1
,
void * jarg2
)
{
LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
LLVMPassManagerRef arg2 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMTargetDataRef)jarg1;
arg2 = (LLVMPassManagerRef)jarg2;
LLVMAddTargetData(arg1,arg2);
}
DllExport char * SWIGSTDCALL Ada_LLVMCopyStringRepOfTargetData (
void * jarg1
)
{
char * jresult ;
LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
char *result = 0 ;
arg1 = (LLVMTargetDataRef)jarg1;
result = (char *)LLVMCopyStringRepOfTargetData(arg1);
jresult = result;
return jresult;
}
DllExport int SWIGSTDCALL Ada_LLVMByteOrder (
void * jarg1
)
{
int jresult ;
LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
LLVMByteOrdering result;
arg1 = (LLVMTargetDataRef)jarg1;
result = (LLVMByteOrdering)LLVMByteOrder(arg1);
jresult = result;
return jresult;
}
DllExport unsigned int SWIGSTDCALL Ada_LLVMPointerSize (
void * jarg1
)
{
unsigned int jresult ;
LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
unsigned int result;
arg1 = (LLVMTargetDataRef)jarg1;
result = (unsigned int)LLVMPointerSize(arg1);
jresult = result;
return jresult;
}
DllExport void * SWIGSTDCALL Ada_LLVMIntPtrType (
void * jarg1
)
{
void * jresult ;
LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
LLVMTypeRef result;
arg1 = (LLVMTargetDataRef)jarg1;
result = (LLVMTypeRef)LLVMIntPtrType(arg1);
jresult = (void *) result;
return jresult;
}
DllExport unsigned long long SWIGSTDCALL Ada_LLVMSizeOfTypeInBits (
void * jarg1
,
void * jarg2
)
{
unsigned long long jresult ;
LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
LLVMTypeRef arg2 = (LLVMTypeRef) 0 ;
unsigned long long result;
arg1 = (LLVMTargetDataRef)jarg1;
arg2 = (LLVMTypeRef)jarg2;
result = (unsigned long long)LLVMSizeOfTypeInBits(arg1,arg2);
jresult = result;
return jresult;
}
DllExport unsigned long long SWIGSTDCALL Ada_LLVMStoreSizeOfType (
void * jarg1
,
void * jarg2
)
{
unsigned long long jresult ;
LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
LLVMTypeRef arg2 = (LLVMTypeRef) 0 ;
unsigned long long result;
arg1 = (LLVMTargetDataRef)jarg1;
arg2 = (LLVMTypeRef)jarg2;
result = (unsigned long long)LLVMStoreSizeOfType(arg1,arg2);
jresult = result;
return jresult;
}
DllExport unsigned long long SWIGSTDCALL Ada_LLVMABISizeOfType (
void * jarg1
,
void * jarg2
)
{
unsigned long long jresult ;
LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
LLVMTypeRef arg2 = (LLVMTypeRef) 0 ;
unsigned long long result;
arg1 = (LLVMTargetDataRef)jarg1;
arg2 = (LLVMTypeRef)jarg2;
result = (unsigned long long)LLVMABISizeOfType(arg1,arg2);
jresult = result;
return jresult;
}
DllExport unsigned int SWIGSTDCALL Ada_LLVMABIAlignmentOfType (
void * jarg1
,
void * jarg2
)
{
unsigned int jresult ;
LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
LLVMTypeRef arg2 = (LLVMTypeRef) 0 ;
unsigned int result;
arg1 = (LLVMTargetDataRef)jarg1;
arg2 = (LLVMTypeRef)jarg2;
result = (unsigned int)LLVMABIAlignmentOfType(arg1,arg2);
jresult = result;
return jresult;
}
DllExport unsigned int SWIGSTDCALL Ada_LLVMCallFrameAlignmentOfType (
void * jarg1
,
void * jarg2
)
{
unsigned int jresult ;
LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
LLVMTypeRef arg2 = (LLVMTypeRef) 0 ;
unsigned int result;
arg1 = (LLVMTargetDataRef)jarg1;
arg2 = (LLVMTypeRef)jarg2;
result = (unsigned int)LLVMCallFrameAlignmentOfType(arg1,arg2);
jresult = result;
return jresult;
}
DllExport unsigned int SWIGSTDCALL Ada_LLVMPreferredAlignmentOfType (
void * jarg1
,
void * jarg2
)
{
unsigned int jresult ;
LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
LLVMTypeRef arg2 = (LLVMTypeRef) 0 ;
unsigned int result;
arg1 = (LLVMTargetDataRef)jarg1;
arg2 = (LLVMTypeRef)jarg2;
result = (unsigned int)LLVMPreferredAlignmentOfType(arg1,arg2);
jresult = result;
return jresult;
}
DllExport unsigned int SWIGSTDCALL Ada_LLVMPreferredAlignmentOfGlobal (
void * jarg1
,
void * jarg2
)
{
unsigned int jresult ;
LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
LLVMValueRef arg2 = (LLVMValueRef) 0 ;
unsigned int result;
arg1 = (LLVMTargetDataRef)jarg1;
arg2 = (LLVMValueRef)jarg2;
result = (unsigned int)LLVMPreferredAlignmentOfGlobal(arg1,arg2);
jresult = result;
return jresult;
}
DllExport unsigned int SWIGSTDCALL Ada_LLVMElementAtOffset (
void * jarg1
,
void * jarg2
,
unsigned long long jarg3
)
{
unsigned int jresult ;
LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
LLVMTypeRef arg2 = (LLVMTypeRef) 0 ;
unsigned long long arg3 ;
unsigned int result;
arg1 = (LLVMTargetDataRef)jarg1;
arg2 = (LLVMTypeRef)jarg2;
arg3 = (unsigned long long) jarg3;
result = (unsigned int)LLVMElementAtOffset(arg1,arg2,arg3);
jresult = result;
return jresult;
}
DllExport unsigned long long SWIGSTDCALL Ada_LLVMOffsetOfElement (
void * jarg1
,
void * jarg2
,
unsigned int jarg3
)
{
unsigned long long jresult ;
LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
LLVMTypeRef arg2 = (LLVMTypeRef) 0 ;
unsigned int arg3 ;
unsigned long long result;
arg1 = (LLVMTargetDataRef)jarg1;
arg2 = (LLVMTypeRef)jarg2;
arg3 = (unsigned int) jarg3;
result = (unsigned long long)LLVMOffsetOfElement(arg1,arg2,arg3);
jresult = result;
return jresult;
}
DllExport void SWIGSTDCALL Ada_LLVMInvalidateStructLayout (
void * jarg1
,
void * jarg2
)
{
LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
LLVMTypeRef arg2 = (LLVMTypeRef) 0 ;
arg1 = (LLVMTargetDataRef)jarg1;
arg2 = (LLVMTypeRef)jarg2;
LLVMInvalidateStructLayout(arg1,arg2);
}
DllExport void SWIGSTDCALL Ada_LLVMDisposeTargetData (
void * jarg1
)
{
LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
arg1 = (LLVMTargetDataRef)jarg1;
LLVMDisposeTargetData(arg1);
}
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,206 @@
-- This file is generated by SWIG. Do *not* modify by hand.
--
with llvm;
package LLVM_Transforms.Binding is
procedure LLVMAddArgumentPromotionPass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddConstantMergePass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddDeadArgEliminationPass
(PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddDeadTypeEliminationPass
(PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddFunctionAttrsPass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddFunctionInliningPass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddGlobalDCEPass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddGlobalOptimizerPass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddIPConstantPropagationPass
(PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddLowerSetJmpPass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddPruneEHPass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddRaiseAllocationsPass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddStripDeadPrototypesPass
(PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddStripSymbolsPass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddAggressiveDCEPass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddCFGSimplificationPass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddCondPropagationPass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddDeadStoreEliminationPass
(PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddGVNPass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddIndVarSimplifyPass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddInstructionCombiningPass
(PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddJumpThreadingPass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddLICMPass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddLoopDeletionPass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddLoopIndexSplitPass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddLoopRotatePass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddLoopUnrollPass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddLoopUnswitchPass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddMemCpyOptPass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddPromoteMemoryToRegisterPass
(PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddReassociatePass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddSCCPPass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddScalarReplAggregatesPass
(PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddSimplifyLibCallsPass (PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddTailCallEliminationPass
(PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddConstantPropagationPass
(PM : in llvm.LLVMPassManagerRef);
procedure LLVMAddDemoteMemoryToRegisterPass
(PM : in llvm.LLVMPassManagerRef);
private
pragma Import
(C,
LLVMAddArgumentPromotionPass,
"Ada_LLVMAddArgumentPromotionPass");
pragma Import
(C,
LLVMAddConstantMergePass,
"Ada_LLVMAddConstantMergePass");
pragma Import
(C,
LLVMAddDeadArgEliminationPass,
"Ada_LLVMAddDeadArgEliminationPass");
pragma Import
(C,
LLVMAddDeadTypeEliminationPass,
"Ada_LLVMAddDeadTypeEliminationPass");
pragma Import
(C,
LLVMAddFunctionAttrsPass,
"Ada_LLVMAddFunctionAttrsPass");
pragma Import
(C,
LLVMAddFunctionInliningPass,
"Ada_LLVMAddFunctionInliningPass");
pragma Import (C, LLVMAddGlobalDCEPass, "Ada_LLVMAddGlobalDCEPass");
pragma Import
(C,
LLVMAddGlobalOptimizerPass,
"Ada_LLVMAddGlobalOptimizerPass");
pragma Import
(C,
LLVMAddIPConstantPropagationPass,
"Ada_LLVMAddIPConstantPropagationPass");
pragma Import (C, LLVMAddLowerSetJmpPass, "Ada_LLVMAddLowerSetJmpPass");
pragma Import (C, LLVMAddPruneEHPass, "Ada_LLVMAddPruneEHPass");
pragma Import
(C,
LLVMAddRaiseAllocationsPass,
"Ada_LLVMAddRaiseAllocationsPass");
pragma Import
(C,
LLVMAddStripDeadPrototypesPass,
"Ada_LLVMAddStripDeadPrototypesPass");
pragma Import (C, LLVMAddStripSymbolsPass, "Ada_LLVMAddStripSymbolsPass");
pragma Import
(C,
LLVMAddAggressiveDCEPass,
"Ada_LLVMAddAggressiveDCEPass");
pragma Import
(C,
LLVMAddCFGSimplificationPass,
"Ada_LLVMAddCFGSimplificationPass");
pragma Import
(C,
LLVMAddCondPropagationPass,
"Ada_LLVMAddCondPropagationPass");
pragma Import
(C,
LLVMAddDeadStoreEliminationPass,
"Ada_LLVMAddDeadStoreEliminationPass");
pragma Import (C, LLVMAddGVNPass, "Ada_LLVMAddGVNPass");
pragma Import
(C,
LLVMAddIndVarSimplifyPass,
"Ada_LLVMAddIndVarSimplifyPass");
pragma Import
(C,
LLVMAddInstructionCombiningPass,
"Ada_LLVMAddInstructionCombiningPass");
pragma Import
(C,
LLVMAddJumpThreadingPass,
"Ada_LLVMAddJumpThreadingPass");
pragma Import (C, LLVMAddLICMPass, "Ada_LLVMAddLICMPass");
pragma Import (C, LLVMAddLoopDeletionPass, "Ada_LLVMAddLoopDeletionPass");
pragma Import
(C,
LLVMAddLoopIndexSplitPass,
"Ada_LLVMAddLoopIndexSplitPass");
pragma Import (C, LLVMAddLoopRotatePass, "Ada_LLVMAddLoopRotatePass");
pragma Import (C, LLVMAddLoopUnrollPass, "Ada_LLVMAddLoopUnrollPass");
pragma Import (C, LLVMAddLoopUnswitchPass, "Ada_LLVMAddLoopUnswitchPass");
pragma Import (C, LLVMAddMemCpyOptPass, "Ada_LLVMAddMemCpyOptPass");
pragma Import
(C,
LLVMAddPromoteMemoryToRegisterPass,
"Ada_LLVMAddPromoteMemoryToRegisterPass");
pragma Import (C, LLVMAddReassociatePass, "Ada_LLVMAddReassociatePass");
pragma Import (C, LLVMAddSCCPPass, "Ada_LLVMAddSCCPPass");
pragma Import
(C,
LLVMAddScalarReplAggregatesPass,
"Ada_LLVMAddScalarReplAggregatesPass");
pragma Import
(C,
LLVMAddSimplifyLibCallsPass,
"Ada_LLVMAddSimplifyLibCallsPass");
pragma Import
(C,
LLVMAddTailCallEliminationPass,
"Ada_LLVMAddTailCallEliminationPass");
pragma Import
(C,
LLVMAddConstantPropagationPass,
"Ada_LLVMAddConstantPropagationPass");
pragma Import
(C,
LLVMAddDemoteMemoryToRegisterPass,
"Ada_LLVMAddDemoteMemoryToRegisterPass");
end LLVM_Transforms.Binding;

View file

@ -0,0 +1,6 @@
-- This file is generated by SWIG. Do *not* modify by hand.
--
package LLVM_Transforms is
end LLVM_Transforms;

View file

@ -0,0 +1,828 @@
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.36
*
* This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make
* changes to this file unless you know what you are doing--modify the SWIG
* interface file instead.
* ----------------------------------------------------------------------------- */
#ifdef __cplusplus
template<typename T> class SwigValueWrapper {
T *tt;
public:
SwigValueWrapper() : tt(0) { }
SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
SwigValueWrapper(const T& t) : tt(new T(t)) { }
~SwigValueWrapper() { delete tt; }
SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
operator T&() const { return *tt; }
T *operator&() { return tt; }
private:
SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
};
template <typename T> T SwigValueInit() {
return T();
}
#endif
/* -----------------------------------------------------------------------------
* This section contains generic SWIG labels for method/variable
* declarations/attributes, and other compiler dependent labels.
* ----------------------------------------------------------------------------- */
/* template workaround for compilers that cannot correctly implement the C++ standard */
#ifndef SWIGTEMPLATEDISAMBIGUATOR
# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
# define SWIGTEMPLATEDISAMBIGUATOR template
# elif defined(__HP_aCC)
/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
# define SWIGTEMPLATEDISAMBIGUATOR template
# else
# define SWIGTEMPLATEDISAMBIGUATOR
# endif
#endif
/* inline attribute */
#ifndef SWIGINLINE
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
# define SWIGINLINE inline
# else
# define SWIGINLINE
# endif
#endif
/* attribute recognised by some compilers to avoid 'unused' warnings */
#ifndef SWIGUNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
# elif defined(__ICC)
# define SWIGUNUSED __attribute__ ((__unused__))
# else
# define SWIGUNUSED
# endif
#endif
#ifndef SWIGUNUSEDPARM
# ifdef __cplusplus
# define SWIGUNUSEDPARM(p)
# else
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
# endif
#endif
/* internal SWIG method */
#ifndef SWIGINTERN
# define SWIGINTERN static SWIGUNUSED
#endif
/* internal inline SWIG method */
#ifndef SWIGINTERNINLINE
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
#endif
/* exporting methods */
#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
# ifndef GCC_HASCLASSVISIBILITY
# define GCC_HASCLASSVISIBILITY
# endif
#endif
#ifndef SWIGEXPORT
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# if defined(STATIC_LINKED)
# define SWIGEXPORT
# else
# define SWIGEXPORT __declspec(dllexport)
# endif
# else
# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
# define SWIGEXPORT __attribute__ ((visibility("default")))
# else
# define SWIGEXPORT
# endif
# endif
#endif
/* calling conventions for Windows */
#ifndef SWIGSTDCALL
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
# define SWIGSTDCALL __stdcall
# else
# define SWIGSTDCALL
# endif
#endif
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE
#endif
/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
# define _SCL_SECURE_NO_DEPRECATE
#endif
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#if defined(_WIN32) || defined(__CYGWIN32__)
# define DllExport __declspec( dllexport )
# define SWIGSTDCALL __stdcall
#else
# define DllExport
# define SWIGSTDCALL
#endif
#ifdef __cplusplus
# include <new>
#endif
/* Support for throwing Ada exceptions from C/C++ */
typedef enum
{
SWIG_AdaException,
SWIG_AdaOutOfMemoryException,
SWIG_AdaIndexOutOfRangeException,
SWIG_AdaDivideByZeroException,
SWIG_AdaArgumentOutOfRangeException,
SWIG_AdaNullReferenceException
} SWIG_AdaExceptionCodes;
typedef void (SWIGSTDCALL* SWIG_AdaExceptionCallback_t)(const char *);
typedef struct
{
SWIG_AdaExceptionCodes code;
SWIG_AdaExceptionCallback_t callback;
}
SWIG_AdaExceptions_t;
static
SWIG_AdaExceptions_t
SWIG_ada_exceptions[] =
{
{ SWIG_AdaException, NULL },
{ SWIG_AdaOutOfMemoryException, NULL },
{ SWIG_AdaIndexOutOfRangeException, NULL },
{ SWIG_AdaDivideByZeroException, NULL },
{ SWIG_AdaArgumentOutOfRangeException, NULL },
{ SWIG_AdaNullReferenceException, NULL }
};
static
void
SWIG_AdaThrowException (SWIG_AdaExceptionCodes code, const char *msg)
{
SWIG_AdaExceptionCallback_t callback = SWIG_ada_exceptions[SWIG_AdaException].callback;
if (code >=0 && (size_t)code < sizeof(SWIG_ada_exceptions)/sizeof(SWIG_AdaExceptions_t)) {
callback = SWIG_ada_exceptions[code].callback;
}
callback(msg);
}
#ifdef __cplusplus
extern "C"
#endif
DllExport void SWIGSTDCALL SWIGRegisterExceptionCallbacks_LLVM_Transforms (SWIG_AdaExceptionCallback_t systemException,
SWIG_AdaExceptionCallback_t outOfMemory,
SWIG_AdaExceptionCallback_t indexOutOfRange,
SWIG_AdaExceptionCallback_t divideByZero,
SWIG_AdaExceptionCallback_t argumentOutOfRange,
SWIG_AdaExceptionCallback_t nullReference)
{
SWIG_ada_exceptions [SWIG_AdaException].callback = systemException;
SWIG_ada_exceptions [SWIG_AdaOutOfMemoryException].callback = outOfMemory;
SWIG_ada_exceptions [SWIG_AdaIndexOutOfRangeException].callback = indexOutOfRange;
SWIG_ada_exceptions [SWIG_AdaDivideByZeroException].callback = divideByZero;
SWIG_ada_exceptions [SWIG_AdaArgumentOutOfRangeException].callback = argumentOutOfRange;
SWIG_ada_exceptions [SWIG_AdaNullReferenceException].callback = nullReference;
}
/* Callback for returning strings to Ada without leaking memory */
typedef char * (SWIGSTDCALL* SWIG_AdaStringHelperCallback)(const char *);
static SWIG_AdaStringHelperCallback SWIG_ada_string_callback = NULL;
/* probably obsolete ...
#ifdef __cplusplus
extern "C"
#endif
DllExport void SWIGSTDCALL SWIGRegisterStringCallback_LLVM_Transforms(SWIG_AdaStringHelperCallback callback) {
SWIG_ada_string_callback = callback;
}
*/
/* Contract support */
#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_AdaThrowException(SWIG_AdaArgumentOutOfRangeException, msg); return nullreturn; } else
#define protected public
#define private public
#include "llvm-c/Transforms/IPO.h"
#include "llvm-c/Transforms/Scalar.h"
// struct LLVMCtxt;
#undef protected
#undef private
#ifdef __cplusplus
extern "C" {
#endif
DllExport void SWIGSTDCALL Ada_LLVMAddArgumentPromotionPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddArgumentPromotionPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddConstantMergePass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddConstantMergePass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddDeadArgEliminationPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddDeadArgEliminationPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddDeadTypeEliminationPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddDeadTypeEliminationPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddFunctionAttrsPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddFunctionAttrsPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddFunctionInliningPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddFunctionInliningPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddGlobalDCEPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddGlobalDCEPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddGlobalOptimizerPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddGlobalOptimizerPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddIPConstantPropagationPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddIPConstantPropagationPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddLowerSetJmpPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddLowerSetJmpPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddPruneEHPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddPruneEHPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddRaiseAllocationsPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddRaiseAllocationsPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddStripDeadPrototypesPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddStripDeadPrototypesPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddStripSymbolsPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddStripSymbolsPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddAggressiveDCEPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddAggressiveDCEPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddCFGSimplificationPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddCFGSimplificationPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddCondPropagationPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddCondPropagationPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddDeadStoreEliminationPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddDeadStoreEliminationPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddGVNPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddGVNPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddIndVarSimplifyPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddIndVarSimplifyPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddInstructionCombiningPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddInstructionCombiningPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddJumpThreadingPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddJumpThreadingPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddLICMPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddLICMPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddLoopDeletionPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddLoopDeletionPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddLoopIndexSplitPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddLoopIndexSplitPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddLoopRotatePass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddLoopRotatePass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddLoopUnrollPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddLoopUnrollPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddLoopUnswitchPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddLoopUnswitchPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddMemCpyOptPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddMemCpyOptPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddPromoteMemoryToRegisterPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddPromoteMemoryToRegisterPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddReassociatePass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddReassociatePass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddSCCPPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddSCCPPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddScalarReplAggregatesPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddScalarReplAggregatesPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddSimplifyLibCallsPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddSimplifyLibCallsPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddTailCallEliminationPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddTailCallEliminationPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddConstantPropagationPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddConstantPropagationPass(arg1);
}
DllExport void SWIGSTDCALL Ada_LLVMAddDemoteMemoryToRegisterPass (
void * jarg1
)
{
LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
arg1 = (LLVMPassManagerRef)jarg1;
LLVMAddDemoteMemoryToRegisterPass(arg1);
}
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,19 @@
##===- bindings/ocaml/Makefile -----------------------------*- Makefile -*-===##
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
##===----------------------------------------------------------------------===##
LEVEL := ../..
DIRS = llvm bitreader bitwriter analysis target executionengine transforms
ExtraMakefiles = $(PROJ_OBJ_DIR)/Makefile.ocaml
ocamldoc:
$(Verb) for i in $(DIRS) ; do \
$(MAKE) -C $$i ocamldoc; \
done
include $(LEVEL)/Makefile.common

View file

@ -0,0 +1,410 @@
##===- tools/ml/Makefile -----------------------------------*- Makefile -*-===##
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
##===----------------------------------------------------------------------===##
#
# An ocaml library is a unique project type in the context of LLVM, so rules are
# here rather than in Makefile.rules.
#
# Reference materials on installing ocaml libraries:
#
# https://fedoraproject.org/wiki/Packaging/OCaml
# http://pkg-ocaml-maint.alioth.debian.org/ocaml_packaging_policy.txt
#
##===----------------------------------------------------------------------===##
include $(LEVEL)/Makefile.config
# CFLAGS needs to be set before Makefile.rules is included.
CXX.Flags += -I"$(shell $(OCAMLC) -where)"
C.Flags += -I"$(shell $(OCAMLC) -where)"
include $(LEVEL)/Makefile.common
# Intentionally ignore PROJ_prefix here. We want the ocaml stdlib. However, the
# user can override this with OCAML_LIBDIR or configure --with-ocaml-libdir=.
PROJ_libocamldir := $(DESTDIR)$(OCAML_LIBDIR)
OcamlDir := $(LibDir)/ocaml
# Info from llvm-config and similar
ifndef IS_CLEANING_TARGET
ifdef UsedComponents
UsedLibs = $(shell $(LLVM_CONFIG) --libs $(UsedComponents))
UsedLibNames = $(shell $(LLVM_CONFIG) --libnames $(UsedComponents))
endif
endif
# Tools
OCAMLCFLAGS += -I $(ObjDir) -I $(OcamlDir)
ifndef IS_CLEANING_TARGET
ifneq ($(ObjectsO),)
OCAMLAFLAGS += $(patsubst %,-cclib %, \
$(filter-out -L$(LibDir),-l$(LIBRARYNAME) \
$(shell $(LLVM_CONFIG) --ldflags)) \
$(UsedLibs))
else
OCAMLAFLAGS += $(patsubst %,-cclib %, \
$(filter-out -L$(LibDir),$(shell $(LLVM_CONFIG) --ldflags)) \
$(UsedLibs))
endif
endif
# -g was introduced in 3.10.0.
#ifneq ($(ENABLE_OPTIMIZED),1)
# OCAMLDEBUGFLAG := -g
#endif
Compile.CMI := $(strip $(OCAMLC) -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o)
Compile.CMO := $(strip $(OCAMLC) -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o)
Archive.CMA := $(strip $(OCAMLC) -a -custom $(OCAMLAFLAGS) $(OCAMLDEBUGFLAG) \
-o)
Compile.CMX := $(strip $(OCAMLOPT) -c $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG) -o)
Archive.CMXA := $(strip $(OCAMLOPT) -a $(OCAMLAFLAGS) $(OCAMLDEBUGFLAG) -o)
ifdef OCAMLOPT
Archive.EXE := $(strip $(OCAMLOPT) -cc $(CXX) $(OCAMLCFLAGS) $(UsedOcamLibs:%=%.cmxa) $(OCAMLDEBUGFLAG) -o)
else
Archive.EXE := $(strip $(OCAMLC) -cc $(CXX) $(OCAMLCFLAGS) $(OCAMLDEBUGFLAG:%=%.cma) -o)
endif
# Source files
OcamlSources1 := $(sort $(wildcard $(PROJ_SRC_DIR)/*.ml))
OcamlHeaders1 := $(sort $(wildcard $(PROJ_SRC_DIR)/*.mli))
OcamlSources2 := $(filter-out $(ExcludeSources),$(OcamlSources1))
OcamlHeaders2 := $(filter-out $(ExcludeHeaders),$(OcamlHeaders1))
OcamlSources := $(OcamlSources2:$(PROJ_SRC_DIR)/%=$(ObjDir)/%)
OcamlHeaders := $(OcamlHeaders2:$(PROJ_SRC_DIR)/%=$(ObjDir)/%)
# Intermediate files
ObjectsCMI := $(OcamlSources:%.ml=%.cmi)
ObjectsCMO := $(OcamlSources:%.ml=%.cmo)
ObjectsCMX := $(OcamlSources:%.ml=%.cmx)
ifdef LIBRARYNAME
LibraryCMA := $(ObjDir)/$(LIBRARYNAME).cma
LibraryCMXA := $(ObjDir)/$(LIBRARYNAME).cmxa
endif
ifdef TOOLNAME
ToolEXE := $(ObjDir)/$(TOOLNAME)$(EXEEXT)
endif
# Output files
# The .cmo files are the only intermediates; all others are to be installed.
OutputsCMI := $(ObjectsCMI:$(ObjDir)/%.cmi=$(OcamlDir)/%.cmi)
OutputsCMX := $(ObjectsCMX:$(ObjDir)/%.cmx=$(OcamlDir)/%.cmx)
OutputLibs := $(UsedLibNames:%=$(OcamlDir)/%)
ifdef LIBRARYNAME
LibraryA := $(OcamlDir)/lib$(LIBRARYNAME).a
OutputCMA := $(LibraryCMA:$(ObjDir)/%.cma=$(OcamlDir)/%.cma)
OutputCMXA := $(LibraryCMXA:$(ObjDir)/%.cmxa=$(OcamlDir)/%.cmxa)
endif
ifdef TOOLNAME
ifdef EXAMPLE_TOOL
OutputEXE := $(ExmplDir)/$(strip $(TOOLNAME))$(EXEEXT)
else
OutputEXE := $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT)
endif
endif
# Installation targets
DestLibs := $(UsedLibNames:%=$(PROJ_libocamldir)/%)
ifdef LIBRARYNAME
DestA := $(PROJ_libocamldir)/lib$(LIBRARYNAME).a
DestCMA := $(PROJ_libocamldir)/$(LIBRARYNAME).cma
DestCMXA := $(PROJ_libocamldir)/$(LIBRARYNAME).cmxa
endif
##===- Dependencies -------------------------------------------------------===##
# Copy the sources into the intermediate directory because older ocamlc doesn't
# support -o except when linking (outputs are placed next to inputs).
$(ObjDir)/%.mli: $(PROJ_SRC_DIR)/%.mli $(ObjDir)/.dir
$(Verb) $(CP) -f $< $@
$(ObjDir)/%.ml: $(PROJ_SRC_DIR)/%.ml $(ObjDir)/.dir
$(Verb) $(CP) -f $< $@
$(ObjectsCMI): $(UsedOcamlInterfaces:%=$(OcamlDir)/%.cmi)
ifdef LIBRARYNAME
$(ObjDir)/$(LIBRARYNAME).ocamldep: $(OcamlSources) $(OcamlHeaders) \
$(OcamlDir)/.dir $(ObjDir)/.dir
$(Verb) $(OCAMLDEP) $(OCAMLCFLAGS) $(OcamlSources) $(OcamlHeaders) > $@
-include $(ObjDir)/$(LIBRARYNAME).ocamldep
endif
ifdef TOOLNAME
$(ObjDir)/$(TOOLNAME).ocamldep: $(OcamlSources) $(OcamlHeaders) \
$(OcamlDir)/.dir $(ObjDir)/.dir
$(Verb) $(OCAMLDEP) $(OCAMLCFLAGS) $(OcamlSources) $(OcamlHeaders) > $@
-include $(ObjDir)/$(TOOLNAME).ocamldep
endif
##===- Build static library from C sources --------------------------------===##
ifdef LibraryA
all-local:: $(LibraryA)
clean-local:: clean-a
install-local:: install-a
uninstall-local:: uninstall-a
$(LibraryA): $(ObjectsO) $(OcamlDir)/.dir
$(Echo) "Building $(BuildMode) $(notdir $@)"
-$(Verb) $(RM) -f $@
$(Verb) $(Archive) $@ $(ObjectsO)
$(Verb) $(Ranlib) $@
clean-a::
-$(Verb) $(RM) -f $(LibraryA)
install-a:: $(LibraryA)
$(Echo) "Installing $(BuildMode) $(DestA)"
$(Verb) $(MKDIR) $(PROJ_libocamldir)
$(Verb) $(INSTALL) $(LibraryA) $(DestA)
$(Verb)
uninstall-a::
$(Echo) "Uninstalling $(DestA)"
-$(Verb) $(RM) -f $(DestA)
endif
##===- Deposit dependent libraries adjacent to Ocaml libs -----------------===##
all-local:: build-deplibs
clean-local:: clean-deplibs
install-local:: install-deplibs
uninstall-local:: uninstall-deplibs
build-deplibs: $(OutputLibs)
$(OcamlDir)/%.a: $(LibDir)/%.a
$(Verb) ln -sf $< $@
$(OcamlDir)/%.o: $(LibDir)/%.o
$(Verb) ln -sf $< $@
clean-deplibs:
$(Verb) $(RM) -f $(OutputLibs)
install-deplibs:
$(Verb) $(MKDIR) $(PROJ_libocamldir)
$(Verb) for i in $(DestLibs:$(PROJ_libocamldir)/%=%); do \
ln -sf "$(PROJ_libdir)/$$i" "$(PROJ_libocamldir)/$$i"; \
done
uninstall-deplibs:
$(Verb) $(RM) -f $(DestLibs)
##===- Build ocaml interfaces (.mli's -> .cmi's) --------------------------===##
ifneq ($(OcamlHeaders),)
all-local:: build-cmis
clean-local:: clean-cmis
install-local:: install-cmis
uninstall-local:: uninstall-cmis
build-cmis: $(OutputsCMI)
$(OcamlDir)/%.cmi: $(ObjDir)/%.cmi $(OcamlDir)/.dir
$(Verb) $(CP) -f $< $@
$(ObjDir)/%.cmi: $(ObjDir)/%.mli $(ObjDir)/.dir
$(Echo) "Compiling $(notdir $<) for $(BuildMode) build"
$(Verb) $(Compile.CMI) $@ $<
clean-cmis::
-$(Verb) $(RM) -f $(OutputsCMI)
# Also install the .mli's (headers) as documentation.
install-cmis: $(OutputsCMI) $(OcamlHeaders)
$(Verb) $(MKDIR) $(PROJ_libocamldir)
$(Verb) for i in $(OutputsCMI:$(OcamlDir)/%=%); do \
$(EchoCmd) "Installing $(BuildMode) $(PROJ_libocamldir)/$$i"; \
$(DataInstall) $(OcamlDir)/$$i "$(PROJ_libocamldir)/$$i"; \
done
$(Verb) for i in $(OcamlHeaders:$(ObjDir)/%=%); do \
$(EchoCmd) "Installing $(BuildMode) $(PROJ_libocamldir)/$$i"; \
$(DataInstall) $(ObjDir)/$$i "$(PROJ_libocamldir)/$$i"; \
done
uninstall-cmis::
$(Verb) for i in $(OutputsCMI:$(OcamlDir)/%=%); do \
$(EchoCmd) "Uninstalling $(PROJ_libocamldir)/$$i"; \
$(RM) -f "$(PROJ_libocamldir)/$$i"; \
done
$(Verb) for i in $(OcamlHeaders:$(ObjDir)/%=%); do \
$(EchoCmd) "Uninstalling $(PROJ_libocamldir)/$$i"; \
$(RM) -f "$(PROJ_libocamldir)/$$i"; \
done
endif
##===- Build ocaml bytecode archive (.ml's -> .cmo's -> .cma) -------------===##
$(ObjDir)/%.cmo: $(ObjDir)/%.ml
$(Echo) "Compiling $(notdir $<) for $(BuildMode) build"
$(Verb) $(Compile.CMO) $@ $<
ifdef LIBRARYNAME
all-local:: $(OutputCMA)
clean-local:: clean-cma
install-local:: install-cma
uninstall-local:: uninstall-cma
$(OutputCMA): $(LibraryCMA) $(OcamlDir)/.dir
$(Verb) $(CP) -f $< $@
$(LibraryCMA): $(ObjectsCMO) $(OcamlDir)/.dir
$(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
$(Verb) $(Archive.CMA) $@ $(ObjectsCMO)
clean-cma::
$(Verb) $(RM) -f $(OutputCMA) $(UsedLibNames:%=$(OcamlDir)/%)
install-cma:: $(OutputCMA)
$(Echo) "Installing $(BuildMode) $(DestCMA)"
$(Verb) $(MKDIR) $(PROJ_libocamldir)
$(Verb) $(DataInstall) $(OutputCMA) "$(DestCMA)"
uninstall-cma::
$(Echo) "Uninstalling $(DestCMA)"
-$(Verb) $(RM) -f $(DestCMA)
endif
##===- Build optimized ocaml archive (.ml's -> .cmx's -> .cmxa, .a) -------===##
# The ocamlopt compiler is supported on a set of targets disjoint from LLVM's.
# If unavailable, 'configure' will not define OCAMLOPT in Makefile.config.
ifdef OCAMLOPT
$(OcamlDir)/%.cmx: $(ObjDir)/%.cmx
$(Verb) $(CP) -f $< $@
$(ObjDir)/%.cmx: $(ObjDir)/%.ml
$(Echo) "Compiling optimized $(notdir $<) for $(BuildMode) build"
$(Verb) $(Compile.CMX) $@ $<
ifdef LIBRARYNAME
all-local:: $(OutputCMXA) $(OutputsCMX)
clean-local:: clean-cmxa
install-local:: install-cmxa
uninstall-local:: uninstall-cmxa
$(OutputCMXA): $(LibraryCMXA)
$(Verb) $(CP) -f $< $@
$(Verb) $(CP) -f $(<:.cmxa=.a) $(@:.cmxa=.a)
$(LibraryCMXA): $(ObjectsCMX)
$(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
$(Verb) $(Archive.CMXA) $@ $(ObjectsCMX)
$(Verb) $(RM) -f $(@:.cmxa=.o)
clean-cmxa::
$(Verb) $(RM) -f $(OutputCMXA) $(OutputCMXA:.cmxa=.a) $(OutputsCMX)
install-cmxa:: $(OutputCMXA) $(OutputsCMX)
$(Verb) $(MKDIR) $(PROJ_libocamldir)
$(Echo) "Installing $(BuildMode) $(DestCMXA)"
$(Verb) $(DataInstall) $(OutputCMXA) $(DestCMXA)
$(Echo) "Installing $(BuildMode) $(DestCMXA:.cmxa=.a)"
$(Verb) $(DataInstall) $(OutputCMXA:.cmxa=.a) $(DestCMXA:.cmxa=.a)
$(Verb) for i in $(OutputsCMX:$(OcamlDir)/%=%); do \
$(EchoCmd) "Installing $(BuildMode) $(PROJ_libocamldir)/$$i"; \
$(DataInstall) $(OcamlDir)/$$i "$(PROJ_libocamldir)/$$i"; \
done
uninstall-cmxa::
$(Echo) "Uninstalling $(DestCMXA)"
$(Verb) $(RM) -f $(DestCMXA)
$(Echo) "Uninstalling $(DestCMXA:.cmxa=.a)"
$(Verb) $(RM) -f $(DestCMXA:.cmxa=.a)
$(Verb) for i in $(OutputsCMX:$(OcamlDir)/%=%); do \
$(EchoCmd) "Uninstalling $(PROJ_libocamldir)/$$i"; \
$(RM) -f $(PROJ_libocamldir)/$$i; \
done
endif
endif
##===- Build executables --------------------------------------------------===##
ifdef TOOLNAME
all-local:: $(OutputEXE)
clean-local:: clean-exe
$(OutputEXE): $(ToolEXE) $(OcamlDir)/.dir
$(Verb) $(CP) -f $< $@
ifndef OCAMLOPT
$(ToolEXE): $(ObjectsCMO) $(OcamlDir)/.dir
$(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
$(Verb) $(Archive.EXE) $@ $<
else
$(ToolEXE): $(ObjectsCMX) $(OcamlDir)/.dir
$(Echo) "Archiving $(notdir $@) for $(BuildMode) build"
$(Verb) $(Archive.EXE) $@ $<
endif
endif
##===- Generate documentation ---------------------------------------------===##
$(ObjDir)/$(LIBRARYNAME).odoc: $(ObjectsCMI)
$(Echo) "Documenting $(notdir $@)"
$(Verb) $(OCAMLDOC) -I $(ObjDir) -I $(OcamlDir) -dump $@ $(OcamlHeaders)
ocamldoc: $(ObjDir)/$(LIBRARYNAME).odoc
##===- Debugging gunk -----------------------------------------------------===##
printvars:: printcamlvars
printcamlvars::
$(Echo) "LLVM_CONFIG : " '$(LLVM_CONFIG)'
$(Echo) "OCAMLCFLAGS : " '$(OCAMLCFLAGS)'
$(Echo) "OCAMLAFLAGS : " '$(OCAMLAFLAGS)'
$(Echo) "OCAMLC : " '$(OCAMLC)'
$(Echo) "OCAMLOPT : " '$(OCAMLOPT)'
$(Echo) "OCAMLDEP : " '$(OCAMLDEP)'
$(Echo) "Compile.CMI : " '$(Compile.CMI)'
$(Echo) "Compile.CMO : " '$(Compile.CMO)'
$(Echo) "Archive.CMA : " '$(Archive.CMA)'
$(Echo) "Compile.CMX : " '$(Compile.CMX)'
$(Echo) "Archive.CMXA : " '$(Archive.CMXA)'
$(Echo) "CAML_LIBDIR : " '$(CAML_LIBDIR)'
$(Echo) "LibraryCMA : " '$(LibraryCMA)'
$(Echo) "LibraryCMXA : " '$(LibraryCMXA)'
$(Echo) "OcamlSources1: " '$(OcamlSources1)'
$(Echo) "OcamlSources2: " '$(OcamlSources2)'
$(Echo) "OcamlSources : " '$(OcamlSources)'
$(Echo) "OcamlHeaders1: " '$(OcamlHeaders1)'
$(Echo) "OcamlHeaders2: " '$(OcamlHeaders2)'
$(Echo) "OcamlHeaders : " '$(OcamlHeaders)'
$(Echo) "ObjectsCMI : " '$(ObjectsCMI)'
$(Echo) "ObjectsCMO : " '$(ObjectsCMO)'
$(Echo) "ObjectsCMX : " '$(ObjectsCMX)'
$(Echo) "OCAML_LIBDIR : " '$(OCAML_LIBDIR)'
$(Echo) "DestA : " '$(DestA)'
$(Echo) "DestCMA : " '$(DestCMA)'
$(Echo) "DestCMXA : " '$(DestCMXA)'
$(Echo) "UsedLibs : " '$(UsedLibs)'
$(Echo) "UsedLibNames : " '$(UsedLibNames)'
.PHONY: printcamlvars build-cmis \
clean-a clean-cmis clean-cma clean-cmxa \
install-a install-cmis install-cma install-cmxa \
install-exe \
uninstall-a uninstall-cmis uninstall-cma uninstall-cmxa \
uninstall-exe

View file

@ -0,0 +1,19 @@
##===- bindings/ocaml/analysis/Makefile --------------------*- Makefile -*-===##
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
##===----------------------------------------------------------------------===##
#
# This is the makefile for the Objective Caml Llvm_analysis interface.
#
##===----------------------------------------------------------------------===##
LEVEL := ../../..
LIBRARYNAME := llvm_analysis
UsedComponents := analysis
UsedOcamlInterfaces := llvm
include ../Makefile.ocaml

View file

@ -0,0 +1,72 @@
/*===-- analysis_ocaml.c - LLVM Ocaml Glue ----------------------*- C++ -*-===*\
|* *|
|* The LLVM Compiler Infrastructure *|
|* *|
|* This file is distributed under the University of Illinois Open Source *|
|* License. See LICENSE.TXT for details. *|
|* *|
|*===----------------------------------------------------------------------===*|
|* *|
|* This file glues LLVM's ocaml interface to its C interface. These functions *|
|* are by and large transparent wrappers to the corresponding C functions. *|
|* *|
|* Note that these functions intentionally take liberties with the CAMLparamX *|
|* macros, since most of the parameters are not GC heap objects. *|
|* *|
\*===----------------------------------------------------------------------===*/
#include "llvm-c/Analysis.h"
#include "caml/alloc.h"
#include "caml/mlvalues.h"
#include "caml/memory.h"
/* Llvm.llmodule -> string option */
CAMLprim value llvm_verify_module(LLVMModuleRef M) {
CAMLparam0();
CAMLlocal2(String, Option);
char *Message;
int Result = LLVMVerifyModule(M, LLVMReturnStatusAction, &Message);
if (0 == Result) {
Option = Val_int(0);
} else {
Option = alloc(1, 0);
String = copy_string(Message);
Store_field(Option, 0, String);
}
LLVMDisposeMessage(Message);
CAMLreturn(Option);
}
/* Llvm.llvalue -> bool */
CAMLprim value llvm_verify_function(LLVMValueRef Fn) {
return Val_bool(LLVMVerifyFunction(Fn, LLVMReturnStatusAction) == 0);
}
/* Llvm.llmodule -> unit */
CAMLprim value llvm_assert_valid_module(LLVMModuleRef M) {
LLVMVerifyModule(M, LLVMAbortProcessAction, 0);
return Val_unit;
}
/* Llvm.llvalue -> unit */
CAMLprim value llvm_assert_valid_function(LLVMValueRef Fn) {
LLVMVerifyFunction(Fn, LLVMAbortProcessAction);
return Val_unit;
}
/* Llvm.llvalue -> unit */
CAMLprim value llvm_view_function_cfg(LLVMValueRef Fn) {
LLVMViewFunctionCFG(Fn);
return Val_unit;
}
/* Llvm.llvalue -> unit */
CAMLprim value llvm_view_function_cfg_only(LLVMValueRef Fn) {
LLVMViewFunctionCFGOnly(Fn);
return Val_unit;
}

View file

@ -0,0 +1,22 @@
(*===-- llvm_analysis.ml - LLVM Ocaml Interface -----------------*- C++ -*-===*
*
* The LLVM Compiler Infrastructure
*
* This file is distributed under the University of Illinois Open Source
* License. See LICENSE.TXT for details.
*
*===----------------------------------------------------------------------===*)
external verify_module : Llvm.llmodule -> string option = "llvm_verify_module"
external verify_function : Llvm.llvalue -> bool = "llvm_verify_function"
external assert_valid_module : Llvm.llmodule -> unit
= "llvm_assert_valid_module"
external assert_valid_function : Llvm.llvalue -> unit
= "llvm_assert_valid_function"
external view_function_cfg : Llvm.llvalue -> unit = "llvm_view_function_cfg"
external view_function_cfg_only : Llvm.llvalue -> unit
= "llvm_view_function_cfg_only"

View file

@ -0,0 +1,46 @@
(*===-- llvm_analysis.mli - LLVM Ocaml Interface ----------------*- C++ -*-===*
*
* The LLVM Compiler Infrastructure
*
* This file is distributed under the University of Illinois Open Source
* License. See LICENSE.TXT for details.
*
*===----------------------------------------------------------------------===*)
(** Intermediate representation analysis.
This interface provides an ocaml API for LLVM IR analyses, the classes in
the Analysis library. *)
(** [verify_module m] returns [None] if the module [m] is valid, and
[Some reason] if it is invalid. [reason] is a string containing a
human-readable validation report. See [llvm::verifyModule]. *)
external verify_module : Llvm.llmodule -> string option = "llvm_verify_module"
(** [verify_function f] returns [None] if the function [f] is valid, and
[Some reason] if it is invalid. [reason] is a string containing a
human-readable validation report. See [llvm::verifyFunction]. *)
external verify_function : Llvm.llvalue -> bool = "llvm_verify_function"
(** [verify_module m] returns if the module [m] is valid, but prints a
validation report to [stderr] and aborts the program if it is invalid. See
[llvm::verifyModule]. *)
external assert_valid_module : Llvm.llmodule -> unit
= "llvm_assert_valid_module"
(** [verify_function f] returns if the function [f] is valid, but prints a
validation report to [stderr] and aborts the program if it is invalid. See
[llvm::verifyFunction]. *)
external assert_valid_function : Llvm.llvalue -> unit
= "llvm_assert_valid_function"
(** [view_function_cfg f] opens up a ghostscript window displaying the CFG of
the current function with the code for each basic block inside.
See [llvm::Function::viewCFG]. *)
external view_function_cfg : Llvm.llvalue -> unit = "llvm_view_function_cfg"
(** [view_function_cfg_only f] works just like [view_function_cfg], but does not
include the contents of basic blocks into the nodes.
See [llvm::Function::viewCFGOnly]. *)
external view_function_cfg_only : Llvm.llvalue -> unit
= "llvm_view_function_cfg_only"

View file

@ -0,0 +1,19 @@
##===- bindings/ocaml/bitreader/Makefile -------------------*- Makefile -*-===##
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
##===----------------------------------------------------------------------===##
#
# This is the makefile for the Objective Caml Llvm_bitreader interface.
#
##===----------------------------------------------------------------------===##
LEVEL := ../../..
LIBRARYNAME := llvm_bitreader
UsedComponents := bitreader
UsedOcamlInterfaces := llvm
include ../Makefile.ocaml

View file

@ -0,0 +1,73 @@
/*===-- bitwriter_ocaml.c - LLVM Ocaml Glue ---------------------*- C++ -*-===*\
|* *|
|* The LLVM Compiler Infrastructure *|
|* *|
|* This file is distributed under the University of Illinois Open Source *|
|* License. See LICENSE.TXT for details. *|
|* *|
|*===----------------------------------------------------------------------===*|
|* *|
|* This file glues LLVM's ocaml interface to its C interface. These functions *|
|* are by and large transparent wrappers to the corresponding C functions. *|
|* *|
\*===----------------------------------------------------------------------===*/
#include "llvm-c/BitReader.h"
#include "caml/alloc.h"
#include "caml/fail.h"
#include "caml/memory.h"
/* Can't use the recommended caml_named_value mechanism for backwards
compatibility reasons. This is largely equivalent. */
static value llvm_bitreader_error_exn;
CAMLprim value llvm_register_bitreader_exns(value Error) {
llvm_bitreader_error_exn = Field(Error, 0);
register_global_root(&llvm_bitreader_error_exn);
return Val_unit;
}
static void llvm_raise(value Prototype, char *Message) {
CAMLparam1(Prototype);
CAMLlocal1(CamlMessage);
CamlMessage = copy_string(Message);
LLVMDisposeMessage(Message);
raise_with_arg(Prototype, CamlMessage);
abort(); /* NOTREACHED */
#ifdef CAMLnoreturn
CAMLnoreturn; /* Silences warnings, but is missing in some versions. */
#endif
}
/*===-- Modules -----------------------------------------------------------===*/
/* Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule */
CAMLprim value llvm_get_module(LLVMContextRef C, LLVMMemoryBufferRef MemBuf) {
CAMLparam0();
CAMLlocal2(Variant, MessageVal);
char *Message;
LLVMModuleRef M;
if (LLVMGetBitcodeModuleInContext(C, MemBuf, &M, &Message))
llvm_raise(llvm_bitreader_error_exn, Message);
CAMLreturn((value) M);
}
/* Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule */
CAMLprim value llvm_parse_bitcode(LLVMContextRef C,
LLVMMemoryBufferRef MemBuf) {
CAMLparam0();
CAMLlocal2(Variant, MessageVal);
LLVMModuleRef M;
char *Message;
if (LLVMParseBitcodeInContext(C, MemBuf, &M, &Message))
llvm_raise(llvm_bitreader_error_exn, Message);
CAMLreturn((value) M);
}

View file

@ -0,0 +1,20 @@
(*===-- llvm_bitreader.ml - LLVM Ocaml Interface ----------------*- C++ -*-===*
*
* The LLVM Compiler Infrastructure
*
* This file is distributed under the University of Illinois Open Source
* License. See LICENSE.TXT for details.
*
*===----------------------------------------------------------------------===*)
exception Error of string
external register_exns : exn -> unit = "llvm_register_bitreader_exns"
let _ = register_exns (Error "")
external get_module : Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule
= "llvm_get_module"
external parse_bitcode : Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule
= "llvm_parse_bitcode"

View file

@ -0,0 +1,29 @@
(*===-- llvm_bitreader.mli - LLVM Ocaml Interface ---------------*- C++ -*-===*
*
* The LLVM Compiler Infrastructure
*
* This file is distributed under the University of Illinois Open Source
* License. See LICENSE.TXT for details.
*
*===----------------------------------------------------------------------===*)
(** Bitcode reader.
This interface provides an ocaml API for the LLVM bitcode reader, the
classes in the Bitreader library. *)
exception Error of string
(** [get_module context mb] reads the bitcode for a new module [m] from the
memory buffer [mb] in the context [context]. Returns [m] if successful, or
raises [Error msg] otherwise, where [msg] is a description of the error
encountered. See the function [llvm::getBitcodeModule]. *)
external get_module : Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule
= "llvm_get_module"
(** [parse_bitcode context mb] parses the bitcode for a new module [m] from the
memory buffer [mb] in the context [context]. Returns [m] if successful, or
raises [Error msg] otherwise, where [msg] is a description of the error
encountered. See the function [llvm::ParseBitcodeFile]. *)
external parse_bitcode : Llvm.llcontext -> Llvm.llmemorybuffer -> Llvm.llmodule
= "llvm_parse_bitcode"

View file

@ -0,0 +1,19 @@
##===- bindings/ocaml/bitwriter/Makefile -------------------*- Makefile -*-===##
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
##===----------------------------------------------------------------------===##
#
# This is the makefile for the Objective Caml Llvm_bitwriter interface.
#
##===----------------------------------------------------------------------===##
LEVEL := ../../..
LIBRARYNAME := llvm_bitwriter
UsedComponents := bitwriter
UsedOcamlInterfaces := llvm
include ../Makefile.ocaml

View file

@ -0,0 +1,45 @@
/*===-- bitwriter_ocaml.c - LLVM Ocaml Glue ---------------------*- C++ -*-===*\
|* *|
|* The LLVM Compiler Infrastructure *|
|* *|
|* This file is distributed under the University of Illinois Open Source *|
|* License. See LICENSE.TXT for details. *|
|* *|
|*===----------------------------------------------------------------------===*|
|* *|
|* This file glues LLVM's ocaml interface to its C interface. These functions *|
|* are by and large transparent wrappers to the corresponding C functions. *|
|* *|
|* Note that these functions intentionally take liberties with the CAMLparamX *|
|* macros, since most of the parameters are not GC heap objects. *|
|* *|
\*===----------------------------------------------------------------------===*/
#include "llvm-c/BitWriter.h"
#include "llvm-c/Core.h"
#include "caml/alloc.h"
#include "caml/mlvalues.h"
#include "caml/memory.h"
/*===-- Modules -----------------------------------------------------------===*/
/* Llvm.llmodule -> string -> bool */
CAMLprim value llvm_write_bitcode_file(value M, value Path) {
int res = LLVMWriteBitcodeToFile((LLVMModuleRef) M, String_val(Path));
return Val_bool(res == 0);
}
/* ?unbuffered:bool -> Llvm.llmodule -> Unix.file_descr -> bool */
CAMLprim value llvm_write_bitcode_to_fd(value U, value M, value FD) {
int Unbuffered;
int res;
if (U == Val_int(0)) {
Unbuffered = 0;
} else {
Unbuffered = Bool_val(Field(U,0));
}
res = LLVMWriteBitcodeToFD((LLVMModuleRef) M, Int_val(FD), 0, Unbuffered);
return Val_bool(res == 0);
}

View file

@ -0,0 +1,25 @@
(*===-- llvm_bitwriter.ml - LLVM Ocaml Interface ----------------*- C++ -*-===*
*
* The LLVM Compiler Infrastructure
*
* This file is distributed under the University of Illinois Open Source
* License. See LICENSE.TXT for details.
*
*===----------------------------------------------------------------------===
*
* This interface provides an ocaml API for the LLVM intermediate
* representation, the classes in the VMCore library.
*
*===----------------------------------------------------------------------===*)
(* Writes the bitcode for module the given path. Returns true if successful. *)
external write_bitcode_file : Llvm.llmodule -> string -> bool
= "llvm_write_bitcode_file"
external write_bitcode_to_fd : ?unbuffered:bool -> Llvm.llmodule
-> Unix.file_descr -> bool
= "llvm_write_bitcode_to_fd"
let output_bitcode ?unbuffered channel m =
write_bitcode_to_fd ?unbuffered m (Unix.descr_of_out_channel channel)

View file

@ -0,0 +1,30 @@
(*===-- llvm_bitwriter.mli - LLVM Ocaml Interface ---------------*- C++ -*-===*
*
* The LLVM Compiler Infrastructure
*
* This file is distributed under the University of Illinois Open Source
* License. See LICENSE.TXT for details.
*
*===----------------------------------------------------------------------===*)
(** Bitcode writer.
This interface provides an ocaml API for the LLVM bitcode writer, the
classes in the Bitwriter library. *)
(** [write_bitcode_file m path] writes the bitcode for module [m] to the file at
[path]. Returns [true] if successful, [false] otherwise. *)
external write_bitcode_file : Llvm.llmodule -> string -> bool
= "llvm_write_bitcode_file"
(** [write_bitcode_to_fd ~unbuffered fd m] writes the bitcode for module
[m] to the channel [c]. If [unbuffered] is [true], after every write the fd
will be flushed. Returns [true] if successful, [false] otherwise. *)
external write_bitcode_to_fd : ?unbuffered:bool -> Llvm.llmodule
-> Unix.file_descr -> bool
= "llvm_write_bitcode_to_fd"
(** [output_bitcode ~unbuffered c m] writes the bitcode for module [m]
to the channel [c]. If [unbuffered] is [true], after every write the fd
will be flushed. Returns [true] if successful, [false] otherwise. *)
val output_bitcode : ?unbuffered:bool -> out_channel -> Llvm.llmodule -> bool

View file

@ -0,0 +1,19 @@
##===- bindings/ocaml/executionengine/Makefile --------------*- Makefile -*-===##
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
##===----------------------------------------------------------------------===##
#
# This is the makefile for the Objective Caml Llvm_executionengine interface.
#
##===----------------------------------------------------------------------===##
LEVEL := ../../..
LIBRARYNAME := llvm_executionengine
UsedComponents := executionengine jit interpreter native
UsedOcamlInterfaces := llvm llvm_target
include ../Makefile.ocaml

View file

@ -0,0 +1,323 @@
/*===-- executionengine_ocaml.c - LLVM Ocaml Glue ---------------*- C++ -*-===*\
|* *|
|* The LLVM Compiler Infrastructure *|
|* *|
|* This file is distributed under the University of Illinois Open Source *|
|* License. See LICENSE.TXT for details. *|
|* *|
|*===----------------------------------------------------------------------===*|
|* *|
|* This file glues LLVM's ocaml interface to its C interface. These functions *|
|* are by and large transparent wrappers to the corresponding C functions. *|
|* *|
|* Note that these functions intentionally take liberties with the CAMLparamX *|
|* macros, since most of the parameters are not GC heap objects. *|
|* *|
\*===----------------------------------------------------------------------===*/
#include "llvm-c/ExecutionEngine.h"
#include "llvm-c/Target.h"
#include "caml/alloc.h"
#include "caml/custom.h"
#include "caml/fail.h"
#include "caml/memory.h"
#include <string.h>
#include <assert.h>
/* Force the LLVM interpreter and JIT to be linked in. */
void llvm_initialize(void) {
LLVMLinkInInterpreter();
LLVMLinkInJIT();
}
/* unit -> bool */
CAMLprim value llvm_initialize_native_target(value Unit) {
return Val_bool(LLVMInitializeNativeTarget());
}
/* Can't use the recommended caml_named_value mechanism for backwards
compatibility reasons. This is largely equivalent. */
static value llvm_ee_error_exn;
CAMLprim value llvm_register_ee_exns(value Error) {
llvm_ee_error_exn = Field(Error, 0);
register_global_root(&llvm_ee_error_exn);
return Val_unit;
}
static void llvm_raise(value Prototype, char *Message) {
CAMLparam1(Prototype);
CAMLlocal1(CamlMessage);
CamlMessage = copy_string(Message);
LLVMDisposeMessage(Message);
raise_with_arg(Prototype, CamlMessage);
abort(); /* NOTREACHED */
#ifdef CAMLnoreturn
CAMLnoreturn; /* Silences warnings, but is missing in some versions. */
#endif
}
/*--... Operations on generic values .......................................--*/
#define Genericvalue_val(v) (*(LLVMGenericValueRef *)(Data_custom_val(v)))
static void llvm_finalize_generic_value(value GenVal) {
LLVMDisposeGenericValue(Genericvalue_val(GenVal));
}
static struct custom_operations generic_value_ops = {
(char *) "LLVMGenericValue",
llvm_finalize_generic_value,
custom_compare_default,
custom_hash_default,
custom_serialize_default,
custom_deserialize_default
};
static value alloc_generic_value(LLVMGenericValueRef Ref) {
value Val = alloc_custom(&generic_value_ops, sizeof(LLVMGenericValueRef), 0, 1);
Genericvalue_val(Val) = Ref;
return Val;
}
/* Llvm.lltype -> float -> t */
CAMLprim value llvm_genericvalue_of_float(LLVMTypeRef Ty, value N) {
CAMLparam1(N);
CAMLreturn(alloc_generic_value(
LLVMCreateGenericValueOfFloat(Ty, Double_val(N))));
}
/* 'a -> t */
CAMLprim value llvm_genericvalue_of_pointer(value V) {
CAMLparam1(V);
CAMLreturn(alloc_generic_value(LLVMCreateGenericValueOfPointer(Op_val(V))));
}
/* Llvm.lltype -> int -> t */
CAMLprim value llvm_genericvalue_of_int(LLVMTypeRef Ty, value Int) {
return alloc_generic_value(LLVMCreateGenericValueOfInt(Ty, Int_val(Int), 1));
}
/* Llvm.lltype -> int32 -> t */
CAMLprim value llvm_genericvalue_of_int32(LLVMTypeRef Ty, value Int32) {
CAMLparam1(Int32);
CAMLreturn(alloc_generic_value(
LLVMCreateGenericValueOfInt(Ty, Int32_val(Int32), 1)));
}
/* Llvm.lltype -> nativeint -> t */
CAMLprim value llvm_genericvalue_of_nativeint(LLVMTypeRef Ty, value NatInt) {
CAMLparam1(NatInt);
CAMLreturn(alloc_generic_value(
LLVMCreateGenericValueOfInt(Ty, Nativeint_val(NatInt), 1)));
}
/* Llvm.lltype -> int64 -> t */
CAMLprim value llvm_genericvalue_of_int64(LLVMTypeRef Ty, value Int64) {
CAMLparam1(Int64);
CAMLreturn(alloc_generic_value(
LLVMCreateGenericValueOfInt(Ty, Int64_val(Int64), 1)));
}
/* Llvm.lltype -> t -> float */
CAMLprim value llvm_genericvalue_as_float(LLVMTypeRef Ty, value GenVal) {
CAMLparam1(GenVal);
CAMLreturn(copy_double(
LLVMGenericValueToFloat(Ty, Genericvalue_val(GenVal))));
}
/* t -> 'a */
CAMLprim value llvm_genericvalue_as_pointer(value GenVal) {
return Val_op(LLVMGenericValueToPointer(Genericvalue_val(GenVal)));
}
/* t -> int */
CAMLprim value llvm_genericvalue_as_int(value GenVal) {
assert(LLVMGenericValueIntWidth(Genericvalue_val(GenVal)) <= 8 * sizeof(value)
&& "Generic value too wide to treat as an int!");
return Val_int(LLVMGenericValueToInt(Genericvalue_val(GenVal), 1));
}
/* t -> int32 */
CAMLprim value llvm_genericvalue_as_int32(value GenVal) {
CAMLparam1(GenVal);
assert(LLVMGenericValueIntWidth(Genericvalue_val(GenVal)) <= 32
&& "Generic value too wide to treat as an int32!");
CAMLreturn(copy_int32(LLVMGenericValueToInt(Genericvalue_val(GenVal), 1)));
}
/* t -> int64 */
CAMLprim value llvm_genericvalue_as_int64(value GenVal) {
CAMLparam1(GenVal);
assert(LLVMGenericValueIntWidth(Genericvalue_val(GenVal)) <= 64
&& "Generic value too wide to treat as an int64!");
CAMLreturn(copy_int64(LLVMGenericValueToInt(Genericvalue_val(GenVal), 1)));
}
/* t -> nativeint */
CAMLprim value llvm_genericvalue_as_nativeint(value GenVal) {
CAMLparam1(GenVal);
assert(LLVMGenericValueIntWidth(Genericvalue_val(GenVal)) <= 8 * sizeof(value)
&& "Generic value too wide to treat as a nativeint!");
CAMLreturn(copy_nativeint(LLVMGenericValueToInt(Genericvalue_val(GenVal),1)));
}
/*--... Operations on execution engines ....................................--*/
/* llmodule -> ExecutionEngine.t */
CAMLprim LLVMExecutionEngineRef llvm_ee_create(LLVMModuleRef M) {
LLVMExecutionEngineRef Interp;
char *Error;
if (LLVMCreateExecutionEngineForModule(&Interp, M, &Error))
llvm_raise(llvm_ee_error_exn, Error);
return Interp;
}
/* llmodule -> ExecutionEngine.t */
CAMLprim LLVMExecutionEngineRef
llvm_ee_create_interpreter(LLVMModuleRef M) {
LLVMExecutionEngineRef Interp;
char *Error;
if (LLVMCreateInterpreterForModule(&Interp, M, &Error))
llvm_raise(llvm_ee_error_exn, Error);
return Interp;
}
/* llmodule -> int -> ExecutionEngine.t */
CAMLprim LLVMExecutionEngineRef
llvm_ee_create_jit(LLVMModuleRef M, value OptLevel) {
LLVMExecutionEngineRef JIT;
char *Error;
if (LLVMCreateJITCompilerForModule(&JIT, M, Int_val(OptLevel), &Error))
llvm_raise(llvm_ee_error_exn, Error);
return JIT;
}
/* ExecutionEngine.t -> unit */
CAMLprim value llvm_ee_dispose(LLVMExecutionEngineRef EE) {
LLVMDisposeExecutionEngine(EE);
return Val_unit;
}
/* llmodule -> ExecutionEngine.t -> unit */
CAMLprim value llvm_ee_add_module(LLVMModuleRef M, LLVMExecutionEngineRef EE) {
LLVMAddModule(EE, M);
return Val_unit;
}
/* llmodule -> ExecutionEngine.t -> llmodule */
CAMLprim LLVMModuleRef llvm_ee_remove_module(LLVMModuleRef M,
LLVMExecutionEngineRef EE) {
LLVMModuleRef RemovedModule;
char *Error;
if (LLVMRemoveModule(EE, M, &RemovedModule, &Error))
llvm_raise(llvm_ee_error_exn, Error);
return RemovedModule;
}
/* string -> ExecutionEngine.t -> llvalue option */
CAMLprim value llvm_ee_find_function(value Name, LLVMExecutionEngineRef EE) {
CAMLparam1(Name);
CAMLlocal1(Option);
LLVMValueRef Found;
if (LLVMFindFunction(EE, String_val(Name), &Found))
CAMLreturn(Val_unit);
Option = alloc(1, 0);
Field(Option, 0) = Val_op(Found);
CAMLreturn(Option);
}
/* llvalue -> GenericValue.t array -> ExecutionEngine.t -> GenericValue.t */
CAMLprim value llvm_ee_run_function(LLVMValueRef F, value Args,
LLVMExecutionEngineRef EE) {
unsigned NumArgs;
LLVMGenericValueRef Result, *GVArgs;
unsigned I;
NumArgs = Wosize_val(Args);
GVArgs = (LLVMGenericValueRef*) malloc(NumArgs * sizeof(LLVMGenericValueRef));
for (I = 0; I != NumArgs; ++I)
GVArgs[I] = Genericvalue_val(Field(Args, I));
Result = LLVMRunFunction(EE, F, NumArgs, GVArgs);
free(GVArgs);
return alloc_generic_value(Result);
}
/* ExecutionEngine.t -> unit */
CAMLprim value llvm_ee_run_static_ctors(LLVMExecutionEngineRef EE) {
LLVMRunStaticConstructors(EE);
return Val_unit;
}
/* ExecutionEngine.t -> unit */
CAMLprim value llvm_ee_run_static_dtors(LLVMExecutionEngineRef EE) {
LLVMRunStaticDestructors(EE);
return Val_unit;
}
/* llvalue -> string array -> (string * string) array -> ExecutionEngine.t ->
int */
CAMLprim value llvm_ee_run_function_as_main(LLVMValueRef F,
value Args, value Env,
LLVMExecutionEngineRef EE) {
CAMLparam2(Args, Env);
int I, NumArgs, NumEnv, EnvSize, Result;
const char **CArgs, **CEnv;
char *CEnvBuf, *Pos;
NumArgs = Wosize_val(Args);
NumEnv = Wosize_val(Env);
/* Build the environment. */
CArgs = (const char **) malloc(NumArgs * sizeof(char*));
for (I = 0; I != NumArgs; ++I)
CArgs[I] = String_val(Field(Args, I));
/* Compute the size of the environment string buffer. */
for (I = 0, EnvSize = 0; I != NumEnv; ++I) {
EnvSize += strlen(String_val(Field(Field(Env, I), 0))) + 1;
EnvSize += strlen(String_val(Field(Field(Env, I), 1))) + 1;
}
/* Build the environment. */
CEnv = (const char **) malloc((NumEnv + 1) * sizeof(char*));
CEnvBuf = (char*) malloc(EnvSize);
Pos = CEnvBuf;
for (I = 0; I != NumEnv; ++I) {
char *Name = String_val(Field(Field(Env, I), 0)),
*Value = String_val(Field(Field(Env, I), 1));
int NameLen = strlen(Name),
ValueLen = strlen(Value);
CEnv[I] = Pos;
memcpy(Pos, Name, NameLen);
Pos += NameLen;
*Pos++ = '=';
memcpy(Pos, Value, ValueLen);
Pos += ValueLen;
*Pos++ = '\0';
}
CEnv[NumEnv] = NULL;
Result = LLVMRunFunctionAsMain(EE, F, NumArgs, CArgs, CEnv);
free(CArgs);
free(CEnv);
free(CEnvBuf);
CAMLreturn(Val_int(Result));
}
/* llvalue -> ExecutionEngine.t -> unit */
CAMLprim value llvm_ee_free_machine_code(LLVMValueRef F,
LLVMExecutionEngineRef EE) {
LLVMFreeMachineCodeForFunction(EE, F);
return Val_unit;
}

View file

@ -0,0 +1,112 @@
(*===-- llvm_executionengine.ml - LLVM Ocaml Interface ----------*- C++ -*-===*
*
* The LLVM Compiler Infrastructure
*
* This file is distributed under the University of Illinois Open Source
* License. See LICENSE.TXT for details.
*
*===----------------------------------------------------------------------===*)
exception Error of string
external register_exns: exn -> unit
= "llvm_register_ee_exns"
module GenericValue = struct
type t
external of_float: Llvm.lltype -> float -> t
= "llvm_genericvalue_of_float"
external of_pointer: 'a -> t
= "llvm_genericvalue_of_pointer"
external of_int32: Llvm.lltype -> int32 -> t
= "llvm_genericvalue_of_int32"
external of_int: Llvm.lltype -> int -> t
= "llvm_genericvalue_of_int"
external of_nativeint: Llvm.lltype -> nativeint -> t
= "llvm_genericvalue_of_nativeint"
external of_int64: Llvm.lltype -> int64 -> t
= "llvm_genericvalue_of_int64"
external as_float: Llvm.lltype -> t -> float
= "llvm_genericvalue_as_float"
external as_pointer: t -> 'a
= "llvm_genericvalue_as_pointer"
external as_int32: t -> int32
= "llvm_genericvalue_as_int32"
external as_int: t -> int
= "llvm_genericvalue_as_int"
external as_nativeint: t -> nativeint
= "llvm_genericvalue_as_nativeint"
external as_int64: t -> int64
= "llvm_genericvalue_as_int64"
end
module ExecutionEngine = struct
type t
(* FIXME: Ocaml is not running this setup code unless we use 'val' in the
interface, which causes the emission of a stub for each function;
using 'external' in the module allows direct calls into
ocaml_executionengine.c. This is hardly fatal, but it is unnecessary
overhead on top of the two stubs that are already invoked for each
call into LLVM. *)
let _ = register_exns (Error "")
external create: Llvm.llmodule -> t
= "llvm_ee_create"
external create_interpreter: Llvm.llmodule -> t
= "llvm_ee_create_interpreter"
external create_jit: Llvm.llmodule -> int -> t
= "llvm_ee_create_jit"
external dispose: t -> unit
= "llvm_ee_dispose"
external add_module: Llvm.llmodule -> t -> unit
= "llvm_ee_add_module"
external remove_module: Llvm.llmodule -> t -> Llvm.llmodule
= "llvm_ee_remove_module"
external find_function: string -> t -> Llvm.llvalue option
= "llvm_ee_find_function"
external run_function: Llvm.llvalue -> GenericValue.t array -> t ->
GenericValue.t
= "llvm_ee_run_function"
external run_static_ctors: t -> unit
= "llvm_ee_run_static_ctors"
external run_static_dtors: t -> unit
= "llvm_ee_run_static_dtors"
external run_function_as_main: Llvm.llvalue -> string array ->
(string * string) array -> t -> int
= "llvm_ee_run_function_as_main"
external free_machine_code: Llvm.llvalue -> t -> unit
= "llvm_ee_free_machine_code"
external target_data: t -> Llvm_target.TargetData.t
= "LLVMGetExecutionEngineTargetData"
(* The following are not bound. Patches are welcome.
get_target_data: t -> lltargetdata
add_global_mapping: llvalue -> llgenericvalue -> t -> unit
clear_all_global_mappings: t -> unit
update_global_mapping: llvalue -> llgenericvalue -> t -> unit
get_pointer_to_global_if_available: llvalue -> t -> llgenericvalue
get_pointer_to_global: llvalue -> t -> llgenericvalue
get_pointer_to_function: llvalue -> t -> llgenericvalue
get_pointer_to_function_or_stub: llvalue -> t -> llgenericvalue
get_global_value_at_address: llgenericvalue -> t -> llvalue option
store_value_to_memory: llgenericvalue -> llgenericvalue -> lltype -> unit
initialize_memory: llvalue -> llgenericvalue -> t -> unit
recompile_and_relink_function: llvalue -> t -> llgenericvalue
get_or_emit_global_variable: llvalue -> t -> llgenericvalue
disable_lazy_compilation: t -> unit
lazy_compilation_enabled: t -> bool
install_lazy_function_creator: (string -> llgenericvalue) -> t -> unit
*)
end
external initialize_native_target : unit -> bool
= "llvm_initialize_native_target"

View file

@ -0,0 +1,163 @@
(*===-- llvm_executionengine.mli - LLVM Ocaml Interface ---------*- C++ -*-===*
*
* The LLVM Compiler Infrastructure
*
* This file is distributed under the University of Illinois Open Source
* License. See LICENSE.TXT for details.
*
*===----------------------------------------------------------------------===*)
(** JIT Interpreter.
This interface provides an ocaml API for LLVM execution engine (JIT/
interpreter), the classes in the ExecutionEngine library. *)
exception Error of string
module GenericValue: sig
(** [GenericValue.t] is a boxed union type used to portably pass arguments to
and receive values from the execution engine. It supports only a limited
selection of types; for more complex argument types, it is necessary to
generate a stub function by hand or to pass parameters by reference.
See the struct [llvm::GenericValue]. *)
type t
(** [of_float fpty n] boxes the float [n] in a float-valued generic value
according to the floating point type [fpty]. See the fields
[llvm::GenericValue::DoubleVal] and [llvm::GenericValue::FloatVal]. *)
external of_float : Llvm.lltype -> float -> t = "llvm_genericvalue_of_float"
(** [of_pointer v] boxes the pointer value [v] in a generic value. See the
field [llvm::GenericValue::PointerVal]. *)
external of_pointer : 'a -> t = "llvm_genericvalue_of_pointer"
(** [of_int32 n w] boxes the int32 [i] in a generic value with the bitwidth
[w]. See the field [llvm::GenericValue::IntVal]. *)
external of_int32 : Llvm.lltype -> int32 -> t = "llvm_genericvalue_of_int32"
(** [of_int n w] boxes the int [i] in a generic value with the bitwidth
[w]. See the field [llvm::GenericValue::IntVal]. *)
external of_int : Llvm.lltype -> int -> t = "llvm_genericvalue_of_int"
(** [of_natint n w] boxes the native int [i] in a generic value with the
bitwidth [w]. See the field [llvm::GenericValue::IntVal]. *)
external of_nativeint : Llvm.lltype -> nativeint -> t
= "llvm_genericvalue_of_nativeint"
(** [of_int64 n w] boxes the int64 [i] in a generic value with the bitwidth
[w]. See the field [llvm::GenericValue::IntVal]. *)
external of_int64 : Llvm.lltype -> int64 -> t = "llvm_genericvalue_of_int64"
(** [as_float fpty gv] unboxes the floating point-valued generic value [gv] of
floating point type [fpty]. See the fields [llvm::GenericValue::DoubleVal]
and [llvm::GenericValue::FloatVal]. *)
external as_float : Llvm.lltype -> t -> float = "llvm_genericvalue_as_float"
(** [as_pointer gv] unboxes the pointer-valued generic value [gv]. See the
field [llvm::GenericValue::PointerVal]. *)
external as_pointer : t -> 'a = "llvm_genericvalue_as_pointer"
(** [as_int32 gv] unboxes the integer-valued generic value [gv] as an [int32].
Is invalid if [gv] has a bitwidth greater than 32 bits. See the field
[llvm::GenericValue::IntVal]. *)
external as_int32 : t -> int32 = "llvm_genericvalue_as_int32"
(** [as_int gv] unboxes the integer-valued generic value [gv] as an [int].
Is invalid if [gv] has a bitwidth greater than the host bit width (but the
most significant bit may be lost). See the field
[llvm::GenericValue::IntVal]. *)
external as_int : t -> int = "llvm_genericvalue_as_int"
(** [as_natint gv] unboxes the integer-valued generic value [gv] as a
[nativeint]. Is invalid if [gv] has a bitwidth greater than
[nativeint]. See the field [llvm::GenericValue::IntVal]. *)
external as_nativeint : t -> nativeint = "llvm_genericvalue_as_nativeint"
(** [as_int64 gv] returns the integer-valued generic value [gv] as an [int64].
Is invalid if [gv] has a bitwidth greater than [int64]. See the field
[llvm::GenericValue::IntVal]. *)
external as_int64 : t -> int64 = "llvm_genericvalue_as_int64"
end
module ExecutionEngine: sig
(** An execution engine is either a JIT compiler or an interpreter, capable of
directly loading an LLVM module and executing its functions without first
invoking a static compiler and generating a native executable. *)
type t
(** [create m] creates a new execution engine, taking ownership of the
module [m] if successful. Creates a JIT if possible, else falls back to an
interpreter. Raises [Error msg] if an error occurrs. The execution engine
is not garbage collected and must be destroyed with [dispose ee].
See the function [llvm::EngineBuilder::create]. *)
external create : Llvm.llmodule -> t = "llvm_ee_create"
(** [create_interpreter m] creates a new interpreter, taking ownership of the
module [m] if successful. Raises [Error msg] if an error occurrs. The
execution engine is not garbage collected and must be destroyed with
[dispose ee].
See the function [llvm::EngineBuilder::create]. *)
external create_interpreter : Llvm.llmodule -> t = "llvm_ee_create_interpreter"
(** [create_jit m optlevel] creates a new JIT (just-in-time compiler), taking
ownership of the module [m] if successful with the desired optimization
level [optlevel]. Raises [Error msg] if an error occurrs. The execution
engine is not garbage collected and must be destroyed with [dispose ee].
See the function [llvm::EngineBuilder::create]. *)
external create_jit : Llvm.llmodule -> int -> t = "llvm_ee_create_jit"
(** [dispose ee] releases the memory used by the execution engine and must be
invoked to avoid memory leaks. *)
external dispose : t -> unit = "llvm_ee_dispose"
(** [add_module m ee] adds the module [m] to the execution engine [ee]. *)
external add_module : Llvm.llmodule -> t -> unit = "llvm_ee_add_module"
(** [remove_module m ee] removes the module [m] from the execution engine
[ee], disposing of [m] and the module referenced by [mp]. Raises
[Error msg] if an error occurs. *)
external remove_module : Llvm.llmodule -> t -> Llvm.llmodule
= "llvm_ee_remove_module"
(** [find_function n ee] finds the function named [n] defined in any of the
modules owned by the execution engine [ee]. Returns [None] if the function
is not found and [Some f] otherwise. *)
external find_function : string -> t -> Llvm.llvalue option
= "llvm_ee_find_function"
(** [run_function f args ee] synchronously executes the function [f] with the
arguments [args], which must be compatible with the parameter types. *)
external run_function : Llvm.llvalue -> GenericValue.t array -> t ->
GenericValue.t
= "llvm_ee_run_function"
(** [run_static_ctors ee] executes the static constructors of each module in
the execution engine [ee]. *)
external run_static_ctors : t -> unit = "llvm_ee_run_static_ctors"
(** [run_static_dtors ee] executes the static destructors of each module in
the execution engine [ee]. *)
external run_static_dtors : t -> unit = "llvm_ee_run_static_dtors"
(** [run_function_as_main f args env ee] executes the function [f] as a main
function, passing it [argv] and [argc] according to the string array
[args], and [envp] as specified by the array [env]. Returns the integer
return value of the function. *)
external run_function_as_main : Llvm.llvalue -> string array ->
(string * string) array -> t -> int
= "llvm_ee_run_function_as_main"
(** [free_machine_code f ee] releases the memory in the execution engine [ee]
used to store the machine code for the function [f]. *)
external free_machine_code : Llvm.llvalue -> t -> unit
= "llvm_ee_free_machine_code"
(** [target_data ee] is the target data owned by the execution engine
[ee]. *)
external target_data : t -> Llvm_target.TargetData.t
= "LLVMGetExecutionEngineTargetData"
end
external initialize_native_target : unit -> bool
= "llvm_initialize_native_target"

View file

@ -0,0 +1,19 @@
##===- bindings/ocaml/llvm/Makefile ------------------------*- Makefile -*-===##
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
##===----------------------------------------------------------------------===##
#
# This is the makefile for the Objective Caml Llvm interface.
#
##===----------------------------------------------------------------------===##
LEVEL := ../../..
LIBRARYNAME := llvm
UsedComponents := core
UsedOcamLibs := llvm
include ../Makefile.ocaml

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

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