From 361680a51927577ccb20b14704dbaac762181843 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 11 Oct 2010 17:22:16 +0000 Subject: [PATCH] Remove more unneeded files and directories from contrib/llvm. This still allows us to build tblgen and clang, and further reduces the footprint in the tree. Approved by: rpaulo (mentor) --- contrib/llvm/CMakeLists.txt | 387 - contrib/llvm/CREDITS.TXT | 360 - contrib/llvm/LICENSE.TXT | 69 - contrib/llvm/Makefile | 241 - contrib/llvm/Makefile.common | 70 - contrib/llvm/Makefile.config.in | 346 - contrib/llvm/Makefile.rules | 2209 -- contrib/llvm/ModuleInfo.txt | 4 - contrib/llvm/README.txt | 16 - contrib/llvm/autoconf/AutoRegen.sh | 58 - contrib/llvm/autoconf/ExportMap.map | 7 - contrib/llvm/autoconf/LICENSE.TXT | 24 - contrib/llvm/autoconf/README.TXT | 49 - contrib/llvm/autoconf/config.guess | 1498 -- contrib/llvm/autoconf/config.sub | 1702 -- contrib/llvm/autoconf/configure.ac | 1582 -- contrib/llvm/autoconf/depcomp | 522 - contrib/llvm/autoconf/install-sh | 322 - contrib/llvm/autoconf/ltmain.sh | 6863 ----- contrib/llvm/autoconf/m4/build_exeext.m4 | 42 - contrib/llvm/autoconf/m4/c_printf_a.m4 | 31 - contrib/llvm/autoconf/m4/check_gnu_make.m4 | 26 - contrib/llvm/autoconf/m4/config_makefile.m4 | 9 - contrib/llvm/autoconf/m4/config_project.m4 | 14 - contrib/llvm/autoconf/m4/cxx_flag_check.m4 | 2 - contrib/llvm/autoconf/m4/find_std_program.m4 | 118 - contrib/llvm/autoconf/m4/func_isinf.m4 | 36 - contrib/llvm/autoconf/m4/func_isnan.m4 | 27 - contrib/llvm/autoconf/m4/func_mmap_file.m4 | 26 - .../llvm/autoconf/m4/header_mmap_anonymous.m4 | 21 - contrib/llvm/autoconf/m4/huge_val.m4 | 20 - contrib/llvm/autoconf/m4/libtool.m4 | 6389 ----- contrib/llvm/autoconf/m4/link_options.m4 | 108 - contrib/llvm/autoconf/m4/linux_mixed_64_32.m4 | 17 - contrib/llvm/autoconf/m4/ltdl.m4 | 418 - .../autoconf/m4/need_dev_zero_for_mmap.m4 | 17 - contrib/llvm/autoconf/m4/path_perl.m4 | 16 - contrib/llvm/autoconf/m4/path_tclsh.m4 | 39 - contrib/llvm/autoconf/m4/rand48.m4 | 12 - contrib/llvm/autoconf/m4/sanity_check.m4 | 31 - contrib/llvm/autoconf/m4/single_cxx_check.m4 | 10 - .../autoconf/m4/visibility_inlines_hidden.m4 | 22 - contrib/llvm/autoconf/missing | 353 - contrib/llvm/autoconf/mkinstalldirs | 150 - contrib/llvm/bindings/Makefile | 16 - contrib/llvm/bindings/README.txt | 3 - .../ada/analysis/llvm_analysis-binding.ads | 32 - .../bindings/ada/analysis/llvm_analysis.ads | 30 - .../ada/analysis/llvm_analysis_wrap.cxx | 369 - .../ada/bitreader/llvm_bit_reader-binding.ads | 52 - .../ada/bitreader/llvm_bit_reader.ads | 6 - .../ada/bitreader/llvm_bitreader_wrap.cxx | 423 - .../ada/bitwriter/llvm_bit_writer-binding.ads | 28 - .../ada/bitwriter/llvm_bit_writer.ads | 6 - .../ada/bitwriter/llvm_bitwriter_wrap.cxx | 335 - .../llvm_execution_engine-binding.ads | 192 - .../executionengine/llvm_execution_engine.ads | 90 - .../llvm_executionengine_wrap.cxx | 924 - contrib/llvm/bindings/ada/llvm.gpr | 34 - .../llvm/bindings/ada/llvm/llvm-binding.ads | 1974 -- contrib/llvm/bindings/ada/llvm/llvm.ads | 497 - .../llvm/llvm_link_time_optimizer-binding.ads | 207 - .../ada/llvm/llvm_link_time_optimizer.ads | 184 - .../ada/llvm/llvm_linktimeoptimizer_wrap.cxx | 923 - contrib/llvm/bindings/ada/llvm/llvm_wrap.cxx | 8817 ------ .../ada/target/llvm_target-binding.ads | 138 - .../llvm/bindings/ada/target/llvm_target.ads | 72 - .../bindings/ada/target/llvm_target_wrap.cxx | 720 - .../transforms/llvm_transforms-binding.ads | 206 - .../ada/transforms/llvm_transforms.ads | 6 - .../ada/transforms/llvm_transforms_wrap.cxx | 828 - contrib/llvm/bindings/ocaml/Makefile | 19 - contrib/llvm/bindings/ocaml/Makefile.ocaml | 410 - contrib/llvm/bindings/ocaml/analysis/Makefile | 19 - .../bindings/ocaml/analysis/analysis_ocaml.c | 72 - .../bindings/ocaml/analysis/llvm_analysis.ml | 22 - .../bindings/ocaml/analysis/llvm_analysis.mli | 46 - .../llvm/bindings/ocaml/bitreader/Makefile | 19 - .../ocaml/bitreader/bitreader_ocaml.c | 73 - .../ocaml/bitreader/llvm_bitreader.ml | 20 - .../ocaml/bitreader/llvm_bitreader.mli | 29 - .../llvm/bindings/ocaml/bitwriter/Makefile | 19 - .../ocaml/bitwriter/bitwriter_ocaml.c | 45 - .../ocaml/bitwriter/llvm_bitwriter.ml | 25 - .../ocaml/bitwriter/llvm_bitwriter.mli | 30 - .../bindings/ocaml/executionengine/Makefile | 19 - .../executionengine/executionengine_ocaml.c | 323 - .../executionengine/llvm_executionengine.ml | 112 - .../executionengine/llvm_executionengine.mli | 163 - contrib/llvm/bindings/ocaml/llvm/Makefile | 19 - contrib/llvm/bindings/ocaml/llvm/llvm.ml | 1064 - contrib/llvm/bindings/ocaml/llvm/llvm.mli | 2259 -- contrib/llvm/bindings/ocaml/llvm/llvm_ocaml.c | 1824 -- contrib/llvm/bindings/ocaml/target/Makefile | 19 - .../llvm/bindings/ocaml/target/llvm_target.ml | 44 - .../bindings/ocaml/target/llvm_target.mli | 102 - .../llvm/bindings/ocaml/target/target_ocaml.c | 109 - .../llvm/bindings/ocaml/transforms/Makefile | 18 - .../bindings/ocaml/transforms/scalar/Makefile | 20 - .../transforms/scalar/llvm_scalar_opts.ml | 75 - .../transforms/scalar/llvm_scalar_opts.mli | 123 - .../transforms/scalar/scalar_opts_ocaml.c | 152 - contrib/llvm/build-for-llvm-top.sh | 68 - contrib/llvm/configure | 22169 ---------------- contrib/llvm/include/llvm/CMakeLists.txt | 19 - .../include/llvm/Config/AsmParsers.def.in | 29 - .../include/llvm/Config/AsmPrinters.def.in | 29 - .../include/llvm/Config/Disassemblers.def.in | 29 - .../llvm/include/llvm/Config/Targets.def.in | 28 - .../llvm/include/llvm/Config/config.h.cmake | 641 - contrib/llvm/include/llvm/Config/config.h.in | 617 - .../include/llvm/Config/llvm-config.h.cmake | 97 - .../llvm/include/llvm/Config/llvm-config.h.in | 97 - .../include/llvm/System/DataTypes.h.cmake | 189 - .../llvm/include/llvm/System/DataTypes.h.in | 111 - contrib/llvm/include/llvm/System/LICENSE.TXT | 6 - contrib/llvm/lib/Analysis/CMakeLists.txt | 53 - contrib/llvm/lib/Analysis/IPA/CMakeLists.txt | 6 - contrib/llvm/lib/Analysis/IPA/Makefile | 15 - contrib/llvm/lib/Analysis/Makefile | 16 - contrib/llvm/lib/Analysis/README.txt | 30 - contrib/llvm/lib/Archive/CMakeLists.txt | 5 - contrib/llvm/lib/Archive/Makefile | 17 - contrib/llvm/lib/AsmParser/CMakeLists.txt | 6 - contrib/llvm/lib/AsmParser/Makefile | 14 - contrib/llvm/lib/Bitcode/Makefile | 14 - .../llvm/lib/Bitcode/Reader/CMakeLists.txt | 4 - contrib/llvm/lib/Bitcode/Reader/Makefile | 15 - .../llvm/lib/Bitcode/Writer/CMakeLists.txt | 6 - contrib/llvm/lib/Bitcode/Writer/Makefile | 15 - .../lib/CodeGen/AsmPrinter/CMakeLists.txt | 11 - contrib/llvm/lib/CodeGen/AsmPrinter/Makefile | 13 - contrib/llvm/lib/CodeGen/CMakeLists.txt | 86 - contrib/llvm/lib/CodeGen/Makefile | 22 - contrib/llvm/lib/CodeGen/README.txt | 199 - .../lib/CodeGen/SelectionDAG/CMakeLists.txt | 25 - .../llvm/lib/CodeGen/SelectionDAG/Makefile | 13 - .../llvm/lib/CompilerDriver/CMakeLists.txt | 10 - contrib/llvm/lib/CompilerDriver/Makefile | 20 - .../llvm/lib/ExecutionEngine/CMakeLists.txt | 4 - .../Interpreter/CMakeLists.txt | 5 - .../lib/ExecutionEngine/Interpreter/Makefile | 13 - .../lib/ExecutionEngine/JIT/CMakeLists.txt | 13 - contrib/llvm/lib/ExecutionEngine/JIT/Makefile | 38 - contrib/llvm/lib/ExecutionEngine/Makefile | 13 - contrib/llvm/lib/Linker/CMakeLists.txt | 6 - contrib/llvm/lib/Linker/Makefile | 15 - contrib/llvm/lib/MC/CMakeLists.txt | 33 - .../llvm/lib/MC/MCDisassembler/CMakeLists.txt | 7 - contrib/llvm/lib/MC/MCDisassembler/Makefile | 14 - contrib/llvm/lib/MC/MCParser/CMakeLists.txt | 10 - contrib/llvm/lib/MC/MCParser/Makefile | 15 - contrib/llvm/lib/MC/Makefile | 16 - contrib/llvm/lib/Makefile | 17 - contrib/llvm/lib/Support/CMakeLists.txt | 49 - contrib/llvm/lib/Support/COPYRIGHT.regex | 54 - contrib/llvm/lib/Support/Makefile | 17 - contrib/llvm/lib/System/CMakeLists.txt | 48 - contrib/llvm/lib/System/Makefile | 25 - contrib/llvm/lib/System/README.txt | 43 - contrib/llvm/lib/System/Unix/README.txt | 16 - .../lib/Target/ARM/AsmParser/CMakeLists.txt | 7 - .../llvm/lib/Target/ARM/AsmParser/Makefile | 15 - .../lib/Target/ARM/AsmPrinter/CMakeLists.txt | 6 - .../llvm/lib/Target/ARM/AsmPrinter/Makefile | 15 - contrib/llvm/lib/Target/ARM/CMakeLists.txt | 50 - .../llvm/lib/Target/ARM/Disassembler/Makefile | 16 - contrib/llvm/lib/Target/ARM/Makefile | 25 - contrib/llvm/lib/Target/ARM/README-Thumb.txt | 248 - contrib/llvm/lib/Target/ARM/README-Thumb2.txt | 6 - contrib/llvm/lib/Target/ARM/README.txt | 659 - .../lib/Target/ARM/TargetInfo/CMakeLists.txt | 7 - .../llvm/lib/Target/ARM/TargetInfo/Makefile | 15 - .../Target/Alpha/AsmPrinter/CMakeLists.txt | 6 - .../llvm/lib/Target/Alpha/AsmPrinter/Makefile | 15 - contrib/llvm/lib/Target/Alpha/CMakeLists.txt | 29 - contrib/llvm/lib/Target/Alpha/Makefile | 23 - contrib/llvm/lib/Target/Alpha/README.txt | 42 - .../Target/Alpha/TargetInfo/CMakeLists.txt | 7 - .../llvm/lib/Target/Alpha/TargetInfo/Makefile | 15 - .../Target/Blackfin/AsmPrinter/CMakeLists.txt | 6 - .../lib/Target/Blackfin/AsmPrinter/Makefile | 16 - .../llvm/lib/Target/Blackfin/CMakeLists.txt | 24 - contrib/llvm/lib/Target/Blackfin/Makefile | 24 - contrib/llvm/lib/Target/Blackfin/README.txt | 244 - .../Target/Blackfin/TargetInfo/CMakeLists.txt | 7 - .../lib/Target/Blackfin/TargetInfo/Makefile | 15 - .../llvm/lib/Target/CBackend/CMakeLists.txt | 3 - contrib/llvm/lib/Target/CBackend/Makefile | 16 - .../Target/CBackend/TargetInfo/CMakeLists.txt | 6 - .../lib/Target/CBackend/TargetInfo/Makefile | 15 - contrib/llvm/lib/Target/CMakeLists.txt | 15 - .../Target/CellSPU/AsmPrinter/CMakeLists.txt | 9 - .../lib/Target/CellSPU/AsmPrinter/Makefile | 17 - .../llvm/lib/Target/CellSPU/CMakeLists.txt | 27 - contrib/llvm/lib/Target/CellSPU/Makefile | 21 - contrib/llvm/lib/Target/CellSPU/README.txt | 92 - .../Target/CellSPU/TargetInfo/CMakeLists.txt | 7 - .../lib/Target/CellSPU/TargetInfo/Makefile | 15 - .../llvm/lib/Target/CppBackend/CMakeLists.txt | 3 - contrib/llvm/lib/Target/CppBackend/Makefile | 16 - .../CppBackend/TargetInfo/CMakeLists.txt | 6 - .../lib/Target/CppBackend/TargetInfo/Makefile | 15 - .../Target/MBlaze/AsmPrinter/CMakeLists.txt | 9 - .../lib/Target/MBlaze/AsmPrinter/Makefile | 17 - contrib/llvm/lib/Target/MBlaze/CMakeLists.txt | 28 - contrib/llvm/lib/Target/MBlaze/Makefile | 23 - .../Target/MBlaze/TargetInfo/CMakeLists.txt | 7 - .../lib/Target/MBlaze/TargetInfo/Makefile | 15 - .../Target/MSP430/AsmPrinter/CMakeLists.txt | 8 - .../lib/Target/MSP430/AsmPrinter/Makefile | 15 - contrib/llvm/lib/Target/MSP430/CMakeLists.txt | 25 - contrib/llvm/lib/Target/MSP430/Makefile | 24 - contrib/llvm/lib/Target/MSP430/README.txt | 40 - .../Target/MSP430/TargetInfo/CMakeLists.txt | 7 - .../lib/Target/MSP430/TargetInfo/Makefile | 15 - contrib/llvm/lib/Target/Makefile | 20 - .../lib/Target/Mips/AsmPrinter/CMakeLists.txt | 9 - .../llvm/lib/Target/Mips/AsmPrinter/Makefile | 17 - contrib/llvm/lib/Target/Mips/CMakeLists.txt | 26 - contrib/llvm/lib/Target/Mips/Makefile | 24 - .../lib/Target/Mips/TargetInfo/CMakeLists.txt | 7 - .../llvm/lib/Target/Mips/TargetInfo/Makefile | 15 - .../Target/PIC16/AsmPrinter/CMakeLists.txt | 9 - .../llvm/lib/Target/PIC16/AsmPrinter/Makefile | 15 - contrib/llvm/lib/Target/PIC16/CMakeLists.txt | 26 - contrib/llvm/lib/Target/PIC16/Makefile | 24 - .../lib/Target/PIC16/PIC16Passes/Makefile | 15 - .../Target/PIC16/TargetInfo/CMakeLists.txt | 7 - .../llvm/lib/Target/PIC16/TargetInfo/Makefile | 15 - .../Target/PowerPC/AsmPrinter/CMakeLists.txt | 6 - .../lib/Target/PowerPC/AsmPrinter/Makefile | 15 - .../llvm/lib/Target/PowerPC/CMakeLists.txt | 30 - contrib/llvm/lib/Target/PowerPC/Makefile | 23 - contrib/llvm/lib/Target/PowerPC/README.txt | 914 - .../lib/Target/PowerPC/README_ALTIVEC.txt | 211 - .../Target/PowerPC/TargetInfo/CMakeLists.txt | 7 - .../lib/Target/PowerPC/TargetInfo/Makefile | 15 - contrib/llvm/lib/Target/README.txt | 1939 -- .../Target/Sparc/AsmPrinter/CMakeLists.txt | 6 - .../llvm/lib/Target/Sparc/AsmPrinter/Makefile | 15 - contrib/llvm/lib/Target/Sparc/CMakeLists.txt | 26 - contrib/llvm/lib/Target/Sparc/Makefile | 23 - contrib/llvm/lib/Target/Sparc/README.txt | 59 - .../Target/Sparc/TargetInfo/CMakeLists.txt | 7 - .../llvm/lib/Target/Sparc/TargetInfo/Makefile | 15 - .../Target/SystemZ/AsmPrinter/CMakeLists.txt | 6 - .../lib/Target/SystemZ/AsmPrinter/Makefile | 15 - .../llvm/lib/Target/SystemZ/CMakeLists.txt | 24 - contrib/llvm/lib/Target/SystemZ/Makefile | 23 - .../Target/SystemZ/TargetInfo/CMakeLists.txt | 7 - .../lib/Target/SystemZ/TargetInfo/Makefile | 15 - .../lib/Target/X86/AsmParser/CMakeLists.txt | 7 - .../llvm/lib/Target/X86/AsmParser/Makefile | 15 - .../lib/Target/X86/AsmPrinter/CMakeLists.txt | 8 - .../llvm/lib/Target/X86/AsmPrinter/Makefile | 15 - contrib/llvm/lib/Target/X86/CMakeLists.txt | 52 - .../Target/X86/Disassembler/CMakeLists.txt | 14 - .../llvm/lib/Target/X86/Disassembler/Makefile | 16 - contrib/llvm/lib/Target/X86/Makefile | 25 - .../llvm/lib/Target/X86/README-FPStack.txt | 85 - contrib/llvm/lib/Target/X86/README-MMX.txt | 71 - contrib/llvm/lib/Target/X86/README-SSE.txt | 907 - .../lib/Target/X86/README-UNIMPLEMENTED.txt | 14 - contrib/llvm/lib/Target/X86/README-X86-64.txt | 273 - contrib/llvm/lib/Target/X86/README.txt | 1962 -- .../lib/Target/X86/TargetInfo/CMakeLists.txt | 7 - .../llvm/lib/Target/X86/TargetInfo/Makefile | 16 - .../X86/X86CompilationCallback_Win64.asm | 68 - .../Target/XCore/AsmPrinter/CMakeLists.txt | 6 - .../llvm/lib/Target/XCore/AsmPrinter/Makefile | 16 - contrib/llvm/lib/Target/XCore/CMakeLists.txt | 24 - contrib/llvm/lib/Target/XCore/Makefile | 24 - contrib/llvm/lib/Target/XCore/README.txt | 7 - .../Target/XCore/TargetInfo/CMakeLists.txt | 7 - .../llvm/lib/Target/XCore/TargetInfo/Makefile | 16 - .../llvm/lib/Transforms/Hello/CMakeLists.txt | 3 - contrib/llvm/lib/Transforms/Hello/Hello.cpp | 65 - .../llvm/lib/Transforms/Hello/Hello.exports | 0 contrib/llvm/lib/Transforms/Hello/Makefile | 24 - .../llvm/lib/Transforms/IPO/CMakeLists.txt | 27 - contrib/llvm/lib/Transforms/IPO/Makefile | 15 - .../lib/Transforms/InstCombine/CMakeLists.txt | 17 - .../llvm/lib/Transforms/InstCombine/Makefile | 15 - .../Transforms/Instrumentation/CMakeLists.txt | 5 - .../lib/Transforms/Instrumentation/Makefile | 15 - contrib/llvm/lib/Transforms/Makefile | 20 - .../llvm/lib/Transforms/Scalar/CMakeLists.txt | 35 - contrib/llvm/lib/Transforms/Scalar/Makefile | 15 - .../llvm/lib/Transforms/Utils/CMakeLists.txt | 28 - contrib/llvm/lib/Transforms/Utils/Makefile | 15 - contrib/llvm/lib/VMCore/CMakeLists.txt | 35 - contrib/llvm/lib/VMCore/Makefile | 34 - contrib/llvm/llvm.spec.in | 67 - contrib/llvm/runtime/Makefile | 31 - contrib/llvm/runtime/README.txt | 4 - .../runtime/libprofile/BasicBlockTracing.c | 67 - .../llvm/runtime/libprofile/CommonProfiling.c | 117 - .../llvm/runtime/libprofile/EdgeProfiling.c | 45 - contrib/llvm/runtime/libprofile/Makefile | 22 - .../runtime/libprofile/OptimalEdgeProfiling.c | 45 - contrib/llvm/runtime/libprofile/Profiling.h | 31 - .../runtime/libprofile/libprofile.exports | 4 - contrib/llvm/tools/CMakeLists.txt | 43 - contrib/llvm/tools/Makefile | 60 - .../llvm/tools/bugpoint-passes/CMakeLists.txt | 3 - contrib/llvm/tools/bugpoint-passes/Makefile | 23 - .../llvm/tools/bugpoint-passes/TestPasses.cpp | 75 - .../tools/bugpoint-passes/bugpoint.exports | 0 contrib/llvm/tools/bugpoint/BugDriver.cpp | 246 - contrib/llvm/tools/bugpoint/BugDriver.h | 329 - contrib/llvm/tools/bugpoint/CMakeLists.txt | 14 - contrib/llvm/tools/bugpoint/CrashDebugger.cpp | 667 - .../llvm/tools/bugpoint/ExecutionDriver.cpp | 501 - .../llvm/tools/bugpoint/ExtractFunction.cpp | 369 - contrib/llvm/tools/bugpoint/FindBugs.cpp | 113 - contrib/llvm/tools/bugpoint/ListReducer.h | 201 - contrib/llvm/tools/bugpoint/Makefile | 16 - .../llvm/tools/bugpoint/Miscompilation.cpp | 1082 - .../llvm/tools/bugpoint/OptimizerDriver.cpp | 260 - contrib/llvm/tools/bugpoint/ToolRunner.cpp | 883 - contrib/llvm/tools/bugpoint/ToolRunner.h | 242 - contrib/llvm/tools/bugpoint/bugpoint.cpp | 159 - contrib/llvm/tools/clang/CMakeLists.txt | 152 - contrib/llvm/tools/clang/INSTALL.txt | 49 - contrib/llvm/tools/clang/LICENSE.TXT | 63 - contrib/llvm/tools/clang/Makefile | 92 - contrib/llvm/tools/clang/ModuleInfo.txt | 5 - contrib/llvm/tools/clang/NOTES.txt | 85 - contrib/llvm/tools/clang/README.txt | 26 - contrib/llvm/tools/clang/TODO.txt | 75 - .../tools/clang/bindings/python/README.txt | 17 - .../clang/bindings/python/clang/__init__.py | 24 - .../clang/bindings/python/clang/cindex.py | 935 - .../python/examples/cindex/cindex-dump.py | 87 - .../python/examples/cindex/cindex-includes.py | 58 - .../clang/bindings/python/tests/__init__.py | 0 .../python/tests/cindex/INPUTS/header1.h | 6 - .../python/tests/cindex/INPUTS/header2.h | 6 - .../python/tests/cindex/INPUTS/header3.h | 3 - .../python/tests/cindex/INPUTS/hello.cpp | 6 - .../python/tests/cindex/INPUTS/include.cpp | 5 - .../tests/cindex/INPUTS/parse_arguments.c | 2 - .../bindings/python/tests/cindex/__init__.py | 0 .../python/tests/cindex/test_cursor.py | 59 - .../python/tests/cindex/test_cursor_kind.py | 27 - .../python/tests/cindex/test_diagnostics.py | 48 - .../python/tests/cindex/test_index.py | 15 - .../tests/cindex/test_translation_unit.py | 73 - .../llvm/tools/clang/include/CMakeLists.txt | 1 - contrib/llvm/tools/clang/include/Makefile | 4 - .../llvm/tools/clang/include/clang-c/Makefile | 31 - .../clang/include/clang/AST/CMakeLists.txt | 24 - .../tools/clang/include/clang/AST/Makefile | 29 - .../clang/include/clang/Basic/CMakeLists.txt | 32 - .../tools/clang/include/clang/Basic/Makefile | 56 - .../clang/include/clang/Basic/Version.inc.in | 6 - .../tools/clang/include/clang/CMakeLists.txt | 4 - .../clang/include/clang/Driver/CMakeLists.txt | 17 - .../tools/clang/include/clang/Driver/Makefile | 18 - .../llvm/tools/clang/include/clang/Makefile | 31 - .../clang/Serialization/CMakeLists.txt | 12 - .../include/clang/Serialization/Makefile | 19 - .../llvm/tools/clang/lib/AST/CMakeLists.txt | 46 - contrib/llvm/tools/clang/lib/AST/Makefile | 18 - .../tools/clang/lib/Analysis/CMakeLists.txt | 17 - .../llvm/tools/clang/lib/Analysis/Makefile | 18 - .../llvm/tools/clang/lib/Basic/CMakeLists.txt | 39 - contrib/llvm/tools/clang/lib/Basic/Makefile | 29 - contrib/llvm/tools/clang/lib/CMakeLists.txt | 15 - .../tools/clang/lib/Checker/CMakeLists.txt | 84 - contrib/llvm/tools/clang/lib/Checker/Makefile | 18 - .../tools/clang/lib/CodeGen/CMakeLists.txt | 41 - contrib/llvm/tools/clang/lib/CodeGen/Makefile | 19 - .../llvm/tools/clang/lib/CodeGen/README.txt | 47 - .../tools/clang/lib/Driver/CMakeLists.txt | 25 - contrib/llvm/tools/clang/lib/Driver/Makefile | 13 - .../tools/clang/lib/Frontend/CMakeLists.txt | 45 - .../llvm/tools/clang/lib/Frontend/Makefile | 14 - .../clang/lib/FrontendTool/CMakeLists.txt | 5 - .../tools/clang/lib/FrontendTool/Makefile | 13 - .../tools/clang/lib/Headers/CMakeLists.txt | 50 - contrib/llvm/tools/clang/lib/Headers/Makefile | 54 - .../llvm/tools/clang/lib/Index/CMakeLists.txt | 15 - contrib/llvm/tools/clang/lib/Index/Makefile | 18 - .../llvm/tools/clang/lib/Lex/CMakeLists.txt | 27 - contrib/llvm/tools/clang/lib/Lex/Makefile | 24 - contrib/llvm/tools/clang/lib/Makefile | 15 - .../llvm/tools/clang/lib/Parse/CMakeLists.txt | 19 - contrib/llvm/tools/clang/lib/Parse/Makefile | 18 - .../tools/clang/lib/Rewrite/CMakeLists.txt | 21 - contrib/llvm/tools/clang/lib/Rewrite/Makefile | 18 - .../llvm/tools/clang/lib/Sema/CMakeLists.txt | 39 - contrib/llvm/tools/clang/lib/Sema/Makefile | 19 - .../clang/lib/Serialization/CMakeLists.txt | 23 - .../tools/clang/lib/Serialization/Makefile | 19 - contrib/llvm/tools/clang/runtime/Makefile | 104 - contrib/llvm/tools/clang/tools/CMakeLists.txt | 3 - contrib/llvm/tools/clang/tools/Makefile | 19 - .../clang/tools/c-index-test/CMakeLists.txt | 30 - .../tools/clang/tools/c-index-test/Makefile | 21 - .../clang/tools/c-index-test/c-index-test.c | 1524 -- .../tools/clang/tools/driver/CMakeLists.txt | 54 - .../tools/clang/tools/driver/Info.plist.in | 18 - .../llvm/tools/clang/tools/driver/Makefile | 66 - .../tools/clang/tools/libclang/CIndex.cpp | 3795 --- .../tools/clang/tools/libclang/CIndexCXX.cpp | 124 - .../tools/libclang/CIndexCodeCompletion.cpp | 822 - .../clang/tools/libclang/CIndexDiagnostic.cpp | 272 - .../clang/tools/libclang/CIndexDiagnostic.h | 53 - .../tools/libclang/CIndexInclusionStack.cpp | 67 - .../tools/clang/tools/libclang/CIndexUSRs.cpp | 847 - .../tools/clang/tools/libclang/CIndexer.cpp | 155 - .../tools/clang/tools/libclang/CIndexer.h | 78 - .../tools/clang/tools/libclang/CMakeLists.txt | 64 - .../tools/clang/tools/libclang/CXCursor.cpp | 374 - .../tools/clang/tools/libclang/CXCursor.h | 138 - .../clang/tools/libclang/CXSourceLocation.h | 78 - .../tools/clang/tools/libclang/CXType.cpp | 297 - .../llvm/tools/clang/tools/libclang/CXType.h | 29 - .../llvm/tools/clang/tools/libclang/Makefile | 46 - .../tools/libclang/libclang.darwin.exports | 108 - .../clang/tools/libclang/libclang.exports | 108 - .../tools/clang/tools/scan-build/c++-analyzer | 1 - .../tools/clang/tools/scan-build/ccc-analyzer | 661 - .../tools/clang/tools/scan-build/scan-build | 1265 - .../tools/clang/tools/scan-build/scanview.css | 62 - .../clang/tools/scan-build/set-xcode-analyzer | 77 - .../tools/clang/tools/scan-build/sorttable.js | 493 - .../tools/clang/tools/scan-view/Reporter.py | 248 - .../tools/scan-view/Resources/FileRadar.scpt | Bin 18418 -> 0 bytes .../scan-view/Resources/GetRadarVersion.scpt | 0 .../tools/scan-view/Resources/bugcatcher.ico | Bin 318 -> 0 bytes .../tools/clang/tools/scan-view/ScanView.py | 770 - .../tools/clang/tools/scan-view/scan-view | 131 - .../tools/clang/tools/scan-view/startfile.py | 203 - .../tools/clang/utils/ABITest/ABITestGen.py | 653 - .../tools/clang/utils/ABITest/Enumeration.py | 276 - .../clang/utils/ABITest/Makefile.test.common | 170 - .../llvm/tools/clang/utils/ABITest/TypeGen.py | 462 - .../utils/ABITest/build-and-summarize-all.sh | 15 - .../utils/ABITest/build-and-summarize.sh | 14 - .../llvm/tools/clang/utils/ABITest/build.sh | 12 - .../tools/clang/utils/ABITest/layout/Makefile | 68 - .../utils/ABITest/return-types-32/Makefile | 7 - .../utils/ABITest/return-types-64/Makefile | 7 - .../utils/ABITest/single-args-32/Makefile | 7 - .../utils/ABITest/single-args-64/Makefile | 13 - .../tools/clang/utils/ABITest/summarize.sh | 15 - .../C++Tests/Clang-Code-Compile/lit.local.cfg | 26 - .../C++Tests/Clang-Code-Syntax/lit.local.cfg | 25 - .../utils/C++Tests/Clang-Syntax/lit.local.cfg | 24 - .../C++Tests/LLVM-Code-Compile/lit.local.cfg | 56 - .../C++Tests/LLVM-Code-Symbols/check-symbols | 54 - .../C++Tests/LLVM-Code-Symbols/lit.local.cfg | 56 - .../C++Tests/LLVM-Code-Syntax/lit.local.cfg | 54 - .../utils/C++Tests/LLVM-Syntax/lit.local.cfg | 24 - .../llvm/tools/clang/utils/C++Tests/lit.cfg | 27 - .../C++Tests/stdc++-Syntax/lit.local.cfg | 17 - .../utils/CIndex/completion_logger_server.py | 44 - contrib/llvm/tools/clang/utils/CaptureCmd | 73 - contrib/llvm/tools/clang/utils/CmpDriver | 210 - contrib/llvm/tools/clang/utils/FindSpecRefs | 910 - contrib/llvm/tools/clang/utils/FuzzTest | 340 - .../utils/OptionalTests/Extra/README.txt | 3 - .../Extra/Runtime/darwin-clang_rt.c | 338 - .../clang/utils/OptionalTests/README.txt | 4 - .../tools/clang/utils/OptionalTests/lit.cfg | 26 - .../llvm/tools/clang/utils/SummarizeErrors | 117 - .../tools/clang/utils/TestUtils/deep-stack.py | 24 - .../tools/clang/utils/TestUtils/pch-test.pl | 61 - .../tools/clang/utils/VtableTest/Makefile | 24 - .../tools/clang/utils/VtableTest/check-zti | 20 - .../tools/clang/utils/VtableTest/check-ztt | 20 - .../tools/clang/utils/VtableTest/check-zvt | 18 - .../llvm/tools/clang/utils/VtableTest/gen.cc | 350 - .../llvm/tools/clang/utils/analyzer/CmpRuns | 230 - .../llvm/tools/clang/utils/analyzer/ubiviz | 74 - .../llvm/tools/clang/utils/builtin-defines.c | 85 - .../clang/utils/clang-completion-mode.el | 257 - contrib/llvm/tools/clang/utils/token-delta.py | 251 - .../x86_64-pc-linux-gnu_gcc-4.3.3.supp | 23 - contrib/llvm/tools/edis/CMakeLists.txt | 13 - contrib/llvm/tools/edis/EDMain.cpp | 284 - .../tools/edis/EnhancedDisassembly.exports | 36 - contrib/llvm/tools/edis/Makefile | 54 - contrib/llvm/tools/gold/Makefile | 32 - contrib/llvm/tools/gold/README.txt | 21 - contrib/llvm/tools/gold/gold-plugin.cpp | 519 - contrib/llvm/tools/gold/gold.exports | 1 - contrib/llvm/tools/llc/CMakeLists.txt | 5 - contrib/llvm/tools/llc/Makefile | 21 - contrib/llvm/tools/llc/llc.cpp | 330 - contrib/llvm/tools/lli/CMakeLists.txt | 5 - contrib/llvm/tools/lli/Makefile | 15 - contrib/llvm/tools/lli/lli.cpp | 254 - contrib/llvm/tools/llvm-ar/CMakeLists.txt | 8 - contrib/llvm/tools/llvm-ar/Makefile | 25 - contrib/llvm/tools/llvm-ar/llvm-ar.cpp | 779 - contrib/llvm/tools/llvm-as/CMakeLists.txt | 6 - contrib/llvm/tools/llvm-as/Makefile | 17 - contrib/llvm/tools/llvm-as/llvm-as.cpp | 119 - .../llvm/tools/llvm-bcanalyzer/CMakeLists.txt | 6 - contrib/llvm/tools/llvm-bcanalyzer/Makefile | 17 - .../tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp | 625 - contrib/llvm/tools/llvm-config/CMakeLists.txt | 146 - contrib/llvm/tools/llvm-config/Makefile | 131 - contrib/llvm/tools/llvm-config/find-cycles.pl | 170 - .../llvm/tools/llvm-config/llvm-config.in.in | 460 - contrib/llvm/tools/llvm-diff/CMakeLists.txt | 6 - .../llvm/tools/llvm-diff/DifferenceEngine.cpp | 676 - .../llvm/tools/llvm-diff/DifferenceEngine.h | 179 - contrib/llvm/tools/llvm-diff/Makefile | 17 - contrib/llvm/tools/llvm-diff/llvm-diff.cpp | 331 - contrib/llvm/tools/llvm-dis/CMakeLists.txt | 6 - contrib/llvm/tools/llvm-dis/Makefile | 17 - contrib/llvm/tools/llvm-dis/llvm-dis.cpp | 138 - .../llvm/tools/llvm-extract/CMakeLists.txt | 5 - contrib/llvm/tools/llvm-extract/Makefile | 18 - .../llvm/tools/llvm-extract/llvm-extract.cpp | 147 - contrib/llvm/tools/llvm-ld/CMakeLists.txt | 6 - contrib/llvm/tools/llvm-ld/Makefile | 15 - contrib/llvm/tools/llvm-ld/Optimize.cpp | 128 - contrib/llvm/tools/llvm-ld/llvm-ld.cpp | 724 - contrib/llvm/tools/llvm-link/CMakeLists.txt | 5 - contrib/llvm/tools/llvm-link/Makefile | 17 - contrib/llvm/tools/llvm-link/llvm-link.cpp | 141 - contrib/llvm/tools/llvm-mc/CMakeLists.txt | 6 - contrib/llvm/tools/llvm-mc/Disassembler.cpp | 338 - contrib/llvm/tools/llvm-mc/Disassembler.h | 40 - contrib/llvm/tools/llvm-mc/Makefile | 24 - contrib/llvm/tools/llvm-mc/llvm-mc.cpp | 410 - contrib/llvm/tools/llvm-nm/CMakeLists.txt | 5 - contrib/llvm/tools/llvm-nm/Makefile | 17 - contrib/llvm/tools/llvm-nm/llvm-nm.cpp | 199 - contrib/llvm/tools/llvm-prof/CMakeLists.txt | 5 - contrib/llvm/tools/llvm-prof/Makefile | 17 - contrib/llvm/tools/llvm-prof/llvm-prof.cpp | 291 - contrib/llvm/tools/llvm-ranlib/CMakeLists.txt | 6 - contrib/llvm/tools/llvm-ranlib/Makefile | 18 - .../llvm/tools/llvm-ranlib/llvm-ranlib.cpp | 101 - contrib/llvm/tools/llvm-shlib/Makefile | 111 - contrib/llvm/tools/llvm-stub/CMakeLists.txt | 3 - contrib/llvm/tools/llvm-stub/Makefile | 13 - contrib/llvm/tools/llvm-stub/llvm-stub.c | 73 - contrib/llvm/tools/llvmc/CMakeLists.txt | 4 - contrib/llvm/tools/llvmc/Makefile | 18 - .../llvm/tools/llvmc/doc/LLVMC-Reference.rst | 839 - .../llvm/tools/llvmc/doc/LLVMC-Tutorial.rst | 129 - contrib/llvm/tools/llvmc/doc/Makefile | 33 - contrib/llvm/tools/llvmc/doc/img/lines.gif | Bin 91 -> 0 bytes contrib/llvm/tools/llvmc/src/AutoGenerated.td | 17 - contrib/llvm/tools/llvmc/src/Base.td.in | 382 - contrib/llvm/tools/llvmc/src/Clang.td | 87 - contrib/llvm/tools/llvmc/src/Hooks.cpp | 33 - contrib/llvm/tools/llvmc/src/Main.cpp | 16 - contrib/llvm/tools/llvmc/src/Makefile | 14 - contrib/llvm/tools/lto/LTOCodeGenerator.cpp | 442 - contrib/llvm/tools/lto/LTOCodeGenerator.h | 72 - contrib/llvm/tools/lto/LTOModule.cpp | 508 - contrib/llvm/tools/lto/LTOModule.h | 111 - contrib/llvm/tools/lto/Makefile | 54 - contrib/llvm/tools/lto/lto.cpp | 283 - contrib/llvm/tools/lto/lto.exports | 26 - contrib/llvm/tools/opt/AnalysisWrappers.cpp | 94 - contrib/llvm/tools/opt/CMakeLists.txt | 8 - contrib/llvm/tools/opt/GraphPrinters.cpp | 123 - contrib/llvm/tools/opt/Makefile | 14 - contrib/llvm/tools/opt/PrintSCC.cpp | 112 - contrib/llvm/tools/opt/opt.cpp | 557 - contrib/llvm/utils/DSAclean.py | 32 - contrib/llvm/utils/DSAextract.py | 111 - contrib/llvm/utils/FileCheck/CMakeLists.txt | 11 - contrib/llvm/utils/FileCheck/FileCheck.cpp | 732 - contrib/llvm/utils/FileCheck/Makefile | 21 - contrib/llvm/utils/FileUpdate/CMakeLists.txt | 11 - contrib/llvm/utils/FileUpdate/FileUpdate.cpp | 87 - contrib/llvm/utils/FileUpdate/Makefile | 21 - contrib/llvm/utils/GenLibDeps.pl | 388 - contrib/llvm/utils/GetSourceVersion | 27 - contrib/llvm/utils/Makefile | 22 - contrib/llvm/utils/Misc/zkill | 276 - contrib/llvm/utils/NLT.schema | 8 - contrib/llvm/utils/NewNightlyTest.pl | 836 - contrib/llvm/utils/NightlyTest.gnuplot | 214 - contrib/llvm/utils/NightlyTestTemplate.html | 244 - contrib/llvm/utils/OldenDataRecover.pl | 37 - contrib/llvm/utils/PerfectShuffle/Makefile | 18 - .../utils/PerfectShuffle/PerfectShuffle.cpp | 571 - contrib/llvm/utils/TableGen/CMakeLists.txt | 46 - contrib/llvm/utils/TableGen/Makefile | 20 - contrib/llvm/utils/UpdateCMakeLists.pl | 119 - .../llvm/utils/bugpoint/RemoteRunSafely.sh | 105 - contrib/llvm/utils/buildit/GNUmakefile | 131 - contrib/llvm/utils/buildit/build_llvm | 373 - contrib/llvm/utils/cgiplotNLT.pl | 68 - contrib/llvm/utils/check-each-file | 150 - contrib/llvm/utils/codegen-diff | 135 - contrib/llvm/utils/count/CMakeLists.txt | 3 - contrib/llvm/utils/count/Makefile | 20 - contrib/llvm/utils/count/count.c | 50 - contrib/llvm/utils/countloc.sh | 40 - contrib/llvm/utils/crosstool/ARM/README | 37 - .../crosstool/ARM/build-install-linux.sh | 200 - .../llvm/utils/crosstool/create-snapshots.sh | 41 - contrib/llvm/utils/emacs/README | 27 - contrib/llvm/utils/emacs/emacs.el | 39 - contrib/llvm/utils/emacs/llvm-mode.el | 128 - contrib/llvm/utils/emacs/tablegen-mode.el | 124 - contrib/llvm/utils/findmisopt | 178 - contrib/llvm/utils/findoptdiff | 101 - contrib/llvm/utils/findsym.pl | 33 - contrib/llvm/utils/fpcmp/Makefile | 16 - contrib/llvm/utils/fpcmp/fpcmp.cpp | 43 - contrib/llvm/utils/getsrcs.sh | 34 - contrib/llvm/utils/git/find-rev | 50 - contrib/llvm/utils/importNLT.pl | 86 - contrib/llvm/utils/jedit/README | 14 - contrib/llvm/utils/jedit/tablegen.xml | 39 - contrib/llvm/utils/lint/common_lint.py | 97 - contrib/llvm/utils/lint/cpp_lint.py | 94 - contrib/llvm/utils/lint/generic_lint.py | 24 - .../utils/lint/remove_trailing_whitespace.sh | 6 - contrib/llvm/utils/lit/TODO | 19 - contrib/llvm/utils/lit/lit.py | 5 - .../lit/lit/ExampleTests.ObjDir/lit.site.cfg | 15 - .../lit/lit/ExampleTests/Clang/fsyntax-only.c | 4 - .../utils/lit/lit/ExampleTests/Clang/lit.cfg | 47 - .../LLVM.InTree/test/Bar/bar-test.ll | 3 - .../ExampleTests/LLVM.InTree/test/Bar/dg.exp | 6 - .../lit/ExampleTests/LLVM.InTree/test/lit.cfg | 151 - .../LLVM.InTree/test/lit.site.cfg | 10 - .../ExampleTests/LLVM.InTree/test/site.exp | 28 - .../ExampleTests/LLVM.OutOfTree/lit.local.cfg | 1 - .../LLVM.OutOfTree/obj/test/Foo/lit.local.cfg | 0 .../LLVM.OutOfTree/obj/test/lit.site.cfg | 11 - .../LLVM.OutOfTree/obj/test/site.exp | 28 - .../LLVM.OutOfTree/src/test/Foo/data.txt | 1 - .../LLVM.OutOfTree/src/test/Foo/dg.exp | 6 - .../LLVM.OutOfTree/src/test/Foo/pct-S.ll | 1 - .../LLVM.OutOfTree/src/test/lit.cfg | 151 - .../lit/ExampleTests/ShExternal/lit.local.cfg | 6 - .../lit/ExampleTests/ShInternal/lit.local.cfg | 6 - .../lit/ExampleTests/TclTest/lit.local.cfg | 5 - .../lit/ExampleTests/TclTest/stderr-pipe.ll | 1 - .../lit/ExampleTests/TclTest/tcl-redir-1.ll | 7 - .../llvm/utils/lit/lit/ExampleTests/fail.c | 2 - .../llvm/utils/lit/lit/ExampleTests/lit.cfg | 26 - .../llvm/utils/lit/lit/ExampleTests/pass.c | 1 - .../lit/ExampleTests/required-and-missing.c | 4 - .../lit/ExampleTests/required-and-present.c | 2 - .../llvm/utils/lit/lit/ExampleTests/xfail.c | 2 - .../llvm/utils/lit/lit/ExampleTests/xpass.c | 2 - contrib/llvm/utils/lit/lit/LitConfig.py | 112 - contrib/llvm/utils/lit/lit/LitFormats.py | 2 - contrib/llvm/utils/lit/lit/LitTestCase.py | 30 - contrib/llvm/utils/lit/lit/ProgressBar.py | 267 - contrib/llvm/utils/lit/lit/ShCommands.py | 85 - contrib/llvm/utils/lit/lit/ShUtil.py | 353 - contrib/llvm/utils/lit/lit/TclUtil.py | 322 - contrib/llvm/utils/lit/lit/Test.py | 79 - contrib/llvm/utils/lit/lit/TestFormats.py | 221 - contrib/llvm/utils/lit/lit/TestRunner.py | 586 - contrib/llvm/utils/lit/lit/TestingConfig.py | 101 - contrib/llvm/utils/lit/lit/Util.py | 125 - contrib/llvm/utils/lit/lit/__init__.py | 10 - contrib/llvm/utils/lit/lit/lit.py | 648 - contrib/llvm/utils/lit/setup.py | 69 - contrib/llvm/utils/llvm-lit/Makefile | 21 - contrib/llvm/utils/llvm-lit/llvm-lit.in | 21 - contrib/llvm/utils/llvm-native-gcc | 249 - contrib/llvm/utils/llvm-native-gxx | 249 - contrib/llvm/utils/llvm.grm | 418 - contrib/llvm/utils/llvmdo | 184 - contrib/llvm/utils/llvmgrep | 39 - contrib/llvm/utils/makellvm | 145 - contrib/llvm/utils/not/CMakeLists.txt | 11 - contrib/llvm/utils/not/Makefile | 21 - contrib/llvm/utils/not/not.cpp | 17 - contrib/llvm/utils/parseNLT.pl | 34 - contrib/llvm/utils/plotNLT.pl | 53 - contrib/llvm/utils/profile.pl | 74 - contrib/llvm/utils/unittest/Makefile | 13 - .../llvm/utils/unittest/UnitTestMain/Makefile | 30 - .../utils/unittest/UnitTestMain/TestMain.cpp | 15 - .../utils/unittest/googletest/LICENSE.TXT | 28 - .../llvm/utils/unittest/googletest/Makefile | 39 - .../utils/unittest/googletest/README.LLVM | 31 - .../unittest/googletest/gtest-death-test.cc | 1172 - .../unittest/googletest/gtest-filepath.cc | 380 - .../utils/unittest/googletest/gtest-port.cc | 711 - .../unittest/googletest/gtest-test-part.cc | 110 - .../unittest/googletest/gtest-typed-test.cc | 110 - .../llvm/utils/unittest/googletest/gtest.cc | 4704 ---- .../include/gtest/gtest-death-test.h | 283 - .../googletest/include/gtest/gtest-message.h | 230 - .../include/gtest/gtest-param-test.h | 1397 - .../googletest/include/gtest/gtest-spi.h | 232 - .../include/gtest/gtest-test-part.h | 176 - .../include/gtest/gtest-typed-test.h | 259 - .../unittest/googletest/include/gtest/gtest.h | 2052 -- .../include/gtest/gtest_pred_impl.h | 368 - .../googletest/include/gtest/gtest_prod.h | 58 - .../internal/gtest-death-test-internal.h | 275 - .../include/gtest/internal/gtest-filepath.h | 210 - .../gtest/internal/gtest-internal-inl.h | 1074 - .../include/gtest/internal/gtest-internal.h | 943 - .../include/gtest/internal/gtest-linked_ptr.h | 243 - .../internal/gtest-param-util-generated.h | 4820 ---- .../include/gtest/internal/gtest-param-util.h | 619 - .../include/gtest/internal/gtest-port.h | 1501 -- .../include/gtest/internal/gtest-string.h | 350 - .../include/gtest/internal/gtest-tuple.h | 968 - .../include/gtest/internal/gtest-type-util.h | 3321 --- .../utils/valgrind/i386-pc-linux-gnu.supp | 41 - .../utils/valgrind/x86_64-pc-linux-gnu.supp | 46 - contrib/llvm/utils/vim/README | 43 - contrib/llvm/utils/vim/llvm.vim | 109 - contrib/llvm/utils/vim/tablegen.vim | 54 - contrib/llvm/utils/vim/vimrc | 220 - contrib/llvm/utils/webNLT.pl | 83 - 721 files changed, 162290 deletions(-) delete mode 100644 contrib/llvm/CMakeLists.txt delete mode 100644 contrib/llvm/CREDITS.TXT delete mode 100644 contrib/llvm/LICENSE.TXT delete mode 100644 contrib/llvm/Makefile delete mode 100644 contrib/llvm/Makefile.common delete mode 100644 contrib/llvm/Makefile.config.in delete mode 100644 contrib/llvm/Makefile.rules delete mode 100644 contrib/llvm/ModuleInfo.txt delete mode 100644 contrib/llvm/README.txt delete mode 100755 contrib/llvm/autoconf/AutoRegen.sh delete mode 100644 contrib/llvm/autoconf/ExportMap.map delete mode 100644 contrib/llvm/autoconf/LICENSE.TXT delete mode 100644 contrib/llvm/autoconf/README.TXT delete mode 100755 contrib/llvm/autoconf/config.guess delete mode 100755 contrib/llvm/autoconf/config.sub delete mode 100644 contrib/llvm/autoconf/configure.ac delete mode 100755 contrib/llvm/autoconf/depcomp delete mode 100755 contrib/llvm/autoconf/install-sh delete mode 100644 contrib/llvm/autoconf/ltmain.sh delete mode 100644 contrib/llvm/autoconf/m4/build_exeext.m4 delete mode 100644 contrib/llvm/autoconf/m4/c_printf_a.m4 delete mode 100644 contrib/llvm/autoconf/m4/check_gnu_make.m4 delete mode 100644 contrib/llvm/autoconf/m4/config_makefile.m4 delete mode 100644 contrib/llvm/autoconf/m4/config_project.m4 delete mode 100644 contrib/llvm/autoconf/m4/cxx_flag_check.m4 delete mode 100644 contrib/llvm/autoconf/m4/find_std_program.m4 delete mode 100644 contrib/llvm/autoconf/m4/func_isinf.m4 delete mode 100644 contrib/llvm/autoconf/m4/func_isnan.m4 delete mode 100644 contrib/llvm/autoconf/m4/func_mmap_file.m4 delete mode 100644 contrib/llvm/autoconf/m4/header_mmap_anonymous.m4 delete mode 100644 contrib/llvm/autoconf/m4/huge_val.m4 delete mode 100644 contrib/llvm/autoconf/m4/libtool.m4 delete mode 100644 contrib/llvm/autoconf/m4/link_options.m4 delete mode 100644 contrib/llvm/autoconf/m4/linux_mixed_64_32.m4 delete mode 100644 contrib/llvm/autoconf/m4/ltdl.m4 delete mode 100644 contrib/llvm/autoconf/m4/need_dev_zero_for_mmap.m4 delete mode 100644 contrib/llvm/autoconf/m4/path_perl.m4 delete mode 100644 contrib/llvm/autoconf/m4/path_tclsh.m4 delete mode 100644 contrib/llvm/autoconf/m4/rand48.m4 delete mode 100644 contrib/llvm/autoconf/m4/sanity_check.m4 delete mode 100644 contrib/llvm/autoconf/m4/single_cxx_check.m4 delete mode 100644 contrib/llvm/autoconf/m4/visibility_inlines_hidden.m4 delete mode 100755 contrib/llvm/autoconf/missing delete mode 100755 contrib/llvm/autoconf/mkinstalldirs delete mode 100644 contrib/llvm/bindings/Makefile delete mode 100644 contrib/llvm/bindings/README.txt delete mode 100644 contrib/llvm/bindings/ada/analysis/llvm_analysis-binding.ads delete mode 100644 contrib/llvm/bindings/ada/analysis/llvm_analysis.ads delete mode 100644 contrib/llvm/bindings/ada/analysis/llvm_analysis_wrap.cxx delete mode 100644 contrib/llvm/bindings/ada/bitreader/llvm_bit_reader-binding.ads delete mode 100644 contrib/llvm/bindings/ada/bitreader/llvm_bit_reader.ads delete mode 100644 contrib/llvm/bindings/ada/bitreader/llvm_bitreader_wrap.cxx delete mode 100644 contrib/llvm/bindings/ada/bitwriter/llvm_bit_writer-binding.ads delete mode 100644 contrib/llvm/bindings/ada/bitwriter/llvm_bit_writer.ads delete mode 100644 contrib/llvm/bindings/ada/bitwriter/llvm_bitwriter_wrap.cxx delete mode 100644 contrib/llvm/bindings/ada/executionengine/llvm_execution_engine-binding.ads delete mode 100644 contrib/llvm/bindings/ada/executionengine/llvm_execution_engine.ads delete mode 100644 contrib/llvm/bindings/ada/executionengine/llvm_executionengine_wrap.cxx delete mode 100644 contrib/llvm/bindings/ada/llvm.gpr delete mode 100644 contrib/llvm/bindings/ada/llvm/llvm-binding.ads delete mode 100644 contrib/llvm/bindings/ada/llvm/llvm.ads delete mode 100644 contrib/llvm/bindings/ada/llvm/llvm_link_time_optimizer-binding.ads delete mode 100644 contrib/llvm/bindings/ada/llvm/llvm_link_time_optimizer.ads delete mode 100644 contrib/llvm/bindings/ada/llvm/llvm_linktimeoptimizer_wrap.cxx delete mode 100644 contrib/llvm/bindings/ada/llvm/llvm_wrap.cxx delete mode 100644 contrib/llvm/bindings/ada/target/llvm_target-binding.ads delete mode 100644 contrib/llvm/bindings/ada/target/llvm_target.ads delete mode 100644 contrib/llvm/bindings/ada/target/llvm_target_wrap.cxx delete mode 100644 contrib/llvm/bindings/ada/transforms/llvm_transforms-binding.ads delete mode 100644 contrib/llvm/bindings/ada/transforms/llvm_transforms.ads delete mode 100644 contrib/llvm/bindings/ada/transforms/llvm_transforms_wrap.cxx delete mode 100644 contrib/llvm/bindings/ocaml/Makefile delete mode 100644 contrib/llvm/bindings/ocaml/Makefile.ocaml delete mode 100644 contrib/llvm/bindings/ocaml/analysis/Makefile delete mode 100644 contrib/llvm/bindings/ocaml/analysis/analysis_ocaml.c delete mode 100644 contrib/llvm/bindings/ocaml/analysis/llvm_analysis.ml delete mode 100644 contrib/llvm/bindings/ocaml/analysis/llvm_analysis.mli delete mode 100644 contrib/llvm/bindings/ocaml/bitreader/Makefile delete mode 100644 contrib/llvm/bindings/ocaml/bitreader/bitreader_ocaml.c delete mode 100644 contrib/llvm/bindings/ocaml/bitreader/llvm_bitreader.ml delete mode 100644 contrib/llvm/bindings/ocaml/bitreader/llvm_bitreader.mli delete mode 100644 contrib/llvm/bindings/ocaml/bitwriter/Makefile delete mode 100644 contrib/llvm/bindings/ocaml/bitwriter/bitwriter_ocaml.c delete mode 100644 contrib/llvm/bindings/ocaml/bitwriter/llvm_bitwriter.ml delete mode 100644 contrib/llvm/bindings/ocaml/bitwriter/llvm_bitwriter.mli delete mode 100644 contrib/llvm/bindings/ocaml/executionengine/Makefile delete mode 100644 contrib/llvm/bindings/ocaml/executionengine/executionengine_ocaml.c delete mode 100644 contrib/llvm/bindings/ocaml/executionengine/llvm_executionengine.ml delete mode 100644 contrib/llvm/bindings/ocaml/executionengine/llvm_executionengine.mli delete mode 100644 contrib/llvm/bindings/ocaml/llvm/Makefile delete mode 100644 contrib/llvm/bindings/ocaml/llvm/llvm.ml delete mode 100644 contrib/llvm/bindings/ocaml/llvm/llvm.mli delete mode 100644 contrib/llvm/bindings/ocaml/llvm/llvm_ocaml.c delete mode 100644 contrib/llvm/bindings/ocaml/target/Makefile delete mode 100644 contrib/llvm/bindings/ocaml/target/llvm_target.ml delete mode 100644 contrib/llvm/bindings/ocaml/target/llvm_target.mli delete mode 100644 contrib/llvm/bindings/ocaml/target/target_ocaml.c delete mode 100644 contrib/llvm/bindings/ocaml/transforms/Makefile delete mode 100644 contrib/llvm/bindings/ocaml/transforms/scalar/Makefile delete mode 100644 contrib/llvm/bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml delete mode 100644 contrib/llvm/bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli delete mode 100644 contrib/llvm/bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c delete mode 100755 contrib/llvm/build-for-llvm-top.sh delete mode 100755 contrib/llvm/configure delete mode 100644 contrib/llvm/include/llvm/CMakeLists.txt delete mode 100644 contrib/llvm/include/llvm/Config/AsmParsers.def.in delete mode 100644 contrib/llvm/include/llvm/Config/AsmPrinters.def.in delete mode 100644 contrib/llvm/include/llvm/Config/Disassemblers.def.in delete mode 100644 contrib/llvm/include/llvm/Config/Targets.def.in delete mode 100644 contrib/llvm/include/llvm/Config/config.h.cmake delete mode 100644 contrib/llvm/include/llvm/Config/config.h.in delete mode 100644 contrib/llvm/include/llvm/Config/llvm-config.h.cmake delete mode 100644 contrib/llvm/include/llvm/Config/llvm-config.h.in delete mode 100644 contrib/llvm/include/llvm/System/DataTypes.h.cmake delete mode 100644 contrib/llvm/include/llvm/System/DataTypes.h.in delete mode 100644 contrib/llvm/include/llvm/System/LICENSE.TXT delete mode 100644 contrib/llvm/lib/Analysis/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Analysis/IPA/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Analysis/IPA/Makefile delete mode 100644 contrib/llvm/lib/Analysis/Makefile delete mode 100644 contrib/llvm/lib/Analysis/README.txt delete mode 100644 contrib/llvm/lib/Archive/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Archive/Makefile delete mode 100644 contrib/llvm/lib/AsmParser/CMakeLists.txt delete mode 100644 contrib/llvm/lib/AsmParser/Makefile delete mode 100644 contrib/llvm/lib/Bitcode/Makefile delete mode 100644 contrib/llvm/lib/Bitcode/Reader/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Bitcode/Reader/Makefile delete mode 100644 contrib/llvm/lib/Bitcode/Writer/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Bitcode/Writer/Makefile delete mode 100644 contrib/llvm/lib/CodeGen/AsmPrinter/CMakeLists.txt delete mode 100644 contrib/llvm/lib/CodeGen/AsmPrinter/Makefile delete mode 100644 contrib/llvm/lib/CodeGen/CMakeLists.txt delete mode 100644 contrib/llvm/lib/CodeGen/Makefile delete mode 100644 contrib/llvm/lib/CodeGen/README.txt delete mode 100644 contrib/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt delete mode 100644 contrib/llvm/lib/CodeGen/SelectionDAG/Makefile delete mode 100644 contrib/llvm/lib/CompilerDriver/CMakeLists.txt delete mode 100644 contrib/llvm/lib/CompilerDriver/Makefile delete mode 100644 contrib/llvm/lib/ExecutionEngine/CMakeLists.txt delete mode 100644 contrib/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt delete mode 100644 contrib/llvm/lib/ExecutionEngine/Interpreter/Makefile delete mode 100644 contrib/llvm/lib/ExecutionEngine/JIT/CMakeLists.txt delete mode 100644 contrib/llvm/lib/ExecutionEngine/JIT/Makefile delete mode 100644 contrib/llvm/lib/ExecutionEngine/Makefile delete mode 100644 contrib/llvm/lib/Linker/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Linker/Makefile delete mode 100644 contrib/llvm/lib/MC/CMakeLists.txt delete mode 100644 contrib/llvm/lib/MC/MCDisassembler/CMakeLists.txt delete mode 100644 contrib/llvm/lib/MC/MCDisassembler/Makefile delete mode 100644 contrib/llvm/lib/MC/MCParser/CMakeLists.txt delete mode 100644 contrib/llvm/lib/MC/MCParser/Makefile delete mode 100644 contrib/llvm/lib/MC/Makefile delete mode 100644 contrib/llvm/lib/Makefile delete mode 100644 contrib/llvm/lib/Support/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Support/COPYRIGHT.regex delete mode 100644 contrib/llvm/lib/Support/Makefile delete mode 100644 contrib/llvm/lib/System/CMakeLists.txt delete mode 100644 contrib/llvm/lib/System/Makefile delete mode 100644 contrib/llvm/lib/System/README.txt delete mode 100644 contrib/llvm/lib/System/Unix/README.txt delete mode 100644 contrib/llvm/lib/Target/ARM/AsmParser/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/ARM/AsmParser/Makefile delete mode 100644 contrib/llvm/lib/Target/ARM/AsmPrinter/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/ARM/AsmPrinter/Makefile delete mode 100644 contrib/llvm/lib/Target/ARM/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/ARM/Disassembler/Makefile delete mode 100644 contrib/llvm/lib/Target/ARM/Makefile delete mode 100644 contrib/llvm/lib/Target/ARM/README-Thumb.txt delete mode 100644 contrib/llvm/lib/Target/ARM/README-Thumb2.txt delete mode 100644 contrib/llvm/lib/Target/ARM/README.txt delete mode 100644 contrib/llvm/lib/Target/ARM/TargetInfo/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/ARM/TargetInfo/Makefile delete mode 100644 contrib/llvm/lib/Target/Alpha/AsmPrinter/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/Alpha/AsmPrinter/Makefile delete mode 100644 contrib/llvm/lib/Target/Alpha/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/Alpha/Makefile delete mode 100644 contrib/llvm/lib/Target/Alpha/README.txt delete mode 100644 contrib/llvm/lib/Target/Alpha/TargetInfo/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/Alpha/TargetInfo/Makefile delete mode 100644 contrib/llvm/lib/Target/Blackfin/AsmPrinter/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/Blackfin/AsmPrinter/Makefile delete mode 100644 contrib/llvm/lib/Target/Blackfin/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/Blackfin/Makefile delete mode 100644 contrib/llvm/lib/Target/Blackfin/README.txt delete mode 100644 contrib/llvm/lib/Target/Blackfin/TargetInfo/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/Blackfin/TargetInfo/Makefile delete mode 100644 contrib/llvm/lib/Target/CBackend/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/CBackend/Makefile delete mode 100644 contrib/llvm/lib/Target/CBackend/TargetInfo/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/CBackend/TargetInfo/Makefile delete mode 100644 contrib/llvm/lib/Target/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/CellSPU/AsmPrinter/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/CellSPU/AsmPrinter/Makefile delete mode 100644 contrib/llvm/lib/Target/CellSPU/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/CellSPU/Makefile delete mode 100644 contrib/llvm/lib/Target/CellSPU/README.txt delete mode 100644 contrib/llvm/lib/Target/CellSPU/TargetInfo/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/CellSPU/TargetInfo/Makefile delete mode 100644 contrib/llvm/lib/Target/CppBackend/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/CppBackend/Makefile delete mode 100644 contrib/llvm/lib/Target/CppBackend/TargetInfo/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/CppBackend/TargetInfo/Makefile delete mode 100644 contrib/llvm/lib/Target/MBlaze/AsmPrinter/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/MBlaze/AsmPrinter/Makefile delete mode 100644 contrib/llvm/lib/Target/MBlaze/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/MBlaze/Makefile delete mode 100644 contrib/llvm/lib/Target/MBlaze/TargetInfo/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/MBlaze/TargetInfo/Makefile delete mode 100644 contrib/llvm/lib/Target/MSP430/AsmPrinter/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/MSP430/AsmPrinter/Makefile delete mode 100644 contrib/llvm/lib/Target/MSP430/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/MSP430/Makefile delete mode 100644 contrib/llvm/lib/Target/MSP430/README.txt delete mode 100644 contrib/llvm/lib/Target/MSP430/TargetInfo/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/MSP430/TargetInfo/Makefile delete mode 100644 contrib/llvm/lib/Target/Makefile delete mode 100644 contrib/llvm/lib/Target/Mips/AsmPrinter/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/Mips/AsmPrinter/Makefile delete mode 100644 contrib/llvm/lib/Target/Mips/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/Mips/Makefile delete mode 100644 contrib/llvm/lib/Target/Mips/TargetInfo/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/Mips/TargetInfo/Makefile delete mode 100644 contrib/llvm/lib/Target/PIC16/AsmPrinter/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/PIC16/AsmPrinter/Makefile delete mode 100644 contrib/llvm/lib/Target/PIC16/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/PIC16/Makefile delete mode 100644 contrib/llvm/lib/Target/PIC16/PIC16Passes/Makefile delete mode 100644 contrib/llvm/lib/Target/PIC16/TargetInfo/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/PIC16/TargetInfo/Makefile delete mode 100644 contrib/llvm/lib/Target/PowerPC/AsmPrinter/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/PowerPC/AsmPrinter/Makefile delete mode 100644 contrib/llvm/lib/Target/PowerPC/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/PowerPC/Makefile delete mode 100644 contrib/llvm/lib/Target/PowerPC/README.txt delete mode 100644 contrib/llvm/lib/Target/PowerPC/README_ALTIVEC.txt delete mode 100644 contrib/llvm/lib/Target/PowerPC/TargetInfo/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/PowerPC/TargetInfo/Makefile delete mode 100644 contrib/llvm/lib/Target/README.txt delete mode 100644 contrib/llvm/lib/Target/Sparc/AsmPrinter/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/Sparc/AsmPrinter/Makefile delete mode 100644 contrib/llvm/lib/Target/Sparc/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/Sparc/Makefile delete mode 100644 contrib/llvm/lib/Target/Sparc/README.txt delete mode 100644 contrib/llvm/lib/Target/Sparc/TargetInfo/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/Sparc/TargetInfo/Makefile delete mode 100644 contrib/llvm/lib/Target/SystemZ/AsmPrinter/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/SystemZ/AsmPrinter/Makefile delete mode 100644 contrib/llvm/lib/Target/SystemZ/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/SystemZ/Makefile delete mode 100644 contrib/llvm/lib/Target/SystemZ/TargetInfo/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/SystemZ/TargetInfo/Makefile delete mode 100644 contrib/llvm/lib/Target/X86/AsmParser/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/X86/AsmParser/Makefile delete mode 100644 contrib/llvm/lib/Target/X86/AsmPrinter/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/X86/AsmPrinter/Makefile delete mode 100644 contrib/llvm/lib/Target/X86/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/X86/Disassembler/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/X86/Disassembler/Makefile delete mode 100644 contrib/llvm/lib/Target/X86/Makefile delete mode 100644 contrib/llvm/lib/Target/X86/README-FPStack.txt delete mode 100644 contrib/llvm/lib/Target/X86/README-MMX.txt delete mode 100644 contrib/llvm/lib/Target/X86/README-SSE.txt delete mode 100644 contrib/llvm/lib/Target/X86/README-UNIMPLEMENTED.txt delete mode 100644 contrib/llvm/lib/Target/X86/README-X86-64.txt delete mode 100644 contrib/llvm/lib/Target/X86/README.txt delete mode 100644 contrib/llvm/lib/Target/X86/TargetInfo/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/X86/TargetInfo/Makefile delete mode 100644 contrib/llvm/lib/Target/X86/X86CompilationCallback_Win64.asm delete mode 100644 contrib/llvm/lib/Target/XCore/AsmPrinter/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/XCore/AsmPrinter/Makefile delete mode 100644 contrib/llvm/lib/Target/XCore/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/XCore/Makefile delete mode 100644 contrib/llvm/lib/Target/XCore/README.txt delete mode 100644 contrib/llvm/lib/Target/XCore/TargetInfo/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Target/XCore/TargetInfo/Makefile delete mode 100644 contrib/llvm/lib/Transforms/Hello/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Transforms/Hello/Hello.cpp delete mode 100644 contrib/llvm/lib/Transforms/Hello/Hello.exports delete mode 100644 contrib/llvm/lib/Transforms/Hello/Makefile delete mode 100644 contrib/llvm/lib/Transforms/IPO/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Transforms/IPO/Makefile delete mode 100644 contrib/llvm/lib/Transforms/InstCombine/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Transforms/InstCombine/Makefile delete mode 100644 contrib/llvm/lib/Transforms/Instrumentation/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Transforms/Instrumentation/Makefile delete mode 100644 contrib/llvm/lib/Transforms/Makefile delete mode 100644 contrib/llvm/lib/Transforms/Scalar/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Transforms/Scalar/Makefile delete mode 100644 contrib/llvm/lib/Transforms/Utils/CMakeLists.txt delete mode 100644 contrib/llvm/lib/Transforms/Utils/Makefile delete mode 100644 contrib/llvm/lib/VMCore/CMakeLists.txt delete mode 100644 contrib/llvm/lib/VMCore/Makefile delete mode 100644 contrib/llvm/llvm.spec.in delete mode 100644 contrib/llvm/runtime/Makefile delete mode 100644 contrib/llvm/runtime/README.txt delete mode 100644 contrib/llvm/runtime/libprofile/BasicBlockTracing.c delete mode 100644 contrib/llvm/runtime/libprofile/CommonProfiling.c delete mode 100644 contrib/llvm/runtime/libprofile/EdgeProfiling.c delete mode 100644 contrib/llvm/runtime/libprofile/Makefile delete mode 100644 contrib/llvm/runtime/libprofile/OptimalEdgeProfiling.c delete mode 100644 contrib/llvm/runtime/libprofile/Profiling.h delete mode 100644 contrib/llvm/runtime/libprofile/libprofile.exports delete mode 100644 contrib/llvm/tools/CMakeLists.txt delete mode 100644 contrib/llvm/tools/Makefile delete mode 100644 contrib/llvm/tools/bugpoint-passes/CMakeLists.txt delete mode 100644 contrib/llvm/tools/bugpoint-passes/Makefile delete mode 100644 contrib/llvm/tools/bugpoint-passes/TestPasses.cpp delete mode 100644 contrib/llvm/tools/bugpoint-passes/bugpoint.exports delete mode 100644 contrib/llvm/tools/bugpoint/BugDriver.cpp delete mode 100644 contrib/llvm/tools/bugpoint/BugDriver.h delete mode 100644 contrib/llvm/tools/bugpoint/CMakeLists.txt delete mode 100644 contrib/llvm/tools/bugpoint/CrashDebugger.cpp delete mode 100644 contrib/llvm/tools/bugpoint/ExecutionDriver.cpp delete mode 100644 contrib/llvm/tools/bugpoint/ExtractFunction.cpp delete mode 100644 contrib/llvm/tools/bugpoint/FindBugs.cpp delete mode 100644 contrib/llvm/tools/bugpoint/ListReducer.h delete mode 100644 contrib/llvm/tools/bugpoint/Makefile delete mode 100644 contrib/llvm/tools/bugpoint/Miscompilation.cpp delete mode 100644 contrib/llvm/tools/bugpoint/OptimizerDriver.cpp delete mode 100644 contrib/llvm/tools/bugpoint/ToolRunner.cpp delete mode 100644 contrib/llvm/tools/bugpoint/ToolRunner.h delete mode 100644 contrib/llvm/tools/bugpoint/bugpoint.cpp delete mode 100644 contrib/llvm/tools/clang/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/INSTALL.txt delete mode 100644 contrib/llvm/tools/clang/LICENSE.TXT delete mode 100644 contrib/llvm/tools/clang/Makefile delete mode 100644 contrib/llvm/tools/clang/ModuleInfo.txt delete mode 100644 contrib/llvm/tools/clang/NOTES.txt delete mode 100644 contrib/llvm/tools/clang/README.txt delete mode 100644 contrib/llvm/tools/clang/TODO.txt delete mode 100644 contrib/llvm/tools/clang/bindings/python/README.txt delete mode 100644 contrib/llvm/tools/clang/bindings/python/clang/__init__.py delete mode 100644 contrib/llvm/tools/clang/bindings/python/clang/cindex.py delete mode 100644 contrib/llvm/tools/clang/bindings/python/examples/cindex/cindex-dump.py delete mode 100644 contrib/llvm/tools/clang/bindings/python/examples/cindex/cindex-includes.py delete mode 100644 contrib/llvm/tools/clang/bindings/python/tests/__init__.py delete mode 100644 contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/header1.h delete mode 100644 contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/header2.h delete mode 100644 contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/header3.h delete mode 100644 contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/hello.cpp delete mode 100644 contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/include.cpp delete mode 100644 contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/parse_arguments.c delete mode 100644 contrib/llvm/tools/clang/bindings/python/tests/cindex/__init__.py delete mode 100644 contrib/llvm/tools/clang/bindings/python/tests/cindex/test_cursor.py delete mode 100644 contrib/llvm/tools/clang/bindings/python/tests/cindex/test_cursor_kind.py delete mode 100644 contrib/llvm/tools/clang/bindings/python/tests/cindex/test_diagnostics.py delete mode 100644 contrib/llvm/tools/clang/bindings/python/tests/cindex/test_index.py delete mode 100644 contrib/llvm/tools/clang/bindings/python/tests/cindex/test_translation_unit.py delete mode 100644 contrib/llvm/tools/clang/include/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/include/Makefile delete mode 100644 contrib/llvm/tools/clang/include/clang-c/Makefile delete mode 100644 contrib/llvm/tools/clang/include/clang/AST/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/include/clang/AST/Makefile delete mode 100644 contrib/llvm/tools/clang/include/clang/Basic/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/include/clang/Basic/Makefile delete mode 100644 contrib/llvm/tools/clang/include/clang/Basic/Version.inc.in delete mode 100644 contrib/llvm/tools/clang/include/clang/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/include/clang/Driver/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/include/clang/Driver/Makefile delete mode 100644 contrib/llvm/tools/clang/include/clang/Makefile delete mode 100644 contrib/llvm/tools/clang/include/clang/Serialization/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/include/clang/Serialization/Makefile delete mode 100644 contrib/llvm/tools/clang/lib/AST/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/lib/AST/Makefile delete mode 100644 contrib/llvm/tools/clang/lib/Analysis/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/lib/Analysis/Makefile delete mode 100644 contrib/llvm/tools/clang/lib/Basic/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/lib/Basic/Makefile delete mode 100644 contrib/llvm/tools/clang/lib/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/lib/Checker/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/lib/Checker/Makefile delete mode 100644 contrib/llvm/tools/clang/lib/CodeGen/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/lib/CodeGen/Makefile delete mode 100644 contrib/llvm/tools/clang/lib/CodeGen/README.txt delete mode 100644 contrib/llvm/tools/clang/lib/Driver/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/lib/Driver/Makefile delete mode 100644 contrib/llvm/tools/clang/lib/Frontend/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/lib/Frontend/Makefile delete mode 100644 contrib/llvm/tools/clang/lib/FrontendTool/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/lib/FrontendTool/Makefile delete mode 100644 contrib/llvm/tools/clang/lib/Headers/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/lib/Headers/Makefile delete mode 100644 contrib/llvm/tools/clang/lib/Index/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/lib/Index/Makefile delete mode 100644 contrib/llvm/tools/clang/lib/Lex/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/lib/Lex/Makefile delete mode 100755 contrib/llvm/tools/clang/lib/Makefile delete mode 100644 contrib/llvm/tools/clang/lib/Parse/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/lib/Parse/Makefile delete mode 100644 contrib/llvm/tools/clang/lib/Rewrite/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/lib/Rewrite/Makefile delete mode 100644 contrib/llvm/tools/clang/lib/Sema/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/lib/Sema/Makefile delete mode 100644 contrib/llvm/tools/clang/lib/Serialization/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/lib/Serialization/Makefile delete mode 100644 contrib/llvm/tools/clang/runtime/Makefile delete mode 100644 contrib/llvm/tools/clang/tools/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/tools/Makefile delete mode 100644 contrib/llvm/tools/clang/tools/c-index-test/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/tools/c-index-test/Makefile delete mode 100644 contrib/llvm/tools/clang/tools/c-index-test/c-index-test.c delete mode 100644 contrib/llvm/tools/clang/tools/driver/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/tools/driver/Info.plist.in delete mode 100644 contrib/llvm/tools/clang/tools/driver/Makefile delete mode 100644 contrib/llvm/tools/clang/tools/libclang/CIndex.cpp delete mode 100644 contrib/llvm/tools/clang/tools/libclang/CIndexCXX.cpp delete mode 100644 contrib/llvm/tools/clang/tools/libclang/CIndexCodeCompletion.cpp delete mode 100644 contrib/llvm/tools/clang/tools/libclang/CIndexDiagnostic.cpp delete mode 100644 contrib/llvm/tools/clang/tools/libclang/CIndexDiagnostic.h delete mode 100644 contrib/llvm/tools/clang/tools/libclang/CIndexInclusionStack.cpp delete mode 100644 contrib/llvm/tools/clang/tools/libclang/CIndexUSRs.cpp delete mode 100644 contrib/llvm/tools/clang/tools/libclang/CIndexer.cpp delete mode 100644 contrib/llvm/tools/clang/tools/libclang/CIndexer.h delete mode 100644 contrib/llvm/tools/clang/tools/libclang/CMakeLists.txt delete mode 100644 contrib/llvm/tools/clang/tools/libclang/CXCursor.cpp delete mode 100644 contrib/llvm/tools/clang/tools/libclang/CXCursor.h delete mode 100644 contrib/llvm/tools/clang/tools/libclang/CXSourceLocation.h delete mode 100644 contrib/llvm/tools/clang/tools/libclang/CXType.cpp delete mode 100644 contrib/llvm/tools/clang/tools/libclang/CXType.h delete mode 100644 contrib/llvm/tools/clang/tools/libclang/Makefile delete mode 100644 contrib/llvm/tools/clang/tools/libclang/libclang.darwin.exports delete mode 100644 contrib/llvm/tools/clang/tools/libclang/libclang.exports delete mode 120000 contrib/llvm/tools/clang/tools/scan-build/c++-analyzer delete mode 100755 contrib/llvm/tools/clang/tools/scan-build/ccc-analyzer delete mode 100755 contrib/llvm/tools/clang/tools/scan-build/scan-build delete mode 100644 contrib/llvm/tools/clang/tools/scan-build/scanview.css delete mode 100755 contrib/llvm/tools/clang/tools/scan-build/set-xcode-analyzer delete mode 100644 contrib/llvm/tools/clang/tools/scan-build/sorttable.js delete mode 100644 contrib/llvm/tools/clang/tools/scan-view/Reporter.py delete mode 100644 contrib/llvm/tools/clang/tools/scan-view/Resources/FileRadar.scpt delete mode 100644 contrib/llvm/tools/clang/tools/scan-view/Resources/GetRadarVersion.scpt delete mode 100644 contrib/llvm/tools/clang/tools/scan-view/Resources/bugcatcher.ico delete mode 100644 contrib/llvm/tools/clang/tools/scan-view/ScanView.py delete mode 100755 contrib/llvm/tools/clang/tools/scan-view/scan-view delete mode 100644 contrib/llvm/tools/clang/tools/scan-view/startfile.py delete mode 100755 contrib/llvm/tools/clang/utils/ABITest/ABITestGen.py delete mode 100644 contrib/llvm/tools/clang/utils/ABITest/Enumeration.py delete mode 100644 contrib/llvm/tools/clang/utils/ABITest/Makefile.test.common delete mode 100644 contrib/llvm/tools/clang/utils/ABITest/TypeGen.py delete mode 100755 contrib/llvm/tools/clang/utils/ABITest/build-and-summarize-all.sh delete mode 100755 contrib/llvm/tools/clang/utils/ABITest/build-and-summarize.sh delete mode 100755 contrib/llvm/tools/clang/utils/ABITest/build.sh delete mode 100644 contrib/llvm/tools/clang/utils/ABITest/layout/Makefile delete mode 100644 contrib/llvm/tools/clang/utils/ABITest/return-types-32/Makefile delete mode 100644 contrib/llvm/tools/clang/utils/ABITest/return-types-64/Makefile delete mode 100644 contrib/llvm/tools/clang/utils/ABITest/single-args-32/Makefile delete mode 100644 contrib/llvm/tools/clang/utils/ABITest/single-args-64/Makefile delete mode 100755 contrib/llvm/tools/clang/utils/ABITest/summarize.sh delete mode 100644 contrib/llvm/tools/clang/utils/C++Tests/Clang-Code-Compile/lit.local.cfg delete mode 100644 contrib/llvm/tools/clang/utils/C++Tests/Clang-Code-Syntax/lit.local.cfg delete mode 100644 contrib/llvm/tools/clang/utils/C++Tests/Clang-Syntax/lit.local.cfg delete mode 100644 contrib/llvm/tools/clang/utils/C++Tests/LLVM-Code-Compile/lit.local.cfg delete mode 100755 contrib/llvm/tools/clang/utils/C++Tests/LLVM-Code-Symbols/check-symbols delete mode 100644 contrib/llvm/tools/clang/utils/C++Tests/LLVM-Code-Symbols/lit.local.cfg delete mode 100644 contrib/llvm/tools/clang/utils/C++Tests/LLVM-Code-Syntax/lit.local.cfg delete mode 100644 contrib/llvm/tools/clang/utils/C++Tests/LLVM-Syntax/lit.local.cfg delete mode 100644 contrib/llvm/tools/clang/utils/C++Tests/lit.cfg delete mode 100644 contrib/llvm/tools/clang/utils/C++Tests/stdc++-Syntax/lit.local.cfg delete mode 100755 contrib/llvm/tools/clang/utils/CIndex/completion_logger_server.py delete mode 100755 contrib/llvm/tools/clang/utils/CaptureCmd delete mode 100755 contrib/llvm/tools/clang/utils/CmpDriver delete mode 100755 contrib/llvm/tools/clang/utils/FindSpecRefs delete mode 100755 contrib/llvm/tools/clang/utils/FuzzTest delete mode 100644 contrib/llvm/tools/clang/utils/OptionalTests/Extra/README.txt delete mode 100644 contrib/llvm/tools/clang/utils/OptionalTests/Extra/Runtime/darwin-clang_rt.c delete mode 100644 contrib/llvm/tools/clang/utils/OptionalTests/README.txt delete mode 100644 contrib/llvm/tools/clang/utils/OptionalTests/lit.cfg delete mode 100755 contrib/llvm/tools/clang/utils/SummarizeErrors delete mode 100755 contrib/llvm/tools/clang/utils/TestUtils/deep-stack.py delete mode 100755 contrib/llvm/tools/clang/utils/TestUtils/pch-test.pl delete mode 100644 contrib/llvm/tools/clang/utils/VtableTest/Makefile delete mode 100755 contrib/llvm/tools/clang/utils/VtableTest/check-zti delete mode 100755 contrib/llvm/tools/clang/utils/VtableTest/check-ztt delete mode 100755 contrib/llvm/tools/clang/utils/VtableTest/check-zvt delete mode 100644 contrib/llvm/tools/clang/utils/VtableTest/gen.cc delete mode 100755 contrib/llvm/tools/clang/utils/analyzer/CmpRuns delete mode 100755 contrib/llvm/tools/clang/utils/analyzer/ubiviz delete mode 100644 contrib/llvm/tools/clang/utils/builtin-defines.c delete mode 100644 contrib/llvm/tools/clang/utils/clang-completion-mode.el delete mode 100755 contrib/llvm/tools/clang/utils/token-delta.py delete mode 100644 contrib/llvm/tools/clang/utils/valgrind/x86_64-pc-linux-gnu_gcc-4.3.3.supp delete mode 100644 contrib/llvm/tools/edis/CMakeLists.txt delete mode 100644 contrib/llvm/tools/edis/EDMain.cpp delete mode 100644 contrib/llvm/tools/edis/EnhancedDisassembly.exports delete mode 100644 contrib/llvm/tools/edis/Makefile delete mode 100644 contrib/llvm/tools/gold/Makefile delete mode 100644 contrib/llvm/tools/gold/README.txt delete mode 100644 contrib/llvm/tools/gold/gold-plugin.cpp delete mode 100644 contrib/llvm/tools/gold/gold.exports delete mode 100644 contrib/llvm/tools/llc/CMakeLists.txt delete mode 100644 contrib/llvm/tools/llc/Makefile delete mode 100644 contrib/llvm/tools/llc/llc.cpp delete mode 100644 contrib/llvm/tools/lli/CMakeLists.txt delete mode 100644 contrib/llvm/tools/lli/Makefile delete mode 100644 contrib/llvm/tools/lli/lli.cpp delete mode 100644 contrib/llvm/tools/llvm-ar/CMakeLists.txt delete mode 100644 contrib/llvm/tools/llvm-ar/Makefile delete mode 100644 contrib/llvm/tools/llvm-ar/llvm-ar.cpp delete mode 100644 contrib/llvm/tools/llvm-as/CMakeLists.txt delete mode 100644 contrib/llvm/tools/llvm-as/Makefile delete mode 100644 contrib/llvm/tools/llvm-as/llvm-as.cpp delete mode 100644 contrib/llvm/tools/llvm-bcanalyzer/CMakeLists.txt delete mode 100644 contrib/llvm/tools/llvm-bcanalyzer/Makefile delete mode 100644 contrib/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp delete mode 100644 contrib/llvm/tools/llvm-config/CMakeLists.txt delete mode 100644 contrib/llvm/tools/llvm-config/Makefile delete mode 100755 contrib/llvm/tools/llvm-config/find-cycles.pl delete mode 100644 contrib/llvm/tools/llvm-config/llvm-config.in.in delete mode 100644 contrib/llvm/tools/llvm-diff/CMakeLists.txt delete mode 100644 contrib/llvm/tools/llvm-diff/DifferenceEngine.cpp delete mode 100644 contrib/llvm/tools/llvm-diff/DifferenceEngine.h delete mode 100644 contrib/llvm/tools/llvm-diff/Makefile delete mode 100644 contrib/llvm/tools/llvm-diff/llvm-diff.cpp delete mode 100644 contrib/llvm/tools/llvm-dis/CMakeLists.txt delete mode 100644 contrib/llvm/tools/llvm-dis/Makefile delete mode 100644 contrib/llvm/tools/llvm-dis/llvm-dis.cpp delete mode 100644 contrib/llvm/tools/llvm-extract/CMakeLists.txt delete mode 100644 contrib/llvm/tools/llvm-extract/Makefile delete mode 100644 contrib/llvm/tools/llvm-extract/llvm-extract.cpp delete mode 100644 contrib/llvm/tools/llvm-ld/CMakeLists.txt delete mode 100644 contrib/llvm/tools/llvm-ld/Makefile delete mode 100644 contrib/llvm/tools/llvm-ld/Optimize.cpp delete mode 100644 contrib/llvm/tools/llvm-ld/llvm-ld.cpp delete mode 100644 contrib/llvm/tools/llvm-link/CMakeLists.txt delete mode 100644 contrib/llvm/tools/llvm-link/Makefile delete mode 100644 contrib/llvm/tools/llvm-link/llvm-link.cpp delete mode 100644 contrib/llvm/tools/llvm-mc/CMakeLists.txt delete mode 100644 contrib/llvm/tools/llvm-mc/Disassembler.cpp delete mode 100644 contrib/llvm/tools/llvm-mc/Disassembler.h delete mode 100644 contrib/llvm/tools/llvm-mc/Makefile delete mode 100644 contrib/llvm/tools/llvm-mc/llvm-mc.cpp delete mode 100644 contrib/llvm/tools/llvm-nm/CMakeLists.txt delete mode 100644 contrib/llvm/tools/llvm-nm/Makefile delete mode 100644 contrib/llvm/tools/llvm-nm/llvm-nm.cpp delete mode 100644 contrib/llvm/tools/llvm-prof/CMakeLists.txt delete mode 100644 contrib/llvm/tools/llvm-prof/Makefile delete mode 100644 contrib/llvm/tools/llvm-prof/llvm-prof.cpp delete mode 100644 contrib/llvm/tools/llvm-ranlib/CMakeLists.txt delete mode 100644 contrib/llvm/tools/llvm-ranlib/Makefile delete mode 100644 contrib/llvm/tools/llvm-ranlib/llvm-ranlib.cpp delete mode 100644 contrib/llvm/tools/llvm-shlib/Makefile delete mode 100644 contrib/llvm/tools/llvm-stub/CMakeLists.txt delete mode 100644 contrib/llvm/tools/llvm-stub/Makefile delete mode 100644 contrib/llvm/tools/llvm-stub/llvm-stub.c delete mode 100644 contrib/llvm/tools/llvmc/CMakeLists.txt delete mode 100644 contrib/llvm/tools/llvmc/Makefile delete mode 100644 contrib/llvm/tools/llvmc/doc/LLVMC-Reference.rst delete mode 100644 contrib/llvm/tools/llvmc/doc/LLVMC-Tutorial.rst delete mode 100644 contrib/llvm/tools/llvmc/doc/Makefile delete mode 100644 contrib/llvm/tools/llvmc/doc/img/lines.gif delete mode 100644 contrib/llvm/tools/llvmc/src/AutoGenerated.td delete mode 100644 contrib/llvm/tools/llvmc/src/Base.td.in delete mode 100644 contrib/llvm/tools/llvmc/src/Clang.td delete mode 100644 contrib/llvm/tools/llvmc/src/Hooks.cpp delete mode 100644 contrib/llvm/tools/llvmc/src/Main.cpp delete mode 100644 contrib/llvm/tools/llvmc/src/Makefile delete mode 100644 contrib/llvm/tools/lto/LTOCodeGenerator.cpp delete mode 100644 contrib/llvm/tools/lto/LTOCodeGenerator.h delete mode 100644 contrib/llvm/tools/lto/LTOModule.cpp delete mode 100644 contrib/llvm/tools/lto/LTOModule.h delete mode 100644 contrib/llvm/tools/lto/Makefile delete mode 100644 contrib/llvm/tools/lto/lto.cpp delete mode 100644 contrib/llvm/tools/lto/lto.exports delete mode 100644 contrib/llvm/tools/opt/AnalysisWrappers.cpp delete mode 100644 contrib/llvm/tools/opt/CMakeLists.txt delete mode 100644 contrib/llvm/tools/opt/GraphPrinters.cpp delete mode 100644 contrib/llvm/tools/opt/Makefile delete mode 100644 contrib/llvm/tools/opt/PrintSCC.cpp delete mode 100644 contrib/llvm/tools/opt/opt.cpp delete mode 100755 contrib/llvm/utils/DSAclean.py delete mode 100644 contrib/llvm/utils/DSAextract.py delete mode 100644 contrib/llvm/utils/FileCheck/CMakeLists.txt delete mode 100644 contrib/llvm/utils/FileCheck/FileCheck.cpp delete mode 100644 contrib/llvm/utils/FileCheck/Makefile delete mode 100644 contrib/llvm/utils/FileUpdate/CMakeLists.txt delete mode 100644 contrib/llvm/utils/FileUpdate/FileUpdate.cpp delete mode 100644 contrib/llvm/utils/FileUpdate/Makefile delete mode 100755 contrib/llvm/utils/GenLibDeps.pl delete mode 100755 contrib/llvm/utils/GetSourceVersion delete mode 100644 contrib/llvm/utils/Makefile delete mode 100755 contrib/llvm/utils/Misc/zkill delete mode 100644 contrib/llvm/utils/NLT.schema delete mode 100755 contrib/llvm/utils/NewNightlyTest.pl delete mode 100644 contrib/llvm/utils/NightlyTest.gnuplot delete mode 100644 contrib/llvm/utils/NightlyTestTemplate.html delete mode 100644 contrib/llvm/utils/OldenDataRecover.pl delete mode 100644 contrib/llvm/utils/PerfectShuffle/Makefile delete mode 100644 contrib/llvm/utils/PerfectShuffle/PerfectShuffle.cpp delete mode 100644 contrib/llvm/utils/TableGen/CMakeLists.txt delete mode 100644 contrib/llvm/utils/TableGen/Makefile delete mode 100755 contrib/llvm/utils/UpdateCMakeLists.pl delete mode 100644 contrib/llvm/utils/bugpoint/RemoteRunSafely.sh delete mode 100644 contrib/llvm/utils/buildit/GNUmakefile delete mode 100755 contrib/llvm/utils/buildit/build_llvm delete mode 100755 contrib/llvm/utils/cgiplotNLT.pl delete mode 100755 contrib/llvm/utils/check-each-file delete mode 100755 contrib/llvm/utils/codegen-diff delete mode 100644 contrib/llvm/utils/count/CMakeLists.txt delete mode 100644 contrib/llvm/utils/count/Makefile delete mode 100644 contrib/llvm/utils/count/count.c delete mode 100755 contrib/llvm/utils/countloc.sh delete mode 100644 contrib/llvm/utils/crosstool/ARM/README delete mode 100755 contrib/llvm/utils/crosstool/ARM/build-install-linux.sh delete mode 100755 contrib/llvm/utils/crosstool/create-snapshots.sh delete mode 100644 contrib/llvm/utils/emacs/README delete mode 100644 contrib/llvm/utils/emacs/emacs.el delete mode 100644 contrib/llvm/utils/emacs/llvm-mode.el delete mode 100644 contrib/llvm/utils/emacs/tablegen-mode.el delete mode 100755 contrib/llvm/utils/findmisopt delete mode 100755 contrib/llvm/utils/findoptdiff delete mode 100755 contrib/llvm/utils/findsym.pl delete mode 100644 contrib/llvm/utils/fpcmp/Makefile delete mode 100644 contrib/llvm/utils/fpcmp/fpcmp.cpp delete mode 100755 contrib/llvm/utils/getsrcs.sh delete mode 100755 contrib/llvm/utils/git/find-rev delete mode 100644 contrib/llvm/utils/importNLT.pl delete mode 100644 contrib/llvm/utils/jedit/README delete mode 100644 contrib/llvm/utils/jedit/tablegen.xml delete mode 100644 contrib/llvm/utils/lint/common_lint.py delete mode 100755 contrib/llvm/utils/lint/cpp_lint.py delete mode 100755 contrib/llvm/utils/lint/generic_lint.py delete mode 100755 contrib/llvm/utils/lint/remove_trailing_whitespace.sh delete mode 100644 contrib/llvm/utils/lit/TODO delete mode 100755 contrib/llvm/utils/lit/lit.py delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests.ObjDir/lit.site.cfg delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/Clang/fsyntax-only.c delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/Clang/lit.cfg delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/LLVM.InTree/test/Bar/bar-test.ll delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/LLVM.InTree/test/Bar/dg.exp delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/LLVM.InTree/test/lit.cfg delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/LLVM.InTree/test/lit.site.cfg delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/LLVM.InTree/test/site.exp delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/lit.local.cfg delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/obj/test/Foo/lit.local.cfg delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/obj/test/lit.site.cfg delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/obj/test/site.exp delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/src/test/Foo/data.txt delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/src/test/Foo/dg.exp delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/src/test/Foo/pct-S.ll delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/src/test/lit.cfg delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/ShExternal/lit.local.cfg delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/ShInternal/lit.local.cfg delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/TclTest/lit.local.cfg delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/TclTest/stderr-pipe.ll delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/TclTest/tcl-redir-1.ll delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/fail.c delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/lit.cfg delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/pass.c delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/required-and-missing.c delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/required-and-present.c delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/xfail.c delete mode 100644 contrib/llvm/utils/lit/lit/ExampleTests/xpass.c delete mode 100644 contrib/llvm/utils/lit/lit/LitConfig.py delete mode 100644 contrib/llvm/utils/lit/lit/LitFormats.py delete mode 100644 contrib/llvm/utils/lit/lit/LitTestCase.py delete mode 100644 contrib/llvm/utils/lit/lit/ProgressBar.py delete mode 100644 contrib/llvm/utils/lit/lit/ShCommands.py delete mode 100644 contrib/llvm/utils/lit/lit/ShUtil.py delete mode 100644 contrib/llvm/utils/lit/lit/TclUtil.py delete mode 100644 contrib/llvm/utils/lit/lit/Test.py delete mode 100644 contrib/llvm/utils/lit/lit/TestFormats.py delete mode 100644 contrib/llvm/utils/lit/lit/TestRunner.py delete mode 100644 contrib/llvm/utils/lit/lit/TestingConfig.py delete mode 100644 contrib/llvm/utils/lit/lit/Util.py delete mode 100644 contrib/llvm/utils/lit/lit/__init__.py delete mode 100755 contrib/llvm/utils/lit/lit/lit.py delete mode 100644 contrib/llvm/utils/lit/setup.py delete mode 100644 contrib/llvm/utils/llvm-lit/Makefile delete mode 100644 contrib/llvm/utils/llvm-lit/llvm-lit.in delete mode 100755 contrib/llvm/utils/llvm-native-gcc delete mode 100755 contrib/llvm/utils/llvm-native-gxx delete mode 100644 contrib/llvm/utils/llvm.grm delete mode 100755 contrib/llvm/utils/llvmdo delete mode 100755 contrib/llvm/utils/llvmgrep delete mode 100755 contrib/llvm/utils/makellvm delete mode 100644 contrib/llvm/utils/not/CMakeLists.txt delete mode 100644 contrib/llvm/utils/not/Makefile delete mode 100644 contrib/llvm/utils/not/not.cpp delete mode 100644 contrib/llvm/utils/parseNLT.pl delete mode 100644 contrib/llvm/utils/plotNLT.pl delete mode 100755 contrib/llvm/utils/profile.pl delete mode 100644 contrib/llvm/utils/unittest/Makefile delete mode 100644 contrib/llvm/utils/unittest/UnitTestMain/Makefile delete mode 100644 contrib/llvm/utils/unittest/UnitTestMain/TestMain.cpp delete mode 100644 contrib/llvm/utils/unittest/googletest/LICENSE.TXT delete mode 100644 contrib/llvm/utils/unittest/googletest/Makefile delete mode 100644 contrib/llvm/utils/unittest/googletest/README.LLVM delete mode 100644 contrib/llvm/utils/unittest/googletest/gtest-death-test.cc delete mode 100644 contrib/llvm/utils/unittest/googletest/gtest-filepath.cc delete mode 100644 contrib/llvm/utils/unittest/googletest/gtest-port.cc delete mode 100644 contrib/llvm/utils/unittest/googletest/gtest-test-part.cc delete mode 100644 contrib/llvm/utils/unittest/googletest/gtest-typed-test.cc delete mode 100644 contrib/llvm/utils/unittest/googletest/gtest.cc delete mode 100644 contrib/llvm/utils/unittest/googletest/include/gtest/gtest-death-test.h delete mode 100644 contrib/llvm/utils/unittest/googletest/include/gtest/gtest-message.h delete mode 100644 contrib/llvm/utils/unittest/googletest/include/gtest/gtest-param-test.h delete mode 100644 contrib/llvm/utils/unittest/googletest/include/gtest/gtest-spi.h delete mode 100644 contrib/llvm/utils/unittest/googletest/include/gtest/gtest-test-part.h delete mode 100644 contrib/llvm/utils/unittest/googletest/include/gtest/gtest-typed-test.h delete mode 100644 contrib/llvm/utils/unittest/googletest/include/gtest/gtest.h delete mode 100644 contrib/llvm/utils/unittest/googletest/include/gtest/gtest_pred_impl.h delete mode 100644 contrib/llvm/utils/unittest/googletest/include/gtest/gtest_prod.h delete mode 100644 contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h delete mode 100644 contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-filepath.h delete mode 100644 contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-internal-inl.h delete mode 100644 contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-internal.h delete mode 100644 contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-linked_ptr.h delete mode 100644 contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-param-util-generated.h delete mode 100644 contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-param-util.h delete mode 100644 contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h delete mode 100644 contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-string.h delete mode 100644 contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-tuple.h delete mode 100644 contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-type-util.h delete mode 100644 contrib/llvm/utils/valgrind/i386-pc-linux-gnu.supp delete mode 100644 contrib/llvm/utils/valgrind/x86_64-pc-linux-gnu.supp delete mode 100644 contrib/llvm/utils/vim/README delete mode 100644 contrib/llvm/utils/vim/llvm.vim delete mode 100644 contrib/llvm/utils/vim/tablegen.vim delete mode 100644 contrib/llvm/utils/vim/vimrc delete mode 100755 contrib/llvm/utils/webNLT.pl diff --git a/contrib/llvm/CMakeLists.txt b/contrib/llvm/CMakeLists.txt deleted file mode 100644 index a6099d17c56a..000000000000 --- a/contrib/llvm/CMakeLists.txt +++ /dev/null @@ -1,387 +0,0 @@ -# See docs/CMake.html for instructions about how to build LLVM with CMake. - -project(LLVM) -cmake_minimum_required(VERSION 2.8) - -# Add path for custom modules -set(CMAKE_MODULE_PATH - ${CMAKE_MODULE_PATH} - "${CMAKE_CURRENT_SOURCE_DIR}/cmake" - "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" - ) - -set(PACKAGE_VERSION "2.8") -include(VersionFromVCS) -add_version_info_from_vcs(PACKAGE_VERSION) - -set(PACKAGE_NAME llvm) -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 - 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) - -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 ) - include(ChooseMSVCCRT) - - 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 ) - - # 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(lib/MC/MCDisassembler) -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) - -add_subdirectory(cmake/modules) - -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. diff --git a/contrib/llvm/CREDITS.TXT b/contrib/llvm/CREDITS.TXT deleted file mode 100644 index aeecfe2e21e1..000000000000 --- a/contrib/llvm/CREDITS.TXT +++ /dev/null @@ -1,360 +0,0 @@ -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: James Grosbach -E: grosbach@apple.com -D: SjLj exception handling support -D: General fixes and improvements for the ARM back-end - -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: Takumi Nakamura -E: geek4civic@gmail.com -E: chapuni@hf.rim.or.jp -D: Cygwin and MinGW support. -S: Yokohama, Japan - -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: Wesley Peck -E: peckw@wesleypeck.com -W: http://wesleypeck.com/ -D: MicroBlaze backend - -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 support in llvm-gcc -D: Dragonegg plugin -D: Exception handling improvements -D: Type legalizer rewrite - -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: Michael J. Spencer -E: bigcheesegs@gmail.com -D: Shepherding Windows COFF support into MC. - -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: wendling@apple.com -D: Bunches of stuff - -N: Bob Wilson -E: bob.wilson@acm.org -D: Advanced SIMD (NEON) support in the ARM backend diff --git a/contrib/llvm/LICENSE.TXT b/contrib/llvm/LICENSE.TXT deleted file mode 100644 index b8d2c742096f..000000000000 --- a/contrib/llvm/LICENSE.TXT +++ /dev/null @@ -1,69 +0,0 @@ -============================================================================== -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} diff --git a/contrib/llvm/Makefile b/contrib/llvm/Makefile deleted file mode 100644 index ae650b7f2d93..000000000000 --- a/contrib/llvm/Makefile +++ /dev/null @@ -1,241 +0,0 @@ -#===- ./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/runtime tools/clang/docs \ - tools/lto - 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 tools/lto - 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; \ - (unset SDKROOT; \ - $(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/src/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) Build -ifneq ($(ENABLE_OPTIMIZED),1) - $(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 - -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." diff --git a/contrib/llvm/Makefile.common b/contrib/llvm/Makefile.common deleted file mode 100644 index e1f52036f6f6..000000000000 --- a/contrib/llvm/Makefile.common +++ /dev/null @@ -1,70 +0,0 @@ -#===-- 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 - diff --git a/contrib/llvm/Makefile.config.in b/contrib/llvm/Makefile.config.in deleted file mode 100644 index 5ebd80384fb0..000000000000 --- a/contrib/llvm/Makefile.config.in +++ /dev/null @@ -1,346 +0,0 @@ -#===-- 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 - -# The macro below is expanded when 'realpath' is not built-in. -# Built-in 'realpath' is available on GNU Make 3.81. -realpath = $(shell cd $(1); $(PWD)) - -PROJ_OBJ_DIR := $(call realpath, .) -PROJ_OBJ_ROOT := $(call realpath, $(PROJ_OBJ_DIR)/$(LEVEL)) - -ifeq ($(PROJECT_NAME),llvm) -LLVM_SRC_ROOT := $(call realpath, @abs_top_srcdir@) -LLVM_OBJ_ROOT := $(call realpath, @abs_top_builddir@) -PROJ_SRC_ROOT := $(LLVM_SRC_ROOT) -PROJ_SRC_DIR := $(call realpath, $(LLVM_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR))) -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 := $(call realpath, $(PROJ_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR))) -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 "+Profile" directories, where -# is either Debug or Release depending on how other build -# flags are set. Otherwise, output is put in the -# 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@ - -# 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 --version-script=file -HAVE_LINK_VERSION_SCRIPT = @HAVE_LINK_VERSION_SCRIPT@ diff --git a/contrib/llvm/Makefile.rules b/contrib/llvm/Makefile.rules deleted file mode 100644 index 9cff1053d0d9..000000000000 --- a/contrib/llvm/Makefile.rules +++ /dev/null @@ -1,2209 +0,0 @@ -#===-- Makefile.rules - 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. For details on how to use -# it properly, please see the document MakefileGuide.html in the docs directory. -# -#===-----------------------------------------------------------------------====# - -################################################################################ -# TARGETS: Define standard targets that can be invoked -################################################################################ - -#-------------------------------------------------------------------- -# Define the various target sets -#-------------------------------------------------------------------- -RecursiveTargets := all clean clean-all install uninstall install-bytecode \ - unitcheck -LocalTargets := all-local clean-local clean-all-local check-local \ - install-local printvars uninstall-local \ - install-bytecode-local -TopLevelTargets := check dist dist-check dist-clean dist-gzip dist-bzip2 \ - dist-zip unittests -UserTargets := $(RecursiveTargets) $(LocalTargets) $(TopLevelTargets) -InternalTargets := preconditions distdir dist-hook - -################################################################################ -# INITIALIZATION: Basic things the makefile needs -################################################################################ - -#-------------------------------------------------------------------- -# Set the VPATH so that we can find source files. -#-------------------------------------------------------------------- -VPATH=$(PROJ_SRC_DIR) - -#-------------------------------------------------------------------- -# Reset the list of suffixes we know how to build. -#-------------------------------------------------------------------- -.SUFFIXES: -.SUFFIXES: .c .cpp .cc .h .hpp .o .a .bc .td .ps .dot .ll .m .mm -.SUFFIXES: $(SHLIBEXT) $(SUFFIXES) - -#-------------------------------------------------------------------- -# Mark all of these targets as phony to avoid implicit rule search -#-------------------------------------------------------------------- -.PHONY: $(UserTargets) $(InternalTargets) - -#-------------------------------------------------------------------- -# Make sure all the user-target rules are double colon rules and -# they are defined first. -#-------------------------------------------------------------------- - -$(UserTargets):: - -################################################################################ -# PRECONDITIONS: that which must be built/checked first -################################################################################ - -SrcMakefiles := $(filter %Makefile %Makefile.tests,\ - $(wildcard $(PROJ_SRC_DIR)/Makefile*)) -ObjMakefiles := $(subst $(PROJ_SRC_DIR),$(PROJ_OBJ_DIR),$(SrcMakefiles)) -ConfigureScript := $(PROJ_SRC_ROOT)/configure -ConfigStatusScript := $(PROJ_OBJ_ROOT)/config.status -MakefileConfigIn := $(strip $(wildcard $(PROJ_SRC_ROOT)/Makefile.config.in)) -MakefileCommonIn := $(strip $(wildcard $(PROJ_SRC_ROOT)/Makefile.common.in)) -MakefileConfig := $(PROJ_OBJ_ROOT)/Makefile.config -MakefileCommon := $(PROJ_OBJ_ROOT)/Makefile.common -PreConditions := $(ConfigStatusScript) $(ObjMakefiles) -ifneq ($(MakefileCommonIn),) -PreConditions += $(MakefileCommon) -endif - -ifneq ($(MakefileConfigIn),) -PreConditions += $(MakefileConfig) -endif - -preconditions: $(PreConditions) - -#------------------------------------------------------------------------ -# Make sure the BUILT_SOURCES are built first -#------------------------------------------------------------------------ -$(filter-out clean clean-local,$(UserTargets)):: $(BUILT_SOURCES) - -clean-all-local:: -ifneq ($(strip $(BUILT_SOURCES)),) - -$(Verb) $(RM) -f $(BUILT_SOURCES) -endif - -ifneq ($(PROJ_OBJ_ROOT),$(PROJ_SRC_ROOT)) -spotless: - $(Verb) if test -x config.status ; then \ - $(EchoCmd) Wiping out $(PROJ_OBJ_ROOT) ; \ - $(MKDIR) .spotless.save ; \ - $(MV) config.status .spotless.save ; \ - $(MV) mklib .spotless.save ; \ - $(MV) projects .spotless.save ; \ - $(RM) -rf * ; \ - $(MV) .spotless.save/config.status . ; \ - $(MV) .spotless.save/mklib . ; \ - $(MV) .spotless.save/projects . ; \ - $(RM) -rf .spotless.save ; \ - $(EchoCmd) Rebuilding configuration of $(PROJ_OBJ_ROOT) ; \ - $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \ - $(ConfigStatusScript) ; \ - else \ - $(EchoCmd) "make spotless" can only be run from $(PROJ_OBJ_ROOT); \ - fi -else -spotless: - $(EchoCmd) "spotless target not supported for objdir == srcdir" -endif - -$(BUILT_SOURCES) : $(ObjMakefiles) - -#------------------------------------------------------------------------ -# Make sure we're not using a stale configuration -#------------------------------------------------------------------------ -reconfigure: - $(Echo) Reconfiguring $(PROJ_OBJ_ROOT) - $(Verb) cd $(PROJ_OBJ_ROOT) && \ - if test -w $(PROJ_OBJ_ROOT)/config.cache ; then \ - $(RM) $(PROJ_OBJ_ROOT)/config.cache ; \ - fi ; \ - $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \ - $(ConfigStatusScript) - -# FIXME: The {PIC16,MSP430}/AsmPrinter line here is a hack to force a reconfigure to pick -# up AsmPrinter changes. Remove it after a reasonable delay from 2009-08-13. - -.PRECIOUS: $(ConfigStatusScript) -$(ConfigStatusScript): $(ConfigureScript) $(LLVM_SRC_ROOT)/lib/Target/PIC16/AsmPrinter/Makefile $(LLVM_SRC_ROOT)/lib/Target/MSP430/AsmPrinter/Makefile - $(Echo) Reconfiguring with $< - $(Verb) cd $(PROJ_OBJ_ROOT) && \ - if test -w $(PROJ_OBJ_ROOT)/config.cache ; then \ - $(RM) $(PROJ_OBJ_ROOT)/config.cache ; \ - fi ; \ - $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \ - $(ConfigStatusScript) - -#------------------------------------------------------------------------ -# Make sure the configuration makefile is up to date -#------------------------------------------------------------------------ -ifneq ($(MakefileConfigIn),) -$(MakefileConfig): $(MakefileConfigIn) $(ConfigStatusScript) - $(Echo) Regenerating $@ - $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ConfigStatusScript) Makefile.config -endif - -ifneq ($(MakefileCommonIn),) -$(MakefileCommon): $(MakefileCommonIn) $(ConfigStatusScript) - $(Echo) Regenerating $@ - $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ConfigStatusScript) Makefile.common -endif - -#------------------------------------------------------------------------ -# If the Makefile in the source tree has been updated, copy it over into the -# build tree. But, only do this if the source and object makefiles differ -#------------------------------------------------------------------------ -ifneq ($(PROJ_OBJ_DIR),$(PROJ_SRC_DIR)) - -Makefile: $(PROJ_SRC_DIR)/Makefile $(ExtraMakefiles) - $(Echo) "Updating Makefile" - $(Verb) $(MKDIR) $(@D) - $(Verb) $(CP) -f $< $@ - -# Copy the Makefile.* files unless we're in the root directory which avoids -# the copying of Makefile.config.in or other things that should be explicitly -# taken care of. -$(PROJ_OBJ_DIR)/Makefile% : $(PROJ_SRC_DIR)/Makefile% - @case '$?' in \ - *Makefile.rules) ;; \ - *.in) ;; \ - *) $(EchoCmd) "Updating $(@F)" ; \ - $(MKDIR) $(@D) ; \ - $(CP) -f $< $@ ;; \ - esac - -endif - -#------------------------------------------------------------------------ -# Set up the basic dependencies -#------------------------------------------------------------------------ -$(UserTargets):: $(PreConditions) - -all:: all-local -clean:: clean-local -clean-all:: clean-local clean-all-local -install:: install-local -uninstall:: uninstall-local -install-local:: all-local -install-bytecode:: install-bytecode-local - -############################################################################### -# LLVMC: Provide rules for compiling llvmc-based driver -############################################################################### - -ifdef LLVMC_BASED_DRIVER - -TOOLNAME = $(LLVMC_BASED_DRIVER) - -LLVMLIBS = CompilerDriver.a -LINK_COMPONENTS = support system - -endif # LLVMC_BASED_DRIVER - -############################################################################### -# VARIABLES: Set up various variables based on configuration data -############################################################################### - -# Variable for if this make is for a "cleaning" target -ifneq ($(strip $(filter clean clean-local dist-clean,$(MAKECMDGOALS))),) - IS_CLEANING_TARGET=1 -endif - -#-------------------------------------------------------------------- -# Variables derived from configuration we are building -#-------------------------------------------------------------------- - -CPP.Defines := -ifeq ($(ENABLE_OPTIMIZED),1) - BuildMode := Release - # Don't use -fomit-frame-pointer on Darwin or FreeBSD. - ifneq ($(HOST_OS),FreeBSD) - ifneq ($(HOST_OS),Darwin) - OmitFramePointer := -fomit-frame-pointer - endif - endif - - # Darwin requires -fstrict-aliasing to be explicitly enabled. - # Avoid -fstrict-aliasing on Darwin for now, there are unresolved issues - # with -fstrict-aliasing and ipa-type-escape radr://6756684 - #ifeq ($(HOST_OS),Darwin) - # EXTRA_OPTIONS += -fstrict-aliasing -Wstrict-aliasing - #endif - CXX.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer) - C.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer) - LD.Flags += $(OPTIMIZE_OPTION) - ifdef DEBUG_SYMBOLS - BuildMode := $(BuildMode)+Debug - CXX.Flags += -g - C.Flags += -g - LD.Flags += -g - KEEP_SYMBOLS := 1 - endif -else - ifdef NO_DEBUG_SYMBOLS - BuildMode := Unoptimized - CXX.Flags += - C.Flags += - LD.Flags += - KEEP_SYMBOLS := 1 - else - BuildMode := Debug - CXX.Flags += -g - C.Flags += -g - LD.Flags += -g - KEEP_SYMBOLS := 1 - endif -endif - -ifeq ($(ENABLE_PROFILING),1) - BuildMode := $(BuildMode)+Profile - CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags)) -pg -g - C.Flags := $(filter-out -fomit-frame-pointer,$(C.Flags)) -pg -g - LD.Flags := $(filter-out -fomit-frame-pointer,$(LD.Flags)) -pg -g - KEEP_SYMBOLS := 1 -endif - -#ifeq ($(ENABLE_VISIBILITY_INLINES_HIDDEN),1) -# CXX.Flags += -fvisibility-inlines-hidden -#endif - -ifdef ENABLE_EXPENSIVE_CHECKS - # GNU libstdc++ uses RTTI if you define _GLIBCXX_DEBUG, which we did above. - # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40160 - REQUIRES_RTTI := 1 -endif - -# IF REQUIRES_EH=1 is specified then don't disable exceptions -ifndef REQUIRES_EH - CXX.Flags += -fno-exceptions -else - # If the library requires EH, it also requires RTTI. - REQUIRES_RTTI := 1 -endif - -ifdef REQUIRES_FRAME_POINTER - CXX.Flags := $(filter-out -fomit-frame-pointer,$(CXX.Flags)) - C.Flags := $(filter-out -fomit-frame-pointer,$(C.Flags)) - LD.Flags := $(filter-out -fomit-frame-pointer,$(LD.Flags)) -endif - -# If REQUIRES_RTTI=1 is specified then don't disable run-time type id. -ifneq ($(REQUIRES_RTTI), 1) - CXX.Flags += -fno-rtti -endif - -ifdef ENABLE_COVERAGE - BuildMode := $(BuildMode)+Coverage - CXX.Flags += -ftest-coverage -fprofile-arcs - C.Flags += -ftest-coverage -fprofile-arcs -endif - -# If DISABLE_ASSERTIONS=1 is specified (make command line or configured), -# then disable assertions by defining the appropriate preprocessor symbols. -ifndef DISABLE_ASSERTIONS - BuildMode := $(BuildMode)+Asserts - CPP.Defines += -D_DEBUG -else - CPP.Defines += -DNDEBUG -endif - -# If ENABLE_EXPENSIVE_CHECKS=1 is specified (make command line or -# configured), then enable expensive checks by defining the -# appropriate preprocessor symbols. -ifdef ENABLE_EXPENSIVE_CHECKS - BuildMode := $(BuildMode)+Checks - CPP.Defines += -D_GLIBCXX_DEBUG -DXDEBUG -endif - -# LOADABLE_MODULE implies several other things so we force them to be -# defined/on. -ifdef LOADABLE_MODULE - SHARED_LIBRARY := 1 - LINK_LIBS_IN_SHARED := 1 -endif - -ifdef SHARED_LIBRARY - ENABLE_PIC := 1 - PIC_FLAG = "(PIC)" -endif - -ifeq ($(ENABLE_PIC),1) - ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) - # Nothing. Win32 defaults to PIC and warns when given -fPIC - else - ifeq ($(HOST_OS),Darwin) - # Common symbols not allowed in dylib files - CXX.Flags += -fno-common - C.Flags += -fno-common - else - # Linux and others; pass -fPIC - CXX.Flags += -fPIC - C.Flags += -fPIC - endif - endif -else - ifeq ($(HOST_OS),Darwin) - CXX.Flags += -mdynamic-no-pic - C.Flags += -mdynamic-no-pic - endif -endif - -# Support makefile variable to disable any kind of timestamp/non-deterministic -# info from being used in the build. -ifeq ($(ENABLE_TIMESTAMPS),1) - DOTDIR_TIMESTAMP_COMMAND := $(DATE) -else - DOTDIR_TIMESTAMP_COMMAND := echo 'Created.' -endif - -ifeq ($(HOST_OS),MingW) - # Work around PR4957 - CPP.Defines += -D__NO_CTYPE_INLINE - ifeq ($(LLVM_CROSS_COMPILING),1) - # Work around http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=525016 - ifdef TOOLNAME - LD.Flags += -Wl,--allow-multiple-definition - endif - endif -endif - -CXX.Flags += -Woverloaded-virtual -CPP.BaseFlags += $(CPP.Defines) -AR.Flags := cru - -# Make Floating point IEEE compliant on Alpha. -ifeq ($(ARCH),Alpha) - CXX.Flags += -mieee - CPP.BaseFlags += -mieee -ifeq ($(ENABLE_PIC),0) - CXX.Flags += -fPIC - CPP.BaseFlags += -fPIC -endif -endif - -ifeq ($(ARCH),Alpha) - LD.Flags += -Wl,--no-relax -endif - -#-------------------------------------------------------------------- -# Directory locations -#-------------------------------------------------------------------- -TargetMode := -ifeq ($(LLVM_CROSS_COMPILING),1) - BuildLLVMToolDir := $(LLVM_OBJ_ROOT)/BuildTools/$(BuildMode)/bin -endif - -ObjRootDir := $(PROJ_OBJ_DIR)/$(BuildMode) -ObjDir := $(ObjRootDir) -LibDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib -ToolDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/bin -ExmplDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/examples -LLVMLibDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/lib -LLVMToolDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/bin -LLVMExmplDir:= $(LLVM_OBJ_ROOT)/$(BuildMode)/examples - -#-------------------------------------------------------------------- -# Locations of shared libraries -#-------------------------------------------------------------------- - -SharedPrefix := lib -SharedLibDir := $(LibDir) -LLVMSharedLibDir := $(LLVMLibDir) - -# Win32.DLL prefers to be located on the "PATH" of binaries. -ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) - SharedLibDir := $(ToolDir) - LLVMSharedLibDir := $(LLVMToolDir) - - ifeq ($(HOST_OS),Cygwin) - SharedPrefix := cyg - else - SharedPrefix := - endif -endif - -#-------------------------------------------------------------------- -# LLVM Capable Compiler -#-------------------------------------------------------------------- - -ifeq ($(LLVMCC_OPTION),llvm-gcc) - LLVMCC := $(LLVMGCC) - LLVMCXX := $(LLVMGXX) -else - ifeq ($(LLVMCC_OPTION),clang) - ifneq ($(CLANGPATH),) - LLVMCC := $(CLANGPATH) - LLVMCXX := $(CLANGXXPATH) - else - ifeq ($(ENABLE_BUILT_CLANG),1) - LLVMCC := $(LLVMToolDir)/clang - LLVMCXX := $(LLVMToolDir)/clang++ - endif - endif - endif -endif - -#-------------------------------------------------------------------- -# Full Paths To Compiled Tools and Utilities -#-------------------------------------------------------------------- -EchoCmd = $(ECHO) llvm[$(MAKELEVEL)]: -Echo = @$(EchoCmd) -ifndef LLVMAS -LLVMAS := $(LLVMToolDir)/llvm-as$(EXEEXT) -endif -ifndef TBLGEN - ifeq ($(LLVM_CROSS_COMPILING),1) - TBLGEN := $(BuildLLVMToolDir)/tblgen$(BUILD_EXEEXT) - else - TBLGEN := $(LLVMToolDir)/tblgen$(EXEEXT) - endif -endif -LLVM_CONFIG := $(LLVMToolDir)/llvm-config -ifndef LLVMLD -LLVMLD := $(LLVMToolDir)/llvm-ld$(EXEEXT) -endif -ifndef LLVMDIS -LLVMDIS := $(LLVMToolDir)/llvm-dis$(EXEEXT) -endif -ifndef LLI -LLI := $(LLVMToolDir)/lli$(EXEEXT) -endif -ifndef LLC -LLC := $(LLVMToolDir)/llc$(EXEEXT) -endif -ifndef LOPT -LOPT := $(LLVMToolDir)/opt$(EXEEXT) -endif -ifndef LBUGPOINT -LBUGPOINT := $(LLVMToolDir)/bugpoint$(EXEEXT) -endif - -#-------------------------------------------------------------------- -# Adjust to user's request -#-------------------------------------------------------------------- - -ifeq ($(HOST_OS),Darwin) - DARWIN_VERSION := `sw_vers -productVersion` - # Strip a number like 10.4.7 to 10.4 - DARWIN_VERSION := $(shell echo $(DARWIN_VERSION)| sed -E 's/(10.[0-9]).*/\1/') - # Get "4" out of 10.4 for later pieces in the makefile. - DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/') - - SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined,suppress \ - -dynamiclib - ifneq ($(ARCH),ARM) - SharedLinkOptions += -mmacosx-version-min=$(DARWIN_VERSION) - endif -else - SharedLinkOptions=-shared -endif - -ifeq ($(TARGET_OS),Darwin) - ifneq ($(ARCH),ARM) - TargetCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION) - endif -endif - -ifdef SHARED_LIBRARY -ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) -ifneq ($(HOST_OS),Darwin) - LD.Flags += $(RPATH) -Wl,'$$ORIGIN' -else -ifneq ($(DARWIN_MAJVERS),4) - LD.Flags += $(RPATH) -Wl,$(SharedLibDir) -endif -endif -endif -endif - -ifdef TOOL_VERBOSE - C.Flags += -v - CXX.Flags += -v - LD.Flags += -v - VERBOSE := 1 -endif - -# Adjust settings for verbose mode -ifndef VERBOSE - Verb := @ - AR.Flags += >/dev/null 2>/dev/null - ConfigureScriptFLAGS += >$(PROJ_OBJ_DIR)/configure.out 2>&1 -else - ConfigureScriptFLAGS := -endif - -# By default, strip symbol information from executable -ifndef KEEP_SYMBOLS - Strip := $(PLATFORMSTRIPOPTS) - StripWarnMsg := "(without symbols)" - Install.StripFlag += -s -endif - -# Adjust linker flags for building an executable -ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) -ifneq ($(HOST_OS), Darwin) -ifdef TOOLNAME - LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib' - ifdef EXAMPLE_TOOL - LD.Flags += $(RPATH) -Wl,$(ExmplDir) $(RDYNAMIC) - else - LD.Flags += $(RPATH) -Wl,$(ToolDir) $(RDYNAMIC) - endif -endif -else -ifneq ($(DARWIN_MAJVERS),4) - LD.Flags += $(RPATH) -Wl,@executable_path/../lib -endif -endif -endif - - -#---------------------------------------------------------- -# Options To Invoke Tools -#---------------------------------------------------------- - -ifndef NO_PEDANTIC -CompileCommonOpts += -pedantic -Wno-long-long -endif -CompileCommonOpts += -Wall -W -Wno-unused-parameter -Wwrite-strings \ - $(EXTRA_OPTIONS) -# Enable cast-qual for C++; the workaround is to use const_cast. -CXX.Flags += -Wcast-qual - -ifeq ($(HOST_OS),HP-UX) - CompileCommonOpts := -D_REENTRANT -D_HPUX_SOURCE -endif - -# If we are building a universal binary on Mac OS/X, pass extra options. This -# is useful to people that want to link the LLVM libraries into their universal -# apps. -# -# The following can be optionally specified: -# UNIVERSAL_SDK_PATH variable can be specified as a path to the SDK to use. -# For Mac OS/X 10.4 Intel machines, the traditional one is: -# UNIVERSAL_SDK_PATH=/Developer/SDKs/MacOSX10.4u.sdk/ -# UNIVERSAL_ARCH can be optionally specified to be a list of architectures -# to build for, e.g. UNIVERSAL_ARCH="i386 ppc ppc64". This defaults to -# i386/ppc only. -ifdef UNIVERSAL - ifndef UNIVERSAL_ARCH - UNIVERSAL_ARCH := i386 ppc - endif - UNIVERSAL_ARCH_OPTIONS := $(UNIVERSAL_ARCH:%=-arch %) - CompileCommonOpts += $(UNIVERSAL_ARCH_OPTIONS) - ifdef UNIVERSAL_SDK_PATH - CompileCommonOpts += -isysroot $(UNIVERSAL_SDK_PATH) - endif - - # Building universal cannot compute dependencies automatically. - DISABLE_AUTO_DEPENDENCIES=1 -else - ifeq ($(TARGET_OS),Darwin) - ifeq ($(ARCH),x86_64) - TargetCommonOpts = -m64 - else - ifeq ($(ARCH),x86) - TargetCommonOpts = -m32 - endif - endif - endif -endif - -ifeq ($(HOST_OS),SunOS) -CPP.BaseFlags += -include llvm/System/Solaris.h -endif - -ifeq ($(HOST_OS),AuroraUX) -CPP.BaseFlags += -include llvm/System/Solaris.h -endif # !HOST_OS - AuroraUX. - -LD.Flags += -L$(LibDir) -L$(LLVMLibDir) -CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -# All -I flags should go here, so that they don't confuse llvm-config. -CPP.Flags += $(sort -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \ - $(patsubst %,-I%/include,\ - $(PROJ_OBJ_ROOT) $(PROJ_SRC_ROOT) \ - $(LLVM_OBJ_ROOT) $(LLVM_SRC_ROOT))) \ - $(CPP.BaseFlags) - -ifeq ($(BUILD_COMPONENT), 1) - Compile.C = $(BUILD_CC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \ - $(TargetCommonOpts) $(CompileCommonOpts) -c - Compile.CXX = $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) \ - $(CPPFLAGS) \ - $(TargetCommonOpts) $(CompileCommonOpts) -c - Preprocess.CXX= $(BUILD_CXX) $(CPP.Flags) $(CPPFLAGS) $(TargetCommonOpts) \ - $(CompileCommonOpts) $(CXX.Flags) -E - Link = $(BUILD_CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) \ - $(LDFLAGS) \ - $(TargetCommonOpts) $(CompileCommonOpts) $(LD.Flags) $(Strip) -else - Compile.C = $(CC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \ - $(TargetCommonOpts) $(CompileCommonOpts) -c - Compile.CXX = $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \ - $(TargetCommonOpts) $(CompileCommonOpts) -c - Preprocess.CXX= $(CXX) $(CPP.Flags) $(TargetCommonOpts) $(CPPFLAGS) \ - $(CompileCommonOpts) $(CXX.Flags) -E - Link = $(CXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(LDFLAGS) \ - $(TargetCommonOpts) $(CompileCommonOpts) $(LD.Flags) $(Strip) -endif - -BCCompile.C = $(LLVMCC) $(CPP.Flags) $(C.Flags) $(CFLAGS) $(CPPFLAGS) \ - $(TargetCommonOpts) $(CompileCommonOpts) -Preprocess.C = $(CC) $(CPP.Flags) $(C.Flags) $(CPPFLAGS) \ - $(TargetCommonOpts) $(CompileCommonOpts) -E - -BCCompile.CXX = $(LLVMCXX) $(CPP.Flags) $(CXX.Flags) $(CXXFLAGS) $(CPPFLAGS) \ - $(TargetCommonOpts) $(CompileCommonOpts) - -ProgInstall = $(INSTALL) $(Install.StripFlag) -m 0755 -ScriptInstall = $(INSTALL) -m 0755 -DataInstall = $(INSTALL) -m 0644 - -# When compiling under Mingw/Cygwin, the tblgen tool expects Windows -# paths. In this case, the SYSPATH function (defined in -# Makefile.config) transforms Unix paths into Windows paths. -TableGen = $(TBLGEN) -I $(call SYSPATH, $(PROJ_SRC_DIR)) \ - -I $(call SYSPATH, $(LLVM_SRC_ROOT)/include) \ - -I $(call SYSPATH, $(PROJ_SRC_ROOT)/include) \ - -I $(call SYSPATH, $(PROJ_SRC_ROOT)/lib/Target) - -Archive = $(AR) $(AR.Flags) -LArchive = $(LLVMToolDir)/llvm-ar rcsf -ifdef RANLIB -Ranlib = $(RANLIB) -else -Ranlib = ranlib -endif - -AliasTool = ln -s - -#---------------------------------------------------------- -# Get the list of source files and compute object file -# names from them. -#---------------------------------------------------------- - -ifndef SOURCES - Sources := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.cpp \ - $(PROJ_SRC_DIR)/*.cc $(PROJ_SRC_DIR)/*.c)) -else - Sources := $(SOURCES) -endif - -ifdef BUILT_SOURCES -Sources += $(filter %.cpp %.c %.cc,$(BUILT_SOURCES)) -endif - -BaseNameSources := $(sort $(basename $(Sources))) - -ObjectsO := $(BaseNameSources:%=$(ObjDir)/%.o) -ObjectsBC := $(BaseNameSources:%=$(ObjDir)/%.bc) - -############################################################################### -# DIRECTORIES: Handle recursive descent of directory structure -############################################################################### - -#--------------------------------------------------------- -# Provide rules to make install dirs. This must be early -# in the file so they get built before dependencies -#--------------------------------------------------------- - -$(DESTDIR)$(PROJ_bindir) $(DESTDIR)$(PROJ_libdir) $(DESTDIR)$(PROJ_includedir) $(DESTDIR)$(PROJ_etcdir):: - $(Verb) $(MKDIR) $@ - -# To create other directories, as needed, and timestamp their creation -%/.dir: - $(Verb) $(MKDIR) $* > /dev/null - $(Verb) $(DOTDIR_TIMESTAMP_COMMAND) > $@ - -.PRECIOUS: $(ObjDir)/.dir $(LibDir)/.dir $(ToolDir)/.dir $(ExmplDir)/.dir -.PRECIOUS: $(LLVMLibDir)/.dir $(LLVMToolDir)/.dir $(LLVMExmplDir)/.dir - -#--------------------------------------------------------- -# Handle the DIRS options for sequential construction -#--------------------------------------------------------- - -SubDirs := -ifdef DIRS -SubDirs += $(DIRS) - -ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT)) -$(RecursiveTargets):: - $(Verb) for dir in $(DIRS); do \ - if ([ ! -f $$dir/Makefile ] || \ - command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \ - $(MKDIR) $$dir; \ - $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \ - fi; \ - ($(MAKE) -C $$dir $@ ) || exit 1; \ - done -else -$(RecursiveTargets):: - $(Verb) for dir in $(DIRS); do \ - ($(MAKE) -C $$dir $@ ) || exit 1; \ - done -endif - -endif - -#--------------------------------------------------------- -# Handle the EXPERIMENTAL_DIRS options ensuring success -# after each directory is built. -#--------------------------------------------------------- -ifdef EXPERIMENTAL_DIRS -$(RecursiveTargets):: - $(Verb) for dir in $(EXPERIMENTAL_DIRS); do \ - if ([ ! -f $$dir/Makefile ] || \ - command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \ - $(MKDIR) $$dir; \ - $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \ - fi; \ - ($(MAKE) -C $$dir $@ ) || exit 0; \ - done -endif - -#----------------------------------------------------------- -# Handle the OPTIONAL_PARALLEL_DIRS options for optional parallel construction -#----------------------------------------------------------- -ifdef OPTIONAL_PARALLEL_DIRS - PARALLEL_DIRS += $(foreach T,$(OPTIONAL_PARALLEL_DIRS),$(shell test -d $(PROJ_SRC_DIR)/$(T) && echo "$(T)")) -endif - -#----------------------------------------------------------- -# Handle the PARALLEL_DIRS options for parallel construction -#----------------------------------------------------------- -ifdef PARALLEL_DIRS - -SubDirs += $(PARALLEL_DIRS) - -# Unfortunately, this list must be maintained if new recursive targets are added -all :: $(addsuffix /.makeall ,$(PARALLEL_DIRS)) -clean :: $(addsuffix /.makeclean ,$(PARALLEL_DIRS)) -clean-all:: $(addsuffix /.makeclean-all,$(PARALLEL_DIRS)) -install :: $(addsuffix /.makeinstall ,$(PARALLEL_DIRS)) -uninstall:: $(addsuffix /.makeuninstall,$(PARALLEL_DIRS)) -install-bytecode :: $(addsuffix /.makeinstall-bytecode,$(PARALLEL_DIRS)) -unitcheck:: $(addsuffix /.makeunitcheck,$(PARALLEL_DIRS)) - -ParallelTargets := $(foreach T,$(RecursiveTargets),%/.make$(T)) - -$(ParallelTargets) : - $(Verb) if ([ ! -f $(@D)/Makefile ] || \ - command test $(@D)/Makefile -ot \ - $(PROJ_SRC_DIR)/$(@D)/Makefile ); then \ - $(MKDIR) $(@D); \ - $(CP) $(PROJ_SRC_DIR)/$(@D)/Makefile $(@D)/Makefile; \ - fi; \ - $(MAKE) -C $(@D) $(subst $(@D)/.make,,$@) -endif - -#--------------------------------------------------------- -# Handle the OPTIONAL_DIRS options for directores that may -# or may not exist. -#--------------------------------------------------------- -ifdef OPTIONAL_DIRS - -SubDirs += $(OPTIONAL_DIRS) - -ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT)) -$(RecursiveTargets):: - $(Verb) for dir in $(OPTIONAL_DIRS); do \ - if [ -d $(PROJ_SRC_DIR)/$$dir ]; then\ - if ([ ! -f $$dir/Makefile ] || \ - command test $$dir/Makefile -ot $(PROJ_SRC_DIR)/$$dir/Makefile ); then \ - $(MKDIR) $$dir; \ - $(CP) $(PROJ_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \ - fi; \ - ($(MAKE) -C$$dir $@ ) || exit 1; \ - fi \ - done -else -$(RecursiveTargets):: - $(Verb) for dir in $(OPTIONAL_DIRS); do \ - ($(MAKE) -C$$dir $@ ) || exit 1; \ - done -endif -endif - -#--------------------------------------------------------- -# Handle the CONFIG_FILES options -#--------------------------------------------------------- -ifdef CONFIG_FILES - -ifdef NO_INSTALL -install-local:: - $(Echo) Install circumvented with NO_INSTALL -uninstall-local:: - $(Echo) UnInstall circumvented with NO_INSTALL -else -install-local:: $(DESTDIR)$(PROJ_etcdir) $(CONFIG_FILES) - $(Echo) Installing Configuration Files To $(DESTDIR)$(PROJ_etcdir) - $(Verb)for file in $(CONFIG_FILES); do \ - if test -f $(PROJ_OBJ_DIR)/$${file} ; then \ - $(DataInstall) $(PROJ_OBJ_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \ - elif test -f $(PROJ_SRC_DIR)/$${file} ; then \ - $(DataInstall) $(PROJ_SRC_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \ - else \ - $(ECHO) Error: cannot find config file $${file}. ; \ - fi \ - done - -uninstall-local:: - $(Echo) Uninstalling Configuration Files From $(DESTDIR)$(PROJ_etcdir) - $(Verb)for file in $(CONFIG_FILES); do \ - $(RM) -f $(DESTDIR)$(PROJ_etcdir)/$${file} ; \ - done -endif - -endif - -############################################################################### -# Set up variables for building libraries -############################################################################### - -#--------------------------------------------------------- -# Define various command line options pertaining to the -# libraries needed when linking. There are "Proj" libs -# (defined by the user's project) and "LLVM" libs (defined -# by the LLVM project). -#--------------------------------------------------------- - -ifdef USEDLIBS -ProjLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS))) -ProjLibsOptions := $(patsubst %.o, $(LibDir)/%.o, $(ProjLibsOptions)) -ProjUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS))) -ProjLibsPaths := $(addprefix $(LibDir)/,$(ProjUsedLibs)) -endif - -ifdef LLVMLIBS -LLVMLibsOptions := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS))) -LLVMLibsOptions := $(patsubst %.o, $(LLVMLibDir)/%.o, $(LLVMLibsOptions)) -LLVMUsedLibs := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS))) -LLVMLibsPaths := $(addprefix $(LLVMLibDir)/,$(LLVMUsedLibs)) -endif - -# Win32.DLL may refer to other components. -ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) - ifdef LOADABLE_MODULE - LINK_COMPONENTS := all - endif -endif - -ifndef IS_CLEANING_TARGET -ifdef LINK_COMPONENTS - -# If LLVM_CONFIG doesn't exist, build it. This can happen if you do a make -# clean in tools, then do a make in tools (instead of at the top level). -$(LLVM_CONFIG): - @echo "*** llvm-config doesn't exist - rebuilding it." - @$(MAKE) -C $(PROJ_OBJ_ROOT)/tools/llvm-config - -$(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT): $(LLVM_CONFIG) - -ifeq ($(ENABLE_SHARED), 1) -# We can take the "auto-import" feature to get rid of using dllimport. -ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) -LLVMLibsOptions += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc \ - -L $(SharedLibDir) -endif -LLVMLibsOptions += -lLLVM-$(LLVMVersion) -LLVMLibsPaths += $(SharedLibDir)/$(SharedPrefix)LLVM-$(LLVMVersion)$(SHLIBEXT) -else - -ifndef NO_LLVM_CONFIG -LLVMConfigLibs := $(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS) || echo Error) -ifeq ($(LLVMConfigLibs),Error) -$(error llvm-config --libs failed) -endif -LLVMLibsOptions += $(LLVMConfigLibs) -LLVMConfigLibfiles := $(shell $(LLVM_CONFIG) --libfiles $(LINK_COMPONENTS) || echo Error) -ifeq ($(LLVMConfigLibfiles),Error) -$(error llvm-config --libfiles failed) -endif -LLVMLibsPaths += $(LLVM_CONFIG) $(LLVMConfigLibfiles) -endif - -endif -endif -endif - -# Set up the library exports file. -ifdef EXPORTED_SYMBOL_FILE - -# First, set up the native export file, which may differ from the source -# export file. - -# The option --version-script is not effective on GNU ld win32. -ifneq (,$(filter $(HOST_OS),Cygwin MingW)) - HAVE_LINK_VERSION_SCRIPT := 0 -endif - -ifeq ($(HOST_OS),Darwin) -# Darwin convention prefixes symbols with underscores. -NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).sed -$(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir - $(Verb) sed -e 's/^/_/' < $< > $@ -clean-local:: - -$(Verb) $(RM) -f $(NativeExportsFile) -else -ifeq ($(HAVE_LINK_VERSION_SCRIPT),1) -# Gold and BFD ld require a version script rather than a plain list. -NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).map -$(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir - $(Verb) echo "{" > $@ - $(Verb) grep -q "\<" $< && echo " global:" >> $@ || : - $(Verb) sed -e 's/$$/;/' -e 's/^/ /' < $< >> $@ - $(Verb) echo " local: *;" >> $@ - $(Verb) echo "};" >> $@ -clean-local:: - -$(Verb) $(RM) -f $(NativeExportsFile) -else -ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) -# GNU ld Win32 accepts .DEF files that contain "DATA" entries. -NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE:.exports=.def)) -$(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir - $(Echo) Generating $(notdir $@) - $(Verb) $(ECHO) "EXPORTS" > $@ - $(Verb) $(CAT) $< >> $@ -clean-local:: - -$(Verb) $(RM) -f $(NativeExportsFile) -else -# Default behavior: just use the exports file verbatim. -NativeExportsFile := $(EXPORTED_SYMBOL_FILE) -endif -endif -endif - -# Now add the linker command-line options to use the native export file. - -# Darwin -ifeq ($(HOST_OS),Darwin) -LLVMLibsOptions += -Wl,-exported_symbols_list,$(NativeExportsFile) -endif - -# gold, bfd ld, etc. -ifeq ($(HAVE_LINK_VERSION_SCRIPT),1) -LLVMLibsOptions += -Wl,--version-script,$(NativeExportsFile) -endif - -# Windows -ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) -# LLVMLibsOptions is invalidated at processing tools/llvm-shlib. -SharedLinkOptions += $(NativeExportsFile) -endif - -endif - -############################################################################### -# Library Build Rules: Four ways to build a library -############################################################################### - -#--------------------------------------------------------- -# Bytecode Module Targets: -# If the user set MODULE_NAME then they want to build a -# bytecode module from the sources. We compile all the -# sources and link it together into a single bytecode -# module. -#--------------------------------------------------------- - -ifdef MODULE_NAME -ifeq ($(strip $(LLVMCC)),) -$(warning Modules require LLVM capable compiler but none is available ****) -else - -Module := $(LibDir)/$(MODULE_NAME).bc -LinkModule := $(LLVMLD) -r - - -ifdef EXPORTED_SYMBOL_FILE -LinkModule += -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE) -endif - -$(Module): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(LLVMLD) - $(Echo) Building $(BuildMode) Bytecode Module $(notdir $@) - $(Verb) $(LinkModule) -o $@ $(ObjectsBC) - -all-local:: $(Module) - -clean-local:: -ifneq ($(strip $(Module)),) - -$(Verb) $(RM) -f $(Module) -endif - -ifdef BYTECODE_DESTINATION -ModuleDestDir := $(BYTECODE_DESTINATION) -else -ModuleDestDir := $(DESTDIR)$(PROJ_libdir) -endif - -ifdef NO_INSTALL -install-local:: - $(Echo) Install circumvented with NO_INSTALL -uninstall-local:: - $(Echo) Uninstall circumvented with NO_INSTALL -else -DestModule := $(ModuleDestDir)/$(MODULE_NAME).bc - -install-module:: $(DestModule) -install-local:: $(DestModule) - -$(DestModule): $(ModuleDestDir) $(Module) - $(Echo) Installing $(BuildMode) Bytecode Module $(DestModule) - $(Verb) $(DataInstall) $(Module) $(DestModule) - -uninstall-local:: - $(Echo) Uninstalling $(BuildMode) Bytecode Module $(DestModule) - -$(Verb) $(RM) -f $(DestModule) -endif - -endif -endif - -# if we're building a library ... -ifdef LIBRARYNAME - -# Make sure there isn't any extraneous whitespace on the LIBRARYNAME option -LIBRARYNAME := $(strip $(LIBRARYNAME)) -ifdef LOADABLE_MODULE -LibName.A := $(LibDir)/$(LIBRARYNAME).a -LibName.SO := $(SharedLibDir)/$(LIBRARYNAME)$(SHLIBEXT) -else -LibName.A := $(LibDir)/lib$(LIBRARYNAME).a -LibName.SO := $(SharedLibDir)/$(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT) -endif -LibName.O := $(LibDir)/$(LIBRARYNAME).o -LibName.BCA:= $(LibDir)/lib$(LIBRARYNAME).bca - -#--------------------------------------------------------- -# Shared Library Targets: -# If the user asked for a shared library to be built -# with the SHARED_LIBRARY variable, then we provide -# targets for building them. -#--------------------------------------------------------- -ifdef SHARED_LIBRARY - -all-local:: $(LibName.SO) - -ifdef EXPORTED_SYMBOL_FILE -$(LibName.SO): $(NativeExportsFile) -endif - -ifdef LINK_LIBS_IN_SHARED -ifdef LOADABLE_MODULE -SharedLibKindMessage := "Loadable Module" -else -SharedLibKindMessage := "Shared Library" -endif -$(LibName.SO): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) $(SharedLibDir)/.dir - $(Echo) Linking $(BuildMode) $(SharedLibKindMessage) \ - $(notdir $@) - $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO) \ - $(ProjLibsOptions) $(LLVMLibsOptions) $(LIBS) -else -$(LibName.SO): $(ObjectsO) $(SharedLibDir)/.dir - $(Echo) Linking $(BuildMode) Shared Library $(notdir $@) - $(Verb) $(Link) $(SharedLinkOptions) -o $@ $(ObjectsO) -endif - -clean-local:: -ifneq ($(strip $(LibName.SO)),) - -$(Verb) $(RM) -f $(LibName.SO) -endif - -ifdef NO_INSTALL -install-local:: - $(Echo) Install circumvented with NO_INSTALL -uninstall-local:: - $(Echo) Uninstall circumvented with NO_INSTALL -else - -# Win32.DLL prefers to be located on the "PATH" of binaries. -ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) -DestSharedLibDir := $(DESTDIR)$(PROJ_bindir) -else -DestSharedLibDir := $(DESTDIR)$(PROJ_libdir) -endif -DestSharedLib := $(DestSharedLibDir)/$(SharedPrefix)$(LIBRARYNAME)$(SHLIBEXT) - -install-local:: $(DestSharedLib) - -$(DestSharedLib): $(LibName.SO) $(DestSharedLibDir) - $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib) - $(Verb) $(INSTALL) $(LibName.SO) $(DestSharedLib) - -uninstall-local:: - $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib) - -$(Verb) $(RM) -f $(DestSharedLibDir)/$(SharedPrefix)$(LIBRARYNAME).* -endif -endif - -#--------------------------------------------------------- -# Bytecode Library Targets: -# If the user asked for a bytecode library to be built -# with the BYTECODE_LIBRARY variable, then we provide -# targets for building them. -#--------------------------------------------------------- -ifdef BYTECODE_LIBRARY -ifeq ($(strip $(LLVMCC)),) -$(warning Bytecode libraries require LLVM capable compiler but none is available ****) -else - -all-local:: $(LibName.BCA) - -ifdef EXPORTED_SYMBOL_FILE -BCLinkLib = $(LLVMLD) -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE) - -$(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir $(LLVMLD) \ - $(LLVMToolDir)/llvm-ar - $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \ - "(internalize)" - $(Verb) $(BCLinkLib) -o $(ObjDir)/$(LIBRARYNAME).internalize $(ObjectsBC) - $(Verb) $(RM) -f $@ - $(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).internalize.bc -else -$(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir \ - $(LLVMToolDir)/llvm-ar - $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) - $(Verb) $(RM) -f $@ - $(Verb) $(LArchive) $@ $(ObjectsBC) - -endif - -clean-local:: -ifneq ($(strip $(LibName.BCA)),) - -$(Verb) $(RM) -f $(LibName.BCA) -endif - -ifdef BYTECODE_DESTINATION -BytecodeDestDir := $(BYTECODE_DESTINATION) -else -BytecodeDestDir := $(DESTDIR)$(PROJ_libdir) -endif - -DestBytecodeLib = $(BytecodeDestDir)/lib$(LIBRARYNAME).bca - -install-bytecode-local:: $(DestBytecodeLib) - -ifdef NO_INSTALL -install-local:: - $(Echo) Install circumvented with NO_INSTALL -uninstall-local:: - $(Echo) Uninstall circumvented with NO_INSTALL -else -install-local:: $(DestBytecodeLib) - -$(DestBytecodeLib): $(LibName.BCA) $(BytecodeDestDir) - $(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib) - $(Verb) $(DataInstall) $(LibName.BCA) $(DestBytecodeLib) - -uninstall-local:: - $(Echo) Uninstalling $(BuildMode) Bytecode Archive $(DestBytecodeLib) - -$(Verb) $(RM) -f $(DestBytecodeLib) -endif -endif -endif - -#--------------------------------------------------------- -# Library Targets: -# If neither BUILD_ARCHIVE or LOADABLE_MODULE are specified, default to -# building an archive. -#--------------------------------------------------------- -ifndef NO_BUILD_ARCHIVE -ifndef BUILD_ARCHIVE -ifndef LOADABLE_MODULE -BUILD_ARCHIVE = 1 -endif -endif -endif - -#--------------------------------------------------------- -# Archive Library Targets: -# If the user wanted a regular archive library built, -# then we provide targets for building them. -#--------------------------------------------------------- -ifdef BUILD_ARCHIVE - -all-local:: $(LibName.A) - -$(LibName.A): $(ObjectsO) $(LibDir)/.dir - $(Echo) Building $(BuildMode) Archive Library $(notdir $@) - -$(Verb) $(RM) -f $@ - $(Verb) $(Archive) $@ $(ObjectsO) - $(Verb) $(Ranlib) $@ - -clean-local:: -ifneq ($(strip $(LibName.A)),) - -$(Verb) $(RM) -f $(LibName.A) -endif - -ifdef NO_INSTALL -install-local:: - $(Echo) Install circumvented with NO_INSTALL -uninstall-local:: - $(Echo) Uninstall circumvented with NO_INSTALL -else -ifdef NO_INSTALL_ARCHIVES -install-local:: - $(Echo) Install circumvented with NO_INSTALL -uninstall-local:: - $(Echo) Uninstall circumvented with NO_INSTALL -else -DestArchiveLib := $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME).a - -install-local:: $(DestArchiveLib) - -$(DestArchiveLib): $(LibName.A) $(DESTDIR)$(PROJ_libdir) - $(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib) - $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_libdir) - $(Verb) $(INSTALL) $(LibName.A) $(DestArchiveLib) - -uninstall-local:: - $(Echo) Uninstalling $(BuildMode) Archive Library $(DestArchiveLib) - -$(Verb) $(RM) -f $(DestArchiveLib) -endif -endif -endif - -# endif LIBRARYNAME -endif - -############################################################################### -# Tool Build Rules: Build executable tool based on TOOLNAME option -############################################################################### - -ifdef TOOLNAME - -#--------------------------------------------------------- -# Set up variables for building a tool. -#--------------------------------------------------------- -TOOLEXENAME := $(strip $(TOOLNAME))$(EXEEXT) -ifdef EXAMPLE_TOOL -ToolBuildPath := $(ExmplDir)/$(TOOLEXENAME) -else -ToolBuildPath := $(ToolDir)/$(TOOLEXENAME) -endif - -# TOOLALIAS is a name to symlink (or copy) the tool to. -ifdef TOOLALIAS -ifdef EXAMPLE_TOOL -ToolAliasBuildPath := $(ExmplDir)/$(strip $(TOOLALIAS))$(EXEEXT) -else -ToolAliasBuildPath := $(ToolDir)/$(strip $(TOOLALIAS))$(EXEEXT) -endif -endif - -#--------------------------------------------------------- -# Prune Exports -#--------------------------------------------------------- - -# If the tool opts in with TOOL_NO_EXPORTS, optimize startup time of the app by -# not exporting all of the weak symbols from the binary. This reduces dyld -# startup time by 4x on darwin in some cases. -ifdef TOOL_NO_EXPORTS -ifeq ($(HOST_OS),Darwin) - -# Tiger tools don't support this. -ifneq ($(DARWIN_MAJVERS),4) -LD.Flags += -Wl,-exported_symbol,_main -endif -endif - -ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux NetBSD FreeBSD)) -ifneq ($(ARCH), Mips) - LD.Flags += -Wl,--version-script=$(LLVM_SRC_ROOT)/autoconf/ExportMap.map -endif -endif -endif - -#--------------------------------------------------------- -# Tool Version Info Support -#--------------------------------------------------------- - -ifeq ($(HOST_OS),Darwin) -ifdef TOOL_INFO_PLIST - -LD.Flags += -Wl,-sectcreate,__TEXT,__info_plist,$(ObjDir)/$(TOOL_INFO_PLIST) - -$(ToolBuildPath): $(ObjDir)/$(TOOL_INFO_PLIST) - -$(ObjDir)/$(TOOL_INFO_PLIST): $(PROJ_SRC_DIR)/$(TOOL_INFO_PLIST).in $(ObjDir)/.dir - $(Echo) "Creating $(TOOLNAME) '$(TOOL_INFO_PLIST)' file..." - $(Verb)sed -e "s#@TOOL_INFO_UTI@#$(TOOL_INFO_UTI)#g" \ - -e "s#@TOOL_INFO_NAME@#$(TOOL_INFO_NAME)#g" \ - -e "s#@TOOL_INFO_VERSION@#$(TOOL_INFO_VERSION)#g" \ - -e "s#@TOOL_INFO_BUILD_VERSION@#$(TOOL_INFO_BUILD_VERSION)#g" \ - $< > $@ - -endif -endif - -#--------------------------------------------------------- -# Provide targets for building the tools -#--------------------------------------------------------- -all-local:: $(ToolBuildPath) $(ToolAliasBuildPath) - -clean-local:: -ifneq ($(strip $(ToolBuildPath)),) - -$(Verb) $(RM) -f $(ToolBuildPath) -endif -ifneq ($(strip $(ToolAliasBuildPath)),) - -$(Verb) $(RM) -f $(ToolAliasBuildPath) -endif - -ifdef EXAMPLE_TOOL -$(ToolBuildPath): $(ExmplDir)/.dir -else -$(ToolBuildPath): $(ToolDir)/.dir -endif - -$(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) - $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg) - $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \ - $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) $(LIBS) - $(Echo) ======= Finished Linking $(BuildMode) Executable $(TOOLNAME) \ - $(StripWarnMsg) - -ifneq ($(strip $(ToolAliasBuildPath)),) -$(ToolAliasBuildPath): $(ToolBuildPath) - $(Echo) Creating $(BuildMode) Alias $(TOOLALIAS) $(StripWarnMsg) - $(Verb) $(RM) -f $(ToolAliasBuildPath) - $(Verb) $(AliasTool) $(TOOLEXENAME) $(ToolAliasBuildPath) - $(Echo) ======= Finished Creating $(BuildMode) Alias $(TOOLALIAS) \ - $(StripWarnMsg) -endif - -ifdef NO_INSTALL -install-local:: - $(Echo) Install circumvented with NO_INSTALL -uninstall-local:: - $(Echo) Uninstall circumvented with NO_INSTALL -else -DestTool = $(DESTDIR)$(PROJ_bindir)/$(TOOLEXENAME) - -install-local:: $(DestTool) - -$(DestTool): $(ToolBuildPath) $(DESTDIR)$(PROJ_bindir) - $(Echo) Installing $(BuildMode) $(DestTool) - $(Verb) $(ProgInstall) $(ToolBuildPath) $(DestTool) - -uninstall-local:: - $(Echo) Uninstalling $(BuildMode) $(DestTool) - -$(Verb) $(RM) -f $(DestTool) - -# TOOLALIAS install. -ifdef TOOLALIAS -DestToolAlias = $(DESTDIR)$(PROJ_bindir)/$(TOOLALIAS)$(EXEEXT) - -install-local:: $(DestToolAlias) - -$(DestToolAlias): $(DestTool) - $(Echo) Installing $(BuildMode) $(DestToolAlias) - $(Verb) $(RM) -f $(DestToolAlias) - $(Verb) $(AliasTool) $(TOOLEXENAME) $(DestToolAlias) - -uninstall-local:: - $(Echo) Uninstalling $(BuildMode) $(DestToolAlias) - -$(Verb) $(RM) -f $(DestToolAlias) -endif - -endif -endif - -############################################################################### -# Object Build Rules: Build object files based on sources -############################################################################### - -# FIXME: This should be checking for "if not GCC or ICC", not for "if HP-UX" -ifeq ($(HOST_OS),HP-UX) - DISABLE_AUTO_DEPENDENCIES=1 -endif - -# Provide rule sets for when dependency generation is enabled -ifndef DISABLE_AUTO_DEPENDENCIES - -#--------------------------------------------------------- -# Create .o files in the ObjDir directory from the .cpp and .c files... -#--------------------------------------------------------- - -DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.d.tmp" \ - -MT "$(ObjDir)/$*.o" -MT "$(ObjDir)/$*.d" - -# If the build succeeded, move the dependency file over, otherwise -# remove it. -DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.d.tmp" "$(ObjDir)/$*.d"; \ - else $(RM) "$(ObjDir)/$*.d.tmp"; exit 1; fi - -$(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_SRC_DIR)/Makefile - $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG) - $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \ - $(DEPEND_MOVEFILE) - -$(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_SRC_DIR)/Makefile - $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG) - $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \ - $(DEPEND_MOVEFILE) - -$(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_SRC_DIR)/Makefile - $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG) - $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \ - $(DEPEND_MOVEFILE) - -$(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_SRC_DIR)/Makefile - $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG) - $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \ - $(DEPEND_MOVEFILE) - -$(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_SRC_DIR)/Makefile - $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG) - $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \ - $(DEPEND_MOVEFILE) - -#--------------------------------------------------------- -# Create .bc files in the ObjDir directory from .cpp .cc and .c files... -#--------------------------------------------------------- - -BC_DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.bc.d.tmp" \ - -MT "$(ObjDir)/$*.ll" -MT "$(ObjDir)/$*.bc.d" - -# If the build succeeded, move the dependency file over, otherwise -# remove it. -BC_DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.bc.d.tmp" "$(ObjDir)/$*.bc.d"; \ - else $(RM) "$(ObjDir)/$*.bc.d.tmp"; exit 1; fi - -$(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX) - $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)" - $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \ - $< -o $(ObjDir)/$*.ll -S -emit-llvm ; \ - $(BC_DEPEND_MOVEFILE) - -$(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX) - $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)" - $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \ - $< -o $(ObjDir)/$*.ll -S -emit-llvm ; \ - $(BC_DEPEND_MOVEFILE) - -$(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX) - $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)" - $(Verb) if $(BCCompile.CXX) $(BC_DEPEND_OPTIONS) \ - $< -o $(ObjDir)/$*.ll -S -emit-llvm ; \ - $(BC_DEPEND_MOVEFILE) - -$(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC) - $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)" - $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \ - $< -o $(ObjDir)/$*.ll -S -emit-llvm ; \ - $(BC_DEPEND_MOVEFILE) - -$(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC) - $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)" - $(Verb) if $(BCCompile.C) $(BC_DEPEND_OPTIONS) \ - $< -o $(ObjDir)/$*.ll -S -emit-llvm ; \ - $(BC_DEPEND_MOVEFILE) - -# Provide alternate rule sets if dependencies are disabled -else - -$(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) - $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG) - $(Compile.CXX) $< -o $@ - -$(ObjDir)/%.o: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) - $(Echo) "Compiling $*.mm for $(BuildMode) build" $(PIC_FLAG) - $(Compile.CXX) $< -o $@ - -$(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) - $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG) - $(Compile.CXX) $< -o $@ - -$(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) - $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG) - $(Compile.C) $< -o $@ - -$(ObjDir)/%.o: %.m $(ObjDir)/.dir $(BUILT_SOURCES) - $(Echo) "Compiling $*.m for $(BuildMode) build" $(PIC_FLAG) - $(Compile.C) $< -o $@ - -$(ObjDir)/%.ll: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX) - $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)" - $(BCCompile.CXX) $< -o $@ -S -emit-llvm - -$(ObjDir)/%.ll: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX) - $(Echo) "Compiling $*.mm for $(BuildMode) build (bytecode)" - $(BCCompile.CXX) $< -o $@ -S -emit-llvm - -$(ObjDir)/%.ll: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCXX) - $(Echo) "Compiling $*.cc for $(BuildMode) build (bytecode)" - $(BCCompile.CXX) $< -o $@ -S -emit-llvm - -$(ObjDir)/%.ll: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC) - $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)" - $(BCCompile.C) $< -o $@ -S -emit-llvm - -$(ObjDir)/%.ll: %.m $(ObjDir)/.dir $(BUILT_SOURCES) $(LLVMCC) - $(Echo) "Compiling $*.m for $(BuildMode) build (bytecode)" - $(BCCompile.C) $< -o $@ -S -emit-llvm - -endif - - -## Rules for building preprocessed (.i/.ii) outputs. -$(BuildMode)/%.ii: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) - $(Echo) "Compiling $*.cpp for $(BuildMode) build to .ii file" - $(Verb) $(Preprocess.CXX) $< -o $@ - -$(BuildMode)/%.ii: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) - $(Echo) "Compiling $*.mm for $(BuildMode) build to .ii file" - $(Verb) $(Preprocess.CXX) $< -o $@ - -$(BuildMode)/%.ii: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) - $(Echo) "Compiling $*.cc for $(BuildMode) build to .ii file" - $(Verb) $(Preprocess.CXX) $< -o $@ - -$(BuildMode)/%.i: %.c $(ObjDir)/.dir $(BUILT_SOURCES) - $(Echo) "Compiling $*.c for $(BuildMode) build to .i file" - $(Verb) $(Preprocess.C) $< -o $@ - -$(BuildMode)/%.i: %.m $(ObjDir)/.dir $(BUILT_SOURCES) - $(Echo) "Compiling $*.m for $(BuildMode) build to .i file" - $(Verb) $(Preprocess.C) $< -o $@ - - -$(ObjDir)/%.s: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) - $(Echo) "Compiling $*.cpp to asm for $(BuildMode) build" $(PIC_FLAG) - $(Compile.CXX) $< -o $@ -S - -$(ObjDir)/%.s: %.mm $(ObjDir)/.dir $(BUILT_SOURCES) - $(Echo) "Compiling $*.mm to asm for $(BuildMode) build" $(PIC_FLAG) - $(Compile.CXX) $< -o $@ -S - -$(ObjDir)/%.s: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) - $(Echo) "Compiling $*.cc to asm for $(BuildMode) build" $(PIC_FLAG) - $(Compile.CXX) $< -o $@ -S - -$(ObjDir)/%.s: %.c $(ObjDir)/.dir $(BUILT_SOURCES) - $(Echo) "Compiling $*.c to asm for $(BuildMode) build" $(PIC_FLAG) - $(Compile.C) $< -o $@ -S - -$(ObjDir)/%.s: %.m $(ObjDir)/.dir $(BUILT_SOURCES) - $(Echo) "Compiling $*.m to asm for $(BuildMode) build" $(PIC_FLAG) - $(Compile.C) $< -o $@ -S - - -# make the C and C++ compilers strip debug info out of bytecode libraries. -ifdef DEBUG_RUNTIME -$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT) - $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)" - $(Verb) $(LOPT) $< -std-compile-opts -o $@ -else -$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT) - $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)" - $(Verb) $(LOPT) $< -std-compile-opts -strip-debug -o $@ -endif - - -#--------------------------------------------------------- -# Provide rule to build .bc files from .ll sources, -# regardless of dependencies -#--------------------------------------------------------- -$(ObjDir)/%.bc: %.ll $(ObjDir)/.dir $(LLVMAS) - $(Echo) "Compiling $*.ll for $(BuildMode) build" - $(Verb) $(LLVMAS) $< -f -o $@ - -############################################################################### -# TABLEGEN: Provide rules for running tblgen to produce *.inc files -############################################################################### - -ifdef TARGET -TABLEGEN_INC_FILES_COMMON = 1 -endif - -ifdef LLVMC_BASED_DRIVER -TABLEGEN_INC_FILES_COMMON = 1 -endif - -ifdef TABLEGEN_INC_FILES_COMMON - -INCFiles := $(filter %.inc,$(BUILT_SOURCES)) -INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp) -.PRECIOUS: $(INCTMPFiles) $(INCFiles) - -# INCFiles rule: All of the tblgen generated files are emitted to -# $(ObjDir)/%.inc.tmp, instead of emitting them directly to %.inc. This allows -# us to only "touch" the real file if the contents of it change. IOW, if -# tblgen is modified, all of the .inc.tmp files are regenerated, but no -# dependencies of the .inc files are, unless the contents of the .inc file -# changes. -$(INCFiles) : %.inc : $(ObjDir)/%.inc.tmp - $(Verb) $(CMP) -s $@ $< || $(CP) $< $@ - -endif # TABLEGEN_INC_FILES_COMMON - -ifdef TARGET - -TDFiles := $(strip $(wildcard $(PROJ_SRC_DIR)/*.td) \ - $(LLVM_SRC_ROOT)/include/llvm/Target/Target.td \ - $(LLVM_SRC_ROOT)/include/llvm/Target/TargetCallingConv.td \ - $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSchedule.td \ - $(LLVM_SRC_ROOT)/include/llvm/Target/TargetSelectionDAG.td \ - $(LLVM_SRC_ROOT)/include/llvm/CodeGen/ValueTypes.td) \ - $(wildcard $(LLVM_SRC_ROOT)/include/llvm/Intrinsics*.td) - -# All of these files depend on tblgen and the .td files. -$(INCTMPFiles) : $(TBLGEN) $(TDFiles) - -$(TARGET:%=$(ObjDir)/%GenRegisterNames.inc.tmp): \ -$(ObjDir)/%GenRegisterNames.inc.tmp : %.td $(ObjDir)/.dir - $(Echo) "Building $( $@ -else -%.ps: %.dot - $(Echo) "Cannot build $@: The program dot is not installed" -endif - -# This rules ensures that header files that are removed still have a rule for -# which they can be "generated." This allows make to ignore them and -# reproduce the dependency lists. -%.h:: ; -%.hpp:: ; - -# Define clean-local to clean the current directory. Note that this uses a -# very conservative approach ensuring that empty variables do not cause -# errors or disastrous removal. -clean-local:: -ifneq ($(strip $(ObjRootDir)),) - -$(Verb) $(RM) -rf $(ObjRootDir) -endif - -$(Verb) $(RM) -f core core.[0-9][0-9]* *.o *.d *~ *.flc -ifneq ($(strip $(SHLIBEXT)),) # Extra paranoia - make real sure SHLIBEXT is set - -$(Verb) $(RM) -f *$(SHLIBEXT) -endif - -clean-all-local:: - -$(Verb) $(RM) -rf Debug Release Profile - - -############################################################################### -# DEPENDENCIES: Include the dependency files if we should -############################################################################### -ifndef DISABLE_AUTO_DEPENDENCIES - -# If its not one of the cleaning targets -ifndef IS_CLEANING_TARGET - -# Get the list of dependency files -DependSourceFiles := $(basename $(filter %.cpp %.c %.cc %.m %.mm, $(Sources))) -DependFiles := $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.d) - -# Include bitcode dependency files if using bitcode libraries -ifdef BYTECODE_LIBRARY -DependFiles += $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.bc.d) -endif - --include $(DependFiles) "" - -endif - -endif - -############################################################################### -# CHECK: Running the test suite -############################################################################### - -check:: - $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \ - if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \ - $(EchoCmd) Running test suite ; \ - $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local \ - TESTSUITE=$(TESTSUITE) ; \ - else \ - $(EchoCmd) No Makefile in test directory ; \ - fi ; \ - else \ - $(EchoCmd) No test directory ; \ - fi - -check-lit:: check - -check-dg:: - $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \ - if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \ - $(EchoCmd) Running test suite ; \ - $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-dg ; \ - else \ - $(EchoCmd) No Makefile in test directory ; \ - fi ; \ - else \ - $(EchoCmd) No test directory ; \ - fi - -check-all:: - $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \ - if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \ - $(EchoCmd) Running test suite ; \ - $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-all ; \ - else \ - $(EchoCmd) No Makefile in test directory ; \ - fi ; \ - else \ - $(EchoCmd) No test directory ; \ - fi - -############################################################################### -# UNITTESTS: Running the unittests test suite -############################################################################### - -unittests:: - $(Verb) if test -d "$(PROJ_OBJ_ROOT)/unittests" ; then \ - if test -f "$(PROJ_OBJ_ROOT)/unittests/Makefile" ; then \ - $(EchoCmd) Running unittests test suite ; \ - $(MAKE) -C $(PROJ_OBJ_ROOT)/unittests unitcheck; \ - else \ - $(EchoCmd) No Makefile in unittests directory ; \ - fi ; \ - else \ - $(EchoCmd) No unittests directory ; \ - fi - -############################################################################### -# DISTRIBUTION: Handle construction of a distribution tarball -############################################################################### - -#------------------------------------------------------------------------ -# Define distribution related variables -#------------------------------------------------------------------------ -DistName := $(PROJECT_NAME)-$(PROJ_VERSION) -DistDir := $(PROJ_OBJ_ROOT)/$(DistName) -TopDistDir := $(PROJ_OBJ_ROOT)/$(DistName) -DistTarGZip := $(PROJ_OBJ_ROOT)/$(DistName).tar.gz -DistZip := $(PROJ_OBJ_ROOT)/$(DistName).zip -DistTarBZ2 := $(PROJ_OBJ_ROOT)/$(DistName).tar.bz2 -DistAlways := CREDITS.TXT LICENSE.TXT README.txt README AUTHORS COPYING \ - ChangeLog INSTALL NEWS Makefile Makefile.common Makefile.rules \ - Makefile.config.in configure autoconf -DistOther := $(notdir $(wildcard \ - $(PROJ_SRC_DIR)/*.h \ - $(PROJ_SRC_DIR)/*.td \ - $(PROJ_SRC_DIR)/*.def \ - $(PROJ_SRC_DIR)/*.ll \ - $(PROJ_SRC_DIR)/*.in)) -DistSubDirs := $(SubDirs) -DistSources = $(Sources) $(EXTRA_DIST) -DistFiles = $(DistAlways) $(DistSources) $(DistOther) - -#------------------------------------------------------------------------ -# We MUST build distribution with OBJ_DIR != SRC_DIR -#------------------------------------------------------------------------ -ifeq ($(PROJ_SRC_DIR),$(PROJ_OBJ_DIR)) -dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip :: - $(Echo) ERROR: Target $@ only available with OBJ_DIR != SRC_DIR - -else - -#------------------------------------------------------------------------ -# Prevent attempt to run dist targets from anywhere but the top level -#------------------------------------------------------------------------ -ifneq ($(LEVEL),.) -dist dist-check dist-clean dist-gzip dist-bzip2 dist-zip :: - $(Echo) ERROR: You must run $@ from $(PROJ_OBJ_ROOT) -else - -#------------------------------------------------------------------------ -# Provide the top level targets -#------------------------------------------------------------------------ - -dist-gzip:: $(DistTarGZip) - -$(DistTarGZip) : $(TopDistDir)/.makedistdir - $(Echo) Packing gzipped distribution tar file. - $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - "$(DistName)" | \ - $(GZIP) -c > "$(DistTarGZip)" - -dist-bzip2:: $(DistTarBZ2) - -$(DistTarBZ2) : $(TopDistDir)/.makedistdir - $(Echo) Packing bzipped distribution tar file. - $(Verb) cd $(PROJ_OBJ_ROOT) ; $(TAR) chf - $(DistName) | \ - $(BZIP2) -c >$(DistTarBZ2) - -dist-zip:: $(DistZip) - -$(DistZip) : $(TopDistDir)/.makedistdir - $(Echo) Packing zipped distribution file. - $(Verb) rm -f $(DistZip) - $(Verb) cd $(PROJ_OBJ_ROOT) ; $(ZIP) -rq $(DistZip) $(DistName) - -dist :: $(DistTarGZip) $(DistTarBZ2) $(DistZip) - $(Echo) ===== DISTRIBUTION PACKAGING SUCESSFUL ===== - -DistCheckDir := $(PROJ_OBJ_ROOT)/_distcheckdir - -dist-check:: $(DistTarGZip) - $(Echo) Checking distribution tar file. - $(Verb) if test -d $(DistCheckDir) ; then \ - $(RM) -rf $(DistCheckDir) ; \ - fi - $(Verb) $(MKDIR) $(DistCheckDir) - $(Verb) cd $(DistCheckDir) && \ - $(MKDIR) $(DistCheckDir)/build && \ - $(MKDIR) $(DistCheckDir)/install && \ - gunzip -c $(DistTarGZip) | $(TAR) xf - && \ - cd build && \ - ../$(DistName)/configure --prefix="$(DistCheckDir)/install" \ - --srcdir=../$(DistName) $(DIST_CHECK_CONFIG_OPTIONS) && \ - $(MAKE) all && \ - $(MAKE) check && \ - $(MAKE) unittests && \ - $(MAKE) install && \ - $(MAKE) uninstall && \ - $(MAKE) dist-clean && \ - $(EchoCmd) ===== $(DistTarGZip) Ready For Distribution ===== - -dist-clean:: - $(Echo) Cleaning distribution files - -$(Verb) $(RM) -rf $(DistTarGZip) $(DistTarBZ2) $(DistZip) $(DistName) \ - $(DistCheckDir) - -endif - -#------------------------------------------------------------------------ -# Provide the recursive distdir target for building the distribution directory -#------------------------------------------------------------------------ -distdir: $(DistDir)/.makedistdir -$(DistDir)/.makedistdir: $(DistSources) - $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \ - if test -d "$(DistDir)" ; then \ - find $(DistDir) -type d ! -perm -200 -exec chmod u+w {} ';' || \ - exit 1 ; \ - fi ; \ - $(EchoCmd) Removing old $(DistDir) ; \ - $(RM) -rf $(DistDir); \ - $(EchoCmd) Making 'all' to verify build ; \ - $(MAKE) ENABLE_OPTIMIZED=1 all ; \ - fi - $(Echo) Building Distribution Directory $(DistDir) - $(Verb) $(MKDIR) $(DistDir) - $(Verb) srcdirstrip=`echo "$(PROJ_SRC_DIR)" | sed 's|.|.|g'`; \ - srcrootstrip=`echo "$(PROJ_SRC_ROOT)" | sed 's|.|.|g'`; \ - for file in $(DistFiles) ; do \ - case "$$file" in \ - $(PROJ_SRC_DIR)/*) \ - file=`echo "$$file" | sed "s#^$$srcdirstrip/##"` \ - ;; \ - $(PROJ_SRC_ROOT)/*) \ - file=`echo "$$file" | \ - sed "s#^$$srcrootstrip/##"` \ - ;; \ - esac; \ - if test -f "$(PROJ_SRC_DIR)/$$file" || \ - test -d "$(PROJ_SRC_DIR)/$$file" ; then \ - from_dir="$(PROJ_SRC_DIR)" ; \ - elif test -f "$$file" || test -d "$$file" ; then \ - from_dir=. ; \ - fi ; \ - to_dir=`echo "$$file" | sed -e 's#/[^/]*$$##'` ; \ - if test "$$to_dir" != "$$file" && test "$$to_dir" != "."; then \ - to_dir="$(DistDir)/$$dir"; \ - $(MKDIR) "$$to_dir" ; \ - else \ - to_dir="$(DistDir)"; \ - fi; \ - mid_dir=`echo "$$file" | sed -n -e 's#^\(.*\)/[^/]*$$#\1#p'`; \ - if test -n "$$mid_dir" ; then \ - $(MKDIR) "$$to_dir/$$mid_dir" || exit 1; \ - fi ; \ - if test -d "$$from_dir/$$file"; then \ - if test -d "$(PROJ_SRC_DIR)/$$file" && \ - test "$$from_dir" != "$(PROJ_SRC_DIR)" ; then \ - cd $(PROJ_SRC_DIR) ; \ - $(TAR) cf - $$file --exclude .svn --exclude CVS | \ - ( cd $$to_dir ; $(TAR) xf - ) ; \ - cd $(PROJ_OBJ_DIR) ; \ - else \ - cd $$from_dir ; \ - $(TAR) cf - $$file --exclude .svn --exclude CVS | \ - ( cd $$to_dir ; $(TAR) xf - ) ; \ - cd $(PROJ_OBJ_DIR) ; \ - fi; \ - elif test -f "$$from_dir/$$file" ; then \ - $(CP) -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \ - elif test -L "$$from_dir/$$file" ; then \ - $(CP) -pd "$$from_dir/$$file" $(DistDir)/$$file || exit 1; \ - elif echo "$(DistAlways)" | grep -v "$$file" >/dev/null ; then \ - $(EchoCmd) "===== WARNING: Distribution Source " \ - "$$from_dir/$$file Not Found!" ; \ - elif test "$(Verb)" != '@' ; then \ - $(EchoCmd) "Skipping non-existent $$from_dir/$$file" ; \ - fi; \ - done - $(Verb) for subdir in $(DistSubDirs) ; do \ - if test "$$subdir" \!= "." ; then \ - new_distdir="$(DistDir)/$$subdir" ; \ - test -d "$$new_distdir" || $(MKDIR) "$$new_distdir" || exit 1; \ - ( cd $$subdir && $(MAKE) ENABLE_OPTIMIZED=1 \ - DistDir="$$new_distdir" distdir ) || exit 1; \ - fi; \ - done - $(Verb) if test "$(DistDir)" = "$(TopDistDir)" ; then \ - $(EchoCmd) Eliminating CVS/.svn directories from distribution ; \ - $(RM) -rf `find $(TopDistDir) -type d \( -name CVS -o \ - -name .svn \) -print` ;\ - $(MAKE) dist-hook ; \ - $(FIND) $(TopDistDir) -type d ! -perm -777 -exec chmod a+rwx {} \; \ - -o ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; \ - -o ! -type d ! -perm -400 -exec chmod a+r {} \; \ - -o ! -type d ! -perm -444 -exec \ - $(SHELL) $(INSTALL_SH) -c -m a+r {} {} \; \ - || chmod -R a+r $(DistDir) ; \ - fi - -# This is invoked by distdir target, define it as a no-op to avoid errors if not -# defined by user. -dist-hook:: - -endif - -############################################################################### -# TOP LEVEL - targets only to apply at the top level directory -############################################################################### - -ifeq ($(LEVEL),.) - -#------------------------------------------------------------------------ -# Install support for the project's include files: -#------------------------------------------------------------------------ -ifdef NO_INSTALL -install-local:: - $(Echo) Install circumvented with NO_INSTALL -uninstall-local:: - $(Echo) Uninstall circumvented with NO_INSTALL -else -install-local:: - $(Echo) Installing include files - $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_includedir) - $(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \ - cd $(PROJ_SRC_ROOT)/include && \ - for hdr in `find . -type f '!' '(' -name '*~' \ - -o -name '.#*' -o -name '*.in' ')' -print | grep -v CVS | \ - grep -v .svn` ; do \ - instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \ - if test \! -d "$$instdir" ; then \ - $(EchoCmd) Making install directory $$instdir ; \ - $(MKDIR) $$instdir ;\ - fi ; \ - $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \ - done ; \ - fi -ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT)) - $(Verb) if test -d "$(PROJ_OBJ_ROOT)/include" ; then \ - cd $(PROJ_OBJ_ROOT)/include && \ - for hdr in `find . -type f -print | grep -v CVS` ; do \ - $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \ - done ; \ - fi -endif - -uninstall-local:: - $(Echo) Uninstalling include files - $(Verb) if [ -d "$(PROJ_SRC_ROOT)/include" ] ; then \ - cd $(PROJ_SRC_ROOT)/include && \ - $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \ - '!' '(' -name '*~' -o -name '.#*' \ - -o -name '*.in' ')' -print ')' | \ - grep -v CVS | sed 's#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \ - cd $(PROJ_SRC_ROOT)/include && \ - $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f -name '*.in' \ - -print ')' | sed 's#\.in$$##;s#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \ - fi -endif -endif - -check-line-length: - @echo searching for overlength lines in files: $(Sources) - @echo - @echo - egrep -n '.{81}' $(Sources) /dev/null - -check-for-tabs: - @echo searching for tabs in files: $(Sources) - @echo - @echo - egrep -n ' ' $(Sources) /dev/null - -check-footprint: - @ls -l $(LibDir) | awk '\ - BEGIN { sum = 0; } \ - { sum += $$5; } \ - END { printf("Libraries: %6.3f MBytes\n", sum/(1024.0*1024.0)); }' - @ls -l $(ToolDir) | awk '\ - BEGIN { sum = 0; } \ - { sum += $$5; } \ - END { printf("Programs: %6.3f MBytes\n", sum/(1024.0*1024.0)); }' -#------------------------------------------------------------------------ -# Print out the directories used for building -#------------------------------------------------------------------------ -printvars:: - $(Echo) "BuildMode : " '$(BuildMode)' - $(Echo) "PROJ_SRC_ROOT: " '$(PROJ_SRC_ROOT)' - $(Echo) "PROJ_SRC_DIR : " '$(PROJ_SRC_DIR)' - $(Echo) "PROJ_OBJ_ROOT: " '$(PROJ_OBJ_ROOT)' - $(Echo) "PROJ_OBJ_DIR : " '$(PROJ_OBJ_DIR)' - $(Echo) "LLVM_SRC_ROOT: " '$(LLVM_SRC_ROOT)' - $(Echo) "LLVM_OBJ_ROOT: " '$(LLVM_OBJ_ROOT)' - $(Echo) "PROJ_prefix : " '$(PROJ_prefix)' - $(Echo) "PROJ_bindir : " '$(PROJ_bindir)' - $(Echo) "PROJ_libdir : " '$(PROJ_libdir)' - $(Echo) "PROJ_etcdir : " '$(PROJ_etcdir)' - $(Echo) "PROJ_includedir : " '$(PROJ_includedir)' - $(Echo) "UserTargets : " '$(UserTargets)' - $(Echo) "ObjMakefiles : " '$(ObjMakefiles)' - $(Echo) "SrcMakefiles : " '$(SrcMakefiles)' - $(Echo) "ObjDir : " '$(ObjDir)' - $(Echo) "LibDir : " '$(LibDir)' - $(Echo) "ToolDir : " '$(ToolDir)' - $(Echo) "ExmplDir : " '$(ExmplDir)' - $(Echo) "Sources : " '$(Sources)' - $(Echo) "TDFiles : " '$(TDFiles)' - $(Echo) "INCFiles : " '$(INCFiles)' - $(Echo) "INCTMPFiles : " '$(INCTMPFiles)' - $(Echo) "PreConditions: " '$(PreConditions)' - $(Echo) "Compile.CXX : " '$(Compile.CXX)' - $(Echo) "Compile.C : " '$(Compile.C)' - $(Echo) "Archive : " '$(Archive)' - $(Echo) "YaccFiles : " '$(YaccFiles)' - $(Echo) "LexFiles : " '$(LexFiles)' - $(Echo) "Module : " '$(Module)' - $(Echo) "FilesToConfig: " '$(FilesToConfigPATH)' - $(Echo) "SubDirs : " '$(SubDirs)' - $(Echo) "ProjLibsPaths: " '$(ProjLibsPaths)' - $(Echo) "ProjLibsOptions: " '$(ProjLibsOptions)' - -### -# Debugging - -# General debugging rule, use 'make dbg-print-XXX' to print the -# definition, value and origin of XXX. -make-print-%: - $(error PRINT: $(value $*) = "$($*)" (from $(origin $*))) diff --git a/contrib/llvm/ModuleInfo.txt b/contrib/llvm/ModuleInfo.txt deleted file mode 100644 index 5a1d8b85ad0b..000000000000 --- a/contrib/llvm/ModuleInfo.txt +++ /dev/null @@ -1,4 +0,0 @@ -DepModule: -BuildCmd: ./build-for-llvm-top.sh -CleanCmd: make clean -C ../build.llvm -InstallCmd: make install -C ../build.llvm diff --git a/contrib/llvm/README.txt b/contrib/llvm/README.txt deleted file mode 100644 index f54f5bf1b372..000000000000 --- a/contrib/llvm/README.txt +++ /dev/null @@ -1,16 +0,0 @@ -\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. - diff --git a/contrib/llvm/autoconf/AutoRegen.sh b/contrib/llvm/autoconf/AutoRegen.sh deleted file mode 100755 index 7809667ac5f1..000000000000 --- a/contrib/llvm/autoconf/AutoRegen.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/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 diff --git a/contrib/llvm/autoconf/ExportMap.map b/contrib/llvm/autoconf/ExportMap.map deleted file mode 100644 index 17b185fed914..000000000000 --- a/contrib/llvm/autoconf/ExportMap.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - global: main; - __progname; - environ; - - local: *; -}; diff --git a/contrib/llvm/autoconf/LICENSE.TXT b/contrib/llvm/autoconf/LICENSE.TXT deleted file mode 100644 index 72fdd39edcc8..000000000000 --- a/contrib/llvm/autoconf/LICENSE.TXT +++ /dev/null @@ -1,24 +0,0 @@ ------------------------------------------------------------------------------- -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. - diff --git a/contrib/llvm/autoconf/README.TXT b/contrib/llvm/autoconf/README.TXT deleted file mode 100644 index 3dabdf7b8793..000000000000 --- a/contrib/llvm/autoconf/README.TXT +++ /dev/null @@ -1,49 +0,0 @@ -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 - 2. configure/build/install libtool with --prefix= - 3. Copy /ltdl.m4 to llvm/autoconf/m4 - 4. Copy /share/aclocal/libtool.m4 to llvm/autoconf/m4/libtool.m4 - 5. Copy /share/libtool/ltmain.sh to llvm/autoconf/ltmain.sh - 6. Copy /share/libtool/libltdl/ltdl.c to llvm/lib/System - 7. Copy /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 - 4. configure/build/install autoconf with --prefix= - 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. diff --git a/contrib/llvm/autoconf/config.guess b/contrib/llvm/autoconf/config.guess deleted file mode 100755 index 865fe53d6b11..000000000000 --- a/contrib/llvm/autoconf/config.guess +++ /dev/null @@ -1,1498 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 -# Free Software Foundation, Inc. - -timestamp='2009-09-18' - -# This file 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 of the License, 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., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, 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 Per Bothner. Please send patches (context -# diff format) to and include a ChangeLog -# entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ELF__ - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; - *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; - macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; - s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - AUX_ARCH="i386" - echo ${AUX_ARCH}-pc-auroraux`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" - # If there is a compiler, see if it is configured for 64-bit objects. - # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. - # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - SUN_ARCH="x86_64" - fi - fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && - { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit ;; - *:AIX:*:[456]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - eval $set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep -q __LP64__ - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - esac - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - *:Interix*:[3456]*) - case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - EM64T | authenticamd | genuineintel) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; - esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit ;; - arm*:Linux:*:*) - eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then - echo ${UNAME_MACHINE}-unknown-linux-gnu - else - echo ${UNAME_MACHINE}-unknown-linux-gnueabi - fi - exit ;; - avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - cris:Linux:*:*) - echo cris-axis-linux-gnu - exit ;; - crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu - exit ;; - frv:Linux:*:*) - echo frv-unknown-linux-gnu - exit ;; - i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-gnu - exit ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} - #else - CPU= - #endif - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - or32:Linux:*:*) - echo or32-unknown-linux-gnu - exit ;; - padre:Linux:*:*) - echo sparc-unknown-linux-gnu - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu - exit ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - exit ;; - xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. - # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that - # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - NCR*:*:4.2:* | MPRAS*:*:4.2:*) - OS_REL='.3' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi - fi ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NSE-?:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; - i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - -cat >&2 < in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/contrib/llvm/autoconf/config.sub b/contrib/llvm/autoconf/config.sub deleted file mode 100755 index 183976a066a9..000000000000 --- a/contrib/llvm/autoconf/config.sub +++ /dev/null @@ -1,1702 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 -# Free Software Foundation, Inc. - -timestamp='2009-08-19' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file 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 of the License, 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., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, 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. - - -# Please send patches to . Submit a context -# diff and a properly formatted GNU ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze) - os= - basic_machine=$1 - ;; - -bluegene*) - os=-cnk - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | bfin \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | fido | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nios | nios2 \ - | ns16k | ns32k \ - | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ - | v850 | v850e \ - | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-unknown - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nios-* | nios2-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ - | tron-* \ - | v850-* | v850e-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze) - basic_machine=microblaze-xilinx - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff - ;; - tile*) - basic_machine=tile-unknown - os=-linux-gnu - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -auroraux) - os=-auroraux - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* | -sym* \ - | -kopensolaris* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; - -zvmoe) - os=-zvmoe - ;; - -dicos*) - os=-dicos - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mep-*) - os=-elf - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-haiku) - os=-haiku - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -cnk*|-aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/contrib/llvm/autoconf/configure.ac b/contrib/llvm/autoconf/configure.ac deleted file mode 100644 index 0596dd60d230..000000000000 --- a/contrib/llvm/autoconf/configure.ac +++ /dev/null @@ -1,1582 +0,0 @@ -dnl === configure.ac --------------------------------------------------------=== -dnl The LLVM Compiler Infrastructure -dnl -dnl This file is distributed under the University of Illinois Open Source -dnl License. See LICENSE.TXT for details. -dnl -dnl===-----------------------------------------------------------------------=== -dnl This is the LLVM configuration script. It is processed by the autoconf -dnl program to produce a script named configure. This script contains the -dnl configuration checks that LLVM needs in order to support multiple platforms. -dnl This file is composed of 10 sections per the recommended organization of -dnl autoconf input defined in the autoconf documentation. As this file evolves, -dnl please keep the various types of checks within their sections. The sections -dnl are as follows: -dnl -dnl SECTION 1: Initialization & Setup -dnl SECTION 2: Architecture, target, and host checks -dnl SECTION 3: Command line arguments for the configure script. -dnl SECTION 4: Check for programs we need and that they are the right version -dnl SECTION 5: Check for libraries -dnl SECTION 6: Check for header files -dnl SECTION 7: Check for types and structures -dnl SECTION 8: Check for specific functions needed -dnl SECTION 9: Additional checks, variables, etc. -dnl SECTION 10: Specify the output files and generate it -dnl -dnl===-----------------------------------------------------------------------=== -dnl=== -dnl=== SECTION 1: Initialization & Setup -dnl=== -dnl===-----------------------------------------------------------------------=== -dnl Initialize autoconf and define the package name, version number and -dnl email address for reporting bugs. -AC_INIT([[llvm]],[[2.8]],[llvmbugs@cs.uiuc.edu]) - -dnl Provide a copyright substitution and ensure the copyright notice is included -dnl in the output of --version option of the generated configure script. -AC_SUBST(LLVM_COPYRIGHT,["Copyright (c) 2003-2010 University of Illinois at Urbana-Champaign."]) -AC_COPYRIGHT([Copyright (c) 2003-2010 University of Illinois at Urbana-Champaign.]) - -dnl Indicate that we require autoconf 2.59 or later. Ths is needed because we -dnl use some autoconf macros only available in 2.59. -AC_PREREQ(2.59) - -dnl Verify that the source directory is valid. This makes sure that we are -dnl configuring LLVM and not some other package (it validates --srcdir argument) -AC_CONFIG_SRCDIR([lib/VMCore/Module.cpp]) - -dnl Place all of the extra autoconf files into the config subdirectory. Tell -dnl various tools where the m4 autoconf macros are. -AC_CONFIG_AUX_DIR([autoconf]) - -dnl Quit if the source directory has already been configured. -dnl NOTE: This relies upon undocumented autoconf behavior. -if test ${srcdir} != "." ; then - if test -f ${srcdir}/include/llvm/Config/config.h ; then - AC_MSG_ERROR([Already configured in ${srcdir}]) - fi -fi - -dnl Configure all of the projects present in our source tree. While we could -dnl just AC_CONFIG_SUBDIRS on the set of directories in projects that have a -dnl configure script, that usage of the AC_CONFIG_SUBDIRS macro is deprecated. -dnl Instead we match on the known projects. - -dnl -dnl One tricky part of doing this is that some projects depend upon other -dnl projects. For example, several projects rely upon the LLVM test suite. -dnl We want to configure those projects first so that their object trees are -dnl created before running the configure scripts of projects that depend upon -dnl them. -dnl - -dnl Several projects use llvm-gcc, so configure that first -if test -d ${srcdir}/projects/llvm-gcc ; then - AC_CONFIG_SUBDIRS([projects/llvm-gcc]) -fi - -dnl Several projects use the LLVM test suite, so configure it next. -if test -d ${srcdir}/projects/test-suite ; then - AC_CONFIG_SUBDIRS([projects/test-suite]) -fi - -dnl llvm-test is the old name of the test-suite, kept here for backwards -dnl compatibility -if test -d ${srcdir}/projects/llvm-test ; then - AC_CONFIG_SUBDIRS([projects/llvm-test]) -fi - -dnl Some projects use poolalloc; configure that next -if test -d ${srcdir}/projects/poolalloc ; then - AC_CONFIG_SUBDIRS([projects/poolalloc]) -fi - -if test -d ${srcdir}/projects/llvm-poolalloc ; then - AC_CONFIG_SUBDIRS([projects/llvm-poolalloc]) -fi - -dnl Check for all other projects -for i in `ls ${srcdir}/projects` -do - if test -d ${srcdir}/projects/${i} ; then - case ${i} in - sample) AC_CONFIG_SUBDIRS([projects/sample]) ;; - privbracket) AC_CONFIG_SUBDIRS([projects/privbracket]) ;; - llvm-stacker) AC_CONFIG_SUBDIRS([projects/llvm-stacker]) ;; - llvm-reopt) AC_CONFIG_SUBDIRS([projects/llvm-reopt]);; - llvm-java) AC_CONFIG_SUBDIRS([projects/llvm-java]) ;; - llvm-tv) AC_CONFIG_SUBDIRS([projects/llvm-tv]) ;; - safecode) AC_CONFIG_SUBDIRS([projects/safecode]) ;; - llvm-kernel) AC_CONFIG_SUBDIRS([projects/llvm-kernel]) ;; - llvm-gcc) ;; - test-suite) ;; - llvm-test) ;; - poolalloc) ;; - llvm-poolalloc) ;; - *) - AC_MSG_WARN([Unknown project (${i}) won't be configured automatically]) - ;; - esac - fi -done - -dnl===-----------------------------------------------------------------------=== -dnl=== -dnl=== SECTION 2: Architecture, target, and host checks -dnl=== -dnl===-----------------------------------------------------------------------=== - -dnl Check the target for which we're compiling and the host that will do the -dnl compilations. This will tell us which LLVM compiler will be used for -dnl compiling SSA into object code. This needs to be done early because -dnl following tests depend on it. -AC_CANONICAL_TARGET - -dnl Determine the platform type and cache its value. This helps us configure -dnl the System library to the correct build platform. -AC_CACHE_CHECK([type of operating system we're going to host on], - [llvm_cv_os_type], -[case $host in - *-*-aix*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="AIX" - llvm_cv_platform_type="Unix" ;; - *-*-irix*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="IRIX" - llvm_cv_platform_type="Unix" ;; - *-*-cygwin*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="Cygwin" - llvm_cv_platform_type="Unix" ;; - *-*-darwin*) - llvm_cv_link_all_option="-Wl,-all_load" - llvm_cv_no_link_all_option="-Wl,-noall_load" - llvm_cv_os_type="Darwin" - llvm_cv_platform_type="Unix" ;; - *-*-minix*) - llvm_cv_link_all_option="-Wl,-all_load" - llvm_cv_no_link_all_option="-Wl,-noall_load" - llvm_cv_os_type="Minix" - llvm_cv_platform_type="Unix" ;; - *-*-freebsd*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="FreeBSD" - llvm_cv_platform_type="Unix" ;; - *-*-openbsd*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="OpenBSD" - llvm_cv_platform_type="Unix" ;; - *-*-netbsd*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="NetBSD" - llvm_cv_platform_type="Unix" ;; - *-*-dragonfly*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="DragonFly" - llvm_cv_platform_type="Unix" ;; - *-*-hpux*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="HP-UX" - llvm_cv_platform_type="Unix" ;; - *-*-interix*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="Interix" - llvm_cv_platform_type="Unix" ;; - *-*-linux*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="Linux" - llvm_cv_platform_type="Unix" ;; - *-*-solaris*) - llvm_cv_link_all_option="-Wl,-z,allextract" - llvm_cv_no_link_all_option="-Wl,-z,defaultextract" - llvm_cv_os_type="SunOS" - llvm_cv_platform_type="Unix" ;; - *-*-auroraux*) - llvm_cv_link_all_option="-Wl,-z,allextract" - llvm_cv_link_all_option="-Wl,-z,defaultextract" - llvm_cv_os_type="AuroraUX" - llvm_cv_platform_type="Unix" ;; - *-*-win32*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="Win32" - llvm_cv_platform_type="Win32" ;; - *-*-mingw*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="MingW" - llvm_cv_platform_type="Win32" ;; - *-*-haiku*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="Haiku" - llvm_cv_platform_type="Unix" ;; - *-unknown-eabi*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="Freestanding" - llvm_cv_platform_type="Unix" ;; - *-unknown-elf*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="Freestanding" - llvm_cv_platform_type="Unix" ;; - *) - llvm_cv_link_all_option="" - llvm_cv_no_link_all_option="" - llvm_cv_os_type="Unknown" - llvm_cv_platform_type="Unknown" ;; -esac]) - -AC_CACHE_CHECK([type of operating system we're going to target], - [llvm_cv_target_os_type], -[case $target in - *-*-aix*) - llvm_cv_target_os_type="AIX" ;; - *-*-irix*) - llvm_cv_target_os_type="IRIX" ;; - *-*-cygwin*) - llvm_cv_target_os_type="Cygwin" ;; - *-*-darwin*) - llvm_cv_target_os_type="Darwin" ;; - *-*-minix*) - llvm_cv_target_os_type="Minix" ;; - *-*-freebsd*) - llvm_cv_target_os_type="FreeBSD" ;; - *-*-openbsd*) - llvm_cv_target_os_type="OpenBSD" ;; - *-*-netbsd*) - llvm_cv_target_os_type="NetBSD" ;; - *-*-dragonfly*) - llvm_cv_target_os_type="DragonFly" ;; - *-*-hpux*) - llvm_cv_target_os_type="HP-UX" ;; - *-*-interix*) - llvm_cv_target_os_type="Interix" ;; - *-*-linux*) - llvm_cv_target_os_type="Linux" ;; - *-*-solaris*) - llvm_cv_target_os_type="SunOS" ;; - *-*-auroraux*) - llvm_cv_target_os_type="AuroraUX" ;; - *-*-win32*) - llvm_cv_target_os_type="Win32" ;; - *-*-mingw*) - llvm_cv_target_os_type="MingW" ;; - *-*-haiku*) - llvm_cv_target_os_type="Haiku" ;; - *-unknown-eabi*) - llvm_cv_target_os_type="Freestanding" ;; - *) - llvm_cv_target_os_type="Unknown" ;; -esac]) - -dnl Make sure we aren't attempting to configure for an unknown system -if test "$llvm_cv_os_type" = "Unknown" ; then - AC_MSG_ERROR([Operating system is unknown, configure can't continue]) -fi - -dnl Set the "OS" Makefile variable based on the platform type so the -dnl makefile can configure itself to specific build hosts -AC_SUBST(OS,$llvm_cv_os_type) -AC_SUBST(HOST_OS,$llvm_cv_os_type) -AC_SUBST(TARGET_OS,$llvm_cv_target_os_type) - -dnl Set the LINKALL and NOLINKALL Makefile variables based on the platform -AC_SUBST(LINKALL,$llvm_cv_link_all_option) -AC_SUBST(NOLINKALL,$llvm_cv_no_link_all_option) - -dnl Set the "LLVM_ON_*" variables based on llvm_cv_platform_type -dnl This is used by lib/System to determine the basic kind of implementation -dnl to use. -case $llvm_cv_platform_type in - Unix) - AC_DEFINE([LLVM_ON_UNIX],[1],[Define if this is Unixish platform]) - AC_SUBST(LLVM_ON_UNIX,[1]) - AC_SUBST(LLVM_ON_WIN32,[0]) - ;; - Win32) - AC_DEFINE([LLVM_ON_WIN32],[1],[Define if this is Win32ish platform]) - AC_SUBST(LLVM_ON_UNIX,[0]) - AC_SUBST(LLVM_ON_WIN32,[1]) - ;; -esac - -dnl Determine what our target architecture is and configure accordingly. -dnl This will allow Makefiles to make a distinction between the hardware and -dnl the OS. -AC_CACHE_CHECK([target architecture],[llvm_cv_target_arch], -[case $target in - i?86-*) llvm_cv_target_arch="x86" ;; - amd64-* | x86_64-*) llvm_cv_target_arch="x86_64" ;; - sparc*-*) llvm_cv_target_arch="Sparc" ;; - powerpc*-*) llvm_cv_target_arch="PowerPC" ;; - alpha*-*) llvm_cv_target_arch="Alpha" ;; - arm*-*) llvm_cv_target_arch="ARM" ;; - mips-*) llvm_cv_target_arch="Mips" ;; - pic16-*) llvm_cv_target_arch="PIC16" ;; - xcore-*) llvm_cv_target_arch="XCore" ;; - msp430-*) llvm_cv_target_arch="MSP430" ;; - s390x-*) llvm_cv_target_arch="SystemZ" ;; - bfin-*) llvm_cv_target_arch="Blackfin" ;; - mblaze-*) llvm_cv_target_arch="MBlaze" ;; - *) llvm_cv_target_arch="Unknown" ;; -esac]) - -if test "$llvm_cv_target_arch" = "Unknown" ; then - AC_MSG_WARN([Configuring LLVM for an unknown target archicture]) -fi - -# Determine the LLVM native architecture for the target -case "$llvm_cv_target_arch" in - x86) LLVM_NATIVE_ARCH="X86" ;; - x86_64) LLVM_NATIVE_ARCH="X86" ;; - *) LLVM_NATIVE_ARCH="$llvm_cv_target_arch" ;; -esac - -dnl Define a substitution, ARCH, for the target architecture -AC_SUBST(ARCH,$llvm_cv_target_arch) - -dnl Check for the endianness of the target -AC_C_BIGENDIAN(AC_SUBST([ENDIAN],[big]),AC_SUBST([ENDIAN],[little])) - -dnl Check for build platform executable suffix if we're crosscompiling -if test "$cross_compiling" = yes; then - AC_SUBST(LLVM_CROSS_COMPILING, [1]) - AC_BUILD_EXEEXT - ac_build_prefix=${build_alias}- - AC_CHECK_PROG(BUILD_CXX, ${ac_build_prefix}g++, ${ac_build_prefix}g++) - if test -z "$BUILD_CXX"; then - AC_CHECK_PROG(BUILD_CXX, g++, g++) - if test -z "$BUILD_CXX"; then - AC_CHECK_PROG(BUILD_CXX, c++, c++, , , /usr/ucb/c++) - fi - fi -else - AC_SUBST(LLVM_CROSS_COMPILING, [0]) -fi - -dnl Check to see if there's a .svn or .git directory indicating that this -dnl build is being done from a checkout. This sets up several defaults for -dnl the command line switches. When we build with a checkout directory, -dnl we get a debug with assertions turned on. Without, we assume a source -dnl release and we get an optimized build without assertions. -dnl See --enable-optimized and --enable-assertions below -if test -d ".svn" -o -d "${srcdir}/.svn" -o -d ".git" -o -d "${srcdir}/.git"; then - cvsbuild="yes" - optimize="no" - AC_SUBST(CVSBUILD,[[CVSBUILD=1]]) -else - cvsbuild="no" - optimize="yes" -fi - -dnl===-----------------------------------------------------------------------=== -dnl=== -dnl=== SECTION 3: Command line arguments for the configure script. -dnl=== -dnl===-----------------------------------------------------------------------=== - -dnl --enable-optimized : check whether they want to do an optimized build: -AC_ARG_ENABLE(optimized, AS_HELP_STRING( - --enable-optimized,[Compile with optimizations enabled (default is YES)]),,enableval="yes") -if test ${enableval} = "no" ; then - AC_SUBST(ENABLE_OPTIMIZED,[[]]) -else - AC_SUBST(ENABLE_OPTIMIZED,[[ENABLE_OPTIMIZED=1]]) -fi - -dnl --enable-profiling : check whether they want to do a profile build: -AC_ARG_ENABLE(profiling, AS_HELP_STRING( - --enable-profiling,[Compile with profiling enabled (default is NO)]),,enableval="no") -if test ${enableval} = "no" ; then - AC_SUBST(ENABLE_PROFILING,[[]]) -else - AC_SUBST(ENABLE_PROFILING,[[ENABLE_PROFILING=1]]) -fi - -dnl --enable-assertions : check whether they want to turn on assertions or not: -AC_ARG_ENABLE(assertions,AS_HELP_STRING( - --enable-assertions,[Compile with assertion checks enabled (default is NO)]),, enableval="no") -if test ${enableval} = "yes" ; then - AC_SUBST(DISABLE_ASSERTIONS,[[]]) -else - AC_SUBST(DISABLE_ASSERTIONS,[[DISABLE_ASSERTIONS=1]]) -fi - -dnl --enable-expensive-checks : check whether they want to turn on expensive debug checks: -AC_ARG_ENABLE(expensive-checks,AS_HELP_STRING( - --enable-expensive-checks,[Compile with expensive debug checks enabled (default is NO)]),, enableval="no") -if test ${enableval} = "yes" ; then - AC_SUBST(ENABLE_EXPENSIVE_CHECKS,[[ENABLE_EXPENSIVE_CHECKS=1]]) - AC_SUBST(EXPENSIVE_CHECKS,[[yes]]) -else - AC_SUBST(ENABLE_EXPENSIVE_CHECKS,[[]]) - AC_SUBST(EXPENSIVE_CHECKS,[[no]]) -fi - -dnl --enable-debug-runtime : should runtime libraries have debug symbols? -AC_ARG_ENABLE(debug-runtime, - AS_HELP_STRING(--enable-debug-runtime,[Build runtime libs with debug symbols (default is NO)]),,enableval=no) -if test ${enableval} = "no" ; then - AC_SUBST(DEBUG_RUNTIME,[[]]) -else - AC_SUBST(DEBUG_RUNTIME,[[DEBUG_RUNTIME=1]]) -fi - -dnl --enable-debug-symbols : should even optimized compiler libraries -dnl have debug symbols? -AC_ARG_ENABLE(debug-symbols, - AS_HELP_STRING(--enable-debug-symbols,[Build compiler with debug symbols (default is NO if optimization is on and YES if it's off)]),,enableval=no) -if test ${enableval} = "no" ; then - AC_SUBST(DEBUG_SYMBOLS,[[]]) -else - AC_SUBST(DEBUG_SYMBOLS,[[DEBUG_SYMBOLS=1]]) -fi - -dnl --enable-jit: check whether they want to enable the jit -AC_ARG_ENABLE(jit, - AS_HELP_STRING(--enable-jit, - [Enable Just In Time Compiling (default is YES)]),, - enableval=default) -if test ${enableval} = "no" -then - AC_SUBST(JIT,[[]]) -else - case "$llvm_cv_target_arch" in - x86) AC_SUBST(TARGET_HAS_JIT,1) ;; - Sparc) AC_SUBST(TARGET_HAS_JIT,0) ;; - PowerPC) AC_SUBST(TARGET_HAS_JIT,1) ;; - x86_64) AC_SUBST(TARGET_HAS_JIT,1) ;; - Alpha) AC_SUBST(TARGET_HAS_JIT,1) ;; - ARM) AC_SUBST(TARGET_HAS_JIT,1) ;; - Mips) AC_SUBST(TARGET_HAS_JIT,0) ;; - PIC16) AC_SUBST(TARGET_HAS_JIT,0) ;; - XCore) AC_SUBST(TARGET_HAS_JIT,0) ;; - MSP430) AC_SUBST(TARGET_HAS_JIT,0) ;; - SystemZ) AC_SUBST(TARGET_HAS_JIT,0) ;; - Blackfin) AC_SUBST(TARGET_HAS_JIT,0) ;; - MBlaze) AC_SUBST(TARGET_HAS_JIT,0) ;; - *) AC_SUBST(TARGET_HAS_JIT,0) ;; - esac -fi - -dnl Allow enablement of doxygen generated documentation -AC_ARG_ENABLE(doxygen, - AS_HELP_STRING([--enable-doxygen], - [Build doxygen documentation (default is NO)]),, - enableval=default) -case "$enableval" in - yes) AC_SUBST(ENABLE_DOXYGEN,[1]) ;; - no) AC_SUBST(ENABLE_DOXYGEN,[0]) ;; - default) AC_SUBST(ENABLE_DOXYGEN,[0]) ;; - *) AC_MSG_ERROR([Invalid setting for --enable-doxygen. Use "yes" or "no"]) ;; -esac - -dnl Allow disablement of threads -AC_ARG_ENABLE(threads, - AS_HELP_STRING([--enable-threads], - [Use threads if available (default is YES)]),, - enableval=default) -case "$enableval" in - yes) AC_SUBST(ENABLE_THREADS,[1]) ;; - no) AC_SUBST(ENABLE_THREADS,[0]) ;; - default) AC_SUBST(ENABLE_THREADS,[1]) ;; - *) AC_MSG_ERROR([Invalid setting for --enable-threads. Use "yes" or "no"]) ;; -esac -AC_DEFINE_UNQUOTED([ENABLE_THREADS],$ENABLE_THREADS,[Define if threads enabled]) - -dnl Allow building without position independent code -AC_ARG_ENABLE(pic, - AS_HELP_STRING([--enable-pic], - [Build LLVM with Position Independent Code (default is YES)]),, - enableval=default) -case "$enableval" in - yes) AC_SUBST(ENABLE_PIC,[1]) ;; - no) AC_SUBST(ENABLE_PIC,[0]) ;; - default) AC_SUBST(ENABLE_PIC,[1]) ;; - *) AC_MSG_ERROR([Invalid setting for --enable-pic. Use "yes" or "no"]) ;; -esac -AC_DEFINE_UNQUOTED([ENABLE_PIC],$ENABLE_PIC, - [Define if position independent code is enabled]) - -dnl Allow building a shared library and linking tools against it. -AC_ARG_ENABLE(shared, - AS_HELP_STRING([--enable-shared], - [Build a shared library and link tools against it (default is NO)]),, - enableval=default) -case "$enableval" in - yes) AC_SUBST(ENABLE_SHARED,[1]) ;; - no) AC_SUBST(ENABLE_SHARED,[0]) ;; - default) AC_SUBST(ENABLE_SHARED,[0]) ;; - *) AC_MSG_ERROR([Invalid setting for --enable-shared. Use "yes" or "no"]) ;; -esac - -dnl Enable embedding timestamp information into build. -AC_ARG_ENABLE(timestamps, - AS_HELP_STRING([--enable-timestamps], - [Enable embedding timestamp information in build (default is YES)]),, - enableval=default) -case "$enableval" in - yes) AC_SUBST(ENABLE_TIMESTAMPS,[1]) ;; - no) AC_SUBST(ENABLE_TIMESTAMPS,[0]) ;; - default) AC_SUBST(ENABLE_TIMESTAMPS,[1]) ;; - *) AC_MSG_ERROR([Invalid setting for --enable-timestamps. Use "yes" or "no"]) ;; -esac -AC_DEFINE_UNQUOTED([ENABLE_TIMESTAMPS],$ENABLE_TIMESTAMPS, - [Define if timestamp information (e.g., __DATE___) is allowed]) - -dnl Allow specific targets to be specified for building (or not) -TARGETS_TO_BUILD="" -AC_ARG_ENABLE([targets],AS_HELP_STRING([--enable-targets], - [Build specific host targets: all or target1,target2,... Valid targets are: - host, x86, x86_64, sparc, powerpc, alpha, arm, mips, spu, pic16, - xcore, msp430, systemz, blackfin, cbe, and cpp (default=all)]),, - enableval=all) -if test "$enableval" = host-only ; then - enableval=host -fi -case "$enableval" in - all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha ARM Mips CellSPU PIC16 XCore MSP430 SystemZ Blackfin CBackend CppBackend MBlaze" ;; - *)for a_target in `echo $enableval|sed -e 's/,/ /g' ` ; do - case "$a_target" in - x86) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;; - x86_64) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;; - sparc) TARGETS_TO_BUILD="Sparc $TARGETS_TO_BUILD" ;; - powerpc) TARGETS_TO_BUILD="PowerPC $TARGETS_TO_BUILD" ;; - alpha) TARGETS_TO_BUILD="Alpha $TARGETS_TO_BUILD" ;; - arm) TARGETS_TO_BUILD="ARM $TARGETS_TO_BUILD" ;; - mips) TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;; - spu) TARGETS_TO_BUILD="CellSPU $TARGETS_TO_BUILD" ;; - pic16) TARGETS_TO_BUILD="PIC16 $TARGETS_TO_BUILD" ;; - xcore) TARGETS_TO_BUILD="XCore $TARGETS_TO_BUILD" ;; - msp430) TARGETS_TO_BUILD="MSP430 $TARGETS_TO_BUILD" ;; - systemz) TARGETS_TO_BUILD="SystemZ $TARGETS_TO_BUILD" ;; - blackfin) TARGETS_TO_BUILD="Blackfin $TARGETS_TO_BUILD" ;; - cbe) TARGETS_TO_BUILD="CBackend $TARGETS_TO_BUILD" ;; - cpp) TARGETS_TO_BUILD="CppBackend $TARGETS_TO_BUILD" ;; - mblaze) TARGETS_TO_BUILD="MBlaze $TARGETS_TO_BUILD" ;; - host) case "$llvm_cv_target_arch" in - x86) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;; - x86_64) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;; - Sparc) TARGETS_TO_BUILD="Sparc $TARGETS_TO_BUILD" ;; - PowerPC) TARGETS_TO_BUILD="PowerPC $TARGETS_TO_BUILD" ;; - Alpha) TARGETS_TO_BUILD="Alpha $TARGETS_TO_BUILD" ;; - ARM) TARGETS_TO_BUILD="ARM $TARGETS_TO_BUILD" ;; - Mips) TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;; - MBlaze) TARGETS_TO_BUILD="MBlaze $TARGETS_TO_BUILD" ;; - CellSPU|SPU) TARGETS_TO_BUILD="CellSPU $TARGETS_TO_BUILD" ;; - PIC16) TARGETS_TO_BUILD="PIC16 $TARGETS_TO_BUILD" ;; - XCore) TARGETS_TO_BUILD="XCore $TARGETS_TO_BUILD" ;; - MSP430) TARGETS_TO_BUILD="MSP430 $TARGETS_TO_BUILD" ;; - s390x) TARGETS_TO_BUILD="SystemZ $TARGETS_TO_BUILD" ;; - Blackfin) TARGETS_TO_BUILD="Blackfin $TARGETS_TO_BUILD" ;; - *) AC_MSG_ERROR([Can not set target to build]) ;; - esac ;; - *) AC_MSG_ERROR([Unrecognized target $a_target]) ;; - esac - done - ;; -esac -AC_SUBST(TARGETS_TO_BUILD,$TARGETS_TO_BUILD) - -# Determine whether we are building LLVM support for the native architecture. -# If so, define LLVM_NATIVE_ARCH to that LLVM target. -for a_target in $TARGETS_TO_BUILD; do - if test "$a_target" = "$LLVM_NATIVE_ARCH"; then - AC_DEFINE_UNQUOTED(LLVM_NATIVE_ARCH, $LLVM_NATIVE_ARCH, - [LLVM architecture name for the native architecture, if available]) - LLVM_NATIVE_TARGET="LLVMInitialize${LLVM_NATIVE_ARCH}Target" - LLVM_NATIVE_TARGETINFO="LLVMInitialize${LLVM_NATIVE_ARCH}TargetInfo" - LLVM_NATIVE_ASMPRINTER="LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter" - AC_DEFINE_UNQUOTED(LLVM_NATIVE_TARGET, $LLVM_NATIVE_TARGET, - [LLVM name for the native Target init function, if available]) - AC_DEFINE_UNQUOTED(LLVM_NATIVE_TARGETINFO, $LLVM_NATIVE_TARGETINFO, - [LLVM name for the native TargetInfo init function, if available]) - AC_DEFINE_UNQUOTED(LLVM_NATIVE_ASMPRINTER, $LLVM_NATIVE_ASMPRINTER, - [LLVM name for the native AsmPrinter init function, if available]) - fi -done - -# Build the LLVM_TARGET and LLVM_... macros for Targets.def and the individual -# target feature def files. -LLVM_ENUM_TARGETS="" -LLVM_ENUM_ASM_PRINTERS="" -LLVM_ENUM_ASM_PARSERS="" -LLVM_ENUM_DISASSEMBLERS="" -for target_to_build in $TARGETS_TO_BUILD; do - LLVM_ENUM_TARGETS="LLVM_TARGET($target_to_build) $LLVM_ENUM_TARGETS" - if test -f ${srcdir}/lib/Target/${target_to_build}/AsmPrinter/Makefile ; then - LLVM_ENUM_ASM_PRINTERS="LLVM_ASM_PRINTER($target_to_build) $LLVM_ENUM_ASM_PRINTERS"; - fi - if test -f ${srcdir}/lib/Target/${target_to_build}/AsmParser/Makefile ; then - LLVM_ENUM_ASM_PARSERS="LLVM_ASM_PARSER($target_to_build) $LLVM_ENUM_ASM_PARSERS"; - fi - if test -f ${srcdir}/lib/Target/${target_to_build}/Disassembler/Makefile ; then - LLVM_ENUM_DISASSEMBLERS="LLVM_DISASSEMBLER($target_to_build) $LLVM_ENUM_DISASSEMBLERS"; - fi -done -AC_SUBST(LLVM_ENUM_TARGETS) -AC_SUBST(LLVM_ENUM_ASM_PRINTERS) -AC_SUBST(LLVM_ENUM_ASM_PARSERS) -AC_SUBST(LLVM_ENUM_DISASSEMBLERS) - -dnl Prevent the CBackend from using printf("%a") for floating point so older -dnl C compilers that cannot deal with the 0x0p+0 hex floating point format -dnl can still compile the CBE's output -AC_ARG_ENABLE([cbe-printf-a],AS_HELP_STRING([--enable-cbe-printf-a], - [Enable C Backend output with hex floating point via %a (default is YES)]),, - enableval=default) -case "$enableval" in - yes) AC_SUBST(ENABLE_CBE_PRINTF_A,[1]) ;; - no) AC_SUBST(ENABLE_CBE_PRINTF_A,[0]) ;; - default) AC_SUBST(ENABLE_CBE_PRINTF_A,[1]) ;; - *) AC_MSG_ERROR([Invalid setting for --enable-cbe-printf-a. Use "yes" or "no"]) ;; -esac -AC_DEFINE_UNQUOTED([ENABLE_CBE_PRINTF_A],$ENABLE_CBE_PRINTF_A, - [Define if CBE is enabled for printf %a output]) - -dnl Allow a specific llvm-gcc/llvm-g++ pair to be used with this LLVM config. -AC_ARG_WITH(llvmgccdir, - AS_HELP_STRING([--with-llvmgccdir], - [Specify location of llvm-gcc install dir (default searches PATH)]),, - withval=default) -case "$withval" in - default) WITH_LLVMGCCDIR=default ;; - /* | [[A-Za-z]]:[[\\/]]*) WITH_LLVMGCCDIR=$withval ;; - *) AC_MSG_ERROR([Invalid path for --with-llvmgccdir. Provide full path]) ;; -esac - -dnl Allow a specific llvm-gcc compiler to be used with this LLVM config. -AC_ARG_WITH(llvmgcc, - AS_HELP_STRING([--with-llvmgcc], - [Specify location of llvm-gcc driver (default searches PATH)]), - LLVMGCC=$with_llvmgcc - WITH_LLVMGCCDIR="",) - -dnl Allow a specific llvm-g++ compiler to be used with this LLVM config. -AC_ARG_WITH(llvmgxx, - AS_HELP_STRING([--with-llvmgxx], - [Specify location of llvm-g++ driver (default searches PATH)]), - LLVMGXX=$with_llvmgxx - WITH_LLVMGCCDIR="",) - -if test -n "$LLVMGCC"; then - LLVMGCCCOMMAND="$LLVMGCC" -fi - -if test -n "$LLVMGXX"; then - LLVMGXXCOMMAND="$LLVMGXX" -fi - -if test -n "$LLVMGCC" && test -z "$LLVMGXX"; then - AC_MSG_ERROR([Invalid llvm-g++. Use --with-llvmgxx when --with-llvmgcc is used]); -fi - -if test -n "$LLVMGXX" && test -z "$LLVMGCC"; then - AC_MSG_ERROR([Invalid llvm-gcc. Use --with-llvmgcc when --with-llvmgxx is used]); -fi - -dnl Allow a specific Clang compiler to be used with this LLVM config. -AC_ARG_WITH(clang, - AS_HELP_STRING([--with-clang], - [Specify location of clang compiler (default is --with-built-clang)]), - [],[with_clang=default]) - -dnl Enable use of the built Clang. -AC_ARG_WITH(built-clang, - AS_HELP_STRING([--with-built-clang], - [Use the compiled Clang as the LLVM compiler (default=check)]), - [],[with_built_clang=check]) - -dnl Select the Clang compiler option. -dnl -dnl If --with-clang is given, always honor that; otherwise honor -dnl --with-built-clang, or check if we have the clang sources. -AC_MSG_CHECKING([clang compiler]) -WITH_CLANGPATH="" -WITH_BUILT_CLANG=0 -if test "$with_clang" != "default"; then - WITH_CLANGPATH="$with_clang" - if ! test -x "$WITH_CLANGPATH"; then - AC_MSG_ERROR([invalid --with-clang, path does not specify an executable]) - fi -elif test "$with_built_clang" = "yes"; then - WITH_BUILT_CLANG=1 -elif test "$with_built_clang" = "no"; then - WITH_BUILT_CLANG=0 -else - if test "$with_built_clang" != "check"; then - AC_MSG_ERROR([invalid value for --with-built-clang.]) - fi - - if test -f ${srcdir}/tools/clang/README.txt; then - WITH_BUILT_CLANG=1 - fi -fi - -if ! test -z "$WITH_CLANGPATH"; then - AC_MSG_RESULT([$WITH_CLANGPATH]) - WITH_CLANGXXPATH=`"$WITH_CLANGPATH" --print-prog-name=clang++` -elif test "$WITH_BUILT_CLANG" = "1"; then - AC_MSG_RESULT([built]) -else - AC_MSG_RESULT([none]) -fi -AC_SUBST(CLANGPATH,$WITH_CLANGPATH) -AC_SUBST(CLANGXXPATH,$WITH_CLANGXXPATH) -AC_SUBST(ENABLE_BUILT_CLANG,$WITH_BUILT_CLANG) - -dnl Override the option to use for optimized builds. -AC_ARG_WITH(optimize-option, - AS_HELP_STRING([--with-optimize-option], - [Select the compiler options to use for optimized builds]),, - withval=default) -AC_MSG_CHECKING([optimization flags]) -case "$withval" in - default) - case "$llvm_cv_os_type" in - FreeBSD) optimize_option=-O2 ;; - MingW) optimize_option=-O2 ;; - *) optimize_option=-O3 ;; - esac ;; - *) optimize_option="$withval" ;; -esac -AC_SUBST(OPTIMIZE_OPTION,$optimize_option) -AC_MSG_RESULT([$optimize_option]) - -dnl Specify extra build options -AC_ARG_WITH(extra-options, - AS_HELP_STRING([--with-extra-options], - [Specify additional options to compile LLVM with]),, - withval=default) -case "$withval" in - default) EXTRA_OPTIONS= ;; - *) EXTRA_OPTIONS=$withval ;; -esac -AC_SUBST(EXTRA_OPTIONS,$EXTRA_OPTIONS) - -dnl Allow specific bindings to be specified for building (or not) -AC_ARG_ENABLE([bindings],AS_HELP_STRING([--enable-bindings], - [Build specific language bindings: all,auto,none,{binding-name} (default=auto)]),, - enableval=default) -BINDINGS_TO_BUILD="" -case "$enableval" in - yes | default | auto) BINDINGS_TO_BUILD="auto" ;; - all ) BINDINGS_TO_BUILD="ocaml" ;; - none | no) BINDINGS_TO_BUILD="" ;; - *)for a_binding in `echo $enableval|sed -e 's/,/ /g' ` ; do - case "$a_binding" in - ocaml) BINDINGS_TO_BUILD="ocaml $BINDINGS_TO_BUILD" ;; - *) AC_MSG_ERROR([Unrecognized binding $a_binding]) ;; - esac - done - ;; -esac - -dnl Allow the ocaml libdir to be overridden. This could go in a configure -dnl script for bindings/ocaml/configure, except that its auto value depends on -dnl OCAMLC, which is found here to support tests. -AC_ARG_WITH([ocaml-libdir], - [AS_HELP_STRING([--with-ocaml-libdir], - [Specify install location for ocaml bindings (default is stdlib)])], - [], - [withval=auto]) -case "$withval" in - auto) with_ocaml_libdir="$withval" ;; - /* | [[A-Za-z]]:[[\\/]]*) with_ocaml_libdir="$withval" ;; - *) AC_MSG_ERROR([Invalid path for --with-ocaml-libdir. Provide full path]) ;; -esac - -AC_ARG_WITH(c-include-dirs, - AS_HELP_STRING([--with-c-include-dirs], - [Colon separated list of directories clang will search for headers]),, - withval="") -AC_DEFINE_UNQUOTED(C_INCLUDE_DIRS,"$withval", - [Directories clang will search for headers]) - -AC_ARG_WITH(cxx-include-root, - AS_HELP_STRING([--with-cxx-include-root], - [Directory with the libstdc++ headers.]),, - withval="") -AC_DEFINE_UNQUOTED(CXX_INCLUDE_ROOT,"$withval", - [Directory with the libstdc++ headers.]) - -AC_ARG_WITH(cxx-include-arch, - AS_HELP_STRING([--with-cxx-include-arch], - [Architecture of the libstdc++ headers.]),, - withval="") -AC_DEFINE_UNQUOTED(CXX_INCLUDE_ARCH,"$withval", - [Arch the libstdc++ headers.]) - -AC_ARG_WITH(cxx-include-32bit-dir, - AS_HELP_STRING([--with-cxx-include-32bit-dir], - [32 bit multilib dir.]),, - withval="") -AC_DEFINE_UNQUOTED(CXX_INCLUDE_32BIT_DIR,"$withval", - [32 bit multilib directory.]) - -AC_ARG_WITH(cxx-include-64bit-dir, - AS_HELP_STRING([--with-cxx-include-64bit-dir], - [64 bit multilib directory.]),, - withval="") -AC_DEFINE_UNQUOTED(CXX_INCLUDE_64BIT_DIR,"$withval", - [64 bit multilib directory.]) - -dnl Allow linking of LLVM with GPLv3 binutils code. -AC_ARG_WITH(binutils-include, - AS_HELP_STRING([--with-binutils-include], - [Specify path to binutils/include/ containing plugin-api.h file for gold plugin.]),, - withval=default) -case "$withval" in - default) WITH_BINUTILS_INCDIR=default ;; - /* | [[A-Za-z]]:[[\\/]]*) WITH_BINUTILS_INCDIR=$withval ;; - *) AC_MSG_ERROR([Invalid path for --with-binutils-include. Provide full path]) ;; -esac -if test "x$WITH_BINUTILS_INCDIR" != xdefault ; then - AC_SUBST(BINUTILS_INCDIR,$WITH_BINUTILS_INCDIR) - if test ! -f "$WITH_BINUTILS_INCDIR/plugin-api.h"; then - echo "$WITH_BINUTILS_INCDIR/plugin-api.h" - AC_MSG_ERROR([Invalid path to directory containing plugin-api.h.]); - fi -fi - -dnl --enable-libffi : check whether the user wants to turn off libffi: -AC_ARG_ENABLE(libffi,AS_HELP_STRING( - --enable-libffi,[Check for the presence of libffi (default is NO)]), - [case "$enableval" in - yes) llvm_cv_enable_libffi="yes" ;; - no) llvm_cv_enable_libffi="no" ;; - *) AC_MSG_ERROR([Invalid setting for --enable-libffi. Use "yes" or "no"]) ;; - esac], - llvm_cv_enable_libffi=no) - -dnl===-----------------------------------------------------------------------=== -dnl=== -dnl=== SECTION 4: Check for programs we need and that they are the right version -dnl=== -dnl===-----------------------------------------------------------------------=== - -dnl Check for compilation tools -AC_PROG_CPP -AC_PROG_CC(gcc) -AC_PROG_CXX(g++) - -AC_PROG_NM -AC_SUBST(NM) - -dnl Check for the tools that the makefiles require -AC_CHECK_GNU_MAKE -AC_PROG_LN_S -AC_PATH_PROG(CMP, [cmp], [cmp]) -AC_PATH_PROG(CP, [cp], [cp]) -AC_PATH_PROG(DATE, [date], [date]) -AC_PATH_PROG(FIND, [find], [find]) -AC_PATH_PROG(GREP, [grep], [grep]) -AC_PATH_PROG(MKDIR,[mkdir],[mkdir]) -AC_PATH_PROG(MV, [mv], [mv]) -AC_PROG_RANLIB -AC_CHECK_TOOL(AR, ar, false) -AC_PATH_PROG(RM, [rm], [rm]) -AC_PATH_PROG(SED, [sed], [sed]) -AC_PATH_PROG(TAR, [tar], [gtar]) -AC_PATH_PROG(BINPWD,[pwd], [pwd]) - -dnl Looking for misc. graph plotting software -AC_PATH_PROG(GRAPHVIZ, [Graphviz], [echo Graphviz]) -if test "$GRAPHVIZ" != "echo Graphviz" ; then - AC_DEFINE([HAVE_GRAPHVIZ],[1],[Define if the Graphviz program is available]) - dnl If we're targeting for mingw we should emit windows paths, not msys - if test "$llvm_cv_os_type" = "MingW" ; then - GRAPHVIZ=`echo $GRAPHVIZ | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' ` - fi - AC_DEFINE_UNQUOTED([LLVM_PATH_GRAPHVIZ],"$GRAPHVIZ${EXEEXT}", - [Define to path to Graphviz program if found or 'echo Graphviz' otherwise]) -fi -AC_PATH_PROG(DOT, [dot], [echo dot]) -if test "$DOT" != "echo dot" ; then - AC_DEFINE([HAVE_DOT],[1],[Define if the dot program is available]) - dnl If we're targeting for mingw we should emit windows paths, not msys - if test "$llvm_cv_os_type" = "MingW" ; then - DOT=`echo $DOT | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' ` - fi - AC_DEFINE_UNQUOTED([LLVM_PATH_DOT],"$DOT${EXEEXT}", - [Define to path to dot program if found or 'echo dot' otherwise]) -fi -AC_PATH_PROG(FDP, [fdp], [echo fdp]) -if test "$FDP" != "echo fdp" ; then - AC_DEFINE([HAVE_FDP],[1],[Define if the neat program is available]) - dnl If we're targeting for mingw we should emit windows paths, not msys - if test "$llvm_cv_os_type" = "MingW" ; then - FDP=`echo $FDP | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' ` - fi - AC_DEFINE_UNQUOTED([LLVM_PATH_FDP],"$FDP${EXEEXT}", - [Define to path to fdp program if found or 'echo fdp' otherwise]) -fi -AC_PATH_PROG(NEATO, [neato], [echo neato]) -if test "$NEATO" != "echo neato" ; then - AC_DEFINE([HAVE_NEATO],[1],[Define if the neat program is available]) - dnl If we're targeting for mingw we should emit windows paths, not msys - if test "$llvm_cv_os_type" = "MingW" ; then - NEATO=`echo $NEATO | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' ` - fi - AC_DEFINE_UNQUOTED([LLVM_PATH_NEATO],"$NEATO${EXEEXT}", - [Define to path to neato program if found or 'echo neato' otherwise]) -fi -AC_PATH_PROG(TWOPI, [twopi], [echo twopi]) -if test "$TWOPI" != "echo twopi" ; then - AC_DEFINE([HAVE_TWOPI],[1],[Define if the neat program is available]) - dnl If we're targeting for mingw we should emit windows paths, not msys - if test "$llvm_cv_os_type" = "MingW" ; then - TWOPI=`echo $TWOPI | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' ` - fi - AC_DEFINE_UNQUOTED([LLVM_PATH_TWOPI],"$TWOPI${EXEEXT}", - [Define to path to twopi program if found or 'echo twopi' otherwise]) -fi -AC_PATH_PROG(CIRCO, [circo], [echo circo]) -if test "$CIRCO" != "echo circo" ; then - AC_DEFINE([HAVE_CIRCO],[1],[Define if the neat program is available]) - dnl If we're targeting for mingw we should emit windows paths, not msys - if test "$llvm_cv_os_type" = "MingW" ; then - CIRCO=`echo $CIRCO | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' ` - fi - AC_DEFINE_UNQUOTED([LLVM_PATH_CIRCO],"$CIRCO${EXEEXT}", - [Define to path to circo program if found or 'echo circo' otherwise]) -fi -AC_PATH_PROGS(GV, [gv gsview32], [echo gv]) -if test "$GV" != "echo gv" ; then - AC_DEFINE([HAVE_GV],[1],[Define if the gv program is available]) - dnl If we're targeting for mingw we should emit windows paths, not msys - if test "$llvm_cv_os_type" = "MingW" ; then - GV=`echo $GV | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' ` - fi - AC_DEFINE_UNQUOTED([LLVM_PATH_GV],"$GV${EXEEXT}", - [Define to path to gv program if found or 'echo gv' otherwise]) -fi -AC_PATH_PROG(DOTTY, [dotty], [echo dotty]) -if test "$DOTTY" != "echo dotty" ; then - AC_DEFINE([HAVE_DOTTY],[1],[Define if the dotty program is available]) - dnl If we're targeting for mingw we should emit windows paths, not msys - if test "$llvm_cv_os_type" = "MingW" ; then - DOTTY=`echo $DOTTY | sed 's/^\/\([[A-Za-z]]\)\//\1:\//' ` - fi - AC_DEFINE_UNQUOTED([LLVM_PATH_DOTTY],"$DOTTY${EXEEXT}", - [Define to path to dotty program if found or 'echo dotty' otherwise]) -fi - -dnl Look for a sufficiently recent version of Perl. -LLVM_PROG_PERL([5.006]) -AC_SUBST(PERL) -if test x"$PERL" = xnone; then - AC_SUBST(HAVE_PERL,0) - AC_MSG_ERROR([perl is required but was not found, please install it]) -else - AC_SUBST(HAVE_PERL,1) -fi - -dnl Find the install program -AC_PROG_INSTALL -dnl Prepend src dir to install path dir if it's a relative path -dnl This is a hack for installs that take place in something other -dnl than the top level. -case "$INSTALL" in - [[\\/$]]* | ?:[[\\/]]* ) ;; - *) INSTALL="\\\$(TOPSRCDIR)/$INSTALL" ;; -esac - -dnl Checks for documentation and testing tools that we can do without. If these -dnl are not found then they are set to "true" which always succeeds but does -dnl nothing. This just lets the build output show that we could have done -dnl something if the tool was available. -AC_PATH_PROG(BZIP2, [bzip2]) -AC_PATH_PROG(CAT, [cat]) -AC_PATH_PROG(DOXYGEN, [doxygen]) -AC_PATH_PROG(GROFF, [groff]) -AC_PATH_PROG(GZIP, [gzip]) -AC_PATH_PROG(POD2HTML, [pod2html]) -AC_PATH_PROG(POD2MAN, [pod2man]) -AC_PATH_PROG(PDFROFF, [pdfroff]) -AC_PATH_PROG(RUNTEST, [runtest]) -DJ_AC_PATH_TCLSH -AC_PATH_PROG(ZIP, [zip]) -AC_PATH_PROGS(OCAMLC, [ocamlc]) -AC_PATH_PROGS(OCAMLOPT, [ocamlopt]) -AC_PATH_PROGS(OCAMLDEP, [ocamldep]) -AC_PATH_PROGS(OCAMLDOC, [ocamldoc]) -AC_PATH_PROGS(GAS, [gas as]) - -dnl Get the version of the linker in use. -AC_LINK_GET_VERSION - -dnl Determine whether the linker supports the -R option. -AC_LINK_USE_R - -dnl Determine whether the linker supports the -export-dynamic option. -AC_LINK_EXPORT_DYNAMIC - -dnl Determine whether the linker supports the --version-script option. -AC_LINK_VERSION_SCRIPT - -dnl Check for libtool and the library that has dlopen function (which must come -dnl before the AC_PROG_LIBTOOL check in order to enable dlopening libraries with -dnl libtool). -AC_LIBTOOL_DLOPEN -AC_LIB_LTDL - -if test "$WITH_LLVMGCCDIR" = "default" ; then - LLVMGCC="llvm-gcc${EXEEXT}" - LLVMGXX="llvm-g++${EXEEXT}" - LLVMGCCCOMMAND="$LLVMGCC" - LLVMGXXCOMMAND="$LLVMGXX" - AC_SUBST(LLVMGCCCOMMAND,$LLVMGCCCOMMAND) - AC_SUBST(LLVMGXXCOMMAND,$LLVMGXXCOMMAND) - AC_PATH_PROG(LLVMGCC, $LLVMGCC, []) - AC_PATH_PROG(LLVMGXX, $LLVMGXX, []) -else - if test -z "$LLVMGCC"; then - LLVMGCC="$WITH_LLVMGCCDIR/bin/llvm-gcc${EXEEXT}" - LLVMGCCCOMMAND="$LLVMGCC" - fi - if test -z "$LLVMGXX"; then - LLVMGXX="$WITH_LLVMGCCDIR/bin/llvm-g++${EXEEXT}" - LLVMGXXCOMMAND="$LLVMGXX" - fi - - AC_SUBST(LLVMGCC,$LLVMGCC) - AC_SUBST(LLVMGXX,$LLVMGXX) - AC_SUBST(LLVMGCCCOMMAND,$LLVMGCCCOMMAND) - AC_SUBST(LLVMGXXCOMMAND,$LLVMGXXCOMMAND) -fi - -dnl Select the LLVM capable compiler to use, we default to using llvm-gcc if -dnl found, otherwise clang if available. -AC_ARG_WITH(llvmcc, - AS_HELP_STRING([--with-llvmcc=], - [Choose the LLVM capable compiler to use (llvm-gcc, clang, or none; default=check)]), - [],[with_llvmcc=check]) -AC_MSG_CHECKING([LLVM capable compiler]) -if test "$with_llvmcc" != "check"; then - if (test "$with_llvmcc" != "llvm-gcc" && - test "$with_llvmcc" != "clang" && - test "$with_llvmcc" != "none"); then - AC_MSG_ERROR([invalid value for --with-llvmcc, expected 'llvm-gcc', 'clang', or 'none'.]) - fi - WITH_LLVMCC="$with_llvmcc" -elif test -n "$LLVMGCC"; then - WITH_LLVMCC=llvm-gcc -elif test -n "$WITH_CLANGPATH" || test "$WITH_BUILT_CLANG" -ne "0"; then - WITH_LLVMCC=clang -else - WITH_LLVMCC=none -fi -AC_MSG_RESULT([$WITH_LLVMCC]) -AC_SUBST(LLVMCC_OPTION,$WITH_LLVMCC) - -AC_MSG_CHECKING([tool compatibility]) - -dnl Ensure that compilation tools are GCC or a GNU compatible compiler such as -dnl ICC; we use GCC specific options in the makefiles so the compiler needs -dnl to support those options. -dnl "icc" emits gcc signatures -dnl "icc -no-gcc" emits no gcc signature BUT is still compatible -ICC=no -IXX=no -case $CC in - icc*|icpc*) - ICC=yes - IXX=yes - ;; - *) - ;; -esac - -if test "$GCC" != "yes" && test "$ICC" != "yes" -then - AC_MSG_ERROR([gcc|icc required but not found]) -fi - -dnl Ensure that compilation tools are GCC; we use GCC specific extensions -if test "$GXX" != "yes" && test "$IXX" != "yes" -then - AC_MSG_ERROR([g++|icc required but not found]) -fi - -dnl Verify that GCC is version 3.0 or higher -if test "$GCC" = "yes" -then - AC_COMPILE_IFELSE([[#if !defined(__GNUC__) || __GNUC__ < 3 -#error Unsupported GCC version -#endif -]], [], [AC_MSG_ERROR([gcc 3.x required, but you have a lower version])]) -fi - -dnl Check for GNU Make. We use its extensions, so don't build without it -if test -z "$llvm_cv_gnu_make_command" -then - AC_MSG_ERROR([GNU Make required but not found]) -fi - -dnl Tool compatibility is okay if we make it here. -AC_MSG_RESULT([ok]) - -dnl Check optional compiler flags. -AC_MSG_CHECKING([optional compiler flags]) -CXX_FLAG_CHECK(NO_VARIADIC_MACROS, [-Wno-variadic-macros]) -CXX_FLAG_CHECK(NO_MISSING_FIELD_INITIALIZERS, [-Wno-missing-field-initializers]) -AC_MSG_RESULT([$NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS]) - -dnl===-----------------------------------------------------------------------=== -dnl=== -dnl=== SECTION 5: Check for libraries -dnl=== -dnl===-----------------------------------------------------------------------=== - -AC_CHECK_LIB(m,sin) -if test "$llvm_cv_os_type" = "MingW" ; then - AC_CHECK_LIB(imagehlp, main) - AC_CHECK_LIB(psapi, main) -fi - -dnl dlopen() is required for plugin support. -AC_SEARCH_LIBS(dlopen,dl,AC_DEFINE([HAVE_DLOPEN],[1], - [Define if dlopen() is available on this platform.]), - AC_MSG_WARN([dlopen() not found - disabling plugin support])) - -dnl libffi is optional; used to call external functions from the interpreter -if test "$llvm_cv_enable_libffi" = "yes" ; then - AC_SEARCH_LIBS(ffi_call,ffi,AC_DEFINE([HAVE_FFI_CALL],[1], - [Define if libffi is available on this platform.]), - AC_MSG_ERROR([libffi not found - configure without --enable-libffi to compile without it])) -fi - -dnl mallinfo is optional; the code can compile (minus features) without it -AC_SEARCH_LIBS(mallinfo,malloc,AC_DEFINE([HAVE_MALLINFO],[1], - [Define if mallinfo() is available on this platform.])) - -dnl pthread locking functions are optional - but llvm will not be thread-safe -dnl without locks. -if test "$ENABLE_THREADS" -eq 1 ; then - AC_CHECK_LIB(pthread, pthread_mutex_init) - AC_SEARCH_LIBS(pthread_mutex_lock,pthread, - AC_DEFINE([HAVE_PTHREAD_MUTEX_LOCK],[1], - [Have pthread_mutex_lock])) - AC_SEARCH_LIBS(pthread_rwlock_init,pthread, - AC_DEFINE([HAVE_PTHREAD_RWLOCK_INIT],[1], - [Have pthread_rwlock_init])) - AC_SEARCH_LIBS(pthread_getspecific,pthread, - AC_DEFINE([HAVE_PTHREAD_GETSPECIFIC],[1], - [Have pthread_getspecific])) -fi - -dnl Allow extra x86-disassembler library -AC_ARG_WITH(udis86, - AS_HELP_STRING([--with-udis86=], - [Use udis86 external x86 disassembler library]), - [ - AC_SUBST(USE_UDIS86, [1]) - case "$withval" in - /usr/lib|yes) ;; - *) LDFLAGS="$LDFLAGS -L${withval}" ;; - esac - AC_CHECK_LIB(udis86, ud_init, [], [ - echo "Error! You need to have libudis86 around." - exit -1 - ]) - ], - AC_SUBST(USE_UDIS86, [0])) -AC_DEFINE_UNQUOTED([USE_UDIS86],$USE_UDIS86, - [Define if use udis86 library]) - -dnl Allow OProfile support for JIT output. -AC_ARG_WITH(oprofile, - AS_HELP_STRING([--with-oprofile=], - [Tell OProfile >= 0.9.4 how to symbolize JIT output]), - [ - AC_SUBST(USE_OPROFILE, [1]) - case "$withval" in - /usr|yes) llvm_cv_oppath=/usr/lib/oprofile ;; - no) llvm_cv_oppath= - AC_SUBST(USE_OPROFILE, [0]) ;; - *) llvm_cv_oppath="${withval}/lib/oprofile" - CPPFLAGS="-I${withval}/include";; - esac - if test -n "$llvm_cv_oppath" ; then - LIBS="$LIBS -L${llvm_cv_oppath} -Wl,-rpath,${llvm_cv_oppath}" - dnl Work around http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=537744: - dnl libbfd is not included properly in libopagent in some Debian - dnl versions. If libbfd isn't found at all, we assume opagent works - dnl anyway. - AC_SEARCH_LIBS(bfd_init, bfd, [], []) - AC_SEARCH_LIBS(op_open_agent, opagent, [], [ - echo "Error! You need to have libopagent around." - exit -1 - ]) - AC_CHECK_HEADER([opagent.h], [], [ - echo "Error! You need to have opagent.h around." - exit -1 - ]) - fi - ], - [ - AC_SUBST(USE_OPROFILE, [0]) - ]) -AC_DEFINE_UNQUOTED([USE_OPROFILE],$USE_OPROFILE, - [Define if we have the oprofile JIT-support library]) - -dnl===-----------------------------------------------------------------------=== -dnl=== -dnl=== SECTION 6: Check for header files -dnl=== -dnl===-----------------------------------------------------------------------=== - -dnl First, use autoconf provided macros for specific headers that we need -dnl We don't check for ancient stuff or things that are guaranteed to be there -dnl by the C++ standard. We always use the versions of C headers. -dnl Generally we're looking for POSIX headers. -AC_HEADER_DIRENT -AC_HEADER_MMAP_ANONYMOUS -AC_HEADER_STAT -AC_HEADER_STDC -AC_HEADER_SYS_WAIT -AC_HEADER_TIME - -AC_CHECK_HEADERS([dlfcn.h execinfo.h fcntl.h inttypes.h limits.h link.h]) -AC_CHECK_HEADERS([malloc.h setjmp.h signal.h stdint.h termios.h unistd.h]) -AC_CHECK_HEADERS([utime.h windows.h]) -AC_CHECK_HEADERS([sys/mman.h sys/param.h sys/resource.h sys/time.h]) -AC_CHECK_HEADERS([sys/types.h sys/ioctl.h malloc/malloc.h mach/mach.h]) -AC_CHECK_HEADERS([valgrind/valgrind.h]) -if test "$ENABLE_THREADS" -eq 1 ; then - AC_CHECK_HEADERS(pthread.h, - AC_SUBST(HAVE_PTHREAD, 1), - AC_SUBST(HAVE_PTHREAD, 0)) -else - AC_SUBST(HAVE_PTHREAD, 0) -fi - -dnl Try to find ffi.h. -if test "$llvm_cv_enable_libffi" = "yes" ; then - AC_CHECK_HEADERS([ffi.h ffi/ffi.h]) -fi - -dnl Try to find Darwin specific crash reporting library. -AC_CHECK_HEADERS([CrashReporterClient.h]) - -dnl===-----------------------------------------------------------------------=== -dnl=== -dnl=== SECTION 7: Check for types and structures -dnl=== -dnl===-----------------------------------------------------------------------=== - -AC_HUGE_VAL_CHECK -AC_TYPE_PID_T -AC_TYPE_SIZE_T -AC_DEFINE_UNQUOTED([RETSIGTYPE],[void],[Define as the return type of signal handlers (`int' or `void').]) -AC_STRUCT_TM -AC_CHECK_TYPES([int64_t],,AC_MSG_ERROR([Type int64_t required but not found])) -AC_CHECK_TYPES([uint64_t],, - AC_CHECK_TYPES([u_int64_t],, - AC_MSG_ERROR([Type uint64_t or u_int64_t required but not found]))) - -dnl===-----------------------------------------------------------------------=== -dnl=== -dnl=== SECTION 8: Check for specific functions needed -dnl=== -dnl===-----------------------------------------------------------------------=== - -AC_CHECK_FUNCS([backtrace ceilf floorf roundf rintf nearbyintf getcwd ]) -AC_CHECK_FUNCS([powf fmodf strtof round ]) -AC_CHECK_FUNCS([getpagesize getrusage getrlimit setrlimit gettimeofday ]) -AC_CHECK_FUNCS([isatty mkdtemp mkstemp ]) -AC_CHECK_FUNCS([mktemp posix_spawn realpath sbrk setrlimit strdup ]) -AC_CHECK_FUNCS([strerror strerror_r strerror_s setenv ]) -AC_CHECK_FUNCS([strtoll strtoq sysconf malloc_zone_statistics ]) -AC_CHECK_FUNCS([setjmp longjmp sigsetjmp siglongjmp]) -AC_C_PRINTF_A -AC_FUNC_RAND48 - -dnl Check for variations in the Standard C++ library and STL. These macros are -dnl provided by LLVM in the autoconf/m4 directory. -AC_FUNC_ISNAN -AC_FUNC_ISINF - -dnl Check for mmap support.We also need to know if /dev/zero is required to -dnl be opened for allocating RWX memory. -dnl Make sure we aren't attempting to configure for an unknown system -if test "$llvm_cv_platform_type" = "Unix" ; then - AC_FUNC_MMAP - AC_FUNC_MMAP_FILE - AC_NEED_DEV_ZERO_FOR_MMAP - - if test "$ac_cv_func_mmap_fixed_mapped" = "no" - then - AC_MSG_WARN([mmap() of a fixed address required but not supported]) - fi - if test "$ac_cv_func_mmap_file" = "no" - then - AC_MSG_WARN([mmap() of files required but not found]) - fi -fi - -dnl atomic builtins are required for threading support. -AC_MSG_CHECKING(for GCC atomic builtins) -dnl Since we'll be using these atomic builtins in C++ files we should test -dnl the C++ compiler. -AC_LANG_PUSH([C++]) -AC_LINK_IFELSE( - AC_LANG_SOURCE( - [[int main() { - volatile unsigned long val = 1; - __sync_synchronize(); - __sync_val_compare_and_swap(&val, 1, 0); - __sync_add_and_fetch(&val, 1); - __sync_sub_and_fetch(&val, 1); - return 0; - } - ]]), - AC_LANG_POP([C++]) - AC_MSG_RESULT(yes) - AC_DEFINE(LLVM_MULTITHREADED, 1, Build multithreading support into LLVM), - AC_MSG_RESULT(no) - AC_DEFINE(LLVM_MULTITHREADED, 0, Build multithreading support into LLVM) - AC_MSG_WARN([LLVM will be built thread-unsafe because atomic builtins are missing])) - -dnl===-----------------------------------------------------------------------=== -dnl=== -dnl=== SECTION 9: Additional checks, variables, etc. -dnl=== -dnl===-----------------------------------------------------------------------=== - -dnl Handle 32-bit linux systems running a 64-bit kernel. -dnl This has to come after section 4 because it invokes the compiler. -if test "$llvm_cv_os_type" = "Linux" -a "$llvm_cv_target_arch" = "x86_64" ; then - AC_IS_LINUX_MIXED - if test "$llvm_cv_linux_mixed" = "yes"; then - llvm_cv_target_arch="x86" - ARCH="x86" - fi -fi - -dnl Check, whether __dso_handle is present -AC_CHECK_FUNCS([__dso_handle]) - -dnl See if the llvm-gcc executable can compile to LLVM assembly -AC_CACHE_CHECK([whether llvm-gcc is sane],[llvm_cv_llvmgcc_sanity], -[llvm_cv_llvmgcc_sanity="no" -if test -x "$LLVMGCC" ; then - cp /dev/null conftest.c - "$LLVMGCC" -emit-llvm -S -o - conftest.c | \ - grep 'target datalayout =' > /dev/null 2>&1 - if test $? -eq 0 ; then - llvm_cv_llvmgcc_sanity="yes" - fi - rm conftest.c -fi]) - -dnl Since we have a sane llvm-gcc, identify it and its sub-tools -if test "$llvm_cv_llvmgcc_sanity" = "yes" ; then - AC_MSG_CHECKING([llvm-gcc component support]) - llvmcc1path=`"$LLVMGCC" --print-prog-name=cc1` - AC_SUBST(LLVMCC1,$llvmcc1path) - llvmcc1pluspath=`"$LLVMGCC" --print-prog-name=cc1plus` - AC_SUBST(LLVMCC1PLUS,$llvmcc1pluspath) - llvmgccdir=`echo "$llvmcc1path" | sed 's,/libexec/.*,,'` - AC_SUBST(LLVMGCCDIR,$llvmgccdir) - llvmgcclangs=[`"$LLVMGCC" -v --help 2>&1 | grep '^Configured with:' | sed 's/^.*--enable-languages=\([^ ]*\).*/\1/'`] - AC_SUBST(LLVMGCC_LANGS,$llvmgcclangs) - AC_MSG_RESULT([ok]) -fi - -dnl Propagate the shared library extension that the libltdl checks did to -dnl the Makefiles so we can use it there too -AC_SUBST(SHLIBEXT,$libltdl_cv_shlibext) - -dnl Propagate the run-time library path variable that the libltdl -dnl checks found to the Makefiles so we can use it there too -AC_SUBST(SHLIBPATH_VAR,$libltdl_cv_shlibpath_var) - -# Translate the various configuration directories and other basic -# information into substitutions that will end up in Makefile.config.in -# that these configured values can be used by the makefiles -if test "${prefix}" = "NONE" ; then - prefix="/usr/local" -fi -eval LLVM_PREFIX="${prefix}"; -eval LLVM_BINDIR="${prefix}/bin"; -eval LLVM_LIBDIR="${prefix}/lib"; -eval LLVM_DATADIR="${prefix}/share/llvm"; -eval LLVM_DOCSDIR="${prefix}/share/doc/llvm"; -eval LLVM_ETCDIR="${prefix}/etc/llvm"; -eval LLVM_INCLUDEDIR="${prefix}/include"; -eval LLVM_INFODIR="${prefix}/info"; -eval LLVM_MANDIR="${prefix}/man"; -LLVM_CONFIGTIME=`date` -AC_SUBST(LLVM_PREFIX) -AC_SUBST(LLVM_BINDIR) -AC_SUBST(LLVM_LIBDIR) -AC_SUBST(LLVM_DATADIR) -AC_SUBST(LLVM_DOCSDIR) -AC_SUBST(LLVM_ETCDIR) -AC_SUBST(LLVM_INCLUDEDIR) -AC_SUBST(LLVM_INFODIR) -AC_SUBST(LLVM_MANDIR) -AC_SUBST(LLVM_CONFIGTIME) - -# Place the various directores into the config.h file as #defines so that we -# can know about the installation paths within LLVM. -AC_DEFINE_UNQUOTED(LLVM_PREFIX,"$LLVM_PREFIX", - [Installation prefix directory]) -AC_DEFINE_UNQUOTED(LLVM_BINDIR, "$LLVM_BINDIR", - [Installation directory for binary executables]) -AC_DEFINE_UNQUOTED(LLVM_LIBDIR, "$LLVM_LIBDIR", - [Installation directory for libraries]) -AC_DEFINE_UNQUOTED(LLVM_DATADIR, "$LLVM_DATADIR", - [Installation directory for data files]) -AC_DEFINE_UNQUOTED(LLVM_DOCSDIR, "$LLVM_DOCSDIR", - [Installation directory for documentation]) -AC_DEFINE_UNQUOTED(LLVM_ETCDIR, "$LLVM_ETCDIR", - [Installation directory for config files]) -AC_DEFINE_UNQUOTED(LLVM_INCLUDEDIR, "$LLVM_INCLUDEDIR", - [Installation directory for include files]) -AC_DEFINE_UNQUOTED(LLVM_INFODIR, "$LLVM_INFODIR", - [Installation directory for .info files]) -AC_DEFINE_UNQUOTED(LLVM_MANDIR, "$LLVM_MANDIR", - [Installation directory for man pages]) -AC_DEFINE_UNQUOTED(LLVM_CONFIGTIME, "$LLVM_CONFIGTIME", - [Time at which LLVM was configured]) -AC_DEFINE_UNQUOTED(LLVM_HOSTTRIPLE, "$host", - [Host triple we were built on]) - -# Determine which bindings to build. -if test "$BINDINGS_TO_BUILD" = auto ; then - BINDINGS_TO_BUILD="" - if test "x$OCAMLC" != x -a "x$OCAMLDEP" != x ; then - BINDINGS_TO_BUILD="ocaml $BINDINGS_TO_BUILD" - fi -fi -AC_SUBST(BINDINGS_TO_BUILD,$BINDINGS_TO_BUILD) - -# This isn't really configurey, but it avoids having to repeat the list in -# other files. -AC_SUBST(ALL_BINDINGS,ocaml) - -# Do any work necessary to ensure that bindings have what they need. -binding_prereqs_failed=0 -for a_binding in $BINDINGS_TO_BUILD ; do - case "$a_binding" in - ocaml) - if test "x$OCAMLC" = x ; then - AC_MSG_WARN([--enable-bindings=ocaml specified, but ocamlc not found. Try configure OCAMLC=/path/to/ocamlc]) - binding_prereqs_failed=1 - fi - if test "x$OCAMLDEP" = x ; then - AC_MSG_WARN([--enable-bindings=ocaml specified, but ocamldep not found. Try configure OCAMLDEP=/path/to/ocamldep]) - binding_prereqs_failed=1 - fi - if test "x$OCAMLOPT" = x ; then - AC_MSG_WARN([--enable-bindings=ocaml specified, but ocamlopt not found. Try configure OCAMLOPT=/path/to/ocamlopt]) - dnl ocamlopt is optional! - fi - if test "x$with_ocaml_libdir" != xauto ; then - AC_SUBST(OCAML_LIBDIR,$with_ocaml_libdir) - else - ocaml_stdlib="`"$OCAMLC" -where`" - if test "$LLVM_PREFIX" '<' "$ocaml_stdlib" -a "$ocaml_stdlib" '<' "$LLVM_PREFIX~" - then - # ocaml stdlib is beneath our prefix; use stdlib - AC_SUBST(OCAML_LIBDIR,$ocaml_stdlib) - else - # ocaml stdlib is outside our prefix; use libdir/ocaml - AC_SUBST(OCAML_LIBDIR,$LLVM_LIBDIR/ocaml) - fi - fi - ;; - esac -done -if test "$binding_prereqs_failed" = 1 ; then - AC_MSG_ERROR([Prequisites for bindings not satisfied. Fix them or use configure --disable-bindings.]) -fi - -dnl Determine whether the compiler supports -fvisibility-inlines-hidden. -AC_CXX_USE_VISIBILITY_INLINES_HIDDEN - -dnl Determine linker rpath flag -if test "$llvm_cv_link_use_r" = "yes" ; then - RPATH="-Wl,-R" -else - RPATH="-Wl,-rpath" -fi -AC_SUBST(RPATH) - -dnl Determine linker rdynamic flag -if test "$llvm_cv_link_use_export_dynamic" = "yes" ; then - RDYNAMIC="-Wl,-export-dynamic" -else - RDYNAMIC="" -fi -AC_SUBST(RDYNAMIC) - -dnl===-----------------------------------------------------------------------=== -dnl=== -dnl=== SECTION 10: Specify the output files and generate it -dnl=== -dnl===-----------------------------------------------------------------------=== - -dnl Configure header files -dnl WARNING: dnl If you add or remove any of the following config headers, then -dnl you MUST also update Makefile.rules so that the variable FilesToConfig -dnl contains the same list of files as AC_CONFIG_HEADERS below. This ensures the -dnl files can be updated automatically when their *.in sources change. -AC_CONFIG_HEADERS([include/llvm/Config/config.h include/llvm/Config/llvm-config.h]) -AH_TOP([#ifndef CONFIG_H -#define CONFIG_H]) -AH_BOTTOM([#endif]) - -AC_CONFIG_FILES([include/llvm/Config/Targets.def]) -AC_CONFIG_FILES([include/llvm/Config/AsmPrinters.def]) -AC_CONFIG_FILES([include/llvm/Config/AsmParsers.def]) -AC_CONFIG_FILES([include/llvm/Config/Disassemblers.def]) -AC_CONFIG_HEADERS([include/llvm/System/DataTypes.h]) - -dnl Configure the makefile's configuration data -AC_CONFIG_FILES([Makefile.config]) - -dnl Configure the RPM spec file for LLVM -AC_CONFIG_FILES([llvm.spec]) - -dnl Configure llvmc's Base plugin -AC_CONFIG_FILES([tools/llvmc/src/Base.td]) - -dnl Do the first stage of configuration for llvm-config.in. -AC_CONFIG_FILES([tools/llvm-config/llvm-config.in]) - -dnl Do special configuration of Makefiles -AC_CONFIG_COMMANDS([setup],,[llvm_src="${srcdir}"]) -AC_CONFIG_MAKEFILE(Makefile) -AC_CONFIG_MAKEFILE(Makefile.common) -AC_CONFIG_MAKEFILE(examples/Makefile) -AC_CONFIG_MAKEFILE(lib/Makefile) -AC_CONFIG_MAKEFILE(runtime/Makefile) -AC_CONFIG_MAKEFILE(test/Makefile) -AC_CONFIG_MAKEFILE(test/Makefile.tests) -AC_CONFIG_MAKEFILE(unittests/Makefile) -AC_CONFIG_MAKEFILE(tools/Makefile) -AC_CONFIG_MAKEFILE(utils/Makefile) -AC_CONFIG_MAKEFILE(projects/Makefile) -AC_CONFIG_MAKEFILE(bindings/Makefile) -AC_CONFIG_MAKEFILE(bindings/ocaml/Makefile.ocaml) - -dnl Finally, crank out the output -AC_OUTPUT diff --git a/contrib/llvm/autoconf/depcomp b/contrib/llvm/autoconf/depcomp deleted file mode 100755 index 11e2d3bfe1cf..000000000000 --- a/contrib/llvm/autoconf/depcomp +++ /dev/null @@ -1,522 +0,0 @@ -#! /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 . - -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 . -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: diff --git a/contrib/llvm/autoconf/install-sh b/contrib/llvm/autoconf/install-sh deleted file mode 100755 index dd97db7aa1ca..000000000000 --- a/contrib/llvm/autoconf/install-sh +++ /dev/null @@ -1,322 +0,0 @@ -#!/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: diff --git a/contrib/llvm/autoconf/ltmain.sh b/contrib/llvm/autoconf/ltmain.sh deleted file mode 100644 index 06823e057a57..000000000000 --- a/contrib/llvm/autoconf/ltmain.sh +++ /dev/null @@ -1,6863 +0,0 @@ -# ltmain.sh - Provide generalized library-building support services. -# NOTE: Changing this file will not affect anything until you rerun configure. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 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 of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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. - -basename="s,^.*/,,g" - -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" - -# The name of this program: -progname=`echo "$progpath" | $SED $basename` -modename="$progname" - -# Global variables: -EXIT_SUCCESS=0 -EXIT_FAILURE=1 - -PROGRAM=ltmain.sh -PACKAGE=libtool -VERSION=1.5.22 -TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" - -# See if we are running on zsh, and set the options which allow our -# commands through without removal of \ escapes. -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - -# Check that we have a working $echo. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell, and then maybe $echo will work. - exec $SHELL "$progpath" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE -fi - -# Global variables. -mode=$default_mode -nonopt= -prev= -prevopt= -run= -show="$echo" -show_help= -execute_dlfiles= -duplicate_deps=no -preserve_args= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" - -##################################### -# Shell function definitions: -# This seems to be the best place for them - -# func_mktempdir [string] -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, STRING is the basename for that directory. -func_mktempdir () -{ - my_template="${TMPDIR-/tmp}/${1-$progname}" - - if test "$run" = ":"; then - # Return a directory name, but don't create it in dry-run mode - my_tmpdir="${my_template}-$$" - else - - # If mktemp works, use that first and foremost - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` - - if test ! -d "$my_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" - - save_mktempdir_umask=`umask` - umask 0077 - $mkdir "$my_tmpdir" - umask $save_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || { - $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 - exit $EXIT_FAILURE - } - fi - - $echo "X$my_tmpdir" | $Xsed -} - - -# func_win32_libid arg -# return the library type of file 'arg' -# -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -func_win32_libid () -{ - win32_libid_type="unknown" - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ - $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then - win32_nmres=`eval $NM -f posix -A $1 | \ - $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` - case $win32_nmres in - import*) win32_libid_type="x86 archive import";; - *) win32_libid_type="x86 archive static";; - esac - fi - ;; - *DLL*) - win32_libid_type="x86 DLL" - ;; - *executable*) # but shell scripts are "executable" too... - case $win32_fileres in - *MS\ Windows\ PE\ Intel*) - win32_libid_type="x86 DLL" - ;; - esac - ;; - esac - $echo $win32_libid_type -} - - -# func_infer_tag arg -# Infer tagged configuration to use if any are available and -# if one wasn't chosen via the "--tag" command line option. -# Only attempt this if the compiler in the base compile -# command doesn't match the default compiler. -# arg is usually of the form 'gcc ...' -func_infer_tag () -{ - if test -n "$available_tags" && test -z "$tagname"; then - CC_quoted= - for arg in $CC; do - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - CC_quoted="$CC_quoted $arg" - done - case $@ in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" - CC_quoted= - for arg in $CC; do - # Double-quote args containing other shell metacharacters. - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - CC_quoted="$CC_quoted $arg" - done - case "$@ " in - " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - $echo "$modename: unable to infer tagged configuration" - $echo "$modename: specify a tag with \`--tag'" 1>&2 - exit $EXIT_FAILURE -# else -# $echo "$modename: using $tagname tagged configuration" - fi - ;; - esac - fi -} - - -# func_extract_an_archive dir oldlib -func_extract_an_archive () -{ - f_ex_an_ar_dir="$1"; shift - f_ex_an_ar_oldlib="$1" - - $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" - $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 - exit $EXIT_FAILURE - fi -} - -# func_extract_archives gentop oldlib ... -func_extract_archives () -{ - my_gentop="$1"; shift - my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" - my_status="" - - $show "${rm}r $my_gentop" - $run ${rm}r "$my_gentop" - $show "$mkdir $my_gentop" - $run $mkdir "$my_gentop" - my_status=$? - if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then - exit $my_status - fi - - for my_xlib in $my_oldlibs; do - # Extract the objects. - case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; - *) my_xabs=`pwd`"/$my_xlib" ;; - esac - my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` - my_xdir="$my_gentop/$my_xlib" - - $show "${rm}r $my_xdir" - $run ${rm}r "$my_xdir" - $show "$mkdir $my_xdir" - $run $mkdir "$my_xdir" - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then - exit $exit_status - fi - case $host in - *-darwin*) - $show "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - if test -z "$run"; then - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` - darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` - if test -n "$darwin_arches"; then - darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - $show "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" - lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" - cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" - func_extract_an_archive "`pwd`" "${darwin_base_archive}" - cd "$darwin_curdir" - $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" - done # $darwin_arches - ## Okay now we have a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` - lipo -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - ${rm}r unfat-$$ - cd "$darwin_orig_dir" - else - cd "$darwin_orig_dir" - func_extract_an_archive "$my_xdir" "$my_xabs" - fi # $darwin_arches - fi # $run - ;; - *) - func_extract_an_archive "$my_xdir" "$my_xabs" - ;; - esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` - done - func_extract_archives_result="$my_oldobjs" -} -# End of Shell function definitions -##################################### - -# Darwin sucks -eval std_shrext=\"$shrext_cmds\" - -disable_libs=no - -# Parse our command line options once, thoroughly. -while test "$#" -gt 0 -do - arg="$1" - shift - - case $arg in - -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - execute_dlfiles) - execute_dlfiles="$execute_dlfiles $arg" - ;; - tag) - tagname="$arg" - preserve_args="${preserve_args}=$arg" - - # Check whether tagname contains only valid characters - case $tagname in - *[!-_A-Za-z0-9,/]*) - $echo "$progname: invalid tag name: $tagname" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $tagname in - CC) - # Don't test for the "default" C tag, as we know, it's there, but - # not specially marked. - ;; - *) - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then - taglist="$taglist $tagname" - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" - else - $echo "$progname: ignoring unknown tag $tagname" 1>&2 - fi - ;; - esac - ;; - *) - eval "$prev=\$arg" - ;; - esac - - prev= - prevopt= - continue - fi - - # Have we seen a non-optional argument yet? - case $arg in - --help) - show_help=yes - ;; - - --version) - $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" - $echo - $echo "Copyright (C) 2005 Free Software Foundation, Inc." - $echo "This is free software; see the source for copying conditions. There is NO" - $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - exit $? - ;; - - --config) - ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath - # Now print the configurations for the tags. - for tagname in $taglist; do - ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" - done - exit $? - ;; - - --debug) - $echo "$progname: enabling shell trace mode" - set -x - preserve_args="$preserve_args $arg" - ;; - - --dry-run | -n) - run=: - ;; - - --features) - $echo "host: $host" - if test "$build_libtool_libs" = yes; then - $echo "enable shared libraries" - else - $echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - $echo "enable static libraries" - else - $echo "disable static libraries" - fi - exit $? - ;; - - --finish) mode="finish" ;; - - --mode) prevopt="--mode" prev=mode ;; - --mode=*) mode="$optarg" ;; - - --preserve-dup-deps) duplicate_deps="yes" ;; - - --quiet | --silent) - show=: - preserve_args="$preserve_args $arg" - ;; - - --tag) - prevopt="--tag" - prev=tag - preserve_args="$preserve_args --tag" - ;; - --tag=*) - set tag "$optarg" ${1+"$@"} - shift - prev=tag - preserve_args="$preserve_args --tag" - ;; - - -dlopen) - prevopt="-dlopen" - prev=execute_dlfiles - ;; - - -*) - $echo "$modename: unrecognized option \`$arg'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - - *) - nonopt="$arg" - break - ;; - esac -done - -if test -n "$prevopt"; then - $echo "$modename: option \`$prevopt' requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE -fi - -case $disable_libs in -no) - ;; -shared) - build_libtool_libs=no - build_old_libs=yes - ;; -static) - build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` - ;; -esac - -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= - -if test -z "$show_help"; then - - # Infer the operation mode. - if test -z "$mode"; then - $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 - $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 - case $nonopt in - *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) - mode=link - for arg - do - case $arg in - -c) - mode=compile - break - ;; - esac - done - ;; - *db | *dbx | *strace | *truss) - mode=execute - ;; - *install*|cp|mv) - mode=install - ;; - *rm) - mode=uninstall - ;; - *) - # If we have no mode, but dlfiles were specified, then do execute mode. - test -n "$execute_dlfiles" && mode=execute - - # Just use the default operation mode. - if test -z "$mode"; then - if test -n "$nonopt"; then - $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 - else - $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 - fi - fi - ;; - esac - fi - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - $echo "$modename: unrecognized option \`-dlopen'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$modename --help --mode=$mode' for more information." - - # These modes are in order of execution frequency so that they run quickly. - case $mode in - # libtool compile mode - compile) - modename="$modename: compile" - # Get the compilation command and the source file. - base_compile= - srcfile="$nonopt" # always keep a non-empty value in "srcfile" - suppress_opt=yes - suppress_output= - arg_mode=normal - libobj= - later= - - for arg - do - case $arg_mode in - arg ) - # do not "continue". Instead, add this to base_compile - lastarg="$arg" - arg_mode=normal - ;; - - target ) - libobj="$arg" - arg_mode=normal - continue - ;; - - normal ) - # Accept any command-line options. - case $arg in - -o) - if test -n "$libobj" ; then - $echo "$modename: you cannot specify \`-o' more than once" 1>&2 - exit $EXIT_FAILURE - fi - arg_mode=target - continue - ;; - - -static | -prefer-pic | -prefer-non-pic) - later="$later $arg" - continue - ;; - - -no-suppress) - suppress_opt=no - continue - ;; - - -Xcompiler) - arg_mode=arg # the next one goes into the "base_compile" arg list - continue # The current "srcfile" will either be retained or - ;; # replaced later. I would guess that would be a bug. - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` - lastarg= - save_ifs="$IFS"; IFS=',' - for arg in $args; do - IFS="$save_ifs" - - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - lastarg="$lastarg $arg" - done - IFS="$save_ifs" - lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` - - # Add the arguments to base_compile. - base_compile="$base_compile $lastarg" - continue - ;; - - * ) - # Accept the current argument as the source file. - # The previous "srcfile" becomes the current argument. - # - lastarg="$srcfile" - srcfile="$arg" - ;; - esac # case $arg - ;; - esac # case $arg_mode - - # Aesthetically quote the previous argument. - lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` - - case $lastarg in - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, and some SunOS ksh mistreat backslash-escaping - # in scan sets (worked around with variable expansion), - # and furthermore cannot handle '|' '&' '(' ')' in scan sets - # at all, so we specify them separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - lastarg="\"$lastarg\"" - ;; - esac - - base_compile="$base_compile $lastarg" - done # for arg - - case $arg_mode in - arg) - $echo "$modename: you must specify an argument for -Xcompile" - exit $EXIT_FAILURE - ;; - target) - $echo "$modename: you must specify a target with \`-o'" 1>&2 - exit $EXIT_FAILURE - ;; - *) - # Get the name of the library object. - [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - xform='[cCFSifmso]' - case $libobj in - *.ada) xform=ada ;; - *.adb) xform=adb ;; - *.ads) xform=ads ;; - *.asm) xform=asm ;; - *.c++) xform=c++ ;; - *.cc) xform=cc ;; - *.ii) xform=ii ;; - *.class) xform=class ;; - *.cpp) xform=cpp ;; - *.cxx) xform=cxx ;; - *.f90) xform=f90 ;; - *.for) xform=for ;; - *.java) xform=java ;; - esac - - libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` - - case $libobj in - *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; - *) - $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - func_infer_tag $base_compile - - for arg in $later; do - case $arg in - -static) - build_old_libs=yes - continue - ;; - - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no - continue - ;; - esac - done - - qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` - case $qlibobj in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qlibobj="\"$qlibobj\"" ;; - esac - test "X$libobj" != "X$qlibobj" \ - && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ - && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." - objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$obj"; then - xdir= - else - xdir=$xdir/ - fi - lobj=${xdir}$objdir/$objname - - if test -z "$base_compile"; then - $echo "$modename: you must specify a compilation command" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - $run $rm $removelist - trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2*) - pic_mode=default - ;; - esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - removelist="$removelist $output_obj $lockfile" - trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 - else - output_obj= - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until $run ln "$progpath" "$lockfile" 2>/dev/null; do - $show "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - $echo "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - $echo "$srcfile" > "$lockfile" - fi - - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi - qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` - case $qsrcfile in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qsrcfile="\"$qsrcfile\"" ;; - esac - - $run $rm "$libobj" "${libobj}T" - - # Create a libtool object file (analogous to a ".la" file), - # but don't create it if we're doing a dry run. - test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then - $echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed, then go on to compile the next one - if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then - $show "$mv $output_obj $lobj" - if $run $mv $output_obj $lobj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Append the name of the PIC object to the libtool object file. - test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then - $echo "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed - if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then - $show "$mv $output_obj $obj" - if $run $mv $output_obj $obj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Append the name of the non-PIC object the libtool object file. - # Only append if the libtool object file exists. - test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - else - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=built - fi - build_libtool_libs=no - build_old_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test "$#" -gt 0; do - arg="$1" - shift - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test - ;; - *) qarg=$arg ;; - esac - libtool_args="$libtool_args $qarg" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - compile_command="$compile_command @OUTPUT@" - finalize_command="$finalize_command @OUTPUT@" - ;; - esac - - case $prev in - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - compile_command="$compile_command @SYMFILE@" - finalize_command="$finalize_command @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - else - dlprefiles="$dlprefiles $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols="$arg" - if test ! -f "$arg"; then - $echo "$modename: symbol file \`$arg' does not exist" - exit $EXIT_FAILURE - fi - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - inst_prefix) - inst_prefix_dir="$arg" - prev= - continue - ;; - precious_regex) - precious_files_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat $save_arg` - do -# moreargs="$moreargs $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit $EXIT_FAILURE - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$libobjs $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects="$non_pic_objects $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit $EXIT_FAILURE - else - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - fi - done - else - $echo "$modename: link input file \`$save_arg' does not exist" - exit $EXIT_FAILURE - fi - arg=$save_arg - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit $EXIT_FAILURE - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) rpath="$rpath $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; - esac - fi - prev= - continue - ;; - xcompiler) - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - xlinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $wl$qarg" - prev= - compile_command="$compile_command $wl$qarg" - finalize_command="$finalize_command $wl$qarg" - continue - ;; - xcclinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - shrext) - shrext_cmds="$arg" - prev= - continue - ;; - darwin_framework|darwin_framework_skip) - test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - prev= - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi # test -n "$prev" - - prevarg="$arg" - - case $arg in - -all-static) - if test -n "$link_static_flag"; then - compile_command="$compile_command $link_static_flag" - finalize_command="$finalize_command $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 - continue - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: more than one -exported-symbols argument is not allowed" - exit $EXIT_FAILURE - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -framework|-arch|-isysroot) - case " $CC " in - *" ${arg} ${1} "* | *" ${arg} ${1} "*) - prev=darwin_framework_skip ;; - *) compiler_flags="$compiler_flags $arg" - prev=darwin_framework ;; - esac - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - continue - ;; - - -inst-prefix-dir) - prev=inst_prefix - continue - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix* | /*-*-irix*) - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - ;; - esac - continue - ;; - - -L*) - dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 - absdir="$dir" - notinst_path="$notinst_path $dir" - fi - dir="$absdir" - ;; - esac - case "$deplibs " in - *" -L$dir "*) ;; - *) - deplibs="$deplibs -L$dir" - lib_search_path="$lib_search_path $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$dir:"*) ;; - *) dllsearchpath="$dllsearchpath:$dir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - *) dllsearchpath="$dllsearchpath:$testbindir";; - esac - ;; - esac - continue - ;; - - -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - deplibs="$deplibs -framework System" - continue - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - test "X$arg" = "X-lc" && continue - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - test "X$arg" = "X-lc" && continue - ;; - esac - elif test "X$arg" = "X-lc_r"; then - case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac - fi - deplibs="$deplibs $arg" - continue - ;; - - # Tru64 UNIX uses -model [arg] to determine the layout of C++ - # classes, name mangling, and exception handling. - -model) - compile_command="$compile_command $arg" - compiler_flags="$compiler_flags $arg" - finalize_command="$finalize_command $arg" - prev=xcompiler - continue - ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) - compiler_flags="$compiler_flags $arg" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - continue - ;; - - -module) - module=yes - continue - ;; - - # -64, -mips[0-9] enable 64-bit mode on the SGI compiler - # -r[0-9][0-9]* specifies the processor on the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler - # +DA*, +DD* enable 64-bit mode on the HP compiler - # -q* pass through compiler args for the IBM compiler - # -m* pass through architecture-specific compiler args for GCC - # -m*, -t[45]*, -txscale* pass through architecture-specific - # compiler args for GCC - # -pg pass through profiling flag for GCC - # @file GCC response files - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ - -t[45]*|-txscale*|@*) - - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - compiler_flags="$compiler_flags $arg" - continue - ;; - - -shrext) - prev=shrext - continue - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - # The PATH hackery in wrapper scripts is required on Windows - # in order for the loader to find any dlls it needs. - $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 - $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -objectlist) - prev=objectlist - continue - ;; - - -o) prev=output ;; - - -precious-files-regex) - prev=precious_regex - continue - ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit $EXIT_FAILURE - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - continue - ;; - - -static) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - -version-number) - prev=vinfo - vinfo_number=yes - continue - ;; - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Wl,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $wl$flag" - linker_flags="$linker_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - -XCClinker) - prev=xcclinker - continue - ;; - - # Some other compiler flag. - -* | +*) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - - *.$objext) - # A standard object. - objs="$objs $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit $EXIT_FAILURE - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$libobjs $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects="$non_pic_objects $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit $EXIT_FAILURE - else - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - fi - ;; - - *.$libext) - # An archive. - deplibs="$deplibs $arg" - old_deplibs="$old_deplibs $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - dlfiles="$dlfiles $arg" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - dlprefiles="$dlprefiles $arg" - prev= - else - deplibs="$deplibs $arg" - fi - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - done # argument parsing loop - - if test -n "$prev"; then - $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` - libobjs_save="$libobjs" - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` - if test "X$output_objdir" = "X$output"; then - output_objdir="$objdir" - else - output_objdir="$output_objdir/$objdir" - fi - # Create the object directory. - if test ! -d "$output_objdir"; then - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then - exit $exit_status - fi - fi - - # Determine the type of output - case $output in - "") - $echo "$modename: you must specify an output file" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) linkmode=prog ;; # Anything else should be a program. - esac - - case $host in - *cygwin* | *mingw* | *pw32*) - # don't eliminate duplications in $postdeps and $predeps - duplicate_compiler_generated_deps=yes - ;; - *) - duplicate_compiler_generated_deps=$duplicate_deps - ;; - esac - specialdeplibs= - - libs= - # Find all interdependent deplibs by searching for libraries - # that are linked more than once (e.g. -la -lb -la) - for deplib in $deplibs; do - if test "X$duplicate_deps" = "Xyes" ; then - case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - libs="$libs $deplib" - done - - if test "$linkmode" = lib; then - libs="$predeps $libs $compiler_lib_search_path $postdeps" - - # Compute libraries that are listed more than once in $predeps - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= - if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; - esac - pre_post_deps="$pre_post_deps $pre_post_dep" - done - fi - pre_post_deps= - fi - - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - case $linkmode in - lib) - passes="conv link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 - exit $EXIT_FAILURE - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=no - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - for pass in $passes; do - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" - deplibs= - fi - if test "$linkmode" = prog; then - case $pass in - dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; - esac - fi - if test "$pass" = dlopen; then - # Collect dlpreopened libraries - save_deplibs="$deplibs" - deplibs= - fi - for deplib in $libs; do - lib= - found=no - case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - compiler_flags="$compiler_flags $deplib" - fi - continue - ;; - -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 - continue - fi - name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` - for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do - for search_ext in .la $std_shrext .so .a; do - # Search the libtool library - lib="$searchdir/lib${name}${search_ext}" - if test -f "$lib"; then - if test "$search_ext" = ".la"; then - found=yes - else - found=no - fi - break 2 - fi - done - done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - else # deplib is a libtool library - # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, - # We need to do some special things here, and not later. - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $deplib "*) - if (${SED} -e '2q' $lib | - grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - library_names= - old_library= - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - for l in $old_library $library_names; do - ll="$l" - done - if test "X$ll" = "X$old_library" ; then # only static version available - found=no - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - fi - ;; - *) ;; - esac - fi - fi - ;; # -l - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - prog) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test "$pass" = scan; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - *) - $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test "$pass" = link; then - dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) lib="$deplib" ;; - *.$libext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - valid_a_lib=no - case $deplibs_check_method in - match_pattern*) - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - if eval $echo \"$deplib\" 2>/dev/null \ - | $SED 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=yes - fi - ;; - pass_all) - valid_a_lib=yes - ;; - esac - if test "$valid_a_lib" != yes; then - $echo - $echo "*** Warning: Trying to link with static lib archive $deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because the file extensions .$libext of this argument makes me believe" - $echo "*** that it is just a static archive that I should not used here." - else - $echo - $echo "*** Warning: Linking the shared library $output against the" - $echo "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - continue - ;; - prog) - if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - newdlprefiles="$newdlprefiles $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - newdlfiles="$newdlfiles $deplib" - fi - fi - continue - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - if test "$found" = yes || test -f "$lib"; then : - else - $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 - exit $EXIT_FAILURE - fi - - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - # If the library was installed with an old release of libtool, - # it will not redefine variables installed, or shouldnotlink - installed=yes - shouldnotlink=no - avoidtemprpath= - - - # Read the .la file - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" - fi - - if test "$pass" = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - # It is a libtool convenience library, so add in its objects. - convenience="$convenience $ladir/$objdir/$old_library" - old_convenience="$old_convenience $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - elif test "$linkmode" != prog && test "$linkmode" != lib; then - $echo "$modename: \`$lib' is not a convenience library" 1>&2 - exit $EXIT_FAILURE - fi - continue - fi # $pass = conv - - - # Get the name of the library we link against. - linklib= - for l in $old_library $library_names; do - linklib="$l" - done - if test -z "$linklib"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - - # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - if test -z "$dlname" || - test "$dlopen_support" != yes || - test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking - # statically, we need to preload. We also need to preload any - # dependent libraries so libltdl's deplib preloader doesn't - # bomb out in the load deplibs phase. - dlprefiles="$dlprefiles $lib $dependency_libs" - else - newdlfiles="$newdlfiles $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 - abs_ladir="$ladir" - fi - ;; - esac - laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - - # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then - if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - $echo "$modename: warning: library \`$lib' was moved." 1>&2 - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$libdir" - absdir="$libdir" - fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes - else - if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir="$ladir" - absdir="$abs_ladir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - fi - fi # $installed = yes - name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - - # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - newdlprefiles="$newdlprefiles $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - newdlprefiles="$newdlprefiles $dir/$dlname" - else - newdlprefiles="$newdlprefiles $dir/$linklib" - fi - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test "$linkmode" = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" # used for prog,scan pass - fi - continue - fi - - - if test "$linkmode" = prog && test "$pass" != link; then - newlib_search_path="$newlib_search_path $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test - esac - # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - if test "$linkmode,$pass" = "prog,link"; then - if test -n "$library_names" && - { test "$prefer_static_libs" = no || test -z "$old_library"; }; then - # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath " in - *" $dir "*) ;; - *" $absdir "*) ;; - *) temp_rpath="$temp_rpath $absdir" ;; - esac - fi - - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - fi - - link_static=no # Whether the deplib will be linked statically - use_static_libs=$prefer_static_libs - if test "$use_static_libs" = built && test "$installed" = yes ; then - use_static_libs=no - fi - if test -n "$library_names" && - { test "$use_static_libs" = no || test -z "$old_library"; }; then - if test "$installed" = no; then - notinst_deplibs="$notinst_deplibs $lib" - need_relink=yes - fi - # This is a shared library - - # Warn about portability, can't link against -module's on - # some systems (darwin) - if test "$shouldnotlink" = yes && test "$pass" = link ; then - $echo - if test "$linkmode" = prog; then - $echo "*** Warning: Linking the executable $output against the loadable module" - else - $echo "*** Warning: Linking the shared library $output against the loadable module" - fi - $echo "*** $linklib is not portable!" - fi - if test "$linkmode" = lib && - test "$hardcode_into_libs" = yes; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - realname="$2" - shift; shift - libname=`eval \\$echo \"$libname_spec\"` - # use dlname if we got it. it's perfectly good, no? - if test -n "$dlname"; then - soname="$dlname" - elif test -n "$soname_spec"; then - # bleh windows - case $host in - *cygwin* | mingw*) - major=`expr $current - $age` - versuffix="-$major" - ;; - esac - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" - soname=`$echo $soroot | ${SED} -e 's/^.*\///'` - newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - $show "extracting exported symbol list from \`$soname'" - save_ifs="$IFS"; IFS='~' - cmds=$extract_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - $show "generating import library for \`$soname'" - save_ifs="$IFS"; IFS='~' - cmds=$old_archive_from_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n "$old_archive_from_expsyms_cmds" - - if test "$linkmode" = prog || test "$mode" != relink; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" - case $host in - *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; - *-*-sysv4*uw2*) add_dir="-L$dir" ;; - *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir="-L$dir" ;; - *-*-darwin* ) - # if the lib is a module then we can not link against - # it, someone is ignoring the new warnings I added - if /usr/bin/file -L $add 2> /dev/null | - $EGREP ": [^:]* bundle" >/dev/null ; then - $echo "** Warning, lib $linklib is a module, not a shared library" - if test -z "$old_library" ; then - $echo - $echo "** And there doesn't seem to be a static archive available" - $echo "** The link will probably fail, sorry" - else - add="$dir/$old_library" - fi - fi - esac - elif test "$hardcode_minus_L" = no; then - case $host in - *-*-sunos*) add_shlibpath="$dir" ;; - esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - relink) - if test "$hardcode_direct" = yes; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - $echo "$modename: configuration error: unsupported hardcode properties" - exit $EXIT_FAILURE - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; - esac - fi - if test "$linkmode" = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && \ - test "$hardcode_minus_L" != yes && \ - test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - fi - fi - fi - - if test "$linkmode" = prog || test "$mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - add="-l$name" - elif test "$hardcode_automatic" = yes; then - if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib" ; then - add="$inst_prefix_dir$libdir/$linklib" - else - add="$libdir/$linklib" - fi - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - fi - - if test "$linkmode" = prog; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test "$linkmode" = prog; then - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test "$build_libtool_libs" = yes; then - # Not a shared library - if test "$deplibs_check_method" != pass_all; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - $echo - $echo "*** Warning: This system can not link to static lib archive $lib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then - $echo "*** But as you try to build a module library, libtool will still create " - $echo "*** a static module, that should work as long as the dlopening application" - $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." - if test -z "$global_symbol_pipe"; then - $echo - $echo "*** However, this would only work if libtool was able to extract symbol" - $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - $echo "*** not find such a program. So, this module is probably useless." - $echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test "$linkmode" = lib; then - if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || - test "$build_old_libs" = yes || - test "$link_static" = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; - esac;; - *) temp_deplibs="$temp_deplibs $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - newlib_search_path="$newlib_search_path $absdir" - # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - - if test "$link_all_deplibs" != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - case $deplib in - -L*) path="$deplib" ;; - *.la) - dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$deplib" && dir="." - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 - absdir="$dir" - fi - ;; - esac - if grep "^installed=no" $deplib > /dev/null; then - path="$absdir/$objdir" - else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - if test "$absdir" != "$libdir"; then - $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 - fi - path="$absdir" - fi - depdepl= - case $host in - *-*-darwin*) - # we do not want to link against static libs, - # but need to link against shared - eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names" ; then - for tmp in $deplibrary_names ; do - depdepl=$tmp - done - if test -f "$path/$depdepl" ; then - depdepl="$path/$depdepl" - fi - # do not add paths which are already there - case " $newlib_search_path " in - *" $path "*) ;; - *) newlib_search_path="$newlib_search_path $path";; - esac - fi - path="" - ;; - *) - path="-L$path" - ;; - esac - ;; - -l*) - case $host in - *-*-darwin*) - # Again, we only want to link against shared libraries - eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` - for tmp in $newlib_search_path ; do - if test -f "$tmp/lib$tmp_libs.dylib" ; then - eval depdepl="$tmp/lib$tmp_libs.dylib" - break - fi - done - path="" - ;; - *) continue ;; - esac - ;; - *) continue ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$path $deplibs" ;; - esac - case " $deplibs " in - *" $depdepl "*) ;; - *) deplibs="$depdepl $deplibs" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir" ;; - esac - done - newlib_search_path= - fi - - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else - vars="compile_deplibs finalize_deplibs" - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; - *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - # Last step: remove runtime libs from dependency_libs - # (they stay in deplibs) - tmp_libs= - for i in $dependency_libs ; do - case " $predeps $postdeps $compiler_lib_search_path " in - *" $i "*) - i="" - ;; - esac - if test -n "$i" ; then - tmp_libs="$tmp_libs $i" - fi - done - dependency_libs=$tmp_libs - done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 - fi - - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 - fi - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - objs="$objs$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form `libNAME.la'. - case $outputname in - lib*) - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - ;; - *) - if test "$module" = no; then - $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - else - libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - fi - ;; - esac - - if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 - exit $EXIT_FAILURE - else - $echo - $echo "*** Warning: Linking the shared library $output against the non-libtool" - $echo "*** objects $objs is not portable!" - libobjs="$libobjs $objs" - fi - fi - - if test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 - fi - - set dummy $rpath - if test "$#" -gt 2; then - $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 - fi - install_libdir="$2" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so - # convenience libraries should have the same extension an - # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 - fi - else - - # Parse the version information argument. - save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - IFS="$save_ifs" - - if test -n "$8"; then - $echo "$modename: too many parameters to \`-version-info'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # convert absolute version numbers to libtool ages - # this retains compatibility with .la files and attempts - # to make the code below a bit more comprehensible - - case $vinfo_number in - yes) - number_major="$2" - number_minor="$3" - number_revision="$4" - # - # There are really only two kinds -- those that - # use the current revision as the major version - # and those that subtract age and use age as - # a minor version. But, then there is irix - # which has an extra 1 added just for fun - # - case $version_type in - darwin|linux|osf|windows) - current=`expr $number_major + $number_minor` - age="$number_minor" - revision="$number_revision" - ;; - freebsd-aout|freebsd-elf|sunos) - current="$number_major" - revision="$number_minor" - age="0" - ;; - irix|nonstopux) - current=`expr $number_major + $number_minor - 1` - age="$number_minor" - revision="$number_minor" - ;; - esac - ;; - no) - current="$2" - revision="$3" - age="$4" - ;; - esac - - # Check that each of the things are valid numbers. - case $current in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $revision in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $age in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - if test "$age" -gt "$current"; then - $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - minor_current=`expr $current + 1` - verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current"; - ;; - - irix | nonstopux) - major=`expr $current - $age + 1` - - case $version_type in - nonstopux) verstring_prefix=nonstopux ;; - *) verstring_prefix=sgi ;; - esac - verstring="$verstring_prefix$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test "$loop" -ne 0; do - iface=`expr $revision - $loop` - loop=`expr $loop - 1` - verstring="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - ;; - - osf) - major=.`expr $current - $age` - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test "$loop" -ne 0; do - iface=`expr $current - $loop` - loop=`expr $loop - 1` - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - verstring="$verstring:${current}.0" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - major=`expr $current - $age` - versuffix="-$major" - ;; - - *) - $echo "$modename: unknown library version type \`$version_type'" 1>&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely - verstring= - ;; - *) - verstring="0.0" - ;; - esac - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - fi - - if test "$mode" != relink; then - # Remove our outputs, but don't remove object files since they - # may have been created when compiling PIC objects. - removelist= - tempremovelist=`$echo "$output_objdir/*"` - for p in $tempremovelist; do - case $p in - *.$objext) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - if test "X$precious_files_regex" != "X"; then - if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 - then - continue - fi - fi - removelist="$removelist $p" - ;; - *) ;; - esac - done - if test -n "$removelist"; then - $show "${rm}r $removelist" - $run ${rm}r $removelist - fi - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - for path in $notinst_path; do - lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` - deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` - dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` - done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - temp_xrpath="$temp_xrpath -R$libdir" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) dlfiles="$dlfiles $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) dlprefiles="$dlprefiles $lib" ;; - esac - done - - if test "$build_libtool_libs" = yes; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - deplibs="$deplibs -framework System" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then - deplibs="$deplibs -lc" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behavior. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $rm conftest.c - cat > conftest.c </dev/null` - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null \ - | grep " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ - | ${SED} 10q \ - | $EGREP "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $echo - $echo "*** Warning: linker path does not have real file for library $a_deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $echo "*** with $libname but no candidates were found. (...for file magic test)" - else - $echo "*** with $libname and none of the candidates passed a file format test" - $echo "*** using a file magic. Last file checked: $potlib" - fi - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - for a_deplib in $deplibs; do - name=`expr $a_deplib : '-l\(.*\)'` - # If $name is empty we are operating on a -L argument. - if test -n "$name" && test "$name" != "0"; then - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - ;; - esac - fi - if test -n "$a_deplib" ; then - libname=`eval \\$echo \"$libname_spec\"` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - potlib="$potent_lib" # see symlink-check above in file_magic test - if eval $echo \"$potent_lib\" 2>/dev/null \ - | ${SED} 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $echo - $echo "*** Warning: linker path does not have real file for library $a_deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $echo "*** with $libname but no candidates were found. (...for regex pattern test)" - else - $echo "*** with $libname and none of the candidates passed a file format test" - $echo "*** using a regex pattern. Last file checked: $potlib" - fi - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ - -e 's/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` - done - fi - if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ - | grep . >/dev/null; then - $echo - if test "X$deplibs_check_method" = "Xnone"; then - $echo "*** Warning: inter-library dependencies are not supported in this platform." - else - $echo "*** Warning: inter-library dependencies are not known to be supported." - fi - $echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - fi - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - $echo - $echo "*** Warning: libtool could not satisfy all declared inter-library" - $echo "*** dependencies of module $libname. Therefore, libtool will create" - $echo "*** a static module, that should work as long as the dlopening" - $echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - $echo - $echo "*** However, this would only work if libtool was able to extract symbol" - $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - $echo "*** not find such a program. So, this module is probably useless." - $echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - $echo "*** The inter-library dependencies that have been dropped here will be" - $echo "*** automatically added whenever a program is linked with this library" - $echo "*** or is declared to -dlopen it." - - if test "$allow_undefined" = no; then - $echo - $echo "*** Since this library must not contain undefined symbols," - $echo "*** because either the platform does not support them or" - $echo "*** it was explicitly requested with -no-undefined," - $echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $deplibs " in - *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; - esac - ;; - *) new_libs="$new_libs $deplib" ;; - esac - done - deplibs="$new_libs" - - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - if test "$hardcode_into_libs" = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath="$finalize_shlibpath" - test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi - - # Get the real and link names of the library. - eval shared_ext=\"$shrext_cmds\" - eval library_names=\"$library_names_spec\" - set dummy $library_names - realname="$2" - shift; shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - if test -z "$dlname"; then - dlname=$soname - fi - - lib="$output_objdir/$realname" - linknames= - for link - do - linknames="$linknames $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - if len=`expr "X$cmd" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - $show "$cmd" - $run eval "$cmd" || exit $? - skipped_export=false - else - # The command line is too long to execute in one step. - $show "using reloadable object file for export list..." - skipped_export=: - # Break out early, otherwise skipped_export may be - # set to false by a later but shorter cmd. - break - fi - done - IFS="$save_ifs" - if test -n "$export_symbols_regex"; then - $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" - $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - $show "$mv \"${export_symbols}T\" \"$export_symbols\"" - $run eval '$mv "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' - fi - - tmp_deplibs= - for test_deplib in $deplibs; do - case " $convenience " in - *" $test_deplib "*) ;; - *) - tmp_deplibs="$tmp_deplibs $test_deplib" - ;; - esac - done - deplibs="$tmp_deplibs" - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - libobjs="$libobjs $func_extract_archives_result" - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - linker_flags="$linker_flags $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval test_cmds=\"$module_expsym_cmds\" - cmds=$module_expsym_cmds - else - eval test_cmds=\"$module_cmds\" - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval test_cmds=\"$archive_expsym_cmds\" - cmds=$archive_expsym_cmds - else - eval test_cmds=\"$archive_cmds\" - cmds=$archive_cmds - fi - fi - - if test "X$skipped_export" != "X:" && - len=`expr "X$test_cmds" : ".*" 2>/dev/null` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # The command line is too long to link in one step, link piecewise. - $echo "creating reloadable object files..." - - # Save the value of $output and $libobjs because we want to - # use them later. If we have whole_archive_flag_spec, we - # want to use save_libobjs as it was before - # whole_archive_flag_spec was expanded, because we can't - # assume the linker understands whole_archive_flag_spec. - # This may have to be revisited, in case too many - # convenience libraries get linked in and end up exceeding - # the spec. - if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - fi - save_output=$output - output_la=`$echo "X$output" | $Xsed -e "$basename"` - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - delfiles= - last_robj= - k=1 - output=$output_objdir/$output_la-${k}.$objext - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - eval test_cmds=\"$reload_cmds $objlist $last_robj\" - if test "X$objlist" = X || - { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && - test "$len" -le "$max_cmd_len"; }; then - objlist="$objlist $obj" - else - # The command $test_cmds is almost too long, add a - # command to the queue. - if test "$k" -eq 1 ; then - # The first file doesn't have a previous command to add. - eval concat_cmds=\"$reload_cmds $objlist $last_robj\" - else - # All subsequent reloadable object files will link in - # the last one created. - eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" - fi - last_robj=$output_objdir/$output_la-${k}.$objext - k=`expr $k + 1` - output=$output_objdir/$output_la-${k}.$objext - objlist=$obj - len=1 - fi - done - # Handle the remaining objects by creating one last - # reloadable object file. All subsequent reloadable object - # files will link in the last one created. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" - - if ${skipped_export-false}; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - libobjs=$output - # Append the command to create the export file. - eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" - fi - - # Set up a command to remove the reloadable object files - # after they are used. - i=0 - while test "$i" -lt "$k" - do - i=`expr $i + 1` - delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" - done - - $echo "creating a temporary reloadable object file: $output" - - # Loop through the commands generated above and execute them. - save_ifs="$IFS"; IFS='~' - for cmd in $concat_cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - libobjs=$output - # Restore the value of output. - output=$save_output - - if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - cmds=$module_expsym_cmds - else - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - cmds=$archive_expsym_cmds - else - cmds=$archive_cmds - fi - fi - - # Append the command to remove the reloadable object files - # to the just-reset $cmds. - eval cmds=\"\$cmds~\$rm $delfiles\" - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? - - if test -n "$convenience"; then - if test -z "$whole_archive_flag_spec"; then - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - fi - fi - - exit $EXIT_SUCCESS - fi - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - obj) - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 - fi - - case $output in - *.lo) - if test -n "$objs$old_deplibs"; then - $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 - exit $EXIT_FAILURE - fi - libobj="$output" - obj=`$echo "X$output" | $Xsed -e "$lo2o"` - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $run $rm $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${obj}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" - cmds=$reload_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit $EXIT_SUCCESS - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - # $show "echo timestamp > $libobj" - # $run eval "echo timestamp > $libobj" || exit $? - exit $EXIT_SUCCESS - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - cmds=$reload_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit $EXIT_SUCCESS - ;; - - prog) - case $host in - *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; - esac - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 - fi - - if test "$preload" = yes; then - if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && - test "$dlopen_self_static" = unknown; then - $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." - fi - fi - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - case $host in - *darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - if test "$tagname" = CXX ; then - compile_command="$compile_command ${wl}-bind_at_load" - finalize_command="$finalize_command ${wl}-bind_at_load" - fi - ;; - esac - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $compile_deplibs " in - *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $compile_deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; - esac - ;; - *) new_libs="$new_libs $deplib" ;; - esac - done - compile_deplibs="$new_libs" - - - compile_command="$compile_command $compile_deplibs" - finalize_command="$finalize_command $finalize_deplibs" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$libdir:"*) ;; - *) dllsearchpath="$dllsearchpath:$libdir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - *) dllsearchpath="$dllsearchpath:$testbindir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - fi - - dlsyms= - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - dlsyms="${outputname}S.c" - else - $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 - fi - fi - - if test -n "$dlsyms"; then - case $dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${outputname}.nm" - - $show "$rm $nlist ${nlist}S ${nlist}T" - $run $rm "$nlist" "${nlist}S" "${nlist}T" - - # Parse the name list into a source file. - $show "creating $output_objdir/$dlsyms" - - test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ -/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ -/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -/* Prevent the only kind of declaration conflicts we can make. */ -#define lt_preloaded_symbols some_other_symbol - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - $show "generating symbol list for \`$output'" - - test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - for arg in $progfiles; do - $show "extracting global C symbols from \`$arg'" - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - if test -n "$export_symbols_regex"; then - $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$outputname.exp" - $run $rm $export_symbols - $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - case $host in - *cygwin* | *mingw* ) - $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' - ;; - esac - else - $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' - $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' - $run eval 'mv "$nlist"T "$nlist"' - case $host in - *cygwin* | *mingw* ) - $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' - ;; - esac - fi - fi - - for arg in $dlprefiles; do - $show "extracting global C symbols from \`$arg'" - name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` - $run eval '$echo ": $name " >> "$nlist"' - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -z "$run"; then - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $mv "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if grep -v "^: " < "$nlist" | - if sort -k 3 /dev/null 2>&1; then - sort -k 3 - else - sort +2 - fi | - uniq > "$nlist"S; then - : - else - grep -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' - else - $echo '/* NONE */' >> "$output_objdir/$dlsyms" - fi - - $echo >> "$output_objdir/$dlsyms" "\ - -#undef lt_preloaded_symbols - -#if defined (__STDC__) && __STDC__ -# define lt_ptr void * -#else -# define lt_ptr char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -" - - case $host in - *cygwin* | *mingw* ) - $echo >> "$output_objdir/$dlsyms" "\ -/* DATA imports from DLLs on WIN32 can't be const, because - runtime relocations are performed -- see ld's documentation - on pseudo-relocs */ -struct { -" - ;; - * ) - $echo >> "$output_objdir/$dlsyms" "\ -const struct { -" - ;; - esac - - - $echo >> "$output_objdir/$dlsyms" "\ - const char *name; - lt_ptr address; -} -lt_preloaded_symbols[] = -{\ -" - - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" - - $echo >> "$output_objdir/$dlsyms" "\ - {0, (lt_ptr) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - fi - - pic_flag_for_symtable= - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; - esac;; - *-*-hpux*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag";; - esac - esac - - # Now compile the dynamic symbol file. - $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" - $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? - - # Clean up the generated files. - $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" - $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" - - # Transform the symbol file into the correct name. - case $host in - *cygwin* | *mingw* ) - if test -f "$output_objdir/${outputname}.def" ; then - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` - else - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - fi - ;; - * ) - compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` - ;; - esac - ;; - *) - $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 - exit $EXIT_FAILURE - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` - fi - - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - $show "$link_command" - $run eval "$link_command" - exit_status=$? - - # Delete the generated files. - if test -n "$dlsyms"; then - $show "$rm $output_objdir/${outputname}S.${objext}" - $run $rm "$output_objdir/${outputname}S.${objext}" - fi - - exit $exit_status - fi - - if test -n "$shlibpath_var"; then - # We should set the shlibpath_var - rpath= - for dir in $temp_rpath; do - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) - # Absolute path. - rpath="$rpath$dir:" - ;; - *) - # Relative path: add a thisdir entry. - rpath="$rpath\$thisdir/$dir:" - ;; - esac - done - temp_rpath="$rpath" - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$no_install" = yes; then - # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $run $rm $output - # Link the executable and exit - $show "$link_command" - $run eval "$link_command" || exit $? - exit $EXIT_SUCCESS - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 - $echo "$modename: \`$output' will be relinked during installation" 1>&2 - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname - - $show "$link_command" - $run eval "$link_command" || exit $? - - # Now create the wrapper script. - $show "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - fi - - # Quote $echo for shipping. - if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then - case $progpath in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; - *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; - esac - qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` - fi - - # Only actually do things if our run command is non-null. - if test -z "$run"; then - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) - exeext=.exe - outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; - *) exeext= ;; - esac - case $host in - *cygwin* | *mingw* ) - output_name=`basename $output` - output_path=`dirname $output` - cwrappersource="$output_path/$objdir/lt-$output_name.c" - cwrapper="$output_path/$output_name.exe" - $rm $cwrappersource $cwrapper - trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 - - cat > $cwrappersource <> $cwrappersource<<"EOF" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined(PATH_MAX) -# define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#ifndef DIR_SEPARATOR -# define DIR_SEPARATOR '/' -# define PATH_SEPARATOR ':' -#endif - -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) -# define HAVE_DOS_BASED_FILE_SYSTEM -# ifndef DIR_SEPARATOR_2 -# define DIR_SEPARATOR_2 '\\' -# endif -# ifndef PATH_SEPARATOR_2 -# define PATH_SEPARATOR_2 ';' -# endif -#endif - -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -#ifndef PATH_SEPARATOR_2 -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) -#else /* PATH_SEPARATOR_2 */ -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) -#endif /* PATH_SEPARATOR_2 */ - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ -} while (0) - -/* -DDEBUG is fairly common in CFLAGS. */ -#undef DEBUG -#if defined DEBUGWRAPPER -# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) -#else -# define DEBUG(format, ...) -#endif - -const char *program_name = NULL; - -void * xmalloc (size_t num); -char * xstrdup (const char *string); -const char * base_name (const char *name); -char * find_executable(const char *wrapper); -int check_executable(const char *path); -char * strendzap(char *str, const char *pat); -void lt_fatal (const char *message, ...); - -int -main (int argc, char *argv[]) -{ - char **newargz; - int i; - - program_name = (char *) xstrdup (base_name (argv[0])); - DEBUG("(main) argv[0] : %s\n",argv[0]); - DEBUG("(main) program_name : %s\n",program_name); - newargz = XMALLOC(char *, argc+2); -EOF - - cat >> $cwrappersource <> $cwrappersource <<"EOF" - newargz[1] = find_executable(argv[0]); - if (newargz[1] == NULL) - lt_fatal("Couldn't find %s", argv[0]); - DEBUG("(main) found exe at : %s\n",newargz[1]); - /* we know the script has the same name, without the .exe */ - /* so make sure newargz[1] doesn't end in .exe */ - strendzap(newargz[1],".exe"); - for (i = 1; i < argc; i++) - newargz[i+1] = xstrdup(argv[i]); - newargz[argc+1] = NULL; - - for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" - return 127; -} - -void * -xmalloc (size_t num) -{ - void * p = (void *) malloc (num); - if (!p) - lt_fatal ("Memory exhausted"); - - return p; -} - -char * -xstrdup (const char *string) -{ - return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL -; -} - -const char * -base_name (const char *name) -{ - const char *base; - -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - /* Skip over the disk name in MSDOS pathnames. */ - if (isalpha ((unsigned char)name[0]) && name[1] == ':') - name += 2; -#endif - - for (base = name; *name; name++) - if (IS_DIR_SEPARATOR (*name)) - base = name + 1; - return base; -} - -int -check_executable(const char * path) -{ - struct stat st; - - DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); - if ((!path) || (!*path)) - return 0; - - if ((stat (path, &st) >= 0) && - ( - /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ -#if defined (S_IXOTH) - ((st.st_mode & S_IXOTH) == S_IXOTH) || -#endif -#if defined (S_IXGRP) - ((st.st_mode & S_IXGRP) == S_IXGRP) || -#endif - ((st.st_mode & S_IXUSR) == S_IXUSR)) - ) - return 1; - else - return 0; -} - -/* Searches for the full path of the wrapper. Returns - newly allocated full path name if found, NULL otherwise */ -char * -find_executable (const char* wrapper) -{ - int has_slash = 0; - const char* p; - const char* p_next; - /* static buffer for getcwd */ - char tmp[LT_PATHMAX + 1]; - int tmp_len; - char* concat_name; - - DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); - - if ((wrapper == NULL) || (*wrapper == '\0')) - return NULL; - - /* Absolute path? */ -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') - { - concat_name = xstrdup (wrapper); - if (check_executable(concat_name)) - return concat_name; - XFREE(concat_name); - } - else - { -#endif - if (IS_DIR_SEPARATOR (wrapper[0])) - { - concat_name = xstrdup (wrapper); - if (check_executable(concat_name)) - return concat_name; - XFREE(concat_name); - } -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - } -#endif - - for (p = wrapper; *p; p++) - if (*p == '/') - { - has_slash = 1; - break; - } - if (!has_slash) - { - /* no slashes; search PATH */ - const char* path = getenv ("PATH"); - if (path != NULL) - { - for (p = path; *p; p = p_next) - { - const char* q; - size_t p_len; - for (q = p; *q; q++) - if (IS_PATH_SEPARATOR(*q)) - break; - p_len = q - p; - p_next = (*q == '\0' ? q : q + 1); - if (p_len == 0) - { - /* empty path: current directory */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); - tmp_len = strlen(tmp); - concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - } - else - { - concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); - memcpy (concat_name, p, p_len); - concat_name[p_len] = '/'; - strcpy (concat_name + p_len + 1, wrapper); - } - if (check_executable(concat_name)) - return concat_name; - XFREE(concat_name); - } - } - /* not found in PATH; assume curdir */ - } - /* Relative path | not found in path: prepend cwd */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); - tmp_len = strlen(tmp); - concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - - if (check_executable(concat_name)) - return concat_name; - XFREE(concat_name); - return NULL; -} - -char * -strendzap(char *str, const char *pat) -{ - size_t len, patlen; - - assert(str != NULL); - assert(pat != NULL); - - len = strlen(str); - patlen = strlen(pat); - - if (patlen <= len) - { - str += len - patlen; - if (strcmp(str, pat) == 0) - *str = '\0'; - } - return str; -} - -static void -lt_error_core (int exit_status, const char * mode, - const char * message, va_list ap) -{ - fprintf (stderr, "%s: %s: ", program_name, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, "FATAL", message, ap); - va_end (ap); -} -EOF - # we should really use a build-platform specific compiler - # here, but OTOH, the wrappers (shell script and this C one) - # are only useful if you want to execute the "real" binary. - # Since the "real" binary is built for $host, then this - # wrapper might as well be built for $host, too. - $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource - ;; - esac - $rm $output - trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 - - $echo > $output "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='${SED} -e 1s/^X//' -sed_quote_subst='$sed_quote_subst' - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variable: - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$echo are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - echo=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$echo works! - : - else - # Restart under the correct shell, and then maybe \$echo will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ -" - $echo >> $output "\ - - # Find the directory that this script lives in. - thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` - done - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - $echo >> $output "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || \\ - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $mkdir \"\$progdir\" - else - $rm \"\$progdir/\$file\" - fi" - - $echo >> $output "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - $echo \"\$relink_command_output\" >&2 - $rm \"\$progdir/\$file\" - exit $EXIT_FAILURE - fi - fi - - $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $rm \"\$progdir/\$program\"; - $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $rm \"\$progdir/\$file\" - fi" - else - $echo >> $output "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $echo >> $output "\ - - if test -f \"\$progdir/\$program\"; then" - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $echo >> $output "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` - - export $shlibpath_var -" - fi - - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $echo >> $output "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - $echo >> $output "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2*) - $echo >> $output "\ - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $echo >> $output "\ - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $echo >> $output "\ - \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" - exit $EXIT_FAILURE - fi - else - # The program doesn't exist. - \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 - \$echo \"This script is just a wrapper for \$program.\" 1>&2 - $echo \"See the $PACKAGE documentation for more information.\" 1>&2 - exit $EXIT_FAILURE - fi -fi\ -" - chmod +x $output - fi - exit $EXIT_SUCCESS - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$old_deplibs $non_pic_objects" - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $addlibs - oldobjs="$oldobjs $func_extract_archives_result" - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - cmds=$old_archive_from_new_cmds - else - # POSIX demands no paths to be encoded in archives. We have - # to avoid creating archives with duplicate basenames if we - # might have to extract them afterwards, e.g., when creating a - # static archive out of a convenience library, or when linking - # the entirety of a libtool archive into another (currently - # not supported by libtool). - if (for obj in $oldobjs - do - $echo "X$obj" | $Xsed -e 's%^.*/%%' - done | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "copying selected object files to avoid basename conflicts..." - - if test -z "$gentop"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "$mkdir $gentop" - $run $mkdir "$gentop" - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "$gentop"; then - exit $exit_status - fi - fi - - save_oldobjs=$oldobjs - oldobjs= - counter=1 - for obj in $save_oldobjs - do - objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - case " $oldobjs " in - " ") oldobjs=$obj ;; - *[\ /]"$objbase "*) - while :; do - # Make sure we don't pick an alternate name that also - # overlaps. - newobj=lt$counter-$objbase - counter=`expr $counter + 1` - case " $oldobjs " in - *[\ /]"$newobj "*) ;; - *) if test ! -f "$gentop/$newobj"; then break; fi ;; - esac - done - $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - $run ln "$obj" "$gentop/$newobj" || - $run cp "$obj" "$gentop/$newobj" - oldobjs="$oldobjs $gentop/$newobj" - ;; - *) oldobjs="$oldobjs $obj" ;; - esac - done - fi - - eval cmds=\"$old_archive_cmds\" - - if len=`expr "X$cmds" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - cmds=$old_archive_cmds - else - # the command line is too long to link in one step, link in parts - $echo "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_oldobjs=$oldobjs - - # Is there a better way of finding the last object in the list? - for obj in $save_oldobjs - do - last_oldobj=$obj - done - for obj in $save_oldobjs - do - oldobjs="$objlist $obj" - objlist="$objlist $obj" - eval test_cmds=\"$old_archive_cmds\" - if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && - test "$len" -le "$max_cmd_len"; then - : - else - # the above command should be used before it gets too long - oldobjs=$objlist - if test "$obj" = "$last_oldobj" ; then - RANLIB=$save_RANLIB - fi - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" - objlist= - fi - done - RANLIB=$save_RANLIB - oldobjs=$objlist - if test "X$oldobjs" = "X" ; then - eval cmds=\"\$concat_cmds\" - else - eval cmds=\"\$concat_cmds~\$old_archive_cmds\" - fi - fi - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - eval cmd=\"$cmd\" - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$generated"; then - $show "${rm}r$generated" - $run ${rm}r$generated - fi - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - $show "creating $output" - - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` - if test "$hardcode_automatic" = yes ; then - relink_command= - fi - - - # Only create the output if not a dry run. - if test -z "$run"; then - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdependency_libs="$newdependency_libs $libdir/$name" - ;; - *) newdependency_libs="$newdependency_libs $deplib" ;; - esac - done - dependency_libs="$newdependency_libs" - newdlfiles= - for lib in $dlfiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdlfiles="$newdlfiles $libdir/$name" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdlprefiles="$newdlprefiles $libdir/$name" - done - dlprefiles="$newdlprefiles" - else - newdlfiles= - for lib in $dlfiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlfiles="$newdlfiles $abs" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlprefiles="$newdlprefiles $abs" - done - dlprefiles="$newdlprefiles" - fi - $rm $output - # place dlname in correct position for cygwin - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; - esac - $echo > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Should we warn about portability when linking against -modules? -shouldnotlink=$module - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then - $echo >> $output "\ -relink_command=\"$relink_command\"" - fi - done - fi - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" - $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? - ;; - esac - exit $EXIT_SUCCESS - ;; - - # libtool install mode - install) - modename="$modename: install" - - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || - # Allow the use of GNU shtool's install command. - $echo "X$nonopt" | grep shtool > /dev/null; then - # Aesthetically quote it. - arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$arg " - arg="$1" - shift - else - install_prog= - arg=$nonopt - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog$arg" - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - for arg - do - if test -n "$dest"; then - files="$files $dest" - dest=$arg - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) - case " $install_prog " in - *[\\\ /]cp\ *) ;; - *) prev=$arg ;; - esac - ;; - -g | -m | -o) prev=$arg ;; - -s) - stripme=" -s" - continue - ;; - -*) - ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - prev= - else - dest=$arg - continue - fi - ;; - esac - - # Aesthetically quote the argument. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog $arg" - done - - if test -z "$install_prog"; then - $echo "$modename: you must specify an install program" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test -n "$prev"; then - $echo "$modename: the \`$prev' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test -z "$files"; then - if test -z "$dest"; then - $echo "$modename: no file or destination specified" 1>&2 - else - $echo "$modename: you must specify a destination" 1>&2 - fi - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Strip any trailing slash from the destination. - dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` - test "X$destdir" = "X$dest" && destdir=. - destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` - - # Not a directory, so check to see that there is only one file specified. - set dummy $files - if test "$#" -gt 2; then - $echo "$modename: \`$dest' is not a directory" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - staticlibs="$staticlibs $file" - ;; - - *.la) - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - library_names= - old_library= - relink_command= - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; - esac - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ - test "X$dir" = "X$file/" && dir= - dir="$dir$objdir" - - if test -n "$relink_command"; then - # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that - # are installed to the same prefix. - # At present, this check doesn't affect windows .dll's that - # are installed into $libdir/../bin (currently, that works fine) - # but it's something to keep an eye on. - if test "$inst_prefix_dir" = "$destdir"; then - $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 - exit $EXIT_FAILURE - fi - - if test -n "$inst_prefix_dir"; then - # Stick the inst_prefix_dir data into the link command. - relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` - else - relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` - fi - - $echo "$modename: warning: relinking \`$file'" 1>&2 - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - exit $EXIT_FAILURE - fi - fi - - # See the names of the shared library. - set dummy $library_names - if test -n "$2"; then - realname="$2" - shift - shift - - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T - - # Install the shared library and build the symlinks. - $show "$install_prog $dir/$srcname $destdir/$realname" - $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? - if test -n "$stripme" && test -n "$striplib"; then - $show "$striplib $destdir/$realname" - $run eval "$striplib $destdir/$realname" || exit $? - fi - - if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. - # Try `ln -sf' first, because the `ln' binary might depend on - # the symlink we replace! Solaris /bin/ln does not understand -f, - # so we also need to try rm && ln -s. - for linkname - do - if test "$linkname" != "$realname"; then - $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" - $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" - fi - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - cmds=$postinstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - fi - - # Install the pseudo-library for information purposes. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - instname="$dir/$name"i - $show "$install_prog $instname $destdir/$name" - $run eval "$install_prog $instname $destdir/$name" || exit $? - - # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` - ;; - *.$objext) - staticdest="$destfile" - destfile= - ;; - *) - $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - # Install the libtool object if requested. - if test -n "$destfile"; then - $show "$install_prog $file $destfile" - $run eval "$install_prog $file $destfile" || exit $? - fi - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` - - $show "$install_prog $staticobj $staticdest" - $run eval "$install_prog \$staticobj \$staticdest" || exit $? - fi - exit $EXIT_SUCCESS - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # If the file is missing, and there is a .exe on the end, strip it - # because it is most likely a libtool script we actually want to - # install - stripped_ext="" - case $file in - *.exe) - if test ! -f "$file"; then - file=`$echo $file|${SED} 's,.exe$,,'` - stripped_ext=".exe" - fi - ;; - esac - - # Do a test to see if this is really a libtool program. - case $host in - *cygwin*|*mingw*) - wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` - ;; - *) - wrapper=$file - ;; - esac - if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then - notinst_deplibs= - relink_command= - - # Note that it is not necessary on cygwin/mingw to append a dot to - # foo even if both foo and FILE.exe exist: automatic-append-.exe - # behavior happens only for exec(3), not for open(2)! Also, sourcing - # `FILE.' does not work on cygwin managed mounts. - # - # If there is no directory component, then add one. - case $wrapper in - */* | *\\*) . ${wrapper} ;; - *) . ./${wrapper} ;; - esac - - # Check the variables that should have been set. - if test -z "$notinst_deplibs"; then - $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 - exit $EXIT_FAILURE - fi - - finalize=yes - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - # If there is no directory component, then add one. - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - fi - libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 - finalize=no - fi - done - - relink_command= - # Note that it is not necessary on cygwin/mingw to append a dot to - # foo even if both foo and FILE.exe exist: automatic-append-.exe - # behavior happens only for exec(3), not for open(2)! Also, sourcing - # `FILE.' does not work on cygwin managed mounts. - # - # If there is no directory component, then add one. - case $wrapper in - */* | *\\*) . ${wrapper} ;; - *) . ./${wrapper} ;; - esac - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - if test "$finalize" = yes && test -z "$run"; then - tmpdir=`func_mktempdir` - file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` - - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - ${rm}r "$tmpdir" - continue - fi - file="$outputname" - else - $echo "$modename: warning: cannot relink \`$file'" 1>&2 - fi - else - # Install the binary that we compiled earlier. - file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyway - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` - ;; - esac - ;; - esac - $show "$install_prog$stripme $file $destfile" - $run eval "$install_prog\$stripme \$file \$destfile" || exit $? - test -n "$outputname" && ${rm}r "$tmpdir" - ;; - esac - done - - for file in $staticlibs; do - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - - $show "$install_prog $file $oldlib" - $run eval "$install_prog \$file \$oldlib" || exit $? - - if test -n "$stripme" && test -n "$old_striplib"; then - $show "$old_striplib $oldlib" - $run eval "$old_striplib $oldlib" || exit $? - fi - - # Do each command in the postinstall commands. - cmds=$old_postinstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$future_libdirs"; then - $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 - fi - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - test -n "$run" && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' - else - exit $EXIT_SUCCESS - fi - ;; - - # libtool finish mode - finish) - modename="$modename: finish" - libdirs="$nonopt" - admincmds= - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - cmds=$finish_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || admincmds="$admincmds - $cmd" - done - IFS="$save_ifs" - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $run eval "$cmds" || admincmds="$admincmds - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - test "$show" = : && exit $EXIT_SUCCESS - - $echo "X----------------------------------------------------------------------" | $Xsed - $echo "Libraries have been installed in:" - for libdir in $libdirs; do - $echo " $libdir" - done - $echo - $echo "If you ever happen to want to link against installed libraries" - $echo "in a given directory, LIBDIR, you must either use libtool, and" - $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" - $echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - $echo " during execution" - fi - if test -n "$runpath_var"; then - $echo " - add LIBDIR to the \`$runpath_var' environment variable" - $echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - $echo " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $echo " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - $echo - $echo "See any operating system documentation about shared libraries for" - $echo "more information, such as the ld(1) and ld.so(8) manual pages." - $echo "X----------------------------------------------------------------------" | $Xsed - exit $EXIT_SUCCESS - ;; - - # libtool execute mode - execute) - modename="$modename: execute" - - # The first argument is the command name. - cmd="$nonopt" - if test -z "$cmd"; then - $echo "$modename: you must specify a COMMAND" 1>&2 - $echo "$help" - exit $EXIT_FAILURE - fi - - # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do - if test ! -f "$file"; then - $echo "$modename: \`$file' is not a file" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - dir= - case $file in - *.la) - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Read the libtool library. - dlname= - library_names= - - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" - continue - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - - if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" - else - $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 - exit $EXIT_FAILURE - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - ;; - - *) - $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case $file in - -*) ;; - *) - # Do a test to see if this is really a libtool program. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` - args="$args \"$file\"" - done - - if test -z "$run"; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - if test "${save_LC_ALL+set}" = set; then - LC_ALL="$save_LC_ALL"; export LC_ALL - fi - if test "${save_LANG+set}" = set; then - LANG="$save_LANG"; export LANG - fi - - # Now prepare to actually exec the command. - exec_cmd="\$cmd$args" - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" - $echo "export $shlibpath_var" - fi - $echo "$cmd$args" - exit $EXIT_SUCCESS - fi - ;; - - # libtool clean and uninstall mode - clean | uninstall) - modename="$modename: $mode" - rm="$nonopt" - files= - rmforce= - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - for arg - do - case $arg in - -f) rm="$rm $arg"; rmforce=yes ;; - -*) rm="$rm $arg" ;; - *) files="$files $arg" ;; - esac - done - - if test -z "$rm"; then - $echo "$modename: you must specify an RM program" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - rmdirs= - - origobjdir="$objdir" - for file in $files; do - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$file"; then - dir=. - objdir="$origobjdir" - else - objdir="$dir/$origobjdir" - fi - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - test "$mode" = uninstall && objdir="$dir" - - # Remember objdir for removal later, being careful to avoid duplicates - if test "$mode" = clean; then - case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if (test -L "$file") >/dev/null 2>&1 \ - || (test -h "$file") >/dev/null 2>&1 \ - || test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif test "$rmforce" = yes; then - continue - fi - - rmfiles="$file" - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - . $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - rmfiles="$rmfiles $objdir/$n" - done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" - - case "$mode" in - clean) - case " $library_names " in - # " " in the beginning catches empty $dlname - *" $dlname "*) ;; - *) rmfiles="$rmfiles $objdir/$dlname" ;; - esac - test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" - ;; - uninstall) - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - cmds=$postuninstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - cmds=$old_postuninstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - # FIXME: should reinstall the best remaining shared library. - ;; - esac - fi - ;; - - *.lo) - # Possibly a libtool object, so verify it. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - - # Read the .lo file - . $dir/$name - - # Add PIC object to the list of files to remove. - if test -n "$pic_object" \ - && test "$pic_object" != none; then - rmfiles="$rmfiles $dir/$pic_object" - fi - - # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" \ - && test "$non_pic_object" != none; then - rmfiles="$rmfiles $dir/$non_pic_object" - fi - fi - ;; - - *) - if test "$mode" = clean ; then - noexename=$name - case $file in - *.exe) - file=`$echo $file|${SED} 's,.exe$,,'` - noexename=`$echo $name|${SED} 's,.exe$,,'` - # $file with .exe has already been added to rmfiles, - # add $file without .exe - rmfiles="$rmfiles $file" - ;; - esac - # Do a test to see if this is a libtool program. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - relink_command= - . $dir/$noexename - - # note $name still contains .exe if it was in $file originally - # as does the version of $file that was added into $rmfiles - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" - fi - if test "X$noexename" != "X$name" ; then - rmfiles="$rmfiles $objdir/lt-${noexename}.c" - fi - fi - fi - ;; - esac - $show "$rm $rmfiles" - $run $rm $rmfiles || exit_status=1 - done - objdir="$origobjdir" - - # Try to remove the ${objdir}s in the directories where we deleted files - for dir in $rmdirs; do - if test -d "$dir"; then - $show "rmdir $dir" - $run rmdir $dir >/dev/null 2>&1 - fi - done - - exit $exit_status - ;; - - "") - $echo "$modename: you must specify a MODE" 1>&2 - $echo "$generic_help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - if test -z "$exec_cmd"; then - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$generic_help" 1>&2 - exit $EXIT_FAILURE - fi -fi # test -z "$show_help" - -if test -n "$exec_cmd"; then - eval exec $exec_cmd - exit $EXIT_FAILURE -fi - -# We need to display help for each of the modes. -case $mode in -"") $echo \ -"Usage: $modename [OPTION]... [MODE-ARG]... - -Provide generalized library-building support services. - - --config show all configuration variables - --debug enable verbose shell tracing --n, --dry-run display commands without modifying any files - --features display basic configuration information and exit - --finish same as \`--mode=finish' - --help display this help message and exit - --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] - --quiet same as \`--silent' - --silent don't print informational messages - --tag=TAG use configuration variables from tag TAG - --version print version information - -MODE must be one of the following: - - clean remove files from the build directory - compile compile a source file into a libtool object - execute automatically set library path, then run a program - finish complete the installation of libtool libraries - install install libraries or executables - link create a library or an executable - uninstall remove libraries from an installed directory - -MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for -a more detailed description of MODE. - -Report bugs to ." - exit $EXIT_SUCCESS - ;; - -clean) - $echo \ -"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... - -Remove files from the build directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, object or program, all the files associated -with it are deleted. Otherwise, only FILE itself is deleted using RM." - ;; - -compile) - $echo \ -"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -prefer-pic try to building PIC objects only - -prefer-non-pic try to building non-PIC objects only - -static always build a \`.o' file suitable for static linking - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - -execute) - $echo \ -"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - -finish) - $echo \ -"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - -install) - $echo \ -"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - -link) - $echo \ -"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects - -precious-files-regex REGEX - don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -static do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - -uninstall) - $echo \ -"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - -*) - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; -esac - -$echo -$echo "Try \`$modename --help' for more information about other modes." - -exit $? - -# The TAGs below are defined such that we never get into a situation -# in which we disable both kinds of libraries. Given conflicting -# choices, we go for a static library, that is the most portable, -# since we can't tell whether shared libraries were disabled because -# the user asked for that or because the platform doesn't support -# them. This is particularly important on AIX, because we don't -# support having both static and shared libraries enabled at the same -# time on that platform, so we default to a shared-only configuration. -# If a disable-shared tag is given, we'll fallback to a static-only -# configuration. But we'll never go from static-only to shared-only. - -# ### BEGIN LIBTOOL TAG CONFIG: disable-shared -disable_libs=shared -# ### END LIBTOOL TAG CONFIG: disable-shared - -# ### BEGIN LIBTOOL TAG CONFIG: disable-static -disable_libs=static -# ### END LIBTOOL TAG CONFIG: disable-static - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff --git a/contrib/llvm/autoconf/m4/build_exeext.m4 b/contrib/llvm/autoconf/m4/build_exeext.m4 deleted file mode 100644 index 1bdecc1ba578..000000000000 --- a/contrib/llvm/autoconf/m4/build_exeext.m4 +++ /dev/null @@ -1,42 +0,0 @@ -# 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)]) diff --git a/contrib/llvm/autoconf/m4/c_printf_a.m4 b/contrib/llvm/autoconf/m4/c_printf_a.m4 deleted file mode 100644 index 61bac8c9dd11..000000000000 --- a/contrib/llvm/autoconf/m4/c_printf_a.m4 +++ /dev/null @@ -1,31 +0,0 @@ -# -# 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 -#include -]],[[ -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 -]) diff --git a/contrib/llvm/autoconf/m4/check_gnu_make.m4 b/contrib/llvm/autoconf/m4/check_gnu_make.m4 deleted file mode 100644 index 7355e1c85bb9..000000000000 --- a/contrib/llvm/autoconf/m4/check_gnu_make.m4 +++ /dev/null @@ -1,26 +0,0 @@ -# -# 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) -]) diff --git a/contrib/llvm/autoconf/m4/config_makefile.m4 b/contrib/llvm/autoconf/m4/config_makefile.m4 deleted file mode 100644 index b1eaffdcd85c..000000000000 --- a/contrib/llvm/autoconf/m4/config_makefile.m4 +++ /dev/null @@ -1,9 +0,0 @@ -# -# 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]) -]) diff --git a/contrib/llvm/autoconf/m4/config_project.m4 b/contrib/llvm/autoconf/m4/config_project.m4 deleted file mode 100644 index eea7faf165c2..000000000000 --- a/contrib/llvm/autoconf/m4/config_project.m4 +++ /dev/null @@ -1,14 +0,0 @@ -# -# 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}"]) -]) diff --git a/contrib/llvm/autoconf/m4/cxx_flag_check.m4 b/contrib/llvm/autoconf/m4/cxx_flag_check.m4 deleted file mode 100644 index ab09f2af5cf0..000000000000 --- a/contrib/llvm/autoconf/m4/cxx_flag_check.m4 +++ /dev/null @@ -1,2 +0,0 @@ -AC_DEFUN([CXX_FLAG_CHECK], - [AC_SUBST($1, `$CXX $2 -fsyntax-only -xc /dev/null 2>/dev/null && echo $2`)]) diff --git a/contrib/llvm/autoconf/m4/find_std_program.m4 b/contrib/llvm/autoconf/m4/find_std_program.m4 deleted file mode 100644 index c789df8e641d..000000000000 --- a/contrib/llvm/autoconf/m4/find_std_program.m4 +++ /dev/null @@ -1,118 +0,0 @@ -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 -]) diff --git a/contrib/llvm/autoconf/m4/func_isinf.m4 b/contrib/llvm/autoconf/m4/func_isinf.m4 deleted file mode 100644 index c936bf920d02..000000000000 --- a/contrib/llvm/autoconf/m4/func_isinf.m4 +++ /dev/null @@ -1,36 +0,0 @@ -# -# 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], [], - [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 ]) -fi - -AC_SINGLE_CXX_CHECK([ac_cv_func_isinf_in_cmath], - [isinf], [], - [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 ]) -fi - -AC_SINGLE_CXX_CHECK([ac_cv_func_std_isinf_in_cmath], - [std::isinf], [], - [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 ]) -fi - -AC_SINGLE_CXX_CHECK([ac_cv_func_finite_in_ieeefp_h], - [finite], [], - [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 ]) -fi - -]) - - diff --git a/contrib/llvm/autoconf/m4/func_isnan.m4 b/contrib/llvm/autoconf/m4/func_isnan.m4 deleted file mode 100644 index eb5ca0daeb5e..000000000000 --- a/contrib/llvm/autoconf/m4/func_isnan.m4 +++ /dev/null @@ -1,27 +0,0 @@ -# -# 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], [], - [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 ]) -fi - -AC_SINGLE_CXX_CHECK([ac_cv_func_isnan_in_cmath], - [isnan], [], - [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 ]) -fi - -AC_SINGLE_CXX_CHECK([ac_cv_func_std_isnan_in_cmath], - [std::isnan], [], - [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 ]) -fi -]) diff --git a/contrib/llvm/autoconf/m4/func_mmap_file.m4 b/contrib/llvm/autoconf/m4/func_mmap_file.m4 deleted file mode 100644 index 372c87fbe5c6..000000000000 --- a/contrib/llvm/autoconf/m4/func_mmap_file.m4 +++ /dev/null @@ -1,26 +0,0 @@ -# -# 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 -#include -#include -]],[[ - 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 -]) diff --git a/contrib/llvm/autoconf/m4/header_mmap_anonymous.m4 b/contrib/llvm/autoconf/m4/header_mmap_anonymous.m4 deleted file mode 100644 index 2270d29557b6..000000000000 --- a/contrib/llvm/autoconf/m4/header_mmap_anonymous.m4 +++ /dev/null @@ -1,21 +0,0 @@ -# -# 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 -#include -#include ]], - [[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 -]) diff --git a/contrib/llvm/autoconf/m4/huge_val.m4 b/contrib/llvm/autoconf/m4/huge_val.m4 deleted file mode 100644 index 5fffbfc8d37c..000000000000 --- a/contrib/llvm/autoconf/m4/huge_val.m4 +++ /dev/null @@ -1,20 +0,0 @@ -# -# 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 ], - [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) -]) diff --git a/contrib/llvm/autoconf/m4/libtool.m4 b/contrib/llvm/autoconf/m4/libtool.m4 deleted file mode 100644 index a8b5e6a94fc5..000000000000 --- a/contrib/llvm/autoconf/m4/libtool.m4 +++ /dev/null @@ -1,6389 +0,0 @@ -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 -## Free Software Foundation, Inc. -## Originally by Gordon Matzigkeit , 1996 -## -## 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 48 AC_PROG_LIBTOOL - - -# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) -# ----------------------------------------------------------- -# If this macro is not defined by Autoconf, define it here. -m4_ifdef([AC_PROVIDE_IFELSE], - [], - [m4_define([AC_PROVIDE_IFELSE], - [m4_ifdef([AC_PROVIDE_$1], - [$2], [$3])])]) - - -# AC_PROG_LIBTOOL -# --------------- -AC_DEFUN([AC_PROG_LIBTOOL], -[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl -dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX -dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. - AC_PROVIDE_IFELSE([AC_PROG_CXX], - [AC_LIBTOOL_CXX], - [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX - ])]) -dnl And a similar setup for Fortran 77 support - AC_PROVIDE_IFELSE([AC_PROG_F77], - [AC_LIBTOOL_F77], - [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 -])]) - -dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. -dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run -dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. - AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [ifdef([AC_PROG_GCJ], - [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([A][M_PROG_GCJ], - [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([LT_AC_PROG_GCJ], - [define([LT_AC_PROG_GCJ], - defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) -])])# AC_PROG_LIBTOOL - - -# _AC_PROG_LIBTOOL -# ---------------- -AC_DEFUN([_AC_PROG_LIBTOOL], -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl -AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl -AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl -AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/mklib' -AC_SUBST(LIBTOOL)dnl - -# Prevent multiple expansion -define([AC_PROG_LIBTOOL], []) -])# _AC_PROG_LIBTOOL - - -# AC_LIBTOOL_SETUP -# ---------------- -AC_DEFUN([AC_LIBTOOL_SETUP], -[AC_PREREQ(2.60)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl -AC_REQUIRE([AC_PROG_NM])dnl - -AC_REQUIRE([AC_PROG_LN_S])dnl -AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! -AC_REQUIRE([AC_OBJEXT])dnl -AC_REQUIRE([AC_EXEEXT])dnl -dnl - -AC_LIBTOOL_SYS_MAX_CMD_LEN -AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -AC_LIBTOOL_OBJDIR - -AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -_LT_AC_PROG_ECHO_BACKSLASH - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e 1s/^X//' -[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] - -# Same as above, but do not quote variable references. -[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=mklib -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" - -AC_CHECK_TOOL(AR, ar, false) -AC_CHECK_TOOL(RANLIB, ranlib, :) -AC_CHECK_TOOL(STRIP, strip, :) - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -_LT_CC_BASENAME([$compiler]) - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - AC_PATH_MAGIC - fi - ;; -esac - -AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -enable_win32_dll=yes, enable_win32_dll=no) - -AC_ARG_ENABLE([libtool-lock], - [AS_HELP_STRING([--disable-libtool-lock],[avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -AC_ARG_WITH([pic], - [AS_HELP_STRING([--with-pic],[try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], - [pic_mode=default]) -test -z "$pic_mode" && pic_mode=default - -# Use C for the default configuration in the libtool script -tagname= -AC_LIBTOOL_LANG_C_CONFIG -_LT_AC_TAGCONFIG -])# AC_LIBTOOL_SETUP - - -# _LT_AC_SYS_COMPILER -# ------------------- -AC_DEFUN([_LT_AC_SYS_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC -])# _LT_AC_SYS_COMPILER - - -# _LT_CC_BASENAME(CC) -# ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -AC_DEFUN([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -]) - - -# _LT_COMPILER_BOILERPLATE -# ------------------------ -# Check for compiler boilerplate output or warnings with -# the simple compiler test code. -AC_DEFUN([_LT_COMPILER_BOILERPLATE], -[ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* -])# _LT_COMPILER_BOILERPLATE - - -# _LT_LINKER_BOILERPLATE -# ---------------------- -# Check for linker boilerplate output or warnings with -# the simple link test code. -AC_DEFUN([_LT_LINKER_BOILERPLATE], -[ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* -])# _LT_LINKER_BOILERPLATE - - -# _LT_AC_SYS_LIBPATH_AIX -# ---------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], -[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -])# _LT_AC_SYS_LIBPATH_AIX - - -# _LT_AC_SHELL_INIT(ARG) -# ---------------------- -AC_DEFUN([_LT_AC_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_AC_SHELL_INIT - - -# _LT_AC_PROG_ECHO_BACKSLASH -# -------------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. -AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], -[_LT_AC_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -echo=${ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null 2>&1 && unset CDPATH - -if test -z "$ECHO"; then -if test "X${echo_test_string+set}" != Xset; then -# find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string=`eval $cmd`) 2>/dev/null && - echo_test_string=`eval $cmd` && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi - -AC_SUBST(ECHO) -])])# _LT_AC_PROG_ECHO_BACKSLASH - - -# _LT_AC_LOCK -# ----------- -AC_DEFUN([_LT_AC_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AS_HELP_STRING([--disable-libtool-lock],[avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -sparc*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; - *) LD="${LD-ld} -64" ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw* | *-*-pw32*) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; - ]) -esac - -need_locks="$enable_libtool_lock" - -])# _LT_AC_LOCK - - -# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], -[AC_REQUIRE([LT_AC_PROG_SED]) -AC_CACHE_CHECK([$1], [$2], - [$2=no - ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - fi - $rm conftest* -]) - -if test x"[$]$2" = xyes; then - ifelse([$5], , :, [$5]) -else - ifelse([$6], , :, [$6]) -fi -])# AC_LIBTOOL_COMPILER_OPTION - - -# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ------------------------------------------------------------ -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], -[AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&AS_MESSAGE_LOG_FD - $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - else - $2=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" -]) - -if test x"[$]$2" = xyes; then - ifelse([$4], , :, [$4]) -else - ifelse([$5], , :, [$5]) -fi -])# AC_LIBTOOL_LINKER_OPTION - - -# AC_LIBTOOL_SYS_MAX_CMD_LEN -# -------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], -[# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ - = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - teststring= - # Add a significant safety factor because C++ compilers can tack on massive - # amounts of additional arguments before passing them to the linker. - # It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - ;; - esac -]) -if test -n $lt_cv_sys_max_cmd_len ; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -])# AC_LIBTOOL_SYS_MAX_CMD_LEN - - -# _LT_AC_CHECK_DLFCN -# ------------------ -AC_DEFUN([_LT_AC_CHECK_DLFCN], -[AC_CHECK_HEADERS(dlfcn.h)dnl -])# _LT_AC_CHECK_DLFCN - - -# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# --------------------------------------------------------------------- -AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "$cross_compiling" = yes; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - else - puts (dlerror ()); - - exit (status); -}] -EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_dlunknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_AC_TRY_DLOPEN_SELF - - -# AC_LIBTOOL_DLOPEN_SELF -# ---------------------- -AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) - ]) - ]) - ]) - ]) - ]) - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi -])# AC_LIBTOOL_DLOPEN_SELF - - -# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) -# --------------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler -AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . 2>&AS_MESSAGE_LOG_FD - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* -]) -])# AC_LIBTOOL_PROG_CC_C_O - - -# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) -# ----------------------------------------- -# Check to see if we can do hard links to lock some files if needed -AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], -[AC_REQUIRE([_LT_AC_LOCK])dnl - -hard_links="nottested" -if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS - - -# AC_LIBTOOL_OBJDIR -# ----------------- -AC_DEFUN([AC_LIBTOOL_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null]) -objdir=$lt_cv_objdir -])# AC_LIBTOOL_OBJDIR - - -# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) -# ---------------------------------------------- -# Check hardcoding attributes. -AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_AC_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ - test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ - test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then - # Linking always hardcodes the temporary library directory. - _LT_AC_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_AC_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_AC_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) - -if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi -])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH - - -# AC_LIBTOOL_SYS_LIB_STRIP -# ------------------------ -AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], -[striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) -fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -])# AC_LIBTOOL_SYS_LIB_STRIP - - -# AC_LIBTOOL_SYS_DYNAMIC_LINKER -# ----------------------------- -# PORTME Fill in your ld.so characteristics -AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], -[AC_MSG_CHECKING([dynamic linker characteristics]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[[45]]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='.dylib' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[[123]]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[[01]]* | freebsdelf3.[[01]]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ - freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -interix3*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[[89]] | openbsd2.[[89]].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi -])# AC_LIBTOOL_SYS_DYNAMIC_LINKER - - -# _LT_AC_TAGCONFIG -# ---------------- -AC_DEFUN([_LT_AC_TAGCONFIG], -[AC_ARG_WITH([tags], - [AS_HELP_STRING([--with-tags@<:@=TAGS@:>@],[include additional configurations @<:@automatic@:>@])], - [tagnames="$withval"]) - -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - AC_MSG_WARN([output file `$ofile' does not exist]) - fi - - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) - else - AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) - fi - fi - if test -z "$LTCFLAGS"; then - eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" - fi - - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in - "") ;; - *) AC_MSG_ERROR([invalid tag name: $tagname]) - ;; - esac - - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - AC_MSG_ERROR([tag name "$tagname" already exists]) - fi - - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile - - case $tagname in - CXX) - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_LIBTOOL_LANG_CXX_CONFIG - else - tagname="" - fi - ;; - - F77) - if test -n "$F77" && test "X$F77" != "Xno"; then - AC_LIBTOOL_LANG_F77_CONFIG - else - tagname="" - fi - ;; - - GCJ) - if test -n "$GCJ" && test "X$GCJ" != "Xno"; then - AC_LIBTOOL_LANG_GCJ_CONFIG - else - tagname="" - fi - ;; - - RC) - AC_LIBTOOL_LANG_RC_CONFIG - ;; - - *) - AC_MSG_ERROR([Unsupported tag name: $tagname]) - ;; - esac - - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi - fi - done - IFS="$lt_save_ifs" - - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - AC_MSG_ERROR([unable to update list of available tagged configurations.]) - fi -fi -])# _LT_AC_TAGCONFIG - - -# AC_LIBTOOL_DLOPEN -# ----------------- -# enable checks for dlopen support -AC_DEFUN([AC_LIBTOOL_DLOPEN], - [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_DLOPEN - - -# AC_LIBTOOL_WIN32_DLL -# -------------------- -# declare package support for building win32 DLLs -AC_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_WIN32_DLL - - -# AC_ENABLE_SHARED([DEFAULT]) -# --------------------------- -# implement the --enable-shared flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_SHARED], -[define([enable_shared_default], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([shared], - AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],[build shared libraries @<:@default=enable_shared_default@:>@]), - [p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_shared=]enable_shared_default) -])# AC_ENABLE_SHARED - - -# AC_DISABLE_SHARED -# ----------------- -# set the default shared flag to --disable-shared -AC_DEFUN([AC_DISABLE_SHARED], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_SHARED(no) -])# AC_DISABLE_SHARED - - -# AC_ENABLE_STATIC([DEFAULT]) -# --------------------------- -# implement the --enable-static flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_STATIC], -[define([enable_static_default], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([static], - AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],[build static libraries @<:@default=enable_static_default@:>@]), - [p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_static=]enable_static_default) -])# AC_ENABLE_STATIC - - -# AC_DISABLE_STATIC -# ----------------- -# set the default static flag to --disable-static -AC_DEFUN([AC_DISABLE_STATIC], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_STATIC(no) -])# AC_DISABLE_STATIC - - -# AC_ENABLE_FAST_INSTALL([DEFAULT]) -# --------------------------------- -# implement the --enable-fast-install flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_FAST_INSTALL], -[define([enable_Fast_install_default], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([fast-install], - AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],[optimize for fast installation @<:@default=enable_Fast_install_default@:>@]), - [p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_fast_install=]enable_Fast_install_default) -])# AC_ENABLE_FAST_INSTALL - - -# AC_DISABLE_FAST_INSTALL -# ----------------------- -# set the default to --disable-fast-install -AC_DEFUN([AC_DISABLE_FAST_INSTALL], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_FAST_INSTALL(no) -])# AC_DISABLE_FAST_INSTALL - - -# AC_LIBTOOL_PICMODE([MODE]) -# -------------------------- -# implement the --with-pic flag -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. -AC_DEFUN([AC_LIBTOOL_PICMODE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -pic_mode=ifelse($#,1,$1,default) -])# AC_LIBTOOL_PICMODE - - -# AC_PROG_EGREP -# ------------- -# This is predefined starting with Autoconf 2.54, so this conditional -# definition can be removed once we require Autoconf 2.54 or later. -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], -[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], - [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi]) - EGREP=$ac_cv_prog_egrep - AC_SUBST([EGREP]) -])]) - - -# AC_PATH_TOOL_PREFIX -# ------------------- -# find a file program which can recognise shared library -AC_DEFUN([AC_PATH_TOOL_PREFIX], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in -[[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="ifelse([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -])# AC_PATH_TOOL_PREFIX - - -# AC_PATH_MAGIC -# ------------- -# find a file program which can recognise a shared library -AC_DEFUN([AC_PATH_MAGIC], -[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# AC_PATH_MAGIC - - -# AC_PROG_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([AC_PROG_LD], -[AC_ARG_WITH([gnu-ld], - [AS_HELP_STRING([--with-gnu-ld],[assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], - [with_gnu_ld=no]) -AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]]* | ?:[[\\/]]*) - re_direlt='/[[^/]][[^/]]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix3*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -nto-qnx*) - lt_cv_deplibs_check_method=unknown - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown -])# AC_DEPLIBS_CHECK_METHOD - - -# AC_PROG_NM -# ---------- -# find the pathname to a BSD-compatible name lister -AC_DEFUN([AC_PROG_NM], -[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS="$lt_save_ifs" - done - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi]) -NM="$lt_cv_path_NM" -])# AC_PROG_NM - - -# AC_CHECK_LIBM -# ------------- -# check for math library -AC_DEFUN([AC_CHECK_LIBM], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM="-lm") - ;; -esac -])# AC_CHECK_LIBM - - -# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl convenience library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-convenience to the configure arguments. Note that -# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, -# it is assumed to be `libltdl'. LIBLTDL will be prefixed with -# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' -# (note the single quotes!). If your package is not flat and you're not -# using automake, define top_builddir and top_srcdir appropriately in -# the Makefiles. -AC_DEFUN([AC_LIBLTDL_CONVENIENCE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case $enable_ltdl_convenience in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; - esac - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_CONVENIENCE - - -# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl installable library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-install to the configure arguments. Note that -# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, -# and an installed libltdl is not found, it is assumed to be `libltdl'. -# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with -# '${top_srcdir}/' (note the single quotes!). If your package is not -# flat and you're not using automake, define top_builddir and top_srcdir -# appropriately in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN([AC_LIBLTDL_INSTALLABLE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - AC_CHECK_LIB(ltdl, lt_dlinit, - [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], - [if test x"$enable_ltdl_install" = xno; then - AC_MSG_WARN([libltdl not installed, but installation disabled]) - else - enable_ltdl_install=yes - fi - ]) - if test x"$enable_ltdl_install" = x"yes"; then - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - else - ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - LTDLINCL= - fi - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_INSTALLABLE - - -# AC_LIBTOOL_CXX -# -------------- -# enable support for C++ libraries -AC_DEFUN([AC_LIBTOOL_CXX], -[AC_REQUIRE([_LT_AC_LANG_CXX]) -])# AC_LIBTOOL_CXX - - -# _LT_AC_LANG_CXX -# --------------- -AC_DEFUN([_LT_AC_LANG_CXX], -[AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([_LT_AC_PROG_CXXCPP]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) -])# _LT_AC_LANG_CXX - -# _LT_AC_PROG_CXXCPP -# ------------------ -AC_DEFUN([_LT_AC_PROG_CXXCPP], -[ -AC_REQUIRE([AC_PROG_CXX]) -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -fi -])# _LT_AC_PROG_CXXCPP - -# AC_LIBTOOL_F77 -# -------------- -# enable support for Fortran 77 libraries -AC_DEFUN([AC_LIBTOOL_F77], -[AC_REQUIRE([_LT_AC_LANG_F77]) -])# AC_LIBTOOL_F77 - - -# _LT_AC_LANG_F77 -# --------------- -AC_DEFUN([_LT_AC_LANG_F77], -[AC_REQUIRE([AC_PROG_F77]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) -])# _LT_AC_LANG_F77 - - -# AC_LIBTOOL_GCJ -# -------------- -# enable support for GCJ libraries -AC_DEFUN([AC_LIBTOOL_GCJ], -[AC_REQUIRE([_LT_AC_LANG_GCJ]) -])# AC_LIBTOOL_GCJ - - -# _LT_AC_LANG_GCJ -# --------------- -AC_DEFUN([_LT_AC_LANG_GCJ], -[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], - [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], - [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], - [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) -])# _LT_AC_LANG_GCJ - - -# AC_LIBTOOL_RC -# ------------- -# enable support for Windows resource files -AC_DEFUN([AC_LIBTOOL_RC], -[AC_REQUIRE([LT_AC_PROG_RC]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) -])# AC_LIBTOOL_RC - - -# AC_LIBTOOL_LANG_C_CONFIG -# ------------------------ -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) -AC_DEFUN([_LT_AC_LANG_C_CONFIG], -[lt_save_CC="$CC" -AC_LANG_PUSH(C) - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' - -_LT_AC_SYS_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_DLOPEN_SELF - -# Report which library types will actually be built -AC_MSG_CHECKING([if libtool supports shared libraries]) -AC_MSG_RESULT([$can_build_shared]) - -AC_MSG_CHECKING([whether to build shared libraries]) -test "$can_build_shared" = "no" && enable_shared=no - -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case $host_os in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -AC_MSG_RESULT([$enable_shared]) - -AC_MSG_CHECKING([whether to build static libraries]) -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -AC_MSG_RESULT([$enable_static]) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC="$lt_save_CC" -])# AC_LIBTOOL_LANG_C_CONFIG - - -# AC_LIBTOOL_LANG_CXX_CONFIG -# -------------------------- -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) -AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], -[AC_LANG_PUSH(C++) -AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([_LT_AC_PROG_CXXCPP]) - -_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_AC_TAGVAR(allow_undefined_flag, $1)= -_LT_AC_TAGVAR(always_export_symbols, $1)=no -_LT_AC_TAGVAR(archive_expsym_cmds, $1)= -_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_direct, $1)=no -_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= -_LT_AC_TAGVAR(hardcode_minus_L, $1)=no -_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported -_LT_AC_TAGVAR(hardcode_automatic, $1)=no -_LT_AC_TAGVAR(module_cmds, $1)= -_LT_AC_TAGVAR(module_expsym_cmds, $1)= -_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown -_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_AC_TAGVAR(no_undefined_flag, $1)= -_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= -_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Dependencies to place before and after the object being linked: -_LT_AC_TAGVAR(predep_objects, $1)= -_LT_AC_TAGVAR(postdep_objects, $1)= -_LT_AC_TAGVAR(predeps, $1)= -_LT_AC_TAGVAR(postdeps, $1)= -_LT_AC_TAGVAR(compiler_lib_search_path, $1)= - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_AC_SYS_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_LD=$LD -lt_save_GCC=$GCC -GCC=$GXX -lt_save_with_gnu_ld=$with_gnu_ld -lt_save_path_LD=$lt_cv_path_LD -if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -else - $as_unset lt_cv_prog_gnu_ld -fi -if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX -else - $as_unset lt_cv_path_LD -fi -test -z "${LDCXX+set}" || LD=$LDCXX -CC=${CXX-"c++"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) - -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' -else - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= -fi - -if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - AC_PROG_LD - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ - grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - -else - GXX=no - with_gnu_ld=no - wlarc= -fi - -# PORTME: fill in a description of your system's C++ link characteristics -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -_LT_AC_TAGVAR(ld_shlibs, $1)=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes ; then - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - freebsd[[12]]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - freebsd-elf*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - ;; - gnu*) - ;; - hpux9*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - ;; - *) - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - interix3*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - linux*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc*) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC*) - # Portland Group C++ compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - m88k*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - openbsd2*) - # C++ shared libraries are fairly broken - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd='echo' - ;; - osf3*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ - $rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. We must also pass each convience library through - # to the system linker between allextract/defaultextract. - # The C++ compiler will combine linker options so we - # cannot just pass the convience library names through - # without $wl. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' - ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - output_verbose_link_cmd='echo' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - fi - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - # So that behaviour is only enabled if SCOABSPATH is set to a - # non-empty value in the environment. Most likely only useful for - # creating official distributions of packages. - # This is a hack until libtool officially supports absolute path - # names for shared libraries. - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; -esac -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -_LT_AC_TAGVAR(GCC, $1)="$GXX" -_LT_AC_TAGVAR(LD, $1)="$LD" - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -AC_LIBTOOL_POSTDEP_PREDEP($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC=$lt_save_CC -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -with_gnu_ld=$lt_save_with_gnu_ld -lt_cv_path_LDCXX=$lt_cv_path_LD -lt_cv_path_LD=$lt_save_path_LD -lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -])# AC_LIBTOOL_LANG_CXX_CONFIG - -# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) -# ------------------------------------ -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" -ifelse([$1], [], -[#! $SHELL - -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 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 of the License, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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. - -# A sed program that does not truncate output. -SED=$lt_SED - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="$SED -e 1s/^X//" - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# The names of the tagged configurations supported by this script. -available_tags= - -# ### BEGIN LIBTOOL CONFIG], -[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os - -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) - -# Is the compiler the GNU C compiler? -with_gcc=$_LT_AC_TAGVAR(GCC, $1) - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_[]_LT_AC_TAGVAR(LD, $1) - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) - -# Commands used to build and install a shared archive. -archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) -archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) -module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" - -# Set to yes if exported symbols are required. -always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) - -# The commands to list exported symbols. -export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) - -# Symbols that must always be exported. -include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) - -ifelse([$1],[], -[# ### END LIBTOOL CONFIG], -[# ### END LIBTOOL TAG CONFIG: $tagname]) - -__EOF__ - -ifelse([$1],[], [ - case $host_os in - aix3*) - cat <<\EOF >> "$cfgfile" - -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -]) -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi -])# AC_LIBTOOL_CONFIG - - -# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl - -_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - - AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI - - -# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -# --------------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], -[AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_NM]) -AC_REQUIRE([AC_OBJEXT]) -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[[ABCDEGRST]]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -linux*) - if test "$host_cpu" = ia64; then - symcode='[[ABCDGIRSTW]]' - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - fi - ;; -irix* | nonstopux*) - symcode='[[BCDEGRST]]' - ;; -osf*) - symcode='[[BCDEGQRST]]' - ;; -solaris*) - symcode='[[BDRT]]' - ;; -sco3.2v5*) - symcode='[[DT]]' - ;; -sysv4.2uw2*) - symcode='[[DT]]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[[ABDT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if grep ' nm_test_var$' "$nlist" >/dev/null; then - if grep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[[]] = -{ -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD - fi - else - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&5 - fi - rm -f conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -]) -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi -]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE - - -# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) -# --------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], -[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= - -AC_MSG_CHECKING([for $compiler option to produce PIC]) - ifelse([$1],[CXX],[ - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | os2* | pw32*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - interix3*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux*) - case $cc_basename in - KCC*) - # KAI C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - icpc* | ecpc*) - # Intel C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgCC*) - # Portland Group C++ compiler. - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx*) - # Digital/Compaq C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc*) - # Lucid - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - vxworks*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - interix3*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - newsos6) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - linux*) - case $cc_basename in - icc* | ecc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - ccc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - solaris*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; - *) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; - esac - ;; - - sunos4*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - unicos*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - - uts4*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then - AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), - [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" -AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], - _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), - $lt_tmp_static_flag, - [], - [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) -]) - - -# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) -# ------------------------------------ -# See if the linker supports building shared libraries. -AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], -[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -ifelse([$1],[CXX],[ - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; - cygwin* | mingw*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - *) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -],[ - runpath_var= - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)= - _LT_AC_TAGVAR(archive_expsym_cmds, $1)= - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= - _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown - _LT_AC_TAGVAR(hardcode_automatic, $1)=no - _LT_AC_TAGVAR(module_cmds, $1)= - _LT_AC_TAGVAR(module_expsym_cmds, $1)= - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_AC_TAGVAR(include_expsyms, $1)= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - _LT_CC_BASENAME([$compiler]) - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - interix3*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - esac - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - sunos4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - - if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then - runpath_var= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GCC" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - # see comment about different semantics on the GNU ld section - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - bsdi[[45]]*) - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' - _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; - - dgux*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - freebsd1*) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu | dragonfly*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - hpux9*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' - - # Both c and cxx compiler support -rpath directly - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - solaris*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; - *) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -# -# Do we need to explicitly link libc? -# -case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_AC_TAGVAR(archive_cmds, $1) in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) - then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) - ;; - esac - fi - ;; -esac -])# AC_LIBTOOL_PROG_LD_SHLIBS - - -# _LT_AC_FILE_LTDLL_C -# ------------------- -# Be careful that the start marker always follows a newline. -AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ -])# _LT_AC_FILE_LTDLL_C - - -# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) -# --------------------------------- -AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) - - -# old names -AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) -AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) -AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) -AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) -AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) - -# This is just to silence aclocal about the macro not being used -ifelse([AC_DISABLE_FAST_INSTALL]) - -AC_DEFUN([LT_AC_PROG_GCJ], -[AC_CHECK_TOOL(GCJ, gcj, no) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS) -]) - -AC_DEFUN([LT_AC_PROG_RC], -[AC_CHECK_TOOL(RC, windres, no) -]) - -############################################################ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -############################################################ -# LT_AC_PROG_SED -# -------------- -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -AC_DEFUN([LT_AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -]) -SED=$lt_cv_path_SED -AC_MSG_RESULT([$SED]) -]) diff --git a/contrib/llvm/autoconf/m4/link_options.m4 b/contrib/llvm/autoconf/m4/link_options.m4 deleted file mode 100644 index 4c5f2f435d04..000000000000 --- a/contrib/llvm/autoconf/m4/link_options.m4 +++ /dev/null @@ -1,108 +0,0 @@ -# -# Get the linker version string. -# -# This macro is specific to LLVM. -# -AC_DEFUN([AC_LINK_GET_VERSION], - [AC_CACHE_CHECK([for linker version],[llvm_cv_link_version], - [ - version_string="$(ld -v 2>&1 | head -1)" - - # Check for ld64. - if (echo "$version_string" | grep -q "ld64"); then - llvm_cv_link_version=$(echo "$version_string" | sed -e "s#.*ld64-\([^ ]*\)#\1#") - else - llvm_cv_link_version=$(echo "$version_string" | sed -e "s#[^0-9]*\([0-9.]*\).*#\1#") - fi - ]) - AC_DEFINE_UNQUOTED([HOST_LINK_VERSION],"$llvm_cv_link_version", - [Linker version detected at compile time.]) -]) - -# -# 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 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 --version-script option being -# passed to the linker. -# -# This macro is specific to LLVM. -# -AC_DEFUN([AC_LINK_VERSION_SCRIPT], -[AC_CACHE_CHECK([for compiler -Wl,--version-script option], - [llvm_cv_link_use_version_script], -[ 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 "{" > "$tmp/export.map" - echo " global: main;" >> "$tmp/export.map" - echo " local: *;" >> "$tmp/export.map" - echo "};" >> "$tmp/export.map" - - CFLAGS="$CFLAGS -Wl,--version-script=$tmp/export.map" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])], - [llvm_cv_link_use_version_script=yes],[llvm_cv_link_use_version_script=no]) - rm "$tmp/export.map" - rmdir "$tmp" - CFLAGS="$oldcflags" - AC_LANG_POP([C]) -]) -if test "$llvm_cv_link_use_version_script" = yes ; then - AC_SUBST(HAVE_LINK_VERSION_SCRIPT,1) - fi -]) - diff --git a/contrib/llvm/autoconf/m4/linux_mixed_64_32.m4 b/contrib/llvm/autoconf/m4/linux_mixed_64_32.m4 deleted file mode 100644 index 123491f87e5e..000000000000 --- a/contrib/llvm/autoconf/m4/linux_mixed_64_32.m4 +++ /dev/null @@ -1,17 +0,0 @@ -# -# 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]) -]) -]) diff --git a/contrib/llvm/autoconf/m4/ltdl.m4 b/contrib/llvm/autoconf/m4/ltdl.m4 deleted file mode 100644 index bc9e2ad24193..000000000000 --- a/contrib/llvm/autoconf/m4/ltdl.m4 +++ /dev/null @@ -1,418 +0,0 @@ -## 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 -#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 < $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 -#endif]) - -AC_CHECK_FUNCS([argz_append argz_create_sep argz_insert argz_next argz_stringify]) -])# AC_LTDL_FUNC_ARGZ diff --git a/contrib/llvm/autoconf/m4/need_dev_zero_for_mmap.m4 b/contrib/llvm/autoconf/m4/need_dev_zero_for_mmap.m4 deleted file mode 100644 index 57b322830172..000000000000 --- a/contrib/llvm/autoconf/m4/need_dev_zero_for_mmap.m4 +++ /dev/null @@ -1,17 +0,0 @@ -# -# 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]) diff --git a/contrib/llvm/autoconf/m4/path_perl.m4 b/contrib/llvm/autoconf/m4/path_perl.m4 deleted file mode 100644 index 406656cb0322..000000000000 --- a/contrib/llvm/autoconf/m4/path_perl.m4 +++ /dev/null @@ -1,16 +0,0 @@ -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 -]) - diff --git a/contrib/llvm/autoconf/m4/path_tclsh.m4 b/contrib/llvm/autoconf/m4/path_tclsh.m4 deleted file mode 100644 index 85433de71cc5..000000000000 --- a/contrib/llvm/autoconf/m4/path_tclsh.m4 +++ /dev/null @@ -1,39 +0,0 @@ -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 -]) - diff --git a/contrib/llvm/autoconf/m4/rand48.m4 b/contrib/llvm/autoconf/m4/rand48.m4 deleted file mode 100644 index 56705d85c9c5..000000000000 --- a/contrib/llvm/autoconf/m4/rand48.m4 +++ /dev/null @@ -1,12 +0,0 @@ -# -# 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], [], - [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 ]) -fi -]) diff --git a/contrib/llvm/autoconf/m4/sanity_check.m4 b/contrib/llvm/autoconf/m4/sanity_check.m4 deleted file mode 100644 index 639fccca2464..000000000000 --- a/contrib/llvm/autoconf/m4/sanity_check.m4 +++ /dev/null @@ -1,31 +0,0 @@ -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 -]) diff --git a/contrib/llvm/autoconf/m4/single_cxx_check.m4 b/contrib/llvm/autoconf/m4/single_cxx_check.m4 deleted file mode 100644 index 21efa4bed353..000000000000 --- a/contrib/llvm/autoconf/m4/single_cxx_check.m4 +++ /dev/null @@ -1,10 +0,0 @@ -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++])]) - ]) - diff --git a/contrib/llvm/autoconf/m4/visibility_inlines_hidden.m4 b/contrib/llvm/autoconf/m4/visibility_inlines_hidden.m4 deleted file mode 100644 index 42ddbe9128b3..000000000000 --- a/contrib/llvm/autoconf/m4/visibility_inlines_hidden.m4 +++ /dev/null @@ -1,22 +0,0 @@ -# -# 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 -]) diff --git a/contrib/llvm/autoconf/missing b/contrib/llvm/autoconf/missing deleted file mode 100755 index 64b5f901dd55..000000000000 --- a/contrib/llvm/autoconf/missing +++ /dev/null @@ -1,353 +0,0 @@ -#! /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 , 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 ." - 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: diff --git a/contrib/llvm/autoconf/mkinstalldirs b/contrib/llvm/autoconf/mkinstalldirs deleted file mode 100755 index 1ee2d580177f..000000000000 --- a/contrib/llvm/autoconf/mkinstalldirs +++ /dev/null @@ -1,150 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy - -scriptversion=2004-02-15.20 - -# Original author: Noah Friedman -# Created: 1993-05-16 -# Public domain. -# -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -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 ." - -# 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: diff --git a/contrib/llvm/bindings/Makefile b/contrib/llvm/bindings/Makefile deleted file mode 100644 index c545b28854cc..000000000000 --- a/contrib/llvm/bindings/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -##===- 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 diff --git a/contrib/llvm/bindings/README.txt b/contrib/llvm/bindings/README.txt deleted file mode 100644 index 7693cb2cead0..000000000000 --- a/contrib/llvm/bindings/README.txt +++ /dev/null @@ -1,3 +0,0 @@ -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. diff --git a/contrib/llvm/bindings/ada/analysis/llvm_analysis-binding.ads b/contrib/llvm/bindings/ada/analysis/llvm_analysis-binding.ads deleted file mode 100644 index c51a50353f11..000000000000 --- a/contrib/llvm/bindings/ada/analysis/llvm_analysis-binding.ads +++ /dev/null @@ -1,32 +0,0 @@ --- 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; diff --git a/contrib/llvm/bindings/ada/analysis/llvm_analysis.ads b/contrib/llvm/bindings/ada/analysis/llvm_analysis.ads deleted file mode 100644 index aa7b3f0e2e91..000000000000 --- a/contrib/llvm/bindings/ada/analysis/llvm_analysis.ads +++ /dev/null @@ -1,30 +0,0 @@ --- 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; diff --git a/contrib/llvm/bindings/ada/analysis/llvm_analysis_wrap.cxx b/contrib/llvm/bindings/ada/analysis/llvm_analysis_wrap.cxx deleted file mode 100644 index f2a8637343de..000000000000 --- a/contrib/llvm/bindings/ada/analysis/llvm_analysis_wrap.cxx +++ /dev/null @@ -1,369 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 class SwigValueWrapper { - T *tt; -public: - SwigValueWrapper() : tt(0) { } - SwigValueWrapper(const SwigValueWrapper& 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& rhs); -}; - -template 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 -#include -#include -#if defined(_WIN32) || defined(__CYGWIN32__) -# define DllExport __declspec( dllexport ) -# define SWIGSTDCALL __stdcall -#else -# define DllExport -# define SWIGSTDCALL -#endif - - -#ifdef __cplusplus -# include -#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 - diff --git a/contrib/llvm/bindings/ada/bitreader/llvm_bit_reader-binding.ads b/contrib/llvm/bindings/ada/bitreader/llvm_bit_reader-binding.ads deleted file mode 100644 index 4fcdb4a84fcf..000000000000 --- a/contrib/llvm/bindings/ada/bitreader/llvm_bit_reader-binding.ads +++ /dev/null @@ -1,52 +0,0 @@ --- 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; diff --git a/contrib/llvm/bindings/ada/bitreader/llvm_bit_reader.ads b/contrib/llvm/bindings/ada/bitreader/llvm_bit_reader.ads deleted file mode 100644 index 7579dea2819d..000000000000 --- a/contrib/llvm/bindings/ada/bitreader/llvm_bit_reader.ads +++ /dev/null @@ -1,6 +0,0 @@ --- This file is generated by SWIG. Do *not* modify by hand. --- - -package LLVM_bit_Reader is - -end LLVM_bit_Reader; diff --git a/contrib/llvm/bindings/ada/bitreader/llvm_bitreader_wrap.cxx b/contrib/llvm/bindings/ada/bitreader/llvm_bitreader_wrap.cxx deleted file mode 100644 index b7ecbed355af..000000000000 --- a/contrib/llvm/bindings/ada/bitreader/llvm_bitreader_wrap.cxx +++ /dev/null @@ -1,423 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 class SwigValueWrapper { - T *tt; -public: - SwigValueWrapper() : tt(0) { } - SwigValueWrapper(const SwigValueWrapper& 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& rhs); -}; - -template 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 -#include -#include -#if defined(_WIN32) || defined(__CYGWIN32__) -# define DllExport __declspec( dllexport ) -# define SWIGSTDCALL __stdcall -#else -# define DllExport -# define SWIGSTDCALL -#endif - - -#ifdef __cplusplus -# include -#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 - diff --git a/contrib/llvm/bindings/ada/bitwriter/llvm_bit_writer-binding.ads b/contrib/llvm/bindings/ada/bitwriter/llvm_bit_writer-binding.ads deleted file mode 100644 index b5542df0e062..000000000000 --- a/contrib/llvm/bindings/ada/bitwriter/llvm_bit_writer-binding.ads +++ /dev/null @@ -1,28 +0,0 @@ --- 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; diff --git a/contrib/llvm/bindings/ada/bitwriter/llvm_bit_writer.ads b/contrib/llvm/bindings/ada/bitwriter/llvm_bit_writer.ads deleted file mode 100644 index 35b1f38aa996..000000000000 --- a/contrib/llvm/bindings/ada/bitwriter/llvm_bit_writer.ads +++ /dev/null @@ -1,6 +0,0 @@ --- This file is generated by SWIG. Do *not* modify by hand. --- - -package LLVM_bit_Writer is - -end LLVM_bit_Writer; diff --git a/contrib/llvm/bindings/ada/bitwriter/llvm_bitwriter_wrap.cxx b/contrib/llvm/bindings/ada/bitwriter/llvm_bitwriter_wrap.cxx deleted file mode 100644 index 4abf44fffd5c..000000000000 --- a/contrib/llvm/bindings/ada/bitwriter/llvm_bitwriter_wrap.cxx +++ /dev/null @@ -1,335 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 class SwigValueWrapper { - T *tt; -public: - SwigValueWrapper() : tt(0) { } - SwigValueWrapper(const SwigValueWrapper& 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& rhs); -}; - -template 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 -#include -#include -#if defined(_WIN32) || defined(__CYGWIN32__) -# define DllExport __declspec( dllexport ) -# define SWIGSTDCALL __stdcall -#else -# define DllExport -# define SWIGSTDCALL -#endif - - -#ifdef __cplusplus -# include -#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 - diff --git a/contrib/llvm/bindings/ada/executionengine/llvm_execution_engine-binding.ads b/contrib/llvm/bindings/ada/executionengine/llvm_execution_engine-binding.ads deleted file mode 100644 index a37c462cf324..000000000000 --- a/contrib/llvm/bindings/ada/executionengine/llvm_execution_engine-binding.ads +++ /dev/null @@ -1,192 +0,0 @@ --- 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; diff --git a/contrib/llvm/bindings/ada/executionengine/llvm_execution_engine.ads b/contrib/llvm/bindings/ada/executionengine/llvm_execution_engine.ads deleted file mode 100644 index c7669920f7ac..000000000000 --- a/contrib/llvm/bindings/ada/executionengine/llvm_execution_engine.ads +++ /dev/null @@ -1,90 +0,0 @@ --- 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; diff --git a/contrib/llvm/bindings/ada/executionengine/llvm_executionengine_wrap.cxx b/contrib/llvm/bindings/ada/executionengine/llvm_executionengine_wrap.cxx deleted file mode 100644 index b63acacb361f..000000000000 --- a/contrib/llvm/bindings/ada/executionengine/llvm_executionengine_wrap.cxx +++ /dev/null @@ -1,924 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 class SwigValueWrapper { - T *tt; -public: - SwigValueWrapper() : tt(0) { } - SwigValueWrapper(const SwigValueWrapper& 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& rhs); -}; - -template 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 -#include -#include -#if defined(_WIN32) || defined(__CYGWIN32__) -# define DllExport __declspec( dllexport ) -# define SWIGSTDCALL __stdcall -#else -# define DllExport -# define SWIGSTDCALL -#endif - - -#ifdef __cplusplus -# include -#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 - diff --git a/contrib/llvm/bindings/ada/llvm.gpr b/contrib/llvm/bindings/ada/llvm.gpr deleted file mode 100644 index 8e87af4fa12e..000000000000 --- a/contrib/llvm/bindings/ada/llvm.gpr +++ /dev/null @@ -1,34 +0,0 @@ -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; - diff --git a/contrib/llvm/bindings/ada/llvm/llvm-binding.ads b/contrib/llvm/bindings/ada/llvm/llvm-binding.ads deleted file mode 100644 index c0e48a1b5bf3..000000000000 --- a/contrib/llvm/bindings/ada/llvm/llvm-binding.ads +++ /dev/null @@ -1,1974 +0,0 @@ --- This file is generated by SWIG. Do *not* modify by hand. --- - -with Interfaces.C.Strings; - - -package llvm.Binding is - - procedure LLVMDisposeMessage - (Message : in Interfaces.C.Strings.chars_ptr); - - function LLVMContextCreate return llvm.LLVMContextRef; - - function LLVMGetGlobalContext return llvm.LLVMContextRef; - - procedure LLVMContextDispose (C : in llvm.LLVMContextRef); - - function LLVMModuleCreateWithName - (ModuleID : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMModuleRef; - - function LLVMModuleCreateWithNameInContext - (ModuleID : in Interfaces.C.Strings.chars_ptr; - C : in llvm.LLVMContextRef) - return llvm.LLVMModuleRef; - - procedure LLVMDisposeModule (M : in llvm.LLVMModuleRef); - - function LLVMGetDataLayout - (M : in llvm.LLVMModuleRef) - return Interfaces.C.Strings.chars_ptr; - - procedure LLVMSetDataLayout - (M : in llvm.LLVMModuleRef; - Triple : in Interfaces.C.Strings.chars_ptr); - - function LLVMGetTarget - (M : in llvm.LLVMModuleRef) - return Interfaces.C.Strings.chars_ptr; - - procedure LLVMSetTarget - (M : in llvm.LLVMModuleRef; - Triple : in Interfaces.C.Strings.chars_ptr); - - function LLVMAddTypeName - (M : in llvm.LLVMModuleRef; - Name : in Interfaces.C.Strings.chars_ptr; - Ty : in llvm.LLVMTypeRef) - return Interfaces.C.int; - - procedure LLVMDeleteTypeName - (M : in llvm.LLVMModuleRef; - Name : in Interfaces.C.Strings.chars_ptr); - - function LLVMGetTypeByName - (M : in llvm.LLVMModuleRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMTypeRef; - - procedure LLVMDumpModule (M : in llvm.LLVMModuleRef); - - function LLVMGetTypeKind - (Ty : in llvm.LLVMTypeRef) - return llvm.LLVMTypeKind; - - function LLVMInt1Type return llvm.LLVMTypeRef; - - function LLVMInt8Type return llvm.LLVMTypeRef; - - function LLVMInt16Type return llvm.LLVMTypeRef; - - function LLVMInt32Type return llvm.LLVMTypeRef; - - function LLVMInt64Type return llvm.LLVMTypeRef; - - function LLVMIntType - (NumBits : in Interfaces.C.unsigned) - return llvm.LLVMTypeRef; - - function LLVMGetIntTypeWidth - (IntegerTy : in llvm.LLVMTypeRef) - return Interfaces.C.unsigned; - - function LLVMFloatType return llvm.LLVMTypeRef; - - function LLVMDoubleType return llvm.LLVMTypeRef; - - function LLVMX86FP80Type return llvm.LLVMTypeRef; - - function LLVMFP128Type return llvm.LLVMTypeRef; - - function LLVMPPCFP128Type return llvm.LLVMTypeRef; - - function LLVMFunctionType - (ReturnType : in llvm.LLVMTypeRef; - ParamTypes : access llvm.LLVMTypeRef; - ParamCount : in Interfaces.C.unsigned; - IsVarArg : in Interfaces.C.int) - return llvm.LLVMTypeRef; - - function LLVMIsFunctionVarArg - (FunctionTy : in llvm.LLVMTypeRef) - return Interfaces.C.int; - - function LLVMGetReturnType - (FunctionTy : in llvm.LLVMTypeRef) - return llvm.LLVMTypeRef; - - function LLVMCountParamTypes - (FunctionTy : in llvm.LLVMTypeRef) - return Interfaces.C.unsigned; - - procedure LLVMGetParamTypes - (FunctionTy : in llvm.LLVMTypeRef; - Dest : access llvm.LLVMTypeRef); - - function LLVMStructType - (ElementTypes : access llvm.LLVMTypeRef; - ElementCount : in Interfaces.C.unsigned; - Packed : in Interfaces.C.int) - return llvm.LLVMTypeRef; - - function LLVMCountStructElementTypes - (StructTy : in llvm.LLVMTypeRef) - return Interfaces.C.unsigned; - - procedure LLVMGetStructElementTypes - (StructTy : in llvm.LLVMTypeRef; - Dest : access llvm.LLVMTypeRef); - - function LLVMIsPackedStruct - (StructTy : in llvm.LLVMTypeRef) - return Interfaces.C.int; - - function LLVMArrayType - (ElementType : in llvm.LLVMTypeRef; - ElementCount : in Interfaces.C.unsigned) - return llvm.LLVMTypeRef; - - function LLVMPointerType - (ElementType : in llvm.LLVMTypeRef; - AddressSpace : in Interfaces.C.unsigned) - return llvm.LLVMTypeRef; - - function LLVMVectorType - (ElementType : in llvm.LLVMTypeRef; - ElementCount : in Interfaces.C.unsigned) - return llvm.LLVMTypeRef; - - function LLVMGetElementType - (Ty : in llvm.LLVMTypeRef) - return llvm.LLVMTypeRef; - - function LLVMGetArrayLength - (ArrayTy : in llvm.LLVMTypeRef) - return Interfaces.C.unsigned; - - function LLVMGetPointerAddressSpace - (PointerTy : in llvm.LLVMTypeRef) - return Interfaces.C.unsigned; - - function LLVMGetVectorSize - (VectorTy : in llvm.LLVMTypeRef) - return Interfaces.C.unsigned; - - function LLVMVoidType return llvm.LLVMTypeRef; - - function LLVMLabelType return llvm.LLVMTypeRef; - - function LLVMOpaqueType return llvm.LLVMTypeRef; - - function LLVMCreateTypeHandle - (PotentiallyAbstractTy : in llvm.LLVMTypeRef) - return llvm.LLVMTypeHandleRef; - - procedure LLVMRefineType - (AbstractTy : in llvm.LLVMTypeRef; - ConcreteTy : in llvm.LLVMTypeRef); - - function LLVMResolveTypeHandle - (TypeHandle : in llvm.LLVMTypeHandleRef) - return llvm.LLVMTypeRef; - - procedure LLVMDisposeTypeHandle (TypeHandle : in llvm.LLVMTypeHandleRef); - - function LLVMTypeOf (Val : in llvm.LLVMValueRef) return llvm.LLVMTypeRef; - - function LLVMGetValueName - (Val : in llvm.LLVMValueRef) - return Interfaces.C.Strings.chars_ptr; - - procedure LLVMSetValueName - (Val : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr); - - procedure LLVMDumpValue (Val : in llvm.LLVMValueRef); - - function LLVMIsAArgument - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsABasicBlock - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAInlineAsm - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAUser - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAConstant - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAConstantAggregateZero - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAConstantArray - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAConstantExpr - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAConstantFP - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAConstantInt - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAConstantPointerNull - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAConstantStruct - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAConstantVector - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAGlobalValue - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAFunction - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAGlobalAlias - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAGlobalVariable - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAUndefValue - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAInstruction - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsABinaryOperator - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsACallInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAIntrinsicInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsADbgInfoIntrinsic - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsADbgDeclareInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsADbgFuncStartInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsADbgRegionEndInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsADbgRegionStartInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsADbgStopPointInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAEHSelectorInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAMemIntrinsic - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAMemCpyInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAMemMoveInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAMemSetInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsACmpInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAFCmpInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAICmpInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAExtractElementInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAGetElementPtrInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAInsertElementInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAInsertValueInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAPHINode - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsASelectInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAShuffleVectorInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAStoreInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsATerminatorInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsABranchInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAInvokeInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAReturnInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsASwitchInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAUnreachableInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAUnwindInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAUnaryInstruction - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAAllocationInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAAllocaInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAMallocInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsACastInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsABitCastInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAFPExtInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAFPToSIInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAFPToUIInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAFPTruncInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAIntToPtrInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAPtrToIntInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsASExtInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsASIToFPInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsATruncInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAUIToFPInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAZExtInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAExtractValueInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAFreeInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsALoadInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMIsAVAArgInst - (Val : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMConstNull - (Ty : in llvm.LLVMTypeRef) - return llvm.LLVMValueRef; - - function LLVMConstAllOnes - (Ty : in llvm.LLVMTypeRef) - return llvm.LLVMValueRef; - - function LLVMGetUndef - (Ty : in llvm.LLVMTypeRef) - return llvm.LLVMValueRef; - - function LLVMIsConstant - (Val : in llvm.LLVMValueRef) - return Interfaces.C.int; - - function LLVMIsNull (Val : in llvm.LLVMValueRef) return Interfaces.C.int; - - function LLVMIsUndef - (Val : in llvm.LLVMValueRef) - return Interfaces.C.int; - - function LLVMConstPointerNull - (Ty : in llvm.LLVMTypeRef) - return llvm.LLVMValueRef; - - function LLVMConstInt - (IntTy : in llvm.LLVMTypeRef; - N : in Interfaces.C.Extensions.unsigned_long_long; - SignExtend : in Interfaces.C.int) - return llvm.LLVMValueRef; - - function LLVMConstReal - (RealTy : in llvm.LLVMTypeRef; - N : in Interfaces.C.double) - return llvm.LLVMValueRef; - - function LLVMConstRealOfString - (RealTy : in llvm.LLVMTypeRef; - Text : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMConstString - (Str : in Interfaces.C.Strings.chars_ptr; - Length : in Interfaces.C.unsigned; - DontNullTerminate : in Interfaces.C.int) - return llvm.LLVMValueRef; - - function LLVMConstArray - (ElementTy : in llvm.LLVMTypeRef; - ConstantVals : access llvm.LLVMValueRef; - Length : in Interfaces.C.unsigned) - return llvm.LLVMValueRef; - - function LLVMConstStruct - (ConstantVals : access llvm.LLVMValueRef; - Count : in Interfaces.C.unsigned; - packed : in Interfaces.C.int) - return llvm.LLVMValueRef; - - function LLVMConstVector - (ScalarConstantVals : access llvm.LLVMValueRef; - Size : in Interfaces.C.unsigned) - return llvm.LLVMValueRef; - - function LLVMSizeOf (Ty : in llvm.LLVMTypeRef) return llvm.LLVMValueRef; - - function LLVMConstNeg - (ConstantVal : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMConstNot - (ConstantVal : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMConstAdd - (LHSConstant : in llvm.LLVMValueRef; - RHSConstant : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMConstSub - (LHSConstant : in llvm.LLVMValueRef; - RHSConstant : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMConstMul - (LHSConstant : in llvm.LLVMValueRef; - RHSConstant : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMConstUDiv - (LHSConstant : in llvm.LLVMValueRef; - RHSConstant : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMConstSDiv - (LHSConstant : in llvm.LLVMValueRef; - RHSConstant : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMConstFDiv - (LHSConstant : in llvm.LLVMValueRef; - RHSConstant : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMConstURem - (LHSConstant : in llvm.LLVMValueRef; - RHSConstant : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMConstSRem - (LHSConstant : in llvm.LLVMValueRef; - RHSConstant : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMConstFRem - (LHSConstant : in llvm.LLVMValueRef; - RHSConstant : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMConstAnd - (LHSConstant : in llvm.LLVMValueRef; - RHSConstant : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMConstOr - (LHSConstant : in llvm.LLVMValueRef; - RHSConstant : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMConstXor - (LHSConstant : in llvm.LLVMValueRef; - RHSConstant : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMConstICmp - (Predicate : in llvm.LLVMIntPredicate; - LHSConstant : in llvm.LLVMValueRef; - RHSConstant : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMConstFCmp - (Predicate : in llvm.LLVMRealPredicate; - LHSConstant : in llvm.LLVMValueRef; - RHSConstant : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMConstShl - (LHSConstant : in llvm.LLVMValueRef; - RHSConstant : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMConstLShr - (LHSConstant : in llvm.LLVMValueRef; - RHSConstant : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMConstAShr - (LHSConstant : in llvm.LLVMValueRef; - RHSConstant : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMConstGEP - (ConstantVal : in llvm.LLVMValueRef; - ConstantIndices : access llvm.LLVMValueRef; - NumIndices : in Interfaces.C.unsigned) - return llvm.LLVMValueRef; - - function LLVMConstTrunc - (ConstantVal : in llvm.LLVMValueRef; - ToType : in llvm.LLVMTypeRef) - return llvm.LLVMValueRef; - - function LLVMConstSExt - (ConstantVal : in llvm.LLVMValueRef; - ToType : in llvm.LLVMTypeRef) - return llvm.LLVMValueRef; - - function LLVMConstZExt - (ConstantVal : in llvm.LLVMValueRef; - ToType : in llvm.LLVMTypeRef) - return llvm.LLVMValueRef; - - function LLVMConstFPTrunc - (ConstantVal : in llvm.LLVMValueRef; - ToType : in llvm.LLVMTypeRef) - return llvm.LLVMValueRef; - - function LLVMConstFPExt - (ConstantVal : in llvm.LLVMValueRef; - ToType : in llvm.LLVMTypeRef) - return llvm.LLVMValueRef; - - function LLVMConstUIToFP - (ConstantVal : in llvm.LLVMValueRef; - ToType : in llvm.LLVMTypeRef) - return llvm.LLVMValueRef; - - function LLVMConstSIToFP - (ConstantVal : in llvm.LLVMValueRef; - ToType : in llvm.LLVMTypeRef) - return llvm.LLVMValueRef; - - function LLVMConstFPToUI - (ConstantVal : in llvm.LLVMValueRef; - ToType : in llvm.LLVMTypeRef) - return llvm.LLVMValueRef; - - function LLVMConstFPToSI - (ConstantVal : in llvm.LLVMValueRef; - ToType : in llvm.LLVMTypeRef) - return llvm.LLVMValueRef; - - function LLVMConstPtrToInt - (ConstantVal : in llvm.LLVMValueRef; - ToType : in llvm.LLVMTypeRef) - return llvm.LLVMValueRef; - - function LLVMConstIntToPtr - (ConstantVal : in llvm.LLVMValueRef; - ToType : in llvm.LLVMTypeRef) - return llvm.LLVMValueRef; - - function LLVMConstBitCast - (ConstantVal : in llvm.LLVMValueRef; - ToType : in llvm.LLVMTypeRef) - return llvm.LLVMValueRef; - - function LLVMConstSelect - (ConstantCondition : in llvm.LLVMValueRef; - ConstantIfTrue : in llvm.LLVMValueRef; - ConstantIfFalse : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMConstExtractElement - (VectorConstant : in llvm.LLVMValueRef; - IndexConstant : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMConstInsertElement - (VectorConstant : in llvm.LLVMValueRef; - ElementValueConstant : in llvm.LLVMValueRef; - IndexConstant : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMConstShuffleVector - (VectorAConstant : in llvm.LLVMValueRef; - VectorBConstant : in llvm.LLVMValueRef; - MaskConstant : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMConstExtractValue - (AggConstant : in llvm.LLVMValueRef; - IdxList : access Interfaces.C.unsigned; - NumIdx : in Interfaces.C.unsigned) - return llvm.LLVMValueRef; - - function LLVMConstInsertValue - (AggConstant : in llvm.LLVMValueRef; - ElementValueConstant : in llvm.LLVMValueRef; - IdxList : access Interfaces.C.unsigned; - NumIdx : in Interfaces.C.unsigned) - return llvm.LLVMValueRef; - - function LLVMConstInlineAsm - (Ty : in llvm.LLVMTypeRef; - AsmString : in Interfaces.C.Strings.chars_ptr; - Constraints : in Interfaces.C.Strings.chars_ptr; - HasSideEffects : in Interfaces.C.int) - return llvm.LLVMValueRef; - - function LLVMGetGlobalParent - (Global : in llvm.LLVMValueRef) - return llvm.LLVMModuleRef; - - function LLVMIsDeclaration - (Global : in llvm.LLVMValueRef) - return Interfaces.C.int; - - function LLVMGetLinkage - (Global : in llvm.LLVMValueRef) - return llvm.LLVMLinkage; - - procedure LLVMSetLinkage - (Global : in llvm.LLVMValueRef; - Linkage : in llvm.LLVMLinkage); - - function LLVMGetSection - (Global : in llvm.LLVMValueRef) - return Interfaces.C.Strings.chars_ptr; - - procedure LLVMSetSection - (Global : in llvm.LLVMValueRef; - Section : in Interfaces.C.Strings.chars_ptr); - - function LLVMGetVisibility - (Global : in llvm.LLVMValueRef) - return llvm.LLVMVisibility; - - procedure LLVMSetVisibility - (Global : in llvm.LLVMValueRef; - Viz : in llvm.LLVMVisibility); - - function LLVMGetAlignment - (Global : in llvm.LLVMValueRef) - return Interfaces.C.unsigned; - - procedure LLVMSetAlignment - (Global : in llvm.LLVMValueRef; - Bytes : in Interfaces.C.unsigned); - - function LLVMAddGlobal - (M : in llvm.LLVMModuleRef; - Ty : in llvm.LLVMTypeRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMGetNamedGlobal - (M : in llvm.LLVMModuleRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMGetFirstGlobal - (M : in llvm.LLVMModuleRef) - return llvm.LLVMValueRef; - - function LLVMGetLastGlobal - (M : in llvm.LLVMModuleRef) - return llvm.LLVMValueRef; - - function LLVMGetNextGlobal - (GlobalVar : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMGetPreviousGlobal - (GlobalVar : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - procedure LLVMDeleteGlobal (GlobalVar : in llvm.LLVMValueRef); - - function LLVMGetInitializer - (GlobalVar : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - procedure LLVMSetInitializer - (GlobalVar : in llvm.LLVMValueRef; - ConstantVal : in llvm.LLVMValueRef); - - function LLVMIsThreadLocal - (GlobalVar : in llvm.LLVMValueRef) - return Interfaces.C.int; - - procedure LLVMSetThreadLocal - (GlobalVar : in llvm.LLVMValueRef; - IsThreadLocal : in Interfaces.C.int); - - function LLVMIsGlobalConstant - (GlobalVar : in llvm.LLVMValueRef) - return Interfaces.C.int; - - procedure LLVMSetGlobalConstant - (GlobalVar : in llvm.LLVMValueRef; - IsConstant : in Interfaces.C.int); - - function LLVMAddAlias - (M : in llvm.LLVMModuleRef; - Ty : in llvm.LLVMTypeRef; - Aliasee : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMAddFunction - (M : in llvm.LLVMModuleRef; - Name : in Interfaces.C.Strings.chars_ptr; - FunctionTy : in llvm.LLVMTypeRef) - return llvm.LLVMValueRef; - - function LLVMGetNamedFunction - (M : in llvm.LLVMModuleRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMGetFirstFunction - (M : in llvm.LLVMModuleRef) - return llvm.LLVMValueRef; - - function LLVMGetLastFunction - (M : in llvm.LLVMModuleRef) - return llvm.LLVMValueRef; - - function LLVMGetNextFunction - (Fn : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMGetPreviousFunction - (Fn : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - procedure LLVMDeleteFunction (Fn : in llvm.LLVMValueRef); - - function LLVMGetIntrinsicID - (Fn : in llvm.LLVMValueRef) - return Interfaces.C.unsigned; - - function LLVMGetFunctionCallConv - (Fn : in llvm.LLVMValueRef) - return Interfaces.C.unsigned; - - procedure LLVMSetFunctionCallConv - (Fn : in llvm.LLVMValueRef; - CC : in Interfaces.C.unsigned); - - function LLVMGetGC - (Fn : in llvm.LLVMValueRef) - return Interfaces.C.Strings.chars_ptr; - - procedure LLVMSetGC - (Fn : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr); - - procedure LLVMAddFunctionAttr - (Fn : in llvm.LLVMValueRef; - PA : in llvm.LLVMAttribute); - - procedure LLVMRemoveFunctionAttr - (Fn : in llvm.LLVMValueRef; - PA : in llvm.LLVMAttribute); - - function LLVMCountParams - (Fn : in llvm.LLVMValueRef) - return Interfaces.C.unsigned; - - procedure LLVMGetParams - (Fn : in llvm.LLVMValueRef; - Params : access llvm.LLVMValueRef); - - function LLVMGetParam - (Fn : in llvm.LLVMValueRef; - Index : in Interfaces.C.unsigned) - return llvm.LLVMValueRef; - - function LLVMGetParamParent - (Inst : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMGetFirstParam - (Fn : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMGetLastParam - (Fn : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMGetNextParam - (Arg : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMGetPreviousParam - (Arg : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - procedure LLVMAddAttribute - (Arg : in llvm.LLVMValueRef; - PA : in llvm.LLVMAttribute); - - procedure LLVMRemoveAttribute - (Arg : in llvm.LLVMValueRef; - PA : in llvm.LLVMAttribute); - - procedure LLVMSetParamAlignment - (Arg : in llvm.LLVMValueRef; - align : in Interfaces.C.unsigned); - - function LLVMBasicBlockAsValue - (BB : in llvm.LLVMBasicBlockRef) - return llvm.LLVMValueRef; - - function LLVMValueIsBasicBlock - (Val : in llvm.LLVMValueRef) - return Interfaces.C.int; - - function LLVMValueAsBasicBlock - (Val : in llvm.LLVMValueRef) - return llvm.LLVMBasicBlockRef; - - function LLVMGetBasicBlockParent - (BB : in llvm.LLVMBasicBlockRef) - return llvm.LLVMValueRef; - - function LLVMCountBasicBlocks - (Fn : in llvm.LLVMValueRef) - return Interfaces.C.unsigned; - - procedure LLVMGetBasicBlocks - (Fn : in llvm.LLVMValueRef; - BasicBlocks : access llvm.LLVMBasicBlockRef); - - function LLVMGetFirstBasicBlock - (Fn : in llvm.LLVMValueRef) - return llvm.LLVMBasicBlockRef; - - function LLVMGetLastBasicBlock - (Fn : in llvm.LLVMValueRef) - return llvm.LLVMBasicBlockRef; - - function LLVMGetNextBasicBlock - (BB : in llvm.LLVMBasicBlockRef) - return llvm.LLVMBasicBlockRef; - - function LLVMGetPreviousBasicBlock - (BB : in llvm.LLVMBasicBlockRef) - return llvm.LLVMBasicBlockRef; - - function LLVMGetEntryBasicBlock - (Fn : in llvm.LLVMValueRef) - return llvm.LLVMBasicBlockRef; - - function LLVMAppendBasicBlock - (Fn : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMBasicBlockRef; - - function LLVMInsertBasicBlock - (InsertBeforeBB : in llvm.LLVMBasicBlockRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMBasicBlockRef; - - procedure LLVMDeleteBasicBlock (BB : in llvm.LLVMBasicBlockRef); - - function LLVMGetInstructionParent - (Inst : in llvm.LLVMValueRef) - return llvm.LLVMBasicBlockRef; - - function LLVMGetFirstInstruction - (BB : in llvm.LLVMBasicBlockRef) - return llvm.LLVMValueRef; - - function LLVMGetLastInstruction - (BB : in llvm.LLVMBasicBlockRef) - return llvm.LLVMValueRef; - - function LLVMGetNextInstruction - (Inst : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMGetPreviousInstruction - (Inst : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - procedure LLVMSetInstructionCallConv - (Instr : in llvm.LLVMValueRef; - CC : in Interfaces.C.unsigned); - - function LLVMGetInstructionCallConv - (Instr : in llvm.LLVMValueRef) - return Interfaces.C.unsigned; - - procedure LLVMAddInstrAttribute - (Instr : in llvm.LLVMValueRef; - index : in Interfaces.C.unsigned; - arg_1 : in llvm.LLVMAttribute); - - procedure LLVMRemoveInstrAttribute - (Instr : in llvm.LLVMValueRef; - index : in Interfaces.C.unsigned; - arg_1 : in llvm.LLVMAttribute); - - procedure LLVMSetInstrParamAlignment - (Instr : in llvm.LLVMValueRef; - index : in Interfaces.C.unsigned; - align : in Interfaces.C.unsigned); - - function LLVMIsTailCall - (CallInst : in llvm.LLVMValueRef) - return Interfaces.C.int; - - procedure LLVMSetTailCall - (CallInst : in llvm.LLVMValueRef; - IsTailCall : in Interfaces.C.int); - - procedure LLVMAddIncoming - (PhiNode : in llvm.LLVMValueRef; - IncomingValues : access llvm.LLVMValueRef; - IncomingBlocks : access llvm.LLVMBasicBlockRef; - Count : in Interfaces.C.unsigned); - - function LLVMCountIncoming - (PhiNode : in llvm.LLVMValueRef) - return Interfaces.C.unsigned; - - function LLVMGetIncomingValue - (PhiNode : in llvm.LLVMValueRef; - Index : in Interfaces.C.unsigned) - return llvm.LLVMValueRef; - - function LLVMGetIncomingBlock - (PhiNode : in llvm.LLVMValueRef; - Index : in Interfaces.C.unsigned) - return llvm.LLVMBasicBlockRef; - - function LLVMCreateBuilder return llvm.LLVMBuilderRef; - - procedure LLVMPositionBuilder - (Builder : in llvm.LLVMBuilderRef; - Block : in llvm.LLVMBasicBlockRef; - Instr : in llvm.LLVMValueRef); - - procedure LLVMPositionBuilderBefore - (Builder : in llvm.LLVMBuilderRef; - Instr : in llvm.LLVMValueRef); - - procedure LLVMPositionBuilderAtEnd - (Builder : in llvm.LLVMBuilderRef; - Block : in llvm.LLVMBasicBlockRef); - - function LLVMGetInsertBlock - (Builder : in llvm.LLVMBuilderRef) - return llvm.LLVMBasicBlockRef; - - procedure LLVMClearInsertionPosition (Builder : in llvm.LLVMBuilderRef); - - procedure LLVMInsertIntoBuilder - (Builder : in llvm.LLVMBuilderRef; - Instr : in llvm.LLVMValueRef); - - procedure LLVMDisposeBuilder (Builder : in llvm.LLVMBuilderRef); - - function LLVMBuildRetVoid - (arg_1 : in llvm.LLVMBuilderRef) - return llvm.LLVMValueRef; - - function LLVMBuildRet - (arg_1 : in llvm.LLVMBuilderRef; - V : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMBuildBr - (arg_1 : in llvm.LLVMBuilderRef; - Dest : in llvm.LLVMBasicBlockRef) - return llvm.LLVMValueRef; - - function LLVMBuildCondBr - (arg_1 : in llvm.LLVMBuilderRef; - the_If : in llvm.LLVMValueRef; - the_Then : in llvm.LLVMBasicBlockRef; - the_Else : in llvm.LLVMBasicBlockRef) - return llvm.LLVMValueRef; - - function LLVMBuildSwitch - (arg_1 : in llvm.LLVMBuilderRef; - V : in llvm.LLVMValueRef; - the_Else : in llvm.LLVMBasicBlockRef; - NumCases : in Interfaces.C.unsigned) - return llvm.LLVMValueRef; - - function LLVMBuildInvoke - (arg_1 : in llvm.LLVMBuilderRef; - Fn : in llvm.LLVMValueRef; - Args : access llvm.LLVMValueRef; - NumArgs : in Interfaces.C.unsigned; - the_Then : in llvm.LLVMBasicBlockRef; - Catch : in llvm.LLVMBasicBlockRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildUnwind - (arg_1 : in llvm.LLVMBuilderRef) - return llvm.LLVMValueRef; - - function LLVMBuildUnreachable - (arg_1 : in llvm.LLVMBuilderRef) - return llvm.LLVMValueRef; - - procedure LLVMAddCase - (Switch : in llvm.LLVMValueRef; - OnVal : in llvm.LLVMValueRef; - Dest : in llvm.LLVMBasicBlockRef); - - function LLVMBuildAdd - (arg_1 : in llvm.LLVMBuilderRef; - LHS : in llvm.LLVMValueRef; - RHS : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildSub - (arg_1 : in llvm.LLVMBuilderRef; - LHS : in llvm.LLVMValueRef; - RHS : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildMul - (arg_1 : in llvm.LLVMBuilderRef; - LHS : in llvm.LLVMValueRef; - RHS : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildUDiv - (arg_1 : in llvm.LLVMBuilderRef; - LHS : in llvm.LLVMValueRef; - RHS : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildSDiv - (arg_1 : in llvm.LLVMBuilderRef; - LHS : in llvm.LLVMValueRef; - RHS : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildFDiv - (arg_1 : in llvm.LLVMBuilderRef; - LHS : in llvm.LLVMValueRef; - RHS : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildURem - (arg_1 : in llvm.LLVMBuilderRef; - LHS : in llvm.LLVMValueRef; - RHS : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildSRem - (arg_1 : in llvm.LLVMBuilderRef; - LHS : in llvm.LLVMValueRef; - RHS : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildFRem - (arg_1 : in llvm.LLVMBuilderRef; - LHS : in llvm.LLVMValueRef; - RHS : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildShl - (arg_1 : in llvm.LLVMBuilderRef; - LHS : in llvm.LLVMValueRef; - RHS : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildLShr - (arg_1 : in llvm.LLVMBuilderRef; - LHS : in llvm.LLVMValueRef; - RHS : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildAShr - (arg_1 : in llvm.LLVMBuilderRef; - LHS : in llvm.LLVMValueRef; - RHS : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildAnd - (arg_1 : in llvm.LLVMBuilderRef; - LHS : in llvm.LLVMValueRef; - RHS : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildOr - (arg_1 : in llvm.LLVMBuilderRef; - LHS : in llvm.LLVMValueRef; - RHS : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildXor - (arg_1 : in llvm.LLVMBuilderRef; - LHS : in llvm.LLVMValueRef; - RHS : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildNeg - (arg_1 : in llvm.LLVMBuilderRef; - V : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildNot - (arg_1 : in llvm.LLVMBuilderRef; - V : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildMalloc - (arg_1 : in llvm.LLVMBuilderRef; - Ty : in llvm.LLVMTypeRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildArrayMalloc - (arg_1 : in llvm.LLVMBuilderRef; - Ty : in llvm.LLVMTypeRef; - Val : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildAlloca - (arg_1 : in llvm.LLVMBuilderRef; - Ty : in llvm.LLVMTypeRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildArrayAlloca - (arg_1 : in llvm.LLVMBuilderRef; - Ty : in llvm.LLVMTypeRef; - Val : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildFree - (arg_1 : in llvm.LLVMBuilderRef; - PointerVal : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMBuildLoad - (arg_1 : in llvm.LLVMBuilderRef; - PointerVal : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildStore - (arg_1 : in llvm.LLVMBuilderRef; - Val : in llvm.LLVMValueRef; - Ptr : in llvm.LLVMValueRef) - return llvm.LLVMValueRef; - - function LLVMBuildGEP - (B : in llvm.LLVMBuilderRef; - Pointer : in llvm.LLVMValueRef; - Indices : access llvm.LLVMValueRef; - NumIndices : in Interfaces.C.unsigned; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildTrunc - (arg_1 : in llvm.LLVMBuilderRef; - Val : in llvm.LLVMValueRef; - DestTy : in llvm.LLVMTypeRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildZExt - (arg_1 : in llvm.LLVMBuilderRef; - Val : in llvm.LLVMValueRef; - DestTy : in llvm.LLVMTypeRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildSExt - (arg_1 : in llvm.LLVMBuilderRef; - Val : in llvm.LLVMValueRef; - DestTy : in llvm.LLVMTypeRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildFPToUI - (arg_1 : in llvm.LLVMBuilderRef; - Val : in llvm.LLVMValueRef; - DestTy : in llvm.LLVMTypeRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildFPToSI - (arg_1 : in llvm.LLVMBuilderRef; - Val : in llvm.LLVMValueRef; - DestTy : in llvm.LLVMTypeRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildUIToFP - (arg_1 : in llvm.LLVMBuilderRef; - Val : in llvm.LLVMValueRef; - DestTy : in llvm.LLVMTypeRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildSIToFP - (arg_1 : in llvm.LLVMBuilderRef; - Val : in llvm.LLVMValueRef; - DestTy : in llvm.LLVMTypeRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildFPTrunc - (arg_1 : in llvm.LLVMBuilderRef; - Val : in llvm.LLVMValueRef; - DestTy : in llvm.LLVMTypeRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildFPExt - (arg_1 : in llvm.LLVMBuilderRef; - Val : in llvm.LLVMValueRef; - DestTy : in llvm.LLVMTypeRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildPtrToInt - (arg_1 : in llvm.LLVMBuilderRef; - Val : in llvm.LLVMValueRef; - DestTy : in llvm.LLVMTypeRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildIntToPtr - (arg_1 : in llvm.LLVMBuilderRef; - Val : in llvm.LLVMValueRef; - DestTy : in llvm.LLVMTypeRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildBitCast - (arg_1 : in llvm.LLVMBuilderRef; - Val : in llvm.LLVMValueRef; - DestTy : in llvm.LLVMTypeRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildICmp - (arg_1 : in llvm.LLVMBuilderRef; - Op : in llvm.LLVMIntPredicate; - LHS : in llvm.LLVMValueRef; - RHS : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildFCmp - (arg_1 : in llvm.LLVMBuilderRef; - Op : in llvm.LLVMRealPredicate; - LHS : in llvm.LLVMValueRef; - RHS : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildPhi - (arg_1 : in llvm.LLVMBuilderRef; - Ty : in llvm.LLVMTypeRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildCall - (arg_1 : in llvm.LLVMBuilderRef; - Fn : in llvm.LLVMValueRef; - Args : access llvm.LLVMValueRef; - NumArgs : in Interfaces.C.unsigned; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildSelect - (arg_1 : in llvm.LLVMBuilderRef; - the_If : in llvm.LLVMValueRef; - the_Then : in llvm.LLVMValueRef; - the_Else : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildVAArg - (arg_1 : in llvm.LLVMBuilderRef; - List : in llvm.LLVMValueRef; - Ty : in llvm.LLVMTypeRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildExtractElement - (arg_1 : in llvm.LLVMBuilderRef; - VecVal : in llvm.LLVMValueRef; - Index : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildInsertElement - (arg_1 : in llvm.LLVMBuilderRef; - VecVal : in llvm.LLVMValueRef; - EltVal : in llvm.LLVMValueRef; - Index : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildShuffleVector - (arg_1 : in llvm.LLVMBuilderRef; - V1 : in llvm.LLVMValueRef; - V2 : in llvm.LLVMValueRef; - Mask : in llvm.LLVMValueRef; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildExtractValue - (arg_1 : in llvm.LLVMBuilderRef; - AggVal : in llvm.LLVMValueRef; - Index : in Interfaces.C.unsigned; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMBuildInsertValue - (arg_1 : in llvm.LLVMBuilderRef; - AggVal : in llvm.LLVMValueRef; - EltVal : in llvm.LLVMValueRef; - Index : in Interfaces.C.unsigned; - Name : in Interfaces.C.Strings.chars_ptr) - return llvm.LLVMValueRef; - - function LLVMCreateModuleProviderForExistingModule - (M : in llvm.LLVMModuleRef) - return llvm.LLVMModuleProviderRef; - - procedure LLVMDisposeModuleProvider (MP : in llvm.LLVMModuleProviderRef); - - function LLVMCreateMemoryBufferWithContentsOfFile - (Path : in Interfaces.C.Strings.chars_ptr; - OutMemBuf : access llvm.LLVMMemoryBufferRef; - OutMessage : access Interfaces.C.Strings.chars_ptr) - return Interfaces.C.int; - - function LLVMCreateMemoryBufferWithSTDIN - (OutMemBuf : access llvm.LLVMMemoryBufferRef; - OutMessage : access Interfaces.C.Strings.chars_ptr) - return Interfaces.C.int; - - procedure LLVMDisposeMemoryBuffer (MemBuf : in llvm.LLVMMemoryBufferRef); - - function LLVMCreatePassManager return llvm.LLVMPassManagerRef; - - function LLVMCreateFunctionPassManager - (MP : in llvm.LLVMModuleProviderRef) - return llvm.LLVMPassManagerRef; - - function LLVMRunPassManager - (PM : in llvm.LLVMPassManagerRef; - M : in llvm.LLVMModuleRef) - return Interfaces.C.int; - - function LLVMInitializeFunctionPassManager - (FPM : in llvm.LLVMPassManagerRef) - return Interfaces.C.int; - - function LLVMRunFunctionPassManager - (FPM : in llvm.LLVMPassManagerRef; - F : in llvm.LLVMValueRef) - return Interfaces.C.int; - - function LLVMFinalizeFunctionPassManager - (FPM : in llvm.LLVMPassManagerRef) - return Interfaces.C.int; - - procedure LLVMDisposePassManager (PM : in llvm.LLVMPassManagerRef); - -private - - pragma Import (C, LLVMDisposeMessage, "Ada_LLVMDisposeMessage"); - pragma Import (C, LLVMContextCreate, "Ada_LLVMContextCreate"); - pragma Import (C, LLVMGetGlobalContext, "Ada_LLVMGetGlobalContext"); - pragma Import (C, LLVMContextDispose, "Ada_LLVMContextDispose"); - pragma Import - (C, - LLVMModuleCreateWithName, - "Ada_LLVMModuleCreateWithName"); - pragma Import - (C, - LLVMModuleCreateWithNameInContext, - "Ada_LLVMModuleCreateWithNameInContext"); - pragma Import (C, LLVMDisposeModule, "Ada_LLVMDisposeModule"); - pragma Import (C, LLVMGetDataLayout, "Ada_LLVMGetDataLayout"); - pragma Import (C, LLVMSetDataLayout, "Ada_LLVMSetDataLayout"); - pragma Import (C, LLVMGetTarget, "Ada_LLVMGetTarget"); - pragma Import (C, LLVMSetTarget, "Ada_LLVMSetTarget"); - pragma Import (C, LLVMAddTypeName, "Ada_LLVMAddTypeName"); - pragma Import (C, LLVMDeleteTypeName, "Ada_LLVMDeleteTypeName"); - pragma Import (C, LLVMGetTypeByName, "Ada_LLVMGetTypeByName"); - pragma Import (C, LLVMDumpModule, "Ada_LLVMDumpModule"); - pragma Import (C, LLVMGetTypeKind, "Ada_LLVMGetTypeKind"); - pragma Import (C, LLVMInt1Type, "Ada_LLVMInt1Type"); - pragma Import (C, LLVMInt8Type, "Ada_LLVMInt8Type"); - pragma Import (C, LLVMInt16Type, "Ada_LLVMInt16Type"); - pragma Import (C, LLVMInt32Type, "Ada_LLVMInt32Type"); - pragma Import (C, LLVMInt64Type, "Ada_LLVMInt64Type"); - pragma Import (C, LLVMIntType, "Ada_LLVMIntType"); - pragma Import (C, LLVMGetIntTypeWidth, "Ada_LLVMGetIntTypeWidth"); - pragma Import (C, LLVMFloatType, "Ada_LLVMFloatType"); - pragma Import (C, LLVMDoubleType, "Ada_LLVMDoubleType"); - pragma Import (C, LLVMX86FP80Type, "Ada_LLVMX86FP80Type"); - pragma Import (C, LLVMFP128Type, "Ada_LLVMFP128Type"); - pragma Import (C, LLVMPPCFP128Type, "Ada_LLVMPPCFP128Type"); - pragma Import (C, LLVMFunctionType, "Ada_LLVMFunctionType"); - pragma Import (C, LLVMIsFunctionVarArg, "Ada_LLVMIsFunctionVarArg"); - pragma Import (C, LLVMGetReturnType, "Ada_LLVMGetReturnType"); - pragma Import (C, LLVMCountParamTypes, "Ada_LLVMCountParamTypes"); - pragma Import (C, LLVMGetParamTypes, "Ada_LLVMGetParamTypes"); - pragma Import (C, LLVMStructType, "Ada_LLVMStructType"); - pragma Import - (C, - LLVMCountStructElementTypes, - "Ada_LLVMCountStructElementTypes"); - pragma Import - (C, - LLVMGetStructElementTypes, - "Ada_LLVMGetStructElementTypes"); - pragma Import (C, LLVMIsPackedStruct, "Ada_LLVMIsPackedStruct"); - pragma Import (C, LLVMArrayType, "Ada_LLVMArrayType"); - pragma Import (C, LLVMPointerType, "Ada_LLVMPointerType"); - pragma Import (C, LLVMVectorType, "Ada_LLVMVectorType"); - pragma Import (C, LLVMGetElementType, "Ada_LLVMGetElementType"); - pragma Import (C, LLVMGetArrayLength, "Ada_LLVMGetArrayLength"); - pragma Import - (C, - LLVMGetPointerAddressSpace, - "Ada_LLVMGetPointerAddressSpace"); - pragma Import (C, LLVMGetVectorSize, "Ada_LLVMGetVectorSize"); - pragma Import (C, LLVMVoidType, "Ada_LLVMVoidType"); - pragma Import (C, LLVMLabelType, "Ada_LLVMLabelType"); - pragma Import (C, LLVMOpaqueType, "Ada_LLVMOpaqueType"); - pragma Import (C, LLVMCreateTypeHandle, "Ada_LLVMCreateTypeHandle"); - pragma Import (C, LLVMRefineType, "Ada_LLVMRefineType"); - pragma Import (C, LLVMResolveTypeHandle, "Ada_LLVMResolveTypeHandle"); - pragma Import (C, LLVMDisposeTypeHandle, "Ada_LLVMDisposeTypeHandle"); - pragma Import (C, LLVMTypeOf, "Ada_LLVMTypeOf"); - pragma Import (C, LLVMGetValueName, "Ada_LLVMGetValueName"); - pragma Import (C, LLVMSetValueName, "Ada_LLVMSetValueName"); - pragma Import (C, LLVMDumpValue, "Ada_LLVMDumpValue"); - pragma Import (C, LLVMIsAArgument, "Ada_LLVMIsAArgument"); - pragma Import (C, LLVMIsABasicBlock, "Ada_LLVMIsABasicBlock"); - pragma Import (C, LLVMIsAInlineAsm, "Ada_LLVMIsAInlineAsm"); - pragma Import (C, LLVMIsAUser, "Ada_LLVMIsAUser"); - pragma Import (C, LLVMIsAConstant, "Ada_LLVMIsAConstant"); - pragma Import - (C, - LLVMIsAConstantAggregateZero, - "Ada_LLVMIsAConstantAggregateZero"); - pragma Import (C, LLVMIsAConstantArray, "Ada_LLVMIsAConstantArray"); - pragma Import (C, LLVMIsAConstantExpr, "Ada_LLVMIsAConstantExpr"); - pragma Import (C, LLVMIsAConstantFP, "Ada_LLVMIsAConstantFP"); - pragma Import (C, LLVMIsAConstantInt, "Ada_LLVMIsAConstantInt"); - pragma Import - (C, - LLVMIsAConstantPointerNull, - "Ada_LLVMIsAConstantPointerNull"); - pragma Import (C, LLVMIsAConstantStruct, "Ada_LLVMIsAConstantStruct"); - pragma Import (C, LLVMIsAConstantVector, "Ada_LLVMIsAConstantVector"); - pragma Import (C, LLVMIsAGlobalValue, "Ada_LLVMIsAGlobalValue"); - pragma Import (C, LLVMIsAFunction, "Ada_LLVMIsAFunction"); - pragma Import (C, LLVMIsAGlobalAlias, "Ada_LLVMIsAGlobalAlias"); - pragma Import (C, LLVMIsAGlobalVariable, "Ada_LLVMIsAGlobalVariable"); - pragma Import (C, LLVMIsAUndefValue, "Ada_LLVMIsAUndefValue"); - pragma Import (C, LLVMIsAInstruction, "Ada_LLVMIsAInstruction"); - pragma Import (C, LLVMIsABinaryOperator, "Ada_LLVMIsABinaryOperator"); - pragma Import (C, LLVMIsACallInst, "Ada_LLVMIsACallInst"); - pragma Import (C, LLVMIsAIntrinsicInst, "Ada_LLVMIsAIntrinsicInst"); - pragma Import (C, LLVMIsADbgInfoIntrinsic, "Ada_LLVMIsADbgInfoIntrinsic"); - pragma Import (C, LLVMIsADbgDeclareInst, "Ada_LLVMIsADbgDeclareInst"); - pragma Import (C, LLVMIsADbgFuncStartInst, "Ada_LLVMIsADbgFuncStartInst"); - pragma Import (C, LLVMIsADbgRegionEndInst, "Ada_LLVMIsADbgRegionEndInst"); - pragma Import - (C, - LLVMIsADbgRegionStartInst, - "Ada_LLVMIsADbgRegionStartInst"); - pragma Import (C, LLVMIsADbgStopPointInst, "Ada_LLVMIsADbgStopPointInst"); - pragma Import (C, LLVMIsAEHSelectorInst, "Ada_LLVMIsAEHSelectorInst"); - pragma Import (C, LLVMIsAMemIntrinsic, "Ada_LLVMIsAMemIntrinsic"); - pragma Import (C, LLVMIsAMemCpyInst, "Ada_LLVMIsAMemCpyInst"); - pragma Import (C, LLVMIsAMemMoveInst, "Ada_LLVMIsAMemMoveInst"); - pragma Import (C, LLVMIsAMemSetInst, "Ada_LLVMIsAMemSetInst"); - pragma Import (C, LLVMIsACmpInst, "Ada_LLVMIsACmpInst"); - pragma Import (C, LLVMIsAFCmpInst, "Ada_LLVMIsAFCmpInst"); - pragma Import (C, LLVMIsAICmpInst, "Ada_LLVMIsAICmpInst"); - pragma Import - (C, - LLVMIsAExtractElementInst, - "Ada_LLVMIsAExtractElementInst"); - pragma Import - (C, - LLVMIsAGetElementPtrInst, - "Ada_LLVMIsAGetElementPtrInst"); - pragma Import - (C, - LLVMIsAInsertElementInst, - "Ada_LLVMIsAInsertElementInst"); - pragma Import (C, LLVMIsAInsertValueInst, "Ada_LLVMIsAInsertValueInst"); - pragma Import (C, LLVMIsAPHINode, "Ada_LLVMIsAPHINode"); - pragma Import (C, LLVMIsASelectInst, "Ada_LLVMIsASelectInst"); - pragma Import - (C, - LLVMIsAShuffleVectorInst, - "Ada_LLVMIsAShuffleVectorInst"); - pragma Import (C, LLVMIsAStoreInst, "Ada_LLVMIsAStoreInst"); - pragma Import (C, LLVMIsATerminatorInst, "Ada_LLVMIsATerminatorInst"); - pragma Import (C, LLVMIsABranchInst, "Ada_LLVMIsABranchInst"); - pragma Import (C, LLVMIsAInvokeInst, "Ada_LLVMIsAInvokeInst"); - pragma Import (C, LLVMIsAReturnInst, "Ada_LLVMIsAReturnInst"); - pragma Import (C, LLVMIsASwitchInst, "Ada_LLVMIsASwitchInst"); - pragma Import (C, LLVMIsAUnreachableInst, "Ada_LLVMIsAUnreachableInst"); - pragma Import (C, LLVMIsAUnwindInst, "Ada_LLVMIsAUnwindInst"); - pragma Import (C, LLVMIsAUnaryInstruction, "Ada_LLVMIsAUnaryInstruction"); - pragma Import (C, LLVMIsAAllocationInst, "Ada_LLVMIsAAllocationInst"); - pragma Import (C, LLVMIsAAllocaInst, "Ada_LLVMIsAAllocaInst"); - pragma Import (C, LLVMIsAMallocInst, "Ada_LLVMIsAMallocInst"); - pragma Import (C, LLVMIsACastInst, "Ada_LLVMIsACastInst"); - pragma Import (C, LLVMIsABitCastInst, "Ada_LLVMIsABitCastInst"); - pragma Import (C, LLVMIsAFPExtInst, "Ada_LLVMIsAFPExtInst"); - pragma Import (C, LLVMIsAFPToSIInst, "Ada_LLVMIsAFPToSIInst"); - pragma Import (C, LLVMIsAFPToUIInst, "Ada_LLVMIsAFPToUIInst"); - pragma Import (C, LLVMIsAFPTruncInst, "Ada_LLVMIsAFPTruncInst"); - pragma Import (C, LLVMIsAIntToPtrInst, "Ada_LLVMIsAIntToPtrInst"); - pragma Import (C, LLVMIsAPtrToIntInst, "Ada_LLVMIsAPtrToIntInst"); - pragma Import (C, LLVMIsASExtInst, "Ada_LLVMIsASExtInst"); - pragma Import (C, LLVMIsASIToFPInst, "Ada_LLVMIsASIToFPInst"); - pragma Import (C, LLVMIsATruncInst, "Ada_LLVMIsATruncInst"); - pragma Import (C, LLVMIsAUIToFPInst, "Ada_LLVMIsAUIToFPInst"); - pragma Import (C, LLVMIsAZExtInst, "Ada_LLVMIsAZExtInst"); - pragma Import (C, LLVMIsAExtractValueInst, "Ada_LLVMIsAExtractValueInst"); - pragma Import (C, LLVMIsAFreeInst, "Ada_LLVMIsAFreeInst"); - pragma Import (C, LLVMIsALoadInst, "Ada_LLVMIsALoadInst"); - pragma Import (C, LLVMIsAVAArgInst, "Ada_LLVMIsAVAArgInst"); - pragma Import (C, LLVMConstNull, "Ada_LLVMConstNull"); - pragma Import (C, LLVMConstAllOnes, "Ada_LLVMConstAllOnes"); - pragma Import (C, LLVMGetUndef, "Ada_LLVMGetUndef"); - pragma Import (C, LLVMIsConstant, "Ada_LLVMIsConstant"); - pragma Import (C, LLVMIsNull, "Ada_LLVMIsNull"); - pragma Import (C, LLVMIsUndef, "Ada_LLVMIsUndef"); - pragma Import (C, LLVMConstPointerNull, "Ada_LLVMConstPointerNull"); - pragma Import (C, LLVMConstInt, "Ada_LLVMConstInt"); - pragma Import (C, LLVMConstReal, "Ada_LLVMConstReal"); - pragma Import (C, LLVMConstRealOfString, "Ada_LLVMConstRealOfString"); - pragma Import (C, LLVMConstString, "Ada_LLVMConstString"); - pragma Import (C, LLVMConstArray, "Ada_LLVMConstArray"); - pragma Import (C, LLVMConstStruct, "Ada_LLVMConstStruct"); - pragma Import (C, LLVMConstVector, "Ada_LLVMConstVector"); - pragma Import (C, LLVMSizeOf, "Ada_LLVMSizeOf"); - pragma Import (C, LLVMConstNeg, "Ada_LLVMConstNeg"); - pragma Import (C, LLVMConstNot, "Ada_LLVMConstNot"); - pragma Import (C, LLVMConstAdd, "Ada_LLVMConstAdd"); - pragma Import (C, LLVMConstSub, "Ada_LLVMConstSub"); - pragma Import (C, LLVMConstMul, "Ada_LLVMConstMul"); - pragma Import (C, LLVMConstUDiv, "Ada_LLVMConstUDiv"); - pragma Import (C, LLVMConstSDiv, "Ada_LLVMConstSDiv"); - pragma Import (C, LLVMConstFDiv, "Ada_LLVMConstFDiv"); - pragma Import (C, LLVMConstURem, "Ada_LLVMConstURem"); - pragma Import (C, LLVMConstSRem, "Ada_LLVMConstSRem"); - pragma Import (C, LLVMConstFRem, "Ada_LLVMConstFRem"); - pragma Import (C, LLVMConstAnd, "Ada_LLVMConstAnd"); - pragma Import (C, LLVMConstOr, "Ada_LLVMConstOr"); - pragma Import (C, LLVMConstXor, "Ada_LLVMConstXor"); - pragma Import (C, LLVMConstICmp, "Ada_LLVMConstICmp"); - pragma Import (C, LLVMConstFCmp, "Ada_LLVMConstFCmp"); - pragma Import (C, LLVMConstShl, "Ada_LLVMConstShl"); - pragma Import (C, LLVMConstLShr, "Ada_LLVMConstLShr"); - pragma Import (C, LLVMConstAShr, "Ada_LLVMConstAShr"); - pragma Import (C, LLVMConstGEP, "Ada_LLVMConstGEP"); - pragma Import (C, LLVMConstTrunc, "Ada_LLVMConstTrunc"); - pragma Import (C, LLVMConstSExt, "Ada_LLVMConstSExt"); - pragma Import (C, LLVMConstZExt, "Ada_LLVMConstZExt"); - pragma Import (C, LLVMConstFPTrunc, "Ada_LLVMConstFPTrunc"); - pragma Import (C, LLVMConstFPExt, "Ada_LLVMConstFPExt"); - pragma Import (C, LLVMConstUIToFP, "Ada_LLVMConstUIToFP"); - pragma Import (C, LLVMConstSIToFP, "Ada_LLVMConstSIToFP"); - pragma Import (C, LLVMConstFPToUI, "Ada_LLVMConstFPToUI"); - pragma Import (C, LLVMConstFPToSI, "Ada_LLVMConstFPToSI"); - pragma Import (C, LLVMConstPtrToInt, "Ada_LLVMConstPtrToInt"); - pragma Import (C, LLVMConstIntToPtr, "Ada_LLVMConstIntToPtr"); - pragma Import (C, LLVMConstBitCast, "Ada_LLVMConstBitCast"); - pragma Import (C, LLVMConstSelect, "Ada_LLVMConstSelect"); - pragma Import (C, LLVMConstExtractElement, "Ada_LLVMConstExtractElement"); - pragma Import (C, LLVMConstInsertElement, "Ada_LLVMConstInsertElement"); - pragma Import (C, LLVMConstShuffleVector, "Ada_LLVMConstShuffleVector"); - pragma Import (C, LLVMConstExtractValue, "Ada_LLVMConstExtractValue"); - pragma Import (C, LLVMConstInsertValue, "Ada_LLVMConstInsertValue"); - pragma Import (C, LLVMConstInlineAsm, "Ada_LLVMConstInlineAsm"); - pragma Import (C, LLVMGetGlobalParent, "Ada_LLVMGetGlobalParent"); - pragma Import (C, LLVMIsDeclaration, "Ada_LLVMIsDeclaration"); - pragma Import (C, LLVMGetLinkage, "Ada_LLVMGetLinkage"); - pragma Import (C, LLVMSetLinkage, "Ada_LLVMSetLinkage"); - pragma Import (C, LLVMGetSection, "Ada_LLVMGetSection"); - pragma Import (C, LLVMSetSection, "Ada_LLVMSetSection"); - pragma Import (C, LLVMGetVisibility, "Ada_LLVMGetVisibility"); - pragma Import (C, LLVMSetVisibility, "Ada_LLVMSetVisibility"); - pragma Import (C, LLVMGetAlignment, "Ada_LLVMGetAlignment"); - pragma Import (C, LLVMSetAlignment, "Ada_LLVMSetAlignment"); - pragma Import (C, LLVMAddGlobal, "Ada_LLVMAddGlobal"); - pragma Import (C, LLVMGetNamedGlobal, "Ada_LLVMGetNamedGlobal"); - pragma Import (C, LLVMGetFirstGlobal, "Ada_LLVMGetFirstGlobal"); - pragma Import (C, LLVMGetLastGlobal, "Ada_LLVMGetLastGlobal"); - pragma Import (C, LLVMGetNextGlobal, "Ada_LLVMGetNextGlobal"); - pragma Import (C, LLVMGetPreviousGlobal, "Ada_LLVMGetPreviousGlobal"); - pragma Import (C, LLVMDeleteGlobal, "Ada_LLVMDeleteGlobal"); - pragma Import (C, LLVMGetInitializer, "Ada_LLVMGetInitializer"); - pragma Import (C, LLVMSetInitializer, "Ada_LLVMSetInitializer"); - pragma Import (C, LLVMIsThreadLocal, "Ada_LLVMIsThreadLocal"); - pragma Import (C, LLVMSetThreadLocal, "Ada_LLVMSetThreadLocal"); - pragma Import (C, LLVMIsGlobalConstant, "Ada_LLVMIsGlobalConstant"); - pragma Import (C, LLVMSetGlobalConstant, "Ada_LLVMSetGlobalConstant"); - pragma Import (C, LLVMAddAlias, "Ada_LLVMAddAlias"); - pragma Import (C, LLVMAddFunction, "Ada_LLVMAddFunction"); - pragma Import (C, LLVMGetNamedFunction, "Ada_LLVMGetNamedFunction"); - pragma Import (C, LLVMGetFirstFunction, "Ada_LLVMGetFirstFunction"); - pragma Import (C, LLVMGetLastFunction, "Ada_LLVMGetLastFunction"); - pragma Import (C, LLVMGetNextFunction, "Ada_LLVMGetNextFunction"); - pragma Import (C, LLVMGetPreviousFunction, "Ada_LLVMGetPreviousFunction"); - pragma Import (C, LLVMDeleteFunction, "Ada_LLVMDeleteFunction"); - pragma Import (C, LLVMGetIntrinsicID, "Ada_LLVMGetIntrinsicID"); - pragma Import (C, LLVMGetFunctionCallConv, "Ada_LLVMGetFunctionCallConv"); - pragma Import (C, LLVMSetFunctionCallConv, "Ada_LLVMSetFunctionCallConv"); - pragma Import (C, LLVMGetGC, "Ada_LLVMGetGC"); - pragma Import (C, LLVMSetGC, "Ada_LLVMSetGC"); - pragma Import (C, LLVMAddFunctionAttr, "Ada_LLVMAddFunctionAttr"); - pragma Import (C, LLVMRemoveFunctionAttr, "Ada_LLVMRemoveFunctionAttr"); - pragma Import (C, LLVMCountParams, "Ada_LLVMCountParams"); - pragma Import (C, LLVMGetParams, "Ada_LLVMGetParams"); - pragma Import (C, LLVMGetParam, "Ada_LLVMGetParam"); - pragma Import (C, LLVMGetParamParent, "Ada_LLVMGetParamParent"); - pragma Import (C, LLVMGetFirstParam, "Ada_LLVMGetFirstParam"); - pragma Import (C, LLVMGetLastParam, "Ada_LLVMGetLastParam"); - pragma Import (C, LLVMGetNextParam, "Ada_LLVMGetNextParam"); - pragma Import (C, LLVMGetPreviousParam, "Ada_LLVMGetPreviousParam"); - pragma Import (C, LLVMAddAttribute, "Ada_LLVMAddAttribute"); - pragma Import (C, LLVMRemoveAttribute, "Ada_LLVMRemoveAttribute"); - pragma Import (C, LLVMSetParamAlignment, "Ada_LLVMSetParamAlignment"); - pragma Import (C, LLVMBasicBlockAsValue, "Ada_LLVMBasicBlockAsValue"); - pragma Import (C, LLVMValueIsBasicBlock, "Ada_LLVMValueIsBasicBlock"); - pragma Import (C, LLVMValueAsBasicBlock, "Ada_LLVMValueAsBasicBlock"); - pragma Import (C, LLVMGetBasicBlockParent, "Ada_LLVMGetBasicBlockParent"); - pragma Import (C, LLVMCountBasicBlocks, "Ada_LLVMCountBasicBlocks"); - pragma Import (C, LLVMGetBasicBlocks, "Ada_LLVMGetBasicBlocks"); - pragma Import (C, LLVMGetFirstBasicBlock, "Ada_LLVMGetFirstBasicBlock"); - pragma Import (C, LLVMGetLastBasicBlock, "Ada_LLVMGetLastBasicBlock"); - pragma Import (C, LLVMGetNextBasicBlock, "Ada_LLVMGetNextBasicBlock"); - pragma Import - (C, - LLVMGetPreviousBasicBlock, - "Ada_LLVMGetPreviousBasicBlock"); - pragma Import (C, LLVMGetEntryBasicBlock, "Ada_LLVMGetEntryBasicBlock"); - pragma Import (C, LLVMAppendBasicBlock, "Ada_LLVMAppendBasicBlock"); - pragma Import (C, LLVMInsertBasicBlock, "Ada_LLVMInsertBasicBlock"); - pragma Import (C, LLVMDeleteBasicBlock, "Ada_LLVMDeleteBasicBlock"); - pragma Import - (C, - LLVMGetInstructionParent, - "Ada_LLVMGetInstructionParent"); - pragma Import (C, LLVMGetFirstInstruction, "Ada_LLVMGetFirstInstruction"); - pragma Import (C, LLVMGetLastInstruction, "Ada_LLVMGetLastInstruction"); - pragma Import (C, LLVMGetNextInstruction, "Ada_LLVMGetNextInstruction"); - pragma Import - (C, - LLVMGetPreviousInstruction, - "Ada_LLVMGetPreviousInstruction"); - pragma Import - (C, - LLVMSetInstructionCallConv, - "Ada_LLVMSetInstructionCallConv"); - pragma Import - (C, - LLVMGetInstructionCallConv, - "Ada_LLVMGetInstructionCallConv"); - pragma Import (C, LLVMAddInstrAttribute, "Ada_LLVMAddInstrAttribute"); - pragma Import - (C, - LLVMRemoveInstrAttribute, - "Ada_LLVMRemoveInstrAttribute"); - pragma Import - (C, - LLVMSetInstrParamAlignment, - "Ada_LLVMSetInstrParamAlignment"); - pragma Import (C, LLVMIsTailCall, "Ada_LLVMIsTailCall"); - pragma Import (C, LLVMSetTailCall, "Ada_LLVMSetTailCall"); - pragma Import (C, LLVMAddIncoming, "Ada_LLVMAddIncoming"); - pragma Import (C, LLVMCountIncoming, "Ada_LLVMCountIncoming"); - pragma Import (C, LLVMGetIncomingValue, "Ada_LLVMGetIncomingValue"); - pragma Import (C, LLVMGetIncomingBlock, "Ada_LLVMGetIncomingBlock"); - pragma Import (C, LLVMCreateBuilder, "Ada_LLVMCreateBuilder"); - pragma Import (C, LLVMPositionBuilder, "Ada_LLVMPositionBuilder"); - pragma Import - (C, - LLVMPositionBuilderBefore, - "Ada_LLVMPositionBuilderBefore"); - pragma Import - (C, - LLVMPositionBuilderAtEnd, - "Ada_LLVMPositionBuilderAtEnd"); - pragma Import (C, LLVMGetInsertBlock, "Ada_LLVMGetInsertBlock"); - pragma Import - (C, - LLVMClearInsertionPosition, - "Ada_LLVMClearInsertionPosition"); - pragma Import (C, LLVMInsertIntoBuilder, "Ada_LLVMInsertIntoBuilder"); - pragma Import (C, LLVMDisposeBuilder, "Ada_LLVMDisposeBuilder"); - pragma Import (C, LLVMBuildRetVoid, "Ada_LLVMBuildRetVoid"); - pragma Import (C, LLVMBuildRet, "Ada_LLVMBuildRet"); - pragma Import (C, LLVMBuildBr, "Ada_LLVMBuildBr"); - pragma Import (C, LLVMBuildCondBr, "Ada_LLVMBuildCondBr"); - pragma Import (C, LLVMBuildSwitch, "Ada_LLVMBuildSwitch"); - pragma Import (C, LLVMBuildInvoke, "Ada_LLVMBuildInvoke"); - pragma Import (C, LLVMBuildUnwind, "Ada_LLVMBuildUnwind"); - pragma Import (C, LLVMBuildUnreachable, "Ada_LLVMBuildUnreachable"); - pragma Import (C, LLVMAddCase, "Ada_LLVMAddCase"); - pragma Import (C, LLVMBuildAdd, "Ada_LLVMBuildAdd"); - pragma Import (C, LLVMBuildSub, "Ada_LLVMBuildSub"); - pragma Import (C, LLVMBuildMul, "Ada_LLVMBuildMul"); - pragma Import (C, LLVMBuildUDiv, "Ada_LLVMBuildUDiv"); - pragma Import (C, LLVMBuildSDiv, "Ada_LLVMBuildSDiv"); - pragma Import (C, LLVMBuildFDiv, "Ada_LLVMBuildFDiv"); - pragma Import (C, LLVMBuildURem, "Ada_LLVMBuildURem"); - pragma Import (C, LLVMBuildSRem, "Ada_LLVMBuildSRem"); - pragma Import (C, LLVMBuildFRem, "Ada_LLVMBuildFRem"); - pragma Import (C, LLVMBuildShl, "Ada_LLVMBuildShl"); - pragma Import (C, LLVMBuildLShr, "Ada_LLVMBuildLShr"); - pragma Import (C, LLVMBuildAShr, "Ada_LLVMBuildAShr"); - pragma Import (C, LLVMBuildAnd, "Ada_LLVMBuildAnd"); - pragma Import (C, LLVMBuildOr, "Ada_LLVMBuildOr"); - pragma Import (C, LLVMBuildXor, "Ada_LLVMBuildXor"); - pragma Import (C, LLVMBuildNeg, "Ada_LLVMBuildNeg"); - pragma Import (C, LLVMBuildNot, "Ada_LLVMBuildNot"); - pragma Import (C, LLVMBuildMalloc, "Ada_LLVMBuildMalloc"); - pragma Import (C, LLVMBuildArrayMalloc, "Ada_LLVMBuildArrayMalloc"); - pragma Import (C, LLVMBuildAlloca, "Ada_LLVMBuildAlloca"); - pragma Import (C, LLVMBuildArrayAlloca, "Ada_LLVMBuildArrayAlloca"); - pragma Import (C, LLVMBuildFree, "Ada_LLVMBuildFree"); - pragma Import (C, LLVMBuildLoad, "Ada_LLVMBuildLoad"); - pragma Import (C, LLVMBuildStore, "Ada_LLVMBuildStore"); - pragma Import (C, LLVMBuildGEP, "Ada_LLVMBuildGEP"); - pragma Import (C, LLVMBuildTrunc, "Ada_LLVMBuildTrunc"); - pragma Import (C, LLVMBuildZExt, "Ada_LLVMBuildZExt"); - pragma Import (C, LLVMBuildSExt, "Ada_LLVMBuildSExt"); - pragma Import (C, LLVMBuildFPToUI, "Ada_LLVMBuildFPToUI"); - pragma Import (C, LLVMBuildFPToSI, "Ada_LLVMBuildFPToSI"); - pragma Import (C, LLVMBuildUIToFP, "Ada_LLVMBuildUIToFP"); - pragma Import (C, LLVMBuildSIToFP, "Ada_LLVMBuildSIToFP"); - pragma Import (C, LLVMBuildFPTrunc, "Ada_LLVMBuildFPTrunc"); - pragma Import (C, LLVMBuildFPExt, "Ada_LLVMBuildFPExt"); - pragma Import (C, LLVMBuildPtrToInt, "Ada_LLVMBuildPtrToInt"); - pragma Import (C, LLVMBuildIntToPtr, "Ada_LLVMBuildIntToPtr"); - pragma Import (C, LLVMBuildBitCast, "Ada_LLVMBuildBitCast"); - pragma Import (C, LLVMBuildICmp, "Ada_LLVMBuildICmp"); - pragma Import (C, LLVMBuildFCmp, "Ada_LLVMBuildFCmp"); - pragma Import (C, LLVMBuildPhi, "Ada_LLVMBuildPhi"); - pragma Import (C, LLVMBuildCall, "Ada_LLVMBuildCall"); - pragma Import (C, LLVMBuildSelect, "Ada_LLVMBuildSelect"); - pragma Import (C, LLVMBuildVAArg, "Ada_LLVMBuildVAArg"); - pragma Import (C, LLVMBuildExtractElement, "Ada_LLVMBuildExtractElement"); - pragma Import (C, LLVMBuildInsertElement, "Ada_LLVMBuildInsertElement"); - pragma Import (C, LLVMBuildShuffleVector, "Ada_LLVMBuildShuffleVector"); - pragma Import (C, LLVMBuildExtractValue, "Ada_LLVMBuildExtractValue"); - pragma Import (C, LLVMBuildInsertValue, "Ada_LLVMBuildInsertValue"); - pragma Import - (C, - LLVMCreateModuleProviderForExistingModule, - "Ada_LLVMCreateModuleProviderForExistingModule"); - pragma Import - (C, - LLVMDisposeModuleProvider, - "Ada_LLVMDisposeModuleProvider"); - pragma Import - (C, - LLVMCreateMemoryBufferWithContentsOfFile, - "Ada_LLVMCreateMemoryBufferWithContentsOfFile"); - pragma Import - (C, - LLVMCreateMemoryBufferWithSTDIN, - "Ada_LLVMCreateMemoryBufferWithSTDIN"); - pragma Import (C, LLVMDisposeMemoryBuffer, "Ada_LLVMDisposeMemoryBuffer"); - pragma Import (C, LLVMCreatePassManager, "Ada_LLVMCreatePassManager"); - pragma Import - (C, - LLVMCreateFunctionPassManager, - "Ada_LLVMCreateFunctionPassManager"); - pragma Import (C, LLVMRunPassManager, "Ada_LLVMRunPassManager"); - pragma Import - (C, - LLVMInitializeFunctionPassManager, - "Ada_LLVMInitializeFunctionPassManager"); - pragma Import - (C, - LLVMRunFunctionPassManager, - "Ada_LLVMRunFunctionPassManager"); - pragma Import - (C, - LLVMFinalizeFunctionPassManager, - "Ada_LLVMFinalizeFunctionPassManager"); - pragma Import (C, LLVMDisposePassManager, "Ada_LLVMDisposePassManager"); - -end llvm.Binding; diff --git a/contrib/llvm/bindings/ada/llvm/llvm.ads b/contrib/llvm/bindings/ada/llvm/llvm.ads deleted file mode 100644 index 20fc940f8c24..000000000000 --- a/contrib/llvm/bindings/ada/llvm/llvm.ads +++ /dev/null @@ -1,497 +0,0 @@ --- 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, - LLVMLinkerPrivateWeakLinkage, - LinkerPrivateWeakDefAutoLinkage); - - 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, - LLVMLinkerPrivateWeakLinkage => 15, - LinkerPrivateWeakDefAutoLinkage => 16); - - 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; diff --git a/contrib/llvm/bindings/ada/llvm/llvm_link_time_optimizer-binding.ads b/contrib/llvm/bindings/ada/llvm/llvm_link_time_optimizer-binding.ads deleted file mode 100644 index 7c0b086b4282..000000000000 --- a/contrib/llvm/bindings/ada/llvm/llvm_link_time_optimizer-binding.ads +++ /dev/null @@ -1,207 +0,0 @@ --- 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; diff --git a/contrib/llvm/bindings/ada/llvm/llvm_link_time_optimizer.ads b/contrib/llvm/bindings/ada/llvm/llvm_link_time_optimizer.ads deleted file mode 100644 index c27f7c5893b6..000000000000 --- a/contrib/llvm/bindings/ada/llvm/llvm_link_time_optimizer.ads +++ /dev/null @@ -1,184 +0,0 @@ --- 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; diff --git a/contrib/llvm/bindings/ada/llvm/llvm_linktimeoptimizer_wrap.cxx b/contrib/llvm/bindings/ada/llvm/llvm_linktimeoptimizer_wrap.cxx deleted file mode 100644 index eb2e7ab15633..000000000000 --- a/contrib/llvm/bindings/ada/llvm/llvm_linktimeoptimizer_wrap.cxx +++ /dev/null @@ -1,923 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 class SwigValueWrapper { - T *tt; -public: - SwigValueWrapper() : tt(0) { } - SwigValueWrapper(const SwigValueWrapper& 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& rhs); -}; - -template 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 -#include -#include -#if defined(_WIN32) || defined(__CYGWIN32__) -# define DllExport __declspec( dllexport ) -# define SWIGSTDCALL __stdcall -#else -# define DllExport -# define SWIGSTDCALL -#endif - - -#ifdef __cplusplus -# include -#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 - diff --git a/contrib/llvm/bindings/ada/llvm/llvm_wrap.cxx b/contrib/llvm/bindings/ada/llvm/llvm_wrap.cxx deleted file mode 100644 index 79b19ff4c0bb..000000000000 --- a/contrib/llvm/bindings/ada/llvm/llvm_wrap.cxx +++ /dev/null @@ -1,8817 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 class SwigValueWrapper { - T *tt; -public: - SwigValueWrapper() : tt(0) { } - SwigValueWrapper(const SwigValueWrapper& 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& rhs); -}; - -template 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 -#include -#include -#if defined(_WIN32) || defined(__CYGWIN32__) -# define DllExport __declspec( dllexport ) -# define SWIGSTDCALL __stdcall -#else -# define DllExport -# define SWIGSTDCALL -#endif - - -#ifdef __cplusplus -# include -#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 (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(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; -// struct LLVMOpaqueType; -// struct LLVMOpaqueValue; - -#undef protected -#undef private -#ifdef __cplusplus -extern "C" { -#endif -DllExport void SWIGSTDCALL Ada_LLVMDisposeMessage ( - char * jarg1 - ) -{ - char *arg1 = (char *) 0 ; - - arg1 = jarg1; - - LLVMDisposeMessage(arg1); - - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMContextCreate ( - ) -{ - void * jresult ; - LLVMContextRef result; - - result = (LLVMContextRef)LLVMContextCreate(); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetGlobalContext ( - ) -{ - void * jresult ; - LLVMContextRef result; - - result = (LLVMContextRef)LLVMGetGlobalContext(); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMContextDispose ( - void * jarg1 - ) -{ - LLVMContextRef arg1 = (LLVMContextRef) 0 ; - - arg1 = (LLVMContextRef)jarg1; - - LLVMContextDispose(arg1); - - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMModuleCreateWithName ( - char * jarg1 - ) -{ - void * jresult ; - char *arg1 = (char *) 0 ; - LLVMModuleRef result; - - arg1 = jarg1; - - result = (LLVMModuleRef)LLVMModuleCreateWithName((char const *)arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMModuleCreateWithNameInContext ( - char * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - char *arg1 = (char *) 0 ; - LLVMContextRef arg2 = (LLVMContextRef) 0 ; - LLVMModuleRef result; - - arg1 = jarg1; - - arg2 = (LLVMContextRef)jarg2; - - result = (LLVMModuleRef)LLVMModuleCreateWithNameInContext((char const *)arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMDisposeModule ( - void * jarg1 - ) -{ - LLVMModuleRef arg1 = (LLVMModuleRef) 0 ; - - arg1 = (LLVMModuleRef)jarg1; - - LLVMDisposeModule(arg1); - - -} - - - -DllExport char * SWIGSTDCALL Ada_LLVMGetDataLayout ( - void * jarg1 - ) -{ - char * jresult ; - LLVMModuleRef arg1 = (LLVMModuleRef) 0 ; - char *result = 0 ; - - arg1 = (LLVMModuleRef)jarg1; - - result = (char *)LLVMGetDataLayout(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMSetDataLayout ( - void * jarg1 - , - - char * jarg2 - ) -{ - LLVMModuleRef arg1 = (LLVMModuleRef) 0 ; - char *arg2 = (char *) 0 ; - - arg1 = (LLVMModuleRef)jarg1; - - arg2 = jarg2; - - LLVMSetDataLayout(arg1,(char const *)arg2); - - -} - - - -DllExport char * SWIGSTDCALL Ada_LLVMGetTarget ( - void * jarg1 - ) -{ - char * jresult ; - LLVMModuleRef arg1 = (LLVMModuleRef) 0 ; - char *result = 0 ; - - arg1 = (LLVMModuleRef)jarg1; - - result = (char *)LLVMGetTarget(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMSetTarget ( - void * jarg1 - , - - char * jarg2 - ) -{ - LLVMModuleRef arg1 = (LLVMModuleRef) 0 ; - char *arg2 = (char *) 0 ; - - arg1 = (LLVMModuleRef)jarg1; - - arg2 = jarg2; - - LLVMSetTarget(arg1,(char const *)arg2); - - -} - - - -DllExport int SWIGSTDCALL Ada_LLVMAddTypeName ( - void * jarg1 - , - - char * jarg2 - , - - void * jarg3 - ) -{ - int jresult ; - LLVMModuleRef arg1 = (LLVMModuleRef) 0 ; - char *arg2 = (char *) 0 ; - LLVMTypeRef arg3 = (LLVMTypeRef) 0 ; - int result; - - arg1 = (LLVMModuleRef)jarg1; - - arg2 = jarg2; - - arg3 = (LLVMTypeRef)jarg3; - - result = (int)LLVMAddTypeName(arg1,(char const *)arg2,arg3); - jresult = result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMDeleteTypeName ( - void * jarg1 - , - - char * jarg2 - ) -{ - LLVMModuleRef arg1 = (LLVMModuleRef) 0 ; - char *arg2 = (char *) 0 ; - - arg1 = (LLVMModuleRef)jarg1; - - arg2 = jarg2; - - LLVMDeleteTypeName(arg1,(char const *)arg2); - - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetTypeByName ( - void * jarg1 - , - - char * jarg2 - ) -{ - void * jresult ; - LLVMModuleRef arg1 = (LLVMModuleRef) 0 ; - char *arg2 = (char *) 0 ; - LLVMTypeRef result; - - arg1 = (LLVMModuleRef)jarg1; - - arg2 = jarg2; - - result = (LLVMTypeRef)LLVMGetTypeByName(arg1,(char const *)arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMDumpModule ( - void * jarg1 - ) -{ - LLVMModuleRef arg1 = (LLVMModuleRef) 0 ; - - arg1 = (LLVMModuleRef)jarg1; - - LLVMDumpModule(arg1); - - -} - - - -DllExport int SWIGSTDCALL Ada_LLVMGetTypeKind ( - void * jarg1 - ) -{ - int jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - LLVMTypeKind result; - - arg1 = (LLVMTypeRef)jarg1; - - result = (LLVMTypeKind)LLVMGetTypeKind(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMInt1Type ( - ) -{ - void * jresult ; - LLVMTypeRef result; - - result = (LLVMTypeRef)LLVMInt1Type(); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMInt8Type ( - ) -{ - void * jresult ; - LLVMTypeRef result; - - result = (LLVMTypeRef)LLVMInt8Type(); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMInt16Type ( - ) -{ - void * jresult ; - LLVMTypeRef result; - - result = (LLVMTypeRef)LLVMInt16Type(); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMInt32Type ( - ) -{ - void * jresult ; - LLVMTypeRef result; - - result = (LLVMTypeRef)LLVMInt32Type(); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMInt64Type ( - ) -{ - void * jresult ; - LLVMTypeRef result; - - result = (LLVMTypeRef)LLVMInt64Type(); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIntType ( - unsigned int jarg1 - ) -{ - void * jresult ; - unsigned int arg1 ; - LLVMTypeRef result; - - - arg1 = (unsigned int) jarg1; - - - result = (LLVMTypeRef)LLVMIntType(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport unsigned int SWIGSTDCALL Ada_LLVMGetIntTypeWidth ( - void * jarg1 - ) -{ - unsigned int jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - unsigned int result; - - arg1 = (LLVMTypeRef)jarg1; - - result = (unsigned int)LLVMGetIntTypeWidth(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMFloatType ( - ) -{ - void * jresult ; - LLVMTypeRef result; - - result = (LLVMTypeRef)LLVMFloatType(); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMDoubleType ( - ) -{ - void * jresult ; - LLVMTypeRef result; - - result = (LLVMTypeRef)LLVMDoubleType(); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMX86FP80Type ( - ) -{ - void * jresult ; - LLVMTypeRef result; - - result = (LLVMTypeRef)LLVMX86FP80Type(); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMFP128Type ( - ) -{ - void * jresult ; - LLVMTypeRef result; - - result = (LLVMTypeRef)LLVMFP128Type(); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMPPCFP128Type ( - ) -{ - void * jresult ; - LLVMTypeRef result; - - result = (LLVMTypeRef)LLVMPPCFP128Type(); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMFunctionType ( - void * jarg1 - , - - void * jarg2 - , - - unsigned int jarg3 - , - - int jarg4 - ) -{ - void * jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - LLVMTypeRef *arg2 = (LLVMTypeRef *) 0 ; - unsigned int arg3 ; - int arg4 ; - LLVMTypeRef result; - - arg1 = (LLVMTypeRef)jarg1; - - arg2 = (LLVMTypeRef *)jarg2; - - - arg3 = (unsigned int) jarg3; - - - - arg4 = (int) jarg4; - - - result = (LLVMTypeRef)LLVMFunctionType(arg1,arg2,arg3,arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport int SWIGSTDCALL Ada_LLVMIsFunctionVarArg ( - void * jarg1 - ) -{ - int jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - int result; - - arg1 = (LLVMTypeRef)jarg1; - - result = (int)LLVMIsFunctionVarArg(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetReturnType ( - void * jarg1 - ) -{ - void * jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - LLVMTypeRef result; - - arg1 = (LLVMTypeRef)jarg1; - - result = (LLVMTypeRef)LLVMGetReturnType(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport unsigned int SWIGSTDCALL Ada_LLVMCountParamTypes ( - void * jarg1 - ) -{ - unsigned int jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - unsigned int result; - - arg1 = (LLVMTypeRef)jarg1; - - result = (unsigned int)LLVMCountParamTypes(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMGetParamTypes ( - void * jarg1 - , - - void * jarg2 - ) -{ - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - LLVMTypeRef *arg2 = (LLVMTypeRef *) 0 ; - - arg1 = (LLVMTypeRef)jarg1; - - arg2 = (LLVMTypeRef *)jarg2; - - LLVMGetParamTypes(arg1,arg2); - - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMStructType ( - void * jarg1 - , - - unsigned int jarg2 - , - - int jarg3 - ) -{ - void * jresult ; - LLVMTypeRef *arg1 = (LLVMTypeRef *) 0 ; - unsigned int arg2 ; - int arg3 ; - LLVMTypeRef result; - - arg1 = (LLVMTypeRef *)jarg1; - - - arg2 = (unsigned int) jarg2; - - - - arg3 = (int) jarg3; - - - result = (LLVMTypeRef)LLVMStructType(arg1,arg2,arg3); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport unsigned int SWIGSTDCALL Ada_LLVMCountStructElementTypes ( - void * jarg1 - ) -{ - unsigned int jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - unsigned int result; - - arg1 = (LLVMTypeRef)jarg1; - - result = (unsigned int)LLVMCountStructElementTypes(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMGetStructElementTypes ( - void * jarg1 - , - - void * jarg2 - ) -{ - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - LLVMTypeRef *arg2 = (LLVMTypeRef *) 0 ; - - arg1 = (LLVMTypeRef)jarg1; - - arg2 = (LLVMTypeRef *)jarg2; - - LLVMGetStructElementTypes(arg1,arg2); - - -} - - - -DllExport int SWIGSTDCALL Ada_LLVMIsPackedStruct ( - void * jarg1 - ) -{ - int jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - int result; - - arg1 = (LLVMTypeRef)jarg1; - - result = (int)LLVMIsPackedStruct(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMArrayType ( - void * jarg1 - , - - unsigned int jarg2 - ) -{ - void * jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - unsigned int arg2 ; - LLVMTypeRef result; - - arg1 = (LLVMTypeRef)jarg1; - - - arg2 = (unsigned int) jarg2; - - - result = (LLVMTypeRef)LLVMArrayType(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMPointerType ( - void * jarg1 - , - - unsigned int jarg2 - ) -{ - void * jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - unsigned int arg2 ; - LLVMTypeRef result; - - arg1 = (LLVMTypeRef)jarg1; - - - arg2 = (unsigned int) jarg2; - - - result = (LLVMTypeRef)LLVMPointerType(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMVectorType ( - void * jarg1 - , - - unsigned int jarg2 - ) -{ - void * jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - unsigned int arg2 ; - LLVMTypeRef result; - - arg1 = (LLVMTypeRef)jarg1; - - - arg2 = (unsigned int) jarg2; - - - result = (LLVMTypeRef)LLVMVectorType(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetElementType ( - void * jarg1 - ) -{ - void * jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - LLVMTypeRef result; - - arg1 = (LLVMTypeRef)jarg1; - - result = (LLVMTypeRef)LLVMGetElementType(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport unsigned int SWIGSTDCALL Ada_LLVMGetArrayLength ( - void * jarg1 - ) -{ - unsigned int jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - unsigned int result; - - arg1 = (LLVMTypeRef)jarg1; - - result = (unsigned int)LLVMGetArrayLength(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport unsigned int SWIGSTDCALL Ada_LLVMGetPointerAddressSpace ( - void * jarg1 - ) -{ - unsigned int jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - unsigned int result; - - arg1 = (LLVMTypeRef)jarg1; - - result = (unsigned int)LLVMGetPointerAddressSpace(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport unsigned int SWIGSTDCALL Ada_LLVMGetVectorSize ( - void * jarg1 - ) -{ - unsigned int jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - unsigned int result; - - arg1 = (LLVMTypeRef)jarg1; - - result = (unsigned int)LLVMGetVectorSize(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMVoidType ( - ) -{ - void * jresult ; - LLVMTypeRef result; - - result = (LLVMTypeRef)LLVMVoidType(); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMLabelType ( - ) -{ - void * jresult ; - LLVMTypeRef result; - - result = (LLVMTypeRef)LLVMLabelType(); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMOpaqueType ( - ) -{ - void * jresult ; - LLVMTypeRef result; - - result = (LLVMTypeRef)LLVMOpaqueType(); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMCreateTypeHandle ( - void * jarg1 - ) -{ - void * jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - LLVMTypeHandleRef result; - - arg1 = (LLVMTypeRef)jarg1; - - result = (LLVMTypeHandleRef)LLVMCreateTypeHandle(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMRefineType ( - void * jarg1 - , - - void * jarg2 - ) -{ - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - LLVMTypeRef arg2 = (LLVMTypeRef) 0 ; - - arg1 = (LLVMTypeRef)jarg1; - - arg2 = (LLVMTypeRef)jarg2; - - LLVMRefineType(arg1,arg2); - - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMResolveTypeHandle ( - void * jarg1 - ) -{ - void * jresult ; - LLVMTypeHandleRef arg1 = (LLVMTypeHandleRef) 0 ; - LLVMTypeRef result; - - arg1 = (LLVMTypeHandleRef)jarg1; - - result = (LLVMTypeRef)LLVMResolveTypeHandle(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMDisposeTypeHandle ( - void * jarg1 - ) -{ - LLVMTypeHandleRef arg1 = (LLVMTypeHandleRef) 0 ; - - arg1 = (LLVMTypeHandleRef)jarg1; - - LLVMDisposeTypeHandle(arg1); - - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMTypeOf ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMTypeRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMTypeRef)LLVMTypeOf(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport char * SWIGSTDCALL Ada_LLVMGetValueName ( - void * jarg1 - ) -{ - char * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - char *result = 0 ; - - arg1 = (LLVMValueRef)jarg1; - - result = (char *)LLVMGetValueName(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMSetValueName ( - void * jarg1 - , - - char * jarg2 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - char *arg2 = (char *) 0 ; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = jarg2; - - LLVMSetValueName(arg1,(char const *)arg2); - - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMDumpValue ( - void * jarg1 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - - arg1 = (LLVMValueRef)jarg1; - - LLVMDumpValue(arg1); - - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAArgument ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAArgument(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsABasicBlock ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsABasicBlock(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAInlineAsm ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAInlineAsm(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAUser ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAUser(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAConstant ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAConstant(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAConstantAggregateZero ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAConstantAggregateZero(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAConstantArray ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAConstantArray(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAConstantExpr ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAConstantExpr(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAConstantFP ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAConstantFP(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAConstantInt ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAConstantInt(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAConstantPointerNull ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAConstantPointerNull(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAConstantStruct ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAConstantStruct(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAConstantVector ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAConstantVector(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAGlobalValue ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAGlobalValue(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAFunction ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAFunction(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAGlobalAlias ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAGlobalAlias(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAGlobalVariable ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAGlobalVariable(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAUndefValue ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAUndefValue(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAInstruction ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAInstruction(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsABinaryOperator ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsABinaryOperator(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsACallInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsACallInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAIntrinsicInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAIntrinsicInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsADbgInfoIntrinsic ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsADbgInfoIntrinsic(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsADbgDeclareInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsADbgDeclareInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsADbgFuncStartInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsADbgFuncStartInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsADbgRegionEndInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsADbgRegionEndInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsADbgRegionStartInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsADbgRegionStartInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsADbgStopPointInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsADbgStopPointInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAEHSelectorInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAEHSelectorInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAMemIntrinsic ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAMemIntrinsic(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAMemCpyInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAMemCpyInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAMemMoveInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAMemMoveInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAMemSetInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAMemSetInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsACmpInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsACmpInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAFCmpInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAFCmpInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAICmpInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAICmpInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAExtractElementInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAExtractElementInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAGetElementPtrInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAGetElementPtrInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAInsertElementInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAInsertElementInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAInsertValueInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAInsertValueInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAPHINode ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAPHINode(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsASelectInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsASelectInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAShuffleVectorInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAShuffleVectorInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAStoreInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAStoreInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsATerminatorInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsATerminatorInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsABranchInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsABranchInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAInvokeInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAInvokeInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAReturnInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAReturnInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsASwitchInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsASwitchInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAUnreachableInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAUnreachableInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAUnwindInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAUnwindInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAUnaryInstruction ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAUnaryInstruction(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAAllocationInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAAllocationInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAAllocaInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAAllocaInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAMallocInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAMallocInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsACastInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsACastInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsABitCastInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsABitCastInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAFPExtInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAFPExtInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAFPToSIInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAFPToSIInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAFPToUIInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAFPToUIInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAFPTruncInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAFPTruncInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAIntToPtrInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAIntToPtrInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAPtrToIntInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAPtrToIntInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsASExtInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsASExtInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsASIToFPInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsASIToFPInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsATruncInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsATruncInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAUIToFPInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAUIToFPInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAZExtInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAZExtInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAExtractValueInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAExtractValueInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAFreeInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAFreeInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsALoadInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsALoadInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMIsAVAArgInst ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMIsAVAArgInst(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstNull ( - void * jarg1 - ) -{ - void * jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMTypeRef)jarg1; - - result = (LLVMValueRef)LLVMConstNull(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstAllOnes ( - void * jarg1 - ) -{ - void * jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMTypeRef)jarg1; - - result = (LLVMValueRef)LLVMConstAllOnes(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetUndef ( - void * jarg1 - ) -{ - void * jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMTypeRef)jarg1; - - result = (LLVMValueRef)LLVMGetUndef(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport int SWIGSTDCALL Ada_LLVMIsConstant ( - void * jarg1 - ) -{ - int jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - int result; - - arg1 = (LLVMValueRef)jarg1; - - result = (int)LLVMIsConstant(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport int SWIGSTDCALL Ada_LLVMIsNull ( - void * jarg1 - ) -{ - int jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - int result; - - arg1 = (LLVMValueRef)jarg1; - - result = (int)LLVMIsNull(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport int SWIGSTDCALL Ada_LLVMIsUndef ( - void * jarg1 - ) -{ - int jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - int result; - - arg1 = (LLVMValueRef)jarg1; - - result = (int)LLVMIsUndef(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstPointerNull ( - void * jarg1 - ) -{ - void * jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMTypeRef)jarg1; - - result = (LLVMValueRef)LLVMConstPointerNull(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstInt ( - void * jarg1 - , - - unsigned long long jarg2 - , - - int jarg3 - ) -{ - void * jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - unsigned long long arg2 ; - int arg3 ; - LLVMValueRef result; - - arg1 = (LLVMTypeRef)jarg1; - - - arg2 = (unsigned long long) jarg2; - - - - arg3 = (int) jarg3; - - - result = (LLVMValueRef)LLVMConstInt(arg1,arg2,arg3); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstReal ( - void * jarg1 - , - - double jarg2 - ) -{ - void * jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - double arg2 ; - LLVMValueRef result; - - arg1 = (LLVMTypeRef)jarg1; - - - arg2 = (double) jarg2; - - - result = (LLVMValueRef)LLVMConstReal(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstRealOfString ( - void * jarg1 - , - - char * jarg2 - ) -{ - void * jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - char *arg2 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMTypeRef)jarg1; - - arg2 = jarg2; - - result = (LLVMValueRef)LLVMConstRealOfString(arg1,(char const *)arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstString ( - char * jarg1 - , - - unsigned int jarg2 - , - - int jarg3 - ) -{ - void * jresult ; - char *arg1 = (char *) 0 ; - unsigned int arg2 ; - int arg3 ; - LLVMValueRef result; - - arg1 = jarg1; - - - arg2 = (unsigned int) jarg2; - - - - arg3 = (int) jarg3; - - - result = (LLVMValueRef)LLVMConstString((char const *)arg1,arg2,arg3); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstArray ( - void * jarg1 - , - - void * jarg2 - , - - unsigned int jarg3 - ) -{ - void * jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - LLVMValueRef *arg2 = (LLVMValueRef *) 0 ; - unsigned int arg3 ; - LLVMValueRef result; - - arg1 = (LLVMTypeRef)jarg1; - - arg2 = (LLVMValueRef *)jarg2; - - - arg3 = (unsigned int) jarg3; - - - result = (LLVMValueRef)LLVMConstArray(arg1,arg2,arg3); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstStruct ( - void * jarg1 - , - - unsigned int jarg2 - , - - int jarg3 - ) -{ - void * jresult ; - LLVMValueRef *arg1 = (LLVMValueRef *) 0 ; - unsigned int arg2 ; - int arg3 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef *)jarg1; - - - arg2 = (unsigned int) jarg2; - - - - arg3 = (int) jarg3; - - - result = (LLVMValueRef)LLVMConstStruct(arg1,arg2,arg3); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstVector ( - void * jarg1 - , - - unsigned int jarg2 - ) -{ - void * jresult ; - LLVMValueRef *arg1 = (LLVMValueRef *) 0 ; - unsigned int arg2 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef *)jarg1; - - - arg2 = (unsigned int) jarg2; - - - result = (LLVMValueRef)LLVMConstVector(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMSizeOf ( - void * jarg1 - ) -{ - void * jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMTypeRef)jarg1; - - result = (LLVMValueRef)LLVMSizeOf(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstNeg ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMConstNeg(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstNot ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMConstNot(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstAdd ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - result = (LLVMValueRef)LLVMConstAdd(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstSub ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - result = (LLVMValueRef)LLVMConstSub(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstMul ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - result = (LLVMValueRef)LLVMConstMul(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstUDiv ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - result = (LLVMValueRef)LLVMConstUDiv(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstSDiv ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - result = (LLVMValueRef)LLVMConstSDiv(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstFDiv ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - result = (LLVMValueRef)LLVMConstFDiv(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstURem ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - result = (LLVMValueRef)LLVMConstURem(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstSRem ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - result = (LLVMValueRef)LLVMConstSRem(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstFRem ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - result = (LLVMValueRef)LLVMConstFRem(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstAnd ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - result = (LLVMValueRef)LLVMConstAnd(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstOr ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - result = (LLVMValueRef)LLVMConstOr(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstXor ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - result = (LLVMValueRef)LLVMConstXor(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstICmp ( - int jarg1 - , - - void * jarg2 - , - - void * jarg3 - ) -{ - void * jresult ; - LLVMIntPredicate arg1 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMIntPredicate) jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - result = (LLVMValueRef)LLVMConstICmp(arg1,arg2,arg3); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstFCmp ( - int jarg1 - , - - void * jarg2 - , - - void * jarg3 - ) -{ - void * jresult ; - LLVMRealPredicate arg1 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMRealPredicate) jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - result = (LLVMValueRef)LLVMConstFCmp(arg1,arg2,arg3); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstShl ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - result = (LLVMValueRef)LLVMConstShl(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstLShr ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - result = (LLVMValueRef)LLVMConstLShr(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstAShr ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - result = (LLVMValueRef)LLVMConstAShr(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstGEP ( - void * jarg1 - , - - void * jarg2 - , - - unsigned int jarg3 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef *arg2 = (LLVMValueRef *) 0 ; - unsigned int arg3 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMValueRef *)jarg2; - - - arg3 = (unsigned int) jarg3; - - - result = (LLVMValueRef)LLVMConstGEP(arg1,arg2,arg3); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstTrunc ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMTypeRef arg2 = (LLVMTypeRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMTypeRef)jarg2; - - result = (LLVMValueRef)LLVMConstTrunc(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstSExt ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMTypeRef arg2 = (LLVMTypeRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMTypeRef)jarg2; - - result = (LLVMValueRef)LLVMConstSExt(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstZExt ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMTypeRef arg2 = (LLVMTypeRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMTypeRef)jarg2; - - result = (LLVMValueRef)LLVMConstZExt(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstFPTrunc ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMTypeRef arg2 = (LLVMTypeRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMTypeRef)jarg2; - - result = (LLVMValueRef)LLVMConstFPTrunc(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstFPExt ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMTypeRef arg2 = (LLVMTypeRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMTypeRef)jarg2; - - result = (LLVMValueRef)LLVMConstFPExt(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstUIToFP ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMTypeRef arg2 = (LLVMTypeRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMTypeRef)jarg2; - - result = (LLVMValueRef)LLVMConstUIToFP(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstSIToFP ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMTypeRef arg2 = (LLVMTypeRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMTypeRef)jarg2; - - result = (LLVMValueRef)LLVMConstSIToFP(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstFPToUI ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMTypeRef arg2 = (LLVMTypeRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMTypeRef)jarg2; - - result = (LLVMValueRef)LLVMConstFPToUI(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstFPToSI ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMTypeRef arg2 = (LLVMTypeRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMTypeRef)jarg2; - - result = (LLVMValueRef)LLVMConstFPToSI(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstPtrToInt ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMTypeRef arg2 = (LLVMTypeRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMTypeRef)jarg2; - - result = (LLVMValueRef)LLVMConstPtrToInt(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstIntToPtr ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMTypeRef arg2 = (LLVMTypeRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMTypeRef)jarg2; - - result = (LLVMValueRef)LLVMConstIntToPtr(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstBitCast ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMTypeRef arg2 = (LLVMTypeRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMTypeRef)jarg2; - - result = (LLVMValueRef)LLVMConstBitCast(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstSelect ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - result = (LLVMValueRef)LLVMConstSelect(arg1,arg2,arg3); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstExtractElement ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - result = (LLVMValueRef)LLVMConstExtractElement(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstInsertElement ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - result = (LLVMValueRef)LLVMConstInsertElement(arg1,arg2,arg3); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstShuffleVector ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - result = (LLVMValueRef)LLVMConstShuffleVector(arg1,arg2,arg3); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstExtractValue ( - void * jarg1 - , - - unsigned int* jarg2 - , - - unsigned int jarg3 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - unsigned int *arg2 = (unsigned int *) 0 ; - unsigned int arg3 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - - arg2 = (unsigned int *) jarg2; - - - - arg3 = (unsigned int) jarg3; - - - result = (LLVMValueRef)LLVMConstExtractValue(arg1,arg2,arg3); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstInsertValue ( - void * jarg1 - , - - void * jarg2 - , - - unsigned int* jarg3 - , - - unsigned int jarg4 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - unsigned int *arg3 = (unsigned int *) 0 ; - unsigned int arg4 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - - arg3 = (unsigned int *) jarg3; - - - - arg4 = (unsigned int) jarg4; - - - result = (LLVMValueRef)LLVMConstInsertValue(arg1,arg2,arg3,arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMConstInlineAsm ( - void * jarg1 - , - - char * jarg2 - , - - char * jarg3 - , - - int jarg4 - ) -{ - void * jresult ; - LLVMTypeRef arg1 = (LLVMTypeRef) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; - int arg4 ; - LLVMValueRef result; - - arg1 = (LLVMTypeRef)jarg1; - - arg2 = jarg2; - - arg3 = jarg3; - - - arg4 = (int) jarg4; - - - result = (LLVMValueRef)LLVMConstInlineAsm(arg1,(char const *)arg2,(char const *)arg3,arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetGlobalParent ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMModuleRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMModuleRef)LLVMGetGlobalParent(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport int SWIGSTDCALL Ada_LLVMIsDeclaration ( - void * jarg1 - ) -{ - int jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - int result; - - arg1 = (LLVMValueRef)jarg1; - - result = (int)LLVMIsDeclaration(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport int SWIGSTDCALL Ada_LLVMGetLinkage ( - void * jarg1 - ) -{ - int jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMLinkage result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMLinkage)LLVMGetLinkage(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMSetLinkage ( - void * jarg1 - , - - int jarg2 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMLinkage arg2 ; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMLinkage) jarg2; - - LLVMSetLinkage(arg1,arg2); - - -} - - - -DllExport char * SWIGSTDCALL Ada_LLVMGetSection ( - void * jarg1 - ) -{ - char * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - char *result = 0 ; - - arg1 = (LLVMValueRef)jarg1; - - result = (char *)LLVMGetSection(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMSetSection ( - void * jarg1 - , - - char * jarg2 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - char *arg2 = (char *) 0 ; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = jarg2; - - LLVMSetSection(arg1,(char const *)arg2); - - -} - - - -DllExport int SWIGSTDCALL Ada_LLVMGetVisibility ( - void * jarg1 - ) -{ - int jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMVisibility result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMVisibility)LLVMGetVisibility(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMSetVisibility ( - void * jarg1 - , - - int jarg2 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMVisibility arg2 ; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMVisibility) jarg2; - - LLVMSetVisibility(arg1,arg2); - - -} - - - -DllExport unsigned int SWIGSTDCALL Ada_LLVMGetAlignment ( - void * jarg1 - ) -{ - unsigned int jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - unsigned int result; - - arg1 = (LLVMValueRef)jarg1; - - result = (unsigned int)LLVMGetAlignment(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMSetAlignment ( - void * jarg1 - , - - unsigned int jarg2 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - unsigned int arg2 ; - - arg1 = (LLVMValueRef)jarg1; - - - arg2 = (unsigned int) jarg2; - - - LLVMSetAlignment(arg1,arg2); - - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMAddGlobal ( - void * jarg1 - , - - void * jarg2 - , - - char * jarg3 - ) -{ - void * jresult ; - LLVMModuleRef arg1 = (LLVMModuleRef) 0 ; - LLVMTypeRef arg2 = (LLVMTypeRef) 0 ; - char *arg3 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMModuleRef)jarg1; - - arg2 = (LLVMTypeRef)jarg2; - - arg3 = jarg3; - - result = (LLVMValueRef)LLVMAddGlobal(arg1,arg2,(char const *)arg3); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetNamedGlobal ( - void * jarg1 - , - - char * jarg2 - ) -{ - void * jresult ; - LLVMModuleRef arg1 = (LLVMModuleRef) 0 ; - char *arg2 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMModuleRef)jarg1; - - arg2 = jarg2; - - result = (LLVMValueRef)LLVMGetNamedGlobal(arg1,(char const *)arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetFirstGlobal ( - void * jarg1 - ) -{ - void * jresult ; - LLVMModuleRef arg1 = (LLVMModuleRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMModuleRef)jarg1; - - result = (LLVMValueRef)LLVMGetFirstGlobal(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetLastGlobal ( - void * jarg1 - ) -{ - void * jresult ; - LLVMModuleRef arg1 = (LLVMModuleRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMModuleRef)jarg1; - - result = (LLVMValueRef)LLVMGetLastGlobal(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetNextGlobal ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMGetNextGlobal(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetPreviousGlobal ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMGetPreviousGlobal(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMDeleteGlobal ( - void * jarg1 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - - arg1 = (LLVMValueRef)jarg1; - - LLVMDeleteGlobal(arg1); - - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetInitializer ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMGetInitializer(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMSetInitializer ( - void * jarg1 - , - - void * jarg2 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - LLVMSetInitializer(arg1,arg2); - - -} - - - -DllExport int SWIGSTDCALL Ada_LLVMIsThreadLocal ( - void * jarg1 - ) -{ - int jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - int result; - - arg1 = (LLVMValueRef)jarg1; - - result = (int)LLVMIsThreadLocal(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMSetThreadLocal ( - void * jarg1 - , - - int jarg2 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - int arg2 ; - - arg1 = (LLVMValueRef)jarg1; - - - arg2 = (int) jarg2; - - - LLVMSetThreadLocal(arg1,arg2); - - -} - - - -DllExport int SWIGSTDCALL Ada_LLVMIsGlobalConstant ( - void * jarg1 - ) -{ - int jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - int result; - - arg1 = (LLVMValueRef)jarg1; - - result = (int)LLVMIsGlobalConstant(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMSetGlobalConstant ( - void * jarg1 - , - - int jarg2 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - int arg2 ; - - arg1 = (LLVMValueRef)jarg1; - - - arg2 = (int) jarg2; - - - LLVMSetGlobalConstant(arg1,arg2); - - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMAddAlias ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMModuleRef arg1 = (LLVMModuleRef) 0 ; - LLVMTypeRef arg2 = (LLVMTypeRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMModuleRef)jarg1; - - arg2 = (LLVMTypeRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMAddAlias(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMAddFunction ( - void * jarg1 - , - - char * jarg2 - , - - void * jarg3 - ) -{ - void * jresult ; - LLVMModuleRef arg1 = (LLVMModuleRef) 0 ; - char *arg2 = (char *) 0 ; - LLVMTypeRef arg3 = (LLVMTypeRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMModuleRef)jarg1; - - arg2 = jarg2; - - arg3 = (LLVMTypeRef)jarg3; - - result = (LLVMValueRef)LLVMAddFunction(arg1,(char const *)arg2,arg3); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetNamedFunction ( - void * jarg1 - , - - char * jarg2 - ) -{ - void * jresult ; - LLVMModuleRef arg1 = (LLVMModuleRef) 0 ; - char *arg2 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMModuleRef)jarg1; - - arg2 = jarg2; - - result = (LLVMValueRef)LLVMGetNamedFunction(arg1,(char const *)arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetFirstFunction ( - void * jarg1 - ) -{ - void * jresult ; - LLVMModuleRef arg1 = (LLVMModuleRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMModuleRef)jarg1; - - result = (LLVMValueRef)LLVMGetFirstFunction(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetLastFunction ( - void * jarg1 - ) -{ - void * jresult ; - LLVMModuleRef arg1 = (LLVMModuleRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMModuleRef)jarg1; - - result = (LLVMValueRef)LLVMGetLastFunction(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetNextFunction ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMGetNextFunction(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetPreviousFunction ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMGetPreviousFunction(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMDeleteFunction ( - void * jarg1 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - - arg1 = (LLVMValueRef)jarg1; - - LLVMDeleteFunction(arg1); - - -} - - - -DllExport unsigned int SWIGSTDCALL Ada_LLVMGetIntrinsicID ( - void * jarg1 - ) -{ - unsigned int jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - unsigned int result; - - arg1 = (LLVMValueRef)jarg1; - - result = (unsigned int)LLVMGetIntrinsicID(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport unsigned int SWIGSTDCALL Ada_LLVMGetFunctionCallConv ( - void * jarg1 - ) -{ - unsigned int jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - unsigned int result; - - arg1 = (LLVMValueRef)jarg1; - - result = (unsigned int)LLVMGetFunctionCallConv(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMSetFunctionCallConv ( - void * jarg1 - , - - unsigned int jarg2 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - unsigned int arg2 ; - - arg1 = (LLVMValueRef)jarg1; - - - arg2 = (unsigned int) jarg2; - - - LLVMSetFunctionCallConv(arg1,arg2); - - -} - - - -DllExport char * SWIGSTDCALL Ada_LLVMGetGC ( - void * jarg1 - ) -{ - char * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - char *result = 0 ; - - arg1 = (LLVMValueRef)jarg1; - - result = (char *)LLVMGetGC(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMSetGC ( - void * jarg1 - , - - char * jarg2 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - char *arg2 = (char *) 0 ; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = jarg2; - - LLVMSetGC(arg1,(char const *)arg2); - - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMAddFunctionAttr ( - void * jarg1 - , - - int jarg2 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMAttribute arg2 ; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMAttribute) jarg2; - - LLVMAddFunctionAttr(arg1,arg2); - - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMRemoveFunctionAttr ( - void * jarg1 - , - - int jarg2 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMAttribute arg2 ; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMAttribute) jarg2; - - LLVMRemoveFunctionAttr(arg1,arg2); - - -} - - - -DllExport unsigned int SWIGSTDCALL Ada_LLVMCountParams ( - void * jarg1 - ) -{ - unsigned int jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - unsigned int result; - - arg1 = (LLVMValueRef)jarg1; - - result = (unsigned int)LLVMCountParams(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMGetParams ( - void * jarg1 - , - - void * jarg2 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef *arg2 = (LLVMValueRef *) 0 ; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMValueRef *)jarg2; - - LLVMGetParams(arg1,arg2); - - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetParam ( - void * jarg1 - , - - unsigned int jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - unsigned int arg2 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - - arg2 = (unsigned int) jarg2; - - - result = (LLVMValueRef)LLVMGetParam(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetParamParent ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMGetParamParent(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetFirstParam ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMGetFirstParam(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetLastParam ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMGetLastParam(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetNextParam ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMGetNextParam(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetPreviousParam ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMGetPreviousParam(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMAddAttribute ( - void * jarg1 - , - - int jarg2 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMAttribute arg2 ; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMAttribute) jarg2; - - LLVMAddAttribute(arg1,arg2); - - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMRemoveAttribute ( - void * jarg1 - , - - int jarg2 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMAttribute arg2 ; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMAttribute) jarg2; - - LLVMRemoveAttribute(arg1,arg2); - - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMSetParamAlignment ( - void * jarg1 - , - - unsigned int jarg2 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - unsigned int arg2 ; - - arg1 = (LLVMValueRef)jarg1; - - - arg2 = (unsigned int) jarg2; - - - LLVMSetParamAlignment(arg1,arg2); - - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBasicBlockAsValue ( - void * jarg1 - ) -{ - void * jresult ; - LLVMBasicBlockRef arg1 = (LLVMBasicBlockRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBasicBlockRef)jarg1; - - result = (LLVMValueRef)LLVMBasicBlockAsValue(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport int SWIGSTDCALL Ada_LLVMValueIsBasicBlock ( - void * jarg1 - ) -{ - int jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - int result; - - arg1 = (LLVMValueRef)jarg1; - - result = (int)LLVMValueIsBasicBlock(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMValueAsBasicBlock ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMBasicBlockRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMBasicBlockRef)LLVMValueAsBasicBlock(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetBasicBlockParent ( - void * jarg1 - ) -{ - void * jresult ; - LLVMBasicBlockRef arg1 = (LLVMBasicBlockRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBasicBlockRef)jarg1; - - result = (LLVMValueRef)LLVMGetBasicBlockParent(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport unsigned int SWIGSTDCALL Ada_LLVMCountBasicBlocks ( - void * jarg1 - ) -{ - unsigned int jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - unsigned int result; - - arg1 = (LLVMValueRef)jarg1; - - result = (unsigned int)LLVMCountBasicBlocks(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMGetBasicBlocks ( - void * jarg1 - , - - void * jarg2 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMBasicBlockRef *arg2 = (LLVMBasicBlockRef *) 0 ; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMBasicBlockRef *)jarg2; - - LLVMGetBasicBlocks(arg1,arg2); - - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetFirstBasicBlock ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMBasicBlockRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMBasicBlockRef)LLVMGetFirstBasicBlock(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetLastBasicBlock ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMBasicBlockRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMBasicBlockRef)LLVMGetLastBasicBlock(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetNextBasicBlock ( - void * jarg1 - ) -{ - void * jresult ; - LLVMBasicBlockRef arg1 = (LLVMBasicBlockRef) 0 ; - LLVMBasicBlockRef result; - - arg1 = (LLVMBasicBlockRef)jarg1; - - result = (LLVMBasicBlockRef)LLVMGetNextBasicBlock(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetPreviousBasicBlock ( - void * jarg1 - ) -{ - void * jresult ; - LLVMBasicBlockRef arg1 = (LLVMBasicBlockRef) 0 ; - LLVMBasicBlockRef result; - - arg1 = (LLVMBasicBlockRef)jarg1; - - result = (LLVMBasicBlockRef)LLVMGetPreviousBasicBlock(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetEntryBasicBlock ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMBasicBlockRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMBasicBlockRef)LLVMGetEntryBasicBlock(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMAppendBasicBlock ( - void * jarg1 - , - - char * jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - char *arg2 = (char *) 0 ; - LLVMBasicBlockRef result; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = jarg2; - - result = (LLVMBasicBlockRef)LLVMAppendBasicBlock(arg1,(char const *)arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMInsertBasicBlock ( - void * jarg1 - , - - char * jarg2 - ) -{ - void * jresult ; - LLVMBasicBlockRef arg1 = (LLVMBasicBlockRef) 0 ; - char *arg2 = (char *) 0 ; - LLVMBasicBlockRef result; - - arg1 = (LLVMBasicBlockRef)jarg1; - - arg2 = jarg2; - - result = (LLVMBasicBlockRef)LLVMInsertBasicBlock(arg1,(char const *)arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMDeleteBasicBlock ( - void * jarg1 - ) -{ - LLVMBasicBlockRef arg1 = (LLVMBasicBlockRef) 0 ; - - arg1 = (LLVMBasicBlockRef)jarg1; - - LLVMDeleteBasicBlock(arg1); - - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetInstructionParent ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMBasicBlockRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMBasicBlockRef)LLVMGetInstructionParent(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetFirstInstruction ( - void * jarg1 - ) -{ - void * jresult ; - LLVMBasicBlockRef arg1 = (LLVMBasicBlockRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBasicBlockRef)jarg1; - - result = (LLVMValueRef)LLVMGetFirstInstruction(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetLastInstruction ( - void * jarg1 - ) -{ - void * jresult ; - LLVMBasicBlockRef arg1 = (LLVMBasicBlockRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBasicBlockRef)jarg1; - - result = (LLVMValueRef)LLVMGetLastInstruction(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetNextInstruction ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMGetNextInstruction(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetPreviousInstruction ( - void * jarg1 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - result = (LLVMValueRef)LLVMGetPreviousInstruction(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMSetInstructionCallConv ( - void * jarg1 - , - - unsigned int jarg2 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - unsigned int arg2 ; - - arg1 = (LLVMValueRef)jarg1; - - - arg2 = (unsigned int) jarg2; - - - LLVMSetInstructionCallConv(arg1,arg2); - - -} - - - -DllExport unsigned int SWIGSTDCALL Ada_LLVMGetInstructionCallConv ( - void * jarg1 - ) -{ - unsigned int jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - unsigned int result; - - arg1 = (LLVMValueRef)jarg1; - - result = (unsigned int)LLVMGetInstructionCallConv(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMAddInstrAttribute ( - void * jarg1 - , - - unsigned int jarg2 - , - - int jarg3 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - unsigned int arg2 ; - LLVMAttribute arg3 ; - - arg1 = (LLVMValueRef)jarg1; - - - arg2 = (unsigned int) jarg2; - - - arg3 = (LLVMAttribute) jarg3; - - LLVMAddInstrAttribute(arg1,arg2,arg3); - - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMRemoveInstrAttribute ( - void * jarg1 - , - - unsigned int jarg2 - , - - int jarg3 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - unsigned int arg2 ; - LLVMAttribute arg3 ; - - arg1 = (LLVMValueRef)jarg1; - - - arg2 = (unsigned int) jarg2; - - - arg3 = (LLVMAttribute) jarg3; - - LLVMRemoveInstrAttribute(arg1,arg2,arg3); - - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMSetInstrParamAlignment ( - void * jarg1 - , - - unsigned int jarg2 - , - - unsigned int jarg3 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - unsigned int arg2 ; - unsigned int arg3 ; - - arg1 = (LLVMValueRef)jarg1; - - - arg2 = (unsigned int) jarg2; - - - - arg3 = (unsigned int) jarg3; - - - LLVMSetInstrParamAlignment(arg1,arg2,arg3); - - -} - - - -DllExport int SWIGSTDCALL Ada_LLVMIsTailCall ( - void * jarg1 - ) -{ - int jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - int result; - - arg1 = (LLVMValueRef)jarg1; - - result = (int)LLVMIsTailCall(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMSetTailCall ( - void * jarg1 - , - - int jarg2 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - int arg2 ; - - arg1 = (LLVMValueRef)jarg1; - - - arg2 = (int) jarg2; - - - LLVMSetTailCall(arg1,arg2); - - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMAddIncoming ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - unsigned int jarg4 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef *arg2 = (LLVMValueRef *) 0 ; - LLVMBasicBlockRef *arg3 = (LLVMBasicBlockRef *) 0 ; - unsigned int arg4 ; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMValueRef *)jarg2; - - arg3 = (LLVMBasicBlockRef *)jarg3; - - - arg4 = (unsigned int) jarg4; - - - LLVMAddIncoming(arg1,arg2,arg3,arg4); - - -} - - - -DllExport unsigned int SWIGSTDCALL Ada_LLVMCountIncoming ( - void * jarg1 - ) -{ - unsigned int jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - unsigned int result; - - arg1 = (LLVMValueRef)jarg1; - - result = (unsigned int)LLVMCountIncoming(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetIncomingValue ( - void * jarg1 - , - - unsigned int jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - unsigned int arg2 ; - LLVMValueRef result; - - arg1 = (LLVMValueRef)jarg1; - - - arg2 = (unsigned int) jarg2; - - - result = (LLVMValueRef)LLVMGetIncomingValue(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetIncomingBlock ( - void * jarg1 - , - - unsigned int jarg2 - ) -{ - void * jresult ; - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - unsigned int arg2 ; - LLVMBasicBlockRef result; - - arg1 = (LLVMValueRef)jarg1; - - - arg2 = (unsigned int) jarg2; - - - result = (LLVMBasicBlockRef)LLVMGetIncomingBlock(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMCreateBuilder ( - ) -{ - void * jresult ; - LLVMBuilderRef result; - - result = (LLVMBuilderRef)LLVMCreateBuilder(); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMPositionBuilder ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - ) -{ - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMBasicBlockRef arg2 = (LLVMBasicBlockRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMBasicBlockRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - LLVMPositionBuilder(arg1,arg2,arg3); - - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMPositionBuilderBefore ( - void * jarg1 - , - - void * jarg2 - ) -{ - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - LLVMPositionBuilderBefore(arg1,arg2); - - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMPositionBuilderAtEnd ( - void * jarg1 - , - - void * jarg2 - ) -{ - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMBasicBlockRef arg2 = (LLVMBasicBlockRef) 0 ; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMBasicBlockRef)jarg2; - - LLVMPositionBuilderAtEnd(arg1,arg2); - - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMGetInsertBlock ( - void * jarg1 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMBasicBlockRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - result = (LLVMBasicBlockRef)LLVMGetInsertBlock(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMClearInsertionPosition ( - void * jarg1 - ) -{ - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - - arg1 = (LLVMBuilderRef)jarg1; - - LLVMClearInsertionPosition(arg1); - - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMInsertIntoBuilder ( - void * jarg1 - , - - void * jarg2 - ) -{ - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - LLVMInsertIntoBuilder(arg1,arg2); - - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMDisposeBuilder ( - void * jarg1 - ) -{ - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - - arg1 = (LLVMBuilderRef)jarg1; - - LLVMDisposeBuilder(arg1); - - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildRetVoid ( - void * jarg1 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - result = (LLVMValueRef)LLVMBuildRetVoid(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildRet ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - result = (LLVMValueRef)LLVMBuildRet(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildBr ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMBasicBlockRef arg2 = (LLVMBasicBlockRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMBasicBlockRef)jarg2; - - result = (LLVMValueRef)LLVMBuildBr(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildCondBr ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - void * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMBasicBlockRef arg3 = (LLVMBasicBlockRef) 0 ; - LLVMBasicBlockRef arg4 = (LLVMBasicBlockRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMBasicBlockRef)jarg3; - - arg4 = (LLVMBasicBlockRef)jarg4; - - result = (LLVMValueRef)LLVMBuildCondBr(arg1,arg2,arg3,arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildSwitch ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - unsigned int jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMBasicBlockRef arg3 = (LLVMBasicBlockRef) 0 ; - unsigned int arg4 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMBasicBlockRef)jarg3; - - - arg4 = (unsigned int) jarg4; - - - result = (LLVMValueRef)LLVMBuildSwitch(arg1,arg2,arg3,arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildInvoke ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - unsigned int jarg4 - , - - void * jarg5 - , - - void * jarg6 - , - - char * jarg7 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef *arg3 = (LLVMValueRef *) 0 ; - unsigned int arg4 ; - LLVMBasicBlockRef arg5 = (LLVMBasicBlockRef) 0 ; - LLVMBasicBlockRef arg6 = (LLVMBasicBlockRef) 0 ; - char *arg7 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef *)jarg3; - - - arg4 = (unsigned int) jarg4; - - - arg5 = (LLVMBasicBlockRef)jarg5; - - arg6 = (LLVMBasicBlockRef)jarg6; - - arg7 = jarg7; - - result = (LLVMValueRef)LLVMBuildInvoke(arg1,arg2,arg3,arg4,arg5,arg6,(char const *)arg7); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildUnwind ( - void * jarg1 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - result = (LLVMValueRef)LLVMBuildUnwind(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildUnreachable ( - void * jarg1 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - result = (LLVMValueRef)LLVMBuildUnreachable(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMAddCase ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - ) -{ - LLVMValueRef arg1 = (LLVMValueRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMBasicBlockRef arg3 = (LLVMBasicBlockRef) 0 ; - - arg1 = (LLVMValueRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMBasicBlockRef)jarg3; - - LLVMAddCase(arg1,arg2,arg3); - - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildAdd ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildAdd(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildSub ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildSub(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildMul ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildMul(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildUDiv ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildUDiv(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildSDiv ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildSDiv(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildFDiv ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildFDiv(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildURem ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildURem(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildSRem ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildSRem(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildFRem ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildFRem(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildShl ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildShl(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildLShr ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildLShr(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildAShr ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildAShr(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildAnd ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildAnd(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildOr ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildOr(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildXor ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildXor(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildNeg ( - void * jarg1 - , - - void * jarg2 - , - - char * jarg3 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - char *arg3 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = jarg3; - - result = (LLVMValueRef)LLVMBuildNeg(arg1,arg2,(char const *)arg3); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildNot ( - void * jarg1 - , - - void * jarg2 - , - - char * jarg3 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - char *arg3 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = jarg3; - - result = (LLVMValueRef)LLVMBuildNot(arg1,arg2,(char const *)arg3); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildMalloc ( - void * jarg1 - , - - void * jarg2 - , - - char * jarg3 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMTypeRef arg2 = (LLVMTypeRef) 0 ; - char *arg3 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMTypeRef)jarg2; - - arg3 = jarg3; - - result = (LLVMValueRef)LLVMBuildMalloc(arg1,arg2,(char const *)arg3); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildArrayMalloc ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMTypeRef arg2 = (LLVMTypeRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMTypeRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildArrayMalloc(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildAlloca ( - void * jarg1 - , - - void * jarg2 - , - - char * jarg3 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMTypeRef arg2 = (LLVMTypeRef) 0 ; - char *arg3 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMTypeRef)jarg2; - - arg3 = jarg3; - - result = (LLVMValueRef)LLVMBuildAlloca(arg1,arg2,(char const *)arg3); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildArrayAlloca ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMTypeRef arg2 = (LLVMTypeRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMTypeRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildArrayAlloca(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildFree ( - void * jarg1 - , - - void * jarg2 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - result = (LLVMValueRef)LLVMBuildFree(arg1,arg2); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildLoad ( - void * jarg1 - , - - void * jarg2 - , - - char * jarg3 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - char *arg3 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = jarg3; - - result = (LLVMValueRef)LLVMBuildLoad(arg1,arg2,(char const *)arg3); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildStore ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - result = (LLVMValueRef)LLVMBuildStore(arg1,arg2,arg3); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildGEP ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - unsigned int jarg4 - , - - char * jarg5 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef *arg3 = (LLVMValueRef *) 0 ; - unsigned int arg4 ; - char *arg5 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef *)jarg3; - - - arg4 = (unsigned int) jarg4; - - - arg5 = jarg5; - - result = (LLVMValueRef)LLVMBuildGEP(arg1,arg2,arg3,arg4,(char const *)arg5); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildTrunc ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMTypeRef arg3 = (LLVMTypeRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMTypeRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildTrunc(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildZExt ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMTypeRef arg3 = (LLVMTypeRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMTypeRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildZExt(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildSExt ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMTypeRef arg3 = (LLVMTypeRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMTypeRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildSExt(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildFPToUI ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMTypeRef arg3 = (LLVMTypeRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMTypeRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildFPToUI(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildFPToSI ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMTypeRef arg3 = (LLVMTypeRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMTypeRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildFPToSI(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildUIToFP ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMTypeRef arg3 = (LLVMTypeRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMTypeRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildUIToFP(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildSIToFP ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMTypeRef arg3 = (LLVMTypeRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMTypeRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildSIToFP(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildFPTrunc ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMTypeRef arg3 = (LLVMTypeRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMTypeRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildFPTrunc(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildFPExt ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMTypeRef arg3 = (LLVMTypeRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMTypeRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildFPExt(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildPtrToInt ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMTypeRef arg3 = (LLVMTypeRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMTypeRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildPtrToInt(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildIntToPtr ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMTypeRef arg3 = (LLVMTypeRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMTypeRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildIntToPtr(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildBitCast ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMTypeRef arg3 = (LLVMTypeRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMTypeRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildBitCast(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildICmp ( - void * jarg1 - , - - int jarg2 - , - - void * jarg3 - , - - void * jarg4 - , - - char * jarg5 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMIntPredicate arg2 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - LLVMValueRef arg4 = (LLVMValueRef) 0 ; - char *arg5 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMIntPredicate) jarg2; - - arg3 = (LLVMValueRef)jarg3; - - arg4 = (LLVMValueRef)jarg4; - - arg5 = jarg5; - - result = (LLVMValueRef)LLVMBuildICmp(arg1,arg2,arg3,arg4,(char const *)arg5); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildFCmp ( - void * jarg1 - , - - int jarg2 - , - - void * jarg3 - , - - void * jarg4 - , - - char * jarg5 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMRealPredicate arg2 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - LLVMValueRef arg4 = (LLVMValueRef) 0 ; - char *arg5 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMRealPredicate) jarg2; - - arg3 = (LLVMValueRef)jarg3; - - arg4 = (LLVMValueRef)jarg4; - - arg5 = jarg5; - - result = (LLVMValueRef)LLVMBuildFCmp(arg1,arg2,arg3,arg4,(char const *)arg5); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildPhi ( - void * jarg1 - , - - void * jarg2 - , - - char * jarg3 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMTypeRef arg2 = (LLVMTypeRef) 0 ; - char *arg3 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMTypeRef)jarg2; - - arg3 = jarg3; - - result = (LLVMValueRef)LLVMBuildPhi(arg1,arg2,(char const *)arg3); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildCall ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - unsigned int jarg4 - , - - char * jarg5 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef *arg3 = (LLVMValueRef *) 0 ; - unsigned int arg4 ; - char *arg5 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef *)jarg3; - - - arg4 = (unsigned int) jarg4; - - - arg5 = jarg5; - - result = (LLVMValueRef)LLVMBuildCall(arg1,arg2,arg3,arg4,(char const *)arg5); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildSelect ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - void * jarg4 - , - - char * jarg5 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - LLVMValueRef arg4 = (LLVMValueRef) 0 ; - char *arg5 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - arg4 = (LLVMValueRef)jarg4; - - arg5 = jarg5; - - result = (LLVMValueRef)LLVMBuildSelect(arg1,arg2,arg3,arg4,(char const *)arg5); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildVAArg ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMTypeRef arg3 = (LLVMTypeRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMTypeRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildVAArg(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildExtractElement ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildExtractElement(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildInsertElement ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - void * jarg4 - , - - char * jarg5 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - LLVMValueRef arg4 = (LLVMValueRef) 0 ; - char *arg5 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - arg4 = (LLVMValueRef)jarg4; - - arg5 = jarg5; - - result = (LLVMValueRef)LLVMBuildInsertElement(arg1,arg2,arg3,arg4,(char const *)arg5); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildShuffleVector ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - void * jarg4 - , - - char * jarg5 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - LLVMValueRef arg4 = (LLVMValueRef) 0 ; - char *arg5 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - arg4 = (LLVMValueRef)jarg4; - - arg5 = jarg5; - - result = (LLVMValueRef)LLVMBuildShuffleVector(arg1,arg2,arg3,arg4,(char const *)arg5); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildExtractValue ( - void * jarg1 - , - - void * jarg2 - , - - unsigned int jarg3 - , - - char * jarg4 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - unsigned int arg3 ; - char *arg4 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - - arg3 = (unsigned int) jarg3; - - - arg4 = jarg4; - - result = (LLVMValueRef)LLVMBuildExtractValue(arg1,arg2,arg3,(char const *)arg4); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMBuildInsertValue ( - void * jarg1 - , - - void * jarg2 - , - - void * jarg3 - , - - unsigned int jarg4 - , - - char * jarg5 - ) -{ - void * jresult ; - LLVMBuilderRef arg1 = (LLVMBuilderRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - LLVMValueRef arg3 = (LLVMValueRef) 0 ; - unsigned int arg4 ; - char *arg5 = (char *) 0 ; - LLVMValueRef result; - - arg1 = (LLVMBuilderRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - arg3 = (LLVMValueRef)jarg3; - - - arg4 = (unsigned int) jarg4; - - - arg5 = jarg5; - - result = (LLVMValueRef)LLVMBuildInsertValue(arg1,arg2,arg3,arg4,(char const *)arg5); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMCreateModuleProviderForExistingModule ( - void * jarg1 - ) -{ - void * jresult ; - LLVMModuleRef arg1 = (LLVMModuleRef) 0 ; - LLVMModuleProviderRef result; - - arg1 = (LLVMModuleRef)jarg1; - - result = (LLVMModuleProviderRef)LLVMCreateModuleProviderForExistingModule(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMDisposeModuleProvider ( - void * jarg1 - ) -{ - LLVMModuleProviderRef arg1 = (LLVMModuleProviderRef) 0 ; - - arg1 = (LLVMModuleProviderRef)jarg1; - - LLVMDisposeModuleProvider(arg1); - - -} - - - -DllExport int SWIGSTDCALL Ada_LLVMCreateMemoryBufferWithContentsOfFile ( - char * jarg1 - , - - void * jarg2 - , - - void * jarg3 - ) -{ - int jresult ; - char *arg1 = (char *) 0 ; - LLVMMemoryBufferRef *arg2 = (LLVMMemoryBufferRef *) 0 ; - char **arg3 = (char **) 0 ; - int result; - - arg1 = jarg1; - - arg2 = (LLVMMemoryBufferRef *)jarg2; - - arg3 = (char **)jarg3; - - result = (int)LLVMCreateMemoryBufferWithContentsOfFile((char const *)arg1,arg2,arg3); - jresult = result; - - - - return jresult; - -} - - - -DllExport int SWIGSTDCALL Ada_LLVMCreateMemoryBufferWithSTDIN ( - void * jarg1 - , - - void * jarg2 - ) -{ - int jresult ; - LLVMMemoryBufferRef *arg1 = (LLVMMemoryBufferRef *) 0 ; - char **arg2 = (char **) 0 ; - int result; - - arg1 = (LLVMMemoryBufferRef *)jarg1; - - arg2 = (char **)jarg2; - - result = (int)LLVMCreateMemoryBufferWithSTDIN(arg1,arg2); - jresult = result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMDisposeMemoryBuffer ( - void * jarg1 - ) -{ - LLVMMemoryBufferRef arg1 = (LLVMMemoryBufferRef) 0 ; - - arg1 = (LLVMMemoryBufferRef)jarg1; - - LLVMDisposeMemoryBuffer(arg1); - - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMCreatePassManager ( - ) -{ - void * jresult ; - LLVMPassManagerRef result; - - result = (LLVMPassManagerRef)LLVMCreatePassManager(); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport void * SWIGSTDCALL Ada_LLVMCreateFunctionPassManager ( - void * jarg1 - ) -{ - void * jresult ; - LLVMModuleProviderRef arg1 = (LLVMModuleProviderRef) 0 ; - LLVMPassManagerRef result; - - arg1 = (LLVMModuleProviderRef)jarg1; - - result = (LLVMPassManagerRef)LLVMCreateFunctionPassManager(arg1); - jresult = (void *) result; - - - - return jresult; - -} - - - -DllExport int SWIGSTDCALL Ada_LLVMRunPassManager ( - void * jarg1 - , - - void * jarg2 - ) -{ - int jresult ; - LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ; - LLVMModuleRef arg2 = (LLVMModuleRef) 0 ; - int result; - - arg1 = (LLVMPassManagerRef)jarg1; - - arg2 = (LLVMModuleRef)jarg2; - - result = (int)LLVMRunPassManager(arg1,arg2); - jresult = result; - - - - return jresult; - -} - - - -DllExport int SWIGSTDCALL Ada_LLVMInitializeFunctionPassManager ( - void * jarg1 - ) -{ - int jresult ; - LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ; - int result; - - arg1 = (LLVMPassManagerRef)jarg1; - - result = (int)LLVMInitializeFunctionPassManager(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport int SWIGSTDCALL Ada_LLVMRunFunctionPassManager ( - void * jarg1 - , - - void * jarg2 - ) -{ - int jresult ; - LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ; - LLVMValueRef arg2 = (LLVMValueRef) 0 ; - int result; - - arg1 = (LLVMPassManagerRef)jarg1; - - arg2 = (LLVMValueRef)jarg2; - - result = (int)LLVMRunFunctionPassManager(arg1,arg2); - jresult = result; - - - - return jresult; - -} - - - -DllExport int SWIGSTDCALL Ada_LLVMFinalizeFunctionPassManager ( - void * jarg1 - ) -{ - int jresult ; - LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ; - int result; - - arg1 = (LLVMPassManagerRef)jarg1; - - result = (int)LLVMFinalizeFunctionPassManager(arg1); - jresult = result; - - - - return jresult; - -} - - - -DllExport void SWIGSTDCALL Ada_LLVMDisposePassManager ( - void * jarg1 - ) -{ - LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ; - - arg1 = (LLVMPassManagerRef)jarg1; - - LLVMDisposePassManager(arg1); - - -} - - - -#ifdef __cplusplus -} -#endif -#ifdef __cplusplus -extern "C" { -#endif -#ifdef __cplusplus -} -#endif - diff --git a/contrib/llvm/bindings/ada/target/llvm_target-binding.ads b/contrib/llvm/bindings/ada/target/llvm_target-binding.ads deleted file mode 100644 index 61201c8d1753..000000000000 --- a/contrib/llvm/bindings/ada/target/llvm_target-binding.ads +++ /dev/null @@ -1,138 +0,0 @@ --- 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; diff --git a/contrib/llvm/bindings/ada/target/llvm_target.ads b/contrib/llvm/bindings/ada/target/llvm_target.ads deleted file mode 100644 index 11cb05d55b35..000000000000 --- a/contrib/llvm/bindings/ada/target/llvm_target.ads +++ /dev/null @@ -1,72 +0,0 @@ --- 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; diff --git a/contrib/llvm/bindings/ada/target/llvm_target_wrap.cxx b/contrib/llvm/bindings/ada/target/llvm_target_wrap.cxx deleted file mode 100644 index 16aca8a4379a..000000000000 --- a/contrib/llvm/bindings/ada/target/llvm_target_wrap.cxx +++ /dev/null @@ -1,720 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 class SwigValueWrapper { - T *tt; -public: - SwigValueWrapper() : tt(0) { } - SwigValueWrapper(const SwigValueWrapper& 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& rhs); -}; - -template 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 -#include -#include -#if defined(_WIN32) || defined(__CYGWIN32__) -# define DllExport __declspec( dllexport ) -# define SWIGSTDCALL __stdcall -#else -# define DllExport -# define SWIGSTDCALL -#endif - - -#ifdef __cplusplus -# include -#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 - diff --git a/contrib/llvm/bindings/ada/transforms/llvm_transforms-binding.ads b/contrib/llvm/bindings/ada/transforms/llvm_transforms-binding.ads deleted file mode 100644 index 2254b6eec2c3..000000000000 --- a/contrib/llvm/bindings/ada/transforms/llvm_transforms-binding.ads +++ /dev/null @@ -1,206 +0,0 @@ --- 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; diff --git a/contrib/llvm/bindings/ada/transforms/llvm_transforms.ads b/contrib/llvm/bindings/ada/transforms/llvm_transforms.ads deleted file mode 100644 index 4f37aafe805c..000000000000 --- a/contrib/llvm/bindings/ada/transforms/llvm_transforms.ads +++ /dev/null @@ -1,6 +0,0 @@ --- This file is generated by SWIG. Do *not* modify by hand. --- - -package LLVM_Transforms is - -end LLVM_Transforms; diff --git a/contrib/llvm/bindings/ada/transforms/llvm_transforms_wrap.cxx b/contrib/llvm/bindings/ada/transforms/llvm_transforms_wrap.cxx deleted file mode 100644 index 8cb04db791aa..000000000000 --- a/contrib/llvm/bindings/ada/transforms/llvm_transforms_wrap.cxx +++ /dev/null @@ -1,828 +0,0 @@ -/* ---------------------------------------------------------------------------- - * 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 class SwigValueWrapper { - T *tt; -public: - SwigValueWrapper() : tt(0) { } - SwigValueWrapper(const SwigValueWrapper& 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& rhs); -}; - -template 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 -#include -#include -#if defined(_WIN32) || defined(__CYGWIN32__) -# define DllExport __declspec( dllexport ) -# define SWIGSTDCALL __stdcall -#else -# define DllExport -# define SWIGSTDCALL -#endif - - -#ifdef __cplusplus -# include -#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 - diff --git a/contrib/llvm/bindings/ocaml/Makefile b/contrib/llvm/bindings/ocaml/Makefile deleted file mode 100644 index a89caefb4ded..000000000000 --- a/contrib/llvm/bindings/ocaml/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -##===- 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 diff --git a/contrib/llvm/bindings/ocaml/Makefile.ocaml b/contrib/llvm/bindings/ocaml/Makefile.ocaml deleted file mode 100644 index 1cff422c28d4..000000000000 --- a/contrib/llvm/bindings/ocaml/Makefile.ocaml +++ /dev/null @@ -1,410 +0,0 @@ -##===- 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 diff --git a/contrib/llvm/bindings/ocaml/analysis/Makefile b/contrib/llvm/bindings/ocaml/analysis/Makefile deleted file mode 100644 index cbfcb246704d..000000000000 --- a/contrib/llvm/bindings/ocaml/analysis/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -##===- 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 diff --git a/contrib/llvm/bindings/ocaml/analysis/analysis_ocaml.c b/contrib/llvm/bindings/ocaml/analysis/analysis_ocaml.c deleted file mode 100644 index 97167055f70e..000000000000 --- a/contrib/llvm/bindings/ocaml/analysis/analysis_ocaml.c +++ /dev/null @@ -1,72 +0,0 @@ -/*===-- 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; -} diff --git a/contrib/llvm/bindings/ocaml/analysis/llvm_analysis.ml b/contrib/llvm/bindings/ocaml/analysis/llvm_analysis.ml deleted file mode 100644 index fc4d20370747..000000000000 --- a/contrib/llvm/bindings/ocaml/analysis/llvm_analysis.ml +++ /dev/null @@ -1,22 +0,0 @@ -(*===-- 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" diff --git a/contrib/llvm/bindings/ocaml/analysis/llvm_analysis.mli b/contrib/llvm/bindings/ocaml/analysis/llvm_analysis.mli deleted file mode 100644 index 793f482e3c6c..000000000000 --- a/contrib/llvm/bindings/ocaml/analysis/llvm_analysis.mli +++ /dev/null @@ -1,46 +0,0 @@ -(*===-- 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" diff --git a/contrib/llvm/bindings/ocaml/bitreader/Makefile b/contrib/llvm/bindings/ocaml/bitreader/Makefile deleted file mode 100644 index a1c7de895cf8..000000000000 --- a/contrib/llvm/bindings/ocaml/bitreader/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -##===- 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 diff --git a/contrib/llvm/bindings/ocaml/bitreader/bitreader_ocaml.c b/contrib/llvm/bindings/ocaml/bitreader/bitreader_ocaml.c deleted file mode 100644 index ef72ce213d8b..000000000000 --- a/contrib/llvm/bindings/ocaml/bitreader/bitreader_ocaml.c +++ /dev/null @@ -1,73 +0,0 @@ -/*===-- 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); -} diff --git a/contrib/llvm/bindings/ocaml/bitreader/llvm_bitreader.ml b/contrib/llvm/bindings/ocaml/bitreader/llvm_bitreader.ml deleted file mode 100644 index 8b9d01d8fb01..000000000000 --- a/contrib/llvm/bindings/ocaml/bitreader/llvm_bitreader.ml +++ /dev/null @@ -1,20 +0,0 @@ -(*===-- 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" diff --git a/contrib/llvm/bindings/ocaml/bitreader/llvm_bitreader.mli b/contrib/llvm/bindings/ocaml/bitreader/llvm_bitreader.mli deleted file mode 100644 index 5e2240974af4..000000000000 --- a/contrib/llvm/bindings/ocaml/bitreader/llvm_bitreader.mli +++ /dev/null @@ -1,29 +0,0 @@ -(*===-- 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" diff --git a/contrib/llvm/bindings/ocaml/bitwriter/Makefile b/contrib/llvm/bindings/ocaml/bitwriter/Makefile deleted file mode 100644 index cec0a59c31b6..000000000000 --- a/contrib/llvm/bindings/ocaml/bitwriter/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -##===- 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 diff --git a/contrib/llvm/bindings/ocaml/bitwriter/bitwriter_ocaml.c b/contrib/llvm/bindings/ocaml/bitwriter/bitwriter_ocaml.c deleted file mode 100644 index 53c93cbdfe9b..000000000000 --- a/contrib/llvm/bindings/ocaml/bitwriter/bitwriter_ocaml.c +++ /dev/null @@ -1,45 +0,0 @@ -/*===-- 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); -} diff --git a/contrib/llvm/bindings/ocaml/bitwriter/llvm_bitwriter.ml b/contrib/llvm/bindings/ocaml/bitwriter/llvm_bitwriter.ml deleted file mode 100644 index 3e69a3cc8fbb..000000000000 --- a/contrib/llvm/bindings/ocaml/bitwriter/llvm_bitwriter.ml +++ /dev/null @@ -1,25 +0,0 @@ -(*===-- 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) diff --git a/contrib/llvm/bindings/ocaml/bitwriter/llvm_bitwriter.mli b/contrib/llvm/bindings/ocaml/bitwriter/llvm_bitwriter.mli deleted file mode 100644 index ea9a87600a75..000000000000 --- a/contrib/llvm/bindings/ocaml/bitwriter/llvm_bitwriter.mli +++ /dev/null @@ -1,30 +0,0 @@ -(*===-- 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 diff --git a/contrib/llvm/bindings/ocaml/executionengine/Makefile b/contrib/llvm/bindings/ocaml/executionengine/Makefile deleted file mode 100644 index 5fa3f22048f4..000000000000 --- a/contrib/llvm/bindings/ocaml/executionengine/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -##===- 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 diff --git a/contrib/llvm/bindings/ocaml/executionengine/executionengine_ocaml.c b/contrib/llvm/bindings/ocaml/executionengine/executionengine_ocaml.c deleted file mode 100644 index 5b1e32efefcd..000000000000 --- a/contrib/llvm/bindings/ocaml/executionengine/executionengine_ocaml.c +++ /dev/null @@ -1,323 +0,0 @@ -/*===-- 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 -#include - -/* 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; -} - diff --git a/contrib/llvm/bindings/ocaml/executionengine/llvm_executionengine.ml b/contrib/llvm/bindings/ocaml/executionengine/llvm_executionengine.ml deleted file mode 100644 index a8535b246404..000000000000 --- a/contrib/llvm/bindings/ocaml/executionengine/llvm_executionengine.ml +++ /dev/null @@ -1,112 +0,0 @@ -(*===-- 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" diff --git a/contrib/llvm/bindings/ocaml/executionengine/llvm_executionengine.mli b/contrib/llvm/bindings/ocaml/executionengine/llvm_executionengine.mli deleted file mode 100644 index ce25f9d0ae09..000000000000 --- a/contrib/llvm/bindings/ocaml/executionengine/llvm_executionengine.mli +++ /dev/null @@ -1,163 +0,0 @@ -(*===-- 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" diff --git a/contrib/llvm/bindings/ocaml/llvm/Makefile b/contrib/llvm/bindings/ocaml/llvm/Makefile deleted file mode 100644 index 99e347bc1312..000000000000 --- a/contrib/llvm/bindings/ocaml/llvm/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -##===- 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 diff --git a/contrib/llvm/bindings/ocaml/llvm/llvm.ml b/contrib/llvm/bindings/ocaml/llvm/llvm.ml deleted file mode 100644 index 462eb201694b..000000000000 --- a/contrib/llvm/bindings/ocaml/llvm/llvm.ml +++ /dev/null @@ -1,1064 +0,0 @@ -(*===-- llvm/llvm.ml - LLVM Ocaml Interface --------------------------------===* - * - * The LLVM Compiler Infrastructure - * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. - * - *===----------------------------------------------------------------------===*) - - -type llcontext -type llmodule -type lltype -type lltypehandle -type llvalue -type lluse -type llbasicblock -type llbuilder -type llmemorybuffer - -module TypeKind = struct - type t = - | Void - | Float - | Double - | X86fp80 - | Fp128 - | Ppc_fp128 - | Label - | Integer - | Function - | Struct - | Array - | Pointer - | Opaque - | Vector - | Metadata -end - -module Linkage = struct - type t = - | External - | Available_externally - | Link_once - | Link_once_odr - | Weak - | Weak_odr - | Appending - | Internal - | Private - | Dllimport - | Dllexport - | External_weak - | Ghost - | Common - | Linker_private -end - -module Visibility = struct - type t = - | Default - | Hidden - | Protected -end - -module CallConv = struct - let c = 0 - let fast = 8 - let cold = 9 - let x86_stdcall = 64 - let x86_fastcall = 65 -end - -module Attribute = struct - type t = - | Zext - | Sext - | Noreturn - | Inreg - | Structret - | Nounwind - | Noalias - | Byval - | Nest - | Readnone - | Readonly - | Noinline - | Alwaysinline - | Optsize - | Ssp - | Sspreq - | Alignment of int - | Nocapture - | Noredzone - | Noimplicitfloat - | Naked - | Inlinehint - | Stackalignment of int -end - -module Icmp = struct - type t = - | Eq - | Ne - | Ugt - | Uge - | Ult - | Ule - | Sgt - | Sge - | Slt - | Sle -end - -module Fcmp = struct - type t = - | False - | Oeq - | Ogt - | Oge - | Olt - | Ole - | One - | Ord - | Uno - | Ueq - | Ugt - | Uge - | Ult - | Ule - | Une - | True -end - -exception IoError of string - -external register_exns : exn -> unit = "llvm_register_core_exns" -let _ = register_exns (IoError "") - -type ('a, 'b) llpos = -| At_end of 'a -| Before of 'b - -type ('a, 'b) llrev_pos = -| At_start of 'a -| After of 'b - -(*===-- Contexts ----------------------------------------------------------===*) -external create_context : unit -> llcontext = "llvm_create_context" -external dispose_context : llcontext -> unit = "llvm_dispose_context" -external global_context : unit -> llcontext = "llvm_global_context" -external mdkind_id : llcontext -> string -> int = "llvm_mdkind_id" - -(*===-- Modules -----------------------------------------------------------===*) -external create_module : llcontext -> string -> llmodule = "llvm_create_module" -external dispose_module : llmodule -> unit = "llvm_dispose_module" -external target_triple: llmodule -> string - = "llvm_target_triple" -external set_target_triple: string -> llmodule -> unit - = "llvm_set_target_triple" -external data_layout: llmodule -> string - = "llvm_data_layout" -external set_data_layout: string -> llmodule -> unit - = "llvm_set_data_layout" -external define_type_name : string -> lltype -> llmodule -> bool - = "llvm_add_type_name" -external delete_type_name : string -> llmodule -> unit - = "llvm_delete_type_name" -external type_by_name : llmodule -> string -> lltype option - = "llvm_type_by_name" -external dump_module : llmodule -> unit = "llvm_dump_module" -external set_module_inline_asm : llmodule -> string -> unit - = "llvm_set_module_inline_asm" - -(*===-- Types -------------------------------------------------------------===*) -external classify_type : lltype -> TypeKind.t = "llvm_classify_type" -external type_context : lltype -> llcontext = "llvm_type_context" - -(*--... Operations on integer types ........................................--*) -external i1_type : llcontext -> lltype = "llvm_i1_type" -external i8_type : llcontext -> lltype = "llvm_i8_type" -external i16_type : llcontext -> lltype = "llvm_i16_type" -external i32_type : llcontext -> lltype = "llvm_i32_type" -external i64_type : llcontext -> lltype = "llvm_i64_type" - -external integer_type : llcontext -> int -> lltype = "llvm_integer_type" -external integer_bitwidth : lltype -> int = "llvm_integer_bitwidth" - -(*--... Operations on real types ...........................................--*) -external float_type : llcontext -> lltype = "llvm_float_type" -external double_type : llcontext -> lltype = "llvm_double_type" -external x86fp80_type : llcontext -> lltype = "llvm_x86fp80_type" -external fp128_type : llcontext -> lltype = "llvm_fp128_type" -external ppc_fp128_type : llcontext -> lltype = "llvm_ppc_fp128_type" - -(*--... Operations on function types .......................................--*) -external function_type : lltype -> lltype array -> lltype = "llvm_function_type" -external var_arg_function_type : lltype -> lltype array -> lltype - = "llvm_var_arg_function_type" -external is_var_arg : lltype -> bool = "llvm_is_var_arg" -external return_type : lltype -> lltype = "LLVMGetReturnType" -external param_types : lltype -> lltype array = "llvm_param_types" - -(*--... Operations on struct types .........................................--*) -external struct_type : llcontext -> lltype array -> lltype = "llvm_struct_type" -external packed_struct_type : llcontext -> lltype array -> lltype - = "llvm_packed_struct_type" -external struct_element_types : lltype -> lltype array - = "llvm_struct_element_types" -external is_packed : lltype -> bool = "llvm_is_packed" - -(*--... Operations on pointer, vector, and array types .....................--*) -external array_type : lltype -> int -> lltype = "llvm_array_type" -external pointer_type : lltype -> lltype = "llvm_pointer_type" -external qualified_pointer_type : lltype -> int -> lltype - = "llvm_qualified_pointer_type" -external vector_type : lltype -> int -> lltype = "llvm_vector_type" - -external element_type : lltype -> lltype = "LLVMGetElementType" -external array_length : lltype -> int = "llvm_array_length" -external address_space : lltype -> int = "llvm_address_space" -external vector_size : lltype -> int = "llvm_vector_size" - -(*--... Operations on other types ..........................................--*) -external opaque_type : llcontext -> lltype = "llvm_opaque_type" -external void_type : llcontext -> lltype = "llvm_void_type" -external label_type : llcontext -> lltype = "llvm_label_type" - -(*--... Operations on type handles .........................................--*) -external handle_to_type : lltype -> lltypehandle = "llvm_handle_to_type" -external type_of_handle : lltypehandle -> lltype = "llvm_type_of_handle" -external refine_type : lltype -> lltype -> unit = "llvm_refine_type" - - -(*===-- Values ------------------------------------------------------------===*) -external type_of : llvalue -> lltype = "llvm_type_of" -external value_name : llvalue -> string = "llvm_value_name" -external set_value_name : string -> llvalue -> unit = "llvm_set_value_name" -external dump_value : llvalue -> unit = "llvm_dump_value" -external replace_all_uses_with : llvalue -> llvalue -> unit - = "LLVMReplaceAllUsesWith" - -(*--... Operations on uses .................................................--*) -external use_begin : llvalue -> lluse option = "llvm_use_begin" -external use_succ : lluse -> lluse option = "llvm_use_succ" -external user : lluse -> llvalue = "llvm_user" -external used_value : lluse -> llvalue = "llvm_used_value" - -let iter_uses f v = - let rec aux = function - | None -> () - | Some u -> - f u; - aux (use_succ u) - in - aux (use_begin v) - -let fold_left_uses f init v = - let rec aux init u = - match u with - | None -> init - | Some u -> aux (f init u) (use_succ u) - in - aux init (use_begin v) - -let fold_right_uses f v init = - let rec aux u init = - match u with - | None -> init - | Some u -> f u (aux (use_succ u) init) - in - aux (use_begin v) init - - -(*--... Operations on users ................................................--*) -external operand : llvalue -> int -> llvalue = "llvm_operand" -external set_operand : llvalue -> int -> llvalue -> unit = "llvm_set_operand" -external num_operands : llvalue -> int = "llvm_num_operands" - -(*--... Operations on constants of (mostly) any type .......................--*) -external is_constant : llvalue -> bool = "llvm_is_constant" -external const_null : lltype -> llvalue = "LLVMConstNull" -external const_all_ones : (*int|vec*)lltype -> llvalue = "LLVMConstAllOnes" -external const_pointer_null : lltype -> llvalue = "LLVMConstPointerNull" -external undef : lltype -> llvalue = "LLVMGetUndef" -external is_null : llvalue -> bool = "llvm_is_null" -external is_undef : llvalue -> bool = "llvm_is_undef" - -(*--... Operations on instructions .........................................--*) -external has_metadata : llvalue -> bool = "llvm_has_metadata" -external metadata : llvalue -> int -> llvalue option = "llvm_metadata" -external set_metadata : llvalue -> int -> llvalue -> unit = "llvm_set_metadata" -external clear_metadata : llvalue -> int -> unit = "llvm_clear_metadata" - -(*--... Operations on metadata .......,.....................................--*) -external mdstring : llcontext -> string -> llvalue = "llvm_mdstring" -external mdnode : llcontext -> llvalue array -> llvalue = "llvm_mdnode" - -(*--... Operations on scalar constants .....................................--*) -external const_int : lltype -> int -> llvalue = "llvm_const_int" -external const_of_int64 : lltype -> Int64.t -> bool -> llvalue - = "llvm_const_of_int64" -external const_int_of_string : lltype -> string -> int -> llvalue - = "llvm_const_int_of_string" -external const_float : lltype -> float -> llvalue = "llvm_const_float" -external const_float_of_string : lltype -> string -> llvalue - = "llvm_const_float_of_string" - -(*--... Operations on composite constants ..................................--*) -external const_string : llcontext -> string -> llvalue = "llvm_const_string" -external const_stringz : llcontext -> string -> llvalue = "llvm_const_stringz" -external const_array : lltype -> llvalue array -> llvalue = "llvm_const_array" -external const_struct : llcontext -> llvalue array -> llvalue - = "llvm_const_struct" -external const_packed_struct : llcontext -> llvalue array -> llvalue - = "llvm_const_packed_struct" -external const_vector : llvalue array -> llvalue = "llvm_const_vector" - -(*--... Constant expressions ...............................................--*) -external align_of : lltype -> llvalue = "LLVMAlignOf" -external size_of : lltype -> llvalue = "LLVMSizeOf" -external const_neg : llvalue -> llvalue = "LLVMConstNeg" -external const_nsw_neg : llvalue -> llvalue = "LLVMConstNSWNeg" -external const_nuw_neg : llvalue -> llvalue = "LLVMConstNUWNeg" -external const_fneg : llvalue -> llvalue = "LLVMConstFNeg" -external const_not : llvalue -> llvalue = "LLVMConstNot" -external const_add : llvalue -> llvalue -> llvalue = "LLVMConstAdd" -external const_nsw_add : llvalue -> llvalue -> llvalue = "LLVMConstNSWAdd" -external const_nuw_add : llvalue -> llvalue -> llvalue = "LLVMConstNUWAdd" -external const_fadd : llvalue -> llvalue -> llvalue = "LLVMConstFAdd" -external const_sub : llvalue -> llvalue -> llvalue = "LLVMConstSub" -external const_nsw_sub : llvalue -> llvalue -> llvalue = "LLVMConstNSWSub" -external const_nuw_sub : llvalue -> llvalue -> llvalue = "LLVMConstNUWSub" -external const_fsub : llvalue -> llvalue -> llvalue = "LLVMConstFSub" -external const_mul : llvalue -> llvalue -> llvalue = "LLVMConstMul" -external const_nsw_mul : llvalue -> llvalue -> llvalue = "LLVMConstNSWMul" -external const_nuw_mul : llvalue -> llvalue -> llvalue = "LLVMConstNUWMul" -external const_fmul : llvalue -> llvalue -> llvalue = "LLVMConstFMul" -external const_udiv : llvalue -> llvalue -> llvalue = "LLVMConstUDiv" -external const_sdiv : llvalue -> llvalue -> llvalue = "LLVMConstSDiv" -external const_exact_sdiv : llvalue -> llvalue -> llvalue = "LLVMConstExactSDiv" -external const_fdiv : llvalue -> llvalue -> llvalue = "LLVMConstFDiv" -external const_urem : llvalue -> llvalue -> llvalue = "LLVMConstURem" -external const_srem : llvalue -> llvalue -> llvalue = "LLVMConstSRem" -external const_frem : llvalue -> llvalue -> llvalue = "LLVMConstFRem" -external const_and : llvalue -> llvalue -> llvalue = "LLVMConstAnd" -external const_or : llvalue -> llvalue -> llvalue = "LLVMConstOr" -external const_xor : llvalue -> llvalue -> llvalue = "LLVMConstXor" -external const_icmp : Icmp.t -> llvalue -> llvalue -> llvalue - = "llvm_const_icmp" -external const_fcmp : Fcmp.t -> llvalue -> llvalue -> llvalue - = "llvm_const_fcmp" -external const_shl : llvalue -> llvalue -> llvalue = "LLVMConstShl" -external const_lshr : llvalue -> llvalue -> llvalue = "LLVMConstLShr" -external const_ashr : llvalue -> llvalue -> llvalue = "LLVMConstAShr" -external const_gep : llvalue -> llvalue array -> llvalue = "llvm_const_gep" -external const_in_bounds_gep : llvalue -> llvalue array -> llvalue - = "llvm_const_in_bounds_gep" -external const_trunc : llvalue -> lltype -> llvalue = "LLVMConstTrunc" -external const_sext : llvalue -> lltype -> llvalue = "LLVMConstSExt" -external const_zext : llvalue -> lltype -> llvalue = "LLVMConstZExt" -external const_fptrunc : llvalue -> lltype -> llvalue = "LLVMConstFPTrunc" -external const_fpext : llvalue -> lltype -> llvalue = "LLVMConstFPExt" -external const_uitofp : llvalue -> lltype -> llvalue = "LLVMConstUIToFP" -external const_sitofp : llvalue -> lltype -> llvalue = "LLVMConstSIToFP" -external const_fptoui : llvalue -> lltype -> llvalue = "LLVMConstFPToUI" -external const_fptosi : llvalue -> lltype -> llvalue = "LLVMConstFPToSI" -external const_ptrtoint : llvalue -> lltype -> llvalue = "LLVMConstPtrToInt" -external const_inttoptr : llvalue -> lltype -> llvalue = "LLVMConstIntToPtr" -external const_bitcast : llvalue -> lltype -> llvalue = "LLVMConstBitCast" -external const_zext_or_bitcast : llvalue -> lltype -> llvalue - = "LLVMConstZExtOrBitCast" -external const_sext_or_bitcast : llvalue -> lltype -> llvalue - = "LLVMConstSExtOrBitCast" -external const_trunc_or_bitcast : llvalue -> lltype -> llvalue - = "LLVMConstTruncOrBitCast" -external const_pointercast : llvalue -> lltype -> llvalue - = "LLVMConstPointerCast" -external const_intcast : llvalue -> lltype -> llvalue = "LLVMConstIntCast" -external const_fpcast : llvalue -> lltype -> llvalue = "LLVMConstFPCast" -external const_select : llvalue -> llvalue -> llvalue -> llvalue - = "LLVMConstSelect" -external const_extractelement : llvalue -> llvalue -> llvalue - = "LLVMConstExtractElement" -external const_insertelement : llvalue -> llvalue -> llvalue -> llvalue - = "LLVMConstInsertElement" -external const_shufflevector : llvalue -> llvalue -> llvalue -> llvalue - = "LLVMConstShuffleVector" -external const_extractvalue : llvalue -> int array -> llvalue - = "llvm_const_extractvalue" -external const_insertvalue : llvalue -> llvalue -> int array -> llvalue - = "llvm_const_insertvalue" -external const_inline_asm : lltype -> string -> string -> bool -> bool -> - llvalue - = "llvm_const_inline_asm" -external block_address : llvalue -> llbasicblock -> llvalue = "LLVMBlockAddress" - -(*--... Operations on global variables, functions, and aliases (globals) ...--*) -external global_parent : llvalue -> llmodule = "LLVMGetGlobalParent" -external is_declaration : llvalue -> bool = "llvm_is_declaration" -external linkage : llvalue -> Linkage.t = "llvm_linkage" -external set_linkage : Linkage.t -> llvalue -> unit = "llvm_set_linkage" -external section : llvalue -> string = "llvm_section" -external set_section : string -> llvalue -> unit = "llvm_set_section" -external visibility : llvalue -> Visibility.t = "llvm_visibility" -external set_visibility : Visibility.t -> llvalue -> unit = "llvm_set_visibility" -external alignment : llvalue -> int = "llvm_alignment" -external set_alignment : int -> llvalue -> unit = "llvm_set_alignment" -external is_global_constant : llvalue -> bool = "llvm_is_global_constant" -external set_global_constant : bool -> llvalue -> unit - = "llvm_set_global_constant" - -(*--... Operations on global variables .....................................--*) -external declare_global : lltype -> string -> llmodule -> llvalue - = "llvm_declare_global" -external declare_qualified_global : lltype -> string -> int -> llmodule -> - llvalue - = "llvm_declare_qualified_global" -external define_global : string -> llvalue -> llmodule -> llvalue - = "llvm_define_global" -external define_qualified_global : string -> llvalue -> int -> llmodule -> - llvalue - = "llvm_define_qualified_global" -external lookup_global : string -> llmodule -> llvalue option - = "llvm_lookup_global" -external delete_global : llvalue -> unit = "llvm_delete_global" -external global_initializer : llvalue -> llvalue = "LLVMGetInitializer" -external set_initializer : llvalue -> llvalue -> unit = "llvm_set_initializer" -external remove_initializer : llvalue -> unit = "llvm_remove_initializer" -external is_thread_local : llvalue -> bool = "llvm_is_thread_local" -external set_thread_local : bool -> llvalue -> unit = "llvm_set_thread_local" -external global_begin : llmodule -> (llmodule, llvalue) llpos - = "llvm_global_begin" -external global_succ : llvalue -> (llmodule, llvalue) llpos - = "llvm_global_succ" -external global_end : llmodule -> (llmodule, llvalue) llrev_pos - = "llvm_global_end" -external global_pred : llvalue -> (llmodule, llvalue) llrev_pos - = "llvm_global_pred" - -let rec iter_global_range f i e = - if i = e then () else - match i with - | At_end _ -> raise (Invalid_argument "Invalid global variable range.") - | Before bb -> - f bb; - iter_global_range f (global_succ bb) e - -let iter_globals f m = - iter_global_range f (global_begin m) (At_end m) - -let rec fold_left_global_range f init i e = - if i = e then init else - match i with - | At_end _ -> raise (Invalid_argument "Invalid global variable range.") - | Before bb -> fold_left_global_range f (f init bb) (global_succ bb) e - -let fold_left_globals f init m = - fold_left_global_range f init (global_begin m) (At_end m) - -let rec rev_iter_global_range f i e = - if i = e then () else - match i with - | At_start _ -> raise (Invalid_argument "Invalid global variable range.") - | After bb -> - f bb; - rev_iter_global_range f (global_pred bb) e - -let rev_iter_globals f m = - rev_iter_global_range f (global_end m) (At_start m) - -let rec fold_right_global_range f i e init = - if i = e then init else - match i with - | At_start _ -> raise (Invalid_argument "Invalid global variable range.") - | After bb -> fold_right_global_range f (global_pred bb) e (f bb init) - -let fold_right_globals f m init = - fold_right_global_range f (global_end m) (At_start m) init - -(*--... Operations on aliases ..............................................--*) -external add_alias : llmodule -> lltype -> llvalue -> string -> llvalue - = "llvm_add_alias" - -(*--... Operations on functions ............................................--*) -external declare_function : string -> lltype -> llmodule -> llvalue - = "llvm_declare_function" -external define_function : string -> lltype -> llmodule -> llvalue - = "llvm_define_function" -external lookup_function : string -> llmodule -> llvalue option - = "llvm_lookup_function" -external delete_function : llvalue -> unit = "llvm_delete_function" -external is_intrinsic : llvalue -> bool = "llvm_is_intrinsic" -external function_call_conv : llvalue -> int = "llvm_function_call_conv" -external set_function_call_conv : int -> llvalue -> unit - = "llvm_set_function_call_conv" -external gc : llvalue -> string option = "llvm_gc" -external set_gc : string option -> llvalue -> unit = "llvm_set_gc" -external function_begin : llmodule -> (llmodule, llvalue) llpos - = "llvm_function_begin" -external function_succ : llvalue -> (llmodule, llvalue) llpos - = "llvm_function_succ" -external function_end : llmodule -> (llmodule, llvalue) llrev_pos - = "llvm_function_end" -external function_pred : llvalue -> (llmodule, llvalue) llrev_pos - = "llvm_function_pred" - -let rec iter_function_range f i e = - if i = e then () else - match i with - | At_end _ -> raise (Invalid_argument "Invalid function range.") - | Before fn -> - f fn; - iter_function_range f (function_succ fn) e - -let iter_functions f m = - iter_function_range f (function_begin m) (At_end m) - -let rec fold_left_function_range f init i e = - if i = e then init else - match i with - | At_end _ -> raise (Invalid_argument "Invalid function range.") - | Before fn -> fold_left_function_range f (f init fn) (function_succ fn) e - -let fold_left_functions f init m = - fold_left_function_range f init (function_begin m) (At_end m) - -let rec rev_iter_function_range f i e = - if i = e then () else - match i with - | At_start _ -> raise (Invalid_argument "Invalid function range.") - | After fn -> - f fn; - rev_iter_function_range f (function_pred fn) e - -let rev_iter_functions f m = - rev_iter_function_range f (function_end m) (At_start m) - -let rec fold_right_function_range f i e init = - if i = e then init else - match i with - | At_start _ -> raise (Invalid_argument "Invalid function range.") - | After fn -> fold_right_function_range f (function_pred fn) e (f fn init) - -let fold_right_functions f m init = - fold_right_function_range f (function_end m) (At_start m) init - -external llvm_add_function_attr : llvalue -> int -> unit - = "llvm_add_function_attr" -external llvm_remove_function_attr : llvalue -> int -> unit - = "llvm_remove_function_attr" - -let pack_attr (attr:Attribute.t) : int = - match attr with - Attribute.Zext -> 1 lsl 0 - | Attribute.Sext -> 1 lsl 1 - | Attribute.Noreturn -> 1 lsl 2 - | Attribute.Inreg -> 1 lsl 3 - | Attribute.Structret -> 1 lsl 4 - | Attribute.Nounwind -> 1 lsl 5 - | Attribute.Noalias -> 1 lsl 6 - | Attribute.Byval -> 1 lsl 7 - | Attribute.Nest -> 1 lsl 8 - | Attribute.Readnone -> 1 lsl 9 - | Attribute.Readonly -> 1 lsl 10 - | Attribute.Noinline -> 1 lsl 11 - | Attribute.Alwaysinline -> 1 lsl 12 - | Attribute.Optsize -> 1 lsl 13 - | Attribute.Ssp -> 1 lsl 14 - | Attribute.Sspreq -> 1 lsl 15 - | Attribute.Alignment n -> n lsl 16 - | Attribute.Nocapture -> 1 lsl 21 - | Attribute.Noredzone -> 1 lsl 22 - | Attribute.Noimplicitfloat -> 1 lsl 23 - | Attribute.Naked -> 1 lsl 24 - | Attribute.Inlinehint -> 1 lsl 25 - | Attribute.Stackalignment n -> n lsl 26 - -let add_function_attr llval attr = - llvm_add_function_attr llval (pack_attr attr) - -let remove_function_attr llval attr = - llvm_remove_function_attr llval (pack_attr attr) - -(*--... Operations on params ...............................................--*) -external params : llvalue -> llvalue array = "llvm_params" -external param : llvalue -> int -> llvalue = "llvm_param" -external param_parent : llvalue -> llvalue = "LLVMGetParamParent" -external param_begin : llvalue -> (llvalue, llvalue) llpos = "llvm_param_begin" -external param_succ : llvalue -> (llvalue, llvalue) llpos = "llvm_param_succ" -external param_end : llvalue -> (llvalue, llvalue) llrev_pos = "llvm_param_end" -external param_pred : llvalue -> (llvalue, llvalue) llrev_pos ="llvm_param_pred" - -let rec iter_param_range f i e = - if i = e then () else - match i with - | At_end _ -> raise (Invalid_argument "Invalid parameter range.") - | Before p -> - f p; - iter_param_range f (param_succ p) e - -let iter_params f fn = - iter_param_range f (param_begin fn) (At_end fn) - -let rec fold_left_param_range f init i e = - if i = e then init else - match i with - | At_end _ -> raise (Invalid_argument "Invalid parameter range.") - | Before p -> fold_left_param_range f (f init p) (param_succ p) e - -let fold_left_params f init fn = - fold_left_param_range f init (param_begin fn) (At_end fn) - -let rec rev_iter_param_range f i e = - if i = e then () else - match i with - | At_start _ -> raise (Invalid_argument "Invalid parameter range.") - | After p -> - f p; - rev_iter_param_range f (param_pred p) e - -let rev_iter_params f fn = - rev_iter_param_range f (param_end fn) (At_start fn) - -let rec fold_right_param_range f init i e = - if i = e then init else - match i with - | At_start _ -> raise (Invalid_argument "Invalid parameter range.") - | After p -> fold_right_param_range f (f p init) (param_pred p) e - -let fold_right_params f fn init = - fold_right_param_range f init (param_end fn) (At_start fn) - -external llvm_add_param_attr : llvalue -> int -> unit - = "llvm_add_param_attr" -external llvm_remove_param_attr : llvalue -> int -> unit - = "llvm_remove_param_attr" - -let add_param_attr llval attr = - llvm_add_param_attr llval (pack_attr attr) - -let remove_param_attr llval attr = - llvm_remove_param_attr llval (pack_attr attr) - -external set_param_alignment : llvalue -> int -> unit - = "llvm_set_param_alignment" - -(*--... Operations on basic blocks .........................................--*) -external value_of_block : llbasicblock -> llvalue = "LLVMBasicBlockAsValue" -external value_is_block : llvalue -> bool = "llvm_value_is_block" -external block_of_value : llvalue -> llbasicblock = "LLVMValueAsBasicBlock" -external block_parent : llbasicblock -> llvalue = "LLVMGetBasicBlockParent" -external basic_blocks : llvalue -> llbasicblock array = "llvm_basic_blocks" -external entry_block : llvalue -> llbasicblock = "LLVMGetEntryBasicBlock" -external delete_block : llbasicblock -> unit = "llvm_delete_block" -external append_block : llcontext -> string -> llvalue -> llbasicblock - = "llvm_append_block" -external insert_block : llcontext -> string -> llbasicblock -> llbasicblock - = "llvm_insert_block" -external block_begin : llvalue -> (llvalue, llbasicblock) llpos - = "llvm_block_begin" -external block_succ : llbasicblock -> (llvalue, llbasicblock) llpos - = "llvm_block_succ" -external block_end : llvalue -> (llvalue, llbasicblock) llrev_pos - = "llvm_block_end" -external block_pred : llbasicblock -> (llvalue, llbasicblock) llrev_pos - = "llvm_block_pred" - -let rec iter_block_range f i e = - if i = e then () else - match i with - | At_end _ -> raise (Invalid_argument "Invalid block range.") - | Before bb -> - f bb; - iter_block_range f (block_succ bb) e - -let iter_blocks f fn = - iter_block_range f (block_begin fn) (At_end fn) - -let rec fold_left_block_range f init i e = - if i = e then init else - match i with - | At_end _ -> raise (Invalid_argument "Invalid block range.") - | Before bb -> fold_left_block_range f (f init bb) (block_succ bb) e - -let fold_left_blocks f init fn = - fold_left_block_range f init (block_begin fn) (At_end fn) - -let rec rev_iter_block_range f i e = - if i = e then () else - match i with - | At_start _ -> raise (Invalid_argument "Invalid block range.") - | After bb -> - f bb; - rev_iter_block_range f (block_pred bb) e - -let rev_iter_blocks f fn = - rev_iter_block_range f (block_end fn) (At_start fn) - -let rec fold_right_block_range f init i e = - if i = e then init else - match i with - | At_start _ -> raise (Invalid_argument "Invalid block range.") - | After bb -> fold_right_block_range f (f bb init) (block_pred bb) e - -let fold_right_blocks f fn init = - fold_right_block_range f init (block_end fn) (At_start fn) - -(*--... Operations on instructions .........................................--*) -external instr_parent : llvalue -> llbasicblock = "LLVMGetInstructionParent" -external instr_begin : llbasicblock -> (llbasicblock, llvalue) llpos - = "llvm_instr_begin" -external instr_succ : llvalue -> (llbasicblock, llvalue) llpos - = "llvm_instr_succ" -external instr_end : llbasicblock -> (llbasicblock, llvalue) llrev_pos - = "llvm_instr_end" -external instr_pred : llvalue -> (llbasicblock, llvalue) llrev_pos - = "llvm_instr_pred" - -let rec iter_instrs_range f i e = - if i = e then () else - match i with - | At_end _ -> raise (Invalid_argument "Invalid instruction range.") - | Before i -> - f i; - iter_instrs_range f (instr_succ i) e - -let iter_instrs f bb = - iter_instrs_range f (instr_begin bb) (At_end bb) - -let rec fold_left_instrs_range f init i e = - if i = e then init else - match i with - | At_end _ -> raise (Invalid_argument "Invalid instruction range.") - | Before i -> fold_left_instrs_range f (f init i) (instr_succ i) e - -let fold_left_instrs f init bb = - fold_left_instrs_range f init (instr_begin bb) (At_end bb) - -let rec rev_iter_instrs_range f i e = - if i = e then () else - match i with - | At_start _ -> raise (Invalid_argument "Invalid instruction range.") - | After i -> - f i; - rev_iter_instrs_range f (instr_pred i) e - -let rev_iter_instrs f bb = - rev_iter_instrs_range f (instr_end bb) (At_start bb) - -let rec fold_right_instr_range f i e init = - if i = e then init else - match i with - | At_start _ -> raise (Invalid_argument "Invalid instruction range.") - | After i -> fold_right_instr_range f (instr_pred i) e (f i init) - -let fold_right_instrs f bb init = - fold_right_instr_range f (instr_end bb) (At_start bb) init - - -(*--... Operations on call sites ...........................................--*) -external instruction_call_conv: llvalue -> int - = "llvm_instruction_call_conv" -external set_instruction_call_conv: int -> llvalue -> unit - = "llvm_set_instruction_call_conv" - -external llvm_add_instruction_param_attr : llvalue -> int -> int -> unit - = "llvm_add_instruction_param_attr" -external llvm_remove_instruction_param_attr : llvalue -> int -> int -> unit - = "llvm_remove_instruction_param_attr" - -let add_instruction_param_attr llval i attr = - llvm_add_instruction_param_attr llval i (pack_attr attr) - -let remove_instruction_param_attr llval i attr = - llvm_remove_instruction_param_attr llval i (pack_attr attr) - -(*--... Operations on call instructions (only) .............................--*) -external is_tail_call : llvalue -> bool = "llvm_is_tail_call" -external set_tail_call : bool -> llvalue -> unit = "llvm_set_tail_call" - -(*--... Operations on phi nodes ............................................--*) -external add_incoming : (llvalue * llbasicblock) -> llvalue -> unit - = "llvm_add_incoming" -external incoming : llvalue -> (llvalue * llbasicblock) list = "llvm_incoming" - - -(*===-- Instruction builders ----------------------------------------------===*) -external builder : llcontext -> llbuilder = "llvm_builder" -external position_builder : (llbasicblock, llvalue) llpos -> llbuilder -> unit - = "llvm_position_builder" -external insertion_block : llbuilder -> llbasicblock = "llvm_insertion_block" -external insert_into_builder : llvalue -> string -> llbuilder -> unit - = "llvm_insert_into_builder" - -let builder_at context ip = - let b = builder context in - position_builder ip b; - b - -let builder_before context i = builder_at context (Before i) -let builder_at_end context bb = builder_at context (At_end bb) - -let position_before i = position_builder (Before i) -let position_at_end bb = position_builder (At_end bb) - - -(*--... Metadata ...........................................................--*) -external set_current_debug_location : llbuilder -> llvalue -> unit - = "llvm_set_current_debug_location" -external clear_current_debug_location : llbuilder -> unit - = "llvm_clear_current_debug_location" -external current_debug_location : llbuilder -> llvalue option - = "llvm_current_debug_location" -external set_inst_debug_location : llbuilder -> llvalue -> unit - = "llvm_set_inst_debug_location" - - -(*--... Terminators ........................................................--*) -external build_ret_void : llbuilder -> llvalue = "llvm_build_ret_void" -external build_ret : llvalue -> llbuilder -> llvalue = "llvm_build_ret" -external build_aggregate_ret : llvalue array -> llbuilder -> llvalue - = "llvm_build_aggregate_ret" -external build_br : llbasicblock -> llbuilder -> llvalue = "llvm_build_br" -external build_cond_br : llvalue -> llbasicblock -> llbasicblock -> llbuilder -> - llvalue = "llvm_build_cond_br" -external build_switch : llvalue -> llbasicblock -> int -> llbuilder -> llvalue - = "llvm_build_switch" -external add_case : llvalue -> llvalue -> llbasicblock -> unit - = "llvm_add_case" -external build_indirect_br : llvalue -> int -> llbuilder -> llvalue - = "llvm_build_indirect_br" -external add_destination : llvalue -> llbasicblock -> unit - = "llvm_add_destination" -external build_invoke : llvalue -> llvalue array -> llbasicblock -> - llbasicblock -> string -> llbuilder -> llvalue - = "llvm_build_invoke_bc" "llvm_build_invoke_nat" -external build_unwind : llbuilder -> llvalue = "llvm_build_unwind" -external build_unreachable : llbuilder -> llvalue = "llvm_build_unreachable" - -(*--... Arithmetic .........................................................--*) -external build_add : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_add" -external build_nsw_add : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_nsw_add" -external build_nuw_add : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_nuw_add" -external build_fadd : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_fadd" -external build_sub : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_sub" -external build_nsw_sub : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_nsw_sub" -external build_nuw_sub : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_nuw_sub" -external build_fsub : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_fsub" -external build_mul : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_mul" -external build_nsw_mul : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_nsw_mul" -external build_nuw_mul : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_nuw_mul" -external build_fmul : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_fmul" -external build_udiv : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_udiv" -external build_sdiv : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_sdiv" -external build_exact_sdiv : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_exact_sdiv" -external build_fdiv : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_fdiv" -external build_urem : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_urem" -external build_srem : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_srem" -external build_frem : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_frem" -external build_shl : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_shl" -external build_lshr : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_lshr" -external build_ashr : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_ashr" -external build_and : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_and" -external build_or : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_or" -external build_xor : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_xor" -external build_neg : llvalue -> string -> llbuilder -> llvalue - = "llvm_build_neg" -external build_nsw_neg : llvalue -> string -> llbuilder -> llvalue - = "llvm_build_nsw_neg" -external build_nuw_neg : llvalue -> string -> llbuilder -> llvalue - = "llvm_build_nuw_neg" -external build_fneg : llvalue -> string -> llbuilder -> llvalue - = "llvm_build_fneg" -external build_not : llvalue -> string -> llbuilder -> llvalue - = "llvm_build_not" - -(*--... Memory .............................................................--*) -external build_alloca : lltype -> string -> llbuilder -> llvalue - = "llvm_build_alloca" -external build_array_alloca : lltype -> llvalue -> string -> llbuilder -> - llvalue = "llvm_build_array_alloca" -external build_load : llvalue -> string -> llbuilder -> llvalue - = "llvm_build_load" -external build_store : llvalue -> llvalue -> llbuilder -> llvalue - = "llvm_build_store" -external build_gep : llvalue -> llvalue array -> string -> llbuilder -> llvalue - = "llvm_build_gep" -external build_in_bounds_gep : llvalue -> llvalue array -> string -> - llbuilder -> llvalue = "llvm_build_in_bounds_gep" -external build_struct_gep : llvalue -> int -> string -> llbuilder -> llvalue - = "llvm_build_struct_gep" - -external build_global_string : string -> string -> llbuilder -> llvalue - = "llvm_build_global_string" -external build_global_stringptr : string -> string -> llbuilder -> llvalue - = "llvm_build_global_stringptr" - -(*--... Casts ..............................................................--*) -external build_trunc : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_trunc" -external build_zext : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_zext" -external build_sext : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_sext" -external build_fptoui : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_fptoui" -external build_fptosi : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_fptosi" -external build_uitofp : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_uitofp" -external build_sitofp : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_sitofp" -external build_fptrunc : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_fptrunc" -external build_fpext : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_fpext" -external build_ptrtoint : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_prttoint" -external build_inttoptr : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_inttoptr" -external build_bitcast : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_bitcast" -external build_zext_or_bitcast : llvalue -> lltype -> string -> llbuilder -> - llvalue = "llvm_build_zext_or_bitcast" -external build_sext_or_bitcast : llvalue -> lltype -> string -> llbuilder -> - llvalue = "llvm_build_sext_or_bitcast" -external build_trunc_or_bitcast : llvalue -> lltype -> string -> llbuilder -> - llvalue = "llvm_build_trunc_or_bitcast" -external build_pointercast : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_pointercast" -external build_intcast : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_intcast" -external build_fpcast : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_fpcast" - -(*--... Comparisons ........................................................--*) -external build_icmp : Icmp.t -> llvalue -> llvalue -> string -> - llbuilder -> llvalue = "llvm_build_icmp" -external build_fcmp : Fcmp.t -> llvalue -> llvalue -> string -> - llbuilder -> llvalue = "llvm_build_fcmp" - -(*--... Miscellaneous instructions .........................................--*) -external build_phi : (llvalue * llbasicblock) list -> string -> llbuilder -> - llvalue = "llvm_build_phi" -external build_call : llvalue -> llvalue array -> string -> llbuilder -> llvalue - = "llvm_build_call" -external build_select : llvalue -> llvalue -> llvalue -> string -> llbuilder -> - llvalue = "llvm_build_select" -external build_va_arg : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_va_arg" -external build_extractelement : llvalue -> llvalue -> string -> llbuilder -> - llvalue = "llvm_build_extractelement" -external build_insertelement : llvalue -> llvalue -> llvalue -> string -> - llbuilder -> llvalue = "llvm_build_insertelement" -external build_shufflevector : llvalue -> llvalue -> llvalue -> string -> - llbuilder -> llvalue = "llvm_build_shufflevector" -external build_extractvalue : llvalue -> int -> string -> llbuilder -> llvalue - = "llvm_build_extractvalue" -external build_insertvalue : llvalue -> llvalue -> int -> string -> llbuilder -> - llvalue = "llvm_build_insertvalue" - -external build_is_null : llvalue -> string -> llbuilder -> llvalue - = "llvm_build_is_null" -external build_is_not_null : llvalue -> string -> llbuilder -> llvalue - = "llvm_build_is_not_null" -external build_ptrdiff : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_ptrdiff" - - -(*===-- Memory buffers ----------------------------------------------------===*) - -module MemoryBuffer = struct - external of_file : string -> llmemorybuffer = "llvm_memorybuffer_of_file" - external of_stdin : unit -> llmemorybuffer = "llvm_memorybuffer_of_stdin" - external dispose : llmemorybuffer -> unit = "llvm_memorybuffer_dispose" -end - - -(*===-- Pass Manager ------------------------------------------------------===*) - -module PassManager = struct - type 'a t - type any = [ `Module | `Function ] - external create : unit -> [ `Module ] t = "llvm_passmanager_create" - external create_function : llmodule -> [ `Function ] t - = "LLVMCreateFunctionPassManager" - external run_module : llmodule -> [ `Module ] t -> bool - = "llvm_passmanager_run_module" - external initialize : [ `Function ] t -> bool = "llvm_passmanager_initialize" - external run_function : llvalue -> [ `Function ] t -> bool - = "llvm_passmanager_run_function" - external finalize : [ `Function ] t -> bool = "llvm_passmanager_finalize" - external dispose : [< any ] t -> unit = "llvm_passmanager_dispose" -end - - -(*===-- Non-Externs -------------------------------------------------------===*) -(* These functions are built using the externals, so must be declared late. *) - -let concat2 sep arr = - let s = ref "" in - if 0 < Array.length arr then begin - s := !s ^ arr.(0); - for i = 1 to (Array.length arr) - 1 do - s := !s ^ sep ^ arr.(i) - done - end; - !s - -let rec string_of_lltype ty = - (* FIXME: stop infinite recursion! :) *) - match classify_type ty with - TypeKind.Integer -> "i" ^ string_of_int (integer_bitwidth ty) - | TypeKind.Pointer -> (string_of_lltype (element_type ty)) ^ "*" - | TypeKind.Struct -> - let s = "{ " ^ (concat2 ", " ( - Array.map string_of_lltype (struct_element_types ty) - )) ^ " }" in - if is_packed ty - then "<" ^ s ^ ">" - else s - | TypeKind.Array -> "[" ^ (string_of_int (array_length ty)) ^ - " x " ^ (string_of_lltype (element_type ty)) ^ "]" - | TypeKind.Vector -> "<" ^ (string_of_int (vector_size ty)) ^ - " x " ^ (string_of_lltype (element_type ty)) ^ ">" - | TypeKind.Opaque -> "opaque" - | TypeKind.Function -> string_of_lltype (return_type ty) ^ - " (" ^ (concat2 ", " ( - Array.map string_of_lltype (param_types ty) - )) ^ ")" - | TypeKind.Label -> "label" - | TypeKind.Ppc_fp128 -> "ppc_fp128" - | TypeKind.Fp128 -> "fp128" - | TypeKind.X86fp80 -> "x86_fp80" - | TypeKind.Double -> "double" - | TypeKind.Float -> "float" - | TypeKind.Void -> "void" - | TypeKind.Metadata -> "metadata" diff --git a/contrib/llvm/bindings/ocaml/llvm/llvm.mli b/contrib/llvm/bindings/ocaml/llvm/llvm.mli deleted file mode 100644 index ba3bbe248b71..000000000000 --- a/contrib/llvm/bindings/ocaml/llvm/llvm.mli +++ /dev/null @@ -1,2259 +0,0 @@ -(*===-- llvm/llvm.mli - LLVM Ocaml Interface -------------------------------===* - * - * The LLVM Compiler Infrastructure - * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. - * - *===----------------------------------------------------------------------===*) - -(** Core API. - - This interface provides an ocaml API for the LLVM intermediate - representation, the classes in the VMCore library. *) - - -(** {6 Abstract types} - - These abstract types correlate directly to the LLVM VMCore classes. *) - -(** The top-level container for all LLVM global data. See the - [llvm::LLVMContext] class. *) -type llcontext - -(** The top-level container for all other LLVM Intermediate Representation (IR) - objects. See the [llvm::Module] class. *) -type llmodule - -(** Each value in the LLVM IR has a type, an instance of [lltype]. See the - [llvm::Type] class. *) -type lltype - -(** When building recursive types using {!refine_type}, [lltype] values may - become invalid; use [lltypehandle] to resolve this problem. See the - [llvm::AbstractTypeHolder] class. *) -type lltypehandle - -(** Any value in the LLVM IR. Functions, instructions, global variables, - constants, and much more are all [llvalues]. See the [llvm::Value] class. - This type covers a wide range of subclasses. *) -type llvalue - -(** Used to store users and usees of values. See the [llvm::Use] class. *) -type lluse - -(** A basic block in LLVM IR. See the [llvm::BasicBlock] class. *) -type llbasicblock - -(** Used to generate instructions in the LLVM IR. See the [llvm::LLVMBuilder] - class. *) -type llbuilder - -(** Used to efficiently handle large buffers of read-only binary data. - See the [llvm::MemoryBuffer] class. *) -type llmemorybuffer - -(** The kind of an [lltype], the result of [classify_type ty]. See the - [llvm::Type::TypeID] enumeration. *) -module TypeKind : sig - type t = - Void - | Float - | Double - | X86fp80 - | Fp128 - | Ppc_fp128 - | Label - | Integer - | Function - | Struct - | Array - | Pointer - | Opaque - | Vector - | Metadata -end - -(** The linkage of a global value, accessed with {!linkage} and - {!set_linkage}. See [llvm::GlobalValue::LinkageTypes]. *) -module Linkage : sig - type t = - External - | Available_externally - | Link_once - | Link_once_odr - | Weak - | Weak_odr - | Appending - | Internal - | Private - | Dllimport - | Dllexport - | External_weak - | Ghost - | Common - | Linker_private -end - -(** The linker visibility of a global value, accessed with {!visibility} and - {!set_visibility}. See [llvm::GlobalValue::VisibilityTypes]. *) -module Visibility : sig - type t = - Default - | Hidden - | Protected -end - -(** The following calling convention values may be accessed with - {!function_call_conv} and {!set_function_call_conv}. Calling - conventions are open-ended. *) -module CallConv : sig - val c : int (** [c] is the C calling convention. *) - val fast : int (** [fast] is the calling convention to allow LLVM - maximum optimization opportunities. Use only with - internal linkage. *) - val cold : int (** [cold] is the calling convention for - callee-save. *) - val x86_stdcall : int (** [x86_stdcall] is the familiar stdcall calling - convention from C. *) - val x86_fastcall : int (** [x86_fastcall] is the familiar fastcall calling - convention from C. *) -end - -module Attribute : sig - type t = - | Zext - | Sext - | Noreturn - | Inreg - | Structret - | Nounwind - | Noalias - | Byval - | Nest - | Readnone - | Readonly - | Noinline - | Alwaysinline - | Optsize - | Ssp - | Sspreq - | Alignment of int - | Nocapture - | Noredzone - | Noimplicitfloat - | Naked - | Inlinehint - | Stackalignment of int -end - -(** The predicate for an integer comparison ([icmp]) instruction. - See the [llvm::ICmpInst::Predicate] enumeration. *) -module Icmp : sig - type t = - | Eq - | Ne - | Ugt - | Uge - | Ult - | Ule - | Sgt - | Sge - | Slt - | Sle -end - -(** The predicate for a floating-point comparison ([fcmp]) instruction. - See the [llvm::FCmpInst::Predicate] enumeration. *) -module Fcmp : sig - type t = - | False - | Oeq - | Ogt - | Oge - | Olt - | Ole - | One - | Ord - | Uno - | Ueq - | Ugt - | Uge - | Ult - | Ule - | Une - | True -end - - -(** {6 Iteration} *) - -(** [Before b] and [At_end a] specify positions from the start of the ['b] list - of [a]. [llpos] is used to specify positions in and for forward iteration - through the various value lists maintained by the LLVM IR. *) -type ('a, 'b) llpos = -| At_end of 'a -| Before of 'b - -(** [After b] and [At_start a] specify positions from the end of the ['b] list - of [a]. [llrev_pos] is used for reverse iteration through the various value - lists maintained by the LLVM IR. *) -type ('a, 'b) llrev_pos = -| At_start of 'a -| After of 'b - - -(** {6 Exceptions} *) - -exception IoError of string - - -(** {6 Contexts} *) - -(** [create_context ()] creates a context for storing the "global" state in - LLVM. See the constructor [llvm::LLVMContext]. *) -external create_context : unit -> llcontext = "llvm_create_context" - -(** [destroy_context ()] destroys a context. See the destructor - [llvm::LLVMContext::~LLVMContext]. *) -external dispose_context : llcontext -> unit = "llvm_dispose_context" - -(** See the function [llvm::getGlobalContext]. *) -external global_context : unit -> llcontext = "llvm_global_context" - -(** [mdkind_id context name] returns the MDKind ID that corresponds to the - name [name] in the context [context]. See the function - [llvm::LLVMContext::getMDKindID]. *) -external mdkind_id : llcontext -> string -> int = "llvm_mdkind_id" - - -(** {6 Modules} *) - -(** [create_module context id] creates a module with the supplied module ID in - the context [context]. Modules are not garbage collected; it is mandatory - to call {!dispose_module} to free memory. See the constructor - [llvm::Module::Module]. *) -external create_module : llcontext -> string -> llmodule = "llvm_create_module" - -(** [dispose_module m] destroys a module [m] and all of the IR objects it - contained. All references to subordinate objects are invalidated; - referencing them will invoke undefined behavior. See the destructor - [llvm::Module::~Module]. *) -external dispose_module : llmodule -> unit = "llvm_dispose_module" - -(** [target_triple m] is the target specifier for the module [m], something like - [i686-apple-darwin8]. See the method [llvm::Module::getTargetTriple]. *) -external target_triple: llmodule -> string - = "llvm_target_triple" - -(** [target_triple triple m] changes the target specifier for the module [m] to - the string [triple]. See the method [llvm::Module::setTargetTriple]. *) -external set_target_triple: string -> llmodule -> unit - = "llvm_set_target_triple" - -(** [data_layout m] is the data layout specifier for the module [m], something - like [e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-...-a0:0:64-f80:128:128]. See the - method [llvm::Module::getDataLayout]. *) -external data_layout: llmodule -> string - = "llvm_data_layout" - -(** [set_data_layout s m] changes the data layout specifier for the module [m] - to the string [s]. See the method [llvm::Module::setDataLayout]. *) -external set_data_layout: string -> llmodule -> unit - = "llvm_set_data_layout" - -(** [define_type_name name ty m] adds a named type to the module's symbol table. - Returns [true] if successful. If such a name already exists, then no entry - is added and [false] is returned. See the [llvm::Module::addTypeName] - method. *) -external define_type_name : string -> lltype -> llmodule -> bool - = "llvm_add_type_name" - -(** [delete_type_name name] removes a type name from the module's symbol - table. *) -external delete_type_name : string -> llmodule -> unit - = "llvm_delete_type_name" - -(** [type_by_name m n] returns the type in the module [m] named [n], or [None] - if it does not exist. See the method [llvm::Module::getTypeByName]. *) -external type_by_name : llmodule -> string -> lltype option - = "llvm_type_by_name" - -(** [dump_module m] prints the .ll representation of the module [m] to standard - error. See the method [llvm::Module::dump]. *) -external dump_module : llmodule -> unit = "llvm_dump_module" - -(** [set_module_inline_asm m asm] sets the inline assembler for the module. See - the method [llvm::Module::setModuleInlineAsm]. *) -external set_module_inline_asm : llmodule -> string -> unit - = "llvm_set_module_inline_asm" - - -(** {6 Types} *) - -(** [classify_type ty] returns the {!TypeKind.t} corresponding to the type [ty]. - See the method [llvm::Type::getTypeID]. *) -external classify_type : lltype -> TypeKind.t = "llvm_classify_type" - -(** [type_context ty] returns the {!llcontext} corresponding to the type [ty]. - See the method [llvm::Type::getContext]. *) -external type_context : lltype -> llcontext = "llvm_type_context" - -(** [string_of_lltype ty] returns a string describing the type [ty]. *) -val string_of_lltype : lltype -> string - -(** {7 Operations on integer types} *) - -(** [i1_type c] returns an integer type of bitwidth 1 in the context [c]. See - [llvm::Type::Int1Ty]. *) -external i1_type : llcontext -> lltype = "llvm_i1_type" - -(** [i8_type c] returns an integer type of bitwidth 8 in the context [c]. See - [llvm::Type::Int8Ty]. *) -external i8_type : llcontext -> lltype = "llvm_i8_type" - -(** [i16_type c] returns an integer type of bitwidth 16 in the context [c]. See - [llvm::Type::Int16Ty]. *) -external i16_type : llcontext -> lltype = "llvm_i16_type" - -(** [i32_type c] returns an integer type of bitwidth 32 in the context [c]. See - [llvm::Type::Int32Ty]. *) -external i32_type : llcontext -> lltype = "llvm_i32_type" - -(** [i64_type c] returns an integer type of bitwidth 64 in the context [c]. See - [llvm::Type::Int64Ty]. *) -external i64_type : llcontext -> lltype = "llvm_i64_type" - -(** [integer_type c n] returns an integer type of bitwidth [n] in the context - [c]. See the method [llvm::IntegerType::get]. *) -external integer_type : llcontext -> int -> lltype = "llvm_integer_type" - -(** [integer_bitwidth c ty] returns the number of bits in the integer type [ty] - in the context [c]. See the method [llvm::IntegerType::getBitWidth]. *) -external integer_bitwidth : lltype -> int = "llvm_integer_bitwidth" - - -(** {7 Operations on real types} *) - -(** [float_type c] returns the IEEE 32-bit floating point type in the context - [c]. See [llvm::Type::FloatTy]. *) -external float_type : llcontext -> lltype = "llvm_float_type" - -(** [double_type c] returns the IEEE 64-bit floating point type in the context - [c]. See [llvm::Type::DoubleTy]. *) -external double_type : llcontext -> lltype = "llvm_double_type" - -(** [x86fp80_type c] returns the x87 80-bit floating point type in the context - [c]. See [llvm::Type::X86_FP80Ty]. *) -external x86fp80_type : llcontext -> lltype = "llvm_x86fp80_type" - -(** [fp128_type c] returns the IEEE 128-bit floating point type in the context - [c]. See [llvm::Type::FP128Ty]. *) -external fp128_type : llcontext -> lltype = "llvm_fp128_type" - -(** [ppc_fp128_type c] returns the PowerPC 128-bit floating point type in the - context [c]. See [llvm::Type::PPC_FP128Ty]. *) -external ppc_fp128_type : llcontext -> lltype = "llvm_ppc_fp128_type" - - -(** {7 Operations on function types} *) - -(** [function_type ret_ty param_tys] returns the function type returning - [ret_ty] and taking [param_tys] as parameters. - See the method [llvm::FunctionType::get]. *) -external function_type : lltype -> lltype array -> lltype = "llvm_function_type" - -(** [va_arg_function_type ret_ty param_tys] is just like - [function_type ret_ty param_tys] except that it returns the function type - which also takes a variable number of arguments. - See the method [llvm::FunctionType::get]. *) -external var_arg_function_type : lltype -> lltype array -> lltype - = "llvm_var_arg_function_type" - -(** [is_var_arg fty] returns [true] if [fty] is a varargs function type, [false] - otherwise. See the method [llvm::FunctionType::isVarArg]. *) -external is_var_arg : lltype -> bool = "llvm_is_var_arg" - -(** [return_type fty] gets the return type of the function type [fty]. - See the method [llvm::FunctionType::getReturnType]. *) -external return_type : lltype -> lltype = "LLVMGetReturnType" - -(** [param_types fty] gets the parameter types of the function type [fty]. - See the method [llvm::FunctionType::getParamType]. *) -external param_types : lltype -> lltype array = "llvm_param_types" - - -(** {7 Operations on struct types} *) - -(** [struct_type context tys] returns the structure type in the context - [context] containing in the types in the array [tys]. See the method - [llvm::StructType::get]. *) -external struct_type : llcontext -> lltype array -> lltype - = "llvm_struct_type" - -(** [packed_struct_type context ys] returns the packed structure type in the - context [context] containing in the types in the array [tys]. See the method - [llvm::StructType::get]. *) -external packed_struct_type : llcontext -> lltype array -> lltype - = "llvm_packed_struct_type" - -(** [struct_element_types sty] returns the constituent types of the struct type - [sty]. See the method [llvm::StructType::getElementType]. *) -external struct_element_types : lltype -> lltype array - = "llvm_struct_element_types" - -(** [is_packed sty] returns [true] if the structure type [sty] is packed, - [false] otherwise. See the method [llvm::StructType::isPacked]. *) -external is_packed : lltype -> bool = "llvm_is_packed" - - -(** {7 Operations on pointer, vector, and array types} *) - -(** [array_type ty n] returns the array type containing [n] elements of type - [ty]. See the method [llvm::ArrayType::get]. *) -external array_type : lltype -> int -> lltype = "llvm_array_type" - -(** [pointer_type ty] returns the pointer type referencing objects of type - [ty] in the default address space (0). - See the method [llvm::PointerType::getUnqual]. *) -external pointer_type : lltype -> lltype = "llvm_pointer_type" - -(** [qualified_pointer_type ty as] returns the pointer type referencing objects - of type [ty] in address space [as]. - See the method [llvm::PointerType::get]. *) -external qualified_pointer_type : lltype -> int -> lltype - = "llvm_qualified_pointer_type" - -(** [vector_type ty n] returns the array type containing [n] elements of the - primitive type [ty]. See the method [llvm::ArrayType::get]. *) -external vector_type : lltype -> int -> lltype = "llvm_vector_type" - -(** [element_type ty] returns the element type of the pointer, vector, or array - type [ty]. See the method [llvm::SequentialType::get]. *) -external element_type : lltype -> lltype = "LLVMGetElementType" - -(** [element_type aty] returns the element count of the array type [aty]. - See the method [llvm::ArrayType::getNumElements]. *) -external array_length : lltype -> int = "llvm_array_length" - -(** [address_space pty] returns the address space qualifier of the pointer type - [pty]. See the method [llvm::PointerType::getAddressSpace]. *) -external address_space : lltype -> int = "llvm_address_space" - -(** [element_type ty] returns the element count of the vector type [ty]. - See the method [llvm::VectorType::getNumElements]. *) -external vector_size : lltype -> int = "llvm_vector_size" - - -(** {7 Operations on other types} *) - -(** [opaque_type c] creates a new opaque type distinct from any other in the - context [c]. Opaque types are useful for building recursive types in - combination with {!refine_type}. See [llvm::OpaqueType::get]. *) -external opaque_type : llcontext -> lltype = "llvm_opaque_type" - -(** [void_type c] creates a type of a function which does not return any - value in the context [c]. See [llvm::Type::VoidTy]. *) -external void_type : llcontext -> lltype = "llvm_void_type" - -(** [label_type c] creates a type of a basic block in the context [c]. See - [llvm::Type::LabelTy]. *) -external label_type : llcontext -> lltype = "llvm_label_type" - -(** {7 Operations on type handles} *) - -(** [handle_to_type ty] creates a handle to the type [ty]. If [ty] is later - refined as a result of a call to {!refine_type}, the handle will be updated; - any bare [lltype] references will become invalid. - See the class [llvm::PATypeHolder]. *) -external handle_to_type : lltype -> lltypehandle = "llvm_handle_to_type" - -(** [type_of_handle tyh] resolves the type handle [tyh]. - See the method [llvm::PATypeHolder::get()]. *) -external type_of_handle : lltypehandle -> lltype = "llvm_type_of_handle" - -(** [refine_type opaque_ty ty] replaces the abstract type [opaque_ty] with the - concrete type [ty] in all users. Warning: This may invalidate {!lltype} - values! Use {!lltypehandle} to manipulate potentially abstract types. See - the method [llvm::Type::refineAbstractType]. *) -external refine_type : lltype -> lltype -> unit = "llvm_refine_type" - - -(* {6 Values} *) - -(** [type_of v] returns the type of the value [v]. - See the method [llvm::Value::getType]. *) -external type_of : llvalue -> lltype = "llvm_type_of" - -(** [value_name v] returns the name of the value [v]. For global values, this is - the symbol name. For instructions and basic blocks, it is the SSA register - name. It is meaningless for constants. - See the method [llvm::Value::getName]. *) -external value_name : llvalue -> string = "llvm_value_name" - -(** [set_value_name n v] sets the name of the value [v] to [n]. See the method - [llvm::Value::setName]. *) -external set_value_name : string -> llvalue -> unit = "llvm_set_value_name" - -(** [dump_value v] prints the .ll representation of the value [v] to standard - error. See the method [llvm::Value::dump]. *) -external dump_value : llvalue -> unit = "llvm_dump_value" - -(** [replace_all_uses_with old new] replaces all uses of the value [old] - * with the value [new]. See the method [llvm::Value::replaceAllUsesWith]. *) -external replace_all_uses_with : llvalue -> llvalue -> unit - = "LLVMReplaceAllUsesWith" - - -(* {6 Uses} *) - -(** [use_begin v] returns the first position in the use list for the value [v]. - [use_begin] and [use_succ] can e used to iterate over the use list in order. - See the method [llvm::Value::use_begin]. *) -external use_begin : llvalue -> lluse option = "llvm_use_begin" - -(** [use_succ u] returns the use list position succeeding [u]. - See the method [llvm::use_value_iterator::operator++]. *) -external use_succ : lluse -> lluse option = "llvm_use_succ" - -(** [user u] returns the user of the use [u]. - See the method [llvm::Use::getUser]. *) -external user : lluse -> llvalue = "llvm_user" - -(** [used_value u] returns the usee of the use [u]. - See the method [llvm::Use::getUsedValue]. *) -external used_value : lluse -> llvalue = "llvm_used_value" - -(** [iter_uses f v] applies function [f] to each of the users of the value [v] - in order. Tail recursive. *) -val iter_uses : (lluse -> unit) -> llvalue -> unit - -(** [fold_left_uses f init v] is [f (... (f init u1) ...) uN] where - [u1,...,uN] are the users of the value [v]. Tail recursive. *) -val fold_left_uses : ('a -> lluse -> 'a) -> 'a -> llvalue -> 'a - -(** [fold_right_uses f v init] is [f u1 (... (f uN init) ...)] where - [u1,...,uN] are the users of the value [v]. Not tail recursive. *) -val fold_right_uses : (lluse -> 'a -> 'a) -> llvalue -> 'a -> 'a - - -(* {6 Users} *) - -(** [operand v i] returns the operand at index [i] for the value [v]. See the - method [llvm::User::getOperand]. *) -external operand : llvalue -> int -> llvalue = "llvm_operand" - -(** [set_operand v i o] sets the operand of the value [v] at the index [i] to - the value [o]. - See the method [llvm::User::setOperand]. *) -external set_operand : llvalue -> int -> llvalue -> unit = "llvm_set_operand" - -(** [num_operands v] returns the number of operands for the value [v]. - See the method [llvm::User::getNumOperands]. *) -external num_operands : llvalue -> int = "llvm_num_operands" - -(** {7 Operations on constants of (mostly) any type} *) - -(** [is_constant v] returns [true] if the value [v] is a constant, [false] - otherwise. Similar to [llvm::isa]. *) -external is_constant : llvalue -> bool = "llvm_is_constant" - -(** [const_null ty] returns the constant null (zero) of the type [ty]. - See the method [llvm::Constant::getNullValue]. *) -external const_null : lltype -> llvalue = "LLVMConstNull" - -(** [const_all_ones ty] returns the constant '-1' of the integer or vector type - [ty]. See the method [llvm::Constant::getAllOnesValue]. *) -external const_all_ones : (*int|vec*)lltype -> llvalue = "LLVMConstAllOnes" - -(** [const_pointer_null ty] returns the constant null (zero) pointer of the type - [ty]. See the method [llvm::ConstantPointerNull::get]. *) -external const_pointer_null : lltype -> llvalue = "LLVMConstPointerNull" - -(** [undef ty] returns the undefined value of the type [ty]. - See the method [llvm::UndefValue::get]. *) -external undef : lltype -> llvalue = "LLVMGetUndef" - -(** [is_null v] returns [true] if the value [v] is the null (zero) value. - See the method [llvm::Constant::isNullValue]. *) -external is_null : llvalue -> bool = "llvm_is_null" - -(** [is_undef v] returns [true] if the value [v] is an undefined value, [false] - otherwise. Similar to [llvm::isa]. *) -external is_undef : llvalue -> bool = "llvm_is_undef" - - -(** {7 Operations on instructions} *) - -(** [has_metadata i] returns whether or not the instruction [i] has any - metadata attached to it. See the function - [llvm::Instruction::hasMetadata]. *) -external has_metadata : llvalue -> bool = "llvm_has_metadata" - -(** [metadata i kind] optionally returns the metadata associated with the - kind [kind] in the instruction [i] See the function - [llvm::Instruction::getMetadata]. *) -external metadata : llvalue -> int -> llvalue option = "llvm_metadata" - -(** [set_metadata i kind md] sets the metadata [md] of kind [kind] in the - instruction [i]. See the function [llvm::Instruction::setMetadata]. *) -external set_metadata : llvalue -> int -> llvalue -> unit = "llvm_set_metadata" - -(** [clear_metadata i kind] clears the metadata of kind [kind] in the - instruction [i]. See the function [llvm::Instruction::setMetadata]. *) -external clear_metadata : llvalue -> int -> unit = "llvm_clear_metadata" - - -(** {7 Operations on metadata} *) - -(** [mdstring c s] returns the MDString of the string [s] in the context [c]. - See the method [llvm::MDNode::get]. *) -external mdstring : llcontext -> string -> llvalue = "llvm_mdstring" - -(** [mdnode c elts] returns the MDNode containing the values [elts] in the - context [c]. - See the method [llvm::MDNode::get]. *) -external mdnode : llcontext -> llvalue array -> llvalue = "llvm_mdnode" - - -(** {7 Operations on scalar constants} *) - -(** [const_int ty i] returns the integer constant of type [ty] and value [i]. - See the method [llvm::ConstantInt::get]. *) -external const_int : lltype -> int -> llvalue = "llvm_const_int" - -(** [const_of_int64 ty i] returns the integer constant of type [ty] and value - [i]. See the method [llvm::ConstantInt::get]. *) -external const_of_int64 : lltype -> Int64.t -> bool -> llvalue - = "llvm_const_of_int64" - -(** [const_int_of_string ty s r] returns the integer constant of type [ty] and - * value [s], with the radix [r]. See the method [llvm::ConstantInt::get]. *) -external const_int_of_string : lltype -> string -> int -> llvalue - = "llvm_const_int_of_string" - -(** [const_float ty n] returns the floating point constant of type [ty] and - value [n]. See the method [llvm::ConstantFP::get]. *) -external const_float : lltype -> float -> llvalue = "llvm_const_float" - -(** [const_float_of_string ty s] returns the floating point constant of type - [ty] and value [n]. See the method [llvm::ConstantFP::get]. *) -external const_float_of_string : lltype -> string -> llvalue - = "llvm_const_float_of_string" - - -(** {7 Operations on composite constants} *) - -(** [const_string c s] returns the constant [i8] array with the values of the - characters in the string [s] in the context [c]. The array is not - null-terminated (but see {!const_stringz}). This value can in turn be used - as the initializer for a global variable. See the method - [llvm::ConstantArray::get]. *) -external const_string : llcontext -> string -> llvalue = "llvm_const_string" - -(** [const_stringz c s] returns the constant [i8] array with the values of the - characters in the string [s] and a null terminator in the context [c]. This - value can in turn be used as the initializer for a global variable. - See the method [llvm::ConstantArray::get]. *) -external const_stringz : llcontext -> string -> llvalue = "llvm_const_stringz" - -(** [const_array ty elts] returns the constant array of type - [array_type ty (Array.length elts)] and containing the values [elts]. - This value can in turn be used as the initializer for a global variable. - See the method [llvm::ConstantArray::get]. *) -external const_array : lltype -> llvalue array -> llvalue = "llvm_const_array" - -(** [const_struct context elts] returns the structured constant of type - [struct_type (Array.map type_of elts)] and containing the values [elts] - in the context [context]. This value can in turn be used as the initializer - for a global variable. See the method [llvm::ConstantStruct::get]. *) -external const_struct : llcontext -> llvalue array -> llvalue - = "llvm_const_struct" - -(** [const_packed_struct context elts] returns the structured constant of - type {!packed_struct_type} [(Array.map type_of elts)] and containing the - values [elts] in the context [context]. This value can in turn be used as - the initializer for a global variable. See the method - [llvm::ConstantStruct::get]. *) -external const_packed_struct : llcontext -> llvalue array -> llvalue - = "llvm_const_packed_struct" - -(** [const_vector elts] returns the vector constant of type - [vector_type (type_of elts.(0)) (Array.length elts)] and containing the - values [elts]. See the method [llvm::ConstantVector::get]. *) -external const_vector : llvalue array -> llvalue = "llvm_const_vector" - - -(** {7 Constant expressions} *) - -(** [align_of ty] returns the alignof constant for the type [ty]. This is - equivalent to [const_ptrtoint (const_gep (const_null (pointer_type {i8,ty})) - (const_int i32_type 0) (const_int i32_type 1)) i32_type], but considerably - more readable. See the method [llvm::ConstantExpr::getAlignOf]. *) -external align_of : lltype -> llvalue = "LLVMAlignOf" - -(** [size_of ty] returns the sizeof constant for the type [ty]. This is - equivalent to [const_ptrtoint (const_gep (const_null (pointer_type ty)) - (const_int i32_type 1)) i64_type], but considerably more readable. - See the method [llvm::ConstantExpr::getSizeOf]. *) -external size_of : lltype -> llvalue = "LLVMSizeOf" - -(** [const_neg c] returns the arithmetic negation of the constant [c]. - See the method [llvm::ConstantExpr::getNeg]. *) -external const_neg : llvalue -> llvalue = "LLVMConstNeg" - -(** [const_nsw_neg c] returns the arithmetic negation of the constant [c] with - no signed wrapping. The result is undefined if the negation overflows. - See the method [llvm::ConstantExpr::getNSWNeg]. *) -external const_nsw_neg : llvalue -> llvalue = "LLVMConstNSWNeg" - -(** [const_nuw_neg c] returns the arithmetic negation of the constant [c] with - no unsigned wrapping. The result is undefined if the negation overflows. - See the method [llvm::ConstantExpr::getNUWNeg]. *) -external const_nuw_neg : llvalue -> llvalue = "LLVMConstNUWNeg" - -(** [const_fneg c] returns the arithmetic negation of the constant float [c]. - See the method [llvm::ConstantExpr::getFNeg]. *) -external const_fneg : llvalue -> llvalue = "LLVMConstFNeg" - -(** [const_not c] returns the bitwise inverse of the constant [c]. - See the method [llvm::ConstantExpr::getNot]. *) -external const_not : llvalue -> llvalue = "LLVMConstNot" - -(** [const_add c1 c2] returns the constant sum of two constants. - See the method [llvm::ConstantExpr::getAdd]. *) -external const_add : llvalue -> llvalue -> llvalue = "LLVMConstAdd" - -(** [const_nsw_add c1 c2] returns the constant sum of two constants with no - signed wrapping. The result is undefined if the sum overflows. - See the method [llvm::ConstantExpr::getNSWAdd]. *) -external const_nsw_add : llvalue -> llvalue -> llvalue = "LLVMConstNSWAdd" - -(** [const_nuw_add c1 c2] returns the constant sum of two constants with no - unsigned wrapping. The result is undefined if the sum overflows. - See the method [llvm::ConstantExpr::getNSWAdd]. *) -external const_nuw_add : llvalue -> llvalue -> llvalue = "LLVMConstNUWAdd" - -(** [const_fadd c1 c2] returns the constant sum of two constant floats. - See the method [llvm::ConstantExpr::getFAdd]. *) -external const_fadd : llvalue -> llvalue -> llvalue = "LLVMConstFAdd" - -(** [const_sub c1 c2] returns the constant difference, [c1 - c2], of two - constants. See the method [llvm::ConstantExpr::getSub]. *) -external const_sub : llvalue -> llvalue -> llvalue = "LLVMConstSub" - -(** [const_nsw_sub c1 c2] returns the constant difference of two constants with - no signed wrapping. The result is undefined if the sum overflows. - See the method [llvm::ConstantExpr::getNSWSub]. *) -external const_nsw_sub : llvalue -> llvalue -> llvalue = "LLVMConstNSWSub" - -(** [const_nuw_sub c1 c2] returns the constant difference of two constants with - no unsigned wrapping. The result is undefined if the sum overflows. - See the method [llvm::ConstantExpr::getNSWSub]. *) -external const_nuw_sub : llvalue -> llvalue -> llvalue = "LLVMConstNUWSub" - -(** [const_fsub c1 c2] returns the constant difference, [c1 - c2], of two - constant floats. See the method [llvm::ConstantExpr::getFSub]. *) -external const_fsub : llvalue -> llvalue -> llvalue = "LLVMConstFSub" - -(** [const_mul c1 c2] returns the constant product of two constants. - See the method [llvm::ConstantExpr::getMul]. *) -external const_mul : llvalue -> llvalue -> llvalue = "LLVMConstMul" - -(** [const_nsw_mul c1 c2] returns the constant product of two constants with - no signed wrapping. The result is undefined if the sum overflows. - See the method [llvm::ConstantExpr::getNSWMul]. *) -external const_nsw_mul : llvalue -> llvalue -> llvalue = "LLVMConstNSWMul" - -(** [const_nuw_mul c1 c2] returns the constant product of two constants with - no unsigned wrapping. The result is undefined if the sum overflows. - See the method [llvm::ConstantExpr::getNSWMul]. *) -external const_nuw_mul : llvalue -> llvalue -> llvalue = "LLVMConstNUWMul" - -(** [const_fmul c1 c2] returns the constant product of two constants floats. - See the method [llvm::ConstantExpr::getFMul]. *) -external const_fmul : llvalue -> llvalue -> llvalue = "LLVMConstFMul" - -(** [const_udiv c1 c2] returns the constant quotient [c1 / c2] of two unsigned - integer constants. - See the method [llvm::ConstantExpr::getUDiv]. *) -external const_udiv : llvalue -> llvalue -> llvalue = "LLVMConstUDiv" - -(** [const_sdiv c1 c2] returns the constant quotient [c1 / c2] of two signed - integer constants. - See the method [llvm::ConstantExpr::getSDiv]. *) -external const_sdiv : llvalue -> llvalue -> llvalue = "LLVMConstSDiv" - -(** [const_exact_sdiv c1 c2] returns the constant quotient [c1 / c2] of two - signed integer constants. The result is undefined if the result is rounded - or overflows. See the method [llvm::ConstantExpr::getExactSDiv]. *) -external const_exact_sdiv : llvalue -> llvalue -> llvalue = "LLVMConstExactSDiv" - -(** [const_fdiv c1 c2] returns the constant quotient [c1 / c2] of two floating - point constants. - See the method [llvm::ConstantExpr::getFDiv]. *) -external const_fdiv : llvalue -> llvalue -> llvalue = "LLVMConstFDiv" - -(** [const_urem c1 c2] returns the constant remainder [c1 MOD c2] of two - unsigned integer constants. - See the method [llvm::ConstantExpr::getURem]. *) -external const_urem : llvalue -> llvalue -> llvalue = "LLVMConstURem" - -(** [const_srem c1 c2] returns the constant remainder [c1 MOD c2] of two - signed integer constants. - See the method [llvm::ConstantExpr::getSRem]. *) -external const_srem : llvalue -> llvalue -> llvalue = "LLVMConstSRem" - -(** [const_frem c1 c2] returns the constant remainder [c1 MOD c2] of two - signed floating point constants. - See the method [llvm::ConstantExpr::getFRem]. *) -external const_frem : llvalue -> llvalue -> llvalue = "LLVMConstFRem" - -(** [const_and c1 c2] returns the constant bitwise [AND] of two integer - constants. - See the method [llvm::ConstantExpr::getAnd]. *) -external const_and : llvalue -> llvalue -> llvalue = "LLVMConstAnd" - -(** [const_or c1 c2] returns the constant bitwise [OR] of two integer - constants. - See the method [llvm::ConstantExpr::getOr]. *) -external const_or : llvalue -> llvalue -> llvalue = "LLVMConstOr" - -(** [const_xor c1 c2] returns the constant bitwise [XOR] of two integer - constants. - See the method [llvm::ConstantExpr::getXor]. *) -external const_xor : llvalue -> llvalue -> llvalue = "LLVMConstXor" - -(** [const_icmp pred c1 c2] returns the constant comparison of two integer - constants, [c1 pred c2]. - See the method [llvm::ConstantExpr::getICmp]. *) -external const_icmp : Icmp.t -> llvalue -> llvalue -> llvalue - = "llvm_const_icmp" - -(** [const_fcmp pred c1 c2] returns the constant comparison of two floating - point constants, [c1 pred c2]. - See the method [llvm::ConstantExpr::getFCmp]. *) -external const_fcmp : Fcmp.t -> llvalue -> llvalue -> llvalue - = "llvm_const_fcmp" - -(** [const_shl c1 c2] returns the constant integer [c1] left-shifted by the - constant integer [c2]. - See the method [llvm::ConstantExpr::getShl]. *) -external const_shl : llvalue -> llvalue -> llvalue = "LLVMConstShl" - -(** [const_lshr c1 c2] returns the constant integer [c1] right-shifted by the - constant integer [c2] with zero extension. - See the method [llvm::ConstantExpr::getLShr]. *) -external const_lshr : llvalue -> llvalue -> llvalue = "LLVMConstLShr" - -(** [const_ashr c1 c2] returns the constant integer [c1] right-shifted by the - constant integer [c2] with sign extension. - See the method [llvm::ConstantExpr::getAShr]. *) -external const_ashr : llvalue -> llvalue -> llvalue = "LLVMConstAShr" - -(** [const_gep pc indices] returns the constant [getElementPtr] of [p1] with the - constant integers indices from the array [indices]. - See the method [llvm::ConstantExpr::getGetElementPtr]. *) -external const_gep : llvalue -> llvalue array -> llvalue = "llvm_const_gep" - -(** [const_in_bounds_gep pc indices] returns the constant [getElementPtr] of [p1] - with the constant integers indices from the array [indices]. - See the method [llvm::ConstantExpr::getInBoundsGetElementPtr]. *) -external const_in_bounds_gep : llvalue -> llvalue array -> llvalue - = "llvm_const_in_bounds_gep" - -(** [const_trunc c ty] returns the constant truncation of integer constant [c] - to the smaller integer type [ty]. - See the method [llvm::ConstantExpr::getTrunc]. *) -external const_trunc : llvalue -> lltype -> llvalue = "LLVMConstTrunc" - -(** [const_sext c ty] returns the constant sign extension of integer constant - [c] to the larger integer type [ty]. - See the method [llvm::ConstantExpr::getSExt]. *) -external const_sext : llvalue -> lltype -> llvalue = "LLVMConstSExt" - -(** [const_zext c ty] returns the constant zero extension of integer constant - [c] to the larger integer type [ty]. - See the method [llvm::ConstantExpr::getZExt]. *) -external const_zext : llvalue -> lltype -> llvalue = "LLVMConstZExt" - -(** [const_fptrunc c ty] returns the constant truncation of floating point - constant [c] to the smaller floating point type [ty]. - See the method [llvm::ConstantExpr::getFPTrunc]. *) -external const_fptrunc : llvalue -> lltype -> llvalue = "LLVMConstFPTrunc" - -(** [const_fpext c ty] returns the constant extension of floating point constant - [c] to the larger floating point type [ty]. - See the method [llvm::ConstantExpr::getFPExt]. *) -external const_fpext : llvalue -> lltype -> llvalue = "LLVMConstFPExt" - -(** [const_uitofp c ty] returns the constant floating point conversion of - unsigned integer constant [c] to the floating point type [ty]. - See the method [llvm::ConstantExpr::getUIToFP]. *) -external const_uitofp : llvalue -> lltype -> llvalue = "LLVMConstUIToFP" - -(** [const_sitofp c ty] returns the constant floating point conversion of - signed integer constant [c] to the floating point type [ty]. - See the method [llvm::ConstantExpr::getSIToFP]. *) -external const_sitofp : llvalue -> lltype -> llvalue = "LLVMConstSIToFP" - -(** [const_fptoui c ty] returns the constant unsigned integer conversion of - floating point constant [c] to integer type [ty]. - See the method [llvm::ConstantExpr::getFPToUI]. *) -external const_fptoui : llvalue -> lltype -> llvalue = "LLVMConstFPToUI" - -(** [const_fptoui c ty] returns the constant unsigned integer conversion of - floating point constant [c] to integer type [ty]. - See the method [llvm::ConstantExpr::getFPToSI]. *) -external const_fptosi : llvalue -> lltype -> llvalue = "LLVMConstFPToSI" - -(** [const_ptrtoint c ty] returns the constant integer conversion of - pointer constant [c] to integer type [ty]. - See the method [llvm::ConstantExpr::getPtrToInt]. *) -external const_ptrtoint : llvalue -> lltype -> llvalue = "LLVMConstPtrToInt" - -(** [const_inttoptr c ty] returns the constant pointer conversion of - integer constant [c] to pointer type [ty]. - See the method [llvm::ConstantExpr::getIntToPtr]. *) -external const_inttoptr : llvalue -> lltype -> llvalue = "LLVMConstIntToPtr" - -(** [const_bitcast c ty] returns the constant bitwise conversion of constant [c] - to type [ty] of equal size. - See the method [llvm::ConstantExpr::getBitCast]. *) -external const_bitcast : llvalue -> lltype -> llvalue = "LLVMConstBitCast" - -(** [const_zext_or_bitcast c ty] returns a constant zext or bitwise cast - conversion of constant [c] to type [ty]. - See the method [llvm::ConstantExpr::getZExtOrBitCast]. *) -external const_zext_or_bitcast : llvalue -> lltype -> llvalue - = "LLVMConstZExtOrBitCast" - -(** [const_sext_or_bitcast c ty] returns a constant sext or bitwise cast - conversion of constant [c] to type [ty]. - See the method [llvm::ConstantExpr::getSExtOrBitCast]. *) -external const_sext_or_bitcast : llvalue -> lltype -> llvalue - = "LLVMConstSExtOrBitCast" - -(** [const_trunc_or_bitcast c ty] returns a constant trunc or bitwise cast - conversion of constant [c] to type [ty]. - See the method [llvm::ConstantExpr::getTruncOrBitCast]. *) -external const_trunc_or_bitcast : llvalue -> lltype -> llvalue - = "LLVMConstTruncOrBitCast" - -(** [const_pointercast c ty] returns a constant bitcast or a pointer-to-int - cast conversion of constant [c] to type [ty] of equal size. - See the method [llvm::ConstantExpr::getPointerCast]. *) -external const_pointercast : llvalue -> lltype -> llvalue - = "LLVMConstPointerCast" - -(** [const_intcast c ty] returns a constant zext, bitcast, or trunc for integer - -> integer casts of constant [c] to type [ty]. - See the method [llvm::ConstantExpr::getIntCast]. *) -external const_intcast : llvalue -> lltype -> llvalue - = "LLVMConstIntCast" - -(** [const_fpcast c ty] returns a constant fpext, bitcast, or fptrunc for fp -> - fp casts of constant [c] to type [ty]. - See the method [llvm::ConstantExpr::getFPCast]. *) -external const_fpcast : llvalue -> lltype -> llvalue - = "LLVMConstFPCast" - -(** [const_select cond t f] returns the constant conditional which returns value - [t] if the boolean constant [cond] is true and the value [f] otherwise. - See the method [llvm::ConstantExpr::getSelect]. *) -external const_select : llvalue -> llvalue -> llvalue -> llvalue - = "LLVMConstSelect" - -(** [const_extractelement vec i] returns the constant [i]th element of - constant vector [vec]. [i] must be a constant [i32] value unsigned less than - the size of the vector. - See the method [llvm::ConstantExpr::getExtractElement]. *) -external const_extractelement : llvalue -> llvalue -> llvalue - = "LLVMConstExtractElement" - -(** [const_insertelement vec v i] returns the constant vector with the same - elements as constant vector [v] but the [i]th element replaced by the - constant [v]. [v] must be a constant value with the type of the vector - elements. [i] must be a constant [i32] value unsigned less than the size - of the vector. - See the method [llvm::ConstantExpr::getInsertElement]. *) -external const_insertelement : llvalue -> llvalue -> llvalue -> llvalue - = "LLVMConstInsertElement" - -(** [const_shufflevector a b mask] returns a constant [shufflevector]. - See the LLVM Language Reference for details on the [shufflevector] - instruction. - See the method [llvm::ConstantExpr::getShuffleVector]. *) -external const_shufflevector : llvalue -> llvalue -> llvalue -> llvalue - = "LLVMConstShuffleVector" - -(** [const_extractvalue agg idxs] returns the constant [idxs]th value of - constant aggregate [agg]. Each [idxs] must be less than the size of the - aggregate. See the method [llvm::ConstantExpr::getExtractValue]. *) -external const_extractvalue : llvalue -> int array -> llvalue - = "llvm_const_extractvalue" - -(** [const_insertvalue agg val idxs] inserts the value [val] in the specified - indexs [idxs] in the aggegate [agg]. Each [idxs] must be less than the size - of the aggregate. See the method [llvm::ConstantExpr::getInsertValue]. *) -external const_insertvalue : llvalue -> llvalue -> int array -> llvalue - = "llvm_const_insertvalue" - -(** [const_inline_asm ty asm con side align] inserts a inline assembly string. - See the method [llvm::InlineAsm::get]. *) -external const_inline_asm : lltype -> string -> string -> bool -> bool -> - llvalue - = "llvm_const_inline_asm" - -(** [block_address f bb] returns the address of the basic block [bb] in the - function [f]. See the method [llvm::BasicBlock::get]. *) -external block_address : llvalue -> llbasicblock -> llvalue = "LLVMBlockAddress" - - -(** {7 Operations on global variables, functions, and aliases (globals)} *) - -(** [global_parent g] is the enclosing module of the global value [g]. - See the method [llvm::GlobalValue::getParent]. *) -external global_parent : llvalue -> llmodule = "LLVMGetGlobalParent" - -(** [is_declaration g] returns [true] if the global value [g] is a declaration - only. Returns [false] otherwise. - See the method [llvm::GlobalValue::isDeclaration]. *) -external is_declaration : llvalue -> bool = "llvm_is_declaration" - -(** [linkage g] returns the linkage of the global value [g]. - See the method [llvm::GlobalValue::getLinkage]. *) -external linkage : llvalue -> Linkage.t = "llvm_linkage" - -(** [set_linkage l g] sets the linkage of the global value [g] to [l]. - See the method [llvm::GlobalValue::setLinkage]. *) -external set_linkage : Linkage.t -> llvalue -> unit = "llvm_set_linkage" - -(** [section g] returns the linker section of the global value [g]. - See the method [llvm::GlobalValue::getSection]. *) -external section : llvalue -> string = "llvm_section" - -(** [set_section s g] sets the linker section of the global value [g] to [s]. - See the method [llvm::GlobalValue::setSection]. *) -external set_section : string -> llvalue -> unit = "llvm_set_section" - -(** [visibility g] returns the linker visibility of the global value [g]. - See the method [llvm::GlobalValue::getVisibility]. *) -external visibility : llvalue -> Visibility.t = "llvm_visibility" - -(** [set_visibility v g] sets the linker visibility of the global value [g] to - [v]. See the method [llvm::GlobalValue::setVisibility]. *) -external set_visibility : Visibility.t -> llvalue -> unit - = "llvm_set_visibility" - -(** [alignment g] returns the required alignment of the global value [g]. - See the method [llvm::GlobalValue::getAlignment]. *) -external alignment : llvalue -> int = "llvm_alignment" - -(** [set_alignment n g] sets the required alignment of the global value [g] to - [n] bytes. See the method [llvm::GlobalValue::setAlignment]. *) -external set_alignment : int -> llvalue -> unit = "llvm_set_alignment" - - -(** {7 Operations on global variables} *) - -(** [declare_global ty name m] returns a new global variable of type [ty] and - with name [name] in module [m] in the default address space (0). If such a - global variable already exists, it is returned. If the type of the existing - global differs, then a bitcast to [ty] is returned. *) -external declare_global : lltype -> string -> llmodule -> llvalue - = "llvm_declare_global" - -(** [declare_qualified_global ty name addrspace m] returns a new global variable - of type [ty] and with name [name] in module [m] in the address space - [addrspace]. If such a global variable already exists, it is returned. If - the type of the existing global differs, then a bitcast to [ty] is - returned. *) -external declare_qualified_global : lltype -> string -> int -> llmodule -> - llvalue - = "llvm_declare_qualified_global" - -(** [define_global name init m] returns a new global with name [name] and - initializer [init] in module [m] in the default address space (0). If the - named global already exists, it is renamed. - See the constructor of [llvm::GlobalVariable]. *) -external define_global : string -> llvalue -> llmodule -> llvalue - = "llvm_define_global" - -(** [define_qualified_global name init addrspace m] returns a new global with - name [name] and initializer [init] in module [m] in the address space - [addrspace]. If the named global already exists, it is renamed. - See the constructor of [llvm::GlobalVariable]. *) -external define_qualified_global : string -> llvalue -> int -> llmodule -> - llvalue - = "llvm_define_qualified_global" - -(** [lookup_global name m] returns [Some g] if a global variable with name - [name] exists in module [m]. If no such global exists, returns [None]. - See the [llvm::GlobalVariable] constructor. *) -external lookup_global : string -> llmodule -> llvalue option - = "llvm_lookup_global" - -(** [delete_global gv] destroys the global variable [gv]. - See the method [llvm::GlobalVariable::eraseFromParent]. *) -external delete_global : llvalue -> unit = "llvm_delete_global" - -(** [global_begin m] returns the first position in the global variable list of - the module [m]. [global_begin] and [global_succ] can be used to iterate - over the global list in order. - See the method [llvm::Module::global_begin]. *) -external global_begin : llmodule -> (llmodule, llvalue) llpos - = "llvm_global_begin" - -(** [global_succ gv] returns the global variable list position succeeding - [Before gv]. - See the method [llvm::Module::global_iterator::operator++]. *) -external global_succ : llvalue -> (llmodule, llvalue) llpos - = "llvm_global_succ" - -(** [iter_globals f m] applies function [f] to each of the global variables of - module [m] in order. Tail recursive. *) -val iter_globals : (llvalue -> unit) -> llmodule -> unit - -(** [fold_left_globals f init m] is [f (... (f init g1) ...) gN] where - [g1,...,gN] are the global variables of module [m]. Tail recursive. *) -val fold_left_globals : ('a -> llvalue -> 'a) -> 'a -> llmodule -> 'a - -(** [global_end m] returns the last position in the global variable list of the - module [m]. [global_end] and [global_pred] can be used to iterate over the - global list in reverse. - See the method [llvm::Module::global_end]. *) -external global_end : llmodule -> (llmodule, llvalue) llrev_pos - = "llvm_global_end" - -(** [global_pred gv] returns the global variable list position preceding - [After gv]. - See the method [llvm::Module::global_iterator::operator--]. *) -external global_pred : llvalue -> (llmodule, llvalue) llrev_pos - = "llvm_global_pred" - -(** [rev_iter_globals f m] applies function [f] to each of the global variables - of module [m] in reverse order. Tail recursive. *) -val rev_iter_globals : (llvalue -> unit) -> llmodule -> unit - -(** [fold_right_globals f m init] is [f g1 (... (f gN init) ...)] where - [g1,...,gN] are the global variables of module [m]. Tail recursive. *) -val fold_right_globals : (llvalue -> 'a -> 'a) -> llmodule -> 'a -> 'a - -(** [is_global_constant gv] returns [true] if the global variabile [gv] is a - constant. Returns [false] otherwise. - See the method [llvm::GlobalVariable::isConstant]. *) -external is_global_constant : llvalue -> bool = "llvm_is_global_constant" - -(** [set_global_constant c gv] sets the global variable [gv] to be a constant if - [c] is [true] and not if [c] is [false]. - See the method [llvm::GlobalVariable::setConstant]. *) -external set_global_constant : bool -> llvalue -> unit - = "llvm_set_global_constant" - -(** [global_initializer gv] returns the initializer for the global variable - [gv]. See the method [llvm::GlobalVariable::getInitializer]. *) -external global_initializer : llvalue -> llvalue = "LLVMGetInitializer" - -(** [set_initializer c gv] sets the initializer for the global variable - [gv] to the constant [c]. - See the method [llvm::GlobalVariable::setInitializer]. *) -external set_initializer : llvalue -> llvalue -> unit = "llvm_set_initializer" - -(** [remove_initializer gv] unsets the initializer for the global variable - [gv]. - See the method [llvm::GlobalVariable::setInitializer]. *) -external remove_initializer : llvalue -> unit = "llvm_remove_initializer" - -(** [is_thread_local gv] returns [true] if the global variable [gv] is - thread-local and [false] otherwise. - See the method [llvm::GlobalVariable::isThreadLocal]. *) -external is_thread_local : llvalue -> bool = "llvm_is_thread_local" - -(** [set_thread_local c gv] sets the global variable [gv] to be thread local if - [c] is [true] and not otherwise. - See the method [llvm::GlobalVariable::setThreadLocal]. *) -external set_thread_local : bool -> llvalue -> unit = "llvm_set_thread_local" - - -(** {7 Operations on aliases} *) - -(** [add_alias m t a n] inserts an alias in the module [m] with the type [t] and - the aliasee [a] with the name [n]. - See the constructor for [llvm::GlobalAlias]. *) -external add_alias : llmodule -> lltype -> llvalue -> string -> llvalue - = "llvm_add_alias" - - -(** {7 Operations on functions} *) - -(** [declare_function name ty m] returns a new function of type [ty] and - with name [name] in module [m]. If such a function already exists, - it is returned. If the type of the existing function differs, then a bitcast - to [ty] is returned. *) -external declare_function : string -> lltype -> llmodule -> llvalue - = "llvm_declare_function" - -(** [define_function name ty m] creates a new function with name [name] and - type [ty] in module [m]. If the named function already exists, it is - renamed. An entry basic block is created in the function. - See the constructor of [llvm::GlobalVariable]. *) -external define_function : string -> lltype -> llmodule -> llvalue - = "llvm_define_function" - -(** [lookup_function name m] returns [Some f] if a function with name - [name] exists in module [m]. If no such function exists, returns [None]. - See the method [llvm::Module] constructor. *) -external lookup_function : string -> llmodule -> llvalue option - = "llvm_lookup_function" - -(** [delete_function f] destroys the function [f]. - See the method [llvm::Function::eraseFromParent]. *) -external delete_function : llvalue -> unit = "llvm_delete_function" - -(** [function_begin m] returns the first position in the function list of the - module [m]. [function_begin] and [function_succ] can be used to iterate over - the function list in order. - See the method [llvm::Module::begin]. *) -external function_begin : llmodule -> (llmodule, llvalue) llpos - = "llvm_function_begin" - -(** [function_succ gv] returns the function list position succeeding - [Before gv]. - See the method [llvm::Module::iterator::operator++]. *) -external function_succ : llvalue -> (llmodule, llvalue) llpos - = "llvm_function_succ" - -(** [iter_functions f m] applies function [f] to each of the functions of module - [m] in order. Tail recursive. *) -val iter_functions : (llvalue -> unit) -> llmodule -> unit - -(** [fold_left_function f init m] is [f (... (f init f1) ...) fN] where - [f1,...,fN] are the functions of module [m]. Tail recursive. *) -val fold_left_functions : ('a -> llvalue -> 'a) -> 'a -> llmodule -> 'a - -(** [function_end m] returns the last position in the function list of - the module [m]. [function_end] and [function_pred] can be used to iterate - over the function list in reverse. - See the method [llvm::Module::end]. *) -external function_end : llmodule -> (llmodule, llvalue) llrev_pos - = "llvm_function_end" - -(** [function_pred gv] returns the function list position preceding [After gv]. - See the method [llvm::Module::iterator::operator--]. *) -external function_pred : llvalue -> (llmodule, llvalue) llrev_pos - = "llvm_function_pred" - -(** [rev_iter_functions f fn] applies function [f] to each of the functions of - module [m] in reverse order. Tail recursive. *) -val rev_iter_functions : (llvalue -> unit) -> llmodule -> unit - -(** [fold_right_functions f m init] is [f (... (f init fN) ...) f1] where - [f1,...,fN] are the functions of module [m]. Tail recursive. *) -val fold_right_functions : (llvalue -> 'a -> 'a) -> llmodule -> 'a -> 'a - -(** [is_intrinsic f] returns true if the function [f] is an intrinsic. - See the method [llvm::Function::isIntrinsic]. *) -external is_intrinsic : llvalue -> bool = "llvm_is_intrinsic" - -(** [function_call_conv f] returns the calling convention of the function [f]. - See the method [llvm::Function::getCallingConv]. *) -external function_call_conv : llvalue -> int = "llvm_function_call_conv" - -(** [set_function_call_conv cc f] sets the calling convention of the function - [f] to the calling convention numbered [cc]. - See the method [llvm::Function::setCallingConv]. *) -external set_function_call_conv : int -> llvalue -> unit - = "llvm_set_function_call_conv" - -(** [gc f] returns [Some name] if the function [f] has a garbage - collection algorithm specified and [None] otherwise. - See the method [llvm::Function::getGC]. *) -external gc : llvalue -> string option = "llvm_gc" - -(** [set_gc gc f] sets the collection algorithm for the function [f] to - [gc]. See the method [llvm::Function::setGC]. *) -external set_gc : string option -> llvalue -> unit = "llvm_set_gc" - -(** [add_function_attr f a] adds attribute [a] to the return type of function - [f]. *) -val add_function_attr : llvalue -> Attribute.t -> unit - -(** [remove_function_attr f a] removes attribute [a] from the return type of - function [f]. *) -val remove_function_attr : llvalue -> Attribute.t -> unit - -(** {7 Operations on params} *) - -(** [params f] returns the parameters of function [f]. - See the method [llvm::Function::getArgumentList]. *) -external params : llvalue -> llvalue array = "llvm_params" - -(** [param f n] returns the [n]th parameter of function [f]. - See the method [llvm::Function::getArgumentList]. *) -external param : llvalue -> int -> llvalue = "llvm_param" - -(** [param_parent p] returns the parent function that owns the parameter. - See the method [llvm::Argument::getParent]. *) -external param_parent : llvalue -> llvalue = "LLVMGetParamParent" - -(** [param_begin f] returns the first position in the parameter list of the - function [f]. [param_begin] and [param_succ] can be used to iterate over - the parameter list in order. - See the method [llvm::Function::arg_begin]. *) -external param_begin : llvalue -> (llvalue, llvalue) llpos = "llvm_param_begin" - -(** [param_succ bb] returns the parameter list position succeeding - [Before bb]. - See the method [llvm::Function::arg_iterator::operator++]. *) -external param_succ : llvalue -> (llvalue, llvalue) llpos = "llvm_param_succ" - -(** [iter_params f fn] applies function [f] to each of the parameters - of function [fn] in order. Tail recursive. *) -val iter_params : (llvalue -> unit) -> llvalue -> unit - -(** [fold_left_params f init fn] is [f (... (f init b1) ...) bN] where - [b1,...,bN] are the parameters of function [fn]. Tail recursive. *) -val fold_left_params : ('a -> llvalue -> 'a) -> 'a -> llvalue -> 'a - -(** [param_end f] returns the last position in the parameter list of - the function [f]. [param_end] and [param_pred] can be used to iterate - over the parameter list in reverse. - See the method [llvm::Function::arg_end]. *) -external param_end : llvalue -> (llvalue, llvalue) llrev_pos = "llvm_param_end" - -(** [param_pred gv] returns the function list position preceding [After gv]. - See the method [llvm::Function::arg_iterator::operator--]. *) -external param_pred : llvalue -> (llvalue, llvalue) llrev_pos - = "llvm_param_pred" - -(** [rev_iter_params f fn] applies function [f] to each of the parameters - of function [fn] in reverse order. Tail recursive. *) -val rev_iter_params : (llvalue -> unit) -> llvalue -> unit - -(** [fold_right_params f fn init] is [f (... (f init bN) ...) b1] where - [b1,...,bN] are the parameters of function [fn]. Tail recursive. *) -val fold_right_params : (llvalue -> 'a -> 'a) -> llvalue -> 'a -> 'a - -(** [add_param p a] adds attribute [a] to parameter [p]. *) -val add_param_attr : llvalue -> Attribute.t -> unit - -(** [remove_param_attr p a] removes attribute [a] from parameter [p]. *) -val remove_param_attr : llvalue -> Attribute.t -> unit - -(** [set_param_alignment p a] set the alignment of parameter [p] to [a]. *) -external set_param_alignment : llvalue -> int -> unit - = "llvm_set_param_alignment" - -(** {7 Operations on basic blocks} *) - -(** [basic_blocks fn] returns the basic blocks of the function [f]. - See the method [llvm::Function::getBasicBlockList]. *) -external basic_blocks : llvalue -> llbasicblock array = "llvm_basic_blocks" - -(** [entry_block fn] returns the entry basic block of the function [f]. - See the method [llvm::Function::getEntryBlock]. *) -external entry_block : llvalue -> llbasicblock = "LLVMGetEntryBasicBlock" - -(** [delete_block bb] deletes the basic block [bb]. - See the method [llvm::BasicBlock::eraseFromParent]. *) -external delete_block : llbasicblock -> unit = "llvm_delete_block" - -(** [append_block c name f] creates a new basic block named [name] at the end of - function [f] in the context [c]. - See the constructor of [llvm::BasicBlock]. *) -external append_block : llcontext -> string -> llvalue -> llbasicblock - = "llvm_append_block" - -(** [insert_block c name bb] creates a new basic block named [name] before the - basic block [bb] in the context [c]. - See the constructor of [llvm::BasicBlock]. *) -external insert_block : llcontext -> string -> llbasicblock -> llbasicblock - = "llvm_insert_block" - -(** [block_parent bb] returns the parent function that owns the basic block. - See the method [llvm::BasicBlock::getParent]. *) -external block_parent : llbasicblock -> llvalue = "LLVMGetBasicBlockParent" - -(** [block_begin f] returns the first position in the basic block list of the - function [f]. [block_begin] and [block_succ] can be used to iterate over - the basic block list in order. - See the method [llvm::Function::begin]. *) -external block_begin : llvalue -> (llvalue, llbasicblock) llpos - = "llvm_block_begin" - -(** [block_succ bb] returns the basic block list position succeeding - [Before bb]. - See the method [llvm::Function::iterator::operator++]. *) -external block_succ : llbasicblock -> (llvalue, llbasicblock) llpos - = "llvm_block_succ" - -(** [iter_blocks f fn] applies function [f] to each of the basic blocks - of function [fn] in order. Tail recursive. *) -val iter_blocks : (llbasicblock -> unit) -> llvalue -> unit - -(** [fold_left_blocks f init fn] is [f (... (f init b1) ...) bN] where - [b1,...,bN] are the basic blocks of function [fn]. Tail recursive. *) -val fold_left_blocks : ('a -> llbasicblock -> 'a) -> 'a -> llvalue -> 'a - -(** [block_end f] returns the last position in the basic block list of - the function [f]. [block_end] and [block_pred] can be used to iterate - over the basic block list in reverse. - See the method [llvm::Function::end]. *) -external block_end : llvalue -> (llvalue, llbasicblock) llrev_pos - = "llvm_block_end" - -(** [block_pred gv] returns the function list position preceding [After gv]. - See the method [llvm::Function::iterator::operator--]. *) -external block_pred : llbasicblock -> (llvalue, llbasicblock) llrev_pos - = "llvm_block_pred" - -(** [rev_iter_blocks f fn] applies function [f] to each of the basic blocks - of function [fn] in reverse order. Tail recursive. *) -val rev_iter_blocks : (llbasicblock -> unit) -> llvalue -> unit - -(** [fold_right_blocks f fn init] is [f (... (f init bN) ...) b1] where - [b1,...,bN] are the basic blocks of function [fn]. Tail recursive. *) -val fold_right_blocks : (llbasicblock -> 'a -> 'a) -> llvalue -> 'a -> 'a - -(** [value_of_block bb] losslessly casts [bb] to an [llvalue]. *) -external value_of_block : llbasicblock -> llvalue = "LLVMBasicBlockAsValue" - -(** [value_is_block v] returns [true] if the value [v] is a basic block and - [false] otherwise. - Similar to [llvm::isa]. *) -external value_is_block : llvalue -> bool = "llvm_value_is_block" - -(** [block_of_value v] losslessly casts [v] to an [llbasicblock]. *) -external block_of_value : llvalue -> llbasicblock = "LLVMValueAsBasicBlock" - - -(** {7 Operations on instructions} *) - -(** [instr_parent i] is the enclosing basic block of the instruction [i]. - See the method [llvm::Instruction::getParent]. *) -external instr_parent : llvalue -> llbasicblock = "LLVMGetInstructionParent" - -(** [instr_begin bb] returns the first position in the instruction list of the - basic block [bb]. [instr_begin] and [instr_succ] can be used to iterate over - the instruction list in order. - See the method [llvm::BasicBlock::begin]. *) -external instr_begin : llbasicblock -> (llbasicblock, llvalue) llpos - = "llvm_instr_begin" - -(** [instr_succ i] returns the instruction list position succeeding [Before i]. - See the method [llvm::BasicBlock::iterator::operator++]. *) -external instr_succ : llvalue -> (llbasicblock, llvalue) llpos - = "llvm_instr_succ" - -(** [iter_instrs f bb] applies function [f] to each of the instructions of basic - block [bb] in order. Tail recursive. *) -val iter_instrs: (llvalue -> unit) -> llbasicblock -> unit - -(** [fold_left_instrs f init bb] is [f (... (f init g1) ...) gN] where - [g1,...,gN] are the instructions of basic block [bb]. Tail recursive. *) -val fold_left_instrs: ('a -> llvalue -> 'a) -> 'a -> llbasicblock -> 'a - -(** [instr_end bb] returns the last position in the instruction list of the - basic block [bb]. [instr_end] and [instr_pred] can be used to iterate over - the instruction list in reverse. - See the method [llvm::BasicBlock::end]. *) -external instr_end : llbasicblock -> (llbasicblock, llvalue) llrev_pos - = "llvm_instr_end" - -(** [instr_pred i] returns the instruction list position preceding [After i]. - See the method [llvm::BasicBlock::iterator::operator--]. *) -external instr_pred : llvalue -> (llbasicblock, llvalue) llrev_pos - = "llvm_instr_pred" - -(** [fold_right_instrs f bb init] is [f (... (f init fN) ...) f1] where - [f1,...,fN] are the instructions of basic block [bb]. Tail recursive. *) -val fold_right_instrs: (llvalue -> 'a -> 'a) -> llbasicblock -> 'a -> 'a - - -(** {7 Operations on call sites} *) - -(** [instruction_call_conv ci] is the calling convention for the call or invoke - instruction [ci], which may be one of the values from the module - {!CallConv}. See the method [llvm::CallInst::getCallingConv] and - [llvm::InvokeInst::getCallingConv]. *) -external instruction_call_conv: llvalue -> int - = "llvm_instruction_call_conv" - -(** [set_instruction_call_conv cc ci] sets the calling convention for the call - or invoke instruction [ci] to the integer [cc], which can be one of the - values from the module {!CallConv}. - See the method [llvm::CallInst::setCallingConv] - and [llvm::InvokeInst::setCallingConv]. *) -external set_instruction_call_conv: int -> llvalue -> unit - = "llvm_set_instruction_call_conv" - -(** [add_instruction_param_attr ci i a] adds attribute [a] to the [i]th - parameter of the call or invoke instruction [ci]. [i]=0 denotes the return - value. *) -val add_instruction_param_attr : llvalue -> int -> Attribute.t -> unit - -(** [remove_instruction_param_attr ci i a] removes attribute [a] from the - [i]th parameter of the call or invoke instruction [ci]. [i]=0 denotes the - return value. *) -val remove_instruction_param_attr : llvalue -> int -> Attribute.t -> unit - -(** {Operations on call instructions (only)} *) - -(** [is_tail_call ci] is [true] if the call instruction [ci] is flagged as - eligible for tail call optimization, [false] otherwise. - See the method [llvm::CallInst::isTailCall]. *) -external is_tail_call : llvalue -> bool = "llvm_is_tail_call" - -(** [set_tail_call tc ci] flags the call instruction [ci] as eligible for tail - call optimization if [tc] is [true], clears otherwise. - See the method [llvm::CallInst::setTailCall]. *) -external set_tail_call : bool -> llvalue -> unit = "llvm_set_tail_call" - -(** {7 Operations on phi nodes} *) - -(** [add_incoming (v, bb) pn] adds the value [v] to the phi node [pn] for use - with branches from [bb]. See the method [llvm::PHINode::addIncoming]. *) -external add_incoming : (llvalue * llbasicblock) -> llvalue -> unit - = "llvm_add_incoming" - -(** [incoming pn] returns the list of value-block pairs for phi node [pn]. - See the method [llvm::PHINode::getIncomingValue]. *) -external incoming : llvalue -> (llvalue * llbasicblock) list = "llvm_incoming" - - - -(** {6 Instruction builders} *) - -(** [builder context] creates an instruction builder with no position in - the context [context]. It is invalid to use this builder until its position - is set with {!position_before} or {!position_at_end}. See the constructor - for [llvm::LLVMBuilder]. *) -external builder : llcontext -> llbuilder = "llvm_builder" - -(** [builder_at ip] creates an instruction builder positioned at [ip]. - See the constructor for [llvm::LLVMBuilder]. *) -val builder_at : llcontext -> (llbasicblock, llvalue) llpos -> llbuilder - -(** [builder_before ins] creates an instruction builder positioned before the - instruction [isn]. See the constructor for [llvm::LLVMBuilder]. *) -val builder_before : llcontext -> llvalue -> llbuilder - -(** [builder_at_end bb] creates an instruction builder positioned at the end of - the basic block [bb]. See the constructor for [llvm::LLVMBuilder]. *) -val builder_at_end : llcontext -> llbasicblock -> llbuilder - -(** [position_builder ip bb] moves the instruction builder [bb] to the position - [ip]. - See the constructor for [llvm::LLVMBuilder]. *) -external position_builder : (llbasicblock, llvalue) llpos -> llbuilder -> unit - = "llvm_position_builder" - -(** [position_before ins b] moves the instruction builder [b] to before the - instruction [isn]. See the method [llvm::LLVMBuilder::SetInsertPoint]. *) -val position_before : llvalue -> llbuilder -> unit - -(** [position_at_end bb b] moves the instruction builder [b] to the end of the - basic block [bb]. See the method [llvm::LLVMBuilder::SetInsertPoint]. *) -val position_at_end : llbasicblock -> llbuilder -> unit - -(** [insertion_block b] returns the basic block that the builder [b] is - positioned to insert into. Raises [Not_Found] if the instruction builder is - uninitialized. - See the method [llvm::LLVMBuilder::GetInsertBlock]. *) -external insertion_block : llbuilder -> llbasicblock = "llvm_insertion_block" - -(** [insert_into_builder i name b] inserts the specified instruction [i] at the - position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::Insert]. *) -external insert_into_builder : llvalue -> string -> llbuilder -> unit - = "llvm_insert_into_builder" - -(** {7 Metadata} *) - -(** [set_current_debug_location b md] sets the current debug location [md] in - the builder [b]. - See the method [llvm::IRBuilder::SetDebugLocation]. *) -external set_current_debug_location : llbuilder -> llvalue -> unit - = "llvm_set_current_debug_location" - -(** [clear_current_debug_location b] clears the current debug location in the - builder [b]. *) -external clear_current_debug_location : llbuilder -> unit - = "llvm_clear_current_debug_location" - -(** [current_debug_location b] returns the current debug location, or None - if none is currently set. - See the method [llvm::IRBuilder::GetDebugLocation]. *) -external current_debug_location : llbuilder -> llvalue option - = "llvm_current_debug_location" - -(** [set_inst_debug_location b i] sets the current debug location of the builder - [b] to the instruction [i]. - See the method [llvm::IRBuilder::SetInstDebugLocation]. *) -external set_inst_debug_location : llbuilder -> llvalue -> unit - = "llvm_set_inst_debug_location" - -(** {7 Terminators} *) - -(** [build_ret_void b] creates a - [ret void] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateRetVoid]. *) -external build_ret_void : llbuilder -> llvalue = "llvm_build_ret_void" - -(** [build_ret v b] creates a - [ret %v] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateRet]. *) -external build_ret : llvalue -> llbuilder -> llvalue = "llvm_build_ret" - -(** [build_aggregate_ret vs b] creates a - [ret {...} { %v1, %v2, ... } ] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateAggregateRet]. *) -external build_aggregate_ret : llvalue array -> llbuilder -> llvalue - = "llvm_build_aggregate_ret" - -(** [build_br bb b] creates a - [br %bb] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateBr]. *) -external build_br : llbasicblock -> llbuilder -> llvalue = "llvm_build_br" - -(** [build_cond_br cond tbb fbb b] creates a - [br %cond, %tbb, %fbb] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateCondBr]. *) -external build_cond_br : llvalue -> llbasicblock -> llbasicblock -> llbuilder -> - llvalue = "llvm_build_cond_br" - -(** [build_switch case elsebb count b] creates an empty - [switch %case, %elsebb] - instruction at the position specified by the instruction builder [b] with - space reserved for [count] cases. - See the method [llvm::LLVMBuilder::CreateSwitch]. *) -external build_switch : llvalue -> llbasicblock -> int -> llbuilder -> llvalue - = "llvm_build_switch" - -(** [add_case sw onval bb] causes switch instruction [sw] to branch to [bb] - when its input matches the constant [onval]. - See the method [llvm::SwitchInst::addCase]. **) -external add_case : llvalue -> llvalue -> llbasicblock -> unit - = "llvm_add_case" - -(** [build_indirect_br addr count b] creates a - [indirectbr %addr] - instruction at the position specified by the instruction builder [b] with - space reserved for [count] destinations. - See the method [llvm::LLVMBuilder::CreateIndirectBr]. *) -external build_indirect_br : llvalue -> int -> llbuilder -> llvalue - = "llvm_build_indirect_br" - -(** [add_destination br bb] adds the basic block [bb] as a possible branch - location for the indirectbr instruction [br]. - See the method [llvm::IndirectBrInst::addDestination]. **) -external add_destination : llvalue -> llbasicblock -> unit - = "llvm_add_destination" - -(** [build_invoke fn args tobb unwindbb name b] creates an - [%name = invoke %fn(args) to %tobb unwind %unwindbb] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateInvoke]. *) -external build_invoke : llvalue -> llvalue array -> llbasicblock -> - llbasicblock -> string -> llbuilder -> llvalue - = "llvm_build_invoke_bc" "llvm_build_invoke_nat" - -(** [build_unwind b] creates an - [unwind] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateUnwind]. *) -external build_unwind : llbuilder -> llvalue = "llvm_build_unwind" - -(** [build_unreachable b] creates an - [unreachable] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateUnwind]. *) -external build_unreachable : llbuilder -> llvalue = "llvm_build_unreachable" - - -(** {7 Arithmetic} *) - -(** [build_add x y name b] creates a - [%name = add %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateAdd]. *) -external build_add : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_add" - -(** [build_nsw_add x y name b] creates a - [%name = nsw add %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateNSWAdd]. *) -external build_nsw_add : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_nsw_add" - -(** [build_nuw_add x y name b] creates a - [%name = nuw add %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateNUWAdd]. *) -external build_nuw_add : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_nuw_add" - -(** [build_fadd x y name b] creates a - [%name = fadd %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateFAdd]. *) -external build_fadd : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_fadd" - -(** [build_sub x y name b] creates a - [%name = sub %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateSub]. *) -external build_sub : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_sub" - -(** [build_nsw_sub x y name b] creates a - [%name = nsw sub %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateNSWSub]. *) -external build_nsw_sub : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_nsw_sub" - -(** [build_nuw_sub x y name b] creates a - [%name = nuw sub %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateNUWSub]. *) -external build_nuw_sub : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_nuw_sub" - -(** [build_fsub x y name b] creates a - [%name = fsub %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateFSub]. *) -external build_fsub : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_fsub" - -(** [build_mul x y name b] creates a - [%name = mul %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateMul]. *) -external build_mul : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_mul" - -(** [build_nsw_mul x y name b] creates a - [%name = nsw mul %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateNSWMul]. *) -external build_nsw_mul : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_nsw_mul" - -(** [build_nuw_mul x y name b] creates a - [%name = nuw mul %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateNUWMul]. *) -external build_nuw_mul : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_nuw_mul" - -(** [build_fmul x y name b] creates a - [%name = fmul %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateFMul]. *) -external build_fmul : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_fmul" - -(** [build_udiv x y name b] creates a - [%name = udiv %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateUDiv]. *) -external build_udiv : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_udiv" - -(** [build_sdiv x y name b] creates a - [%name = sdiv %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateSDiv]. *) -external build_sdiv : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_sdiv" - -(** [build_exact_sdiv x y name b] creates a - [%name = exact sdiv %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateExactSDiv]. *) -external build_exact_sdiv : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_exact_sdiv" - -(** [build_fdiv x y name b] creates a - [%name = fdiv %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateFDiv]. *) -external build_fdiv : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_fdiv" - -(** [build_urem x y name b] creates a - [%name = urem %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateURem]. *) -external build_urem : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_urem" - -(** [build_SRem x y name b] creates a - [%name = srem %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateSRem]. *) -external build_srem : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_srem" - -(** [build_frem x y name b] creates a - [%name = frem %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateFRem]. *) -external build_frem : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_frem" - -(** [build_shl x y name b] creates a - [%name = shl %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateShl]. *) -external build_shl : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_shl" - -(** [build_lshr x y name b] creates a - [%name = lshr %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateLShr]. *) -external build_lshr : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_lshr" - -(** [build_ashr x y name b] creates a - [%name = ashr %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateAShr]. *) -external build_ashr : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_ashr" - -(** [build_and x y name b] creates a - [%name = and %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateAnd]. *) -external build_and : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_and" - -(** [build_or x y name b] creates a - [%name = or %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateOr]. *) -external build_or : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_or" - -(** [build_xor x y name b] creates a - [%name = xor %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateXor]. *) -external build_xor : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_xor" - -(** [build_neg x name b] creates a - [%name = sub 0, %x] - instruction at the position specified by the instruction builder [b]. - [-0.0] is used for floating point types to compute the correct sign. - See the method [llvm::LLVMBuilder::CreateNeg]. *) -external build_neg : llvalue -> string -> llbuilder -> llvalue - = "llvm_build_neg" - -(** [build_nsw_neg x name b] creates a - [%name = nsw sub 0, %x] - instruction at the position specified by the instruction builder [b]. - [-0.0] is used for floating point types to compute the correct sign. - See the method [llvm::LLVMBuilder::CreateNeg]. *) -external build_nsw_neg : llvalue -> string -> llbuilder -> llvalue - = "llvm_build_nsw_neg" - -(** [build_nuw_neg x name b] creates a - [%name = nuw sub 0, %x] - instruction at the position specified by the instruction builder [b]. - [-0.0] is used for floating point types to compute the correct sign. - See the method [llvm::LLVMBuilder::CreateNeg]. *) -external build_nuw_neg : llvalue -> string -> llbuilder -> llvalue - = "llvm_build_nuw_neg" - -(** [build_fneg x name b] creates a - [%name = fsub 0, %x] - instruction at the position specified by the instruction builder [b]. - [-0.0] is used for floating point types to compute the correct sign. - See the method [llvm::LLVMBuilder::CreateFNeg]. *) -external build_fneg : llvalue -> string -> llbuilder -> llvalue - = "llvm_build_fneg" - -(** [build_xor x name b] creates a - [%name = xor %x, -1] - instruction at the position specified by the instruction builder [b]. - [-1] is the correct "all ones" value for the type of [x]. - See the method [llvm::LLVMBuilder::CreateXor]. *) -external build_not : llvalue -> string -> llbuilder -> llvalue - = "llvm_build_not" - - -(** {7 Memory} *) - -(** [build_alloca ty name b] creates a - [%name = alloca %ty] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateAlloca]. *) -external build_alloca : lltype -> string -> llbuilder -> llvalue - = "llvm_build_alloca" - -(** [build_array_alloca ty n name b] creates a - [%name = alloca %ty, %n] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateAlloca]. *) -external build_array_alloca : lltype -> llvalue -> string -> llbuilder -> - llvalue = "llvm_build_array_alloca" - -(** [build_load v name b] creates a - [%name = load %v] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateLoad]. *) -external build_load : llvalue -> string -> llbuilder -> llvalue - = "llvm_build_load" - -(** [build_store v p b] creates a - [store %v, %p] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateStore]. *) -external build_store : llvalue -> llvalue -> llbuilder -> llvalue - = "llvm_build_store" - -(** [build_gep p indices name b] creates a - [%name = getelementptr %p, indices...] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateGetElementPtr]. *) -external build_gep : llvalue -> llvalue array -> string -> llbuilder -> llvalue - = "llvm_build_gep" - -(** [build_in_bounds_gep p indices name b] creates a - [%name = gelementptr inbounds %p, indices...] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateInBoundsGetElementPtr]. *) -external build_in_bounds_gep : llvalue -> llvalue array -> string -> llbuilder -> - llvalue = "llvm_build_in_bounds_gep" - -(** [build_struct_gep p idx name b] creates a - [%name = getelementptr %p, 0, idx] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateStructGetElementPtr]. *) -external build_struct_gep : llvalue -> int -> string -> llbuilder -> - llvalue = "llvm_build_struct_gep" - -(** [build_global_string str name b] creates a series of instructions that adds - a global string at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateGlobalString]. *) -external build_global_string : string -> string -> llbuilder -> llvalue - = "llvm_build_global_string" - -(** [build_global_stringptr str name b] creates a series of instructions that - adds a global string pointer at the position specified by the instruction - builder [b]. - See the method [llvm::LLVMBuilder::CreateGlobalStringPtr]. *) -external build_global_stringptr : string -> string -> llbuilder -> llvalue - = "llvm_build_global_stringptr" - - -(** {7 Casts} *) - -(** [build_trunc v ty name b] creates a - [%name = trunc %p to %ty] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateTrunc]. *) -external build_trunc : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_trunc" - -(** [build_zext v ty name b] creates a - [%name = zext %p to %ty] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateZExt]. *) -external build_zext : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_zext" - -(** [build_sext v ty name b] creates a - [%name = sext %p to %ty] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateSExt]. *) -external build_sext : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_sext" - -(** [build_fptoui v ty name b] creates a - [%name = fptoui %p to %ty] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateFPToUI]. *) -external build_fptoui : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_fptoui" - -(** [build_fptosi v ty name b] creates a - [%name = fptosi %p to %ty] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateFPToSI]. *) -external build_fptosi : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_fptosi" - -(** [build_uitofp v ty name b] creates a - [%name = uitofp %p to %ty] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateUIToFP]. *) -external build_uitofp : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_uitofp" - -(** [build_sitofp v ty name b] creates a - [%name = sitofp %p to %ty] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateSIToFP]. *) -external build_sitofp : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_sitofp" - -(** [build_fptrunc v ty name b] creates a - [%name = fptrunc %p to %ty] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateFPTrunc]. *) -external build_fptrunc : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_fptrunc" - -(** [build_fpext v ty name b] creates a - [%name = fpext %p to %ty] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateFPExt]. *) -external build_fpext : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_fpext" - -(** [build_ptrtoint v ty name b] creates a - [%name = prtotint %p to %ty] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreatePtrToInt]. *) -external build_ptrtoint : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_prttoint" - -(** [build_inttoptr v ty name b] creates a - [%name = inttoptr %p to %ty] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateIntToPtr]. *) -external build_inttoptr : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_inttoptr" - -(** [build_bitcast v ty name b] creates a - [%name = bitcast %p to %ty] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateBitCast]. *) -external build_bitcast : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_bitcast" - -(** [build_zext_or_bitcast v ty name b] creates a zext or bitcast - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateZExtOrBitCast]. *) -external build_zext_or_bitcast : llvalue -> lltype -> string -> llbuilder -> - llvalue = "llvm_build_zext_or_bitcast" - -(** [build_sext_or_bitcast v ty name b] creates a sext or bitcast - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateSExtOrBitCast]. *) -external build_sext_or_bitcast : llvalue -> lltype -> string -> llbuilder -> - llvalue = "llvm_build_sext_or_bitcast" - -(** [build_trunc_or_bitcast v ty name b] creates a trunc or bitcast - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateZExtOrBitCast]. *) -external build_trunc_or_bitcast : llvalue -> lltype -> string -> llbuilder -> - llvalue = "llvm_build_trunc_or_bitcast" - -(** [build_pointercast v ty name b] creates a bitcast or pointer-to-int - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreatePointerCast]. *) -external build_pointercast : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_pointercast" - -(** [build_intcast v ty name b] creates a zext, bitcast, or trunc - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateIntCast]. *) -external build_intcast : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_intcast" - -(** [build_fpcast v ty name b] creates a fpext, bitcast, or fptrunc - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateFPCast]. *) -external build_fpcast : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_fpcast" - - -(** {7 Comparisons} *) - -(** [build_icmp pred x y name b] creates a - [%name = icmp %pred %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateICmp]. *) -external build_icmp : Icmp.t -> llvalue -> llvalue -> string -> - llbuilder -> llvalue = "llvm_build_icmp" - -(** [build_fcmp pred x y name b] creates a - [%name = fcmp %pred %x, %y] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateFCmp]. *) -external build_fcmp : Fcmp.t -> llvalue -> llvalue -> string -> - llbuilder -> llvalue = "llvm_build_fcmp" - - -(** {7 Miscellaneous instructions} *) - -(** [build_phi incoming name b] creates a - [%name = phi %incoming] - instruction at the position specified by the instruction builder [b]. - [incoming] is a list of [(llvalue, llbasicblock)] tuples. - See the method [llvm::LLVMBuilder::CreatePHI]. *) -external build_phi : (llvalue * llbasicblock) list -> string -> llbuilder -> - llvalue = "llvm_build_phi" - -(** [build_call fn args name b] creates a - [%name = call %fn(args...)] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateCall]. *) -external build_call : llvalue -> llvalue array -> string -> llbuilder -> llvalue - = "llvm_build_call" - -(** [build_select cond thenv elsev name b] creates a - [%name = select %cond, %thenv, %elsev] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateSelect]. *) -external build_select : llvalue -> llvalue -> llvalue -> string -> llbuilder -> - llvalue = "llvm_build_select" - -(** [build_va_arg valist argty name b] creates a - [%name = va_arg %valist, %argty] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateVAArg]. *) -external build_va_arg : llvalue -> lltype -> string -> llbuilder -> llvalue - = "llvm_build_va_arg" - -(** [build_extractelement vec i name b] creates a - [%name = extractelement %vec, %i] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateExtractElement]. *) -external build_extractelement : llvalue -> llvalue -> string -> llbuilder -> - llvalue = "llvm_build_extractelement" - -(** [build_insertelement vec elt i name b] creates a - [%name = insertelement %vec, %elt, %i] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateInsertElement]. *) -external build_insertelement : llvalue -> llvalue -> llvalue -> string -> - llbuilder -> llvalue = "llvm_build_insertelement" - -(** [build_shufflevector veca vecb mask name b] creates a - [%name = shufflevector %veca, %vecb, %mask] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateShuffleVector]. *) -external build_shufflevector : llvalue -> llvalue -> llvalue -> string -> - llbuilder -> llvalue = "llvm_build_shufflevector" - -(** [build_insertvalue agg idx name b] creates a - [%name = extractvalue %agg, %idx] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateExtractValue]. *) -external build_extractvalue : llvalue -> int -> string -> llbuilder -> llvalue - = "llvm_build_extractvalue" - -(** [build_insertvalue agg val idx name b] creates a - [%name = insertvalue %agg, %val, %idx] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateInsertValue]. *) -external build_insertvalue : llvalue -> llvalue -> int -> string -> llbuilder -> - llvalue = "llvm_build_insertvalue" - -(** [build_is_null val name b] creates a - [%name = icmp eq %val, null] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateIsNull]. *) -external build_is_null : llvalue -> string -> llbuilder -> llvalue - = "llvm_build_is_null" - -(** [build_is_not_null val name b] creates a - [%name = icmp ne %val, null] - instruction at the position specified by the instruction builder [b]. - See the method [llvm::LLVMBuilder::CreateIsNotNull]. *) -external build_is_not_null : llvalue -> string -> llbuilder -> llvalue - = "llvm_build_is_not_null" - -(** [build_ptrdiff lhs rhs name b] creates a series of instructions that measure - the difference between two pointer values at the position specified by the - instruction builder [b]. - See the method [llvm::LLVMBuilder::CreatePtrDiff]. *) -external build_ptrdiff : llvalue -> llvalue -> string -> llbuilder -> llvalue - = "llvm_build_ptrdiff" - - -(** {6 Memory buffers} *) - -module MemoryBuffer : sig - (** [of_file p] is the memory buffer containing the contents of the file at - path [p]. If the file could not be read, then [IoError msg] is - raised. *) - external of_file : string -> llmemorybuffer = "llvm_memorybuffer_of_file" - - (** [stdin ()] is the memory buffer containing the contents of standard input. - If standard input is empty, then [IoError msg] is raised. *) - external of_stdin : unit -> llmemorybuffer = "llvm_memorybuffer_of_stdin" - - (** Disposes of a memory buffer. *) - external dispose : llmemorybuffer -> unit = "llvm_memorybuffer_dispose" -end - - -(** {6 Pass Managers} *) - -module PassManager : sig - (** *) - type 'a t - type any = [ `Module | `Function ] - - (** [PassManager.create ()] constructs a new whole-module pass pipeline. This - type of pipeline is suitable for link-time optimization and whole-module - transformations. - See the constructor of [llvm::PassManager]. *) - external create : unit -> [ `Module ] t = "llvm_passmanager_create" - - (** [PassManager.create_function m] constructs a new function-by-function - pass pipeline over the module [m]. It does not take ownership of [m]. - This type of pipeline is suitable for code generation and JIT compilation - tasks. - See the constructor of [llvm::FunctionPassManager]. *) - external create_function : llmodule -> [ `Function ] t - = "LLVMCreateFunctionPassManager" - - (** [run_module m pm] initializes, executes on the module [m], and finalizes - all of the passes scheduled in the pass manager [pm]. Returns [true] if - any of the passes modified the module, [false] otherwise. - See the [llvm::PassManager::run] method. *) - external run_module : llmodule -> [ `Module ] t -> bool - = "llvm_passmanager_run_module" - - (** [initialize fpm] initializes all of the function passes scheduled in the - function pass manager [fpm]. Returns [true] if any of the passes modified - the module, [false] otherwise. - See the [llvm::FunctionPassManager::doInitialization] method. *) - external initialize : [ `Function ] t -> bool = "llvm_passmanager_initialize" - - (** [run_function f fpm] executes all of the function passes scheduled in the - function pass manager [fpm] over the function [f]. Returns [true] if any - of the passes modified [f], [false] otherwise. - See the [llvm::FunctionPassManager::run] method. *) - external run_function : llvalue -> [ `Function ] t -> bool - = "llvm_passmanager_run_function" - - (** [finalize fpm] finalizes all of the function passes scheduled in in the - function pass manager [fpm]. Returns [true] if any of the passes - modified the module, [false] otherwise. - See the [llvm::FunctionPassManager::doFinalization] method. *) - external finalize : [ `Function ] t -> bool = "llvm_passmanager_finalize" - - (** Frees the memory of a pass pipeline. For function pipelines, does not free - the module. - See the destructor of [llvm::BasePassManager]. *) - external dispose : [< any ] t -> unit = "llvm_passmanager_dispose" -end diff --git a/contrib/llvm/bindings/ocaml/llvm/llvm_ocaml.c b/contrib/llvm/bindings/ocaml/llvm/llvm_ocaml.c deleted file mode 100644 index ef2e3d66629c..000000000000 --- a/contrib/llvm/bindings/ocaml/llvm/llvm_ocaml.c +++ /dev/null @@ -1,1824 +0,0 @@ -/*===-- llvm_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/Core.h" -#include "caml/alloc.h" -#include "caml/custom.h" -#include "caml/memory.h" -#include "caml/fail.h" -#include "caml/callback.h" -#include "llvm/Config/config.h" -#include -#include - - -/* Can't use the recommended caml_named_value mechanism for backwards - compatibility reasons. This is largely equivalent. */ -static value llvm_ioerror_exn; - -CAMLprim value llvm_register_core_exns(value IoError) { - llvm_ioerror_exn = Field(IoError, 0); - register_global_root(&llvm_ioerror_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 -} - -static value alloc_variant(int tag, void *Value) { - value Iter = alloc_small(1, tag); - Field(Iter, 0) = Val_op(Value); - return Iter; -} - -/* Macro to convert the C first/next/last/prev idiom to the Ocaml llpos/ - llrev_pos idiom. */ -#define DEFINE_ITERATORS(camlname, cname, pty, cty, pfun) \ - /* llmodule -> ('a, 'b) llpos */ \ - CAMLprim value llvm_##camlname##_begin(pty Mom) { \ - cty First = LLVMGetFirst##cname(Mom); \ - if (First) \ - return alloc_variant(1, First); \ - return alloc_variant(0, Mom); \ - } \ - \ - /* llvalue -> ('a, 'b) llpos */ \ - CAMLprim value llvm_##camlname##_succ(cty Kid) { \ - cty Next = LLVMGetNext##cname(Kid); \ - if (Next) \ - return alloc_variant(1, Next); \ - return alloc_variant(0, pfun(Kid)); \ - } \ - \ - /* llmodule -> ('a, 'b) llrev_pos */ \ - CAMLprim value llvm_##camlname##_end(pty Mom) { \ - cty Last = LLVMGetLast##cname(Mom); \ - if (Last) \ - return alloc_variant(1, Last); \ - return alloc_variant(0, Mom); \ - } \ - \ - /* llvalue -> ('a, 'b) llrev_pos */ \ - CAMLprim value llvm_##camlname##_pred(cty Kid) { \ - cty Prev = LLVMGetPrevious##cname(Kid); \ - if (Prev) \ - return alloc_variant(1, Prev); \ - return alloc_variant(0, pfun(Kid)); \ - } - - -/*===-- Contexts ----------------------------------------------------------===*/ - -/* unit -> llcontext */ -CAMLprim LLVMContextRef llvm_create_context(value Unit) { - return LLVMContextCreate(); -} - -/* llcontext -> unit */ -CAMLprim value llvm_dispose_context(LLVMContextRef C) { - LLVMContextDispose(C); - return Val_unit; -} - -/* unit -> llcontext */ -CAMLprim LLVMContextRef llvm_global_context(value Unit) { - return LLVMGetGlobalContext(); -} - -/* llcontext -> string -> int */ -CAMLprim value llvm_mdkind_id(LLVMContextRef C, value Name) { - unsigned MDKindID = LLVMGetMDKindIDInContext(C, String_val(Name), - caml_string_length(Name)); - return Val_int(MDKindID); -} - -/*===-- Modules -----------------------------------------------------------===*/ - -/* llcontext -> string -> llmodule */ -CAMLprim LLVMModuleRef llvm_create_module(LLVMContextRef C, value ModuleID) { - return LLVMModuleCreateWithNameInContext(String_val(ModuleID), C); -} - -/* llmodule -> unit */ -CAMLprim value llvm_dispose_module(LLVMModuleRef M) { - LLVMDisposeModule(M); - return Val_unit; -} - -/* llmodule -> string */ -CAMLprim value llvm_target_triple(LLVMModuleRef M) { - return copy_string(LLVMGetTarget(M)); -} - -/* string -> llmodule -> unit */ -CAMLprim value llvm_set_target_triple(value Trip, LLVMModuleRef M) { - LLVMSetTarget(M, String_val(Trip)); - return Val_unit; -} - -/* llmodule -> string */ -CAMLprim value llvm_data_layout(LLVMModuleRef M) { - return copy_string(LLVMGetDataLayout(M)); -} - -/* string -> llmodule -> unit */ -CAMLprim value llvm_set_data_layout(value Layout, LLVMModuleRef M) { - LLVMSetDataLayout(M, String_val(Layout)); - return Val_unit; -} - -/* string -> lltype -> llmodule -> bool */ -CAMLprim value llvm_add_type_name(value Name, LLVMTypeRef Ty, LLVMModuleRef M) { - int res = LLVMAddTypeName(M, String_val(Name), Ty); - return Val_bool(res == 0); -} - -/* string -> llmodule -> unit */ -CAMLprim value llvm_delete_type_name(value Name, LLVMModuleRef M) { - LLVMDeleteTypeName(M, String_val(Name)); - return Val_unit; -} - -/* llmodule -> string -> lltype option */ -CAMLprim value llvm_type_by_name(LLVMModuleRef M, value Name) { - CAMLparam1(Name); - LLVMTypeRef T; - if ((T = LLVMGetTypeByName(M, String_val(Name)))) { - value Option = alloc(1, 0); - Field(Option, 0) = (value) T; - CAMLreturn(Option); - } - CAMLreturn(Val_int(0)); -} - -/* llmodule -> unit */ -CAMLprim value llvm_dump_module(LLVMModuleRef M) { - LLVMDumpModule(M); - return Val_unit; -} - -/* llmodule -> string -> unit */ -CAMLprim value llvm_set_module_inline_asm(LLVMModuleRef M, value Asm) { - LLVMSetModuleInlineAsm(M, String_val(Asm)); - return Val_unit; -} - -/*===-- Types -------------------------------------------------------------===*/ - -/* lltype -> TypeKind.t */ -CAMLprim value llvm_classify_type(LLVMTypeRef Ty) { - return Val_int(LLVMGetTypeKind(Ty)); -} - -/* lltype -> llcontext */ -CAMLprim LLVMContextRef llvm_type_context(LLVMTypeRef Ty) { - return LLVMGetTypeContext(Ty); -} - -/*--... Operations on integer types ........................................--*/ - -/* llcontext -> lltype */ -CAMLprim LLVMTypeRef llvm_i1_type (LLVMContextRef Context) { - return LLVMInt1TypeInContext(Context); -} - -/* llcontext -> lltype */ -CAMLprim LLVMTypeRef llvm_i8_type (LLVMContextRef Context) { - return LLVMInt8TypeInContext(Context); -} - -/* llcontext -> lltype */ -CAMLprim LLVMTypeRef llvm_i16_type (LLVMContextRef Context) { - return LLVMInt16TypeInContext(Context); -} - -/* llcontext -> lltype */ -CAMLprim LLVMTypeRef llvm_i32_type (LLVMContextRef Context) { - return LLVMInt32TypeInContext(Context); -} - -/* llcontext -> lltype */ -CAMLprim LLVMTypeRef llvm_i64_type (LLVMContextRef Context) { - return LLVMInt64TypeInContext(Context); -} - -/* llcontext -> int -> lltype */ -CAMLprim LLVMTypeRef llvm_integer_type(LLVMContextRef Context, value Width) { - return LLVMIntTypeInContext(Context, Int_val(Width)); -} - -/* lltype -> int */ -CAMLprim value llvm_integer_bitwidth(LLVMTypeRef IntegerTy) { - return Val_int(LLVMGetIntTypeWidth(IntegerTy)); -} - -/*--... Operations on real types ...........................................--*/ - -/* llcontext -> lltype */ -CAMLprim LLVMTypeRef llvm_float_type(LLVMContextRef Context) { - return LLVMFloatTypeInContext(Context); -} - -/* llcontext -> lltype */ -CAMLprim LLVMTypeRef llvm_double_type(LLVMContextRef Context) { - return LLVMDoubleTypeInContext(Context); -} - -/* llcontext -> lltype */ -CAMLprim LLVMTypeRef llvm_x86fp80_type(LLVMContextRef Context) { - return LLVMX86FP80TypeInContext(Context); -} - -/* llcontext -> lltype */ -CAMLprim LLVMTypeRef llvm_fp128_type(LLVMContextRef Context) { - return LLVMFP128TypeInContext(Context); -} - -/* llcontext -> lltype */ -CAMLprim LLVMTypeRef llvm_ppc_fp128_type(LLVMContextRef Context) { - return LLVMPPCFP128TypeInContext(Context); -} - -/*--... Operations on function types .......................................--*/ - -/* lltype -> lltype array -> lltype */ -CAMLprim LLVMTypeRef llvm_function_type(LLVMTypeRef RetTy, value ParamTys) { - return LLVMFunctionType(RetTy, (LLVMTypeRef *) ParamTys, - Wosize_val(ParamTys), 0); -} - -/* lltype -> lltype array -> lltype */ -CAMLprim LLVMTypeRef llvm_var_arg_function_type(LLVMTypeRef RetTy, - value ParamTys) { - return LLVMFunctionType(RetTy, (LLVMTypeRef *) ParamTys, - Wosize_val(ParamTys), 1); -} - -/* lltype -> bool */ -CAMLprim value llvm_is_var_arg(LLVMTypeRef FunTy) { - return Val_bool(LLVMIsFunctionVarArg(FunTy)); -} - -/* lltype -> lltype array */ -CAMLprim value llvm_param_types(LLVMTypeRef FunTy) { - value Tys = alloc(LLVMCountParamTypes(FunTy), 0); - LLVMGetParamTypes(FunTy, (LLVMTypeRef *) Tys); - return Tys; -} - -/*--... Operations on struct types .........................................--*/ - -/* llcontext -> lltype array -> lltype */ -CAMLprim LLVMTypeRef llvm_struct_type(LLVMContextRef C, value ElementTypes) { - return LLVMStructTypeInContext(C, (LLVMTypeRef *) ElementTypes, - Wosize_val(ElementTypes), 0); -} - -/* llcontext -> lltype array -> lltype */ -CAMLprim LLVMTypeRef llvm_packed_struct_type(LLVMContextRef C, - value ElementTypes) { - return LLVMStructTypeInContext(C, (LLVMTypeRef *) ElementTypes, - Wosize_val(ElementTypes), 1); -} - -/* lltype -> lltype array */ -CAMLprim value llvm_struct_element_types(LLVMTypeRef StructTy) { - value Tys = alloc(LLVMCountStructElementTypes(StructTy), 0); - LLVMGetStructElementTypes(StructTy, (LLVMTypeRef *) Tys); - return Tys; -} - -/* lltype -> bool */ -CAMLprim value llvm_is_packed(LLVMTypeRef StructTy) { - return Val_bool(LLVMIsPackedStruct(StructTy)); -} - -/*--... Operations on array, pointer, and vector types .....................--*/ - -/* lltype -> int -> lltype */ -CAMLprim LLVMTypeRef llvm_array_type(LLVMTypeRef ElementTy, value Count) { - return LLVMArrayType(ElementTy, Int_val(Count)); -} - -/* lltype -> lltype */ -CAMLprim LLVMTypeRef llvm_pointer_type(LLVMTypeRef ElementTy) { - return LLVMPointerType(ElementTy, 0); -} - -/* lltype -> int -> lltype */ -CAMLprim LLVMTypeRef llvm_qualified_pointer_type(LLVMTypeRef ElementTy, - value AddressSpace) { - return LLVMPointerType(ElementTy, Int_val(AddressSpace)); -} - -/* lltype -> int -> lltype */ -CAMLprim LLVMTypeRef llvm_vector_type(LLVMTypeRef ElementTy, value Count) { - return LLVMVectorType(ElementTy, Int_val(Count)); -} - -/* lltype -> int */ -CAMLprim value llvm_array_length(LLVMTypeRef ArrayTy) { - return Val_int(LLVMGetArrayLength(ArrayTy)); -} - -/* lltype -> int */ -CAMLprim value llvm_address_space(LLVMTypeRef PtrTy) { - return Val_int(LLVMGetPointerAddressSpace(PtrTy)); -} - -/* lltype -> int */ -CAMLprim value llvm_vector_size(LLVMTypeRef VectorTy) { - return Val_int(LLVMGetVectorSize(VectorTy)); -} - -/*--... Operations on other types ..........................................--*/ - -/* llcontext -> lltype */ -CAMLprim LLVMTypeRef llvm_void_type (LLVMContextRef Context) { - return LLVMVoidTypeInContext(Context); -} - -/* llcontext -> lltype */ -CAMLprim LLVMTypeRef llvm_label_type(LLVMContextRef Context) { - return LLVMLabelTypeInContext(Context); -} - -/* llcontext -> lltype */ -CAMLprim LLVMTypeRef llvm_opaque_type(LLVMContextRef Context) { - return LLVMOpaqueTypeInContext(Context); -} - -/*--... Operations on type handles .........................................--*/ - -#define Typehandle_val(v) (*(LLVMTypeHandleRef *)(Data_custom_val(v))) - -static void llvm_finalize_handle(value TH) { - LLVMDisposeTypeHandle(Typehandle_val(TH)); -} - -static struct custom_operations typehandle_ops = { - (char *) "LLVMTypeHandle", - llvm_finalize_handle, - custom_compare_default, - custom_hash_default, - custom_serialize_default, - custom_deserialize_default -}; - -CAMLprim value llvm_handle_to_type(LLVMTypeRef PATy) { - value TH = alloc_custom(&typehandle_ops, sizeof(LLVMBuilderRef), 0, 1); - Typehandle_val(TH) = LLVMCreateTypeHandle(PATy); - return TH; -} - -CAMLprim LLVMTypeRef llvm_type_of_handle(value TH) { - return LLVMResolveTypeHandle(Typehandle_val(TH)); -} - -CAMLprim value llvm_refine_type(LLVMTypeRef AbstractTy, LLVMTypeRef ConcreteTy){ - LLVMRefineType(AbstractTy, ConcreteTy); - return Val_unit; -} - - -/*===-- VALUES ------------------------------------------------------------===*/ - -/* llvalue -> lltype */ -CAMLprim LLVMTypeRef llvm_type_of(LLVMValueRef Val) { - return LLVMTypeOf(Val); -} - -/* llvalue -> string */ -CAMLprim value llvm_value_name(LLVMValueRef Val) { - return copy_string(LLVMGetValueName(Val)); -} - -/* string -> llvalue -> unit */ -CAMLprim value llvm_set_value_name(value Name, LLVMValueRef Val) { - LLVMSetValueName(Val, String_val(Name)); - return Val_unit; -} - -/* llvalue -> unit */ -CAMLprim value llvm_dump_value(LLVMValueRef Val) { - LLVMDumpValue(Val); - return Val_unit; -} - -/*--... Operations on users ................................................--*/ - -/* llvalue -> int -> llvalue */ -CAMLprim LLVMValueRef llvm_operand(LLVMValueRef V, value I) { - return LLVMGetOperand(V, Int_val(I)); -} - -/* llvalue -> int -> llvalue -> unit */ -CAMLprim value llvm_set_operand(LLVMValueRef U, value I, LLVMValueRef V) { - LLVMSetOperand(U, Int_val(I), V); - return Val_unit; -} - -/* llvalue -> int */ -CAMLprim value llvm_num_operands(LLVMValueRef V) { - return Val_int(LLVMGetNumOperands(V)); -} - -/*--... Operations on constants of (mostly) any type .......................--*/ - -/* llvalue -> bool */ -CAMLprim value llvm_is_constant(LLVMValueRef Val) { - return Val_bool(LLVMIsConstant(Val)); -} - -/* llvalue -> bool */ -CAMLprim value llvm_is_null(LLVMValueRef Val) { - return Val_bool(LLVMIsNull(Val)); -} - -/* llvalue -> bool */ -CAMLprim value llvm_is_undef(LLVMValueRef Val) { - return Val_bool(LLVMIsUndef(Val)); -} - -/*--... Operations on instructions .........................................--*/ - -/* llvalue -> bool */ -CAMLprim value llvm_has_metadata(LLVMValueRef Val) { - return Val_bool(LLVMHasMetadata(Val)); -} - -/* llvalue -> int -> llvalue option */ -CAMLprim value llvm_metadata(LLVMValueRef Val, value MDKindID) { - CAMLparam1(MDKindID); - LLVMValueRef MD; - if ((MD = LLVMGetMetadata(Val, Int_val(MDKindID)))) { - value Option = alloc(1, 0); - Field(Option, 0) = (value) MD; - CAMLreturn(Option); - } - CAMLreturn(Val_int(0)); -} - -/* llvalue -> int -> llvalue -> unit */ -CAMLprim value llvm_set_metadata(LLVMValueRef Val, value MDKindID, - LLVMValueRef MD) { - LLVMSetMetadata(Val, Int_val(MDKindID), MD); - return Val_unit; -} - -/* llvalue -> int -> unit */ -CAMLprim value llvm_clear_metadata(LLVMValueRef Val, value MDKindID) { - LLVMSetMetadata(Val, Int_val(MDKindID), NULL); - return Val_unit; -} - - -/*--... Operations on metadata .............................................--*/ - -/* llcontext -> string -> llvalue */ -CAMLprim LLVMValueRef llvm_mdstring(LLVMContextRef C, value S) { - return LLVMMDStringInContext(C, String_val(S), caml_string_length(S)); -} - -/* llcontext -> llvalue array -> llvalue */ -CAMLprim LLVMValueRef llvm_mdnode(LLVMContextRef C, value ElementVals) { - return LLVMMDNodeInContext(C, (LLVMValueRef*) Op_val(ElementVals), - Wosize_val(ElementVals)); -} - -/*--... Operations on scalar constants .....................................--*/ - -/* lltype -> int -> llvalue */ -CAMLprim LLVMValueRef llvm_const_int(LLVMTypeRef IntTy, value N) { - return LLVMConstInt(IntTy, (long long) Int_val(N), 1); -} - -/* lltype -> Int64.t -> bool -> llvalue */ -CAMLprim LLVMValueRef llvm_const_of_int64(LLVMTypeRef IntTy, value N, - value SExt) { - return LLVMConstInt(IntTy, Int64_val(N), Bool_val(SExt)); -} - -/* lltype -> string -> int -> llvalue */ -CAMLprim LLVMValueRef llvm_const_int_of_string(LLVMTypeRef IntTy, value S, - value Radix) { - return LLVMConstIntOfStringAndSize(IntTy, String_val(S), caml_string_length(S), - Int_val(Radix)); -} - -/* lltype -> float -> llvalue */ -CAMLprim LLVMValueRef llvm_const_float(LLVMTypeRef RealTy, value N) { - return LLVMConstReal(RealTy, Double_val(N)); -} - -/* lltype -> string -> llvalue */ -CAMLprim LLVMValueRef llvm_const_float_of_string(LLVMTypeRef RealTy, value S) { - return LLVMConstRealOfStringAndSize(RealTy, String_val(S), - caml_string_length(S)); -} - -/*--... Operations on composite constants ..................................--*/ - -/* llcontext -> string -> llvalue */ -CAMLprim LLVMValueRef llvm_const_string(LLVMContextRef Context, value Str, - value NullTerminate) { - return LLVMConstStringInContext(Context, String_val(Str), string_length(Str), - 1); -} - -/* llcontext -> string -> llvalue */ -CAMLprim LLVMValueRef llvm_const_stringz(LLVMContextRef Context, value Str, - value NullTerminate) { - return LLVMConstStringInContext(Context, String_val(Str), string_length(Str), - 0); -} - -/* lltype -> llvalue array -> llvalue */ -CAMLprim LLVMValueRef llvm_const_array(LLVMTypeRef ElementTy, - value ElementVals) { - return LLVMConstArray(ElementTy, (LLVMValueRef*) Op_val(ElementVals), - Wosize_val(ElementVals)); -} - -/* llcontext -> llvalue array -> llvalue */ -CAMLprim LLVMValueRef llvm_const_struct(LLVMContextRef C, value ElementVals) { - return LLVMConstStructInContext(C, (LLVMValueRef *) Op_val(ElementVals), - Wosize_val(ElementVals), 0); -} - -/* llcontext -> llvalue array -> llvalue */ -CAMLprim LLVMValueRef llvm_const_packed_struct(LLVMContextRef C, - value ElementVals) { - return LLVMConstStructInContext(C, (LLVMValueRef *) Op_val(ElementVals), - Wosize_val(ElementVals), 1); -} - -/* llvalue array -> llvalue */ -CAMLprim LLVMValueRef llvm_const_vector(value ElementVals) { - return LLVMConstVector((LLVMValueRef*) Op_val(ElementVals), - Wosize_val(ElementVals)); -} - -/*--... Constant expressions ...............................................--*/ - -/* Icmp.t -> llvalue -> llvalue -> llvalue */ -CAMLprim LLVMValueRef llvm_const_icmp(value Pred, - LLVMValueRef LHSConstant, - LLVMValueRef RHSConstant) { - return LLVMConstICmp(Int_val(Pred) + LLVMIntEQ, LHSConstant, RHSConstant); -} - -/* Fcmp.t -> llvalue -> llvalue -> llvalue */ -CAMLprim LLVMValueRef llvm_const_fcmp(value Pred, - LLVMValueRef LHSConstant, - LLVMValueRef RHSConstant) { - return LLVMConstFCmp(Int_val(Pred), LHSConstant, RHSConstant); -} - -/* llvalue -> llvalue array -> llvalue */ -CAMLprim LLVMValueRef llvm_const_gep(LLVMValueRef ConstantVal, value Indices) { - return LLVMConstGEP(ConstantVal, (LLVMValueRef*) Op_val(Indices), - Wosize_val(Indices)); -} - -/* llvalue -> llvalue array -> llvalue */ -CAMLprim LLVMValueRef llvm_const_in_bounds_gep(LLVMValueRef ConstantVal, - value Indices) { - return LLVMConstInBoundsGEP(ConstantVal, (LLVMValueRef*) Op_val(Indices), - Wosize_val(Indices)); -} - -/* llvalue -> int array -> llvalue */ -CAMLprim LLVMValueRef llvm_const_extractvalue(LLVMValueRef Aggregate, - value Indices) { - CAMLparam1(Indices); - int size = Wosize_val(Indices); - int i; - LLVMValueRef result; - - unsigned* idxs = (unsigned*)malloc(size * sizeof(unsigned)); - for (i = 0; i < size; i++) { - idxs[i] = Int_val(Field(Indices, i)); - } - - result = LLVMConstExtractValue(Aggregate, idxs, size); - free(idxs); - CAMLreturnT(LLVMValueRef, result); -} - -/* llvalue -> llvalue -> int array -> llvalue */ -CAMLprim LLVMValueRef llvm_const_insertvalue(LLVMValueRef Aggregate, - LLVMValueRef Val, value Indices) { - CAMLparam1(Indices); - int size = Wosize_val(Indices); - int i; - LLVMValueRef result; - - unsigned* idxs = (unsigned*)malloc(size * sizeof(unsigned)); - for (i = 0; i < size; i++) { - idxs[i] = Int_val(Field(Indices, i)); - } - - result = LLVMConstInsertValue(Aggregate, Val, idxs, size); - free(idxs); - CAMLreturnT(LLVMValueRef, result); -} - -/* lltype -> string -> string -> bool -> bool -> llvalue */ -CAMLprim LLVMValueRef llvm_const_inline_asm(LLVMTypeRef Ty, value Asm, - value Constraints, value HasSideEffects, - value IsAlignStack) { - return LLVMConstInlineAsm(Ty, String_val(Asm), String_val(Constraints), - Bool_val(HasSideEffects), Bool_val(IsAlignStack)); -} - -/*--... Operations on global variables, functions, and aliases (globals) ...--*/ - -/* llvalue -> bool */ -CAMLprim value llvm_is_declaration(LLVMValueRef Global) { - return Val_bool(LLVMIsDeclaration(Global)); -} - -/* llvalue -> Linkage.t */ -CAMLprim value llvm_linkage(LLVMValueRef Global) { - return Val_int(LLVMGetLinkage(Global)); -} - -/* Linkage.t -> llvalue -> unit */ -CAMLprim value llvm_set_linkage(value Linkage, LLVMValueRef Global) { - LLVMSetLinkage(Global, Int_val(Linkage)); - return Val_unit; -} - -/* llvalue -> string */ -CAMLprim value llvm_section(LLVMValueRef Global) { - return copy_string(LLVMGetSection(Global)); -} - -/* string -> llvalue -> unit */ -CAMLprim value llvm_set_section(value Section, LLVMValueRef Global) { - LLVMSetSection(Global, String_val(Section)); - return Val_unit; -} - -/* llvalue -> Visibility.t */ -CAMLprim value llvm_visibility(LLVMValueRef Global) { - return Val_int(LLVMGetVisibility(Global)); -} - -/* Visibility.t -> llvalue -> unit */ -CAMLprim value llvm_set_visibility(value Viz, LLVMValueRef Global) { - LLVMSetVisibility(Global, Int_val(Viz)); - return Val_unit; -} - -/* llvalue -> int */ -CAMLprim value llvm_alignment(LLVMValueRef Global) { - return Val_int(LLVMGetAlignment(Global)); -} - -/* int -> llvalue -> unit */ -CAMLprim value llvm_set_alignment(value Bytes, LLVMValueRef Global) { - LLVMSetAlignment(Global, Int_val(Bytes)); - return Val_unit; -} - -/*--... Operations on uses .................................................--*/ - -/* llvalue -> lluse option */ -CAMLprim value llvm_use_begin(LLVMValueRef Val) { - CAMLparam0(); - LLVMUseRef First; - if ((First = LLVMGetFirstUse(Val))) { - value Option = alloc(1, 0); - Field(Option, 0) = (value) First; - CAMLreturn(Option); - } - CAMLreturn(Val_int(0)); -} - -/* lluse -> lluse option */ -CAMLprim value llvm_use_succ(LLVMUseRef U) { - CAMLparam0(); - LLVMUseRef Next; - if ((Next = LLVMGetNextUse(U))) { - value Option = alloc(1, 0); - Field(Option, 0) = (value) Next; - CAMLreturn(Option); - } - CAMLreturn(Val_int(0)); -} - -/* lluse -> llvalue */ -CAMLprim LLVMValueRef llvm_user(LLVMUseRef UR) { - return LLVMGetUser(UR); -} - -/* lluse -> llvalue */ -CAMLprim LLVMValueRef llvm_used_value(LLVMUseRef UR) { - return LLVMGetUsedValue(UR); -} - -/*--... Operations on global variables .....................................--*/ - -DEFINE_ITERATORS(global, Global, LLVMModuleRef, LLVMValueRef, - LLVMGetGlobalParent) - -/* lltype -> string -> llmodule -> llvalue */ -CAMLprim LLVMValueRef llvm_declare_global(LLVMTypeRef Ty, value Name, - LLVMModuleRef M) { - LLVMValueRef GlobalVar; - if ((GlobalVar = LLVMGetNamedGlobal(M, String_val(Name)))) { - if (LLVMGetElementType(LLVMTypeOf(GlobalVar)) != Ty) - return LLVMConstBitCast(GlobalVar, LLVMPointerType(Ty, 0)); - return GlobalVar; - } - return LLVMAddGlobal(M, Ty, String_val(Name)); -} - -/* lltype -> string -> int -> llmodule -> llvalue */ -CAMLprim LLVMValueRef llvm_declare_qualified_global(LLVMTypeRef Ty, value Name, - value AddressSpace, - LLVMModuleRef M) { - LLVMValueRef GlobalVar; - if ((GlobalVar = LLVMGetNamedGlobal(M, String_val(Name)))) { - if (LLVMGetElementType(LLVMTypeOf(GlobalVar)) != Ty) - return LLVMConstBitCast(GlobalVar, - LLVMPointerType(Ty, Int_val(AddressSpace))); - return GlobalVar; - } - return LLVMAddGlobal(M, Ty, String_val(Name)); -} - -/* string -> llmodule -> llvalue option */ -CAMLprim value llvm_lookup_global(value Name, LLVMModuleRef M) { - CAMLparam1(Name); - LLVMValueRef GlobalVar; - if ((GlobalVar = LLVMGetNamedGlobal(M, String_val(Name)))) { - value Option = alloc(1, 0); - Field(Option, 0) = (value) GlobalVar; - CAMLreturn(Option); - } - CAMLreturn(Val_int(0)); -} - -/* string -> llvalue -> llmodule -> llvalue */ -CAMLprim LLVMValueRef llvm_define_global(value Name, LLVMValueRef Initializer, - LLVMModuleRef M) { - LLVMValueRef GlobalVar = LLVMAddGlobal(M, LLVMTypeOf(Initializer), - String_val(Name)); - LLVMSetInitializer(GlobalVar, Initializer); - return GlobalVar; -} - -/* string -> llvalue -> int -> llmodule -> llvalue */ -CAMLprim LLVMValueRef llvm_define_qualified_global(value Name, - LLVMValueRef Initializer, - value AddressSpace, - LLVMModuleRef M) { - LLVMValueRef GlobalVar = LLVMAddGlobalInAddressSpace(M, - LLVMTypeOf(Initializer), - String_val(Name), - Int_val(AddressSpace)); - LLVMSetInitializer(GlobalVar, Initializer); - return GlobalVar; -} - -/* llvalue -> unit */ -CAMLprim value llvm_delete_global(LLVMValueRef GlobalVar) { - LLVMDeleteGlobal(GlobalVar); - return Val_unit; -} - -/* llvalue -> llvalue -> unit */ -CAMLprim value llvm_set_initializer(LLVMValueRef ConstantVal, - LLVMValueRef GlobalVar) { - LLVMSetInitializer(GlobalVar, ConstantVal); - return Val_unit; -} - -/* llvalue -> unit */ -CAMLprim value llvm_remove_initializer(LLVMValueRef GlobalVar) { - LLVMSetInitializer(GlobalVar, NULL); - return Val_unit; -} - -/* llvalue -> bool */ -CAMLprim value llvm_is_thread_local(LLVMValueRef GlobalVar) { - return Val_bool(LLVMIsThreadLocal(GlobalVar)); -} - -/* bool -> llvalue -> unit */ -CAMLprim value llvm_set_thread_local(value IsThreadLocal, - LLVMValueRef GlobalVar) { - LLVMSetThreadLocal(GlobalVar, Bool_val(IsThreadLocal)); - return Val_unit; -} - -/* llvalue -> bool */ -CAMLprim value llvm_is_global_constant(LLVMValueRef GlobalVar) { - return Val_bool(LLVMIsGlobalConstant(GlobalVar)); -} - -/* bool -> llvalue -> unit */ -CAMLprim value llvm_set_global_constant(value Flag, LLVMValueRef GlobalVar) { - LLVMSetGlobalConstant(GlobalVar, Bool_val(Flag)); - return Val_unit; -} - -/*--... Operations on aliases ..............................................--*/ - -CAMLprim LLVMValueRef llvm_add_alias(LLVMModuleRef M, LLVMTypeRef Ty, - LLVMValueRef Aliasee, value Name) { - return LLVMAddAlias(M, Ty, Aliasee, String_val(Name)); -} - -/*--... Operations on functions ............................................--*/ - -DEFINE_ITERATORS(function, Function, LLVMModuleRef, LLVMValueRef, - LLVMGetGlobalParent) - -/* string -> lltype -> llmodule -> llvalue */ -CAMLprim LLVMValueRef llvm_declare_function(value Name, LLVMTypeRef Ty, - LLVMModuleRef M) { - LLVMValueRef Fn; - if ((Fn = LLVMGetNamedFunction(M, String_val(Name)))) { - if (LLVMGetElementType(LLVMTypeOf(Fn)) != Ty) - return LLVMConstBitCast(Fn, LLVMPointerType(Ty, 0)); - return Fn; - } - return LLVMAddFunction(M, String_val(Name), Ty); -} - -/* string -> llmodule -> llvalue option */ -CAMLprim value llvm_lookup_function(value Name, LLVMModuleRef M) { - CAMLparam1(Name); - LLVMValueRef Fn; - if ((Fn = LLVMGetNamedFunction(M, String_val(Name)))) { - value Option = alloc(1, 0); - Field(Option, 0) = (value) Fn; - CAMLreturn(Option); - } - CAMLreturn(Val_int(0)); -} - -/* string -> lltype -> llmodule -> llvalue */ -CAMLprim LLVMValueRef llvm_define_function(value Name, LLVMTypeRef Ty, - LLVMModuleRef M) { - LLVMValueRef Fn = LLVMAddFunction(M, String_val(Name), Ty); - LLVMAppendBasicBlockInContext(LLVMGetTypeContext(Ty), Fn, "entry"); - return Fn; -} - -/* llvalue -> unit */ -CAMLprim value llvm_delete_function(LLVMValueRef Fn) { - LLVMDeleteFunction(Fn); - return Val_unit; -} - -/* llvalue -> bool */ -CAMLprim value llvm_is_intrinsic(LLVMValueRef Fn) { - return Val_bool(LLVMGetIntrinsicID(Fn)); -} - -/* llvalue -> int */ -CAMLprim value llvm_function_call_conv(LLVMValueRef Fn) { - return Val_int(LLVMGetFunctionCallConv(Fn)); -} - -/* int -> llvalue -> unit */ -CAMLprim value llvm_set_function_call_conv(value Id, LLVMValueRef Fn) { - LLVMSetFunctionCallConv(Fn, Int_val(Id)); - return Val_unit; -} - -/* llvalue -> string option */ -CAMLprim value llvm_gc(LLVMValueRef Fn) { - const char *GC; - CAMLparam0(); - CAMLlocal2(Name, Option); - - if ((GC = LLVMGetGC(Fn))) { - Name = copy_string(GC); - - Option = alloc(1, 0); - Field(Option, 0) = Name; - CAMLreturn(Option); - } else { - CAMLreturn(Val_int(0)); - } -} - -/* string option -> llvalue -> unit */ -CAMLprim value llvm_set_gc(value GC, LLVMValueRef Fn) { - LLVMSetGC(Fn, GC == Val_int(0)? 0 : String_val(Field(GC, 0))); - return Val_unit; -} - -/* llvalue -> Attribute.t -> unit */ -CAMLprim value llvm_add_function_attr(LLVMValueRef Arg, value PA) { - LLVMAddFunctionAttr(Arg, Int_val(PA)); - return Val_unit; -} - -/* llvalue -> Attribute.t -> unit */ -CAMLprim value llvm_remove_function_attr(LLVMValueRef Arg, value PA) { - LLVMRemoveFunctionAttr(Arg, Int_val(PA)); - return Val_unit; -} -/*--... Operations on parameters ...........................................--*/ - -DEFINE_ITERATORS(param, Param, LLVMValueRef, LLVMValueRef, LLVMGetParamParent) - -/* llvalue -> int -> llvalue */ -CAMLprim LLVMValueRef llvm_param(LLVMValueRef Fn, value Index) { - return LLVMGetParam(Fn, Int_val(Index)); -} - -/* llvalue -> llvalue */ -CAMLprim value llvm_params(LLVMValueRef Fn) { - value Params = alloc(LLVMCountParams(Fn), 0); - LLVMGetParams(Fn, (LLVMValueRef *) Op_val(Params)); - return Params; -} - -/* llvalue -> Attribute.t -> unit */ -CAMLprim value llvm_add_param_attr(LLVMValueRef Arg, value PA) { - LLVMAddAttribute(Arg, Int_val(PA)); - return Val_unit; -} - -/* llvalue -> Attribute.t -> unit */ -CAMLprim value llvm_remove_param_attr(LLVMValueRef Arg, value PA) { - LLVMRemoveAttribute(Arg, Int_val(PA)); - return Val_unit; -} - -/* llvalue -> int -> unit */ -CAMLprim value llvm_set_param_alignment(LLVMValueRef Arg, value align) { - LLVMSetParamAlignment(Arg, Int_val(align)); - return Val_unit; -} - -/*--... Operations on basic blocks .........................................--*/ - -DEFINE_ITERATORS( - block, BasicBlock, LLVMValueRef, LLVMBasicBlockRef, LLVMGetBasicBlockParent) - -/* llvalue -> llbasicblock array */ -CAMLprim value llvm_basic_blocks(LLVMValueRef Fn) { - value MLArray = alloc(LLVMCountBasicBlocks(Fn), 0); - LLVMGetBasicBlocks(Fn, (LLVMBasicBlockRef *) Op_val(MLArray)); - return MLArray; -} - -/* llbasicblock -> unit */ -CAMLprim value llvm_delete_block(LLVMBasicBlockRef BB) { - LLVMDeleteBasicBlock(BB); - return Val_unit; -} - -/* string -> llvalue -> llbasicblock */ -CAMLprim LLVMBasicBlockRef llvm_append_block(LLVMContextRef Context, value Name, - LLVMValueRef Fn) { - return LLVMAppendBasicBlockInContext(Context, Fn, String_val(Name)); -} - -/* string -> llbasicblock -> llbasicblock */ -CAMLprim LLVMBasicBlockRef llvm_insert_block(LLVMContextRef Context, value Name, - LLVMBasicBlockRef BB) { - return LLVMInsertBasicBlockInContext(Context, BB, String_val(Name)); -} - -/* llvalue -> bool */ -CAMLprim value llvm_value_is_block(LLVMValueRef Val) { - return Val_bool(LLVMValueIsBasicBlock(Val)); -} - -/*--... Operations on instructions .........................................--*/ - -DEFINE_ITERATORS(instr, Instruction, LLVMBasicBlockRef, LLVMValueRef, - LLVMGetInstructionParent) - - -/*--... Operations on call sites ...........................................--*/ - -/* llvalue -> int */ -CAMLprim value llvm_instruction_call_conv(LLVMValueRef Inst) { - return Val_int(LLVMGetInstructionCallConv(Inst)); -} - -/* int -> llvalue -> unit */ -CAMLprim value llvm_set_instruction_call_conv(value CC, LLVMValueRef Inst) { - LLVMSetInstructionCallConv(Inst, Int_val(CC)); - return Val_unit; -} - -/* llvalue -> int -> Attribute.t -> unit */ -CAMLprim value llvm_add_instruction_param_attr(LLVMValueRef Instr, - value index, - value PA) { - LLVMAddInstrAttribute(Instr, Int_val(index), Int_val(PA)); - return Val_unit; -} - -/* llvalue -> int -> Attribute.t -> unit */ -CAMLprim value llvm_remove_instruction_param_attr(LLVMValueRef Instr, - value index, - value PA) { - LLVMRemoveInstrAttribute(Instr, Int_val(index), Int_val(PA)); - return Val_unit; -} - -/*--... Operations on call instructions (only) .............................--*/ - -/* llvalue -> bool */ -CAMLprim value llvm_is_tail_call(LLVMValueRef CallInst) { - return Val_bool(LLVMIsTailCall(CallInst)); -} - -/* bool -> llvalue -> unit */ -CAMLprim value llvm_set_tail_call(value IsTailCall, - LLVMValueRef CallInst) { - LLVMSetTailCall(CallInst, Bool_val(IsTailCall)); - return Val_unit; -} - -/*--... Operations on phi nodes ............................................--*/ - -/* (llvalue * llbasicblock) -> llvalue -> unit */ -CAMLprim value llvm_add_incoming(value Incoming, LLVMValueRef PhiNode) { - LLVMAddIncoming(PhiNode, - (LLVMValueRef*) &Field(Incoming, 0), - (LLVMBasicBlockRef*) &Field(Incoming, 1), - 1); - return Val_unit; -} - -/* llvalue -> (llvalue * llbasicblock) list */ -CAMLprim value llvm_incoming(LLVMValueRef PhiNode) { - unsigned I; - CAMLparam0(); - CAMLlocal3(Hd, Tl, Tmp); - - /* Build a tuple list of them. */ - Tl = Val_int(0); - for (I = LLVMCountIncoming(PhiNode); I != 0; ) { - Hd = alloc(2, 0); - Store_field(Hd, 0, (value) LLVMGetIncomingValue(PhiNode, --I)); - Store_field(Hd, 1, (value) LLVMGetIncomingBlock(PhiNode, I)); - - Tmp = alloc(2, 0); - Store_field(Tmp, 0, Hd); - Store_field(Tmp, 1, Tl); - Tl = Tmp; - } - - CAMLreturn(Tl); -} - - -/*===-- Instruction builders ----------------------------------------------===*/ - -#define Builder_val(v) (*(LLVMBuilderRef *)(Data_custom_val(v))) - -static void llvm_finalize_builder(value B) { - LLVMDisposeBuilder(Builder_val(B)); -} - -static struct custom_operations builder_ops = { - (char *) "IRBuilder", - llvm_finalize_builder, - custom_compare_default, - custom_hash_default, - custom_serialize_default, - custom_deserialize_default -}; - -static value alloc_builder(LLVMBuilderRef B) { - value V = alloc_custom(&builder_ops, sizeof(LLVMBuilderRef), 0, 1); - Builder_val(V) = B; - return V; -} - -/* llcontext -> llbuilder */ -CAMLprim value llvm_builder(LLVMContextRef C) { - return alloc_builder(LLVMCreateBuilderInContext(C)); -} - -/* (llbasicblock, llvalue) llpos -> llbuilder -> unit */ -CAMLprim value llvm_position_builder(value Pos, value B) { - if (Tag_val(Pos) == 0) { - LLVMBasicBlockRef BB = (LLVMBasicBlockRef) Op_val(Field(Pos, 0)); - LLVMPositionBuilderAtEnd(Builder_val(B), BB); - } else { - LLVMValueRef I = (LLVMValueRef) Op_val(Field(Pos, 0)); - LLVMPositionBuilderBefore(Builder_val(B), I); - } - return Val_unit; -} - -/* llbuilder -> llbasicblock */ -CAMLprim LLVMBasicBlockRef llvm_insertion_block(value B) { - LLVMBasicBlockRef InsertBlock = LLVMGetInsertBlock(Builder_val(B)); - if (!InsertBlock) - raise_not_found(); - return InsertBlock; -} - -/* llvalue -> string -> llbuilder -> unit */ -CAMLprim value llvm_insert_into_builder(LLVMValueRef I, value Name, value B) { - LLVMInsertIntoBuilderWithName(Builder_val(B), I, String_val(Name)); - return Val_unit; -} - -/*--... Metadata ...........................................................--*/ - -/* llbuilder -> llvalue -> unit */ -CAMLprim value llvm_set_current_debug_location(value B, LLVMValueRef V) { - LLVMSetCurrentDebugLocation(Builder_val(B), V); - return Val_unit; -} - -/* llbuilder -> unit */ -CAMLprim value llvm_clear_current_debug_location(value B) { - LLVMSetCurrentDebugLocation(Builder_val(B), NULL); - return Val_unit; -} - -/* llbuilder -> llvalue option */ -CAMLprim value llvm_current_debug_location(value B) { - CAMLparam0(); - LLVMValueRef L; - if ((L = LLVMGetCurrentDebugLocation(Builder_val(B)))) { - value Option = alloc(1, 0); - Field(Option, 0) = (value) L; - CAMLreturn(Option); - } - CAMLreturn(Val_int(0)); -} - -/* llbuilder -> llvalue -> unit */ -CAMLprim value llvm_set_inst_debug_location(value B, LLVMValueRef V) { - LLVMSetInstDebugLocation(Builder_val(B), V); - return Val_unit; -} - - -/*--... Terminators ........................................................--*/ - -/* llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_ret_void(value B) { - return LLVMBuildRetVoid(Builder_val(B)); -} - -/* llvalue -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_ret(LLVMValueRef Val, value B) { - return LLVMBuildRet(Builder_val(B), Val); -} - -/* llvalue array -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_aggregate_ret(value RetVals, value B) { - return LLVMBuildAggregateRet(Builder_val(B), (LLVMValueRef *) Op_val(RetVals), - Wosize_val(RetVals)); -} - -/* llbasicblock -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_br(LLVMBasicBlockRef BB, value B) { - return LLVMBuildBr(Builder_val(B), BB); -} - -/* llvalue -> llbasicblock -> llbasicblock -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_cond_br(LLVMValueRef If, - LLVMBasicBlockRef Then, - LLVMBasicBlockRef Else, - value B) { - return LLVMBuildCondBr(Builder_val(B), If, Then, Else); -} - -/* llvalue -> llbasicblock -> int -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_switch(LLVMValueRef Of, - LLVMBasicBlockRef Else, - value EstimatedCount, - value B) { - return LLVMBuildSwitch(Builder_val(B), Of, Else, Int_val(EstimatedCount)); -} - -/* llvalue -> llvalue -> llbasicblock -> unit */ -CAMLprim value llvm_add_case(LLVMValueRef Switch, LLVMValueRef OnVal, - LLVMBasicBlockRef Dest) { - LLVMAddCase(Switch, OnVal, Dest); - return Val_unit; -} - -/* llvalue -> llbasicblock -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_indirect_br(LLVMValueRef Addr, - value EstimatedDests, - value B) { - return LLVMBuildIndirectBr(Builder_val(B), Addr, EstimatedDests); -} - -/* llvalue -> llvalue -> llbasicblock -> unit */ -CAMLprim value llvm_add_destination(LLVMValueRef IndirectBr, - LLVMBasicBlockRef Dest) { - LLVMAddDestination(IndirectBr, Dest); - return Val_unit; -} - -/* llvalue -> llvalue array -> llbasicblock -> llbasicblock -> string -> - llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_invoke_nat(LLVMValueRef Fn, value Args, - LLVMBasicBlockRef Then, - LLVMBasicBlockRef Catch, - value Name, value B) { - return LLVMBuildInvoke(Builder_val(B), Fn, (LLVMValueRef *) Op_val(Args), - Wosize_val(Args), Then, Catch, String_val(Name)); -} - -/* llvalue -> llvalue array -> llbasicblock -> llbasicblock -> string -> - llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_invoke_bc(value Args[], int NumArgs) { - return llvm_build_invoke_nat((LLVMValueRef) Args[0], Args[1], - (LLVMBasicBlockRef) Args[2], - (LLVMBasicBlockRef) Args[3], - Args[4], Args[5]); -} - -/* llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_unwind(value B) { - return LLVMBuildUnwind(Builder_val(B)); -} - -/* llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_unreachable(value B) { - return LLVMBuildUnreachable(Builder_val(B)); -} - -/*--... Arithmetic .........................................................--*/ - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_add(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildAdd(Builder_val(B), LHS, RHS, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_nsw_add(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildNSWAdd(Builder_val(B), LHS, RHS, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_nuw_add(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildNUWAdd(Builder_val(B), LHS, RHS, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_fadd(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildFAdd(Builder_val(B), LHS, RHS, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_sub(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildSub(Builder_val(B), LHS, RHS, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_nsw_sub(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildNSWSub(Builder_val(B), LHS, RHS, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_nuw_sub(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildNUWSub(Builder_val(B), LHS, RHS, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_fsub(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildFSub(Builder_val(B), LHS, RHS, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_mul(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildMul(Builder_val(B), LHS, RHS, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_nsw_mul(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildNSWMul(Builder_val(B), LHS, RHS, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_nuw_mul(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildNUWMul(Builder_val(B), LHS, RHS, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_fmul(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildFMul(Builder_val(B), LHS, RHS, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_udiv(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildUDiv(Builder_val(B), LHS, RHS, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_sdiv(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildSDiv(Builder_val(B), LHS, RHS, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_exact_sdiv(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildExactSDiv(Builder_val(B), LHS, RHS, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_fdiv(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildFDiv(Builder_val(B), LHS, RHS, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_urem(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildURem(Builder_val(B), LHS, RHS, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_srem(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildSRem(Builder_val(B), LHS, RHS, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_frem(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildFRem(Builder_val(B), LHS, RHS, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_shl(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildShl(Builder_val(B), LHS, RHS, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_lshr(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildLShr(Builder_val(B), LHS, RHS, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_ashr(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildAShr(Builder_val(B), LHS, RHS, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_and(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildAnd(Builder_val(B), LHS, RHS, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_or(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildOr(Builder_val(B), LHS, RHS, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_xor(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildXor(Builder_val(B), LHS, RHS, String_val(Name)); -} - -/* llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_neg(LLVMValueRef X, - value Name, value B) { - return LLVMBuildNeg(Builder_val(B), X, String_val(Name)); -} - -/* llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_nsw_neg(LLVMValueRef X, - value Name, value B) { - return LLVMBuildNSWNeg(Builder_val(B), X, String_val(Name)); -} - -/* llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_nuw_neg(LLVMValueRef X, - value Name, value B) { - return LLVMBuildNUWNeg(Builder_val(B), X, String_val(Name)); -} - -/* llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_fneg(LLVMValueRef X, - value Name, value B) { - return LLVMBuildFNeg(Builder_val(B), X, String_val(Name)); -} - -/* llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_not(LLVMValueRef X, - value Name, value B) { - return LLVMBuildNot(Builder_val(B), X, String_val(Name)); -} - -/*--... Memory .............................................................--*/ - -/* lltype -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_alloca(LLVMTypeRef Ty, - value Name, value B) { - return LLVMBuildAlloca(Builder_val(B), Ty, String_val(Name)); -} - -/* lltype -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_array_alloca(LLVMTypeRef Ty, LLVMValueRef Size, - value Name, value B) { - return LLVMBuildArrayAlloca(Builder_val(B), Ty, Size, String_val(Name)); -} - -/* llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_load(LLVMValueRef Pointer, - value Name, value B) { - return LLVMBuildLoad(Builder_val(B), Pointer, String_val(Name)); -} - -/* llvalue -> llvalue -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_store(LLVMValueRef Value, LLVMValueRef Pointer, - value B) { - return LLVMBuildStore(Builder_val(B), Value, Pointer); -} - -/* llvalue -> llvalue array -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_gep(LLVMValueRef Pointer, value Indices, - value Name, value B) { - return LLVMBuildGEP(Builder_val(B), Pointer, - (LLVMValueRef *) Op_val(Indices), Wosize_val(Indices), - String_val(Name)); -} - -/* llvalue -> llvalue array -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_in_bounds_gep(LLVMValueRef Pointer, - value Indices, value Name, - value B) { - return LLVMBuildInBoundsGEP(Builder_val(B), Pointer, - (LLVMValueRef *) Op_val(Indices), - Wosize_val(Indices), String_val(Name)); -} - -/* llvalue -> int -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_struct_gep(LLVMValueRef Pointer, - value Index, value Name, - value B) { - return LLVMBuildStructGEP(Builder_val(B), Pointer, - Int_val(Index), String_val(Name)); -} - -/* string -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_global_string(value Str, value Name, value B) { - return LLVMBuildGlobalString(Builder_val(B), String_val(Str), - String_val(Name)); -} - -/* string -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_global_stringptr(value Str, value Name, - value B) { - return LLVMBuildGlobalStringPtr(Builder_val(B), String_val(Str), - String_val(Name)); -} - -/*--... Casts ..............................................................--*/ - -/* llvalue -> lltype -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_trunc(LLVMValueRef X, LLVMTypeRef Ty, - value Name, value B) { - return LLVMBuildTrunc(Builder_val(B), X, Ty, String_val(Name)); -} - -/* llvalue -> lltype -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_zext(LLVMValueRef X, LLVMTypeRef Ty, - value Name, value B) { - return LLVMBuildZExt(Builder_val(B), X, Ty, String_val(Name)); -} - -/* llvalue -> lltype -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_sext(LLVMValueRef X, LLVMTypeRef Ty, - value Name, value B) { - return LLVMBuildSExt(Builder_val(B), X, Ty, String_val(Name)); -} - -/* llvalue -> lltype -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_fptoui(LLVMValueRef X, LLVMTypeRef Ty, - value Name, value B) { - return LLVMBuildFPToUI(Builder_val(B), X, Ty, String_val(Name)); -} - -/* llvalue -> lltype -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_fptosi(LLVMValueRef X, LLVMTypeRef Ty, - value Name, value B) { - return LLVMBuildFPToSI(Builder_val(B), X, Ty, String_val(Name)); -} - -/* llvalue -> lltype -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_uitofp(LLVMValueRef X, LLVMTypeRef Ty, - value Name, value B) { - return LLVMBuildUIToFP(Builder_val(B), X, Ty, String_val(Name)); -} - -/* llvalue -> lltype -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_sitofp(LLVMValueRef X, LLVMTypeRef Ty, - value Name, value B) { - return LLVMBuildSIToFP(Builder_val(B), X, Ty, String_val(Name)); -} - -/* llvalue -> lltype -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_fptrunc(LLVMValueRef X, LLVMTypeRef Ty, - value Name, value B) { - return LLVMBuildFPTrunc(Builder_val(B), X, Ty, String_val(Name)); -} - -/* llvalue -> lltype -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_fpext(LLVMValueRef X, LLVMTypeRef Ty, - value Name, value B) { - return LLVMBuildFPExt(Builder_val(B), X, Ty, String_val(Name)); -} - -/* llvalue -> lltype -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_prttoint(LLVMValueRef X, LLVMTypeRef Ty, - value Name, value B) { - return LLVMBuildPtrToInt(Builder_val(B), X, Ty, String_val(Name)); -} - -/* llvalue -> lltype -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_inttoptr(LLVMValueRef X, LLVMTypeRef Ty, - value Name, value B) { - return LLVMBuildIntToPtr(Builder_val(B), X, Ty, String_val(Name)); -} - -/* llvalue -> lltype -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_bitcast(LLVMValueRef X, LLVMTypeRef Ty, - value Name, value B) { - return LLVMBuildBitCast(Builder_val(B), X, Ty, String_val(Name)); -} - -/* llvalue -> lltype -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_zext_or_bitcast(LLVMValueRef X, LLVMTypeRef Ty, - value Name, value B) { - return LLVMBuildZExtOrBitCast(Builder_val(B), X, Ty, String_val(Name)); -} - -/* llvalue -> lltype -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_sext_or_bitcast(LLVMValueRef X, LLVMTypeRef Ty, - value Name, value B) { - return LLVMBuildSExtOrBitCast(Builder_val(B), X, Ty, String_val(Name)); -} - -/* llvalue -> lltype -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_trunc_or_bitcast(LLVMValueRef X, - LLVMTypeRef Ty, value Name, - value B) { - return LLVMBuildTruncOrBitCast(Builder_val(B), X, Ty, String_val(Name)); -} - -/* llvalue -> lltype -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_pointercast(LLVMValueRef X, LLVMTypeRef Ty, - value Name, value B) { - return LLVMBuildPointerCast(Builder_val(B), X, Ty, String_val(Name)); -} - -/* llvalue -> lltype -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_intcast(LLVMValueRef X, LLVMTypeRef Ty, - value Name, value B) { - return LLVMBuildIntCast(Builder_val(B), X, Ty, String_val(Name)); -} - -/* llvalue -> lltype -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_fpcast(LLVMValueRef X, LLVMTypeRef Ty, - value Name, value B) { - return LLVMBuildFPCast(Builder_val(B), X, Ty, String_val(Name)); -} - -/*--... Comparisons ........................................................--*/ - -/* Icmp.t -> llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_icmp(value Pred, - LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildICmp(Builder_val(B), Int_val(Pred) + LLVMIntEQ, LHS, RHS, - String_val(Name)); -} - -/* Fcmp.t -> llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_fcmp(value Pred, - LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildFCmp(Builder_val(B), Int_val(Pred), LHS, RHS, - String_val(Name)); -} - -/*--... Miscellaneous instructions .........................................--*/ - -/* (llvalue * llbasicblock) list -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_phi(value Incoming, value Name, value B) { - value Hd, Tl; - LLVMValueRef FirstValue, PhiNode; - - assert(Incoming != Val_int(0) && "Empty list passed to Llvm.build_phi!"); - - Hd = Field(Incoming, 0); - FirstValue = (LLVMValueRef) Field(Hd, 0); - PhiNode = LLVMBuildPhi(Builder_val(B), LLVMTypeOf(FirstValue), - String_val(Name)); - - for (Tl = Incoming; Tl != Val_int(0); Tl = Field(Tl, 1)) { - value Hd = Field(Tl, 0); - LLVMAddIncoming(PhiNode, (LLVMValueRef*) &Field(Hd, 0), - (LLVMBasicBlockRef*) &Field(Hd, 1), 1); - } - - return PhiNode; -} - -/* llvalue -> llvalue array -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_call(LLVMValueRef Fn, value Params, - value Name, value B) { - return LLVMBuildCall(Builder_val(B), Fn, (LLVMValueRef *) Op_val(Params), - Wosize_val(Params), String_val(Name)); -} - -/* llvalue -> llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_select(LLVMValueRef If, - LLVMValueRef Then, LLVMValueRef Else, - value Name, value B) { - return LLVMBuildSelect(Builder_val(B), If, Then, Else, String_val(Name)); -} - -/* llvalue -> lltype -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_va_arg(LLVMValueRef List, LLVMTypeRef Ty, - value Name, value B) { - return LLVMBuildVAArg(Builder_val(B), List, Ty, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_extractelement(LLVMValueRef Vec, - LLVMValueRef Idx, - value Name, value B) { - return LLVMBuildExtractElement(Builder_val(B), Vec, Idx, String_val(Name)); -} - -/* llvalue -> llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_insertelement(LLVMValueRef Vec, - LLVMValueRef Element, - LLVMValueRef Idx, - value Name, value B) { - return LLVMBuildInsertElement(Builder_val(B), Vec, Element, Idx, - String_val(Name)); -} - -/* llvalue -> llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_shufflevector(LLVMValueRef V1, LLVMValueRef V2, - LLVMValueRef Mask, - value Name, value B) { - return LLVMBuildShuffleVector(Builder_val(B), V1, V2, Mask, String_val(Name)); -} - -/* llvalue -> int -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_extractvalue(LLVMValueRef Aggregate, - value Idx, value Name, value B) { - return LLVMBuildExtractValue(Builder_val(B), Aggregate, Int_val(Idx), - String_val(Name)); -} - -/* llvalue -> llvalue -> int -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_insertvalue(LLVMValueRef Aggregate, - LLVMValueRef Val, value Idx, - value Name, value B) { - return LLVMBuildInsertValue(Builder_val(B), Aggregate, Val, Int_val(Idx), - String_val(Name)); -} - -/* llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_is_null(LLVMValueRef Val, value Name, - value B) { - return LLVMBuildIsNull(Builder_val(B), Val, String_val(Name)); -} - -/* llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_is_not_null(LLVMValueRef Val, value Name, - value B) { - return LLVMBuildIsNotNull(Builder_val(B), Val, String_val(Name)); -} - -/* llvalue -> llvalue -> string -> llbuilder -> llvalue */ -CAMLprim LLVMValueRef llvm_build_ptrdiff(LLVMValueRef LHS, LLVMValueRef RHS, - value Name, value B) { - return LLVMBuildPtrDiff(Builder_val(B), LHS, RHS, String_val(Name)); -} - - -/*===-- Memory buffers ----------------------------------------------------===*/ - -/* string -> llmemorybuffer - raises IoError msg on error */ -CAMLprim value llvm_memorybuffer_of_file(value Path) { - CAMLparam1(Path); - char *Message; - LLVMMemoryBufferRef MemBuf; - - if (LLVMCreateMemoryBufferWithContentsOfFile(String_val(Path), - &MemBuf, &Message)) - llvm_raise(llvm_ioerror_exn, Message); - - CAMLreturn((value) MemBuf); -} - -/* unit -> llmemorybuffer - raises IoError msg on error */ -CAMLprim LLVMMemoryBufferRef llvm_memorybuffer_of_stdin(value Unit) { - char *Message; - LLVMMemoryBufferRef MemBuf; - - if (LLVMCreateMemoryBufferWithSTDIN(&MemBuf, &Message)) - llvm_raise(llvm_ioerror_exn, Message); - - return MemBuf; -} - -/* llmemorybuffer -> unit */ -CAMLprim value llvm_memorybuffer_dispose(LLVMMemoryBufferRef MemBuf) { - LLVMDisposeMemoryBuffer(MemBuf); - return Val_unit; -} - -/*===-- Pass Managers -----------------------------------------------------===*/ - -/* unit -> [ `Module ] PassManager.t */ -CAMLprim LLVMPassManagerRef llvm_passmanager_create(value Unit) { - return LLVMCreatePassManager(); -} - -/* llmodule -> [ `Function ] PassManager.t -> bool */ -CAMLprim value llvm_passmanager_run_module(LLVMModuleRef M, - LLVMPassManagerRef PM) { - return Val_bool(LLVMRunPassManager(PM, M)); -} - -/* [ `Function ] PassManager.t -> bool */ -CAMLprim value llvm_passmanager_initialize(LLVMPassManagerRef FPM) { - return Val_bool(LLVMInitializeFunctionPassManager(FPM)); -} - -/* llvalue -> [ `Function ] PassManager.t -> bool */ -CAMLprim value llvm_passmanager_run_function(LLVMValueRef F, - LLVMPassManagerRef FPM) { - return Val_bool(LLVMRunFunctionPassManager(FPM, F)); -} - -/* [ `Function ] PassManager.t -> bool */ -CAMLprim value llvm_passmanager_finalize(LLVMPassManagerRef FPM) { - return Val_bool(LLVMFinalizeFunctionPassManager(FPM)); -} - -/* PassManager.any PassManager.t -> unit */ -CAMLprim value llvm_passmanager_dispose(LLVMPassManagerRef PM) { - LLVMDisposePassManager(PM); - return Val_unit; -} diff --git a/contrib/llvm/bindings/ocaml/target/Makefile b/contrib/llvm/bindings/ocaml/target/Makefile deleted file mode 100644 index 3c48cd8fc208..000000000000 --- a/contrib/llvm/bindings/ocaml/target/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -##===- bindings/ocaml/target/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_target interface. -# -##===----------------------------------------------------------------------===## - -LEVEL := ../../.. -LIBRARYNAME := llvm_target -UsedComponents := target -UsedOcamlInterfaces := llvm - -include ../Makefile.ocaml diff --git a/contrib/llvm/bindings/ocaml/target/llvm_target.ml b/contrib/llvm/bindings/ocaml/target/llvm_target.ml deleted file mode 100644 index ea5341d5e8b2..000000000000 --- a/contrib/llvm/bindings/ocaml/target/llvm_target.ml +++ /dev/null @@ -1,44 +0,0 @@ -(*===-- llvm_target.ml - LLVM Ocaml Interface ------------------*- OCaml -*-===* - * - * The LLVM Compiler Infrastructure - * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. - * - *===----------------------------------------------------------------------===*) - -module Endian = struct - type t = - | Big - | Little -end - -module TargetData = struct - type t - - external create : string -> t = "llvm_targetdata_create" - external add : t -> [ unit - = "llvm_targetdata_add" - external as_string : t -> string = "llvm_targetdata_as_string" - external invalidate_struct_layout : t -> Llvm.lltype -> unit - = "llvm_targetdata_invalidate_struct_layout" - external dispose : t -> unit = "llvm_targetdata_dispose" -end - -external byte_order : TargetData.t -> Endian.t = "llvm_byte_order" -external pointer_size : TargetData.t -> int = "llvm_pointer_size" -external intptr_type : TargetData.t -> Llvm.lltype = "LLVMIntPtrType" -external size_in_bits : TargetData.t -> Llvm.lltype -> Int64.t - = "llvm_size_in_bits" -external store_size : TargetData.t -> Llvm.lltype -> Int64.t = "llvm_store_size" -external abi_size : TargetData.t -> Llvm.lltype -> Int64.t = "llvm_abi_size" -external abi_align : TargetData.t -> Llvm.lltype -> int = "llvm_abi_align" -external stack_align : TargetData.t -> Llvm.lltype -> int = "llvm_stack_align" -external preferred_align : TargetData.t -> Llvm.lltype -> int - = "llvm_preferred_align" -external preferred_align_of_global : TargetData.t -> Llvm.llvalue -> int - = "llvm_preferred_align_of_global" -external element_at_offset : TargetData.t -> Llvm.lltype -> Int64.t -> int - = "llvm_element_at_offset" -external offset_of_element : TargetData.t -> Llvm.lltype -> int -> Int64.t - = "llvm_offset_of_element" diff --git a/contrib/llvm/bindings/ocaml/target/llvm_target.mli b/contrib/llvm/bindings/ocaml/target/llvm_target.mli deleted file mode 100644 index a82e1b684fad..000000000000 --- a/contrib/llvm/bindings/ocaml/target/llvm_target.mli +++ /dev/null @@ -1,102 +0,0 @@ -(*===-- llvm_target.mli - LLVM Ocaml Interface -----------------*- OCaml -*-===* - * - * The LLVM Compiler Infrastructure - * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. - * - *===----------------------------------------------------------------------===*) - -(** Target Information. - - This interface provides an ocaml API for LLVM target information, - the classes in the Target library. *) - -module Endian : sig - type t = - | Big - | Little -end - -module TargetData : sig - type t - - (** [TargetData.create rep] parses the target data string representation [rep]. - See the constructor llvm::TargetData::TargetData. *) - external create : string -> t = "llvm_targetdata_create" - - (** [add_target_data td pm] adds the target data [td] to the pass manager [pm]. - Does not take ownership of the target data. - See the method llvm::PassManagerBase::add. *) - external add : t -> [ unit - = "llvm_targetdata_add" - - (** [as_string td] is the string representation of the target data [td]. - See the constructor llvm::TargetData::TargetData. *) - external as_string : t -> string = "llvm_targetdata_as_string" - - (** Struct layouts are speculatively cached. If a TargetDataRef is alive when - types are being refined and removed, this method must be called whenever a - struct type is removed to avoid a dangling pointer in this cache. - See the method llvm::TargetData::InvalidateStructLayoutInfo. *) - external invalidate_struct_layout : t -> Llvm.lltype -> unit - = "llvm_targetdata_invalidate_struct_layout" - - (** Deallocates a TargetData. - See the destructor llvm::TargetData::~TargetData. *) - external dispose : t -> unit = "llvm_targetdata_dispose" -end - -(** Returns the byte order of a target, either LLVMBigEndian or - LLVMLittleEndian. - See the method llvm::TargetData::isLittleEndian. *) -external byte_order : TargetData.t -> Endian.t = "llvm_byte_order" - -(** Returns the pointer size in bytes for a target. - See the method llvm::TargetData::getPointerSize. *) -external pointer_size : TargetData.t -> int = "llvm_pointer_size" - -(** Returns the integer type that is the same size as a pointer on a target. - See the method llvm::TargetData::getIntPtrType. *) -external intptr_type : TargetData.t -> Llvm.lltype = "LLVMIntPtrType" - -(** Computes the size of a type in bytes for a target. - See the method llvm::TargetData::getTypeSizeInBits. *) -external size_in_bits : TargetData.t -> Llvm.lltype -> Int64.t - = "llvm_size_in_bits" - -(** Computes the storage size of a type in bytes for a target. - See the method llvm::TargetData::getTypeStoreSize. *) -external store_size : TargetData.t -> Llvm.lltype -> Int64.t = "llvm_store_size" - -(** Computes the ABI size of a type in bytes for a target. - See the method llvm::TargetData::getTypeAllocSize. *) -external abi_size : TargetData.t -> Llvm.lltype -> Int64.t = "llvm_abi_size" - -(** Computes the ABI alignment of a type in bytes for a target. - See the method llvm::TargetData::getTypeABISize. *) -external abi_align : TargetData.t -> Llvm.lltype -> int = "llvm_abi_align" - -(** Computes the call frame alignment of a type in bytes for a target. - See the method llvm::TargetData::getTypeABISize. *) -external stack_align : TargetData.t -> Llvm.lltype -> int = "llvm_stack_align" - -(** Computes the preferred alignment of a type in bytes for a target. - See the method llvm::TargetData::getTypeABISize. *) -external preferred_align : TargetData.t -> Llvm.lltype -> int - = "llvm_preferred_align" - -(** Computes the preferred alignment of a global variable in bytes for a target. - See the method llvm::TargetData::getPreferredAlignment. *) -external preferred_align_of_global : TargetData.t -> Llvm.llvalue -> int - = "llvm_preferred_align_of_global" - -(** Computes the structure element that contains the byte offset for a target. - See the method llvm::StructLayout::getElementContainingOffset. *) -external element_at_offset : TargetData.t -> Llvm.lltype -> Int64.t -> int - = "llvm_element_at_offset" - -(** Computes the byte offset of the indexed struct element for a target. - See the method llvm::StructLayout::getElementContainingOffset. *) -external offset_of_element : TargetData.t -> Llvm.lltype -> int -> Int64.t - = "llvm_offset_of_element" diff --git a/contrib/llvm/bindings/ocaml/target/target_ocaml.c b/contrib/llvm/bindings/ocaml/target/target_ocaml.c deleted file mode 100644 index cc20e8187a7a..000000000000 --- a/contrib/llvm/bindings/ocaml/target/target_ocaml.c +++ /dev/null @@ -1,109 +0,0 @@ -/*===-- target_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/Target.h" -#include "caml/alloc.h" - -/* string -> TargetData.t */ -CAMLprim LLVMTargetDataRef llvm_targetdata_create(value StringRep) { - return LLVMCreateTargetData(String_val(StringRep)); -} - -/* TargetData.t -> [ unit */ -CAMLprim value llvm_targetdata_add(LLVMTargetDataRef TD, LLVMPassManagerRef PM){ - LLVMAddTargetData(TD, PM); - return Val_unit; -} - -/* TargetData.t -> string */ -CAMLprim value llvm_targetdata_as_string(LLVMTargetDataRef TD) { - char *StringRep = LLVMCopyStringRepOfTargetData(TD); - value Copy = copy_string(StringRep); - LLVMDisposeMessage(StringRep); - return Copy; -} - -/* TargetData.t -> Llvm.lltype -> unit */ -CAMLprim value llvm_targetdata_invalidate_struct_layout(LLVMTargetDataRef TD, - LLVMTypeRef Ty) { - LLVMInvalidateStructLayout(TD, Ty); - return Val_unit; -} - -/* TargetData.t -> unit */ -CAMLprim value llvm_targetdata_dispose(LLVMTargetDataRef TD) { - LLVMDisposeTargetData(TD); - return Val_unit; -} - -/* TargetData.t -> Endian.t */ -CAMLprim value llvm_byte_order(LLVMTargetDataRef TD) { - return Val_int(LLVMByteOrder(TD)); -} - -/* TargetData.t -> int */ -CAMLprim value llvm_pointer_size(LLVMTargetDataRef TD) { - return Val_int(LLVMPointerSize(TD)); -} - -/* TargetData.t -> Llvm.lltype -> Int64.t */ -CAMLprim value llvm_size_in_bits(LLVMTargetDataRef TD, LLVMTypeRef Ty) { - return caml_copy_int64(LLVMSizeOfTypeInBits(TD, Ty)); -} - -/* TargetData.t -> Llvm.lltype -> Int64.t */ -CAMLprim value llvm_store_size(LLVMTargetDataRef TD, LLVMTypeRef Ty) { - return caml_copy_int64(LLVMStoreSizeOfType(TD, Ty)); -} - -/* TargetData.t -> Llvm.lltype -> Int64.t */ -CAMLprim value llvm_abi_size(LLVMTargetDataRef TD, LLVMTypeRef Ty) { - return caml_copy_int64(LLVMABISizeOfType(TD, Ty)); -} - -/* TargetData.t -> Llvm.lltype -> int */ -CAMLprim value llvm_abi_align(LLVMTargetDataRef TD, LLVMTypeRef Ty) { - return Val_int(LLVMABIAlignmentOfType(TD, Ty)); -} - -/* TargetData.t -> Llvm.lltype -> int */ -CAMLprim value llvm_stack_align(LLVMTargetDataRef TD, LLVMTypeRef Ty) { - return Val_int(LLVMCallFrameAlignmentOfType(TD, Ty)); -} - -/* TargetData.t -> Llvm.lltype -> int */ -CAMLprim value llvm_preferred_align(LLVMTargetDataRef TD, LLVMTypeRef Ty) { - return Val_int(LLVMPreferredAlignmentOfType(TD, Ty)); -} - -/* TargetData.t -> Llvm.llvalue -> int */ -CAMLprim value llvm_preferred_align_of_global(LLVMTargetDataRef TD, - LLVMValueRef GlobalVar) { - return Val_int(LLVMPreferredAlignmentOfGlobal(TD, GlobalVar)); -} - -/* TargetData.t -> Llvm.lltype -> Int64.t -> int */ -CAMLprim value llvm_element_at_offset(LLVMTargetDataRef TD, LLVMTypeRef Ty, - value Offset) { - return Val_int(LLVMElementAtOffset(TD, Ty, Int_val(Offset))); -} - -/* TargetData.t -> Llvm.lltype -> int -> Int64.t */ -CAMLprim value llvm_offset_of_element(LLVMTargetDataRef TD, LLVMTypeRef Ty, - value Index) { - return caml_copy_int64(LLVMOffsetOfElement(TD, Ty, Int_val(Index))); -} diff --git a/contrib/llvm/bindings/ocaml/transforms/Makefile b/contrib/llvm/bindings/ocaml/transforms/Makefile deleted file mode 100644 index 95b00c8d74aa..000000000000 --- a/contrib/llvm/bindings/ocaml/transforms/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -##===- bindings/ocaml/transforms/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 = scalar - -ocamldoc: - $(Verb) for i in $(DIRS) ; do \ - $(MAKE) -C $$i ocamldoc; \ - done - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/bindings/ocaml/transforms/scalar/Makefile b/contrib/llvm/bindings/ocaml/transforms/scalar/Makefile deleted file mode 100644 index cbaffa4ea7ae..000000000000 --- a/contrib/llvm/bindings/ocaml/transforms/scalar/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -##===- bindings/ocaml/transforms/scalar/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_scalar_opts interface. -# -##===----------------------------------------------------------------------===## - -LEVEL := ../../../.. -LIBRARYNAME := llvm_scalar_opts -DONT_BUILD_RELINKED := 1 -UsedComponents := scalaropts -UsedOcamlInterfaces := llvm - -include ../../Makefile.ocaml diff --git a/contrib/llvm/bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml b/contrib/llvm/bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml deleted file mode 100644 index 5699152b5a92..000000000000 --- a/contrib/llvm/bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml +++ /dev/null @@ -1,75 +0,0 @@ -(*===-- llvm_scalar_opts.ml - LLVM Ocaml Interface -------------*- OCaml -*-===* - * - * The LLVM Compiler Infrastructure - * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. - * - *===----------------------------------------------------------------------===*) - -external add_constant_propagation : [ unit - = "llvm_add_constant_propagation" -external add_sccp : [ unit - = "llvm_add_sccp" -external add_dead_store_elimination : [ unit - = "llvm_add_dead_store_elimination" -external add_aggressive_dce : [ unit - = "llvm_add_aggressive_dce" -external -add_scalar_repl_aggregation : [ unit - = "llvm_add_scalar_repl_aggregation" -external add_ind_var_simplification : [ unit - = "llvm_add_ind_var_simplification" -external -add_instruction_combination : [ unit - = "llvm_add_instruction_combination" -external add_licm : [ unit - = "llvm_add_licm" -external add_loop_unswitch : [ unit - = "llvm_add_loop_unswitch" -external add_loop_unroll : [ unit - = "llvm_add_loop_unroll" -external add_loop_rotation : [ unit - = "llvm_add_loop_rotation" -external add_loop_index_split : [ unit - = "llvm_add_loop_index_split" -external -add_memory_to_register_promotion : [ unit - = "llvm_add_memory_to_register_promotion" -external -add_memory_to_register_demotion : [ unit - = "llvm_add_memory_to_register_demotion" -external add_reassociation : [ unit - = "llvm_add_reassociation" -external add_jump_threading : [ unit - = "llvm_add_jump_threading" -external add_cfg_simplification : [ unit - = "llvm_add_cfg_simplification" -external -add_tail_call_elimination : [ unit - = "llvm_add_tail_call_elimination" -external add_gvn : [ unit - = "llvm_add_gvn" -external add_memcpy_opt : [ unit - = "llvm_add_memcpy_opt" -external add_loop_deletion : [ unit - = "llvm_add_loop_deletion" -external -add_lib_call_simplification : [ unit - = "llvm_add_lib_call_simplification" diff --git a/contrib/llvm/bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli b/contrib/llvm/bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli deleted file mode 100644 index 9f95fbce9f89..000000000000 --- a/contrib/llvm/bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli +++ /dev/null @@ -1,123 +0,0 @@ -(*===-- llvm_scalar_opts.mli - LLVM Ocaml Interface ------------*- OCaml -*-===* - * - * The LLVM Compiler Infrastructure - * - * This file is distributed under the University of Illinois Open Source - * License. See LICENSE.TXT for details. - * - *===----------------------------------------------------------------------===*) - -(** Scalar Transforms. - - This interface provides an ocaml API for LLVM scalar transforms, the - classes in the [LLVMScalarOpts] library. *) - -(** See the [llvm::createConstantPropogationPass] function. *) -external add_constant_propagation : [ unit - = "llvm_add_constant_propagation" - -(** See the [llvm::createSCCPPass] function. *) -external add_sccp : [ unit - = "llvm_add_sccp" - -(** See [llvm::createDeadStoreEliminationPass] function. *) -external add_dead_store_elimination : [ unit - = "llvm_add_dead_store_elimination" - -(** See The [llvm::createAggressiveDCEPass] function. *) -external add_aggressive_dce : [ unit - = "llvm_add_aggressive_dce" - -(** See the [llvm::createScalarReplAggregatesPass] function. *) -external -add_scalar_repl_aggregation : [ unit - = "llvm_add_scalar_repl_aggregation" - -(** See the [llvm::createIndVarSimplifyPass] function. *) -external add_ind_var_simplification : [ unit - = "llvm_add_ind_var_simplification" - -(** See the [llvm::createInstructionCombiningPass] function. *) -external -add_instruction_combination : [ unit - = "llvm_add_instruction_combination" - -(** See the [llvm::createLICMPass] function. *) -external add_licm : [ unit - = "llvm_add_licm" - -(** See the [llvm::createLoopUnswitchPass] function. *) -external add_loop_unswitch : [ unit - = "llvm_add_loop_unswitch" - -(** See the [llvm::createLoopUnrollPass] function. *) -external add_loop_unroll : [ unit - = "llvm_add_loop_unroll" - -(** See the [llvm::createLoopRotatePass] function. *) -external add_loop_rotation : [ unit - = "llvm_add_loop_rotation" - -(** See the [llvm::createLoopIndexSplitPass] function. *) -external add_loop_index_split : [ unit - = "llvm_add_loop_index_split" - -(** See the [llvm::createPromoteMemoryToRegisterPass] function. *) -external -add_memory_to_register_promotion : [ unit - = "llvm_add_memory_to_register_promotion" - -(** See the [llvm::createDemoteMemoryToRegisterPass] function. *) -external -add_memory_to_register_demotion : [ unit - = "llvm_add_memory_to_register_demotion" - -(** See the [llvm::createReassociatePass] function. *) -external add_reassociation : [ unit - = "llvm_add_reassociation" - -(** See the [llvm::createJumpThreadingPass] function. *) -external add_jump_threading : [ unit - = "llvm_add_jump_threading" - -(** See the [llvm::createCFGSimplificationPass] function. *) -external add_cfg_simplification : [ unit - = "llvm_add_cfg_simplification" - -(** See the [llvm::createTailCallEliminationPass] function. *) -external -add_tail_call_elimination : [ unit - = "llvm_add_tail_call_elimination" - -(** See the [llvm::createGVNPass] function. *) -external add_gvn : [ unit - = "llvm_add_gvn" - -(** See the [llvm::createMemCpyOptPass] function. *) -external add_memcpy_opt : [ unit - = "llvm_add_memcpy_opt" - -(** See the [llvm::createLoopDeletionPass] function. *) -external add_loop_deletion : [ unit - = "llvm_add_loop_deletion" - -(** See the [llvm::createSimplifyLibCallsPass] function. *) -external -add_lib_call_simplification : [ unit - = "llvm_add_lib_call_simplification" diff --git a/contrib/llvm/bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c b/contrib/llvm/bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c deleted file mode 100644 index c20bdde5753a..000000000000 --- a/contrib/llvm/bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c +++ /dev/null @@ -1,152 +0,0 @@ -/*===-- scalar_opts_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/Transforms/Scalar.h" -#include "caml/mlvalues.h" -#include "caml/misc.h" - -/* [ unit */ -CAMLprim value llvm_add_constant_propagation(LLVMPassManagerRef PM) { - LLVMAddConstantPropagationPass(PM); - return Val_unit; -} - -/* [ unit */ -CAMLprim value llvm_add_sccp(LLVMPassManagerRef PM) { - LLVMAddSCCPPass(PM); - return Val_unit; -} - -/* [ unit */ -CAMLprim value llvm_add_dead_store_elimination(LLVMPassManagerRef PM) { - LLVMAddDeadStoreEliminationPass(PM); - return Val_unit; -} - -/* [ unit */ -CAMLprim value llvm_add_aggressive_dce(LLVMPassManagerRef PM) { - LLVMAddAggressiveDCEPass(PM); - return Val_unit; -} - -/* [ unit */ -CAMLprim value llvm_add_scalar_repl_aggregation(LLVMPassManagerRef PM) { - LLVMAddScalarReplAggregatesPass(PM); - return Val_unit; -} - -/* [ unit */ -CAMLprim value llvm_add_ind_var_simplification(LLVMPassManagerRef PM) { - LLVMAddIndVarSimplifyPass(PM); - return Val_unit; -} - -/* [ unit */ -CAMLprim value llvm_add_instruction_combination(LLVMPassManagerRef PM) { - LLVMAddInstructionCombiningPass(PM); - return Val_unit; -} - -/* [ unit */ -CAMLprim value llvm_add_licm(LLVMPassManagerRef PM) { - LLVMAddLICMPass(PM); - return Val_unit; -} - -/* [ unit */ -CAMLprim value llvm_add_loop_unswitch(LLVMPassManagerRef PM) { - LLVMAddLoopUnrollPass(PM); - return Val_unit; -} - -/* [ unit */ -CAMLprim value llvm_add_loop_unroll(LLVMPassManagerRef PM) { - LLVMAddLoopUnrollPass(PM); - return Val_unit; -} - -/* [ unit */ -CAMLprim value llvm_add_loop_rotation(LLVMPassManagerRef PM) { - LLVMAddLoopRotatePass(PM); - return Val_unit; -} - -/* [ unit */ -CAMLprim value llvm_add_loop_index_split(LLVMPassManagerRef PM) { - LLVMAddLoopIndexSplitPass(PM); - return Val_unit; -} - -/* [ unit */ -CAMLprim value llvm_add_memory_to_register_promotion(LLVMPassManagerRef PM) { - LLVMAddPromoteMemoryToRegisterPass(PM); - return Val_unit; -} - -/* [ unit */ -CAMLprim value llvm_add_memory_to_register_demotion(LLVMPassManagerRef PM) { - LLVMAddDemoteMemoryToRegisterPass(PM); - return Val_unit; -} - -/* [ unit */ -CAMLprim value llvm_add_reassociation(LLVMPassManagerRef PM) { - LLVMAddReassociatePass(PM); - return Val_unit; -} - -/* [ unit */ -CAMLprim value llvm_add_jump_threading(LLVMPassManagerRef PM) { - LLVMAddJumpThreadingPass(PM); - return Val_unit; -} - -/* [ unit */ -CAMLprim value llvm_add_cfg_simplification(LLVMPassManagerRef PM) { - LLVMAddCFGSimplificationPass(PM); - return Val_unit; -} - -/* [ unit */ -CAMLprim value llvm_add_tail_call_elimination(LLVMPassManagerRef PM) { - LLVMAddTailCallEliminationPass(PM); - return Val_unit; -} - -/* [ unit */ -CAMLprim value llvm_add_gvn(LLVMPassManagerRef PM) { - LLVMAddGVNPass(PM); - return Val_unit; -} - -/* [ unit */ -CAMLprim value llvm_add_memcpy_opt(LLVMPassManagerRef PM) { - LLVMAddMemCpyOptPass(PM); - return Val_unit; -} - -/* [ unit */ -CAMLprim value llvm_add_loop_deletion(LLVMPassManagerRef PM) { - LLVMAddLoopDeletionPass(PM); - return Val_unit; -} - -/* [ unit */ -CAMLprim value llvm_add_lib_call_simplification(LLVMPassManagerRef PM) { - LLVMAddSimplifyLibCallsPass(PM); - return Val_unit; -} diff --git a/contrib/llvm/build-for-llvm-top.sh b/contrib/llvm/build-for-llvm-top.sh deleted file mode 100755 index 78e3ed87f092..000000000000 --- a/contrib/llvm/build-for-llvm-top.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh - -# This includes the Bourne shell library from llvm-top. Since this file is -# generally only used when building from llvm-top, it is safe to assume that -# llvm is checked out into llvm-top in which case .. just works. -. ../library.sh - -# Process the options passed in to us by the build script into standard -# variables. -process_arguments "$@" - -# First, see if the build directory is there. If not, create it. -build_dir="$LLVM_TOP/build.llvm" -if test ! -d "$build_dir" ; then - mkdir -p "$build_dir" -fi - -# See if we have previously been configured by sensing the presence -# of the config.status scripts -config_status="$build_dir/config.status" -if test ! -f "$config_status" -o "$config_status" -ot "$0" ; then - # We must configure so build a list of configure options - config_options="--prefix=$PREFIX --with-llvmgccdir=$PREFIX" - if test "$OPTIMIZED" -eq 1 ; then - config_options="$config_options --enable-optimized" - else - config_options="$config_options --disable-optimized" - fi - if test "$DEBUG" -eq 1 ; then - config_options="$config_options --enable-debug" - else - config_options="$config_options --disable-debug" - fi - if test "$ASSERTIONS" -eq 1 ; then - config_options="$config_options --enable-assertions" - else - config_options="$config_options --disable-assertions" - fi - if test "$CHECKING" -eq 1 ; then - config_options="$config_options --enable-expensive-checks" - else - config_options="$config_options --disable-expensive-checks" - fi - if test "$DOXYGEN" -eq 1 ; then - config_options="$config_options --enable-doxygen" - else - config_options="$config_options --disable-doxygen" - fi - if test "$THREADS" -eq 1 ; then - config_options="$config_options --enable-threads" - else - config_options="$config_options --disable-threads" - fi - config_options="$config_options $OPTIONS_DASH $OPTIONS_DASH_DASH" - src_dir=`pwd` - cd "$build_dir" - msg 0 Configuring $module with: - msg 0 " $src_dir/configure" $config_options - $src_dir/configure $config_options || \ - die $? "Configuring $module module failed" -else - msg 0 Module $module already configured, ignoring configure options. - cd "$build_dir" -fi - -msg 0 Building $module with: -msg 0 " make" $OPTIONS_ASSIGN tools-only -make $OPTIONS_ASSIGN tools-only diff --git a/contrib/llvm/configure b/contrib/llvm/configure deleted file mode 100755 index 776de364bb20..000000000000 --- a/contrib/llvm/configure +++ /dev/null @@ -1,22169 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.60 for llvm 2.8. -# -# Report bugs to . -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -# -# Copyright (c) 2003-2010 University of Illinois at Urbana-Champaign. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : -else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /usr/bin/posix$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - case $as_dir in - /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac -done -IFS=$as_save_IFS - - - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell autoconf@gnu.org about your system, - echo including any error possibly output before this - echo message -} - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir -fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -# Find out whether ``test -x'' works. Don't use a zero-byte file, as -# systems may use methods other than mode bits to determine executability. -cat >conf$$.file <<_ASEOF -#! /bin/sh -exit 0 -_ASEOF -chmod +x conf$$.file -if test -x conf$$.file >/dev/null 2>&1; then - as_executable_p="test -x" -else - as_executable_p=: -fi -rm -f conf$$.file - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - - -exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Identity of this package. -PACKAGE_NAME='llvm' -PACKAGE_TARNAME='-llvm-' -PACKAGE_VERSION='2.8' -PACKAGE_STRING='llvm 2.8' -PACKAGE_BUGREPORT='llvmbugs@cs.uiuc.edu' - -ac_unique_file="lib/VMCore/Module.cpp" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_SYS_STAT_H -# include -#endif -#if STDC_HEADERS -# include -# include -#else -# if HAVE_STDLIB_H -# include -# endif -#endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H -# include -# endif -# include -#endif -#if HAVE_STRINGS_H -# include -#endif -#if HAVE_INTTYPES_H -# include -#endif -#if HAVE_STDINT_H -# include -#endif -#if HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -LLVM_COPYRIGHT -subdirs -build -build_cpu -build_vendor -build_os -host -host_cpu -host_vendor -host_os -target -target_cpu -target_vendor -target_os -OS -HOST_OS -TARGET_OS -LINKALL -NOLINKALL -LLVM_ON_UNIX -LLVM_ON_WIN32 -ARCH -ENDIAN -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -CPP -GREP -EGREP -LLVM_CROSS_COMPILING -BUILD_CC -BUILD_EXEEXT -BUILD_CXX -CVSBUILD -ENABLE_OPTIMIZED -ENABLE_PROFILING -DISABLE_ASSERTIONS -ENABLE_EXPENSIVE_CHECKS -EXPENSIVE_CHECKS -DEBUG_RUNTIME -DEBUG_SYMBOLS -JIT -TARGET_HAS_JIT -ENABLE_DOXYGEN -ENABLE_THREADS -ENABLE_PIC -ENABLE_SHARED -ENABLE_TIMESTAMPS -TARGETS_TO_BUILD -LLVM_ENUM_TARGETS -LLVM_ENUM_ASM_PRINTERS -LLVM_ENUM_ASM_PARSERS -LLVM_ENUM_DISASSEMBLERS -ENABLE_CBE_PRINTF_A -CLANGPATH -CLANGXXPATH -ENABLE_BUILT_CLANG -OPTIMIZE_OPTION -EXTRA_OPTIONS -BINUTILS_INCDIR -CXX -CXXFLAGS -ac_ct_CXX -NM -ifGNUmake -LN_S -CMP -CP -DATE -FIND -MKDIR -MV -RANLIB -AR -RM -SED -TAR -BINPWD -GRAPHVIZ -DOT -FDP -NEATO -TWOPI -CIRCO -GV -DOTTY -PERL -HAVE_PERL -INSTALL_PROGRAM -INSTALL_SCRIPT -INSTALL_DATA -BZIP2 -CAT -DOXYGEN -GROFF -GZIP -POD2HTML -POD2MAN -PDFROFF -RUNTEST -TCLSH -ZIP -OCAMLC -OCAMLOPT -OCAMLDEP -OCAMLDOC -GAS -HAVE_LINK_VERSION_SCRIPT -INSTALL_LTDL_TRUE -INSTALL_LTDL_FALSE -CONVENIENCE_LTDL_TRUE -CONVENIENCE_LTDL_FALSE -LIBADD_DL -LLVMGCCCOMMAND -LLVMGXXCOMMAND -LLVMGCC -LLVMGXX -LLVMCC_OPTION -NO_VARIADIC_MACROS -NO_MISSING_FIELD_INITIALIZERS -USE_UDIS86 -USE_OPROFILE -HAVE_PTHREAD -HUGE_VAL_SANITY -MMAP_FILE -LLVMCC1 -LLVMCC1PLUS -LLVMGCCDIR -LLVMGCC_LANGS -SHLIBEXT -SHLIBPATH_VAR -LLVM_PREFIX -LLVM_BINDIR -LLVM_LIBDIR -LLVM_DATADIR -LLVM_DOCSDIR -LLVM_ETCDIR -LLVM_INCLUDEDIR -LLVM_INFODIR -LLVM_MANDIR -LLVM_CONFIGTIME -BINDINGS_TO_BUILD -ALL_BINDINGS -OCAML_LIBDIR -ENABLE_VISIBILITY_INLINES_HIDDEN -RPATH -RDYNAMIC -LIBOBJS -LTLIBOBJS' -ac_subst_files='' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -CPPFLAGS -CPP -CXX -CXXFLAGS -CCC' -ac_subdirs_all='projects/llvm-gcc -projects/test-suite -projects/llvm-test -projects/poolalloc -projects/llvm-poolalloc -projects/sample -projects/privbracket -projects/llvm-stacker -projects/llvm-reopt -projects/llvm-java -projects/llvm-tv -projects/safecode -projects/llvm-kernel' - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval enable_$ac_feature=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval enable_$ac_feature=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval with_$ac_package=\$ac_optarg ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval with_$ac_package=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute directory names. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$0" || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures llvm 2.8 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/-llvm-] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] - --target=TARGET configure for building compilers for TARGET [HOST] -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of llvm 2.8:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-optimized Compile with optimizations enabled (default is NO) - --enable-profiling Compile with profiling enabled (default is NO) - --enable-assertions Compile with assertion checks enabled (default is - NO) - --enable-expensive-checks - Compile with expensive debug checks enabled (default - is NO) - --enable-debug-runtime Build runtime libs with debug symbols (default is - NO) - --enable-debug-symbols Build compiler with debug symbols (default is NO if - optimization is on and YES if it's off) - --enable-jit Enable Just In Time Compiling (default is YES) - --enable-doxygen Build doxygen documentation (default is NO) - --enable-threads Use threads if available (default is YES) - --enable-pic Build LLVM with Position Independent Code (default - is YES) - --enable-shared Build a shared library and link tools against it - (default is NO) - --enable-timestamps Enable embedding timestamp information in build - (default is YES) - --enable-targets Build specific host targets: all or - target1,target2,... Valid targets are: host, x86, - x86_64, sparc, powerpc, alpha, arm, mips, spu, - pic16, xcore, msp430, systemz, blackfin, cbe, and - cpp (default=all) - --enable-cbe-printf-a Enable C Backend output with hex floating point via - %a (default is YES) - --enable-bindings Build specific language bindings: - all,auto,none,{binding-name} (default=auto) - --enable-libffi Check for the presence of libffi (default is NO) - --enable-ltdl-install install libltdl - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-llvmgccdir Specify location of llvm-gcc install dir (default - searches PATH) - --with-llvmgcc Specify location of llvm-gcc driver (default - searches PATH) - --with-llvmgxx Specify location of llvm-g++ driver (default - searches PATH) - --with-clang Specify location of clang compiler (default is - --with-built-clang) - --with-built-clang Use the compiled Clang as the LLVM compiler - (default=check) - --with-optimize-option Select the compiler options to use for optimized - builds - --with-extra-options Specify additional options to compile LLVM with - --with-ocaml-libdir Specify install location for ocaml bindings (default - is stdlib) - --with-c-include-dirs Colon separated list of directories clang will - search for headers - --with-cxx-include-root Directory with the libstdc++ headers. - --with-cxx-include-arch Architecture of the libstdc++ headers. - --with-cxx-include-32bit-dir - 32 bit multilib dir. - --with-cxx-include-64bit-dir - 64 bit multilib directory. - --with-binutils-include Specify path to binutils/include/ containing - plugin-api.h file for gold plugin. - --with-tclinclude directory where tcl headers are - --with-llvmcc= Choose the LLVM capable compiler to use (llvm-gcc, - clang, or none; default=check) - --with-udis86= Use udis86 external x86 disassembler library - --with-oprofile= - Tell OProfile >= 0.9.4 how to symbolize JIT output - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - CXX C++ compiler command - CXXFLAGS C++ compiler flags - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to . -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -llvm configure 2.8 -generated by GNU Autoconf 2.60 - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. - -Copyright (c) 2003-2010 University of Illinois at Urbana-Champaign. -_ACEOF - exit -fi -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by llvm $as_me 2.8, which was -generated by GNU Autoconf 2.60. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args '$ac_arg'" - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" -elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" -else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" -fi -shift -for ac_site_file -do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi - - - - - - - - - - - - - - - - - - - - - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -LLVM_COPYRIGHT="Copyright (c) 2003-2010 University of Illinois at Urbana-Champaign." - - - - - - - -ac_aux_dir= -for ac_dir in autoconf "$srcdir"/autoconf; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in autoconf \"$srcdir\"/autoconf" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in autoconf \"$srcdir\"/autoconf" >&2;} - { (exit 1); exit 1; }; } -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - - -if test ${srcdir} != "." ; then - if test -f ${srcdir}/include/llvm/Config/config.h ; then - { { echo "$as_me:$LINENO: error: Already configured in ${srcdir}" >&5 -echo "$as_me: error: Already configured in ${srcdir}" >&2;} - { (exit 1); exit 1; }; } - fi -fi - - - -if test -d ${srcdir}/projects/llvm-gcc ; then - subdirs="$subdirs projects/llvm-gcc" - -fi - -if test -d ${srcdir}/projects/test-suite ; then - subdirs="$subdirs projects/test-suite" - -fi - -if test -d ${srcdir}/projects/llvm-test ; then - subdirs="$subdirs projects/llvm-test" - -fi - -if test -d ${srcdir}/projects/poolalloc ; then - subdirs="$subdirs projects/poolalloc" - -fi - -if test -d ${srcdir}/projects/llvm-poolalloc ; then - subdirs="$subdirs projects/llvm-poolalloc" - -fi - -for i in `ls ${srcdir}/projects` -do - if test -d ${srcdir}/projects/${i} ; then - case ${i} in - sample) subdirs="$subdirs projects/sample" - ;; - privbracket) subdirs="$subdirs projects/privbracket" - ;; - llvm-stacker) subdirs="$subdirs projects/llvm-stacker" - ;; - llvm-reopt) subdirs="$subdirs projects/llvm-reopt" -;; - llvm-java) subdirs="$subdirs projects/llvm-java" - ;; - llvm-tv) subdirs="$subdirs projects/llvm-tv" - ;; - safecode) subdirs="$subdirs projects/safecode" - ;; - llvm-kernel) subdirs="$subdirs projects/llvm-kernel" - ;; - llvm-gcc) ;; - test-suite) ;; - llvm-test) ;; - poolalloc) ;; - llvm-poolalloc) ;; - *) - { echo "$as_me:$LINENO: WARNING: Unknown project (${i}) won't be configured automatically" >&5 -echo "$as_me: WARNING: Unknown project (${i}) won't be configured automatically" >&2;} - ;; - esac - fi -done - - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} - { (exit 1); exit 1; }; } - -{ echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6; } -if test "${ac_cv_build+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -echo "$as_me: error: invalid value of canonical build" >&2;} - { (exit 1); exit 1; }; };; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6; } -if test "${ac_cv_host+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - -{ echo "$as_me:$LINENO: checking target system type" >&5 -echo $ECHO_N "checking target system type... $ECHO_C" >&6; } -if test "${ac_cv_target+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "x$target_alias" = x; then - ac_cv_target=$ac_cv_host -else - ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -echo "${ECHO_T}$ac_cv_target" >&6; } -case $ac_cv_target in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 -echo "$as_me: error: invalid value of canonical target" >&2;} - { (exit 1); exit 1; }; };; -esac -target=$ac_cv_target -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_target -shift -target_cpu=$1 -target_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -target_os=$* -IFS=$ac_save_IFS -case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac - - -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -test -n "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - NONENONEs,x,x, && - program_prefix=${target_alias}- - -{ echo "$as_me:$LINENO: checking type of operating system we're going to host on" >&5 -echo $ECHO_N "checking type of operating system we're going to host on... $ECHO_C" >&6; } -if test "${llvm_cv_os_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $host in - *-*-aix*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="AIX" - llvm_cv_platform_type="Unix" ;; - *-*-irix*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="IRIX" - llvm_cv_platform_type="Unix" ;; - *-*-cygwin*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="Cygwin" - llvm_cv_platform_type="Unix" ;; - *-*-darwin*) - llvm_cv_link_all_option="-Wl,-all_load" - llvm_cv_no_link_all_option="-Wl,-noall_load" - llvm_cv_os_type="Darwin" - llvm_cv_platform_type="Unix" ;; - *-*-minix*) - llvm_cv_link_all_option="-Wl,-all_load" - llvm_cv_no_link_all_option="-Wl,-noall_load" - llvm_cv_os_type="Minix" - llvm_cv_platform_type="Unix" ;; - *-*-freebsd*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="FreeBSD" - llvm_cv_platform_type="Unix" ;; - *-*-openbsd*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="OpenBSD" - llvm_cv_platform_type="Unix" ;; - *-*-netbsd*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="NetBSD" - llvm_cv_platform_type="Unix" ;; - *-*-dragonfly*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="DragonFly" - llvm_cv_platform_type="Unix" ;; - *-*-hpux*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="HP-UX" - llvm_cv_platform_type="Unix" ;; - *-*-interix*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="Interix" - llvm_cv_platform_type="Unix" ;; - *-*-linux*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="Linux" - llvm_cv_platform_type="Unix" ;; - *-*-solaris*) - llvm_cv_link_all_option="-Wl,-z,allextract" - llvm_cv_no_link_all_option="-Wl,-z,defaultextract" - llvm_cv_os_type="SunOS" - llvm_cv_platform_type="Unix" ;; - *-*-auroraux*) - llvm_cv_link_all_option="-Wl,-z,allextract" - llvm_cv_link_all_option="-Wl,-z,defaultextract" - llvm_cv_os_type="AuroraUX" - llvm_cv_platform_type="Unix" ;; - *-*-win32*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="Win32" - llvm_cv_platform_type="Win32" ;; - *-*-mingw*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="MingW" - llvm_cv_platform_type="Win32" ;; - *-*-haiku*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="Haiku" - llvm_cv_platform_type="Unix" ;; - *-unknown-eabi*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="Freestanding" - llvm_cv_platform_type="Unix" ;; - *-unknown-elf*) - llvm_cv_link_all_option="-Wl,--whole-archive" - llvm_cv_no_link_all_option="-Wl,--no-whole-archive" - llvm_cv_os_type="Freestanding" - llvm_cv_platform_type="Unix" ;; - *) - llvm_cv_link_all_option="" - llvm_cv_no_link_all_option="" - llvm_cv_os_type="Unknown" - llvm_cv_platform_type="Unknown" ;; -esac -fi -{ echo "$as_me:$LINENO: result: $llvm_cv_os_type" >&5 -echo "${ECHO_T}$llvm_cv_os_type" >&6; } - -{ echo "$as_me:$LINENO: checking type of operating system we're going to target" >&5 -echo $ECHO_N "checking type of operating system we're going to target... $ECHO_C" >&6; } -if test "${llvm_cv_target_os_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $target in - *-*-aix*) - llvm_cv_target_os_type="AIX" ;; - *-*-irix*) - llvm_cv_target_os_type="IRIX" ;; - *-*-cygwin*) - llvm_cv_target_os_type="Cygwin" ;; - *-*-darwin*) - llvm_cv_target_os_type="Darwin" ;; - *-*-minix*) - llvm_cv_target_os_type="Minix" ;; - *-*-freebsd*) - llvm_cv_target_os_type="FreeBSD" ;; - *-*-openbsd*) - llvm_cv_target_os_type="OpenBSD" ;; - *-*-netbsd*) - llvm_cv_target_os_type="NetBSD" ;; - *-*-dragonfly*) - llvm_cv_target_os_type="DragonFly" ;; - *-*-hpux*) - llvm_cv_target_os_type="HP-UX" ;; - *-*-interix*) - llvm_cv_target_os_type="Interix" ;; - *-*-linux*) - llvm_cv_target_os_type="Linux" ;; - *-*-solaris*) - llvm_cv_target_os_type="SunOS" ;; - *-*-auroraux*) - llvm_cv_target_os_type="AuroraUX" ;; - *-*-win32*) - llvm_cv_target_os_type="Win32" ;; - *-*-mingw*) - llvm_cv_target_os_type="MingW" ;; - *-*-haiku*) - llvm_cv_target_os_type="Haiku" ;; - *-unknown-eabi*) - llvm_cv_target_os_type="Freestanding" ;; - *) - llvm_cv_target_os_type="Unknown" ;; -esac -fi -{ echo "$as_me:$LINENO: result: $llvm_cv_target_os_type" >&5 -echo "${ECHO_T}$llvm_cv_target_os_type" >&6; } - -if test "$llvm_cv_os_type" = "Unknown" ; then - { { echo "$as_me:$LINENO: error: Operating system is unknown, configure can't continue" >&5 -echo "$as_me: error: Operating system is unknown, configure can't continue" >&2;} - { (exit 1); exit 1; }; } -fi - -OS=$llvm_cv_os_type - -HOST_OS=$llvm_cv_os_type - -TARGET_OS=$llvm_cv_target_os_type - - -LINKALL=$llvm_cv_link_all_option - -NOLINKALL=$llvm_cv_no_link_all_option - - -case $llvm_cv_platform_type in - Unix) - -cat >>confdefs.h <<\_ACEOF -#define LLVM_ON_UNIX 1 -_ACEOF - - LLVM_ON_UNIX=1 - - LLVM_ON_WIN32=0 - - ;; - Win32) - -cat >>confdefs.h <<\_ACEOF -#define LLVM_ON_WIN32 1 -_ACEOF - - LLVM_ON_UNIX=0 - - LLVM_ON_WIN32=1 - - ;; -esac - -{ echo "$as_me:$LINENO: checking target architecture" >&5 -echo $ECHO_N "checking target architecture... $ECHO_C" >&6; } -if test "${llvm_cv_target_arch+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $target in - i?86-*) llvm_cv_target_arch="x86" ;; - amd64-* | x86_64-*) llvm_cv_target_arch="x86_64" ;; - sparc*-*) llvm_cv_target_arch="Sparc" ;; - powerpc*-*) llvm_cv_target_arch="PowerPC" ;; - alpha*-*) llvm_cv_target_arch="Alpha" ;; - arm*-*) llvm_cv_target_arch="ARM" ;; - mips-*) llvm_cv_target_arch="Mips" ;; - pic16-*) llvm_cv_target_arch="PIC16" ;; - xcore-*) llvm_cv_target_arch="XCore" ;; - msp430-*) llvm_cv_target_arch="MSP430" ;; - s390x-*) llvm_cv_target_arch="SystemZ" ;; - bfin-*) llvm_cv_target_arch="Blackfin" ;; - mblaze-*) llvm_cv_target_arch="MBlaze" ;; - *) llvm_cv_target_arch="Unknown" ;; -esac -fi -{ echo "$as_me:$LINENO: result: $llvm_cv_target_arch" >&5 -echo "${ECHO_T}$llvm_cv_target_arch" >&6; } - -if test "$llvm_cv_target_arch" = "Unknown" ; then - { echo "$as_me:$LINENO: WARNING: Configuring LLVM for an unknown target archicture" >&5 -echo "$as_me: WARNING: Configuring LLVM for an unknown target archicture" >&2;} -fi - -# Determine the LLVM native architecture for the target -case "$llvm_cv_target_arch" in - x86) LLVM_NATIVE_ARCH="X86" ;; - x86_64) LLVM_NATIVE_ARCH="X86" ;; - *) LLVM_NATIVE_ARCH="$llvm_cv_target_arch" ;; -esac - -ARCH=$llvm_cv_target_arch - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { (ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } -fi - -ac_exeext=$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } - -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - -rm -f a.out a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6; } - -{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_c89=$ac_arg -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; - xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; -esac - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_path_GREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_executable_p "$ac_path_GREP"; } || continue - # Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - - $ac_path_GREP_found && break 3 - done -done - -done -IFS=$as_save_IFS - - -fi - -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_GREP=$GREP -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_path_EGREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_executable_p "$ac_path_EGREP"; } || continue - # Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - - $ac_path_EGREP_found && break 3 - done -done - -done -IFS=$as_save_IFS - - -fi - -EGREP="$ac_cv_path_EGREP" -if test -z "$EGREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_EGREP=$EGREP -fi - - - fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stdc=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } -if test "${ac_cv_c_bigendian+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # See if sys/param.h defines the BYTE_ORDER macro. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_c_bigendian=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } -int -main () -{ - _ascii (); _ebcdic (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then - ac_cv_c_bigendian=yes -fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi -fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ - - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=no -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_bigendian=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } -case $ac_cv_c_bigendian in - yes) - ENDIAN=big - ;; - no) - ENDIAN=little - ;; - *) - { { echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} - { (exit 1); exit 1; }; } ;; -esac - - -if test "$cross_compiling" = yes; then - LLVM_CROSS_COMPILING=1 - - -{ echo "$as_me:$LINENO: checking for executable suffix on build platform" >&5 -echo $ECHO_N "checking for executable suffix on build platform... $ECHO_C" >&6; } -if test "${ac_cv_build_exeext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$CYGWIN" = yes || test "$MINGW32" = yes; then - ac_cv_build_exeext=.exe -else - ac_build_prefix=${build_alias}- - - # Extract the first word of "${ac_build_prefix}gcc", so it can be a program name with args. -set dummy ${ac_build_prefix}gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_BUILD_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$BUILD_CC"; then - ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_BUILD_CC="${ac_build_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -BUILD_CC=$ac_cv_prog_BUILD_CC -if test -n "$BUILD_CC"; then - { echo "$as_me:$LINENO: result: $BUILD_CC" >&5 -echo "${ECHO_T}$BUILD_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - if test -z "$BUILD_CC"; then - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_BUILD_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$BUILD_CC"; then - ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_BUILD_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -BUILD_CC=$ac_cv_prog_BUILD_CC -if test -n "$BUILD_CC"; then - { echo "$as_me:$LINENO: result: $BUILD_CC" >&5 -echo "${ECHO_T}$BUILD_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - if test -z "$BUILD_CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_BUILD_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$BUILD_CC"; then - ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_BUILD_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_BUILD_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set BUILD_CC to just the basename; use the full file name. - shift - ac_cv_prog_BUILD_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -BUILD_CC=$ac_cv_prog_BUILD_CC -if test -n "$BUILD_CC"; then - { echo "$as_me:$LINENO: result: $BUILD_CC" >&5 -echo "${ECHO_T}$BUILD_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - fi - fi - test -z "$BUILD_CC" && { { echo "$as_me:$LINENO: error: no acceptable cc found in \$PATH" >&5 -echo "$as_me: error: no acceptable cc found in \$PATH" >&2;} - { (exit 1); exit 1; }; } - ac_build_link='${BUILD_CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' - rm -f conftest* - echo 'int main () { return 0; }' > conftest.$ac_ext - ac_cv_build_exeext= - if { (eval echo "$as_me:$LINENO: \"$ac_build_link\"") >&5 - (eval $ac_build_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; 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 - { { echo "$as_me:$LINENO: error: installation or configuration problem: compiler cannot create executables." >&5 -echo "$as_me: error: installation or configuration problem: compiler cannot create executables." >&2;} - { (exit 1); exit 1; }; } - fi - rm -f conftest* - test x"${ac_cv_build_exeext}" = x && ac_cv_build_exeext=blank -fi -fi - -BUILD_EXEEXT="" -test x"${ac_cv_build_exeext}" != xblank && BUILD_EXEEXT=${ac_cv_build_exeext} -{ echo "$as_me:$LINENO: result: ${ac_cv_build_exeext}" >&5 -echo "${ECHO_T}${ac_cv_build_exeext}" >&6; } -ac_build_exeext=$BUILD_EXEEXT - - ac_build_prefix=${build_alias}- - # Extract the first word of "${ac_build_prefix}g++", so it can be a program name with args. -set dummy ${ac_build_prefix}g++; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_BUILD_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$BUILD_CXX"; then - ac_cv_prog_BUILD_CXX="$BUILD_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_BUILD_CXX="${ac_build_prefix}g++" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -BUILD_CXX=$ac_cv_prog_BUILD_CXX -if test -n "$BUILD_CXX"; then - { echo "$as_me:$LINENO: result: $BUILD_CXX" >&5 -echo "${ECHO_T}$BUILD_CXX" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - if test -z "$BUILD_CXX"; then - # Extract the first word of "g++", so it can be a program name with args. -set dummy g++; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_BUILD_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$BUILD_CXX"; then - ac_cv_prog_BUILD_CXX="$BUILD_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_BUILD_CXX="g++" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -BUILD_CXX=$ac_cv_prog_BUILD_CXX -if test -n "$BUILD_CXX"; then - { echo "$as_me:$LINENO: result: $BUILD_CXX" >&5 -echo "${ECHO_T}$BUILD_CXX" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - if test -z "$BUILD_CXX"; then - # Extract the first word of "c++", so it can be a program name with args. -set dummy c++; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_BUILD_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$BUILD_CXX"; then - ac_cv_prog_BUILD_CXX="$BUILD_CXX" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/c++"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_BUILD_CXX="c++" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_BUILD_CXX - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set BUILD_CXX to just the basename; use the full file name. - shift - ac_cv_prog_BUILD_CXX="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -BUILD_CXX=$ac_cv_prog_BUILD_CXX -if test -n "$BUILD_CXX"; then - { echo "$as_me:$LINENO: result: $BUILD_CXX" >&5 -echo "${ECHO_T}$BUILD_CXX" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - fi - fi -else - LLVM_CROSS_COMPILING=0 - -fi - -if test -d ".svn" -o -d "${srcdir}/.svn" -o -d ".git" -o -d "${srcdir}/.git"; then - cvsbuild="yes" - optimize="no" - CVSBUILD=CVSBUILD=1 - -else - cvsbuild="no" - optimize="yes" -fi - - -# Check whether --enable-optimized was given. -if test "${enable_optimized+set}" = set; then - enableval=$enable_optimized; -else - enableval="yes" -fi - -if test ${enableval} = "no" ; then - ENABLE_OPTIMIZED= - -else - ENABLE_OPTIMIZED=ENABLE_OPTIMIZED=1 - -fi - -# Check whether --enable-profiling was given. -if test "${enable_profiling+set}" = set; then - enableval=$enable_profiling; -else - enableval="no" -fi - -if test ${enableval} = "no" ; then - ENABLE_PROFILING= - -else - ENABLE_PROFILING=ENABLE_PROFILING=1 - -fi - -# Check whether --enable-assertions was given. -if test "${enable_assertions+set}" = set; then - enableval=$enable_assertions; -else - enableval="no" -fi - -if test ${enableval} = "yes" ; then - DISABLE_ASSERTIONS= - -else - DISABLE_ASSERTIONS=DISABLE_ASSERTIONS=1 - -fi - -# Check whether --enable-expensive-checks was given. -if test "${enable_expensive_checks+set}" = set; then - enableval=$enable_expensive_checks; -else - enableval="no" -fi - -if test ${enableval} = "yes" ; then - ENABLE_EXPENSIVE_CHECKS=ENABLE_EXPENSIVE_CHECKS=1 - - EXPENSIVE_CHECKS=yes - -else - ENABLE_EXPENSIVE_CHECKS= - - EXPENSIVE_CHECKS=no - -fi - -# Check whether --enable-debug-runtime was given. -if test "${enable_debug_runtime+set}" = set; then - enableval=$enable_debug_runtime; -else - enableval=no -fi - -if test ${enableval} = "no" ; then - DEBUG_RUNTIME= - -else - DEBUG_RUNTIME=DEBUG_RUNTIME=1 - -fi - -# Check whether --enable-debug-symbols was given. -if test "${enable_debug_symbols+set}" = set; then - enableval=$enable_debug_symbols; -else - enableval=no -fi - -if test ${enableval} = "no" ; then - DEBUG_SYMBOLS= - -else - DEBUG_SYMBOLS=DEBUG_SYMBOLS=1 - -fi - -# Check whether --enable-jit was given. -if test "${enable_jit+set}" = set; then - enableval=$enable_jit; -else - enableval=default -fi - -if test ${enableval} = "no" -then - JIT= - -else - case "$llvm_cv_target_arch" in - x86) TARGET_HAS_JIT=1 - ;; - Sparc) TARGET_HAS_JIT=0 - ;; - PowerPC) TARGET_HAS_JIT=1 - ;; - x86_64) TARGET_HAS_JIT=1 - ;; - Alpha) TARGET_HAS_JIT=1 - ;; - ARM) TARGET_HAS_JIT=1 - ;; - Mips) TARGET_HAS_JIT=0 - ;; - PIC16) TARGET_HAS_JIT=0 - ;; - XCore) TARGET_HAS_JIT=0 - ;; - MSP430) TARGET_HAS_JIT=0 - ;; - SystemZ) TARGET_HAS_JIT=0 - ;; - Blackfin) TARGET_HAS_JIT=0 - ;; - MBlaze) TARGET_HAS_JIT=0 - ;; - *) TARGET_HAS_JIT=0 - ;; - esac -fi - -# Check whether --enable-doxygen was given. -if test "${enable_doxygen+set}" = set; then - enableval=$enable_doxygen; -else - enableval=default -fi - -case "$enableval" in - yes) ENABLE_DOXYGEN=1 - ;; - no) ENABLE_DOXYGEN=0 - ;; - default) ENABLE_DOXYGEN=0 - ;; - *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-doxygen. Use \"yes\" or \"no\"" >&5 -echo "$as_me: error: Invalid setting for --enable-doxygen. Use \"yes\" or \"no\"" >&2;} - { (exit 1); exit 1; }; } ;; -esac - -# Check whether --enable-threads was given. -if test "${enable_threads+set}" = set; then - enableval=$enable_threads; -else - enableval=default -fi - -case "$enableval" in - yes) ENABLE_THREADS=1 - ;; - no) ENABLE_THREADS=0 - ;; - default) ENABLE_THREADS=1 - ;; - *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-threads. Use \"yes\" or \"no\"" >&5 -echo "$as_me: error: Invalid setting for --enable-threads. Use \"yes\" or \"no\"" >&2;} - { (exit 1); exit 1; }; } ;; -esac - -cat >>confdefs.h <<_ACEOF -#define ENABLE_THREADS $ENABLE_THREADS -_ACEOF - - -# Check whether --enable-pic was given. -if test "${enable_pic+set}" = set; then - enableval=$enable_pic; -else - enableval=default -fi - -case "$enableval" in - yes) ENABLE_PIC=1 - ;; - no) ENABLE_PIC=0 - ;; - default) ENABLE_PIC=1 - ;; - *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-pic. Use \"yes\" or \"no\"" >&5 -echo "$as_me: error: Invalid setting for --enable-pic. Use \"yes\" or \"no\"" >&2;} - { (exit 1); exit 1; }; } ;; -esac - -cat >>confdefs.h <<_ACEOF -#define ENABLE_PIC $ENABLE_PIC -_ACEOF - - -# Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then - enableval=$enable_shared; -else - enableval=default -fi - -case "$enableval" in - yes) ENABLE_SHARED=1 - ;; - no) ENABLE_SHARED=0 - ;; - default) ENABLE_SHARED=0 - ;; - *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-shared. Use \"yes\" or \"no\"" >&5 -echo "$as_me: error: Invalid setting for --enable-shared. Use \"yes\" or \"no\"" >&2;} - { (exit 1); exit 1; }; } ;; -esac - -# Check whether --enable-timestamps was given. -if test "${enable_timestamps+set}" = set; then - enableval=$enable_timestamps; -else - enableval=default -fi - -case "$enableval" in - yes) ENABLE_TIMESTAMPS=1 - ;; - no) ENABLE_TIMESTAMPS=0 - ;; - default) ENABLE_TIMESTAMPS=1 - ;; - *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-timestamps. Use \"yes\" or \"no\"" >&5 -echo "$as_me: error: Invalid setting for --enable-timestamps. Use \"yes\" or \"no\"" >&2;} - { (exit 1); exit 1; }; } ;; -esac - -cat >>confdefs.h <<_ACEOF -#define ENABLE_TIMESTAMPS $ENABLE_TIMESTAMPS -_ACEOF - - -TARGETS_TO_BUILD="" -# Check whether --enable-targets was given. -if test "${enable_targets+set}" = set; then - enableval=$enable_targets; -else - enableval=all -fi - -if test "$enableval" = host-only ; then - enableval=host -fi -case "$enableval" in - all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha ARM Mips CellSPU PIC16 XCore MSP430 SystemZ Blackfin CBackend CppBackend MBlaze" ;; - *)for a_target in `echo $enableval|sed -e 's/,/ /g' ` ; do - case "$a_target" in - x86) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;; - x86_64) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;; - sparc) TARGETS_TO_BUILD="Sparc $TARGETS_TO_BUILD" ;; - powerpc) TARGETS_TO_BUILD="PowerPC $TARGETS_TO_BUILD" ;; - alpha) TARGETS_TO_BUILD="Alpha $TARGETS_TO_BUILD" ;; - arm) TARGETS_TO_BUILD="ARM $TARGETS_TO_BUILD" ;; - mips) TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;; - spu) TARGETS_TO_BUILD="CellSPU $TARGETS_TO_BUILD" ;; - pic16) TARGETS_TO_BUILD="PIC16 $TARGETS_TO_BUILD" ;; - xcore) TARGETS_TO_BUILD="XCore $TARGETS_TO_BUILD" ;; - msp430) TARGETS_TO_BUILD="MSP430 $TARGETS_TO_BUILD" ;; - systemz) TARGETS_TO_BUILD="SystemZ $TARGETS_TO_BUILD" ;; - blackfin) TARGETS_TO_BUILD="Blackfin $TARGETS_TO_BUILD" ;; - cbe) TARGETS_TO_BUILD="CBackend $TARGETS_TO_BUILD" ;; - cpp) TARGETS_TO_BUILD="CppBackend $TARGETS_TO_BUILD" ;; - mblaze) TARGETS_TO_BUILD="MBlaze $TARGETS_TO_BUILD" ;; - host) case "$llvm_cv_target_arch" in - x86) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;; - x86_64) TARGETS_TO_BUILD="X86 $TARGETS_TO_BUILD" ;; - Sparc) TARGETS_TO_BUILD="Sparc $TARGETS_TO_BUILD" ;; - PowerPC) TARGETS_TO_BUILD="PowerPC $TARGETS_TO_BUILD" ;; - Alpha) TARGETS_TO_BUILD="Alpha $TARGETS_TO_BUILD" ;; - ARM) TARGETS_TO_BUILD="ARM $TARGETS_TO_BUILD" ;; - Mips) TARGETS_TO_BUILD="Mips $TARGETS_TO_BUILD" ;; - MBlaze) TARGETS_TO_BUILD="MBlaze $TARGETS_TO_BUILD" ;; - CellSPU|SPU) TARGETS_TO_BUILD="CellSPU $TARGETS_TO_BUILD" ;; - PIC16) TARGETS_TO_BUILD="PIC16 $TARGETS_TO_BUILD" ;; - XCore) TARGETS_TO_BUILD="XCore $TARGETS_TO_BUILD" ;; - MSP430) TARGETS_TO_BUILD="MSP430 $TARGETS_TO_BUILD" ;; - s390x) TARGETS_TO_BUILD="SystemZ $TARGETS_TO_BUILD" ;; - Blackfin) TARGETS_TO_BUILD="Blackfin $TARGETS_TO_BUILD" ;; - *) { { echo "$as_me:$LINENO: error: Can not set target to build" >&5 -echo "$as_me: error: Can not set target to build" >&2;} - { (exit 1); exit 1; }; } ;; - esac ;; - *) { { echo "$as_me:$LINENO: error: Unrecognized target $a_target" >&5 -echo "$as_me: error: Unrecognized target $a_target" >&2;} - { (exit 1); exit 1; }; } ;; - esac - done - ;; -esac -TARGETS_TO_BUILD=$TARGETS_TO_BUILD - - -# Determine whether we are building LLVM support for the native architecture. -# If so, define LLVM_NATIVE_ARCH to that LLVM target. -for a_target in $TARGETS_TO_BUILD; do - if test "$a_target" = "$LLVM_NATIVE_ARCH"; then - -cat >>confdefs.h <<_ACEOF -#define LLVM_NATIVE_ARCH $LLVM_NATIVE_ARCH -_ACEOF - - LLVM_NATIVE_TARGET="LLVMInitialize${LLVM_NATIVE_ARCH}Target" - LLVM_NATIVE_TARGETINFO="LLVMInitialize${LLVM_NATIVE_ARCH}TargetInfo" - LLVM_NATIVE_ASMPRINTER="LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter" - -cat >>confdefs.h <<_ACEOF -#define LLVM_NATIVE_TARGET $LLVM_NATIVE_TARGET -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define LLVM_NATIVE_TARGETINFO $LLVM_NATIVE_TARGETINFO -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define LLVM_NATIVE_ASMPRINTER $LLVM_NATIVE_ASMPRINTER -_ACEOF - - fi -done - -# Build the LLVM_TARGET and LLVM_... macros for Targets.def and the individual -# target feature def files. -LLVM_ENUM_TARGETS="" -LLVM_ENUM_ASM_PRINTERS="" -LLVM_ENUM_ASM_PARSERS="" -LLVM_ENUM_DISASSEMBLERS="" -for target_to_build in $TARGETS_TO_BUILD; do - LLVM_ENUM_TARGETS="LLVM_TARGET($target_to_build) $LLVM_ENUM_TARGETS" - if test -f ${srcdir}/lib/Target/${target_to_build}/AsmPrinter/Makefile ; then - LLVM_ENUM_ASM_PRINTERS="LLVM_ASM_PRINTER($target_to_build) $LLVM_ENUM_ASM_PRINTERS"; - fi - if test -f ${srcdir}/lib/Target/${target_to_build}/AsmParser/Makefile ; then - LLVM_ENUM_ASM_PARSERS="LLVM_ASM_PARSER($target_to_build) $LLVM_ENUM_ASM_PARSERS"; - fi - if test -f ${srcdir}/lib/Target/${target_to_build}/Disassembler/Makefile ; then - LLVM_ENUM_DISASSEMBLERS="LLVM_DISASSEMBLER($target_to_build) $LLVM_ENUM_DISASSEMBLERS"; - fi -done - - - - - -# Check whether --enable-cbe-printf-a was given. -if test "${enable_cbe_printf_a+set}" = set; then - enableval=$enable_cbe_printf_a; -else - enableval=default -fi - -case "$enableval" in - yes) ENABLE_CBE_PRINTF_A=1 - ;; - no) ENABLE_CBE_PRINTF_A=0 - ;; - default) ENABLE_CBE_PRINTF_A=1 - ;; - *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-cbe-printf-a. Use \"yes\" or \"no\"" >&5 -echo "$as_me: error: Invalid setting for --enable-cbe-printf-a. Use \"yes\" or \"no\"" >&2;} - { (exit 1); exit 1; }; } ;; -esac - -cat >>confdefs.h <<_ACEOF -#define ENABLE_CBE_PRINTF_A $ENABLE_CBE_PRINTF_A -_ACEOF - - - -# Check whether --with-llvmgccdir was given. -if test "${with_llvmgccdir+set}" = set; then - withval=$with_llvmgccdir; -else - withval=default -fi - -case "$withval" in - default) WITH_LLVMGCCDIR=default ;; - /* | [A-Za-z]:[\\/]*) WITH_LLVMGCCDIR=$withval ;; - *) { { echo "$as_me:$LINENO: error: Invalid path for --with-llvmgccdir. Provide full path" >&5 -echo "$as_me: error: Invalid path for --with-llvmgccdir. Provide full path" >&2;} - { (exit 1); exit 1; }; } ;; -esac - - -# Check whether --with-llvmgcc was given. -if test "${with_llvmgcc+set}" = set; then - withval=$with_llvmgcc; LLVMGCC=$with_llvmgcc - WITH_LLVMGCCDIR="" -fi - - - -# Check whether --with-llvmgxx was given. -if test "${with_llvmgxx+set}" = set; then - withval=$with_llvmgxx; LLVMGXX=$with_llvmgxx - WITH_LLVMGCCDIR="" -fi - - -if test -n "$LLVMGCC"; then - LLVMGCCCOMMAND="$LLVMGCC" -fi - -if test -n "$LLVMGXX"; then - LLVMGXXCOMMAND="$LLVMGXX" -fi - -if test -n "$LLVMGCC" && test -z "$LLVMGXX"; then - { { echo "$as_me:$LINENO: error: Invalid llvm-g++. Use --with-llvmgxx when --with-llvmgcc is used" >&5 -echo "$as_me: error: Invalid llvm-g++. Use --with-llvmgxx when --with-llvmgcc is used" >&2;} - { (exit 1); exit 1; }; }; -fi - -if test -n "$LLVMGXX" && test -z "$LLVMGCC"; then - { { echo "$as_me:$LINENO: error: Invalid llvm-gcc. Use --with-llvmgcc when --with-llvmgxx is used" >&5 -echo "$as_me: error: Invalid llvm-gcc. Use --with-llvmgcc when --with-llvmgxx is used" >&2;} - { (exit 1); exit 1; }; }; -fi - - -# Check whether --with-clang was given. -if test "${with_clang+set}" = set; then - withval=$with_clang; -else - with_clang=default -fi - - - -# Check whether --with-built-clang was given. -if test "${with_built_clang+set}" = set; then - withval=$with_built_clang; -else - with_built_clang=check -fi - - -{ echo "$as_me:$LINENO: checking clang compiler" >&5 -echo $ECHO_N "checking clang compiler... $ECHO_C" >&6; } -WITH_CLANGPATH="" -WITH_BUILT_CLANG=0 -if test "$with_clang" != "default"; then - WITH_CLANGPATH="$with_clang" - if ! test -x "$WITH_CLANGPATH"; then - { { echo "$as_me:$LINENO: error: invalid --with-clang, path does not specify an executable" >&5 -echo "$as_me: error: invalid --with-clang, path does not specify an executable" >&2;} - { (exit 1); exit 1; }; } - fi -elif test "$with_built_clang" = "yes"; then - WITH_BUILT_CLANG=1 -elif test "$with_built_clang" = "no"; then - WITH_BUILT_CLANG=0 -else - if test "$with_built_clang" != "check"; then - { { echo "$as_me:$LINENO: error: invalid value for --with-built-clang." >&5 -echo "$as_me: error: invalid value for --with-built-clang." >&2;} - { (exit 1); exit 1; }; } - fi - - if test -f ${srcdir}/tools/clang/README.txt; then - WITH_BUILT_CLANG=1 - fi -fi - -if ! test -z "$WITH_CLANGPATH"; then - { echo "$as_me:$LINENO: result: $WITH_CLANGPATH" >&5 -echo "${ECHO_T}$WITH_CLANGPATH" >&6; } - WITH_CLANGXXPATH=`"$WITH_CLANGPATH" --print-prog-name=clang++` -elif test "$WITH_BUILT_CLANG" = "1"; then - { echo "$as_me:$LINENO: result: built" >&5 -echo "${ECHO_T}built" >&6; } -else - { echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6; } -fi -CLANGPATH=$WITH_CLANGPATH - -CLANGXXPATH=$WITH_CLANGXXPATH - -ENABLE_BUILT_CLANG=$WITH_BUILT_CLANG - - - -# Check whether --with-optimize-option was given. -if test "${with_optimize_option+set}" = set; then - withval=$with_optimize_option; -else - withval=default -fi - -{ echo "$as_me:$LINENO: checking optimization flags" >&5 -echo $ECHO_N "checking optimization flags... $ECHO_C" >&6; } -case "$withval" in - default) - case "$llvm_cv_os_type" in - FreeBSD) optimize_option=-O2 ;; - MingW) optimize_option=-O2 ;; - *) optimize_option=-O3 ;; - esac ;; - *) optimize_option="$withval" ;; -esac -OPTIMIZE_OPTION=$optimize_option - -{ echo "$as_me:$LINENO: result: $optimize_option" >&5 -echo "${ECHO_T}$optimize_option" >&6; } - - -# Check whether --with-extra-options was given. -if test "${with_extra_options+set}" = set; then - withval=$with_extra_options; -else - withval=default -fi - -case "$withval" in - default) EXTRA_OPTIONS= ;; - *) EXTRA_OPTIONS=$withval ;; -esac -EXTRA_OPTIONS=$EXTRA_OPTIONS - - -# Check whether --enable-bindings was given. -if test "${enable_bindings+set}" = set; then - enableval=$enable_bindings; -else - enableval=default -fi - -BINDINGS_TO_BUILD="" -case "$enableval" in - yes | default | auto) BINDINGS_TO_BUILD="auto" ;; - all ) BINDINGS_TO_BUILD="ocaml" ;; - none | no) BINDINGS_TO_BUILD="" ;; - *)for a_binding in `echo $enableval|sed -e 's/,/ /g' ` ; do - case "$a_binding" in - ocaml) BINDINGS_TO_BUILD="ocaml $BINDINGS_TO_BUILD" ;; - *) { { echo "$as_me:$LINENO: error: Unrecognized binding $a_binding" >&5 -echo "$as_me: error: Unrecognized binding $a_binding" >&2;} - { (exit 1); exit 1; }; } ;; - esac - done - ;; -esac - - -# Check whether --with-ocaml-libdir was given. -if test "${with_ocaml_libdir+set}" = set; then - withval=$with_ocaml_libdir; -else - withval=auto -fi - -case "$withval" in - auto) with_ocaml_libdir="$withval" ;; - /* | [A-Za-z]:[\\/]*) with_ocaml_libdir="$withval" ;; - *) { { echo "$as_me:$LINENO: error: Invalid path for --with-ocaml-libdir. Provide full path" >&5 -echo "$as_me: error: Invalid path for --with-ocaml-libdir. Provide full path" >&2;} - { (exit 1); exit 1; }; } ;; -esac - - -# Check whether --with-c-include-dirs was given. -if test "${with_c_include_dirs+set}" = set; then - withval=$with_c_include_dirs; -else - withval="" -fi - - -cat >>confdefs.h <<_ACEOF -#define C_INCLUDE_DIRS "$withval" -_ACEOF - - - -# Check whether --with-cxx-include-root was given. -if test "${with_cxx_include_root+set}" = set; then - withval=$with_cxx_include_root; -else - withval="" -fi - - -cat >>confdefs.h <<_ACEOF -#define CXX_INCLUDE_ROOT "$withval" -_ACEOF - - - -# Check whether --with-cxx-include-arch was given. -if test "${with_cxx_include_arch+set}" = set; then - withval=$with_cxx_include_arch; -else - withval="" -fi - - -cat >>confdefs.h <<_ACEOF -#define CXX_INCLUDE_ARCH "$withval" -_ACEOF - - - -# Check whether --with-cxx-include-32bit-dir was given. -if test "${with_cxx_include_32bit_dir+set}" = set; then - withval=$with_cxx_include_32bit_dir; -else - withval="" -fi - - -cat >>confdefs.h <<_ACEOF -#define CXX_INCLUDE_32BIT_DIR "$withval" -_ACEOF - - - -# Check whether --with-cxx-include-64bit-dir was given. -if test "${with_cxx_include_64bit_dir+set}" = set; then - withval=$with_cxx_include_64bit_dir; -else - withval="" -fi - - -cat >>confdefs.h <<_ACEOF -#define CXX_INCLUDE_64BIT_DIR "$withval" -_ACEOF - - - -# Check whether --with-binutils-include was given. -if test "${with_binutils_include+set}" = set; then - withval=$with_binutils_include; -else - withval=default -fi - -case "$withval" in - default) WITH_BINUTILS_INCDIR=default ;; - /* | [A-Za-z]:[\\/]*) WITH_BINUTILS_INCDIR=$withval ;; - *) { { echo "$as_me:$LINENO: error: Invalid path for --with-binutils-include. Provide full path" >&5 -echo "$as_me: error: Invalid path for --with-binutils-include. Provide full path" >&2;} - { (exit 1); exit 1; }; } ;; -esac -if test "x$WITH_BINUTILS_INCDIR" != xdefault ; then - BINUTILS_INCDIR=$WITH_BINUTILS_INCDIR - - if test ! -f "$WITH_BINUTILS_INCDIR/plugin-api.h"; then - echo "$WITH_BINUTILS_INCDIR/plugin-api.h" - { { echo "$as_me:$LINENO: error: Invalid path to directory containing plugin-api.h." >&5 -echo "$as_me: error: Invalid path to directory containing plugin-api.h." >&2;} - { (exit 1); exit 1; }; }; - fi -fi - -# Check whether --enable-libffi was given. -if test "${enable_libffi+set}" = set; then - enableval=$enable_libffi; case "$enableval" in - yes) llvm_cv_enable_libffi="yes" ;; - no) llvm_cv_enable_libffi="no" ;; - *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-libffi. Use \"yes\" or \"no\"" >&5 -echo "$as_me: error: Invalid setting for --enable-libffi. Use \"yes\" or \"no\"" >&2;} - { (exit 1); exit 1; }; } ;; - esac -else - llvm_cv_enable_libffi=no -fi - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in gcc - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in gcc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_c89=$ac_arg -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; - xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; -esac - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$CXX" && break - done -fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in g++ -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 -echo "${ECHO_T}$ac_ct_CXX" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$ac_ct_CXX" && break -done - - if test "x$ac_ct_CXX" = x; then - CXX="g++" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CXX=$ac_ct_CXX - fi -fi - - fi -fi -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C++ compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } -GXX=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 -echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_cxx_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cxx_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CXXFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cxx_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag -fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 -echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; } -if test "${lt_cv_path_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS="$lt_save_ifs" - done - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi -fi -{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 -echo "${ECHO_T}$lt_cv_path_NM" >&6; } -NM="$lt_cv_path_NM" - - - -{ echo "$as_me:$LINENO: checking for GNU make" >&5 -echo $ECHO_N "checking for GNU make... $ECHO_C" >&6; } -if test "${llvm_cv_gnu_make_command+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - 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 -fi -{ echo "$as_me:$LINENO: result: $llvm_cv_gnu_make_command" >&5 -echo "${ECHO_T}$llvm_cv_gnu_make_command" >&6; } - if test "x$llvm_cv_gnu_make_command" != "x" ; then - ifGNUmake='' ; - else - ifGNUmake='#' ; - { echo "$as_me:$LINENO: result: \"Not found\"" >&5 -echo "${ECHO_T}\"Not found\"" >&6; }; - fi - - -{ echo "$as_me:$LINENO: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else - { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6; } -fi - -# Extract the first word of "cmp", so it can be a program name with args. -set dummy cmp; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_CMP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $CMP in - [\\/]* | ?:[\\/]*) - ac_cv_path_CMP="$CMP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_CMP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_CMP" && ac_cv_path_CMP="cmp" - ;; -esac -fi -CMP=$ac_cv_path_CMP -if test -n "$CMP"; then - { echo "$as_me:$LINENO: result: $CMP" >&5 -echo "${ECHO_T}$CMP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "cp", so it can be a program name with args. -set dummy cp; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_CP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $CP in - [\\/]* | ?:[\\/]*) - ac_cv_path_CP="$CP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_CP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_CP" && ac_cv_path_CP="cp" - ;; -esac -fi -CP=$ac_cv_path_CP -if test -n "$CP"; then - { echo "$as_me:$LINENO: result: $CP" >&5 -echo "${ECHO_T}$CP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "date", so it can be a program name with args. -set dummy date; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_DATE+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $DATE in - [\\/]* | ?:[\\/]*) - ac_cv_path_DATE="$DATE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_DATE="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_DATE" && ac_cv_path_DATE="date" - ;; -esac -fi -DATE=$ac_cv_path_DATE -if test -n "$DATE"; then - { echo "$as_me:$LINENO: result: $DATE" >&5 -echo "${ECHO_T}$DATE" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "find", so it can be a program name with args. -set dummy find; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_FIND+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $FIND in - [\\/]* | ?:[\\/]*) - ac_cv_path_FIND="$FIND" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_FIND="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_FIND" && ac_cv_path_FIND="find" - ;; -esac -fi -FIND=$ac_cv_path_FIND -if test -n "$FIND"; then - { echo "$as_me:$LINENO: result: $FIND" >&5 -echo "${ECHO_T}$FIND" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "grep", so it can be a program name with args. -set dummy grep; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $GREP in - [\\/]* | ?:[\\/]*) - ac_cv_path_GREP="$GREP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_GREP" && ac_cv_path_GREP="grep" - ;; -esac -fi -GREP=$ac_cv_path_GREP -if test -n "$GREP"; then - { echo "$as_me:$LINENO: result: $GREP" >&5 -echo "${ECHO_T}$GREP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "mkdir", so it can be a program name with args. -set dummy mkdir; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_MKDIR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $MKDIR in - [\\/]* | ?:[\\/]*) - ac_cv_path_MKDIR="$MKDIR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_MKDIR="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_MKDIR" && ac_cv_path_MKDIR="mkdir" - ;; -esac -fi -MKDIR=$ac_cv_path_MKDIR -if test -n "$MKDIR"; then - { echo "$as_me:$LINENO: result: $MKDIR" >&5 -echo "${ECHO_T}$MKDIR" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "mv", so it can be a program name with args. -set dummy mv; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_MV+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $MV in - [\\/]* | ?:[\\/]*) - ac_cv_path_MV="$MV" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_MV" && ac_cv_path_MV="mv" - ;; -esac -fi -MV=$ac_cv_path_MV -if test -n "$MV"; then - { echo "$as_me:$LINENO: result: $MV" >&5 -echo "${ECHO_T}$MV" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="${ac_tool_prefix}ar" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_AR"; then - ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AR="ar" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 -echo "${ECHO_T}$ac_ct_AR" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_AR" = x; then - AR="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -else - AR="$ac_cv_prog_AR" -fi - -# Extract the first word of "rm", so it can be a program name with args. -set dummy rm; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_RM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $RM in - [\\/]* | ?:[\\/]*) - ac_cv_path_RM="$RM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_RM" && ac_cv_path_RM="rm" - ;; -esac -fi -RM=$ac_cv_path_RM -if test -n "$RM"; then - { echo "$as_me:$LINENO: result: $RM" >&5 -echo "${ECHO_T}$RM" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "sed", so it can be a program name with args. -set dummy sed; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_SED+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $SED in - [\\/]* | ?:[\\/]*) - ac_cv_path_SED="$SED" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_SED" && ac_cv_path_SED="sed" - ;; -esac -fi -SED=$ac_cv_path_SED -if test -n "$SED"; then - { echo "$as_me:$LINENO: result: $SED" >&5 -echo "${ECHO_T}$SED" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "tar", so it can be a program name with args. -set dummy tar; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_TAR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $TAR in - [\\/]* | ?:[\\/]*) - ac_cv_path_TAR="$TAR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_TAR" && ac_cv_path_TAR="gtar" - ;; -esac -fi -TAR=$ac_cv_path_TAR -if test -n "$TAR"; then - { echo "$as_me:$LINENO: result: $TAR" >&5 -echo "${ECHO_T}$TAR" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "pwd", so it can be a program name with args. -set dummy pwd; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_BINPWD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $BINPWD in - [\\/]* | ?:[\\/]*) - ac_cv_path_BINPWD="$BINPWD" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_BINPWD="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_BINPWD" && ac_cv_path_BINPWD="pwd" - ;; -esac -fi -BINPWD=$ac_cv_path_BINPWD -if test -n "$BINPWD"; then - { echo "$as_me:$LINENO: result: $BINPWD" >&5 -echo "${ECHO_T}$BINPWD" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - -# Extract the first word of "Graphviz", so it can be a program name with args. -set dummy Graphviz; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_GRAPHVIZ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $GRAPHVIZ in - [\\/]* | ?:[\\/]*) - ac_cv_path_GRAPHVIZ="$GRAPHVIZ" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_GRAPHVIZ="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_GRAPHVIZ" && ac_cv_path_GRAPHVIZ="echo Graphviz" - ;; -esac -fi -GRAPHVIZ=$ac_cv_path_GRAPHVIZ -if test -n "$GRAPHVIZ"; then - { echo "$as_me:$LINENO: result: $GRAPHVIZ" >&5 -echo "${ECHO_T}$GRAPHVIZ" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -if test "$GRAPHVIZ" != "echo Graphviz" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_GRAPHVIZ 1 -_ACEOF - - if test "$llvm_cv_os_type" = "MingW" ; then - GRAPHVIZ=`echo $GRAPHVIZ | sed 's/^\/\([A-Za-z]\)\//\1:\//' ` - fi - -cat >>confdefs.h <<_ACEOF -#define LLVM_PATH_GRAPHVIZ "$GRAPHVIZ${EXEEXT}" -_ACEOF - -fi -# Extract the first word of "dot", so it can be a program name with args. -set dummy dot; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_DOT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $DOT in - [\\/]* | ?:[\\/]*) - ac_cv_path_DOT="$DOT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_DOT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_DOT" && ac_cv_path_DOT="echo dot" - ;; -esac -fi -DOT=$ac_cv_path_DOT -if test -n "$DOT"; then - { echo "$as_me:$LINENO: result: $DOT" >&5 -echo "${ECHO_T}$DOT" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -if test "$DOT" != "echo dot" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DOT 1 -_ACEOF - - if test "$llvm_cv_os_type" = "MingW" ; then - DOT=`echo $DOT | sed 's/^\/\([A-Za-z]\)\//\1:\//' ` - fi - -cat >>confdefs.h <<_ACEOF -#define LLVM_PATH_DOT "$DOT${EXEEXT}" -_ACEOF - -fi -# Extract the first word of "fdp", so it can be a program name with args. -set dummy fdp; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_FDP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $FDP in - [\\/]* | ?:[\\/]*) - ac_cv_path_FDP="$FDP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_FDP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_FDP" && ac_cv_path_FDP="echo fdp" - ;; -esac -fi -FDP=$ac_cv_path_FDP -if test -n "$FDP"; then - { echo "$as_me:$LINENO: result: $FDP" >&5 -echo "${ECHO_T}$FDP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -if test "$FDP" != "echo fdp" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_FDP 1 -_ACEOF - - if test "$llvm_cv_os_type" = "MingW" ; then - FDP=`echo $FDP | sed 's/^\/\([A-Za-z]\)\//\1:\//' ` - fi - -cat >>confdefs.h <<_ACEOF -#define LLVM_PATH_FDP "$FDP${EXEEXT}" -_ACEOF - -fi -# Extract the first word of "neato", so it can be a program name with args. -set dummy neato; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_NEATO+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $NEATO in - [\\/]* | ?:[\\/]*) - ac_cv_path_NEATO="$NEATO" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_NEATO="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_NEATO" && ac_cv_path_NEATO="echo neato" - ;; -esac -fi -NEATO=$ac_cv_path_NEATO -if test -n "$NEATO"; then - { echo "$as_me:$LINENO: result: $NEATO" >&5 -echo "${ECHO_T}$NEATO" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -if test "$NEATO" != "echo neato" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_NEATO 1 -_ACEOF - - if test "$llvm_cv_os_type" = "MingW" ; then - NEATO=`echo $NEATO | sed 's/^\/\([A-Za-z]\)\//\1:\//' ` - fi - -cat >>confdefs.h <<_ACEOF -#define LLVM_PATH_NEATO "$NEATO${EXEEXT}" -_ACEOF - -fi -# Extract the first word of "twopi", so it can be a program name with args. -set dummy twopi; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_TWOPI+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $TWOPI in - [\\/]* | ?:[\\/]*) - ac_cv_path_TWOPI="$TWOPI" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_TWOPI="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_TWOPI" && ac_cv_path_TWOPI="echo twopi" - ;; -esac -fi -TWOPI=$ac_cv_path_TWOPI -if test -n "$TWOPI"; then - { echo "$as_me:$LINENO: result: $TWOPI" >&5 -echo "${ECHO_T}$TWOPI" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -if test "$TWOPI" != "echo twopi" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_TWOPI 1 -_ACEOF - - if test "$llvm_cv_os_type" = "MingW" ; then - TWOPI=`echo $TWOPI | sed 's/^\/\([A-Za-z]\)\//\1:\//' ` - fi - -cat >>confdefs.h <<_ACEOF -#define LLVM_PATH_TWOPI "$TWOPI${EXEEXT}" -_ACEOF - -fi -# Extract the first word of "circo", so it can be a program name with args. -set dummy circo; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_CIRCO+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $CIRCO in - [\\/]* | ?:[\\/]*) - ac_cv_path_CIRCO="$CIRCO" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_CIRCO="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_CIRCO" && ac_cv_path_CIRCO="echo circo" - ;; -esac -fi -CIRCO=$ac_cv_path_CIRCO -if test -n "$CIRCO"; then - { echo "$as_me:$LINENO: result: $CIRCO" >&5 -echo "${ECHO_T}$CIRCO" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -if test "$CIRCO" != "echo circo" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_CIRCO 1 -_ACEOF - - if test "$llvm_cv_os_type" = "MingW" ; then - CIRCO=`echo $CIRCO | sed 's/^\/\([A-Za-z]\)\//\1:\//' ` - fi - -cat >>confdefs.h <<_ACEOF -#define LLVM_PATH_CIRCO "$CIRCO${EXEEXT}" -_ACEOF - -fi -for ac_prog in gv gsview32 -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_GV+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $GV in - [\\/]* | ?:[\\/]*) - ac_cv_path_GV="$GV" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_GV="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -GV=$ac_cv_path_GV -if test -n "$GV"; then - { echo "$as_me:$LINENO: result: $GV" >&5 -echo "${ECHO_T}$GV" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$GV" && break -done -test -n "$GV" || GV="echo gv" - -if test "$GV" != "echo gv" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_GV 1 -_ACEOF - - if test "$llvm_cv_os_type" = "MingW" ; then - GV=`echo $GV | sed 's/^\/\([A-Za-z]\)\//\1:\//' ` - fi - -cat >>confdefs.h <<_ACEOF -#define LLVM_PATH_GV "$GV${EXEEXT}" -_ACEOF - -fi -# Extract the first word of "dotty", so it can be a program name with args. -set dummy dotty; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_DOTTY+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $DOTTY in - [\\/]* | ?:[\\/]*) - ac_cv_path_DOTTY="$DOTTY" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_DOTTY="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_DOTTY" && ac_cv_path_DOTTY="echo dotty" - ;; -esac -fi -DOTTY=$ac_cv_path_DOTTY -if test -n "$DOTTY"; then - { echo "$as_me:$LINENO: result: $DOTTY" >&5 -echo "${ECHO_T}$DOTTY" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -if test "$DOTTY" != "echo dotty" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DOTTY 1 -_ACEOF - - if test "$llvm_cv_os_type" = "MingW" ; then - DOTTY=`echo $DOTTY | sed 's/^\/\([A-Za-z]\)\//\1:\//' ` - fi - -cat >>confdefs.h <<_ACEOF -#define LLVM_PATH_DOTTY "$DOTTY${EXEEXT}" -_ACEOF - -fi - - -# Extract the first word of "perl", so it can be a program name with args. -set dummy perl; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_PERL+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $PERL in - [\\/]* | ?:[\\/]*) - ac_cv_path_PERL="$PERL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="none" - ;; -esac -fi -PERL=$ac_cv_path_PERL -if test -n "$PERL"; then - { echo "$as_me:$LINENO: result: $PERL" >&5 -echo "${ECHO_T}$PERL" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -if test "$PERL" != "none"; then - { echo "$as_me:$LINENO: checking for Perl 5.006 or newer" >&5 -echo $ECHO_N "checking for Perl 5.006 or newer... $ECHO_C" >&6; } - if $PERL -e 'use 5.006;' 2>&1 > /dev/null; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - else - PERL=none - { echo "$as_me:$LINENO: result: not found" >&5 -echo "${ECHO_T}not found" >&6; } - fi -fi - - -if test x"$PERL" = xnone; then - HAVE_PERL=0 - - { { echo "$as_me:$LINENO: error: perl is required but was not found, please install it" >&5 -echo "$as_me: error: perl is required but was not found, please install it" >&2;} - { (exit 1); exit 1; }; } -else - HAVE_PERL=1 - -fi - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; }; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done -IFS=$as_save_IFS - - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -case "$INSTALL" in - [\\/$]* | ?:[\\/]* ) ;; - *) INSTALL="\\\$(TOPSRCDIR)/$INSTALL" ;; -esac - -# Extract the first word of "bzip2", so it can be a program name with args. -set dummy bzip2; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_BZIP2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $BZIP2 in - [\\/]* | ?:[\\/]*) - ac_cv_path_BZIP2="$BZIP2" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_BZIP2="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -BZIP2=$ac_cv_path_BZIP2 -if test -n "$BZIP2"; then - { echo "$as_me:$LINENO: result: $BZIP2" >&5 -echo "${ECHO_T}$BZIP2" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "cat", so it can be a program name with args. -set dummy cat; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_CAT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $CAT in - [\\/]* | ?:[\\/]*) - ac_cv_path_CAT="$CAT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_CAT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -CAT=$ac_cv_path_CAT -if test -n "$CAT"; then - { echo "$as_me:$LINENO: result: $CAT" >&5 -echo "${ECHO_T}$CAT" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "doxygen", so it can be a program name with args. -set dummy doxygen; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_DOXYGEN+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $DOXYGEN in - [\\/]* | ?:[\\/]*) - ac_cv_path_DOXYGEN="$DOXYGEN" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_DOXYGEN="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -DOXYGEN=$ac_cv_path_DOXYGEN -if test -n "$DOXYGEN"; then - { echo "$as_me:$LINENO: result: $DOXYGEN" >&5 -echo "${ECHO_T}$DOXYGEN" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "groff", so it can be a program name with args. -set dummy groff; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_GROFF+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $GROFF in - [\\/]* | ?:[\\/]*) - ac_cv_path_GROFF="$GROFF" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_GROFF="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -GROFF=$ac_cv_path_GROFF -if test -n "$GROFF"; then - { echo "$as_me:$LINENO: result: $GROFF" >&5 -echo "${ECHO_T}$GROFF" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "gzip", so it can be a program name with args. -set dummy gzip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_GZIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $GZIP in - [\\/]* | ?:[\\/]*) - ac_cv_path_GZIP="$GZIP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_GZIP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -GZIP=$ac_cv_path_GZIP -if test -n "$GZIP"; then - { echo "$as_me:$LINENO: result: $GZIP" >&5 -echo "${ECHO_T}$GZIP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "pod2html", so it can be a program name with args. -set dummy pod2html; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_POD2HTML+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $POD2HTML in - [\\/]* | ?:[\\/]*) - ac_cv_path_POD2HTML="$POD2HTML" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_POD2HTML="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -POD2HTML=$ac_cv_path_POD2HTML -if test -n "$POD2HTML"; then - { echo "$as_me:$LINENO: result: $POD2HTML" >&5 -echo "${ECHO_T}$POD2HTML" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "pod2man", so it can be a program name with args. -set dummy pod2man; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_POD2MAN+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $POD2MAN in - [\\/]* | ?:[\\/]*) - ac_cv_path_POD2MAN="$POD2MAN" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_POD2MAN="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -POD2MAN=$ac_cv_path_POD2MAN -if test -n "$POD2MAN"; then - { echo "$as_me:$LINENO: result: $POD2MAN" >&5 -echo "${ECHO_T}$POD2MAN" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "pdfroff", so it can be a program name with args. -set dummy pdfroff; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_PDFROFF+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $PDFROFF in - [\\/]* | ?:[\\/]*) - ac_cv_path_PDFROFF="$PDFROFF" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PDFROFF="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -PDFROFF=$ac_cv_path_PDFROFF -if test -n "$PDFROFF"; then - { echo "$as_me:$LINENO: result: $PDFROFF" >&5 -echo "${ECHO_T}$PDFROFF" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "runtest", so it can be a program name with args. -set dummy runtest; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_RUNTEST+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $RUNTEST in - [\\/]* | ?:[\\/]*) - ac_cv_path_RUNTEST="$RUNTEST" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_RUNTEST="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -RUNTEST=$ac_cv_path_RUNTEST -if test -n "$RUNTEST"; then - { echo "$as_me:$LINENO: result: $RUNTEST" >&5 -echo "${ECHO_T}$RUNTEST" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - -no_itcl=true -{ echo "$as_me:$LINENO: checking for the tclsh program in tclinclude directory" >&5 -echo $ECHO_N "checking for the tclsh program in tclinclude directory... $ECHO_C" >&6; } - -# Check whether --with-tclinclude was given. -if test "${with_tclinclude+set}" = set; then - withval=$with_tclinclude; with_tclinclude=${withval} -else - with_tclinclude='' -fi - -if test "${ac_cv_path_tclsh+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - -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 - { { echo "$as_me:$LINENO: error: ${with_tclinclude} directory doesn't contain tclsh" >&5 -echo "$as_me: error: ${with_tclinclude} directory doesn't contain tclsh" >&2;} - { (exit 1); exit 1; }; } - fi -fi -fi - - -if test x"${ac_cv_path_tclsh}" = x ; then - { echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6; } - for ac_prog in 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 -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_TCLSH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $TCLSH in - [\\/]* | ?:[\\/]*) - ac_cv_path_TCLSH="$TCLSH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_TCLSH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -TCLSH=$ac_cv_path_TCLSH -if test -n "$TCLSH"; then - { echo "$as_me:$LINENO: result: $TCLSH" >&5 -echo "${ECHO_T}$TCLSH" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$TCLSH" && break -done - - if test x"${TCLSH}" = x ; then - ac_cv_path_tclsh=''; - else - ac_cv_path_tclsh="${TCLSH}"; - fi -else - { echo "$as_me:$LINENO: result: ${ac_cv_path_tclsh}" >&5 -echo "${ECHO_T}${ac_cv_path_tclsh}" >&6; } - TCLSH="${ac_cv_path_tclsh}" - -fi - -# Extract the first word of "zip", so it can be a program name with args. -set dummy zip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_ZIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $ZIP in - [\\/]* | ?:[\\/]*) - ac_cv_path_ZIP="$ZIP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_ZIP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -ZIP=$ac_cv_path_ZIP -if test -n "$ZIP"; then - { echo "$as_me:$LINENO: result: $ZIP" >&5 -echo "${ECHO_T}$ZIP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -for ac_prog in ocamlc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_OCAMLC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $OCAMLC in - [\\/]* | ?:[\\/]*) - ac_cv_path_OCAMLC="$OCAMLC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_OCAMLC="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -OCAMLC=$ac_cv_path_OCAMLC -if test -n "$OCAMLC"; then - { echo "$as_me:$LINENO: result: $OCAMLC" >&5 -echo "${ECHO_T}$OCAMLC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$OCAMLC" && break -done - -for ac_prog in ocamlopt -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_OCAMLOPT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $OCAMLOPT in - [\\/]* | ?:[\\/]*) - ac_cv_path_OCAMLOPT="$OCAMLOPT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_OCAMLOPT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -OCAMLOPT=$ac_cv_path_OCAMLOPT -if test -n "$OCAMLOPT"; then - { echo "$as_me:$LINENO: result: $OCAMLOPT" >&5 -echo "${ECHO_T}$OCAMLOPT" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$OCAMLOPT" && break -done - -for ac_prog in ocamldep -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_OCAMLDEP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $OCAMLDEP in - [\\/]* | ?:[\\/]*) - ac_cv_path_OCAMLDEP="$OCAMLDEP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_OCAMLDEP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -OCAMLDEP=$ac_cv_path_OCAMLDEP -if test -n "$OCAMLDEP"; then - { echo "$as_me:$LINENO: result: $OCAMLDEP" >&5 -echo "${ECHO_T}$OCAMLDEP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$OCAMLDEP" && break -done - -for ac_prog in ocamldoc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_OCAMLDOC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $OCAMLDOC in - [\\/]* | ?:[\\/]*) - ac_cv_path_OCAMLDOC="$OCAMLDOC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_OCAMLDOC="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -OCAMLDOC=$ac_cv_path_OCAMLDOC -if test -n "$OCAMLDOC"; then - { echo "$as_me:$LINENO: result: $OCAMLDOC" >&5 -echo "${ECHO_T}$OCAMLDOC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$OCAMLDOC" && break -done - -for ac_prog in gas as -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_GAS+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $GAS in - [\\/]* | ?:[\\/]*) - ac_cv_path_GAS="$GAS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_GAS="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -GAS=$ac_cv_path_GAS -if test -n "$GAS"; then - { echo "$as_me:$LINENO: result: $GAS" >&5 -echo "${ECHO_T}$GAS" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$GAS" && break -done - - -{ echo "$as_me:$LINENO: checking for linker version" >&5 -echo $ECHO_N "checking for linker version... $ECHO_C" >&6; } -if test "${llvm_cv_link_version+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - version_string="$(ld -v 2>&1 | head -1)" - - # Check for ld64. - if (echo "$version_string" | grep -q "ld64"); then - llvm_cv_link_version=$(echo "$version_string" | sed -e "s#.*ld64-\([^ ]*\)#\1#") - else - llvm_cv_link_version=$(echo "$version_string" | sed -e "s#[^0-9]*\([0-9.]*\).*#\1#") - fi - -fi -{ echo "$as_me:$LINENO: result: $llvm_cv_link_version" >&5 -echo "${ECHO_T}$llvm_cv_link_version" >&6; } - -cat >>confdefs.h <<_ACEOF -#define HOST_LINK_VERSION "$llvm_cv_link_version" -_ACEOF - - - -{ echo "$as_me:$LINENO: checking for compiler -Wl,-R option" >&5 -echo $ECHO_N "checking for compiler -Wl,-R option... $ECHO_C" >&6; } -if test "${llvm_cv_link_use_r+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - oldcflags="$CFLAGS" - CFLAGS="$CFLAGS -Wl,-R." - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - llvm_cv_link_use_r=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - llvm_cv_link_use_r=no -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS="$oldcflags" - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -fi -{ echo "$as_me:$LINENO: result: $llvm_cv_link_use_r" >&5 -echo "${ECHO_T}$llvm_cv_link_use_r" >&6; } -if test "$llvm_cv_link_use_r" = yes ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LINK_R 1 -_ACEOF - - fi - - -{ echo "$as_me:$LINENO: checking for compiler -Wl,-export-dynamic option" >&5 -echo $ECHO_N "checking for compiler -Wl,-export-dynamic option... $ECHO_C" >&6; } -if test "${llvm_cv_link_use_export_dynamic+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - oldcflags="$CFLAGS" - CFLAGS="$CFLAGS -Wl,-export-dynamic" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - llvm_cv_link_use_export_dynamic=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - llvm_cv_link_use_export_dynamic=no -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CFLAGS="$oldcflags" - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -fi -{ echo "$as_me:$LINENO: result: $llvm_cv_link_use_export_dynamic" >&5 -echo "${ECHO_T}$llvm_cv_link_use_export_dynamic" >&6; } -if test "$llvm_cv_link_use_export_dynamic" = yes ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LINK_EXPORT_DYNAMIC 1 -_ACEOF - - fi - - -{ echo "$as_me:$LINENO: checking for compiler -Wl,--version-script option" >&5 -echo $ECHO_N "checking for compiler -Wl,--version-script option... $ECHO_C" >&6; } -if test "${llvm_cv_link_use_version_script+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - 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 "{" > "$tmp/export.map" - echo " global: main;" >> "$tmp/export.map" - echo " local: *;" >> "$tmp/export.map" - echo "};" >> "$tmp/export.map" - - CFLAGS="$CFLAGS -Wl,--version-script=$tmp/export.map" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - llvm_cv_link_use_version_script=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - llvm_cv_link_use_version_script=no -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - rm "$tmp/export.map" - rmdir "$tmp" - CFLAGS="$oldcflags" - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -fi -{ echo "$as_me:$LINENO: result: $llvm_cv_link_use_version_script" >&5 -echo "${ECHO_T}$llvm_cv_link_use_version_script" >&6; } -if test "$llvm_cv_link_use_version_script" = yes ; then - HAVE_LINK_VERSION_SCRIPT=1 - - fi - - - - -{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } -if test "${ac_cv_c_const+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -/* FIXME: Include the comments suggested by Paul. */ -#ifndef __cplusplus - /* Ultrix mips cc rejects this. */ - typedef int charset[2]; - const charset x; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *ccp; - char **p; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - ccp = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++ccp; - p = (char**) ccp; - ccp = (char const *const *) p; - { /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; - if (s) return 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - if (!foo) return 0; - } - return !x[0] && !zero.x; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_const=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_c_const=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -echo "${ECHO_T}$ac_cv_c_const" >&6; } -if test $ac_cv_c_const = no; then - -cat >>confdefs.h <<\_ACEOF -#define const -_ACEOF - -fi - - - - - - -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 -echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include <$ac_hdr> - -int -main () -{ -if ((DIR *) 0) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 -_ACEOF - -ac_header_dirent=$ac_hdr; break -fi - -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then - { echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } -if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dir; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir=$ac_res -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then - : -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -else - { echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } -if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' x; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir=$ac_res -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then - : -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -fi - - -for ac_header in dlfcn.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------------- ## -## Report this to llvmbugs@cs.uiuc.edu ## -## ----------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -# Check whether --enable-ltdl-install was given. -if test "${enable_ltdl_install+set}" = set; then - enableval=$enable_ltdl_install; -fi - - - - -if test x"${enable_ltdl_install-no}" != xno; then - INSTALL_LTDL_TRUE= - INSTALL_LTDL_FALSE='#' -else - INSTALL_LTDL_TRUE='#' - INSTALL_LTDL_FALSE= -fi - - - -if test x"${enable_ltdl_convenience-no}" != xno; then - CONVENIENCE_LTDL_TRUE= - CONVENIENCE_LTDL_FALSE='#' -else - CONVENIENCE_LTDL_TRUE='#' - CONVENIENCE_LTDL_FALSE= -fi - - -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='.dylib' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[123]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -interix3*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - - -{ echo "$as_me:$LINENO: checking which extension is used for loadable modules" >&5 -echo $ECHO_N "checking which extension is used for loadable modules... $ECHO_C" >&6; } -if test "${libltdl_cv_shlibext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - -module=yes -eval libltdl_cv_shlibext=$shrext_cmds - -fi -{ echo "$as_me:$LINENO: result: $libltdl_cv_shlibext" >&5 -echo "${ECHO_T}$libltdl_cv_shlibext" >&6; } -if test -n "$libltdl_cv_shlibext"; then - -cat >>confdefs.h <<_ACEOF -#define LTDL_SHLIB_EXT "$libltdl_cv_shlibext" -_ACEOF - -fi - - -{ echo "$as_me:$LINENO: checking which variable specifies run-time library path" >&5 -echo $ECHO_N "checking which variable specifies run-time library path... $ECHO_C" >&6; } -if test "${libltdl_cv_shlibpath_var+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - libltdl_cv_shlibpath_var="$shlibpath_var" -fi -{ echo "$as_me:$LINENO: result: $libltdl_cv_shlibpath_var" >&5 -echo "${ECHO_T}$libltdl_cv_shlibpath_var" >&6; } -if test -n "$libltdl_cv_shlibpath_var"; then - -cat >>confdefs.h <<_ACEOF -#define LTDL_SHLIBPATH_VAR "$libltdl_cv_shlibpath_var" -_ACEOF - -fi - - -{ echo "$as_me:$LINENO: checking for the default library search path" >&5 -echo $ECHO_N "checking for the default library search path... $ECHO_C" >&6; } -if test "${libltdl_cv_sys_search_path+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec" -fi -{ echo "$as_me:$LINENO: result: $libltdl_cv_sys_search_path" >&5 -echo "${ECHO_T}$libltdl_cv_sys_search_path" >&6; } -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 - -cat >>confdefs.h <<_ACEOF -#define LTDL_SYSSEARCHPATH "$sys_search_path" -_ACEOF - -fi - -{ echo "$as_me:$LINENO: checking for objdir" >&5 -echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } -if test "${libltdl_cv_objdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - 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 - -fi -{ echo "$as_me:$LINENO: result: $libltdl_cv_objdir" >&5 -echo "${ECHO_T}$libltdl_cv_objdir" >&6; } - -cat >>confdefs.h <<_ACEOF -#define LTDL_OBJDIR "$libltdl_cv_objdir/" -_ACEOF - - - - - - -# Check for command to grab the raw symbol name followed by C symbol from nm. -{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 -echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } -if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32*) - symcode='[ABCDGISTW]' - ;; -hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[ABCDEGRST]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -linux*) - if test "$host_cpu" = ia64; then - symcode='[ABCDGIRSTW]' - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - fi - ;; -irix* | nonstopux*) - symcode='[BCDEGRST]' - ;; -osf*) - symcode='[BCDEGQRST]' - ;; -solaris*) - symcode='[BDRT]' - ;; -sco3.2v5*) - symcode='[DT]' - ;; -sysv4.2uw2*) - symcode='[DT]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[ABDT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGIRSTW]' ;; -esac - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 - (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if grep ' nm_test_var$' "$nlist" >/dev/null; then - if grep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[] = -{ -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -f conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done - -fi - -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6; } -else - { echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6; } -fi - - -{ echo "$as_me:$LINENO: checking whether libtool supports -dlopen/-dlpreopen" >&5 -echo $ECHO_N "checking whether libtool supports -dlopen/-dlpreopen... $ECHO_C" >&6; } -if test "${libltdl_cv_preloaded_symbols+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$lt_cv_sys_global_symbol_pipe"; then - libltdl_cv_preloaded_symbols=yes - else - libltdl_cv_preloaded_symbols=no - fi - -fi -{ echo "$as_me:$LINENO: result: $libltdl_cv_preloaded_symbols" >&5 -echo "${ECHO_T}$libltdl_cv_preloaded_symbols" >&6; } -if test x"$libltdl_cv_preloaded_symbols" = xyes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_PRELOADED_SYMBOLS 1 -_ACEOF - -fi - -LIBADD_DL= - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ echo "$as_me:$LINENO: checking for shl_load" >&5 -echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } -if test "${ac_cv_func_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define shl_load to an innocuous variant, in case declares shl_load. - For example, HP-UX 11i declares gettimeofday. */ -#define shl_load innocuous_shl_load - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef shl_load - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_shl_load || defined __stub___shl_load -choke me -#endif - -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_shl_load=no -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } -if test $ac_cv_func_shl_load = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_SHL_LOAD 1 -_ACEOF - -else - { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load (); -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dld_shl_load=no -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } -if test $ac_cv_lib_dld_shl_load = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_SHL_LOAD 1 -_ACEOF - - LIBADD_DL="$LIBADD_DL -ldld" -else - { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dl_dlopen=no -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LIBDL 1 -_ACEOF - - LIBADD_DL="-ldl" libltdl_cv_lib_dl_dlopen="yes" -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if HAVE_DLFCN_H -# include -#endif - -int -main () -{ -dlopen(0, 0); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LIBDL 1 -_ACEOF - libltdl_cv_func_dlopen="yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } -if test "${ac_cv_lib_svld_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_svld_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_svld_dlopen=no -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } -if test $ac_cv_lib_svld_dlopen = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LIBDL 1 -_ACEOF - - LIBADD_DL="-lsvld" libltdl_cv_func_dlopen="yes" -else - { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } -if test "${ac_cv_lib_dld_dld_link+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dld_link (); -int -main () -{ -return dld_link (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_dld_link=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_dld_dld_link=no -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } -if test $ac_cv_lib_dld_dld_link = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DLD 1 -_ACEOF - - LIBADD_DL="$LIBADD_DL -ldld" -else - { echo "$as_me:$LINENO: checking for _dyld_func_lookup" >&5 -echo $ECHO_N "checking for _dyld_func_lookup... $ECHO_C" >&6; } -if test "${ac_cv_func__dyld_func_lookup+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define _dyld_func_lookup to an innocuous variant, in case declares _dyld_func_lookup. - For example, HP-UX 11i declares gettimeofday. */ -#define _dyld_func_lookup innocuous__dyld_func_lookup - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char _dyld_func_lookup (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef _dyld_func_lookup - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char _dyld_func_lookup (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub__dyld_func_lookup || defined __stub____dyld_func_lookup -choke me -#endif - -int -main () -{ -return _dyld_func_lookup (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func__dyld_func_lookup=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func__dyld_func_lookup=no -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func__dyld_func_lookup" >&5 -echo "${ECHO_T}$ac_cv_func__dyld_func_lookup" >&6; } -if test $ac_cv_func__dyld_func_lookup = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DYLD 1 -_ACEOF - -fi - - -fi - - -fi - - -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi - - -fi - - -fi - - -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" - -for ac_func in dlerror -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - LIBS="$lt_save_LIBS" -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -{ echo "$as_me:$LINENO: checking for _ prefix in compiled symbols" >&5 -echo $ECHO_N "checking for _ prefix in compiled symbols... $ECHO_C" >&6; } -if test "${ac_cv_sys_symbol_underscore+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_sys_symbol_underscore=no - cat > conftest.$ac_ext <&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Now try to grab the symbols. - ac_nlist=conftest.nm - if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist\"") >&5 - (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && 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" >&5 - fi - fi - else - echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "configure: failed program was:" >&5 - cat conftest.c >&5 - fi - rm -rf conftest* - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_symbol_underscore" >&5 -echo "${ECHO_T}$ac_cv_sys_symbol_underscore" >&6; } - - -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 - { echo "$as_me:$LINENO: checking whether we have to add an underscore for dlsym" >&5 -echo $ECHO_N "checking whether we have to add an underscore for dlsym... $ECHO_C" >&6; } -if test "${libltdl_cv_need_uscore+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - libltdl_cv_need_uscore=unknown - save_LIBS="$LIBS" - LIBS="$LIBS $LIBADD_DL" - if test "$cross_compiling" = yes; then : - libltdl_cv_need_uscore=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - else - puts (dlerror ()); - - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) libltdl_cv_need_uscore=no ;; - x$lt_dlneed_uscore) libltdl_cv_need_uscore=yes ;; - x$lt_dlunknown|x*) ;; - esac - else : - # compilation failed - - fi -fi -rm -fr conftest* - - LIBS="$save_LIBS" - -fi -{ echo "$as_me:$LINENO: result: $libltdl_cv_need_uscore" >&5 -echo "${ECHO_T}$libltdl_cv_need_uscore" >&6; } - fi -fi - -if test x"$libltdl_cv_need_uscore" = xyes; then - -cat >>confdefs.h <<\_ACEOF -#define NEED_USCORE 1 -_ACEOF - -fi - - -{ echo "$as_me:$LINENO: checking whether deplibs are loaded by dlopen" >&5 -echo $ECHO_N "checking whether deplibs are loaded by dlopen... $ECHO_C" >&6; } -if test "${libltdl_cv_sys_dlopen_deplibs+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # 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 - -fi -{ echo "$as_me:$LINENO: result: $libltdl_cv_sys_dlopen_deplibs" >&5 -echo "${ECHO_T}$libltdl_cv_sys_dlopen_deplibs" >&6; } -if test "$libltdl_cv_sys_dlopen_deplibs" != yes; then - -cat >>confdefs.h <<\_ACEOF -#define LTDL_DLOPEN_DEPLIBS 1 -_ACEOF - -fi - - -for ac_header in argz.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------------- ## -## Report this to llvmbugs@cs.uiuc.edu ## -## ----------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -{ echo "$as_me:$LINENO: checking for error_t" >&5 -echo $ECHO_N "checking for error_t... $ECHO_C" >&6; } -if test "${ac_cv_type_error_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if HAVE_ARGZ_H -# include -#endif - -typedef error_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_error_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_error_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_error_t" >&5 -echo "${ECHO_T}$ac_cv_type_error_t" >&6; } -if test $ac_cv_type_error_t = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_ERROR_T 1 -_ACEOF - - -else - -cat >>confdefs.h <<\_ACEOF -#define error_t int -_ACEOF - -fi - - - - - - - -for ac_func in argz_append argz_create_sep argz_insert argz_next argz_stringify -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - - - - - - - - - - - - - - - - - - - - - - - - - -for ac_header in assert.h ctype.h errno.h malloc.h memory.h stdlib.h \ - stdio.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------------- ## -## Report this to llvmbugs@cs.uiuc.edu ## -## ----------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - -for ac_header in dl.h sys/dl.h dld.h mach-o/dyld.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------------- ## -## Report this to llvmbugs@cs.uiuc.edu ## -## ----------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -for ac_header in string.h strings.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------------- ## -## Report this to llvmbugs@cs.uiuc.edu ## -## ----------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - break -fi - -done - - - - -for ac_func in strchr index -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - break -fi -done - - - -for ac_func in strrchr rindex -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - break -fi -done - - - -for ac_func in memcpy bcopy -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - break -fi -done - - - -for ac_func in memmove strcmp -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - -for ac_func in closedir opendir readdir -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - -if test "$WITH_LLVMGCCDIR" = "default" ; then - LLVMGCC="llvm-gcc${EXEEXT}" - LLVMGXX="llvm-g++${EXEEXT}" - LLVMGCCCOMMAND="$LLVMGCC" - LLVMGXXCOMMAND="$LLVMGXX" - LLVMGCCCOMMAND=$LLVMGCCCOMMAND - - LLVMGXXCOMMAND=$LLVMGXXCOMMAND - - # Extract the first word of "$LLVMGCC", so it can be a program name with args. -set dummy $LLVMGCC; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_LLVMGCC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $LLVMGCC in - [\\/]* | ?:[\\/]*) - ac_cv_path_LLVMGCC="$LLVMGCC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_LLVMGCC="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -LLVMGCC=$ac_cv_path_LLVMGCC -if test -n "$LLVMGCC"; then - { echo "$as_me:$LINENO: result: $LLVMGCC" >&5 -echo "${ECHO_T}$LLVMGCC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - # Extract the first word of "$LLVMGXX", so it can be a program name with args. -set dummy $LLVMGXX; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_LLVMGXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $LLVMGXX in - [\\/]* | ?:[\\/]*) - ac_cv_path_LLVMGXX="$LLVMGXX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_LLVMGXX="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -LLVMGXX=$ac_cv_path_LLVMGXX -if test -n "$LLVMGXX"; then - { echo "$as_me:$LINENO: result: $LLVMGXX" >&5 -echo "${ECHO_T}$LLVMGXX" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -else - if test -z "$LLVMGCC"; then - LLVMGCC="$WITH_LLVMGCCDIR/bin/llvm-gcc${EXEEXT}" - LLVMGCCCOMMAND="$LLVMGCC" - fi - if test -z "$LLVMGXX"; then - LLVMGXX="$WITH_LLVMGCCDIR/bin/llvm-g++${EXEEXT}" - LLVMGXXCOMMAND="$LLVMGXX" - fi - - LLVMGCC=$LLVMGCC - - LLVMGXX=$LLVMGXX - - LLVMGCCCOMMAND=$LLVMGCCCOMMAND - - LLVMGXXCOMMAND=$LLVMGXXCOMMAND - -fi - - -# Check whether --with-llvmcc was given. -if test "${with_llvmcc+set}" = set; then - withval=$with_llvmcc; -else - with_llvmcc=check -fi - -{ echo "$as_me:$LINENO: checking LLVM capable compiler" >&5 -echo $ECHO_N "checking LLVM capable compiler... $ECHO_C" >&6; } -if test "$with_llvmcc" != "check"; then - if (test "$with_llvmcc" != "llvm-gcc" && - test "$with_llvmcc" != "clang" && - test "$with_llvmcc" != "none"); then - { { echo "$as_me:$LINENO: error: invalid value for --with-llvmcc, expected 'llvm-gcc', 'clang', or 'none'." >&5 -echo "$as_me: error: invalid value for --with-llvmcc, expected 'llvm-gcc', 'clang', or 'none'." >&2;} - { (exit 1); exit 1; }; } - fi - WITH_LLVMCC="$with_llvmcc" -elif test -n "$LLVMGCC"; then - WITH_LLVMCC=llvm-gcc -elif test -n "$WITH_CLANGPATH" || test "$WITH_BUILT_CLANG" -ne "0"; then - WITH_LLVMCC=clang -else - WITH_LLVMCC=none -fi -{ echo "$as_me:$LINENO: result: $WITH_LLVMCC" >&5 -echo "${ECHO_T}$WITH_LLVMCC" >&6; } -LLVMCC_OPTION=$WITH_LLVMCC - - -{ echo "$as_me:$LINENO: checking tool compatibility" >&5 -echo $ECHO_N "checking tool compatibility... $ECHO_C" >&6; } - -ICC=no -IXX=no -case $CC in - icc*|icpc*) - ICC=yes - IXX=yes - ;; - *) - ;; -esac - -if test "$GCC" != "yes" && test "$ICC" != "yes" -then - { { echo "$as_me:$LINENO: error: gcc|icc required but not found" >&5 -echo "$as_me: error: gcc|icc required but not found" >&2;} - { (exit 1); exit 1; }; } -fi - -if test "$GXX" != "yes" && test "$IXX" != "yes" -then - { { echo "$as_me:$LINENO: error: g++|icc required but not found" >&5 -echo "$as_me: error: g++|icc required but not found" >&2;} - { (exit 1); exit 1; }; } -fi - -if test "$GCC" = "yes" -then - cat >conftest.$ac_ext <<_ACEOF -#if !defined(__GNUC__) || __GNUC__ < 3 -#error Unsupported GCC version -#endif - -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - { { echo "$as_me:$LINENO: error: gcc 3.x required, but you have a lower version" >&5 -echo "$as_me: error: gcc 3.x required, but you have a lower version" >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -if test -z "$llvm_cv_gnu_make_command" -then - { { echo "$as_me:$LINENO: error: GNU Make required but not found" >&5 -echo "$as_me: error: GNU Make required but not found" >&2;} - { (exit 1); exit 1; }; } -fi - -{ echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6; } - -{ echo "$as_me:$LINENO: checking optional compiler flags" >&5 -echo $ECHO_N "checking optional compiler flags... $ECHO_C" >&6; } -NO_VARIADIC_MACROS=`$CXX -Wno-variadic-macros -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wno-variadic-macros` - -NO_MISSING_FIELD_INITIALIZERS=`$CXX -Wno-missing-field-initializers -fsyntax-only -xc /dev/null 2>/dev/null && echo -Wno-missing-field-initializers` - -{ echo "$as_me:$LINENO: result: $NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS" >&5 -echo "${ECHO_T}$NO_VARIADIC_MACROS $NO_MISSING_FIELD_INITIALIZERS" >&6; } - - - -{ echo "$as_me:$LINENO: checking for sin in -lm" >&5 -echo $ECHO_N "checking for sin in -lm... $ECHO_C" >&6; } -if test "${ac_cv_lib_m_sin+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char sin (); -int -main () -{ -return sin (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_m_sin=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_m_sin=no -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_sin" >&5 -echo "${ECHO_T}$ac_cv_lib_m_sin" >&6; } -if test $ac_cv_lib_m_sin = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBM 1 -_ACEOF - - LIBS="-lm $LIBS" - -fi - -if test "$llvm_cv_os_type" = "MingW" ; then - -{ echo "$as_me:$LINENO: checking for main in -limagehlp" >&5 -echo $ECHO_N "checking for main in -limagehlp... $ECHO_C" >&6; } -if test "${ac_cv_lib_imagehlp_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-limagehlp $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_imagehlp_main=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_imagehlp_main=no -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_imagehlp_main" >&5 -echo "${ECHO_T}$ac_cv_lib_imagehlp_main" >&6; } -if test $ac_cv_lib_imagehlp_main = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBIMAGEHLP 1 -_ACEOF - - LIBS="-limagehlp $LIBS" - -fi - - -{ echo "$as_me:$LINENO: checking for main in -lpsapi" >&5 -echo $ECHO_N "checking for main in -lpsapi... $ECHO_C" >&6; } -if test "${ac_cv_lib_psapi_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpsapi $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_psapi_main=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_psapi_main=no -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_psapi_main" >&5 -echo "${ECHO_T}$ac_cv_lib_psapi_main" >&6; } -if test $ac_cv_lib_psapi_main = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBPSAPI 1 -_ACEOF - - LIBS="-lpsapi $LIBS" - -fi - -fi - -{ echo "$as_me:$LINENO: checking for library containing dlopen" >&5 -echo $ECHO_N "checking for library containing dlopen... $ECHO_C" >&6; } -if test "${ac_cv_search_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dl; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_dlopen=$ac_res -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_dlopen+set}" = set; then - break -fi -done -if test "${ac_cv_search_dlopen+set}" = set; then - : -else - ac_cv_search_dlopen=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_dlopen" >&5 -echo "${ECHO_T}$ac_cv_search_dlopen" >&6; } -ac_res=$ac_cv_search_dlopen -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DLOPEN 1 -_ACEOF - -else - { echo "$as_me:$LINENO: WARNING: dlopen() not found - disabling plugin support" >&5 -echo "$as_me: WARNING: dlopen() not found - disabling plugin support" >&2;} -fi - - -if test "$llvm_cv_enable_libffi" = "yes" ; then - { echo "$as_me:$LINENO: checking for library containing ffi_call" >&5 -echo $ECHO_N "checking for library containing ffi_call... $ECHO_C" >&6; } -if test "${ac_cv_search_ffi_call+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char ffi_call (); -int -main () -{ -return ffi_call (); - ; - return 0; -} -_ACEOF -for ac_lib in '' ffi; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_ffi_call=$ac_res -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_ffi_call+set}" = set; then - break -fi -done -if test "${ac_cv_search_ffi_call+set}" = set; then - : -else - ac_cv_search_ffi_call=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_ffi_call" >&5 -echo "${ECHO_T}$ac_cv_search_ffi_call" >&6; } -ac_res=$ac_cv_search_ffi_call -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -cat >>confdefs.h <<\_ACEOF -#define HAVE_FFI_CALL 1 -_ACEOF - -else - { { echo "$as_me:$LINENO: error: libffi not found - configure without --enable-libffi to compile without it" >&5 -echo "$as_me: error: libffi not found - configure without --enable-libffi to compile without it" >&2;} - { (exit 1); exit 1; }; } -fi - -fi - -{ echo "$as_me:$LINENO: checking for library containing mallinfo" >&5 -echo $ECHO_N "checking for library containing mallinfo... $ECHO_C" >&6; } -if test "${ac_cv_search_mallinfo+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char mallinfo (); -int -main () -{ -return mallinfo (); - ; - return 0; -} -_ACEOF -for ac_lib in '' malloc; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_mallinfo=$ac_res -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_mallinfo+set}" = set; then - break -fi -done -if test "${ac_cv_search_mallinfo+set}" = set; then - : -else - ac_cv_search_mallinfo=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_mallinfo" >&5 -echo "${ECHO_T}$ac_cv_search_mallinfo" >&6; } -ac_res=$ac_cv_search_mallinfo -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MALLINFO 1 -_ACEOF - -fi - - -if test "$ENABLE_THREADS" -eq 1 ; then - -{ echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 -echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6; } -if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pthread_mutex_init (); -int -main () -{ -return pthread_mutex_init (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_pthread_pthread_mutex_init=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_pthread_pthread_mutex_init=no -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6; } -if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBPTHREAD 1 -_ACEOF - - LIBS="-lpthread $LIBS" - -fi - - { echo "$as_me:$LINENO: checking for library containing pthread_mutex_lock" >&5 -echo $ECHO_N "checking for library containing pthread_mutex_lock... $ECHO_C" >&6; } -if test "${ac_cv_search_pthread_mutex_lock+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pthread_mutex_lock (); -int -main () -{ -return pthread_mutex_lock (); - ; - return 0; -} -_ACEOF -for ac_lib in '' pthread; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_pthread_mutex_lock=$ac_res -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_pthread_mutex_lock+set}" = set; then - break -fi -done -if test "${ac_cv_search_pthread_mutex_lock+set}" = set; then - : -else - ac_cv_search_pthread_mutex_lock=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_pthread_mutex_lock" >&5 -echo "${ECHO_T}$ac_cv_search_pthread_mutex_lock" >&6; } -ac_res=$ac_cv_search_pthread_mutex_lock -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -cat >>confdefs.h <<\_ACEOF -#define HAVE_PTHREAD_MUTEX_LOCK 1 -_ACEOF - -fi - - { echo "$as_me:$LINENO: checking for library containing pthread_rwlock_init" >&5 -echo $ECHO_N "checking for library containing pthread_rwlock_init... $ECHO_C" >&6; } -if test "${ac_cv_search_pthread_rwlock_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pthread_rwlock_init (); -int -main () -{ -return pthread_rwlock_init (); - ; - return 0; -} -_ACEOF -for ac_lib in '' pthread; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_pthread_rwlock_init=$ac_res -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_pthread_rwlock_init+set}" = set; then - break -fi -done -if test "${ac_cv_search_pthread_rwlock_init+set}" = set; then - : -else - ac_cv_search_pthread_rwlock_init=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_pthread_rwlock_init" >&5 -echo "${ECHO_T}$ac_cv_search_pthread_rwlock_init" >&6; } -ac_res=$ac_cv_search_pthread_rwlock_init -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -cat >>confdefs.h <<\_ACEOF -#define HAVE_PTHREAD_RWLOCK_INIT 1 -_ACEOF - -fi - - { echo "$as_me:$LINENO: checking for library containing pthread_getspecific" >&5 -echo $ECHO_N "checking for library containing pthread_getspecific... $ECHO_C" >&6; } -if test "${ac_cv_search_pthread_getspecific+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pthread_getspecific (); -int -main () -{ -return pthread_getspecific (); - ; - return 0; -} -_ACEOF -for ac_lib in '' pthread; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_pthread_getspecific=$ac_res -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_pthread_getspecific+set}" = set; then - break -fi -done -if test "${ac_cv_search_pthread_getspecific+set}" = set; then - : -else - ac_cv_search_pthread_getspecific=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_pthread_getspecific" >&5 -echo "${ECHO_T}$ac_cv_search_pthread_getspecific" >&6; } -ac_res=$ac_cv_search_pthread_getspecific -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -cat >>confdefs.h <<\_ACEOF -#define HAVE_PTHREAD_GETSPECIFIC 1 -_ACEOF - -fi - -fi - - -# Check whether --with-udis86 was given. -if test "${with_udis86+set}" = set; then - withval=$with_udis86; - USE_UDIS86=1 - - case "$withval" in - /usr/lib|yes) ;; - *) LDFLAGS="$LDFLAGS -L${withval}" ;; - esac - -{ echo "$as_me:$LINENO: checking for ud_init in -ludis86" >&5 -echo $ECHO_N "checking for ud_init in -ludis86... $ECHO_C" >&6; } -if test "${ac_cv_lib_udis86_ud_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ludis86 $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char ud_init (); -int -main () -{ -return ud_init (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_udis86_ud_init=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_udis86_ud_init=no -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_udis86_ud_init" >&5 -echo "${ECHO_T}$ac_cv_lib_udis86_ud_init" >&6; } -if test $ac_cv_lib_udis86_ud_init = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBUDIS86 1 -_ACEOF - - LIBS="-ludis86 $LIBS" - -else - - echo "Error! You need to have libudis86 around." - exit -1 - -fi - - -else - USE_UDIS86=0 - -fi - - -cat >>confdefs.h <<_ACEOF -#define USE_UDIS86 $USE_UDIS86 -_ACEOF - - - -# Check whether --with-oprofile was given. -if test "${with_oprofile+set}" = set; then - withval=$with_oprofile; - USE_OPROFILE=1 - - case "$withval" in - /usr|yes) llvm_cv_oppath=/usr/lib/oprofile ;; - no) llvm_cv_oppath= - USE_OPROFILE=0 - ;; - *) llvm_cv_oppath="${withval}/lib/oprofile" - CPPFLAGS="-I${withval}/include";; - esac - if test -n "$llvm_cv_oppath" ; then - LIBS="$LIBS -L${llvm_cv_oppath} -Wl,-rpath,${llvm_cv_oppath}" - { echo "$as_me:$LINENO: checking for library containing bfd_init" >&5 -echo $ECHO_N "checking for library containing bfd_init... $ECHO_C" >&6; } -if test "${ac_cv_search_bfd_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char bfd_init (); -int -main () -{ -return bfd_init (); - ; - return 0; -} -_ACEOF -for ac_lib in '' bfd; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_bfd_init=$ac_res -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_bfd_init+set}" = set; then - break -fi -done -if test "${ac_cv_search_bfd_init+set}" = set; then - : -else - ac_cv_search_bfd_init=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_bfd_init" >&5 -echo "${ECHO_T}$ac_cv_search_bfd_init" >&6; } -ac_res=$ac_cv_search_bfd_init -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - - { echo "$as_me:$LINENO: checking for library containing op_open_agent" >&5 -echo $ECHO_N "checking for library containing op_open_agent... $ECHO_C" >&6; } -if test "${ac_cv_search_op_open_agent+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char op_open_agent (); -int -main () -{ -return op_open_agent (); - ; - return 0; -} -_ACEOF -for ac_lib in '' opagent; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_op_open_agent=$ac_res -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_op_open_agent+set}" = set; then - break -fi -done -if test "${ac_cv_search_op_open_agent+set}" = set; then - : -else - ac_cv_search_op_open_agent=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_op_open_agent" >&5 -echo "${ECHO_T}$ac_cv_search_op_open_agent" >&6; } -ac_res=$ac_cv_search_op_open_agent -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -else - - echo "Error! You need to have libopagent around." - exit -1 - -fi - - if test "${ac_cv_header_opagent_h+set}" = set; then - { echo "$as_me:$LINENO: checking for opagent.h" >&5 -echo $ECHO_N "checking for opagent.h... $ECHO_C" >&6; } -if test "${ac_cv_header_opagent_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_opagent_h" >&5 -echo "${ECHO_T}$ac_cv_header_opagent_h" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking opagent.h usability" >&5 -echo $ECHO_N "checking opagent.h usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking opagent.h presence" >&5 -echo $ECHO_N "checking opagent.h presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: opagent.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: opagent.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: opagent.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: opagent.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: opagent.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: opagent.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: opagent.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: opagent.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: opagent.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: opagent.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: opagent.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: opagent.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: opagent.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: opagent.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: opagent.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: opagent.h: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------------- ## -## Report this to llvmbugs@cs.uiuc.edu ## -## ----------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for opagent.h" >&5 -echo $ECHO_N "checking for opagent.h... $ECHO_C" >&6; } -if test "${ac_cv_header_opagent_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_opagent_h=$ac_header_preproc -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_opagent_h" >&5 -echo "${ECHO_T}$ac_cv_header_opagent_h" >&6; } - -fi -if test $ac_cv_header_opagent_h = yes; then - : -else - - echo "Error! You need to have opagent.h around." - exit -1 - -fi - - - fi - -else - - USE_OPROFILE=0 - - -fi - - -cat >>confdefs.h <<_ACEOF -#define USE_OPROFILE $USE_OPROFILE -_ACEOF - - - - - - - - -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 -echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include <$ac_hdr> - -int -main () -{ -if ((DIR *) 0) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 -_ACEOF - -ac_header_dirent=$ac_hdr; break -fi - -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then - { echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } -if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dir; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir=$ac_res -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then - : -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -else - { echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } -if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_func_search_save_LIBS=$LIBS -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' x; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir=$ac_res -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if test "${ac_cv_search_opendir+set}" = set; then - break -fi -done -if test "${ac_cv_search_opendir+set}" = set; then - : -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -fi - -{ echo "$as_me:$LINENO: checking for MAP_ANONYMOUS vs. MAP_ANON" >&5 -echo $ECHO_N "checking for MAP_ANONYMOUS vs. MAP_ANON... $ECHO_C" >&6; } -if test "${ac_cv_header_mmap_anon+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -int -main () -{ -mmap (0, 1, PROT_READ, MAP_ANONYMOUS, -1, 0); return (0); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_mmap_anon=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_mmap_anon=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_mmap_anon" >&5 -echo "${ECHO_T}$ac_cv_header_mmap_anon" >&6; } -if test "$ac_cv_header_mmap_anon" = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MMAP_ANONYMOUS 1 -_ACEOF - -fi - -{ echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5 -echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6; } -if test "${ac_cv_header_stat_broken+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -#if defined S_ISBLK && defined S_IFDIR -# if S_ISBLK (S_IFDIR) -You lose. -# endif -#endif - -#if defined S_ISBLK && defined S_IFCHR -# if S_ISBLK (S_IFCHR) -You lose. -# endif -#endif - -#if defined S_ISLNK && defined S_IFREG -# if S_ISLNK (S_IFREG) -You lose. -# endif -#endif - -#if defined S_ISSOCK && defined S_IFREG -# if S_ISSOCK (S_IFREG) -You lose. -# endif -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "You lose" >/dev/null 2>&1; then - ac_cv_header_stat_broken=yes -else - ac_cv_header_stat_broken=no -fi -rm -f conftest* - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5 -echo "${ECHO_T}$ac_cv_header_stat_broken" >&6; } -if test $ac_cv_header_stat_broken = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STAT_MACROS_BROKEN 1 -_ACEOF - -fi - -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stdc=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -{ echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 -echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6; } -if test "${ac_cv_header_sys_wait_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#ifndef WEXITSTATUS -# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) -#endif -#ifndef WIFEXITED -# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) -#endif - -int -main () -{ - int s; - wait (&s); - s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_sys_wait_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_sys_wait_h=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; } -if test $ac_cv_header_sys_wait_h = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_SYS_WAIT_H 1 -_ACEOF - -fi - -{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } -if test "${ac_cv_header_time+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include - -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_time=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_time=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 -echo "${ECHO_T}$ac_cv_header_time" >&6; } -if test $ac_cv_header_time = yes; then - -cat >>confdefs.h <<\_ACEOF -#define TIME_WITH_SYS_TIME 1 -_ACEOF - -fi - - - - - - - - -for ac_header in dlfcn.h execinfo.h fcntl.h inttypes.h limits.h link.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------------- ## -## Report this to llvmbugs@cs.uiuc.edu ## -## ----------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - - - -for ac_header in malloc.h setjmp.h signal.h stdint.h termios.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------------- ## -## Report this to llvmbugs@cs.uiuc.edu ## -## ----------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -for ac_header in utime.h windows.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------------- ## -## Report this to llvmbugs@cs.uiuc.edu ## -## ----------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - -for ac_header in sys/mman.h sys/param.h sys/resource.h sys/time.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------------- ## -## Report this to llvmbugs@cs.uiuc.edu ## -## ----------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - -for ac_header in sys/types.h sys/ioctl.h malloc/malloc.h mach/mach.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------------- ## -## Report this to llvmbugs@cs.uiuc.edu ## -## ----------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_header in valgrind/valgrind.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------------- ## -## Report this to llvmbugs@cs.uiuc.edu ## -## ----------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -if test "$ENABLE_THREADS" -eq 1 ; then - -for ac_header in pthread.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------------- ## -## Report this to llvmbugs@cs.uiuc.edu ## -## ----------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - HAVE_PTHREAD=1 - -else - HAVE_PTHREAD=0 - -fi - -done - -else - HAVE_PTHREAD=0 - -fi - -if test "$llvm_cv_enable_libffi" = "yes" ; then - - -for ac_header in ffi.h ffi/ffi.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------------- ## -## Report this to llvmbugs@cs.uiuc.edu ## -## ----------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -fi - - -for ac_header in CrashReporterClient.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------------- ## -## Report this to llvmbugs@cs.uiuc.edu ## -## ----------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - - { echo "$as_me:$LINENO: checking for HUGE_VAL sanity" >&5 -echo $ECHO_N "checking for HUGE_VAL sanity... $ECHO_C" >&6; } -if test "${ac_cv_huge_val_sanity+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - ac_save_CXXFLAGS=$CXXFLAGS - CXXFLAGS=-pedantic - if test "$cross_compiling" = yes; then - ac_cv_huge_val_sanity=yes -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -double x = HUGE_VAL; return x != x; - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_huge_val_sanity=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_huge_val_sanity=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - - CXXFLAGS=$ac_save_CXXFLAGS - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_huge_val_sanity" >&5 -echo "${ECHO_T}$ac_cv_huge_val_sanity" >&6; } - HUGE_VAL_SANITY=$ac_cv_huge_val_sanity - - -{ echo "$as_me:$LINENO: checking for pid_t" >&5 -echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } -if test "${ac_cv_type_pid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef pid_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_pid_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_pid_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 -echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } -if test $ac_cv_type_pid_t = yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define pid_t int -_ACEOF - -fi - -{ echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } -if test "${ac_cv_type_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef size_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_size_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_size_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6; } -if test $ac_cv_type_size_t = yes; then - : -else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF - -fi - - -cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE void -_ACEOF - -{ echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 -echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; } -if test "${ac_cv_struct_tm+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -struct tm *tp; tp->tm_sec; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_struct_tm=time.h -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_struct_tm=sys/time.h -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 -echo "${ECHO_T}$ac_cv_struct_tm" >&6; } -if test $ac_cv_struct_tm = sys/time.h; then - -cat >>confdefs.h <<\_ACEOF -#define TM_IN_SYS_TIME 1 -_ACEOF - -fi - -{ echo "$as_me:$LINENO: checking for int64_t" >&5 -echo $ECHO_N "checking for int64_t... $ECHO_C" >&6; } -if test "${ac_cv_type_int64_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef int64_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_int64_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_int64_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 -echo "${ECHO_T}$ac_cv_type_int64_t" >&6; } -if test $ac_cv_type_int64_t = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_INT64_T 1 -_ACEOF - - -else - { { echo "$as_me:$LINENO: error: Type int64_t required but not found" >&5 -echo "$as_me: error: Type int64_t required but not found" >&2;} - { (exit 1); exit 1; }; } -fi - -{ echo "$as_me:$LINENO: checking for uint64_t" >&5 -echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6; } -if test "${ac_cv_type_uint64_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef uint64_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_uint64_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_uint64_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 -echo "${ECHO_T}$ac_cv_type_uint64_t" >&6; } -if test $ac_cv_type_uint64_t = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_UINT64_T 1 -_ACEOF - - -else - { echo "$as_me:$LINENO: checking for u_int64_t" >&5 -echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6; } -if test "${ac_cv_type_u_int64_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef u_int64_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_u_int64_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_u_int64_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 -echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6; } -if test $ac_cv_type_u_int64_t = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_U_INT64_T 1 -_ACEOF - - -else - { { echo "$as_me:$LINENO: error: Type uint64_t or u_int64_t required but not found" >&5 -echo "$as_me: error: Type uint64_t or u_int64_t required but not found" >&2;} - { (exit 1); exit 1; }; } -fi - -fi - - - - - - - - - - -for ac_func in backtrace ceilf floorf roundf rintf nearbyintf getcwd -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - - -for ac_func in powf fmodf strtof round -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - - - -for ac_func in getpagesize getrusage getrlimit setrlimit gettimeofday -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - -for ac_func in isatty mkdtemp mkstemp -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - - - - -for ac_func in mktemp posix_spawn realpath sbrk setrlimit strdup -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - - -for ac_func in strerror strerror_r strerror_s setenv -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - - -for ac_func in strtoll strtoq sysconf malloc_zone_statistics -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - - -for ac_func in setjmp longjmp sigsetjmp siglongjmp -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -{ echo "$as_me:$LINENO: checking if printf has the %a format character" >&5 -echo $ECHO_N "checking if printf has the %a format character... $ECHO_C" >&6; } -if test "${llvm_cv_c_printf_a+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - if test "$cross_compiling" = yes; then - llvmac_cv_c_printf_a=no -else - cat >conftest.$ac_ext <<_ACEOF - - /* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include -#include - -int -main () -{ - -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); - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - llvm_cv_c_printf_a=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -llvmac_cv_c_printf_a=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $llvm_cv_c_printf_a" >&5 -echo "${ECHO_T}$llvm_cv_c_printf_a" >&6; } - if test "$llvm_cv_c_printf_a" = "yes"; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_PRINTF_A 1 -_ACEOF - - fi - - -{ echo "$as_me:$LINENO: checking for srand48/lrand48/drand48 in " >&5 -echo $ECHO_N "checking for srand48/lrand48/drand48 in ... $ECHO_C" >&6; } -if test "${ac_cv_func_rand48+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -srand48(0);lrand48();drand48(); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_rand48=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_rand48=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_rand48" >&5 -echo "${ECHO_T}$ac_cv_func_rand48" >&6; } - -if test "$ac_cv_func_rand48" = "yes" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_RAND48 1 -_ACEOF - -fi - - - -{ echo "$as_me:$LINENO: checking for isnan in " >&5 -echo $ECHO_N "checking for isnan in ... $ECHO_C" >&6; } -if test "${ac_cv_func_isnan_in_math_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -float f; isnan(f); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_isnan_in_math_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_isnan_in_math_h=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_isnan_in_math_h" >&5 -echo "${ECHO_T}$ac_cv_func_isnan_in_math_h" >&6; } - - -if test "$ac_cv_func_isnan_in_math_h" = "yes" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ISNAN_IN_MATH_H 1 -_ACEOF - -fi - -{ echo "$as_me:$LINENO: checking for isnan in " >&5 -echo $ECHO_N "checking for isnan in ... $ECHO_C" >&6; } -if test "${ac_cv_func_isnan_in_cmath+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -float f; isnan(f); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_isnan_in_cmath=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_isnan_in_cmath=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_isnan_in_cmath" >&5 -echo "${ECHO_T}$ac_cv_func_isnan_in_cmath" >&6; } - -if test "$ac_cv_func_isnan_in_cmath" = "yes" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ISNAN_IN_CMATH 1 -_ACEOF - -fi - -{ echo "$as_me:$LINENO: checking for std::isnan in " >&5 -echo $ECHO_N "checking for std::isnan in ... $ECHO_C" >&6; } -if test "${ac_cv_func_std_isnan_in_cmath+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -float f; std::isnan(f); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_std_isnan_in_cmath=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_std_isnan_in_cmath=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_std_isnan_in_cmath" >&5 -echo "${ECHO_T}$ac_cv_func_std_isnan_in_cmath" >&6; } - -if test "$ac_cv_func_std_isnan_in_cmath" = "yes" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_STD_ISNAN_IN_CMATH 1 -_ACEOF - -fi - - -{ echo "$as_me:$LINENO: checking for isinf in " >&5 -echo $ECHO_N "checking for isinf in ... $ECHO_C" >&6; } -if test "${ac_cv_func_isinf_in_math_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -float f; isinf(f); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_isinf_in_math_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_isinf_in_math_h=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_isinf_in_math_h" >&5 -echo "${ECHO_T}$ac_cv_func_isinf_in_math_h" >&6; } - -if test "$ac_cv_func_isinf_in_math_h" = "yes" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ISINF_IN_MATH_H 1 -_ACEOF - -fi - -{ echo "$as_me:$LINENO: checking for isinf in " >&5 -echo $ECHO_N "checking for isinf in ... $ECHO_C" >&6; } -if test "${ac_cv_func_isinf_in_cmath+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -float f; isinf(f); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_isinf_in_cmath=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_isinf_in_cmath=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_isinf_in_cmath" >&5 -echo "${ECHO_T}$ac_cv_func_isinf_in_cmath" >&6; } - -if test "$ac_cv_func_isinf_in_cmath" = "yes" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ISINF_IN_CMATH 1 -_ACEOF - -fi - -{ echo "$as_me:$LINENO: checking for std::isinf in " >&5 -echo $ECHO_N "checking for std::isinf in ... $ECHO_C" >&6; } -if test "${ac_cv_func_std_isinf_in_cmath+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -float f; std::isinf(f)} - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_std_isinf_in_cmath=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_std_isinf_in_cmath=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_std_isinf_in_cmath" >&5 -echo "${ECHO_T}$ac_cv_func_std_isinf_in_cmath" >&6; } - -if test "$ac_cv_func_std_isinf_in_cmath" = "yes" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_STD_ISINF_IN_CMATH 1 -_ACEOF - -fi - -{ echo "$as_me:$LINENO: checking for finite in " >&5 -echo $ECHO_N "checking for finite in ... $ECHO_C" >&6; } -if test "${ac_cv_func_finite_in_ieeefp_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -float f; finite(f); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_finite_in_ieeefp_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_finite_in_ieeefp_h=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_finite_in_ieeefp_h" >&5 -echo "${ECHO_T}$ac_cv_func_finite_in_ieeefp_h" >&6; } - -if test "$ac_cv_func_finite_in_ieeefp_h" = "yes" ; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_FINITE_IN_IEEEFP_H 1 -_ACEOF - -fi - - - -if test "$llvm_cv_platform_type" = "Unix" ; then - - -for ac_header in stdlib.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ----------------------------------- ## -## Report this to llvmbugs@cs.uiuc.edu ## -## ----------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_func in getpagesize -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -{ echo "$as_me:$LINENO: checking for working mmap" >&5 -echo $ECHO_N "checking for working mmap... $ECHO_C" >&6; } -if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_mmap_fixed_mapped=no -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -/* malloc might have been renamed as rpl_malloc. */ -#undef malloc - -/* Thanks to Mike Haertel and Jim Avera for this test. - Here is a matrix of mmap possibilities: - mmap private not fixed - mmap private fixed at somewhere currently unmapped - mmap private fixed at somewhere already mapped - mmap shared not fixed - mmap shared fixed at somewhere currently unmapped - mmap shared fixed at somewhere already mapped - For private mappings, we should verify that changes cannot be read() - back from the file, nor mmap's back from the file at a different - address. (There have been systems where private was not correctly - implemented like the infamous i386 svr4.0, and systems where the - VM page cache was not coherent with the file system buffer cache - like early versions of FreeBSD and possibly contemporary NetBSD.) - For shared mappings, we should conversely verify that changes get - propagated back to all the places they're supposed to be. - - Grep wants private fixed already mapped. - The main things grep needs to know about mmap are: - * does it exist and is it safe to write into the mmap'd area - * how to use it (BSD variants) */ - -#include -#include - -#if !STDC_HEADERS && !HAVE_STDLIB_H -char *malloc (); -#endif - -/* This mess was copied from the GNU getpagesize.h. */ -#if !HAVE_GETPAGESIZE -/* Assume that all systems that can run configure have sys/param.h. */ -# if !HAVE_SYS_PARAM_H -# define HAVE_SYS_PARAM_H 1 -# endif - -# ifdef _SC_PAGESIZE -# define getpagesize() sysconf(_SC_PAGESIZE) -# else /* no _SC_PAGESIZE */ -# if HAVE_SYS_PARAM_H -# include -# ifdef EXEC_PAGESIZE -# define getpagesize() EXEC_PAGESIZE -# else /* no EXEC_PAGESIZE */ -# ifdef NBPG -# define getpagesize() NBPG * CLSIZE -# ifndef CLSIZE -# define CLSIZE 1 -# endif /* no CLSIZE */ -# else /* no NBPG */ -# ifdef NBPC -# define getpagesize() NBPC -# else /* no NBPC */ -# ifdef PAGESIZE -# define getpagesize() PAGESIZE -# endif /* PAGESIZE */ -# endif /* no NBPC */ -# endif /* no NBPG */ -# endif /* no EXEC_PAGESIZE */ -# else /* no HAVE_SYS_PARAM_H */ -# define getpagesize() 8192 /* punt totally */ -# endif /* no HAVE_SYS_PARAM_H */ -# endif /* no _SC_PAGESIZE */ - -#endif /* no HAVE_GETPAGESIZE */ - -int -main () -{ - char *data, *data2, *data3; - int i, pagesize; - int fd; - - pagesize = getpagesize (); - - /* First, make a file with some known garbage in it. */ - data = (char *) malloc (pagesize); - if (!data) - return 1; - for (i = 0; i < pagesize; ++i) - *(data + i) = rand (); - umask (0); - fd = creat ("conftest.mmap", 0600); - if (fd < 0) - return 1; - if (write (fd, data, pagesize) != pagesize) - return 1; - close (fd); - - /* Next, try to mmap the file at a fixed address which already has - something else allocated at it. If we can, also make sure that - we see the same garbage. */ - fd = open ("conftest.mmap", O_RDWR); - if (fd < 0) - return 1; - data2 = (char *) malloc (2 * pagesize); - if (!data2) - return 1; - data2 += (pagesize - ((long int) data2 & (pagesize - 1))) & (pagesize - 1); - if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_FIXED, fd, 0L)) - return 1; - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data2 + i)) - return 1; - - /* Finally, make sure that changes to the mapped area do not - percolate back to the file as seen by read(). (This is a bug on - some variants of i386 svr4.0.) */ - for (i = 0; i < pagesize; ++i) - *(data2 + i) = *(data2 + i) + 1; - data3 = (char *) malloc (pagesize); - if (!data3) - return 1; - if (read (fd, data3, pagesize) != pagesize) - return 1; - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data3 + i)) - return 1; - close (fd); - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_mmap_fixed_mapped=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_mmap_fixed_mapped=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 -echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6; } -if test $ac_cv_func_mmap_fixed_mapped = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MMAP 1 -_ACEOF - -fi -rm -f conftest.mmap - - { echo "$as_me:$LINENO: checking for mmap of files" >&5 -echo $ECHO_N "checking for mmap of files... $ECHO_C" >&6; } -if test "${ac_cv_func_mmap_file+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - if test "$cross_compiling" = yes; then - ac_cv_func_mmap_file=no -else - cat >conftest.$ac_ext <<_ACEOF - - /* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include -#include -#include - -int -main () -{ - - int fd; - fd = creat ("foo",0777); - fd = (int) mmap (0, 1, PROT_READ, MAP_SHARED, fd, 0); - unlink ("foo"); - return (fd != (int) MAP_FAILED); - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_mmap_file=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_mmap_file=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_mmap_file" >&5 -echo "${ECHO_T}$ac_cv_func_mmap_file" >&6; } -if test "$ac_cv_func_mmap_file" = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MMAP_FILE -_ACEOF - - MMAP_FILE=yes - -fi - - { echo "$as_me:$LINENO: checking if /dev/zero is needed for mmap" >&5 -echo $ECHO_N "checking if /dev/zero is needed for mmap... $ECHO_C" >&6; } -if test "${ac_cv_need_dev_zero_for_mmap+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - 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 - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_need_dev_zero_for_mmap" >&5 -echo "${ECHO_T}$ac_cv_need_dev_zero_for_mmap" >&6; } -if test "$ac_cv_need_dev_zero_for_mmap" = yes; then - -cat >>confdefs.h <<\_ACEOF -#define NEED_DEV_ZERO_FOR_MMAP 1 -_ACEOF - -fi - - if test "$ac_cv_func_mmap_fixed_mapped" = "no" - then - { echo "$as_me:$LINENO: WARNING: mmap() of a fixed address required but not supported" >&5 -echo "$as_me: WARNING: mmap() of a fixed address required but not supported" >&2;} - fi - if test "$ac_cv_func_mmap_file" = "no" - then - { echo "$as_me:$LINENO: WARNING: mmap() of files required but not found" >&5 -echo "$as_me: WARNING: mmap() of files required but not found" >&2;} - fi -fi - -{ echo "$as_me:$LINENO: checking for GCC atomic builtins" >&5 -echo $ECHO_N "checking for GCC atomic builtins... $ECHO_C" >&6; } -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int main() { - volatile unsigned long val = 1; - __sync_synchronize(); - __sync_val_compare_and_swap(&val, 1, 0); - __sync_add_and_fetch(&val, 1); - __sync_sub_and_fetch(&val, 1); - return 0; - } - -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - -cat >>confdefs.h <<\_ACEOF -#define LLVM_MULTITHREADED 1 -_ACEOF - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - -cat >>confdefs.h <<\_ACEOF -#define LLVM_MULTITHREADED 0 -_ACEOF - - { echo "$as_me:$LINENO: WARNING: LLVM will be built thread-unsafe because atomic builtins are missing" >&5 -echo "$as_me: WARNING: LLVM will be built thread-unsafe because atomic builtins are missing" >&2;} -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - - -if test "$llvm_cv_os_type" = "Linux" -a "$llvm_cv_target_arch" = "x86_64" ; then - { echo "$as_me:$LINENO: checking for 32-bit userspace on 64-bit system" >&5 -echo $ECHO_N "checking for 32-bit userspace on 64-bit system... $ECHO_C" >&6; } -if test "${llvm_cv_linux_mixed+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifndef __x86_64__ - error: Not x86-64 even if uname says so! - #endif - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - llvm_cv_linux_mixed=no -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - llvm_cv_linux_mixed=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -fi -{ echo "$as_me:$LINENO: result: $llvm_cv_linux_mixed" >&5 -echo "${ECHO_T}$llvm_cv_linux_mixed" >&6; } - - if test "$llvm_cv_linux_mixed" = "yes"; then - llvm_cv_target_arch="x86" - ARCH="x86" - fi -fi - - -for ac_func in __dso_handle -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - -{ echo "$as_me:$LINENO: checking whether llvm-gcc is sane" >&5 -echo $ECHO_N "checking whether llvm-gcc is sane... $ECHO_C" >&6; } -if test "${llvm_cv_llvmgcc_sanity+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - llvm_cv_llvmgcc_sanity="no" -if test -x "$LLVMGCC" ; then - cp /dev/null conftest.c - "$LLVMGCC" -emit-llvm -S -o - conftest.c | \ - grep 'target datalayout =' > /dev/null 2>&1 - if test $? -eq 0 ; then - llvm_cv_llvmgcc_sanity="yes" - fi - rm conftest.c -fi -fi -{ echo "$as_me:$LINENO: result: $llvm_cv_llvmgcc_sanity" >&5 -echo "${ECHO_T}$llvm_cv_llvmgcc_sanity" >&6; } - -if test "$llvm_cv_llvmgcc_sanity" = "yes" ; then - { echo "$as_me:$LINENO: checking llvm-gcc component support" >&5 -echo $ECHO_N "checking llvm-gcc component support... $ECHO_C" >&6; } - llvmcc1path=`"$LLVMGCC" --print-prog-name=cc1` - LLVMCC1=$llvmcc1path - - llvmcc1pluspath=`"$LLVMGCC" --print-prog-name=cc1plus` - LLVMCC1PLUS=$llvmcc1pluspath - - llvmgccdir=`echo "$llvmcc1path" | sed 's,/libexec/.*,,'` - LLVMGCCDIR=$llvmgccdir - - llvmgcclangs=`"$LLVMGCC" -v --help 2>&1 | grep '^Configured with:' | sed 's/^.*--enable-languages=\([^ ]*\).*/\1/'` - LLVMGCC_LANGS=$llvmgcclangs - - { echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6; } -fi - -SHLIBEXT=$libltdl_cv_shlibext - - -SHLIBPATH_VAR=$libltdl_cv_shlibpath_var - - -# Translate the various configuration directories and other basic -# information into substitutions that will end up in Makefile.config.in -# that these configured values can be used by the makefiles -if test "${prefix}" = "NONE" ; then - prefix="/usr/local" -fi -eval LLVM_PREFIX="${prefix}"; -eval LLVM_BINDIR="${prefix}/bin"; -eval LLVM_LIBDIR="${prefix}/lib"; -eval LLVM_DATADIR="${prefix}/share/llvm"; -eval LLVM_DOCSDIR="${prefix}/share/doc/llvm"; -eval LLVM_ETCDIR="${prefix}/etc/llvm"; -eval LLVM_INCLUDEDIR="${prefix}/include"; -eval LLVM_INFODIR="${prefix}/info"; -eval LLVM_MANDIR="${prefix}/man"; -LLVM_CONFIGTIME=`date` - - - - - - - - - - - -# Place the various directores into the config.h file as #defines so that we -# can know about the installation paths within LLVM. - -cat >>confdefs.h <<_ACEOF -#define LLVM_PREFIX "$LLVM_PREFIX" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define LLVM_BINDIR "$LLVM_BINDIR" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define LLVM_LIBDIR "$LLVM_LIBDIR" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define LLVM_DATADIR "$LLVM_DATADIR" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define LLVM_DOCSDIR "$LLVM_DOCSDIR" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define LLVM_ETCDIR "$LLVM_ETCDIR" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define LLVM_INCLUDEDIR "$LLVM_INCLUDEDIR" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define LLVM_INFODIR "$LLVM_INFODIR" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define LLVM_MANDIR "$LLVM_MANDIR" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define LLVM_CONFIGTIME "$LLVM_CONFIGTIME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define LLVM_HOSTTRIPLE "$host" -_ACEOF - - -# Determine which bindings to build. -if test "$BINDINGS_TO_BUILD" = auto ; then - BINDINGS_TO_BUILD="" - if test "x$OCAMLC" != x -a "x$OCAMLDEP" != x ; then - BINDINGS_TO_BUILD="ocaml $BINDINGS_TO_BUILD" - fi -fi -BINDINGS_TO_BUILD=$BINDINGS_TO_BUILD - - -# This isn't really configurey, but it avoids having to repeat the list in -# other files. -ALL_BINDINGS=ocaml - - -# Do any work necessary to ensure that bindings have what they need. -binding_prereqs_failed=0 -for a_binding in $BINDINGS_TO_BUILD ; do - case "$a_binding" in - ocaml) - if test "x$OCAMLC" = x ; then - { echo "$as_me:$LINENO: WARNING: --enable-bindings=ocaml specified, but ocamlc not found. Try configure OCAMLC=/path/to/ocamlc" >&5 -echo "$as_me: WARNING: --enable-bindings=ocaml specified, but ocamlc not found. Try configure OCAMLC=/path/to/ocamlc" >&2;} - binding_prereqs_failed=1 - fi - if test "x$OCAMLDEP" = x ; then - { echo "$as_me:$LINENO: WARNING: --enable-bindings=ocaml specified, but ocamldep not found. Try configure OCAMLDEP=/path/to/ocamldep" >&5 -echo "$as_me: WARNING: --enable-bindings=ocaml specified, but ocamldep not found. Try configure OCAMLDEP=/path/to/ocamldep" >&2;} - binding_prereqs_failed=1 - fi - if test "x$OCAMLOPT" = x ; then - { echo "$as_me:$LINENO: WARNING: --enable-bindings=ocaml specified, but ocamlopt not found. Try configure OCAMLOPT=/path/to/ocamlopt" >&5 -echo "$as_me: WARNING: --enable-bindings=ocaml specified, but ocamlopt not found. Try configure OCAMLOPT=/path/to/ocamlopt" >&2;} - fi - if test "x$with_ocaml_libdir" != xauto ; then - OCAML_LIBDIR=$with_ocaml_libdir - - else - ocaml_stdlib="`"$OCAMLC" -where`" - if test "$LLVM_PREFIX" '<' "$ocaml_stdlib" -a "$ocaml_stdlib" '<' "$LLVM_PREFIX~" - then - # ocaml stdlib is beneath our prefix; use stdlib - OCAML_LIBDIR=$ocaml_stdlib - - else - # ocaml stdlib is outside our prefix; use libdir/ocaml - OCAML_LIBDIR=$LLVM_LIBDIR/ocaml - - fi - fi - ;; - esac -done -if test "$binding_prereqs_failed" = 1 ; then - { { echo "$as_me:$LINENO: error: Prequisites for bindings not satisfied. Fix them or use configure --disable-bindings." >&5 -echo "$as_me: error: Prequisites for bindings not satisfied. Fix them or use configure --disable-bindings." >&2;} - { (exit 1); exit 1; }; } -fi - -{ echo "$as_me:$LINENO: checking for compiler -fvisibility-inlines-hidden option" >&5 -echo $ECHO_N "checking for compiler -fvisibility-inlines-hidden option... $ECHO_C" >&6; } -if test "${llvm_cv_cxx_visibility_inlines_hidden+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - oldcxxflags="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - llvm_cv_cxx_visibility_inlines_hidden=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - llvm_cv_cxx_visibility_inlines_hidden=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CXXFLAGS="$oldcxxflags" - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -fi -{ echo "$as_me:$LINENO: result: $llvm_cv_cxx_visibility_inlines_hidden" >&5 -echo "${ECHO_T}$llvm_cv_cxx_visibility_inlines_hidden" >&6; } -if test "$llvm_cv_cxx_visibility_inlines_hidden" = yes ; then - ENABLE_VISIBILITY_INLINES_HIDDEN=1 - -else - ENABLE_VISIBILITY_INLINES_HIDDEN=0 - -fi - - -if test "$llvm_cv_link_use_r" = "yes" ; then - RPATH="-Wl,-R" -else - RPATH="-Wl,-rpath" -fi - - -if test "$llvm_cv_link_use_export_dynamic" = "yes" ; then - RDYNAMIC="-Wl,-export-dynamic" -else - RDYNAMIC="" -fi - - - -ac_config_headers="$ac_config_headers include/llvm/Config/config.h include/llvm/Config/llvm-config.h" - - - - - - -ac_config_files="$ac_config_files include/llvm/Config/Targets.def" - -ac_config_files="$ac_config_files include/llvm/Config/AsmPrinters.def" - -ac_config_files="$ac_config_files include/llvm/Config/AsmParsers.def" - -ac_config_files="$ac_config_files include/llvm/Config/Disassemblers.def" - -ac_config_headers="$ac_config_headers include/llvm/System/DataTypes.h" - - -ac_config_files="$ac_config_files Makefile.config" - - -ac_config_files="$ac_config_files llvm.spec" - - -ac_config_files="$ac_config_files tools/llvmc/src/Base.td" - - -ac_config_files="$ac_config_files tools/llvm-config/llvm-config.in" - - -ac_config_commands="$ac_config_commands setup" - -ac_config_commands="$ac_config_commands Makefile" - - -ac_config_commands="$ac_config_commands Makefile.common" - - -ac_config_commands="$ac_config_commands examples/Makefile" - - -ac_config_commands="$ac_config_commands lib/Makefile" - - -ac_config_commands="$ac_config_commands runtime/Makefile" - - -ac_config_commands="$ac_config_commands test/Makefile" - - -ac_config_commands="$ac_config_commands test/Makefile.tests" - - -ac_config_commands="$ac_config_commands unittests/Makefile" - - -ac_config_commands="$ac_config_commands tools/Makefile" - - -ac_config_commands="$ac_config_commands utils/Makefile" - - -ac_config_commands="$ac_config_commands projects/Makefile" - - -ac_config_commands="$ac_config_commands bindings/Makefile" - - -ac_config_commands="$ac_config_commands bindings/ocaml/Makefile.ocaml" - - - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file - else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -if test -z "${INSTALL_LTDL_TRUE}" && test -z "${INSTALL_LTDL_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"INSTALL_LTDL\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"INSTALL_LTDL\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi -if test -z "${CONVENIENCE_LTDL_TRUE}" && test -z "${CONVENIENCE_LTDL_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"CONVENIENCE_LTDL\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"CONVENIENCE_LTDL\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir -fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -# Find out whether ``test -x'' works. Don't use a zero-byte file, as -# systems may use methods other than mode bits to determine executability. -cat >conf$$.file <<_ASEOF -#! /bin/sh -exit 0 -_ASEOF -chmod +x conf$$.file -if test -x conf$$.file >/dev/null 2>&1; then - as_executable_p="test -x" -else - as_executable_p=: -fi -rm -f conf$$.file - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 - -# Save the log message, to keep $[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by llvm $as_me 2.8, which was -generated by GNU Autoconf 2.60. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to ." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -llvm config.status 2.8 -configured by $0, generated by GNU Autoconf 2.60, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2006 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - echo "$ac_cs_version"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL - export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -# -# INIT-COMMANDS -# -llvm_src="${srcdir}" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "include/llvm/Config/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/Config/config.h" ;; - "include/llvm/Config/llvm-config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/Config/llvm-config.h" ;; - "include/llvm/Config/Targets.def") CONFIG_FILES="$CONFIG_FILES include/llvm/Config/Targets.def" ;; - "include/llvm/Config/AsmPrinters.def") CONFIG_FILES="$CONFIG_FILES include/llvm/Config/AsmPrinters.def" ;; - "include/llvm/Config/AsmParsers.def") CONFIG_FILES="$CONFIG_FILES include/llvm/Config/AsmParsers.def" ;; - "include/llvm/Config/Disassemblers.def") CONFIG_FILES="$CONFIG_FILES include/llvm/Config/Disassemblers.def" ;; - "include/llvm/System/DataTypes.h") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/System/DataTypes.h" ;; - "Makefile.config") CONFIG_FILES="$CONFIG_FILES Makefile.config" ;; - "llvm.spec") CONFIG_FILES="$CONFIG_FILES llvm.spec" ;; - "tools/llvmc/src/Base.td") CONFIG_FILES="$CONFIG_FILES tools/llvmc/src/Base.td" ;; - "tools/llvm-config/llvm-config.in") CONFIG_FILES="$CONFIG_FILES tools/llvm-config/llvm-config.in" ;; - "setup") CONFIG_COMMANDS="$CONFIG_COMMANDS setup" ;; - "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;; - "Makefile.common") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile.common" ;; - "examples/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS examples/Makefile" ;; - "lib/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS lib/Makefile" ;; - "runtime/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS runtime/Makefile" ;; - "test/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS test/Makefile" ;; - "test/Makefile.tests") CONFIG_COMMANDS="$CONFIG_COMMANDS test/Makefile.tests" ;; - "unittests/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS unittests/Makefile" ;; - "tools/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS tools/Makefile" ;; - "utils/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS utils/Makefile" ;; - "projects/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS projects/Makefile" ;; - "bindings/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS bindings/Makefile" ;; - "bindings/ocaml/Makefile.ocaml") CONFIG_COMMANDS="$CONFIG_COMMANDS bindings/ocaml/Makefile.ocaml" ;; - - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -# -# Set up the sed scripts for CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "$CONFIG_FILES"; then - -_ACEOF - - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -LLVM_COPYRIGHT!$LLVM_COPYRIGHT$ac_delim -subdirs!$subdirs$ac_delim -build!$build$ac_delim -build_cpu!$build_cpu$ac_delim -build_vendor!$build_vendor$ac_delim -build_os!$build_os$ac_delim -host!$host$ac_delim -host_cpu!$host_cpu$ac_delim -host_vendor!$host_vendor$ac_delim -host_os!$host_os$ac_delim -target!$target$ac_delim -target_cpu!$target_cpu$ac_delim -target_vendor!$target_vendor$ac_delim -target_os!$target_os$ac_delim -OS!$OS$ac_delim -HOST_OS!$HOST_OS$ac_delim -TARGET_OS!$TARGET_OS$ac_delim -LINKALL!$LINKALL$ac_delim -NOLINKALL!$NOLINKALL$ac_delim -LLVM_ON_UNIX!$LLVM_ON_UNIX$ac_delim -LLVM_ON_WIN32!$LLVM_ON_WIN32$ac_delim -ARCH!$ARCH$ac_delim -ENDIAN!$ENDIAN$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -CPP!$CPP$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -LLVM_CROSS_COMPILING!$LLVM_CROSS_COMPILING$ac_delim -BUILD_CC!$BUILD_CC$ac_delim -BUILD_EXEEXT!$BUILD_EXEEXT$ac_delim -BUILD_CXX!$BUILD_CXX$ac_delim -CVSBUILD!$CVSBUILD$ac_delim -ENABLE_OPTIMIZED!$ENABLE_OPTIMIZED$ac_delim -ENABLE_PROFILING!$ENABLE_PROFILING$ac_delim -DISABLE_ASSERTIONS!$DISABLE_ASSERTIONS$ac_delim -ENABLE_EXPENSIVE_CHECKS!$ENABLE_EXPENSIVE_CHECKS$ac_delim -EXPENSIVE_CHECKS!$EXPENSIVE_CHECKS$ac_delim -DEBUG_RUNTIME!$DEBUG_RUNTIME$ac_delim -DEBUG_SYMBOLS!$DEBUG_SYMBOLS$ac_delim -JIT!$JIT$ac_delim -TARGET_HAS_JIT!$TARGET_HAS_JIT$ac_delim -ENABLE_DOXYGEN!$ENABLE_DOXYGEN$ac_delim -ENABLE_THREADS!$ENABLE_THREADS$ac_delim -ENABLE_PIC!$ENABLE_PIC$ac_delim -ENABLE_SHARED!$ENABLE_SHARED$ac_delim -ENABLE_TIMESTAMPS!$ENABLE_TIMESTAMPS$ac_delim -TARGETS_TO_BUILD!$TARGETS_TO_BUILD$ac_delim -LLVM_ENUM_TARGETS!$LLVM_ENUM_TARGETS$ac_delim -LLVM_ENUM_ASM_PRINTERS!$LLVM_ENUM_ASM_PRINTERS$ac_delim -LLVM_ENUM_ASM_PARSERS!$LLVM_ENUM_ASM_PARSERS$ac_delim -LLVM_ENUM_DISASSEMBLERS!$LLVM_ENUM_DISASSEMBLERS$ac_delim -ENABLE_CBE_PRINTF_A!$ENABLE_CBE_PRINTF_A$ac_delim -CLANGPATH!$CLANGPATH$ac_delim -CLANGXXPATH!$CLANGXXPATH$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -CEOF$ac_eof -_ACEOF - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -ENABLE_BUILT_CLANG!$ENABLE_BUILT_CLANG$ac_delim -OPTIMIZE_OPTION!$OPTIMIZE_OPTION$ac_delim -EXTRA_OPTIONS!$EXTRA_OPTIONS$ac_delim -BINUTILS_INCDIR!$BINUTILS_INCDIR$ac_delim -CXX!$CXX$ac_delim -CXXFLAGS!$CXXFLAGS$ac_delim -ac_ct_CXX!$ac_ct_CXX$ac_delim -NM!$NM$ac_delim -ifGNUmake!$ifGNUmake$ac_delim -LN_S!$LN_S$ac_delim -CMP!$CMP$ac_delim -CP!$CP$ac_delim -DATE!$DATE$ac_delim -FIND!$FIND$ac_delim -MKDIR!$MKDIR$ac_delim -MV!$MV$ac_delim -RANLIB!$RANLIB$ac_delim -AR!$AR$ac_delim -RM!$RM$ac_delim -SED!$SED$ac_delim -TAR!$TAR$ac_delim -BINPWD!$BINPWD$ac_delim -GRAPHVIZ!$GRAPHVIZ$ac_delim -DOT!$DOT$ac_delim -FDP!$FDP$ac_delim -NEATO!$NEATO$ac_delim -TWOPI!$TWOPI$ac_delim -CIRCO!$CIRCO$ac_delim -GV!$GV$ac_delim -DOTTY!$DOTTY$ac_delim -PERL!$PERL$ac_delim -HAVE_PERL!$HAVE_PERL$ac_delim -INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim -INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim -INSTALL_DATA!$INSTALL_DATA$ac_delim -BZIP2!$BZIP2$ac_delim -CAT!$CAT$ac_delim -DOXYGEN!$DOXYGEN$ac_delim -GROFF!$GROFF$ac_delim -GZIP!$GZIP$ac_delim -POD2HTML!$POD2HTML$ac_delim -POD2MAN!$POD2MAN$ac_delim -PDFROFF!$PDFROFF$ac_delim -RUNTEST!$RUNTEST$ac_delim -TCLSH!$TCLSH$ac_delim -ZIP!$ZIP$ac_delim -OCAMLC!$OCAMLC$ac_delim -OCAMLOPT!$OCAMLOPT$ac_delim -OCAMLDEP!$OCAMLDEP$ac_delim -OCAMLDOC!$OCAMLDOC$ac_delim -GAS!$GAS$ac_delim -HAVE_LINK_VERSION_SCRIPT!$HAVE_LINK_VERSION_SCRIPT$ac_delim -INSTALL_LTDL_TRUE!$INSTALL_LTDL_TRUE$ac_delim -INSTALL_LTDL_FALSE!$INSTALL_LTDL_FALSE$ac_delim -CONVENIENCE_LTDL_TRUE!$CONVENIENCE_LTDL_TRUE$ac_delim -CONVENIENCE_LTDL_FALSE!$CONVENIENCE_LTDL_FALSE$ac_delim -LIBADD_DL!$LIBADD_DL$ac_delim -LLVMGCCCOMMAND!$LLVMGCCCOMMAND$ac_delim -LLVMGXXCOMMAND!$LLVMGXXCOMMAND$ac_delim -LLVMGCC!$LLVMGCC$ac_delim -LLVMGXX!$LLVMGXX$ac_delim -LLVMCC_OPTION!$LLVMCC_OPTION$ac_delim -NO_VARIADIC_MACROS!$NO_VARIADIC_MACROS$ac_delim -NO_MISSING_FIELD_INITIALIZERS!$NO_MISSING_FIELD_INITIALIZERS$ac_delim -USE_UDIS86!$USE_UDIS86$ac_delim -USE_OPROFILE!$USE_OPROFILE$ac_delim -HAVE_PTHREAD!$HAVE_PTHREAD$ac_delim -HUGE_VAL_SANITY!$HUGE_VAL_SANITY$ac_delim -MMAP_FILE!$MMAP_FILE$ac_delim -LLVMCC1!$LLVMCC1$ac_delim -LLVMCC1PLUS!$LLVMCC1PLUS$ac_delim -LLVMGCCDIR!$LLVMGCCDIR$ac_delim -LLVMGCC_LANGS!$LLVMGCC_LANGS$ac_delim -SHLIBEXT!$SHLIBEXT$ac_delim -SHLIBPATH_VAR!$SHLIBPATH_VAR$ac_delim -LLVM_PREFIX!$LLVM_PREFIX$ac_delim -LLVM_BINDIR!$LLVM_BINDIR$ac_delim -LLVM_LIBDIR!$LLVM_LIBDIR$ac_delim -LLVM_DATADIR!$LLVM_DATADIR$ac_delim -LLVM_DOCSDIR!$LLVM_DOCSDIR$ac_delim -LLVM_ETCDIR!$LLVM_ETCDIR$ac_delim -LLVM_INCLUDEDIR!$LLVM_INCLUDEDIR$ac_delim -LLVM_INFODIR!$LLVM_INFODIR$ac_delim -LLVM_MANDIR!$LLVM_MANDIR$ac_delim -LLVM_CONFIGTIME!$LLVM_CONFIGTIME$ac_delim -BINDINGS_TO_BUILD!$BINDINGS_TO_BUILD$ac_delim -ALL_BINDINGS!$ALL_BINDINGS$ac_delim -OCAML_LIBDIR!$OCAML_LIBDIR$ac_delim -ENABLE_VISIBILITY_INLINES_HIDDEN!$ENABLE_VISIBILITY_INLINES_HIDDEN$ac_delim -RPATH!$RPATH$ac_delim -RDYNAMIC!$RDYNAMIC$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 93; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g -CEOF$ac_eof -_ACEOF - - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF -fi # test -n "$CONFIG_FILES" - - -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} - { (exit 1); exit 1; }; };; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; - esac - ac_file_inputs="$ac_file_inputs $ac_f" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input="Generated from "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - fi - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= - -case `sed -n '/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p -' $ac_file_inputs` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -$ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} - - rm -f "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac - ;; - :H) - # - # CONFIG_HEADER - # -_ACEOF - -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' - -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then replace #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def -_ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines conftest.tail - -echo "ac_result=$ac_in" >>$CONFIG_STATUS -cat >>$CONFIG_STATUS <<\_ACEOF - if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f $ac_file - mv "$tmp/config.h" $ac_file - fi - else - echo "/* $configure_input */" - cat "$ac_result" - fi - rm -f "$tmp/out12" - ;; - - :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 -echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname Makefile` - ${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/Makefile Makefile ;; - "Makefile.common":C) ${llvm_src}/autoconf/mkinstalldirs `dirname Makefile.common` - ${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/Makefile.common Makefile.common ;; - "examples/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname examples/Makefile` - ${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/examples/Makefile examples/Makefile ;; - "lib/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname lib/Makefile` - ${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/lib/Makefile lib/Makefile ;; - "runtime/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname runtime/Makefile` - ${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/runtime/Makefile runtime/Makefile ;; - "test/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname test/Makefile` - ${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/test/Makefile test/Makefile ;; - "test/Makefile.tests":C) ${llvm_src}/autoconf/mkinstalldirs `dirname test/Makefile.tests` - ${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/test/Makefile.tests test/Makefile.tests ;; - "unittests/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname unittests/Makefile` - ${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/unittests/Makefile unittests/Makefile ;; - "tools/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname tools/Makefile` - ${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/tools/Makefile tools/Makefile ;; - "utils/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname utils/Makefile` - ${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/utils/Makefile utils/Makefile ;; - "projects/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname projects/Makefile` - ${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/projects/Makefile projects/Makefile ;; - "bindings/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname bindings/Makefile` - ${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/bindings/Makefile bindings/Makefile ;; - "bindings/ocaml/Makefile.ocaml":C) ${llvm_src}/autoconf/mkinstalldirs `dirname bindings/ocaml/Makefile.ocaml` - ${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/bindings/ocaml/Makefile.ocaml bindings/ocaml/Makefile.ocaml ;; - - esac -done # for ac_tag - - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi - -# -# CONFIG_SUBDIRS section. -# -if test "$no_recursion" != yes; then - - # Remove --cache-file and --srcdir arguments so they do not pile up. - ac_sub_configure_args= - ac_prev= - eval "set x $ac_configure_args" - shift - for ac_arg - do - if test -n "$ac_prev"; then - ac_prev= - continue - fi - case $ac_arg in - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \ - | --c=*) - ;; - --config-cache | -C) - ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - ;; - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - ;; - *) - case $ac_arg in - *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - ac_sub_configure_args="$ac_sub_configure_args '$ac_arg'" ;; - esac - done - - # Always prepend --prefix to ensure using the same prefix - # in subdir configurations. - ac_arg="--prefix=$prefix" - case $ac_arg in - *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - ac_sub_configure_args="$ac_arg $ac_sub_configure_args" - - ac_popdir=`pwd` - for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue - - # Do not complain, so a configure script can configure whichever - # parts of a large source tree are present. - test -d "$srcdir/$ac_dir" || continue - - ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" - echo "$as_me:$LINENO: $ac_msg" >&5 - echo "$ac_msg" >&6 - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - cd "$ac_dir" - - # Check for guested configure; otherwise get Cygnus style configure. - if test -f "$ac_srcdir/configure.gnu"; then - ac_sub_configure=$ac_srcdir/configure.gnu - elif test -f "$ac_srcdir/configure"; then - ac_sub_configure=$ac_srcdir/configure - elif test -f "$ac_srcdir/configure.in"; then - # This should be Cygnus configure. - ac_sub_configure=$ac_aux_dir/configure - else - { echo "$as_me:$LINENO: WARNING: no configuration information is in $ac_dir" >&5 -echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} - ac_sub_configure= - fi - - # The recursion is here. - if test -n "$ac_sub_configure"; then - # Make the cache file name correct relative to the subdirectory. - case $cache_file in - [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; - *) # Relative name. - ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; - esac - - { echo "$as_me:$LINENO: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 -echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} - # The eval makes quoting arguments work. - eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ - --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || - { { echo "$as_me:$LINENO: error: $ac_sub_configure failed for $ac_dir" >&5 -echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;} - { (exit 1); exit 1; }; } - fi - - cd "$ac_popdir" - done -fi - diff --git a/contrib/llvm/include/llvm/CMakeLists.txt b/contrib/llvm/include/llvm/CMakeLists.txt deleted file mode 100644 index 5e4f40881d00..000000000000 --- a/contrib/llvm/include/llvm/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -set(LLVM_TARGET_DEFINITIONS Intrinsics.td) - -tablegen(Intrinsics.gen -gen-intrinsic) - -add_custom_target(intrinsics_gen ALL - DEPENDS ${llvm_builded_incs_dir}/Intrinsics.gen) - -set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} intrinsics_gen PARENT_SCOPE) - -if( MSVC_IDE OR XCODE ) - # Creates a dummy target containing all headers for the benefit of - # Visual Studio users. - file(GLOB_RECURSE headers *.h) - add_td_sources(headers) - add_library(llvm_headers_do_not_build EXCLUDE_FROM_ALL - # We need at least one source file: - ${LLVM_MAIN_SRC_DIR}/lib/Transforms/Hello/Hello.cpp - ${headers}) -endif() diff --git a/contrib/llvm/include/llvm/Config/AsmParsers.def.in b/contrib/llvm/include/llvm/Config/AsmParsers.def.in deleted file mode 100644 index 041af837541c..000000000000 --- a/contrib/llvm/include/llvm/Config/AsmParsers.def.in +++ /dev/null @@ -1,29 +0,0 @@ -//===- llvm/Config/AsmParsers.def - LLVM Assembly Parsers -------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file enumerates all of the assembly-language parsers -// supported by this build of LLVM. Clients of this file should define -// the LLVM_ASM_PARSER macro to be a function-like macro with a -// single parameter (the name of the target whose assembly can be -// generated); including this file will then enumerate all of the -// targets with assembly parsers. -// -// The set of targets supported by LLVM is generated at configuration -// time, at which point this header is generated. Do not modify this -// header directly. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_ASM_PARSER -# error Please define the macro LLVM_ASM_PARSER(TargetName) -#endif - -@LLVM_ENUM_ASM_PARSERS@ - -#undef LLVM_ASM_PARSER diff --git a/contrib/llvm/include/llvm/Config/AsmPrinters.def.in b/contrib/llvm/include/llvm/Config/AsmPrinters.def.in deleted file mode 100644 index 9729bd75eb40..000000000000 --- a/contrib/llvm/include/llvm/Config/AsmPrinters.def.in +++ /dev/null @@ -1,29 +0,0 @@ -//===- llvm/Config/AsmPrinters.def - LLVM Assembly Printers -----*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file enumerates all of the assembly-language printers -// supported by this build of LLVM. Clients of this file should define -// the LLVM_ASM_PRINTER macro to be a function-like macro with a -// single parameter (the name of the target whose assembly can be -// generated); including this file will then enumerate all of the -// targets with assembly printers. -// -// The set of targets supported by LLVM is generated at configuration -// time, at which point this header is generated. Do not modify this -// header directly. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_ASM_PRINTER -# error Please define the macro LLVM_ASM_PRINTER(TargetName) -#endif - -@LLVM_ENUM_ASM_PRINTERS@ - -#undef LLVM_ASM_PRINTER diff --git a/contrib/llvm/include/llvm/Config/Disassemblers.def.in b/contrib/llvm/include/llvm/Config/Disassemblers.def.in deleted file mode 100644 index 1b136570933b..000000000000 --- a/contrib/llvm/include/llvm/Config/Disassemblers.def.in +++ /dev/null @@ -1,29 +0,0 @@ -//===- llvm/Config/Disassemblers.def - LLVM Assembly Parsers ----*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file enumerates all of the assembly-language parsers -// supported by this build of LLVM. Clients of this file should define -// the LLVM_ASM_PARSER macro to be a function-like macro with a -// single parameter (the name of the target whose assembly can be -// generated); including this file will then enumerate all of the -// targets with assembly parsers. -// -// The set of targets supported by LLVM is generated at configuration -// time, at which point this header is generated. Do not modify this -// header directly. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_DISASSEMBLER -# error Please define the macro LLVM_DISASSEMBLER(TargetName) -#endif - -@LLVM_ENUM_DISASSEMBLERS@ - -#undef LLVM_DISASSEMBLER diff --git a/contrib/llvm/include/llvm/Config/Targets.def.in b/contrib/llvm/include/llvm/Config/Targets.def.in deleted file mode 100644 index d589ecee12cc..000000000000 --- a/contrib/llvm/include/llvm/Config/Targets.def.in +++ /dev/null @@ -1,28 +0,0 @@ -/*===- llvm/Config/Targets.def - LLVM Target Architectures ------*- C++ -*-===*\ -|* *| -|* The LLVM Compiler Infrastructure *| -|* *| -|* This file is distributed under the University of Illinois Open Source *| -|* License. See LICENSE.TXT for details. *| -|* *| -|*===----------------------------------------------------------------------===*| -|* *| -|* This file enumerates all of the target architectures supported by *| -|* this build of LLVM. Clients of this file should define the *| -|* LLVM_TARGET macro to be a function-like macro with a single *| -|* parameter (the name of the target); including this file will then *| -|* enumerate all of the targets. *| -|* *| -|* The set of targets supported by LLVM is generated at configuration *| -|* time, at which point this header is generated. Do not modify this *| -|* header directly. *| -|* *| -\*===----------------------------------------------------------------------===*/ - -#ifndef LLVM_TARGET -# error Please define the macro LLVM_TARGET(TargetName) -#endif - -@LLVM_ENUM_TARGETS@ - -#undef LLVM_TARGET diff --git a/contrib/llvm/include/llvm/Config/config.h.cmake b/contrib/llvm/include/llvm/Config/config.h.cmake deleted file mode 100644 index e8feabffdaf7..000000000000 --- a/contrib/llvm/include/llvm/Config/config.h.cmake +++ /dev/null @@ -1,641 +0,0 @@ - -/************************************** -** Created by Kevin from config.h.in ** -***************************************/ - -#ifndef CONFIG_H -#define CONFIG_H - -/* Define if dlopen(0) will open the symbols of the program */ -#undef CAN_DLOPEN_SELF - -/* Define if CBE is enabled for printf %a output */ -#undef ENABLE_CBE_PRINTF_A - -/* Directories clang will search for headers */ -#define C_INCLUDE_DIRS "${C_INCLUDE_DIRS}" - -/* Directory clang will search for libstdc++ headers */ -#define CXX_INCLUDE_ROOT "${CXX_INCLUDE_ROOT}" - -/* Architecture of libstdc++ headers */ -#define CXX_INCLUDE_ARCH "${CXX_INCLUDE_ARCH}" - -/* 32 bit multilib directory */ -#define CXX_INCLUDE_32BIT_DIR "${CXX_INCLUDE_32BIT_DIR}" - -/* 64 bit multilib directory */ -#define CXX_INCLUDE_64BIT_DIR "${CXX_INCLUDE_64BIT_DIR}" - -/* Define if position independent code is enabled */ -#cmakedefine ENABLE_PIC ${ENABLE_PIC} - -/* Define if threads enabled */ -#cmakedefine ENABLE_THREADS ${ENABLE_THREADS} - -/* Define to 1 if you have the `argz_append' function. */ -#undef HAVE_ARGZ_APPEND - -/* Define to 1 if you have the `argz_create_sep' function. */ -#undef HAVE_ARGZ_CREATE_SEP - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_ARGZ_H ${HAVE_ARGZ_H} - -/* Define to 1 if you have the `argz_insert' function. */ -#undef HAVE_ARGZ_INSERT - -/* Define to 1 if you have the `argz_next' function. */ -#undef HAVE_ARGZ_NEXT - -/* Define to 1 if you have the `argz_stringify' function. */ -#undef HAVE_ARGZ_STRINGIFY - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_ASSERT_H ${HAVE_ASSERT_H} - -/* Define to 1 if you have the `backtrace' function. */ -#undef HAVE_BACKTRACE - -/* Define to 1 if you have the `bcopy' function. */ -#undef HAVE_BCOPY - -/* Does not have bi-directional iterator */ -#undef HAVE_BI_ITERATOR - -/* Define to 1 if you have the `ceilf' function. */ -#cmakedefine HAVE_CEILF ${HAVE_CEILF} - -/* Define if the neat program is available */ -#cmakedefine HAVE_CIRCO ${HAVE_CIRCO} - -/* Define to 1 if you have the `closedir' function. */ -#undef HAVE_CLOSEDIR - -/* Define to 1 if you have the header file. */ -#undef HAVE_CTYPE_H - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#cmakedefine HAVE_DIRENT_H ${HAVE_DIRENT_H} - -/* Define if you have the GNU dld library. */ -#undef HAVE_DLD - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_DLD_H ${HAVE_DLD_H} - -/* Define to 1 if you have the `dlerror' function. */ -#undef HAVE_DLERROR - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_DLFCN_H ${HAVE_DLFCN_H} - -/* Define if dlopen() is available on this platform. */ -#undef HAVE_DLOPEN - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_DL_H ${HAVE_DL_H} - -/* Define if the dot program is available */ -#cmakedefine HAVE_DOT ${HAVE_DOT} - -/* Define if the dotty program is available */ -#cmakedefine HAVE_DOTTY ${HAVE_DOTTY} - -/* Define if you have the _dyld_func_lookup function. */ -#undef HAVE_DYLD - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_ERRNO_H ${HAVE_ERRNO_H} - -/* Define to 1 if the system has the type `error_t'. */ -#undef HAVE_ERROR_T - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_EXECINFO_H ${HAVE_EXECINFO_H} - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_FCNTL_H ${HAVE_FCNTL_H} - -/* Define if the neat program is available */ -#cmakedefine HAVE_FDP ${HAVE_FDP} - -/* Set to 1 if the finite function is found in */ -#cmakedefine HAVE_FINITE_IN_IEEEFP_H ${HAVE_FINITE_IN_IEEEFP_H} - -/* Define to 1 if you have the `floorf' function. */ -#cmakedefine HAVE_FLOORF ${HAVE_FLOORF} - -/* Does not have forward iterator */ -#undef HAVE_FWD_ITERATOR - -/* Define to 1 if you have the `getcwd' function. */ -#undef HAVE_GETCWD - -/* Define to 1 if you have the `getpagesize' function. */ -#cmakedefine HAVE_GETPAGESIZE ${HAVE_GETPAGESIZE} - -/* Define to 1 if you have the `getrlimit' function. */ -#undef HAVE_GETRLIMIT - -/* Define to 1 if you have the `getrusage' function. */ -#cmakedefine HAVE_GETRUSAGE ${HAVE_GETRUSAGE} - -/* Define to 1 if you have the `gettimeofday' function. */ -#undef HAVE_GETTIMEOFDAY - -/* Does not have */ -#undef HAVE_GLOBAL_HASH_MAP - -/* Does not have hash_set in global namespace */ -#undef HAVE_GLOBAL_HASH_SET - -/* Does not have ext/hash_map */ -#undef HAVE_GNU_EXT_HASH_MAP - -/* Does not have hash_set in gnu namespace */ -#undef HAVE_GNU_EXT_HASH_SET - -/* Define if the Graphviz program is available */ -#undef HAVE_GRAPHVIZ - -/* Define if the gv program is available */ -#cmakedefine HAVE_GV ${HAVE_GV} - -/* Define to 1 if you have the `index' function. */ -#undef HAVE_INDEX - -/* Define to 1 if the system has the type `int64_t'. */ -#undef HAVE_INT64_T - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_INTTYPES_H ${HAVE_INTTYPES_H} - -/* Define to 1 if you have the `isatty' function. */ -#cmakedefine HAVE_ISATTY 1 - -/* Set to 1 if the isinf function is found in */ -#cmakedefine HAVE_ISINF_IN_CMATH ${HAVE_ISINF_IN_CMATH} - -/* Set to 1 if the isinf function is found in */ -#cmakedefine HAVE_ISINF_IN_MATH_H ${HAVE_ISINF_IN_MATH_H} - -/* Set to 1 if the isnan function is found in */ -#cmakedefine HAVE_ISNAN_IN_CMATH ${HAVE_ISNAN_IN_CMATH} - -/* Set to 1 if the isnan function is found in */ -#cmakedefine HAVE_ISNAN_IN_MATH_H ${HAVE_ISNAN_IN_MATH_H} - -/* Define if you have the libdl library or equivalent. */ -#undef HAVE_LIBDL - -/* Define to 1 if you have the `imagehlp' library (-limagehlp). */ -#cmakedefine HAVE_LIBIMAGEHLP ${HAVE_LIBIMAGEHLP} - -/* Define to 1 if you have the `m' library (-lm). */ -#undef HAVE_LIBM - -/* Define to 1 if you have the `psapi' library (-lpsapi). */ -#cmakedefine HAVE_LIBPSAPI ${HAVE_LIBPSAPI} - -/* Define to 1 if you have the `pthread' library (-lpthread). */ -#cmakedefine HAVE_LIBPTHREAD ${HAVE_LIBPTHREAD} - -/* Define to 1 if you have the `udis86' library (-ludis86). */ -#undef HAVE_LIBUDIS86 - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_LIMITS_H ${HAVE_LIMITS_H} - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_LINK_H ${HAVE_LINK_H} - -/* 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. */ -#undef HAVE_LINK_R - -/* Define to 1 if you have the `longjmp' function. */ -#undef HAVE_LONGJMP - -/* Define to 1 if you have the header file. */ -#undef HAVE_MACH_MACH_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MACH_O_DYLD_H - -/* Define if mallinfo() is available on this platform. */ -#cmakedefine HAVE_MALLINFO ${HAVE_MALLINFO} - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_MALLOC_H ${HAVE_MALLOC_H} - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_MALLOC_MALLOC_H ${HAVE_MALLOC_MALLOC_H} - -/* Define to 1 if you have the `malloc_zone_statistics' function. */ -#cmakedefine HAVE_MALLOC_ZONE_STATISTICS ${HAVE_MALLOC_ZONE_STATISTICS} - -/* Define to 1 if you have the `memcpy' function. */ -#undef HAVE_MEMCPY - -/* Define to 1 if you have the `memmove' function. */ -#undef HAVE_MEMMOVE - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_MEMORY_H ${HAVE_MEMORY_H} - -/* Define to 1 if you have the `mkdtemp' function. */ -#cmakedefine HAVE_MKDTEMP ${HAVE_MKDTEMP} - -/* Define to 1 if you have the `mkstemp' function. */ -#cmakedefine HAVE_MKSTEMP ${HAVE_MKSTEMP} - -/* Define to 1 if you have the `mktemp' function. */ -#cmakedefine HAVE_MKTEMP ${HAVE_MKTEMP} - -/* Define to 1 if you have a working `mmap' system call. */ -#undef HAVE_MMAP - -/* Define if mmap() uses MAP_ANONYMOUS to map anonymous pages, or undefine if - it uses MAP_ANON */ -#undef HAVE_MMAP_ANONYMOUS - -/* Define if mmap() can map files into memory */ -#undef HAVE_MMAP_FILE - -/* define if the compiler implements namespaces */ -#undef HAVE_NAMESPACES - -/* Define to 1 if you have the header file, and it defines `DIR'. */ -#cmakedefine HAVE_NDIR_H ${HAVE_NDIR_H} - -/* Define to 1 if you have the `nearbyintf' function. */ -#cmakedefine HAVE_NEARBYINTF ${HAVE_NEARBYINTF} - -/* Define if the neat program is available */ -#cmakedefine HAVE_NEATO ${HAVE_NEATO} - -/* Define to 1 if you have the `opendir' function. */ -#undef HAVE_OPENDIR - -/* Define if libtool can extract symbol lists from object files. */ -#undef HAVE_PRELOADED_SYMBOLS - -/* Define to have the %a format string */ -#undef HAVE_PRINTF_A - -/* Have pthread.h */ -#cmakedefine HAVE_PTHREAD_H ${HAVE_PTHREAD_H} - -/* Have pthread_mutex_lock */ -#cmakedefine HAVE_PTHREAD_MUTEX_LOCK ${HAVE_PTHREAD_MUTEX_LOCK} - -/* Have pthread_rwlock_init */ -#cmakedefine HAVE_PTHREAD_RWLOCK_INIT ${HAVE_PTHREAD_RWLOCK_INIT} - -/* Have pthread_getspecific */ -#cmakedefine HAVE_PTHREAD_GETSPECIFIC ${HAVE_PTHREAD_GETSPECIFIC} - -/* Define to 1 if srand48/lrand48/drand48 exist in */ -#undef HAVE_RAND48 - -/* Define to 1 if you have the `readdir' function. */ -#undef HAVE_READDIR - -/* Define to 1 if you have the `realpath' function. */ -#undef HAVE_REALPATH - -/* Define to 1 if you have the `rindex' function. */ -#undef HAVE_RINDEX - -/* Define to 1 if you have the `rintf' function. */ -#undef HAVE_RINTF - -/* Define to 1 if you have the `roundf' function. */ -#undef HAVE_ROUNDF - -/* Define to 1 if you have the `round' function. */ -#cmakedefine HAVE_ROUND ${HAVE_ROUND} - -/* Define to 1 if you have the `sbrk' function. */ -#cmakedefine HAVE_SBRK ${HAVE_SBRK} - -/* Define to 1 if you have the `setenv' function. */ -#cmakedefine HAVE_SETENV ${HAVE_SETENV} - -/* Define to 1 if you have the `setjmp' function. */ -#undef HAVE_SETJMP - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SETJMP_H ${HAVE_SETJMP_H} - -/* Define to 1 if you have the `setrlimit' function. */ -#cmakedefine HAVE_SETRLIMIT ${HAVE_SETRLIMIT} - -/* Define if you have the shl_load function. */ -#undef HAVE_SHL_LOAD - -/* Define to 1 if you have the `siglongjmp' function. */ -#undef HAVE_SIGLONGJMP - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SIGNAL_H ${HAVE_SIGNAL_H} - -/* Define to 1 if you have the `sigsetjmp' function. */ -#undef HAVE_SIGSETJMP - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_STDINT_H ${HAVE_STDINT_H} - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_STDIO_H ${HAVE_STDIO_H} - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_STDLIB_H ${HAVE_STDLIB_H} - -/* Does not have ext/hash_map> */ -#undef HAVE_STD_EXT_HASH_MAP - -/* Does not have hash_set in std namespace */ -#undef HAVE_STD_EXT_HASH_SET - -/* Set to 1 if the std::isinf function is found in */ -#undef HAVE_STD_ISINF_IN_CMATH - -/* Set to 1 if the std::isnan function is found in */ -#undef HAVE_STD_ISNAN_IN_CMATH - -/* Does not have std namespace iterator */ -#undef HAVE_STD_ITERATOR - -/* Define to 1 if you have the `strchr' function. */ -#undef HAVE_STRCHR - -/* Define to 1 if you have the `strcmp' function. */ -#undef HAVE_STRCMP - -/* Define to 1 if you have the `strdup' function. */ -#undef HAVE_STRDUP - -/* Define to 1 if you have the `strerror' function. */ -#cmakedefine HAVE_STRERROR ${HAVE_STRERROR} - -/* Define to 1 if you have the `strerror_r' function. */ -#cmakedefine HAVE_STRERROR_R ${HAVE_STRERROR_R} - -/* Define to 1 if you have the `strerror_s' function. */ -#cmakedefine HAVE_STRERROR_S ${HAVE_STRERROR_S} - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_STRING_H ${HAVE_STRING_H} - -/* Define to 1 if you have the `strrchr' function. */ -#undef HAVE_STRRCHR - -/* Define to 1 if you have the `strtoll' function. */ -#cmakedefine HAVE_STRTOLL ${HAVE_STRTOLL} - -/* Define to 1 if you have the `strtoq' function. */ -#undef HAVE_STRTOQ - -/* Define to 1 if you have the `sysconf' function. */ -#undef HAVE_SYSCONF - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#cmakedefine HAVE_SYS_DIR_H ${HAVE_SYS_DIR_H} - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_DL_H ${HAVE_SYS_DL_H} - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_IOCTL_H ${HAVE_SYS_IOCTL_H} - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_MMAN_H ${} - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#cmakedefine HAVE_SYS_NDIR_H ${HAVE_SYS_NDIR_H} - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_PARAM_H ${HAVE_SYS_PARAM_H} - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_RESOURCE_H ${HAVE_SYS_RESOURCE_H} - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_STAT_H ${HAVE_SYS_STAT_H} - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_TIME_H ${HAVE_SYS_TIME_H} - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_TYPES_H ${HAVE_SYS_TYPES_H} - -/* Define to 1 if you have that is POSIX.1 compatible. */ -#cmakedefine HAVE_SYS_WAIT_H ${HAVE_SYS_WAIT_H} - -/* Define if the neat program is available */ -#cmakedefine HAVE_TWOPI ${HAVE_TWOPI} - -/* Define to 1 if the system has the type `uint64_t'. */ -#undef HAVE_UINT64_T - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_TERMIOS_H ${HAVE_TERMIOS_H} - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_UNISTD_H ${HAVE_UNISTD_H} - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_UTIME_H ${HAVE_UTIME_H} - -/* Define to 1 if the system has the type `u_int64_t'. */ -#undef HAVE_U_INT64_T - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_VALGRIND_VALGRIND_H ${HAVE_VALGRIND_VALGRIND_H} - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_WINDOWS_H ${HAVE_WINDOWS_H} - -/* Installation directory for binary executables */ -#undef LLVM_BINDIR - -/* Time at which LLVM was configured */ -#undef LLVM_CONFIGTIME - -/* Installation directory for documentation */ -#undef LLVM_DATADIR - -/* Installation directory for config files */ -#undef LLVM_ETCDIR - -/* Host triple we were built on */ -#cmakedefine LLVM_HOSTTRIPLE "${LLVM_HOSTTRIPLE}" - -/* Installation directory for include files */ -#undef LLVM_INCLUDEDIR - -/* Installation directory for .info files */ -#undef LLVM_INFODIR - -/* Installation directory for libraries */ -#undef LLVM_LIBDIR - -/* Installation directory for man pages */ -#undef LLVM_MANDIR - -/* Build multithreading support into LLVM */ -#cmakedefine LLVM_MULTITHREADED ${LLVM_MULTITHREADED} - -/* Define if this is Unixish platform */ -#cmakedefine LLVM_ON_UNIX ${LLVM_ON_UNIX} - -/* Define if this is Win32ish platform */ -#cmakedefine LLVM_ON_WIN32 ${LLVM_ON_WIN32} - -/* Added by Kevin -- Maximum path length */ -#cmakedefine MAXPATHLEN ${MAXPATHLEN} - -/* Define to path to circo program if found or 'echo circo' otherwise */ -#cmakedefine LLVM_PATH_CIRCO "${LLVM_PATH_CIRCO}" - -/* Define to path to dot program if found or 'echo dot' otherwise */ -#cmakedefine LLVM_PATH_DOT "${LLVM_PATH_DOT}" - -/* Define to path to dotty program if found or 'echo dotty' otherwise */ -#cmakedefine LLVM_PATH_DOTTY "${LLVM_PATH_DOTTY}" - -/* Define to path to fdp program if found or 'echo fdp' otherwise */ -#cmakedefine LLVM_PATH_FDP "${LLVM_PATH_FDP}" - -/* Define to path to Graphviz program if found or 'echo Graphviz' otherwise */ -#undef LLVM_PATH_GRAPHVIZ - -/* Define to path to gv program if found or 'echo gv' otherwise */ -#cmakedefine LLVM_PATH_GV "${LLVM_PATH_GV}" - -/* Define to path to neato program if found or 'echo neato' otherwise */ -#cmakedefine LLVM_PATH_NEATO "${LLVM_PATH_NEATO}" - -/* Define to path to twopi program if found or 'echo twopi' otherwise */ -#cmakedefine LLVM_PATH_TWOPI "${LLVM_PATH_TWOPI}" - -/* Installation prefix directory */ -#cmakedefine LLVM_PREFIX "${LLVM_PREFIX}" - -/* Define if the OS needs help to load dependent libraries for dlopen(). */ -#cmakedefine LTDL_DLOPEN_DEPLIBS ${LTDL_DLOPEN_DEPLIBS} - -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#undef LTDL_OBJDIR - -/* Define to the name of the environment variable that determines the dynamic - library search path. */ -#cmakedefine LTDL_SHLIBPATH_VAR "${LTDL_SHLIBPATH_VAR}" - -/* Define to the extension used for shared libraries, say, ".so". */ -#cmakedefine LTDL_SHLIB_EXT "${LTDL_SHLIB_EXT}" - -/* Define to the system default library search path. */ -#cmakedefine LTDL_SYSSEARCHPATH "${LTDL_SYSSEARCHPATH}" - -/* Define if /dev/zero should be used when mapping RWX memory, or undefine if - its not necessary */ -#undef NEED_DEV_ZERO_FOR_MMAP - -/* Define if dlsym() requires a leading underscore in symbol names. */ -#undef NEED_USCORE - -/* Define to the address where bug reports for this package should be sent. */ -#cmakedefine PACKAGE_BUGREPORT "${PACKAGE_BUGREPORT}" - -/* Define to the full name of this package. */ -#cmakedefine PACKAGE_NAME "${PACKAGE_NAME}" - -/* Define to the full name and version of this package. */ -#cmakedefine PACKAGE_STRING "${PACKAGE_STRING}" - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#cmakedefine PACKAGE_VERSION "${PACKAGE_VERSION}" - -/* Define as the return type of signal handlers (`int' or `void'). */ -#cmakedefine RETSIGTYPE ${RETSIGTYPE} - -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at runtime. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ -#undef STACK_DIRECTION - -/* Define to 1 if the `S_IS*' macros in do not work properly. */ -#undef STAT_MACROS_BROKEN - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to 1 if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - -/* Define to 1 if your declares `struct tm'. */ -#undef TM_IN_SYS_TIME - -/* Define if use udis86 library */ -#undef USE_UDIS86 - -/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a - `char[]'. */ -#undef YYTEXT_POINTER - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to a type to use for `error_t' if it is not otherwise available. */ -#cmakedefine error_t ${error_t} - -/* Define to a type to use for `mode_t' if it is not otherwise available. */ -#cmakedefine mode_t ${mode_t} - -/* Define to `int' if does not define. */ -#undef pid_t - -/* Define to `unsigned int' if does not define. */ -#undef size_t - -/* Define to a function replacing strtoll */ -#cmakedefine strtoll ${strtoll} - -/* Define to a function implementing strtoull */ -#cmakedefine strtoull ${strtoull} - -/* Define to a function implementing stricmp */ -#cmakedefine stricmp ${stricmp} - -/* Define to a function implementing strdup */ -#cmakedefine strdup ${strdup} - -/* LLVM architecture name for the native architecture, if available */ -#cmakedefine LLVM_NATIVE_ARCH ${LLVM_NATIVE_ARCH} - -/* LLVM name for the native Target init function, if available */ -#cmakedefine LLVM_NATIVE_TARGET LLVMInitialize${LLVM_NATIVE_ARCH}Target - -/* LLVM name for the native TargetInfo init function, if available */ -#cmakedefine LLVM_NATIVE_TARGETINFO LLVMInitialize${LLVM_NATIVE_ARCH}TargetInfo - -/* LLVM name for the native AsmPrinter init function, if available */ -#cmakedefine LLVM_NATIVE_ASMPRINTER LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter - -#endif diff --git a/contrib/llvm/include/llvm/Config/config.h.in b/contrib/llvm/include/llvm/Config/config.h.in deleted file mode 100644 index d62da1ab0377..000000000000 --- a/contrib/llvm/include/llvm/Config/config.h.in +++ /dev/null @@ -1,617 +0,0 @@ -/* include/llvm/Config/config.h.in. Generated from autoconf/configure.ac by autoheader. */ - -#ifndef CONFIG_H -#define CONFIG_H - -/* 32 bit multilib directory. */ -#undef CXX_INCLUDE_32BIT_DIR - -/* 64 bit multilib directory. */ -#undef CXX_INCLUDE_64BIT_DIR - -/* Arch the libstdc++ headers. */ -#undef CXX_INCLUDE_ARCH - -/* Directory with the libstdc++ headers. */ -#undef CXX_INCLUDE_ROOT - -/* Directories clang will search for headers */ -#undef C_INCLUDE_DIRS - -/* Define if CBE is enabled for printf %a output */ -#undef ENABLE_CBE_PRINTF_A - -/* Define if position independent code is enabled */ -#undef ENABLE_PIC - -/* Define if threads enabled */ -#undef ENABLE_THREADS - -/* Define if timestamp information (e.g., __DATE___) is allowed */ -#undef ENABLE_TIMESTAMPS - -/* Define to 1 if you have the `argz_append' function. */ -#undef HAVE_ARGZ_APPEND - -/* Define to 1 if you have the `argz_create_sep' function. */ -#undef HAVE_ARGZ_CREATE_SEP - -/* Define to 1 if you have the header file. */ -#undef HAVE_ARGZ_H - -/* Define to 1 if you have the `argz_insert' function. */ -#undef HAVE_ARGZ_INSERT - -/* Define to 1 if you have the `argz_next' function. */ -#undef HAVE_ARGZ_NEXT - -/* Define to 1 if you have the `argz_stringify' function. */ -#undef HAVE_ARGZ_STRINGIFY - -/* Define to 1 if you have the header file. */ -#undef HAVE_ASSERT_H - -/* Define to 1 if you have the `backtrace' function. */ -#undef HAVE_BACKTRACE - -/* Define to 1 if you have the `bcopy' function. */ -#undef HAVE_BCOPY - -/* Define to 1 if you have the `ceilf' function. */ -#undef HAVE_CEILF - -/* Define if the neat program is available */ -#undef HAVE_CIRCO - -/* Define to 1 if you have the `closedir' function. */ -#undef HAVE_CLOSEDIR - -/* Define to 1 if you have the header file. */ -#undef HAVE_CRASHREPORTERCLIENT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_CTYPE_H - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_DIRENT_H - -/* Define if you have the GNU dld library. */ -#undef HAVE_DLD - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLD_H - -/* Define to 1 if you have the `dlerror' function. */ -#undef HAVE_DLERROR - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define if dlopen() is available on this platform. */ -#undef HAVE_DLOPEN - -/* Define to 1 if you have the header file. */ -#undef HAVE_DL_H - -/* Define if the dot program is available */ -#undef HAVE_DOT - -/* Define if the dotty program is available */ -#undef HAVE_DOTTY - -/* Define if you have the _dyld_func_lookup function. */ -#undef HAVE_DYLD - -/* Define to 1 if you have the header file. */ -#undef HAVE_ERRNO_H - -/* Define to 1 if the system has the type `error_t'. */ -#undef HAVE_ERROR_T - -/* Define to 1 if you have the header file. */ -#undef HAVE_EXECINFO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_FCNTL_H - -/* Define if the neat program is available */ -#undef HAVE_FDP - -/* Define if libffi is available on this platform. */ -#undef HAVE_FFI_CALL - -/* Define to 1 if you have the header file. */ -#undef HAVE_FFI_FFI_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_FFI_H - -/* Set to 1 if the finite function is found in */ -#undef HAVE_FINITE_IN_IEEEFP_H - -/* Define to 1 if you have the `floorf' function. */ -#undef HAVE_FLOORF - -/* Define to 1 if you have the `fmodf' function. */ -#undef HAVE_FMODF - -/* Define to 1 if you have the `getcwd' function. */ -#undef HAVE_GETCWD - -/* Define to 1 if you have the `getpagesize' function. */ -#undef HAVE_GETPAGESIZE - -/* Define to 1 if you have the `getrlimit' function. */ -#undef HAVE_GETRLIMIT - -/* Define to 1 if you have the `getrusage' function. */ -#undef HAVE_GETRUSAGE - -/* Define to 1 if you have the `gettimeofday' function. */ -#undef HAVE_GETTIMEOFDAY - -/* Define if the Graphviz program is available */ -#undef HAVE_GRAPHVIZ - -/* Define if the gv program is available */ -#undef HAVE_GV - -/* Define to 1 if you have the `index' function. */ -#undef HAVE_INDEX - -/* Define to 1 if the system has the type `int64_t'. */ -#undef HAVE_INT64_T - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the `isatty' function. */ -#undef HAVE_ISATTY - -/* Set to 1 if the isinf function is found in */ -#undef HAVE_ISINF_IN_CMATH - -/* Set to 1 if the isinf function is found in */ -#undef HAVE_ISINF_IN_MATH_H - -/* Set to 1 if the isnan function is found in */ -#undef HAVE_ISNAN_IN_CMATH - -/* Set to 1 if the isnan function is found in */ -#undef HAVE_ISNAN_IN_MATH_H - -/* Define if you have the libdl library or equivalent. */ -#undef HAVE_LIBDL - -/* Define to 1 if you have the `imagehlp' library (-limagehlp). */ -#undef HAVE_LIBIMAGEHLP - -/* Define to 1 if you have the `m' library (-lm). */ -#undef HAVE_LIBM - -/* Define to 1 if you have the `psapi' library (-lpsapi). */ -#undef HAVE_LIBPSAPI - -/* Define to 1 if you have the `pthread' library (-lpthread). */ -#undef HAVE_LIBPTHREAD - -/* Define to 1 if you have the `udis86' library (-ludis86). */ -#undef HAVE_LIBUDIS86 - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Define if you can use -Wl,-export-dynamic. */ -#undef HAVE_LINK_EXPORT_DYNAMIC - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINK_H - -/* 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. */ -#undef HAVE_LINK_R - -/* Define to 1 if you have the `longjmp' function. */ -#undef HAVE_LONGJMP - -/* Define to 1 if you have the header file. */ -#undef HAVE_MACH_MACH_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MACH_O_DYLD_H - -/* Define if mallinfo() is available on this platform. */ -#undef HAVE_MALLINFO - -/* Define to 1 if you have the header file. */ -#undef HAVE_MALLOC_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MALLOC_MALLOC_H - -/* Define to 1 if you have the `malloc_zone_statistics' function. */ -#undef HAVE_MALLOC_ZONE_STATISTICS - -/* Define to 1 if you have the `memcpy' function. */ -#undef HAVE_MEMCPY - -/* Define to 1 if you have the `memmove' function. */ -#undef HAVE_MEMMOVE - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `mkdtemp' function. */ -#undef HAVE_MKDTEMP - -/* Define to 1 if you have the `mkstemp' function. */ -#undef HAVE_MKSTEMP - -/* Define to 1 if you have the `mktemp' function. */ -#undef HAVE_MKTEMP - -/* Define to 1 if you have a working `mmap' system call. */ -#undef HAVE_MMAP - -/* Define if mmap() uses MAP_ANONYMOUS to map anonymous pages, or undefine if - it uses MAP_ANON */ -#undef HAVE_MMAP_ANONYMOUS - -/* Define if mmap() can map files into memory */ -#undef HAVE_MMAP_FILE - -/* Define to 1 if you have the header file, and it defines `DIR'. */ -#undef HAVE_NDIR_H - -/* Define to 1 if you have the `nearbyintf' function. */ -#undef HAVE_NEARBYINTF - -/* Define if the neat program is available */ -#undef HAVE_NEATO - -/* Define to 1 if you have the `opendir' function. */ -#undef HAVE_OPENDIR - -/* Define to 1 if you have the `posix_spawn' function. */ -#undef HAVE_POSIX_SPAWN - -/* Define to 1 if you have the `powf' function. */ -#undef HAVE_POWF - -/* Define if libtool can extract symbol lists from object files. */ -#undef HAVE_PRELOADED_SYMBOLS - -/* Define to have the %a format string */ -#undef HAVE_PRINTF_A - -/* Have pthread_getspecific */ -#undef HAVE_PTHREAD_GETSPECIFIC - -/* Define to 1 if you have the header file. */ -#undef HAVE_PTHREAD_H - -/* Have pthread_mutex_lock */ -#undef HAVE_PTHREAD_MUTEX_LOCK - -/* Have pthread_rwlock_init */ -#undef HAVE_PTHREAD_RWLOCK_INIT - -/* Define to 1 if srand48/lrand48/drand48 exist in */ -#undef HAVE_RAND48 - -/* Define to 1 if you have the `readdir' function. */ -#undef HAVE_READDIR - -/* Define to 1 if you have the `realpath' function. */ -#undef HAVE_REALPATH - -/* Define to 1 if you have the `rindex' function. */ -#undef HAVE_RINDEX - -/* Define to 1 if you have the `rintf' function. */ -#undef HAVE_RINTF - -/* Define to 1 if you have the `round' function. */ -#undef HAVE_ROUND - -/* Define to 1 if you have the `roundf' function. */ -#undef HAVE_ROUNDF - -/* Define to 1 if you have the `sbrk' function. */ -#undef HAVE_SBRK - -/* Define to 1 if you have the `setenv' function. */ -#undef HAVE_SETENV - -/* Define to 1 if you have the `setjmp' function. */ -#undef HAVE_SETJMP - -/* Define to 1 if you have the header file. */ -#undef HAVE_SETJMP_H - -/* Define to 1 if you have the `setrlimit' function. */ -#undef HAVE_SETRLIMIT - -/* Define if you have the shl_load function. */ -#undef HAVE_SHL_LOAD - -/* Define to 1 if you have the `siglongjmp' function. */ -#undef HAVE_SIGLONGJMP - -/* Define to 1 if you have the header file. */ -#undef HAVE_SIGNAL_H - -/* Define to 1 if you have the `sigsetjmp' function. */ -#undef HAVE_SIGSETJMP - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Set to 1 if the std::isinf function is found in */ -#undef HAVE_STD_ISINF_IN_CMATH - -/* Set to 1 if the std::isnan function is found in */ -#undef HAVE_STD_ISNAN_IN_CMATH - -/* Define to 1 if you have the `strchr' function. */ -#undef HAVE_STRCHR - -/* Define to 1 if you have the `strcmp' function. */ -#undef HAVE_STRCMP - -/* Define to 1 if you have the `strdup' function. */ -#undef HAVE_STRDUP - -/* Define to 1 if you have the `strerror' function. */ -#undef HAVE_STRERROR - -/* Define to 1 if you have the `strerror_r' function. */ -#undef HAVE_STRERROR_R - -/* Define to 1 if you have the `strerror_s' function. */ -#undef HAVE_STRERROR_S - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `strrchr' function. */ -#undef HAVE_STRRCHR - -/* Define to 1 if you have the `strtof' function. */ -#undef HAVE_STRTOF - -/* Define to 1 if you have the `strtoll' function. */ -#undef HAVE_STRTOLL - -/* Define to 1 if you have the `strtoq' function. */ -#undef HAVE_STRTOQ - -/* Define to 1 if you have the `sysconf' function. */ -#undef HAVE_SYSCONF - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_DIR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_DL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_IOCTL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_MMAN_H - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_NDIR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PARAM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_RESOURCE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have that is POSIX.1 compatible. */ -#undef HAVE_SYS_WAIT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_TERMIOS_H - -/* Define if the neat program is available */ -#undef HAVE_TWOPI - -/* Define to 1 if the system has the type `uint64_t'. */ -#undef HAVE_UINT64_T - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UTIME_H - -/* Define to 1 if the system has the type `u_int64_t'. */ -#undef HAVE_U_INT64_T - -/* Define to 1 if you have the header file. */ -#undef HAVE_VALGRIND_VALGRIND_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_WINDOWS_H - -/* Define to 1 if you have the `__dso_handle' function. */ -#undef HAVE___DSO_HANDLE - -/* Linker version detected at compile time. */ -#undef HOST_LINK_VERSION - -/* Installation directory for binary executables */ -#undef LLVM_BINDIR - -/* Time at which LLVM was configured */ -#undef LLVM_CONFIGTIME - -/* Installation directory for data files */ -#undef LLVM_DATADIR - -/* Installation directory for documentation */ -#undef LLVM_DOCSDIR - -/* Installation directory for config files */ -#undef LLVM_ETCDIR - -/* Host triple we were built on */ -#undef LLVM_HOSTTRIPLE - -/* Installation directory for include files */ -#undef LLVM_INCLUDEDIR - -/* Installation directory for .info files */ -#undef LLVM_INFODIR - -/* Installation directory for libraries */ -#undef LLVM_LIBDIR - -/* Installation directory for man pages */ -#undef LLVM_MANDIR - -/* Build multithreading support into LLVM */ -#undef LLVM_MULTITHREADED - -/* LLVM architecture name for the native architecture, if available */ -#undef LLVM_NATIVE_ARCH - -/* LLVM name for the native AsmPrinter init function, if available */ -#undef LLVM_NATIVE_ASMPRINTER - -/* LLVM name for the native Target init function, if available */ -#undef LLVM_NATIVE_TARGET - -/* LLVM name for the native TargetInfo init function, if available */ -#undef LLVM_NATIVE_TARGETINFO - -/* Define if this is Unixish platform */ -#undef LLVM_ON_UNIX - -/* Define if this is Win32ish platform */ -#undef LLVM_ON_WIN32 - -/* Define to path to circo program if found or 'echo circo' otherwise */ -#undef LLVM_PATH_CIRCO - -/* Define to path to dot program if found or 'echo dot' otherwise */ -#undef LLVM_PATH_DOT - -/* Define to path to dotty program if found or 'echo dotty' otherwise */ -#undef LLVM_PATH_DOTTY - -/* Define to path to fdp program if found or 'echo fdp' otherwise */ -#undef LLVM_PATH_FDP - -/* Define to path to Graphviz program if found or 'echo Graphviz' otherwise */ -#undef LLVM_PATH_GRAPHVIZ - -/* Define to path to gv program if found or 'echo gv' otherwise */ -#undef LLVM_PATH_GV - -/* Define to path to neato program if found or 'echo neato' otherwise */ -#undef LLVM_PATH_NEATO - -/* Define to path to twopi program if found or 'echo twopi' otherwise */ -#undef LLVM_PATH_TWOPI - -/* Installation prefix directory */ -#undef LLVM_PREFIX - -/* Define if the OS needs help to load dependent libraries for dlopen(). */ -#undef LTDL_DLOPEN_DEPLIBS - -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#undef LTDL_OBJDIR - -/* Define to the name of the environment variable that determines the dynamic - library search path. */ -#undef LTDL_SHLIBPATH_VAR - -/* Define to the extension used for shared libraries, say, ".so". */ -#undef LTDL_SHLIB_EXT - -/* Define to the system default library search path. */ -#undef LTDL_SYSSEARCHPATH - -/* Define if /dev/zero should be used when mapping RWX memory, or undefine if - its not necessary */ -#undef NEED_DEV_ZERO_FOR_MMAP - -/* Define if dlsym() requires a leading underscore in symbol names. */ -#undef NEED_USCORE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define as the return type of signal handlers (`int' or `void'). */ -#undef RETSIGTYPE - -/* Define to 1 if the `S_IS*' macros in do not work properly. */ -#undef STAT_MACROS_BROKEN - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to 1 if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - -/* Define to 1 if your declares `struct tm'. */ -#undef TM_IN_SYS_TIME - -/* Define if we have the oprofile JIT-support library */ -#undef USE_OPROFILE - -/* Define if use udis86 library */ -#undef USE_UDIS86 - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to a type to use for `error_t' if it is not otherwise available. */ -#undef error_t - -/* Define to `int' if does not define. */ -#undef pid_t - -/* Define to `unsigned int' if does not define. */ -#undef size_t - -#endif diff --git a/contrib/llvm/include/llvm/Config/llvm-config.h.cmake b/contrib/llvm/include/llvm/Config/llvm-config.h.cmake deleted file mode 100644 index 8469bcc60674..000000000000 --- a/contrib/llvm/include/llvm/Config/llvm-config.h.cmake +++ /dev/null @@ -1,97 +0,0 @@ -/*===-- llvm/config/llvm-config.h - llvm configure variable -------*- C -*-===*/ -/* */ -/* The LLVM Compiler Infrastructure */ -/* */ -/* This file is distributed under the University of Illinois Open Source */ -/* License. See LICENSE.TXT for details. */ -/* */ -/*===----------------------------------------------------------------------===*/ - -/* This file enumerates all of the llvm variables from configure so that - they can be in exported headers and won't override package specific - directives. This is a C file so we can include it in the llvm-c headers. */ - -/* To avoid multiple inclusions of these variables when we include the exported - headers and config.h, conditionally include these. */ -/* TODO: This is a bit of a hack. */ -#ifndef CONFIG_H - -/* Installation directory for binary executables */ -#cmakedefine LLVM_BINDIR "${LLVM_BINDIR}" - -/* Time at which LLVM was configured */ -#cmakedefine LLVM_CONFIGTIME "${LLVM_CONFIGTIME}" - -/* Installation directory for data files */ -#cmakedefine LLVM_DATADIR "${LLVM_DATADIR}" - -/* Installation directory for documentation */ -#cmakedefine LLVM_DOCSDIR "${LLVM_DOCSDIR}" - -/* Installation directory for config files */ -#cmakedefine LLVM_ETCDIR "${LLVM_ETCDIR}" - -/* Host triple we were built on */ -#cmakedefine LLVM_HOSTTRIPLE "${LLVM_HOSTTRIPLE}" - -/* Installation directory for include files */ -#cmakedefine LLVM_INCLUDEDIR "${LLVM_INCLUDEDIR}" - -/* Installation directory for .info files */ -#cmakedefine LLVM_INFODIR "${LLVM_INFODIR}" - -/* Installation directory for libraries */ -#cmakedefine LLVM_LIBDIR "${LLVM_LIBDIR}" - -/* Installation directory for man pages */ -#cmakedefine LLVM_MANDIR "${LLVM_MANDIR}" - -/* Build multithreading support into LLVM */ -#cmakedefine LLVM_MULTITHREADED - -/* LLVM architecture name for the native architecture, if available */ -#cmakedefine LLVM_NATIVE_ARCH ${LLVM_NATIVE_ARCH} - -/* LLVM name for the native Target init function, if available */ -#cmakedefine LLVM_NATIVE_TARGET LLVMInitialize${LLVM_NATIVE_ARCH}Target - -/* LLVM name for the native TargetInfo init function, if available */ -#cmakedefine LLVM_NATIVE_TARGETINFO LLVMInitialize${LLVM_NATIVE_ARCH}TargetInfo - -/* LLVM name for the native AsmPrinter init function, if available */ -#cmakedefine LLVM_NATIVE_ASMPRINTER LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter - -/* Define if this is Unixish platform */ -#cmakedefine LLVM_ON_UNIX - -/* Define if this is Win32ish platform */ -#cmakedefine LLVM_ON_WIN32 - -/* Define to path to circo program if found or 'echo circo' otherwise */ -#cmakedefine LLVM_PATH_CIRCO "${LLVM_PATH_CIRCO}" - -/* Define to path to dot program if found or 'echo dot' otherwise */ -#cmakedefine LLVM_PATH_DOT "${LLVM_PATH_DOT}" - -/* Define to path to dotty program if found or 'echo dotty' otherwise */ -#cmakedefine LLVM_PATH_DOTTY "${LLVM_PATH_DOTTY}" - -/* Define to path to fdp program if found or 'echo fdp' otherwise */ -#cmakedefine LLVM_PATH_FDP "${LLVM_PATH_FDP}" - -/* Define to path to Graphviz program if found or 'echo Graphviz' otherwise */ -#cmakedefine LLVM_PATH_GRAPHVIZ "${LLVM_PATH_GRAPHVIZ}" - -/* Define to path to gv program if found or 'echo gv' otherwise */ -#cmakedefine LLVM_PATH_GV "${LLVM_PATH_GV}" - -/* Define to path to neato program if found or 'echo neato' otherwise */ -#cmakedefine LLVM_PATH_NEATO "${LLVM_PATH_NEATO}" - -/* Define to path to twopi program if found or 'echo twopi' otherwise */ -#cmakedefine LLVM_PATH_TWOPI "${LLVM_PATH_TWOPI}" - -/* Installation prefix directory */ -#cmakedefine LLVM_PREFIX "${LLVM_PREFIX}" - -#endif diff --git a/contrib/llvm/include/llvm/Config/llvm-config.h.in b/contrib/llvm/include/llvm/Config/llvm-config.h.in deleted file mode 100644 index e7a04ee91bb9..000000000000 --- a/contrib/llvm/include/llvm/Config/llvm-config.h.in +++ /dev/null @@ -1,97 +0,0 @@ -/*===-- llvm/config/llvm-config.h - llvm configure variable -------*- C -*-===*/ -/* */ -/* The LLVM Compiler Infrastructure */ -/* */ -/* This file is distributed under the University of Illinois Open Source */ -/* License. See LICENSE.TXT for details. */ -/* */ -/*===----------------------------------------------------------------------===*/ - -/* This file enumerates all of the llvm variables from configure so that - they can be in exported headers and won't override package specific - directives. This is a C file so we can include it in the llvm-c headers. */ - -/* To avoid multiple inclusions of these variables when we include the exported - headers and config.h, conditionally include these. */ -/* TODO: This is a bit of a hack. */ -#ifndef CONFIG_H - -/* Installation directory for binary executables */ -#undef LLVM_BINDIR - -/* Time at which LLVM was configured */ -#undef LLVM_CONFIGTIME - -/* Installation directory for data files */ -#undef LLVM_DATADIR - -/* Installation directory for documentation */ -#undef LLVM_DOCSDIR - -/* Installation directory for config files */ -#undef LLVM_ETCDIR - -/* Host triple we were built on */ -#undef LLVM_HOSTTRIPLE - -/* Installation directory for include files */ -#undef LLVM_INCLUDEDIR - -/* Installation directory for .info files */ -#undef LLVM_INFODIR - -/* Installation directory for libraries */ -#undef LLVM_LIBDIR - -/* Installation directory for man pages */ -#undef LLVM_MANDIR - -/* Build multithreading support into LLVM */ -#undef LLVM_MULTITHREADED - -/* LLVM architecture name for the native architecture, if available */ -#undef LLVM_NATIVE_ARCH - -/* LLVM name for the native Target init function, if available */ -#undef LLVM_NATIVE_TARGET - -/* LLVM name for the native TargetInfo init function, if available */ -#undef LLVM_NATIVE_TARGETINFO - -/* LLVM name for the native AsmPrinter init function, if available */ -#undef LLVM_NATIVE_ASMPRINTER - -/* Define if this is Unixish platform */ -#undef LLVM_ON_UNIX - -/* Define if this is Win32ish platform */ -#undef LLVM_ON_WIN32 - -/* Define to path to circo program if found or 'echo circo' otherwise */ -#undef LLVM_PATH_CIRCO - -/* Define to path to dot program if found or 'echo dot' otherwise */ -#undef LLVM_PATH_DOT - -/* Define to path to dotty program if found or 'echo dotty' otherwise */ -#undef LLVM_PATH_DOTTY - -/* Define to path to fdp program if found or 'echo fdp' otherwise */ -#undef LLVM_PATH_FDP - -/* Define to path to Graphviz program if found or 'echo Graphviz' otherwise */ -#undef LLVM_PATH_GRAPHVIZ - -/* Define to path to gv program if found or 'echo gv' otherwise */ -#undef LLVM_PATH_GV - -/* Define to path to neato program if found or 'echo neato' otherwise */ -#undef LLVM_PATH_NEATO - -/* Define to path to twopi program if found or 'echo twopi' otherwise */ -#undef LLVM_PATH_TWOPI - -/* Installation prefix directory */ -#undef LLVM_PREFIX - -#endif diff --git a/contrib/llvm/include/llvm/System/DataTypes.h.cmake b/contrib/llvm/include/llvm/System/DataTypes.h.cmake deleted file mode 100644 index 9efe75a56ebc..000000000000 --- a/contrib/llvm/include/llvm/System/DataTypes.h.cmake +++ /dev/null @@ -1,189 +0,0 @@ -/*===-- include/System/DataTypes.h - Define fixed size types -----*- C -*-===*\ -|* *| -|* The LLVM Compiler Infrastructure *| -|* *| -|* This file is distributed under the University of Illinois Open Source *| -|* License. See LICENSE.TXT for details. *| -|* *| -|*===----------------------------------------------------------------------===*| -|* *| -|* This file contains definitions to figure out the size of _HOST_ data types.*| -|* This file is important because different host OS's define different macros,*| -|* which makes portability tough. This file exports the following *| -|* definitions: *| -|* *| -|* [u]int(32|64)_t : typedefs for signed and unsigned 32/64 bit system types*| -|* [U]INT(8|16|32|64)_(MIN|MAX) : Constants for the min and max values. *| -|* *| -|* No library is required when using these functinons. *| -|* *| -|*===----------------------------------------------------------------------===*/ - -/* Please leave this file C-compatible. */ - -#ifndef SUPPORT_DATATYPES_H -#define SUPPORT_DATATYPES_H - -#cmakedefine HAVE_SYS_TYPES_H ${HAVE_SYS_TYPES_H} -#cmakedefine HAVE_INTTYPES_H ${HAVE_INTTYPES_H} -#cmakedefine HAVE_STDINT_H ${HAVE_STDINT_H} -#cmakedefine HAVE_UINT64_T ${HAVE_UINT64_T} -#cmakedefine HAVE_U_INT64_T ${HAVE_U_INT64_T} - -#ifdef __cplusplus -#include -#else -#include -#endif - -#ifndef _MSC_VER - -/* Note that this header's correct operation depends on __STDC_LIMIT_MACROS - being defined. We would define it here, but in order to prevent Bad Things - happening when system headers or C++ STL headers include stdint.h before we - define it here, we define it on the g++ command line (in Makefile.rules). */ -#if !defined(__STDC_LIMIT_MACROS) -# error "Must #define __STDC_LIMIT_MACROS before #including System/DataTypes.h" -#endif - -#if !defined(__STDC_CONSTANT_MACROS) -# error "Must #define __STDC_CONSTANT_MACROS before " \ - "#including System/DataTypes.h" -#endif - -/* Note that includes , if this is a C99 system. */ -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#ifdef HAVE_INTTYPES_H -#include -#endif - -#ifdef HAVE_STDINT_H -#include -#endif - -#ifdef _AIX -#include "llvm/System/AIXDataTypesFix.h" -#endif - -/* Handle incorrect definition of uint64_t as u_int64_t */ -#ifndef HAVE_UINT64_T -#ifdef HAVE_U_INT64_T -typedef u_int64_t uint64_t; -#else -# error "Don't have a definition for uint64_t on this platform" -#endif -#endif - -#ifdef _OpenBSD_ -#define INT8_MAX 127 -#define INT8_MIN -128 -#define UINT8_MAX 255 -#define INT16_MAX 32767 -#define INT16_MIN -32768 -#define UINT16_MAX 65535 -#define INT32_MAX 2147483647 -#define INT32_MIN -2147483648 -#define UINT32_MAX 4294967295U -#endif - -#else /* _MSC_VER */ -/* Visual C++ doesn't provide standard integer headers, but it does provide - built-in data types. */ -#include -#include -#include -#ifdef __cplusplus -#include -#else -#include -#endif -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; -typedef signed int int32_t; -typedef unsigned int uint32_t; -typedef short int16_t; -typedef unsigned short uint16_t; -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef signed int ssize_t; -#ifndef INT8_MAX -# define INT8_MAX 127 -#endif -#ifndef INT8_MIN -# define INT8_MIN -128 -#endif -#ifndef UINT8_MAX -# define UINT8_MAX 255 -#endif -#ifndef INT16_MAX -# define INT16_MAX 32767 -#endif -#ifndef INT16_MIN -# define INT16_MIN -32768 -#endif -#ifndef UINT16_MAX -# define UINT16_MAX 65535 -#endif -#ifndef INT32_MAX -# define INT32_MAX 2147483647 -#endif -#ifndef INT32_MIN -# define INT32_MIN -2147483648 -#endif -#ifndef UINT32_MAX -# define UINT32_MAX 4294967295U -#endif -/* Certain compatibility updates to VC++ introduce the `cstdint' - * header, which defines the INT*_C macros. On default installs they - * are absent. */ -#ifndef INT8_C -# define INT8_C(C) C##i8 -#endif -#ifndef UINT8_C -# define UINT8_C(C) C##ui8 -#endif -#ifndef INT16_C -# define INT16_C(C) C##i16 -#endif -#ifndef UINT16_C -# define UINT16_C(C) C##ui16 -#endif -#ifndef INT32_C -# define INT32_C(C) C##i32 -#endif -#ifndef UINT32_C -# define UINT32_C(C) C##ui32 -#endif -#ifndef INT64_C -# define INT64_C(C) C##i64 -#endif -#ifndef UINT64_C -# define UINT64_C(C) C##ui64 -#endif -#endif /* _MSC_VER */ - -/* Set defaults for constants which we cannot find. */ -#if !defined(INT64_MAX) -# define INT64_MAX 9223372036854775807LL -#endif -#if !defined(INT64_MIN) -# define INT64_MIN ((-INT64_MAX)-1) -#endif -#if !defined(UINT64_MAX) -# define UINT64_MAX 0xffffffffffffffffULL -#endif - -#if __GNUC__ > 3 -#define END_WITH_NULL __attribute__((sentinel)) -#else -#define END_WITH_NULL -#endif - -#ifndef HUGE_VALF -#define HUGE_VALF (float)HUGE_VAL -#endif - -#endif /* SUPPORT_DATATYPES_H */ diff --git a/contrib/llvm/include/llvm/System/DataTypes.h.in b/contrib/llvm/include/llvm/System/DataTypes.h.in deleted file mode 100644 index 6537f3010fae..000000000000 --- a/contrib/llvm/include/llvm/System/DataTypes.h.in +++ /dev/null @@ -1,111 +0,0 @@ -/*===-- include/System/DataTypes.h - Define fixed size types -----*- C -*-===*\ -|* *| -|* The LLVM Compiler Infrastructure *| -|* *| -|* This file is distributed under the University of Illinois Open Source *| -|* License. See LICENSE.TXT for details. *| -|* *| -|*===----------------------------------------------------------------------===*| -|* *| -|* This file contains definitions to figure out the size of _HOST_ data types.*| -|* This file is important because different host OS's define different macros,*| -|* which makes portability tough. This file exports the following *| -|* definitions: *| -|* *| -|* [u]int(32|64)_t : typedefs for signed and unsigned 32/64 bit system types*| -|* [U]INT(8|16|32|64)_(MIN|MAX) : Constants for the min and max values. *| -|* *| -|* No library is required when using these functions. *| -|* *| -|*===----------------------------------------------------------------------===*/ - -/* Please leave this file C-compatible. */ - -#ifndef SUPPORT_DATATYPES_H -#define SUPPORT_DATATYPES_H - -#undef HAVE_SYS_TYPES_H -#undef HAVE_INTTYPES_H -#undef HAVE_STDINT_H -#undef HAVE_UINT64_T -#undef HAVE_U_INT64_T - -#ifdef __cplusplus -#include -#else -#include -#endif - -/* Note that this header's correct operation depends on __STDC_LIMIT_MACROS - being defined. We would define it here, but in order to prevent Bad Things - happening when system headers or C++ STL headers include stdint.h before we - define it here, we define it on the g++ command line (in Makefile.rules). */ -#if !defined(__STDC_LIMIT_MACROS) -# error "Must #define __STDC_LIMIT_MACROS before #including System/DataTypes.h" -#endif - -#if !defined(__STDC_CONSTANT_MACROS) -# error "Must #define __STDC_CONSTANT_MACROS before " \ - "#including System/DataTypes.h" -#endif - -/* Note that includes , if this is a C99 system. */ -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#ifdef HAVE_INTTYPES_H -#include -#endif - -#ifdef HAVE_STDINT_H -#include -#endif - -#ifdef _AIX -#include "llvm/System/AIXDataTypesFix.h" -#endif - -/* Handle incorrect definition of uint64_t as u_int64_t */ -#ifndef HAVE_UINT64_T -#ifdef HAVE_U_INT64_T -typedef u_int64_t uint64_t; -#else -# error "Don't have a definition for uint64_t on this platform" -#endif -#endif - -#ifdef _OpenBSD_ -#define INT8_MAX 127 -#define INT8_MIN -128 -#define UINT8_MAX 255 -#define INT16_MAX 32767 -#define INT16_MIN -32768 -#define UINT16_MAX 65535 -#define INT32_MAX 2147483647 -#define INT32_MIN -2147483648 -#define UINT32_MAX 4294967295U -#endif - -/* Set defaults for constants which we cannot find. */ -#if !defined(INT64_MAX) -# define INT64_MAX 9223372036854775807LL -#endif -#if !defined(INT64_MIN) -# define INT64_MIN ((-INT64_MAX)-1) -#endif -#if !defined(UINT64_MAX) -# define UINT64_MAX 0xffffffffffffffffULL -#endif - -#if __GNUC__ > 3 -#define END_WITH_NULL __attribute__((sentinel)) -#else -#define END_WITH_NULL -#endif - -#ifndef HUGE_VALF -#define HUGE_VALF (float)HUGE_VAL -#endif - -#endif /* SUPPORT_DATATYPES_H */ diff --git a/contrib/llvm/include/llvm/System/LICENSE.TXT b/contrib/llvm/include/llvm/System/LICENSE.TXT deleted file mode 100644 index f569da205289..000000000000 --- a/contrib/llvm/include/llvm/System/LICENSE.TXT +++ /dev/null @@ -1,6 +0,0 @@ -LLVM System Interface Library -------------------------------------------------------------------------------- -The LLVM System Interface Library is licensed under the Illinois Open Source -License and has the following additional copyright: - -Copyright (C) 2004 eXtensible Systems, Inc. diff --git a/contrib/llvm/lib/Analysis/CMakeLists.txt b/contrib/llvm/lib/Analysis/CMakeLists.txt deleted file mode 100644 index 6a2ab681d1ac..000000000000 --- a/contrib/llvm/lib/Analysis/CMakeLists.txt +++ /dev/null @@ -1,53 +0,0 @@ -add_llvm_library(LLVMAnalysis - AliasAnalysis.cpp - AliasAnalysisCounter.cpp - AliasAnalysisEvaluator.cpp - AliasDebugger.cpp - AliasSetTracker.cpp - Analysis.cpp - BasicAliasAnalysis.cpp - CFGPrinter.cpp - CaptureTracking.cpp - ConstantFolding.cpp - DbgInfoPrinter.cpp - DebugInfo.cpp - DomPrinter.cpp - IVUsers.cpp - InlineCost.cpp - InstCount.cpp - InstructionSimplify.cpp - Interval.cpp - IntervalPartition.cpp - LazyValueInfo.cpp - LibCallAliasAnalysis.cpp - LibCallSemantics.cpp - Lint.cpp - LiveValues.cpp - Loads.cpp - LoopDependenceAnalysis.cpp - LoopInfo.cpp - LoopPass.cpp - MemoryBuiltins.cpp - MemoryDependenceAnalysis.cpp - ModuleDebugInfoPrinter.cpp - PHITransAddr.cpp - PointerTracking.cpp - PostDominators.cpp - ProfileEstimatorPass.cpp - ProfileInfo.cpp - ProfileInfoLoader.cpp - ProfileInfoLoaderPass.cpp - ProfileVerifierPass.cpp - RegionInfo.cpp - RegionPrinter.cpp - ScalarEvolution.cpp - ScalarEvolutionAliasAnalysis.cpp - ScalarEvolutionExpander.cpp - ScalarEvolutionNormalization.cpp - SparsePropagation.cpp - Trace.cpp - TypeBasedAliasAnalysis.cpp - ValueTracking.cpp - ) - -target_link_libraries (LLVMAnalysis LLVMSupport) diff --git a/contrib/llvm/lib/Analysis/IPA/CMakeLists.txt b/contrib/llvm/lib/Analysis/IPA/CMakeLists.txt deleted file mode 100644 index 007ad228ae56..000000000000 --- a/contrib/llvm/lib/Analysis/IPA/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -add_llvm_library(LLVMipa - CallGraph.cpp - CallGraphSCCPass.cpp - FindUsedTypes.cpp - GlobalsModRef.cpp - ) diff --git a/contrib/llvm/lib/Analysis/IPA/Makefile b/contrib/llvm/lib/Analysis/IPA/Makefile deleted file mode 100644 index b850c9ff7f44..000000000000 --- a/contrib/llvm/lib/Analysis/IPA/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Analysis/IPA/Makefile ---------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMipa -BUILD_ARCHIVE = 1 - -include $(LEVEL)/Makefile.common - diff --git a/contrib/llvm/lib/Analysis/Makefile b/contrib/llvm/lib/Analysis/Makefile deleted file mode 100644 index 4af6d350a645..000000000000 --- a/contrib/llvm/lib/Analysis/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -##===- lib/Analysis/Makefile -------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../.. -LIBRARYNAME = LLVMAnalysis -DIRS = IPA -BUILD_ARCHIVE = 1 - -include $(LEVEL)/Makefile.common - diff --git a/contrib/llvm/lib/Analysis/README.txt b/contrib/llvm/lib/Analysis/README.txt deleted file mode 100644 index 0e96e4c950cc..000000000000 --- a/contrib/llvm/lib/Analysis/README.txt +++ /dev/null @@ -1,30 +0,0 @@ -Analysis Opportunities: - -//===---------------------------------------------------------------------===// - -In test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll, the -ScalarEvolution expression for %r is this: - - {1,+,3,+,2} - -Outside the loop, this could be evaluated simply as (%n * %n), however -ScalarEvolution currently evaluates it as - - (-2 + (2 * (trunc i65 (((zext i64 (-2 + %n) to i65) * (zext i64 (-1 + %n) to i65)) /u 2) to i64)) + (3 * %n)) - -In addition to being much more complicated, it involves i65 arithmetic, -which is very inefficient when expanded into code. - -//===---------------------------------------------------------------------===// - -In formatValue in test/CodeGen/X86/lsr-delayed-fold.ll, - -ScalarEvolution is forming this expression: - -((trunc i64 (-1 * %arg5) to i32) + (trunc i64 %arg5 to i32) + (-1 * (trunc i64 undef to i32))) - -This could be folded to - -(-1 * (trunc i64 undef to i32)) - -//===---------------------------------------------------------------------===// diff --git a/contrib/llvm/lib/Archive/CMakeLists.txt b/contrib/llvm/lib/Archive/CMakeLists.txt deleted file mode 100644 index 7ff478a41a59..000000000000 --- a/contrib/llvm/lib/Archive/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_llvm_library(LLVMArchive - Archive.cpp - ArchiveReader.cpp - ArchiveWriter.cpp - ) diff --git a/contrib/llvm/lib/Archive/Makefile b/contrib/llvm/lib/Archive/Makefile deleted file mode 100644 index da9780403a08..000000000000 --- a/contrib/llvm/lib/Archive/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -##===- lib/Archive/Makefile --------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../.. -LIBRARYNAME = LLVMArchive - -# We only want an archive so only those modules actually used by a tool are -# included. -BUILD_ARCHIVE := 1 - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/AsmParser/CMakeLists.txt b/contrib/llvm/lib/AsmParser/CMakeLists.txt deleted file mode 100644 index 985ebe200988..000000000000 --- a/contrib/llvm/lib/AsmParser/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -# AsmParser -add_llvm_library(LLVMAsmParser - LLLexer.cpp - LLParser.cpp - Parser.cpp - ) diff --git a/contrib/llvm/lib/AsmParser/Makefile b/contrib/llvm/lib/AsmParser/Makefile deleted file mode 100644 index 995bb0e130e2..000000000000 --- a/contrib/llvm/lib/AsmParser/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -##===- lib/AsmParser/Makefile ------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../.. -LIBRARYNAME := LLVMAsmParser -BUILD_ARCHIVE = 1 - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Bitcode/Makefile b/contrib/llvm/lib/Bitcode/Makefile deleted file mode 100644 index 2d6b5ad1fe88..000000000000 --- a/contrib/llvm/lib/Bitcode/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -##===- lib/Bitcode/Makefile --------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../.. -PARALLEL_DIRS = Reader Writer - -include $(LEVEL)/Makefile.common - diff --git a/contrib/llvm/lib/Bitcode/Reader/CMakeLists.txt b/contrib/llvm/lib/Bitcode/Reader/CMakeLists.txt deleted file mode 100644 index 693d4310b834..000000000000 --- a/contrib/llvm/lib/Bitcode/Reader/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_llvm_library(LLVMBitReader - BitReader.cpp - BitcodeReader.cpp - ) diff --git a/contrib/llvm/lib/Bitcode/Reader/Makefile b/contrib/llvm/lib/Bitcode/Reader/Makefile deleted file mode 100644 index 59af8d53a73e..000000000000 --- a/contrib/llvm/lib/Bitcode/Reader/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Bitcode/Reader/Makefile -------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMBitReader -BUILD_ARCHIVE = 1 - -include $(LEVEL)/Makefile.common - diff --git a/contrib/llvm/lib/Bitcode/Writer/CMakeLists.txt b/contrib/llvm/lib/Bitcode/Writer/CMakeLists.txt deleted file mode 100644 index f097b097c337..000000000000 --- a/contrib/llvm/lib/Bitcode/Writer/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -add_llvm_library(LLVMBitWriter - BitWriter.cpp - BitcodeWriter.cpp - BitcodeWriterPass.cpp - ValueEnumerator.cpp - ) diff --git a/contrib/llvm/lib/Bitcode/Writer/Makefile b/contrib/llvm/lib/Bitcode/Writer/Makefile deleted file mode 100644 index 7b0bd72159ad..000000000000 --- a/contrib/llvm/lib/Bitcode/Writer/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Bitcode/Reader/Makefile -------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMBitWriter -BUILD_ARCHIVE = 1 - -include $(LEVEL)/Makefile.common - diff --git a/contrib/llvm/lib/CodeGen/AsmPrinter/CMakeLists.txt b/contrib/llvm/lib/CodeGen/AsmPrinter/CMakeLists.txt deleted file mode 100644 index ca8b8436c11f..000000000000 --- a/contrib/llvm/lib/CodeGen/AsmPrinter/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -add_llvm_library(LLVMAsmPrinter - AsmPrinter.cpp - AsmPrinterDwarf.cpp - AsmPrinterInlineAsm.cpp - DIE.cpp - DwarfDebug.cpp - DwarfException.cpp - OcamlGCPrinter.cpp - ) - -target_link_libraries (LLVMAsmPrinter LLVMMCParser) diff --git a/contrib/llvm/lib/CodeGen/AsmPrinter/Makefile b/contrib/llvm/lib/CodeGen/AsmPrinter/Makefile deleted file mode 100644 index 60aa6cbcf6f3..000000000000 --- a/contrib/llvm/lib/CodeGen/AsmPrinter/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -##===- lib/CodeGen/AsmPrinter/Makefile ---------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMAsmPrinter - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/CodeGen/CMakeLists.txt b/contrib/llvm/lib/CodeGen/CMakeLists.txt deleted file mode 100644 index 2ef115dbd205..000000000000 --- a/contrib/llvm/lib/CodeGen/CMakeLists.txt +++ /dev/null @@ -1,86 +0,0 @@ -add_llvm_library(LLVMCodeGen - AggressiveAntiDepBreaker.cpp - Analysis.cpp - BranchFolding.cpp - CalcSpillWeights.cpp - CallingConvLower.cpp - CodePlacementOpt.cpp - CriticalAntiDepBreaker.cpp - DeadMachineInstructionElim.cpp - DwarfEHPrepare.cpp - ELFCodeEmitter.cpp - ELFWriter.cpp - GCMetadata.cpp - GCMetadataPrinter.cpp - GCStrategy.cpp - IfConversion.cpp - InlineSpiller.cpp - IntrinsicLowering.cpp - LLVMTargetMachine.cpp - LatencyPriorityQueue.cpp - LiveInterval.cpp - LiveIntervalAnalysis.cpp - LiveStackAnalysis.cpp - LiveVariables.cpp - LocalStackSlotAllocation.cpp - LowerSubregs.cpp - MachineBasicBlock.cpp - MachineCSE.cpp - MachineDominators.cpp - MachineFunction.cpp - MachineFunctionAnalysis.cpp - MachineFunctionPass.cpp - MachineFunctionPrinterPass.cpp - MachineInstr.cpp - MachineLICM.cpp - MachineLoopInfo.cpp - MachineModuleInfo.cpp - MachineModuleInfoImpls.cpp - MachinePassRegistry.cpp - MachineRegisterInfo.cpp - MachineSSAUpdater.cpp - MachineSink.cpp - MachineVerifier.cpp - ObjectCodeEmitter.cpp - OcamlGC.cpp - OptimizePHIs.cpp - PHIElimination.cpp - Passes.cpp - PeepholeOptimizer.cpp - PostRAHazardRecognizer.cpp - PostRASchedulerList.cpp - PreAllocSplitting.cpp - ProcessImplicitDefs.cpp - PrologEpilogInserter.cpp - PseudoSourceValue.cpp - RegAllocFast.cpp - RegAllocLinearScan.cpp - RegAllocPBQP.cpp - RegisterCoalescer.cpp - RegisterScavenging.cpp - RenderMachineFunction.cpp - ScheduleDAG.cpp - ScheduleDAGEmit.cpp - ScheduleDAGInstrs.cpp - ScheduleDAGPrinter.cpp - ShadowStackGC.cpp - ShrinkWrapping.cpp - SimpleRegisterCoalescing.cpp - SjLjEHPrepare.cpp - SlotIndexes.cpp - Spiller.cpp - SplitKit.cpp - Splitter.cpp - StackProtector.cpp - StackSlotColoring.cpp - StrongPHIElimination.cpp - TailDuplication.cpp - TargetInstrInfoImpl.cpp - TargetLoweringObjectFileImpl.cpp - TwoAddressInstructionPass.cpp - UnreachableBlockElim.cpp - VirtRegMap.cpp - VirtRegRewriter.cpp - ) - -target_link_libraries (LLVMCodeGen LLVMCore LLVMScalarOpts) diff --git a/contrib/llvm/lib/CodeGen/Makefile b/contrib/llvm/lib/CodeGen/Makefile deleted file mode 100644 index 4ab3e3c0013e..000000000000 --- a/contrib/llvm/lib/CodeGen/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -##===- lib/CodeGen/Makefile --------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../.. -LIBRARYNAME = LLVMCodeGen -PARALLEL_DIRS = SelectionDAG AsmPrinter -BUILD_ARCHIVE = 1 - -include $(LEVEL)/Makefile.common - -# Xcode prior to 2.4 generates an error in -pedantic mode with use of HUGE_VAL -# in this directory. Disable -pedantic for this broken compiler. -ifneq ($(HUGE_VAL_SANITY),yes) -CompileCommonOpts := $(filter-out -pedantic, $(CompileCommonOpts)) -endif - diff --git a/contrib/llvm/lib/CodeGen/README.txt b/contrib/llvm/lib/CodeGen/README.txt deleted file mode 100644 index b655dda41153..000000000000 --- a/contrib/llvm/lib/CodeGen/README.txt +++ /dev/null @@ -1,199 +0,0 @@ -//===---------------------------------------------------------------------===// - -Common register allocation / spilling problem: - - mul lr, r4, lr - str lr, [sp, #+52] - ldr lr, [r1, #+32] - sxth r3, r3 - ldr r4, [sp, #+52] - mla r4, r3, lr, r4 - -can be: - - mul lr, r4, lr - mov r4, lr - str lr, [sp, #+52] - ldr lr, [r1, #+32] - sxth r3, r3 - mla r4, r3, lr, r4 - -and then "merge" mul and mov: - - mul r4, r4, lr - str lr, [sp, #+52] - ldr lr, [r1, #+32] - sxth r3, r3 - mla r4, r3, lr, r4 - -It also increase the likelyhood the store may become dead. - -//===---------------------------------------------------------------------===// - -bb27 ... - ... - %reg1037 = ADDri %reg1039, 1 - %reg1038 = ADDrs %reg1032, %reg1039, %NOREG, 10 - Successors according to CFG: 0x8b03bf0 (#5) - -bb76 (0x8b03bf0, LLVM BB @0x8b032d0, ID#5): - Predecessors according to CFG: 0x8b0c5f0 (#3) 0x8b0a7c0 (#4) - %reg1039 = PHI %reg1070, mbb, %reg1037, mbb - -Note ADDri is not a two-address instruction. However, its result %reg1037 is an -operand of the PHI node in bb76 and its operand %reg1039 is the result of the -PHI node. We should treat it as a two-address code and make sure the ADDri is -scheduled after any node that reads %reg1039. - -//===---------------------------------------------------------------------===// - -Use local info (i.e. register scavenger) to assign it a free register to allow -reuse: - ldr r3, [sp, #+4] - add r3, r3, #3 - ldr r2, [sp, #+8] - add r2, r2, #2 - ldr r1, [sp, #+4] <== - add r1, r1, #1 - ldr r0, [sp, #+4] - add r0, r0, #2 - -//===---------------------------------------------------------------------===// - -LLVM aggressively lift CSE out of loop. Sometimes this can be negative side- -effects: - -R1 = X + 4 -R2 = X + 7 -R3 = X + 15 - -loop: -load [i + R1] -... -load [i + R2] -... -load [i + R3] - -Suppose there is high register pressure, R1, R2, R3, can be spilled. We need -to implement proper re-materialization to handle this: - -R1 = X + 4 -R2 = X + 7 -R3 = X + 15 - -loop: -R1 = X + 4 @ re-materialized -load [i + R1] -... -R2 = X + 7 @ re-materialized -load [i + R2] -... -R3 = X + 15 @ re-materialized -load [i + R3] - -Furthermore, with re-association, we can enable sharing: - -R1 = X + 4 -R2 = X + 7 -R3 = X + 15 - -loop: -T = i + X -load [T + 4] -... -load [T + 7] -... -load [T + 15] -//===---------------------------------------------------------------------===// - -It's not always a good idea to choose rematerialization over spilling. If all -the load / store instructions would be folded then spilling is cheaper because -it won't require new live intervals / registers. See 2003-05-31-LongShifts for -an example. - -//===---------------------------------------------------------------------===// - -With a copying garbage collector, derived pointers must not be retained across -collector safe points; the collector could move the objects and invalidate the -derived pointer. This is bad enough in the first place, but safe points can -crop up unpredictably. Consider: - - %array = load { i32, [0 x %obj] }** %array_addr - %nth_el = getelementptr { i32, [0 x %obj] }* %array, i32 0, i32 %n - %old = load %obj** %nth_el - %z = div i64 %x, %y - store %obj* %new, %obj** %nth_el - -If the i64 division is lowered to a libcall, then a safe point will (must) -appear for the call site. If a collection occurs, %array and %nth_el no longer -point into the correct object. - -The fix for this is to copy address calculations so that dependent pointers -are never live across safe point boundaries. But the loads cannot be copied -like this if there was an intervening store, so may be hard to get right. - -Only a concurrent mutator can trigger a collection at the libcall safe point. -So single-threaded programs do not have this requirement, even with a copying -collector. Still, LLVM optimizations would probably undo a front-end's careful -work. - -//===---------------------------------------------------------------------===// - -The ocaml frametable structure supports liveness information. It would be good -to support it. - -//===---------------------------------------------------------------------===// - -The FIXME in ComputeCommonTailLength in BranchFolding.cpp needs to be -revisited. The check is there to work around a misuse of directives in inline -assembly. - -//===---------------------------------------------------------------------===// - -It would be good to detect collector/target compatibility instead of silently -doing the wrong thing. - -//===---------------------------------------------------------------------===// - -It would be really nice to be able to write patterns in .td files for copies, -which would eliminate a bunch of explicit predicates on them (e.g. no side -effects). Once this is in place, it would be even better to have tblgen -synthesize the various copy insertion/inspection methods in TargetInstrInfo. - -//===---------------------------------------------------------------------===// - -Stack coloring improvments: - -1. Do proper LiveStackAnalysis on all stack objects including those which are - not spill slots. -2. Reorder objects to fill in gaps between objects. - e.g. 4, 1, , 4, 1, 1, 1, , 4 => 4, 1, 1, 1, 1, 4, 4 - -//===---------------------------------------------------------------------===// - -The scheduler should be able to sort nearby instructions by their address. For -example, in an expanded memset sequence it's not uncommon to see code like this: - - movl $0, 4(%rdi) - movl $0, 8(%rdi) - movl $0, 12(%rdi) - movl $0, 0(%rdi) - -Each of the stores is independent, and the scheduler is currently making an -arbitrary decision about the order. - -//===---------------------------------------------------------------------===// - -Another opportunitiy in this code is that the $0 could be moved to a register: - - movl $0, 4(%rdi) - movl $0, 8(%rdi) - movl $0, 12(%rdi) - movl $0, 0(%rdi) - -This would save substantial code size, especially for longer sequences like -this. It would be easy to have a rule telling isel to avoid matching MOV32mi -if the immediate has more than some fixed number of uses. It's more involved -to teach the register allocator how to do late folding to recover from -excessive register pressure. - diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt b/contrib/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt deleted file mode 100644 index 799988a4c862..000000000000 --- a/contrib/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -add_llvm_library(LLVMSelectionDAG - DAGCombiner.cpp - FastISel.cpp - FunctionLoweringInfo.cpp - InstrEmitter.cpp - LegalizeDAG.cpp - LegalizeFloatTypes.cpp - LegalizeIntegerTypes.cpp - LegalizeTypes.cpp - LegalizeTypesGeneric.cpp - LegalizeVectorOps.cpp - LegalizeVectorTypes.cpp - ScheduleDAGFast.cpp - ScheduleDAGList.cpp - ScheduleDAGRRList.cpp - ScheduleDAGSDNodes.cpp - SelectionDAG.cpp - SelectionDAGBuilder.cpp - SelectionDAGISel.cpp - SelectionDAGPrinter.cpp - TargetLowering.cpp - TargetSelectionDAGInfo.cpp - ) - -target_link_libraries (LLVMSelectionDAG LLVMAnalysis LLVMAsmPrinter LLVMCodeGen) diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/Makefile b/contrib/llvm/lib/CodeGen/SelectionDAG/Makefile deleted file mode 100644 index ea716fdaabba..000000000000 --- a/contrib/llvm/lib/CodeGen/SelectionDAG/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -##===- lib/CodeGen/SelectionDAG/Makefile -------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMSelectionDAG - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/CompilerDriver/CMakeLists.txt b/contrib/llvm/lib/CompilerDriver/CMakeLists.txt deleted file mode 100644 index 153dd443cbf2..000000000000 --- a/contrib/llvm/lib/CompilerDriver/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -set(LLVM_LINK_COMPONENTS support system) -set(LLVM_REQUIRES_EH 1) - -add_llvm_tool(llvmc - Action.cpp - CompilationGraph.cpp - llvmc.cpp - Plugin.cpp - Tool.cpp - ) diff --git a/contrib/llvm/lib/CompilerDriver/Makefile b/contrib/llvm/lib/CompilerDriver/Makefile deleted file mode 100644 index 8e8b73ca8f83..000000000000 --- a/contrib/llvm/lib/CompilerDriver/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -##===- lib/CompilerDriver/Makefile -------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open -# Source License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../.. - -# We don't want this library to appear in `llvm-config --libs` output, so its -# name doesn't start with "LLVM" and NO_LLVM_CONFIG is set. - -LIBRARYNAME = CompilerDriver -LINK_COMPONENTS = support system -NO_LLVM_CONFIG = 1 - - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/ExecutionEngine/CMakeLists.txt b/contrib/llvm/lib/ExecutionEngine/CMakeLists.txt deleted file mode 100644 index 0e118ccd904f..000000000000 --- a/contrib/llvm/lib/ExecutionEngine/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_llvm_library(LLVMExecutionEngine - ExecutionEngine.cpp - ExecutionEngineBindings.cpp - ) diff --git a/contrib/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt b/contrib/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt deleted file mode 100644 index dff97fa26e8f..000000000000 --- a/contrib/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_llvm_library(LLVMInterpreter - Execution.cpp - ExternalFunctions.cpp - Interpreter.cpp - ) diff --git a/contrib/llvm/lib/ExecutionEngine/Interpreter/Makefile b/contrib/llvm/lib/ExecutionEngine/Interpreter/Makefile deleted file mode 100644 index 5def1365c61a..000000000000 --- a/contrib/llvm/lib/ExecutionEngine/Interpreter/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -##===- lib/ExecutionEngine/Interpreter/Makefile ------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMInterpreter - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/ExecutionEngine/JIT/CMakeLists.txt b/contrib/llvm/lib/ExecutionEngine/JIT/CMakeLists.txt deleted file mode 100644 index 42020d69af02..000000000000 --- a/contrib/llvm/lib/ExecutionEngine/JIT/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -# TODO: Support other architectures. See Makefile. -add_definitions(-DENABLE_X86_JIT) - -add_llvm_library(LLVMJIT - Intercept.cpp - JIT.cpp - JITDebugRegisterer.cpp - JITDwarfEmitter.cpp - JITEmitter.cpp - JITMemoryManager.cpp - OProfileJITEventListener.cpp - TargetSelect.cpp - ) diff --git a/contrib/llvm/lib/ExecutionEngine/JIT/Makefile b/contrib/llvm/lib/ExecutionEngine/JIT/Makefile deleted file mode 100644 index aafa3d9d420f..000000000000 --- a/contrib/llvm/lib/ExecutionEngine/JIT/Makefile +++ /dev/null @@ -1,38 +0,0 @@ -##===- lib/ExecutionEngine/JIT/Makefile --------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMJIT - -# Get the $(ARCH) setting -include $(LEVEL)/Makefile.config - -# Enable the X86 JIT if compiling on X86 -ifeq ($(ARCH), x86) - ENABLE_X86_JIT = 1 -endif - -# This flag can also be used on the command line to force inclusion -# of the X86 JIT on non-X86 hosts -ifdef ENABLE_X86_JIT - CPPFLAGS += -DENABLE_X86_JIT -endif - -# Enable the Sparc JIT if compiling on Sparc -ifeq ($(ARCH), Sparc) - ENABLE_SPARC_JIT = 1 -endif - -# This flag can also be used on the command line to force inclusion -# of the Sparc JIT on non-Sparc hosts -ifdef ENABLE_SPARC_JIT - CPPFLAGS += -DENABLE_SPARC_JIT -endif - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/ExecutionEngine/Makefile b/contrib/llvm/lib/ExecutionEngine/Makefile deleted file mode 100644 index e0e050e89728..000000000000 --- a/contrib/llvm/lib/ExecutionEngine/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -##===- lib/ExecutionEngine/Makefile ------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../.. -LIBRARYNAME = LLVMExecutionEngine -PARALLEL_DIRS = Interpreter JIT - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Linker/CMakeLists.txt b/contrib/llvm/lib/Linker/CMakeLists.txt deleted file mode 100644 index 0b6d2f4218e3..000000000000 --- a/contrib/llvm/lib/Linker/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -add_llvm_library(LLVMLinker - LinkArchives.cpp - LinkItems.cpp - LinkModules.cpp - Linker.cpp - ) diff --git a/contrib/llvm/lib/Linker/Makefile b/contrib/llvm/lib/Linker/Makefile deleted file mode 100644 index 19e646b74830..000000000000 --- a/contrib/llvm/lib/Linker/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Linker/Makefile ---------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../.. -LIBRARYNAME = LLVMLinker -BUILD_ARCHIVE := 1 - -include $(LEVEL)/Makefile.common - diff --git a/contrib/llvm/lib/MC/CMakeLists.txt b/contrib/llvm/lib/MC/CMakeLists.txt deleted file mode 100644 index 60a3a3e3e312..000000000000 --- a/contrib/llvm/lib/MC/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -add_llvm_library(LLVMMC - ELFObjectWriter.cpp - MCAsmInfo.cpp - MCAsmInfoCOFF.cpp - MCAsmInfoDarwin.cpp - MCAsmStreamer.cpp - MCAssembler.cpp - MCCodeEmitter.cpp - MCContext.cpp - MCDisassembler.cpp - MCELFStreamer.cpp - MCExpr.cpp - MCInst.cpp - MCInstPrinter.cpp - MCLabel.cpp - MCDwarf.cpp - MCLoggingStreamer.cpp - MCMachOStreamer.cpp - MCNullStreamer.cpp - MCObjectStreamer.cpp - MCObjectWriter.cpp - MCSection.cpp - MCSectionCOFF.cpp - MCSectionELF.cpp - MCSectionMachO.cpp - MCStreamer.cpp - MCSymbol.cpp - MCValue.cpp - MachObjectWriter.cpp - WinCOFFStreamer.cpp - WinCOFFObjectWriter.cpp - TargetAsmBackend.cpp - ) diff --git a/contrib/llvm/lib/MC/MCDisassembler/CMakeLists.txt b/contrib/llvm/lib/MC/MCDisassembler/CMakeLists.txt deleted file mode 100644 index 5fa7b70194b2..000000000000 --- a/contrib/llvm/lib/MC/MCDisassembler/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ - -add_llvm_library(LLVMMCDisassembler - EDDisassembler.cpp - EDOperand.cpp - EDInst.cpp - EDToken.cpp - ) diff --git a/contrib/llvm/lib/MC/MCDisassembler/Makefile b/contrib/llvm/lib/MC/MCDisassembler/Makefile deleted file mode 100644 index 7d71cd381a7c..000000000000 --- a/contrib/llvm/lib/MC/MCDisassembler/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -##===- lib/MC/MCDisassembler/Makefile ----------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMMCDisassembler - -include $(LEVEL)/Makefile.common - diff --git a/contrib/llvm/lib/MC/MCParser/CMakeLists.txt b/contrib/llvm/lib/MC/MCParser/CMakeLists.txt deleted file mode 100644 index 25a7bf484212..000000000000 --- a/contrib/llvm/lib/MC/MCParser/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -add_llvm_library(LLVMMCParser - AsmLexer.cpp - AsmParser.cpp - DarwinAsmParser.cpp - ELFAsmParser.cpp - MCAsmLexer.cpp - MCAsmParser.cpp - MCAsmParserExtension.cpp - TargetAsmParser.cpp - ) diff --git a/contrib/llvm/lib/MC/MCParser/Makefile b/contrib/llvm/lib/MC/MCParser/Makefile deleted file mode 100644 index 4477757657c7..000000000000 --- a/contrib/llvm/lib/MC/MCParser/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/MC/MCParser/Makefile ----------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMMCParser -BUILD_ARCHIVE := 1 - -include $(LEVEL)/Makefile.common - diff --git a/contrib/llvm/lib/MC/Makefile b/contrib/llvm/lib/MC/Makefile deleted file mode 100644 index bf8b7c0e7831..000000000000 --- a/contrib/llvm/lib/MC/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -##===- lib/MC/Makefile -------------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../.. -LIBRARYNAME = LLVMMC -BUILD_ARCHIVE := 1 -PARALLEL_DIRS := MCParser MCDisassembler - -include $(LEVEL)/Makefile.common - diff --git a/contrib/llvm/lib/Makefile b/contrib/llvm/lib/Makefile deleted file mode 100644 index 3807f31c7037..000000000000 --- a/contrib/llvm/lib/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -##===- lib/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 := VMCore AsmParser Bitcode Archive Analysis Transforms CodeGen \ - Target ExecutionEngine Linker MC CompilerDriver - -include $(LEVEL)/Makefile.common - diff --git a/contrib/llvm/lib/Support/CMakeLists.txt b/contrib/llvm/lib/Support/CMakeLists.txt deleted file mode 100644 index 0c70a402654e..000000000000 --- a/contrib/llvm/lib/Support/CMakeLists.txt +++ /dev/null @@ -1,49 +0,0 @@ -add_llvm_library(LLVMSupport - APFloat.cpp - APInt.cpp - APSInt.cpp - Allocator.cpp - circular_raw_ostream.cpp - CommandLine.cpp - ConstantRange.cpp - CrashRecoveryContext.cpp - Debug.cpp - DeltaAlgorithm.cpp - DAGDeltaAlgorithm.cpp - Dwarf.cpp - ErrorHandling.cpp - FileUtilities.cpp - FoldingSet.cpp - FormattedStream.cpp - GraphWriter.cpp - IsInf.cpp - IsNAN.cpp - ManagedStatic.cpp - MemoryBuffer.cpp - MemoryObject.cpp - PluginLoader.cpp - PrettyStackTrace.cpp - Regex.cpp - SmallPtrSet.cpp - SmallVector.cpp - SourceMgr.cpp - Statistic.cpp - StringExtras.cpp - StringMap.cpp - StringPool.cpp - StringRef.cpp - SystemUtils.cpp - TargetRegistry.cpp - Timer.cpp - Triple.cpp - Twine.cpp - raw_os_ostream.cpp - raw_ostream.cpp - regcomp.c - regerror.c - regexec.c - regfree.c - regstrlcpy.c - ) - -target_link_libraries (LLVMSupport LLVMSystem) diff --git a/contrib/llvm/lib/Support/COPYRIGHT.regex b/contrib/llvm/lib/Support/COPYRIGHT.regex deleted file mode 100644 index a6392fd37c3d..000000000000 --- a/contrib/llvm/lib/Support/COPYRIGHT.regex +++ /dev/null @@ -1,54 +0,0 @@ -$OpenBSD: COPYRIGHT,v 1.3 2003/06/02 20:18:36 millert Exp $ - -Copyright 1992, 1993, 1994 Henry Spencer. All rights reserved. -This software is not subject to any license of the American Telephone -and Telegraph Company or of the Regents of the University of California. - -Permission is granted to anyone to use this software for any purpose on -any computer system, and to alter it and redistribute it, subject -to the following restrictions: - -1. The author is not responsible for the consequences of use of this - software, no matter how awful, even if they arise from flaws in it. - -2. The origin of this software must not be misrepresented, either by - explicit claim or by omission. Since few users ever read sources, - credits must appear in the documentation. - -3. Altered versions must be plainly marked as such, and must not be - misrepresented as being the original software. Since few users - ever read sources, credits must appear in the documentation. - -4. This notice may not be removed or altered. - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -/*- - * Copyright (c) 1994 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)COPYRIGHT 8.1 (Berkeley) 3/16/94 - */ diff --git a/contrib/llvm/lib/Support/Makefile b/contrib/llvm/lib/Support/Makefile deleted file mode 100644 index 48c21f4fd9e0..000000000000 --- a/contrib/llvm/lib/Support/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -##===- lib/Support/Makefile --------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../.. -LIBRARYNAME = LLVMSupport -BUILD_ARCHIVE = 1 - -## FIXME: This only requires RTTI because tblgen uses it. Fix that. -REQUIRES_RTTI = 1 - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/System/CMakeLists.txt b/contrib/llvm/lib/System/CMakeLists.txt deleted file mode 100644 index b43c3afa5248..000000000000 --- a/contrib/llvm/lib/System/CMakeLists.txt +++ /dev/null @@ -1,48 +0,0 @@ -add_llvm_library(LLVMSystem - Alarm.cpp - Atomic.cpp - Disassembler.cpp - DynamicLibrary.cpp - Errno.cpp - Host.cpp - IncludeFile.cpp - Memory.cpp - Mutex.cpp - Path.cpp - Process.cpp - Program.cpp - RWMutex.cpp - SearchForAddressOfSpecialSymbol.cpp - Signals.cpp - ThreadLocal.cpp - Threading.cpp - TimeValue.cpp - Valgrind.cpp - Unix/Alarm.inc - Unix/Host.inc - Unix/Memory.inc - Unix/Mutex.inc - Unix/Path.inc - Unix/Process.inc - Unix/Program.inc - Unix/RWMutex.inc - Unix/Signals.inc - Unix/ThreadLocal.inc - Unix/TimeValue.inc - Win32/Alarm.inc - Win32/DynamicLibrary.inc - Win32/Host.inc - Win32/Memory.inc - Win32/Mutex.inc - Win32/Path.inc - Win32/Process.inc - Win32/Program.inc - Win32/RWMutex.inc - Win32/Signals.inc - Win32/ThreadLocal.inc - Win32/TimeValue.inc - ) - -if( BUILD_SHARED_LIBS AND NOT WIN32 ) - target_link_libraries(LLVMSystem ${CMAKE_DL_LIBS}) -endif() diff --git a/contrib/llvm/lib/System/Makefile b/contrib/llvm/lib/System/Makefile deleted file mode 100644 index bb013b9f1f16..000000000000 --- a/contrib/llvm/lib/System/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -##===- lib/System/Makefile ---------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../.. -LIBRARYNAME = LLVMSystem -BUILD_ARCHIVE = 1 -REQUIRES_RTTI = 1 -include $(LEVEL)/Makefile.config - -ifeq ($(HOST_OS),MingW) - REQUIRES_EH := 1 -endif - -EXTRA_DIST = Unix Win32 README.txt - -include $(LEVEL)/Makefile.common - -CompileCommonOpts := $(filter-out -pedantic,$(CompileCommonOpts)) -CompileCommonOpts := $(filter-out -Wno-long-long,$(CompileCommonOpts)) diff --git a/contrib/llvm/lib/System/README.txt b/contrib/llvm/lib/System/README.txt deleted file mode 100644 index eacb20094a61..000000000000 --- a/contrib/llvm/lib/System/README.txt +++ /dev/null @@ -1,43 +0,0 @@ -Design Of lib/System -==================== - -The software in this directory is designed to completely shield LLVM from any -and all operating system specific functionality. It is not intended to be a -complete operating system wrapper (such as ACE), but only to provide the -functionality necessary to support LLVM. - -The software located here, of necessity, has very specific and stringent design -rules. Violation of these rules means that cracks in the shield could form and -the primary goal of the library is defeated. By consistently using this library, -LLVM becomes more easily ported to new platforms since the only thing requiring -porting is this library. - -Complete documentation for the library can be found in the file: - llvm/docs/SystemLibrary.html -or at this URL: - http://llvm.org/docs/SystemLibrary.html - -While we recommend that you read the more detailed documentation, for the -impatient, here's a high level summary of the library's requirements. - - 1. No system header files are to be exposed through the interface. - 2. Std C++ and Std C header files are okay to be exposed through the interface. - 3. No exposed system-specific functions. - 4. No exposed system-specific data. - 5. Data in lib/System classes must use only simple C++ intrinsic types. - 6. Errors are handled by returning "true" and setting an optional std::string - 7. Library must not throw any exceptions, period. - 8. Interface functions must not have throw() specifications. - 9. No duplicate function impementations are permitted within an operating - system class. - -To accomplish these requirements, the library has numerous design criteria that -must be satisfied. Here's a high level summary of the library's design criteria: - - 1. No unused functionality (only what LLVM needs) - 2. High-Level Interfaces - 3. Use Opaque Classes - 4. Common Implementations - 5. Multiple Implementations - 6. Minimize Memory Allocation - 7. No Virtual Methods diff --git a/contrib/llvm/lib/System/Unix/README.txt b/contrib/llvm/lib/System/Unix/README.txt deleted file mode 100644 index b3bace483e5d..000000000000 --- a/contrib/llvm/lib/System/Unix/README.txt +++ /dev/null @@ -1,16 +0,0 @@ -llvm/lib/System/Unix README -=========================== - -This directory provides implementations of the lib/System classes that -are common to two or more variants of UNIX. For example, the directory -structure underneath this directory could look like this: - -Unix - only code that is truly generic to all UNIX platforms - Posix - code that is specific to Posix variants of UNIX - SUS - code that is specific to the Single Unix Specification - SysV - code that is specific to System V variants of UNIX - -As a rule, only those directories actually needing to be created should be -created. Also, further subdirectories could be created to reflect versions of -the various standards. For example, under SUS there could be v1, v2, and v3 -subdirectories to reflect the three major versions of SUS. diff --git a/contrib/llvm/lib/Target/ARM/AsmParser/CMakeLists.txt b/contrib/llvm/lib/Target/ARM/AsmParser/CMakeLists.txt deleted file mode 100644 index 9ba7c0125d7f..000000000000 --- a/contrib/llvm/lib/Target/ARM/AsmParser/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMARMAsmParser - ARMAsmLexer.cpp - ARMAsmParser.cpp - ) - diff --git a/contrib/llvm/lib/Target/ARM/AsmParser/Makefile b/contrib/llvm/lib/Target/ARM/AsmParser/Makefile deleted file mode 100644 index 841516fffbd5..000000000000 --- a/contrib/llvm/lib/Target/ARM/AsmParser/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Target/ARM/AsmParser/Makefile -------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../../.. -LIBRARYNAME = LLVMARMAsmParser - -# Hack: we need to include 'main' ARM target directory to grab private headers -CPP.Flags += -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/ARM/AsmPrinter/CMakeLists.txt b/contrib/llvm/lib/Target/ARM/AsmPrinter/CMakeLists.txt deleted file mode 100644 index 18645c0864a3..000000000000 --- a/contrib/llvm/lib/Target/ARM/AsmPrinter/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMARMAsmPrinter - ARMInstPrinter.cpp - ) -add_dependencies(LLVMARMAsmPrinter ARMCodeGenTable_gen) diff --git a/contrib/llvm/lib/Target/ARM/AsmPrinter/Makefile b/contrib/llvm/lib/Target/ARM/AsmPrinter/Makefile deleted file mode 100644 index 65d372e44b88..000000000000 --- a/contrib/llvm/lib/Target/ARM/AsmPrinter/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Target/ARM/AsmPrinter/Makefile ------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../../.. -LIBRARYNAME = LLVMARMAsmPrinter - -# Hack: we need to include 'main' arm target directory to grab private headers -CPP.Flags += -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/ARM/CMakeLists.txt b/contrib/llvm/lib/Target/ARM/CMakeLists.txt deleted file mode 100644 index 6b4dee5965d2..000000000000 --- a/contrib/llvm/lib/Target/ARM/CMakeLists.txt +++ /dev/null @@ -1,50 +0,0 @@ -set(LLVM_TARGET_DEFINITIONS ARM.td) - -tablegen(ARMGenRegisterInfo.h.inc -gen-register-desc-header) -tablegen(ARMGenRegisterNames.inc -gen-register-enums) -tablegen(ARMGenRegisterInfo.inc -gen-register-desc) -tablegen(ARMGenInstrNames.inc -gen-instr-enums) -tablegen(ARMGenInstrInfo.inc -gen-instr-desc) -tablegen(ARMGenCodeEmitter.inc -gen-emitter) -tablegen(ARMGenAsmWriter.inc -gen-asm-writer) -tablegen(ARMGenAsmMatcher.inc -gen-asm-matcher) -tablegen(ARMGenDAGISel.inc -gen-dag-isel) -tablegen(ARMGenFastISel.inc -gen-fast-isel) -tablegen(ARMGenCallingConv.inc -gen-callingconv) -tablegen(ARMGenSubtarget.inc -gen-subtarget) -tablegen(ARMGenEDInfo.inc -gen-enhanced-disassembly-info) - -add_llvm_target(ARMCodeGen - ARMAsmPrinter.cpp - ARMBaseInstrInfo.cpp - ARMBaseRegisterInfo.cpp - ARMCodeEmitter.cpp - ARMConstantIslandPass.cpp - ARMConstantPoolValue.cpp - ARMExpandPseudoInsts.cpp - ARMFastISel.cpp - ARMGlobalMerge.cpp - ARMISelDAGToDAG.cpp - ARMISelLowering.cpp - ARMInstrInfo.cpp - ARMJITInfo.cpp - ARMLoadStoreOptimizer.cpp - ARMMCAsmInfo.cpp - ARMMCInstLower.cpp - ARMRegisterInfo.cpp - ARMSelectionDAGInfo.cpp - ARMSubtarget.cpp - ARMTargetMachine.cpp - ARMTargetObjectFile.cpp - NEONMoveFix.cpp - NEONPreAllocPass.cpp - Thumb1InstrInfo.cpp - Thumb1RegisterInfo.cpp - Thumb2HazardRecognizer.cpp - Thumb2ITBlockPass.cpp - Thumb2InstrInfo.cpp - Thumb2RegisterInfo.cpp - Thumb2SizeReduction.cpp - ) - -target_link_libraries (LLVMARMCodeGen LLVMARMAsmPrinter LLVMSelectionDAG) diff --git a/contrib/llvm/lib/Target/ARM/Disassembler/Makefile b/contrib/llvm/lib/Target/ARM/Disassembler/Makefile deleted file mode 100644 index 031b6aca5a48..000000000000 --- a/contrib/llvm/lib/Target/ARM/Disassembler/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -##===- lib/Target/ARM/Disassembler/Makefile ----------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../../.. -LIBRARYNAME = LLVMARMDisassembler - -# Hack: we need to include 'main' arm target directory to grab private headers -CPPFLAGS = -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/ARM/Makefile b/contrib/llvm/lib/Target/ARM/Makefile deleted file mode 100644 index b3fcfaf6bda7..000000000000 --- a/contrib/llvm/lib/Target/ARM/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -##===- lib/Target/ARM/Makefile -----------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMARMCodeGen -TARGET = ARM - -# Make sure that tblgen is run, first thing. -BUILT_SOURCES = ARMGenRegisterInfo.h.inc ARMGenRegisterNames.inc \ - ARMGenRegisterInfo.inc ARMGenInstrNames.inc \ - ARMGenInstrInfo.inc ARMGenAsmWriter.inc ARMGenAsmMatcher.inc \ - ARMGenDAGISel.inc ARMGenSubtarget.inc \ - ARMGenCodeEmitter.inc ARMGenCallingConv.inc \ - ARMGenDecoderTables.inc ARMGenEDInfo.inc \ - ARMGenFastISel.inc - -DIRS = AsmPrinter AsmParser Disassembler TargetInfo - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/ARM/README-Thumb.txt b/contrib/llvm/lib/Target/ARM/README-Thumb.txt deleted file mode 100644 index 6b605bb0a7cf..000000000000 --- a/contrib/llvm/lib/Target/ARM/README-Thumb.txt +++ /dev/null @@ -1,248 +0,0 @@ -//===---------------------------------------------------------------------===// -// Random ideas for the ARM backend (Thumb specific). -//===---------------------------------------------------------------------===// - -* Add support for compiling functions in both ARM and Thumb mode, then taking - the smallest. - -* Add support for compiling individual basic blocks in thumb mode, when in a - larger ARM function. This can be used for presumed cold code, like paths - to abort (failure path of asserts), EH handling code, etc. - -* Thumb doesn't have normal pre/post increment addressing modes, but you can - load/store 32-bit integers with pre/postinc by using load/store multiple - instrs with a single register. - -* Make better use of high registers r8, r10, r11, r12 (ip). Some variants of add - and cmp instructions can use high registers. Also, we can use them as - temporaries to spill values into. - -* In thumb mode, short, byte, and bool preferred alignments are currently set - to 4 to accommodate ISA restriction (i.e. add sp, #imm, imm must be multiple - of 4). - -//===---------------------------------------------------------------------===// - -Potential jumptable improvements: - -* If we know function size is less than (1 << 16) * 2 bytes, we can use 16-bit - jumptable entries (e.g. (L1 - L2) >> 1). Or even smaller entries if the - function is even smaller. This also applies to ARM. - -* Thumb jumptable codegen can improve given some help from the assembler. This - is what we generate right now: - - .set PCRELV0, (LJTI1_0_0-(LPCRELL0+4)) -LPCRELL0: - mov r1, #PCRELV0 - add r1, pc - ldr r0, [r0, r1] - mov pc, r0 - .align 2 -LJTI1_0_0: - .long LBB1_3 - ... - -Note there is another pc relative add that we can take advantage of. - add r1, pc, #imm_8 * 4 - -We should be able to generate: - -LPCRELL0: - add r1, LJTI1_0_0 - ldr r0, [r0, r1] - mov pc, r0 - .align 2 -LJTI1_0_0: - .long LBB1_3 - -if the assembler can translate the add to: - add r1, pc, #((LJTI1_0_0-(LPCRELL0+4))&0xfffffffc) - -Note the assembler also does something similar to constpool load: -LPCRELL0: - ldr r0, LCPI1_0 -=> - ldr r0, pc, #((LCPI1_0-(LPCRELL0+4))&0xfffffffc) - - -//===---------------------------------------------------------------------===// - -We compiles the following: - -define i16 @func_entry_2E_ce(i32 %i) { - switch i32 %i, label %bb12.exitStub [ - i32 0, label %bb4.exitStub - i32 1, label %bb9.exitStub - i32 2, label %bb4.exitStub - i32 3, label %bb4.exitStub - i32 7, label %bb9.exitStub - i32 8, label %bb.exitStub - i32 9, label %bb9.exitStub - ] - -bb12.exitStub: - ret i16 0 - -bb4.exitStub: - ret i16 1 - -bb9.exitStub: - ret i16 2 - -bb.exitStub: - ret i16 3 -} - -into: - -_func_entry_2E_ce: - mov r2, #1 - lsl r2, r0 - cmp r0, #9 - bhi LBB1_4 @bb12.exitStub -LBB1_1: @newFuncRoot - mov r1, #13 - tst r2, r1 - bne LBB1_5 @bb4.exitStub -LBB1_2: @newFuncRoot - ldr r1, LCPI1_0 - tst r2, r1 - bne LBB1_6 @bb9.exitStub -LBB1_3: @newFuncRoot - mov r1, #1 - lsl r1, r1, #8 - tst r2, r1 - bne LBB1_7 @bb.exitStub -LBB1_4: @bb12.exitStub - mov r0, #0 - bx lr -LBB1_5: @bb4.exitStub - mov r0, #1 - bx lr -LBB1_6: @bb9.exitStub - mov r0, #2 - bx lr -LBB1_7: @bb.exitStub - mov r0, #3 - bx lr -LBB1_8: - .align 2 -LCPI1_0: - .long 642 - - -gcc compiles to: - - cmp r0, #9 - @ lr needed for prologue - bhi L2 - ldr r3, L11 - mov r2, #1 - mov r1, r2, asl r0 - ands r0, r3, r2, asl r0 - movne r0, #2 - bxne lr - tst r1, #13 - beq L9 -L3: - mov r0, r2 - bx lr -L9: - tst r1, #256 - movne r0, #3 - bxne lr -L2: - mov r0, #0 - bx lr -L12: - .align 2 -L11: - .long 642 - - -GCC is doing a couple of clever things here: - 1. It is predicating one of the returns. This isn't a clear win though: in - cases where that return isn't taken, it is replacing one condbranch with - two 'ne' predicated instructions. - 2. It is sinking the shift of "1 << i" into the tst, and using ands instead of - tst. This will probably require whole function isel. - 3. GCC emits: - tst r1, #256 - we emit: - mov r1, #1 - lsl r1, r1, #8 - tst r2, r1 - - -//===---------------------------------------------------------------------===// - -When spilling in thumb mode and the sp offset is too large to fit in the ldr / -str offset field, we load the offset from a constpool entry and add it to sp: - -ldr r2, LCPI -add r2, sp -ldr r2, [r2] - -These instructions preserve the condition code which is important if the spill -is between a cmp and a bcc instruction. However, we can use the (potentially) -cheaper sequnce if we know it's ok to clobber the condition register. - -add r2, sp, #255 * 4 -add r2, #132 -ldr r2, [r2, #7 * 4] - -This is especially bad when dynamic alloca is used. The all fixed size stack -objects are referenced off the frame pointer with negative offsets. See -oggenc for an example. - - -//===---------------------------------------------------------------------===// - -Poor codegen test/CodeGen/ARM/select.ll f7: - - ldr r5, LCPI1_0 -LPC0: - add r5, pc - ldr r6, LCPI1_1 - ldr r2, LCPI1_2 - mov r3, r6 - mov lr, pc - bx r5 - -//===---------------------------------------------------------------------===// - -Make register allocator / spiller smarter so we can re-materialize "mov r, imm", -etc. Almost all Thumb instructions clobber condition code. - -//===---------------------------------------------------------------------===// - -Add ldmia, stmia support. - -//===---------------------------------------------------------------------===// - -Thumb load / store address mode offsets are scaled. The values kept in the -instruction operands are pre-scale values. This probably ought to be changed -to avoid extra work when we convert Thumb2 instructions to Thumb1 instructions. - -//===---------------------------------------------------------------------===// - -We need to make (some of the) Thumb1 instructions predicable. That will allow -shrinking of predicated Thumb2 instructions. To allow this, we need to be able -to toggle the 's' bit since they do not set CPSR when they are inside IT blocks. - -//===---------------------------------------------------------------------===// - -Make use of hi register variants of cmp: tCMPhir / tCMPZhir. - -//===---------------------------------------------------------------------===// - -Thumb1 immediate field sometimes keep pre-scaled values. See -Thumb1RegisterInfo::eliminateFrameIndex. This is inconsistent from ARM and -Thumb2. - -//===---------------------------------------------------------------------===// - -Rather than having tBR_JTr print a ".align 2" and constant island pass pad it, -add a target specific ALIGN instruction instead. That way, GetInstSizeInBytes -won't have to over-estimate. It can also be used for loop alignment pass. diff --git a/contrib/llvm/lib/Target/ARM/README-Thumb2.txt b/contrib/llvm/lib/Target/ARM/README-Thumb2.txt deleted file mode 100644 index e7c2552d9e4c..000000000000 --- a/contrib/llvm/lib/Target/ARM/README-Thumb2.txt +++ /dev/null @@ -1,6 +0,0 @@ -//===---------------------------------------------------------------------===// -// Random ideas for the ARM backend (Thumb2 specific). -//===---------------------------------------------------------------------===// - -Make sure jumptable destinations are below the jumptable in order to make use -of tbb / tbh. diff --git a/contrib/llvm/lib/Target/ARM/README.txt b/contrib/llvm/lib/Target/ARM/README.txt deleted file mode 100644 index 9fc3fb92cb2c..000000000000 --- a/contrib/llvm/lib/Target/ARM/README.txt +++ /dev/null @@ -1,659 +0,0 @@ -//===---------------------------------------------------------------------===// -// Random ideas for the ARM backend. -//===---------------------------------------------------------------------===// - -Reimplement 'select' in terms of 'SEL'. - -* We would really like to support UXTAB16, but we need to prove that the - add doesn't need to overflow between the two 16-bit chunks. - -* Implement pre/post increment support. (e.g. PR935) -* Implement smarter constant generation for binops with large immediates. - -A few ARMv6T2 ops should be pattern matched: BFI, SBFX, and UBFX - -Interesting optimization for PIC codegen on arm-linux: -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43129 - -//===---------------------------------------------------------------------===// - -Crazy idea: Consider code that uses lots of 8-bit or 16-bit values. By the -time regalloc happens, these values are now in a 32-bit register, usually with -the top-bits known to be sign or zero extended. If spilled, we should be able -to spill these to a 8-bit or 16-bit stack slot, zero or sign extending as part -of the reload. - -Doing this reduces the size of the stack frame (important for thumb etc), and -also increases the likelihood that we will be able to reload multiple values -from the stack with a single load. - -//===---------------------------------------------------------------------===// - -The constant island pass is in good shape. Some cleanups might be desirable, -but there is unlikely to be much improvement in the generated code. - -1. There may be some advantage to trying to be smarter about the initial -placement, rather than putting everything at the end. - -2. There might be some compile-time efficiency to be had by representing -consecutive islands as a single block rather than multiple blocks. - -3. Use a priority queue to sort constant pool users in inverse order of - position so we always process the one closed to the end of functions - first. This may simply CreateNewWater. - -//===---------------------------------------------------------------------===// - -Eliminate copysign custom expansion. We are still generating crappy code with -default expansion + if-conversion. - -//===---------------------------------------------------------------------===// - -Eliminate one instruction from: - -define i32 @_Z6slow4bii(i32 %x, i32 %y) { - %tmp = icmp sgt i32 %x, %y - %retval = select i1 %tmp, i32 %x, i32 %y - ret i32 %retval -} - -__Z6slow4bii: - cmp r0, r1 - movgt r1, r0 - mov r0, r1 - bx lr -=> - -__Z6slow4bii: - cmp r0, r1 - movle r0, r1 - bx lr - -//===---------------------------------------------------------------------===// - -Implement long long "X-3" with instructions that fold the immediate in. These -were disabled due to badness with the ARM carry flag on subtracts. - -//===---------------------------------------------------------------------===// - -More load / store optimizations: -1) Better representation for block transfer? This is from Olden/power: - - fldd d0, [r4] - fstd d0, [r4, #+32] - fldd d0, [r4, #+8] - fstd d0, [r4, #+40] - fldd d0, [r4, #+16] - fstd d0, [r4, #+48] - fldd d0, [r4, #+24] - fstd d0, [r4, #+56] - -If we can spare the registers, it would be better to use fldm and fstm here. -Need major register allocator enhancement though. - -2) Can we recognize the relative position of constantpool entries? i.e. Treat - - ldr r0, LCPI17_3 - ldr r1, LCPI17_4 - ldr r2, LCPI17_5 - - as - ldr r0, LCPI17 - ldr r1, LCPI17+4 - ldr r2, LCPI17+8 - - Then the ldr's can be combined into a single ldm. See Olden/power. - -Note for ARM v4 gcc uses ldmia to load a pair of 32-bit values to represent a -double 64-bit FP constant: - - adr r0, L6 - ldmia r0, {r0-r1} - - .align 2 -L6: - .long -858993459 - .long 1074318540 - -3) struct copies appear to be done field by field -instead of by words, at least sometimes: - -struct foo { int x; short s; char c1; char c2; }; -void cpy(struct foo*a, struct foo*b) { *a = *b; } - -llvm code (-O2) - ldrb r3, [r1, #+6] - ldr r2, [r1] - ldrb r12, [r1, #+7] - ldrh r1, [r1, #+4] - str r2, [r0] - strh r1, [r0, #+4] - strb r3, [r0, #+6] - strb r12, [r0, #+7] -gcc code (-O2) - ldmia r1, {r1-r2} - stmia r0, {r1-r2} - -In this benchmark poor handling of aggregate copies has shown up as -having a large effect on size, and possibly speed as well (we don't have -a good way to measure on ARM). - -//===---------------------------------------------------------------------===// - -* Consider this silly example: - -double bar(double x) { - double r = foo(3.1); - return x+r; -} - -_bar: - stmfd sp!, {r4, r5, r7, lr} - add r7, sp, #8 - mov r4, r0 - mov r5, r1 - fldd d0, LCPI1_0 - fmrrd r0, r1, d0 - bl _foo - fmdrr d0, r4, r5 - fmsr s2, r0 - fsitod d1, s2 - faddd d0, d1, d0 - fmrrd r0, r1, d0 - ldmfd sp!, {r4, r5, r7, pc} - -Ignore the prologue and epilogue stuff for a second. Note - mov r4, r0 - mov r5, r1 -the copys to callee-save registers and the fact they are only being used by the -fmdrr instruction. It would have been better had the fmdrr been scheduled -before the call and place the result in a callee-save DPR register. The two -mov ops would not have been necessary. - -//===---------------------------------------------------------------------===// - -Calling convention related stuff: - -* gcc's parameter passing implementation is terrible and we suffer as a result: - -e.g. -struct s { - double d1; - int s1; -}; - -void foo(struct s S) { - printf("%g, %d\n", S.d1, S.s1); -} - -'S' is passed via registers r0, r1, r2. But gcc stores them to the stack, and -then reload them to r1, r2, and r3 before issuing the call (r0 contains the -address of the format string): - - stmfd sp!, {r7, lr} - add r7, sp, #0 - sub sp, sp, #12 - stmia sp, {r0, r1, r2} - ldmia sp, {r1-r2} - ldr r0, L5 - ldr r3, [sp, #8] -L2: - add r0, pc, r0 - bl L_printf$stub - -Instead of a stmia, ldmia, and a ldr, wouldn't it be better to do three moves? - -* Return an aggregate type is even worse: - -e.g. -struct s foo(void) { - struct s S = {1.1, 2}; - return S; -} - - mov ip, r0 - ldr r0, L5 - sub sp, sp, #12 -L2: - add r0, pc, r0 - @ lr needed for prologue - ldmia r0, {r0, r1, r2} - stmia sp, {r0, r1, r2} - stmia ip, {r0, r1, r2} - mov r0, ip - add sp, sp, #12 - bx lr - -r0 (and later ip) is the hidden parameter from caller to store the value in. The -first ldmia loads the constants into r0, r1, r2. The last stmia stores r0, r1, -r2 into the address passed in. However, there is one additional stmia that -stores r0, r1, and r2 to some stack location. The store is dead. - -The llvm-gcc generated code looks like this: - -csretcc void %foo(%struct.s* %agg.result) { -entry: - %S = alloca %struct.s, align 4 ; <%struct.s*> [#uses=1] - %memtmp = alloca %struct.s ; <%struct.s*> [#uses=1] - cast %struct.s* %S to sbyte* ; :0 [#uses=2] - call void %llvm.memcpy.i32( sbyte* %0, sbyte* cast ({ double, int }* %C.0.904 to sbyte*), uint 12, uint 4 ) - cast %struct.s* %agg.result to sbyte* ; :1 [#uses=2] - call void %llvm.memcpy.i32( sbyte* %1, sbyte* %0, uint 12, uint 0 ) - cast %struct.s* %memtmp to sbyte* ; :2 [#uses=1] - call void %llvm.memcpy.i32( sbyte* %2, sbyte* %1, uint 12, uint 0 ) - ret void -} - -llc ends up issuing two memcpy's (the first memcpy becomes 3 loads from -constantpool). Perhaps we should 1) fix llvm-gcc so the memcpy is translated -into a number of load and stores, or 2) custom lower memcpy (of small size) to -be ldmia / stmia. I think option 2 is better but the current register -allocator cannot allocate a chunk of registers at a time. - -A feasible temporary solution is to use specific physical registers at the -lowering time for small (<= 4 words?) transfer size. - -* ARM CSRet calling convention requires the hidden argument to be returned by -the callee. - -//===---------------------------------------------------------------------===// - -We can definitely do a better job on BB placements to eliminate some branches. -It's very common to see llvm generated assembly code that looks like this: - -LBB3: - ... -LBB4: -... - beq LBB3 - b LBB2 - -If BB4 is the only predecessor of BB3, then we can emit BB3 after BB4. We can -then eliminate beq and and turn the unconditional branch to LBB2 to a bne. - -See McCat/18-imp/ComputeBoundingBoxes for an example. - -//===---------------------------------------------------------------------===// - -Pre-/post- indexed load / stores: - -1) We should not make the pre/post- indexed load/store transform if the base ptr -is guaranteed to be live beyond the load/store. This can happen if the base -ptr is live out of the block we are performing the optimization. e.g. - -mov r1, r2 -ldr r3, [r1], #4 -... - -vs. - -ldr r3, [r2] -add r1, r2, #4 -... - -In most cases, this is just a wasted optimization. However, sometimes it can -negatively impact the performance because two-address code is more restrictive -when it comes to scheduling. - -Unfortunately, liveout information is currently unavailable during DAG combine -time. - -2) Consider spliting a indexed load / store into a pair of add/sub + load/store - to solve #1 (in TwoAddressInstructionPass.cpp). - -3) Enhance LSR to generate more opportunities for indexed ops. - -4) Once we added support for multiple result patterns, write indexed loads - patterns instead of C++ instruction selection code. - -5) Use VLDM / VSTM to emulate indexed FP load / store. - -//===---------------------------------------------------------------------===// - -Implement support for some more tricky ways to materialize immediates. For -example, to get 0xffff8000, we can use: - -mov r9, #&3f8000 -sub r9, r9, #&400000 - -//===---------------------------------------------------------------------===// - -We sometimes generate multiple add / sub instructions to update sp in prologue -and epilogue if the inc / dec value is too large to fit in a single immediate -operand. In some cases, perhaps it might be better to load the value from a -constantpool instead. - -//===---------------------------------------------------------------------===// - -GCC generates significantly better code for this function. - -int foo(int StackPtr, unsigned char *Line, unsigned char *Stack, int LineLen) { - int i = 0; - - if (StackPtr != 0) { - while (StackPtr != 0 && i < (((LineLen) < (32768))? (LineLen) : (32768))) - Line[i++] = Stack[--StackPtr]; - if (LineLen > 32768) - { - while (StackPtr != 0 && i < LineLen) - { - i++; - --StackPtr; - } - } - } - return StackPtr; -} - -//===---------------------------------------------------------------------===// - -This should compile to the mlas instruction: -int mlas(int x, int y, int z) { return ((x * y + z) < 0) ? 7 : 13; } - -//===---------------------------------------------------------------------===// - -At some point, we should triage these to see if they still apply to us: - -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19598 -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18560 -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27016 - -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11831 -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11826 -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11825 -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11824 -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11823 -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11820 -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10982 - -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10242 -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9831 -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9760 -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9759 -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9703 -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9702 -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9663 - -http://www.inf.u-szeged.hu/gcc-arm/ -http://citeseer.ist.psu.edu/debus04linktime.html - -//===---------------------------------------------------------------------===// - -gcc generates smaller code for this function at -O2 or -Os: - -void foo(signed char* p) { - if (*p == 3) - bar(); - else if (*p == 4) - baz(); - else if (*p == 5) - quux(); -} - -llvm decides it's a good idea to turn the repeated if...else into a -binary tree, as if it were a switch; the resulting code requires -1 -compare-and-branches when *p<=2 or *p==5, the same number if *p==4 -or *p>6, and +1 if *p==3. So it should be a speed win -(on balance). However, the revised code is larger, with 4 conditional -branches instead of 3. - -More seriously, there is a byte->word extend before -each comparison, where there should be only one, and the condition codes -are not remembered when the same two values are compared twice. - -//===---------------------------------------------------------------------===// - -More LSR enhancements possible: - -1. Teach LSR about pre- and post- indexed ops to allow iv increment be merged - in a load / store. -2. Allow iv reuse even when a type conversion is required. For example, i8 - and i32 load / store addressing modes are identical. - - -//===---------------------------------------------------------------------===// - -This: - -int foo(int a, int b, int c, int d) { - long long acc = (long long)a * (long long)b; - acc += (long long)c * (long long)d; - return (int)(acc >> 32); -} - -Should compile to use SMLAL (Signed Multiply Accumulate Long) which multiplies -two signed 32-bit values to produce a 64-bit value, and accumulates this with -a 64-bit value. - -We currently get this with both v4 and v6: - -_foo: - smull r1, r0, r1, r0 - smull r3, r2, r3, r2 - adds r3, r3, r1 - adc r0, r2, r0 - bx lr - -//===---------------------------------------------------------------------===// - -This: - #include - std::pair full_add(unsigned a, unsigned b) - { return std::make_pair(a + b, a + b < a); } - bool no_overflow(unsigned a, unsigned b) - { return !full_add(a, b).second; } - -Should compile to: - -_Z8full_addjj: - adds r2, r1, r2 - movcc r1, #0 - movcs r1, #1 - str r2, [r0, #0] - strb r1, [r0, #4] - mov pc, lr - -_Z11no_overflowjj: - cmn r0, r1 - movcs r0, #0 - movcc r0, #1 - mov pc, lr - -not: - -__Z8full_addjj: - add r3, r2, r1 - str r3, [r0] - mov r2, #1 - mov r12, #0 - cmp r3, r1 - movlo r12, r2 - str r12, [r0, #+4] - bx lr -__Z11no_overflowjj: - add r3, r1, r0 - mov r2, #1 - mov r1, #0 - cmp r3, r0 - movhs r1, r2 - mov r0, r1 - bx lr - -//===---------------------------------------------------------------------===// - -Some of the NEON intrinsics may be appropriate for more general use, either -as target-independent intrinsics or perhaps elsewhere in the ARM backend. -Some of them may also be lowered to target-independent SDNodes, and perhaps -some new SDNodes could be added. - -For example, maximum, minimum, and absolute value operations are well-defined -and standard operations, both for vector and scalar types. - -The current NEON-specific intrinsics for count leading zeros and count one -bits could perhaps be replaced by the target-independent ctlz and ctpop -intrinsics. It may also make sense to add a target-independent "ctls" -intrinsic for "count leading sign bits". Likewise, the backend could use -the target-independent SDNodes for these operations. - -ARMv6 has scalar saturating and halving adds and subtracts. The same -intrinsics could possibly be used for both NEON's vector implementations of -those operations and the ARMv6 scalar versions. - -//===---------------------------------------------------------------------===// - -ARM::MOVCCr is commutable (by flipping the condition). But we need to implement -ARMInstrInfo::commuteInstruction() to support it. - -//===---------------------------------------------------------------------===// - -Split out LDR (literal) from normal ARM LDR instruction. Also consider spliting -LDR into imm12 and so_reg forms. This allows us to clean up some code. e.g. -ARMLoadStoreOptimizer does not need to look at LDR (literal) and LDR (so_reg) -while ARMConstantIslandPass only need to worry about LDR (literal). - -//===---------------------------------------------------------------------===// - -Constant island pass should make use of full range SoImm values for LEApcrel. -Be careful though as the last attempt caused infinite looping on lencod. - -//===---------------------------------------------------------------------===// - -Predication issue. This function: - -extern unsigned array[ 128 ]; -int foo( int x ) { - int y; - y = array[ x & 127 ]; - if ( x & 128 ) - y = 123456789 & ( y >> 2 ); - else - y = 123456789 & y; - return y; -} - -compiles to: - -_foo: - and r1, r0, #127 - ldr r2, LCPI1_0 - ldr r2, [r2] - ldr r1, [r2, +r1, lsl #2] - mov r2, r1, lsr #2 - tst r0, #128 - moveq r2, r1 - ldr r0, LCPI1_1 - and r0, r2, r0 - bx lr - -It would be better to do something like this, to fold the shift into the -conditional move: - - and r1, r0, #127 - ldr r2, LCPI1_0 - ldr r2, [r2] - ldr r1, [r2, +r1, lsl #2] - tst r0, #128 - movne r1, r1, lsr #2 - ldr r0, LCPI1_1 - and r0, r1, r0 - bx lr - -it saves an instruction and a register. - -//===---------------------------------------------------------------------===// - -It might be profitable to cse MOVi16 if there are lots of 32-bit immediates -with the same bottom half. - -//===---------------------------------------------------------------------===// - -Robert Muth started working on an alternate jump table implementation that -does not put the tables in-line in the text. This is more like the llvm -default jump table implementation. This might be useful sometime. Several -revisions of patches are on the mailing list, beginning at: -http://lists.cs.uiuc.edu/pipermail/llvmdev/2009-June/022763.html - -//===---------------------------------------------------------------------===// - -Make use of the "rbit" instruction. - -//===---------------------------------------------------------------------===// - -Take a look at test/CodeGen/Thumb2/machine-licm.ll. ARM should be taught how -to licm and cse the unnecessary load from cp#1. - -//===---------------------------------------------------------------------===// - -The CMN instruction sets the flags like an ADD instruction, while CMP sets -them like a subtract. Therefore to be able to use CMN for comparisons other -than the Z bit, we'll need additional logic to reverse the conditionals -associated with the comparison. Perhaps a pseudo-instruction for the comparison, -with a post-codegen pass to clean up and handle the condition codes? -See PR5694 for testcase. - -//===---------------------------------------------------------------------===// - -Given the following on armv5: -int test1(int A, int B) { - return (A&-8388481)|(B&8388480); -} - -We currently generate: - ldr r2, .LCPI0_0 - and r0, r0, r2 - ldr r2, .LCPI0_1 - and r1, r1, r2 - orr r0, r1, r0 - bx lr - -We should be able to replace the second ldr+and with a bic (i.e. reuse the -constant which was already loaded). Not sure what's necessary to do that. - -//===---------------------------------------------------------------------===// - -The code generated for bswap on armv4/5 (CPUs without rev) is less than ideal: - -int a(int x) { return __builtin_bswap32(x); } - -a: - mov r1, #255, 24 - mov r2, #255, 16 - and r1, r1, r0, lsr #8 - and r2, r2, r0, lsl #8 - orr r1, r1, r0, lsr #24 - orr r0, r2, r0, lsl #24 - orr r0, r0, r1 - bx lr - -Something like the following would be better (fewer instructions/registers): - eor r1, r0, r0, ror #16 - bic r1, r1, #0xff0000 - mov r1, r1, lsr #8 - eor r0, r1, r0, ror #8 - bx lr - -A custom Thumb version would also be a slight improvement over the generic -version. - -//===---------------------------------------------------------------------===// - -Consider the following simple C code: - -void foo(unsigned char *a, unsigned char *b, int *c) { - if ((*a | *b) == 0) *c = 0; -} - -currently llvm-gcc generates something like this (nice branchless code I'd say): - - ldrb r0, [r0] - ldrb r1, [r1] - orr r0, r1, r0 - tst r0, #255 - moveq r0, #0 - streq r0, [r2] - bx lr - -Note that both "tst" and "moveq" are redundant. - -//===---------------------------------------------------------------------===// - diff --git a/contrib/llvm/lib/Target/ARM/TargetInfo/CMakeLists.txt b/contrib/llvm/lib/Target/ARM/TargetInfo/CMakeLists.txt deleted file mode 100644 index 3910bb02e219..000000000000 --- a/contrib/llvm/lib/Target/ARM/TargetInfo/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMARMInfo - ARMTargetInfo.cpp - ) - -add_dependencies(LLVMARMInfo ARMCodeGenTable_gen) diff --git a/contrib/llvm/lib/Target/ARM/TargetInfo/Makefile b/contrib/llvm/lib/Target/ARM/TargetInfo/Makefile deleted file mode 100644 index 6292ab14b346..000000000000 --- a/contrib/llvm/lib/Target/ARM/TargetInfo/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Target/ARM/TargetInfo/Makefile ------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../../.. -LIBRARYNAME = LLVMARMInfo - -# Hack: we need to include 'main' target directory to grab private headers -CPPFLAGS = -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/Alpha/AsmPrinter/CMakeLists.txt b/contrib/llvm/lib/Target/Alpha/AsmPrinter/CMakeLists.txt deleted file mode 100644 index 992c21813149..000000000000 --- a/contrib/llvm/lib/Target/Alpha/AsmPrinter/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMAlphaAsmPrinter - AlphaAsmPrinter.cpp - ) -add_dependencies(LLVMAlphaAsmPrinter AlphaCodeGenTable_gen) diff --git a/contrib/llvm/lib/Target/Alpha/AsmPrinter/Makefile b/contrib/llvm/lib/Target/Alpha/AsmPrinter/Makefile deleted file mode 100644 index ea13c38df4aa..000000000000 --- a/contrib/llvm/lib/Target/Alpha/AsmPrinter/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Target/Alpha/AsmPrinter/Makefile ----------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../../.. -LIBRARYNAME = LLVMAlphaAsmPrinter - -# Hack: we need to include 'main' alpha target directory to grab private headers -CPP.Flags += -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/Alpha/CMakeLists.txt b/contrib/llvm/lib/Target/Alpha/CMakeLists.txt deleted file mode 100644 index fbf7f3ab6b30..000000000000 --- a/contrib/llvm/lib/Target/Alpha/CMakeLists.txt +++ /dev/null @@ -1,29 +0,0 @@ -set(LLVM_TARGET_DEFINITIONS Alpha.td) - -tablegen(AlphaGenRegisterInfo.h.inc -gen-register-desc-header) -tablegen(AlphaGenRegisterNames.inc -gen-register-enums) -tablegen(AlphaGenRegisterInfo.inc -gen-register-desc) -tablegen(AlphaGenInstrNames.inc -gen-instr-enums) -tablegen(AlphaGenInstrInfo.inc -gen-instr-desc) -tablegen(AlphaGenCodeEmitter.inc -gen-emitter) -tablegen(AlphaGenAsmWriter.inc -gen-asm-writer) -tablegen(AlphaGenDAGISel.inc -gen-dag-isel) -tablegen(AlphaGenCallingConv.inc -gen-callingconv) -tablegen(AlphaGenSubtarget.inc -gen-subtarget) - -add_llvm_target(AlphaCodeGen - AlphaBranchSelector.cpp - AlphaCodeEmitter.cpp - AlphaInstrInfo.cpp - AlphaISelDAGToDAG.cpp - AlphaISelLowering.cpp - AlphaJITInfo.cpp - AlphaLLRP.cpp - AlphaMCAsmInfo.cpp - AlphaRegisterInfo.cpp - AlphaSubtarget.cpp - AlphaTargetMachine.cpp - AlphaSelectionDAGInfo.cpp - ) - -target_link_libraries (LLVMAlphaCodeGen LLVMSelectionDAG) diff --git a/contrib/llvm/lib/Target/Alpha/Makefile b/contrib/llvm/lib/Target/Alpha/Makefile deleted file mode 100644 index 54d53abea5f1..000000000000 --- a/contrib/llvm/lib/Target/Alpha/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -##===- lib/Target/Alpha/Makefile -------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMAlphaCodeGen -TARGET = Alpha - -# Make sure that tblgen is run, first thing. -BUILT_SOURCES = AlphaGenRegisterInfo.h.inc AlphaGenRegisterNames.inc \ - AlphaGenRegisterInfo.inc AlphaGenInstrNames.inc \ - AlphaGenInstrInfo.inc AlphaGenCodeEmitter.inc \ - AlphaGenAsmWriter.inc AlphaGenDAGISel.inc \ - AlphaGenCallingConv.inc AlphaGenSubtarget.inc - -DIRS = AsmPrinter TargetInfo - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/Alpha/README.txt b/contrib/llvm/lib/Target/Alpha/README.txt deleted file mode 100644 index 9ae15174c582..000000000000 --- a/contrib/llvm/lib/Target/Alpha/README.txt +++ /dev/null @@ -1,42 +0,0 @@ -*** - -add gcc builtins for alpha instructions - - -*** - -custom expand byteswap into nifty -extract/insert/mask byte/word/longword/quadword low/high -sequences - -*** - -see if any of the extract/insert/mask operations can be added - -*** - -match more interesting things for cmovlbc cmovlbs (move if low bit clear/set) - -*** - -lower srem and urem - -remq(i,j): i - (j * divq(i,j)) if j != 0 -remqu(i,j): i - (j * divqu(i,j)) if j != 0 -reml(i,j): i - (j * divl(i,j)) if j != 0 -remlu(i,j): i - (j * divlu(i,j)) if j != 0 - -*** - -add crazy vector instructions (MVI): - -(MIN|MAX)(U|S)(B8|W4) min and max, signed and unsigned, byte and word -PKWB, UNPKBW pack/unpack word to byte -PKLB UNPKBL pack/unpack long to byte -PERR pixel error (sum accross bytes of bytewise abs(i8v8 a - i8v8 b)) - -cmpbytes bytewise cmpeq of i8v8 a and i8v8 b (not part of MVI extentions) - -this has some good examples for other operations that can be synthesised well -from these rather meager vector ops (such as saturating add). -http://www.alphalinux.org/docs/MVI-full.html diff --git a/contrib/llvm/lib/Target/Alpha/TargetInfo/CMakeLists.txt b/contrib/llvm/lib/Target/Alpha/TargetInfo/CMakeLists.txt deleted file mode 100644 index 2a7291b90aeb..000000000000 --- a/contrib/llvm/lib/Target/Alpha/TargetInfo/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMAlphaInfo - AlphaTargetInfo.cpp - ) - -add_dependencies(LLVMAlphaInfo AlphaCodeGenTable_gen) diff --git a/contrib/llvm/lib/Target/Alpha/TargetInfo/Makefile b/contrib/llvm/lib/Target/Alpha/TargetInfo/Makefile deleted file mode 100644 index de01d7f8e8ef..000000000000 --- a/contrib/llvm/lib/Target/Alpha/TargetInfo/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Target/Alpha/TargetInfo/Makefile ----------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../../.. -LIBRARYNAME = LLVMAlphaInfo - -# Hack: we need to include 'main' target directory to grab private headers -CPPFLAGS = -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/Blackfin/AsmPrinter/CMakeLists.txt b/contrib/llvm/lib/Target/Blackfin/AsmPrinter/CMakeLists.txt deleted file mode 100644 index 795aebfe2b8e..000000000000 --- a/contrib/llvm/lib/Target/Blackfin/AsmPrinter/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMBlackfinAsmPrinter - BlackfinAsmPrinter.cpp - ) -add_dependencies(LLVMBlackfinAsmPrinter BlackfinCodeGenTable_gen) diff --git a/contrib/llvm/lib/Target/Blackfin/AsmPrinter/Makefile b/contrib/llvm/lib/Target/Blackfin/AsmPrinter/Makefile deleted file mode 100644 index a106a2382a14..000000000000 --- a/contrib/llvm/lib/Target/Blackfin/AsmPrinter/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -##===- lib/Target/Blackfin/AsmPrinter/Makefile -------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../../.. -LIBRARYNAME = LLVMBlackfinAsmPrinter - -# Hack: we need to include 'main' Blackfin target directory to grab private -# headers -CPP.Flags += -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/Blackfin/CMakeLists.txt b/contrib/llvm/lib/Target/Blackfin/CMakeLists.txt deleted file mode 100644 index f8847d057da6..000000000000 --- a/contrib/llvm/lib/Target/Blackfin/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -set(LLVM_TARGET_DEFINITIONS Blackfin.td) - -tablegen(BlackfinGenRegisterInfo.h.inc -gen-register-desc-header) -tablegen(BlackfinGenRegisterNames.inc -gen-register-enums) -tablegen(BlackfinGenRegisterInfo.inc -gen-register-desc) -tablegen(BlackfinGenInstrNames.inc -gen-instr-enums) -tablegen(BlackfinGenInstrInfo.inc -gen-instr-desc) -tablegen(BlackfinGenAsmWriter.inc -gen-asm-writer) -tablegen(BlackfinGenDAGISel.inc -gen-dag-isel) -tablegen(BlackfinGenSubtarget.inc -gen-subtarget) -tablegen(BlackfinGenCallingConv.inc -gen-callingconv) -tablegen(BlackfinGenIntrinsics.inc -gen-tgt-intrinsic) - -add_llvm_target(BlackfinCodeGen - BlackfinInstrInfo.cpp - BlackfinIntrinsicInfo.cpp - BlackfinISelDAGToDAG.cpp - BlackfinISelLowering.cpp - BlackfinMCAsmInfo.cpp - BlackfinRegisterInfo.cpp - BlackfinSubtarget.cpp - BlackfinTargetMachine.cpp - BlackfinSelectionDAGInfo.cpp - ) diff --git a/contrib/llvm/lib/Target/Blackfin/Makefile b/contrib/llvm/lib/Target/Blackfin/Makefile deleted file mode 100644 index 339bef9981f4..000000000000 --- a/contrib/llvm/lib/Target/Blackfin/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -##===- lib/Target/Blackfin/Makefile ------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMBlackfinCodeGen -TARGET = Blackfin - -# Make sure that tblgen is run, first thing. -BUILT_SOURCES = BlackfinGenRegisterInfo.h.inc BlackfinGenRegisterNames.inc \ - BlackfinGenRegisterInfo.inc BlackfinGenInstrNames.inc \ - BlackfinGenInstrInfo.inc BlackfinGenAsmWriter.inc \ - BlackfinGenDAGISel.inc BlackfinGenSubtarget.inc \ - BlackfinGenCallingConv.inc BlackfinGenIntrinsics.inc - -DIRS = AsmPrinter TargetInfo - -include $(LEVEL)/Makefile.common - diff --git a/contrib/llvm/lib/Target/Blackfin/README.txt b/contrib/llvm/lib/Target/Blackfin/README.txt deleted file mode 100644 index b4c8227cd645..000000000000 --- a/contrib/llvm/lib/Target/Blackfin/README.txt +++ /dev/null @@ -1,244 +0,0 @@ -//===-- README.txt - Notes for Blackfin Target ------------------*- org -*-===// - -* Condition codes -** DONE Problem with asymmetric SETCC operations -The instruction - - CC = R0 < 2 - -is not symmetric - there is no R0 > 2 instruction. On the other hand, IF CC -JUMP can take both CC and !CC as a condition. We cannot pattern-match (brcond -(not cc), target), the DAG optimizer removes that kind of thing. - -This is handled by creating a pseudo-register NCC that aliases CC. Register -classes JustCC and NotCC are used to control the inversion of CC. - -** DONE CC as an i32 register -The AnyCC register class pretends to hold i32 values. It can only represent the -values 0 and 1, but we can copy to and from the D class. This hack makes it -possible to represent the setcc instruction without having i1 as a legal type. - -In most cases, the CC register is set by a "CC = .." or BITTST instruction, and -then used in a conditional branch or move. The code generator thinks it is -moving 32 bits, but the value stays in CC. In other cases, the result of a -comparison is actually used as am i32 number, and CC will be copied to a D -register. - -* Stack frames -** TODO Use Push/Pop instructions -We should use the push/pop instructions when saving callee-saved -registers. The are smaller, and we may even use push multiple instructions. - -** TODO requiresRegisterScavenging -We need more intelligence in determining when the scavenger is needed. We -should keep track of: -- Spilling D16 registers -- Spilling AnyCC registers - -* Assembler -** TODO Implement PrintGlobalVariable -** TODO Remove LOAD32sym -It's a hack combining two instructions by concatenation. - -* Inline Assembly - -These are the GCC constraints from bfin/constraints.md: - -| Code | Register class | LLVM | -|-------+-------------------------------------------+------| -| a | P | C | -| d | D | C | -| z | Call clobbered P (P0, P1, P2) | X | -| D | EvenD | X | -| W | OddD | X | -| e | Accu | C | -| A | A0 | S | -| B | A1 | S | -| b | I | C | -| v | B | C | -| f | M | C | -| c | Circular I, B, L | X | -| C | JustCC | S | -| t | LoopTop | X | -| u | LoopBottom | X | -| k | LoopCount | X | -| x | GR | C | -| y | RET*, ASTAT, SEQSTAT, USP | X | -| w | ALL | C | -| Z | The FD-PIC GOT pointer (P3) | S | -| Y | The FD-PIC function pointer register (P1) | S | -| q0-q7 | R0-R7 individually | | -| qA | P0 | | -|-------+-------------------------------------------+------| -| Code | Constant | | -|-------+-------------------------------------------+------| -| J | 1< \ - --enable-targets=x86,x86_64,powerpc,spu - ---------------------------------------------------------------------------- - -TODO: -* Create a machine pass for performing dual-pipeline scheduling specifically - for CellSPU, and insert branch prediction instructions as needed. - -* i32 instructions: - - * i32 division (work-in-progress) - -* i64 support (see i64operations.c test harness): - - * shifts and comparison operators: done - * sign and zero extension: done - * addition: done - * subtraction: needed - * multiplication: done - -* i128 support: - - * zero extension, any extension: done - * sign extension: needed - * arithmetic operators (add, sub, mul, div): needed - * logical operations (and, or, shl, srl, sra, xor, nor, nand): needed - - * or: done - -* f64 support - - * Comparison operators: - SETOEQ unimplemented - SETOGT unimplemented - SETOGE unimplemented - SETOLT unimplemented - SETOLE unimplemented - SETONE unimplemented - SETO done (lowered) - SETUO done (lowered) - SETUEQ unimplemented - SETUGT unimplemented - SETUGE unimplemented - SETULT unimplemented - SETULE unimplemented - SETUNE unimplemented - -* LLVM vector suport - - * VSETCC needs to be implemented. It's pretty straightforward to code, but - needs implementation. - -* Intrinsics - - * spu.h instrinsics added but not tested. Need to have an operational - llvm-spu-gcc in order to write a unit test harness. - -===-------------------------------------------------------------------------=== diff --git a/contrib/llvm/lib/Target/CellSPU/TargetInfo/CMakeLists.txt b/contrib/llvm/lib/Target/CellSPU/TargetInfo/CMakeLists.txt deleted file mode 100644 index 928d0fe97e0d..000000000000 --- a/contrib/llvm/lib/Target/CellSPU/TargetInfo/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMCellSPUInfo - CellSPUTargetInfo.cpp - ) - -add_dependencies(LLVMCellSPUInfo CellSPUCodeGenTable_gen) diff --git a/contrib/llvm/lib/Target/CellSPU/TargetInfo/Makefile b/contrib/llvm/lib/Target/CellSPU/TargetInfo/Makefile deleted file mode 100644 index 9cb6827b4323..000000000000 --- a/contrib/llvm/lib/Target/CellSPU/TargetInfo/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Target/CellSPU/TargetInfo/Makefile --------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../../.. -LIBRARYNAME = LLVMCellSPUInfo - -# Hack: we need to include 'main' target directory to grab private headers -CPPFLAGS = -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/CppBackend/CMakeLists.txt b/contrib/llvm/lib/Target/CppBackend/CMakeLists.txt deleted file mode 100644 index f8182b80c94c..000000000000 --- a/contrib/llvm/lib/Target/CppBackend/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_llvm_target(CppBackend - CPPBackend.cpp - ) diff --git a/contrib/llvm/lib/Target/CppBackend/Makefile b/contrib/llvm/lib/Target/CppBackend/Makefile deleted file mode 100644 index d75f4e872265..000000000000 --- a/contrib/llvm/lib/Target/CppBackend/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -##===- lib/Target/CppBackend/Makefile --- ------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMCppBackend -DIRS = TargetInfo - -include $(LEVEL)/Makefile.common - -CompileCommonOpts += -Wno-format diff --git a/contrib/llvm/lib/Target/CppBackend/TargetInfo/CMakeLists.txt b/contrib/llvm/lib/Target/CppBackend/TargetInfo/CMakeLists.txt deleted file mode 100644 index edaf5d3cb188..000000000000 --- a/contrib/llvm/lib/Target/CppBackend/TargetInfo/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMCppBackendInfo - CppBackendTargetInfo.cpp - ) - diff --git a/contrib/llvm/lib/Target/CppBackend/TargetInfo/Makefile b/contrib/llvm/lib/Target/CppBackend/TargetInfo/Makefile deleted file mode 100644 index 6e682838daec..000000000000 --- a/contrib/llvm/lib/Target/CppBackend/TargetInfo/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Target/CppBackend/TargetInfo/Makefile -----------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../../.. -LIBRARYNAME = LLVMCppBackendInfo - -# Hack: we need to include 'main' target directory to grab private headers -CPPFLAGS = -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/MBlaze/AsmPrinter/CMakeLists.txt b/contrib/llvm/lib/Target/MBlaze/AsmPrinter/CMakeLists.txt deleted file mode 100644 index fac2c1959d7a..000000000000 --- a/contrib/llvm/lib/Target/MBlaze/AsmPrinter/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -include_directories( - ${CMAKE_CURRENT_BINARY_DIR}/.. - ${CMAKE_CURRENT_SOURCE_DIR}/.. - ) - -add_llvm_library(LLVMMBlazeAsmPrinter - MBlazeAsmPrinter.cpp - ) -add_dependencies(LLVMMBlazeAsmPrinter MBlazeCodeGenTable_gen) diff --git a/contrib/llvm/lib/Target/MBlaze/AsmPrinter/Makefile b/contrib/llvm/lib/Target/MBlaze/AsmPrinter/Makefile deleted file mode 100644 index c44651cc93bd..000000000000 --- a/contrib/llvm/lib/Target/MBlaze/AsmPrinter/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -##===- lib/Target/MBlaze/AsmPrinter/Makefile ---------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../../.. -LIBRARYNAME = LLVMMBlazeAsmPrinter - -# Hack: we need to include 'main' MBlaze target directory to grab -# private headers -CPP.Flags += -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/MBlaze/CMakeLists.txt b/contrib/llvm/lib/Target/MBlaze/CMakeLists.txt deleted file mode 100644 index 7f85bf82518d..000000000000 --- a/contrib/llvm/lib/Target/MBlaze/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -set(LLVM_TARGET_DEFINITIONS MBlaze.td) - -tablegen(MBlazeGenRegisterInfo.h.inc -gen-register-desc-header) -tablegen(MBlazeGenRegisterNames.inc -gen-register-enums) -tablegen(MBlazeGenRegisterInfo.inc -gen-register-desc) -tablegen(MBlazeGenInstrNames.inc -gen-instr-enums) -tablegen(MBlazeGenInstrInfo.inc -gen-instr-desc) -tablegen(MBlazeGenAsmWriter.inc -gen-asm-writer) -tablegen(MBlazeGenDAGISel.inc -gen-dag-isel) -tablegen(MBlazeGenCallingConv.inc -gen-callingconv) -tablegen(MBlazeGenSubtarget.inc -gen-subtarget) -tablegen(MBlazeGenIntrinsics.inc -gen-tgt-intrinsic) - -add_llvm_target(MBlazeCodeGen - MBlazeDelaySlotFiller.cpp - MBlazeInstrInfo.cpp - MBlazeISelDAGToDAG.cpp - MBlazeISelLowering.cpp - MBlazeMCAsmInfo.cpp - MBlazeRegisterInfo.cpp - MBlazeSubtarget.cpp - MBlazeTargetMachine.cpp - MBlazeTargetObjectFile.cpp - MBlazeIntrinsicInfo.cpp - MBlazeSelectionDAGInfo.cpp - ) - -target_link_libraries (LLVMMBlazeCodeGen LLVMSelectionDAG) diff --git a/contrib/llvm/lib/Target/MBlaze/Makefile b/contrib/llvm/lib/Target/MBlaze/Makefile deleted file mode 100644 index 19e508c532a6..000000000000 --- a/contrib/llvm/lib/Target/MBlaze/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -##===- lib/Target/MBlaze/Makefile --------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../.. -LIBRARYNAME = LLVMMBlazeCodeGen -TARGET = MBlaze - -# Make sure that tblgen is run, first thing. -BUILT_SOURCES = MBlazeGenRegisterInfo.h.inc MBlazeGenRegisterNames.inc \ - MBlazeGenRegisterInfo.inc MBlazeGenInstrNames.inc \ - MBlazeGenInstrInfo.inc MBlazeGenAsmWriter.inc \ - MBlazeGenDAGISel.inc MBlazeGenCallingConv.inc \ - MBlazeGenSubtarget.inc MBlazeGenIntrinsics.inc - -DIRS = AsmPrinter TargetInfo - -include $(LEVEL)/Makefile.common - diff --git a/contrib/llvm/lib/Target/MBlaze/TargetInfo/CMakeLists.txt b/contrib/llvm/lib/Target/MBlaze/TargetInfo/CMakeLists.txt deleted file mode 100644 index 5afb14d09a55..000000000000 --- a/contrib/llvm/lib/Target/MBlaze/TargetInfo/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMMBlazeInfo - MBlazeTargetInfo.cpp - ) - -add_dependencies(LLVMMBlazeInfo MBlazeCodeGenTable_gen) diff --git a/contrib/llvm/lib/Target/MBlaze/TargetInfo/Makefile b/contrib/llvm/lib/Target/MBlaze/TargetInfo/Makefile deleted file mode 100644 index fb7ea118a6b5..000000000000 --- a/contrib/llvm/lib/Target/MBlaze/TargetInfo/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Target/MBlaze/TargetInfo/Makefile ---------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../../.. -LIBRARYNAME = LLVMMBlazeInfo - -# Hack: we need to include 'main' target directory to grab private headers -CPPFLAGS = -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/MSP430/AsmPrinter/CMakeLists.txt b/contrib/llvm/lib/Target/MSP430/AsmPrinter/CMakeLists.txt deleted file mode 100644 index 4b1f4e6ff269..000000000000 --- a/contrib/llvm/lib/Target/MSP430/AsmPrinter/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMMSP430AsmPrinter - MSP430AsmPrinter.cpp - MSP430InstPrinter.cpp - MSP430MCInstLower.cpp - ) -add_dependencies(LLVMMSP430AsmPrinter MSP430CodeGenTable_gen) diff --git a/contrib/llvm/lib/Target/MSP430/AsmPrinter/Makefile b/contrib/llvm/lib/Target/MSP430/AsmPrinter/Makefile deleted file mode 100644 index a5293ab8a234..000000000000 --- a/contrib/llvm/lib/Target/MSP430/AsmPrinter/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Target/MSP430/AsmPrinter/Makefile ---------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../../.. -LIBRARYNAME = LLVMMSP430AsmPrinter - -# Hack: we need to include 'main' MSP430 target directory to grab private headers -CPP.Flags += -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/MSP430/CMakeLists.txt b/contrib/llvm/lib/Target/MSP430/CMakeLists.txt deleted file mode 100644 index a3f60d2a44f1..000000000000 --- a/contrib/llvm/lib/Target/MSP430/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -set(LLVM_TARGET_DEFINITIONS MSP430.td) - -tablegen(MSP430GenRegisterInfo.h.inc -gen-register-desc-header) -tablegen(MSP430GenRegisterNames.inc -gen-register-enums) -tablegen(MSP430GenRegisterInfo.inc -gen-register-desc) -tablegen(MSP430GenInstrNames.inc -gen-instr-enums) -tablegen(MSP430GenInstrInfo.inc -gen-instr-desc) -tablegen(MSP430GenAsmWriter.inc -gen-asm-writer) -tablegen(MSP430GenDAGISel.inc -gen-dag-isel) -tablegen(MSP430GenCallingConv.inc -gen-callingconv) -tablegen(MSP430GenSubtarget.inc -gen-subtarget) - -add_llvm_target(MSP430CodeGen - MSP430BranchSelector.cpp - MSP430ISelDAGToDAG.cpp - MSP430ISelLowering.cpp - MSP430InstrInfo.cpp - MSP430MCAsmInfo.cpp - MSP430RegisterInfo.cpp - MSP430Subtarget.cpp - MSP430TargetMachine.cpp - MSP430SelectionDAGInfo.cpp - ) - -target_link_libraries (LLVMMSP430CodeGen LLVMSelectionDAG) diff --git a/contrib/llvm/lib/Target/MSP430/Makefile b/contrib/llvm/lib/Target/MSP430/Makefile deleted file mode 100644 index b1f33d6d0c11..000000000000 --- a/contrib/llvm/lib/Target/MSP430/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -##===- lib/Target/MSP430/Makefile --------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMMSP430CodeGen -TARGET = MSP430 - -# Make sure that tblgen is run, first thing. -BUILT_SOURCES = MSP430GenRegisterInfo.h.inc MSP430GenRegisterNames.inc \ - MSP430GenRegisterInfo.inc MSP430GenInstrNames.inc \ - MSP430GenInstrInfo.inc MSP430GenAsmWriter.inc \ - MSP430GenDAGISel.inc MSP430GenCallingConv.inc \ - MSP430GenSubtarget.inc - -DIRS = AsmPrinter TargetInfo - -include $(LEVEL)/Makefile.common - diff --git a/contrib/llvm/lib/Target/MSP430/README.txt b/contrib/llvm/lib/Target/MSP430/README.txt deleted file mode 100644 index 5b9634bcfe73..000000000000 --- a/contrib/llvm/lib/Target/MSP430/README.txt +++ /dev/null @@ -1,40 +0,0 @@ -//===---------------------------------------------------------------------===// -// MSP430 backend. -//===---------------------------------------------------------------------===// - -DISCLAIMER: Thid backend should be considered as highly experimental. I never -seen nor worked with this MCU, all information was gathered from datasheet -only. The original intention of making this backend was to write documentation -of form "How to write backend for dummies" :) Thes notes hopefully will be -available pretty soon. - -Some things are incomplete / not implemented yet (this list surely is not -complete as well): - -1. Verify, how stuff is handling implicit zext with 8 bit operands (this might -be modelled currently in improper way - should we need to mark the superreg as -def for every 8 bit instruction?). - -2. Libcalls: multiplication, division, remainder. Note, that calling convention -for libcalls is incomptible with calling convention of libcalls of msp430-gcc -(these cannot be used though due to license restriction). - -3. Implement multiplication / division by constant (dag combiner hook?). - -4. Implement non-constant shifts. - -5. Implement varargs stuff. - -6. Verify and fix (if needed) how's stuff playing with i32 / i64. - -7. Implement floating point stuff (softfp?) - -8. Implement instruction encoding for (possible) direct code emission in the -future. - -9. Since almost all instructions set flags - implement brcond / select in better -way (currently they emit explicit comparison). - -10. Handle imm in comparisons in better way (see comment in MSP430InstrInfo.td) - -11. Implement hooks for better memory op folding, etc. diff --git a/contrib/llvm/lib/Target/MSP430/TargetInfo/CMakeLists.txt b/contrib/llvm/lib/Target/MSP430/TargetInfo/CMakeLists.txt deleted file mode 100644 index 1d408d0cb5be..000000000000 --- a/contrib/llvm/lib/Target/MSP430/TargetInfo/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMMSP430Info - MSP430TargetInfo.cpp - ) - -add_dependencies(LLVMMSP430Info MSP430Table_gen) diff --git a/contrib/llvm/lib/Target/MSP430/TargetInfo/Makefile b/contrib/llvm/lib/Target/MSP430/TargetInfo/Makefile deleted file mode 100644 index abb08f2548ee..000000000000 --- a/contrib/llvm/lib/Target/MSP430/TargetInfo/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Target/MSP430/TargetInfo/Makefile ---------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../../.. -LIBRARYNAME = LLVMMSP430Info - -# Hack: we need to include 'main' target directory to grab private headers -CPPFLAGS = -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/Makefile b/contrib/llvm/lib/Target/Makefile deleted file mode 100644 index 50a360f1f868..000000000000 --- a/contrib/llvm/lib/Target/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -#===- lib/Target/Makefile ----------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../.. -LIBRARYNAME = LLVMTarget -BUILD_ARCHIVE = 1 - -# We include this early so we can access the value of TARGETS_TO_BUILD as the -# value for PARALLEL_DIRS which must be set before Makefile.rules is included -include $(LEVEL)/Makefile.config - -PARALLEL_DIRS := $(TARGETS_TO_BUILD) - -include $(LLVM_SRC_ROOT)/Makefile.rules diff --git a/contrib/llvm/lib/Target/Mips/AsmPrinter/CMakeLists.txt b/contrib/llvm/lib/Target/Mips/AsmPrinter/CMakeLists.txt deleted file mode 100644 index d3099d2a4e3e..000000000000 --- a/contrib/llvm/lib/Target/Mips/AsmPrinter/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -include_directories( - ${CMAKE_CURRENT_BINARY_DIR}/.. - ${CMAKE_CURRENT_SOURCE_DIR}/.. - ) - -add_llvm_library(LLVMMipsAsmPrinter - MipsAsmPrinter.cpp - ) -add_dependencies(LLVMMipsAsmPrinter MipsCodeGenTable_gen) diff --git a/contrib/llvm/lib/Target/Mips/AsmPrinter/Makefile b/contrib/llvm/lib/Target/Mips/AsmPrinter/Makefile deleted file mode 100644 index b1efe9b94479..000000000000 --- a/contrib/llvm/lib/Target/Mips/AsmPrinter/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -##===- lib/Target/Mips/AsmPrinter/Makefile -----------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../../.. -LIBRARYNAME = LLVMMipsAsmPrinter - -# Hack: we need to include 'main' Mips target directory to grab -# private headers -CPP.Flags += -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/Mips/CMakeLists.txt b/contrib/llvm/lib/Target/Mips/CMakeLists.txt deleted file mode 100644 index a77802aec52a..000000000000 --- a/contrib/llvm/lib/Target/Mips/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -set(LLVM_TARGET_DEFINITIONS Mips.td) - -tablegen(MipsGenRegisterInfo.h.inc -gen-register-desc-header) -tablegen(MipsGenRegisterNames.inc -gen-register-enums) -tablegen(MipsGenRegisterInfo.inc -gen-register-desc) -tablegen(MipsGenInstrNames.inc -gen-instr-enums) -tablegen(MipsGenInstrInfo.inc -gen-instr-desc) -tablegen(MipsGenAsmWriter.inc -gen-asm-writer) -tablegen(MipsGenDAGISel.inc -gen-dag-isel) -tablegen(MipsGenCallingConv.inc -gen-callingconv) -tablegen(MipsGenSubtarget.inc -gen-subtarget) - -add_llvm_target(MipsCodeGen - MipsDelaySlotFiller.cpp - MipsInstrInfo.cpp - MipsISelDAGToDAG.cpp - MipsISelLowering.cpp - MipsMCAsmInfo.cpp - MipsRegisterInfo.cpp - MipsSubtarget.cpp - MipsTargetMachine.cpp - MipsTargetObjectFile.cpp - MipsSelectionDAGInfo.cpp - ) - -target_link_libraries (LLVMMipsCodeGen LLVMSelectionDAG) diff --git a/contrib/llvm/lib/Target/Mips/Makefile b/contrib/llvm/lib/Target/Mips/Makefile deleted file mode 100644 index 2ed8d77b85b2..000000000000 --- a/contrib/llvm/lib/Target/Mips/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -##===- lib/Target/Mips/Makefile ----------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMMipsCodeGen -TARGET = Mips - -# Make sure that tblgen is run, first thing. -BUILT_SOURCES = MipsGenRegisterInfo.h.inc MipsGenRegisterNames.inc \ - MipsGenRegisterInfo.inc MipsGenInstrNames.inc \ - MipsGenInstrInfo.inc MipsGenAsmWriter.inc \ - MipsGenDAGISel.inc MipsGenCallingConv.inc \ - MipsGenSubtarget.inc - -DIRS = AsmPrinter TargetInfo - -include $(LEVEL)/Makefile.common - diff --git a/contrib/llvm/lib/Target/Mips/TargetInfo/CMakeLists.txt b/contrib/llvm/lib/Target/Mips/TargetInfo/CMakeLists.txt deleted file mode 100644 index 6e5d56ba4ae7..000000000000 --- a/contrib/llvm/lib/Target/Mips/TargetInfo/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMMipsInfo - MipsTargetInfo.cpp - ) - -add_dependencies(LLVMMipsInfo MipsCodeGenTable_gen) diff --git a/contrib/llvm/lib/Target/Mips/TargetInfo/Makefile b/contrib/llvm/lib/Target/Mips/TargetInfo/Makefile deleted file mode 100644 index 32f4e1695b1d..000000000000 --- a/contrib/llvm/lib/Target/Mips/TargetInfo/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Target/Mips/TargetInfo/Makefile -----------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../../.. -LIBRARYNAME = LLVMMipsInfo - -# Hack: we need to include 'main' target directory to grab private headers -CPPFLAGS = -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/PIC16/AsmPrinter/CMakeLists.txt b/contrib/llvm/lib/Target/PIC16/AsmPrinter/CMakeLists.txt deleted file mode 100644 index d36bb8eb4a5f..000000000000 --- a/contrib/llvm/lib/Target/PIC16/AsmPrinter/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -include_directories( - ${CMAKE_CURRENT_BINARY_DIR}/.. - ${CMAKE_CURRENT_SOURCE_DIR}/.. - ) - -add_llvm_library(LLVMPIC16AsmPrinter - PIC16AsmPrinter.cpp - ) -add_dependencies(LLVMPIC16AsmPrinter PIC16CodeGenTable_gen) diff --git a/contrib/llvm/lib/Target/PIC16/AsmPrinter/Makefile b/contrib/llvm/lib/Target/PIC16/AsmPrinter/Makefile deleted file mode 100644 index e3c0684ebcf8..000000000000 --- a/contrib/llvm/lib/Target/PIC16/AsmPrinter/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Target/PIC16/AsmPrinter/Makefile ----------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../../.. -LIBRARYNAME = LLVMPIC16AsmPrinter - -# Hack: we need to include 'main' pic16 target directory to grab private headers -CPP.Flags += -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/PIC16/CMakeLists.txt b/contrib/llvm/lib/Target/PIC16/CMakeLists.txt deleted file mode 100644 index 2b6cb9e4e461..000000000000 --- a/contrib/llvm/lib/Target/PIC16/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -set(LLVM_TARGET_DEFINITIONS PIC16.td) - -tablegen(PIC16GenRegisterInfo.h.inc -gen-register-desc-header) -tablegen(PIC16GenRegisterNames.inc -gen-register-enums) -tablegen(PIC16GenRegisterInfo.inc -gen-register-desc) -tablegen(PIC16GenInstrNames.inc -gen-instr-enums) -tablegen(PIC16GenInstrInfo.inc -gen-instr-desc) -tablegen(PIC16GenAsmWriter.inc -gen-asm-writer) -tablegen(PIC16GenDAGISel.inc -gen-dag-isel) -tablegen(PIC16GenCallingConv.inc -gen-callingconv) -tablegen(PIC16GenSubtarget.inc -gen-subtarget) - -add_llvm_target(PIC16CodeGen - PIC16DebugInfo.cpp - PIC16InstrInfo.cpp - PIC16ISelDAGToDAG.cpp - PIC16ISelLowering.cpp - PIC16MemSelOpt.cpp - PIC16MCAsmInfo.cpp - PIC16RegisterInfo.cpp - PIC16Section.cpp - PIC16Subtarget.cpp - PIC16TargetMachine.cpp - PIC16TargetObjectFile.cpp - PIC16SelectionDAGInfo.cpp - ) diff --git a/contrib/llvm/lib/Target/PIC16/Makefile b/contrib/llvm/lib/Target/PIC16/Makefile deleted file mode 100644 index 9e784d1d7262..000000000000 --- a/contrib/llvm/lib/Target/PIC16/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -##===- lib/Target/PIC16/Makefile ---------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMPIC16CodeGen -TARGET = PIC16 - -# Make sure that tblgen is run, first thing. -BUILT_SOURCES = PIC16GenRegisterInfo.h.inc PIC16GenRegisterNames.inc \ - PIC16GenRegisterInfo.inc PIC16GenInstrNames.inc \ - PIC16GenInstrInfo.inc PIC16GenAsmWriter.inc \ - PIC16GenDAGISel.inc PIC16GenCallingConv.inc \ - PIC16GenSubtarget.inc - -DIRS = AsmPrinter TargetInfo PIC16Passes - -include $(LEVEL)/Makefile.common - diff --git a/contrib/llvm/lib/Target/PIC16/PIC16Passes/Makefile b/contrib/llvm/lib/Target/PIC16/PIC16Passes/Makefile deleted file mode 100644 index 9684b8d2cae4..000000000000 --- a/contrib/llvm/lib/Target/PIC16/PIC16Passes/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Target/PIC16/PIC16Passes/Makefile -----------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../../.. -TARGET = PIC16 -LIBRARYNAME = LLVMpic16passes -BUILD_ARCHIVE = 1 - -include $(LEVEL)/Makefile.common - diff --git a/contrib/llvm/lib/Target/PIC16/TargetInfo/CMakeLists.txt b/contrib/llvm/lib/Target/PIC16/TargetInfo/CMakeLists.txt deleted file mode 100644 index bfc6ff4e8e2e..000000000000 --- a/contrib/llvm/lib/Target/PIC16/TargetInfo/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMPIC16Info - PIC16TargetInfo.cpp - ) - -add_dependencies(LLVMPIC16Info PIC16Table_gen) diff --git a/contrib/llvm/lib/Target/PIC16/TargetInfo/Makefile b/contrib/llvm/lib/Target/PIC16/TargetInfo/Makefile deleted file mode 100644 index 76609f66d652..000000000000 --- a/contrib/llvm/lib/Target/PIC16/TargetInfo/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Target/PIC16/TargetInfo/Makefile ----------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../../.. -LIBRARYNAME = LLVMPIC16Info - -# Hack: we need to include 'main' target directory to grab private headers -CPPFLAGS = -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/PowerPC/AsmPrinter/CMakeLists.txt b/contrib/llvm/lib/Target/PowerPC/AsmPrinter/CMakeLists.txt deleted file mode 100644 index 42cd4862a98f..000000000000 --- a/contrib/llvm/lib/Target/PowerPC/AsmPrinter/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMPowerPCAsmPrinter - PPCAsmPrinter.cpp - ) -add_dependencies(LLVMPowerPCAsmPrinter PowerPCCodeGenTable_gen) diff --git a/contrib/llvm/lib/Target/PowerPC/AsmPrinter/Makefile b/contrib/llvm/lib/Target/PowerPC/AsmPrinter/Makefile deleted file mode 100644 index bd5dce12dc43..000000000000 --- a/contrib/llvm/lib/Target/PowerPC/AsmPrinter/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Target/PowerPC/AsmPrinter/Makefile --------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../../.. -LIBRARYNAME = LLVMPowerPCAsmPrinter - -# Hack: we need to include 'main' PowerPC target directory to grab private headers -CPP.Flags += -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/PowerPC/CMakeLists.txt b/contrib/llvm/lib/Target/PowerPC/CMakeLists.txt deleted file mode 100644 index 7ffc5eb5f311..000000000000 --- a/contrib/llvm/lib/Target/PowerPC/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -set(LLVM_TARGET_DEFINITIONS PPC.td) - -tablegen(PPCGenInstrNames.inc -gen-instr-enums) -tablegen(PPCGenRegisterNames.inc -gen-register-enums) -tablegen(PPCGenAsmWriter.inc -gen-asm-writer) -tablegen(PPCGenCodeEmitter.inc -gen-emitter) -tablegen(PPCGenRegisterInfo.h.inc -gen-register-desc-header) -tablegen(PPCGenRegisterInfo.inc -gen-register-desc) -tablegen(PPCGenInstrInfo.inc -gen-instr-desc) -tablegen(PPCGenDAGISel.inc -gen-dag-isel) -tablegen(PPCGenCallingConv.inc -gen-callingconv) -tablegen(PPCGenSubtarget.inc -gen-subtarget) - -add_llvm_target(PowerPCCodeGen - PPCBranchSelector.cpp - PPCCodeEmitter.cpp - PPCHazardRecognizers.cpp - PPCInstrInfo.cpp - PPCISelDAGToDAG.cpp - PPCISelLowering.cpp - PPCJITInfo.cpp - PPCMCAsmInfo.cpp - PPCPredicates.cpp - PPCRegisterInfo.cpp - PPCSubtarget.cpp - PPCTargetMachine.cpp - PPCSelectionDAGInfo.cpp - ) - -target_link_libraries (LLVMPowerPCCodeGen LLVMSelectionDAG) diff --git a/contrib/llvm/lib/Target/PowerPC/Makefile b/contrib/llvm/lib/Target/PowerPC/Makefile deleted file mode 100644 index 1265f1d36910..000000000000 --- a/contrib/llvm/lib/Target/PowerPC/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -##===- lib/Target/PowerPC/Makefile -------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMPowerPCCodeGen -TARGET = PPC - -# Make sure that tblgen is run, first thing. -BUILT_SOURCES = PPCGenInstrNames.inc PPCGenRegisterNames.inc \ - PPCGenAsmWriter.inc PPCGenCodeEmitter.inc \ - PPCGenRegisterInfo.h.inc PPCGenRegisterInfo.inc \ - PPCGenInstrInfo.inc PPCGenDAGISel.inc \ - PPCGenSubtarget.inc PPCGenCallingConv.inc - -DIRS = AsmPrinter TargetInfo - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/PowerPC/README.txt b/contrib/llvm/lib/Target/PowerPC/README.txt deleted file mode 100644 index 3465779e344b..000000000000 --- a/contrib/llvm/lib/Target/PowerPC/README.txt +++ /dev/null @@ -1,914 +0,0 @@ -//===- README.txt - Notes for improving PowerPC-specific code gen ---------===// - -TODO: -* gpr0 allocation -* implement do-loop -> bdnz transform -* lmw/stmw pass a la arm load store optimizer for prolog/epilog - -===-------------------------------------------------------------------------=== - -On PPC64, this: - -long f2 (long x) { return 0xfffffff000000000UL; } -long f3 (long x) { return 0x1ffffffffUL; } - -could compile into: - -_f2: - li r3,-1 - rldicr r3,r3,0,27 - blr -_f3: - li r3,-1 - rldicl r3,r3,0,31 - blr - -we produce: - -_f2: - lis r2, 4095 - ori r2, r2, 65535 - sldi r3, r2, 36 - blr -_f3: - li r2, 1 - sldi r2, r2, 32 - oris r2, r2, 65535 - ori r3, r2, 65535 - blr - - -===-------------------------------------------------------------------------=== - -Support 'update' load/store instructions. These are cracked on the G5, but are -still a codesize win. - -With preinc enabled, this: - -long *%test4(long *%X, long *%dest) { - %Y = getelementptr long* %X, int 4 - %A = load long* %Y - store long %A, long* %dest - ret long* %Y -} - -compiles to: - -_test4: - mr r2, r3 - lwzu r5, 32(r2) - lwz r3, 36(r3) - stw r5, 0(r4) - stw r3, 4(r4) - mr r3, r2 - blr - -with -sched=list-burr, I get: - -_test4: - lwz r2, 36(r3) - lwzu r5, 32(r3) - stw r2, 4(r4) - stw r5, 0(r4) - blr - -===-------------------------------------------------------------------------=== - -We compile the hottest inner loop of viterbi to: - - li r6, 0 - b LBB1_84 ;bb432.i -LBB1_83: ;bb420.i - lbzx r8, r5, r7 - addi r6, r7, 1 - stbx r8, r4, r7 -LBB1_84: ;bb432.i - mr r7, r6 - cmplwi cr0, r7, 143 - bne cr0, LBB1_83 ;bb420.i - -The CBE manages to produce: - - li r0, 143 - mtctr r0 -loop: - lbzx r2, r2, r11 - stbx r0, r2, r9 - addi r2, r2, 1 - bdz later - b loop - -This could be much better (bdnz instead of bdz) but it still beats us. If we -produced this with bdnz, the loop would be a single dispatch group. - -===-------------------------------------------------------------------------=== - -Compile: - -void foo(int *P) { - if (P) *P = 0; -} - -into: - -_foo: - cmpwi cr0,r3,0 - beqlr cr0 - li r0,0 - stw r0,0(r3) - blr - -This is effectively a simple form of predication. - -===-------------------------------------------------------------------------=== - -Lump the constant pool for each function into ONE pic object, and reference -pieces of it as offsets from the start. For functions like this (contrived -to have lots of constants obviously): - -double X(double Y) { return (Y*1.23 + 4.512)*2.34 + 14.38; } - -We generate: - -_X: - lis r2, ha16(.CPI_X_0) - lfd f0, lo16(.CPI_X_0)(r2) - lis r2, ha16(.CPI_X_1) - lfd f2, lo16(.CPI_X_1)(r2) - fmadd f0, f1, f0, f2 - lis r2, ha16(.CPI_X_2) - lfd f1, lo16(.CPI_X_2)(r2) - lis r2, ha16(.CPI_X_3) - lfd f2, lo16(.CPI_X_3)(r2) - fmadd f1, f0, f1, f2 - blr - -It would be better to materialize .CPI_X into a register, then use immediates -off of the register to avoid the lis's. This is even more important in PIC -mode. - -Note that this (and the static variable version) is discussed here for GCC: -http://gcc.gnu.org/ml/gcc-patches/2006-02/msg00133.html - -Here's another example (the sgn function): -double testf(double a) { - return a == 0.0 ? 0.0 : (a > 0.0 ? 1.0 : -1.0); -} - -it produces a BB like this: -LBB1_1: ; cond_true - lis r2, ha16(LCPI1_0) - lfs f0, lo16(LCPI1_0)(r2) - lis r2, ha16(LCPI1_1) - lis r3, ha16(LCPI1_2) - lfs f2, lo16(LCPI1_2)(r3) - lfs f3, lo16(LCPI1_1)(r2) - fsub f0, f0, f1 - fsel f1, f0, f2, f3 - blr - -===-------------------------------------------------------------------------=== - -PIC Code Gen IPO optimization: - -Squish small scalar globals together into a single global struct, allowing the -address of the struct to be CSE'd, avoiding PIC accesses (also reduces the size -of the GOT on targets with one). - -Note that this is discussed here for GCC: -http://gcc.gnu.org/ml/gcc-patches/2006-02/msg00133.html - -===-------------------------------------------------------------------------=== - -Implement Newton-Rhapson method for improving estimate instructions to the -correct accuracy, and implementing divide as multiply by reciprocal when it has -more than one use. Itanium would want this too. - -===-------------------------------------------------------------------------=== - -Compile offsets from allocas: - -int *%test() { - %X = alloca { int, int } - %Y = getelementptr {int,int}* %X, int 0, uint 1 - ret int* %Y -} - -into a single add, not two: - -_test: - addi r2, r1, -8 - addi r3, r2, 4 - blr - ---> important for C++. - -===-------------------------------------------------------------------------=== - -No loads or stores of the constants should be needed: - -struct foo { double X, Y; }; -void xxx(struct foo F); -void bar() { struct foo R = { 1.0, 2.0 }; xxx(R); } - -===-------------------------------------------------------------------------=== - -Darwin Stub removal: - -We still generate calls to foo$stub, and stubs, on Darwin. This is not -necessary when building with the Leopard (10.5) or later linker, as stubs are -generated by ld when necessary. Parameterizing this based on the deployment -target (-mmacosx-version-min) is probably enough. x86-32 does this right, see -its logic. - -===-------------------------------------------------------------------------=== - -Darwin Stub LICM optimization: - -Loops like this: - - for (...) bar(); - -Have to go through an indirect stub if bar is external or linkonce. It would -be better to compile it as: - - fp = &bar; - for (...) fp(); - -which only computes the address of bar once (instead of each time through the -stub). This is Darwin specific and would have to be done in the code generator. -Probably not a win on x86. - -===-------------------------------------------------------------------------=== - -Simple IPO for argument passing, change: - void foo(int X, double Y, int Z) -> void foo(int X, int Z, double Y) - -the Darwin ABI specifies that any integer arguments in the first 32 bytes worth -of arguments get assigned to r3 through r10. That is, if you have a function -foo(int, double, int) you get r3, f1, r6, since the 64 bit double ate up the -argument bytes for r4 and r5. The trick then would be to shuffle the argument -order for functions we can internalize so that the maximum number of -integers/pointers get passed in regs before you see any of the fp arguments. - -Instead of implementing this, it would actually probably be easier to just -implement a PPC fastcc, where we could do whatever we wanted to the CC, -including having this work sanely. - -===-------------------------------------------------------------------------=== - -Fix Darwin FP-In-Integer Registers ABI - -Darwin passes doubles in structures in integer registers, which is very very -bad. Add something like a BIT_CONVERT to LLVM, then do an i-p transformation -that percolates these things out of functions. - -Check out how horrible this is: -http://gcc.gnu.org/ml/gcc/2005-10/msg01036.html - -This is an extension of "interprocedural CC unmunging" that can't be done with -just fastcc. - -===-------------------------------------------------------------------------=== - -Compile this: - -int foo(int a) { - int b = (a < 8); - if (b) { - return b * 3; // ignore the fact that this is always 3. - } else { - return 2; - } -} - -into something not this: - -_foo: -1) cmpwi cr7, r3, 8 - mfcr r2, 1 - rlwinm r2, r2, 29, 31, 31 -1) cmpwi cr0, r3, 7 - bgt cr0, LBB1_2 ; UnifiedReturnBlock -LBB1_1: ; then - rlwinm r2, r2, 0, 31, 31 - mulli r3, r2, 3 - blr -LBB1_2: ; UnifiedReturnBlock - li r3, 2 - blr - -In particular, the two compares (marked 1) could be shared by reversing one. -This could be done in the dag combiner, by swapping a BR_CC when a SETCC of the -same operands (but backwards) exists. In this case, this wouldn't save us -anything though, because the compares still wouldn't be shared. - -===-------------------------------------------------------------------------=== - -We should custom expand setcc instead of pretending that we have it. That -would allow us to expose the access of the crbit after the mfcr, allowing -that access to be trivially folded into other ops. A simple example: - -int foo(int a, int b) { return (a < b) << 4; } - -compiles into: - -_foo: - cmpw cr7, r3, r4 - mfcr r2, 1 - rlwinm r2, r2, 29, 31, 31 - slwi r3, r2, 4 - blr - -===-------------------------------------------------------------------------=== - -Fold add and sub with constant into non-extern, non-weak addresses so this: - -static int a; -void bar(int b) { a = b; } -void foo(unsigned char *c) { - *c = a; -} - -So that - -_foo: - lis r2, ha16(_a) - la r2, lo16(_a)(r2) - lbz r2, 3(r2) - stb r2, 0(r3) - blr - -Becomes - -_foo: - lis r2, ha16(_a+3) - lbz r2, lo16(_a+3)(r2) - stb r2, 0(r3) - blr - -===-------------------------------------------------------------------------=== - -We generate really bad code for this: - -int f(signed char *a, _Bool b, _Bool c) { - signed char t = 0; - if (b) t = *a; - if (c) *a = t; -} - -===-------------------------------------------------------------------------=== - -This: -int test(unsigned *P) { return *P >> 24; } - -Should compile to: - -_test: - lbz r3,0(r3) - blr - -not: - -_test: - lwz r2, 0(r3) - srwi r3, r2, 24 - blr - -===-------------------------------------------------------------------------=== - -On the G5, logical CR operations are more expensive in their three -address form: ops that read/write the same register are half as expensive as -those that read from two registers that are different from their destination. - -We should model this with two separate instructions. The isel should generate -the "two address" form of the instructions. When the register allocator -detects that it needs to insert a copy due to the two-addresness of the CR -logical op, it will invoke PPCInstrInfo::convertToThreeAddress. At this point -we can convert to the "three address" instruction, to save code space. - -This only matters when we start generating cr logical ops. - -===-------------------------------------------------------------------------=== - -We should compile these two functions to the same thing: - -#include -void f(int a, int b, int *P) { - *P = (a-b)>=0?(a-b):(b-a); -} -void g(int a, int b, int *P) { - *P = abs(a-b); -} - -Further, they should compile to something better than: - -_g: - subf r2, r4, r3 - subfic r3, r2, 0 - cmpwi cr0, r2, -1 - bgt cr0, LBB2_2 ; entry -LBB2_1: ; entry - mr r2, r3 -LBB2_2: ; entry - stw r2, 0(r5) - blr - -GCC produces: - -_g: - subf r4,r4,r3 - srawi r2,r4,31 - xor r0,r2,r4 - subf r0,r2,r0 - stw r0,0(r5) - blr - -... which is much nicer. - -This theoretically may help improve twolf slightly (used in dimbox.c:142?). - -===-------------------------------------------------------------------------=== - -PR5945: This: -define i32 @clamp0g(i32 %a) { -entry: - %cmp = icmp slt i32 %a, 0 - %sel = select i1 %cmp, i32 0, i32 %a - ret i32 %sel -} - -Is compile to this with the PowerPC (32-bit) backend: - -_clamp0g: - cmpwi cr0, r3, 0 - li r2, 0 - blt cr0, LBB1_2 -; BB#1: ; %entry - mr r2, r3 -LBB1_2: ; %entry - mr r3, r2 - blr - -This could be reduced to the much simpler: - -_clamp0g: - srawi r2, r3, 31 - andc r3, r3, r2 - blr - -===-------------------------------------------------------------------------=== - -int foo(int N, int ***W, int **TK, int X) { - int t, i; - - for (t = 0; t < N; ++t) - for (i = 0; i < 4; ++i) - W[t / X][i][t % X] = TK[i][t]; - - return 5; -} - -We generate relatively atrocious code for this loop compared to gcc. - -We could also strength reduce the rem and the div: -http://www.lcs.mit.edu/pubs/pdf/MIT-LCS-TM-600.pdf - -===-------------------------------------------------------------------------=== - -float foo(float X) { return (int)(X); } - -Currently produces: - -_foo: - fctiwz f0, f1 - stfd f0, -8(r1) - lwz r2, -4(r1) - extsw r2, r2 - std r2, -16(r1) - lfd f0, -16(r1) - fcfid f0, f0 - frsp f1, f0 - blr - -We could use a target dag combine to turn the lwz/extsw into an lwa when the -lwz has a single use. Since LWA is cracked anyway, this would be a codesize -win only. - -===-------------------------------------------------------------------------=== - -We generate ugly code for this: - -void func(unsigned int *ret, float dx, float dy, float dz, float dw) { - unsigned code = 0; - if(dx < -dw) code |= 1; - if(dx > dw) code |= 2; - if(dy < -dw) code |= 4; - if(dy > dw) code |= 8; - if(dz < -dw) code |= 16; - if(dz > dw) code |= 32; - *ret = code; -} - -===-------------------------------------------------------------------------=== - -Complete the signed i32 to FP conversion code using 64-bit registers -transformation, good for PI. See PPCISelLowering.cpp, this comment: - - // FIXME: disable this lowered code. This generates 64-bit register values, - // and we don't model the fact that the top part is clobbered by calls. We - // need to flag these together so that the value isn't live across a call. - //setOperationAction(ISD::SINT_TO_FP, MVT::i32, Custom); - -Also, if the registers are spilled to the stack, we have to ensure that all -64-bits of them are save/restored, otherwise we will miscompile the code. It -sounds like we need to get the 64-bit register classes going. - -===-------------------------------------------------------------------------=== - -%struct.B = type { i8, [3 x i8] } - -define void @bar(%struct.B* %b) { -entry: - %tmp = bitcast %struct.B* %b to i32* ; [#uses=1] - %tmp = load i32* %tmp ; [#uses=1] - %tmp3 = bitcast %struct.B* %b to i32* ; [#uses=1] - %tmp4 = load i32* %tmp3 ; [#uses=1] - %tmp8 = bitcast %struct.B* %b to i32* ; [#uses=2] - %tmp9 = load i32* %tmp8 ; [#uses=1] - %tmp4.mask17 = shl i32 %tmp4, i8 1 ; [#uses=1] - %tmp1415 = and i32 %tmp4.mask17, 2147483648 ; [#uses=1] - %tmp.masked = and i32 %tmp, 2147483648 ; [#uses=1] - %tmp11 = or i32 %tmp1415, %tmp.masked ; [#uses=1] - %tmp12 = and i32 %tmp9, 2147483647 ; [#uses=1] - %tmp13 = or i32 %tmp12, %tmp11 ; [#uses=1] - store i32 %tmp13, i32* %tmp8 - ret void -} - -We emit: - -_foo: - lwz r2, 0(r3) - slwi r4, r2, 1 - or r4, r4, r2 - rlwimi r2, r4, 0, 0, 0 - stw r2, 0(r3) - blr - -We could collapse a bunch of those ORs and ANDs and generate the following -equivalent code: - -_foo: - lwz r2, 0(r3) - rlwinm r4, r2, 1, 0, 0 - or r2, r2, r4 - stw r2, 0(r3) - blr - -===-------------------------------------------------------------------------=== - -We compile: - -unsigned test6(unsigned x) { - return ((x & 0x00FF0000) >> 16) | ((x & 0x000000FF) << 16); -} - -into: - -_test6: - lis r2, 255 - rlwinm r3, r3, 16, 0, 31 - ori r2, r2, 255 - and r3, r3, r2 - blr - -GCC gets it down to: - -_test6: - rlwinm r0,r3,16,8,15 - rlwinm r3,r3,16,24,31 - or r3,r3,r0 - blr - - -===-------------------------------------------------------------------------=== - -Consider a function like this: - -float foo(float X) { return X + 1234.4123f; } - -The FP constant ends up in the constant pool, so we need to get the LR register. - This ends up producing code like this: - -_foo: -.LBB_foo_0: ; entry - mflr r11 -*** stw r11, 8(r1) - bl "L00000$pb" -"L00000$pb": - mflr r2 - addis r2, r2, ha16(.CPI_foo_0-"L00000$pb") - lfs f0, lo16(.CPI_foo_0-"L00000$pb")(r2) - fadds f1, f1, f0 -*** lwz r11, 8(r1) - mtlr r11 - blr - -This is functional, but there is no reason to spill the LR register all the way -to the stack (the two marked instrs): spilling it to a GPR is quite enough. - -Implementing this will require some codegen improvements. Nate writes: - -"So basically what we need to support the "no stack frame save and restore" is a -generalization of the LR optimization to "callee-save regs". - -Currently, we have LR marked as a callee-save reg. The register allocator sees -that it's callee save, and spills it directly to the stack. - -Ideally, something like this would happen: - -LR would be in a separate register class from the GPRs. The class of LR would be -marked "unspillable". When the register allocator came across an unspillable -reg, it would ask "what is the best class to copy this into that I *can* spill" -If it gets a class back, which it will in this case (the gprs), it grabs a free -register of that class. If it is then later necessary to spill that reg, so be -it. - -===-------------------------------------------------------------------------=== - -We compile this: -int test(_Bool X) { - return X ? 524288 : 0; -} - -to: -_test: - cmplwi cr0, r3, 0 - lis r2, 8 - li r3, 0 - beq cr0, LBB1_2 ;entry -LBB1_1: ;entry - mr r3, r2 -LBB1_2: ;entry - blr - -instead of: -_test: - addic r2,r3,-1 - subfe r0,r2,r3 - slwi r3,r0,19 - blr - -This sort of thing occurs a lot due to globalopt. - -===-------------------------------------------------------------------------=== - -We compile: - -define i32 @bar(i32 %x) nounwind readnone ssp { -entry: - %0 = icmp eq i32 %x, 0 ; [#uses=1] - %neg = sext i1 %0 to i32 ; [#uses=1] - ret i32 %neg -} - -to: - -_bar: - cntlzw r2, r3 - slwi r2, r2, 26 - srawi r3, r2, 31 - blr - -it would be better to produce: - -_bar: - addic r3,r3,-1 - subfe r3,r3,r3 - blr - -===-------------------------------------------------------------------------=== - -We currently compile 32-bit bswap: - -declare i32 @llvm.bswap.i32(i32 %A) -define i32 @test(i32 %A) { - %B = call i32 @llvm.bswap.i32(i32 %A) - ret i32 %B -} - -to: - -_test: - rlwinm r2, r3, 24, 16, 23 - slwi r4, r3, 24 - rlwimi r2, r3, 8, 24, 31 - rlwimi r4, r3, 8, 8, 15 - rlwimi r4, r2, 0, 16, 31 - mr r3, r4 - blr - -it would be more efficient to produce: - -_foo: mr r0,r3 - rlwinm r3,r3,8,0xffffffff - rlwimi r3,r0,24,0,7 - rlwimi r3,r0,24,16,23 - blr - -===-------------------------------------------------------------------------=== - -test/CodeGen/PowerPC/2007-03-24-cntlzd.ll compiles to: - -__ZNK4llvm5APInt17countLeadingZerosEv: - ld r2, 0(r3) - cntlzd r2, r2 - or r2, r2, r2 <<-- silly. - addi r3, r2, -64 - blr - -The dead or is a 'truncate' from 64- to 32-bits. - -===-------------------------------------------------------------------------=== - -We generate horrible ppc code for this: - -#define N 2000000 -double a[N],c[N]; -void simpleloop() { - int j; - for (j=0; j - inline std::pair full_add(unsigned a, unsigned b) - { return std::make_pair(a + b, a + b < a); } - bool no_overflow(unsigned a, unsigned b) - { return !full_add(a, b).second; } - -Should compile to: - -__Z11no_overflowjj: - add r4,r3,r4 - subfc r3,r3,r4 - li r3,0 - adde r3,r3,r3 - blr - -(or better) not: - -__Z11no_overflowjj: - add r2, r4, r3 - cmplw cr7, r2, r3 - mfcr r2 - rlwinm r2, r2, 29, 31, 31 - xori r3, r2, 1 - blr - -//===---------------------------------------------------------------------===// - -We compile some FP comparisons into an mfcr with two rlwinms and an or. For -example: -#include -int test(double x, double y) { return islessequal(x, y);} -int test2(double x, double y) { return islessgreater(x, y);} -int test3(double x, double y) { return !islessequal(x, y);} - -Compiles into (all three are similar, but the bits differ): - -_test: - fcmpu cr7, f1, f2 - mfcr r2 - rlwinm r3, r2, 29, 31, 31 - rlwinm r2, r2, 31, 31, 31 - or r3, r2, r3 - blr - -GCC compiles this into: - - _test: - fcmpu cr7,f1,f2 - cror 30,28,30 - mfcr r3 - rlwinm r3,r3,31,1 - blr - -which is more efficient and can use mfocr. See PR642 for some more context. - -//===---------------------------------------------------------------------===// - -void foo(float *data, float d) { - long i; - for (i = 0; i < 8000; i++) - data[i] = d; -} -void foo2(float *data, float d) { - long i; - data--; - for (i = 0; i < 8000; i++) { - data[1] = d; - data++; - } -} - -These compile to: - -_foo: - li r2, 0 -LBB1_1: ; bb - addi r4, r2, 4 - stfsx f1, r3, r2 - cmplwi cr0, r4, 32000 - mr r2, r4 - bne cr0, LBB1_1 ; bb - blr -_foo2: - li r2, 0 -LBB2_1: ; bb - addi r4, r2, 4 - stfsx f1, r3, r2 - cmplwi cr0, r4, 32000 - mr r2, r4 - bne cr0, LBB2_1 ; bb - blr - -The 'mr' could be eliminated to folding the add into the cmp better. - -//===---------------------------------------------------------------------===// -Codegen for the following (low-probability) case deteriorated considerably -when the correctness fixes for unordered comparisons went in (PR 642, 58871). -It should be possible to recover the code quality described in the comments. - -; RUN: llvm-as < %s | llc -march=ppc32 | grep or | count 3 -; This should produce one 'or' or 'cror' instruction per function. - -; RUN: llvm-as < %s | llc -march=ppc32 | grep mfcr | count 3 -; PR2964 - -define i32 @test(double %x, double %y) nounwind { -entry: - %tmp3 = fcmp ole double %x, %y ; [#uses=1] - %tmp345 = zext i1 %tmp3 to i32 ; [#uses=1] - ret i32 %tmp345 -} - -define i32 @test2(double %x, double %y) nounwind { -entry: - %tmp3 = fcmp one double %x, %y ; [#uses=1] - %tmp345 = zext i1 %tmp3 to i32 ; [#uses=1] - ret i32 %tmp345 -} - -define i32 @test3(double %x, double %y) nounwind { -entry: - %tmp3 = fcmp ugt double %x, %y ; [#uses=1] - %tmp34 = zext i1 %tmp3 to i32 ; [#uses=1] - ret i32 %tmp34 -} -//===----------------------------------------------------------------------===// -; RUN: llvm-as < %s | llc -march=ppc32 | not grep fneg - -; This could generate FSEL with appropriate flags (FSEL is not IEEE-safe, and -; should not be generated except with -enable-finite-only-fp-math or the like). -; With the correctness fixes for PR642 (58871) LowerSELECT_CC would need to -; recognize a more elaborate tree than a simple SETxx. - -define double @test_FNEG_sel(double %A, double %B, double %C) { - %D = fsub double -0.000000e+00, %A ; [#uses=1] - %Cond = fcmp ugt double %D, -0.000000e+00 ; [#uses=1] - %E = select i1 %Cond, double %B, double %C ; [#uses=1] - ret double %E -} - -//===----------------------------------------------------------------------===// -The save/restore sequence for CR in prolog/epilog is terrible: -- Each CR subreg is saved individually, rather than doing one save as a unit. -- On Darwin, the save is done after the decrement of SP, which means the offset -from SP of the save slot can be too big for a store instruction, which means we -need an additional register (currently hacked in 96015+96020; the solution there -is correct, but poor). -- On SVR4 the same thing can happen, and I don't think saving before the SP -decrement is safe on that target, as there is no red zone. This is currently -broken AFAIK, although it's not a target I can exercise. -The following demonstrates the problem: -extern void bar(char *p); -void foo() { - char x[100000]; - bar(x); - __asm__("" ::: "cr2"); -} diff --git a/contrib/llvm/lib/Target/PowerPC/README_ALTIVEC.txt b/contrib/llvm/lib/Target/PowerPC/README_ALTIVEC.txt deleted file mode 100644 index 1e4c6fb98440..000000000000 --- a/contrib/llvm/lib/Target/PowerPC/README_ALTIVEC.txt +++ /dev/null @@ -1,211 +0,0 @@ -//===- README_ALTIVEC.txt - Notes for improving Altivec code gen ----------===// - -Implement PPCInstrInfo::isLoadFromStackSlot/isStoreToStackSlot for vector -registers, to generate better spill code. - -//===----------------------------------------------------------------------===// - -The first should be a single lvx from the constant pool, the second should be -a xor/stvx: - -void foo(void) { - int x[8] __attribute__((aligned(128))) = { 1, 1, 1, 17, 1, 1, 1, 1 }; - bar (x); -} - -#include -void foo(void) { - int x[8] __attribute__((aligned(128))); - memset (x, 0, sizeof (x)); - bar (x); -} - -//===----------------------------------------------------------------------===// - -Altivec: Codegen'ing MUL with vector FMADD should add -0.0, not 0.0: -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8763 - -When -ffast-math is on, we can use 0.0. - -//===----------------------------------------------------------------------===// - - Consider this: - v4f32 Vector; - v4f32 Vector2 = { Vector.X, Vector.X, Vector.X, Vector.X }; - -Since we know that "Vector" is 16-byte aligned and we know the element offset -of ".X", we should change the load into a lve*x instruction, instead of doing -a load/store/lve*x sequence. - -//===----------------------------------------------------------------------===// - -For functions that use altivec AND have calls, we are VRSAVE'ing all call -clobbered regs. - -//===----------------------------------------------------------------------===// - -Implement passing vectors by value into calls and receiving them as arguments. - -//===----------------------------------------------------------------------===// - -GCC apparently tries to codegen { C1, C2, Variable, C3 } as a constant pool load -of C1/C2/C3, then a load and vperm of Variable. - -//===----------------------------------------------------------------------===// - -We need a way to teach tblgen that some operands of an intrinsic are required to -be constants. The verifier should enforce this constraint. - -//===----------------------------------------------------------------------===// - -We currently codegen SCALAR_TO_VECTOR as a store of the scalar to a 16-byte -aligned stack slot, followed by a load/vperm. We should probably just store it -to a scalar stack slot, then use lvsl/vperm to load it. If the value is already -in memory this is a big win. - -//===----------------------------------------------------------------------===// - -extract_vector_elt of an arbitrary constant vector can be done with the -following instructions: - -vTemp = vec_splat(v0,2); // 2 is the element the src is in. -vec_ste(&destloc,0,vTemp); - -We can do an arbitrary non-constant value by using lvsr/perm/ste. - -//===----------------------------------------------------------------------===// - -If we want to tie instruction selection into the scheduler, we can do some -constant formation with different instructions. For example, we can generate -"vsplti -1" with "vcmpequw R,R" and 1,1,1,1 with "vsubcuw R,R", and 0,0,0,0 with -"vsplti 0" or "vxor", each of which use different execution units, thus could -help scheduling. - -This is probably only reasonable for a post-pass scheduler. - -//===----------------------------------------------------------------------===// - -For this function: - -void test(vector float *A, vector float *B) { - vector float C = (vector float)vec_cmpeq(*A, *B); - if (!vec_any_eq(*A, *B)) - *B = (vector float){0,0,0,0}; - *A = C; -} - -we get the following basic block: - - ... - lvx v2, 0, r4 - lvx v3, 0, r3 - vcmpeqfp v4, v3, v2 - vcmpeqfp. v2, v3, v2 - bne cr6, LBB1_2 ; cond_next - -The vcmpeqfp/vcmpeqfp. instructions currently cannot be merged when the -vcmpeqfp. result is used by a branch. This can be improved. - -//===----------------------------------------------------------------------===// - -The code generated for this is truly aweful: - -vector float test(float a, float b) { - return (vector float){ 0.0, a, 0.0, 0.0}; -} - -LCPI1_0: ; float - .space 4 - .text - .globl _test - .align 4 -_test: - mfspr r2, 256 - oris r3, r2, 4096 - mtspr 256, r3 - lis r3, ha16(LCPI1_0) - addi r4, r1, -32 - stfs f1, -16(r1) - addi r5, r1, -16 - lfs f0, lo16(LCPI1_0)(r3) - stfs f0, -32(r1) - lvx v2, 0, r4 - lvx v3, 0, r5 - vmrghw v3, v3, v2 - vspltw v2, v2, 0 - vmrghw v2, v2, v3 - mtspr 256, r2 - blr - -//===----------------------------------------------------------------------===// - -int foo(vector float *x, vector float *y) { - if (vec_all_eq(*x,*y)) return 3245; - else return 12; -} - -A predicate compare being used in a select_cc should have the same peephole -applied to it as a predicate compare used by a br_cc. There should be no -mfcr here: - -_foo: - mfspr r2, 256 - oris r5, r2, 12288 - mtspr 256, r5 - li r5, 12 - li r6, 3245 - lvx v2, 0, r4 - lvx v3, 0, r3 - vcmpeqfp. v2, v3, v2 - mfcr r3, 2 - rlwinm r3, r3, 25, 31, 31 - cmpwi cr0, r3, 0 - bne cr0, LBB1_2 ; entry -LBB1_1: ; entry - mr r6, r5 -LBB1_2: ; entry - mr r3, r6 - mtspr 256, r2 - blr - -//===----------------------------------------------------------------------===// - -CodeGen/PowerPC/vec_constants.ll has an and operation that should be -codegen'd to andc. The issue is that the 'all ones' build vector is -SelectNodeTo'd a VSPLTISB instruction node before the and/xor is selected -which prevents the vnot pattern from matching. - - -//===----------------------------------------------------------------------===// - -An alternative to the store/store/load approach for illegal insert element -lowering would be: - -1. store element to any ol' slot -2. lvx the slot -3. lvsl 0; splat index; vcmpeq to generate a select mask -4. lvsl slot + x; vperm to rotate result into correct slot -5. vsel result together. - -//===----------------------------------------------------------------------===// - -Should codegen branches on vec_any/vec_all to avoid mfcr. Two examples: - -#include - int f(vector float a, vector float b) - { - int aa = 0; - if (vec_all_ge(a, b)) - aa |= 0x1; - if (vec_any_ge(a,b)) - aa |= 0x2; - return aa; -} - -vector float f(vector float a, vector float b) { - if (vec_any_eq(a, b)) - return a; - else - return b; -} - diff --git a/contrib/llvm/lib/Target/PowerPC/TargetInfo/CMakeLists.txt b/contrib/llvm/lib/Target/PowerPC/TargetInfo/CMakeLists.txt deleted file mode 100644 index 058d599a4af0..000000000000 --- a/contrib/llvm/lib/Target/PowerPC/TargetInfo/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMPowerPCInfo - PowerPCTargetInfo.cpp - ) - -add_dependencies(LLVMPowerPCInfo PowerPCCodeGenTable_gen) diff --git a/contrib/llvm/lib/Target/PowerPC/TargetInfo/Makefile b/contrib/llvm/lib/Target/PowerPC/TargetInfo/Makefile deleted file mode 100644 index a101aa4a4495..000000000000 --- a/contrib/llvm/lib/Target/PowerPC/TargetInfo/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Target/PowerPC/TargetInfo/Makefile --------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../../.. -LIBRARYNAME = LLVMPowerPCInfo - -# Hack: we need to include 'main' target directory to grab private headers -CPPFLAGS = -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/README.txt b/contrib/llvm/lib/Target/README.txt deleted file mode 100644 index 4faf8bcfd419..000000000000 --- a/contrib/llvm/lib/Target/README.txt +++ /dev/null @@ -1,1939 +0,0 @@ -Target Independent Opportunities: - -//===---------------------------------------------------------------------===// - -Dead argument elimination should be enhanced to handle cases when an argument is -dead to an externally visible function. Though the argument can't be removed -from the externally visible function, the caller doesn't need to pass it in. -For example in this testcase: - - void foo(int X) __attribute__((noinline)); - void foo(int X) { sideeffect(); } - void bar(int A) { foo(A+1); } - -We compile bar to: - -define void @bar(i32 %A) nounwind ssp { - %0 = add nsw i32 %A, 1 ; [#uses=1] - tail call void @foo(i32 %0) nounwind noinline ssp - ret void -} - -The add is dead, we could pass in 'i32 undef' instead. This occurs for C++ -templates etc, which usually have linkonce_odr/weak_odr linkage, not internal -linkage. - -//===---------------------------------------------------------------------===// - -With the recent changes to make the implicit def/use set explicit in -machineinstrs, we should change the target descriptions for 'call' instructions -so that the .td files don't list all the call-clobbered registers as implicit -defs. Instead, these should be added by the code generator (e.g. on the dag). - -This has a number of uses: - -1. PPC32/64 and X86 32/64 can avoid having multiple copies of call instructions - for their different impdef sets. -2. Targets with multiple calling convs (e.g. x86) which have different clobber - sets don't need copies of call instructions. -3. 'Interprocedural register allocation' can be done to reduce the clobber sets - of calls. - -//===---------------------------------------------------------------------===// - -Make the PPC branch selector target independant - -//===---------------------------------------------------------------------===// - -Get the C front-end to expand hypot(x,y) -> llvm.sqrt(x*x+y*y) when errno and -precision don't matter (ffastmath). Misc/mandel will like this. :) This isn't -safe in general, even on darwin. See the libm implementation of hypot for -examples (which special case when x/y are exactly zero to get signed zeros etc -right). - -//===---------------------------------------------------------------------===// - -Solve this DAG isel folding deficiency: - -int X, Y; - -void fn1(void) -{ - X = X | (Y << 3); -} - -compiles to - -fn1: - movl Y, %eax - shll $3, %eax - orl X, %eax - movl %eax, X - ret - -The problem is the store's chain operand is not the load X but rather -a TokenFactor of the load X and load Y, which prevents the folding. - -There are two ways to fix this: - -1. The dag combiner can start using alias analysis to realize that y/x - don't alias, making the store to X not dependent on the load from Y. -2. The generated isel could be made smarter in the case it can't - disambiguate the pointers. - -Number 1 is the preferred solution. - -This has been "fixed" by a TableGen hack. But that is a short term workaround -which will be removed once the proper fix is made. - -//===---------------------------------------------------------------------===// - -On targets with expensive 64-bit multiply, we could LSR this: - -for (i = ...; ++i) { - x = 1ULL << i; - -into: - long long tmp = 1; - for (i = ...; ++i, tmp+=tmp) - x = tmp; - -This would be a win on ppc32, but not x86 or ppc64. - -//===---------------------------------------------------------------------===// - -Shrink: (setlt (loadi32 P), 0) -> (setlt (loadi8 Phi), 0) - -//===---------------------------------------------------------------------===// - -Reassociate should turn things like: - -int factorial(int X) { - return X*X*X*X*X*X*X*X; -} - -into llvm.powi calls, allowing the code generator to produce balanced -multiplication trees. - -First, the intrinsic needs to be extended to support integers, and second the -code generator needs to be enhanced to lower these to multiplication trees. - -//===---------------------------------------------------------------------===// - -Interesting? testcase for add/shift/mul reassoc: - -int bar(int x, int y) { - return x*x*x+y+x*x*x*x*x*y*y*y*y; -} -int foo(int z, int n) { - return bar(z, n) + bar(2*z, 2*n); -} - -This is blocked on not handling X*X*X -> powi(X, 3) (see note above). The issue -is that we end up getting t = 2*X s = t*t and don't turn this into 4*X*X, -which is the same number of multiplies and is canonical, because the 2*X has -multiple uses. Here's a simple example: - -define i32 @test15(i32 %X1) { - %B = mul i32 %X1, 47 ; X1*47 - %C = mul i32 %B, %B - ret i32 %C -} - - -//===---------------------------------------------------------------------===// - -Reassociate should handle the example in GCC PR16157: - -extern int a0, a1, a2, a3, a4; extern int b0, b1, b2, b3, b4; -void f () { /* this can be optimized to four additions... */ - b4 = a4 + a3 + a2 + a1 + a0; - b3 = a3 + a2 + a1 + a0; - b2 = a2 + a1 + a0; - b1 = a1 + a0; -} - -This requires reassociating to forms of expressions that are already available, -something that reassoc doesn't think about yet. - - -//===---------------------------------------------------------------------===// - -This function: (derived from GCC PR19988) -double foo(double x, double y) { - return ((x + 0.1234 * y) * (x + -0.1234 * y)); -} - -compiles to: -_foo: - movapd %xmm1, %xmm2 - mulsd LCPI1_1(%rip), %xmm1 - mulsd LCPI1_0(%rip), %xmm2 - addsd %xmm0, %xmm1 - addsd %xmm0, %xmm2 - movapd %xmm1, %xmm0 - mulsd %xmm2, %xmm0 - ret - -Reassociate should be able to turn it into: - -double foo(double x, double y) { - return ((x + 0.1234 * y) * (x - 0.1234 * y)); -} - -Which allows the multiply by constant to be CSE'd, producing: - -_foo: - mulsd LCPI1_0(%rip), %xmm1 - movapd %xmm1, %xmm2 - addsd %xmm0, %xmm2 - subsd %xmm1, %xmm0 - mulsd %xmm2, %xmm0 - ret - -This doesn't need -ffast-math support at all. This is particularly bad because -the llvm-gcc frontend is canonicalizing the later into the former, but clang -doesn't have this problem. - -//===---------------------------------------------------------------------===// - -These two functions should generate the same code on big-endian systems: - -int g(int *j,int *l) { return memcmp(j,l,4); } -int h(int *j, int *l) { return *j - *l; } - -this could be done in SelectionDAGISel.cpp, along with other special cases, -for 1,2,4,8 bytes. - -//===---------------------------------------------------------------------===// - -It would be nice to revert this patch: -http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20060213/031986.html - -And teach the dag combiner enough to simplify the code expanded before -legalize. It seems plausible that this knowledge would let it simplify other -stuff too. - -//===---------------------------------------------------------------------===// - -For vector types, TargetData.cpp::getTypeInfo() returns alignment that is equal -to the type size. It works but can be overly conservative as the alignment of -specific vector types are target dependent. - -//===---------------------------------------------------------------------===// - -We should produce an unaligned load from code like this: - -v4sf example(float *P) { - return (v4sf){P[0], P[1], P[2], P[3] }; -} - -//===---------------------------------------------------------------------===// - -Add support for conditional increments, and other related patterns. Instead -of: - - movl 136(%esp), %eax - cmpl $0, %eax - je LBB16_2 #cond_next -LBB16_1: #cond_true - incl _foo -LBB16_2: #cond_next - -emit: - movl _foo, %eax - cmpl $1, %edi - sbbl $-1, %eax - movl %eax, _foo - -//===---------------------------------------------------------------------===// - -Combine: a = sin(x), b = cos(x) into a,b = sincos(x). - -Expand these to calls of sin/cos and stores: - double sincos(double x, double *sin, double *cos); - float sincosf(float x, float *sin, float *cos); - long double sincosl(long double x, long double *sin, long double *cos); - -Doing so could allow SROA of the destination pointers. See also: -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17687 - -This is now easily doable with MRVs. We could even make an intrinsic for this -if anyone cared enough about sincos. - -//===---------------------------------------------------------------------===// - -quantum_sigma_x in 462.libquantum contains the following loop: - - for(i=0; isize; i++) - { - /* Flip the target bit of each basis state */ - reg->node[i].state ^= ((MAX_UNSIGNED) 1 << target); - } - -Where MAX_UNSIGNED/state is a 64-bit int. On a 32-bit platform it would be just -so cool to turn it into something like: - - long long Res = ((MAX_UNSIGNED) 1 << target); - if (target < 32) { - for(i=0; isize; i++) - reg->node[i].state ^= Res & 0xFFFFFFFFULL; - } else { - for(i=0; isize; i++) - reg->node[i].state ^= Res & 0xFFFFFFFF00000000ULL - } - -... which would only do one 32-bit XOR per loop iteration instead of two. - -It would also be nice to recognize the reg->size doesn't alias reg->node[i], but -this requires TBAA. - -//===---------------------------------------------------------------------===// - -This isn't recognized as bswap by instcombine (yes, it really is bswap): - -unsigned long reverse(unsigned v) { - unsigned t; - t = v ^ ((v << 16) | (v >> 16)); - t &= ~0xff0000; - v = (v << 24) | (v >> 8); - return v ^ (t >> 8); -} - -Neither is this (very standard idiom): - -int f(int n) -{ - return (((n) << 24) | (((n) & 0xff00) << 8) - | (((n) >> 8) & 0xff00) | ((n) >> 24)); -} - -//===---------------------------------------------------------------------===// - -[LOOP RECOGNITION] - -These idioms should be recognized as popcount (see PR1488): - -unsigned countbits_slow(unsigned v) { - unsigned c; - for (c = 0; v; v >>= 1) - c += v & 1; - return c; -} -unsigned countbits_fast(unsigned v){ - unsigned c; - for (c = 0; v; c++) - v &= v - 1; // clear the least significant bit set - return c; -} - -BITBOARD = unsigned long long -int PopCnt(register BITBOARD a) { - register int c=0; - while(a) { - c++; - a &= a - 1; - } - return c; -} -unsigned int popcount(unsigned int input) { - unsigned int count = 0; - for (unsigned int i = 0; i < 4 * 8; i++) - count += (input >> i) & i; - return count; -} - -This is a form of idiom recognition for loops, the same thing that could be -useful for recognizing memset/memcpy. - -//===---------------------------------------------------------------------===// - -These should turn into single 16-bit (unaligned?) loads on little/big endian -processors. - -unsigned short read_16_le(const unsigned char *adr) { - return adr[0] | (adr[1] << 8); -} -unsigned short read_16_be(const unsigned char *adr) { - return (adr[0] << 8) | adr[1]; -} - -//===---------------------------------------------------------------------===// - --instcombine should handle this transform: - icmp pred (sdiv X / C1 ), C2 -when X, C1, and C2 are unsigned. Similarly for udiv and signed operands. - -Currently InstCombine avoids this transform but will do it when the signs of -the operands and the sign of the divide match. See the FIXME in -InstructionCombining.cpp in the visitSetCondInst method after the switch case -for Instruction::UDiv (around line 4447) for more details. - -The SingleSource/Benchmarks/Shootout-C++/hash and hash2 tests have examples of -this construct. - -//===---------------------------------------------------------------------===// - -[LOOP RECOGNITION] - -viterbi speeds up *significantly* if the various "history" related copy loops -are turned into memcpy calls at the source level. We need a "loops to memcpy" -pass. - -//===---------------------------------------------------------------------===// - -[LOOP OPTIMIZATION] - -SingleSource/Benchmarks/Misc/dt.c shows several interesting optimization -opportunities in its double_array_divs_variable function: it needs loop -interchange, memory promotion (which LICM already does), vectorization and -variable trip count loop unrolling (since it has a constant trip count). ICC -apparently produces this very nice code with -ffast-math: - -..B1.70: # Preds ..B1.70 ..B1.69 - mulpd %xmm0, %xmm1 #108.2 - mulpd %xmm0, %xmm1 #108.2 - mulpd %xmm0, %xmm1 #108.2 - mulpd %xmm0, %xmm1 #108.2 - addl $8, %edx # - cmpl $131072, %edx #108.2 - jb ..B1.70 # Prob 99% #108.2 - -It would be better to count down to zero, but this is a lot better than what we -do. - -//===---------------------------------------------------------------------===// - -Consider: - -typedef unsigned U32; -typedef unsigned long long U64; -int test (U32 *inst, U64 *regs) { - U64 effective_addr2; - U32 temp = *inst; - int r1 = (temp >> 20) & 0xf; - int b2 = (temp >> 16) & 0xf; - effective_addr2 = temp & 0xfff; - if (b2) effective_addr2 += regs[b2]; - b2 = (temp >> 12) & 0xf; - if (b2) effective_addr2 += regs[b2]; - effective_addr2 &= regs[4]; - if ((effective_addr2 & 3) == 0) - return 1; - return 0; -} - -Note that only the low 2 bits of effective_addr2 are used. On 32-bit systems, -we don't eliminate the computation of the top half of effective_addr2 because -we don't have whole-function selection dags. On x86, this means we use one -extra register for the function when effective_addr2 is declared as U64 than -when it is declared U32. - -PHI Slicing could be extended to do this. - -//===---------------------------------------------------------------------===// - -LSR should know what GPR types a target has from TargetData. This code: - -volatile short X, Y; // globals - -void foo(int N) { - int i; - for (i = 0; i < N; i++) { X = i; Y = i*4; } -} - -produces two near identical IV's (after promotion) on PPC/ARM: - -LBB1_2: - ldr r3, LCPI1_0 - ldr r3, [r3] - strh r2, [r3] - ldr r3, LCPI1_1 - ldr r3, [r3] - strh r1, [r3] - add r1, r1, #4 - add r2, r2, #1 <- [0,+,1] - sub r0, r0, #1 <- [0,-,1] - cmp r0, #0 - bne LBB1_2 - -LSR should reuse the "+" IV for the exit test. - -//===---------------------------------------------------------------------===// - -Tail call elim should be more aggressive, checking to see if the call is -followed by an uncond branch to an exit block. - -; This testcase is due to tail-duplication not wanting to copy the return -; instruction into the terminating blocks because there was other code -; optimized out of the function after the taildup happened. -; RUN: llvm-as < %s | opt -tailcallelim | llvm-dis | not grep call - -define i32 @t4(i32 %a) { -entry: - %tmp.1 = and i32 %a, 1 ; [#uses=1] - %tmp.2 = icmp ne i32 %tmp.1, 0 ; [#uses=1] - br i1 %tmp.2, label %then.0, label %else.0 - -then.0: ; preds = %entry - %tmp.5 = add i32 %a, -1 ; [#uses=1] - %tmp.3 = call i32 @t4( i32 %tmp.5 ) ; [#uses=1] - br label %return - -else.0: ; preds = %entry - %tmp.7 = icmp ne i32 %a, 0 ; [#uses=1] - br i1 %tmp.7, label %then.1, label %return - -then.1: ; preds = %else.0 - %tmp.11 = add i32 %a, -2 ; [#uses=1] - %tmp.9 = call i32 @t4( i32 %tmp.11 ) ; [#uses=1] - br label %return - -return: ; preds = %then.1, %else.0, %then.0 - %result.0 = phi i32 [ 0, %else.0 ], [ %tmp.3, %then.0 ], - [ %tmp.9, %then.1 ] - ret i32 %result.0 -} - -//===---------------------------------------------------------------------===// - -Tail recursion elimination should handle: - -int pow2m1(int n) { - if (n == 0) - return 0; - return 2 * pow2m1 (n - 1) + 1; -} - -Also, multiplies can be turned into SHL's, so they should be handled as if -they were associative. "return foo() << 1" can be tail recursion eliminated. - -//===---------------------------------------------------------------------===// - -Argument promotion should promote arguments for recursive functions, like -this: - -; RUN: llvm-as < %s | opt -argpromotion | llvm-dis | grep x.val - -define internal i32 @foo(i32* %x) { -entry: - %tmp = load i32* %x ; [#uses=0] - %tmp.foo = call i32 @foo( i32* %x ) ; [#uses=1] - ret i32 %tmp.foo -} - -define i32 @bar(i32* %x) { -entry: - %tmp3 = call i32 @foo( i32* %x ) ; [#uses=1] - ret i32 %tmp3 -} - -//===---------------------------------------------------------------------===// - -We should investigate an instruction sinking pass. Consider this silly -example in pic mode: - -#include -void foo(int x) { - assert(x); - //... -} - -we compile this to: -_foo: - subl $28, %esp - call "L1$pb" -"L1$pb": - popl %eax - cmpl $0, 32(%esp) - je LBB1_2 # cond_true -LBB1_1: # return - # ... - addl $28, %esp - ret -LBB1_2: # cond_true -... - -The PIC base computation (call+popl) is only used on one path through the -code, but is currently always computed in the entry block. It would be -better to sink the picbase computation down into the block for the -assertion, as it is the only one that uses it. This happens for a lot of -code with early outs. - -Another example is loads of arguments, which are usually emitted into the -entry block on targets like x86. If not used in all paths through a -function, they should be sunk into the ones that do. - -In this case, whole-function-isel would also handle this. - -//===---------------------------------------------------------------------===// - -Investigate lowering of sparse switch statements into perfect hash tables: -http://burtleburtle.net/bob/hash/perfect.html - -//===---------------------------------------------------------------------===// - -We should turn things like "load+fabs+store" and "load+fneg+store" into the -corresponding integer operations. On a yonah, this loop: - -double a[256]; -void foo() { - int i, b; - for (b = 0; b < 10000000; b++) - for (i = 0; i < 256; i++) - a[i] = -a[i]; -} - -is twice as slow as this loop: - -long long a[256]; -void foo() { - int i, b; - for (b = 0; b < 10000000; b++) - for (i = 0; i < 256; i++) - a[i] ^= (1ULL << 63); -} - -and I suspect other processors are similar. On X86 in particular this is a -big win because doing this with integers allows the use of read/modify/write -instructions. - -//===---------------------------------------------------------------------===// - -DAG Combiner should try to combine small loads into larger loads when -profitable. For example, we compile this C++ example: - -struct THotKey { short Key; bool Control; bool Shift; bool Alt; }; -extern THotKey m_HotKey; -THotKey GetHotKey () { return m_HotKey; } - -into (-O3 -fno-exceptions -static -fomit-frame-pointer): - -__Z9GetHotKeyv: - pushl %esi - movl 8(%esp), %eax - movb _m_HotKey+3, %cl - movb _m_HotKey+4, %dl - movb _m_HotKey+2, %ch - movw _m_HotKey, %si - movw %si, (%eax) - movb %ch, 2(%eax) - movb %cl, 3(%eax) - movb %dl, 4(%eax) - popl %esi - ret $4 - -GCC produces: - -__Z9GetHotKeyv: - movl _m_HotKey, %edx - movl 4(%esp), %eax - movl %edx, (%eax) - movzwl _m_HotKey+4, %edx - movw %dx, 4(%eax) - ret $4 - -The LLVM IR contains the needed alignment info, so we should be able to -merge the loads and stores into 4-byte loads: - - %struct.THotKey = type { i16, i8, i8, i8 } -define void @_Z9GetHotKeyv(%struct.THotKey* sret %agg.result) nounwind { -... - %tmp2 = load i16* getelementptr (@m_HotKey, i32 0, i32 0), align 8 - %tmp5 = load i8* getelementptr (@m_HotKey, i32 0, i32 1), align 2 - %tmp8 = load i8* getelementptr (@m_HotKey, i32 0, i32 2), align 1 - %tmp11 = load i8* getelementptr (@m_HotKey, i32 0, i32 3), align 2 - -Alternatively, we should use a small amount of base-offset alias analysis -to make it so the scheduler doesn't need to hold all the loads in regs at -once. - -//===---------------------------------------------------------------------===// - -We should add an FRINT node to the DAG to model targets that have legal -implementations of ceil/floor/rint. - -//===---------------------------------------------------------------------===// - -Consider: - -int test() { - long long input[8] = {1,1,1,1,1,1,1,1}; - foo(input); -} - -We currently compile this into a memcpy from a global array since the -initializer is fairly large and not memset'able. This is good, but the memcpy -gets lowered to load/stores in the code generator. This is also ok, except -that the codegen lowering for memcpy doesn't handle the case when the source -is a constant global. This gives us atrocious code like this: - - call "L1$pb" -"L1$pb": - popl %eax - movl _C.0.1444-"L1$pb"+32(%eax), %ecx - movl %ecx, 40(%esp) - movl _C.0.1444-"L1$pb"+20(%eax), %ecx - movl %ecx, 28(%esp) - movl _C.0.1444-"L1$pb"+36(%eax), %ecx - movl %ecx, 44(%esp) - movl _C.0.1444-"L1$pb"+44(%eax), %ecx - movl %ecx, 52(%esp) - movl _C.0.1444-"L1$pb"+40(%eax), %ecx - movl %ecx, 48(%esp) - movl _C.0.1444-"L1$pb"+12(%eax), %ecx - movl %ecx, 20(%esp) - movl _C.0.1444-"L1$pb"+4(%eax), %ecx -... - -instead of: - movl $1, 16(%esp) - movl $0, 20(%esp) - movl $1, 24(%esp) - movl $0, 28(%esp) - movl $1, 32(%esp) - movl $0, 36(%esp) - ... - -//===---------------------------------------------------------------------===// - -http://llvm.org/PR717: - -The following code should compile into "ret int undef". Instead, LLVM -produces "ret int 0": - -int f() { - int x = 4; - int y; - if (x == 3) y = 0; - return y; -} - -//===---------------------------------------------------------------------===// - -The loop unroller should partially unroll loops (instead of peeling them) -when code growth isn't too bad and when an unroll count allows simplification -of some code within the loop. One trivial example is: - -#include -int main() { - int nRet = 17; - int nLoop; - for ( nLoop = 0; nLoop < 1000; nLoop++ ) { - if ( nLoop & 1 ) - nRet += 2; - else - nRet -= 1; - } - return nRet; -} - -Unrolling by 2 would eliminate the '&1' in both copies, leading to a net -reduction in code size. The resultant code would then also be suitable for -exit value computation. - -//===---------------------------------------------------------------------===// - -We miss a bunch of rotate opportunities on various targets, including ppc, x86, -etc. On X86, we miss a bunch of 'rotate by variable' cases because the rotate -matching code in dag combine doesn't look through truncates aggressively -enough. Here are some testcases reduces from GCC PR17886: - -unsigned long long f(unsigned long long x, int y) { - return (x << y) | (x >> 64-y); -} -unsigned f2(unsigned x, int y){ - return (x << y) | (x >> 32-y); -} -unsigned long long f3(unsigned long long x){ - int y = 9; - return (x << y) | (x >> 64-y); -} -unsigned f4(unsigned x){ - int y = 10; - return (x << y) | (x >> 32-y); -} -unsigned long long f5(unsigned long long x, unsigned long long y) { - return (x << 8) | ((y >> 48) & 0xffull); -} -unsigned long long f6(unsigned long long x, unsigned long long y, int z) { - switch(z) { - case 1: - return (x << 8) | ((y >> 48) & 0xffull); - case 2: - return (x << 16) | ((y >> 40) & 0xffffull); - case 3: - return (x << 24) | ((y >> 32) & 0xffffffull); - case 4: - return (x << 32) | ((y >> 24) & 0xffffffffull); - default: - return (x << 40) | ((y >> 16) & 0xffffffffffull); - } -} - -On X86-64, we only handle f2/f3/f4 right. On x86-32, a few of these -generate truly horrible code, instead of using shld and friends. On -ARM, we end up with calls to L___lshrdi3/L___ashldi3 in f, which is -badness. PPC64 misses f, f5 and f6. CellSPU aborts in isel. - -//===---------------------------------------------------------------------===// - -We do a number of simplifications in simplify libcalls to strength reduce -standard library functions, but we don't currently merge them together. For -example, it is useful to merge memcpy(a,b,strlen(b)) -> strcpy. This can only -be done safely if "b" isn't modified between the strlen and memcpy of course. - -//===---------------------------------------------------------------------===// - -We compile this program: (from GCC PR11680) -http://gcc.gnu.org/bugzilla/attachment.cgi?id=4487 - -Into code that runs the same speed in fast/slow modes, but both modes run 2x -slower than when compile with GCC (either 4.0 or 4.2): - -$ llvm-g++ perf.cpp -O3 -fno-exceptions -$ time ./a.out fast -1.821u 0.003s 0:01.82 100.0% 0+0k 0+0io 0pf+0w - -$ g++ perf.cpp -O3 -fno-exceptions -$ time ./a.out fast -0.821u 0.001s 0:00.82 100.0% 0+0k 0+0io 0pf+0w - -It looks like we are making the same inlining decisions, so this may be raw -codegen badness or something else (haven't investigated). - -//===---------------------------------------------------------------------===// - -We miss some instcombines for stuff like this: -void bar (void); -void foo (unsigned int a) { - /* This one is equivalent to a >= (3 << 2). */ - if ((a >> 2) >= 3) - bar (); -} - -A few other related ones are in GCC PR14753. - -//===---------------------------------------------------------------------===// - -Divisibility by constant can be simplified (according to GCC PR12849) from -being a mulhi to being a mul lo (cheaper). Testcase: - -void bar(unsigned n) { - if (n % 3 == 0) - true(); -} - -This is equivalent to the following, where 2863311531 is the multiplicative -inverse of 3, and 1431655766 is ((2^32)-1)/3+1: -void bar(unsigned n) { - if (n * 2863311531U < 1431655766U) - true(); -} - -The same transformation can work with an even modulo with the addition of a -rotate: rotate the result of the multiply to the right by the number of bits -which need to be zero for the condition to be true, and shrink the compare RHS -by the same amount. Unless the target supports rotates, though, that -transformation probably isn't worthwhile. - -The transformation can also easily be made to work with non-zero equality -comparisons: just transform, for example, "n % 3 == 1" to "(n-1) % 3 == 0". - -//===---------------------------------------------------------------------===// - -Better mod/ref analysis for scanf would allow us to eliminate the vtable and a -bunch of other stuff from this example (see PR1604): - -#include -struct test { - int val; - virtual ~test() {} -}; - -int main() { - test t; - std::scanf("%d", &t.val); - std::printf("%d\n", t.val); -} - -//===---------------------------------------------------------------------===// - -These functions perform the same computation, but produce different assembly. - -define i8 @select(i8 %x) readnone nounwind { - %A = icmp ult i8 %x, 250 - %B = select i1 %A, i8 0, i8 1 - ret i8 %B -} - -define i8 @addshr(i8 %x) readnone nounwind { - %A = zext i8 %x to i9 - %B = add i9 %A, 6 ;; 256 - 250 == 6 - %C = lshr i9 %B, 8 - %D = trunc i9 %C to i8 - ret i8 %D -} - -//===---------------------------------------------------------------------===// - -From gcc bug 24696: -int -f (unsigned long a, unsigned long b, unsigned long c) -{ - return ((a & (c - 1)) != 0) || ((b & (c - 1)) != 0); -} -int -f (unsigned long a, unsigned long b, unsigned long c) -{ - return ((a & (c - 1)) != 0) | ((b & (c - 1)) != 0); -} -Both should combine to ((a|b) & (c-1)) != 0. Currently not optimized with -"clang -emit-llvm-bc | opt -std-compile-opts". - -//===---------------------------------------------------------------------===// - -From GCC Bug 20192: -#define PMD_MASK (~((1UL << 23) - 1)) -void clear_pmd_range(unsigned long start, unsigned long end) -{ - if (!(start & ~PMD_MASK) && !(end & ~PMD_MASK)) - f(); -} -The expression should optimize to something like -"!((start|end)&~PMD_MASK). Currently not optimized with "clang --emit-llvm-bc | opt -std-compile-opts". - -//===---------------------------------------------------------------------===// - -void a(int variable) -{ - if (variable == 4 || variable == 6) - bar(); -} -This should optimize to "if ((variable | 2) == 6)". Currently not -optimized with "clang -emit-llvm-bc | opt -std-compile-opts | llc". - -//===---------------------------------------------------------------------===// - -unsigned int f(unsigned int i, unsigned int n) {++i; if (i == n) ++i; return -i;} -unsigned int f2(unsigned int i, unsigned int n) {++i; i += i == n; return i;} -These should combine to the same thing. Currently, the first function -produces better code on X86. - -//===---------------------------------------------------------------------===// - -From GCC Bug 15784: -#define abs(x) x>0?x:-x -int f(int x, int y) -{ - return (abs(x)) >= 0; -} -This should optimize to x == INT_MIN. (With -fwrapv.) Currently not -optimized with "clang -emit-llvm-bc | opt -std-compile-opts". - -//===---------------------------------------------------------------------===// - -From GCC Bug 14753: -void -rotate_cst (unsigned int a) -{ - a = (a << 10) | (a >> 22); - if (a == 123) - bar (); -} -void -minus_cst (unsigned int a) -{ - unsigned int tem; - - tem = 20 - a; - if (tem == 5) - bar (); -} -void -mask_gt (unsigned int a) -{ - /* This is equivalent to a > 15. */ - if ((a & ~7) > 8) - bar (); -} -void -rshift_gt (unsigned int a) -{ - /* This is equivalent to a > 23. */ - if ((a >> 2) > 5) - bar (); -} -All should simplify to a single comparison. All of these are -currently not optimized with "clang -emit-llvm-bc | opt --std-compile-opts". - -//===---------------------------------------------------------------------===// - -From GCC Bug 32605: -int c(int* x) {return (char*)x+2 == (char*)x;} -Should combine to 0. Currently not optimized with "clang --emit-llvm-bc | opt -std-compile-opts" (although llc can optimize it). - -//===---------------------------------------------------------------------===// - -int a(unsigned b) {return ((b << 31) | (b << 30)) >> 31;} -Should be combined to "((b >> 1) | b) & 1". Currently not optimized -with "clang -emit-llvm-bc | opt -std-compile-opts". - -//===---------------------------------------------------------------------===// - -unsigned a(unsigned x, unsigned y) { return x | (y & 1) | (y & 2);} -Should combine to "x | (y & 3)". Currently not optimized with "clang --emit-llvm-bc | opt -std-compile-opts". - -//===---------------------------------------------------------------------===// - -int a(int a, int b, int c) {return (~a & c) | ((c|a) & b);} -Should fold to "(~a & c) | (a & b)". Currently not optimized with -"clang -emit-llvm-bc | opt -std-compile-opts". - -//===---------------------------------------------------------------------===// - -int a(int a,int b) {return (~(a|b))|a;} -Should fold to "a|~b". Currently not optimized with "clang --emit-llvm-bc | opt -std-compile-opts". - -//===---------------------------------------------------------------------===// - -int a(int a, int b) {return (a&&b) || (a&&!b);} -Should fold to "a". Currently not optimized with "clang -emit-llvm-bc -| opt -std-compile-opts". - -//===---------------------------------------------------------------------===// - -int a(int a, int b, int c) {return (a&&b) || (!a&&c);} -Should fold to "a ? b : c", or at least something sane. Currently not -optimized with "clang -emit-llvm-bc | opt -std-compile-opts". - -//===---------------------------------------------------------------------===// - -int a(int a, int b, int c) {return (a&&b) || (a&&c) || (a&&b&&c);} -Should fold to a && (b || c). Currently not optimized with "clang --emit-llvm-bc | opt -std-compile-opts". - -//===---------------------------------------------------------------------===// - -int a(int x) {return x | ((x & 8) ^ 8);} -Should combine to x | 8. Currently not optimized with "clang --emit-llvm-bc | opt -std-compile-opts". - -//===---------------------------------------------------------------------===// - -int a(int x) {return x ^ ((x & 8) ^ 8);} -Should also combine to x | 8. Currently not optimized with "clang --emit-llvm-bc | opt -std-compile-opts". - -//===---------------------------------------------------------------------===// - -int a(int x) {return (x & 8) == 0 ? -1 : -9;} -Should combine to (x | -9) ^ 8. Currently not optimized with "clang --emit-llvm-bc | opt -std-compile-opts". - -//===---------------------------------------------------------------------===// - -int a(int x) {return (x & 8) == 0 ? -9 : -1;} -Should combine to x | -9. Currently not optimized with "clang --emit-llvm-bc | opt -std-compile-opts". - -//===---------------------------------------------------------------------===// - -int a(int x) {return ((x | -9) ^ 8) & x;} -Should combine to x & -9. Currently not optimized with "clang --emit-llvm-bc | opt -std-compile-opts". - -//===---------------------------------------------------------------------===// - -unsigned a(unsigned a) {return a * 0x11111111 >> 28 & 1;} -Should combine to "a * 0x88888888 >> 31". Currently not optimized -with "clang -emit-llvm-bc | opt -std-compile-opts". - -//===---------------------------------------------------------------------===// - -unsigned a(char* x) {if ((*x & 32) == 0) return b();} -There's an unnecessary zext in the generated code with "clang --emit-llvm-bc | opt -std-compile-opts". - -//===---------------------------------------------------------------------===// - -unsigned a(unsigned long long x) {return 40 * (x >> 1);} -Should combine to "20 * (((unsigned)x) & -2)". Currently not -optimized with "clang -emit-llvm-bc | opt -std-compile-opts". - -//===---------------------------------------------------------------------===// - -This was noticed in the entryblock for grokdeclarator in 403.gcc: - - %tmp = icmp eq i32 %decl_context, 4 - %decl_context_addr.0 = select i1 %tmp, i32 3, i32 %decl_context - %tmp1 = icmp eq i32 %decl_context_addr.0, 1 - %decl_context_addr.1 = select i1 %tmp1, i32 0, i32 %decl_context_addr.0 - -tmp1 should be simplified to something like: - (!tmp || decl_context == 1) - -This allows recursive simplifications, tmp1 is used all over the place in -the function, e.g. by: - - %tmp23 = icmp eq i32 %decl_context_addr.1, 0 ; [#uses=1] - %tmp24 = xor i1 %tmp1, true ; [#uses=1] - %or.cond8 = and i1 %tmp23, %tmp24 ; [#uses=1] - -later. - -//===---------------------------------------------------------------------===// - -[STORE SINKING] - -Store sinking: This code: - -void f (int n, int *cond, int *res) { - int i; - *res = 0; - for (i = 0; i < n; i++) - if (*cond) - *res ^= 234; /* (*) */ -} - -On this function GVN hoists the fully redundant value of *res, but nothing -moves the store out. This gives us this code: - -bb: ; preds = %bb2, %entry - %.rle = phi i32 [ 0, %entry ], [ %.rle6, %bb2 ] - %i.05 = phi i32 [ 0, %entry ], [ %indvar.next, %bb2 ] - %1 = load i32* %cond, align 4 - %2 = icmp eq i32 %1, 0 - br i1 %2, label %bb2, label %bb1 - -bb1: ; preds = %bb - %3 = xor i32 %.rle, 234 - store i32 %3, i32* %res, align 4 - br label %bb2 - -bb2: ; preds = %bb, %bb1 - %.rle6 = phi i32 [ %3, %bb1 ], [ %.rle, %bb ] - %indvar.next = add i32 %i.05, 1 - %exitcond = icmp eq i32 %indvar.next, %n - br i1 %exitcond, label %return, label %bb - -DSE should sink partially dead stores to get the store out of the loop. - -Here's another partial dead case: -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12395 - -//===---------------------------------------------------------------------===// - -Scalar PRE hoists the mul in the common block up to the else: - -int test (int a, int b, int c, int g) { - int d, e; - if (a) - d = b * c; - else - d = b - c; - e = b * c + g; - return d + e; -} - -It would be better to do the mul once to reduce codesize above the if. -This is GCC PR38204. - -//===---------------------------------------------------------------------===// - -[STORE SINKING] - -GCC PR37810 is an interesting case where we should sink load/store reload -into the if block and outside the loop, so we don't reload/store it on the -non-call path. - -for () { - *P += 1; - if () - call(); - else - ... --> -tmp = *P -for () { - tmp += 1; - if () { - *P = tmp; - call(); - tmp = *P; - } else ... -} -*P = tmp; - -We now hoist the reload after the call (Transforms/GVN/lpre-call-wrap.ll), but -we don't sink the store. We need partially dead store sinking. - -//===---------------------------------------------------------------------===// - -[LOAD PRE CRIT EDGE SPLITTING] - -GCC PR37166: Sinking of loads prevents SROA'ing the "g" struct on the stack -leading to excess stack traffic. This could be handled by GVN with some crazy -symbolic phi translation. The code we get looks like (g is on the stack): - -bb2: ; preds = %bb1 -.. - %9 = getelementptr %struct.f* %g, i32 0, i32 0 - store i32 %8, i32* %9, align bel %bb3 - -bb3: ; preds = %bb1, %bb2, %bb - %c_addr.0 = phi %struct.f* [ %g, %bb2 ], [ %c, %bb ], [ %c, %bb1 ] - %b_addr.0 = phi %struct.f* [ %b, %bb2 ], [ %g, %bb ], [ %b, %bb1 ] - %10 = getelementptr %struct.f* %c_addr.0, i32 0, i32 0 - %11 = load i32* %10, align 4 - -%11 is partially redundant, an in BB2 it should have the value %8. - -GCC PR33344 and PR35287 are similar cases. - - -//===---------------------------------------------------------------------===// - -[LOAD PRE] - -There are many load PRE testcases in testsuite/gcc.dg/tree-ssa/loadpre* in the -GCC testsuite, ones we don't get yet are (checked through loadpre25): - -[CRIT EDGE BREAKING] -loadpre3.c predcom-4.c - -[PRE OF READONLY CALL] -loadpre5.c - -[TURN SELECT INTO BRANCH] -loadpre14.c loadpre15.c - -actually a conditional increment: loadpre18.c loadpre19.c - - -//===---------------------------------------------------------------------===// - -[SCALAR PRE] -There are many PRE testcases in testsuite/gcc.dg/tree-ssa/ssa-pre-*.c in the -GCC testsuite. - -//===---------------------------------------------------------------------===// - -There are some interesting cases in testsuite/gcc.dg/tree-ssa/pred-comm* in the -GCC testsuite. For example, we get the first example in predcom-1.c, but -miss the second one: - -unsigned fib[1000]; -unsigned avg[1000]; - -__attribute__ ((noinline)) -void count_averages(int n) { - int i; - for (i = 1; i < n; i++) - avg[i] = (((unsigned long) fib[i - 1] + fib[i] + fib[i + 1]) / 3) & 0xffff; -} - -which compiles into two loads instead of one in the loop. - -predcom-2.c is the same as predcom-1.c - -predcom-3.c is very similar but needs loads feeding each other instead of -store->load. - - -//===---------------------------------------------------------------------===// - -[ALIAS ANALYSIS] - -Type based alias analysis: -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14705 - -We should do better analysis of posix_memalign. At the least it should -no-capture its pointer argument, at best, we should know that the out-value -result doesn't point to anything (like malloc). One example of this is in -SingleSource/Benchmarks/Misc/dt.c - -//===---------------------------------------------------------------------===// - -A/B get pinned to the stack because we turn an if/then into a select instead -of PRE'ing the load/store. This may be fixable in instcombine: -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37892 - -struct X { int i; }; -int foo (int x) { - struct X a; - struct X b; - struct X *p; - a.i = 1; - b.i = 2; - if (x) - p = &a; - else - p = &b; - return p->i; -} - -//===---------------------------------------------------------------------===// - -Interesting missed case because of control flow flattening (should be 2 loads): -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26629 -With: llvm-gcc t2.c -S -o - -O0 -emit-llvm | llvm-as | - opt -mem2reg -gvn -instcombine | llvm-dis -we miss it because we need 1) CRIT EDGE 2) MULTIPLE DIFFERENT -VALS PRODUCED BY ONE BLOCK OVER DIFFERENT PATHS - -//===---------------------------------------------------------------------===// - -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19633 -We could eliminate the branch condition here, loading from null is undefined: - -struct S { int w, x, y, z; }; -struct T { int r; struct S s; }; -void bar (struct S, int); -void foo (int a, struct T b) -{ - struct S *c = 0; - if (a) - c = &b.s; - bar (*c, a); -} - -//===---------------------------------------------------------------------===// - -simplifylibcalls should do several optimizations for strspn/strcspn: - -strcspn(x, "") -> strlen(x) -strcspn("", x) -> 0 -strspn("", x) -> 0 -strspn(x, "") -> strlen(x) -strspn(x, "a") -> strchr(x, 'a')-x - -strcspn(x, "a") -> inlined loop for up to 3 letters (similarly for strspn): - -size_t __strcspn_c3 (__const char *__s, int __reject1, int __reject2, - int __reject3) { - register size_t __result = 0; - while (__s[__result] != '\0' && __s[__result] != __reject1 && - __s[__result] != __reject2 && __s[__result] != __reject3) - ++__result; - return __result; -} - -This should turn into a switch on the character. See PR3253 for some notes on -codegen. - -456.hmmer apparently uses strcspn and strspn a lot. 471.omnetpp uses strspn. - -//===---------------------------------------------------------------------===// - -"gas" uses this idiom: - else if (strchr ("+-/*%|&^:[]()~", *intel_parser.op_string)) -.. - else if (strchr ("<>", *intel_parser.op_string) - -Those should be turned into a switch. - -//===---------------------------------------------------------------------===// - -252.eon contains this interesting code: - - %3072 = getelementptr [100 x i8]* %tempString, i32 0, i32 0 - %3073 = call i8* @strcpy(i8* %3072, i8* %3071) nounwind - %strlen = call i32 @strlen(i8* %3072) ; uses = 1 - %endptr = getelementptr [100 x i8]* %tempString, i32 0, i32 %strlen - call void @llvm.memcpy.i32(i8* %endptr, - i8* getelementptr ([5 x i8]* @"\01LC42", i32 0, i32 0), i32 5, i32 1) - %3074 = call i32 @strlen(i8* %endptr) nounwind readonly - -This is interesting for a couple reasons. First, in this: - - %3073 = call i8* @strcpy(i8* %3072, i8* %3071) nounwind - %strlen = call i32 @strlen(i8* %3072) - -The strlen could be replaced with: %strlen = sub %3072, %3073, because the -strcpy call returns a pointer to the end of the string. Based on that, the -endptr GEP just becomes equal to 3073, which eliminates a strlen call and GEP. - -Second, the memcpy+strlen strlen can be replaced with: - - %3074 = call i32 @strlen([5 x i8]* @"\01LC42") nounwind readonly - -Because the destination was just copied into the specified memory buffer. This, -in turn, can be constant folded to "4". - -In other code, it contains: - - %endptr6978 = bitcast i8* %endptr69 to i32* - store i32 7107374, i32* %endptr6978, align 1 - %3167 = call i32 @strlen(i8* %endptr69) nounwind readonly - -Which could also be constant folded. Whatever is producing this should probably -be fixed to leave this as a memcpy from a string. - -Further, eon also has an interesting partially redundant strlen call: - -bb8: ; preds = %_ZN18eonImageCalculatorC1Ev.exit - %682 = getelementptr i8** %argv, i32 6 ; [#uses=2] - %683 = load i8** %682, align 4 ; [#uses=4] - %684 = load i8* %683, align 1 ; [#uses=1] - %685 = icmp eq i8 %684, 0 ; [#uses=1] - br i1 %685, label %bb10, label %bb9 - -bb9: ; preds = %bb8 - %686 = call i32 @strlen(i8* %683) nounwind readonly - %687 = icmp ugt i32 %686, 254 ; [#uses=1] - br i1 %687, label %bb10, label %bb11 - -bb10: ; preds = %bb9, %bb8 - %688 = call i32 @strlen(i8* %683) nounwind readonly - -This could be eliminated by doing the strlen once in bb8, saving code size and -improving perf on the bb8->9->10 path. - -//===---------------------------------------------------------------------===// - -I see an interesting fully redundant call to strlen left in 186.crafty:InputMove -which looks like: - %movetext11 = getelementptr [128 x i8]* %movetext, i32 0, i32 0 - - -bb62: ; preds = %bb55, %bb53 - %promote.0 = phi i32 [ %169, %bb55 ], [ 0, %bb53 ] - %171 = call i32 @strlen(i8* %movetext11) nounwind readonly align 1 - %172 = add i32 %171, -1 ; [#uses=1] - %173 = getelementptr [128 x i8]* %movetext, i32 0, i32 %172 - -... no stores ... - br i1 %or.cond, label %bb65, label %bb72 - -bb65: ; preds = %bb62 - store i8 0, i8* %173, align 1 - br label %bb72 - -bb72: ; preds = %bb65, %bb62 - %trank.1 = phi i32 [ %176, %bb65 ], [ -1, %bb62 ] - %177 = call i32 @strlen(i8* %movetext11) nounwind readonly align 1 - -Note that on the bb62->bb72 path, that the %177 strlen call is partially -redundant with the %171 call. At worst, we could shove the %177 strlen call -up into the bb65 block moving it out of the bb62->bb72 path. However, note -that bb65 stores to the string, zeroing out the last byte. This means that on -that path the value of %177 is actually just %171-1. A sub is cheaper than a -strlen! - -This pattern repeats several times, basically doing: - - A = strlen(P); - P[A-1] = 0; - B = strlen(P); - where it is "obvious" that B = A-1. - -//===---------------------------------------------------------------------===// - -186.crafty also contains this code: - -%1906 = call i32 @strlen(i8* getelementptr ([32 x i8]* @pgn_event, i32 0,i32 0)) -%1907 = getelementptr [32 x i8]* @pgn_event, i32 0, i32 %1906 -%1908 = call i8* @strcpy(i8* %1907, i8* %1905) nounwind align 1 -%1909 = call i32 @strlen(i8* getelementptr ([32 x i8]* @pgn_event, i32 0,i32 0)) -%1910 = getelementptr [32 x i8]* @pgn_event, i32 0, i32 %1909 - -The last strlen is computable as 1908-@pgn_event, which means 1910=1908. - -//===---------------------------------------------------------------------===// - -186.crafty has this interesting pattern with the "out.4543" variable: - -call void @llvm.memcpy.i32( - i8* getelementptr ([10 x i8]* @out.4543, i32 0, i32 0), - i8* getelementptr ([7 x i8]* @"\01LC28700", i32 0, i32 0), i32 7, i32 1) -%101 = call@printf(i8* ... @out.4543, i32 0, i32 0)) nounwind - -It is basically doing: - - memcpy(globalarray, "string"); - printf(..., globalarray); - -Anyway, by knowing that printf just reads the memory and forward substituting -the string directly into the printf, this eliminates reads from globalarray. -Since this pattern occurs frequently in crafty (due to the "DisplayTime" and -other similar functions) there are many stores to "out". Once all the printfs -stop using "out", all that is left is the memcpy's into it. This should allow -globalopt to remove the "stored only" global. - -//===---------------------------------------------------------------------===// - -This code: - -define inreg i32 @foo(i8* inreg %p) nounwind { - %tmp0 = load i8* %p - %tmp1 = ashr i8 %tmp0, 5 - %tmp2 = sext i8 %tmp1 to i32 - ret i32 %tmp2 -} - -could be dagcombine'd to a sign-extending load with a shift. -For example, on x86 this currently gets this: - - movb (%eax), %al - sarb $5, %al - movsbl %al, %eax - -while it could get this: - - movsbl (%eax), %eax - sarl $5, %eax - -//===---------------------------------------------------------------------===// - -GCC PR31029: - -int test(int x) { return 1-x == x; } // --> return false -int test2(int x) { return 2-x == x; } // --> return x == 1 ? - -Always foldable for odd constants, what is the rule for even? - -//===---------------------------------------------------------------------===// - -PR 3381: GEP to field of size 0 inside a struct could be turned into GEP -for next field in struct (which is at same address). - -For example: store of float into { {{}}, float } could be turned into a store to -the float directly. - -//===---------------------------------------------------------------------===// - -#include -double foo(double a) { return sin(a); } - -This compiles into this on x86-64 Linux: -foo: - subq $8, %rsp - call sin - addq $8, %rsp - ret -vs: - -foo: - jmp sin - -//===---------------------------------------------------------------------===// - -The arg promotion pass should make use of nocapture to make its alias analysis -stuff much more precise. - -//===---------------------------------------------------------------------===// - -The following functions should be optimized to use a select instead of a -branch (from gcc PR40072): - -char char_int(int m) {if(m>7) return 0; return m;} -int int_char(char m) {if(m>7) return 0; return m;} - -//===---------------------------------------------------------------------===// - -int func(int a, int b) { if (a & 0x80) b |= 0x80; else b &= ~0x80; return b; } - -Generates this: - -define i32 @func(i32 %a, i32 %b) nounwind readnone ssp { -entry: - %0 = and i32 %a, 128 ; [#uses=1] - %1 = icmp eq i32 %0, 0 ; [#uses=1] - %2 = or i32 %b, 128 ; [#uses=1] - %3 = and i32 %b, -129 ; [#uses=1] - %b_addr.0 = select i1 %1, i32 %3, i32 %2 ; [#uses=1] - ret i32 %b_addr.0 -} - -However, it's functionally equivalent to: - - b = (b & ~0x80) | (a & 0x80); - -Which generates this: - -define i32 @func(i32 %a, i32 %b) nounwind readnone ssp { -entry: - %0 = and i32 %b, -129 ; [#uses=1] - %1 = and i32 %a, 128 ; [#uses=1] - %2 = or i32 %0, %1 ; [#uses=1] - ret i32 %2 -} - -This can be generalized for other forms: - - b = (b & ~0x80) | (a & 0x40) << 1; - -//===---------------------------------------------------------------------===// - -These two functions produce different code. They shouldn't: - -#include - -uint8_t p1(uint8_t b, uint8_t a) { - b = (b & ~0xc0) | (a & 0xc0); - return (b); -} - -uint8_t p2(uint8_t b, uint8_t a) { - b = (b & ~0x40) | (a & 0x40); - b = (b & ~0x80) | (a & 0x80); - return (b); -} - -define zeroext i8 @p1(i8 zeroext %b, i8 zeroext %a) nounwind readnone ssp { -entry: - %0 = and i8 %b, 63 ; [#uses=1] - %1 = and i8 %a, -64 ; [#uses=1] - %2 = or i8 %1, %0 ; [#uses=1] - ret i8 %2 -} - -define zeroext i8 @p2(i8 zeroext %b, i8 zeroext %a) nounwind readnone ssp { -entry: - %0 = and i8 %b, 63 ; [#uses=1] - %.masked = and i8 %a, 64 ; [#uses=1] - %1 = and i8 %a, -128 ; [#uses=1] - %2 = or i8 %1, %0 ; [#uses=1] - %3 = or i8 %2, %.masked ; [#uses=1] - ret i8 %3 -} - -//===---------------------------------------------------------------------===// - -IPSCCP does not currently propagate argument dependent constants through -functions where it does not not all of the callers. This includes functions -with normal external linkage as well as templates, C99 inline functions etc. -Specifically, it does nothing to: - -define i32 @test(i32 %x, i32 %y, i32 %z) nounwind { -entry: - %0 = add nsw i32 %y, %z - %1 = mul i32 %0, %x - %2 = mul i32 %y, %z - %3 = add nsw i32 %1, %2 - ret i32 %3 -} - -define i32 @test2() nounwind { -entry: - %0 = call i32 @test(i32 1, i32 2, i32 4) nounwind - ret i32 %0 -} - -It would be interesting extend IPSCCP to be able to handle simple cases like -this, where all of the arguments to a call are constant. Because IPSCCP runs -before inlining, trivial templates and inline functions are not yet inlined. -The results for a function + set of constant arguments should be memoized in a -map. - -//===---------------------------------------------------------------------===// - -The libcall constant folding stuff should be moved out of SimplifyLibcalls into -libanalysis' constantfolding logic. This would allow IPSCCP to be able to -handle simple things like this: - -static int foo(const char *X) { return strlen(X); } -int bar() { return foo("abcd"); } - -//===---------------------------------------------------------------------===// - -InstCombine should use SimplifyDemandedBits to remove the or instruction: - -define i1 @test(i8 %x, i8 %y) { - %A = or i8 %x, 1 - %B = icmp ugt i8 %A, 3 - ret i1 %B -} - -Currently instcombine calls SimplifyDemandedBits with either all bits or just -the sign bit, if the comparison is obviously a sign test. In this case, we only -need all but the bottom two bits from %A, and if we gave that mask to SDB it -would delete the or instruction for us. - -//===---------------------------------------------------------------------===// - -functionattrs doesn't know much about memcpy/memset. This function should be -marked readnone rather than readonly, since it only twiddles local memory, but -functionattrs doesn't handle memset/memcpy/memmove aggressively: - -struct X { int *p; int *q; }; -int foo() { - int i = 0, j = 1; - struct X x, y; - int **p; - y.p = &i; - x.q = &j; - p = __builtin_memcpy (&x, &y, sizeof (int *)); - return **p; -} - -//===---------------------------------------------------------------------===// - -Missed instcombine transformation: -define i1 @a(i32 %x) nounwind readnone { -entry: - %cmp = icmp eq i32 %x, 30 - %sub = add i32 %x, -30 - %cmp2 = icmp ugt i32 %sub, 9 - %or = or i1 %cmp, %cmp2 - ret i1 %or -} -This should be optimized to a single compare. Testcase derived from gcc. - -//===---------------------------------------------------------------------===// - -Missed instcombine transformation: -void b(); -void a(int x) { if (((1<47)&(b<58); } - -The sgt and slt should be combined into a single comparison. Testcase derived -from gcc. - -//===---------------------------------------------------------------------===// - -Missed instcombine transformation: -define i32 @a(i32 %x) nounwind readnone { -entry: - %rem = srem i32 %x, 32 - %shl = shl i32 1, %rem - ret i32 %shl -} - -The srem can be transformed to an and because if x is negative, the shift is -undefined. Testcase derived from gcc. - -//===---------------------------------------------------------------------===// - -Missed instcombine/dagcombine transformation: -define i32 @a(i32 %x, i32 %y) nounwind readnone { -entry: - %mul = mul i32 %y, -8 - %sub = sub i32 %x, %mul - ret i32 %sub -} - -Should compile to something like x+y*8, but currently compiles to an -inefficient result. Testcase derived from gcc. - -//===---------------------------------------------------------------------===// - -Missed instcombine/dagcombine transformation: -define void @lshift_lt(i8 zeroext %a) nounwind { -entry: - %conv = zext i8 %a to i32 - %shl = shl i32 %conv, 3 - %cmp = icmp ult i32 %shl, 33 - br i1 %cmp, label %if.then, label %if.end - -if.then: - tail call void @bar() nounwind - ret void - -if.end: - ret void -} -declare void @bar() nounwind - -The shift should be eliminated. Testcase derived from gcc. - -//===---------------------------------------------------------------------===// - -These compile into different code, one gets recognized as a switch and the -other doesn't due to phase ordering issues (PR6212): - -int test1(int mainType, int subType) { - if (mainType == 7) - subType = 4; - else if (mainType == 9) - subType = 6; - else if (mainType == 11) - subType = 9; - return subType; -} - -int test2(int mainType, int subType) { - if (mainType == 7) - subType = 4; - if (mainType == 9) - subType = 6; - if (mainType == 11) - subType = 9; - return subType; -} - -//===---------------------------------------------------------------------===// - -The following test case (from PR6576): - -define i32 @mul(i32 %a, i32 %b) nounwind readnone { -entry: - %cond1 = icmp eq i32 %b, 0 ; [#uses=1] - br i1 %cond1, label %exit, label %bb.nph -bb.nph: ; preds = %entry - %tmp = mul i32 %b, %a ; [#uses=1] - ret i32 %tmp -exit: ; preds = %entry - ret i32 0 -} - -could be reduced to: - -define i32 @mul(i32 %a, i32 %b) nounwind readnone { -entry: - %tmp = mul i32 %b, %a - ret i32 %tmp -} - -//===---------------------------------------------------------------------===// - -We should use DSE + llvm.lifetime.end to delete dead vtable pointer updates. -See GCC PR34949 - -Another interesting case is that something related could be used for variables -that go const after their ctor has finished. In these cases, globalopt (which -can statically run the constructor) could mark the global const (so it gets put -in the readonly section). A testcase would be: - -#include -using namespace std; -const complex should_be_in_rodata (42,-42); -complex should_be_in_data (42,-42); -complex should_be_in_bss; - -Where we currently evaluate the ctors but the globals don't become const because -the optimizer doesn't know they "become const" after the ctor is done. See -GCC PR4131 for more examples. - -//===---------------------------------------------------------------------===// - -In this code: - -long foo(long x) { - return x > 1 ? x : 1; -} - -LLVM emits a comparison with 1 instead of 0. 0 would be equivalent -and cheaper on most targets. - -LLVM prefers comparisons with zero over non-zero in general, but in this -case it choses instead to keep the max operation obvious. - -//===---------------------------------------------------------------------===// - -Take the following testcase on x86-64 (similar testcases exist for all targets -with addc/adde): - -define void @a(i64* nocapture %s, i64* nocapture %t, i64 %a, i64 %b, -i64 %c) nounwind { -entry: - %0 = zext i64 %a to i128 ; [#uses=1] - %1 = zext i64 %b to i128 ; [#uses=1] - %2 = add i128 %1, %0 ; [#uses=2] - %3 = zext i64 %c to i128 ; [#uses=1] - %4 = shl i128 %3, 64 ; [#uses=1] - %5 = add i128 %4, %2 ; [#uses=1] - %6 = lshr i128 %5, 64 ; [#uses=1] - %7 = trunc i128 %6 to i64 ; [#uses=1] - store i64 %7, i64* %s, align 8 - %8 = trunc i128 %2 to i64 ; [#uses=1] - store i64 %8, i64* %t, align 8 - ret void -} - -Generated code: - addq %rcx, %rdx - movl $0, %eax - adcq $0, %rax - addq %r8, %rax - movq %rax, (%rdi) - movq %rdx, (%rsi) - ret - -Expected code: - addq %rcx, %rdx - adcq $0, %r8 - movq %r8, (%rdi) - movq %rdx, (%rsi) - ret - -The generated SelectionDAG has an ADD of an ADDE, where both operands of the -ADDE are zero. Replacing one of the operands of the ADDE with the other operand -of the ADD, and replacing the ADD with the ADDE, should give the desired result. - -(That said, we are doing a lot better than gcc on this testcase. :) ) - -//===---------------------------------------------------------------------===// - -Switch lowering generates less than ideal code for the following switch: -define void @a(i32 %x) nounwind { -entry: - switch i32 %x, label %if.end [ - i32 0, label %if.then - i32 1, label %if.then - i32 2, label %if.then - i32 3, label %if.then - i32 5, label %if.then - ] -if.then: - tail call void @foo() nounwind - ret void -if.end: - ret void -} -declare void @foo() - -Generated code on x86-64 (other platforms give similar results): -a: - cmpl $5, %edi - ja .LBB0_2 - movl %edi, %eax - movl $47, %ecx - btq %rax, %rcx - jb .LBB0_3 -.LBB0_2: - ret -.LBB0_3: - jmp foo # TAILCALL - -The movl+movl+btq+jb could be simplified to a cmpl+jne. - -Or, if we wanted to be really clever, we could simplify the whole thing to -something like the following, which eliminates a branch: - xorl $1, %edi - cmpl $4, %edi - ja .LBB0_2 - ret -.LBB0_2: - jmp foo # TAILCALL -//===---------------------------------------------------------------------===// -Given a branch where the two target blocks are identical ("ret i32 %b" in -both), simplifycfg will simplify them away. But not so for a switch statement: - -define i32 @f(i32 %a, i32 %b) nounwind readnone { -entry: - switch i32 %a, label %bb3 [ - i32 4, label %bb - i32 6, label %bb - ] - -bb: ; preds = %entry, %entry - ret i32 %b - -bb3: ; preds = %entry - ret i32 %b -} -//===---------------------------------------------------------------------===// diff --git a/contrib/llvm/lib/Target/Sparc/AsmPrinter/CMakeLists.txt b/contrib/llvm/lib/Target/Sparc/AsmPrinter/CMakeLists.txt deleted file mode 100644 index da629f6e63fb..000000000000 --- a/contrib/llvm/lib/Target/Sparc/AsmPrinter/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMSparcAsmPrinter - SparcAsmPrinter.cpp - ) -add_dependencies(LLVMSparcAsmPrinter SparcCodeGenTable_gen) diff --git a/contrib/llvm/lib/Target/Sparc/AsmPrinter/Makefile b/contrib/llvm/lib/Target/Sparc/AsmPrinter/Makefile deleted file mode 100644 index fe475389c680..000000000000 --- a/contrib/llvm/lib/Target/Sparc/AsmPrinter/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Target/Sparc/AsmPrinter/Makefile ----------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../../.. -LIBRARYNAME = LLVMSparcAsmPrinter - -# Hack: we need to include 'main' Sparc target directory to grab private headers -CPP.Flags += -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/Sparc/CMakeLists.txt b/contrib/llvm/lib/Target/Sparc/CMakeLists.txt deleted file mode 100644 index 684cadfb57f7..000000000000 --- a/contrib/llvm/lib/Target/Sparc/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -set(LLVM_TARGET_DEFINITIONS Sparc.td) - -tablegen(SparcGenRegisterInfo.h.inc -gen-register-desc-header) -tablegen(SparcGenRegisterNames.inc -gen-register-enums) -tablegen(SparcGenRegisterInfo.inc -gen-register-desc) -tablegen(SparcGenInstrNames.inc -gen-instr-enums) -tablegen(SparcGenInstrInfo.inc -gen-instr-desc) -tablegen(SparcGenAsmWriter.inc -gen-asm-writer) -tablegen(SparcGenDAGISel.inc -gen-dag-isel) -tablegen(SparcGenSubtarget.inc -gen-subtarget) -tablegen(SparcGenCallingConv.inc -gen-callingconv) - -add_llvm_target(SparcCodeGen - DelaySlotFiller.cpp - FPMover.cpp - SparcInstrInfo.cpp - SparcISelDAGToDAG.cpp - SparcISelLowering.cpp - SparcMCAsmInfo.cpp - SparcRegisterInfo.cpp - SparcSubtarget.cpp - SparcTargetMachine.cpp - SparcSelectionDAGInfo.cpp - ) - -target_link_libraries (LLVMSparcCodeGen LLVMSelectionDAG) diff --git a/contrib/llvm/lib/Target/Sparc/Makefile b/contrib/llvm/lib/Target/Sparc/Makefile deleted file mode 100644 index e4078487e167..000000000000 --- a/contrib/llvm/lib/Target/Sparc/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -##===- lib/Target/Sparc/Makefile ---------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMSparcCodeGen -TARGET = Sparc - -# Make sure that tblgen is run, first thing. -BUILT_SOURCES = SparcGenRegisterInfo.h.inc SparcGenRegisterNames.inc \ - SparcGenRegisterInfo.inc SparcGenInstrNames.inc \ - SparcGenInstrInfo.inc SparcGenAsmWriter.inc \ - SparcGenDAGISel.inc SparcGenSubtarget.inc SparcGenCallingConv.inc - -DIRS = AsmPrinter TargetInfo - -include $(LEVEL)/Makefile.common - diff --git a/contrib/llvm/lib/Target/Sparc/README.txt b/contrib/llvm/lib/Target/Sparc/README.txt deleted file mode 100644 index b4991fe5790b..000000000000 --- a/contrib/llvm/lib/Target/Sparc/README.txt +++ /dev/null @@ -1,59 +0,0 @@ - -To-do ------ - -* Keep the address of the constant pool in a register instead of forming its - address all of the time. -* We can fold small constant offsets into the %hi/%lo references to constant - pool addresses as well. -* When in V9 mode, register allocate %icc[0-3]. -* Add support for isel'ing UMUL_LOHI instead of marking it as Expand. -* Emit the 'Branch on Integer Register with Prediction' instructions. It's - not clear how to write a pattern for this though: - -float %t1(int %a, int* %p) { - %C = seteq int %a, 0 - br bool %C, label %T, label %F -T: - store int 123, int* %p - br label %F -F: - ret float undef -} - -codegens to this: - -t1: - save -96, %o6, %o6 -1) subcc %i0, 0, %l0 -1) bne .LBBt1_2 ! F - nop -.LBBt1_1: ! T - or %g0, 123, %l0 - st %l0, [%i1] -.LBBt1_2: ! F - restore %g0, %g0, %g0 - retl - nop - -1) should be replaced with a brz in V9 mode. - -* Same as above, but emit conditional move on register zero (p192) in V9 - mode. Testcase: - -int %t1(int %a, int %b) { - %C = seteq int %a, 0 - %D = select bool %C, int %a, int %b - ret int %D -} - -* Emit MULX/[SU]DIVX instructions in V9 mode instead of fiddling - with the Y register, if they are faster. - -* Codegen bswap(load)/store(bswap) -> load/store ASI - -* Implement frame pointer elimination, e.g. eliminate save/restore for - leaf fns. -* Fill delay slots - -* Implement JIT support diff --git a/contrib/llvm/lib/Target/Sparc/TargetInfo/CMakeLists.txt b/contrib/llvm/lib/Target/Sparc/TargetInfo/CMakeLists.txt deleted file mode 100644 index 870b56a6ea1b..000000000000 --- a/contrib/llvm/lib/Target/Sparc/TargetInfo/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMSparcInfo - SparcTargetInfo.cpp - ) - -add_dependencies(LLVMSparcInfo SparcCodeGenTable_gen) diff --git a/contrib/llvm/lib/Target/Sparc/TargetInfo/Makefile b/contrib/llvm/lib/Target/Sparc/TargetInfo/Makefile deleted file mode 100644 index 641ed87160c7..000000000000 --- a/contrib/llvm/lib/Target/Sparc/TargetInfo/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Target/Sparc/TargetInfo/Makefile ----------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../../.. -LIBRARYNAME = LLVMSparcInfo - -# Hack: we need to include 'main' target directory to grab private headers -CPPFLAGS = -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/SystemZ/AsmPrinter/CMakeLists.txt b/contrib/llvm/lib/Target/SystemZ/AsmPrinter/CMakeLists.txt deleted file mode 100644 index c6be83a61080..000000000000 --- a/contrib/llvm/lib/Target/SystemZ/AsmPrinter/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMSystemZAsmPrinter - SystemZAsmPrinter.cpp - ) -add_dependencies(LLVMSystemZAsmPrinter SystemZCodeGenTable_gen) diff --git a/contrib/llvm/lib/Target/SystemZ/AsmPrinter/Makefile b/contrib/llvm/lib/Target/SystemZ/AsmPrinter/Makefile deleted file mode 100644 index 0f90ed369f77..000000000000 --- a/contrib/llvm/lib/Target/SystemZ/AsmPrinter/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Target/SystemZ/AsmPrinter/Makefile --------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../../.. -LIBRARYNAME = LLVMSystemZAsmPrinter - -# Hack: we need to include 'main' SystemZ target directory to grab private headers -CPP.Flags += -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/SystemZ/CMakeLists.txt b/contrib/llvm/lib/Target/SystemZ/CMakeLists.txt deleted file mode 100644 index 880e56f0525b..000000000000 --- a/contrib/llvm/lib/Target/SystemZ/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -set(LLVM_TARGET_DEFINITIONS SystemZ.td) - -tablegen(SystemZGenRegisterInfo.h.inc -gen-register-desc-header) -tablegen(SystemZGenRegisterNames.inc -gen-register-enums) -tablegen(SystemZGenRegisterInfo.inc -gen-register-desc) -tablegen(SystemZGenInstrNames.inc -gen-instr-enums) -tablegen(SystemZGenInstrInfo.inc -gen-instr-desc) -tablegen(SystemZGenAsmWriter.inc -gen-asm-writer) -tablegen(SystemZGenDAGISel.inc -gen-dag-isel) -tablegen(SystemZGenCallingConv.inc -gen-callingconv) -tablegen(SystemZGenSubtarget.inc -gen-subtarget) - -add_llvm_target(SystemZCodeGen - SystemZISelDAGToDAG.cpp - SystemZISelLowering.cpp - SystemZInstrInfo.cpp - SystemZMCAsmInfo.cpp - SystemZRegisterInfo.cpp - SystemZSubtarget.cpp - SystemZTargetMachine.cpp - SystemZSelectionDAGInfo.cpp - ) - -target_link_libraries (LLVMSystemZCodeGen LLVMSelectionDAG) diff --git a/contrib/llvm/lib/Target/SystemZ/Makefile b/contrib/llvm/lib/Target/SystemZ/Makefile deleted file mode 100644 index 5b44090f3f12..000000000000 --- a/contrib/llvm/lib/Target/SystemZ/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -##===- lib/Target/SystemZ/Makefile ---------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMSystemZCodeGen -TARGET = SystemZ - -# Make sure that tblgen is run, first thing. -BUILT_SOURCES = SystemZGenRegisterInfo.h.inc SystemZGenRegisterNames.inc \ - SystemZGenRegisterInfo.inc SystemZGenInstrNames.inc \ - SystemZGenInstrInfo.inc SystemZGenAsmWriter.inc \ - SystemZGenDAGISel.inc SystemZGenSubtarget.inc SystemZGenCallingConv.inc - -DIRS = AsmPrinter TargetInfo - -include $(LEVEL)/Makefile.common - diff --git a/contrib/llvm/lib/Target/SystemZ/TargetInfo/CMakeLists.txt b/contrib/llvm/lib/Target/SystemZ/TargetInfo/CMakeLists.txt deleted file mode 100644 index 743d8d322d05..000000000000 --- a/contrib/llvm/lib/Target/SystemZ/TargetInfo/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMSystemZInfo - SystemZTargetInfo.cpp - ) - -add_dependencies(LLVMSystemZInfo SystemZCodeGenTable_gen) diff --git a/contrib/llvm/lib/Target/SystemZ/TargetInfo/Makefile b/contrib/llvm/lib/Target/SystemZ/TargetInfo/Makefile deleted file mode 100644 index 0be80eb4e6ad..000000000000 --- a/contrib/llvm/lib/Target/SystemZ/TargetInfo/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Target/SystemZ/TargetInfo/Makefile --------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../../.. -LIBRARYNAME = LLVMSystemZInfo - -# Hack: we need to include 'main' target directory to grab private headers -CPPFLAGS = -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/X86/AsmParser/CMakeLists.txt b/contrib/llvm/lib/Target/X86/AsmParser/CMakeLists.txt deleted file mode 100644 index 40dbdd72faa1..000000000000 --- a/contrib/llvm/lib/Target/X86/AsmParser/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMX86AsmParser - X86AsmLexer.cpp - X86AsmParser.cpp - ) -add_dependencies(LLVMX86AsmParser X86CodeGenTable_gen) diff --git a/contrib/llvm/lib/Target/X86/AsmParser/Makefile b/contrib/llvm/lib/Target/X86/AsmParser/Makefile deleted file mode 100644 index fb9760796622..000000000000 --- a/contrib/llvm/lib/Target/X86/AsmParser/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Target/X86/AsmParser/Makefile -------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../../.. -LIBRARYNAME = LLVMX86AsmParser - -# Hack: we need to include 'main' x86 target directory to grab private headers -CPP.Flags += -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/X86/AsmPrinter/CMakeLists.txt b/contrib/llvm/lib/Target/X86/AsmPrinter/CMakeLists.txt deleted file mode 100644 index 033973eeeff9..000000000000 --- a/contrib/llvm/lib/Target/X86/AsmPrinter/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMX86AsmPrinter - X86ATTInstPrinter.cpp - X86IntelInstPrinter.cpp - X86InstComments.cpp - ) -add_dependencies(LLVMX86AsmPrinter X86CodeGenTable_gen) diff --git a/contrib/llvm/lib/Target/X86/AsmPrinter/Makefile b/contrib/llvm/lib/Target/X86/AsmPrinter/Makefile deleted file mode 100644 index c82aa330a20c..000000000000 --- a/contrib/llvm/lib/Target/X86/AsmPrinter/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Target/X86/AsmPrinter/Makefile ------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../../../.. -LIBRARYNAME = LLVMX86AsmPrinter - -# Hack: we need to include 'main' x86 target directory to grab private headers -CPP.Flags += -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/X86/CMakeLists.txt b/contrib/llvm/lib/Target/X86/CMakeLists.txt deleted file mode 100644 index e9399f5c8322..000000000000 --- a/contrib/llvm/lib/Target/X86/CMakeLists.txt +++ /dev/null @@ -1,52 +0,0 @@ -set(LLVM_TARGET_DEFINITIONS X86.td) - -tablegen(X86GenRegisterInfo.h.inc -gen-register-desc-header) -tablegen(X86GenRegisterNames.inc -gen-register-enums) -tablegen(X86GenRegisterInfo.inc -gen-register-desc) -tablegen(X86GenDisassemblerTables.inc -gen-disassembler) -tablegen(X86GenInstrNames.inc -gen-instr-enums) -tablegen(X86GenInstrInfo.inc -gen-instr-desc) -tablegen(X86GenAsmWriter.inc -gen-asm-writer) -tablegen(X86GenAsmWriter1.inc -gen-asm-writer -asmwriternum=1) -tablegen(X86GenAsmMatcher.inc -gen-asm-matcher) -tablegen(X86GenDAGISel.inc -gen-dag-isel) -tablegen(X86GenFastISel.inc -gen-fast-isel) -tablegen(X86GenCallingConv.inc -gen-callingconv) -tablegen(X86GenSubtarget.inc -gen-subtarget) -tablegen(X86GenEDInfo.inc -gen-enhanced-disassembly-info) - -set(sources - SSEDomainFix.cpp - X86AsmBackend.cpp - X86AsmPrinter.cpp - X86COFFMachineModuleInfo.cpp - X86CodeEmitter.cpp - X86ELFWriterInfo.cpp - X86FastISel.cpp - X86FloatingPoint.cpp - X86ISelDAGToDAG.cpp - X86ISelLowering.cpp - X86InstrInfo.cpp - X86JITInfo.cpp - X86MCAsmInfo.cpp - X86MCCodeEmitter.cpp - X86MCInstLower.cpp - X86RegisterInfo.cpp - X86SelectionDAGInfo.cpp - X86Subtarget.cpp - X86TargetMachine.cpp - X86TargetObjectFile.cpp - ) - -if( CMAKE_CL_64 ) - enable_language(ASM_MASM) - ADD_CUSTOM_COMMAND( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/X86CompilationCallback_Win64.obj - COMMAND ${CMAKE_ASM_MASM_COMPILER} /Fo ${CMAKE_CURRENT_BINARY_DIR}/X86CompilationCallback_Win64.obj /c ${CMAKE_CURRENT_SOURCE_DIR}/X86CompilationCallback_Win64.asm - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/X86CompilationCallback_Win64.asm - ) - set(sources ${sources} ${CMAKE_CURRENT_BINARY_DIR}/X86CompilationCallback_Win64.obj) -endif() - -add_llvm_target(X86CodeGen ${sources}) - diff --git a/contrib/llvm/lib/Target/X86/Disassembler/CMakeLists.txt b/contrib/llvm/lib/Target/X86/Disassembler/CMakeLists.txt deleted file mode 100644 index 97589c00515b..000000000000 --- a/contrib/llvm/lib/Target/X86/Disassembler/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMX86Disassembler - X86Disassembler.cpp - X86DisassemblerDecoder.c - ) -# workaround for hanging compilation on MSVC9 and 10 -if( MSVC_VERSION EQUAL 1500 OR MSVC_VERSION EQUAL 1600 ) -set_property( - SOURCE X86Disassembler.cpp - PROPERTY COMPILE_FLAGS "/Od" - ) -endif() -add_dependencies(LLVMX86Disassembler X86CodeGenTable_gen) diff --git a/contrib/llvm/lib/Target/X86/Disassembler/Makefile b/contrib/llvm/lib/Target/X86/Disassembler/Makefile deleted file mode 100644 index 8669fd8fd930..000000000000 --- a/contrib/llvm/lib/Target/X86/Disassembler/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -##===- lib/Target/X86/Disassembler/Makefile ----------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../../.. -LIBRARYNAME = LLVMX86Disassembler - -# Hack: we need to include 'main' x86 target directory to grab private headers -CPP.Flags += -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/X86/Makefile b/contrib/llvm/lib/Target/X86/Makefile deleted file mode 100644 index f4ff894a2af7..000000000000 --- a/contrib/llvm/lib/Target/X86/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -##===- lib/Target/X86/Makefile -----------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMX86CodeGen -TARGET = X86 - -# Make sure that tblgen is run, first thing. -BUILT_SOURCES = X86GenRegisterInfo.h.inc X86GenRegisterNames.inc \ - X86GenRegisterInfo.inc X86GenInstrNames.inc \ - X86GenInstrInfo.inc X86GenAsmWriter.inc X86GenAsmMatcher.inc \ - X86GenAsmWriter1.inc X86GenDAGISel.inc \ - X86GenDisassemblerTables.inc X86GenFastISel.inc \ - X86GenCallingConv.inc X86GenSubtarget.inc \ - X86GenEDInfo.inc - -DIRS = AsmPrinter AsmParser Disassembler TargetInfo - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/X86/README-FPStack.txt b/contrib/llvm/lib/Target/X86/README-FPStack.txt deleted file mode 100644 index 39efd2dbcf1a..000000000000 --- a/contrib/llvm/lib/Target/X86/README-FPStack.txt +++ /dev/null @@ -1,85 +0,0 @@ -//===---------------------------------------------------------------------===// -// Random ideas for the X86 backend: FP stack related stuff -//===---------------------------------------------------------------------===// - -//===---------------------------------------------------------------------===// - -Some targets (e.g. athlons) prefer freep to fstp ST(0): -http://gcc.gnu.org/ml/gcc-patches/2004-04/msg00659.html - -//===---------------------------------------------------------------------===// - -This should use fiadd on chips where it is profitable: -double foo(double P, int *I) { return P+*I; } - -We have fiadd patterns now but the followings have the same cost and -complexity. We need a way to specify the later is more profitable. - -def FpADD32m : FpI<(ops RFP:$dst, RFP:$src1, f32mem:$src2), OneArgFPRW, - [(set RFP:$dst, (fadd RFP:$src1, - (extloadf64f32 addr:$src2)))]>; - // ST(0) = ST(0) + [mem32] - -def FpIADD32m : FpI<(ops RFP:$dst, RFP:$src1, i32mem:$src2), OneArgFPRW, - [(set RFP:$dst, (fadd RFP:$src1, - (X86fild addr:$src2, i32)))]>; - // ST(0) = ST(0) + [mem32int] - -//===---------------------------------------------------------------------===// - -The FP stackifier should handle simple permutates to reduce number of shuffle -instructions, e.g. turning: - -fld P -> fld Q -fld Q fld P -fxch - -or: - -fxch -> fucomi -fucomi jl X -jg X - -Ideas: -http://gcc.gnu.org/ml/gcc-patches/2004-11/msg02410.html - - -//===---------------------------------------------------------------------===// - -Add a target specific hook to DAG combiner to handle SINT_TO_FP and -FP_TO_SINT when the source operand is already in memory. - -//===---------------------------------------------------------------------===// - -Open code rint,floor,ceil,trunc: -http://gcc.gnu.org/ml/gcc-patches/2004-08/msg02006.html -http://gcc.gnu.org/ml/gcc-patches/2004-08/msg02011.html - -Opencode the sincos[f] libcall. - -//===---------------------------------------------------------------------===// - -None of the FPStack instructions are handled in -X86RegisterInfo::foldMemoryOperand, which prevents the spiller from -folding spill code into the instructions. - -//===---------------------------------------------------------------------===// - -Currently the x86 codegen isn't very good at mixing SSE and FPStack -code: - -unsigned int foo(double x) { return x; } - -foo: - subl $20, %esp - movsd 24(%esp), %xmm0 - movsd %xmm0, 8(%esp) - fldl 8(%esp) - fisttpll (%esp) - movl (%esp), %eax - addl $20, %esp - ret - -This just requires being smarter when custom expanding fptoui. - -//===---------------------------------------------------------------------===// diff --git a/contrib/llvm/lib/Target/X86/README-MMX.txt b/contrib/llvm/lib/Target/X86/README-MMX.txt deleted file mode 100644 index a6c8616b6d2c..000000000000 --- a/contrib/llvm/lib/Target/X86/README-MMX.txt +++ /dev/null @@ -1,71 +0,0 @@ -//===---------------------------------------------------------------------===// -// Random ideas for the X86 backend: MMX-specific stuff. -//===---------------------------------------------------------------------===// - -//===---------------------------------------------------------------------===// - -This: - -#include - -__v2si qux(int A) { - return (__v2si){ 0, A }; -} - -is compiled into: - -_qux: - subl $28, %esp - movl 32(%esp), %eax - movd %eax, %mm0 - movq %mm0, (%esp) - movl (%esp), %eax - movl %eax, 20(%esp) - movq %mm0, 8(%esp) - movl 12(%esp), %eax - movl %eax, 16(%esp) - movq 16(%esp), %mm0 - addl $28, %esp - ret - -Yuck! - -GCC gives us: - -_qux: - subl $12, %esp - movl 16(%esp), %eax - movl 20(%esp), %edx - movl $0, (%eax) - movl %edx, 4(%eax) - addl $12, %esp - ret $4 - -//===---------------------------------------------------------------------===// - -We generate crappy code for this: - -__m64 t() { - return _mm_cvtsi32_si64(1); -} - -_t: - subl $12, %esp - movl $1, %eax - movd %eax, %mm0 - movq %mm0, (%esp) - movl (%esp), %eax - movl 4(%esp), %edx - addl $12, %esp - ret - -The extra stack traffic is covered in the previous entry. But the other reason -is we are not smart about materializing constants in MMX registers. With -m64 - - movl $1, %eax - movd %eax, %mm0 - movd %mm0, %rax - ret - -We should be using a constantpool load instead: - movq LC0(%rip), %rax diff --git a/contrib/llvm/lib/Target/X86/README-SSE.txt b/contrib/llvm/lib/Target/X86/README-SSE.txt deleted file mode 100644 index f96b22f1e204..000000000000 --- a/contrib/llvm/lib/Target/X86/README-SSE.txt +++ /dev/null @@ -1,907 +0,0 @@ -//===---------------------------------------------------------------------===// -// Random ideas for the X86 backend: SSE-specific stuff. -//===---------------------------------------------------------------------===// - -//===---------------------------------------------------------------------===// - -SSE Variable shift can be custom lowered to something like this, which uses a -small table + unaligned load + shuffle instead of going through memory. - -__m128i_shift_right: - .byte 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 - .byte -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - -... -__m128i shift_right(__m128i value, unsigned long offset) { - return _mm_shuffle_epi8(value, - _mm_loadu_si128((__m128 *) (___m128i_shift_right + offset))); -} - -//===---------------------------------------------------------------------===// - -SSE has instructions for doing operations on complex numbers, we should pattern -match them. Compiling this: - -_Complex float f32(_Complex float A, _Complex float B) { - return A+B; -} - -into: - -_f32: - movdqa %xmm0, %xmm2 - addss %xmm1, %xmm2 - pshufd $16, %xmm2, %xmm2 - pshufd $1, %xmm1, %xmm1 - pshufd $1, %xmm0, %xmm0 - addss %xmm1, %xmm0 - pshufd $16, %xmm0, %xmm1 - movdqa %xmm2, %xmm0 - unpcklps %xmm1, %xmm0 - ret - -seems silly. - - -//===---------------------------------------------------------------------===// - -Expand libm rounding functions inline: Significant speedups possible. -http://gcc.gnu.org/ml/gcc-patches/2006-10/msg00909.html - -//===---------------------------------------------------------------------===// - -When compiled with unsafemath enabled, "main" should enable SSE DAZ mode and -other fast SSE modes. - -//===---------------------------------------------------------------------===// - -Think about doing i64 math in SSE regs on x86-32. - -//===---------------------------------------------------------------------===// - -This testcase should have no SSE instructions in it, and only one load from -a constant pool: - -double %test3(bool %B) { - %C = select bool %B, double 123.412, double 523.01123123 - ret double %C -} - -Currently, the select is being lowered, which prevents the dag combiner from -turning 'select (load CPI1), (load CPI2)' -> 'load (select CPI1, CPI2)' - -The pattern isel got this one right. - -//===---------------------------------------------------------------------===// - -SSE should implement 'select_cc' using 'emulated conditional moves' that use -pcmp/pand/pandn/por to do a selection instead of a conditional branch: - -double %X(double %Y, double %Z, double %A, double %B) { - %C = setlt double %A, %B - %z = fadd double %Z, 0.0 ;; select operand is not a load - %D = select bool %C, double %Y, double %z - ret double %D -} - -We currently emit: - -_X: - subl $12, %esp - xorpd %xmm0, %xmm0 - addsd 24(%esp), %xmm0 - movsd 32(%esp), %xmm1 - movsd 16(%esp), %xmm2 - ucomisd 40(%esp), %xmm1 - jb LBB_X_2 -LBB_X_1: - movsd %xmm0, %xmm2 -LBB_X_2: - movsd %xmm2, (%esp) - fldl (%esp) - addl $12, %esp - ret - -//===---------------------------------------------------------------------===// - -Lower memcpy / memset to a series of SSE 128 bit move instructions when it's -feasible. - -//===---------------------------------------------------------------------===// - -Codegen: - if (copysign(1.0, x) == copysign(1.0, y)) -into: - if (x^y & mask) -when using SSE. - -//===---------------------------------------------------------------------===// - -Use movhps to update upper 64-bits of a v4sf value. Also movlps on lower half -of a v4sf value. - -//===---------------------------------------------------------------------===// - -Better codegen for vector_shuffles like this { x, 0, 0, 0 } or { x, 0, x, 0}. -Perhaps use pxor / xorp* to clear a XMM register first? - -//===---------------------------------------------------------------------===// - -External test Nurbs exposed some problems. Look for -__ZN15Nurbs_SSE_Cubic17TessellateSurfaceE, bb cond_next140. This is what icc -emits: - - movaps (%edx), %xmm2 #59.21 - movaps (%edx), %xmm5 #60.21 - movaps (%edx), %xmm4 #61.21 - movaps (%edx), %xmm3 #62.21 - movl 40(%ecx), %ebp #69.49 - shufps $0, %xmm2, %xmm5 #60.21 - movl 100(%esp), %ebx #69.20 - movl (%ebx), %edi #69.20 - imull %ebp, %edi #69.49 - addl (%eax), %edi #70.33 - shufps $85, %xmm2, %xmm4 #61.21 - shufps $170, %xmm2, %xmm3 #62.21 - shufps $255, %xmm2, %xmm2 #63.21 - lea (%ebp,%ebp,2), %ebx #69.49 - negl %ebx #69.49 - lea -3(%edi,%ebx), %ebx #70.33 - shll $4, %ebx #68.37 - addl 32(%ecx), %ebx #68.37 - testb $15, %bl #91.13 - jne L_B1.24 # Prob 5% #91.13 - -This is the llvm code after instruction scheduling: - -cond_next140 (0xa910740, LLVM BB @0xa90beb0): - %reg1078 = MOV32ri -3 - %reg1079 = ADD32rm %reg1078, %reg1068, 1, %NOREG, 0 - %reg1037 = MOV32rm %reg1024, 1, %NOREG, 40 - %reg1080 = IMUL32rr %reg1079, %reg1037 - %reg1081 = MOV32rm %reg1058, 1, %NOREG, 0 - %reg1038 = LEA32r %reg1081, 1, %reg1080, -3 - %reg1036 = MOV32rm %reg1024, 1, %NOREG, 32 - %reg1082 = SHL32ri %reg1038, 4 - %reg1039 = ADD32rr %reg1036, %reg1082 - %reg1083 = MOVAPSrm %reg1059, 1, %NOREG, 0 - %reg1034 = SHUFPSrr %reg1083, %reg1083, 170 - %reg1032 = SHUFPSrr %reg1083, %reg1083, 0 - %reg1035 = SHUFPSrr %reg1083, %reg1083, 255 - %reg1033 = SHUFPSrr %reg1083, %reg1083, 85 - %reg1040 = MOV32rr %reg1039 - %reg1084 = AND32ri8 %reg1039, 15 - CMP32ri8 %reg1084, 0 - JE mbb - -Still ok. After register allocation: - -cond_next140 (0xa910740, LLVM BB @0xa90beb0): - %EAX = MOV32ri -3 - %EDX = MOV32rm , 1, %NOREG, 0 - ADD32rm %EAX, %EDX, 1, %NOREG, 0 - %EDX = MOV32rm , 1, %NOREG, 0 - %EDX = MOV32rm %EDX, 1, %NOREG, 40 - IMUL32rr %EAX, %EDX - %ESI = MOV32rm , 1, %NOREG, 0 - %ESI = MOV32rm %ESI, 1, %NOREG, 0 - MOV32mr , 1, %NOREG, 0, %ESI - %EAX = LEA32r %ESI, 1, %EAX, -3 - %ESI = MOV32rm , 1, %NOREG, 0 - %ESI = MOV32rm %ESI, 1, %NOREG, 32 - %EDI = MOV32rr %EAX - SHL32ri %EDI, 4 - ADD32rr %EDI, %ESI - %XMM0 = MOVAPSrm %ECX, 1, %NOREG, 0 - %XMM1 = MOVAPSrr %XMM0 - SHUFPSrr %XMM1, %XMM1, 170 - %XMM2 = MOVAPSrr %XMM0 - SHUFPSrr %XMM2, %XMM2, 0 - %XMM3 = MOVAPSrr %XMM0 - SHUFPSrr %XMM3, %XMM3, 255 - SHUFPSrr %XMM0, %XMM0, 85 - %EBX = MOV32rr %EDI - AND32ri8 %EBX, 15 - CMP32ri8 %EBX, 0 - JE mbb - -This looks really bad. The problem is shufps is a destructive opcode. Since it -appears as operand two in more than one shufps ops. It resulted in a number of -copies. Note icc also suffers from the same problem. Either the instruction -selector should select pshufd or The register allocator can made the two-address -to three-address transformation. - -It also exposes some other problems. See MOV32ri -3 and the spills. - -//===---------------------------------------------------------------------===// - -Consider: - -__m128 test(float a) { - return _mm_set_ps(0.0, 0.0, 0.0, a*a); -} - -This compiles into: - -movss 4(%esp), %xmm1 -mulss %xmm1, %xmm1 -xorps %xmm0, %xmm0 -movss %xmm1, %xmm0 -ret - -Because mulss doesn't modify the top 3 elements, the top elements of -xmm1 are already zero'd. We could compile this to: - -movss 4(%esp), %xmm0 -mulss %xmm0, %xmm0 -ret - -//===---------------------------------------------------------------------===// - -Here's a sick and twisted idea. Consider code like this: - -__m128 test(__m128 a) { - float b = *(float*)&A; - ... - return _mm_set_ps(0.0, 0.0, 0.0, b); -} - -This might compile to this code: - -movaps c(%esp), %xmm1 -xorps %xmm0, %xmm0 -movss %xmm1, %xmm0 -ret - -Now consider if the ... code caused xmm1 to get spilled. This might produce -this code: - -movaps c(%esp), %xmm1 -movaps %xmm1, c2(%esp) -... - -xorps %xmm0, %xmm0 -movaps c2(%esp), %xmm1 -movss %xmm1, %xmm0 -ret - -However, since the reload is only used by these instructions, we could -"fold" it into the uses, producing something like this: - -movaps c(%esp), %xmm1 -movaps %xmm1, c2(%esp) -... - -movss c2(%esp), %xmm0 -ret - -... saving two instructions. - -The basic idea is that a reload from a spill slot, can, if only one 4-byte -chunk is used, bring in 3 zeros the one element instead of 4 elements. -This can be used to simplify a variety of shuffle operations, where the -elements are fixed zeros. - -//===---------------------------------------------------------------------===// - -This code generates ugly code, probably due to costs being off or something: - -define void @test(float* %P, <4 x float>* %P2 ) { - %xFloat0.688 = load float* %P - %tmp = load <4 x float>* %P2 - %inFloat3.713 = insertelement <4 x float> %tmp, float 0.0, i32 3 - store <4 x float> %inFloat3.713, <4 x float>* %P2 - ret void -} - -Generates: - -_test: - movl 8(%esp), %eax - movaps (%eax), %xmm0 - pxor %xmm1, %xmm1 - movaps %xmm0, %xmm2 - shufps $50, %xmm1, %xmm2 - shufps $132, %xmm2, %xmm0 - movaps %xmm0, (%eax) - ret - -Would it be better to generate: - -_test: - movl 8(%esp), %ecx - movaps (%ecx), %xmm0 - xor %eax, %eax - pinsrw $6, %eax, %xmm0 - pinsrw $7, %eax, %xmm0 - movaps %xmm0, (%ecx) - ret - -? - -//===---------------------------------------------------------------------===// - -Some useful information in the Apple Altivec / SSE Migration Guide: - -http://developer.apple.com/documentation/Performance/Conceptual/ -Accelerate_sse_migration/index.html - -e.g. SSE select using and, andnot, or. Various SSE compare translations. - -//===---------------------------------------------------------------------===// - -Add hooks to commute some CMPP operations. - -//===---------------------------------------------------------------------===// - -Apply the same transformation that merged four float into a single 128-bit load -to loads from constant pool. - -//===---------------------------------------------------------------------===// - -Floating point max / min are commutable when -enable-unsafe-fp-path is -specified. We should turn int_x86_sse_max_ss and X86ISD::FMIN etc. into other -nodes which are selected to max / min instructions that are marked commutable. - -//===---------------------------------------------------------------------===// - -We should materialize vector constants like "all ones" and "signbit" with -code like: - - cmpeqps xmm1, xmm1 ; xmm1 = all-ones - -and: - cmpeqps xmm1, xmm1 ; xmm1 = all-ones - psrlq xmm1, 31 ; xmm1 = all 100000000000... - -instead of using a load from the constant pool. The later is important for -ABS/NEG/copysign etc. - -//===---------------------------------------------------------------------===// - -These functions: - -#include -__m128i a; -void x(unsigned short n) { - a = _mm_slli_epi32 (a, n); -} -void y(unsigned n) { - a = _mm_slli_epi32 (a, n); -} - -compile to ( -O3 -static -fomit-frame-pointer): -_x: - movzwl 4(%esp), %eax - movd %eax, %xmm0 - movaps _a, %xmm1 - pslld %xmm0, %xmm1 - movaps %xmm1, _a - ret -_y: - movd 4(%esp), %xmm0 - movaps _a, %xmm1 - pslld %xmm0, %xmm1 - movaps %xmm1, _a - ret - -"y" looks good, but "x" does silly movzwl stuff around into a GPR. It seems -like movd would be sufficient in both cases as the value is already zero -extended in the 32-bit stack slot IIRC. For signed short, it should also be -save, as a really-signed value would be undefined for pslld. - - -//===---------------------------------------------------------------------===// - -#include -int t1(double d) { return signbit(d); } - -This currently compiles to: - subl $12, %esp - movsd 16(%esp), %xmm0 - movsd %xmm0, (%esp) - movl 4(%esp), %eax - shrl $31, %eax - addl $12, %esp - ret - -We should use movmskp{s|d} instead. - -//===---------------------------------------------------------------------===// - -CodeGen/X86/vec_align.ll tests whether we can turn 4 scalar loads into a single -(aligned) vector load. This functionality has a couple of problems. - -1. The code to infer alignment from loads of globals is in the X86 backend, - not the dag combiner. This is because dagcombine2 needs to be able to see - through the X86ISD::Wrapper node, which DAGCombine can't really do. -2. The code for turning 4 x load into a single vector load is target - independent and should be moved to the dag combiner. -3. The code for turning 4 x load into a vector load can only handle a direct - load from a global or a direct load from the stack. It should be generalized - to handle any load from P, P+4, P+8, P+12, where P can be anything. -4. The alignment inference code cannot handle loads from globals in non-static - mode because it doesn't look through the extra dyld stub load. If you try - vec_align.ll without -relocation-model=static, you'll see what I mean. - -//===---------------------------------------------------------------------===// - -We should lower store(fneg(load p), q) into an integer load+xor+store, which -eliminates a constant pool load. For example, consider: - -define i64 @ccosf(float %z.0, float %z.1) nounwind readonly { -entry: - %tmp6 = fsub float -0.000000e+00, %z.1 ; [#uses=1] - %tmp20 = tail call i64 @ccoshf( float %tmp6, float %z.0 ) nounwind readonly - ret i64 %tmp20 -} -declare i64 @ccoshf(float %z.0, float %z.1) nounwind readonly - -This currently compiles to: - -LCPI1_0: # <4 x float> - .long 2147483648 # float -0 - .long 2147483648 # float -0 - .long 2147483648 # float -0 - .long 2147483648 # float -0 -_ccosf: - subl $12, %esp - movss 16(%esp), %xmm0 - movss %xmm0, 4(%esp) - movss 20(%esp), %xmm0 - xorps LCPI1_0, %xmm0 - movss %xmm0, (%esp) - call L_ccoshf$stub - addl $12, %esp - ret - -Note the load into xmm0, then xor (to negate), then store. In PIC mode, -this code computes the pic base and does two loads to do the constant pool -load, so the improvement is much bigger. - -The tricky part about this xform is that the argument load/store isn't exposed -until post-legalize, and at that point, the fneg has been custom expanded into -an X86 fxor. This means that we need to handle this case in the x86 backend -instead of in target independent code. - -//===---------------------------------------------------------------------===// - -Non-SSE4 insert into 16 x i8 is atrociously bad. - -//===---------------------------------------------------------------------===// - -<2 x i64> extract is substantially worse than <2 x f64>, even if the destination -is memory. - -//===---------------------------------------------------------------------===// - -SSE4 extract-to-mem ops aren't being pattern matched because of the AssertZext -sitting between the truncate and the extract. - -//===---------------------------------------------------------------------===// - -INSERTPS can match any insert (extract, imm1), imm2 for 4 x float, and insert -any number of 0.0 simultaneously. Currently we only use it for simple -insertions. - -See comments in LowerINSERT_VECTOR_ELT_SSE4. - -//===---------------------------------------------------------------------===// - -On a random note, SSE2 should declare insert/extract of 2 x f64 as legal, not -Custom. All combinations of insert/extract reg-reg, reg-mem, and mem-reg are -legal, it'll just take a few extra patterns written in the .td file. - -Note: this is not a code quality issue; the custom lowered code happens to be -right, but we shouldn't have to custom lower anything. This is probably related -to <2 x i64> ops being so bad. - -//===---------------------------------------------------------------------===// - -'select' on vectors and scalars could be a whole lot better. We currently -lower them to conditional branches. On x86-64 for example, we compile this: - -double test(double a, double b, double c, double d) { return a - -typedef short vSInt16 __attribute__ ((__vector_size__ (16))); - -static const vSInt16 a = {- 22725, - 12873, - 22725, - 12873, - 22725, - 12873, -- 22725, - 12873};; - -vSInt16 madd(vSInt16 b) -{ - return _mm_madd_epi16(a, b); -} - -Generated code (x86-32, linux): -madd: - pushl %ebp - movl %esp, %ebp - andl $-16, %esp - movaps .LCPI1_0, %xmm1 - pmaddwd %xmm1, %xmm0 - movl %ebp, %esp - popl %ebp - ret - -//===---------------------------------------------------------------------===// - -Consider: -#include -__m128 foo2 (float x) { - return _mm_set_ps (0, 0, x, 0); -} - -In x86-32 mode, we generate this spiffy code: - -_foo2: - movss 4(%esp), %xmm0 - pshufd $81, %xmm0, %xmm0 - ret - -in x86-64 mode, we generate this code, which could be better: - -_foo2: - xorps %xmm1, %xmm1 - movss %xmm0, %xmm1 - pshufd $81, %xmm1, %xmm0 - ret - -In sse4 mode, we could use insertps to make both better. - -Here's another testcase that could use insertps [mem]: - -#include -extern float x2, x3; -__m128 foo1 (float x1, float x4) { - return _mm_set_ps (x2, x1, x3, x4); -} - -gcc mainline compiles it to: - -foo1: - insertps $0x10, x2(%rip), %xmm0 - insertps $0x10, x3(%rip), %xmm1 - movaps %xmm1, %xmm2 - movlhps %xmm0, %xmm2 - movaps %xmm2, %xmm0 - ret - -//===---------------------------------------------------------------------===// - -We compile vector multiply-by-constant into poor code: - -define <4 x i32> @f(<4 x i32> %i) nounwind { - %A = mul <4 x i32> %i, < i32 10, i32 10, i32 10, i32 10 > - ret <4 x i32> %A -} - -On targets without SSE4.1, this compiles into: - -LCPI1_0: ## <4 x i32> - .long 10 - .long 10 - .long 10 - .long 10 - .text - .align 4,0x90 - .globl _f -_f: - pshufd $3, %xmm0, %xmm1 - movd %xmm1, %eax - imull LCPI1_0+12, %eax - movd %eax, %xmm1 - pshufd $1, %xmm0, %xmm2 - movd %xmm2, %eax - imull LCPI1_0+4, %eax - movd %eax, %xmm2 - punpckldq %xmm1, %xmm2 - movd %xmm0, %eax - imull LCPI1_0, %eax - movd %eax, %xmm1 - movhlps %xmm0, %xmm0 - movd %xmm0, %eax - imull LCPI1_0+8, %eax - movd %eax, %xmm0 - punpckldq %xmm0, %xmm1 - movaps %xmm1, %xmm0 - punpckldq %xmm2, %xmm0 - ret - -It would be better to synthesize integer vector multiplication by constants -using shifts and adds, pslld and paddd here. And even on targets with SSE4.1, -simple cases such as multiplication by powers of two would be better as -vector shifts than as multiplications. - -//===---------------------------------------------------------------------===// - -We compile this: - -__m128i -foo2 (char x) -{ - return _mm_set_epi8 (1, 0, 0, 0, 0, 0, 0, 0, 0, x, 0, 1, 0, 0, 0, 0); -} - -into: - movl $1, %eax - xorps %xmm0, %xmm0 - pinsrw $2, %eax, %xmm0 - movzbl 4(%esp), %eax - pinsrw $3, %eax, %xmm0 - movl $256, %eax - pinsrw $7, %eax, %xmm0 - ret - - -gcc-4.2: - subl $12, %esp - movzbl 16(%esp), %eax - movdqa LC0, %xmm0 - pinsrw $3, %eax, %xmm0 - addl $12, %esp - ret - .const - .align 4 -LC0: - .word 0 - .word 0 - .word 1 - .word 0 - .word 0 - .word 0 - .word 0 - .word 256 - -With SSE4, it should be - movdqa .LC0(%rip), %xmm0 - pinsrb $6, %edi, %xmm0 - -//===---------------------------------------------------------------------===// - -We should transform a shuffle of two vectors of constants into a single vector -of constants. Also, insertelement of a constant into a vector of constants -should also result in a vector of constants. e.g. 2008-06-25-VecISelBug.ll. - -We compiled it to something horrible: - - .align 4 -LCPI1_1: ## float - .long 1065353216 ## float 1 - .const - - .align 4 -LCPI1_0: ## <4 x float> - .space 4 - .long 1065353216 ## float 1 - .space 4 - .long 1065353216 ## float 1 - .text - .align 4,0x90 - .globl _t -_t: - xorps %xmm0, %xmm0 - movhps LCPI1_0, %xmm0 - movss LCPI1_1, %xmm1 - movaps %xmm0, %xmm2 - shufps $2, %xmm1, %xmm2 - shufps $132, %xmm2, %xmm0 - movaps %xmm0, 0 - -//===---------------------------------------------------------------------===// -rdar://5907648 - -This function: - -float foo(unsigned char x) { - return x; -} - -compiles to (x86-32): - -define float @foo(i8 zeroext %x) nounwind { - %tmp12 = uitofp i8 %x to float ; [#uses=1] - ret float %tmp12 -} - -compiles to: - -_foo: - subl $4, %esp - movzbl 8(%esp), %eax - cvtsi2ss %eax, %xmm0 - movss %xmm0, (%esp) - flds (%esp) - addl $4, %esp - ret - -We should be able to use: - cvtsi2ss 8($esp), %xmm0 -since we know the stack slot is already zext'd. - -//===---------------------------------------------------------------------===// - -Consider using movlps instead of movsd to implement (scalar_to_vector (loadf64)) -when code size is critical. movlps is slower than movsd on core2 but it's one -byte shorter. - -//===---------------------------------------------------------------------===// - -We should use a dynamic programming based approach to tell when using FPStack -operations is cheaper than SSE. SciMark montecarlo contains code like this -for example: - -double MonteCarlo_num_flops(int Num_samples) { - return ((double) Num_samples)* 4.0; -} - -In fpstack mode, this compiles into: - -LCPI1_0: - .long 1082130432 ## float 4.000000e+00 -_MonteCarlo_num_flops: - subl $4, %esp - movl 8(%esp), %eax - movl %eax, (%esp) - fildl (%esp) - fmuls LCPI1_0 - addl $4, %esp - ret - -in SSE mode, it compiles into significantly slower code: - -_MonteCarlo_num_flops: - subl $12, %esp - cvtsi2sd 16(%esp), %xmm0 - mulsd LCPI1_0, %xmm0 - movsd %xmm0, (%esp) - fldl (%esp) - addl $12, %esp - ret - -There are also other cases in scimark where using fpstack is better, it is -cheaper to do fld1 than load from a constant pool for example, so -"load, add 1.0, store" is better done in the fp stack, etc. - -//===---------------------------------------------------------------------===// - -The X86 backend should be able to if-convert SSE comparisons like "ucomisd" to -"cmpsd". For example, this code: - -double d1(double x) { return x == x ? x : x + x; } - -Compiles into: - -_d1: - ucomisd %xmm0, %xmm0 - jnp LBB1_2 - addsd %xmm0, %xmm0 - ret -LBB1_2: - ret - -Also, the 'ret's should be shared. This is PR6032. - -//===---------------------------------------------------------------------===// - -These should compile into the same code (PR6214): Perhaps instcombine should -canonicalize the former into the later? - -define float @foo(float %x) nounwind { - %t = bitcast float %x to i32 - %s = and i32 %t, 2147483647 - %d = bitcast i32 %s to float - ret float %d -} - -declare float @fabsf(float %n) -define float @bar(float %x) nounwind { - %d = call float @fabsf(float %x) - ret float %d -} - -//===---------------------------------------------------------------------===// - -This IR (from PR6194): - -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" -target triple = "x86_64-apple-darwin10.0.0" - -%0 = type { double, double } -%struct.float3 = type { float, float, float } - -define void @test(%0, %struct.float3* nocapture %res) nounwind noinline ssp { -entry: - %tmp18 = extractvalue %0 %0, 0 ; [#uses=1] - %tmp19 = bitcast double %tmp18 to i64 ; [#uses=1] - %tmp20 = zext i64 %tmp19 to i128 ; [#uses=1] - %tmp10 = lshr i128 %tmp20, 32 ; [#uses=1] - %tmp11 = trunc i128 %tmp10 to i32 ; [#uses=1] - %tmp12 = bitcast i32 %tmp11 to float ; [#uses=1] - %tmp5 = getelementptr inbounds %struct.float3* %res, i64 0, i32 1 ; [#uses=1] - store float %tmp12, float* %tmp5 - ret void -} - -Compiles to: - -_test: ## @test - movd %xmm0, %rax - shrq $32, %rax - movl %eax, 4(%rdi) - ret - -This would be better kept in the SSE unit by treating XMM0 as a 4xfloat and -doing a shuffle from v[1] to v[0] then a float store. - -//===---------------------------------------------------------------------===// - -On SSE4 machines, we compile this code: - -define <2 x float> @test2(<2 x float> %Q, <2 x float> %R, - <2 x float> *%P) nounwind { - %Z = fadd <2 x float> %Q, %R - - store <2 x float> %Z, <2 x float> *%P - ret <2 x float> %Z -} - -into: - -_test2: ## @test2 -## BB#0: - insertps $0, %xmm2, %xmm2 - insertps $16, %xmm3, %xmm2 - insertps $0, %xmm0, %xmm3 - insertps $16, %xmm1, %xmm3 - addps %xmm2, %xmm3 - movq %xmm3, (%rdi) - movaps %xmm3, %xmm0 - pshufd $1, %xmm3, %xmm1 - ## kill: XMM1 XMM1 - ret - -The insertps's of $0 are pointless complex copies. - -//===---------------------------------------------------------------------===// - - diff --git a/contrib/llvm/lib/Target/X86/README-UNIMPLEMENTED.txt b/contrib/llvm/lib/Target/X86/README-UNIMPLEMENTED.txt deleted file mode 100644 index c26c75ab951c..000000000000 --- a/contrib/llvm/lib/Target/X86/README-UNIMPLEMENTED.txt +++ /dev/null @@ -1,14 +0,0 @@ -//===---------------------------------------------------------------------===// -// Testcases that crash the X86 backend because they aren't implemented -//===---------------------------------------------------------------------===// - -These are cases we know the X86 backend doesn't handle. Patches are welcome -and appreciated, because no one has signed up to implemented these yet. -Implementing these would allow elimination of the corresponding intrinsics, -which would be great. - -1) vector shifts -2) vector comparisons -3) vector fp<->int conversions: PR2683, PR2684, PR2685, PR2686, PR2688 -4) bitcasts from vectors to scalars: PR2804 -5) llvm.atomic.cmp.swap.i128.p0i128: PR3462 diff --git a/contrib/llvm/lib/Target/X86/README-X86-64.txt b/contrib/llvm/lib/Target/X86/README-X86-64.txt deleted file mode 100644 index 78c4dc00ee72..000000000000 --- a/contrib/llvm/lib/Target/X86/README-X86-64.txt +++ /dev/null @@ -1,273 +0,0 @@ -//===- README_X86_64.txt - Notes for X86-64 code gen ----------------------===// - -AMD64 Optimization Manual 8.2 has some nice information about optimizing integer -multiplication by a constant. How much of it applies to Intel's X86-64 -implementation? There are definite trade-offs to consider: latency vs. register -pressure vs. code size. - -//===---------------------------------------------------------------------===// - -Are we better off using branches instead of cmove to implement FP to -unsigned i64? - -_conv: - ucomiss LC0(%rip), %xmm0 - cvttss2siq %xmm0, %rdx - jb L3 - subss LC0(%rip), %xmm0 - movabsq $-9223372036854775808, %rax - cvttss2siq %xmm0, %rdx - xorq %rax, %rdx -L3: - movq %rdx, %rax - ret - -instead of - -_conv: - movss LCPI1_0(%rip), %xmm1 - cvttss2siq %xmm0, %rcx - movaps %xmm0, %xmm2 - subss %xmm1, %xmm2 - cvttss2siq %xmm2, %rax - movabsq $-9223372036854775808, %rdx - xorq %rdx, %rax - ucomiss %xmm1, %xmm0 - cmovb %rcx, %rax - ret - -Seems like the jb branch has high likelyhood of being taken. It would have -saved a few instructions. - -//===---------------------------------------------------------------------===// - -Poor codegen: - -int X[2]; -int b; -void test(void) { - memset(X, b, 2*sizeof(X[0])); -} - -llc: - movq _b@GOTPCREL(%rip), %rax - movzbq (%rax), %rax - movq %rax, %rcx - shlq $8, %rcx - orq %rax, %rcx - movq %rcx, %rax - shlq $16, %rax - orq %rcx, %rax - movq %rax, %rcx - shlq $32, %rcx - movq _X@GOTPCREL(%rip), %rdx - orq %rax, %rcx - movq %rcx, (%rdx) - ret - -gcc: - movq _b@GOTPCREL(%rip), %rax - movabsq $72340172838076673, %rdx - movzbq (%rax), %rax - imulq %rdx, %rax - movq _X@GOTPCREL(%rip), %rdx - movq %rax, (%rdx) - ret - -And the codegen is even worse for the following -(from http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33103): - void fill1(char *s, int a) - { - __builtin_memset(s, a, 15); - } - -For this version, we duplicate the computation of the constant to store. - -//===---------------------------------------------------------------------===// - -It's not possible to reference AH, BH, CH, and DH registers in an instruction -requiring REX prefix. However, divb and mulb both produce results in AH. If isel -emits a CopyFromReg which gets turned into a movb and that can be allocated a -r8b - r15b. - -To get around this, isel emits a CopyFromReg from AX and then right shift it -down by 8 and truncate it. It's not pretty but it works. We need some register -allocation magic to make the hack go away (e.g. putting additional constraints -on the result of the movb). - -//===---------------------------------------------------------------------===// - -The x86-64 ABI for hidden-argument struct returns requires that the -incoming value of %rdi be copied into %rax by the callee upon return. - -The idea is that it saves callers from having to remember this value, -which would often require a callee-saved register. Callees usually -need to keep this value live for most of their body anyway, so it -doesn't add a significant burden on them. - -We currently implement this in codegen, however this is suboptimal -because it means that it would be quite awkward to implement the -optimization for callers. - -A better implementation would be to relax the LLVM IR rules for sret -arguments to allow a function with an sret argument to have a non-void -return type, and to have the front-end to set up the sret argument value -as the return value of the function. The front-end could more easily -emit uses of the returned struct value to be in terms of the function's -lowered return value, and it would free non-C frontends from a -complication only required by a C-based ABI. - -//===---------------------------------------------------------------------===// - -We get a redundant zero extension for code like this: - -int mask[1000]; -int foo(unsigned x) { - if (x < 10) - x = x * 45; - else - x = x * 78; - return mask[x]; -} - -_foo: -LBB1_0: ## entry - cmpl $9, %edi - jbe LBB1_3 ## bb -LBB1_1: ## bb1 - imull $78, %edi, %eax -LBB1_2: ## bb2 - movl %eax, %eax <---- - movq _mask@GOTPCREL(%rip), %rcx - movl (%rcx,%rax,4), %eax - ret -LBB1_3: ## bb - imull $45, %edi, %eax - jmp LBB1_2 ## bb2 - -Before regalloc, we have: - - %reg1025 = IMUL32rri8 %reg1024, 45, %EFLAGS - JMP mbb - Successors according to CFG: 0x203afb0 (#3) - -bb1: 0x203af60, LLVM BB @0x1e02310, ID#2: - Predecessors according to CFG: 0x203aec0 (#0) - %reg1026 = IMUL32rri8 %reg1024, 78, %EFLAGS - Successors according to CFG: 0x203afb0 (#3) - -bb2: 0x203afb0, LLVM BB @0x1e02340, ID#3: - Predecessors according to CFG: 0x203af10 (#1) 0x203af60 (#2) - %reg1027 = PHI %reg1025, mbb, - %reg1026, mbb - %reg1029 = MOVZX64rr32 %reg1027 - -so we'd have to know that IMUL32rri8 leaves the high word zero extended and to -be able to recognize the zero extend. This could also presumably be implemented -if we have whole-function selectiondags. - -//===---------------------------------------------------------------------===// - -Take the following C code -(from http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43640): - -struct u1 -{ - float x; - float y; -}; - -float foo(struct u1 u) -{ - return u.x + u.y; -} - -Optimizes to the following IR: -define float @foo(double %u.0) nounwind readnone { -entry: - %tmp8 = bitcast double %u.0 to i64 ; [#uses=2] - %tmp6 = trunc i64 %tmp8 to i32 ; [#uses=1] - %tmp7 = bitcast i32 %tmp6 to float ; [#uses=1] - %tmp2 = lshr i64 %tmp8, 32 ; [#uses=1] - %tmp3 = trunc i64 %tmp2 to i32 ; [#uses=1] - %tmp4 = bitcast i32 %tmp3 to float ; [#uses=1] - %0 = fadd float %tmp7, %tmp4 ; [#uses=1] - ret float %0 -} - -And current llvm-gcc/clang output: - movd %xmm0, %rax - movd %eax, %xmm1 - shrq $32, %rax - movd %eax, %xmm0 - addss %xmm1, %xmm0 - ret - -We really shouldn't move the floats to RAX, only to immediately move them -straight back to the XMM registers. - -There really isn't any good way to handle this purely in IR optimizers; it -could possibly be handled by changing the output of the fronted, though. It -would also be feasible to add a x86-specific DAGCombine to optimize the -bitcast+trunc+(lshr+)bitcast combination. - -//===---------------------------------------------------------------------===// - -Take the following code -(from http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34653): -extern unsigned long table[]; -unsigned long foo(unsigned char *p) { - unsigned long tag = *p; - return table[tag >> 4] + table[tag & 0xf]; -} - -Current code generated: - movzbl (%rdi), %eax - movq %rax, %rcx - andq $240, %rcx - shrq %rcx - andq $15, %rax - movq table(,%rax,8), %rax - addq table(%rcx), %rax - ret - -Issues: -1. First movq should be movl; saves a byte. -2. Both andq's should be andl; saves another two bytes. I think this was - implemented at one point, but subsequently regressed. -3. shrq should be shrl; saves another byte. -4. The first andq can be completely eliminated by using a slightly more - expensive addressing mode. - -//===---------------------------------------------------------------------===// - -Consider the following (contrived testcase, but contains common factors): - -#include -int test(int x, ...) { - int sum, i; - va_list l; - va_start(l, x); - for (i = 0; i < x; i++) - sum += va_arg(l, int); - va_end(l); - return sum; -} - -Testcase given in C because fixing it will likely involve changing the IR -generated for it. The primary issue with the result is that it doesn't do any -of the optimizations which are possible if we know the address of a va_list -in the current function is never taken: -1. We shouldn't spill the XMM registers because we only call va_arg with "int". -2. It would be nice if we could scalarrepl the va_list. -3. Probably overkill, but it'd be cool if we could peel off the first five -iterations of the loop. - -Other optimizations involving functions which use va_arg on floats which don't -have the address of a va_list taken: -1. Conversely to the above, we shouldn't spill general registers if we only - call va_arg on "double". -2. If we know nothing more than 64 bits wide is read from the XMM registers, - we can change the spilling code to reduce the amount of stack used by half. - -//===---------------------------------------------------------------------===// diff --git a/contrib/llvm/lib/Target/X86/README.txt b/contrib/llvm/lib/Target/X86/README.txt deleted file mode 100644 index a305ae6ec550..000000000000 --- a/contrib/llvm/lib/Target/X86/README.txt +++ /dev/null @@ -1,1962 +0,0 @@ -//===---------------------------------------------------------------------===// -// Random ideas for the X86 backend. -//===---------------------------------------------------------------------===// - -We should add support for the "movbe" instruction, which does a byte-swapping -copy (3-addr bswap + memory support?) This is available on Atom processors. - -//===---------------------------------------------------------------------===// - -CodeGen/X86/lea-3.ll:test3 should be a single LEA, not a shift/move. The X86 -backend knows how to three-addressify this shift, but it appears the register -allocator isn't even asking it to do so in this case. We should investigate -why this isn't happening, it could have significant impact on other important -cases for X86 as well. - -//===---------------------------------------------------------------------===// - -This should be one DIV/IDIV instruction, not a libcall: - -unsigned test(unsigned long long X, unsigned Y) { - return X/Y; -} - -This can be done trivially with a custom legalizer. What about overflow -though? http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14224 - -//===---------------------------------------------------------------------===// - -Improvements to the multiply -> shift/add algorithm: -http://gcc.gnu.org/ml/gcc-patches/2004-08/msg01590.html - -//===---------------------------------------------------------------------===// - -Improve code like this (occurs fairly frequently, e.g. in LLVM): -long long foo(int x) { return 1LL << x; } - -http://gcc.gnu.org/ml/gcc-patches/2004-09/msg01109.html -http://gcc.gnu.org/ml/gcc-patches/2004-09/msg01128.html -http://gcc.gnu.org/ml/gcc-patches/2004-09/msg01136.html - -Another useful one would be ~0ULL >> X and ~0ULL << X. - -One better solution for 1LL << x is: - xorl %eax, %eax - xorl %edx, %edx - testb $32, %cl - sete %al - setne %dl - sall %cl, %eax - sall %cl, %edx - -But that requires good 8-bit subreg support. - -Also, this might be better. It's an extra shift, but it's one instruction -shorter, and doesn't stress 8-bit subreg support. -(From http://gcc.gnu.org/ml/gcc-patches/2004-09/msg01148.html, -but without the unnecessary and.) - movl %ecx, %eax - shrl $5, %eax - movl %eax, %edx - xorl $1, %edx - sall %cl, %eax - sall %cl. %edx - -64-bit shifts (in general) expand to really bad code. Instead of using -cmovs, we should expand to a conditional branch like GCC produces. - -//===---------------------------------------------------------------------===// - -Compile this: -_Bool f(_Bool a) { return a!=1; } - -into: - movzbl %dil, %eax - xorl $1, %eax - ret - -(Although note that this isn't a legal way to express the code that llvm-gcc -currently generates for that function.) - -//===---------------------------------------------------------------------===// - -Some isel ideas: - -1. Dynamic programming based approach when compile time if not an - issue. -2. Code duplication (addressing mode) during isel. -3. Other ideas from "Register-Sensitive Selection, Duplication, and - Sequencing of Instructions". -4. Scheduling for reduced register pressure. E.g. "Minimum Register - Instruction Sequence Problem: Revisiting Optimal Code Generation for DAGs" - and other related papers. - http://citeseer.ist.psu.edu/govindarajan01minimum.html - -//===---------------------------------------------------------------------===// - -Should we promote i16 to i32 to avoid partial register update stalls? - -//===---------------------------------------------------------------------===// - -Leave any_extend as pseudo instruction and hint to register -allocator. Delay codegen until post register allocation. -Note. any_extend is now turned into an INSERT_SUBREG. We still need to teach -the coalescer how to deal with it though. - -//===---------------------------------------------------------------------===// - -It appears icc use push for parameter passing. Need to investigate. - -//===---------------------------------------------------------------------===// - -Only use inc/neg/not instructions on processors where they are faster than -add/sub/xor. They are slower on the P4 due to only updating some processor -flags. - -//===---------------------------------------------------------------------===// - -The instruction selector sometimes misses folding a load into a compare. The -pattern is written as (cmp reg, (load p)). Because the compare isn't -commutative, it is not matched with the load on both sides. The dag combiner -should be made smart enough to cannonicalize the load into the RHS of a compare -when it can invert the result of the compare for free. - -//===---------------------------------------------------------------------===// - -In many cases, LLVM generates code like this: - -_test: - movl 8(%esp), %eax - cmpl %eax, 4(%esp) - setl %al - movzbl %al, %eax - ret - -on some processors (which ones?), it is more efficient to do this: - -_test: - movl 8(%esp), %ebx - xor %eax, %eax - cmpl %ebx, 4(%esp) - setl %al - ret - -Doing this correctly is tricky though, as the xor clobbers the flags. - -//===---------------------------------------------------------------------===// - -We should generate bts/btr/etc instructions on targets where they are cheap or -when codesize is important. e.g., for: - -void setbit(int *target, int bit) { - *target |= (1 << bit); -} -void clearbit(int *target, int bit) { - *target &= ~(1 << bit); -} - -//===---------------------------------------------------------------------===// - -Instead of the following for memset char*, 1, 10: - - movl $16843009, 4(%edx) - movl $16843009, (%edx) - movw $257, 8(%edx) - -It might be better to generate - - movl $16843009, %eax - movl %eax, 4(%edx) - movl %eax, (%edx) - movw al, 8(%edx) - -when we can spare a register. It reduces code size. - -//===---------------------------------------------------------------------===// - -Evaluate what the best way to codegen sdiv X, (2^C) is. For X/8, we currently -get this: - -define i32 @test1(i32 %X) { - %Y = sdiv i32 %X, 8 - ret i32 %Y -} - -_test1: - movl 4(%esp), %eax - movl %eax, %ecx - sarl $31, %ecx - shrl $29, %ecx - addl %ecx, %eax - sarl $3, %eax - ret - -GCC knows several different ways to codegen it, one of which is this: - -_test1: - movl 4(%esp), %eax - cmpl $-1, %eax - leal 7(%eax), %ecx - cmovle %ecx, %eax - sarl $3, %eax - ret - -which is probably slower, but it's interesting at least :) - -//===---------------------------------------------------------------------===// - -We are currently lowering large (1MB+) memmove/memcpy to rep/stosl and rep/movsl -We should leave these as libcalls for everything over a much lower threshold, -since libc is hand tuned for medium and large mem ops (avoiding RFO for large -stores, TLB preheating, etc) - -//===---------------------------------------------------------------------===// - -Optimize this into something reasonable: - x * copysign(1.0, y) * copysign(1.0, z) - -//===---------------------------------------------------------------------===// - -Optimize copysign(x, *y) to use an integer load from y. - -//===---------------------------------------------------------------------===// - -The following tests perform worse with LSR: - -lambda, siod, optimizer-eval, ackermann, hash2, nestedloop, strcat, and Treesor. - -//===---------------------------------------------------------------------===// - -Adding to the list of cmp / test poor codegen issues: - -int test(__m128 *A, __m128 *B) { - if (_mm_comige_ss(*A, *B)) - return 3; - else - return 4; -} - -_test: - movl 8(%esp), %eax - movaps (%eax), %xmm0 - movl 4(%esp), %eax - movaps (%eax), %xmm1 - comiss %xmm0, %xmm1 - setae %al - movzbl %al, %ecx - movl $3, %eax - movl $4, %edx - cmpl $0, %ecx - cmove %edx, %eax - ret - -Note the setae, movzbl, cmpl, cmove can be replaced with a single cmovae. There -are a number of issues. 1) We are introducing a setcc between the result of the -intrisic call and select. 2) The intrinsic is expected to produce a i32 value -so a any extend (which becomes a zero extend) is added. - -We probably need some kind of target DAG combine hook to fix this. - -//===---------------------------------------------------------------------===// - -We generate significantly worse code for this than GCC: -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21150 -http://gcc.gnu.org/bugzilla/attachment.cgi?id=8701 - -There is also one case we do worse on PPC. - -//===---------------------------------------------------------------------===// - -For this: - -int test(int a) -{ - return a * 3; -} - -We currently emits - imull $3, 4(%esp), %eax - -Perhaps this is what we really should generate is? Is imull three or four -cycles? Note: ICC generates this: - movl 4(%esp), %eax - leal (%eax,%eax,2), %eax - -The current instruction priority is based on pattern complexity. The former is -more "complex" because it folds a load so the latter will not be emitted. - -Perhaps we should use AddedComplexity to give LEA32r a higher priority? We -should always try to match LEA first since the LEA matching code does some -estimate to determine whether the match is profitable. - -However, if we care more about code size, then imull is better. It's two bytes -shorter than movl + leal. - -On a Pentium M, both variants have the same characteristics with regard -to throughput; however, the multiplication has a latency of four cycles, as -opposed to two cycles for the movl+lea variant. - -//===---------------------------------------------------------------------===// - -__builtin_ffs codegen is messy. - -int ffs_(unsigned X) { return __builtin_ffs(X); } - -llvm produces: -ffs_: - movl 4(%esp), %ecx - bsfl %ecx, %eax - movl $32, %edx - cmove %edx, %eax - incl %eax - xorl %edx, %edx - testl %ecx, %ecx - cmove %edx, %eax - ret - -vs gcc: - -_ffs_: - movl $-1, %edx - bsfl 4(%esp), %eax - cmove %edx, %eax - addl $1, %eax - ret - -Another example of __builtin_ffs (use predsimplify to eliminate a select): - -int foo (unsigned long j) { - if (j) - return __builtin_ffs (j) - 1; - else - return 0; -} - -//===---------------------------------------------------------------------===// - -It appears gcc place string data with linkonce linkage in -.section __TEXT,__const_coal,coalesced instead of -.section __DATA,__const_coal,coalesced. -Take a look at darwin.h, there are other Darwin assembler directives that we -do not make use of. - -//===---------------------------------------------------------------------===// - -define i32 @foo(i32* %a, i32 %t) { -entry: - br label %cond_true - -cond_true: ; preds = %cond_true, %entry - %x.0.0 = phi i32 [ 0, %entry ], [ %tmp9, %cond_true ] ; [#uses=3] - %t_addr.0.0 = phi i32 [ %t, %entry ], [ %tmp7, %cond_true ] ; [#uses=1] - %tmp2 = getelementptr i32* %a, i32 %x.0.0 ; [#uses=1] - %tmp3 = load i32* %tmp2 ; [#uses=1] - %tmp5 = add i32 %t_addr.0.0, %x.0.0 ; [#uses=1] - %tmp7 = add i32 %tmp5, %tmp3 ; [#uses=2] - %tmp9 = add i32 %x.0.0, 1 ; [#uses=2] - %tmp = icmp sgt i32 %tmp9, 39 ; [#uses=1] - br i1 %tmp, label %bb12, label %cond_true - -bb12: ; preds = %cond_true - ret i32 %tmp7 -} -is pessimized by -loop-reduce and -indvars - -//===---------------------------------------------------------------------===// - -u32 to float conversion improvement: - -float uint32_2_float( unsigned u ) { - float fl = (int) (u & 0xffff); - float fh = (int) (u >> 16); - fh *= 0x1.0p16f; - return fh + fl; -} - -00000000 subl $0x04,%esp -00000003 movl 0x08(%esp,1),%eax -00000007 movl %eax,%ecx -00000009 shrl $0x10,%ecx -0000000c cvtsi2ss %ecx,%xmm0 -00000010 andl $0x0000ffff,%eax -00000015 cvtsi2ss %eax,%xmm1 -00000019 mulss 0x00000078,%xmm0 -00000021 addss %xmm1,%xmm0 -00000025 movss %xmm0,(%esp,1) -0000002a flds (%esp,1) -0000002d addl $0x04,%esp -00000030 ret - -//===---------------------------------------------------------------------===// - -When using fastcc abi, align stack slot of argument of type double on 8 byte -boundary to improve performance. - -//===---------------------------------------------------------------------===// - -Codegen: - -int f(int a, int b) { - if (a == 4 || a == 6) - b++; - return b; -} - - -as: - -or eax, 2 -cmp eax, 6 -jz label - -//===---------------------------------------------------------------------===// - -GCC's ix86_expand_int_movcc function (in i386.c) has a ton of interesting -simplifications for integer "x cmp y ? a : b". For example, instead of: - -int G; -void f(int X, int Y) { - G = X < 0 ? 14 : 13; -} - -compiling to: - -_f: - movl $14, %eax - movl $13, %ecx - movl 4(%esp), %edx - testl %edx, %edx - cmovl %eax, %ecx - movl %ecx, _G - ret - -it could be: -_f: - movl 4(%esp), %eax - sarl $31, %eax - notl %eax - addl $14, %eax - movl %eax, _G - ret - -etc. - -Another is: -int usesbb(unsigned int a, unsigned int b) { - return (a < b ? -1 : 0); -} -to: -_usesbb: - movl 8(%esp), %eax - cmpl %eax, 4(%esp) - sbbl %eax, %eax - ret - -instead of: -_usesbb: - xorl %eax, %eax - movl 8(%esp), %ecx - cmpl %ecx, 4(%esp) - movl $4294967295, %ecx - cmovb %ecx, %eax - ret - -//===---------------------------------------------------------------------===// - -Consider the expansion of: - -define i32 @test3(i32 %X) { - %tmp1 = urem i32 %X, 255 - ret i32 %tmp1 -} - -Currently it compiles to: - -... - movl $2155905153, %ecx - movl 8(%esp), %esi - movl %esi, %eax - mull %ecx -... - -This could be "reassociated" into: - - movl $2155905153, %eax - movl 8(%esp), %ecx - mull %ecx - -to avoid the copy. In fact, the existing two-address stuff would do this -except that mul isn't a commutative 2-addr instruction. I guess this has -to be done at isel time based on the #uses to mul? - -//===---------------------------------------------------------------------===// - -Make sure the instruction which starts a loop does not cross a cacheline -boundary. This requires knowning the exact length of each machine instruction. -That is somewhat complicated, but doable. Example 256.bzip2: - -In the new trace, the hot loop has an instruction which crosses a cacheline -boundary. In addition to potential cache misses, this can't help decoding as I -imagine there has to be some kind of complicated decoder reset and realignment -to grab the bytes from the next cacheline. - -532 532 0x3cfc movb (1809(%esp, %esi), %bl <<<--- spans 2 64 byte lines -942 942 0x3d03 movl %dh, (1809(%esp, %esi) -937 937 0x3d0a incl %esi -3 3 0x3d0b cmpb %bl, %dl -27 27 0x3d0d jnz 0x000062db - -//===---------------------------------------------------------------------===// - -In c99 mode, the preprocessor doesn't like assembly comments like #TRUNCATE. - -//===---------------------------------------------------------------------===// - -This could be a single 16-bit load. - -int f(char *p) { - if ((p[0] == 1) & (p[1] == 2)) return 1; - return 0; -} - -//===---------------------------------------------------------------------===// - -We should inline lrintf and probably other libc functions. - -//===---------------------------------------------------------------------===// - -Use the FLAGS values from arithmetic instructions more. For example, compile: - -int add_zf(int *x, int y, int a, int b) { - if ((*x += y) == 0) - return a; - else - return b; -} - -to: - addl %esi, (%rdi) - movl %edx, %eax - cmovne %ecx, %eax - ret -instead of: - -_add_zf: - addl (%rdi), %esi - movl %esi, (%rdi) - testl %esi, %esi - cmove %edx, %ecx - movl %ecx, %eax - ret - -As another example, compile function f2 in test/CodeGen/X86/cmp-test.ll -without a test instruction. - -//===---------------------------------------------------------------------===// - -These two functions have identical effects: - -unsigned int f(unsigned int i, unsigned int n) {++i; if (i == n) ++i; return i;} -unsigned int f2(unsigned int i, unsigned int n) {++i; i += i == n; return i;} - -We currently compile them to: - -_f: - movl 4(%esp), %eax - movl %eax, %ecx - incl %ecx - movl 8(%esp), %edx - cmpl %edx, %ecx - jne LBB1_2 #UnifiedReturnBlock -LBB1_1: #cond_true - addl $2, %eax - ret -LBB1_2: #UnifiedReturnBlock - movl %ecx, %eax - ret -_f2: - movl 4(%esp), %eax - movl %eax, %ecx - incl %ecx - cmpl 8(%esp), %ecx - sete %cl - movzbl %cl, %ecx - leal 1(%ecx,%eax), %eax - ret - -both of which are inferior to GCC's: - -_f: - movl 4(%esp), %edx - leal 1(%edx), %eax - addl $2, %edx - cmpl 8(%esp), %eax - cmove %edx, %eax - ret -_f2: - movl 4(%esp), %eax - addl $1, %eax - xorl %edx, %edx - cmpl 8(%esp), %eax - sete %dl - addl %edx, %eax - ret - -//===---------------------------------------------------------------------===// - -This code: - -void test(int X) { - if (X) abort(); -} - -is currently compiled to: - -_test: - subl $12, %esp - cmpl $0, 16(%esp) - jne LBB1_1 - addl $12, %esp - ret -LBB1_1: - call L_abort$stub - -It would be better to produce: - -_test: - subl $12, %esp - cmpl $0, 16(%esp) - jne L_abort$stub - addl $12, %esp - ret - -This can be applied to any no-return function call that takes no arguments etc. -Alternatively, the stack save/restore logic could be shrink-wrapped, producing -something like this: - -_test: - cmpl $0, 4(%esp) - jne LBB1_1 - ret -LBB1_1: - subl $12, %esp - call L_abort$stub - -Both are useful in different situations. Finally, it could be shrink-wrapped -and tail called, like this: - -_test: - cmpl $0, 4(%esp) - jne LBB1_1 - ret -LBB1_1: - pop %eax # realign stack. - call L_abort$stub - -Though this probably isn't worth it. - -//===---------------------------------------------------------------------===// - -Sometimes it is better to codegen subtractions from a constant (e.g. 7-x) with -a neg instead of a sub instruction. Consider: - -int test(char X) { return 7-X; } - -we currently produce: -_test: - movl $7, %eax - movsbl 4(%esp), %ecx - subl %ecx, %eax - ret - -We would use one fewer register if codegen'd as: - - movsbl 4(%esp), %eax - neg %eax - add $7, %eax - ret - -Note that this isn't beneficial if the load can be folded into the sub. In -this case, we want a sub: - -int test(int X) { return 7-X; } -_test: - movl $7, %eax - subl 4(%esp), %eax - ret - -//===---------------------------------------------------------------------===// - -Leaf functions that require one 4-byte spill slot have a prolog like this: - -_foo: - pushl %esi - subl $4, %esp -... -and an epilog like this: - addl $4, %esp - popl %esi - ret - -It would be smaller, and potentially faster, to push eax on entry and to -pop into a dummy register instead of using addl/subl of esp. Just don't pop -into any return registers :) - -//===---------------------------------------------------------------------===// - -The X86 backend should fold (branch (or (setcc, setcc))) into multiple -branches. We generate really poor code for: - -double testf(double a) { - return a == 0.0 ? 0.0 : (a > 0.0 ? 1.0 : -1.0); -} - -For example, the entry BB is: - -_testf: - subl $20, %esp - pxor %xmm0, %xmm0 - movsd 24(%esp), %xmm1 - ucomisd %xmm0, %xmm1 - setnp %al - sete %cl - testb %cl, %al - jne LBB1_5 # UnifiedReturnBlock -LBB1_1: # cond_true - - -it would be better to replace the last four instructions with: - - jp LBB1_1 - je LBB1_5 -LBB1_1: - -We also codegen the inner ?: into a diamond: - - cvtss2sd LCPI1_0(%rip), %xmm2 - cvtss2sd LCPI1_1(%rip), %xmm3 - ucomisd %xmm1, %xmm0 - ja LBB1_3 # cond_true -LBB1_2: # cond_true - movapd %xmm3, %xmm2 -LBB1_3: # cond_true - movapd %xmm2, %xmm0 - ret - -We should sink the load into xmm3 into the LBB1_2 block. This should -be pretty easy, and will nuke all the copies. - -//===---------------------------------------------------------------------===// - -This: - #include - inline std::pair full_add(unsigned a, unsigned b) - { return std::make_pair(a + b, a + b < a); } - bool no_overflow(unsigned a, unsigned b) - { return !full_add(a, b).second; } - -Should compile to: - - - _Z11no_overflowjj: - addl %edi, %esi - setae %al - ret - -FIXME: That code looks wrong; bool return is normally defined as zext. - -on x86-64, not: - -__Z11no_overflowjj: - addl %edi, %esi - cmpl %edi, %esi - setae %al - movzbl %al, %eax - ret - - -//===---------------------------------------------------------------------===// - -The following code: - -bb114.preheader: ; preds = %cond_next94 - %tmp231232 = sext i16 %tmp62 to i32 ; [#uses=1] - %tmp233 = sub i32 32, %tmp231232 ; [#uses=1] - %tmp245246 = sext i16 %tmp65 to i32 ; [#uses=1] - %tmp252253 = sext i16 %tmp68 to i32 ; [#uses=1] - %tmp254 = sub i32 32, %tmp252253 ; [#uses=1] - %tmp553554 = bitcast i16* %tmp37 to i8* ; [#uses=2] - %tmp583584 = sext i16 %tmp98 to i32 ; [#uses=1] - %tmp585 = sub i32 32, %tmp583584 ; [#uses=1] - %tmp614615 = sext i16 %tmp101 to i32 ; [#uses=1] - %tmp621622 = sext i16 %tmp104 to i32 ; [#uses=1] - %tmp623 = sub i32 32, %tmp621622 ; [#uses=1] - br label %bb114 - -produces: - -LBB3_5: # bb114.preheader - movswl -68(%ebp), %eax - movl $32, %ecx - movl %ecx, -80(%ebp) - subl %eax, -80(%ebp) - movswl -52(%ebp), %eax - movl %ecx, -84(%ebp) - subl %eax, -84(%ebp) - movswl -70(%ebp), %eax - movl %ecx, -88(%ebp) - subl %eax, -88(%ebp) - movswl -50(%ebp), %eax - subl %eax, %ecx - movl %ecx, -76(%ebp) - movswl -42(%ebp), %eax - movl %eax, -92(%ebp) - movswl -66(%ebp), %eax - movl %eax, -96(%ebp) - movw $0, -98(%ebp) - -This appears to be bad because the RA is not folding the store to the stack -slot into the movl. The above instructions could be: - movl $32, -80(%ebp) -... - movl $32, -84(%ebp) -... -This seems like a cross between remat and spill folding. - -This has redundant subtractions of %eax from a stack slot. However, %ecx doesn't -change, so we could simply subtract %eax from %ecx first and then use %ecx (or -vice-versa). - -//===---------------------------------------------------------------------===// - -This code: - - %tmp659 = icmp slt i16 %tmp654, 0 ; [#uses=1] - br i1 %tmp659, label %cond_true662, label %cond_next715 - -produces this: - - testw %cx, %cx - movswl %cx, %esi - jns LBB4_109 # cond_next715 - -Shark tells us that using %cx in the testw instruction is sub-optimal. It -suggests using the 32-bit register (which is what ICC uses). - -//===---------------------------------------------------------------------===// - -We compile this: - -void compare (long long foo) { - if (foo < 4294967297LL) - abort(); -} - -to: - -compare: - subl $4, %esp - cmpl $0, 8(%esp) - setne %al - movzbw %al, %ax - cmpl $1, 12(%esp) - setg %cl - movzbw %cl, %cx - cmove %ax, %cx - testb $1, %cl - jne .LBB1_2 # UnifiedReturnBlock -.LBB1_1: # ifthen - call abort -.LBB1_2: # UnifiedReturnBlock - addl $4, %esp - ret - -(also really horrible code on ppc). This is due to the expand code for 64-bit -compares. GCC produces multiple branches, which is much nicer: - -compare: - subl $12, %esp - movl 20(%esp), %edx - movl 16(%esp), %eax - decl %edx - jle .L7 -.L5: - addl $12, %esp - ret - .p2align 4,,7 -.L7: - jl .L4 - cmpl $0, %eax - .p2align 4,,8 - ja .L5 -.L4: - .p2align 4,,9 - call abort - -//===---------------------------------------------------------------------===// - -Tail call optimization improvements: Tail call optimization currently -pushes all arguments on the top of the stack (their normal place for -non-tail call optimized calls) that source from the callers arguments -or that source from a virtual register (also possibly sourcing from -callers arguments). -This is done to prevent overwriting of parameters (see example -below) that might be used later. - -example: - -int callee(int32, int64); -int caller(int32 arg1, int32 arg2) { - int64 local = arg2 * 2; - return callee(arg2, (int64)local); -} - -[arg1] [!arg2 no longer valid since we moved local onto it] -[arg2] -> [(int64) -[RETADDR] local ] - -Moving arg1 onto the stack slot of callee function would overwrite -arg2 of the caller. - -Possible optimizations: - - - - Analyse the actual parameters of the callee to see which would - overwrite a caller parameter which is used by the callee and only - push them onto the top of the stack. - - int callee (int32 arg1, int32 arg2); - int caller (int32 arg1, int32 arg2) { - return callee(arg1,arg2); - } - - Here we don't need to write any variables to the top of the stack - since they don't overwrite each other. - - int callee (int32 arg1, int32 arg2); - int caller (int32 arg1, int32 arg2) { - return callee(arg2,arg1); - } - - Here we need to push the arguments because they overwrite each - other. - -//===---------------------------------------------------------------------===// - -main () -{ - int i = 0; - unsigned long int z = 0; - - do { - z -= 0x00004000; - i++; - if (i > 0x00040000) - abort (); - } while (z > 0); - exit (0); -} - -gcc compiles this to: - -_main: - subl $28, %esp - xorl %eax, %eax - jmp L2 -L3: - cmpl $262144, %eax - je L10 -L2: - addl $1, %eax - cmpl $262145, %eax - jne L3 - call L_abort$stub -L10: - movl $0, (%esp) - call L_exit$stub - -llvm: - -_main: - subl $12, %esp - movl $1, %eax - movl $16384, %ecx -LBB1_1: # bb - cmpl $262145, %eax - jge LBB1_4 # cond_true -LBB1_2: # cond_next - incl %eax - addl $4294950912, %ecx - cmpl $16384, %ecx - jne LBB1_1 # bb -LBB1_3: # bb11 - xorl %eax, %eax - addl $12, %esp - ret -LBB1_4: # cond_true - call L_abort$stub - -1. LSR should rewrite the first cmp with induction variable %ecx. -2. DAG combiner should fold - leal 1(%eax), %edx - cmpl $262145, %edx - => - cmpl $262144, %eax - -//===---------------------------------------------------------------------===// - -define i64 @test(double %X) { - %Y = fptosi double %X to i64 - ret i64 %Y -} - -compiles to: - -_test: - subl $20, %esp - movsd 24(%esp), %xmm0 - movsd %xmm0, 8(%esp) - fldl 8(%esp) - fisttpll (%esp) - movl 4(%esp), %edx - movl (%esp), %eax - addl $20, %esp - #FP_REG_KILL - ret - -This should just fldl directly from the input stack slot. - -//===---------------------------------------------------------------------===// - -This code: -int foo (int x) { return (x & 65535) | 255; } - -Should compile into: - -_foo: - movzwl 4(%esp), %eax - orl $255, %eax - ret - -instead of: -_foo: - movl $255, %eax - orl 4(%esp), %eax - andl $65535, %eax - ret - -//===---------------------------------------------------------------------===// - -We're codegen'ing multiply of long longs inefficiently: - -unsigned long long LLM(unsigned long long arg1, unsigned long long arg2) { - return arg1 * arg2; -} - -We compile to (fomit-frame-pointer): - -_LLM: - pushl %esi - movl 8(%esp), %ecx - movl 16(%esp), %esi - movl %esi, %eax - mull %ecx - imull 12(%esp), %esi - addl %edx, %esi - imull 20(%esp), %ecx - movl %esi, %edx - addl %ecx, %edx - popl %esi - ret - -This looks like a scheduling deficiency and lack of remat of the load from -the argument area. ICC apparently produces: - - movl 8(%esp), %ecx - imull 12(%esp), %ecx - movl 16(%esp), %eax - imull 4(%esp), %eax - addl %eax, %ecx - movl 4(%esp), %eax - mull 12(%esp) - addl %ecx, %edx - ret - -Note that it remat'd loads from 4(esp) and 12(esp). See this GCC PR: -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17236 - -//===---------------------------------------------------------------------===// - -We can fold a store into "zeroing a reg". Instead of: - -xorl %eax, %eax -movl %eax, 124(%esp) - -we should get: - -movl $0, 124(%esp) - -if the flags of the xor are dead. - -Likewise, we isel "x<<1" into "add reg,reg". If reg is spilled, this should -be folded into: shl [mem], 1 - -//===---------------------------------------------------------------------===// - -In SSE mode, we turn abs and neg into a load from the constant pool plus a xor -or and instruction, for example: - - xorpd LCPI1_0, %xmm2 - -However, if xmm2 gets spilled, we end up with really ugly code like this: - - movsd (%esp), %xmm0 - xorpd LCPI1_0, %xmm0 - movsd %xmm0, (%esp) - -Since we 'know' that this is a 'neg', we can actually "fold" the spill into -the neg/abs instruction, turning it into an *integer* operation, like this: - - xorl 2147483648, [mem+4] ## 2147483648 = (1 << 31) - -you could also use xorb, but xorl is less likely to lead to a partial register -stall. Here is a contrived testcase: - -double a, b, c; -void test(double *P) { - double X = *P; - a = X; - bar(); - X = -X; - b = X; - bar(); - c = X; -} - -//===---------------------------------------------------------------------===// - -The generated code on x86 for checking for signed overflow on a multiply the -obvious way is much longer than it needs to be. - -int x(int a, int b) { - long long prod = (long long)a*b; - return prod > 0x7FFFFFFF || prod < (-0x7FFFFFFF-1); -} - -See PR2053 for more details. - -//===---------------------------------------------------------------------===// - -We should investigate using cdq/ctld (effect: edx = sar eax, 31) -more aggressively; it should cost the same as a move+shift on any modern -processor, but it's a lot shorter. Downside is that it puts more -pressure on register allocation because it has fixed operands. - -Example: -int abs(int x) {return x < 0 ? -x : x;} - -gcc compiles this to the following when using march/mtune=pentium2/3/4/m/etc.: -abs: - movl 4(%esp), %eax - cltd - xorl %edx, %eax - subl %edx, %eax - ret - -//===---------------------------------------------------------------------===// - -Consider: -int test(unsigned long a, unsigned long b) { return -(a < b); } - -We currently compile this to: - -define i32 @test(i32 %a, i32 %b) nounwind { - %tmp3 = icmp ult i32 %a, %b ; [#uses=1] - %tmp34 = zext i1 %tmp3 to i32 ; [#uses=1] - %tmp5 = sub i32 0, %tmp34 ; [#uses=1] - ret i32 %tmp5 -} - -and - -_test: - movl 8(%esp), %eax - cmpl %eax, 4(%esp) - setb %al - movzbl %al, %eax - negl %eax - ret - -Several deficiencies here. First, we should instcombine zext+neg into sext: - -define i32 @test2(i32 %a, i32 %b) nounwind { - %tmp3 = icmp ult i32 %a, %b ; [#uses=1] - %tmp34 = sext i1 %tmp3 to i32 ; [#uses=1] - ret i32 %tmp34 -} - -However, before we can do that, we have to fix the bad codegen that we get for -sext from bool: - -_test2: - movl 8(%esp), %eax - cmpl %eax, 4(%esp) - setb %al - movzbl %al, %eax - shll $31, %eax - sarl $31, %eax - ret - -This code should be at least as good as the code above. Once this is fixed, we -can optimize this specific case even more to: - - movl 8(%esp), %eax - xorl %ecx, %ecx - cmpl %eax, 4(%esp) - sbbl %ecx, %ecx - -//===---------------------------------------------------------------------===// - -Take the following code (from -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16541): - -extern unsigned char first_one[65536]; -int FirstOnet(unsigned long long arg1) -{ - if (arg1 >> 48) - return (first_one[arg1 >> 48]); - return 0; -} - - -The following code is currently generated: -FirstOnet: - movl 8(%esp), %eax - cmpl $65536, %eax - movl 4(%esp), %ecx - jb .LBB1_2 # UnifiedReturnBlock -.LBB1_1: # ifthen - shrl $16, %eax - movzbl first_one(%eax), %eax - ret -.LBB1_2: # UnifiedReturnBlock - xorl %eax, %eax - ret - -We could change the "movl 8(%esp), %eax" into "movzwl 10(%esp), %eax"; this -lets us change the cmpl into a testl, which is shorter, and eliminate the shift. - -//===---------------------------------------------------------------------===// - -We compile this function: - -define i32 @foo(i32 %a, i32 %b, i32 %c, i8 zeroext %d) nounwind { -entry: - %tmp2 = icmp eq i8 %d, 0 ; [#uses=1] - br i1 %tmp2, label %bb7, label %bb - -bb: ; preds = %entry - %tmp6 = add i32 %b, %a ; [#uses=1] - ret i32 %tmp6 - -bb7: ; preds = %entry - %tmp10 = sub i32 %a, %c ; [#uses=1] - ret i32 %tmp10 -} - -to: - -foo: # @foo -# BB#0: # %entry - movl 4(%esp), %ecx - cmpb $0, 16(%esp) - je .LBB0_2 -# BB#1: # %bb - movl 8(%esp), %eax - addl %ecx, %eax - ret -.LBB0_2: # %bb7 - movl 12(%esp), %edx - movl %ecx, %eax - subl %edx, %eax - ret - -There's an obviously unnecessary movl in .LBB0_2, and we could eliminate a -couple more movls by putting 4(%esp) into %eax instead of %ecx. - -//===---------------------------------------------------------------------===// - -See rdar://4653682. - -From flops: - -LBB1_15: # bb310 - cvtss2sd LCPI1_0, %xmm1 - addsd %xmm1, %xmm0 - movsd 176(%esp), %xmm2 - mulsd %xmm0, %xmm2 - movapd %xmm2, %xmm3 - mulsd %xmm3, %xmm3 - movapd %xmm3, %xmm4 - mulsd LCPI1_23, %xmm4 - addsd LCPI1_24, %xmm4 - mulsd %xmm3, %xmm4 - addsd LCPI1_25, %xmm4 - mulsd %xmm3, %xmm4 - addsd LCPI1_26, %xmm4 - mulsd %xmm3, %xmm4 - addsd LCPI1_27, %xmm4 - mulsd %xmm3, %xmm4 - addsd LCPI1_28, %xmm4 - mulsd %xmm3, %xmm4 - addsd %xmm1, %xmm4 - mulsd %xmm2, %xmm4 - movsd 152(%esp), %xmm1 - addsd %xmm4, %xmm1 - movsd %xmm1, 152(%esp) - incl %eax - cmpl %eax, %esi - jge LBB1_15 # bb310 -LBB1_16: # bb358.loopexit - movsd 152(%esp), %xmm0 - addsd %xmm0, %xmm0 - addsd LCPI1_22, %xmm0 - movsd %xmm0, 152(%esp) - -Rather than spilling the result of the last addsd in the loop, we should have -insert a copy to split the interval (one for the duration of the loop, one -extending to the fall through). The register pressure in the loop isn't high -enough to warrant the spill. - -Also check why xmm7 is not used at all in the function. - -//===---------------------------------------------------------------------===// - -Take the following: - -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" -target triple = "i386-apple-darwin8" -@in_exit.4870.b = internal global i1 false ; [#uses=2] -define fastcc void @abort_gzip() noreturn nounwind { -entry: - %tmp.b.i = load i1* @in_exit.4870.b ; [#uses=1] - br i1 %tmp.b.i, label %bb.i, label %bb4.i -bb.i: ; preds = %entry - tail call void @exit( i32 1 ) noreturn nounwind - unreachable -bb4.i: ; preds = %entry - store i1 true, i1* @in_exit.4870.b - tail call void @exit( i32 1 ) noreturn nounwind - unreachable -} -declare void @exit(i32) noreturn nounwind - -This compiles into: -_abort_gzip: ## @abort_gzip -## BB#0: ## %entry - subl $12, %esp - movb _in_exit.4870.b, %al - cmpb $1, %al - jne LBB0_2 - -We somehow miss folding the movb into the cmpb. - -//===---------------------------------------------------------------------===// - -We compile: - -int test(int x, int y) { - return x-y-1; -} - -into (-m64): - -_test: - decl %edi - movl %edi, %eax - subl %esi, %eax - ret - -it would be better to codegen as: x+~y (notl+addl) - -//===---------------------------------------------------------------------===// - -This code: - -int foo(const char *str,...) -{ - __builtin_va_list a; int x; - __builtin_va_start(a,str); x = __builtin_va_arg(a,int); __builtin_va_end(a); - return x; -} - -gets compiled into this on x86-64: - subq $200, %rsp - movaps %xmm7, 160(%rsp) - movaps %xmm6, 144(%rsp) - movaps %xmm5, 128(%rsp) - movaps %xmm4, 112(%rsp) - movaps %xmm3, 96(%rsp) - movaps %xmm2, 80(%rsp) - movaps %xmm1, 64(%rsp) - movaps %xmm0, 48(%rsp) - movq %r9, 40(%rsp) - movq %r8, 32(%rsp) - movq %rcx, 24(%rsp) - movq %rdx, 16(%rsp) - movq %rsi, 8(%rsp) - leaq (%rsp), %rax - movq %rax, 192(%rsp) - leaq 208(%rsp), %rax - movq %rax, 184(%rsp) - movl $48, 180(%rsp) - movl $8, 176(%rsp) - movl 176(%rsp), %eax - cmpl $47, %eax - jbe .LBB1_3 # bb -.LBB1_1: # bb3 - movq 184(%rsp), %rcx - leaq 8(%rcx), %rax - movq %rax, 184(%rsp) -.LBB1_2: # bb4 - movl (%rcx), %eax - addq $200, %rsp - ret -.LBB1_3: # bb - movl %eax, %ecx - addl $8, %eax - addq 192(%rsp), %rcx - movl %eax, 176(%rsp) - jmp .LBB1_2 # bb4 - -gcc 4.3 generates: - subq $96, %rsp -.LCFI0: - leaq 104(%rsp), %rax - movq %rsi, -80(%rsp) - movl $8, -120(%rsp) - movq %rax, -112(%rsp) - leaq -88(%rsp), %rax - movq %rax, -104(%rsp) - movl $8, %eax - cmpl $48, %eax - jb .L6 - movq -112(%rsp), %rdx - movl (%rdx), %eax - addq $96, %rsp - ret - .p2align 4,,10 - .p2align 3 -.L6: - mov %eax, %edx - addq -104(%rsp), %rdx - addl $8, %eax - movl %eax, -120(%rsp) - movl (%rdx), %eax - addq $96, %rsp - ret - -and it gets compiled into this on x86: - pushl %ebp - movl %esp, %ebp - subl $4, %esp - leal 12(%ebp), %eax - movl %eax, -4(%ebp) - leal 16(%ebp), %eax - movl %eax, -4(%ebp) - movl 12(%ebp), %eax - addl $4, %esp - popl %ebp - ret - -gcc 4.3 generates: - pushl %ebp - movl %esp, %ebp - movl 12(%ebp), %eax - popl %ebp - ret - -//===---------------------------------------------------------------------===// - -Teach tblgen not to check bitconvert source type in some cases. This allows us -to consolidate the following patterns in X86InstrMMX.td: - -def : Pat<(v2i32 (bitconvert (i64 (vector_extract (v2i64 VR128:$src), - (iPTR 0))))), - (v2i32 (MMX_MOVDQ2Qrr VR128:$src))>; -def : Pat<(v4i16 (bitconvert (i64 (vector_extract (v2i64 VR128:$src), - (iPTR 0))))), - (v4i16 (MMX_MOVDQ2Qrr VR128:$src))>; -def : Pat<(v8i8 (bitconvert (i64 (vector_extract (v2i64 VR128:$src), - (iPTR 0))))), - (v8i8 (MMX_MOVDQ2Qrr VR128:$src))>; - -There are other cases in various td files. - -//===---------------------------------------------------------------------===// - -Take something like the following on x86-32: -unsigned a(unsigned long long x, unsigned y) {return x % y;} - -We currently generate a libcall, but we really shouldn't: the expansion is -shorter and likely faster than the libcall. The expected code is something -like the following: - - movl 12(%ebp), %eax - movl 16(%ebp), %ecx - xorl %edx, %edx - divl %ecx - movl 8(%ebp), %eax - divl %ecx - movl %edx, %eax - ret - -A similar code sequence works for division. - -//===---------------------------------------------------------------------===// - -These should compile to the same code, but the later codegen's to useless -instructions on X86. This may be a trivial dag combine (GCC PR7061): - -struct s1 { unsigned char a, b; }; -unsigned long f1(struct s1 x) { - return x.a + x.b; -} -struct s2 { unsigned a: 8, b: 8; }; -unsigned long f2(struct s2 x) { - return x.a + x.b; -} - -//===---------------------------------------------------------------------===// - -We currently compile this: - -define i32 @func1(i32 %v1, i32 %v2) nounwind { -entry: - %t = call {i32, i1} @llvm.sadd.with.overflow.i32(i32 %v1, i32 %v2) - %sum = extractvalue {i32, i1} %t, 0 - %obit = extractvalue {i32, i1} %t, 1 - br i1 %obit, label %overflow, label %normal -normal: - ret i32 %sum -overflow: - call void @llvm.trap() - unreachable -} -declare {i32, i1} @llvm.sadd.with.overflow.i32(i32, i32) -declare void @llvm.trap() - -to: - -_func1: - movl 4(%esp), %eax - addl 8(%esp), %eax - jo LBB1_2 ## overflow -LBB1_1: ## normal - ret -LBB1_2: ## overflow - ud2 - -it would be nice to produce "into" someday. - -//===---------------------------------------------------------------------===// - -This code: - -void vec_mpys1(int y[], const int x[], int scaler) { -int i; -for (i = 0; i < 150; i++) - y[i] += (((long long)scaler * (long long)x[i]) >> 31); -} - -Compiles to this loop with GCC 3.x: - -.L5: - movl %ebx, %eax - imull (%edi,%ecx,4) - shrdl $31, %edx, %eax - addl %eax, (%esi,%ecx,4) - incl %ecx - cmpl $149, %ecx - jle .L5 - -llvm-gcc compiles it to the much uglier: - -LBB1_1: ## bb1 - movl 24(%esp), %eax - movl (%eax,%edi,4), %ebx - movl %ebx, %ebp - imull %esi, %ebp - movl %ebx, %eax - mull %ecx - addl %ebp, %edx - sarl $31, %ebx - imull %ecx, %ebx - addl %edx, %ebx - shldl $1, %eax, %ebx - movl 20(%esp), %eax - addl %ebx, (%eax,%edi,4) - incl %edi - cmpl $150, %edi - jne LBB1_1 ## bb1 - -The issue is that we hoist the cast of "scaler" to long long outside of the -loop, the value comes into the loop as two values, and -RegsForValue::getCopyFromRegs doesn't know how to put an AssertSext on the -constructed BUILD_PAIR which represents the cast value. - -//===---------------------------------------------------------------------===// - -Test instructions can be eliminated by using EFLAGS values from arithmetic -instructions. This is currently not done for mul, and, or, xor, neg, shl, -sra, srl, shld, shrd, atomic ops, and others. It is also currently not done -for read-modify-write instructions. It is also current not done if the -OF or CF flags are needed. - -The shift operators have the complication that when the shift count is -zero, EFLAGS is not set, so they can only subsume a test instruction if -the shift count is known to be non-zero. Also, using the EFLAGS value -from a shift is apparently very slow on some x86 implementations. - -In read-modify-write instructions, the root node in the isel match is -the store, and isel has no way for the use of the EFLAGS result of the -arithmetic to be remapped to the new node. - -Add and subtract instructions set OF on signed overflow and CF on unsiged -overflow, while test instructions always clear OF and CF. In order to -replace a test with an add or subtract in a situation where OF or CF is -needed, codegen must be able to prove that the operation cannot see -signed or unsigned overflow, respectively. - -//===---------------------------------------------------------------------===// - -memcpy/memmove do not lower to SSE copies when possible. A silly example is: -define <16 x float> @foo(<16 x float> %A) nounwind { - %tmp = alloca <16 x float>, align 16 - %tmp2 = alloca <16 x float>, align 16 - store <16 x float> %A, <16 x float>* %tmp - %s = bitcast <16 x float>* %tmp to i8* - %s2 = bitcast <16 x float>* %tmp2 to i8* - call void @llvm.memcpy.i64(i8* %s, i8* %s2, i64 64, i32 16) - %R = load <16 x float>* %tmp2 - ret <16 x float> %R -} - -declare void @llvm.memcpy.i64(i8* nocapture, i8* nocapture, i64, i32) nounwind - -which compiles to: - -_foo: - subl $140, %esp - movaps %xmm3, 112(%esp) - movaps %xmm2, 96(%esp) - movaps %xmm1, 80(%esp) - movaps %xmm0, 64(%esp) - movl 60(%esp), %eax - movl %eax, 124(%esp) - movl 56(%esp), %eax - movl %eax, 120(%esp) - movl 52(%esp), %eax - - movaps (%esp), %xmm0 - movaps 16(%esp), %xmm1 - movaps 32(%esp), %xmm2 - movaps 48(%esp), %xmm3 - addl $140, %esp - ret - -On Nehalem, it may even be cheaper to just use movups when unaligned than to -fall back to lower-granularity chunks. - -//===---------------------------------------------------------------------===// - -Implement processor-specific optimizations for parity with GCC on these -processors. GCC does two optimizations: - -1. ix86_pad_returns inserts a noop before ret instructions if immediately - preceeded by a conditional branch or is the target of a jump. -2. ix86_avoid_jump_misspredicts inserts noops in cases where a 16-byte block of - code contains more than 3 branches. - -The first one is done for all AMDs, Core2, and "Generic" -The second one is done for: Atom, Pentium Pro, all AMDs, Pentium 4, Nocona, - Core 2, and "Generic" - -//===---------------------------------------------------------------------===// - -Testcase: -int a(int x) { return (x & 127) > 31; } - -Current output: - movl 4(%esp), %eax - andl $127, %eax - cmpl $31, %eax - seta %al - movzbl %al, %eax - ret - -Ideal output: - xorl %eax, %eax - testl $96, 4(%esp) - setne %al - ret - -This should definitely be done in instcombine, canonicalizing the range -condition into a != condition. We get this IR: - -define i32 @a(i32 %x) nounwind readnone { -entry: - %0 = and i32 %x, 127 ; [#uses=1] - %1 = icmp ugt i32 %0, 31 ; [#uses=1] - %2 = zext i1 %1 to i32 ; [#uses=1] - ret i32 %2 -} - -Instcombine prefers to strength reduce relational comparisons to equality -comparisons when possible, this should be another case of that. This could -be handled pretty easily in InstCombiner::visitICmpInstWithInstAndIntCst, but it -looks like InstCombiner::visitICmpInstWithInstAndIntCst should really already -be redesigned to use ComputeMaskedBits and friends. - - -//===---------------------------------------------------------------------===// -Testcase: -int x(int a) { return (a&0xf0)>>4; } - -Current output: - movl 4(%esp), %eax - shrl $4, %eax - andl $15, %eax - ret - -Ideal output: - movzbl 4(%esp), %eax - shrl $4, %eax - ret - -//===---------------------------------------------------------------------===// - -Testcase: -int x(int a) { return (a & 0x80) ? 0x100 : 0; } -int y(int a) { return (a & 0x80) *2; } - -Current: - testl $128, 4(%esp) - setne %al - movzbl %al, %eax - shll $8, %eax - ret - -Better: - movl 4(%esp), %eax - addl %eax, %eax - andl $256, %eax - ret - -This is another general instcombine transformation that is profitable on all -targets. In LLVM IR, these functions look like this: - -define i32 @x(i32 %a) nounwind readnone { -entry: - %0 = and i32 %a, 128 - %1 = icmp eq i32 %0, 0 - %iftmp.0.0 = select i1 %1, i32 0, i32 256 - ret i32 %iftmp.0.0 -} - -define i32 @y(i32 %a) nounwind readnone { -entry: - %0 = shl i32 %a, 1 - %1 = and i32 %0, 256 - ret i32 %1 -} - -Replacing an icmp+select with a shift should always be considered profitable in -instcombine. - -//===---------------------------------------------------------------------===// - -Re-implement atomic builtins __sync_add_and_fetch() and __sync_sub_and_fetch -properly. - -When the return value is not used (i.e. only care about the value in the -memory), x86 does not have to use add to implement these. Instead, it can use -add, sub, inc, dec instructions with the "lock" prefix. - -This is currently implemented using a bit of instruction selection trick. The -issue is the target independent pattern produces one output and a chain and we -want to map it into one that just output a chain. The current trick is to select -it into a MERGE_VALUES with the first definition being an implicit_def. The -proper solution is to add new ISD opcodes for the no-output variant. DAG -combiner can then transform the node before it gets to target node selection. - -Problem #2 is we are adding a whole bunch of x86 atomic instructions when in -fact these instructions are identical to the non-lock versions. We need a way to -add target specific information to target nodes and have this information -carried over to machine instructions. Asm printer (or JIT) can use this -information to add the "lock" prefix. - -//===---------------------------------------------------------------------===// - -_Bool bar(int *x) { return *x & 1; } - -define zeroext i1 @bar(i32* nocapture %x) nounwind readonly { -entry: - %tmp1 = load i32* %x ; [#uses=1] - %and = and i32 %tmp1, 1 ; [#uses=1] - %tobool = icmp ne i32 %and, 0 ; [#uses=1] - ret i1 %tobool -} - -bar: # @bar -# BB#0: # %entry - movl 4(%esp), %eax - movb (%eax), %al - andb $1, %al - movzbl %al, %eax - ret - -Missed optimization: should be movl+andl. - -//===---------------------------------------------------------------------===// - -Consider the following two functions compiled with clang: -_Bool foo(int *x) { return !(*x & 4); } -unsigned bar(int *x) { return !(*x & 4); } - -foo: - movl 4(%esp), %eax - testb $4, (%eax) - sete %al - movzbl %al, %eax - ret - -bar: - movl 4(%esp), %eax - movl (%eax), %eax - shrl $2, %eax - andl $1, %eax - xorl $1, %eax - ret - -The second function generates more code even though the two functions are -are functionally identical. - -//===---------------------------------------------------------------------===// - -Take the following C code: -int x(int y) { return (y & 63) << 14; } - -Code produced by gcc: - andl $63, %edi - sall $14, %edi - movl %edi, %eax - ret - -Code produced by clang: - shll $14, %edi - movl %edi, %eax - andl $1032192, %eax - ret - -The code produced by gcc is 3 bytes shorter. This sort of construct often -shows up with bitfields. - -//===---------------------------------------------------------------------===// - -Take the following C code: -int f(int a, int b) { return (unsigned char)a == (unsigned char)b; } - -We generate the following IR with clang: -define i32 @f(i32 %a, i32 %b) nounwind readnone { -entry: - %tmp = xor i32 %b, %a ; [#uses=1] - %tmp6 = and i32 %tmp, 255 ; [#uses=1] - %cmp = icmp eq i32 %tmp6, 0 ; [#uses=1] - %conv5 = zext i1 %cmp to i32 ; [#uses=1] - ret i32 %conv5 -} - -And the following x86 code: - xorl %esi, %edi - testb $-1, %dil - sete %al - movzbl %al, %eax - ret - -A cmpb instead of the xorl+testb would be one instruction shorter. - -//===---------------------------------------------------------------------===// - -Given the following C code: -int f(int a, int b) { return (signed char)a == (signed char)b; } - -We generate the following IR with clang: -define i32 @f(i32 %a, i32 %b) nounwind readnone { -entry: - %sext = shl i32 %a, 24 ; [#uses=1] - %conv1 = ashr i32 %sext, 24 ; [#uses=1] - %sext6 = shl i32 %b, 24 ; [#uses=1] - %conv4 = ashr i32 %sext6, 24 ; [#uses=1] - %cmp = icmp eq i32 %conv1, %conv4 ; [#uses=1] - %conv5 = zext i1 %cmp to i32 ; [#uses=1] - ret i32 %conv5 -} - -And the following x86 code: - movsbl %sil, %eax - movsbl %dil, %ecx - cmpl %eax, %ecx - sete %al - movzbl %al, %eax - ret - - -It should be possible to eliminate the sign extensions. - -//===---------------------------------------------------------------------===// - -LLVM misses a load+store narrowing opportunity in this code: - -%struct.bf = type { i64, i16, i16, i32 } - -@bfi = external global %struct.bf* ; <%struct.bf**> [#uses=2] - -define void @t1() nounwind ssp { -entry: - %0 = load %struct.bf** @bfi, align 8 ; <%struct.bf*> [#uses=1] - %1 = getelementptr %struct.bf* %0, i64 0, i32 1 ; [#uses=1] - %2 = bitcast i16* %1 to i32* ; [#uses=2] - %3 = load i32* %2, align 1 ; [#uses=1] - %4 = and i32 %3, -65537 ; [#uses=1] - store i32 %4, i32* %2, align 1 - %5 = load %struct.bf** @bfi, align 8 ; <%struct.bf*> [#uses=1] - %6 = getelementptr %struct.bf* %5, i64 0, i32 1 ; [#uses=1] - %7 = bitcast i16* %6 to i32* ; [#uses=2] - %8 = load i32* %7, align 1 ; [#uses=1] - %9 = and i32 %8, -131073 ; [#uses=1] - store i32 %9, i32* %7, align 1 - ret void -} - -LLVM currently emits this: - - movq bfi(%rip), %rax - andl $-65537, 8(%rax) - movq bfi(%rip), %rax - andl $-131073, 8(%rax) - ret - -It could narrow the loads and stores to emit this: - - movq bfi(%rip), %rax - andb $-2, 10(%rax) - movq bfi(%rip), %rax - andb $-3, 10(%rax) - ret - -The trouble is that there is a TokenFactor between the store and the -load, making it non-trivial to determine if there's anything between -the load and the store which would prohibit narrowing. - -//===---------------------------------------------------------------------===// diff --git a/contrib/llvm/lib/Target/X86/TargetInfo/CMakeLists.txt b/contrib/llvm/lib/Target/X86/TargetInfo/CMakeLists.txt deleted file mode 100644 index 90be9f58cc73..000000000000 --- a/contrib/llvm/lib/Target/X86/TargetInfo/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMX86Info - X86TargetInfo.cpp - ) - -add_dependencies(LLVMX86Info X86CodeGenTable_gen) diff --git a/contrib/llvm/lib/Target/X86/TargetInfo/Makefile b/contrib/llvm/lib/Target/X86/TargetInfo/Makefile deleted file mode 100644 index ee91982df0c8..000000000000 --- a/contrib/llvm/lib/Target/X86/TargetInfo/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -##===- lib/Target/X86/TargetInfo/Makefile ------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../../.. -LIBRARYNAME = LLVMX86Info - -# Hack: we need to include 'main' target directory to grab private headers -CPP.Flags += -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/X86/X86CompilationCallback_Win64.asm b/contrib/llvm/lib/Target/X86/X86CompilationCallback_Win64.asm deleted file mode 100644 index f321778db24b..000000000000 --- a/contrib/llvm/lib/Target/X86/X86CompilationCallback_Win64.asm +++ /dev/null @@ -1,68 +0,0 @@ -;;===-- X86CompilationCallback_Win64.asm - Implement Win64 JIT callback ---=== -;; -;; The LLVM Compiler Infrastructure -;; -;; This file is distributed under the University of Illinois Open Source -;; License. See LICENSE.TXT for details. -;; -;;===----------------------------------------------------------------------=== -;; -;; This file implements the JIT interfaces for the X86 target. -;; -;;===----------------------------------------------------------------------=== - -extrn X86CompilationCallback2: PROC - -.code -X86CompilationCallback proc - push rbp - - ; Save RSP. - mov rbp, rsp - - ; Save all int arg registers - ; WARNING: We cannot use register spill area - we're generating stubs by hands! - push rcx - push rdx - push r8 - push r9 - - ; Align stack on 16-byte boundary. - and rsp, -16 - - ; Save all XMM arg registers. Also allocate reg spill area. - sub rsp, 96 - movaps [rsp +32], xmm0 - movaps [rsp+16+32], xmm1 - movaps [rsp+32+32], xmm2 - movaps [rsp+48+32], xmm3 - - ; JIT callee - - ; Pass prev frame and return address. - mov rcx, rbp - mov rdx, qword ptr [rbp+8] - call X86CompilationCallback2 - - ; Restore all XMM arg registers. - movaps xmm3, [rsp+48+32] - movaps xmm2, [rsp+32+32] - movaps xmm1, [rsp+16+32] - movaps xmm0, [rsp +32] - - ; Restore RSP. - mov rsp, rbp - - ; Restore all int arg registers - sub rsp, 32 - pop r9 - pop r8 - pop rdx - pop rcx - - ; Restore RBP. - pop rbp - ret -X86CompilationCallback endp - -End diff --git a/contrib/llvm/lib/Target/XCore/AsmPrinter/CMakeLists.txt b/contrib/llvm/lib/Target/XCore/AsmPrinter/CMakeLists.txt deleted file mode 100644 index 7c7c2f4ded04..000000000000 --- a/contrib/llvm/lib/Target/XCore/AsmPrinter/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMXCoreAsmPrinter - XCoreAsmPrinter.cpp - ) -add_dependencies(LLVMXCoreAsmPrinter XCoreCodeGenTable_gen) diff --git a/contrib/llvm/lib/Target/XCore/AsmPrinter/Makefile b/contrib/llvm/lib/Target/XCore/AsmPrinter/Makefile deleted file mode 100644 index 581f736b7431..000000000000 --- a/contrib/llvm/lib/Target/XCore/AsmPrinter/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -##===- lib/Target/XCore/AsmPrinter/Makefile ----------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../../.. -LIBRARYNAME = LLVMXCoreAsmPrinter - -# Hack: we need to include 'main' XCore target directory to grab private headers -CPP.Flags += -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Target/XCore/CMakeLists.txt b/contrib/llvm/lib/Target/XCore/CMakeLists.txt deleted file mode 100644 index 38b35d7666c0..000000000000 --- a/contrib/llvm/lib/Target/XCore/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -set(LLVM_TARGET_DEFINITIONS XCore.td) - -tablegen(XCoreGenRegisterInfo.h.inc -gen-register-desc-header) -tablegen(XCoreGenRegisterNames.inc -gen-register-enums) -tablegen(XCoreGenRegisterInfo.inc -gen-register-desc) -tablegen(XCoreGenInstrNames.inc -gen-instr-enums) -tablegen(XCoreGenInstrInfo.inc -gen-instr-desc) -tablegen(XCoreGenAsmWriter.inc -gen-asm-writer) -tablegen(XCoreGenDAGISel.inc -gen-dag-isel) -tablegen(XCoreGenCallingConv.inc -gen-callingconv) -tablegen(XCoreGenSubtarget.inc -gen-subtarget) - -add_llvm_target(XCoreCodeGen - XCoreFrameInfo.cpp - XCoreInstrInfo.cpp - XCoreISelDAGToDAG.cpp - XCoreISelLowering.cpp - XCoreMCAsmInfo.cpp - XCoreRegisterInfo.cpp - XCoreSubtarget.cpp - XCoreTargetMachine.cpp - XCoreTargetObjectFile.cpp - XCoreSelectionDAGInfo.cpp - ) diff --git a/contrib/llvm/lib/Target/XCore/Makefile b/contrib/llvm/lib/Target/XCore/Makefile deleted file mode 100644 index 1b709745041a..000000000000 --- a/contrib/llvm/lib/Target/XCore/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -##===- lib/Target/XCore/Makefile ---------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMXCoreCodeGen -TARGET = XCore - -# Make sure that tblgen is run, first thing. -BUILT_SOURCES = XCoreGenRegisterInfo.h.inc XCoreGenRegisterNames.inc \ - XCoreGenRegisterInfo.inc XCoreGenInstrNames.inc \ - XCoreGenInstrInfo.inc XCoreGenAsmWriter.inc \ - XCoreGenDAGISel.inc XCoreGenCallingConv.inc \ - XCoreGenSubtarget.inc - -DIRS = AsmPrinter TargetInfo - -include $(LEVEL)/Makefile.common - diff --git a/contrib/llvm/lib/Target/XCore/README.txt b/contrib/llvm/lib/Target/XCore/README.txt deleted file mode 100644 index b69205b49b6c..000000000000 --- a/contrib/llvm/lib/Target/XCore/README.txt +++ /dev/null @@ -1,7 +0,0 @@ -To-do ------ - -* Instruction encodings -* Tailcalls -* Investigate loop alignment -* Add builtins diff --git a/contrib/llvm/lib/Target/XCore/TargetInfo/CMakeLists.txt b/contrib/llvm/lib/Target/XCore/TargetInfo/CMakeLists.txt deleted file mode 100644 index 0a568de1624b..000000000000 --- a/contrib/llvm/lib/Target/XCore/TargetInfo/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) - -add_llvm_library(LLVMXCoreInfo - XCoreTargetInfo.cpp - ) - -add_dependencies(LLVMXCoreInfo XCoreTable_gen) diff --git a/contrib/llvm/lib/Target/XCore/TargetInfo/Makefile b/contrib/llvm/lib/Target/XCore/TargetInfo/Makefile deleted file mode 100644 index f8a409517497..000000000000 --- a/contrib/llvm/lib/Target/XCore/TargetInfo/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -##===- lib/Target/XCore/TargetInfo/Makefile ----------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../../.. -LIBRARYNAME = LLVMXCoreInfo - -# Hack: we need to include 'main' target directory to grab private headers -CPPFLAGS = -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/.. - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Transforms/Hello/CMakeLists.txt b/contrib/llvm/lib/Transforms/Hello/CMakeLists.txt deleted file mode 100644 index 917b745628de..000000000000 --- a/contrib/llvm/lib/Transforms/Hello/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_llvm_loadable_module( LLVMHello - Hello.cpp - ) diff --git a/contrib/llvm/lib/Transforms/Hello/Hello.cpp b/contrib/llvm/lib/Transforms/Hello/Hello.cpp deleted file mode 100644 index 838d5505490f..000000000000 --- a/contrib/llvm/lib/Transforms/Hello/Hello.cpp +++ /dev/null @@ -1,65 +0,0 @@ -//===- Hello.cpp - Example code from "Writing an LLVM Pass" ---------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements two versions of the LLVM "Hello World" pass described -// in docs/WritingAnLLVMPass.html -// -//===----------------------------------------------------------------------===// - -#define DEBUG_TYPE "hello" -#include "llvm/Pass.h" -#include "llvm/Function.h" -#include "llvm/Support/raw_ostream.h" -#include "llvm/ADT/Statistic.h" -using namespace llvm; - -STATISTIC(HelloCounter, "Counts number of functions greeted"); - -namespace { - // Hello - The first implementation, without getAnalysisUsage. - struct Hello : public FunctionPass { - static char ID; // Pass identification, replacement for typeid - Hello() : FunctionPass(ID) {} - - virtual bool runOnFunction(Function &F) { - ++HelloCounter; - errs() << "Hello: "; - errs().write_escaped(F.getName()) << '\n'; - return false; - } - }; -} - -char Hello::ID = 0; -INITIALIZE_PASS(Hello, "hello", "Hello World Pass", false, false); - -namespace { - // Hello2 - The second implementation with getAnalysisUsage implemented. - struct Hello2 : public FunctionPass { - static char ID; // Pass identification, replacement for typeid - Hello2() : FunctionPass(ID) {} - - virtual bool runOnFunction(Function &F) { - ++HelloCounter; - errs() << "Hello: "; - errs().write_escaped(F.getName()) << '\n'; - return false; - } - - // We don't modify the program, so we preserve all analyses - virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.setPreservesAll(); - } - }; -} - -char Hello2::ID = 0; -INITIALIZE_PASS(Hello2, "hello2", - "Hello World Pass (with getAnalysisUsage implemented)", - false, false); diff --git a/contrib/llvm/lib/Transforms/Hello/Hello.exports b/contrib/llvm/lib/Transforms/Hello/Hello.exports deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/contrib/llvm/lib/Transforms/Hello/Makefile b/contrib/llvm/lib/Transforms/Hello/Makefile deleted file mode 100644 index f1e31489d3c9..000000000000 --- a/contrib/llvm/lib/Transforms/Hello/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -##===- lib/Transforms/Hello/Makefile -----------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMHello -LOADABLE_MODULE = 1 -USEDLIBS = - -# If we don't need RTTI or EH, there's no reason to export anything -# from the hello plugin. -ifneq ($(REQUIRES_RTTI), 1) -ifneq ($(REQUIRES_EH), 1) -EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/Hello.exports -endif -endif - -include $(LEVEL)/Makefile.common - diff --git a/contrib/llvm/lib/Transforms/IPO/CMakeLists.txt b/contrib/llvm/lib/Transforms/IPO/CMakeLists.txt deleted file mode 100644 index 65483e8fed63..000000000000 --- a/contrib/llvm/lib/Transforms/IPO/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -add_llvm_library(LLVMipo - ArgumentPromotion.cpp - ConstantMerge.cpp - DeadArgumentElimination.cpp - DeadTypeElimination.cpp - ExtractGV.cpp - FunctionAttrs.cpp - GlobalDCE.cpp - GlobalOpt.cpp - IPConstantPropagation.cpp - IPO.cpp - InlineAlways.cpp - InlineSimple.cpp - Inliner.cpp - Internalize.cpp - LoopExtractor.cpp - LowerSetJmp.cpp - MergeFunctions.cpp - PartialInlining.cpp - PartialSpecialization.cpp - PruneEH.cpp - StripDeadPrototypes.cpp - StripSymbols.cpp - StructRetPromotion.cpp - ) - -target_link_libraries (LLVMipo LLVMScalarOpts LLVMInstCombine) diff --git a/contrib/llvm/lib/Transforms/IPO/Makefile b/contrib/llvm/lib/Transforms/IPO/Makefile deleted file mode 100644 index 5c42374139aa..000000000000 --- a/contrib/llvm/lib/Transforms/IPO/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Transforms/IPO/Makefile -------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMipo -BUILD_ARCHIVE = 1 - -include $(LEVEL)/Makefile.common - diff --git a/contrib/llvm/lib/Transforms/InstCombine/CMakeLists.txt b/contrib/llvm/lib/Transforms/InstCombine/CMakeLists.txt deleted file mode 100644 index 5b1ff3e23bb0..000000000000 --- a/contrib/llvm/lib/Transforms/InstCombine/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -add_llvm_library(LLVMInstCombine - InstructionCombining.cpp - InstCombineAddSub.cpp - InstCombineAndOrXor.cpp - InstCombineCalls.cpp - InstCombineCasts.cpp - InstCombineCompares.cpp - InstCombineLoadStoreAlloca.cpp - InstCombineMulDivRem.cpp - InstCombinePHI.cpp - InstCombineSelect.cpp - InstCombineShifts.cpp - InstCombineSimplifyDemanded.cpp - InstCombineVectorOps.cpp - ) - -target_link_libraries (LLVMInstCombine LLVMTransformUtils) diff --git a/contrib/llvm/lib/Transforms/InstCombine/Makefile b/contrib/llvm/lib/Transforms/InstCombine/Makefile deleted file mode 100644 index 0c488e78b6d9..000000000000 --- a/contrib/llvm/lib/Transforms/InstCombine/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Transforms/InstCombine/Makefile -----------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMInstCombine -BUILD_ARCHIVE = 1 - -include $(LEVEL)/Makefile.common - diff --git a/contrib/llvm/lib/Transforms/Instrumentation/CMakeLists.txt b/contrib/llvm/lib/Transforms/Instrumentation/CMakeLists.txt deleted file mode 100644 index 128bf489787c..000000000000 --- a/contrib/llvm/lib/Transforms/Instrumentation/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_llvm_library(LLVMInstrumentation - EdgeProfiling.cpp - OptimalEdgeProfiling.cpp - ProfilingUtils.cpp - ) diff --git a/contrib/llvm/lib/Transforms/Instrumentation/Makefile b/contrib/llvm/lib/Transforms/Instrumentation/Makefile deleted file mode 100644 index 6cbc7a9cd88a..000000000000 --- a/contrib/llvm/lib/Transforms/Instrumentation/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Transforms/Instrumentation/Makefile -------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMInstrumentation -BUILD_ARCHIVE = 1 - -include $(LEVEL)/Makefile.common - diff --git a/contrib/llvm/lib/Transforms/Makefile b/contrib/llvm/lib/Transforms/Makefile deleted file mode 100644 index e527be25decb..000000000000 --- a/contrib/llvm/lib/Transforms/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -##===- lib/Transforms/Makefile -----------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../.. -PARALLEL_DIRS = Utils Instrumentation Scalar InstCombine IPO Hello - -include $(LEVEL)/Makefile.config - -# No support for plugins on windows targets -ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW Minix)) - PARALLEL_DIRS := $(filter-out Hello, $(PARALLEL_DIRS)) -endif - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/lib/Transforms/Scalar/CMakeLists.txt b/contrib/llvm/lib/Transforms/Scalar/CMakeLists.txt deleted file mode 100644 index b7598eace536..000000000000 --- a/contrib/llvm/lib/Transforms/Scalar/CMakeLists.txt +++ /dev/null @@ -1,35 +0,0 @@ -add_llvm_library(LLVMScalarOpts - ADCE.cpp - BasicBlockPlacement.cpp - CodeGenPrepare.cpp - ConstantProp.cpp - CorrelatedValuePropagation.cpp - DCE.cpp - DeadStoreElimination.cpp - GEPSplitter.cpp - GVN.cpp - IndVarSimplify.cpp - JumpThreading.cpp - LICM.cpp - LoopDeletion.cpp - LoopIndexSplit.cpp - LoopRotation.cpp - LoopStrengthReduce.cpp - LoopUnrollPass.cpp - LoopUnswitch.cpp - LowerAtomic.cpp - MemCpyOptimizer.cpp - Reassociate.cpp - Reg2Mem.cpp - SCCP.cpp - Scalar.cpp - ScalarReplAggregates.cpp - SimplifyCFGPass.cpp - SimplifyHalfPowrLibCalls.cpp - SimplifyLibCalls.cpp - Sink.cpp - TailDuplication.cpp - TailRecursionElimination.cpp - ) - -target_link_libraries (LLVMScalarOpts LLVMTransformUtils) diff --git a/contrib/llvm/lib/Transforms/Scalar/Makefile b/contrib/llvm/lib/Transforms/Scalar/Makefile deleted file mode 100644 index cc42fd00ac7d..000000000000 --- a/contrib/llvm/lib/Transforms/Scalar/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Transforms/Scalar/Makefile ----------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMScalarOpts -BUILD_ARCHIVE = 1 - -include $(LEVEL)/Makefile.common - diff --git a/contrib/llvm/lib/Transforms/Utils/CMakeLists.txt b/contrib/llvm/lib/Transforms/Utils/CMakeLists.txt deleted file mode 100644 index 61cbeb2bd35b..000000000000 --- a/contrib/llvm/lib/Transforms/Utils/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -add_llvm_library(LLVMTransformUtils - AddrModeMatcher.cpp - BasicBlockUtils.cpp - BasicInliner.cpp - BreakCriticalEdges.cpp - BuildLibCalls.cpp - CloneFunction.cpp - CloneLoop.cpp - CloneModule.cpp - CodeExtractor.cpp - DemoteRegToStack.cpp - InlineFunction.cpp - InstructionNamer.cpp - LCSSA.cpp - Local.cpp - LoopSimplify.cpp - LoopUnroll.cpp - LowerInvoke.cpp - LowerSwitch.cpp - Mem2Reg.cpp - PromoteMemoryToRegister.cpp - SSAUpdater.cpp - SimplifyCFG.cpp - UnifyFunctionExitNodes.cpp - ValueMapper.cpp - ) - -target_link_libraries (LLVMTransformUtils LLVMSupport) diff --git a/contrib/llvm/lib/Transforms/Utils/Makefile b/contrib/llvm/lib/Transforms/Utils/Makefile deleted file mode 100644 index d1e9336d67f0..000000000000 --- a/contrib/llvm/lib/Transforms/Utils/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Transforms/Utils/Makefile -----------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../../.. -LIBRARYNAME = LLVMTransformUtils -BUILD_ARCHIVE = 1 - -include $(LEVEL)/Makefile.common - diff --git a/contrib/llvm/lib/VMCore/CMakeLists.txt b/contrib/llvm/lib/VMCore/CMakeLists.txt deleted file mode 100644 index 1388c93cce39..000000000000 --- a/contrib/llvm/lib/VMCore/CMakeLists.txt +++ /dev/null @@ -1,35 +0,0 @@ -add_llvm_library(LLVMCore - AsmWriter.cpp - Attributes.cpp - AutoUpgrade.cpp - BasicBlock.cpp - ConstantFold.cpp - Constants.cpp - Core.cpp - DebugLoc.cpp - Dominators.cpp - Function.cpp - GVMaterializer.cpp - Globals.cpp - IRBuilder.cpp - InlineAsm.cpp - Instruction.cpp - Instructions.cpp - IntrinsicInst.cpp - LLVMContext.cpp - LLVMContextImpl.cpp - LeakDetector.cpp - Metadata.cpp - Module.cpp - Pass.cpp - PassManager.cpp - PassRegistry.cpp - PrintModulePass.cpp - Type.cpp - TypeSymbolTable.cpp - Use.cpp - Value.cpp - ValueSymbolTable.cpp - ValueTypes.cpp - Verifier.cpp - ) diff --git a/contrib/llvm/lib/VMCore/Makefile b/contrib/llvm/lib/VMCore/Makefile deleted file mode 100644 index 03a4fc707deb..000000000000 --- a/contrib/llvm/lib/VMCore/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -##===- lib/VMCore/Makefile ---------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../.. -LIBRARYNAME = LLVMCore -BUILD_ARCHIVE = 1 -REQUIRES_RTTI = 1 - -BUILT_SOURCES = $(PROJ_OBJ_ROOT)/include/llvm/Intrinsics.gen - -include $(LEVEL)/Makefile.common - -GENFILE:=$(PROJ_OBJ_ROOT)/include/llvm/Intrinsics.gen - -INTRINSICTD := $(PROJ_SRC_ROOT)/include/llvm/Intrinsics.td -INTRINSICTDS := $(wildcard $(PROJ_SRC_ROOT)/include/llvm/Intrinsics*.td) - -$(ObjDir)/Intrinsics.gen.tmp: $(ObjDir)/.dir $(INTRINSICTDS) $(TBLGEN) - $(Echo) Building Intrinsics.gen.tmp from Intrinsics.td - $(Verb) $(TableGen) $(call SYSPATH, $(INTRINSICTD)) -o $(call SYSPATH, $@) -gen-intrinsic - -$(GENFILE): $(ObjDir)/Intrinsics.gen.tmp - $(Verb) $(CMP) -s $@ $< || ( $(CP) $< $@ && \ - $(EchoCmd) Updated Intrinsics.gen because Intrinsics.gen.tmp \ - changed significantly. ) - -install-local:: $(GENFILE) - $(Echo) Installing $(DESTDIR)$(PROJ_includedir)/llvm/Intrinsics.gen - $(Verb) $(DataInstall) $(GENFILE) $(DESTDIR)$(PROJ_includedir)/llvm/Intrinsics.gen diff --git a/contrib/llvm/llvm.spec.in b/contrib/llvm/llvm.spec.in deleted file mode 100644 index 9284d65d0077..000000000000 --- a/contrib/llvm/llvm.spec.in +++ /dev/null @@ -1,67 +0,0 @@ -Name: @PACKAGE_NAME@ -Version: @PACKAGE_VERSION@ -Release: 0 -Summary: The Low Level Virtual Machine (An Optimizing Compiler Infrastructure) -License: University of Illinois/NCSA Open Source License -Vendor: None (open source) -Group: Development/Compilers -URL: http://llvm..org/ -Source: http://llvm.org/releases/@PACKAGE_VERSION@/@PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz -BuildRoot: %{_tmppath}/%{name}-root -Requires: /sbin/ldconfig -BuildRequires: gcc >= 3.4 - -%description -LLVM is a compiler infrastructure designed for compile-time, link-time, runtime, -and idle-time optimization of programs from arbitrary programming languages. -LLVM is written in C++ and has been developed since 2000 at the University of -Illinois and Apple. It currently supports compilation of C and C++ programs, -using front-ends derived from GCC 4.0.1. A new front-end for the C family of -languages is in development. The compiler infrastructure -includes mirror sets of programming tools as well as libraries with equivalent -functionality. - -%prep -%setup -q -n @PACKAGE_NAME@-@PACKAGE_VERSION@ - -%build -./configure \ ---prefix=%{_prefix} \ ---bindir=%{_bindir} \ ---datadir=%{_datadir} \ ---includedir=%{_includedir} \ ---libdir=%{_libdir} \ ---enable-optimized \ ---enable-assertions -make tools-only - -%install -rm -rf %{buildroot} -make install DESTDIR=%{buildroot} - -%clean -rm -rf %{buildroot} - -%post -p /sbin/ldconfig - -%postun -p /sbin/ldconfig - -%files -%defattr(-, root, root) -%doc CREDITS.TXT LICENSE.TXT README.txt docs/*.{html,css,gif,jpg} docs/CommandGuide -%{_bindir}/* -%{_libdir}/*.o -%{_libdir}/*.a -%{_libdir}/*.so -%{_includedir}/llvm - -%changelog -* Fri Aug 04 2006 Reid Spencer -- Updates for release 1.8 -* Fri Apr 07 2006 Reid Spencer -- Make the build be optimized+assertions -* Fri May 13 2005 Reid Spencer -- Minor adjustments for the 1.5 release -* Mon Feb 09 2003 Brian R. Gaeke -- Initial working version of RPM spec file. - diff --git a/contrib/llvm/runtime/Makefile b/contrib/llvm/runtime/Makefile deleted file mode 100644 index d0e85d58264f..000000000000 --- a/contrib/llvm/runtime/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -##===- runtime/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 - -ifndef NO_RUNTIME_LIBS - -PARALLEL_DIRS := libprofile - -# Disable libprofile: a faulty libtool is generated by autoconf which breaks the -# build on Sparc -ifeq ($(ARCH), Sparc) -PARALLEL_DIRS := $(filter-out libprofile, $(PARALLEL_DIRS)) -endif - -ifeq ($(TARGET_OS), $(filter $(TARGET_OS), Cygwin MingW Minix)) -PARALLEL_DIRS := $(filter-out libprofile, $(PARALLEL_DIRS)) -endif - -endif - -include $(LEVEL)/Makefile.common - -install:: diff --git a/contrib/llvm/runtime/README.txt b/contrib/llvm/runtime/README.txt deleted file mode 100644 index 2e2e547de316..000000000000 --- a/contrib/llvm/runtime/README.txt +++ /dev/null @@ -1,4 +0,0 @@ -This directory contains the various runtime libraries used by components of -the LLVM compiler. For example, the automatic pool allocation transformation -inserts calls to an external pool allocator library. This runtime library is -an example of the type of library that lives in these directories. diff --git a/contrib/llvm/runtime/libprofile/BasicBlockTracing.c b/contrib/llvm/runtime/libprofile/BasicBlockTracing.c deleted file mode 100644 index dbe81e3f6504..000000000000 --- a/contrib/llvm/runtime/libprofile/BasicBlockTracing.c +++ /dev/null @@ -1,67 +0,0 @@ -/*===-- BasicBlockTracing.c - Support library for basic block tracing -----===*\ -|* -|* The LLVM Compiler Infrastructure -|* -|* This file is distributed under the University of Illinois Open Source -|* License. See LICENSE.TXT for details. -|* -|*===----------------------------------------------------------------------===*| -|* -|* This file implements the call back routines for the basic block tracing -|* instrumentation pass. This should be used with the -trace-basic-blocks -|* LLVM pass. -|* -\*===----------------------------------------------------------------------===*/ - -#include "Profiling.h" -#include -#include - -static unsigned *ArrayStart, *ArrayEnd, *ArrayCursor; - -/* WriteAndFlushBBTraceData - write out the currently accumulated trace data - * and reset the cursor to point to the beginning of the buffer. - */ -static void WriteAndFlushBBTraceData () { - write_profiling_data(BBTraceInfo, ArrayStart, (ArrayCursor - ArrayStart)); - ArrayCursor = ArrayStart; -} - -/* BBTraceAtExitHandler - When the program exits, just write out any remaining - * data and free the trace buffer. - */ -static void BBTraceAtExitHandler() { - WriteAndFlushBBTraceData (); - free (ArrayStart); -} - -/* llvm_trace_basic_block - called upon hitting a new basic block. */ -void llvm_trace_basic_block (unsigned BBNum) { - *ArrayCursor++ = BBNum; - if (ArrayCursor == ArrayEnd) - WriteAndFlushBBTraceData (); -} - -/* llvm_start_basic_block_tracing - This is the main entry point of the basic - * block tracing library. It is responsible for setting up the atexit - * handler and allocating the trace buffer. - */ -int llvm_start_basic_block_tracing(int argc, const char **argv, - unsigned *arrayStart, unsigned numElements) { - int Ret; - const unsigned BufferSize = 128 * 1024; - unsigned ArraySize; - - Ret = save_arguments(argc, argv); - - /* Allocate a buffer to contain BB tracing data */ - ArraySize = BufferSize / sizeof (unsigned); - ArrayStart = malloc (ArraySize * sizeof (unsigned)); - ArrayEnd = ArrayStart + ArraySize; - ArrayCursor = ArrayStart; - - /* Set up the atexit handler. */ - atexit (BBTraceAtExitHandler); - - return Ret; -} diff --git a/contrib/llvm/runtime/libprofile/CommonProfiling.c b/contrib/llvm/runtime/libprofile/CommonProfiling.c deleted file mode 100644 index 8b27a2576974..000000000000 --- a/contrib/llvm/runtime/libprofile/CommonProfiling.c +++ /dev/null @@ -1,117 +0,0 @@ -/*===-- CommonProfiling.c - Profiling support library support -------------===*\ -|* -|* The LLVM Compiler Infrastructure -|* -|* This file is distributed under the University of Illinois Open Source -|* License. See LICENSE.TXT for details. -|* -|*===----------------------------------------------------------------------===*| -|* -|* This file implements functions used by the various different types of -|* profiling implementations. -|* -\*===----------------------------------------------------------------------===*/ - -#include "Profiling.h" -#include -#include -#include -#include -#include -#include -#include - -static char *SavedArgs = 0; -static unsigned SavedArgsLength = 0; - -static const char *OutputFilename = "llvmprof.out"; - -/* save_arguments - Save argc and argv as passed into the program for the file - * we output. - */ -int save_arguments(int argc, const char **argv) { - unsigned Length, i; - if (SavedArgs || !argv) return argc; /* This can be called multiple times */ - - /* Check to see if there are any arguments passed into the program for the - * profiler. If there are, strip them off and remember their settings. - */ - while (argc > 1 && !strncmp(argv[1], "-llvmprof-", 10)) { - /* Ok, we have an llvmprof argument. Remove it from the arg list and decide - * what to do with it. - */ - const char *Arg = argv[1]; - memmove(&argv[1], &argv[2], (argc-1)*sizeof(char*)); - --argc; - - if (!strcmp(Arg, "-llvmprof-output")) { - if (argc == 1) - puts("-llvmprof-output requires a filename argument!"); - else { - OutputFilename = strdup(argv[1]); - memmove(&argv[1], &argv[2], (argc-1)*sizeof(char*)); - --argc; - } - } else { - printf("Unknown option to the profiler runtime: '%s' - ignored.\n", Arg); - } - } - - for (Length = 0, i = 0; i != (unsigned)argc; ++i) - Length += strlen(argv[i])+1; - - SavedArgs = (char*)malloc(Length); - for (Length = 0, i = 0; i != (unsigned)argc; ++i) { - unsigned Len = strlen(argv[i]); - memcpy(SavedArgs+Length, argv[i], Len); - Length += Len; - SavedArgs[Length++] = ' '; - } - - SavedArgsLength = Length; - - return argc; -} - - -/* write_profiling_data - Write a raw block of profiling counters out to the - * llvmprof.out file. Note that we allow programs to be instrumented with - * multiple different kinds of instrumentation. For this reason, this function - * may be called more than once. - */ -void write_profiling_data(enum ProfilingType PT, unsigned *Start, - unsigned NumElements) { - static int OutFile = -1; - int PTy; - - /* If this is the first time this function is called, open the output file for - * appending, creating it if it does not already exist. - */ - if (OutFile == -1) { - OutFile = open(OutputFilename, O_CREAT | O_WRONLY | O_APPEND, 0666); - if (OutFile == -1) { - fprintf(stderr, "LLVM profiling runtime: while opening '%s': ", - OutputFilename); - perror(""); - return; - } - - /* Output the command line arguments to the file. */ - { - int PTy = ArgumentInfo; - int Zeros = 0; - write(OutFile, &PTy, sizeof(int)); - write(OutFile, &SavedArgsLength, sizeof(unsigned)); - write(OutFile, SavedArgs, SavedArgsLength); - /* Pad out to a multiple of four bytes */ - if (SavedArgsLength & 3) - write(OutFile, &Zeros, 4-(SavedArgsLength&3)); - } - } - - /* Write out this record! */ - PTy = PT; - write(OutFile, &PTy, sizeof(int)); - write(OutFile, &NumElements, sizeof(unsigned)); - write(OutFile, Start, NumElements*sizeof(unsigned)); -} diff --git a/contrib/llvm/runtime/libprofile/EdgeProfiling.c b/contrib/llvm/runtime/libprofile/EdgeProfiling.c deleted file mode 100644 index 4a68a086fbce..000000000000 --- a/contrib/llvm/runtime/libprofile/EdgeProfiling.c +++ /dev/null @@ -1,45 +0,0 @@ -/*===-- EdgeProfiling.c - Support library for edge profiling --------------===*\ -|* -|* The LLVM Compiler Infrastructure -|* -|* This file is distributed under the University of Illinois Open Source -|* License. See LICENSE.TXT for details. -|* -|*===----------------------------------------------------------------------===*| -|* -|* This file implements the call back routines for the edge profiling -|* instrumentation pass. This should be used with the -insert-edge-profiling -|* LLVM pass. -|* -\*===----------------------------------------------------------------------===*/ - -#include "Profiling.h" -#include - -static unsigned *ArrayStart; -static unsigned NumElements; - -/* EdgeProfAtExitHandler - When the program exits, just write out the profiling - * data. - */ -static void EdgeProfAtExitHandler() { - /* Note that if this were doing something more intelligent with the - * instrumentation, we could do some computation here to expand what we - * collected into simple edge profiles. Since we directly count each edge, we - * just write out all of the counters directly. - */ - write_profiling_data(EdgeInfo, ArrayStart, NumElements); -} - - -/* llvm_start_edge_profiling - This is the main entry point of the edge - * profiling library. It is responsible for setting up the atexit handler. - */ -int llvm_start_edge_profiling(int argc, const char **argv, - unsigned *arrayStart, unsigned numElements) { - int Ret = save_arguments(argc, argv); - ArrayStart = arrayStart; - NumElements = numElements; - atexit(EdgeProfAtExitHandler); - return Ret; -} diff --git a/contrib/llvm/runtime/libprofile/Makefile b/contrib/llvm/runtime/libprofile/Makefile deleted file mode 100644 index 4125af60d21a..000000000000 --- a/contrib/llvm/runtime/libprofile/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -##===- runtime/libprofile/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 - -ifneq ($(strip $(LLVMCC)),) -BYTECODE_LIBRARY = 1 -endif -SHARED_LIBRARY = 1 -LOADABLE_MODULE = 1 -LIBRARYNAME = profile_rt -EXTRA_DIST = libprofile.exports -EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/libprofile.exports - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/runtime/libprofile/OptimalEdgeProfiling.c b/contrib/llvm/runtime/libprofile/OptimalEdgeProfiling.c deleted file mode 100644 index eb7887b2aea9..000000000000 --- a/contrib/llvm/runtime/libprofile/OptimalEdgeProfiling.c +++ /dev/null @@ -1,45 +0,0 @@ -/*===-- OptimalEdgeProfiling.c - Support library for opt. edge profiling --===*\ -|* -|* The LLVM Compiler Infrastructure -|* -|* This file is distributed under the University of Illinois Open Source -|* License. See LICENSE.TXT for details. -|* -|*===----------------------------------------------------------------------===*| -|* -|* This file implements the call back routines for the edge profiling -|* instrumentation pass. This should be used with the -|* -insert-opt-edge-profiling LLVM pass. -|* -\*===----------------------------------------------------------------------===*/ - -#include "Profiling.h" -#include - -static unsigned *ArrayStart; -static unsigned NumElements; - -/* OptEdgeProfAtExitHandler - When the program exits, just write out the - * profiling data. - */ -static void OptEdgeProfAtExitHandler() { - /* Note that, although the array has a counter for each edge, not all - * counters are updated, the ones that are not used are initialised with -1. - * When loading this information the counters with value -1 have to be - * recalculated, it is guranteed that this is possible. - */ - write_profiling_data(OptEdgeInfo, ArrayStart, NumElements); -} - - -/* llvm_start_opt_edge_profiling - This is the main entry point of the edge - * profiling library. It is responsible for setting up the atexit handler. - */ -int llvm_start_opt_edge_profiling(int argc, const char **argv, - unsigned *arrayStart, unsigned numElements) { - int Ret = save_arguments(argc, argv); - ArrayStart = arrayStart; - NumElements = numElements; - atexit(OptEdgeProfAtExitHandler); - return Ret; -} diff --git a/contrib/llvm/runtime/libprofile/Profiling.h b/contrib/llvm/runtime/libprofile/Profiling.h deleted file mode 100644 index a7e3ccc72b6c..000000000000 --- a/contrib/llvm/runtime/libprofile/Profiling.h +++ /dev/null @@ -1,31 +0,0 @@ -/*===-- Profiling.h - Profiling support library support routines --*- C -*-===*\ -|* -|* The LLVM Compiler Infrastructure -|* -|* This file is distributed under the University of Illinois Open Source -|* License. See LICENSE.TXT for details. -|* -|*===----------------------------------------------------------------------===*| -|* -|* This file defines functions shared by the various different profiling -|* implementations. -|* -\*===----------------------------------------------------------------------===*/ - -#ifndef PROFILING_H -#define PROFILING_H - -#include "llvm/Analysis/ProfileInfoTypes.h" /* for enum ProfilingType */ - -/* save_arguments - Save argc and argv as passed into the program for the file - * we output. - */ -int save_arguments(int argc, const char **argv); - -/* write_profiling_data - Write out a typed packet of profiling data to the - * current output file. - */ -void write_profiling_data(enum ProfilingType PT, unsigned *Start, - unsigned NumElements); - -#endif diff --git a/contrib/llvm/runtime/libprofile/libprofile.exports b/contrib/llvm/runtime/libprofile/libprofile.exports deleted file mode 100644 index f45ff4760189..000000000000 --- a/contrib/llvm/runtime/libprofile/libprofile.exports +++ /dev/null @@ -1,4 +0,0 @@ -llvm_start_edge_profiling -llvm_start_opt_edge_profiling -llvm_start_basic_block_tracing -llvm_trace_basic_block diff --git a/contrib/llvm/tools/CMakeLists.txt b/contrib/llvm/tools/CMakeLists.txt deleted file mode 100644 index 7ed10e9729de..000000000000 --- a/contrib/llvm/tools/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -# NOTE: The tools are organized into five groups of four consisting of one -# large and three small executables. This is done to minimize memory load -# in parallel builds. Please retain this ordering. - -if( NOT WIN32 OR MSYS OR CYGWIN ) - # It is useful to build llvm-config before the other tools, so we - # have a fresh LibDeps.txt for regenerating the hard-coded library - # dependencies. llvm-config/CMakeLists.txt takes care of this but we - # must keep llvm-config as the first entry on the list of tools to - # be built. - add_subdirectory(llvm-config) -endif() - -add_subdirectory(opt) -add_subdirectory(llvm-as) -add_subdirectory(llvm-dis) -add_subdirectory(llvm-mc) - -add_subdirectory(llc) -add_subdirectory(llvm-ranlib) -add_subdirectory(llvm-ar) -add_subdirectory(llvm-nm) - -add_subdirectory(llvm-ld) -add_subdirectory(llvm-prof) -add_subdirectory(llvm-link) -add_subdirectory(lli) - -add_subdirectory(llvm-extract) -add_subdirectory(llvm-diff) - -add_subdirectory(bugpoint) -add_subdirectory(bugpoint-passes) -add_subdirectory(llvm-bcanalyzer) -add_subdirectory(llvm-stub) -add_subdirectory(edis) -add_subdirectory(llvmc) - -if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/clang/CMakeLists.txt ) - add_subdirectory( ${CMAKE_CURRENT_SOURCE_DIR}/clang ) -endif( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/clang/CMakeLists.txt ) - -set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} PARENT_SCOPE) diff --git a/contrib/llvm/tools/Makefile b/contrib/llvm/tools/Makefile deleted file mode 100644 index aa07a2b1b77f..000000000000 --- a/contrib/llvm/tools/Makefile +++ /dev/null @@ -1,60 +0,0 @@ -##===- tools/Makefile --------------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL := .. - -# Build clang if present. -OPTIONAL_PARALLEL_DIRS := clang - -# NOTE: The tools are organized into five groups of four consisting of one -# large and three small executables. This is done to minimize memory load -# in parallel builds. Please retain this ordering. -DIRS := llvm-config -PARALLEL_DIRS := opt llvm-as llvm-dis \ - llc llvm-ranlib llvm-ar llvm-nm \ - llvm-ld llvm-prof llvm-link \ - lli llvm-extract llvm-mc \ - bugpoint llvm-bcanalyzer llvm-stub \ - llvmc llvm-diff - -# Let users override the set of tools to build from the command line. -ifdef ONLY_TOOLS - OPTIONAL_PARALLEL_DIRS := - PARALLEL_DIRS := $(ONLY_TOOLS) -endif - -include $(LEVEL)/Makefile.config - - -# These libraries build as dynamic libraries (.dylib /.so), they can only be -# built if ENABLE_PIC is set. -ifeq ($(ENABLE_PIC),1) - # No support for dynamic libraries on windows targets. - ifneq ($(TARGET_OS), $(filter $(TARGET_OS), Cygwin MingW)) - # gold only builds if binutils is around. It requires "lto" to build before - # it so it is added to DIRS. - ifdef BINUTILS_INCDIR - DIRS += lto gold - else - PARALLEL_DIRS += lto - endif - - PARALLEL_DIRS += bugpoint-passes - - # The edis library is only supported if ARM and/or X86 are enabled, and if - # LLVM is being built PIC on platforms that support dylibs. - ifneq ($(DISABLE_EDIS),1) - ifneq ($(filter $(TARGETS_TO_BUILD), X86 ARM),) - PARALLEL_DIRS += edis - endif - endif - endif -endif - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/tools/bugpoint-passes/CMakeLists.txt b/contrib/llvm/tools/bugpoint-passes/CMakeLists.txt deleted file mode 100644 index 50109a52c249..000000000000 --- a/contrib/llvm/tools/bugpoint-passes/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_llvm_loadable_module( BugpointPasses - TestPasses.cpp - ) diff --git a/contrib/llvm/tools/bugpoint-passes/Makefile b/contrib/llvm/tools/bugpoint-passes/Makefile deleted file mode 100644 index b4ad3e4ad3b0..000000000000 --- a/contrib/llvm/tools/bugpoint-passes/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -##===- tools/bugpoint-passes/Makefile -- -------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../.. -LIBRARYNAME = BugpointPasses -LOADABLE_MODULE = 1 -USEDLIBS = - -# If we don't need RTTI or EH, there's no reason to export anything -# from this plugin. -ifneq ($(REQUIRES_RTTI), 1) -ifneq ($(REQUIRES_EH), 1) -EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/bugpoint.exports -endif -endif - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/tools/bugpoint-passes/TestPasses.cpp b/contrib/llvm/tools/bugpoint-passes/TestPasses.cpp deleted file mode 100644 index 1535b0388561..000000000000 --- a/contrib/llvm/tools/bugpoint-passes/TestPasses.cpp +++ /dev/null @@ -1,75 +0,0 @@ -//===- TestPasses.cpp - "buggy" passes used to test bugpoint --------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains "buggy" passes that are used to test bugpoint, to check -// that it is narrowing down testcases correctly. -// -//===----------------------------------------------------------------------===// - -#include "llvm/BasicBlock.h" -#include "llvm/Constant.h" -#include "llvm/Instructions.h" -#include "llvm/Pass.h" -#include "llvm/Type.h" -#include "llvm/Support/InstVisitor.h" - -using namespace llvm; - -namespace { - /// CrashOnCalls - This pass is used to test bugpoint. It intentionally - /// crashes on any call instructions. - class CrashOnCalls : public BasicBlockPass { - public: - static char ID; // Pass ID, replacement for typeid - CrashOnCalls() : BasicBlockPass(ID) {} - private: - virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.setPreservesAll(); - } - - bool runOnBasicBlock(BasicBlock &BB) { - for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I) - if (isa(*I)) - abort(); - - return false; - } - }; -} - -char CrashOnCalls::ID = 0; -static RegisterPass - X("bugpoint-crashcalls", - "BugPoint Test Pass - Intentionally crash on CallInsts"); - -namespace { - /// DeleteCalls - This pass is used to test bugpoint. It intentionally - /// deletes some call instructions, "misoptimizing" the program. - class DeleteCalls : public BasicBlockPass { - public: - static char ID; // Pass ID, replacement for typeid - DeleteCalls() : BasicBlockPass(ID) {} - private: - bool runOnBasicBlock(BasicBlock &BB) { - for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I) - if (CallInst *CI = dyn_cast(I)) { - if (!CI->use_empty()) - CI->replaceAllUsesWith(Constant::getNullValue(CI->getType())); - CI->getParent()->getInstList().erase(CI); - break; - } - return false; - } - }; -} - -char DeleteCalls::ID = 0; -static RegisterPass - Y("bugpoint-deletecalls", - "BugPoint Test Pass - Intentionally 'misoptimize' CallInsts"); diff --git a/contrib/llvm/tools/bugpoint-passes/bugpoint.exports b/contrib/llvm/tools/bugpoint-passes/bugpoint.exports deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/contrib/llvm/tools/bugpoint/BugDriver.cpp b/contrib/llvm/tools/bugpoint/BugDriver.cpp deleted file mode 100644 index 6966671f9cb2..000000000000 --- a/contrib/llvm/tools/bugpoint/BugDriver.cpp +++ /dev/null @@ -1,246 +0,0 @@ -//===- BugDriver.cpp - Top-Level BugPoint class implementation ------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This class contains all of the shared state and information that is used by -// the BugPoint tool to track down errors in optimizations. This class is the -// main driver class that invokes all sub-functionality. -// -//===----------------------------------------------------------------------===// - -#include "BugDriver.h" -#include "ToolRunner.h" -#include "llvm/Linker.h" -#include "llvm/Module.h" -#include "llvm/Pass.h" -#include "llvm/Support/IRReader.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/FileUtilities.h" -#include "llvm/Support/SourceMgr.h" -#include "llvm/Support/raw_ostream.h" -#include "llvm/System/Host.h" -#include -using namespace llvm; - -namespace llvm { - Triple TargetTriple; -} - -// Anonymous namespace to define command line options for debugging. -// -namespace { - // Output - The user can specify a file containing the expected output of the - // program. If this filename is set, it is used as the reference diff source, - // otherwise the raw input run through an interpreter is used as the reference - // source. - // - cl::opt - OutputFile("output", cl::desc("Specify a reference program output " - "(for miscompilation detection)")); -} - -/// setNewProgram - If we reduce or update the program somehow, call this method -/// to update bugdriver with it. This deletes the old module and sets the -/// specified one as the current program. -void BugDriver::setNewProgram(Module *M) { - delete Program; - Program = M; -} - - -/// getPassesString - Turn a list of passes into a string which indicates the -/// command line options that must be passed to add the passes. -/// -std::string llvm::getPassesString(const std::vector &Passes) { - std::string Result; - for (unsigned i = 0, e = Passes.size(); i != e; ++i) { - if (i) Result += " "; - Result += "-"; - Result += Passes[i]; - } - return Result; -} - -BugDriver::BugDriver(const char *toolname, bool find_bugs, - unsigned timeout, unsigned memlimit, bool use_valgrind, - LLVMContext& ctxt) - : Context(ctxt), ToolName(toolname), ReferenceOutputFile(OutputFile), - Program(0), Interpreter(0), SafeInterpreter(0), gcc(0), - run_find_bugs(find_bugs), Timeout(timeout), - MemoryLimit(memlimit), UseValgrind(use_valgrind) {} - -BugDriver::~BugDriver() { - delete Program; -} - - -/// ParseInputFile - Given a bitcode or assembly input filename, parse and -/// return it, or return null if not possible. -/// -Module *llvm::ParseInputFile(const std::string &Filename, - LLVMContext& Ctxt) { - SMDiagnostic Err; - Module *Result = ParseIRFile(Filename, Err, Ctxt); - if (!Result) - Err.Print("bugpoint", errs()); - - // If we don't have an override triple, use the first one to configure - // bugpoint, or use the host triple if none provided. - if (Result) { - if (TargetTriple.getTriple().empty()) { - Triple TheTriple(Result->getTargetTriple()); - - if (TheTriple.getTriple().empty()) - TheTriple.setTriple(sys::getHostTriple()); - - TargetTriple.setTriple(TheTriple.getTriple()); - } - - Result->setTargetTriple(TargetTriple.getTriple()); // override the triple - } - return Result; -} - -// This method takes the specified list of LLVM input files, attempts to load -// them, either as assembly or bitcode, then link them together. It returns -// true on failure (if, for example, an input bitcode file could not be -// parsed), and false on success. -// -bool BugDriver::addSources(const std::vector &Filenames) { - assert(Program == 0 && "Cannot call addSources multiple times!"); - assert(!Filenames.empty() && "Must specify at least on input filename!"); - - // Load the first input file. - Program = ParseInputFile(Filenames[0], Context); - if (Program == 0) return true; - - outs() << "Read input file : '" << Filenames[0] << "'\n"; - - for (unsigned i = 1, e = Filenames.size(); i != e; ++i) { - std::auto_ptr M(ParseInputFile(Filenames[i], Context)); - if (M.get() == 0) return true; - - outs() << "Linking in input file: '" << Filenames[i] << "'\n"; - std::string ErrorMessage; - if (Linker::LinkModules(Program, M.get(), &ErrorMessage)) { - errs() << ToolName << ": error linking in '" << Filenames[i] << "': " - << ErrorMessage << '\n'; - return true; - } - } - - outs() << "*** All input ok\n"; - - // All input files read successfully! - return false; -} - - - -/// run - The top level method that is invoked after all of the instance -/// variables are set up from command line arguments. -/// -bool BugDriver::run(std::string &ErrMsg) { - if (run_find_bugs) { - // Rearrange the passes and apply them to the program. Repeat this process - // until the user kills the program or we find a bug. - return runManyPasses(PassesToRun, ErrMsg); - } - - // If we're not running as a child, the first thing that we must do is - // determine what the problem is. Does the optimization series crash the - // compiler, or does it produce illegal code? We make the top-level - // decision by trying to run all of the passes on the the input program, - // which should generate a bitcode file. If it does generate a bitcode - // file, then we know the compiler didn't crash, so try to diagnose a - // miscompilation. - if (!PassesToRun.empty()) { - outs() << "Running selected passes on program to test for crash: "; - if (runPasses(Program, PassesToRun)) - return debugOptimizerCrash(); - } - - // Set up the execution environment, selecting a method to run LLVM bitcode. - if (initializeExecutionEnvironment()) return true; - - // Test to see if we have a code generator crash. - outs() << "Running the code generator to test for a crash: "; - std::string Error; - compileProgram(Program, &Error); - if (!Error.empty()) { - outs() << Error; - return debugCodeGeneratorCrash(ErrMsg); - } - outs() << '\n'; - - // Run the raw input to see where we are coming from. If a reference output - // was specified, make sure that the raw output matches it. If not, it's a - // problem in the front-end or the code generator. - // - bool CreatedOutput = false; - if (ReferenceOutputFile.empty()) { - outs() << "Generating reference output from raw program: "; - if (!createReferenceFile(Program)) { - return debugCodeGeneratorCrash(ErrMsg); - } - CreatedOutput = true; - } - - // Make sure the reference output file gets deleted on exit from this - // function, if appropriate. - sys::Path ROF(ReferenceOutputFile); - FileRemover RemoverInstance(ROF, CreatedOutput && !SaveTemps); - - // Diff the output of the raw program against the reference output. If it - // matches, then we assume there is a miscompilation bug and try to - // diagnose it. - outs() << "*** Checking the code generator...\n"; - bool Diff = diffProgram(Program, "", "", false, &Error); - if (!Error.empty()) { - errs() << Error; - return debugCodeGeneratorCrash(ErrMsg); - } - if (!Diff) { - outs() << "\n*** Output matches: Debugging miscompilation!\n"; - debugMiscompilation(&Error); - if (!Error.empty()) { - errs() << Error; - return debugCodeGeneratorCrash(ErrMsg); - } - return false; - } - - outs() << "\n*** Input program does not match reference diff!\n"; - outs() << "Debugging code generator problem!\n"; - bool Failure = debugCodeGenerator(&Error); - if (!Error.empty()) { - errs() << Error; - return debugCodeGeneratorCrash(ErrMsg); - } - return Failure; -} - -void llvm::PrintFunctionList(const std::vector &Funcs) { - unsigned NumPrint = Funcs.size(); - if (NumPrint > 10) NumPrint = 10; - for (unsigned i = 0; i != NumPrint; ++i) - outs() << " " << Funcs[i]->getName(); - if (NumPrint < Funcs.size()) - outs() << "... <" << Funcs.size() << " total>"; - outs().flush(); -} - -void llvm::PrintGlobalVariableList(const std::vector &GVs) { - unsigned NumPrint = GVs.size(); - if (NumPrint > 10) NumPrint = 10; - for (unsigned i = 0; i != NumPrint; ++i) - outs() << " " << GVs[i]->getName(); - if (NumPrint < GVs.size()) - outs() << "... <" << GVs.size() << " total>"; - outs().flush(); -} diff --git a/contrib/llvm/tools/bugpoint/BugDriver.h b/contrib/llvm/tools/bugpoint/BugDriver.h deleted file mode 100644 index e48806aee6bc..000000000000 --- a/contrib/llvm/tools/bugpoint/BugDriver.h +++ /dev/null @@ -1,329 +0,0 @@ -//===- BugDriver.h - Top-Level BugPoint class -------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This class contains all of the shared state and information that is used by -// the BugPoint tool to track down errors in optimizations. This class is the -// main driver class that invokes all sub-functionality. -// -//===----------------------------------------------------------------------===// - -#ifndef BUGDRIVER_H -#define BUGDRIVER_H - -#include "llvm/ADT/ValueMap.h" -#include -#include - -namespace llvm { - -class Value; -class PassInfo; -class Module; -class GlobalVariable; -class Function; -class BasicBlock; -class AbstractInterpreter; -class Instruction; -class LLVMContext; - -class DebugCrashes; - -class GCC; - -extern bool DisableSimplifyCFG; - -/// BugpointIsInterrupted - Set to true when the user presses ctrl-c. -/// -extern bool BugpointIsInterrupted; - -class BugDriver { - LLVMContext& Context; - const char *ToolName; // argv[0] of bugpoint - std::string ReferenceOutputFile; // Name of `good' output file - Module *Program; // The raw program, linked together - std::vector PassesToRun; - AbstractInterpreter *Interpreter; // How to run the program - AbstractInterpreter *SafeInterpreter; // To generate reference output, etc. - GCC *gcc; - bool run_find_bugs; - unsigned Timeout; - unsigned MemoryLimit; - bool UseValgrind; - - // FIXME: sort out public/private distinctions... - friend class ReducePassList; - friend class ReduceMisCodegenFunctions; - -public: - BugDriver(const char *toolname, bool find_bugs, - unsigned timeout, unsigned memlimit, bool use_valgrind, - LLVMContext& ctxt); - ~BugDriver(); - - const char *getToolName() const { return ToolName; } - - LLVMContext& getContext() const { return Context; } - - // Set up methods... these methods are used to copy information about the - // command line arguments into instance variables of BugDriver. - // - bool addSources(const std::vector &FileNames); - void addPass(std::string p) { PassesToRun.push_back(p); } - void setPassesToRun(const std::vector &PTR) { - PassesToRun = PTR; - } - const std::vector &getPassesToRun() const { - return PassesToRun; - } - - /// run - The top level method that is invoked after all of the instance - /// variables are set up from command line arguments. The \p as_child argument - /// indicates whether the driver is to run in parent mode or child mode. - /// - bool run(std::string &ErrMsg); - - /// debugOptimizerCrash - This method is called when some optimizer pass - /// crashes on input. It attempts to prune down the testcase to something - /// reasonable, and figure out exactly which pass is crashing. - /// - bool debugOptimizerCrash(const std::string &ID = "passes"); - - /// debugCodeGeneratorCrash - This method is called when the code generator - /// crashes on an input. It attempts to reduce the input as much as possible - /// while still causing the code generator to crash. - bool debugCodeGeneratorCrash(std::string &Error); - - /// debugMiscompilation - This method is used when the passes selected are not - /// crashing, but the generated output is semantically different from the - /// input. - void debugMiscompilation(std::string *Error); - - /// debugPassMiscompilation - This method is called when the specified pass - /// miscompiles Program as input. It tries to reduce the testcase to - /// something that smaller that still miscompiles the program. - /// ReferenceOutput contains the filename of the file containing the output we - /// are to match. - /// - bool debugPassMiscompilation(const PassInfo *ThePass, - const std::string &ReferenceOutput); - - /// compileSharedObject - This method creates a SharedObject from a given - /// BitcodeFile for debugging a code generator. - /// - std::string compileSharedObject(const std::string &BitcodeFile, - std::string &Error); - - /// debugCodeGenerator - This method narrows down a module to a function or - /// set of functions, using the CBE as a ``safe'' code generator for other - /// functions that are not under consideration. - bool debugCodeGenerator(std::string *Error); - - /// isExecutingJIT - Returns true if bugpoint is currently testing the JIT - /// - bool isExecutingJIT(); - - /// runPasses - Run all of the passes in the "PassesToRun" list, discard the - /// output, and return true if any of the passes crashed. - bool runPasses(Module *M) const { - return runPasses(M, PassesToRun); - } - - Module *getProgram() const { return Program; } - - /// swapProgramIn - Set the current module to the specified module, returning - /// the old one. - Module *swapProgramIn(Module *M) { - Module *OldProgram = Program; - Program = M; - return OldProgram; - } - - AbstractInterpreter *switchToSafeInterpreter() { - AbstractInterpreter *Old = Interpreter; - Interpreter = (AbstractInterpreter*)SafeInterpreter; - return Old; - } - - void switchToInterpreter(AbstractInterpreter *AI) { - Interpreter = AI; - } - - /// setNewProgram - If we reduce or update the program somehow, call this - /// method to update bugdriver with it. This deletes the old module and sets - /// the specified one as the current program. - void setNewProgram(Module *M); - - /// compileProgram - Try to compile the specified module, returning false and - /// setting Error if an error occurs. This is used for code generation - /// crash testing. - /// - void compileProgram(Module *M, std::string *Error) const; - - /// executeProgram - This method runs "Program", capturing the output of the - /// program to a file. A recommended filename may be optionally specified. - /// - std::string executeProgram(const Module *Program, - std::string OutputFilename, - std::string Bitcode, - const std::string &SharedObjects, - AbstractInterpreter *AI, - std::string *Error) const; - - /// executeProgramSafely - Used to create reference output with the "safe" - /// backend, if reference output is not provided. If there is a problem with - /// the code generator (e.g., llc crashes), this will return false and set - /// Error. - /// - std::string executeProgramSafely(const Module *Program, - std::string OutputFile, - std::string *Error) const; - - /// createReferenceFile - calls compileProgram and then records the output - /// into ReferenceOutputFile. Returns true if reference file created, false - /// otherwise. Note: initializeExecutionEnvironment should be called BEFORE - /// this function. - /// - bool createReferenceFile(Module *M, const std::string &Filename - = "bugpoint.reference.out"); - - /// diffProgram - This method executes the specified module and diffs the - /// output against the file specified by ReferenceOutputFile. If the output - /// is different, 1 is returned. If there is a problem with the code - /// generator (e.g., llc crashes), this will return -1 and set Error. - /// - bool diffProgram(const Module *Program, - const std::string &BitcodeFile = "", - const std::string &SharedObj = "", - bool RemoveBitcode = false, - std::string *Error = 0) const; - - /// EmitProgressBitcode - This function is used to output M to a file named - /// "bugpoint-ID.bc". - /// - void EmitProgressBitcode(const Module *M, const std::string &ID, - bool NoFlyer = false) const; - - /// deleteInstructionFromProgram - This method clones the current Program and - /// deletes the specified instruction from the cloned module. It then runs a - /// series of cleanup passes (ADCE and SimplifyCFG) to eliminate any code - /// which depends on the value. The modified module is then returned. - /// - Module *deleteInstructionFromProgram(const Instruction *I, unsigned Simp); - - /// performFinalCleanups - This method clones the current Program and performs - /// a series of cleanups intended to get rid of extra cruft on the module. If - /// the MayModifySemantics argument is true, then the cleanups is allowed to - /// modify how the code behaves. - /// - Module *performFinalCleanups(Module *M, bool MayModifySemantics = false); - - /// ExtractLoop - Given a module, extract up to one loop from it into a new - /// function. This returns null if there are no extractable loops in the - /// program or if the loop extractor crashes. - Module *ExtractLoop(Module *M); - - /// ExtractMappedBlocksFromModule - Extract all but the specified basic blocks - /// into their own functions. The only detail is that M is actually a module - /// cloned from the one the BBs are in, so some mapping needs to be performed. - /// If this operation fails for some reason (ie the implementation is buggy), - /// this function should return null, otherwise it returns a new Module. - Module *ExtractMappedBlocksFromModule(const std::vector &BBs, - Module *M); - - /// runPassesOn - Carefully run the specified set of pass on the specified - /// module, returning the transformed module on success, or a null pointer on - /// failure. If AutoDebugCrashes is set to true, then bugpoint will - /// automatically attempt to track down a crashing pass if one exists, and - /// this method will never return null. - Module *runPassesOn(Module *M, const std::vector &Passes, - bool AutoDebugCrashes = false, unsigned NumExtraArgs = 0, - const char * const *ExtraArgs = NULL); - - /// runPasses - Run the specified passes on Program, outputting a bitcode - /// file and writting the filename into OutputFile if successful. If the - /// optimizations fail for some reason (optimizer crashes), return true, - /// otherwise return false. If DeleteOutput is set to true, the bitcode is - /// deleted on success, and the filename string is undefined. This prints to - /// outs() a single line message indicating whether compilation was successful - /// or failed, unless Quiet is set. ExtraArgs specifies additional arguments - /// to pass to the child bugpoint instance. - /// - bool runPasses(Module *Program, - const std::vector &PassesToRun, - std::string &OutputFilename, bool DeleteOutput = false, - bool Quiet = false, unsigned NumExtraArgs = 0, - const char * const *ExtraArgs = NULL) const; - - /// runManyPasses - Take the specified pass list and create different - /// combinations of passes to compile the program with. Compile the program with - /// each set and mark test to see if it compiled correctly. If the passes - /// compiled correctly output nothing and rearrange the passes into a new order. - /// If the passes did not compile correctly, output the command required to - /// recreate the failure. This returns true if a compiler error is found. - /// - bool runManyPasses(const std::vector &AllPasses, - std::string &ErrMsg); - - /// writeProgramToFile - This writes the current "Program" to the named - /// bitcode file. If an error occurs, true is returned. - /// - bool writeProgramToFile(const std::string &Filename, const Module *M) const; - -private: - /// runPasses - Just like the method above, but this just returns true or - /// false indicating whether or not the optimizer crashed on the specified - /// input (true = crashed). - /// - bool runPasses(Module *M, - const std::vector &PassesToRun, - bool DeleteOutput = true) const { - std::string Filename; - return runPasses(M, PassesToRun, Filename, DeleteOutput); - } - - /// initializeExecutionEnvironment - This method is used to set up the - /// environment for executing LLVM programs. - /// - bool initializeExecutionEnvironment(); -}; - -/// ParseInputFile - Given a bitcode or assembly input filename, parse and -/// return it, or return null if not possible. -/// -Module *ParseInputFile(const std::string &InputFilename, - LLVMContext& ctxt); - - -/// getPassesString - Turn a list of passes into a string which indicates the -/// command line options that must be passed to add the passes. -/// -std::string getPassesString(const std::vector &Passes); - -/// PrintFunctionList - prints out list of problematic functions -/// -void PrintFunctionList(const std::vector &Funcs); - -/// PrintGlobalVariableList - prints out list of problematic global variables -/// -void PrintGlobalVariableList(const std::vector &GVs); - -// DeleteFunctionBody - "Remove" the function by deleting all of it's basic -// blocks, making it external. -// -void DeleteFunctionBody(Function *F); - -/// SplitFunctionsOutOfModule - Given a module and a list of functions in the -/// module, split the functions OUT of the specified module, and place them in -/// the new module. -Module *SplitFunctionsOutOfModule(Module *M, const std::vector &F, - ValueMap &VMap); - -} // End llvm namespace - -#endif diff --git a/contrib/llvm/tools/bugpoint/CMakeLists.txt b/contrib/llvm/tools/bugpoint/CMakeLists.txt deleted file mode 100644 index e06feb100312..000000000000 --- a/contrib/llvm/tools/bugpoint/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -set(LLVM_LINK_COMPONENTS asmparser instrumentation scalaropts ipo - linker bitreader bitwriter) - -add_llvm_tool(bugpoint - BugDriver.cpp - CrashDebugger.cpp - ExecutionDriver.cpp - ExtractFunction.cpp - FindBugs.cpp - Miscompilation.cpp - OptimizerDriver.cpp - ToolRunner.cpp - bugpoint.cpp - ) diff --git a/contrib/llvm/tools/bugpoint/CrashDebugger.cpp b/contrib/llvm/tools/bugpoint/CrashDebugger.cpp deleted file mode 100644 index 57dc1c830c10..000000000000 --- a/contrib/llvm/tools/bugpoint/CrashDebugger.cpp +++ /dev/null @@ -1,667 +0,0 @@ -//===- CrashDebugger.cpp - Debug compilation crashes ----------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the bugpoint internals that narrow down compilation crashes -// -//===----------------------------------------------------------------------===// - -#include "BugDriver.h" -#include "ToolRunner.h" -#include "ListReducer.h" -#include "llvm/Constants.h" -#include "llvm/DerivedTypes.h" -#include "llvm/Instructions.h" -#include "llvm/Module.h" -#include "llvm/Pass.h" -#include "llvm/PassManager.h" -#include "llvm/ValueSymbolTable.h" -#include "llvm/ADT/SmallPtrSet.h" -#include "llvm/Analysis/Verifier.h" -#include "llvm/Support/CFG.h" -#include "llvm/Transforms/Scalar.h" -#include "llvm/Transforms/Utils/Cloning.h" -#include "llvm/Support/FileUtilities.h" -#include "llvm/Support/CommandLine.h" -#include -using namespace llvm; - -namespace { - cl::opt - KeepMain("keep-main", - cl::desc("Force function reduction to keep main"), - cl::init(false)); - cl::opt - NoGlobalRM ("disable-global-remove", - cl::desc("Do not remove global variables"), - cl::init(false)); -} - -namespace llvm { - class ReducePassList : public ListReducer { - BugDriver &BD; - public: - ReducePassList(BugDriver &bd) : BD(bd) {} - - // doTest - Return true iff running the "removed" passes succeeds, and - // running the "Kept" passes fail when run on the output of the "removed" - // passes. If we return true, we update the current module of bugpoint. - // - virtual TestResult doTest(std::vector &Removed, - std::vector &Kept, - std::string &Error); - }; -} - -ReducePassList::TestResult -ReducePassList::doTest(std::vector &Prefix, - std::vector &Suffix, - std::string &Error) { - sys::Path PrefixOutput; - Module *OrigProgram = 0; - if (!Prefix.empty()) { - outs() << "Checking to see if these passes crash: " - << getPassesString(Prefix) << ": "; - std::string PfxOutput; - if (BD.runPasses(BD.getProgram(), Prefix, PfxOutput)) - return KeepPrefix; - - PrefixOutput.set(PfxOutput); - OrigProgram = BD.Program; - - BD.Program = ParseInputFile(PrefixOutput.str(), BD.getContext()); - if (BD.Program == 0) { - errs() << BD.getToolName() << ": Error reading bitcode file '" - << PrefixOutput.str() << "'!\n"; - exit(1); - } - PrefixOutput.eraseFromDisk(); - } - - outs() << "Checking to see if these passes crash: " - << getPassesString(Suffix) << ": "; - - if (BD.runPasses(BD.getProgram(), Suffix)) { - delete OrigProgram; // The suffix crashes alone... - return KeepSuffix; - } - - // Nothing failed, restore state... - if (OrigProgram) { - delete BD.Program; - BD.Program = OrigProgram; - } - return NoFailure; -} - -namespace { - /// ReduceCrashingGlobalVariables - This works by removing the global - /// variable's initializer and seeing if the program still crashes. If it - /// does, then we keep that program and try again. - /// - class ReduceCrashingGlobalVariables : public ListReducer { - BugDriver &BD; - bool (*TestFn)(const BugDriver &, Module *); - public: - ReduceCrashingGlobalVariables(BugDriver &bd, - bool (*testFn)(const BugDriver &, Module *)) - : BD(bd), TestFn(testFn) {} - - virtual TestResult doTest(std::vector &Prefix, - std::vector &Kept, - std::string &Error) { - if (!Kept.empty() && TestGlobalVariables(Kept)) - return KeepSuffix; - if (!Prefix.empty() && TestGlobalVariables(Prefix)) - return KeepPrefix; - return NoFailure; - } - - bool TestGlobalVariables(std::vector &GVs); - }; -} - -bool -ReduceCrashingGlobalVariables::TestGlobalVariables( - std::vector &GVs) { - // Clone the program to try hacking it apart... - ValueMap VMap; - Module *M = CloneModule(BD.getProgram(), VMap); - - // Convert list to set for fast lookup... - std::set GVSet; - - for (unsigned i = 0, e = GVs.size(); i != e; ++i) { - GlobalVariable* CMGV = cast(VMap[GVs[i]]); - assert(CMGV && "Global Variable not in module?!"); - GVSet.insert(CMGV); - } - - outs() << "Checking for crash with only these global variables: "; - PrintGlobalVariableList(GVs); - outs() << ": "; - - // Loop over and delete any global variables which we aren't supposed to be - // playing with... - for (Module::global_iterator I = M->global_begin(), E = M->global_end(); - I != E; ++I) - if (I->hasInitializer() && !GVSet.count(I)) { - I->setInitializer(0); - I->setLinkage(GlobalValue::ExternalLinkage); - } - - // Try running the hacked up program... - if (TestFn(BD, M)) { - BD.setNewProgram(M); // It crashed, keep the trimmed version... - - // Make sure to use global variable pointers that point into the now-current - // module. - GVs.assign(GVSet.begin(), GVSet.end()); - return true; - } - - delete M; - return false; -} - -namespace llvm { - /// ReduceCrashingFunctions reducer - This works by removing functions and - /// seeing if the program still crashes. If it does, then keep the newer, - /// smaller program. - /// - class ReduceCrashingFunctions : public ListReducer { - BugDriver &BD; - bool (*TestFn)(const BugDriver &, Module *); - public: - ReduceCrashingFunctions(BugDriver &bd, - bool (*testFn)(const BugDriver &, Module *)) - : BD(bd), TestFn(testFn) {} - - virtual TestResult doTest(std::vector &Prefix, - std::vector &Kept, - std::string &Error) { - if (!Kept.empty() && TestFuncs(Kept)) - return KeepSuffix; - if (!Prefix.empty() && TestFuncs(Prefix)) - return KeepPrefix; - return NoFailure; - } - - bool TestFuncs(std::vector &Prefix); - }; -} - -bool ReduceCrashingFunctions::TestFuncs(std::vector &Funcs) { - - //if main isn't present, claim there is no problem - if (KeepMain && find(Funcs.begin(), Funcs.end(), - BD.getProgram()->getFunction("main")) == Funcs.end()) - return false; - - // Clone the program to try hacking it apart... - ValueMap VMap; - Module *M = CloneModule(BD.getProgram(), VMap); - - // Convert list to set for fast lookup... - std::set Functions; - for (unsigned i = 0, e = Funcs.size(); i != e; ++i) { - Function *CMF = cast(VMap[Funcs[i]]); - assert(CMF && "Function not in module?!"); - assert(CMF->getFunctionType() == Funcs[i]->getFunctionType() && "wrong ty"); - assert(CMF->getName() == Funcs[i]->getName() && "wrong name"); - Functions.insert(CMF); - } - - outs() << "Checking for crash with only these functions: "; - PrintFunctionList(Funcs); - outs() << ": "; - - // Loop over and delete any functions which we aren't supposed to be playing - // with... - for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) - if (!I->isDeclaration() && !Functions.count(I)) - DeleteFunctionBody(I); - - // Try running the hacked up program... - if (TestFn(BD, M)) { - BD.setNewProgram(M); // It crashed, keep the trimmed version... - - // Make sure to use function pointers that point into the now-current - // module. - Funcs.assign(Functions.begin(), Functions.end()); - return true; - } - delete M; - return false; -} - - -namespace { - /// ReduceCrashingBlocks reducer - This works by setting the terminators of - /// all terminators except the specified basic blocks to a 'ret' instruction, - /// then running the simplify-cfg pass. This has the effect of chopping up - /// the CFG really fast which can reduce large functions quickly. - /// - class ReduceCrashingBlocks : public ListReducer { - BugDriver &BD; - bool (*TestFn)(const BugDriver &, Module *); - public: - ReduceCrashingBlocks(BugDriver &bd, - bool (*testFn)(const BugDriver &, Module *)) - : BD(bd), TestFn(testFn) {} - - virtual TestResult doTest(std::vector &Prefix, - std::vector &Kept, - std::string &Error) { - if (!Kept.empty() && TestBlocks(Kept)) - return KeepSuffix; - if (!Prefix.empty() && TestBlocks(Prefix)) - return KeepPrefix; - return NoFailure; - } - - bool TestBlocks(std::vector &Prefix); - }; -} - -bool ReduceCrashingBlocks::TestBlocks(std::vector &BBs) { - // Clone the program to try hacking it apart... - ValueMap VMap; - Module *M = CloneModule(BD.getProgram(), VMap); - - // Convert list to set for fast lookup... - SmallPtrSet Blocks; - for (unsigned i = 0, e = BBs.size(); i != e; ++i) - Blocks.insert(cast(VMap[BBs[i]])); - - outs() << "Checking for crash with only these blocks:"; - unsigned NumPrint = Blocks.size(); - if (NumPrint > 10) NumPrint = 10; - for (unsigned i = 0, e = NumPrint; i != e; ++i) - outs() << " " << BBs[i]->getName(); - if (NumPrint < Blocks.size()) - outs() << "... <" << Blocks.size() << " total>"; - outs() << ": "; - - // Loop over and delete any hack up any blocks that are not listed... - for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) - for (Function::iterator BB = I->begin(), E = I->end(); BB != E; ++BB) - if (!Blocks.count(BB) && BB->getTerminator()->getNumSuccessors()) { - // Loop over all of the successors of this block, deleting any PHI nodes - // that might include it. - for (succ_iterator SI = succ_begin(BB), E = succ_end(BB); SI != E; ++SI) - (*SI)->removePredecessor(BB); - - TerminatorInst *BBTerm = BB->getTerminator(); - - if (!BB->getTerminator()->getType()->isVoidTy()) - BBTerm->replaceAllUsesWith(Constant::getNullValue(BBTerm->getType())); - - // Replace the old terminator instruction. - BB->getInstList().pop_back(); - new UnreachableInst(BB->getContext(), BB); - } - - // The CFG Simplifier pass may delete one of the basic blocks we are - // interested in. If it does we need to take the block out of the list. Make - // a "persistent mapping" by turning basic blocks into pairs. - // This won't work well if blocks are unnamed, but that is just the risk we - // have to take. - std::vector > BlockInfo; - - for (SmallPtrSet::iterator I = Blocks.begin(), - E = Blocks.end(); I != E; ++I) - BlockInfo.push_back(std::make_pair((*I)->getParent()->getName(), - (*I)->getName())); - - // Now run the CFG simplify pass on the function... - std::vector Passes; - Passes.push_back("simplifycfg"); - Passes.push_back("verify"); - Module *New = BD.runPassesOn(M, Passes); - delete M; - if (!New) { - errs() << "simplifycfg failed!\n"; - exit(1); - } - M = New; - - // Try running on the hacked up program... - if (TestFn(BD, M)) { - BD.setNewProgram(M); // It crashed, keep the trimmed version... - - // Make sure to use basic block pointers that point into the now-current - // module, and that they don't include any deleted blocks. - BBs.clear(); - const ValueSymbolTable &GST = M->getValueSymbolTable(); - for (unsigned i = 0, e = BlockInfo.size(); i != e; ++i) { - Function *F = cast(GST.lookup(BlockInfo[i].first)); - ValueSymbolTable &ST = F->getValueSymbolTable(); - Value* V = ST.lookup(BlockInfo[i].second); - if (V && V->getType() == Type::getLabelTy(V->getContext())) - BBs.push_back(cast(V)); - } - return true; - } - delete M; // It didn't crash, try something else. - return false; -} - -namespace { - /// ReduceCrashingInstructions reducer - This works by removing the specified - /// non-terminator instructions and replacing them with undef. - /// - class ReduceCrashingInstructions : public ListReducer { - BugDriver &BD; - bool (*TestFn)(const BugDriver &, Module *); - public: - ReduceCrashingInstructions(BugDriver &bd, - bool (*testFn)(const BugDriver &, Module *)) - : BD(bd), TestFn(testFn) {} - - virtual TestResult doTest(std::vector &Prefix, - std::vector &Kept, - std::string &Error) { - if (!Kept.empty() && TestInsts(Kept)) - return KeepSuffix; - if (!Prefix.empty() && TestInsts(Prefix)) - return KeepPrefix; - return NoFailure; - } - - bool TestInsts(std::vector &Prefix); - }; -} - -bool ReduceCrashingInstructions::TestInsts(std::vector - &Insts) { - // Clone the program to try hacking it apart... - ValueMap VMap; - Module *M = CloneModule(BD.getProgram(), VMap); - - // Convert list to set for fast lookup... - SmallPtrSet Instructions; - for (unsigned i = 0, e = Insts.size(); i != e; ++i) { - assert(!isa(Insts[i])); - Instructions.insert(cast(VMap[Insts[i]])); - } - - outs() << "Checking for crash with only " << Instructions.size(); - if (Instructions.size() == 1) - outs() << " instruction: "; - else - outs() << " instructions: "; - - for (Module::iterator MI = M->begin(), ME = M->end(); MI != ME; ++MI) - for (Function::iterator FI = MI->begin(), FE = MI->end(); FI != FE; ++FI) - for (BasicBlock::iterator I = FI->begin(), E = FI->end(); I != E;) { - Instruction *Inst = I++; - if (!Instructions.count(Inst) && !isa(Inst)) { - if (!Inst->getType()->isVoidTy()) - Inst->replaceAllUsesWith(UndefValue::get(Inst->getType())); - Inst->eraseFromParent(); - } - } - - // Verify that this is still valid. - PassManager Passes; - Passes.add(createVerifierPass()); - Passes.run(*M); - - // Try running on the hacked up program... - if (TestFn(BD, M)) { - BD.setNewProgram(M); // It crashed, keep the trimmed version... - - // Make sure to use instruction pointers that point into the now-current - // module, and that they don't include any deleted blocks. - Insts.clear(); - for (SmallPtrSet::const_iterator I = Instructions.begin(), - E = Instructions.end(); I != E; ++I) - Insts.push_back(*I); - return true; - } - delete M; // It didn't crash, try something else. - return false; -} - -/// DebugACrash - Given a predicate that determines whether a component crashes -/// on a program, try to destructively reduce the program while still keeping -/// the predicate true. -static bool DebugACrash(BugDriver &BD, - bool (*TestFn)(const BugDriver &, Module *), - std::string &Error) { - // See if we can get away with nuking some of the global variable initializers - // in the program... - if (!NoGlobalRM && - BD.getProgram()->global_begin() != BD.getProgram()->global_end()) { - // Now try to reduce the number of global variable initializers in the - // module to something small. - Module *M = CloneModule(BD.getProgram()); - bool DeletedInit = false; - - for (Module::global_iterator I = M->global_begin(), E = M->global_end(); - I != E; ++I) - if (I->hasInitializer()) { - I->setInitializer(0); - I->setLinkage(GlobalValue::ExternalLinkage); - DeletedInit = true; - } - - if (!DeletedInit) { - delete M; // No change made... - } else { - // See if the program still causes a crash... - outs() << "\nChecking to see if we can delete global inits: "; - - if (TestFn(BD, M)) { // Still crashes? - BD.setNewProgram(M); - outs() << "\n*** Able to remove all global initializers!\n"; - } else { // No longer crashes? - outs() << " - Removing all global inits hides problem!\n"; - delete M; - - std::vector GVs; - - for (Module::global_iterator I = BD.getProgram()->global_begin(), - E = BD.getProgram()->global_end(); I != E; ++I) - if (I->hasInitializer()) - GVs.push_back(I); - - if (GVs.size() > 1 && !BugpointIsInterrupted) { - outs() << "\n*** Attempting to reduce the number of global " - << "variables in the testcase\n"; - - unsigned OldSize = GVs.size(); - ReduceCrashingGlobalVariables(BD, TestFn).reduceList(GVs, Error); - if (!Error.empty()) - return true; - - if (GVs.size() < OldSize) - BD.EmitProgressBitcode(BD.getProgram(), "reduced-global-variables"); - } - } - } - } - - // Now try to reduce the number of functions in the module to something small. - std::vector Functions; - for (Module::iterator I = BD.getProgram()->begin(), - E = BD.getProgram()->end(); I != E; ++I) - if (!I->isDeclaration()) - Functions.push_back(I); - - if (Functions.size() > 1 && !BugpointIsInterrupted) { - outs() << "\n*** Attempting to reduce the number of functions " - "in the testcase\n"; - - unsigned OldSize = Functions.size(); - ReduceCrashingFunctions(BD, TestFn).reduceList(Functions, Error); - - if (Functions.size() < OldSize) - BD.EmitProgressBitcode(BD.getProgram(), "reduced-function"); - } - - // Attempt to delete entire basic blocks at a time to speed up - // convergence... this actually works by setting the terminator of the blocks - // to a return instruction then running simplifycfg, which can potentially - // shrinks the code dramatically quickly - // - if (!DisableSimplifyCFG && !BugpointIsInterrupted) { - std::vector Blocks; - for (Module::const_iterator I = BD.getProgram()->begin(), - E = BD.getProgram()->end(); I != E; ++I) - for (Function::const_iterator FI = I->begin(), E = I->end(); FI !=E; ++FI) - Blocks.push_back(FI); - unsigned OldSize = Blocks.size(); - ReduceCrashingBlocks(BD, TestFn).reduceList(Blocks, Error); - if (Blocks.size() < OldSize) - BD.EmitProgressBitcode(BD.getProgram(), "reduced-blocks"); - } - - // Attempt to delete instructions using bisection. This should help out nasty - // cases with large basic blocks where the problem is at one end. - if (!BugpointIsInterrupted) { - std::vector Insts; - for (Module::const_iterator MI = BD.getProgram()->begin(), - ME = BD.getProgram()->end(); MI != ME; ++MI) - for (Function::const_iterator FI = MI->begin(), FE = MI->end(); FI != FE; - ++FI) - for (BasicBlock::const_iterator I = FI->begin(), E = FI->end(); - I != E; ++I) - if (!isa(I)) - Insts.push_back(I); - - ReduceCrashingInstructions(BD, TestFn).reduceList(Insts, Error); - } - - // FIXME: This should use the list reducer to converge faster by deleting - // larger chunks of instructions at a time! - unsigned Simplification = 2; - do { - if (BugpointIsInterrupted) break; - --Simplification; - outs() << "\n*** Attempting to reduce testcase by deleting instruc" - << "tions: Simplification Level #" << Simplification << '\n'; - - // Now that we have deleted the functions that are unnecessary for the - // program, try to remove instructions that are not necessary to cause the - // crash. To do this, we loop through all of the instructions in the - // remaining functions, deleting them (replacing any values produced with - // nulls), and then running ADCE and SimplifyCFG. If the transformed input - // still triggers failure, keep deleting until we cannot trigger failure - // anymore. - // - unsigned InstructionsToSkipBeforeDeleting = 0; - TryAgain: - - // Loop over all of the (non-terminator) instructions remaining in the - // function, attempting to delete them. - unsigned CurInstructionNum = 0; - for (Module::const_iterator FI = BD.getProgram()->begin(), - E = BD.getProgram()->end(); FI != E; ++FI) - if (!FI->isDeclaration()) - for (Function::const_iterator BI = FI->begin(), E = FI->end(); BI != E; - ++BI) - for (BasicBlock::const_iterator I = BI->begin(), E = --BI->end(); - I != E; ++I, ++CurInstructionNum) - if (InstructionsToSkipBeforeDeleting) { - --InstructionsToSkipBeforeDeleting; - } else { - if (BugpointIsInterrupted) goto ExitLoops; - - outs() << "Checking instruction: " << *I; - Module *M = BD.deleteInstructionFromProgram(I, Simplification); - - // Find out if the pass still crashes on this pass... - if (TestFn(BD, M)) { - // Yup, it does, we delete the old module, and continue trying - // to reduce the testcase... - BD.setNewProgram(M); - InstructionsToSkipBeforeDeleting = CurInstructionNum; - goto TryAgain; // I wish I had a multi-level break here! - } - - // This pass didn't crash without this instruction, try the next - // one. - delete M; - } - - if (InstructionsToSkipBeforeDeleting) { - InstructionsToSkipBeforeDeleting = 0; - goto TryAgain; - } - - } while (Simplification); -ExitLoops: - - // Try to clean up the testcase by running funcresolve and globaldce... - if (!BugpointIsInterrupted) { - outs() << "\n*** Attempting to perform final cleanups: "; - Module *M = CloneModule(BD.getProgram()); - M = BD.performFinalCleanups(M, true); - - // Find out if the pass still crashes on the cleaned up program... - if (TestFn(BD, M)) { - BD.setNewProgram(M); // Yup, it does, keep the reduced version... - } else { - delete M; - } - } - - BD.EmitProgressBitcode(BD.getProgram(), "reduced-simplified"); - - return false; -} - -static bool TestForOptimizerCrash(const BugDriver &BD, Module *M) { - return BD.runPasses(M); -} - -/// debugOptimizerCrash - This method is called when some pass crashes on input. -/// It attempts to prune down the testcase to something reasonable, and figure -/// out exactly which pass is crashing. -/// -bool BugDriver::debugOptimizerCrash(const std::string &ID) { - outs() << "\n*** Debugging optimizer crash!\n"; - - std::string Error; - // Reduce the list of passes which causes the optimizer to crash... - if (!BugpointIsInterrupted) - ReducePassList(*this).reduceList(PassesToRun, Error); - assert(Error.empty()); - - outs() << "\n*** Found crashing pass" - << (PassesToRun.size() == 1 ? ": " : "es: ") - << getPassesString(PassesToRun) << '\n'; - - EmitProgressBitcode(Program, ID); - - bool Success = DebugACrash(*this, TestForOptimizerCrash, Error); - assert(Error.empty()); - return Success; -} - -static bool TestForCodeGenCrash(const BugDriver &BD, Module *M) { - std::string Error; - BD.compileProgram(M, &Error); - if (!Error.empty()) { - errs() << "\n"; - return true; // Tool is still crashing. - } - errs() << '\n'; - return false; -} - -/// debugCodeGeneratorCrash - This method is called when the code generator -/// crashes on an input. It attempts to reduce the input as much as possible -/// while still causing the code generator to crash. -bool BugDriver::debugCodeGeneratorCrash(std::string &Error) { - errs() << "*** Debugging code generator crash!\n"; - - return DebugACrash(*this, TestForCodeGenCrash, Error); -} diff --git a/contrib/llvm/tools/bugpoint/ExecutionDriver.cpp b/contrib/llvm/tools/bugpoint/ExecutionDriver.cpp deleted file mode 100644 index 731248493247..000000000000 --- a/contrib/llvm/tools/bugpoint/ExecutionDriver.cpp +++ /dev/null @@ -1,501 +0,0 @@ -//===- ExecutionDriver.cpp - Allow execution of LLVM program --------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains code used to execute the program utilizing one of the -// various ways of running LLVM bitcode. -// -//===----------------------------------------------------------------------===// - -#include "BugDriver.h" -#include "ToolRunner.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/Debug.h" -#include "llvm/Support/FileUtilities.h" -#include "llvm/Support/SystemUtils.h" -#include "llvm/Support/raw_ostream.h" -#include - -using namespace llvm; - -namespace { - // OutputType - Allow the user to specify the way code should be run, to test - // for miscompilation. - // - enum OutputType { - AutoPick, RunLLI, RunJIT, RunLLC, RunLLCIA, RunCBE, CBE_bug, LLC_Safe,Custom - }; - - cl::opt - AbsTolerance("abs-tolerance", cl::desc("Absolute error tolerated"), - cl::init(0.0)); - cl::opt - RelTolerance("rel-tolerance", cl::desc("Relative error tolerated"), - cl::init(0.0)); - - cl::opt - InterpreterSel(cl::desc("Specify the \"test\" i.e. suspect back-end:"), - cl::values(clEnumValN(AutoPick, "auto", "Use best guess"), - clEnumValN(RunLLI, "run-int", - "Execute with the interpreter"), - clEnumValN(RunJIT, "run-jit", "Execute with JIT"), - clEnumValN(RunLLC, "run-llc", "Compile with LLC"), - clEnumValN(RunLLCIA, "run-llc-ia", - "Compile with LLC with integrated assembler"), - clEnumValN(RunCBE, "run-cbe", "Compile with CBE"), - clEnumValN(CBE_bug,"cbe-bug", "Find CBE bugs"), - clEnumValN(LLC_Safe, "llc-safe", "Use LLC for all"), - clEnumValN(Custom, "run-custom", - "Use -exec-command to define a command to execute " - "the bitcode. Useful for cross-compilation."), - clEnumValEnd), - cl::init(AutoPick)); - - cl::opt - SafeInterpreterSel(cl::desc("Specify \"safe\" i.e. known-good backend:"), - cl::values(clEnumValN(AutoPick, "safe-auto", "Use best guess"), - clEnumValN(RunLLC, "safe-run-llc", "Compile with LLC"), - clEnumValN(RunCBE, "safe-run-cbe", "Compile with CBE"), - clEnumValN(Custom, "safe-run-custom", - "Use -exec-command to define a command to execute " - "the bitcode. Useful for cross-compilation."), - clEnumValEnd), - cl::init(AutoPick)); - - cl::opt - SafeInterpreterPath("safe-path", - cl::desc("Specify the path to the \"safe\" backend program"), - cl::init("")); - - cl::opt - AppendProgramExitCode("append-exit-code", - cl::desc("Append the exit code to the output so it gets diff'd too"), - cl::init(false)); - - cl::opt - InputFile("input", cl::init("/dev/null"), - cl::desc("Filename to pipe in as stdin (default: /dev/null)")); - - cl::list - AdditionalSOs("additional-so", - cl::desc("Additional shared objects to load " - "into executing programs")); - - cl::list - AdditionalLinkerArgs("Xlinker", - cl::desc("Additional arguments to pass to the linker")); - - cl::opt - CustomExecCommand("exec-command", cl::init("simulate"), - cl::desc("Command to execute the bitcode (use with -run-custom) " - "(default: simulate)")); -} - -namespace llvm { - // Anything specified after the --args option are taken as arguments to the - // program being debugged. - cl::list - InputArgv("args", cl::Positional, cl::desc("..."), - cl::ZeroOrMore, cl::PositionalEatsArgs); - - cl::opt - OutputPrefix("output-prefix", cl::init("bugpoint"), - cl::desc("Prefix to use for outputs (default: 'bugpoint')")); -} - -namespace { - cl::list - ToolArgv("tool-args", cl::Positional, cl::desc("..."), - cl::ZeroOrMore, cl::PositionalEatsArgs); - - cl::list - SafeToolArgv("safe-tool-args", cl::Positional, - cl::desc("..."), - cl::ZeroOrMore, cl::PositionalEatsArgs); - - cl::opt - GCCBinary("gcc", cl::init("gcc"), - cl::desc("The gcc binary to use. (default 'gcc')")); - - cl::list - GCCToolArgv("gcc-tool-args", cl::Positional, - cl::desc("..."), - cl::ZeroOrMore, cl::PositionalEatsArgs); -} - -//===----------------------------------------------------------------------===// -// BugDriver method implementation -// - -/// initializeExecutionEnvironment - This method is used to set up the -/// environment for executing LLVM programs. -/// -bool BugDriver::initializeExecutionEnvironment() { - outs() << "Initializing execution environment: "; - - // Create an instance of the AbstractInterpreter interface as specified on - // the command line - SafeInterpreter = 0; - std::string Message; - - switch (InterpreterSel) { - case AutoPick: - InterpreterSel = RunCBE; - Interpreter = - AbstractInterpreter::createCBE(getToolName(), Message, GCCBinary, - &ToolArgv, &GCCToolArgv); - if (!Interpreter) { - InterpreterSel = RunJIT; - Interpreter = AbstractInterpreter::createJIT(getToolName(), Message, - &ToolArgv); - } - if (!Interpreter) { - InterpreterSel = RunLLC; - Interpreter = AbstractInterpreter::createLLC(getToolName(), Message, - GCCBinary, &ToolArgv, - &GCCToolArgv); - } - if (!Interpreter) { - InterpreterSel = RunLLI; - Interpreter = AbstractInterpreter::createLLI(getToolName(), Message, - &ToolArgv); - } - if (!Interpreter) { - InterpreterSel = AutoPick; - Message = "Sorry, I can't automatically select an interpreter!\n"; - } - break; - case RunLLI: - Interpreter = AbstractInterpreter::createLLI(getToolName(), Message, - &ToolArgv); - break; - case RunLLC: - case RunLLCIA: - case LLC_Safe: - Interpreter = AbstractInterpreter::createLLC(getToolName(), Message, - GCCBinary, &ToolArgv, - &GCCToolArgv, - InterpreterSel == RunLLCIA); - break; - case RunJIT: - Interpreter = AbstractInterpreter::createJIT(getToolName(), Message, - &ToolArgv); - break; - case RunCBE: - case CBE_bug: - Interpreter = AbstractInterpreter::createCBE(getToolName(), Message, - GCCBinary, &ToolArgv, - &GCCToolArgv); - break; - case Custom: - Interpreter = AbstractInterpreter::createCustom(Message, CustomExecCommand); - break; - default: - Message = "Sorry, this back-end is not supported by bugpoint right now!\n"; - break; - } - if (!Interpreter) - errs() << Message; - else // Display informational messages on stdout instead of stderr - outs() << Message; - - std::string Path = SafeInterpreterPath; - if (Path.empty()) - Path = getToolName(); - std::vector SafeToolArgs = SafeToolArgv; - switch (SafeInterpreterSel) { - case AutoPick: - // In "cbe-bug" mode, default to using LLC as the "safe" backend. - if (!SafeInterpreter && - InterpreterSel == CBE_bug) { - SafeInterpreterSel = RunLLC; - SafeToolArgs.push_back("--relocation-model=pic"); - SafeInterpreter = AbstractInterpreter::createLLC(Path.c_str(), Message, - GCCBinary, - &SafeToolArgs, - &GCCToolArgv); - } - - // In "llc-safe" mode, default to using LLC as the "safe" backend. - if (!SafeInterpreter && - InterpreterSel == LLC_Safe) { - SafeInterpreterSel = RunLLC; - SafeToolArgs.push_back("--relocation-model=pic"); - SafeInterpreter = AbstractInterpreter::createLLC(Path.c_str(), Message, - GCCBinary, - &SafeToolArgs, - &GCCToolArgv); - } - - // Pick a backend that's different from the test backend. The JIT and - // LLC backends share a lot of code, so prefer to use the CBE as the - // safe back-end when testing them. - if (!SafeInterpreter && - InterpreterSel != RunCBE) { - SafeInterpreterSel = RunCBE; - SafeInterpreter = AbstractInterpreter::createCBE(Path.c_str(), Message, - GCCBinary, - &SafeToolArgs, - &GCCToolArgv); - } - if (!SafeInterpreter && - InterpreterSel != RunLLC && - InterpreterSel != RunJIT) { - SafeInterpreterSel = RunLLC; - SafeToolArgs.push_back("--relocation-model=pic"); - SafeInterpreter = AbstractInterpreter::createLLC(Path.c_str(), Message, - GCCBinary, - &SafeToolArgs, - &GCCToolArgv); - } - if (!SafeInterpreter) { - SafeInterpreterSel = AutoPick; - Message = "Sorry, I can't automatically select an interpreter!\n"; - } - break; - case RunLLC: - case RunLLCIA: - SafeToolArgs.push_back("--relocation-model=pic"); - SafeInterpreter = AbstractInterpreter::createLLC(Path.c_str(), Message, - GCCBinary, &SafeToolArgs, - &GCCToolArgv, - SafeInterpreterSel == RunLLCIA); - break; - case RunCBE: - SafeInterpreter = AbstractInterpreter::createCBE(Path.c_str(), Message, - GCCBinary, &SafeToolArgs, - &GCCToolArgv); - break; - case Custom: - SafeInterpreter = AbstractInterpreter::createCustom(Message, - CustomExecCommand); - break; - default: - Message = "Sorry, this back-end is not supported by bugpoint as the " - "\"safe\" backend right now!\n"; - break; - } - if (!SafeInterpreter) { outs() << Message << "\nExiting.\n"; exit(1); } - - gcc = GCC::create(Message, GCCBinary, &GCCToolArgv); - if (!gcc) { outs() << Message << "\nExiting.\n"; exit(1); } - - // If there was an error creating the selected interpreter, quit with error. - return Interpreter == 0; -} - -/// compileProgram - Try to compile the specified module, returning false and -/// setting Error if an error occurs. This is used for code generation -/// crash testing. -/// -void BugDriver::compileProgram(Module *M, std::string *Error) const { - // Emit the program to a bitcode file... - sys::Path BitcodeFile (OutputPrefix + "-test-program.bc"); - std::string ErrMsg; - if (BitcodeFile.makeUnique(true, &ErrMsg)) { - errs() << ToolName << ": Error making unique filename: " << ErrMsg - << "\n"; - exit(1); - } - if (writeProgramToFile(BitcodeFile.str(), M)) { - errs() << ToolName << ": Error emitting bitcode to file '" - << BitcodeFile.str() << "'!\n"; - exit(1); - } - - // Remove the temporary bitcode file when we are done. - FileRemover BitcodeFileRemover(BitcodeFile, !SaveTemps); - - // Actually compile the program! - Interpreter->compileProgram(BitcodeFile.str(), Error, Timeout, MemoryLimit); -} - - -/// executeProgram - This method runs "Program", capturing the output of the -/// program to a file, returning the filename of the file. A recommended -/// filename may be optionally specified. -/// -std::string BugDriver::executeProgram(const Module *Program, - std::string OutputFile, - std::string BitcodeFile, - const std::string &SharedObj, - AbstractInterpreter *AI, - std::string *Error) const { - if (AI == 0) AI = Interpreter; - assert(AI && "Interpreter should have been created already!"); - bool CreatedBitcode = false; - std::string ErrMsg; - if (BitcodeFile.empty()) { - // Emit the program to a bitcode file... - sys::Path uniqueFilename(OutputPrefix + "-test-program.bc"); - if (uniqueFilename.makeUnique(true, &ErrMsg)) { - errs() << ToolName << ": Error making unique filename: " - << ErrMsg << "!\n"; - exit(1); - } - BitcodeFile = uniqueFilename.str(); - - if (writeProgramToFile(BitcodeFile, Program)) { - errs() << ToolName << ": Error emitting bitcode to file '" - << BitcodeFile << "'!\n"; - exit(1); - } - CreatedBitcode = true; - } - - // Remove the temporary bitcode file when we are done. - sys::Path BitcodePath(BitcodeFile); - FileRemover BitcodeFileRemover(BitcodePath, CreatedBitcode && !SaveTemps); - - if (OutputFile.empty()) OutputFile = OutputPrefix + "-execution-output"; - - // Check to see if this is a valid output filename... - sys::Path uniqueFile(OutputFile); - if (uniqueFile.makeUnique(true, &ErrMsg)) { - errs() << ToolName << ": Error making unique filename: " - << ErrMsg << "\n"; - exit(1); - } - OutputFile = uniqueFile.str(); - - // Figure out which shared objects to run, if any. - std::vector SharedObjs(AdditionalSOs); - if (!SharedObj.empty()) - SharedObjs.push_back(SharedObj); - - int RetVal = AI->ExecuteProgram(BitcodeFile, InputArgv, InputFile, OutputFile, - Error, AdditionalLinkerArgs, SharedObjs, - Timeout, MemoryLimit); - if (!Error->empty()) - return OutputFile; - - if (RetVal == -1) { - errs() << ""; - static bool FirstTimeout = true; - if (FirstTimeout) { - outs() << "\n" - "*** Program execution timed out! This mechanism is designed to handle\n" - " programs stuck in infinite loops gracefully. The -timeout option\n" - " can be used to change the timeout threshold or disable it completely\n" - " (with -timeout=0). This message is only displayed once.\n"; - FirstTimeout = false; - } - } - - if (AppendProgramExitCode) { - std::ofstream outFile(OutputFile.c_str(), std::ios_base::app); - outFile << "exit " << RetVal << '\n'; - outFile.close(); - } - - // Return the filename we captured the output to. - return OutputFile; -} - -/// executeProgramSafely - Used to create reference output with the "safe" -/// backend, if reference output is not provided. -/// -std::string BugDriver::executeProgramSafely(const Module *Program, - std::string OutputFile, - std::string *Error) const { - return executeProgram(Program, OutputFile, "", "", SafeInterpreter, Error); -} - -std::string BugDriver::compileSharedObject(const std::string &BitcodeFile, - std::string &Error) { - assert(Interpreter && "Interpreter should have been created already!"); - sys::Path OutputFile; - - // Using the known-good backend. - GCC::FileType FT = SafeInterpreter->OutputCode(BitcodeFile, OutputFile, - Error); - if (!Error.empty()) - return ""; - - std::string SharedObjectFile; - bool Failure = gcc->MakeSharedObject(OutputFile.str(), FT, SharedObjectFile, - AdditionalLinkerArgs, Error); - if (!Error.empty()) - return ""; - if (Failure) - exit(1); - - // Remove the intermediate C file - OutputFile.eraseFromDisk(); - - return "./" + SharedObjectFile; -} - -/// createReferenceFile - calls compileProgram and then records the output -/// into ReferenceOutputFile. Returns true if reference file created, false -/// otherwise. Note: initializeExecutionEnvironment should be called BEFORE -/// this function. -/// -bool BugDriver::createReferenceFile(Module *M, const std::string &Filename) { - std::string Error; - compileProgram(Program, &Error); - if (!Error.empty()) - return false; - - ReferenceOutputFile = executeProgramSafely(Program, Filename, &Error); - if (!Error.empty()) { - errs() << Error; - if (Interpreter != SafeInterpreter) { - errs() << "*** There is a bug running the \"safe\" backend. Either" - << " debug it (for example with the -run-cbe bugpoint option," - << " if CBE is being used as the \"safe\" backend), or fix the" - << " error some other way.\n"; - } - return false; - } - outs() << "\nReference output is: " << ReferenceOutputFile << "\n\n"; - return true; -} - -/// diffProgram - This method executes the specified module and diffs the -/// output against the file specified by ReferenceOutputFile. If the output -/// is different, 1 is returned. If there is a problem with the code -/// generator (e.g., llc crashes), this will return -1 and set Error. -/// -bool BugDriver::diffProgram(const Module *Program, - const std::string &BitcodeFile, - const std::string &SharedObject, - bool RemoveBitcode, - std::string *ErrMsg) const { - // Execute the program, generating an output file... - sys::Path Output(executeProgram(Program, "", BitcodeFile, SharedObject, 0, - ErrMsg)); - if (!ErrMsg->empty()) - return false; - - std::string Error; - bool FilesDifferent = false; - if (int Diff = DiffFilesWithTolerance(sys::Path(ReferenceOutputFile), - sys::Path(Output.str()), - AbsTolerance, RelTolerance, &Error)) { - if (Diff == 2) { - errs() << "While diffing output: " << Error << '\n'; - exit(1); - } - FilesDifferent = true; - } - else { - // Remove the generated output if there are no differences. - Output.eraseFromDisk(); - } - - // Remove the bitcode file if we are supposed to. - if (RemoveBitcode) - sys::Path(BitcodeFile).eraseFromDisk(); - return FilesDifferent; -} - -bool BugDriver::isExecutingJIT() { - return InterpreterSel == RunJIT; -} - diff --git a/contrib/llvm/tools/bugpoint/ExtractFunction.cpp b/contrib/llvm/tools/bugpoint/ExtractFunction.cpp deleted file mode 100644 index 524f130ba751..000000000000 --- a/contrib/llvm/tools/bugpoint/ExtractFunction.cpp +++ /dev/null @@ -1,369 +0,0 @@ -//===- ExtractFunction.cpp - Extract a function from Program --------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements several methods that are used to extract functions, -// loops, or portions of a module from the rest of the module. -// -//===----------------------------------------------------------------------===// - -#include "BugDriver.h" -#include "llvm/Constants.h" -#include "llvm/DerivedTypes.h" -#include "llvm/LLVMContext.h" -#include "llvm/Module.h" -#include "llvm/PassManager.h" -#include "llvm/Pass.h" -#include "llvm/Analysis/Verifier.h" -#include "llvm/Assembly/Writer.h" -#include "llvm/Transforms/IPO.h" -#include "llvm/Transforms/Scalar.h" -#include "llvm/Transforms/Utils/Cloning.h" -#include "llvm/Transforms/Utils/FunctionUtils.h" -#include "llvm/Target/TargetData.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/Debug.h" -#include "llvm/Support/FileUtilities.h" -#include "llvm/Support/raw_ostream.h" -#include "llvm/System/Path.h" -#include "llvm/System/Signals.h" -#include -using namespace llvm; - -namespace llvm { - bool DisableSimplifyCFG = false; - extern cl::opt OutputPrefix; -} // End llvm namespace - -namespace { - cl::opt - NoDCE ("disable-dce", - cl::desc("Do not use the -dce pass to reduce testcases")); - cl::opt - NoSCFG("disable-simplifycfg", cl::location(DisableSimplifyCFG), - cl::desc("Do not use the -simplifycfg pass to reduce testcases")); -} - -/// deleteInstructionFromProgram - This method clones the current Program and -/// deletes the specified instruction from the cloned module. It then runs a -/// series of cleanup passes (ADCE and SimplifyCFG) to eliminate any code which -/// depends on the value. The modified module is then returned. -/// -Module *BugDriver::deleteInstructionFromProgram(const Instruction *I, - unsigned Simplification) { - // FIXME, use vmap? - Module *Clone = CloneModule(Program); - - const BasicBlock *PBB = I->getParent(); - const Function *PF = PBB->getParent(); - - Module::iterator RFI = Clone->begin(); // Get iterator to corresponding fn - std::advance(RFI, std::distance(PF->getParent()->begin(), - Module::const_iterator(PF))); - - Function::iterator RBI = RFI->begin(); // Get iterator to corresponding BB - std::advance(RBI, std::distance(PF->begin(), Function::const_iterator(PBB))); - - BasicBlock::iterator RI = RBI->begin(); // Get iterator to corresponding inst - std::advance(RI, std::distance(PBB->begin(), BasicBlock::const_iterator(I))); - Instruction *TheInst = RI; // Got the corresponding instruction! - - // If this instruction produces a value, replace any users with null values - if (!TheInst->getType()->isVoidTy()) - TheInst->replaceAllUsesWith(Constant::getNullValue(TheInst->getType())); - - // Remove the instruction from the program. - TheInst->getParent()->getInstList().erase(TheInst); - - // Spiff up the output a little bit. - std::vector Passes; - - /// Can we get rid of the -disable-* options? - if (Simplification > 1 && !NoDCE) - Passes.push_back("dce"); - if (Simplification && !DisableSimplifyCFG) - Passes.push_back("simplifycfg"); // Delete dead control flow - - Passes.push_back("verify"); - Module *New = runPassesOn(Clone, Passes); - delete Clone; - if (!New) { - errs() << "Instruction removal failed. Sorry. :( Please report a bug!\n"; - exit(1); - } - return New; -} - -/// performFinalCleanups - This method clones the current Program and performs -/// a series of cleanups intended to get rid of extra cruft on the module -/// before handing it to the user. -/// -Module *BugDriver::performFinalCleanups(Module *M, bool MayModifySemantics) { - // Make all functions external, so GlobalDCE doesn't delete them... - for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) - I->setLinkage(GlobalValue::ExternalLinkage); - - std::vector CleanupPasses; - CleanupPasses.push_back("globaldce"); - - if (MayModifySemantics) - CleanupPasses.push_back("deadarghaX0r"); - else - CleanupPasses.push_back("deadargelim"); - - CleanupPasses.push_back("deadtypeelim"); - - Module *New = runPassesOn(M, CleanupPasses); - if (New == 0) { - errs() << "Final cleanups failed. Sorry. :( Please report a bug!\n"; - return M; - } - delete M; - return New; -} - - -/// ExtractLoop - Given a module, extract up to one loop from it into a new -/// function. This returns null if there are no extractable loops in the -/// program or if the loop extractor crashes. -Module *BugDriver::ExtractLoop(Module *M) { - std::vector LoopExtractPasses; - LoopExtractPasses.push_back("loop-extract-single"); - - Module *NewM = runPassesOn(M, LoopExtractPasses); - if (NewM == 0) { - outs() << "*** Loop extraction failed: "; - EmitProgressBitcode(M, "loopextraction", true); - outs() << "*** Sorry. :( Please report a bug!\n"; - return 0; - } - - // Check to see if we created any new functions. If not, no loops were - // extracted and we should return null. Limit the number of loops we extract - // to avoid taking forever. - static unsigned NumExtracted = 32; - if (M->size() == NewM->size() || --NumExtracted == 0) { - delete NewM; - return 0; - } else { - assert(M->size() < NewM->size() && "Loop extract removed functions?"); - Module::iterator MI = NewM->begin(); - for (unsigned i = 0, e = M->size(); i != e; ++i) - ++MI; - } - - return NewM; -} - - -// DeleteFunctionBody - "Remove" the function by deleting all of its basic -// blocks, making it external. -// -void llvm::DeleteFunctionBody(Function *F) { - // delete the body of the function... - F->deleteBody(); - assert(F->isDeclaration() && "This didn't make the function external!"); -} - -/// GetTorInit - Given a list of entries for static ctors/dtors, return them -/// as a constant array. -static Constant *GetTorInit(std::vector > &TorList) { - assert(!TorList.empty() && "Don't create empty tor list!"); - std::vector ArrayElts; - for (unsigned i = 0, e = TorList.size(); i != e; ++i) { - std::vector Elts; - Elts.push_back(ConstantInt::get( - Type::getInt32Ty(TorList[i].first->getContext()), TorList[i].second)); - Elts.push_back(TorList[i].first); - ArrayElts.push_back(ConstantStruct::get(TorList[i].first->getContext(), - Elts, false)); - } - return ConstantArray::get(ArrayType::get(ArrayElts[0]->getType(), - ArrayElts.size()), - ArrayElts); -} - -/// SplitStaticCtorDtor - A module was recently split into two parts, M1/M2, and -/// M1 has all of the global variables. If M2 contains any functions that are -/// static ctors/dtors, we need to add an llvm.global_[cd]tors global to M2, and -/// prune appropriate entries out of M1s list. -static void SplitStaticCtorDtor(const char *GlobalName, Module *M1, Module *M2, - ValueMap &VMap) { - GlobalVariable *GV = M1->getNamedGlobal(GlobalName); - if (!GV || GV->isDeclaration() || GV->hasLocalLinkage() || - !GV->use_empty()) return; - - std::vector > M1Tors, M2Tors; - ConstantArray *InitList = dyn_cast(GV->getInitializer()); - if (!InitList) return; - - for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i) { - if (ConstantStruct *CS = dyn_cast(InitList->getOperand(i))){ - if (CS->getNumOperands() != 2) return; // Not array of 2-element structs. - - if (CS->getOperand(1)->isNullValue()) - break; // Found a null terminator, stop here. - - ConstantInt *CI = dyn_cast(CS->getOperand(0)); - int Priority = CI ? CI->getSExtValue() : 0; - - Constant *FP = CS->getOperand(1); - if (ConstantExpr *CE = dyn_cast(FP)) - if (CE->isCast()) - FP = CE->getOperand(0); - if (Function *F = dyn_cast(FP)) { - if (!F->isDeclaration()) - M1Tors.push_back(std::make_pair(F, Priority)); - else { - // Map to M2's version of the function. - F = cast(VMap[F]); - M2Tors.push_back(std::make_pair(F, Priority)); - } - } - } - } - - GV->eraseFromParent(); - if (!M1Tors.empty()) { - Constant *M1Init = GetTorInit(M1Tors); - new GlobalVariable(*M1, M1Init->getType(), false, - GlobalValue::AppendingLinkage, - M1Init, GlobalName); - } - - GV = M2->getNamedGlobal(GlobalName); - assert(GV && "Not a clone of M1?"); - assert(GV->use_empty() && "llvm.ctors shouldn't have uses!"); - - GV->eraseFromParent(); - if (!M2Tors.empty()) { - Constant *M2Init = GetTorInit(M2Tors); - new GlobalVariable(*M2, M2Init->getType(), false, - GlobalValue::AppendingLinkage, - M2Init, GlobalName); - } -} - - -/// SplitFunctionsOutOfModule - Given a module and a list of functions in the -/// module, split the functions OUT of the specified module, and place them in -/// the new module. -Module * -llvm::SplitFunctionsOutOfModule(Module *M, - const std::vector &F, - ValueMap &VMap) { - // Make sure functions & globals are all external so that linkage - // between the two modules will work. - for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) - I->setLinkage(GlobalValue::ExternalLinkage); - for (Module::global_iterator I = M->global_begin(), E = M->global_end(); - I != E; ++I) { - if (I->hasName() && I->getName()[0] == '\01') - I->setName(I->getName().substr(1)); - I->setLinkage(GlobalValue::ExternalLinkage); - } - - ValueMap NewVMap; - Module *New = CloneModule(M, NewVMap); - - // Make sure global initializers exist only in the safe module (CBE->.so) - for (Module::global_iterator I = New->global_begin(), E = New->global_end(); - I != E; ++I) - I->setInitializer(0); // Delete the initializer to make it external - - // Remove the Test functions from the Safe module - std::set TestFunctions; - for (unsigned i = 0, e = F.size(); i != e; ++i) { - Function *TNOF = cast(VMap[F[i]]); - DEBUG(errs() << "Removing function "); - DEBUG(WriteAsOperand(errs(), TNOF, false)); - DEBUG(errs() << "\n"); - TestFunctions.insert(cast(NewVMap[TNOF])); - DeleteFunctionBody(TNOF); // Function is now external in this module! - } - - - // Remove the Safe functions from the Test module - for (Module::iterator I = New->begin(), E = New->end(); I != E; ++I) - if (!TestFunctions.count(I)) - DeleteFunctionBody(I); - - - // Make sure that there is a global ctor/dtor array in both halves of the - // module if they both have static ctor/dtor functions. - SplitStaticCtorDtor("llvm.global_ctors", M, New, NewVMap); - SplitStaticCtorDtor("llvm.global_dtors", M, New, NewVMap); - - return New; -} - -//===----------------------------------------------------------------------===// -// Basic Block Extraction Code -//===----------------------------------------------------------------------===// - -/// ExtractMappedBlocksFromModule - Extract all but the specified basic blocks -/// into their own functions. The only detail is that M is actually a module -/// cloned from the one the BBs are in, so some mapping needs to be performed. -/// If this operation fails for some reason (ie the implementation is buggy), -/// this function should return null, otherwise it returns a new Module. -Module *BugDriver::ExtractMappedBlocksFromModule(const - std::vector &BBs, - Module *M) { - sys::Path uniqueFilename(OutputPrefix + "-extractblocks"); - std::string ErrMsg; - if (uniqueFilename.createTemporaryFileOnDisk(true, &ErrMsg)) { - outs() << "*** Basic Block extraction failed!\n"; - errs() << "Error creating temporary file: " << ErrMsg << "\n"; - EmitProgressBitcode(M, "basicblockextractfail", true); - return 0; - } - sys::RemoveFileOnSignal(uniqueFilename); - - std::string ErrorInfo; - tool_output_file BlocksToNotExtractFile(uniqueFilename.c_str(), ErrorInfo); - if (!ErrorInfo.empty()) { - outs() << "*** Basic Block extraction failed!\n"; - errs() << "Error writing list of blocks to not extract: " << ErrorInfo - << "\n"; - EmitProgressBitcode(M, "basicblockextractfail", true); - return 0; - } - for (std::vector::const_iterator I = BBs.begin(), E = BBs.end(); - I != E; ++I) { - BasicBlock *BB = *I; - // If the BB doesn't have a name, give it one so we have something to key - // off of. - if (!BB->hasName()) BB->setName("tmpbb"); - BlocksToNotExtractFile.os() << BB->getParent()->getNameStr() << " " - << BB->getName() << "\n"; - } - BlocksToNotExtractFile.os().close(); - if (BlocksToNotExtractFile.os().has_error()) { - errs() << "Error writing list of blocks to not extract: " << ErrorInfo - << "\n"; - EmitProgressBitcode(M, "basicblockextractfail", true); - BlocksToNotExtractFile.os().clear_error(); - return 0; - } - BlocksToNotExtractFile.keep(); - - std::string uniqueFN = "--extract-blocks-file=" + uniqueFilename.str(); - const char *ExtraArg = uniqueFN.c_str(); - - std::vector PI; - PI.push_back("extract-blocks"); - Module *Ret = runPassesOn(M, PI, false, 1, &ExtraArg); - - uniqueFilename.eraseFromDisk(); // Free disk space - - if (Ret == 0) { - outs() << "*** Basic Block extraction failed, please report a bug!\n"; - EmitProgressBitcode(M, "basicblockextractfail", true); - } - return Ret; -} diff --git a/contrib/llvm/tools/bugpoint/FindBugs.cpp b/contrib/llvm/tools/bugpoint/FindBugs.cpp deleted file mode 100644 index a291f9fb0f99..000000000000 --- a/contrib/llvm/tools/bugpoint/FindBugs.cpp +++ /dev/null @@ -1,113 +0,0 @@ -//===-- FindBugs.cpp - Run Many Different Optimizations -------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines an interface that allows bugpoint to choose different -// combinations of optimizations to run on the selected input. Bugpoint will -// run these optimizations and record the success/failure of each. This way -// we can hopefully spot bugs in the optimizations. -// -//===----------------------------------------------------------------------===// - -#include "BugDriver.h" -#include "ToolRunner.h" -#include "llvm/Pass.h" -#include "llvm/Support/raw_ostream.h" -#include -#include -using namespace llvm; - -/// runManyPasses - Take the specified pass list and create different -/// combinations of passes to compile the program with. Compile the program with -/// each set and mark test to see if it compiled correctly. If the passes -/// compiled correctly output nothing and rearrange the passes into a new order. -/// If the passes did not compile correctly, output the command required to -/// recreate the failure. This returns true if a compiler error is found. -/// -bool BugDriver::runManyPasses(const std::vector &AllPasses, - std::string &ErrMsg) { - setPassesToRun(AllPasses); - outs() << "Starting bug finding procedure...\n\n"; - - // Creating a reference output if necessary - if (initializeExecutionEnvironment()) return false; - - outs() << "\n"; - if (ReferenceOutputFile.empty()) { - outs() << "Generating reference output from raw program: \n"; - if (!createReferenceFile(Program)) - return false; - } - - srand(time(NULL)); - - unsigned num = 1; - while(1) { - // - // Step 1: Randomize the order of the optimizer passes. - // - std::random_shuffle(PassesToRun.begin(), PassesToRun.end()); - - // - // Step 2: Run optimizer passes on the program and check for success. - // - outs() << "Running selected passes on program to test for crash: "; - for(int i = 0, e = PassesToRun.size(); i != e; i++) { - outs() << "-" << PassesToRun[i] << " "; - } - - std::string Filename; - if(runPasses(Program, PassesToRun, Filename, false)) { - outs() << "\n"; - outs() << "Optimizer passes caused failure!\n\n"; - debugOptimizerCrash(); - return true; - } else { - outs() << "Combination " << num << " optimized successfully!\n"; - } - - // - // Step 3: Compile the optimized code. - // - outs() << "Running the code generator to test for a crash: "; - std::string Error; - compileProgram(Program, &Error); - if (!Error.empty()) { - outs() << "\n*** compileProgram threw an exception: "; - outs() << Error; - return debugCodeGeneratorCrash(ErrMsg); - } - outs() << '\n'; - - // - // Step 4: Run the program and compare its output to the reference - // output (created above). - // - outs() << "*** Checking if passes caused miscompliation:\n"; - bool Diff = diffProgram(Program, Filename, "", false, &Error); - if (Error.empty() && Diff) { - outs() << "\n*** diffProgram returned true!\n"; - debugMiscompilation(&Error); - if (Error.empty()) - return true; - } - if (!Error.empty()) { - errs() << Error; - debugCodeGeneratorCrash(ErrMsg); - return true; - } - outs() << "\n*** diff'd output matches!\n"; - - sys::Path(Filename).eraseFromDisk(); - - outs() << "\n\n"; - num++; - } //end while - - // Unreachable. -} diff --git a/contrib/llvm/tools/bugpoint/ListReducer.h b/contrib/llvm/tools/bugpoint/ListReducer.h deleted file mode 100644 index bd1c5da65c8f..000000000000 --- a/contrib/llvm/tools/bugpoint/ListReducer.h +++ /dev/null @@ -1,201 +0,0 @@ -//===- ListReducer.h - Trim down list while retaining property --*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This class is to be used as a base class for operations that want to zero in -// on a subset of the input which still causes the bug we are tracking. -// -//===----------------------------------------------------------------------===// - -#ifndef BUGPOINT_LIST_REDUCER_H -#define BUGPOINT_LIST_REDUCER_H - -#include "llvm/Support/raw_ostream.h" -#include "llvm/Support/ErrorHandling.h" -#include -#include -#include - -namespace llvm { - - extern bool BugpointIsInterrupted; - -template -struct ListReducer { - enum TestResult { - NoFailure, // No failure of the predicate was detected - KeepSuffix, // The suffix alone satisfies the predicate - KeepPrefix, // The prefix alone satisfies the predicate - InternalError // Encountered an error trying to run the predicate - }; - - virtual ~ListReducer() {} - - // doTest - This virtual function should be overriden by subclasses to - // implement the test desired. The testcase is only required to test to see - // if the Kept list still satisfies the property, but if it is going to check - // the prefix anyway, it can. - // - virtual TestResult doTest(std::vector &Prefix, - std::vector &Kept, - std::string &Error) = 0; - - // reduceList - This function attempts to reduce the length of the specified - // list while still maintaining the "test" property. This is the core of the - // "work" that bugpoint does. - // - bool reduceList(std::vector &TheList, std::string &Error) { - std::vector empty; - std::srand(0x6e5ea738); // Seed the random number generator - switch (doTest(TheList, empty, Error)) { - case KeepPrefix: - if (TheList.size() == 1) // we are done, it's the base case and it fails - return true; - else - break; // there's definitely an error, but we need to narrow it down - - case KeepSuffix: - // cannot be reached! - llvm_unreachable("bugpoint ListReducer internal error: " - "selected empty set."); - - case NoFailure: - return false; // there is no failure with the full set of passes/funcs! - - case InternalError: - assert(!Error.empty()); - return true; - } - - // Maximal number of allowed splitting iterations, - // before the elements are randomly shuffled. - const unsigned MaxIterationsWithoutProgress = 3; - bool ShufflingEnabled = true; - -Backjump: - unsigned MidTop = TheList.size(); - unsigned MaxIterations = MaxIterationsWithoutProgress; - unsigned NumOfIterationsWithoutProgress = 0; - while (MidTop > 1) { // Binary split reduction loop - // Halt if the user presses ctrl-c. - if (BugpointIsInterrupted) { - errs() << "\n\n*** Reduction Interrupted, cleaning up...\n\n"; - return true; - } - - // If the loop doesn't make satisfying progress, try shuffling. - // The purpose of shuffling is to avoid the heavy tails of the - // distribution (improving the speed of convergence). - if (ShufflingEnabled && - NumOfIterationsWithoutProgress > MaxIterations) { - std::vector ShuffledList(TheList); - std::random_shuffle(ShuffledList.begin(), ShuffledList.end()); - errs() << "\n\n*** Testing shuffled set...\n\n"; - // Check that random shuffle doesn't loose the bug - if (doTest(ShuffledList, empty, Error) == KeepPrefix) { - // If the bug is still here, use the shuffled list. - TheList.swap(ShuffledList); - MidTop = TheList.size(); - // Must increase the shuffling treshold to avoid the small - // probability of inifinite looping without making progress. - MaxIterations += 2; - errs() << "\n\n*** Shuffling does not hide the bug...\n\n"; - } else { - ShufflingEnabled = false; // Disable shuffling further on - errs() << "\n\n*** Shuffling hides the bug...\n\n"; - } - NumOfIterationsWithoutProgress = 0; - } - - unsigned Mid = MidTop / 2; - std::vector Prefix(TheList.begin(), TheList.begin()+Mid); - std::vector Suffix(TheList.begin()+Mid, TheList.end()); - - switch (doTest(Prefix, Suffix, Error)) { - case KeepSuffix: - // The property still holds. We can just drop the prefix elements, and - // shorten the list to the "kept" elements. - TheList.swap(Suffix); - MidTop = TheList.size(); - // Reset progress treshold and progress counter - MaxIterations = MaxIterationsWithoutProgress; - NumOfIterationsWithoutProgress = 0; - break; - case KeepPrefix: - // The predicate still holds, shorten the list to the prefix elements. - TheList.swap(Prefix); - MidTop = TheList.size(); - // Reset progress treshold and progress counter - MaxIterations = MaxIterationsWithoutProgress; - NumOfIterationsWithoutProgress = 0; - break; - case NoFailure: - // Otherwise the property doesn't hold. Some of the elements we removed - // must be necessary to maintain the property. - MidTop = Mid; - NumOfIterationsWithoutProgress++; - break; - case InternalError: - return true; // Error was set by doTest. - } - assert(Error.empty() && "doTest did not return InternalError for error"); - } - - // Probability of backjumping from the trimming loop back to the binary - // split reduction loop. - const int BackjumpProbability = 10; - - // Okay, we trimmed as much off the top and the bottom of the list as we - // could. If there is more than two elements in the list, try deleting - // interior elements and testing that. - // - if (TheList.size() > 2) { - bool Changed = true; - std::vector EmptyList; - while (Changed) { // Trimming loop. - Changed = false; - - // If the binary split reduction loop made an unfortunate sequence of - // splits, the trimming loop might be left off with a huge number of - // remaining elements (large search space). Backjumping out of that - // search space and attempting a different split can significantly - // improve the convergence speed. - if (std::rand() % 100 < BackjumpProbability) - goto Backjump; - - for (unsigned i = 1; i < TheList.size()-1; ++i) { // Check interior elts - if (BugpointIsInterrupted) { - errs() << "\n\n*** Reduction Interrupted, cleaning up...\n\n"; - return true; - } - - std::vector TestList(TheList); - TestList.erase(TestList.begin()+i); - - if (doTest(EmptyList, TestList, Error) == KeepSuffix) { - // We can trim down the list! - TheList.swap(TestList); - --i; // Don't skip an element of the list - Changed = true; - } - if (!Error.empty()) - return true; - } - // This can take a long time if left uncontrolled. For now, don't - // iterate. - break; - } - } - - return true; // there are some failure and we've narrowed them down - } -}; - -} // End llvm namespace - -#endif diff --git a/contrib/llvm/tools/bugpoint/Makefile b/contrib/llvm/tools/bugpoint/Makefile deleted file mode 100644 index 5d287ef188ae..000000000000 --- a/contrib/llvm/tools/bugpoint/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -##===- tools/bugpoint/Makefile -----------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../.. - -TOOLNAME = bugpoint - -LINK_COMPONENTS := asmparser instrumentation scalaropts ipo \ - linker bitreader bitwriter - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/tools/bugpoint/Miscompilation.cpp b/contrib/llvm/tools/bugpoint/Miscompilation.cpp deleted file mode 100644 index 3f2b6968718b..000000000000 --- a/contrib/llvm/tools/bugpoint/Miscompilation.cpp +++ /dev/null @@ -1,1082 +0,0 @@ -//===- Miscompilation.cpp - Debug program miscompilations -----------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements optimizer and code generation miscompilation debugging -// support. -// -//===----------------------------------------------------------------------===// - -#include "BugDriver.h" -#include "ListReducer.h" -#include "ToolRunner.h" -#include "llvm/Constants.h" -#include "llvm/DerivedTypes.h" -#include "llvm/Instructions.h" -#include "llvm/Linker.h" -#include "llvm/Module.h" -#include "llvm/Pass.h" -#include "llvm/Analysis/Verifier.h" -#include "llvm/Transforms/Utils/Cloning.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/FileUtilities.h" -#include "llvm/Config/config.h" // for HAVE_LINK_R -using namespace llvm; - -namespace llvm { - extern cl::opt OutputPrefix; - extern cl::list InputArgv; -} - -namespace { - static llvm::cl::opt - DisableLoopExtraction("disable-loop-extraction", - cl::desc("Don't extract loops when searching for miscompilations"), - cl::init(false)); - static llvm::cl::opt - DisableBlockExtraction("disable-block-extraction", - cl::desc("Don't extract blocks when searching for miscompilations"), - cl::init(false)); - - class ReduceMiscompilingPasses : public ListReducer { - BugDriver &BD; - public: - ReduceMiscompilingPasses(BugDriver &bd) : BD(bd) {} - - virtual TestResult doTest(std::vector &Prefix, - std::vector &Suffix, - std::string &Error); - }; -} - -/// TestResult - After passes have been split into a test group and a control -/// group, see if they still break the program. -/// -ReduceMiscompilingPasses::TestResult -ReduceMiscompilingPasses::doTest(std::vector &Prefix, - std::vector &Suffix, - std::string &Error) { - // First, run the program with just the Suffix passes. If it is still broken - // with JUST the kept passes, discard the prefix passes. - outs() << "Checking to see if '" << getPassesString(Suffix) - << "' compiles correctly: "; - - std::string BitcodeResult; - if (BD.runPasses(BD.getProgram(), Suffix, BitcodeResult, false/*delete*/, - true/*quiet*/)) { - errs() << " Error running this sequence of passes" - << " on the input program!\n"; - BD.setPassesToRun(Suffix); - BD.EmitProgressBitcode(BD.getProgram(), "pass-error", false); - exit(BD.debugOptimizerCrash()); - } - - // Check to see if the finished program matches the reference output... - bool Diff = BD.diffProgram(BD.getProgram(), BitcodeResult, "", - true /*delete bitcode*/, &Error); - if (!Error.empty()) - return InternalError; - if (Diff) { - outs() << " nope.\n"; - if (Suffix.empty()) { - errs() << BD.getToolName() << ": I'm confused: the test fails when " - << "no passes are run, nondeterministic program?\n"; - exit(1); - } - return KeepSuffix; // Miscompilation detected! - } - outs() << " yup.\n"; // No miscompilation! - - if (Prefix.empty()) return NoFailure; - - // Next, see if the program is broken if we run the "prefix" passes first, - // then separately run the "kept" passes. - outs() << "Checking to see if '" << getPassesString(Prefix) - << "' compiles correctly: "; - - // If it is not broken with the kept passes, it's possible that the prefix - // passes must be run before the kept passes to break it. If the program - // WORKS after the prefix passes, but then fails if running the prefix AND - // kept passes, we can update our bitcode file to include the result of the - // prefix passes, then discard the prefix passes. - // - if (BD.runPasses(BD.getProgram(), Prefix, BitcodeResult, false/*delete*/, - true/*quiet*/)) { - errs() << " Error running this sequence of passes" - << " on the input program!\n"; - BD.setPassesToRun(Prefix); - BD.EmitProgressBitcode(BD.getProgram(), "pass-error", false); - exit(BD.debugOptimizerCrash()); - } - - // If the prefix maintains the predicate by itself, only keep the prefix! - Diff = BD.diffProgram(BD.getProgram(), BitcodeResult, "", false, &Error); - if (!Error.empty()) - return InternalError; - if (Diff) { - outs() << " nope.\n"; - sys::Path(BitcodeResult).eraseFromDisk(); - return KeepPrefix; - } - outs() << " yup.\n"; // No miscompilation! - - // Ok, so now we know that the prefix passes work, try running the suffix - // passes on the result of the prefix passes. - // - OwningPtr PrefixOutput(ParseInputFile(BitcodeResult, - BD.getContext())); - if (PrefixOutput == 0) { - errs() << BD.getToolName() << ": Error reading bitcode file '" - << BitcodeResult << "'!\n"; - exit(1); - } - sys::Path(BitcodeResult).eraseFromDisk(); // No longer need the file on disk - - // Don't check if there are no passes in the suffix. - if (Suffix.empty()) - return NoFailure; - - outs() << "Checking to see if '" << getPassesString(Suffix) - << "' passes compile correctly after the '" - << getPassesString(Prefix) << "' passes: "; - - OwningPtr OriginalInput(BD.swapProgramIn(PrefixOutput.take())); - if (BD.runPasses(BD.getProgram(), Suffix, BitcodeResult, false/*delete*/, - true/*quiet*/)) { - errs() << " Error running this sequence of passes" - << " on the input program!\n"; - BD.setPassesToRun(Suffix); - BD.EmitProgressBitcode(BD.getProgram(), "pass-error", false); - exit(BD.debugOptimizerCrash()); - } - - // Run the result... - Diff = BD.diffProgram(BD.getProgram(), BitcodeResult, "", - true /*delete bitcode*/, &Error); - if (!Error.empty()) - return InternalError; - if (Diff) { - outs() << " nope.\n"; - return KeepSuffix; - } - - // Otherwise, we must not be running the bad pass anymore. - outs() << " yup.\n"; // No miscompilation! - // Restore orig program & free test. - delete BD.swapProgramIn(OriginalInput.take()); - return NoFailure; -} - -namespace { - class ReduceMiscompilingFunctions : public ListReducer { - BugDriver &BD; - bool (*TestFn)(BugDriver &, Module *, Module *, std::string &); - public: - ReduceMiscompilingFunctions(BugDriver &bd, - bool (*F)(BugDriver &, Module *, Module *, - std::string &)) - : BD(bd), TestFn(F) {} - - virtual TestResult doTest(std::vector &Prefix, - std::vector &Suffix, - std::string &Error) { - if (!Suffix.empty()) { - bool Ret = TestFuncs(Suffix, Error); - if (!Error.empty()) - return InternalError; - if (Ret) - return KeepSuffix; - } - if (!Prefix.empty()) { - bool Ret = TestFuncs(Prefix, Error); - if (!Error.empty()) - return InternalError; - if (Ret) - return KeepPrefix; - } - return NoFailure; - } - - bool TestFuncs(const std::vector &Prefix, std::string &Error); - }; -} - -/// TestMergedProgram - Given two modules, link them together and run the -/// program, checking to see if the program matches the diff. If there is -/// an error, return NULL. If not, return the merged module. The Broken argument -/// will be set to true if the output is different. If the DeleteInputs -/// argument is set to true then this function deletes both input -/// modules before it returns. -/// -static Module *TestMergedProgram(const BugDriver &BD, Module *M1, Module *M2, - bool DeleteInputs, std::string &Error, - bool &Broken) { - // Link the two portions of the program back to together. - std::string ErrorMsg; - if (!DeleteInputs) { - M1 = CloneModule(M1); - M2 = CloneModule(M2); - } - if (Linker::LinkModules(M1, M2, &ErrorMsg)) { - errs() << BD.getToolName() << ": Error linking modules together:" - << ErrorMsg << '\n'; - exit(1); - } - delete M2; // We are done with this module. - - // Execute the program. - Broken = BD.diffProgram(M1, "", "", false, &Error); - if (!Error.empty()) { - // Delete the linked module - delete M1; - return NULL; - } - return M1; -} - -/// TestFuncs - split functions in a Module into two groups: those that are -/// under consideration for miscompilation vs. those that are not, and test -/// accordingly. Each group of functions becomes a separate Module. -/// -bool ReduceMiscompilingFunctions::TestFuncs(const std::vector &Funcs, - std::string &Error) { - // Test to see if the function is misoptimized if we ONLY run it on the - // functions listed in Funcs. - outs() << "Checking to see if the program is misoptimized when " - << (Funcs.size()==1 ? "this function is" : "these functions are") - << " run through the pass" - << (BD.getPassesToRun().size() == 1 ? "" : "es") << ":"; - PrintFunctionList(Funcs); - outs() << '\n'; - - // Create a clone for two reasons: - // * If the optimization passes delete any function, the deleted function - // will be in the clone and Funcs will still point to valid memory - // * If the optimization passes use interprocedural information to break - // a function, we want to continue with the original function. Otherwise - // we can conclude that a function triggers the bug when in fact one - // needs a larger set of original functions to do so. - ValueMap VMap; - Module *Clone = CloneModule(BD.getProgram(), VMap); - Module *Orig = BD.swapProgramIn(Clone); - - std::vector FuncsOnClone; - for (unsigned i = 0, e = Funcs.size(); i != e; ++i) { - Function *F = cast(VMap[Funcs[i]]); - FuncsOnClone.push_back(F); - } - - // Split the module into the two halves of the program we want. - VMap.clear(); - Module *ToNotOptimize = CloneModule(BD.getProgram(), VMap); - Module *ToOptimize = SplitFunctionsOutOfModule(ToNotOptimize, FuncsOnClone, - VMap); - - // Run the predicate, note that the predicate will delete both input modules. - bool Broken = TestFn(BD, ToOptimize, ToNotOptimize, Error); - - delete BD.swapProgramIn(Orig); - - return Broken; -} - -/// DisambiguateGlobalSymbols - Give anonymous global values names. -/// -static void DisambiguateGlobalSymbols(Module *M) { - for (Module::global_iterator I = M->global_begin(), E = M->global_end(); - I != E; ++I) - if (!I->hasName()) - I->setName("anon_global"); - for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I) - if (!I->hasName()) - I->setName("anon_fn"); -} - -/// ExtractLoops - Given a reduced list of functions that still exposed the bug, -/// check to see if we can extract the loops in the region without obscuring the -/// bug. If so, it reduces the amount of code identified. -/// -static bool ExtractLoops(BugDriver &BD, - bool (*TestFn)(BugDriver &, Module *, Module *, - std::string &), - std::vector &MiscompiledFunctions, - std::string &Error) { - bool MadeChange = false; - while (1) { - if (BugpointIsInterrupted) return MadeChange; - - ValueMap VMap; - Module *ToNotOptimize = CloneModule(BD.getProgram(), VMap); - Module *ToOptimize = SplitFunctionsOutOfModule(ToNotOptimize, - MiscompiledFunctions, - VMap); - Module *ToOptimizeLoopExtracted = BD.ExtractLoop(ToOptimize); - if (!ToOptimizeLoopExtracted) { - // If the loop extractor crashed or if there were no extractible loops, - // then this chapter of our odyssey is over with. - delete ToNotOptimize; - delete ToOptimize; - return MadeChange; - } - - errs() << "Extracted a loop from the breaking portion of the program.\n"; - - // Bugpoint is intentionally not very trusting of LLVM transformations. In - // particular, we're not going to assume that the loop extractor works, so - // we're going to test the newly loop extracted program to make sure nothing - // has broken. If something broke, then we'll inform the user and stop - // extraction. - AbstractInterpreter *AI = BD.switchToSafeInterpreter(); - bool Failure; - Module *New = TestMergedProgram(BD, ToOptimizeLoopExtracted, ToNotOptimize, - false, Error, Failure); - if (!New) - return false; - // Delete the original and set the new program. - delete BD.swapProgramIn(New); - if (Failure) { - BD.switchToInterpreter(AI); - - // Merged program doesn't work anymore! - errs() << " *** ERROR: Loop extraction broke the program. :(" - << " Please report a bug!\n"; - errs() << " Continuing on with un-loop-extracted version.\n"; - - BD.writeProgramToFile(OutputPrefix + "-loop-extract-fail-tno.bc", - ToNotOptimize); - BD.writeProgramToFile(OutputPrefix + "-loop-extract-fail-to.bc", - ToOptimize); - BD.writeProgramToFile(OutputPrefix + "-loop-extract-fail-to-le.bc", - ToOptimizeLoopExtracted); - - errs() << "Please submit the " - << OutputPrefix << "-loop-extract-fail-*.bc files.\n"; - delete ToOptimize; - delete ToNotOptimize; - delete ToOptimizeLoopExtracted; - return MadeChange; - } - delete ToOptimize; - BD.switchToInterpreter(AI); - - outs() << " Testing after loop extraction:\n"; - // Clone modules, the tester function will free them. - Module *TOLEBackup = CloneModule(ToOptimizeLoopExtracted); - Module *TNOBackup = CloneModule(ToNotOptimize); - Failure = TestFn(BD, ToOptimizeLoopExtracted, ToNotOptimize, Error); - if (!Error.empty()) - return false; - if (!Failure) { - outs() << "*** Loop extraction masked the problem. Undoing.\n"; - // If the program is not still broken, then loop extraction did something - // that masked the error. Stop loop extraction now. - delete TOLEBackup; - delete TNOBackup; - return MadeChange; - } - ToOptimizeLoopExtracted = TOLEBackup; - ToNotOptimize = TNOBackup; - - outs() << "*** Loop extraction successful!\n"; - - std::vector > MisCompFunctions; - for (Module::iterator I = ToOptimizeLoopExtracted->begin(), - E = ToOptimizeLoopExtracted->end(); I != E; ++I) - if (!I->isDeclaration()) - MisCompFunctions.push_back(std::make_pair(I->getName(), - I->getFunctionType())); - - // Okay, great! Now we know that we extracted a loop and that loop - // extraction both didn't break the program, and didn't mask the problem. - // Replace the current program with the loop extracted version, and try to - // extract another loop. - std::string ErrorMsg; - if (Linker::LinkModules(ToNotOptimize, ToOptimizeLoopExtracted, &ErrorMsg)){ - errs() << BD.getToolName() << ": Error linking modules together:" - << ErrorMsg << '\n'; - exit(1); - } - delete ToOptimizeLoopExtracted; - - // All of the Function*'s in the MiscompiledFunctions list are in the old - // module. Update this list to include all of the functions in the - // optimized and loop extracted module. - MiscompiledFunctions.clear(); - for (unsigned i = 0, e = MisCompFunctions.size(); i != e; ++i) { - Function *NewF = ToNotOptimize->getFunction(MisCompFunctions[i].first); - - assert(NewF && "Function not found??"); - assert(NewF->getFunctionType() == MisCompFunctions[i].second && - "found wrong function type?"); - MiscompiledFunctions.push_back(NewF); - } - - BD.setNewProgram(ToNotOptimize); - MadeChange = true; - } -} - -namespace { - class ReduceMiscompiledBlocks : public ListReducer { - BugDriver &BD; - bool (*TestFn)(BugDriver &, Module *, Module *, std::string &); - std::vector FunctionsBeingTested; - public: - ReduceMiscompiledBlocks(BugDriver &bd, - bool (*F)(BugDriver &, Module *, Module *, - std::string &), - const std::vector &Fns) - : BD(bd), TestFn(F), FunctionsBeingTested(Fns) {} - - virtual TestResult doTest(std::vector &Prefix, - std::vector &Suffix, - std::string &Error) { - if (!Suffix.empty()) { - bool Ret = TestFuncs(Suffix, Error); - if (!Error.empty()) - return InternalError; - if (Ret) - return KeepSuffix; - } - if (!Prefix.empty()) { - bool Ret = TestFuncs(Prefix, Error); - if (!Error.empty()) - return InternalError; - if (Ret) - return KeepPrefix; - } - return NoFailure; - } - - bool TestFuncs(const std::vector &BBs, std::string &Error); - }; -} - -/// TestFuncs - Extract all blocks for the miscompiled functions except for the -/// specified blocks. If the problem still exists, return true. -/// -bool ReduceMiscompiledBlocks::TestFuncs(const std::vector &BBs, - std::string &Error) { - // Test to see if the function is misoptimized if we ONLY run it on the - // functions listed in Funcs. - outs() << "Checking to see if the program is misoptimized when all "; - if (!BBs.empty()) { - outs() << "but these " << BBs.size() << " blocks are extracted: "; - for (unsigned i = 0, e = BBs.size() < 10 ? BBs.size() : 10; i != e; ++i) - outs() << BBs[i]->getName() << " "; - if (BBs.size() > 10) outs() << "..."; - } else { - outs() << "blocks are extracted."; - } - outs() << '\n'; - - // Split the module into the two halves of the program we want. - ValueMap VMap; - Module *Clone = CloneModule(BD.getProgram(), VMap); - Module *Orig = BD.swapProgramIn(Clone); - std::vector FuncsOnClone; - std::vector BBsOnClone; - for (unsigned i = 0, e = FunctionsBeingTested.size(); i != e; ++i) { - Function *F = cast(VMap[FunctionsBeingTested[i]]); - FuncsOnClone.push_back(F); - } - for (unsigned i = 0, e = BBs.size(); i != e; ++i) { - BasicBlock *BB = cast(VMap[BBs[i]]); - BBsOnClone.push_back(BB); - } - VMap.clear(); - - Module *ToNotOptimize = CloneModule(BD.getProgram(), VMap); - Module *ToOptimize = SplitFunctionsOutOfModule(ToNotOptimize, - FuncsOnClone, - VMap); - - // Try the extraction. If it doesn't work, then the block extractor crashed - // or something, in which case bugpoint can't chase down this possibility. - if (Module *New = BD.ExtractMappedBlocksFromModule(BBsOnClone, ToOptimize)) { - delete ToOptimize; - // Run the predicate, - // note that the predicate will delete both input modules. - bool Ret = TestFn(BD, New, ToNotOptimize, Error); - delete BD.swapProgramIn(Orig); - return Ret; - } - delete BD.swapProgramIn(Orig); - delete ToOptimize; - delete ToNotOptimize; - return false; -} - - -/// ExtractBlocks - Given a reduced list of functions that still expose the bug, -/// extract as many basic blocks from the region as possible without obscuring -/// the bug. -/// -static bool ExtractBlocks(BugDriver &BD, - bool (*TestFn)(BugDriver &, Module *, Module *, - std::string &), - std::vector &MiscompiledFunctions, - std::string &Error) { - if (BugpointIsInterrupted) return false; - - std::vector Blocks; - for (unsigned i = 0, e = MiscompiledFunctions.size(); i != e; ++i) - for (Function::iterator I = MiscompiledFunctions[i]->begin(), - E = MiscompiledFunctions[i]->end(); I != E; ++I) - Blocks.push_back(I); - - // Use the list reducer to identify blocks that can be extracted without - // obscuring the bug. The Blocks list will end up containing blocks that must - // be retained from the original program. - unsigned OldSize = Blocks.size(); - - // Check to see if all blocks are extractible first. - bool Ret = ReduceMiscompiledBlocks(BD, TestFn, MiscompiledFunctions) - .TestFuncs(std::vector(), Error); - if (!Error.empty()) - return false; - if (Ret) { - Blocks.clear(); - } else { - ReduceMiscompiledBlocks(BD, TestFn, - MiscompiledFunctions).reduceList(Blocks, Error); - if (!Error.empty()) - return false; - if (Blocks.size() == OldSize) - return false; - } - - ValueMap VMap; - Module *ProgClone = CloneModule(BD.getProgram(), VMap); - Module *ToExtract = SplitFunctionsOutOfModule(ProgClone, - MiscompiledFunctions, - VMap); - Module *Extracted = BD.ExtractMappedBlocksFromModule(Blocks, ToExtract); - if (Extracted == 0) { - // Weird, extraction should have worked. - errs() << "Nondeterministic problem extracting blocks??\n"; - delete ProgClone; - delete ToExtract; - return false; - } - - // Otherwise, block extraction succeeded. Link the two program fragments back - // together. - delete ToExtract; - - std::vector > MisCompFunctions; - for (Module::iterator I = Extracted->begin(), E = Extracted->end(); - I != E; ++I) - if (!I->isDeclaration()) - MisCompFunctions.push_back(std::make_pair(I->getName(), - I->getFunctionType())); - - std::string ErrorMsg; - if (Linker::LinkModules(ProgClone, Extracted, &ErrorMsg)) { - errs() << BD.getToolName() << ": Error linking modules together:" - << ErrorMsg << '\n'; - exit(1); - } - delete Extracted; - - // Set the new program and delete the old one. - BD.setNewProgram(ProgClone); - - // Update the list of miscompiled functions. - MiscompiledFunctions.clear(); - - for (unsigned i = 0, e = MisCompFunctions.size(); i != e; ++i) { - Function *NewF = ProgClone->getFunction(MisCompFunctions[i].first); - assert(NewF && "Function not found??"); - assert(NewF->getFunctionType() == MisCompFunctions[i].second && - "Function has wrong type??"); - MiscompiledFunctions.push_back(NewF); - } - - return true; -} - - -/// DebugAMiscompilation - This is a generic driver to narrow down -/// miscompilations, either in an optimization or a code generator. -/// -static std::vector -DebugAMiscompilation(BugDriver &BD, - bool (*TestFn)(BugDriver &, Module *, Module *, - std::string &), - std::string &Error) { - // Okay, now that we have reduced the list of passes which are causing the - // failure, see if we can pin down which functions are being - // miscompiled... first build a list of all of the non-external functions in - // the program. - std::vector MiscompiledFunctions; - Module *Prog = BD.getProgram(); - for (Module::iterator I = Prog->begin(), E = Prog->end(); I != E; ++I) - if (!I->isDeclaration()) - MiscompiledFunctions.push_back(I); - - // Do the reduction... - if (!BugpointIsInterrupted) - ReduceMiscompilingFunctions(BD, TestFn).reduceList(MiscompiledFunctions, - Error); - if (!Error.empty()) - return MiscompiledFunctions; - - outs() << "\n*** The following function" - << (MiscompiledFunctions.size() == 1 ? " is" : "s are") - << " being miscompiled: "; - PrintFunctionList(MiscompiledFunctions); - outs() << '\n'; - - // See if we can rip any loops out of the miscompiled functions and still - // trigger the problem. - - if (!BugpointIsInterrupted && !DisableLoopExtraction) { - bool Ret = ExtractLoops(BD, TestFn, MiscompiledFunctions, Error); - if (!Error.empty()) - return MiscompiledFunctions; - if (Ret) { - // Okay, we extracted some loops and the problem still appears. See if - // we can eliminate some of the created functions from being candidates. - DisambiguateGlobalSymbols(BD.getProgram()); - - // Do the reduction... - if (!BugpointIsInterrupted) - ReduceMiscompilingFunctions(BD, TestFn).reduceList(MiscompiledFunctions, - Error); - if (!Error.empty()) - return MiscompiledFunctions; - - outs() << "\n*** The following function" - << (MiscompiledFunctions.size() == 1 ? " is" : "s are") - << " being miscompiled: "; - PrintFunctionList(MiscompiledFunctions); - outs() << '\n'; - } - } - - if (!BugpointIsInterrupted && !DisableBlockExtraction) { - bool Ret = ExtractBlocks(BD, TestFn, MiscompiledFunctions, Error); - if (!Error.empty()) - return MiscompiledFunctions; - if (Ret) { - // Okay, we extracted some blocks and the problem still appears. See if - // we can eliminate some of the created functions from being candidates. - DisambiguateGlobalSymbols(BD.getProgram()); - - // Do the reduction... - ReduceMiscompilingFunctions(BD, TestFn).reduceList(MiscompiledFunctions, - Error); - if (!Error.empty()) - return MiscompiledFunctions; - - outs() << "\n*** The following function" - << (MiscompiledFunctions.size() == 1 ? " is" : "s are") - << " being miscompiled: "; - PrintFunctionList(MiscompiledFunctions); - outs() << '\n'; - } - } - - return MiscompiledFunctions; -} - -/// TestOptimizer - This is the predicate function used to check to see if the -/// "Test" portion of the program is misoptimized. If so, return true. In any -/// case, both module arguments are deleted. -/// -static bool TestOptimizer(BugDriver &BD, Module *Test, Module *Safe, - std::string &Error) { - // Run the optimization passes on ToOptimize, producing a transformed version - // of the functions being tested. - outs() << " Optimizing functions being tested: "; - Module *Optimized = BD.runPassesOn(Test, BD.getPassesToRun(), - /*AutoDebugCrashes*/true); - outs() << "done.\n"; - delete Test; - - outs() << " Checking to see if the merged program executes correctly: "; - bool Broken; - Module *New = TestMergedProgram(BD, Optimized, Safe, true, Error, Broken); - if (New) { - outs() << (Broken ? " nope.\n" : " yup.\n"); - // Delete the original and set the new program. - delete BD.swapProgramIn(New); - } - return Broken; -} - - -/// debugMiscompilation - This method is used when the passes selected are not -/// crashing, but the generated output is semantically different from the -/// input. -/// -void BugDriver::debugMiscompilation(std::string *Error) { - // Make sure something was miscompiled... - if (!BugpointIsInterrupted) - if (!ReduceMiscompilingPasses(*this).reduceList(PassesToRun, *Error)) { - if (Error->empty()) - errs() << "*** Optimized program matches reference output! No problem" - << " detected...\nbugpoint can't help you with your problem!\n"; - return; - } - - outs() << "\n*** Found miscompiling pass" - << (getPassesToRun().size() == 1 ? "" : "es") << ": " - << getPassesString(getPassesToRun()) << '\n'; - EmitProgressBitcode(Program, "passinput"); - - std::vector MiscompiledFunctions = - DebugAMiscompilation(*this, TestOptimizer, *Error); - if (!Error->empty()) - return; - - // Output a bunch of bitcode files for the user... - outs() << "Outputting reduced bitcode files which expose the problem:\n"; - ValueMap VMap; - Module *ToNotOptimize = CloneModule(getProgram(), VMap); - Module *ToOptimize = SplitFunctionsOutOfModule(ToNotOptimize, - MiscompiledFunctions, - VMap); - - outs() << " Non-optimized portion: "; - EmitProgressBitcode(ToNotOptimize, "tonotoptimize", true); - delete ToNotOptimize; // Delete hacked module. - - outs() << " Portion that is input to optimizer: "; - EmitProgressBitcode(ToOptimize, "tooptimize"); - delete ToOptimize; // Delete hacked module. - - return; -} - -/// CleanupAndPrepareModules - Get the specified modules ready for code -/// generator testing. -/// -static void CleanupAndPrepareModules(BugDriver &BD, Module *&Test, - Module *Safe) { - // Clean up the modules, removing extra cruft that we don't need anymore... - Test = BD.performFinalCleanups(Test); - - // If we are executing the JIT, we have several nasty issues to take care of. - if (!BD.isExecutingJIT()) return; - - // First, if the main function is in the Safe module, we must add a stub to - // the Test module to call into it. Thus, we create a new function `main' - // which just calls the old one. - if (Function *oldMain = Safe->getFunction("main")) - if (!oldMain->isDeclaration()) { - // Rename it - oldMain->setName("llvm_bugpoint_old_main"); - // Create a NEW `main' function with same type in the test module. - Function *newMain = Function::Create(oldMain->getFunctionType(), - GlobalValue::ExternalLinkage, - "main", Test); - // Create an `oldmain' prototype in the test module, which will - // corresponds to the real main function in the same module. - Function *oldMainProto = Function::Create(oldMain->getFunctionType(), - GlobalValue::ExternalLinkage, - oldMain->getName(), Test); - // Set up and remember the argument list for the main function. - std::vector args; - for (Function::arg_iterator - I = newMain->arg_begin(), E = newMain->arg_end(), - OI = oldMain->arg_begin(); I != E; ++I, ++OI) { - I->setName(OI->getName()); // Copy argument names from oldMain - args.push_back(I); - } - - // Call the old main function and return its result - BasicBlock *BB = BasicBlock::Create(Safe->getContext(), "entry", newMain); - CallInst *call = CallInst::Create(oldMainProto, args.begin(), args.end(), - "", BB); - - // If the type of old function wasn't void, return value of call - ReturnInst::Create(Safe->getContext(), call, BB); - } - - // The second nasty issue we must deal with in the JIT is that the Safe - // module cannot directly reference any functions defined in the test - // module. Instead, we use a JIT API call to dynamically resolve the - // symbol. - - // Add the resolver to the Safe module. - // Prototype: void *getPointerToNamedFunction(const char* Name) - Constant *resolverFunc = - Safe->getOrInsertFunction("getPointerToNamedFunction", - Type::getInt8PtrTy(Safe->getContext()), - Type::getInt8PtrTy(Safe->getContext()), - (Type *)0); - - // Use the function we just added to get addresses of functions we need. - for (Module::iterator F = Safe->begin(), E = Safe->end(); F != E; ++F) { - if (F->isDeclaration() && !F->use_empty() && &*F != resolverFunc && - !F->isIntrinsic() /* ignore intrinsics */) { - Function *TestFn = Test->getFunction(F->getName()); - - // Don't forward functions which are external in the test module too. - if (TestFn && !TestFn->isDeclaration()) { - // 1. Add a string constant with its name to the global file - Constant *InitArray = ConstantArray::get(F->getContext(), F->getName()); - GlobalVariable *funcName = - new GlobalVariable(*Safe, InitArray->getType(), true /*isConstant*/, - GlobalValue::InternalLinkage, InitArray, - F->getName() + "_name"); - - // 2. Use `GetElementPtr *funcName, 0, 0' to convert the string to an - // sbyte* so it matches the signature of the resolver function. - - // GetElementPtr *funcName, ulong 0, ulong 0 - std::vector GEPargs(2, - Constant::getNullValue(Type::getInt32Ty(F->getContext()))); - Value *GEP = - ConstantExpr::getGetElementPtr(funcName, &GEPargs[0], 2); - std::vector ResolverArgs; - ResolverArgs.push_back(GEP); - - // Rewrite uses of F in global initializers, etc. to uses of a wrapper - // function that dynamically resolves the calls to F via our JIT API - if (!F->use_empty()) { - // Create a new global to hold the cached function pointer. - Constant *NullPtr = ConstantPointerNull::get(F->getType()); - GlobalVariable *Cache = - new GlobalVariable(*F->getParent(), F->getType(), - false, GlobalValue::InternalLinkage, - NullPtr,F->getName()+".fpcache"); - - // Construct a new stub function that will re-route calls to F - const FunctionType *FuncTy = F->getFunctionType(); - Function *FuncWrapper = Function::Create(FuncTy, - GlobalValue::InternalLinkage, - F->getName() + "_wrapper", - F->getParent()); - BasicBlock *EntryBB = BasicBlock::Create(F->getContext(), - "entry", FuncWrapper); - BasicBlock *DoCallBB = BasicBlock::Create(F->getContext(), - "usecache", FuncWrapper); - BasicBlock *LookupBB = BasicBlock::Create(F->getContext(), - "lookupfp", FuncWrapper); - - // Check to see if we already looked up the value. - Value *CachedVal = new LoadInst(Cache, "fpcache", EntryBB); - Value *IsNull = new ICmpInst(*EntryBB, ICmpInst::ICMP_EQ, CachedVal, - NullPtr, "isNull"); - BranchInst::Create(LookupBB, DoCallBB, IsNull, EntryBB); - - // Resolve the call to function F via the JIT API: - // - // call resolver(GetElementPtr...) - CallInst *Resolver = - CallInst::Create(resolverFunc, ResolverArgs.begin(), - ResolverArgs.end(), "resolver", LookupBB); - - // Cast the result from the resolver to correctly-typed function. - CastInst *CastedResolver = - new BitCastInst(Resolver, - PointerType::getUnqual(F->getFunctionType()), - "resolverCast", LookupBB); - - // Save the value in our cache. - new StoreInst(CastedResolver, Cache, LookupBB); - BranchInst::Create(DoCallBB, LookupBB); - - PHINode *FuncPtr = PHINode::Create(NullPtr->getType(), - "fp", DoCallBB); - FuncPtr->addIncoming(CastedResolver, LookupBB); - FuncPtr->addIncoming(CachedVal, EntryBB); - - // Save the argument list. - std::vector Args; - for (Function::arg_iterator i = FuncWrapper->arg_begin(), - e = FuncWrapper->arg_end(); i != e; ++i) - Args.push_back(i); - - // Pass on the arguments to the real function, return its result - if (F->getReturnType()->isVoidTy()) { - CallInst::Create(FuncPtr, Args.begin(), Args.end(), "", DoCallBB); - ReturnInst::Create(F->getContext(), DoCallBB); - } else { - CallInst *Call = CallInst::Create(FuncPtr, Args.begin(), Args.end(), - "retval", DoCallBB); - ReturnInst::Create(F->getContext(),Call, DoCallBB); - } - - // Use the wrapper function instead of the old function - F->replaceAllUsesWith(FuncWrapper); - } - } - } - } - - if (verifyModule(*Test) || verifyModule(*Safe)) { - errs() << "Bugpoint has a bug, which corrupted a module!!\n"; - abort(); - } -} - - - -/// TestCodeGenerator - This is the predicate function used to check to see if -/// the "Test" portion of the program is miscompiled by the code generator under -/// test. If so, return true. In any case, both module arguments are deleted. -/// -static bool TestCodeGenerator(BugDriver &BD, Module *Test, Module *Safe, - std::string &Error) { - CleanupAndPrepareModules(BD, Test, Safe); - - sys::Path TestModuleBC("bugpoint.test.bc"); - std::string ErrMsg; - if (TestModuleBC.makeUnique(true, &ErrMsg)) { - errs() << BD.getToolName() << "Error making unique filename: " - << ErrMsg << "\n"; - exit(1); - } - if (BD.writeProgramToFile(TestModuleBC.str(), Test)) { - errs() << "Error writing bitcode to `" << TestModuleBC.str() - << "'\nExiting."; - exit(1); - } - delete Test; - - FileRemover TestModuleBCRemover(TestModuleBC, !SaveTemps); - - // Make the shared library - sys::Path SafeModuleBC("bugpoint.safe.bc"); - if (SafeModuleBC.makeUnique(true, &ErrMsg)) { - errs() << BD.getToolName() << "Error making unique filename: " - << ErrMsg << "\n"; - exit(1); - } - - if (BD.writeProgramToFile(SafeModuleBC.str(), Safe)) { - errs() << "Error writing bitcode to `" << SafeModuleBC.str() - << "'\nExiting."; - exit(1); - } - - FileRemover SafeModuleBCRemover(SafeModuleBC, !SaveTemps); - - std::string SharedObject = BD.compileSharedObject(SafeModuleBC.str(), Error); - if (!Error.empty()) - return false; - delete Safe; - - FileRemover SharedObjectRemover(sys::Path(SharedObject), !SaveTemps); - - // Run the code generator on the `Test' code, loading the shared library. - // The function returns whether or not the new output differs from reference. - bool Result = BD.diffProgram(BD.getProgram(), TestModuleBC.str(), - SharedObject, false, &Error); - if (!Error.empty()) - return false; - - if (Result) - errs() << ": still failing!\n"; - else - errs() << ": didn't fail.\n"; - - return Result; -} - - -/// debugCodeGenerator - debug errors in LLC, LLI, or CBE. -/// -bool BugDriver::debugCodeGenerator(std::string *Error) { - if ((void*)SafeInterpreter == (void*)Interpreter) { - std::string Result = executeProgramSafely(Program, "bugpoint.safe.out", - Error); - if (Error->empty()) { - outs() << "\n*** The \"safe\" i.e. 'known good' backend cannot match " - << "the reference diff. This may be due to a\n front-end " - << "bug or a bug in the original program, but this can also " - << "happen if bugpoint isn't running the program with the " - << "right flags or input.\n I left the result of executing " - << "the program with the \"safe\" backend in this file for " - << "you: '" - << Result << "'.\n"; - } - return true; - } - - DisambiguateGlobalSymbols(Program); - - std::vector Funcs = DebugAMiscompilation(*this, TestCodeGenerator, - *Error); - if (!Error->empty()) - return true; - - // Split the module into the two halves of the program we want. - ValueMap VMap; - Module *ToNotCodeGen = CloneModule(getProgram(), VMap); - Module *ToCodeGen = SplitFunctionsOutOfModule(ToNotCodeGen, Funcs, VMap); - - // Condition the modules - CleanupAndPrepareModules(*this, ToCodeGen, ToNotCodeGen); - - sys::Path TestModuleBC("bugpoint.test.bc"); - std::string ErrMsg; - if (TestModuleBC.makeUnique(true, &ErrMsg)) { - errs() << getToolName() << "Error making unique filename: " - << ErrMsg << "\n"; - exit(1); - } - - if (writeProgramToFile(TestModuleBC.str(), ToCodeGen)) { - errs() << "Error writing bitcode to `" << TestModuleBC.str() - << "'\nExiting."; - exit(1); - } - delete ToCodeGen; - - // Make the shared library - sys::Path SafeModuleBC("bugpoint.safe.bc"); - if (SafeModuleBC.makeUnique(true, &ErrMsg)) { - errs() << getToolName() << "Error making unique filename: " - << ErrMsg << "\n"; - exit(1); - } - - if (writeProgramToFile(SafeModuleBC.str(), ToNotCodeGen)) { - errs() << "Error writing bitcode to `" << SafeModuleBC.str() - << "'\nExiting."; - exit(1); - } - std::string SharedObject = compileSharedObject(SafeModuleBC.str(), *Error); - if (!Error->empty()) - return true; - delete ToNotCodeGen; - - outs() << "You can reproduce the problem with the command line: \n"; - if (isExecutingJIT()) { - outs() << " lli -load " << SharedObject << " " << TestModuleBC.str(); - } else { - outs() << " llc " << TestModuleBC.str() << " -o " << TestModuleBC.str() - << ".s\n"; - outs() << " gcc " << SharedObject << " " << TestModuleBC.str() - << ".s -o " << TestModuleBC.str() << ".exe"; -#if defined (HAVE_LINK_R) - outs() << " -Wl,-R."; -#endif - outs() << "\n"; - outs() << " " << TestModuleBC.str() << ".exe"; - } - for (unsigned i = 0, e = InputArgv.size(); i != e; ++i) - outs() << " " << InputArgv[i]; - outs() << '\n'; - outs() << "The shared object was created with:\n llc -march=c " - << SafeModuleBC.str() << " -o temporary.c\n" - << " gcc -xc temporary.c -O2 -o " << SharedObject; - if (TargetTriple.getArch() == Triple::sparc) - outs() << " -G"; // Compile a shared library, `-G' for Sparc - else - outs() << " -fPIC -shared"; // `-shared' for Linux/X86, maybe others - - outs() << " -fno-strict-aliasing\n"; - - return false; -} diff --git a/contrib/llvm/tools/bugpoint/OptimizerDriver.cpp b/contrib/llvm/tools/bugpoint/OptimizerDriver.cpp deleted file mode 100644 index 3600ca6a81e3..000000000000 --- a/contrib/llvm/tools/bugpoint/OptimizerDriver.cpp +++ /dev/null @@ -1,260 +0,0 @@ -//===- OptimizerDriver.cpp - Allow BugPoint to run passes safely ----------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines an interface that allows bugpoint to run various passes -// without the threat of a buggy pass corrupting bugpoint (of course, bugpoint -// may have its own bugs, but that's another story...). It achieves this by -// forking a copy of itself and having the child process do the optimizations. -// If this client dies, we can always fork a new one. :) -// -//===----------------------------------------------------------------------===// - -// Note: as a short term hack, the old Unix-specific code and platform- -// independent code co-exist via conditional compilation until it is verified -// that the new code works correctly on Unix. - -#include "BugDriver.h" -#include "llvm/Module.h" -#include "llvm/PassManager.h" -#include "llvm/Analysis/Verifier.h" -#include "llvm/Bitcode/ReaderWriter.h" -#include "llvm/Target/TargetData.h" -#include "llvm/Support/FileUtilities.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/SystemUtils.h" -#include "llvm/Support/Debug.h" -#include "llvm/Support/raw_ostream.h" -#include "llvm/System/Path.h" -#include "llvm/System/Program.h" - -#define DONT_GET_PLUGIN_LOADER_OPTION -#include "llvm/Support/PluginLoader.h" - -#include -using namespace llvm; - -namespace llvm { - extern cl::opt OutputPrefix; -} - -namespace { - // ChildOutput - This option captures the name of the child output file that - // is set up by the parent bugpoint process - cl::opt ChildOutput("child-output", cl::ReallyHidden); -} - -/// writeProgramToFile - This writes the current "Program" to the named bitcode -/// file. If an error occurs, true is returned. -/// -bool BugDriver::writeProgramToFile(const std::string &Filename, - const Module *M) const { - std::string ErrInfo; - tool_output_file Out(Filename.c_str(), ErrInfo, - raw_fd_ostream::F_Binary); - if (ErrInfo.empty()) { - WriteBitcodeToFile(M, Out.os()); - Out.os().close(); - if (!Out.os().has_error()) { - Out.keep(); - return false; - } - } - Out.os().clear_error(); - return true; -} - - -/// EmitProgressBitcode - This function is used to output the current Program -/// to a file named "bugpoint-ID.bc". -/// -void BugDriver::EmitProgressBitcode(const Module *M, - const std::string &ID, - bool NoFlyer) const { - // Output the input to the current pass to a bitcode file, emit a message - // telling the user how to reproduce it: opt -foo blah.bc - // - std::string Filename = OutputPrefix + "-" + ID + ".bc"; - if (writeProgramToFile(Filename, M)) { - errs() << "Error opening file '" << Filename << "' for writing!\n"; - return; - } - - outs() << "Emitted bitcode to '" << Filename << "'\n"; - if (NoFlyer || PassesToRun.empty()) return; - outs() << "\n*** You can reproduce the problem with: "; - if (UseValgrind) outs() << "valgrind "; - outs() << "opt " << Filename << " "; - outs() << getPassesString(PassesToRun) << "\n"; -} - -cl::opt SilencePasses("silence-passes", cl::desc("Suppress output of running passes (both stdout and stderr)")); - -static cl::list OptArgs("opt-args", cl::Positional, - cl::desc("..."), - cl::ZeroOrMore, cl::PositionalEatsArgs); - -/// runPasses - Run the specified passes on Program, outputting a bitcode file -/// and writing the filename into OutputFile if successful. If the -/// optimizations fail for some reason (optimizer crashes), return true, -/// otherwise return false. If DeleteOutput is set to true, the bitcode is -/// deleted on success, and the filename string is undefined. This prints to -/// outs() a single line message indicating whether compilation was successful -/// or failed. -/// -bool BugDriver::runPasses(Module *Program, - const std::vector &Passes, - std::string &OutputFilename, bool DeleteOutput, - bool Quiet, unsigned NumExtraArgs, - const char * const *ExtraArgs) const { - // setup the output file name - outs().flush(); - sys::Path uniqueFilename(OutputPrefix + "-output.bc"); - std::string ErrMsg; - if (uniqueFilename.makeUnique(true, &ErrMsg)) { - errs() << getToolName() << ": Error making unique filename: " - << ErrMsg << "\n"; - return(1); - } - OutputFilename = uniqueFilename.str(); - - // set up the input file name - sys::Path inputFilename(OutputPrefix + "-input.bc"); - if (inputFilename.makeUnique(true, &ErrMsg)) { - errs() << getToolName() << ": Error making unique filename: " - << ErrMsg << "\n"; - return(1); - } - - std::string ErrInfo; - tool_output_file InFile(inputFilename.c_str(), ErrInfo, - raw_fd_ostream::F_Binary); - - - if (!ErrInfo.empty()) { - errs() << "Error opening bitcode file: " << inputFilename.str() << "\n"; - return 1; - } - WriteBitcodeToFile(Program, InFile.os()); - InFile.os().close(); - if (InFile.os().has_error()) { - errs() << "Error writing bitcode file: " << inputFilename.str() << "\n"; - InFile.os().clear_error(); - return 1; - } - InFile.keep(); - - // setup the child process' arguments - SmallVector Args; - sys::Path tool = FindExecutable("opt", getToolName(), (void*)"opt"); - std::string Opt = tool.str(); - if (UseValgrind) { - Args.push_back("valgrind"); - Args.push_back("--error-exitcode=1"); - Args.push_back("-q"); - Args.push_back(tool.c_str()); - } else - Args.push_back(Opt.c_str()); - - Args.push_back("-o"); - Args.push_back(OutputFilename.c_str()); - for (unsigned i = 0, e = OptArgs.size(); i != e; ++i) - Args.push_back(OptArgs[i].c_str()); - std::vector pass_args; - for (unsigned i = 0, e = PluginLoader::getNumPlugins(); i != e; ++i) { - pass_args.push_back( std::string("-load")); - pass_args.push_back( PluginLoader::getPlugin(i)); - } - for (std::vector::const_iterator I = Passes.begin(), - E = Passes.end(); I != E; ++I ) - pass_args.push_back( std::string("-") + (*I) ); - for (std::vector::const_iterator I = pass_args.begin(), - E = pass_args.end(); I != E; ++I ) - Args.push_back(I->c_str()); - Args.push_back(inputFilename.c_str()); - for (unsigned i = 0; i < NumExtraArgs; ++i) - Args.push_back(*ExtraArgs); - Args.push_back(0); - - DEBUG(errs() << "\nAbout to run:\t"; - for (unsigned i = 0, e = Args.size()-1; i != e; ++i) - errs() << " " << Args[i]; - errs() << "\n"; - ); - - sys::Path prog; - if (UseValgrind) - prog = sys::Program::FindProgramByName("valgrind"); - else - prog = tool; - - // Redirect stdout and stderr to nowhere if SilencePasses is given - sys::Path Nowhere; - const sys::Path *Redirects[3] = {0, &Nowhere, &Nowhere}; - - int result = sys::Program::ExecuteAndWait(prog, Args.data(), 0, - (SilencePasses ? Redirects : 0), - Timeout, MemoryLimit, &ErrMsg); - - // If we are supposed to delete the bitcode file or if the passes crashed, - // remove it now. This may fail if the file was never created, but that's ok. - if (DeleteOutput || result != 0) - sys::Path(OutputFilename).eraseFromDisk(); - - // Remove the temporary input file as well - inputFilename.eraseFromDisk(); - - if (!Quiet) { - if (result == 0) - outs() << "Success!\n"; - else if (result > 0) - outs() << "Exited with error code '" << result << "'\n"; - else if (result < 0) { - if (result == -1) - outs() << "Execute failed: " << ErrMsg << "\n"; - else - outs() << "Crashed with signal #" << abs(result) << "\n"; - } - if (result & 0x01000000) - outs() << "Dumped core\n"; - } - - // Was the child successful? - return result != 0; -} - - -/// runPassesOn - Carefully run the specified set of pass on the specified -/// module, returning the transformed module on success, or a null pointer on -/// failure. -Module *BugDriver::runPassesOn(Module *M, - const std::vector &Passes, - bool AutoDebugCrashes, unsigned NumExtraArgs, - const char * const *ExtraArgs) { - std::string BitcodeResult; - if (runPasses(M, Passes, BitcodeResult, false/*delete*/, true/*quiet*/, - NumExtraArgs, ExtraArgs)) { - if (AutoDebugCrashes) { - errs() << " Error running this sequence of passes" - << " on the input program!\n"; - delete swapProgramIn(M); - EmitProgressBitcode(M, "pass-error", false); - exit(debugOptimizerCrash()); - } - return 0; - } - - Module *Ret = ParseInputFile(BitcodeResult, Context); - if (Ret == 0) { - errs() << getToolName() << ": Error reading bitcode file '" - << BitcodeResult << "'!\n"; - exit(1); - } - sys::Path(BitcodeResult).eraseFromDisk(); // No longer need the file on disk - return Ret; -} diff --git a/contrib/llvm/tools/bugpoint/ToolRunner.cpp b/contrib/llvm/tools/bugpoint/ToolRunner.cpp deleted file mode 100644 index 36dbe144c1c5..000000000000 --- a/contrib/llvm/tools/bugpoint/ToolRunner.cpp +++ /dev/null @@ -1,883 +0,0 @@ -//===-- ToolRunner.cpp ----------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements the interfaces described in the ToolRunner.h file. -// -//===----------------------------------------------------------------------===// - -#define DEBUG_TYPE "toolrunner" -#include "ToolRunner.h" -#include "llvm/System/Program.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/Debug.h" -#include "llvm/Support/FileUtilities.h" -#include "llvm/Support/raw_ostream.h" -#include "llvm/Config/config.h" // for HAVE_LINK_R -#include -#include -using namespace llvm; - -namespace llvm { - cl::opt - SaveTemps("save-temps", cl::init(false), cl::desc("Save temporary files")); -} - -namespace { - cl::opt - RemoteClient("remote-client", - cl::desc("Remote execution client (rsh/ssh)")); - - cl::opt - RemoteHost("remote-host", - cl::desc("Remote execution (rsh/ssh) host")); - - cl::opt - RemotePort("remote-port", - cl::desc("Remote execution (rsh/ssh) port")); - - cl::opt - RemoteUser("remote-user", - cl::desc("Remote execution (rsh/ssh) user id")); - - cl::opt - RemoteExtra("remote-extra-options", - cl::desc("Remote execution (rsh/ssh) extra options")); -} - -/// RunProgramWithTimeout - This function provides an alternate interface -/// to the sys::Program::ExecuteAndWait interface. -/// @see sys::Program::ExecuteAndWait -static int RunProgramWithTimeout(const sys::Path &ProgramPath, - const char **Args, - const sys::Path &StdInFile, - const sys::Path &StdOutFile, - const sys::Path &StdErrFile, - unsigned NumSeconds = 0, - unsigned MemoryLimit = 0) { - const sys::Path* redirects[3]; - redirects[0] = &StdInFile; - redirects[1] = &StdOutFile; - redirects[2] = &StdErrFile; - -#if 0 // For debug purposes - { - errs() << "RUN:"; - for (unsigned i = 0; Args[i]; ++i) - errs() << " " << Args[i]; - errs() << "\n"; - } -#endif - - return - sys::Program::ExecuteAndWait(ProgramPath, Args, 0, redirects, - NumSeconds, MemoryLimit); -} - -/// RunProgramRemotelyWithTimeout - This function runs the given program -/// remotely using the given remote client and the sys::Program::ExecuteAndWait. -/// Returns the remote program exit code or reports a remote client error if it -/// fails. Remote client is required to return 255 if it failed or program exit -/// code otherwise. -/// @see sys::Program::ExecuteAndWait -static int RunProgramRemotelyWithTimeout(const sys::Path &RemoteClientPath, - const char **Args, - const sys::Path &StdInFile, - const sys::Path &StdOutFile, - const sys::Path &StdErrFile, - unsigned NumSeconds = 0, - unsigned MemoryLimit = 0) { - const sys::Path* redirects[3]; - redirects[0] = &StdInFile; - redirects[1] = &StdOutFile; - redirects[2] = &StdErrFile; - -#if 0 // For debug purposes - { - errs() << "RUN:"; - for (unsigned i = 0; Args[i]; ++i) - errs() << " " << Args[i]; - errs() << "\n"; - } -#endif - - // Run the program remotely with the remote client - int ReturnCode = sys::Program::ExecuteAndWait(RemoteClientPath, Args, - 0, redirects, NumSeconds, MemoryLimit); - - // Has the remote client fail? - if (255 == ReturnCode) { - std::ostringstream OS; - OS << "\nError running remote client:\n "; - for (const char **Arg = Args; *Arg; ++Arg) - OS << " " << *Arg; - OS << "\n"; - - // The error message is in the output file, let's print it out from there. - std::ifstream ErrorFile(StdOutFile.c_str()); - if (ErrorFile) { - std::copy(std::istreambuf_iterator(ErrorFile), - std::istreambuf_iterator(), - std::ostreambuf_iterator(OS)); - ErrorFile.close(); - } - - errs() << OS; - } - - return ReturnCode; -} - -static std::string ProcessFailure(sys::Path ProgPath, const char** Args, - unsigned Timeout = 0, - unsigned MemoryLimit = 0) { - std::ostringstream OS; - OS << "\nError running tool:\n "; - for (const char **Arg = Args; *Arg; ++Arg) - OS << " " << *Arg; - OS << "\n"; - - // Rerun the compiler, capturing any error messages to print them. - sys::Path ErrorFilename("bugpoint.program_error_messages"); - std::string ErrMsg; - if (ErrorFilename.makeUnique(true, &ErrMsg)) { - errs() << "Error making unique filename: " << ErrMsg << "\n"; - exit(1); - } - RunProgramWithTimeout(ProgPath, Args, sys::Path(""), ErrorFilename, - ErrorFilename, Timeout, MemoryLimit); - // FIXME: check return code ? - - // Print out the error messages generated by GCC if possible... - std::ifstream ErrorFile(ErrorFilename.c_str()); - if (ErrorFile) { - std::copy(std::istreambuf_iterator(ErrorFile), - std::istreambuf_iterator(), - std::ostreambuf_iterator(OS)); - ErrorFile.close(); - } - - ErrorFilename.eraseFromDisk(); - return OS.str(); -} - -//===---------------------------------------------------------------------===// -// LLI Implementation of AbstractIntepreter interface -// -namespace { - class LLI : public AbstractInterpreter { - std::string LLIPath; // The path to the LLI executable - std::vector ToolArgs; // Args to pass to LLI - public: - LLI(const std::string &Path, const std::vector *Args) - : LLIPath(Path) { - ToolArgs.clear (); - if (Args) { ToolArgs = *Args; } - } - - virtual int ExecuteProgram(const std::string &Bitcode, - const std::vector &Args, - const std::string &InputFile, - const std::string &OutputFile, - std::string *Error, - const std::vector &GCCArgs, - const std::vector &SharedLibs = - std::vector(), - unsigned Timeout = 0, - unsigned MemoryLimit = 0); - }; -} - -int LLI::ExecuteProgram(const std::string &Bitcode, - const std::vector &Args, - const std::string &InputFile, - const std::string &OutputFile, - std::string *Error, - const std::vector &GCCArgs, - const std::vector &SharedLibs, - unsigned Timeout, - unsigned MemoryLimit) { - std::vector LLIArgs; - LLIArgs.push_back(LLIPath.c_str()); - LLIArgs.push_back("-force-interpreter=true"); - - for (std::vector::const_iterator i = SharedLibs.begin(), e = SharedLibs.end(); i != e; ++i) { - LLIArgs.push_back("-load"); - LLIArgs.push_back((*i).c_str()); - } - - // Add any extra LLI args. - for (unsigned i = 0, e = ToolArgs.size(); i != e; ++i) - LLIArgs.push_back(ToolArgs[i].c_str()); - - LLIArgs.push_back(Bitcode.c_str()); - // Add optional parameters to the running program from Argv - for (unsigned i=0, e = Args.size(); i != e; ++i) - LLIArgs.push_back(Args[i].c_str()); - LLIArgs.push_back(0); - - outs() << ""; outs().flush(); - DEBUG(errs() << "\nAbout to run:\t"; - for (unsigned i=0, e = LLIArgs.size()-1; i != e; ++i) - errs() << " " << LLIArgs[i]; - errs() << "\n"; - ); - return RunProgramWithTimeout(sys::Path(LLIPath), &LLIArgs[0], - sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile), - Timeout, MemoryLimit); -} - -// LLI create method - Try to find the LLI executable -AbstractInterpreter *AbstractInterpreter::createLLI(const char *Argv0, - std::string &Message, - const std::vector *ToolArgs) { - std::string LLIPath = - FindExecutable("lli", Argv0, (void *)(intptr_t)&createLLI).str(); - if (!LLIPath.empty()) { - Message = "Found lli: " + LLIPath + "\n"; - return new LLI(LLIPath, ToolArgs); - } - - Message = "Cannot find `lli' in executable directory or PATH!\n"; - return 0; -} - -//===---------------------------------------------------------------------===// -// Custom execution command implementation of AbstractIntepreter interface -// -// Allows using a custom command for executing the bitcode, thus allows, -// for example, to invoke a cross compiler for code generation followed by -// a simulator that executes the generated binary. -namespace { - class CustomExecutor : public AbstractInterpreter { - std::string ExecutionCommand; - std::vector ExecutorArgs; - public: - CustomExecutor( - const std::string &ExecutionCmd, std::vector ExecArgs) : - ExecutionCommand(ExecutionCmd), ExecutorArgs(ExecArgs) {} - - virtual int ExecuteProgram(const std::string &Bitcode, - const std::vector &Args, - const std::string &InputFile, - const std::string &OutputFile, - std::string *Error, - const std::vector &GCCArgs, - const std::vector &SharedLibs = - std::vector(), - unsigned Timeout = 0, - unsigned MemoryLimit = 0); - }; -} - -int CustomExecutor::ExecuteProgram(const std::string &Bitcode, - const std::vector &Args, - const std::string &InputFile, - const std::string &OutputFile, - std::string *Error, - const std::vector &GCCArgs, - const std::vector &SharedLibs, - unsigned Timeout, - unsigned MemoryLimit) { - - std::vector ProgramArgs; - ProgramArgs.push_back(ExecutionCommand.c_str()); - - for (std::size_t i = 0; i < ExecutorArgs.size(); ++i) - ProgramArgs.push_back(ExecutorArgs.at(i).c_str()); - ProgramArgs.push_back(Bitcode.c_str()); - ProgramArgs.push_back(0); - - // Add optional parameters to the running program from Argv - for (unsigned i = 0, e = Args.size(); i != e; ++i) - ProgramArgs.push_back(Args[i].c_str()); - - return RunProgramWithTimeout( - sys::Path(ExecutionCommand), - &ProgramArgs[0], sys::Path(InputFile), sys::Path(OutputFile), - sys::Path(OutputFile), Timeout, MemoryLimit); -} - -// Custom execution environment create method, takes the execution command -// as arguments -AbstractInterpreter *AbstractInterpreter::createCustom( - std::string &Message, - const std::string &ExecCommandLine) { - - std::string Command = ""; - std::vector Args; - std::string delimiters = " "; - - // Tokenize the ExecCommandLine to the command and the args to allow - // defining a full command line as the command instead of just the - // executed program. We cannot just pass the whole string after the command - // as a single argument because then program sees only a single - // command line argument (with spaces in it: "foo bar" instead - // of "foo" and "bar"). - - // code borrowed from: - // http://oopweb.com/CPP/Documents/CPPHOWTO/Volume/C++Programming-HOWTO-7.html - std::string::size_type lastPos = - ExecCommandLine.find_first_not_of(delimiters, 0); - std::string::size_type pos = - ExecCommandLine.find_first_of(delimiters, lastPos); - - while (std::string::npos != pos || std::string::npos != lastPos) { - std::string token = ExecCommandLine.substr(lastPos, pos - lastPos); - if (Command == "") - Command = token; - else - Args.push_back(token); - // Skip delimiters. Note the "not_of" - lastPos = ExecCommandLine.find_first_not_of(delimiters, pos); - // Find next "non-delimiter" - pos = ExecCommandLine.find_first_of(delimiters, lastPos); - } - - std::string CmdPath = sys::Program::FindProgramByName(Command).str(); - if (CmdPath.empty()) { - Message = - std::string("Cannot find '") + Command + - "' in executable directory or PATH!\n"; - return 0; - } - - Message = "Found command in: " + CmdPath + "\n"; - - return new CustomExecutor(CmdPath, Args); -} - -//===----------------------------------------------------------------------===// -// LLC Implementation of AbstractIntepreter interface -// -GCC::FileType LLC::OutputCode(const std::string &Bitcode, - sys::Path &OutputAsmFile, std::string &Error, - unsigned Timeout, unsigned MemoryLimit) { - const char *Suffix = (UseIntegratedAssembler ? ".llc.o" : ".llc.s"); - sys::Path uniqueFile(Bitcode + Suffix); - std::string ErrMsg; - if (uniqueFile.makeUnique(true, &ErrMsg)) { - errs() << "Error making unique filename: " << ErrMsg << "\n"; - exit(1); - } - OutputAsmFile = uniqueFile; - std::vector LLCArgs; - LLCArgs.push_back(LLCPath.c_str()); - - // Add any extra LLC args. - for (unsigned i = 0, e = ToolArgs.size(); i != e; ++i) - LLCArgs.push_back(ToolArgs[i].c_str()); - - LLCArgs.push_back("-o"); - LLCArgs.push_back(OutputAsmFile.c_str()); // Output to the Asm file - LLCArgs.push_back(Bitcode.c_str()); // This is the input bitcode - - if (UseIntegratedAssembler) - LLCArgs.push_back("-filetype=obj"); - - LLCArgs.push_back (0); - - outs() << (UseIntegratedAssembler ? "" : ""); - outs().flush(); - DEBUG(errs() << "\nAbout to run:\t"; - for (unsigned i = 0, e = LLCArgs.size()-1; i != e; ++i) - errs() << " " << LLCArgs[i]; - errs() << "\n"; - ); - if (RunProgramWithTimeout(sys::Path(LLCPath), &LLCArgs[0], - sys::Path(), sys::Path(), sys::Path(), - Timeout, MemoryLimit)) - Error = ProcessFailure(sys::Path(LLCPath), &LLCArgs[0], - Timeout, MemoryLimit); - return UseIntegratedAssembler ? GCC::ObjectFile : GCC::AsmFile; -} - -void LLC::compileProgram(const std::string &Bitcode, std::string *Error, - unsigned Timeout, unsigned MemoryLimit) { - sys::Path OutputAsmFile; - OutputCode(Bitcode, OutputAsmFile, *Error, Timeout, MemoryLimit); - OutputAsmFile.eraseFromDisk(); -} - -int LLC::ExecuteProgram(const std::string &Bitcode, - const std::vector &Args, - const std::string &InputFile, - const std::string &OutputFile, - std::string *Error, - const std::vector &ArgsForGCC, - const std::vector &SharedLibs, - unsigned Timeout, - unsigned MemoryLimit) { - - sys::Path OutputAsmFile; - GCC::FileType FileKind = OutputCode(Bitcode, OutputAsmFile, *Error, Timeout, - MemoryLimit); - FileRemover OutFileRemover(OutputAsmFile, !SaveTemps); - - std::vector GCCArgs(ArgsForGCC); - GCCArgs.insert(GCCArgs.end(), SharedLibs.begin(), SharedLibs.end()); - - // Assuming LLC worked, compile the result with GCC and run it. - return gcc->ExecuteProgram(OutputAsmFile.str(), Args, FileKind, - InputFile, OutputFile, Error, GCCArgs, - Timeout, MemoryLimit); -} - -/// createLLC - Try to find the LLC executable -/// -LLC *AbstractInterpreter::createLLC(const char *Argv0, - std::string &Message, - const std::string &GCCBinary, - const std::vector *Args, - const std::vector *GCCArgs, - bool UseIntegratedAssembler) { - std::string LLCPath = - FindExecutable("llc", Argv0, (void *)(intptr_t)&createLLC).str(); - if (LLCPath.empty()) { - Message = "Cannot find `llc' in executable directory or PATH!\n"; - return 0; - } - - Message = "Found llc: " + LLCPath + "\n"; - GCC *gcc = GCC::create(Message, GCCBinary, GCCArgs); - if (!gcc) { - errs() << Message << "\n"; - exit(1); - } - return new LLC(LLCPath, gcc, Args, UseIntegratedAssembler); -} - -//===---------------------------------------------------------------------===// -// JIT Implementation of AbstractIntepreter interface -// -namespace { - class JIT : public AbstractInterpreter { - std::string LLIPath; // The path to the LLI executable - std::vector ToolArgs; // Args to pass to LLI - public: - JIT(const std::string &Path, const std::vector *Args) - : LLIPath(Path) { - ToolArgs.clear (); - if (Args) { ToolArgs = *Args; } - } - - virtual int ExecuteProgram(const std::string &Bitcode, - const std::vector &Args, - const std::string &InputFile, - const std::string &OutputFile, - std::string *Error, - const std::vector &GCCArgs = - std::vector(), - const std::vector &SharedLibs = - std::vector(), - unsigned Timeout = 0, - unsigned MemoryLimit = 0); - }; -} - -int JIT::ExecuteProgram(const std::string &Bitcode, - const std::vector &Args, - const std::string &InputFile, - const std::string &OutputFile, - std::string *Error, - const std::vector &GCCArgs, - const std::vector &SharedLibs, - unsigned Timeout, - unsigned MemoryLimit) { - // Construct a vector of parameters, incorporating those from the command-line - std::vector JITArgs; - JITArgs.push_back(LLIPath.c_str()); - JITArgs.push_back("-force-interpreter=false"); - - // Add any extra LLI args. - for (unsigned i = 0, e = ToolArgs.size(); i != e; ++i) - JITArgs.push_back(ToolArgs[i].c_str()); - - for (unsigned i = 0, e = SharedLibs.size(); i != e; ++i) { - JITArgs.push_back("-load"); - JITArgs.push_back(SharedLibs[i].c_str()); - } - JITArgs.push_back(Bitcode.c_str()); - // Add optional parameters to the running program from Argv - for (unsigned i=0, e = Args.size(); i != e; ++i) - JITArgs.push_back(Args[i].c_str()); - JITArgs.push_back(0); - - outs() << ""; outs().flush(); - DEBUG(errs() << "\nAbout to run:\t"; - for (unsigned i=0, e = JITArgs.size()-1; i != e; ++i) - errs() << " " << JITArgs[i]; - errs() << "\n"; - ); - DEBUG(errs() << "\nSending output to " << OutputFile << "\n"); - return RunProgramWithTimeout(sys::Path(LLIPath), &JITArgs[0], - sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile), - Timeout, MemoryLimit); -} - -/// createJIT - Try to find the LLI executable -/// -AbstractInterpreter *AbstractInterpreter::createJIT(const char *Argv0, - std::string &Message, const std::vector *Args) { - std::string LLIPath = - FindExecutable("lli", Argv0, (void *)(intptr_t)&createJIT).str(); - if (!LLIPath.empty()) { - Message = "Found lli: " + LLIPath + "\n"; - return new JIT(LLIPath, Args); - } - - Message = "Cannot find `lli' in executable directory or PATH!\n"; - return 0; -} - -GCC::FileType CBE::OutputCode(const std::string &Bitcode, - sys::Path &OutputCFile, std::string &Error, - unsigned Timeout, unsigned MemoryLimit) { - sys::Path uniqueFile(Bitcode+".cbe.c"); - std::string ErrMsg; - if (uniqueFile.makeUnique(true, &ErrMsg)) { - errs() << "Error making unique filename: " << ErrMsg << "\n"; - exit(1); - } - OutputCFile = uniqueFile; - std::vector LLCArgs; - LLCArgs.push_back(LLCPath.c_str()); - - // Add any extra LLC args. - for (unsigned i = 0, e = ToolArgs.size(); i != e; ++i) - LLCArgs.push_back(ToolArgs[i].c_str()); - - LLCArgs.push_back("-o"); - LLCArgs.push_back(OutputCFile.c_str()); // Output to the C file - LLCArgs.push_back("-march=c"); // Output C language - LLCArgs.push_back(Bitcode.c_str()); // This is the input bitcode - LLCArgs.push_back(0); - - outs() << ""; outs().flush(); - DEBUG(errs() << "\nAbout to run:\t"; - for (unsigned i = 0, e = LLCArgs.size()-1; i != e; ++i) - errs() << " " << LLCArgs[i]; - errs() << "\n"; - ); - if (RunProgramWithTimeout(LLCPath, &LLCArgs[0], sys::Path(), sys::Path(), - sys::Path(), Timeout, MemoryLimit)) - Error = ProcessFailure(LLCPath, &LLCArgs[0], Timeout, MemoryLimit); - return GCC::CFile; -} - -void CBE::compileProgram(const std::string &Bitcode, std::string *Error, - unsigned Timeout, unsigned MemoryLimit) { - sys::Path OutputCFile; - OutputCode(Bitcode, OutputCFile, *Error, Timeout, MemoryLimit); - OutputCFile.eraseFromDisk(); -} - -int CBE::ExecuteProgram(const std::string &Bitcode, - const std::vector &Args, - const std::string &InputFile, - const std::string &OutputFile, - std::string *Error, - const std::vector &ArgsForGCC, - const std::vector &SharedLibs, - unsigned Timeout, - unsigned MemoryLimit) { - sys::Path OutputCFile; - OutputCode(Bitcode, OutputCFile, *Error, Timeout, MemoryLimit); - - FileRemover CFileRemove(OutputCFile, !SaveTemps); - - std::vector GCCArgs(ArgsForGCC); - GCCArgs.insert(GCCArgs.end(), SharedLibs.begin(), SharedLibs.end()); - - return gcc->ExecuteProgram(OutputCFile.str(), Args, GCC::CFile, - InputFile, OutputFile, Error, GCCArgs, - Timeout, MemoryLimit); -} - -/// createCBE - Try to find the 'llc' executable -/// -CBE *AbstractInterpreter::createCBE(const char *Argv0, - std::string &Message, - const std::string &GCCBinary, - const std::vector *Args, - const std::vector *GCCArgs) { - sys::Path LLCPath = - FindExecutable("llc", Argv0, (void *)(intptr_t)&createCBE); - if (LLCPath.isEmpty()) { - Message = - "Cannot find `llc' in executable directory or PATH!\n"; - return 0; - } - - Message = "Found llc: " + LLCPath.str() + "\n"; - GCC *gcc = GCC::create(Message, GCCBinary, GCCArgs); - if (!gcc) { - errs() << Message << "\n"; - exit(1); - } - return new CBE(LLCPath, gcc, Args); -} - -//===---------------------------------------------------------------------===// -// GCC abstraction -// - -static bool IsARMArchitecture(std::vector Args) { - for (std::vector::const_iterator - I = Args.begin(), E = Args.end(); I != E; ++I) { - if (StringRef(*I).equals_lower("-arch")) { - ++I; - if (I != E && StringRef(*I).substr(0, strlen("arm")).equals_lower("arm")) - return true; - } - } - - return false; -} - -int GCC::ExecuteProgram(const std::string &ProgramFile, - const std::vector &Args, - FileType fileType, - const std::string &InputFile, - const std::string &OutputFile, - std::string *Error, - const std::vector &ArgsForGCC, - unsigned Timeout, - unsigned MemoryLimit) { - std::vector GCCArgs; - - GCCArgs.push_back(GCCPath.c_str()); - - if (TargetTriple.getArch() == Triple::x86) - GCCArgs.push_back("-m32"); - - for (std::vector::const_iterator - I = gccArgs.begin(), E = gccArgs.end(); I != E; ++I) - GCCArgs.push_back(I->c_str()); - - // Specify -x explicitly in case the extension is wonky - if (fileType != ObjectFile) { - GCCArgs.push_back("-x"); - if (fileType == CFile) { - GCCArgs.push_back("c"); - GCCArgs.push_back("-fno-strict-aliasing"); - } else { - GCCArgs.push_back("assembler"); - - // For ARM architectures we don't want this flag. bugpoint isn't - // explicitly told what architecture it is working on, so we get - // it from gcc flags - if ((TargetTriple.getOS() == Triple::Darwin) && - !IsARMArchitecture(GCCArgs)) - GCCArgs.push_back("-force_cpusubtype_ALL"); - } - } - - GCCArgs.push_back(ProgramFile.c_str()); // Specify the input filename. - - GCCArgs.push_back("-x"); - GCCArgs.push_back("none"); - GCCArgs.push_back("-o"); - sys::Path OutputBinary (ProgramFile+".gcc.exe"); - std::string ErrMsg; - if (OutputBinary.makeUnique(true, &ErrMsg)) { - errs() << "Error making unique filename: " << ErrMsg << "\n"; - exit(1); - } - GCCArgs.push_back(OutputBinary.c_str()); // Output to the right file... - - // Add any arguments intended for GCC. We locate them here because this is - // most likely -L and -l options that need to come before other libraries but - // after the source. Other options won't be sensitive to placement on the - // command line, so this should be safe. - for (unsigned i = 0, e = ArgsForGCC.size(); i != e; ++i) - GCCArgs.push_back(ArgsForGCC[i].c_str()); - - GCCArgs.push_back("-lm"); // Hard-code the math library... - GCCArgs.push_back("-O2"); // Optimize the program a bit... -#if defined (HAVE_LINK_R) - GCCArgs.push_back("-Wl,-R."); // Search this dir for .so files -#endif - if (TargetTriple.getArch() == Triple::sparc) - GCCArgs.push_back("-mcpu=v9"); - GCCArgs.push_back(0); // NULL terminator - - outs() << ""; outs().flush(); - DEBUG(errs() << "\nAbout to run:\t"; - for (unsigned i = 0, e = GCCArgs.size()-1; i != e; ++i) - errs() << " " << GCCArgs[i]; - errs() << "\n"; - ); - if (RunProgramWithTimeout(GCCPath, &GCCArgs[0], sys::Path(), sys::Path(), - sys::Path())) { - *Error = ProcessFailure(GCCPath, &GCCArgs[0]); - return -1; - } - - std::vector ProgramArgs; - - // Declared here so that the destructor only runs after - // ProgramArgs is used. - std::string Exec; - - if (RemoteClientPath.isEmpty()) - ProgramArgs.push_back(OutputBinary.c_str()); - else { - ProgramArgs.push_back(RemoteClientPath.c_str()); - ProgramArgs.push_back(RemoteHost.c_str()); - if (!RemoteUser.empty()) { - ProgramArgs.push_back("-l"); - ProgramArgs.push_back(RemoteUser.c_str()); - } - if (!RemotePort.empty()) { - ProgramArgs.push_back("-p"); - ProgramArgs.push_back(RemotePort.c_str()); - } - if (!RemoteExtra.empty()) { - ProgramArgs.push_back(RemoteExtra.c_str()); - } - - // Full path to the binary. We need to cd to the exec directory because - // there is a dylib there that the exec expects to find in the CWD - char* env_pwd = getenv("PWD"); - Exec = "cd "; - Exec += env_pwd; - Exec += "; ./"; - Exec += OutputBinary.c_str(); - ProgramArgs.push_back(Exec.c_str()); - } - - // Add optional parameters to the running program from Argv - for (unsigned i = 0, e = Args.size(); i != e; ++i) - ProgramArgs.push_back(Args[i].c_str()); - ProgramArgs.push_back(0); // NULL terminator - - // Now that we have a binary, run it! - outs() << ""; outs().flush(); - DEBUG(errs() << "\nAbout to run:\t"; - for (unsigned i = 0, e = ProgramArgs.size()-1; i != e; ++i) - errs() << " " << ProgramArgs[i]; - errs() << "\n"; - ); - - FileRemover OutputBinaryRemover(OutputBinary, !SaveTemps); - - if (RemoteClientPath.isEmpty()) { - DEBUG(errs() << ""); - return RunProgramWithTimeout(OutputBinary, &ProgramArgs[0], - sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile), - Timeout, MemoryLimit); - } else { - outs() << ""; outs().flush(); - return RunProgramRemotelyWithTimeout(sys::Path(RemoteClientPath), - &ProgramArgs[0], sys::Path(InputFile), sys::Path(OutputFile), - sys::Path(OutputFile), Timeout, MemoryLimit); - } -} - -int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType, - std::string &OutputFile, - const std::vector &ArgsForGCC, - std::string &Error) { - sys::Path uniqueFilename(InputFile+LTDL_SHLIB_EXT); - std::string ErrMsg; - if (uniqueFilename.makeUnique(true, &ErrMsg)) { - errs() << "Error making unique filename: " << ErrMsg << "\n"; - exit(1); - } - OutputFile = uniqueFilename.str(); - - std::vector GCCArgs; - - GCCArgs.push_back(GCCPath.c_str()); - - if (TargetTriple.getArch() == Triple::x86) - GCCArgs.push_back("-m32"); - - for (std::vector::const_iterator - I = gccArgs.begin(), E = gccArgs.end(); I != E; ++I) - GCCArgs.push_back(I->c_str()); - - // Compile the C/asm file into a shared object - if (fileType != ObjectFile) { - GCCArgs.push_back("-x"); - GCCArgs.push_back(fileType == AsmFile ? "assembler" : "c"); - } - GCCArgs.push_back("-fno-strict-aliasing"); - GCCArgs.push_back(InputFile.c_str()); // Specify the input filename. - GCCArgs.push_back("-x"); - GCCArgs.push_back("none"); - if (TargetTriple.getArch() == Triple::sparc) - GCCArgs.push_back("-G"); // Compile a shared library, `-G' for Sparc - else if (TargetTriple.getOS() == Triple::Darwin) { - // link all source files into a single module in data segment, rather than - // generating blocks. dynamic_lookup requires that you set - // MACOSX_DEPLOYMENT_TARGET=10.3 in your env. FIXME: it would be better for - // bugpoint to just pass that in the environment of GCC. - GCCArgs.push_back("-single_module"); - GCCArgs.push_back("-dynamiclib"); // `-dynamiclib' for MacOS X/PowerPC - GCCArgs.push_back("-undefined"); - GCCArgs.push_back("dynamic_lookup"); - } else - GCCArgs.push_back("-shared"); // `-shared' for Linux/X86, maybe others - - if ((TargetTriple.getArch() == Triple::alpha) || - (TargetTriple.getArch() == Triple::x86_64)) - GCCArgs.push_back("-fPIC"); // Requires shared objs to contain PIC - - if (TargetTriple.getArch() == Triple::sparc) - GCCArgs.push_back("-mcpu=v9"); - - GCCArgs.push_back("-o"); - GCCArgs.push_back(OutputFile.c_str()); // Output to the right filename. - GCCArgs.push_back("-O2"); // Optimize the program a bit. - - - - // Add any arguments intended for GCC. We locate them here because this is - // most likely -L and -l options that need to come before other libraries but - // after the source. Other options won't be sensitive to placement on the - // command line, so this should be safe. - for (unsigned i = 0, e = ArgsForGCC.size(); i != e; ++i) - GCCArgs.push_back(ArgsForGCC[i].c_str()); - GCCArgs.push_back(0); // NULL terminator - - - - outs() << ""; outs().flush(); - DEBUG(errs() << "\nAbout to run:\t"; - for (unsigned i = 0, e = GCCArgs.size()-1; i != e; ++i) - errs() << " " << GCCArgs[i]; - errs() << "\n"; - ); - if (RunProgramWithTimeout(GCCPath, &GCCArgs[0], sys::Path(), sys::Path(), - sys::Path())) { - Error = ProcessFailure(GCCPath, &GCCArgs[0]); - return 1; - } - return 0; -} - -/// create - Try to find the `gcc' executable -/// -GCC *GCC::create(std::string &Message, - const std::string &GCCBinary, - const std::vector *Args) { - sys::Path GCCPath = sys::Program::FindProgramByName(GCCBinary); - if (GCCPath.isEmpty()) { - Message = "Cannot find `"+ GCCBinary +"' in executable directory or PATH!\n"; - return 0; - } - - sys::Path RemoteClientPath; - if (!RemoteClient.empty()) - RemoteClientPath = sys::Program::FindProgramByName(RemoteClient); - - Message = "Found gcc: " + GCCPath.str() + "\n"; - return new GCC(GCCPath, RemoteClientPath, Args); -} diff --git a/contrib/llvm/tools/bugpoint/ToolRunner.h b/contrib/llvm/tools/bugpoint/ToolRunner.h deleted file mode 100644 index cda0ddfa71d9..000000000000 --- a/contrib/llvm/tools/bugpoint/ToolRunner.h +++ /dev/null @@ -1,242 +0,0 @@ -//===-- tools/bugpoint/ToolRunner.h -----------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file exposes an abstraction around a platform C compiler, used to -// compile C and assembly code. It also exposes an "AbstractIntepreter" -// interface, which is used to execute code using one of the LLVM execution -// engines. -// -//===----------------------------------------------------------------------===// - -#ifndef BUGPOINT_TOOLRUNNER_H -#define BUGPOINT_TOOLRUNNER_H - -#include "llvm/ADT/Triple.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/SystemUtils.h" -#include "llvm/System/Path.h" -#include -#include - -namespace llvm { - -extern cl::opt SaveTemps; -extern Triple TargetTriple; - -class CBE; -class LLC; - -//===---------------------------------------------------------------------===// -// GCC abstraction -// -class GCC { - sys::Path GCCPath; // The path to the gcc executable. - sys::Path RemoteClientPath; // The path to the rsh / ssh executable. - std::vector gccArgs; // GCC-specific arguments. - GCC(const sys::Path &gccPath, const sys::Path &RemotePath, - const std::vector *GCCArgs) - : GCCPath(gccPath), RemoteClientPath(RemotePath) { - if (GCCArgs) gccArgs = *GCCArgs; - } -public: - enum FileType { AsmFile, ObjectFile, CFile }; - - static GCC *create(std::string &Message, - const std::string &GCCBinary, - const std::vector *Args); - - /// ExecuteProgram - Execute the program specified by "ProgramFile" (which is - /// either a .s file, or a .c file, specified by FileType), with the specified - /// arguments. Standard input is specified with InputFile, and standard - /// Output is captured to the specified OutputFile location. The SharedLibs - /// option specifies optional native shared objects that can be loaded into - /// the program for execution. - /// - int ExecuteProgram(const std::string &ProgramFile, - const std::vector &Args, - FileType fileType, - const std::string &InputFile, - const std::string &OutputFile, - std::string *Error = 0, - const std::vector &GCCArgs = - std::vector(), - unsigned Timeout = 0, - unsigned MemoryLimit = 0); - - /// MakeSharedObject - This compiles the specified file (which is either a .c - /// file or a .s file) into a shared object. - /// - int MakeSharedObject(const std::string &InputFile, FileType fileType, - std::string &OutputFile, - const std::vector &ArgsForGCC, - std::string &Error); -}; - - -//===---------------------------------------------------------------------===// -/// AbstractInterpreter Class - Subclasses of this class are used to execute -/// LLVM bitcode in a variety of ways. This abstract interface hides this -/// complexity behind a simple interface. -/// -class AbstractInterpreter { -public: - static CBE *createCBE(const char *Argv0, std::string &Message, - const std::string &GCCBinary, - const std::vector *Args = 0, - const std::vector *GCCArgs = 0); - static LLC *createLLC(const char *Argv0, std::string &Message, - const std::string &GCCBinary, - const std::vector *Args = 0, - const std::vector *GCCArgs = 0, - bool UseIntegratedAssembler = false); - - static AbstractInterpreter* createLLI(const char *Argv0, std::string &Message, - const std::vector *Args=0); - - static AbstractInterpreter* createJIT(const char *Argv0, std::string &Message, - const std::vector *Args=0); - - static AbstractInterpreter* createCustom(std::string &Message, - const std::string &ExecCommandLine); - - - virtual ~AbstractInterpreter() {} - - /// compileProgram - Compile the specified program from bitcode to executable - /// code. This does not produce any output, it is only used when debugging - /// the code generator. It returns false if the code generator fails. - virtual void compileProgram(const std::string &Bitcode, std::string *Error, - unsigned Timeout = 0, unsigned MemoryLimit = 0) {} - - /// OutputCode - Compile the specified program from bitcode to code - /// understood by the GCC driver (either C or asm). If the code generator - /// fails, it sets Error, otherwise, this function returns the type of code - /// emitted. - virtual GCC::FileType OutputCode(const std::string &Bitcode, - sys::Path &OutFile, std::string &Error, - unsigned Timeout = 0, - unsigned MemoryLimit = 0) { - Error = "OutputCode not supported by this AbstractInterpreter!"; - return GCC::AsmFile; - } - - /// ExecuteProgram - Run the specified bitcode file, emitting output to the - /// specified filename. This sets RetVal to the exit code of the program or - /// returns false if a problem was encountered that prevented execution of - /// the program. - /// - virtual int ExecuteProgram(const std::string &Bitcode, - const std::vector &Args, - const std::string &InputFile, - const std::string &OutputFile, - std::string *Error, - const std::vector &GCCArgs = - std::vector(), - const std::vector &SharedLibs = - std::vector(), - unsigned Timeout = 0, - unsigned MemoryLimit = 0) = 0; -}; - -//===---------------------------------------------------------------------===// -// CBE Implementation of AbstractIntepreter interface -// -class CBE : public AbstractInterpreter { - sys::Path LLCPath; // The path to the `llc' executable. - std::vector ToolArgs; // Extra args to pass to LLC. - GCC *gcc; -public: - CBE(const sys::Path &llcPath, GCC *Gcc, - const std::vector *Args) - : LLCPath(llcPath), gcc(Gcc) { - ToolArgs.clear (); - if (Args) ToolArgs = *Args; - } - ~CBE() { delete gcc; } - - /// compileProgram - Compile the specified program from bitcode to executable - /// code. This does not produce any output, it is only used when debugging - /// the code generator. Returns false if the code generator fails. - virtual void compileProgram(const std::string &Bitcode, std::string *Error, - unsigned Timeout = 0, unsigned MemoryLimit = 0); - - virtual int ExecuteProgram(const std::string &Bitcode, - const std::vector &Args, - const std::string &InputFile, - const std::string &OutputFile, - std::string *Error, - const std::vector &GCCArgs = - std::vector(), - const std::vector &SharedLibs = - std::vector(), - unsigned Timeout = 0, - unsigned MemoryLimit = 0); - - /// OutputCode - Compile the specified program from bitcode to code - /// understood by the GCC driver (either C or asm). If the code generator - /// fails, it sets Error, otherwise, this function returns the type of code - /// emitted. - virtual GCC::FileType OutputCode(const std::string &Bitcode, - sys::Path &OutFile, std::string &Error, - unsigned Timeout = 0, - unsigned MemoryLimit = 0); -}; - - -//===---------------------------------------------------------------------===// -// LLC Implementation of AbstractIntepreter interface -// -class LLC : public AbstractInterpreter { - std::string LLCPath; // The path to the LLC executable. - std::vector ToolArgs; // Extra args to pass to LLC. - GCC *gcc; - bool UseIntegratedAssembler; -public: - LLC(const std::string &llcPath, GCC *Gcc, - const std::vector *Args, - bool useIntegratedAssembler) - : LLCPath(llcPath), gcc(Gcc), - UseIntegratedAssembler(useIntegratedAssembler) { - ToolArgs.clear(); - if (Args) ToolArgs = *Args; - } - ~LLC() { delete gcc; } - - /// compileProgram - Compile the specified program from bitcode to executable - /// code. This does not produce any output, it is only used when debugging - /// the code generator. Returns false if the code generator fails. - virtual void compileProgram(const std::string &Bitcode, std::string *Error, - unsigned Timeout = 0, unsigned MemoryLimit = 0); - - virtual int ExecuteProgram(const std::string &Bitcode, - const std::vector &Args, - const std::string &InputFile, - const std::string &OutputFile, - std::string *Error, - const std::vector &GCCArgs = - std::vector(), - const std::vector &SharedLibs = - std::vector(), - unsigned Timeout = 0, - unsigned MemoryLimit = 0); - - /// OutputCode - Compile the specified program from bitcode to code - /// understood by the GCC driver (either C or asm). If the code generator - /// fails, it sets Error, otherwise, this function returns the type of code - /// emitted. - virtual GCC::FileType OutputCode(const std::string &Bitcode, - sys::Path &OutFile, std::string &Error, - unsigned Timeout = 0, - unsigned MemoryLimit = 0); -}; - -} // End llvm namespace - -#endif diff --git a/contrib/llvm/tools/bugpoint/bugpoint.cpp b/contrib/llvm/tools/bugpoint/bugpoint.cpp deleted file mode 100644 index 79cf563ec6fd..000000000000 --- a/contrib/llvm/tools/bugpoint/bugpoint.cpp +++ /dev/null @@ -1,159 +0,0 @@ -//===- bugpoint.cpp - The LLVM Bugpoint utility ---------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This program is an automated compiler debugger tool. It is used to narrow -// down miscompilations and crash problems to a specific pass in the compiler, -// and the specific Module or Function input that is causing the problem. -// -//===----------------------------------------------------------------------===// - -#include "BugDriver.h" -#include "ToolRunner.h" -#include "llvm/LinkAllPasses.h" -#include "llvm/LLVMContext.h" -#include "llvm/Support/PassNameParser.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/ManagedStatic.h" -#include "llvm/Support/PluginLoader.h" -#include "llvm/Support/PrettyStackTrace.h" -#include "llvm/Support/StandardPasses.h" -#include "llvm/System/Process.h" -#include "llvm/System/Signals.h" -#include "llvm/System/Valgrind.h" -#include "llvm/LinkAllVMCore.h" -using namespace llvm; - -static cl::opt -FindBugs("find-bugs", cl::desc("Run many different optimization sequences " - "on program to find bugs"), cl::init(false)); - -static cl::list -InputFilenames(cl::Positional, cl::OneOrMore, - cl::desc("")); - -static cl::opt -TimeoutValue("timeout", cl::init(300), cl::value_desc("seconds"), - cl::desc("Number of seconds program is allowed to run before it " - "is killed (default is 300s), 0 disables timeout")); - -static cl::opt -MemoryLimit("mlimit", cl::init(-1), cl::value_desc("MBytes"), - cl::desc("Maximum amount of memory to use. 0 disables check." - " Defaults to 100MB (800MB under valgrind).")); - -static cl::opt -UseValgrind("enable-valgrind", - cl::desc("Run optimizations through valgrind")); - -// The AnalysesList is automatically populated with registered Passes by the -// PassNameParser. -// -static cl::list -PassList(cl::desc("Passes available:"), cl::ZeroOrMore); - -static cl::opt -StandardCompileOpts("std-compile-opts", - cl::desc("Include the standard compile time optimizations")); - -static cl::opt -StandardLinkOpts("std-link-opts", - cl::desc("Include the standard link time optimizations")); - -static cl::opt -OverrideTriple("mtriple", cl::desc("Override target triple for module")); - -/// BugpointIsInterrupted - Set to true when the user presses ctrl-c. -bool llvm::BugpointIsInterrupted = false; - -static void BugpointInterruptFunction() { - BugpointIsInterrupted = true; -} - -// Hack to capture a pass list. -namespace { - class AddToDriver : public PassManager { - BugDriver &D; - public: - AddToDriver(BugDriver &_D) : D(_D) {} - - virtual void add(Pass *P) { - const void *ID = P->getPassID(); - const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(ID); - D.addPass(PI->getPassArgument()); - } - }; -} - -int main(int argc, char **argv) { - llvm::sys::PrintStackTraceOnErrorSignal(); - llvm::PrettyStackTraceProgram X(argc, argv); - llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. - cl::ParseCommandLineOptions(argc, argv, - "LLVM automatic testcase reducer. See\nhttp://" - "llvm.org/cmds/bugpoint.html" - " for more information.\n"); - sys::SetInterruptFunction(BugpointInterruptFunction); - - LLVMContext& Context = getGlobalContext(); - // If we have an override, set it and then track the triple we want Modules - // to use. - if (!OverrideTriple.empty()) { - TargetTriple.setTriple(Triple::normalize(OverrideTriple)); - outs() << "Override triple set to '" << TargetTriple.getTriple() << "'\n"; - } - - if (MemoryLimit < 0) { - // Set the default MemoryLimit. Be sure to update the flag's description if - // you change this. - if (sys::RunningOnValgrind() || UseValgrind) - MemoryLimit = 800; - else - MemoryLimit = 100; - } - - BugDriver D(argv[0], FindBugs, TimeoutValue, MemoryLimit, - UseValgrind, Context); - if (D.addSources(InputFilenames)) return 1; - - AddToDriver PM(D); - if (StandardCompileOpts) { - createStandardModulePasses(&PM, 3, - /*OptimizeSize=*/ false, - /*UnitAtATime=*/ true, - /*UnrollLoops=*/ true, - /*SimplifyLibCalls=*/ true, - /*HaveExceptions=*/ true, - createFunctionInliningPass()); - } - - if (StandardLinkOpts) - createStandardLTOPasses(&PM, /*Internalize=*/true, - /*RunInliner=*/true, - /*VerifyEach=*/false); - - - for (std::vector::iterator I = PassList.begin(), - E = PassList.end(); - I != E; ++I) { - const PassInfo* PI = *I; - D.addPass(PI->getPassArgument()); - } - - // Bugpoint has the ability of generating a plethora of core files, so to - // avoid filling up the disk, we prevent it - sys::Process::PreventCoreFiles(); - - std::string Error; - bool Failure = D.run(Error); - if (!Error.empty()) { - errs() << Error; - return 1; - } - return Failure; -} diff --git a/contrib/llvm/tools/clang/CMakeLists.txt b/contrib/llvm/tools/clang/CMakeLists.txt deleted file mode 100644 index 1ba2a622d4e1..000000000000 --- a/contrib/llvm/tools/clang/CMakeLists.txt +++ /dev/null @@ -1,152 +0,0 @@ -# Clang version information - -set(CLANG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) -set(CLANG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) - -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() - -if( NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR ) - file(GLOB_RECURSE - tablegenned_files_on_include_dir - "${CLANG_SOURCE_DIR}/include/clang/*.inc") - if( tablegenned_files_on_include_dir ) - message(FATAL_ERROR "Apparently there is a previous in-source build, " -"probably as the result of running `configure' and `make' on " -"${CLANG_SOURCE_DIR}. This may cause problems. The suspicious files are:\n" -"${tablegenned_files_on_include_dir}\nPlease clean the source directory.") - endif() -endif() - -# Compute the Clang version from the LLVM version. -string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION - ${PACKAGE_VERSION}) -message(STATUS "Clang version: ${CLANG_VERSION}") - -string(REGEX REPLACE "([0-9]+)\\.[0-9]+(\\.[0-9]+)?" "\\1" CLANG_VERSION_MAJOR - ${CLANG_VERSION}) -string(REGEX REPLACE "[0-9]+\\.([0-9]+)(\\.[0-9]+)?" "\\1" CLANG_VERSION_MINOR - ${CLANG_VERSION}) -if (${CLANG_VERSION} MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+") - set(CLANG_HAS_VERSION_PATCHLEVEL 1) - string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" CLANG_VERSION_PATCHLEVEL - ${CLANG_VERSION}) -else() - set(CLANG_HAS_VERSION_PATCHLEVEL 0) -endif() - -# Configure the Version.inc file. -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/include/clang/Basic/Version.inc.in - ${CMAKE_CURRENT_BINARY_DIR}/include/clang/Basic/Version.inc) - -# Add appropriate flags for GCC -if (CMAKE_COMPILER_IS_GNUCXX) - # FIXME: Turn off exceptions, RTTI: - # -fno-exceptions -fno-rtti - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common -Woverloaded-virtual -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings") -endif () - -if (APPLE) - set(CMAKE_MODULE_LINKER_FLAGS "-Wl,-flat_namespace -Wl,-undefined -Wl,suppress") -endif () - -macro(add_clang_library name) - set(srcs ${ARGN}) - if(MSVC_IDE OR XCODE) - file( GLOB_RECURSE headers *.h *.td *.def) - set(srcs ${srcs} ${headers}) - string( REGEX MATCHALL "/[^/]+" split_path ${CMAKE_CURRENT_SOURCE_DIR}) - list( GET split_path -1 dir) - file( GLOB_RECURSE headers - ../../include/clang${dir}/*.h - ../../include/clang${dir}/*.td - ../../include/clang${dir}/*.def) - set(srcs ${srcs} ${headers}) - endif(MSVC_IDE OR XCODE) - if (MODULE) - set(libkind MODULE) - elseif (SHARED_LIBRARY) - set(libkind SHARED) - else() - set(libkind) - endif() - add_library( ${name} ${libkind} ${srcs} ) - if( LLVM_COMMON_DEPENDS ) - add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} ) - endif( LLVM_COMMON_DEPENDS ) - if( LLVM_USED_LIBS ) - foreach(lib ${LLVM_USED_LIBS}) - target_link_libraries( ${name} ${lib} ) - endforeach(lib) - endif( LLVM_USED_LIBS ) - if( LLVM_LINK_COMPONENTS ) - llvm_config(${name} ${LLVM_LINK_COMPONENTS}) - endif( LLVM_LINK_COMPONENTS ) - get_system_libs(llvm_system_libs) - if( llvm_system_libs ) - target_link_libraries(${name} ${llvm_system_libs}) - endif( llvm_system_libs ) - add_dependencies(${name} ClangDiagnosticCommon) - if(MSVC) - get_target_property(cflag ${name} COMPILE_FLAGS) - if(NOT cflag) - set(cflag "") - endif(NOT cflag) - set(cflag "${cflag} /Za") - set_target_properties(${name} PROPERTIES COMPILE_FLAGS ${cflag}) - endif(MSVC) - install(TARGETS ${name} - LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} - ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}) -endmacro(add_clang_library) - -macro(add_clang_executable name) - set(srcs ${ARGN}) - if(MSVC_IDE) - file( GLOB_RECURSE headers *.h *.td *.def) - set(srcs ${srcs} ${headers}) - endif(MSVC_IDE) - add_llvm_executable( ${name} ${srcs} ) -endmacro(add_clang_executable) - -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_BINARY_DIR}/include - ) - -install(DIRECTORY include/ - DESTINATION include - FILES_MATCHING - PATTERN "*.def" - PATTERN "*.h" - PATTERN "*.td" - PATTERN ".svn" EXCLUDE - ) - -install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ - DESTINATION include - FILES_MATCHING - PATTERN "CMakeFiles" EXCLUDE - PATTERN "*.inc" - ) - -add_definitions( -D_GNU_SOURCE ) - -option(CLANG_BUILD_EXAMPLES "Build CLANG example programs." OFF) -if(CLANG_BUILD_EXAMPLES) - add_subdirectory(examples) -endif () - -add_subdirectory(include) -add_subdirectory(lib) -add_subdirectory(tools) - -# TODO: docs. -add_subdirectory(test) - diff --git a/contrib/llvm/tools/clang/INSTALL.txt b/contrib/llvm/tools/clang/INSTALL.txt deleted file mode 100644 index e8e320962bb4..000000000000 --- a/contrib/llvm/tools/clang/INSTALL.txt +++ /dev/null @@ -1,49 +0,0 @@ -//===----------------------------------------------------------------------===// -// Clang Installation Instructions -//===----------------------------------------------------------------------===// - -These instructions describe how to build and install Clang. - -//===----------------------------------------------------------------------===// -// Step 1: Organization -//===----------------------------------------------------------------------===// - -Clang is designed to be built as part of an LLVM build. Assuming that the LLVM -source code is located at $LLVM_SRC_ROOT, then the clang source code should be -installed as: - - $LLVM_SRC_ROOT/tools/clang - -The directory is not required to be called clang, but doing so will allow the -LLVM build system to automatically recognize it and build it along with LLVM. - -//===----------------------------------------------------------------------===// -// Step 2: Configure and Build LLVM -//===----------------------------------------------------------------------===// - -Configure and build your copy of LLVM (see $LLVM_SRC_ROOT/GettingStarted.html -for more information). - -Assuming you installed clang at $LLVM_SRC_ROOT/tools/clang then Clang will -automatically be built with LLVM. Otherwise, run 'make' in the Clang source -directory to build Clang. - -//===----------------------------------------------------------------------===// -// Step 3: (Optional) Verify Your Build -//===----------------------------------------------------------------------===// - -It is a good idea to run the Clang tests to make sure your build works -correctly. From inside the Clang build directory, run 'make test' to run the -tests. - -//===----------------------------------------------------------------------===// -// Step 4: Install Clang -//===----------------------------------------------------------------------===// - -From inside the Clang build directory, run 'make install' to install the Clang -compiler and header files into the prefix directory selected when LLVM was -configured. - -The Clang compiler is available as 'clang' and supports a gcc like command line -interface. See the man page for clang (installed into $prefix/share/man/man1) -for more information. diff --git a/contrib/llvm/tools/clang/LICENSE.TXT b/contrib/llvm/tools/clang/LICENSE.TXT deleted file mode 100644 index a378a5f7fd51..000000000000 --- a/contrib/llvm/tools/clang/LICENSE.TXT +++ /dev/null @@ -1,63 +0,0 @@ -============================================================================== -LLVM Release License -============================================================================== -University of Illinois/NCSA -Open Source License - -Copyright (c) 2007-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. - -============================================================================== -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 -------- --------- - - diff --git a/contrib/llvm/tools/clang/Makefile b/contrib/llvm/tools/clang/Makefile deleted file mode 100644 index f871c25274ed..000000000000 --- a/contrib/llvm/tools/clang/Makefile +++ /dev/null @@ -1,92 +0,0 @@ -##===- Makefile --------------------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -# If CLANG_LEVEL is not set, then we are the top-level Makefile. Otherwise, we -# are being included from a subdirectory makefile. - -ifndef CLANG_LEVEL - -IS_TOP_LEVEL := 1 -CLANG_LEVEL := . -DIRS := include lib tools runtime docs - -PARALLEL_DIRS := - -ifeq ($(BUILD_EXAMPLES),1) - PARALLEL_DIRS += examples -endif -endif - -ifeq ($(MAKECMDGOALS),libs-only) - DIRS := $(filter-out tools docs, $(DIRS)) - OPTIONAL_DIRS := -endif - -### -# Common Makefile code, shared by all Clang Makefiles. - -# Set LLVM source root level. -LEVEL := $(CLANG_LEVEL)/../.. - -# Include LLVM common makefile. -include $(LEVEL)/Makefile.common - -# Set common Clang build flags. -CPP.Flags += -I$(PROJ_SRC_DIR)/$(CLANG_LEVEL)/include -I$(PROJ_OBJ_DIR)/$(CLANG_LEVEL)/include -ifdef CLANG_VENDOR -CPP.Flags += -DCLANG_VENDOR='"$(CLANG_VENDOR) "' -endif - -# Disable -fstrict-aliasing. Darwin disables it by default (and LLVM doesn't -# work with it enabled with GCC), Clang/llvm-gc don't support it yet, and newer -# GCC's have false positive warnings with it on Linux (which prove a pain to -# fix). For example: -# http://gcc.gnu.org/PR41874 -# http://gcc.gnu.org/PR41838 -# -# We can revisit this when LLVM/Clang support it. -CXX.Flags += -fno-strict-aliasing - -### -# Clang Top Level specific stuff. - -ifeq ($(IS_TOP_LEVEL),1) - -ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT)) -$(RecursiveTargets):: - $(Verb) if [ ! -f test/Makefile ]; then \ - $(MKDIR) test; \ - $(CP) $(PROJ_SRC_DIR)/test/Makefile test/Makefile; \ - fi -endif - -test:: - @ $(MAKE) -C test - -report:: - @ $(MAKE) -C test report - -clean:: - @ $(MAKE) -C test clean - -libs-only: all - -tags:: - $(Verb) etags `find . -type f -name '*.h' -or -name '*.cpp' | \ - grep -v /lib/Headers | grep -v /test/` - -cscope.files: - find tools lib include -name '*.cpp' \ - -or -name '*.def' \ - -or -name '*.td' \ - -or -name '*.h' > cscope.files - -.PHONY: test report clean cscope.files - -endif diff --git a/contrib/llvm/tools/clang/ModuleInfo.txt b/contrib/llvm/tools/clang/ModuleInfo.txt deleted file mode 100644 index 4368ef067aea..000000000000 --- a/contrib/llvm/tools/clang/ModuleInfo.txt +++ /dev/null @@ -1,5 +0,0 @@ -# This file provides information for llvm-top -DepModule: llvm -ConfigCmd: -ConfigTest: -BuildCmd: diff --git a/contrib/llvm/tools/clang/NOTES.txt b/contrib/llvm/tools/clang/NOTES.txt deleted file mode 100644 index f66a96120a81..000000000000 --- a/contrib/llvm/tools/clang/NOTES.txt +++ /dev/null @@ -1,85 +0,0 @@ -//===---------------------------------------------------------------------===// -// Random Notes -//===---------------------------------------------------------------------===// - -C90/C99/C++ Comparisons: -http://david.tribble.com/text/cdiffs.htm - -//===---------------------------------------------------------------------===// - -To time GCC preprocessing speed without output, use: - "time gcc -MM file" -This is similar to -Eonly. - -//===---------------------------------------------------------------------===// - -Creating and using a PTH file for performance measurement (use a release build). - -$ clang -ccc-pch-is-pth -x objective-c-header INPUTS/Cocoa_h.m -o /tmp/tokencache -$ clang -cc1 -token-cache /tmp/tokencache INPUTS/Cocoa_h.m - -//===---------------------------------------------------------------------===// - - C++ Template Instantiation benchmark: - http://users.rcn.com/abrahams/instantiation_speed/index.html - -//===---------------------------------------------------------------------===// - -TODO: File Manager Speedup: - - We currently do a lot of stat'ing for files that don't exist, particularly - when lots of -I paths exist (e.g. see the example, check for - failures in stat in FileManager::getFile). It would be far better to make - the following changes: - 1. FileEntry contains a sys::Path instead of a std::string for Name. - 2. sys::Path contains timestamp and size, lazily computed. Eliminate from - FileEntry. - 3. File UIDs are created on request, not when files are opened. - These changes make it possible to efficiently have FileEntry objects for - files that exist on the file system, but have not been used yet. - - Once this is done: - 1. DirectoryEntry gets a boolean value "has read entries". When false, not - all entries in the directory are in the file mgr, when true, they are. - 2. Instead of stat'ing the file in FileManager::getFile, check to see if - the dir has been read. If so, fail immediately, if not, read the dir, - then retry. - 3. Reading the dir uses the getdirentries syscall, creating an FileEntry - for all files found. - -//===---------------------------------------------------------------------===// -// Specifying targets: -triple and -arch -//===---------------------------------------------------------------------===// - -The clang supports "-triple" and "-arch" options. At most one -triple and one --arch option may be specified. Both are optional. - -The "selection of target" behavior is defined as follows: - -(1) If the user does not specify -triple, we default to the host triple. -(2) If the user specifies a -arch, that overrides the arch in the host or - specified triple. - -//===---------------------------------------------------------------------===// - - -verifyInputConstraint and verifyOutputConstraint should not return bool. - -Instead we should return something like: - -enum VerifyConstraintResult { - Valid, - - // Output only - OutputOperandConstraintLacksEqualsCharacter, - MatchingConstraintNotValidInOutputOperand, - - // Input only - InputOperandConstraintContainsEqualsCharacter, - MatchingConstraintReferencesInvalidOperandNumber, - - // Both - PercentConstraintUsedWithLastOperand -}; - -//===---------------------------------------------------------------------===// diff --git a/contrib/llvm/tools/clang/README.txt b/contrib/llvm/tools/clang/README.txt deleted file mode 100644 index 44ce723acef8..000000000000 --- a/contrib/llvm/tools/clang/README.txt +++ /dev/null @@ -1,26 +0,0 @@ -//===----------------------------------------------------------------------===// -// C Language Family Front-end -//===----------------------------------------------------------------------===// - -Welcome to Clang. This is a compiler front-end for the C family of languages -(C, C++, Objective-C, and Objective-C++) which is built as part of the LLVM -compiler infrastructure project. - -Unlike many other compiler frontends, Clang is useful for a number of things -beyond just compiling code: we intend for Clang to be host to a number of -different source level tools. One example of this is the Clang Static Analyzer. - -If you're interested in more (including how to build Clang) it is best to read -the relevant web sites. Here are some pointers: - -Information on Clang: http://clang.llvm.org/ -Building and using Clang: http://clang.llvm.org/get_started.html -Clang Static Analyzer: http://clang-analyzer.llvm.org/ -Information on the LLVM project: http://llvm.org/ - -If you have questions or comments about Clang, a great place to discuss them is -on the Clang development mailing list: - http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev - -If you find a bug in Clang, please file it in the LLVM bug tracker: - http://llvm.org/bugs/ diff --git a/contrib/llvm/tools/clang/TODO.txt b/contrib/llvm/tools/clang/TODO.txt deleted file mode 100644 index c63b1b33d6d6..000000000000 --- a/contrib/llvm/tools/clang/TODO.txt +++ /dev/null @@ -1,75 +0,0 @@ -//===---------------------------------------------------------------------===// -// Minor random things that can be improved -//===---------------------------------------------------------------------===// - - -Warn about "X && 0x1000" saying that the user may mean "X & 0x1000". -We should do this for any immediate except zero, so long as it doesn't come -from a macro expansion. Likewise for ||. - -//===---------------------------------------------------------------------===// - -Lexer-related diagnostics should point to the problematic character, not the -start of the token. For example: - -int y = 0000\ -00080; - -diag.c:4:9: error: invalid digit '8' in octal constant -int y = 0000\ - ^ - -should be: - -diag.c:4:9: error: invalid digit '8' in octal constant -00080; - ^ - -This specific diagnostic is implemented, but others should be updated. - -//===---------------------------------------------------------------------===// - -C++ (checker): For iterators, warn of the use of "iterator++" instead - of "++iterator" when when the value returned by operator++(int) is - ignored. - -//===---------------------------------------------------------------------===// - -We want to keep more source range information in Declarator to help -produce better diagnostics. Declarator::getSourceRange() should be -implemented to give a range for the whole declarator with all of its -specifiers, and DeclaratorChunk::ParamInfo should also have a source -range covering the whole parameter, so that an error message like this: - -overloaded-operator-decl.cpp:37:23: error: parameter of overloaded post-increment operator must have type 'int' (not 'float') -X operator++(X&, const float& f); - ^ -can be turned into something like this: - -overloaded-operator-decl.cpp:37:23: error: parameter of overloaded post-increment operator must have type 'int' (not 'float') -X operator++(X&, const float& f); - ^ ~~~~~~~~~~~~~~ - -//===---------------------------------------------------------------------===// - -For terminal output, we should consider limiting the amount of -diagnostic text we print once the first error has been -encountered. For example, once we have produced an error diagnostic, -we should only continue producing diagnostics until we have produced a -page full of results (say, 50 lines of text). Beyond that, (1) the -remaining errors are likely to be less interesting, and (2) the poor -user has to scroll his terminal to find out where things went wrong. - -//===---------------------------------------------------------------------===// -More ideas for code modification hints: - - If no member of a given name is found in a class/struct, search through the names of entities that do exist in the class and suggest the closest candidate. e.g., if I write "DS.setTypeSpecType", it would suggest "DS.SetTypeSpecType" (edit distance = 1). - - If a class member is defined out-of-line but isn't in the class declaration (and there are no close matches!), provide the option to add an in-class declaration. - - Fix-it hints for the inclusion of headers when needed for particular features (e.g., for typeid) - -//===---------------------------------------------------------------------===// - -Options to support: - -ftabstop=width - -fpreprocessed mode. - -nostdinc++ - -imultilib diff --git a/contrib/llvm/tools/clang/bindings/python/README.txt b/contrib/llvm/tools/clang/bindings/python/README.txt deleted file mode 100644 index 742cf8fbb8fc..000000000000 --- a/contrib/llvm/tools/clang/bindings/python/README.txt +++ /dev/null @@ -1,17 +0,0 @@ -//===----------------------------------------------------------------------===// -// Clang Python Bindings -//===----------------------------------------------------------------------===// - -This directory implements Python bindings for Clang. - -You may need to alter LD_LIBRARY_PATH so that the Clang library can be -found. The unit tests are designed to be run with 'nosetests'. For example: --- -$ env PYTHONPATH=$(echo ~/llvm/tools/clang/bindings/python/) \ - LD_LIBRARY_PATH=$(llvm-config --libdir) \ - nosetests -v -tests.cindex.test_index.test_create ... ok -... - -OK --- diff --git a/contrib/llvm/tools/clang/bindings/python/clang/__init__.py b/contrib/llvm/tools/clang/bindings/python/clang/__init__.py deleted file mode 100644 index 88f30812383f..000000000000 --- a/contrib/llvm/tools/clang/bindings/python/clang/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -#===- __init__.py - Clang Python Bindings --------------------*- python -*--===# -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -#===------------------------------------------------------------------------===# - -r""" -Clang Library Bindings -====================== - -This package provides access to the Clang compiler and libraries. - -The available modules are: - - cindex - - Bindings for the Clang indexing library. -""" - -__all__ = ['cindex'] - diff --git a/contrib/llvm/tools/clang/bindings/python/clang/cindex.py b/contrib/llvm/tools/clang/bindings/python/clang/cindex.py deleted file mode 100644 index f0f81b5d6948..000000000000 --- a/contrib/llvm/tools/clang/bindings/python/clang/cindex.py +++ /dev/null @@ -1,935 +0,0 @@ -#===- cindex.py - Python Indexing Library Bindings -----------*- python -*--===# -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -#===------------------------------------------------------------------------===# - -r""" -Clang Indexing Library Bindings -=============================== - -This module provides an interface to the Clang indexing library. It is a -low-level interface to the indexing library which attempts to match the Clang -API directly while also being "pythonic". Notable differences from the C API -are: - - * string results are returned as Python strings, not CXString objects. - - * null cursors are translated to None. - - * access to child cursors is done via iteration, not visitation. - -The major indexing objects are: - - Index - - The top-level object which manages some global library state. - - TranslationUnit - - High-level object encapsulating the AST for a single translation unit. These - can be loaded from .ast files or parsed on the fly. - - Cursor - - Generic object for representing a node in the AST. - - SourceRange, SourceLocation, and File - - Objects representing information about the input source. - -Most object information is exposed using properties, when the underlying API -call is efficient. -""" - -# TODO -# ==== -# -# o API support for invalid translation units. Currently we can't even get the -# diagnostics on failure because they refer to locations in an object that -# will have been invalidated. -# -# o fix memory management issues (currently client must hold on to index and -# translation unit, or risk crashes). -# -# o expose code completion APIs. -# -# o cleanup ctypes wrapping, would be nice to separate the ctypes details more -# clearly, and hide from the external interface (i.e., help(cindex)). -# -# o implement additional SourceLocation, SourceRange, and File methods. - -from ctypes import * - -def get_cindex_library(): - # FIXME: It's probably not the case that the library is actually found in - # this location. We need a better system of identifying and loading the - # CIndex library. It could be on path or elsewhere, or versioned, etc. - import platform - name = platform.system() - if name == 'Darwin': - return cdll.LoadLibrary('libclang.dylib') - elif name == 'Windows': - return cdll.LoadLibrary('libclang.dll') - else: - return cdll.LoadLibrary('libclang.so') - -# ctypes doesn't implicitly convert c_void_p to the appropriate wrapper -# object. This is a problem, because it means that from_parameter will see an -# integer and pass the wrong value on platforms where int != void*. Work around -# this by marshalling object arguments as void**. -c_object_p = POINTER(c_void_p) - -lib = get_cindex_library() - -### Structures and Utility Classes ### - -class _CXString(Structure): - """Helper for transforming CXString results.""" - - _fields_ = [("spelling", c_char_p), ("free", c_int)] - - def __del__(self): - _CXString_dispose(self) - - @staticmethod - def from_result(res, fn, args): - assert isinstance(res, _CXString) - return _CXString_getCString(res) - -class SourceLocation(Structure): - """ - A SourceLocation represents a particular location within a source file. - """ - _fields_ = [("ptr_data", c_void_p * 2), ("int_data", c_uint)] - _data = None - - def _get_instantiation(self): - if self._data is None: - f, l, c, o = c_object_p(), c_uint(), c_uint(), c_uint() - SourceLocation_loc(self, byref(f), byref(l), byref(c), byref(o)) - f = File(f) if f else None - self._data = (f, int(l.value), int(c.value), int(c.value)) - return self._data - - @property - def file(self): - """Get the file represented by this source location.""" - return self._get_instantiation()[0] - - @property - def line(self): - """Get the line represented by this source location.""" - return self._get_instantiation()[1] - - @property - def column(self): - """Get the column represented by this source location.""" - return self._get_instantiation()[2] - - @property - def offset(self): - """Get the file offset represented by this source location.""" - return self._get_instantiation()[3] - - def __repr__(self): - return "" % ( - self.file.name if self.file else None, self.line, self.column) - -class SourceRange(Structure): - """ - A SourceRange describes a range of source locations within the source - code. - """ - _fields_ = [ - ("ptr_data", c_void_p * 2), - ("begin_int_data", c_uint), - ("end_int_data", c_uint)] - - # FIXME: Eliminate this and make normal constructor? Requires hiding ctypes - # object. - @staticmethod - def from_locations(start, end): - return SourceRange_getRange(start, end) - - @property - def start(self): - """ - Return a SourceLocation representing the first character within a - source range. - """ - return SourceRange_start(self) - - @property - def end(self): - """ - Return a SourceLocation representing the last character within a - source range. - """ - return SourceRange_end(self) - - def __repr__(self): - return "" % (self.start, self.end) - -class Diagnostic(object): - """ - A Diagnostic is a single instance of a Clang diagnostic. It includes the - diagnostic severity, the message, the location the diagnostic occurred, as - well as additional source ranges and associated fix-it hints. - """ - - Ignored = 0 - Note = 1 - Warning = 2 - Error = 3 - Fatal = 4 - - def __init__(self, ptr): - self.ptr = ptr - - def __del__(self): - _clang_disposeDiagnostic(self.ptr) - - @property - def severity(self): - return _clang_getDiagnosticSeverity(self.ptr) - - @property - def location(self): - return _clang_getDiagnosticLocation(self.ptr) - - @property - def spelling(self): - return _clang_getDiagnosticSpelling(self.ptr) - - @property - def ranges(self): - class RangeIterator: - def __init__(self, diag): - self.diag = diag - - def __len__(self): - return int(_clang_getDiagnosticNumRanges(self.diag)) - - def __getitem__(self, key): - return _clang_getDiagnosticRange(self.diag, key) - - return RangeIterator(self.ptr) - - @property - def fixits(self): - class FixItIterator: - def __init__(self, diag): - self.diag = diag - - def __len__(self): - return int(_clang_getDiagnosticNumFixIts(self.diag)) - - def __getitem__(self, key): - range = SourceRange() - value = _clang_getDiagnosticFixIt(self.diag, key, byref(range)) - if len(value) == 0: - raise IndexError - - return FixIt(range, value) - - return FixItIterator(self.ptr) - - def __repr__(self): - return "" % ( - self.severity, self.location, self.spelling) - -class FixIt(object): - """ - A FixIt represents a transformation to be applied to the source to - "fix-it". The fix-it shouldbe applied by replacing the given source range - with the given value. - """ - - def __init__(self, range, value): - self.range = range - self.value = value - - def __repr__(self): - return "" % (self.range, self.value) - -### Cursor Kinds ### - -class CursorKind(object): - """ - A CursorKind describes the kind of entity that a cursor points to. - """ - - # The unique kind objects, indexed by id. - _kinds = [] - _name_map = None - - def __init__(self, value): - if value >= len(CursorKind._kinds): - CursorKind._kinds += [None] * (value - len(CursorKind._kinds) + 1) - if CursorKind._kinds[value] is not None: - raise ValueError,'CursorKind already loaded' - self.value = value - CursorKind._kinds[value] = self - CursorKind._name_map = None - - def from_param(self): - return self.value - - @property - def name(self): - """Get the enumeration name of this cursor kind.""" - if self._name_map is None: - self._name_map = {} - for key,value in CursorKind.__dict__.items(): - if isinstance(value,CursorKind): - self._name_map[value] = key - return self._name_map[self] - - @staticmethod - def from_id(id): - if id >= len(CursorKind._kinds) or CursorKind._kinds[id] is None: - raise ValueError,'Unknown cursor kind' - return CursorKind._kinds[id] - - @staticmethod - def get_all_kinds(): - """Return all CursorKind enumeration instances.""" - return filter(None, CursorKind._kinds) - - def is_declaration(self): - """Test if this is a declaration kind.""" - return CursorKind_is_decl(self) - - def is_reference(self): - """Test if this is a reference kind.""" - return CursorKind_is_ref(self) - - def is_expression(self): - """Test if this is an expression kind.""" - return CursorKind_is_expr(self) - - def is_statement(self): - """Test if this is a statement kind.""" - return CursorKind_is_stmt(self) - - def is_invalid(self): - """Test if this is an invalid kind.""" - return CursorKind_is_inv(self) - - def __repr__(self): - return 'CursorKind.%s' % (self.name,) - -# FIXME: Is there a nicer way to expose this enumeration? We could potentially -# represent the nested structure, or even build a class hierarchy. The main -# things we want for sure are (a) simple external access to kinds, (b) a place -# to hang a description and name, (c) easy to keep in sync with Index.h. - -### -# Declaration Kinds - -# A declaration whose specific kind is not exposed via this interface. -# -# Unexposed declarations have the same operations as any other kind of -# declaration; one can extract their location information, spelling, find their -# definitions, etc. However, the specific kind of the declaration is not -# reported. -CursorKind.UNEXPOSED_DECL = CursorKind(1) - -# A C or C++ struct. -CursorKind.STRUCT_DECL = CursorKind(2) - -# A C or C++ union. -CursorKind.UNION_DECL = CursorKind(3) - -# A C++ class. -CursorKind.CLASS_DECL = CursorKind(4) - -# An enumeration. -CursorKind.ENUM_DECL = CursorKind(5) - -# A field (in C) or non-static data member (in C++) in a struct, union, or C++ -# class. -CursorKind.FIELD_DECL = CursorKind(6) - -# An enumerator constant. -CursorKind.ENUM_CONSTANT_DECL = CursorKind(7) - -# A function. -CursorKind.FUNCTION_DECL = CursorKind(8) - -# A variable. -CursorKind.VAR_DECL = CursorKind(9) - -# A function or method parameter. -CursorKind.PARM_DECL = CursorKind(10) - -# An Objective-C @interface. -CursorKind.OBJC_INTERFACE_DECL = CursorKind(11) - -# An Objective-C @interface for a category. -CursorKind.OBJC_CATEGORY_DECL = CursorKind(12) - -# An Objective-C @protocol declaration. -CursorKind.OBJC_PROTOCOL_DECL = CursorKind(13) - -# An Objective-C @property declaration. -CursorKind.OBJC_PROPERTY_DECL = CursorKind(14) - -# An Objective-C instance variable. -CursorKind.OBJC_IVAR_DECL = CursorKind(15) - -# An Objective-C instance method. -CursorKind.OBJC_INSTANCE_METHOD_DECL = CursorKind(16) - -# An Objective-C class method. -CursorKind.OBJC_CLASS_METHOD_DECL = CursorKind(17) - -# An Objective-C @implementation. -CursorKind.OBJC_IMPLEMENTATION_DECL = CursorKind(18) - -# An Objective-C @implementation for a category. -CursorKind.OBJC_CATEGORY_IMPL_DECL = CursorKind(19) - -# A typedef. -CursorKind.TYPEDEF_DECL = CursorKind(20) - -### -# Reference Kinds - -CursorKind.OBJC_SUPER_CLASS_REF = CursorKind(40) -CursorKind.OBJC_PROTOCOL_REF = CursorKind(41) -CursorKind.OBJC_CLASS_REF = CursorKind(42) - -# A reference to a type declaration. -# -# A type reference occurs anywhere where a type is named but not -# declared. For example, given: -# typedef unsigned size_type; -# size_type size; -# -# The typedef is a declaration of size_type (CXCursor_TypedefDecl), -# while the type of the variable "size" is referenced. The cursor -# referenced by the type of size is the typedef for size_type. -CursorKind.TYPE_REF = CursorKind(43) - -### -# Invalid/Error Kinds - -CursorKind.INVALID_FILE = CursorKind(70) -CursorKind.NO_DECL_FOUND = CursorKind(71) -CursorKind.NOT_IMPLEMENTED = CursorKind(72) - -### -# Expression Kinds - -# An expression whose specific kind is not exposed via this interface. -# -# Unexposed expressions have the same operations as any other kind of -# expression; one can extract their location information, spelling, children, -# etc. However, the specific kind of the expression is not reported. -CursorKind.UNEXPOSED_EXPR = CursorKind(100) - -# An expression that refers to some value declaration, such as a function, -# varible, or enumerator. -CursorKind.DECL_REF_EXPR = CursorKind(101) - -# An expression that refers to a member of a struct, union, class, Objective-C -# class, etc. -CursorKind.MEMBER_REF_EXPR = CursorKind(102) - -# An expression that calls a function. -CursorKind.CALL_EXPR = CursorKind(103) - -# An expression that sends a message to an Objective-C object or class. -CursorKind.OBJC_MESSAGE_EXPR = CursorKind(104) - -# A statement whose specific kind is not exposed via this interface. -# -# Unexposed statements have the same operations as any other kind of statement; -# one can extract their location information, spelling, children, etc. However, -# the specific kind of the statement is not reported. -CursorKind.UNEXPOSED_STMT = CursorKind(200) - -### -# Other Kinds - -# Cursor that represents the translation unit itself. -# -# The translation unit cursor exists primarily to act as the root cursor for -# traversing the contents of a translation unit. -CursorKind.TRANSLATION_UNIT = CursorKind(300) - -### Cursors ### - -class Cursor(Structure): - """ - The Cursor class represents a reference to an element within the AST. It - acts as a kind of iterator. - """ - _fields_ = [("_kind_id", c_int), ("data", c_void_p * 3)] - - def __eq__(self, other): - return Cursor_eq(self, other) - - def __ne__(self, other): - return not Cursor_eq(self, other) - - def is_definition(self): - """ - Returns true if the declaration pointed at by the cursor is also a - definition of that entity. - """ - return Cursor_is_def(self) - - def get_definition(self): - """ - If the cursor is a reference to a declaration or a declaration of - some entity, return a cursor that points to the definition of that - entity. - """ - # TODO: Should probably check that this is either a reference or - # declaration prior to issuing the lookup. - return Cursor_def(self) - - def get_usr(self): - """Return the Unified Symbol Resultion (USR) for the entity referenced - by the given cursor (or None). - - A Unified Symbol Resolution (USR) is a string that identifies a - particular entity (function, class, variable, etc.) within a - program. USRs can be compared across translation units to determine, - e.g., when references in one translation refer to an entity defined in - another translation unit.""" - return Cursor_usr(self) - - @property - def kind(self): - """Return the kind of this cursor.""" - return CursorKind.from_id(self._kind_id) - - @property - def spelling(self): - """Return the spelling of the entity pointed at by the cursor.""" - if not self.kind.is_declaration(): - # FIXME: clang_getCursorSpelling should be fixed to not assert on - # this, for consistency with clang_getCursorUSR. - return None - return Cursor_spelling(self) - - @property - def location(self): - """ - Return the source location (the starting character) of the entity - pointed at by the cursor. - """ - return Cursor_loc(self) - - @property - def extent(self): - """ - Return the source range (the range of text) occupied by the entity - pointed at by the cursor. - """ - return Cursor_extent(self) - - def get_children(self): - """Return an iterator for accessing the children of this cursor.""" - - # FIXME: Expose iteration from CIndex, PR6125. - def visitor(child, parent, children): - # FIXME: Document this assertion in API. - # FIXME: There should just be an isNull method. - assert child != Cursor_null() - children.append(child) - return 1 # continue - children = [] - Cursor_visit(self, Cursor_visit_callback(visitor), children) - return iter(children) - - @staticmethod - def from_result(res, fn, args): - assert isinstance(res, Cursor) - # FIXME: There should just be an isNull method. - if res == Cursor_null(): - return None - return res - -## CIndex Objects ## - -# CIndex objects (derived from ClangObject) are essentially lightweight -# wrappers attached to some underlying object, which is exposed via CIndex as -# a void*. - -class ClangObject(object): - """ - A helper for Clang objects. This class helps act as an intermediary for - the ctypes library and the Clang CIndex library. - """ - def __init__(self, obj): - assert isinstance(obj, c_object_p) and obj - self.obj = self._as_parameter_ = obj - - def from_param(self): - return self._as_parameter_ - - -class _CXUnsavedFile(Structure): - """Helper for passing unsaved file arguments.""" - _fields_ = [("name", c_char_p), ("contents", c_char_p), ('length', c_ulong)] - -## Diagnostic Conversion ## - -_clang_getNumDiagnostics = lib.clang_getNumDiagnostics -_clang_getNumDiagnostics.argtypes = [c_object_p] -_clang_getNumDiagnostics.restype = c_uint - -_clang_getDiagnostic = lib.clang_getDiagnostic -_clang_getDiagnostic.argtypes = [c_object_p, c_uint] -_clang_getDiagnostic.restype = c_object_p - -_clang_disposeDiagnostic = lib.clang_disposeDiagnostic -_clang_disposeDiagnostic.argtypes = [c_object_p] - -_clang_getDiagnosticSeverity = lib.clang_getDiagnosticSeverity -_clang_getDiagnosticSeverity.argtypes = [c_object_p] -_clang_getDiagnosticSeverity.restype = c_int - -_clang_getDiagnosticLocation = lib.clang_getDiagnosticLocation -_clang_getDiagnosticLocation.argtypes = [c_object_p] -_clang_getDiagnosticLocation.restype = SourceLocation - -_clang_getDiagnosticSpelling = lib.clang_getDiagnosticSpelling -_clang_getDiagnosticSpelling.argtypes = [c_object_p] -_clang_getDiagnosticSpelling.restype = _CXString -_clang_getDiagnosticSpelling.errcheck = _CXString.from_result - -_clang_getDiagnosticNumRanges = lib.clang_getDiagnosticNumRanges -_clang_getDiagnosticNumRanges.argtypes = [c_object_p] -_clang_getDiagnosticNumRanges.restype = c_uint - -_clang_getDiagnosticRange = lib.clang_getDiagnosticRange -_clang_getDiagnosticRange.argtypes = [c_object_p, c_uint] -_clang_getDiagnosticRange.restype = SourceRange - -_clang_getDiagnosticNumFixIts = lib.clang_getDiagnosticNumFixIts -_clang_getDiagnosticNumFixIts.argtypes = [c_object_p] -_clang_getDiagnosticNumFixIts.restype = c_uint - -_clang_getDiagnosticFixIt = lib.clang_getDiagnosticFixIt -_clang_getDiagnosticFixIt.argtypes = [c_object_p, c_uint, POINTER(SourceRange)] -_clang_getDiagnosticFixIt.restype = _CXString -_clang_getDiagnosticFixIt.errcheck = _CXString.from_result - -### - -class Index(ClangObject): - """ - The Index type provides the primary interface to the Clang CIndex library, - primarily by providing an interface for reading and parsing translation - units. - """ - - @staticmethod - def create(excludeDecls=False): - """ - Create a new Index. - Parameters: - excludeDecls -- Exclude local declarations from translation units. - """ - return Index(Index_create(excludeDecls, 0)) - - def __del__(self): - Index_dispose(self) - - def read(self, path): - """Load the translation unit from the given AST file.""" - ptr = TranslationUnit_read(self, path) - return TranslationUnit(ptr) if ptr else None - - def parse(self, path, args = [], unsaved_files = []): - """ - Load the translation unit from the given source code file by running - clang and generating the AST before loading. Additional command line - parameters can be passed to clang via the args parameter. - - In-memory contents for files can be provided by passing a list of pairs - to as unsaved_files, the first item should be the filenames to be mapped - and the second should be the contents to be substituted for the - file. The contents may be passed as strings or file objects. - """ - arg_array = 0 - if len(args): - arg_array = (c_char_p * len(args))(* args) - unsaved_files_array = 0 - if len(unsaved_files): - unsaved_files_array = (_CXUnsavedFile * len(unsaved_files))() - for i,(name,value) in enumerate(unsaved_files): - if not isinstance(value, str): - # FIXME: It would be great to support an efficient version - # of this, one day. - value = value.read() - print value - if not isinstance(value, str): - raise TypeError,'Unexpected unsaved file contents.' - unsaved_files_array[i].name = name - unsaved_files_array[i].contents = value - unsaved_files_array[i].length = len(value) - ptr = TranslationUnit_parse(self, path, len(args), arg_array, - len(unsaved_files), unsaved_files_array) - return TranslationUnit(ptr) if ptr else None - - -class TranslationUnit(ClangObject): - """ - The TranslationUnit class represents a source code translation unit and - provides read-only access to its top-level declarations. - """ - - def __init__(self, ptr): - ClangObject.__init__(self, ptr) - - def __del__(self): - TranslationUnit_dispose(self) - - @property - def cursor(self): - """Retrieve the cursor that represents the given translation unit.""" - return TranslationUnit_cursor(self) - - @property - def spelling(self): - """Get the original translation unit source file name.""" - return TranslationUnit_spelling(self) - - def get_includes(self): - """ - Return an iterable sequence of FileInclusion objects that describe the - sequence of inclusions in a translation unit. The first object in - this sequence is always the input file. Note that this method will not - recursively iterate over header files included through precompiled - headers. - """ - def visitor(fobj, lptr, depth, includes): - loc = lptr.contents - includes.append(FileInclusion(loc.file, File(fobj), loc, depth)) - - # Automatically adapt CIndex/ctype pointers to python objects - includes = [] - TranslationUnit_includes(self, - TranslationUnit_includes_callback(visitor), - includes) - return iter(includes) - - @property - def diagnostics(self): - """ - Return an iterable (and indexable) object containing the diagnostics. - """ - class DiagIterator: - def __init__(self, tu): - self.tu = tu - - def __len__(self): - return int(_clang_getNumDiagnostics(self.tu)) - - def __getitem__(self, key): - diag = _clang_getDiagnostic(self.tu, key) - if not diag: - raise IndexError - return Diagnostic(diag) - - return DiagIterator(self) - -class File(ClangObject): - """ - The File class represents a particular source file that is part of a - translation unit. - """ - - @property - def name(self): - """Return the complete file and path name of the file.""" - return File_name(self) - - @property - def time(self): - """Return the last modification time of the file.""" - return File_time(self) - -class FileInclusion(object): - """ - The FileInclusion class represents the inclusion of one source file by - another via a '#include' directive or as the input file for the translation - unit. This class provides information about the included file, the including - file, the location of the '#include' directive and the depth of the included - file in the stack. Note that the input file has depth 0. - """ - - def __init__(self, src, tgt, loc, depth): - self.source = src - self.include = tgt - self.location = loc - self.depth = depth - - @property - def is_input_file(self): - """True if the included file is the input file.""" - return self.depth == 0 - -# Additional Functions and Types - -# String Functions -_CXString_dispose = lib.clang_disposeString -_CXString_dispose.argtypes = [_CXString] - -_CXString_getCString = lib.clang_getCString -_CXString_getCString.argtypes = [_CXString] -_CXString_getCString.restype = c_char_p - -# Source Location Functions -SourceLocation_loc = lib.clang_getInstantiationLocation -SourceLocation_loc.argtypes = [SourceLocation, POINTER(c_object_p), - POINTER(c_uint), POINTER(c_uint), - POINTER(c_uint)] - -# Source Range Functions -SourceRange_getRange = lib.clang_getRange -SourceRange_getRange.argtypes = [SourceLocation, SourceLocation] -SourceRange_getRange.restype = SourceRange - -SourceRange_start = lib.clang_getRangeStart -SourceRange_start.argtypes = [SourceRange] -SourceRange_start.restype = SourceLocation - -SourceRange_end = lib.clang_getRangeEnd -SourceRange_end.argtypes = [SourceRange] -SourceRange_end.restype = SourceLocation - -# CursorKind Functions -CursorKind_is_decl = lib.clang_isDeclaration -CursorKind_is_decl.argtypes = [CursorKind] -CursorKind_is_decl.restype = bool - -CursorKind_is_ref = lib.clang_isReference -CursorKind_is_ref.argtypes = [CursorKind] -CursorKind_is_ref.restype = bool - -CursorKind_is_expr = lib.clang_isExpression -CursorKind_is_expr.argtypes = [CursorKind] -CursorKind_is_expr.restype = bool - -CursorKind_is_stmt = lib.clang_isStatement -CursorKind_is_stmt.argtypes = [CursorKind] -CursorKind_is_stmt.restype = bool - -CursorKind_is_inv = lib.clang_isInvalid -CursorKind_is_inv.argtypes = [CursorKind] -CursorKind_is_inv.restype = bool - -# Cursor Functions -# TODO: Implement this function -Cursor_get = lib.clang_getCursor -Cursor_get.argtypes = [TranslationUnit, SourceLocation] -Cursor_get.restype = Cursor - -Cursor_null = lib.clang_getNullCursor -Cursor_null.restype = Cursor - -Cursor_usr = lib.clang_getCursorUSR -Cursor_usr.argtypes = [Cursor] -Cursor_usr.restype = _CXString -Cursor_usr.errcheck = _CXString.from_result - -Cursor_is_def = lib.clang_isCursorDefinition -Cursor_is_def.argtypes = [Cursor] -Cursor_is_def.restype = bool - -Cursor_def = lib.clang_getCursorDefinition -Cursor_def.argtypes = [Cursor] -Cursor_def.restype = Cursor -Cursor_def.errcheck = Cursor.from_result - -Cursor_eq = lib.clang_equalCursors -Cursor_eq.argtypes = [Cursor, Cursor] -Cursor_eq.restype = c_uint - -Cursor_spelling = lib.clang_getCursorSpelling -Cursor_spelling.argtypes = [Cursor] -Cursor_spelling.restype = _CXString -Cursor_spelling.errcheck = _CXString.from_result - -Cursor_loc = lib.clang_getCursorLocation -Cursor_loc.argtypes = [Cursor] -Cursor_loc.restype = SourceLocation - -Cursor_extent = lib.clang_getCursorExtent -Cursor_extent.argtypes = [Cursor] -Cursor_extent.restype = SourceRange - -Cursor_ref = lib.clang_getCursorReferenced -Cursor_ref.argtypes = [Cursor] -Cursor_ref.restype = Cursor -Cursor_ref.errcheck = Cursor.from_result - -Cursor_visit_callback = CFUNCTYPE(c_int, Cursor, Cursor, py_object) -Cursor_visit = lib.clang_visitChildren -Cursor_visit.argtypes = [Cursor, Cursor_visit_callback, py_object] -Cursor_visit.restype = c_uint - -# Index Functions -Index_create = lib.clang_createIndex -Index_create.argtypes = [c_int, c_int] -Index_create.restype = c_object_p - -Index_dispose = lib.clang_disposeIndex -Index_dispose.argtypes = [Index] - -# Translation Unit Functions -TranslationUnit_read = lib.clang_createTranslationUnit -TranslationUnit_read.argtypes = [Index, c_char_p] -TranslationUnit_read.restype = c_object_p - -TranslationUnit_parse = lib.clang_createTranslationUnitFromSourceFile -TranslationUnit_parse.argtypes = [Index, c_char_p, c_int, c_void_p, - c_int, c_void_p] -TranslationUnit_parse.restype = c_object_p - -TranslationUnit_cursor = lib.clang_getTranslationUnitCursor -TranslationUnit_cursor.argtypes = [TranslationUnit] -TranslationUnit_cursor.restype = Cursor -TranslationUnit_cursor.errcheck = Cursor.from_result - -TranslationUnit_spelling = lib.clang_getTranslationUnitSpelling -TranslationUnit_spelling.argtypes = [TranslationUnit] -TranslationUnit_spelling.restype = _CXString -TranslationUnit_spelling.errcheck = _CXString.from_result - -TranslationUnit_dispose = lib.clang_disposeTranslationUnit -TranslationUnit_dispose.argtypes = [TranslationUnit] - -TranslationUnit_includes_callback = CFUNCTYPE(None, - c_object_p, - POINTER(SourceLocation), - c_uint, py_object) -TranslationUnit_includes = lib.clang_getInclusions -TranslationUnit_includes.argtypes = [TranslationUnit, - TranslationUnit_includes_callback, - py_object] - -# File Functions -File_name = lib.clang_getFileName -File_name.argtypes = [File] -File_name.restype = c_char_p - -File_time = lib.clang_getFileTime -File_time.argtypes = [File] -File_time.restype = c_uint - -### - -__all__ = ['Index', 'TranslationUnit', 'Cursor', 'CursorKind', - 'Diagnostic', 'FixIt', 'SourceRange', 'SourceLocation', 'File'] diff --git a/contrib/llvm/tools/clang/bindings/python/examples/cindex/cindex-dump.py b/contrib/llvm/tools/clang/bindings/python/examples/cindex/cindex-dump.py deleted file mode 100644 index af7ddab6ea53..000000000000 --- a/contrib/llvm/tools/clang/bindings/python/examples/cindex/cindex-dump.py +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env python - -#===- cindex-dump.py - cindex/Python Source Dump -------------*- python -*--===# -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -#===------------------------------------------------------------------------===# - -""" -A simple command line tool for dumping a source file using the Clang Index -Library. -""" - -def get_diag_info(diag): - return { 'severity' : diag.severity, - 'location' : diag.location, - 'spelling' : diag.spelling, - 'ranges' : diag.ranges, - 'fixits' : diag.fixits } - -def get_cursor_id(cursor, cursor_list = []): - if not opts.showIDs: - return None - - if cursor is None: - return None - - # FIXME: This is really slow. It would be nice if the index API exposed - # something that let us hash cursors. - for i,c in enumerate(cursor_list): - if cursor == c: - return i - cursor_list.append(cursor) - return len(cursor_list) - 1 - -def get_info(node, depth=0): - if opts.maxDepth is not None and depth >= opts.maxDepth: - children = None - else: - children = [get_info(c, depth+1) - for c in node.get_children()] - return { 'id' : get_cursor_id(node), - 'kind' : node.kind, - 'usr' : node.get_usr(), - 'spelling' : node.spelling, - 'location' : node.location, - 'extent.start' : node.extent.start, - 'extent.end' : node.extent.end, - 'is_definition' : node.is_definition(), - 'definition id' : get_cursor_id(node.get_definition()), - 'children' : children } - -def main(): - from clang.cindex import Index - from pprint import pprint - - from optparse import OptionParser, OptionGroup - - global opts - - parser = OptionParser("usage: %prog [options] {filename} [clang-args*]") - parser.add_option("", "--show-ids", dest="showIDs", - help="Don't compute cursor IDs (very slow)", - default=False) - parser.add_option("", "--max-depth", dest="maxDepth", - help="Limit cursor expansion to depth N", - metavar="N", type=int, default=None) - parser.disable_interspersed_args() - (opts, args) = parser.parse_args() - - if len(args) == 0: - parser.error('invalid number arguments') - - index = Index.create() - tu = index.parse(None, args) - if not tu: - parser.error("unable to load input") - - pprint(('diags', map(get_diag_info, tu.diagnostics))) - pprint(('nodes', get_info(tu.cursor))) - -if __name__ == '__main__': - main() - diff --git a/contrib/llvm/tools/clang/bindings/python/examples/cindex/cindex-includes.py b/contrib/llvm/tools/clang/bindings/python/examples/cindex/cindex-includes.py deleted file mode 100644 index 17500227a349..000000000000 --- a/contrib/llvm/tools/clang/bindings/python/examples/cindex/cindex-includes.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python - -#===- cindex-includes.py - cindex/Python Inclusion Graph -----*- python -*--===# -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -#===------------------------------------------------------------------------===# - -""" -A simple command line tool for dumping a Graphviz description (dot) that -describes include dependencies. -""" - -def main(): - import sys - from clang.cindex import Index - - from optparse import OptionParser, OptionGroup - - parser = OptionParser("usage: %prog [options] {filename} [clang-args*]") - parser.disable_interspersed_args() - (opts, args) = parser.parse_args() - if len(args) == 0: - parser.error('invalid number arguments') - - # FIXME: Add an output file option - out = sys.stdout - - index = Index.create() - tu = index.parse(None, args) - if not tu: - parser.error("unable to load input") - - # A helper function for generating the node name. - def name(f): - if f: - return "\"" + f.name + "\"" - - # Generate the include graph - out.write("digraph G {\n") - for i in tu.get_includes(): - line = " "; - if i.is_input_file: - # Always write the input file as a node just in case it doesn't - # actually include anything. This would generate a 1 node graph. - line += name(i.include) - else: - line += '%s->%s' % (name(i.source), name(i.include)) - line += "\n"; - out.write(line) - out.write("}\n") - -if __name__ == '__main__': - main() - diff --git a/contrib/llvm/tools/clang/bindings/python/tests/__init__.py b/contrib/llvm/tools/clang/bindings/python/tests/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/header1.h b/contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/header1.h deleted file mode 100644 index b4eacbee3754..000000000000 --- a/contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/header1.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef HEADER1 -#define HEADER1 - -#include "header3.h" - -#endif diff --git a/contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/header2.h b/contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/header2.h deleted file mode 100644 index c4eddc0c5620..000000000000 --- a/contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/header2.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef HEADER2 -#define HEADER2 - -#include "header3.h" - -#endif diff --git a/contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/header3.h b/contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/header3.h deleted file mode 100644 index 6dca764860e1..000000000000 --- a/contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/header3.h +++ /dev/null @@ -1,3 +0,0 @@ -// Not a guarded header! - -void f(); diff --git a/contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/hello.cpp b/contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/hello.cpp deleted file mode 100644 index 7ef086e56b2c..000000000000 --- a/contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/hello.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "stdio.h" - -int main(int argc, char* argv[]) { - printf("hello world\n"); - return 0; -} diff --git a/contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/include.cpp b/contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/include.cpp deleted file mode 100644 index 60cfdaae4d09..000000000000 --- a/contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/include.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include "header1.h" -#include "header2.h" -#include "header1.h" - -int main() { } diff --git a/contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/parse_arguments.c b/contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/parse_arguments.c deleted file mode 100644 index 7196486c78a1..000000000000 --- a/contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/parse_arguments.c +++ /dev/null @@ -1,2 +0,0 @@ -int DECL_ONE = 1; -int DECL_TWO = 2; diff --git a/contrib/llvm/tools/clang/bindings/python/tests/cindex/__init__.py b/contrib/llvm/tools/clang/bindings/python/tests/cindex/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/contrib/llvm/tools/clang/bindings/python/tests/cindex/test_cursor.py b/contrib/llvm/tools/clang/bindings/python/tests/cindex/test_cursor.py deleted file mode 100644 index a653ba7bf28e..000000000000 --- a/contrib/llvm/tools/clang/bindings/python/tests/cindex/test_cursor.py +++ /dev/null @@ -1,59 +0,0 @@ -from clang.cindex import Index, CursorKind - -kInput = """\ -// FIXME: Find nicer way to drop builtins and other cruft. -int start_decl; - -struct s0 { - int a; - int b; -}; - -struct s1; - -void f0(int a0, int a1) { - int l0, l1; - - if (a0) - return; - - for (;;) { - break; - } -} -""" - -def test_get_children(): - index = Index.create() - tu = index.parse('t.c', unsaved_files = [('t.c',kInput)]) - - # Skip until past start_decl. - it = tu.cursor.get_children() - while it.next().spelling != 'start_decl': - pass - - tu_nodes = list(it) - - assert len(tu_nodes) == 3 - - assert tu_nodes[0].kind == CursorKind.STRUCT_DECL - assert tu_nodes[0].spelling == 's0' - assert tu_nodes[0].is_definition() == True - assert tu_nodes[0].location.file.name == 't.c' - assert tu_nodes[0].location.line == 4 - assert tu_nodes[0].location.column == 8 - - s0_nodes = list(tu_nodes[0].get_children()) - assert len(s0_nodes) == 2 - assert s0_nodes[0].kind == CursorKind.FIELD_DECL - assert s0_nodes[0].spelling == 'a' - assert s0_nodes[1].kind == CursorKind.FIELD_DECL - assert s0_nodes[1].spelling == 'b' - - assert tu_nodes[1].kind == CursorKind.STRUCT_DECL - assert tu_nodes[1].spelling == 's1' - assert tu_nodes[1].is_definition() == False - - assert tu_nodes[2].kind == CursorKind.FUNCTION_DECL - assert tu_nodes[2].spelling == 'f0' - assert tu_nodes[2].is_definition() == True diff --git a/contrib/llvm/tools/clang/bindings/python/tests/cindex/test_cursor_kind.py b/contrib/llvm/tools/clang/bindings/python/tests/cindex/test_cursor_kind.py deleted file mode 100644 index bdfa31855835..000000000000 --- a/contrib/llvm/tools/clang/bindings/python/tests/cindex/test_cursor_kind.py +++ /dev/null @@ -1,27 +0,0 @@ -from clang.cindex import CursorKind - -def test_name(): - assert CursorKind.UNEXPOSED_DECL.name is 'UNEXPOSED_DECL' - -def test_get_all_kinds(): - assert CursorKind.UNEXPOSED_DECL in CursorKind.get_all_kinds() - assert CursorKind.TRANSLATION_UNIT in CursorKind.get_all_kinds() - -def test_kind_groups(): - """Check that every kind classifies to exactly one group.""" - - assert CursorKind.UNEXPOSED_DECL.is_declaration() - assert CursorKind.TYPE_REF.is_reference() - assert CursorKind.DECL_REF_EXPR.is_expression() - assert CursorKind.UNEXPOSED_STMT.is_statement() - assert CursorKind.INVALID_FILE.is_invalid() - - for k in CursorKind.get_all_kinds(): - group = [n for n in ('is_declaration', 'is_reference', 'is_expression', - 'is_statement', 'is_invalid') - if getattr(k, n)()] - - if k == CursorKind.TRANSLATION_UNIT: - assert len(group) == 0 - else: - assert len(group) == 1 diff --git a/contrib/llvm/tools/clang/bindings/python/tests/cindex/test_diagnostics.py b/contrib/llvm/tools/clang/bindings/python/tests/cindex/test_diagnostics.py deleted file mode 100644 index 85187652917b..000000000000 --- a/contrib/llvm/tools/clang/bindings/python/tests/cindex/test_diagnostics.py +++ /dev/null @@ -1,48 +0,0 @@ -from clang.cindex import * - -def tu_from_source(source): - index = Index.create() - tu = index.parse('INPUT.c', unsaved_files = [('INPUT.c', source)]) - # FIXME: Remove the need for this. - tu.index = index - return tu - -# FIXME: We need support for invalid translation units to test better. - -def test_diagnostic_warning(): - tu = tu_from_source("""int f0() {}\n""") - assert len(tu.diagnostics) == 1 - assert tu.diagnostics[0].severity == Diagnostic.Warning - assert tu.diagnostics[0].location.line == 1 - assert tu.diagnostics[0].location.column == 11 - assert (tu.diagnostics[0].spelling == - 'control reaches end of non-void function') - -def test_diagnostic_note(): - # FIXME: We aren't getting notes here for some reason. - index = Index.create() - tu = tu_from_source("""#define A x\nvoid *A = 1;\n""") - assert len(tu.diagnostics) == 1 - assert tu.diagnostics[0].severity == Diagnostic.Warning - assert tu.diagnostics[0].location.line == 2 - assert tu.diagnostics[0].location.column == 7 - assert 'incompatible' in tu.diagnostics[0].spelling -# assert tu.diagnostics[1].severity == Diagnostic.Note -# assert tu.diagnostics[1].location.line == 1 -# assert tu.diagnostics[1].location.column == 11 -# assert tu.diagnostics[1].spelling == 'instantiated from' - -def test_diagnostic_fixit(): - index = Index.create() - tu = tu_from_source("""struct { int f0; } x = { f0 : 1 };""") - assert len(tu.diagnostics) == 1 - assert tu.diagnostics[0].severity == Diagnostic.Warning - assert tu.diagnostics[0].location.line == 1 - assert tu.diagnostics[0].location.column == 31 - assert tu.diagnostics[0].spelling.startswith('use of GNU old-style') - assert len(tu.diagnostics[0].fixits) == 1 - assert tu.diagnostics[0].fixits[0].range.start.line == 1 - assert tu.diagnostics[0].fixits[0].range.start.column == 26 - assert tu.diagnostics[0].fixits[0].range.end.line == 1 - assert tu.diagnostics[0].fixits[0].range.end.column == 30 - assert tu.diagnostics[0].fixits[0].value == '.f0 = ' diff --git a/contrib/llvm/tools/clang/bindings/python/tests/cindex/test_index.py b/contrib/llvm/tools/clang/bindings/python/tests/cindex/test_index.py deleted file mode 100644 index dc173f04d218..000000000000 --- a/contrib/llvm/tools/clang/bindings/python/tests/cindex/test_index.py +++ /dev/null @@ -1,15 +0,0 @@ -from clang.cindex import * -import os - -kInputsDir = os.path.join(os.path.dirname(__file__), 'INPUTS') - -def test_create(): - index = Index.create() - -# FIXME: test Index.read - -def test_parse(): - index = Index.create() - assert isinstance(index, Index) - tu = index.parse(os.path.join(kInputsDir, 'hello.cpp')) - assert isinstance(tu, TranslationUnit) diff --git a/contrib/llvm/tools/clang/bindings/python/tests/cindex/test_translation_unit.py b/contrib/llvm/tools/clang/bindings/python/tests/cindex/test_translation_unit.py deleted file mode 100644 index 3c05c3f06af4..000000000000 --- a/contrib/llvm/tools/clang/bindings/python/tests/cindex/test_translation_unit.py +++ /dev/null @@ -1,73 +0,0 @@ -from clang.cindex import * -import os - -kInputsDir = os.path.join(os.path.dirname(__file__), 'INPUTS') - -def test_spelling(): - path = os.path.join(kInputsDir, 'hello.cpp') - index = Index.create() - tu = index.parse(path) - assert tu.spelling == path - -def test_cursor(): - path = os.path.join(kInputsDir, 'hello.cpp') - index = Index.create() - tu = index.parse(path) - c = tu.cursor - assert isinstance(c, Cursor) - assert c.kind is CursorKind.TRANSLATION_UNIT - -def test_parse_arguments(): - path = os.path.join(kInputsDir, 'parse_arguments.c') - index = Index.create() - tu = index.parse(path, ['-DDECL_ONE=hello', '-DDECL_TWO=hi']) - spellings = [c.spelling for c in tu.cursor.get_children()] - assert spellings[-2] == 'hello' - assert spellings[-1] == 'hi' - -def test_unsaved_files(): - index = Index.create() - # FIXME: Why can't we just use "fake.h" here (instead of /tmp/fake.h)? - tu = index.parse('fake.c', unsaved_files = [ - ('fake.c', """ -#include "/tmp/fake.h" -int x; -int SOME_DEFINE; -"""), - ('/tmp/fake.h', """ -#define SOME_DEFINE y -""") - ]) - spellings = [c.spelling for c in tu.cursor.get_children()] - assert spellings[-2] == 'x' - assert spellings[-1] == 'y' - -def test_unsaved_files_2(): - import StringIO - index = Index.create() - tu = index.parse('fake.c', unsaved_files = [ - ('fake.c', StringIO.StringIO('int x;'))]) - spellings = [c.spelling for c in tu.cursor.get_children()] - assert spellings[-1] == 'x' - - -def test_includes(): - def eq(expected, actual): - if not actual.is_input_file: - return expected[0] == actual.source.name and \ - expected[1] == actual.include.name - else: - return expected[1] == actual.include.name - - src = os.path.join(kInputsDir, 'include.cpp') - h1 = os.path.join(kInputsDir, "header1.h") - h2 = os.path.join(kInputsDir, "header2.h") - h3 = os.path.join(kInputsDir, "header3.h") - inc = [(None, src), (src, h1), (h1, h3), (src, h2), (h2, h3)] - - index = Index.create() - tu = index.parse(src) - for i in zip(inc, tu.get_includes()): - assert eq(i[0], i[1]) - - diff --git a/contrib/llvm/tools/clang/include/CMakeLists.txt b/contrib/llvm/tools/clang/include/CMakeLists.txt deleted file mode 100644 index 253a09b1012f..000000000000 --- a/contrib/llvm/tools/clang/include/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(clang) diff --git a/contrib/llvm/tools/clang/include/Makefile b/contrib/llvm/tools/clang/include/Makefile deleted file mode 100644 index 79b9adfb7282..000000000000 --- a/contrib/llvm/tools/clang/include/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -CLANG_LEVEL := .. -DIRS := clang clang-c - -include $(CLANG_LEVEL)/Makefile diff --git a/contrib/llvm/tools/clang/include/clang-c/Makefile b/contrib/llvm/tools/clang/include/clang-c/Makefile deleted file mode 100644 index 98ea7190e687..000000000000 --- a/contrib/llvm/tools/clang/include/clang-c/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -CLANG_LEVEL := ../.. -DIRS := - -include $(CLANG_LEVEL)/Makefile - -install-local:: - $(Echo) Installing Clang C API include files - $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_includedir) - $(Verb) if test -d "$(PROJ_SRC_ROOT)/tools/clang/include/clang-c" ; then \ - cd $(PROJ_SRC_ROOT)/tools/clang/include && \ - for hdr in `find clang-c -type f '!' '(' -name '*~' \ - -o -name '.#*' -o -name '*.in' -o -name '*.txt' \ - -o -name 'Makefile' -o -name '*.td' ')' -print \ - | grep -v CVS | grep -v .svn | grep -v .dir` ; do \ - instdir=$(DESTDIR)`dirname "$(PROJ_includedir)/$$hdr"` ; \ - if test \! -d "$$instdir" ; then \ - $(EchoCmd) Making install directory $$instdir ; \ - $(MKDIR) $$instdir ;\ - fi ; \ - $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \ - done ; \ - fi -ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT)) - $(Verb) if test -d "$(PROJ_OBJ_ROOT)/tools/clang/include/clang-c" ; then \ - cd $(PROJ_OBJ_ROOT)/tools/clang/include && \ - for hdr in `find clang-c -type f '!' '(' -name 'Makefile' ')' -print \ - | grep -v CVS | grep -v .tmp | grep -v .dir` ; do \ - $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \ - done ; \ - fi -endif diff --git a/contrib/llvm/tools/clang/include/clang/AST/CMakeLists.txt b/contrib/llvm/tools/clang/include/clang/AST/CMakeLists.txt deleted file mode 100644 index 800c58361b02..000000000000 --- a/contrib/llvm/tools/clang/include/clang/AST/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -set(LLVM_TARGET_DEFINITIONS ../Basic/Attr.td) -tablegen(Attrs.inc - -gen-clang-attr-classes - -I ${CMAKE_CURRENT_SOURCE_DIR}/../../) -add_custom_target(ClangAttrClasses - DEPENDS Attrs.inc) - -tablegen(AttrImpl.inc - -gen-clang-attr-impl - -I ${CMAKE_CURRENT_SOURCE_DIR}/../../) -add_custom_target(ClangAttrImpl - DEPENDS AttrImpl.inc) - -set(LLVM_TARGET_DEFINITIONS ../Basic/StmtNodes.td) -tablegen(StmtNodes.inc - -gen-clang-stmt-nodes) -add_custom_target(ClangStmtNodes - DEPENDS StmtNodes.inc) - -set(LLVM_TARGET_DEFINITIONS ../Basic/DeclNodes.td) -tablegen(DeclNodes.inc - -gen-clang-decl-nodes) -add_custom_target(ClangDeclNodes - DEPENDS DeclNodes.inc) diff --git a/contrib/llvm/tools/clang/include/clang/AST/Makefile b/contrib/llvm/tools/clang/include/clang/AST/Makefile deleted file mode 100644 index 6ba6e897d186..000000000000 --- a/contrib/llvm/tools/clang/include/clang/AST/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -CLANG_LEVEL := ../../.. -TD_SRC_DIR = $(PROJ_SRC_DIR)/../Basic -BUILT_SOURCES = Attrs.inc AttrImpl.inc StmtNodes.inc DeclNodes.inc - -TABLEGEN_INC_FILES_COMMON = 1 - -include $(CLANG_LEVEL)/Makefile - -$(ObjDir)/Attrs.inc.tmp : $(TD_SRC_DIR)/Attr.td $(TBLGEN) \ - $(ObjDir)/.dir - $(Echo) "Building Clang attribute classes with tblgen" - $(Verb) $(TableGen) -gen-clang-attr-classes -o $(call SYSPATH, $@) \ - -I $(PROJ_SRC_DIR)/../../ $< - -$(ObjDir)/AttrImpl.inc.tmp : $(TD_SRC_DIR)/Attr.td $(TBLGEN) \ - $(ObjDir)/.dir - $(Echo) "Building Clang attribute implementations with tblgen" - $(Verb) $(TableGen) -gen-clang-attr-impl -o $(call SYSPATH, $@) \ - -I $(PROJ_SRC_DIR)/../../ $< - -$(ObjDir)/StmtNodes.inc.tmp : $(TD_SRC_DIR)/StmtNodes.td $(TBLGEN) \ - $(ObjDir)/.dir - $(Echo) "Building Clang statement node tables with tblgen" - $(Verb) $(TableGen) -gen-clang-stmt-nodes -o $(call SYSPATH, $@) $< - -$(ObjDir)/DeclNodes.inc.tmp : $(TD_SRC_DIR)/DeclNodes.td $(TBLGEN) \ - $(ObjDir)/.dir - $(Echo) "Building Clang declaration node tables with tblgen" - $(Verb) $(TableGen) -gen-clang-decl-nodes -o $(call SYSPATH, $@) $< diff --git a/contrib/llvm/tools/clang/include/clang/Basic/CMakeLists.txt b/contrib/llvm/tools/clang/include/clang/Basic/CMakeLists.txt deleted file mode 100644 index c5952365d593..000000000000 --- a/contrib/llvm/tools/clang/include/clang/Basic/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -macro(clang_diag_gen component) - tablegen(Diagnostic${component}Kinds.inc - -gen-clang-diags-defs -clang-component=${component}) - add_custom_target(ClangDiagnostic${component} - DEPENDS Diagnostic${component}Kinds.inc) -endmacro(clang_diag_gen) - -set(LLVM_TARGET_DEFINITIONS Diagnostic.td) -clang_diag_gen(Analysis) -clang_diag_gen(AST) -clang_diag_gen(Common) -clang_diag_gen(Driver) -clang_diag_gen(Frontend) -clang_diag_gen(Lex) -clang_diag_gen(Parse) -clang_diag_gen(Sema) -tablegen(DiagnosticGroups.inc - -gen-clang-diag-groups) -add_custom_target(ClangDiagnosticGroups - DEPENDS DiagnosticGroups.inc) - -set(LLVM_TARGET_DEFINITIONS Attr.td) -tablegen(AttrList.inc - -gen-clang-attr-list - -I ${CMAKE_CURRENT_SOURCE_DIR}/../../) -add_custom_target(ClangAttrList - DEPENDS AttrList.inc) - -# ARM NEON -set(LLVM_TARGET_DEFINITIONS arm_neon.td) -tablegen(arm_neon.inc -gen-arm-neon-sema) -add_custom_target(ClangARMNeon DEPENDS arm_neon.inc) diff --git a/contrib/llvm/tools/clang/include/clang/Basic/Makefile b/contrib/llvm/tools/clang/include/clang/Basic/Makefile deleted file mode 100644 index bc64f6aab555..000000000000 --- a/contrib/llvm/tools/clang/include/clang/Basic/Makefile +++ /dev/null @@ -1,56 +0,0 @@ -CLANG_LEVEL := ../../.. -BUILT_SOURCES = \ - DiagnosticAnalysisKinds.inc DiagnosticASTKinds.inc \ - DiagnosticCommonKinds.inc DiagnosticDriverKinds.inc \ - DiagnosticFrontendKinds.inc DiagnosticLexKinds.inc \ - DiagnosticParseKinds.inc DiagnosticSemaKinds.inc \ - DiagnosticGroups.inc AttrList.inc arm_neon.inc \ - Version.inc - -TABLEGEN_INC_FILES_COMMON = 1 - -include $(CLANG_LEVEL)/Makefile - -INPUT_TDS = $(wildcard $(PROJ_SRC_DIR)/Diagnostic*.td) - -# Compute the Clang version from the LLVM version, unless specified explicitly. -ifndef CLANG_VERSION -CLANG_VERSION := $(subst svn,,$(LLVMVersion)) -CLANG_VERSION := $(subst rc,,$(CLANG_VERSION)) -endif - -CLANG_VERSION_COMPONENTS := $(subst ., ,$(CLANG_VERSION)) -CLANG_VERSION_MAJOR := $(word 1,$(CLANG_VERSION_COMPONENTS)) -CLANG_VERSION_MINOR := $(word 2,$(CLANG_VERSION_COMPONENTS)) -CLANG_VERSION_PATCHLEVEL := $(word 3,$(CLANG_VERSION_COMPONENTS)) -ifeq ($(CLANG_VERSION_PATCHLEVEL),) -CLANG_HAS_VERSION_PATCHLEVEL := 0 -else -CLANG_HAS_VERSION_PATCHLEVEL := 1 -endif - -$(ObjDir)/Diagnostic%Kinds.inc.tmp : Diagnostic.td Diagnostic%Kinds.td $(TBLGEN) $(ObjDir)/.dir - $(Echo) "Building Clang $(patsubst Diagnostic%Kinds.inc.tmp,%,$(@F)) diagnostic tables with tblgen" - $(Verb) $(TableGen) -gen-clang-diags-defs -clang-component=$(patsubst Diagnostic%Kinds.inc.tmp,%,$(@F)) -o $(call SYSPATH, $@) $< - -$(ObjDir)/DiagnosticGroups.inc.tmp : Diagnostic.td DiagnosticGroups.td $(INPUT_TDS) $(TBLGEN) $(ObjDir)/.dir - $(Echo) "Building Clang diagnostic groups with tblgen" - $(Verb) $(TableGen) -gen-clang-diag-groups -o $(call SYSPATH, $@) $< - -$(ObjDir)/AttrList.inc.tmp : Attr.td $(TBLGEN) $(ObjDir)/.dir - $(Echo) "Building Clang attribute list with tblgen" - $(Verb) $(TableGen) -gen-clang-attr-list -o $(call SYSPATH, $@) \ - -I $(PROJ_SRC_DIR)/../.. $< - -$(ObjDir)/arm_neon.inc.tmp : arm_neon.td $(TBLGEN) $(ObjDir)/.dir - $(Echo) "Building Clang arm_neon.inc with tblgen" - $(Verb) $(TableGen) -gen-arm-neon-sema -o $(call SYSPATH, $@) $< - -$(ObjDir)/Version.inc.tmp : Version.inc.in Makefile $(LLVM_OBJ_ROOT)/Makefile.config $(ObjDir)/.dir - $(Echo) "Updating Clang version info." - $(Verb)sed -e "s#@CLANG_VERSION@#$(CLANG_VERSION)#g" \ - -e "s#@CLANG_VERSION_MAJOR@#$(CLANG_VERSION_MAJOR)#g" \ - -e "s#@CLANG_VERSION_MINOR@#$(CLANG_VERSION_MINOR)#g" \ - -e "s#@CLANG_VERSION_PATCHLEVEL@#$(CLANG_VERSION_PATCHLEVEL)#g" \ - -e "s#@CLANG_HAS_VERSION_PATCHLEVEL@#$(CLANG_HAS_VERSION_PATCHLEVEL)#g" \ - $< > $@ diff --git a/contrib/llvm/tools/clang/include/clang/Basic/Version.inc.in b/contrib/llvm/tools/clang/include/clang/Basic/Version.inc.in deleted file mode 100644 index ccf8430c8ba2..000000000000 --- a/contrib/llvm/tools/clang/include/clang/Basic/Version.inc.in +++ /dev/null @@ -1,6 +0,0 @@ -#define CLANG_VERSION @CLANG_VERSION@ -#define CLANG_VERSION_MAJOR @CLANG_VERSION_MAJOR@ -#define CLANG_VERSION_MINOR @CLANG_VERSION_MINOR@ -#if @CLANG_HAS_VERSION_PATCHLEVEL@ -#define CLANG_VERSION_PATCHLEVEL @CLANG_VERSION_PATCHLEVEL@ -#endif diff --git a/contrib/llvm/tools/clang/include/clang/CMakeLists.txt b/contrib/llvm/tools/clang/include/clang/CMakeLists.txt deleted file mode 100644 index e82cf429eecc..000000000000 --- a/contrib/llvm/tools/clang/include/clang/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(AST) -add_subdirectory(Basic) -add_subdirectory(Driver) -add_subdirectory(Serialization) diff --git a/contrib/llvm/tools/clang/include/clang/Driver/CMakeLists.txt b/contrib/llvm/tools/clang/include/clang/Driver/CMakeLists.txt deleted file mode 100644 index 99be53ffc72b..000000000000 --- a/contrib/llvm/tools/clang/include/clang/Driver/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -set(LLVM_TARGET_DEFINITIONS Options.td) -tablegen(Options.inc - -gen-opt-parser-defs) -add_custom_target(ClangDriverOptions - DEPENDS Options.inc) - -set(LLVM_TARGET_DEFINITIONS CC1Options.td) -tablegen(CC1Options.inc - -gen-opt-parser-defs) -add_custom_target(ClangCC1Options - DEPENDS CC1Options.inc) - -set(LLVM_TARGET_DEFINITIONS CC1AsOptions.td) -tablegen(CC1AsOptions.inc - -gen-opt-parser-defs) -add_custom_target(ClangCC1AsOptions - DEPENDS CC1AsOptions.inc) diff --git a/contrib/llvm/tools/clang/include/clang/Driver/Makefile b/contrib/llvm/tools/clang/include/clang/Driver/Makefile deleted file mode 100644 index d8291662a563..000000000000 --- a/contrib/llvm/tools/clang/include/clang/Driver/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -CLANG_LEVEL := ../../.. -BUILT_SOURCES = Options.inc CC1Options.inc CC1AsOptions.inc - -TABLEGEN_INC_FILES_COMMON = 1 - -include $(CLANG_LEVEL)/Makefile - -$(ObjDir)/Options.inc.tmp : Options.td OptParser.td $(TBLGEN) $(ObjDir)/.dir - $(Echo) "Building Clang Driver Option tables with tblgen" - $(Verb) $(TableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $< - -$(ObjDir)/CC1Options.inc.tmp : CC1Options.td OptParser.td $(TBLGEN) $(ObjDir)/.dir - $(Echo) "Building Clang CC1 Option tables with tblgen" - $(Verb) $(TableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $< - -$(ObjDir)/CC1AsOptions.inc.tmp : CC1AsOptions.td OptParser.td $(TBLGEN) $(ObjDir)/.dir - $(Echo) "Building Clang CC1 Assembler Option tables with tblgen" - $(Verb) $(TableGen) -gen-opt-parser-defs -o $(call SYSPATH, $@) $< diff --git a/contrib/llvm/tools/clang/include/clang/Makefile b/contrib/llvm/tools/clang/include/clang/Makefile deleted file mode 100644 index 030b0720fd81..000000000000 --- a/contrib/llvm/tools/clang/include/clang/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -CLANG_LEVEL := ../.. -DIRS := AST Basic Driver Serialization - -include $(CLANG_LEVEL)/Makefile - -install-local:: - $(Echo) Installing Clang include files - $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_includedir) - $(Verb) if test -d "$(PROJ_SRC_ROOT)/tools/clang/include/clang" ; then \ - cd $(PROJ_SRC_ROOT)/tools/clang/include && \ - for hdr in `find clang -type f '!' '(' -name '*~' \ - -o -name '.#*' -o -name '*.in' -o -name '*.txt' \ - -o -name 'Makefile' -o -name '*.td' -o -name '*.orig' ')' -print \ - | grep -v CVS | grep -v .svn | grep -v .dir` ; do \ - instdir=$(DESTDIR)`dirname "$(PROJ_includedir)/$$hdr"` ; \ - if test \! -d "$$instdir" ; then \ - $(EchoCmd) Making install directory $$instdir ; \ - $(MKDIR) $$instdir ;\ - fi ; \ - $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \ - done ; \ - fi -ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT)) - $(Verb) if test -d "$(PROJ_OBJ_ROOT)/tools/clang/include/clang" ; then \ - cd $(PROJ_OBJ_ROOT)/tools/clang/include && \ - for hdr in `find clang -type f '!' '(' -name 'Makefile' ')' -print \ - | grep -v CVS | grep -v .tmp | grep -v .dir` ; do \ - $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \ - done ; \ - fi -endif diff --git a/contrib/llvm/tools/clang/include/clang/Serialization/CMakeLists.txt b/contrib/llvm/tools/clang/include/clang/Serialization/CMakeLists.txt deleted file mode 100644 index 3712009bf37d..000000000000 --- a/contrib/llvm/tools/clang/include/clang/Serialization/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -set(LLVM_TARGET_DEFINITIONS ../Basic/Attr.td) -tablegen(AttrPCHRead.inc - -gen-clang-attr-pch-read - -I ${CMAKE_CURRENT_SOURCE_DIR}/../../) -add_custom_target(ClangAttrPCHRead - DEPENDS AttrPCHRead.inc) - -tablegen(AttrPCHWrite.inc - -gen-clang-attr-pch-write - -I ${CMAKE_CURRENT_SOURCE_DIR}/../../) -add_custom_target(ClangAttrPCHWrite - DEPENDS AttrPCHWrite.inc) diff --git a/contrib/llvm/tools/clang/include/clang/Serialization/Makefile b/contrib/llvm/tools/clang/include/clang/Serialization/Makefile deleted file mode 100644 index 79486b11bc68..000000000000 --- a/contrib/llvm/tools/clang/include/clang/Serialization/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -CLANG_LEVEL := ../../.. -TD_SRC_DIR = $(PROJ_SRC_DIR)/../Basic -BUILT_SOURCES = AttrPCHRead.inc AttrPCHWrite.inc - -TABLEGEN_INC_FILES_COMMON = 1 - -include $(CLANG_LEVEL)/Makefile - -$(ObjDir)/AttrPCHRead.inc.tmp : $(TD_SRC_DIR)/Attr.td $(TBLGEN) \ - $(ObjDir)/.dir - $(Echo) "Building Clang PCH reader with tblgen" - $(Verb) $(TableGen) -gen-clang-attr-pch-read -o $(call SYSPATH, $@) \ - -I $(PROJ_SRC_DIR)/../../ $< - -$(ObjDir)/AttrPCHWrite.inc.tmp : $(TD_SRC_DIR)/Attr.td $(TBLGEN) \ - $(ObjDir)/.dir - $(Echo) "Building Clang PCH writer with tblgen" - $(Verb) $(TableGen) -gen-clang-attr-pch-write -o $(call SYSPATH, $@) \ - -I $(PROJ_SRC_DIR)/../../ $< diff --git a/contrib/llvm/tools/clang/lib/AST/CMakeLists.txt b/contrib/llvm/tools/clang/lib/AST/CMakeLists.txt deleted file mode 100644 index 82a81ec42411..000000000000 --- a/contrib/llvm/tools/clang/lib/AST/CMakeLists.txt +++ /dev/null @@ -1,46 +0,0 @@ -set(LLVM_NO_RTTI 1) - -add_clang_library(clangAST - APValue.cpp - ASTConsumer.cpp - ASTContext.cpp - ASTDiagnostic.cpp - ASTImporter.cpp - AttrImpl.cpp - CXXInheritance.cpp - Decl.cpp - DeclarationName.cpp - DeclBase.cpp - DeclCXX.cpp - DeclFriend.cpp - DeclGroup.cpp - DeclObjC.cpp - DeclPrinter.cpp - DeclTemplate.cpp - Expr.cpp - ExprClassification.cpp - ExprConstant.cpp - ExprCXX.cpp - FullExpr.cpp - InheritViz.cpp - ItaniumCXXABI.cpp - MicrosoftCXXABI.cpp - NestedNameSpecifier.cpp - ParentMap.cpp - RecordLayout.cpp - RecordLayoutBuilder.cpp - Stmt.cpp - StmtDumper.cpp - StmtIterator.cpp - StmtPrinter.cpp - StmtProfile.cpp - StmtViz.cpp - TemplateBase.cpp - TemplateName.cpp - Type.cpp - TypeLoc.cpp - TypePrinter.cpp - ) - -add_dependencies(clangAST ClangARMNeon ClangAttrClasses ClangAttrList - ClangAttrImpl ClangDiagnosticAST ClangDeclNodes ClangStmtNodes) diff --git a/contrib/llvm/tools/clang/lib/AST/Makefile b/contrib/llvm/tools/clang/lib/AST/Makefile deleted file mode 100644 index 65383c5552d4..000000000000 --- a/contrib/llvm/tools/clang/lib/AST/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -##===- clang/lib/AST/Makefile ------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -# -# This implements the AST library for the C-Language front-end. -# -##===----------------------------------------------------------------------===## - -CLANG_LEVEL := ../.. -LIBRARYNAME := clangAST - -include $(CLANG_LEVEL)/Makefile - diff --git a/contrib/llvm/tools/clang/lib/Analysis/CMakeLists.txt b/contrib/llvm/tools/clang/lib/Analysis/CMakeLists.txt deleted file mode 100644 index 850e9b468100..000000000000 --- a/contrib/llvm/tools/clang/lib/Analysis/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -set(LLVM_NO_RTTI 1) - -add_clang_library(clangAnalysis - AnalysisContext.cpp - CFG.cpp - CFGStmtMap.cpp - FormatString.cpp - LiveVariables.cpp - PrintfFormatString.cpp - PseudoConstantAnalysis.cpp - ReachableCode.cpp - ScanfFormatString.cpp - UninitializedValues.cpp - ) - -add_dependencies(clangAnalysis ClangAttrClasses ClangAttrList - ClangDiagnosticAnalysis ClangDeclNodes ClangStmtNodes) diff --git a/contrib/llvm/tools/clang/lib/Analysis/Makefile b/contrib/llvm/tools/clang/lib/Analysis/Makefile deleted file mode 100644 index fbbb83d71003..000000000000 --- a/contrib/llvm/tools/clang/lib/Analysis/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -##===- clang/lib/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 implements analyses built on top of source-level CFGs. -# -##===----------------------------------------------------------------------===## - -CLANG_LEVEL := ../.. -LIBRARYNAME := clangAnalysis - -include $(CLANG_LEVEL)/Makefile - diff --git a/contrib/llvm/tools/clang/lib/Basic/CMakeLists.txt b/contrib/llvm/tools/clang/lib/Basic/CMakeLists.txt deleted file mode 100644 index 87bf834c2752..000000000000 --- a/contrib/llvm/tools/clang/lib/Basic/CMakeLists.txt +++ /dev/null @@ -1,39 +0,0 @@ -set(LLVM_NO_RTTI 1) - -add_clang_library(clangBasic - Builtins.cpp - ConvertUTF.c - Diagnostic.cpp - FileManager.cpp - IdentifierTable.cpp - SourceLocation.cpp - SourceManager.cpp - TargetInfo.cpp - Targets.cpp - TokenKinds.cpp - Version.cpp - ) - -# Determine Subversion revision. -# FIXME: This only gets updated when CMake is run, so this revision number -# may be out-of-date! -find_package(Subversion) -if (Subversion_FOUND AND EXISTS "${CLANG_SOURCE_DIR}/.svn") - Subversion_WC_INFO(${CLANG_SOURCE_DIR} CLANG) - set_source_files_properties(Version.cpp - PROPERTIES COMPILE_DEFINITIONS "SVN_REVISION=\"${CLANG_WC_REVISION}\"") -endif() - -add_dependencies(clangBasic - ClangARMNeon - ClangAttrList - ClangDiagnosticAnalysis - ClangDiagnosticAST - ClangDiagnosticCommon - ClangDiagnosticDriver - ClangDiagnosticFrontend - ClangDiagnosticGroups - ClangDiagnosticLex - ClangDiagnosticParse - ClangDiagnosticSema) - diff --git a/contrib/llvm/tools/clang/lib/Basic/Makefile b/contrib/llvm/tools/clang/lib/Basic/Makefile deleted file mode 100644 index c15630459567..000000000000 --- a/contrib/llvm/tools/clang/lib/Basic/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -##===- clang/lib/Basic/Makefile ----------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -# -# This implements the Basic library for the C-Language front-end. -# -##===----------------------------------------------------------------------===## - -CLANG_LEVEL := ../.. -LIBRARYNAME := clangBasic - -include $(CLANG_LEVEL)/Makefile - -SVN_REVISION := $(shell $(LLVM_SRC_ROOT)/utils/GetSourceVersion $(PROJ_SRC_DIR)/../..) - -CPP.Defines += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include \ - -DSVN_REVISION='"$(SVN_REVISION)"' - -$(ObjDir)/.ver-svn .ver: $(ObjDir)/.dir - @if [ '$(SVN_REVISION)' != '$(shell cat $(ObjDir)/.ver-svn 2>/dev/null)' ]; then\ - echo '$(SVN_REVISION)' > $(ObjDir)/.ver-svn; \ - fi -$(ObjDir)/.ver-svn: .ver -$(ObjDir)/Version.o: $(ObjDir)/.ver-svn diff --git a/contrib/llvm/tools/clang/lib/CMakeLists.txt b/contrib/llvm/tools/clang/lib/CMakeLists.txt deleted file mode 100644 index bd5e342e028f..000000000000 --- a/contrib/llvm/tools/clang/lib/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -add_subdirectory(Headers) -add_subdirectory(Basic) -add_subdirectory(Lex) -add_subdirectory(Parse) -add_subdirectory(AST) -add_subdirectory(Sema) -add_subdirectory(CodeGen) -add_subdirectory(Analysis) -add_subdirectory(Rewrite) -add_subdirectory(Driver) -add_subdirectory(Serialization) -add_subdirectory(Frontend) -add_subdirectory(FrontendTool) -add_subdirectory(Index) -add_subdirectory(Checker) diff --git a/contrib/llvm/tools/clang/lib/Checker/CMakeLists.txt b/contrib/llvm/tools/clang/lib/Checker/CMakeLists.txt deleted file mode 100644 index 5b54f0d12d5d..000000000000 --- a/contrib/llvm/tools/clang/lib/Checker/CMakeLists.txt +++ /dev/null @@ -1,84 +0,0 @@ -set(LLVM_NO_RTTI 1) - -add_clang_library(clangChecker - AdjustedReturnValueChecker.cpp - AggExprVisitor.cpp - AnalysisConsumer.cpp - AnalysisManager.cpp - ArrayBoundChecker.cpp - AttrNonNullChecker.cpp - BasicConstraintManager.cpp - BasicObjCFoundationChecks.cpp - BasicStore.cpp - BasicValueFactory.cpp - BugReporter.cpp - BugReporterVisitors.cpp - BuiltinFunctionChecker.cpp - CFRefCount.cpp - CallAndMessageChecker.cpp - CastSizeChecker.cpp - CastToStructChecker.cpp - CheckDeadStores.cpp - CheckObjCDealloc.cpp - CheckObjCInstMethSignature.cpp - CheckSecuritySyntaxOnly.cpp - CheckSizeofPointer.cpp - Checker.cpp - CheckerHelpers.cpp - CocoaConventions.cpp - CStringChecker.cpp - DereferenceChecker.cpp - DivZeroChecker.cpp - Environment.cpp - ExplodedGraph.cpp - FixedAddressChecker.cpp - FlatStore.cpp - FrontendActions.cpp - GRBlockCounter.cpp - GRCXXExprEngine.cpp - GRCoreEngine.cpp - GRExprEngine.cpp - GRExprEngineExperimentalChecks.cpp - GRState.cpp - HTMLDiagnostics.cpp - IdempotentOperationChecker.cpp - LLVMConventionsChecker.cpp - MacOSXAPIChecker.cpp - MallocChecker.cpp - ManagerRegistry.cpp - MemRegion.cpp - NSAutoreleasePoolChecker.cpp - NSErrorChecker.cpp - NoReturnFunctionChecker.cpp - OSAtomicChecker.cpp - ObjCUnusedIVarsChecker.cpp - PathDiagnostic.cpp - PlistDiagnostics.cpp - PointerArithChecker.cpp - PointerSubChecker.cpp - PthreadLockChecker.cpp - RangeConstraintManager.cpp - RegionStore.cpp - ReturnPointerRangeChecker.cpp - ReturnUndefChecker.cpp - SVals.cpp - SValuator.cpp - SimpleConstraintManager.cpp - SimpleSValuator.cpp - StackAddrLeakChecker.cpp - Store.cpp - StreamChecker.cpp - SymbolManager.cpp - UndefBranchChecker.cpp - UndefCapturedBlockVarChecker.cpp - UndefResultChecker.cpp - UndefinedArraySubscriptChecker.cpp - UndefinedAssignmentChecker.cpp - UnixAPIChecker.cpp - UnreachableCodeChecker.cpp - VLASizeChecker.cpp - ValueManager.cpp - ) - -add_dependencies(clangChecker ClangAttrClasses ClangAttrList ClangDeclNodes - ClangStmtNodes) diff --git a/contrib/llvm/tools/clang/lib/Checker/Makefile b/contrib/llvm/tools/clang/lib/Checker/Makefile deleted file mode 100644 index 4ec6f65a0bb1..000000000000 --- a/contrib/llvm/tools/clang/lib/Checker/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -##===- clang/lib/Checker/Makefile --------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -# -# This implements analyses built on top of source-level CFGs. -# -##===----------------------------------------------------------------------===## - -CLANG_LEVEL := ../.. -LIBRARYNAME := clangChecker - -include $(CLANG_LEVEL)/Makefile - diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CMakeLists.txt b/contrib/llvm/tools/clang/lib/CodeGen/CMakeLists.txt deleted file mode 100644 index b5a23291f8a2..000000000000 --- a/contrib/llvm/tools/clang/lib/CodeGen/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ -set(LLVM_NO_RTTI 1) - -add_clang_library(clangCodeGen - BackendUtil.cpp - CGBlocks.cpp - CGBuiltin.cpp - CGCall.cpp - CGClass.cpp - CGCXX.cpp - CGDebugInfo.cpp - CGDecl.cpp - CGDeclCXX.cpp - CGException.cpp - CGExpr.cpp - CGExprAgg.cpp - CGExprComplex.cpp - CGExprConstant.cpp - CGExprCXX.cpp - CGExprScalar.cpp - CGObjC.cpp - CGObjCGNU.cpp - CGObjCMac.cpp - CGRecordLayoutBuilder.cpp - CGRTTI.cpp - CGStmt.cpp - CGTemporaries.cpp - CGVTables.cpp - CGVTT.cpp - CodeGenAction.cpp - CodeGenFunction.cpp - CodeGenModule.cpp - CodeGenTypes.cpp - ItaniumCXXABI.cpp - Mangle.cpp - MicrosoftCXXABI.cpp - ModuleBuilder.cpp - TargetInfo.cpp - ) - -add_dependencies(clangCodeGen ClangAttrClasses ClangAttrList ClangDeclNodes - ClangStmtNodes) diff --git a/contrib/llvm/tools/clang/lib/CodeGen/Makefile b/contrib/llvm/tools/clang/lib/CodeGen/Makefile deleted file mode 100644 index 6032dffec1a5..000000000000 --- a/contrib/llvm/tools/clang/lib/CodeGen/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -##===- clang/lib/CodeGen/Makefile --------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -# -# This implements the AST -> LLVM code generation library for the -# C-Language front-end. -# -##===----------------------------------------------------------------------===## - -CLANG_LEVEL := ../.. -LIBRARYNAME := clangCodeGen - -include $(CLANG_LEVEL)/Makefile - diff --git a/contrib/llvm/tools/clang/lib/CodeGen/README.txt b/contrib/llvm/tools/clang/lib/CodeGen/README.txt deleted file mode 100644 index e6d61095bf23..000000000000 --- a/contrib/llvm/tools/clang/lib/CodeGen/README.txt +++ /dev/null @@ -1,47 +0,0 @@ -IRgen optimization opportunities. - -//===---------------------------------------------------------------------===// - -The common pattern of --- -short x; // or char, etc -(x == 10) --- -generates an zext/sext of x which can easily be avoided. - -//===---------------------------------------------------------------------===// - -Bitfields accesses can be shifted to simplify masking and sign -extension. For example, if the bitfield width is 8 and it is -appropriately aligned then is is a lot shorter to just load the char -directly. - -//===---------------------------------------------------------------------===// - -It may be worth avoiding creation of alloca's for formal arguments -for the common situation where the argument is never written to or has -its address taken. The idea would be to begin generating code by using -the argument directly and if its address is taken or it is stored to -then generate the alloca and patch up the existing code. - -In theory, the same optimization could be a win for block local -variables as long as the declaration dominates all statements in the -block. - -NOTE: The main case we care about this for is for -O0 -g compile time -performance, and in that scenario we will need to emit the alloca -anyway currently to emit proper debug info. So this is blocked by -being able to emit debug information which refers to an LLVM -temporary, not an alloca. - -//===---------------------------------------------------------------------===// - -We should try and avoid generating basic blocks which only contain -jumps. At -O0, this penalizes us all the way from IRgen (malloc & -instruction overhead), all the way down through code generation and -assembly time. - -On 176.gcc:expr.ll, it looks like over 12% of basic blocks are just -direct branches! - -//===---------------------------------------------------------------------===// diff --git a/contrib/llvm/tools/clang/lib/Driver/CMakeLists.txt b/contrib/llvm/tools/clang/lib/Driver/CMakeLists.txt deleted file mode 100644 index 00d076bb7eb8..000000000000 --- a/contrib/llvm/tools/clang/lib/Driver/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -set(LLVM_NO_RTTI 1) - -add_clang_library(clangDriver - Action.cpp - Arg.cpp - ArgList.cpp - CC1Options.cpp - CC1AsOptions.cpp - Compilation.cpp - Driver.cpp - DriverOptions.cpp - HostInfo.cpp - Job.cpp - Option.cpp - OptTable.cpp - Phases.cpp - Tool.cpp - ToolChain.cpp - ToolChains.cpp - Tools.cpp - Types.cpp - ) - -add_dependencies(clangDriver ClangAttrList ClangDiagnosticDriver - ClangDriverOptions ClangCC1Options ClangCC1AsOptions) diff --git a/contrib/llvm/tools/clang/lib/Driver/Makefile b/contrib/llvm/tools/clang/lib/Driver/Makefile deleted file mode 100644 index 454ab8626c2c..000000000000 --- a/contrib/llvm/tools/clang/lib/Driver/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -##===- clang/lib/Driver/Makefile ---------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -CLANG_LEVEL := ../.. -LIBRARYNAME := clangDriver - -include $(CLANG_LEVEL)/Makefile diff --git a/contrib/llvm/tools/clang/lib/Frontend/CMakeLists.txt b/contrib/llvm/tools/clang/lib/Frontend/CMakeLists.txt deleted file mode 100644 index 5a31495397ae..000000000000 --- a/contrib/llvm/tools/clang/lib/Frontend/CMakeLists.txt +++ /dev/null @@ -1,45 +0,0 @@ -set(LLVM_NO_RTTI 1) - -add_clang_library(clangFrontend - ASTConsumers.cpp - ASTMerge.cpp - ASTUnit.cpp - BoostConAction.cpp - CacheTokens.cpp - CompilerInstance.cpp - CompilerInvocation.cpp - DeclXML.cpp - DependencyFile.cpp - DiagChecker.cpp - DocumentXML.cpp - FrontendAction.cpp - FrontendActions.cpp - FrontendOptions.cpp - InitHeaderSearch.cpp - InitPreprocessor.cpp - LangStandards.cpp - PrintPreprocessedOutput.cpp - StmtXML.cpp - TextDiagnosticBuffer.cpp - TextDiagnosticPrinter.cpp - TypeXML.cpp - VerifyDiagnosticsClient.cpp - Warnings.cpp - ) - -IF(MSVC) - get_target_property(NON_ANSI_COMPILE_FLAGS clangFrontend COMPILE_FLAGS) - string(REPLACE /Za - "" NON_ANSI_COMPILE_FLAGS - ${NON_ANSI_COMPILE_FLAGS}) - set_target_properties(clangFrontend PROPERTIES COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS}) -ENDIF(MSVC) - -add_dependencies(clangFrontend - ClangAttrClasses - ClangAttrList - ClangDiagnosticFrontend - ClangDiagnosticLex - ClangDiagnosticSema - ClangDeclNodes - ClangStmtNodes) diff --git a/contrib/llvm/tools/clang/lib/Frontend/Makefile b/contrib/llvm/tools/clang/lib/Frontend/Makefile deleted file mode 100644 index 3c13ad69cc67..000000000000 --- a/contrib/llvm/tools/clang/lib/Frontend/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -##===- clang/lib/Frontend/Makefile -------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -CLANG_LEVEL := ../.. -LIBRARYNAME := clangFrontend - -include $(CLANG_LEVEL)/Makefile - diff --git a/contrib/llvm/tools/clang/lib/FrontendTool/CMakeLists.txt b/contrib/llvm/tools/clang/lib/FrontendTool/CMakeLists.txt deleted file mode 100644 index 26c9fc7b5106..000000000000 --- a/contrib/llvm/tools/clang/lib/FrontendTool/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -set(LLVM_NO_RTTI 1) - -add_clang_library(clangFrontendTool - ExecuteCompilerInvocation.cpp - ) diff --git a/contrib/llvm/tools/clang/lib/FrontendTool/Makefile b/contrib/llvm/tools/clang/lib/FrontendTool/Makefile deleted file mode 100644 index c43213ff99d0..000000000000 --- a/contrib/llvm/tools/clang/lib/FrontendTool/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -##===- clang/lib/FrontendTool/Makefile ---------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -CLANG_LEVEL := ../.. -LIBRARYNAME := clangFrontendTool - -include $(CLANG_LEVEL)/Makefile diff --git a/contrib/llvm/tools/clang/lib/Headers/CMakeLists.txt b/contrib/llvm/tools/clang/lib/Headers/CMakeLists.txt deleted file mode 100644 index a1b5f50caa08..000000000000 --- a/contrib/llvm/tools/clang/lib/Headers/CMakeLists.txt +++ /dev/null @@ -1,50 +0,0 @@ -set(files - altivec.h - avxintrin.h - emmintrin.h - float.h - immintrin.h - iso646.h - limits.h - mm_malloc.h - mmintrin.h - pmmintrin.h - smmintrin.h - stdarg.h - stdbool.h - stddef.h - stdint.h - tgmath.h - tmmintrin.h - xmmintrin.h) - -if (MSVC_IDE OR XCODE) - set(output_dir ${LLVM_BINARY_DIR}/bin/lib/clang/${CLANG_VERSION}/include) -else () - set(output_dir ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/include) -endif () - -# Generate arm_neon.h -set(LLVM_TARGET_DEFINITIONS ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_neon.td) -tablegen(arm_neon.h.inc -gen-arm-neon) - -add_custom_command(OUTPUT ${output_dir}/arm_neon.h - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h.inc - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h.inc ${output_dir}/arm_neon.h - COMMENT "Copying clang's arm_neon.h...") - -foreach( f ${files} ) - set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} ) - set( dst ${output_dir}/${f} ) - add_custom_command(OUTPUT ${dst} - DEPENDS ${src} - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst} - COMMENT "Copying clang's ${f}...") -endforeach( f ) - -add_custom_target(clang-headers ALL - DEPENDS ${files} ${output_dir}/arm_neon.h) - -install(FILES ${files} ${output_dir}/arm_neon.h - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ - DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) diff --git a/contrib/llvm/tools/clang/lib/Headers/Makefile b/contrib/llvm/tools/clang/lib/Headers/Makefile deleted file mode 100644 index d75b1a2e7cae..000000000000 --- a/contrib/llvm/tools/clang/lib/Headers/Makefile +++ /dev/null @@ -1,54 +0,0 @@ -##===- clang/lib/Headers/Makefile --------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -CLANG_LEVEL := ../.. - -BUILT_SOURCES = arm_neon.h.inc -TABLEGEN_INC_FILES_COMMON = 1 - -include $(CLANG_LEVEL)/Makefile - -CLANG_VERSION := $(word 3,$(shell grep "CLANG_VERSION " \ - $(PROJ_OBJ_DIR)/$(CLANG_LEVEL)/include/clang/Basic/Version.inc)) - -HeaderDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib/clang/$(CLANG_VERSION)/include - -HEADERS := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.h)) - -OBJHEADERS := $(addprefix $(HeaderDir)/, $(HEADERS)) - - -$(OBJHEADERS): $(HeaderDir)/%.h: $(PROJ_SRC_DIR)/%.h $(HeaderDir)/.dir $(HeaderDir)/arm_neon.h - $(Verb) cp $< $@ - $(Echo) Copying $(notdir $<) to build dir - -$(HeaderDir)/arm_neon.h: $(BUILT_SOURCES) $(HeaderDir)/.dir - $(Verb) cp $< $@ - $(Echo) Copying $(notdir $<) to build dir - -# Hook into the standard Makefile rules. -all-local:: $(OBJHEADERS) - -PROJ_headers := $(DESTDIR)$(PROJ_prefix)/lib/clang/$(CLANG_VERSION)/include - -INSTHEADERS := $(addprefix $(PROJ_headers)/, $(HEADERS)) -INSTHEADERS += $(PROJ_headers)/arm_neon.h - -$(PROJ_headers): - $(Verb) $(MKDIR) $@ - -$(INSTHEADERS): $(PROJ_headers)/%.h: $(HeaderDir)/%.h | $(PROJ_headers) - $(Verb) $(DataInstall) $< $(PROJ_headers) - $(Echo) Installing compiler include file: $(notdir $<) - -install-local:: $(INSTHEADERS) - -$(ObjDir)/arm_neon.h.inc.tmp : $(CLANG_LEVEL)/include/clang/Basic/arm_neon.td $(TBLGEN) $(ObjDir)/.dir - $(Echo) "Building Clang arm_neon.h.inc with tblgen" - $(Verb) $(TableGen) -gen-arm-neon -o $(call SYSPATH, $@) $< diff --git a/contrib/llvm/tools/clang/lib/Index/CMakeLists.txt b/contrib/llvm/tools/clang/lib/Index/CMakeLists.txt deleted file mode 100644 index 61f69b218e26..000000000000 --- a/contrib/llvm/tools/clang/lib/Index/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -set(LLVM_NO_RTTI 1) - -add_clang_library(clangIndex - ASTLocation.cpp - Analyzer.cpp - CallGraph.cpp - DeclReferenceMap.cpp - Entity.cpp - GlobalSelector.cpp - Handlers.cpp - IndexProvider.cpp - Indexer.cpp - Program.cpp - SelectorMap.cpp - ) diff --git a/contrib/llvm/tools/clang/lib/Index/Makefile b/contrib/llvm/tools/clang/lib/Index/Makefile deleted file mode 100644 index 8607d781e5d7..000000000000 --- a/contrib/llvm/tools/clang/lib/Index/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -##===- clang/lib/Index/Makefile ----------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -# -# This implements the Indexer library for the C-Language front-end. -# -##===----------------------------------------------------------------------===## - -CLANG_LEVEL := ../.. -LIBRARYNAME := clangIndex - -include $(CLANG_LEVEL)/Makefile - diff --git a/contrib/llvm/tools/clang/lib/Lex/CMakeLists.txt b/contrib/llvm/tools/clang/lib/Lex/CMakeLists.txt deleted file mode 100644 index 632fbc6340cc..000000000000 --- a/contrib/llvm/tools/clang/lib/Lex/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -set(LLVM_NO_RTTI 1) - -# TODO: Add -maltivec when ARCH is PowerPC. - -add_clang_library(clangLex - HeaderMap.cpp - HeaderSearch.cpp - Lexer.cpp - LiteralSupport.cpp - MacroArgs.cpp - MacroInfo.cpp - PPCaching.cpp - PPDirectives.cpp - PPExpressions.cpp - PPLexerChange.cpp - PPMacroExpansion.cpp - PTHLexer.cpp - Pragma.cpp - PreprocessingRecord.cpp - Preprocessor.cpp - PreprocessorLexer.cpp - ScratchBuffer.cpp - TokenConcatenation.cpp - TokenLexer.cpp - ) - -add_dependencies(clangLex ClangDiagnosticLex) diff --git a/contrib/llvm/tools/clang/lib/Lex/Makefile b/contrib/llvm/tools/clang/lib/Lex/Makefile deleted file mode 100644 index d80fb55c78a7..000000000000 --- a/contrib/llvm/tools/clang/lib/Lex/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -##===- clang/lib/Lex/Makefile ------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -# -# This implements the Lexer library for the C-Language front-end. -# -##===----------------------------------------------------------------------===## - -CLANG_LEVEL := ../.. -include $(CLANG_LEVEL)/../../Makefile.config - -LIBRARYNAME := clangLex - -ifeq ($(ARCH),PowerPC) -CXX.Flags += -maltivec -endif - -include $(CLANG_LEVEL)/Makefile - diff --git a/contrib/llvm/tools/clang/lib/Makefile b/contrib/llvm/tools/clang/lib/Makefile deleted file mode 100755 index dbd0eb699ee1..000000000000 --- a/contrib/llvm/tools/clang/lib/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- lib/Makefile ----------------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -CLANG_LEVEL := .. - -PARALLEL_DIRS = Headers Basic Lex Parse AST Sema CodeGen Analysis \ - Checker Rewrite Serialization Frontend FrontendTool Index Driver - -include $(CLANG_LEVEL)/Makefile - diff --git a/contrib/llvm/tools/clang/lib/Parse/CMakeLists.txt b/contrib/llvm/tools/clang/lib/Parse/CMakeLists.txt deleted file mode 100644 index 189af3dc882f..000000000000 --- a/contrib/llvm/tools/clang/lib/Parse/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -set(LLVM_NO_RTTI 1) - -add_clang_library(clangParse - ParseAST.cpp - ParseCXXInlineMethods.cpp - ParseDecl.cpp - ParseDeclCXX.cpp - ParseExpr.cpp - ParseExprCXX.cpp - ParseInit.cpp - ParseObjc.cpp - ParsePragma.cpp - ParseStmt.cpp - ParseTemplate.cpp - ParseTentative.cpp - Parser.cpp - ) - -add_dependencies(clangParse ClangAttrClasses ClangAttrList ClangDeclNodes ClangDiagnosticParse ClangStmtNodes) diff --git a/contrib/llvm/tools/clang/lib/Parse/Makefile b/contrib/llvm/tools/clang/lib/Parse/Makefile deleted file mode 100644 index 5ec7c333c504..000000000000 --- a/contrib/llvm/tools/clang/lib/Parse/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -##===- clang/lib/Parse/Makefile ----------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -# -# This implements the Parser library for the C-Language front-end. -# -##===----------------------------------------------------------------------===## - -CLANG_LEVEL := ../.. -LIBRARYNAME := clangParse - -include $(CLANG_LEVEL)/Makefile - diff --git a/contrib/llvm/tools/clang/lib/Rewrite/CMakeLists.txt b/contrib/llvm/tools/clang/lib/Rewrite/CMakeLists.txt deleted file mode 100644 index ffeb3e66ebcb..000000000000 --- a/contrib/llvm/tools/clang/lib/Rewrite/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -set(LLVM_NO_RTTI 1) - -add_clang_library(clangRewrite - DeltaTree.cpp - FixItRewriter.cpp - FrontendActions.cpp - HTMLPrint.cpp - HTMLRewrite.cpp - RewriteMacros.cpp - RewriteObjC.cpp - RewriteRope.cpp - RewriteTest.cpp - Rewriter.cpp - TokenRewriter.cpp - ) - -add_dependencies(clangBasic - ClangAttrClasses - ClangAttrList - ClangDeclNodes - ClangStmtNodes) diff --git a/contrib/llvm/tools/clang/lib/Rewrite/Makefile b/contrib/llvm/tools/clang/lib/Rewrite/Makefile deleted file mode 100644 index 5fef9b2c0d38..000000000000 --- a/contrib/llvm/tools/clang/lib/Rewrite/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -##===- clang/lib/Rewrite/Makefile --------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -# -# This implements code transformation / rewriting facilities. -# -##===----------------------------------------------------------------------===## - -CLANG_LEVEL := ../.. -LIBRARYNAME := clangRewrite - -include $(CLANG_LEVEL)/Makefile - diff --git a/contrib/llvm/tools/clang/lib/Sema/CMakeLists.txt b/contrib/llvm/tools/clang/lib/Sema/CMakeLists.txt deleted file mode 100644 index e65bb227f159..000000000000 --- a/contrib/llvm/tools/clang/lib/Sema/CMakeLists.txt +++ /dev/null @@ -1,39 +0,0 @@ -set(LLVM_NO_RTTI 1) - -add_clang_library(clangSema - AnalysisBasedWarnings.cpp - AttributeList.cpp - CodeCompleteConsumer.cpp - DeclSpec.cpp - IdentifierResolver.cpp - JumpDiagnostics.cpp - Sema.cpp - SemaAccess.cpp - SemaAttr.cpp - SemaCXXCast.cpp - SemaCXXScopeSpec.cpp - SemaChecking.cpp - SemaCodeComplete.cpp - SemaDecl.cpp - SemaDeclAttr.cpp - SemaDeclCXX.cpp - SemaDeclObjC.cpp - SemaExceptionSpec.cpp - SemaExpr.cpp - SemaExprCXX.cpp - SemaExprObjC.cpp - SemaInit.cpp - SemaLookup.cpp - SemaObjCProperty.cpp - SemaOverload.cpp - SemaStmt.cpp - SemaTemplate.cpp - SemaTemplateDeduction.cpp - SemaTemplateInstantiate.cpp - SemaTemplateInstantiateDecl.cpp - SemaType.cpp - TargetAttributesSema.cpp - ) - -add_dependencies(clangSema ClangARMNeon ClangAttrClasses ClangAttrList - ClangDiagnosticSema ClangDeclNodes ClangStmtNodes) diff --git a/contrib/llvm/tools/clang/lib/Sema/Makefile b/contrib/llvm/tools/clang/lib/Sema/Makefile deleted file mode 100644 index 2c02739d268f..000000000000 --- a/contrib/llvm/tools/clang/lib/Sema/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -##===- clang/lib/Sema/Makefile -----------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -# -# This implements the semantic analyzer and AST builder library for the -# C-Language front-end. -# -##===----------------------------------------------------------------------===## - -CLANG_LEVEL := ../.. -LIBRARYNAME := clangSema - -include $(CLANG_LEVEL)/Makefile - diff --git a/contrib/llvm/tools/clang/lib/Serialization/CMakeLists.txt b/contrib/llvm/tools/clang/lib/Serialization/CMakeLists.txt deleted file mode 100644 index d863c179bed2..000000000000 --- a/contrib/llvm/tools/clang/lib/Serialization/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -set(LLVM_NO_RTTI 1) - -add_clang_library(clangSerialization - GeneratePCH.cpp - ASTCommon.cpp - ASTReader.cpp - ASTReaderDecl.cpp - ASTReaderStmt.cpp - ASTWriter.cpp - ASTWriterDecl.cpp - ASTWriterStmt.cpp - ) - -add_dependencies(clangSerialization - ClangAttrClasses - ClangAttrList - ClangAttrPCHRead - ClangAttrPCHWrite - ClangDiagnosticFrontend - ClangDiagnosticLex - ClangDiagnosticSema - ClangDeclNodes - ClangStmtNodes) diff --git a/contrib/llvm/tools/clang/lib/Serialization/Makefile b/contrib/llvm/tools/clang/lib/Serialization/Makefile deleted file mode 100644 index e89ddc38ec94..000000000000 --- a/contrib/llvm/tools/clang/lib/Serialization/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -##===- clang/lib/Serialization/Makefile --------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -# -# This implements the semantic analyzer and AST builder library for the -# C-Language front-end. -# -##===----------------------------------------------------------------------===## - -CLANG_LEVEL := ../.. -LIBRARYNAME := clangSerialization - -include $(CLANG_LEVEL)/Makefile - diff --git a/contrib/llvm/tools/clang/runtime/Makefile b/contrib/llvm/tools/clang/runtime/Makefile deleted file mode 100644 index 0e8b359123b1..000000000000 --- a/contrib/llvm/tools/clang/runtime/Makefile +++ /dev/null @@ -1,104 +0,0 @@ -##===- clang/runtime/Makefile ------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -# -# This file defines support for building the Clang runtime libraries (which are -# implemented by compiler-rt) and placing them in the proper locations in the -# Clang resources directory (i.e., where the driver expects them). -# -##===----------------------------------------------------------------------===## - -CLANG_LEVEL := .. -include $(CLANG_LEVEL)/Makefile - -CLANG_VERSION := $(word 3,$(shell grep "CLANG_VERSION " \ - $(PROJ_OBJ_DIR)/$(CLANG_LEVEL)/include/clang/Basic/Version.inc)) - -ResourceDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib/clang/$(CLANG_VERSION) -PROJ_resources := $(DESTDIR)$(PROJ_prefix)/lib/clang/$(CLANG_VERSION) - -ResourceLibDir := $(ResourceDir)/lib -PROJ_resources_lib := $(PROJ_resources)/lib - -# Expect compiler-rt to be in llvm/projects/compiler-rt -COMPILERRT_SRC_ROOT := $(LLVM_SRC_ROOT)/projects/compiler-rt - -ifndef CLANG_NO_RUNTIME -ifeq ($(shell test -d $(COMPILERRT_SRC_ROOT) && echo OK),OK) - -# Select the compiler-rt configuration to use, and install directory. -# -# FIXME: Eventually, we want some kind of configure support for this. We want to -# build/install runtime libraries for as many targets as clang was configured to -# support. -RuntimeDirs := -ifeq ($(OS),Darwin) -RuntimeDirs += darwin -RuntimeLibrary.darwin.Configs = 10.4 armv6 cc_kext -endif - -# Rule to build the compiler-rt libraries we need. -# -# We build all the libraries in a single shot to avoid recursive make as much as -# possible. -BuildRuntimeLibraries: - $(Verb) $(MAKE) -C $(COMPILERRT_SRC_ROOT) \ - ProjSrcRoot=$(COMPILERRT_SRC_ROOT) \ - ProjObjRoot=$(PROJ_OBJ_DIR) \ - CC="$(ToolDir)/clang -no-integrated-as" \ - $(RuntimeDirs:%=clang_%) -.PHONY: BuildRuntimeLibraries -CleanRuntimeLibraries: - $(Verb) $(MAKE) -C $(COMPILERRT_SRC_ROOT) \ - ProjSrcRoot=$(COMPILERRT_SRC_ROOT) \ - ProjObjRoot=$(PROJ_OBJ_DIR) \ - clean -.PHONY: CleanRuntimeLibraries - -$(PROJ_resources_lib): - $(Verb) $(MKDIR) $@ - -# Expand rules for copying/installing each individual library. We can't use -# implicit rules here because we need to match against multiple things. -define RuntimeLibraryTemplate -$(PROJ_OBJ_DIR)/clang_$1/%/libcompiler_rt.a: BuildRuntimeLibraries - @true -.PRECIOUS: $(PROJ_OBJ_DIR)/clang_$1/%/libcompiler_rt.a - -# Rule to copy the libraries to their resource directory location. -$(ResourceLibDir)/$1/libclang_rt.%.a: \ - $(PROJ_OBJ_DIR)/clang_$1/%/libcompiler_rt.a \ - $(ResourceLibDir)/$1/.dir - $(Echo) Copying runtime library $1/$$* to build dir - $(Verb) cp $(PROJ_OBJ_DIR)/clang_$1/$$*/libcompiler_rt.a $$@ -RuntimeLibrary.$1: \ - $(RuntimeLibrary.$1.Configs:%=$(ResourceLibDir)/$1/libclang_rt.%.a) -.PHONY: RuntimeLibrary.$1 - -$(PROJ_resources_lib)/$1: $(PROJ_resources_lib) - $(Verb) $(MKDIR) $$@ - -$(PROJ_resources_lib)/$1/libclang_rt.%.a: \ - $(ResourceLibDir)/$1/libclang_rt.%.a | $(PROJ_resources_lib)/$1 - $(Echo) Installing compiler runtime library: $1/$$* - $(Verb) $(DataInstall) $$< $(PROJ_resources_lib)/$1 - -# Rule to install runtime libraries. -RuntimeLibraryInstall.$1: \ - $(RuntimeLibrary.$1.Configs:%=$(PROJ_resources_lib)/$1/libclang_rt.%.a) -.PHONY: RuntimeLibraryInstall.$1 -endef -$(foreach lib,$(RuntimeDirs), $(eval $(call RuntimeLibraryTemplate,$(lib)))) - -# Hook into the standard Makefile rules. -all-local:: $(RuntimeDirs:%=RuntimeLibrary.%) -install-local:: $(RuntimeDirs:%=RuntimeLibraryInstall.%) -clean-local:: CleanRuntimeLibraries - -endif -endif diff --git a/contrib/llvm/tools/clang/tools/CMakeLists.txt b/contrib/llvm/tools/clang/tools/CMakeLists.txt deleted file mode 100644 index ae33b782d49d..000000000000 --- a/contrib/llvm/tools/clang/tools/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(libclang) -add_subdirectory(c-index-test) -add_subdirectory(driver) diff --git a/contrib/llvm/tools/clang/tools/Makefile b/contrib/llvm/tools/clang/tools/Makefile deleted file mode 100644 index 0202cc5bbbb0..000000000000 --- a/contrib/llvm/tools/clang/tools/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -##===- tools/Makefile --------------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -CLANG_LEVEL := .. -DIRS := driver libclang c-index-test - -include $(CLANG_LEVEL)/../../Makefile.config - -ifeq ($(OS), $(filter $(OS), Cygwin MingW Minix)) -DIRS := $(filter-out libclang c-index-test, $(DIRS)) -endif - -include $(CLANG_LEVEL)/Makefile diff --git a/contrib/llvm/tools/clang/tools/c-index-test/CMakeLists.txt b/contrib/llvm/tools/clang/tools/c-index-test/CMakeLists.txt deleted file mode 100644 index 5cf2cd6ebf34..000000000000 --- a/contrib/llvm/tools/clang/tools/c-index-test/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -set(LLVM_NO_RTTI 1) - -set( LLVM_USED_LIBS - libclang - clangIndex - clangFrontend - clangDriver - clangSerialization - clangParse - clangSema - clangAnalysis - clangAST - clangLex - clangBasic - ) - -set( LLVM_LINK_COMPONENTS - bitreader - mc - core - ) - -add_clang_executable(c-index-test - c-index-test.c - ) - -set_target_properties(c-index-test - PROPERTIES - LINKER_LANGUAGE CXX) - diff --git a/contrib/llvm/tools/clang/tools/c-index-test/Makefile b/contrib/llvm/tools/clang/tools/c-index-test/Makefile deleted file mode 100644 index f41aa8098155..000000000000 --- a/contrib/llvm/tools/clang/tools/c-index-test/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -##===- tools/index-test/Makefile ---------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -CLANG_LEVEL := ../.. - -TOOLNAME = c-index-test - -# No plugins, optimize startup time. -TOOL_NO_EXPORTS = 1 - -LINK_COMPONENTS := bitreader mc core -USEDLIBS = clang.a clangIndex.a clangFrontend.a clangDriver.a \ - clangSerialization.a clangParse.a clangSema.a clangAnalysis.a \ - clangAST.a clangLex.a clangBasic.a - -include $(CLANG_LEVEL)/Makefile diff --git a/contrib/llvm/tools/clang/tools/c-index-test/c-index-test.c b/contrib/llvm/tools/clang/tools/c-index-test/c-index-test.c deleted file mode 100644 index 58eff97ef8f8..000000000000 --- a/contrib/llvm/tools/clang/tools/c-index-test/c-index-test.c +++ /dev/null @@ -1,1524 +0,0 @@ -/* c-index-test.c */ - -#include "clang-c/Index.h" -#include -#include -#include -#include -#include - -/******************************************************************************/ -/* Utility functions. */ -/******************************************************************************/ - -#ifdef _MSC_VER -char *basename(const char* path) -{ - char* base1 = (char*)strrchr(path, '/'); - char* base2 = (char*)strrchr(path, '\\'); - if (base1 && base2) - return((base1 > base2) ? base1 + 1 : base2 + 1); - else if (base1) - return(base1 + 1); - else if (base2) - return(base2 + 1); - - return((char*)path); -} -#else -extern char *basename(const char *); -#endif - -/** \brief Return the default parsing options. */ -static unsigned getDefaultParsingOptions() { - unsigned options = CXTranslationUnit_DetailedPreprocessingRecord; - - if (getenv("CINDEXTEST_EDITING")) - options |= clang_defaultEditingTranslationUnitOptions(); - if (getenv("CINDEXTEST_COMPLETION_CACHING")) - options |= CXTranslationUnit_CacheCompletionResults; - - return options; -} - -static void PrintExtent(FILE *out, unsigned begin_line, unsigned begin_column, - unsigned end_line, unsigned end_column) { - fprintf(out, "[%d:%d - %d:%d]", begin_line, begin_column, - end_line, end_column); -} - -static unsigned CreateTranslationUnit(CXIndex Idx, const char *file, - CXTranslationUnit *TU) { - - *TU = clang_createTranslationUnit(Idx, file); - if (!*TU) { - fprintf(stderr, "Unable to load translation unit from '%s'!\n", file); - return 0; - } - return 1; -} - -void free_remapped_files(struct CXUnsavedFile *unsaved_files, - int num_unsaved_files) { - int i; - for (i = 0; i != num_unsaved_files; ++i) { - free((char *)unsaved_files[i].Filename); - free((char *)unsaved_files[i].Contents); - } - free(unsaved_files); -} - -int parse_remapped_files(int argc, const char **argv, int start_arg, - struct CXUnsavedFile **unsaved_files, - int *num_unsaved_files) { - int i; - int arg; - int prefix_len = strlen("-remap-file="); - *unsaved_files = 0; - *num_unsaved_files = 0; - - /* Count the number of remapped files. */ - for (arg = start_arg; arg < argc; ++arg) { - if (strncmp(argv[arg], "-remap-file=", prefix_len)) - break; - - ++*num_unsaved_files; - } - - if (*num_unsaved_files == 0) - return 0; - - *unsaved_files - = (struct CXUnsavedFile *)malloc(sizeof(struct CXUnsavedFile) * - *num_unsaved_files); - for (arg = start_arg, i = 0; i != *num_unsaved_files; ++i, ++arg) { - struct CXUnsavedFile *unsaved = *unsaved_files + i; - const char *arg_string = argv[arg] + prefix_len; - int filename_len; - char *filename; - char *contents; - FILE *to_file; - const char *semi = strchr(arg_string, ';'); - if (!semi) { - fprintf(stderr, - "error: -remap-file=from;to argument is missing semicolon\n"); - free_remapped_files(*unsaved_files, i); - *unsaved_files = 0; - *num_unsaved_files = 0; - return -1; - } - - /* Open the file that we're remapping to. */ - to_file = fopen(semi + 1, "r"); - if (!to_file) { - fprintf(stderr, "error: cannot open file %s that we are remapping to\n", - semi + 1); - free_remapped_files(*unsaved_files, i); - *unsaved_files = 0; - *num_unsaved_files = 0; - return -1; - } - - /* Determine the length of the file we're remapping to. */ - fseek(to_file, 0, SEEK_END); - unsaved->Length = ftell(to_file); - fseek(to_file, 0, SEEK_SET); - - /* Read the contents of the file we're remapping to. */ - contents = (char *)malloc(unsaved->Length + 1); - if (fread(contents, 1, unsaved->Length, to_file) != unsaved->Length) { - fprintf(stderr, "error: unexpected %s reading 'to' file %s\n", - (feof(to_file) ? "EOF" : "error"), semi + 1); - fclose(to_file); - free_remapped_files(*unsaved_files, i); - *unsaved_files = 0; - *num_unsaved_files = 0; - return -1; - } - contents[unsaved->Length] = 0; - unsaved->Contents = contents; - - /* Close the file. */ - fclose(to_file); - - /* Copy the file name that we're remapping from. */ - filename_len = semi - arg_string; - filename = (char *)malloc(filename_len + 1); - memcpy(filename, arg_string, filename_len); - filename[filename_len] = 0; - unsaved->Filename = filename; - } - - return 0; -} - -/******************************************************************************/ -/* Pretty-printing. */ -/******************************************************************************/ - -static void PrintCursor(CXCursor Cursor) { - if (clang_isInvalid(Cursor.kind)) { - CXString ks = clang_getCursorKindSpelling(Cursor.kind); - printf("Invalid Cursor => %s", clang_getCString(ks)); - clang_disposeString(ks); - } - else { - CXString string, ks; - CXCursor Referenced; - unsigned line, column; - CXCursor SpecializationOf; - - ks = clang_getCursorKindSpelling(Cursor.kind); - string = clang_getCursorSpelling(Cursor); - printf("%s=%s", clang_getCString(ks), - clang_getCString(string)); - clang_disposeString(ks); - clang_disposeString(string); - - Referenced = clang_getCursorReferenced(Cursor); - if (!clang_equalCursors(Referenced, clang_getNullCursor())) { - CXSourceLocation Loc = clang_getCursorLocation(Referenced); - clang_getInstantiationLocation(Loc, 0, &line, &column, 0); - printf(":%d:%d", line, column); - } - - if (clang_isCursorDefinition(Cursor)) - printf(" (Definition)"); - - switch (clang_getCursorAvailability(Cursor)) { - case CXAvailability_Available: - break; - - case CXAvailability_Deprecated: - printf(" (deprecated)"); - break; - - case CXAvailability_NotAvailable: - printf(" (unavailable)"); - break; - } - - if (Cursor.kind == CXCursor_IBOutletCollectionAttr) { - CXType T = - clang_getCanonicalType(clang_getIBOutletCollectionType(Cursor)); - CXString S = clang_getTypeKindSpelling(T.kind); - printf(" [IBOutletCollection=%s]", clang_getCString(S)); - clang_disposeString(S); - } - - if (Cursor.kind == CXCursor_CXXBaseSpecifier) { - enum CX_CXXAccessSpecifier access = clang_getCXXAccessSpecifier(Cursor); - unsigned isVirtual = clang_isVirtualBase(Cursor); - const char *accessStr = 0; - - switch (access) { - case CX_CXXInvalidAccessSpecifier: - accessStr = "invalid"; break; - case CX_CXXPublic: - accessStr = "public"; break; - case CX_CXXProtected: - accessStr = "protected"; break; - case CX_CXXPrivate: - accessStr = "private"; break; - } - - printf(" [access=%s isVirtual=%s]", accessStr, - isVirtual ? "true" : "false"); - } - - SpecializationOf = clang_getSpecializedCursorTemplate(Cursor); - if (!clang_equalCursors(SpecializationOf, clang_getNullCursor())) { - CXSourceLocation Loc = clang_getCursorLocation(SpecializationOf); - CXString Name = clang_getCursorSpelling(SpecializationOf); - clang_getInstantiationLocation(Loc, 0, &line, &column, 0); - printf(" [Specialization of %s:%d:%d]", - clang_getCString(Name), line, column); - clang_disposeString(Name); - } - } -} - -static const char* GetCursorSource(CXCursor Cursor) { - CXSourceLocation Loc = clang_getCursorLocation(Cursor); - CXString source; - CXFile file; - clang_getInstantiationLocation(Loc, &file, 0, 0, 0); - source = clang_getFileName(file); - if (!clang_getCString(source)) { - clang_disposeString(source); - return ""; - } - else { - const char *b = basename(clang_getCString(source)); - clang_disposeString(source); - return b; - } -} - -/******************************************************************************/ -/* Callbacks. */ -/******************************************************************************/ - -typedef void (*PostVisitTU)(CXTranslationUnit); - -void PrintDiagnostic(CXDiagnostic Diagnostic) { - FILE *out = stderr; - CXFile file; - CXString Msg; - unsigned display_opts = CXDiagnostic_DisplaySourceLocation - | CXDiagnostic_DisplayColumn | CXDiagnostic_DisplaySourceRanges; - unsigned i, num_fixits; - - if (clang_getDiagnosticSeverity(Diagnostic) == CXDiagnostic_Ignored) - return; - - Msg = clang_formatDiagnostic(Diagnostic, display_opts); - fprintf(stderr, "%s\n", clang_getCString(Msg)); - clang_disposeString(Msg); - - clang_getInstantiationLocation(clang_getDiagnosticLocation(Diagnostic), - &file, 0, 0, 0); - if (!file) - return; - - num_fixits = clang_getDiagnosticNumFixIts(Diagnostic); - for (i = 0; i != num_fixits; ++i) { - CXSourceRange range; - CXString insertion_text = clang_getDiagnosticFixIt(Diagnostic, i, &range); - CXSourceLocation start = clang_getRangeStart(range); - CXSourceLocation end = clang_getRangeEnd(range); - unsigned start_line, start_column, end_line, end_column; - CXFile start_file, end_file; - clang_getInstantiationLocation(start, &start_file, &start_line, - &start_column, 0); - clang_getInstantiationLocation(end, &end_file, &end_line, &end_column, 0); - if (clang_equalLocations(start, end)) { - /* Insertion. */ - if (start_file == file) - fprintf(out, "FIX-IT: Insert \"%s\" at %d:%d\n", - clang_getCString(insertion_text), start_line, start_column); - } else if (strcmp(clang_getCString(insertion_text), "") == 0) { - /* Removal. */ - if (start_file == file && end_file == file) { - fprintf(out, "FIX-IT: Remove "); - PrintExtent(out, start_line, start_column, end_line, end_column); - fprintf(out, "\n"); - } - } else { - /* Replacement. */ - if (start_file == end_file) { - fprintf(out, "FIX-IT: Replace "); - PrintExtent(out, start_line, start_column, end_line, end_column); - fprintf(out, " with \"%s\"\n", clang_getCString(insertion_text)); - } - break; - } - clang_disposeString(insertion_text); - } -} - -void PrintDiagnostics(CXTranslationUnit TU) { - int i, n = clang_getNumDiagnostics(TU); - for (i = 0; i != n; ++i) { - CXDiagnostic Diag = clang_getDiagnostic(TU, i); - PrintDiagnostic(Diag); - clang_disposeDiagnostic(Diag); - } -} - -/******************************************************************************/ -/* Logic for testing traversal. */ -/******************************************************************************/ - -static const char *FileCheckPrefix = "CHECK"; - -static void PrintCursorExtent(CXCursor C) { - CXSourceRange extent = clang_getCursorExtent(C); - CXFile begin_file, end_file; - unsigned begin_line, begin_column, end_line, end_column; - - clang_getInstantiationLocation(clang_getRangeStart(extent), - &begin_file, &begin_line, &begin_column, 0); - clang_getInstantiationLocation(clang_getRangeEnd(extent), - &end_file, &end_line, &end_column, 0); - if (!begin_file || !end_file) - return; - - printf(" Extent="); - PrintExtent(stdout, begin_line, begin_column, end_line, end_column); -} - -/* Data used by all of the visitors. */ -typedef struct { - CXTranslationUnit TU; - enum CXCursorKind *Filter; -} VisitorData; - - -enum CXChildVisitResult FilteredPrintingVisitor(CXCursor Cursor, - CXCursor Parent, - CXClientData ClientData) { - VisitorData *Data = (VisitorData *)ClientData; - if (!Data->Filter || (Cursor.kind == *(enum CXCursorKind *)Data->Filter)) { - CXSourceLocation Loc = clang_getCursorLocation(Cursor); - unsigned line, column; - clang_getInstantiationLocation(Loc, 0, &line, &column, 0); - printf("// %s: %s:%d:%d: ", FileCheckPrefix, - GetCursorSource(Cursor), line, column); - PrintCursor(Cursor); - PrintCursorExtent(Cursor); - printf("\n"); - return CXChildVisit_Recurse; - } - - return CXChildVisit_Continue; -} - -static enum CXChildVisitResult FunctionScanVisitor(CXCursor Cursor, - CXCursor Parent, - CXClientData ClientData) { - const char *startBuf, *endBuf; - unsigned startLine, startColumn, endLine, endColumn, curLine, curColumn; - CXCursor Ref; - VisitorData *Data = (VisitorData *)ClientData; - - if (Cursor.kind != CXCursor_FunctionDecl || - !clang_isCursorDefinition(Cursor)) - return CXChildVisit_Continue; - - clang_getDefinitionSpellingAndExtent(Cursor, &startBuf, &endBuf, - &startLine, &startColumn, - &endLine, &endColumn); - /* Probe the entire body, looking for both decls and refs. */ - curLine = startLine; - curColumn = startColumn; - - while (startBuf < endBuf) { - CXSourceLocation Loc; - CXFile file; - CXString source; - - if (*startBuf == '\n') { - startBuf++; - curLine++; - curColumn = 1; - } else if (*startBuf != '\t') - curColumn++; - - Loc = clang_getCursorLocation(Cursor); - clang_getInstantiationLocation(Loc, &file, 0, 0, 0); - - source = clang_getFileName(file); - if (clang_getCString(source)) { - CXSourceLocation RefLoc - = clang_getLocation(Data->TU, file, curLine, curColumn); - Ref = clang_getCursor(Data->TU, RefLoc); - if (Ref.kind == CXCursor_NoDeclFound) { - /* Nothing found here; that's fine. */ - } else if (Ref.kind != CXCursor_FunctionDecl) { - printf("// %s: %s:%d:%d: ", FileCheckPrefix, GetCursorSource(Ref), - curLine, curColumn); - PrintCursor(Ref); - printf("\n"); - } - } - clang_disposeString(source); - startBuf++; - } - - return CXChildVisit_Continue; -} - -/******************************************************************************/ -/* USR testing. */ -/******************************************************************************/ - -enum CXChildVisitResult USRVisitor(CXCursor C, CXCursor parent, - CXClientData ClientData) { - VisitorData *Data = (VisitorData *)ClientData; - if (!Data->Filter || (C.kind == *(enum CXCursorKind *)Data->Filter)) { - CXString USR = clang_getCursorUSR(C); - const char *cstr = clang_getCString(USR); - if (!cstr || cstr[0] == '\0') { - clang_disposeString(USR); - return CXChildVisit_Recurse; - } - printf("// %s: %s %s", FileCheckPrefix, GetCursorSource(C), cstr); - - PrintCursorExtent(C); - printf("\n"); - clang_disposeString(USR); - - return CXChildVisit_Recurse; - } - - return CXChildVisit_Continue; -} - -/******************************************************************************/ -/* Inclusion stack testing. */ -/******************************************************************************/ - -void InclusionVisitor(CXFile includedFile, CXSourceLocation *includeStack, - unsigned includeStackLen, CXClientData data) { - - unsigned i; - CXString fname; - - fname = clang_getFileName(includedFile); - printf("file: %s\nincluded by:\n", clang_getCString(fname)); - clang_disposeString(fname); - - for (i = 0; i < includeStackLen; ++i) { - CXFile includingFile; - unsigned line, column; - clang_getInstantiationLocation(includeStack[i], &includingFile, &line, - &column, 0); - fname = clang_getFileName(includingFile); - printf(" %s:%d:%d\n", clang_getCString(fname), line, column); - clang_disposeString(fname); - } - printf("\n"); -} - -void PrintInclusionStack(CXTranslationUnit TU) { - clang_getInclusions(TU, InclusionVisitor, NULL); -} - -/******************************************************************************/ -/* Linkage testing. */ -/******************************************************************************/ - -static enum CXChildVisitResult PrintLinkage(CXCursor cursor, CXCursor p, - CXClientData d) { - const char *linkage = 0; - - if (clang_isInvalid(clang_getCursorKind(cursor))) - return CXChildVisit_Recurse; - - switch (clang_getCursorLinkage(cursor)) { - case CXLinkage_Invalid: break; - case CXLinkage_NoLinkage: linkage = "NoLinkage"; break; - case CXLinkage_Internal: linkage = "Internal"; break; - case CXLinkage_UniqueExternal: linkage = "UniqueExternal"; break; - case CXLinkage_External: linkage = "External"; break; - } - - if (linkage) { - PrintCursor(cursor); - printf("linkage=%s\n", linkage); - } - - return CXChildVisit_Recurse; -} - -/******************************************************************************/ -/* Typekind testing. */ -/******************************************************************************/ - -static enum CXChildVisitResult PrintTypeKind(CXCursor cursor, CXCursor p, - CXClientData d) { - - if (!clang_isInvalid(clang_getCursorKind(cursor))) { - CXType T = clang_getCursorType(cursor); - CXString S = clang_getTypeKindSpelling(T.kind); - PrintCursor(cursor); - printf(" typekind=%s", clang_getCString(S)); - clang_disposeString(S); - /* Print the canonical type if it is different. */ - { - CXType CT = clang_getCanonicalType(T); - if (!clang_equalTypes(T, CT)) { - CXString CS = clang_getTypeKindSpelling(CT.kind); - printf(" [canonical=%s]", clang_getCString(CS)); - clang_disposeString(CS); - } - } - /* Print the return type if it exists. */ - { - CXType RT = clang_getCursorResultType(cursor); - if (RT.kind != CXType_Invalid) { - CXString RS = clang_getTypeKindSpelling(RT.kind); - printf(" [result=%s]", clang_getCString(RS)); - clang_disposeString(RS); - } - } - /* Print if this is a non-POD type. */ - printf(" [isPOD=%d]", clang_isPODType(T)); - - printf("\n"); - } - return CXChildVisit_Recurse; -} - - -/******************************************************************************/ -/* Loading ASTs/source. */ -/******************************************************************************/ - -static int perform_test_load(CXIndex Idx, CXTranslationUnit TU, - const char *filter, const char *prefix, - CXCursorVisitor Visitor, - PostVisitTU PV) { - - if (prefix) - FileCheckPrefix = prefix; - - if (Visitor) { - enum CXCursorKind K = CXCursor_NotImplemented; - enum CXCursorKind *ck = &K; - VisitorData Data; - - /* Perform some simple filtering. */ - if (!strcmp(filter, "all") || !strcmp(filter, "local")) ck = NULL; - else if (!strcmp(filter, "none")) K = (enum CXCursorKind) ~0; - else if (!strcmp(filter, "category")) K = CXCursor_ObjCCategoryDecl; - else if (!strcmp(filter, "interface")) K = CXCursor_ObjCInterfaceDecl; - else if (!strcmp(filter, "protocol")) K = CXCursor_ObjCProtocolDecl; - else if (!strcmp(filter, "function")) K = CXCursor_FunctionDecl; - else if (!strcmp(filter, "typedef")) K = CXCursor_TypedefDecl; - else if (!strcmp(filter, "scan-function")) Visitor = FunctionScanVisitor; - else { - fprintf(stderr, "Unknown filter for -test-load-tu: %s\n", filter); - return 1; - } - - Data.TU = TU; - Data.Filter = ck; - clang_visitChildren(clang_getTranslationUnitCursor(TU), Visitor, &Data); - } - - if (PV) - PV(TU); - - PrintDiagnostics(TU); - clang_disposeTranslationUnit(TU); - return 0; -} - -int perform_test_load_tu(const char *file, const char *filter, - const char *prefix, CXCursorVisitor Visitor, - PostVisitTU PV) { - CXIndex Idx; - CXTranslationUnit TU; - int result; - Idx = clang_createIndex(/* excludeDeclsFromPCH */ - !strcmp(filter, "local") ? 1 : 0, - /* displayDiagnosics=*/1); - - if (!CreateTranslationUnit(Idx, file, &TU)) { - clang_disposeIndex(Idx); - return 1; - } - - result = perform_test_load(Idx, TU, filter, prefix, Visitor, PV); - clang_disposeIndex(Idx); - return result; -} - -int perform_test_load_source(int argc, const char **argv, - const char *filter, CXCursorVisitor Visitor, - PostVisitTU PV) { - const char *UseExternalASTs = - getenv("CINDEXTEST_USE_EXTERNAL_AST_GENERATION"); - CXIndex Idx; - CXTranslationUnit TU; - struct CXUnsavedFile *unsaved_files = 0; - int num_unsaved_files = 0; - int result; - - Idx = clang_createIndex(/* excludeDeclsFromPCH */ - !strcmp(filter, "local") ? 1 : 0, - /* displayDiagnosics=*/1); - - if (UseExternalASTs && strlen(UseExternalASTs)) - clang_setUseExternalASTGeneration(Idx, 1); - - if (parse_remapped_files(argc, argv, 0, &unsaved_files, &num_unsaved_files)) { - clang_disposeIndex(Idx); - return -1; - } - - TU = clang_createTranslationUnitFromSourceFile(Idx, 0, - argc - num_unsaved_files, - argv + num_unsaved_files, - num_unsaved_files, - unsaved_files); - if (!TU) { - fprintf(stderr, "Unable to load translation unit!\n"); - free_remapped_files(unsaved_files, num_unsaved_files); - clang_disposeIndex(Idx); - return 1; - } - - result = perform_test_load(Idx, TU, filter, NULL, Visitor, PV); - free_remapped_files(unsaved_files, num_unsaved_files); - clang_disposeIndex(Idx); - return result; -} - -int perform_test_reparse_source(int argc, const char **argv, int trials, - const char *filter, CXCursorVisitor Visitor, - PostVisitTU PV) { - const char *UseExternalASTs = - getenv("CINDEXTEST_USE_EXTERNAL_AST_GENERATION"); - CXIndex Idx; - CXTranslationUnit TU; - struct CXUnsavedFile *unsaved_files = 0; - int num_unsaved_files = 0; - int result; - int trial; - - Idx = clang_createIndex(/* excludeDeclsFromPCH */ - !strcmp(filter, "local") ? 1 : 0, - /* displayDiagnosics=*/1); - - if (UseExternalASTs && strlen(UseExternalASTs)) - clang_setUseExternalASTGeneration(Idx, 1); - - if (parse_remapped_files(argc, argv, 0, &unsaved_files, &num_unsaved_files)) { - clang_disposeIndex(Idx); - return -1; - } - - /* Load the initial translation unit -- we do this without honoring remapped - * files, so that we have a way to test results after changing the source. */ - TU = clang_parseTranslationUnit(Idx, 0, - argv + num_unsaved_files, - argc - num_unsaved_files, - 0, 0, getDefaultParsingOptions()); - if (!TU) { - fprintf(stderr, "Unable to load translation unit!\n"); - free_remapped_files(unsaved_files, num_unsaved_files); - clang_disposeIndex(Idx); - return 1; - } - - for (trial = 0; trial < trials; ++trial) { - if (clang_reparseTranslationUnit(TU, num_unsaved_files, unsaved_files, - clang_defaultReparseOptions(TU))) { - fprintf(stderr, "Unable to reparse translation unit!\n"); - clang_disposeTranslationUnit(TU); - free_remapped_files(unsaved_files, num_unsaved_files); - clang_disposeIndex(Idx); - return -1; - } - } - - result = perform_test_load(Idx, TU, filter, NULL, Visitor, PV); - free_remapped_files(unsaved_files, num_unsaved_files); - clang_disposeIndex(Idx); - return result; -} - -/******************************************************************************/ -/* Logic for testing clang_getCursor(). */ -/******************************************************************************/ - -static void print_cursor_file_scan(CXCursor cursor, - unsigned start_line, unsigned start_col, - unsigned end_line, unsigned end_col, - const char *prefix) { - printf("// %s: ", FileCheckPrefix); - if (prefix) - printf("-%s", prefix); - PrintExtent(stdout, start_line, start_col, end_line, end_col); - printf(" "); - PrintCursor(cursor); - printf("\n"); -} - -static int perform_file_scan(const char *ast_file, const char *source_file, - const char *prefix) { - CXIndex Idx; - CXTranslationUnit TU; - FILE *fp; - CXCursor prevCursor = clang_getNullCursor(); - CXFile file; - unsigned line = 1, col = 1; - unsigned start_line = 1, start_col = 1; - - if (!(Idx = clang_createIndex(/* excludeDeclsFromPCH */ 1, - /* displayDiagnosics=*/1))) { - fprintf(stderr, "Could not create Index\n"); - return 1; - } - - if (!CreateTranslationUnit(Idx, ast_file, &TU)) - return 1; - - if ((fp = fopen(source_file, "r")) == NULL) { - fprintf(stderr, "Could not open '%s'\n", source_file); - return 1; - } - - file = clang_getFile(TU, source_file); - for (;;) { - CXCursor cursor; - int c = fgetc(fp); - - if (c == '\n') { - ++line; - col = 1; - } else - ++col; - - /* Check the cursor at this position, and dump the previous one if we have - * found something new. - */ - cursor = clang_getCursor(TU, clang_getLocation(TU, file, line, col)); - if ((c == EOF || !clang_equalCursors(cursor, prevCursor)) && - prevCursor.kind != CXCursor_InvalidFile) { - print_cursor_file_scan(prevCursor, start_line, start_col, - line, col, prefix); - start_line = line; - start_col = col; - } - if (c == EOF) - break; - - prevCursor = cursor; - } - - fclose(fp); - return 0; -} - -/******************************************************************************/ -/* Logic for testing clang_codeComplete(). */ -/******************************************************************************/ - -/* Parse file:line:column from the input string. Returns 0 on success, non-zero - on failure. If successful, the pointer *filename will contain newly-allocated - memory (that will be owned by the caller) to store the file name. */ -int parse_file_line_column(const char *input, char **filename, unsigned *line, - unsigned *column, unsigned *second_line, - unsigned *second_column) { - /* Find the second colon. */ - const char *last_colon = strrchr(input, ':'); - unsigned values[4], i; - unsigned num_values = (second_line && second_column)? 4 : 2; - - char *endptr = 0; - if (!last_colon || last_colon == input) { - if (num_values == 4) - fprintf(stderr, "could not parse filename:line:column:line:column in " - "'%s'\n", input); - else - fprintf(stderr, "could not parse filename:line:column in '%s'\n", input); - return 1; - } - - for (i = 0; i != num_values; ++i) { - const char *prev_colon; - - /* Parse the next line or column. */ - values[num_values - i - 1] = strtol(last_colon + 1, &endptr, 10); - if (*endptr != 0 && *endptr != ':') { - fprintf(stderr, "could not parse %s in '%s'\n", - (i % 2 ? "column" : "line"), input); - return 1; - } - - if (i + 1 == num_values) - break; - - /* Find the previous colon. */ - prev_colon = last_colon - 1; - while (prev_colon != input && *prev_colon != ':') - --prev_colon; - if (prev_colon == input) { - fprintf(stderr, "could not parse %s in '%s'\n", - (i % 2 == 0? "column" : "line"), input); - return 1; - } - - last_colon = prev_colon; - } - - *line = values[0]; - *column = values[1]; - - if (second_line && second_column) { - *second_line = values[2]; - *second_column = values[3]; - } - - /* Copy the file name. */ - *filename = (char*)malloc(last_colon - input + 1); - memcpy(*filename, input, last_colon - input); - (*filename)[last_colon - input] = 0; - return 0; -} - -const char * -clang_getCompletionChunkKindSpelling(enum CXCompletionChunkKind Kind) { - switch (Kind) { - case CXCompletionChunk_Optional: return "Optional"; - case CXCompletionChunk_TypedText: return "TypedText"; - case CXCompletionChunk_Text: return "Text"; - case CXCompletionChunk_Placeholder: return "Placeholder"; - case CXCompletionChunk_Informative: return "Informative"; - case CXCompletionChunk_CurrentParameter: return "CurrentParameter"; - case CXCompletionChunk_LeftParen: return "LeftParen"; - case CXCompletionChunk_RightParen: return "RightParen"; - case CXCompletionChunk_LeftBracket: return "LeftBracket"; - case CXCompletionChunk_RightBracket: return "RightBracket"; - case CXCompletionChunk_LeftBrace: return "LeftBrace"; - case CXCompletionChunk_RightBrace: return "RightBrace"; - case CXCompletionChunk_LeftAngle: return "LeftAngle"; - case CXCompletionChunk_RightAngle: return "RightAngle"; - case CXCompletionChunk_Comma: return "Comma"; - case CXCompletionChunk_ResultType: return "ResultType"; - case CXCompletionChunk_Colon: return "Colon"; - case CXCompletionChunk_SemiColon: return "SemiColon"; - case CXCompletionChunk_Equal: return "Equal"; - case CXCompletionChunk_HorizontalSpace: return "HorizontalSpace"; - case CXCompletionChunk_VerticalSpace: return "VerticalSpace"; - } - - return "Unknown"; -} - -void print_completion_string(CXCompletionString completion_string, FILE *file) { - int I, N; - - N = clang_getNumCompletionChunks(completion_string); - for (I = 0; I != N; ++I) { - CXString text; - const char *cstr; - enum CXCompletionChunkKind Kind - = clang_getCompletionChunkKind(completion_string, I); - - if (Kind == CXCompletionChunk_Optional) { - fprintf(file, "{Optional "); - print_completion_string( - clang_getCompletionChunkCompletionString(completion_string, I), - file); - fprintf(file, "}"); - continue; - } - - text = clang_getCompletionChunkText(completion_string, I); - cstr = clang_getCString(text); - fprintf(file, "{%s %s}", - clang_getCompletionChunkKindSpelling(Kind), - cstr ? cstr : ""); - clang_disposeString(text); - } - -} - -void print_completion_result(CXCompletionResult *completion_result, - CXClientData client_data) { - FILE *file = (FILE *)client_data; - CXString ks = clang_getCursorKindSpelling(completion_result->CursorKind); - - fprintf(file, "%s:", clang_getCString(ks)); - clang_disposeString(ks); - - print_completion_string(completion_result->CompletionString, file); - fprintf(file, " (%u)", - clang_getCompletionPriority(completion_result->CompletionString)); - switch (clang_getCompletionAvailability(completion_result->CompletionString)){ - case CXAvailability_Available: - break; - - case CXAvailability_Deprecated: - fprintf(file, " (deprecated)"); - break; - - case CXAvailability_NotAvailable: - fprintf(file, " (unavailable)"); - break; - } - fprintf(file, "\n"); -} - -int my_stricmp(const char *s1, const char *s2) { - while (*s1 && *s2) { - int c1 = tolower(*s1), c2 = tolower(*s2); - if (c1 < c2) - return -1; - else if (c1 > c2) - return 1; - - ++s1; - ++s2; - } - - if (*s1) - return 1; - else if (*s2) - return -1; - return 0; -} - -int perform_code_completion(int argc, const char **argv, int timing_only) { - const char *input = argv[1]; - char *filename = 0; - unsigned line; - unsigned column; - CXIndex CIdx; - int errorCode; - struct CXUnsavedFile *unsaved_files = 0; - int num_unsaved_files = 0; - CXCodeCompleteResults *results = 0; - CXTranslationUnit *TU = 0; - - if (timing_only) - input += strlen("-code-completion-timing="); - else - input += strlen("-code-completion-at="); - - if ((errorCode = parse_file_line_column(input, &filename, &line, &column, - 0, 0))) - return errorCode; - - if (parse_remapped_files(argc, argv, 2, &unsaved_files, &num_unsaved_files)) - return -1; - - CIdx = clang_createIndex(0, 1); - if (getenv("CINDEXTEST_EDITING")) { - unsigned I, Repeats = 5; - TU = clang_parseTranslationUnit(CIdx, 0, - argv + num_unsaved_files + 2, - argc - num_unsaved_files - 2, - 0, 0, getDefaultParsingOptions()); - if (!TU) { - fprintf(stderr, "Unable to load translation unit!\n"); - return 1; - } - for (I = 0; I != Repeats; ++I) { - results = clang_codeCompleteAt(TU, filename, line, column, - unsaved_files, num_unsaved_files, - clang_defaultCodeCompleteOptions()); - if (!results) { - fprintf(stderr, "Unable to perform code completion!\n"); - return 1; - } - if (I != Repeats-1) - clang_disposeCodeCompleteResults(results); - } - } else - results = clang_codeComplete(CIdx, - argv[argc - 1], argc - num_unsaved_files - 3, - argv + num_unsaved_files + 2, - num_unsaved_files, unsaved_files, - filename, line, column); - - if (results) { - unsigned i, n = results->NumResults; - if (!timing_only) { - /* Sort the code-completion results based on the typed text. */ - clang_sortCodeCompletionResults(results->Results, results->NumResults); - - for (i = 0; i != n; ++i) - print_completion_result(results->Results + i, stdout); - } - n = clang_codeCompleteGetNumDiagnostics(results); - for (i = 0; i != n; ++i) { - CXDiagnostic diag = clang_codeCompleteGetDiagnostic(results, i); - PrintDiagnostic(diag); - clang_disposeDiagnostic(diag); - } - clang_disposeCodeCompleteResults(results); - } - clang_disposeTranslationUnit(TU); - clang_disposeIndex(CIdx); - free(filename); - - free_remapped_files(unsaved_files, num_unsaved_files); - - return 0; -} - -typedef struct { - char *filename; - unsigned line; - unsigned column; -} CursorSourceLocation; - -int inspect_cursor_at(int argc, const char **argv) { - CXIndex CIdx; - int errorCode; - struct CXUnsavedFile *unsaved_files = 0; - int num_unsaved_files = 0; - CXTranslationUnit TU; - CXCursor Cursor; - CursorSourceLocation *Locations = 0; - unsigned NumLocations = 0, Loc; - - /* Count the number of locations. */ - while (strstr(argv[NumLocations+1], "-cursor-at=") == argv[NumLocations+1]) - ++NumLocations; - - /* Parse the locations. */ - assert(NumLocations > 0 && "Unable to count locations?"); - Locations = (CursorSourceLocation *)malloc( - NumLocations * sizeof(CursorSourceLocation)); - for (Loc = 0; Loc < NumLocations; ++Loc) { - const char *input = argv[Loc + 1] + strlen("-cursor-at="); - if ((errorCode = parse_file_line_column(input, &Locations[Loc].filename, - &Locations[Loc].line, - &Locations[Loc].column, 0, 0))) - return errorCode; - } - - if (parse_remapped_files(argc, argv, NumLocations + 1, &unsaved_files, - &num_unsaved_files)) - return -1; - - CIdx = clang_createIndex(0, 1); - TU = clang_createTranslationUnitFromSourceFile(CIdx, argv[argc - 1], - argc - num_unsaved_files - 2 - NumLocations, - argv + num_unsaved_files + 1 + NumLocations, - num_unsaved_files, - unsaved_files); - if (!TU) { - fprintf(stderr, "unable to parse input\n"); - return -1; - } - - for (Loc = 0; Loc < NumLocations; ++Loc) { - CXFile file = clang_getFile(TU, Locations[Loc].filename); - if (!file) - continue; - - Cursor = clang_getCursor(TU, - clang_getLocation(TU, file, Locations[Loc].line, - Locations[Loc].column)); - PrintCursor(Cursor); - printf("\n"); - free(Locations[Loc].filename); - } - - PrintDiagnostics(TU); - clang_disposeTranslationUnit(TU); - clang_disposeIndex(CIdx); - free(Locations); - free_remapped_files(unsaved_files, num_unsaved_files); - return 0; -} - -int perform_token_annotation(int argc, const char **argv) { - const char *input = argv[1]; - char *filename = 0; - unsigned line, second_line; - unsigned column, second_column; - CXIndex CIdx; - CXTranslationUnit TU = 0; - int errorCode; - struct CXUnsavedFile *unsaved_files = 0; - int num_unsaved_files = 0; - CXToken *tokens; - unsigned num_tokens; - CXSourceRange range; - CXSourceLocation startLoc, endLoc; - CXFile file = 0; - CXCursor *cursors = 0; - unsigned i; - - input += strlen("-test-annotate-tokens="); - if ((errorCode = parse_file_line_column(input, &filename, &line, &column, - &second_line, &second_column))) - return errorCode; - - if (parse_remapped_files(argc, argv, 2, &unsaved_files, &num_unsaved_files)) - return -1; - - CIdx = clang_createIndex(0, 1); - TU = clang_createTranslationUnitFromSourceFile(CIdx, argv[argc - 1], - argc - num_unsaved_files - 3, - argv + num_unsaved_files + 2, - num_unsaved_files, - unsaved_files); - if (!TU) { - fprintf(stderr, "unable to parse input\n"); - clang_disposeIndex(CIdx); - free(filename); - free_remapped_files(unsaved_files, num_unsaved_files); - return -1; - } - errorCode = 0; - - file = clang_getFile(TU, filename); - if (!file) { - fprintf(stderr, "file %s is not in this translation unit\n", filename); - errorCode = -1; - goto teardown; - } - - startLoc = clang_getLocation(TU, file, line, column); - if (clang_equalLocations(clang_getNullLocation(), startLoc)) { - fprintf(stderr, "invalid source location %s:%d:%d\n", filename, line, - column); - errorCode = -1; - goto teardown; - } - - endLoc = clang_getLocation(TU, file, second_line, second_column); - if (clang_equalLocations(clang_getNullLocation(), endLoc)) { - fprintf(stderr, "invalid source location %s:%d:%d\n", filename, - second_line, second_column); - errorCode = -1; - goto teardown; - } - - range = clang_getRange(startLoc, endLoc); - clang_tokenize(TU, range, &tokens, &num_tokens); - cursors = (CXCursor *)malloc(num_tokens * sizeof(CXCursor)); - clang_annotateTokens(TU, tokens, num_tokens, cursors); - for (i = 0; i != num_tokens; ++i) { - const char *kind = ""; - CXString spelling = clang_getTokenSpelling(TU, tokens[i]); - CXSourceRange extent = clang_getTokenExtent(TU, tokens[i]); - unsigned start_line, start_column, end_line, end_column; - - switch (clang_getTokenKind(tokens[i])) { - case CXToken_Punctuation: kind = "Punctuation"; break; - case CXToken_Keyword: kind = "Keyword"; break; - case CXToken_Identifier: kind = "Identifier"; break; - case CXToken_Literal: kind = "Literal"; break; - case CXToken_Comment: kind = "Comment"; break; - } - clang_getInstantiationLocation(clang_getRangeStart(extent), - 0, &start_line, &start_column, 0); - clang_getInstantiationLocation(clang_getRangeEnd(extent), - 0, &end_line, &end_column, 0); - printf("%s: \"%s\" ", kind, clang_getCString(spelling)); - PrintExtent(stdout, start_line, start_column, end_line, end_column); - if (!clang_isInvalid(cursors[i].kind)) { - printf(" "); - PrintCursor(cursors[i]); - } - printf("\n"); - } - free(cursors); - - teardown: - PrintDiagnostics(TU); - clang_disposeTranslationUnit(TU); - clang_disposeIndex(CIdx); - free(filename); - free_remapped_files(unsaved_files, num_unsaved_files); - return errorCode; -} - -/******************************************************************************/ -/* USR printing. */ -/******************************************************************************/ - -static int insufficient_usr(const char *kind, const char *usage) { - fprintf(stderr, "USR for '%s' requires: %s\n", kind, usage); - return 1; -} - -static unsigned isUSR(const char *s) { - return s[0] == 'c' && s[1] == ':'; -} - -static int not_usr(const char *s, const char *arg) { - fprintf(stderr, "'%s' argument ('%s') is not a USR\n", s, arg); - return 1; -} - -static void print_usr(CXString usr) { - const char *s = clang_getCString(usr); - printf("%s\n", s); - clang_disposeString(usr); -} - -static void display_usrs() { - fprintf(stderr, "-print-usrs options:\n" - " ObjCCategory \n" - " ObjCClass \n" - " ObjCIvar \n" - " ObjCMethod [0=class method|1=instance method] " - "\n" - " ObjCProperty \n" - " ObjCProtocol \n"); -} - -int print_usrs(const char **I, const char **E) { - while (I != E) { - const char *kind = *I; - unsigned len = strlen(kind); - switch (len) { - case 8: - if (memcmp(kind, "ObjCIvar", 8) == 0) { - if (I + 2 >= E) - return insufficient_usr(kind, " "); - if (!isUSR(I[2])) - return not_usr("", I[2]); - else { - CXString x; - x.Spelling = I[2]; - x.MustFreeString = 0; - print_usr(clang_constructUSR_ObjCIvar(I[1], x)); - } - - I += 3; - continue; - } - break; - case 9: - if (memcmp(kind, "ObjCClass", 9) == 0) { - if (I + 1 >= E) - return insufficient_usr(kind, ""); - print_usr(clang_constructUSR_ObjCClass(I[1])); - I += 2; - continue; - } - break; - case 10: - if (memcmp(kind, "ObjCMethod", 10) == 0) { - if (I + 3 >= E) - return insufficient_usr(kind, " " - "[0=class method|1=instance method] "); - if (!isUSR(I[3])) - return not_usr("", I[3]); - else { - CXString x; - x.Spelling = I[3]; - x.MustFreeString = 0; - print_usr(clang_constructUSR_ObjCMethod(I[1], atoi(I[2]), x)); - } - I += 4; - continue; - } - break; - case 12: - if (memcmp(kind, "ObjCCategory", 12) == 0) { - if (I + 2 >= E) - return insufficient_usr(kind, " "); - print_usr(clang_constructUSR_ObjCCategory(I[1], I[2])); - I += 3; - continue; - } - if (memcmp(kind, "ObjCProtocol", 12) == 0) { - if (I + 1 >= E) - return insufficient_usr(kind, ""); - print_usr(clang_constructUSR_ObjCProtocol(I[1])); - I += 2; - continue; - } - if (memcmp(kind, "ObjCProperty", 12) == 0) { - if (I + 2 >= E) - return insufficient_usr(kind, " "); - if (!isUSR(I[2])) - return not_usr("", I[2]); - else { - CXString x; - x.Spelling = I[2]; - x.MustFreeString = 0; - print_usr(clang_constructUSR_ObjCProperty(I[1], x)); - } - I += 3; - continue; - } - break; - default: - break; - } - break; - } - - if (I != E) { - fprintf(stderr, "Invalid USR kind: %s\n", *I); - display_usrs(); - return 1; - } - return 0; -} - -int print_usrs_file(const char *file_name) { - char line[2048]; - const char *args[128]; - unsigned numChars = 0; - - FILE *fp = fopen(file_name, "r"); - if (!fp) { - fprintf(stderr, "error: cannot open '%s'\n", file_name); - return 1; - } - - /* This code is not really all that safe, but it works fine for testing. */ - while (!feof(fp)) { - char c = fgetc(fp); - if (c == '\n') { - unsigned i = 0; - const char *s = 0; - - if (numChars == 0) - continue; - - line[numChars] = '\0'; - numChars = 0; - - if (line[0] == '/' && line[1] == '/') - continue; - - s = strtok(line, " "); - while (s) { - args[i] = s; - ++i; - s = strtok(0, " "); - } - if (print_usrs(&args[0], &args[i])) - return 1; - } - else - line[numChars++] = c; - } - - fclose(fp); - return 0; -} - -/******************************************************************************/ -/* Command line processing. */ -/******************************************************************************/ -int write_pch_file(const char *filename, int argc, const char *argv[]) { - CXIndex Idx; - CXTranslationUnit TU; - struct CXUnsavedFile *unsaved_files = 0; - int num_unsaved_files = 0; - - Idx = clang_createIndex(/* excludeDeclsFromPCH */1, /* displayDiagnosics=*/1); - - if (parse_remapped_files(argc, argv, 0, &unsaved_files, &num_unsaved_files)) { - clang_disposeIndex(Idx); - return -1; - } - - TU = clang_parseTranslationUnit(Idx, 0, - argv + num_unsaved_files, - argc - num_unsaved_files, - unsaved_files, - num_unsaved_files, - CXTranslationUnit_Incomplete); - if (!TU) { - fprintf(stderr, "Unable to load translation unit!\n"); - free_remapped_files(unsaved_files, num_unsaved_files); - clang_disposeIndex(Idx); - return 1; - } - - if (clang_saveTranslationUnit(TU, filename, clang_defaultSaveOptions(TU))) - fprintf(stderr, "Unable to write PCH file %s\n", filename); - clang_disposeTranslationUnit(TU); - free_remapped_files(unsaved_files, num_unsaved_files); - clang_disposeIndex(Idx); - return 0; -} - -/******************************************************************************/ -/* Command line processing. */ -/******************************************************************************/ - -static CXCursorVisitor GetVisitor(const char *s) { - if (s[0] == '\0') - return FilteredPrintingVisitor; - if (strcmp(s, "-usrs") == 0) - return USRVisitor; - return NULL; -} - -static void print_usage(void) { - fprintf(stderr, - "usage: c-index-test -code-completion-at= \n" - " c-index-test -code-completion-timing= \n" - " c-index-test -cursor-at= \n" - " c-index-test -test-file-scan " - "[FileCheck prefix]\n" - " c-index-test -test-load-tu " - "[FileCheck prefix]\n" - " c-index-test -test-load-tu-usrs " - "[FileCheck prefix]\n" - " c-index-test -test-load-source {}*\n"); - fprintf(stderr, - " c-index-test -test-load-source-reparse " - " {}*\n" - " c-index-test -test-load-source-usrs {}*\n" - " c-index-test -test-annotate-tokens= {}*\n" - " c-index-test -test-inclusion-stack-source {}*\n" - " c-index-test -test-inclusion-stack-tu \n" - " c-index-test -test-print-linkage-source {}*\n" - " c-index-test -test-print-typekind {}*\n" - " c-index-test -print-usr [ {}]*\n"); - fprintf(stderr, - " c-index-test -print-usr-file \n" - " c-index-test -write-pch \n\n"); - fprintf(stderr, - " values:\n%s", - " all - load all symbols, including those from PCH\n" - " local - load all symbols except those in PCH\n" - " category - only load ObjC categories (non-PCH)\n" - " interface - only load ObjC interfaces (non-PCH)\n" - " protocol - only load ObjC protocols (non-PCH)\n" - " function - only load functions (non-PCH)\n" - " typedef - only load typdefs (non-PCH)\n" - " scan-function - scan function bodies (non-PCH)\n\n"); -} - -int main(int argc, const char **argv) { - clang_enableStackTraces(); - if (argc > 2 && strstr(argv[1], "-code-completion-at=") == argv[1]) - return perform_code_completion(argc, argv, 0); - if (argc > 2 && strstr(argv[1], "-code-completion-timing=") == argv[1]) - return perform_code_completion(argc, argv, 1); - if (argc > 2 && strstr(argv[1], "-cursor-at=") == argv[1]) - return inspect_cursor_at(argc, argv); - else if (argc >= 4 && strncmp(argv[1], "-test-load-tu", 13) == 0) { - CXCursorVisitor I = GetVisitor(argv[1] + 13); - if (I) - return perform_test_load_tu(argv[2], argv[3], argc >= 5 ? argv[4] : 0, I, - NULL); - } - else if (argc >= 5 && strncmp(argv[1], "-test-load-source-reparse", 25) == 0){ - CXCursorVisitor I = GetVisitor(argv[1] + 25); - if (I) { - int trials = atoi(argv[2]); - return perform_test_reparse_source(argc - 4, argv + 4, trials, argv[3], I, - NULL); - } - } - else if (argc >= 4 && strncmp(argv[1], "-test-load-source", 17) == 0) { - CXCursorVisitor I = GetVisitor(argv[1] + 17); - if (I) - return perform_test_load_source(argc - 3, argv + 3, argv[2], I, NULL); - } - else if (argc >= 4 && strcmp(argv[1], "-test-file-scan") == 0) - return perform_file_scan(argv[2], argv[3], - argc >= 5 ? argv[4] : 0); - else if (argc > 2 && strstr(argv[1], "-test-annotate-tokens=") == argv[1]) - return perform_token_annotation(argc, argv); - else if (argc > 2 && strcmp(argv[1], "-test-inclusion-stack-source") == 0) - return perform_test_load_source(argc - 2, argv + 2, "all", NULL, - PrintInclusionStack); - else if (argc > 2 && strcmp(argv[1], "-test-inclusion-stack-tu") == 0) - return perform_test_load_tu(argv[2], "all", NULL, NULL, - PrintInclusionStack); - else if (argc > 2 && strcmp(argv[1], "-test-print-linkage-source") == 0) - return perform_test_load_source(argc - 2, argv + 2, "all", PrintLinkage, - NULL); - else if (argc > 2 && strcmp(argv[1], "-test-print-typekind") == 0) - return perform_test_load_source(argc - 2, argv + 2, "all", - PrintTypeKind, 0); - else if (argc > 1 && strcmp(argv[1], "-print-usr") == 0) { - if (argc > 2) - return print_usrs(argv + 2, argv + argc); - else { - display_usrs(); - return 1; - } - } - else if (argc > 2 && strcmp(argv[1], "-print-usr-file") == 0) - return print_usrs_file(argv[2]); - else if (argc > 2 && strcmp(argv[1], "-write-pch") == 0) - return write_pch_file(argv[2], argc - 3, argv + 3); - - print_usage(); - return 1; -} diff --git a/contrib/llvm/tools/clang/tools/driver/CMakeLists.txt b/contrib/llvm/tools/clang/tools/driver/CMakeLists.txt deleted file mode 100644 index ec6e9c6e8026..000000000000 --- a/contrib/llvm/tools/clang/tools/driver/CMakeLists.txt +++ /dev/null @@ -1,54 +0,0 @@ -set(LLVM_NO_RTTI 1) - -set( LLVM_USED_LIBS - clangFrontendTool - clangFrontend - clangDriver - clangSerialization - clangCodeGen - clangParse - clangSema - clangChecker - clangAnalysis - clangIndex - clangRewrite - clangAST - clangLex - clangBasic - ) - -set( LLVM_LINK_COMPONENTS - ${LLVM_TARGETS_TO_BUILD} - asmparser - bitreader - bitwriter - codegen - ipo - selectiondag - ) - -add_clang_executable(clang - driver.cpp - cc1_main.cpp - cc1as_main.cpp - ) - -if(UNIX) - set(CLANGXX_LINK_OR_COPY create_symlink) - set(CLANGXX_DESTDIR $ENV{DESTDIR}/) -else() - set(CLANGXX_LINK_OR_COPY copy) -endif() - -# Create the clang++ symlink in the build directory. -add_custom_target(clang++ ALL - ${CMAKE_COMMAND} -E ${CLANGXX_LINK_OR_COPY} - "${LLVM_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/clang${CMAKE_EXECUTABLE_SUFFIX}" - "${LLVM_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/clang++${CMAKE_EXECUTABLE_SUFFIX}" - DEPENDS clang) - -install(TARGETS clang - RUNTIME DESTINATION bin) - -# Create the clang++ symlink at installation time. -install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E ${CLANGXX_LINK_OR_COPY} \"${CMAKE_INSTALL_PREFIX}/bin/clang${CMAKE_EXECUTABLE_SUFFIX}\" \"${CLANGXX_DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/clang++${CMAKE_EXECUTABLE_SUFFIX}\")") diff --git a/contrib/llvm/tools/clang/tools/driver/Info.plist.in b/contrib/llvm/tools/clang/tools/driver/Info.plist.in deleted file mode 100644 index c938fb053d92..000000000000 --- a/contrib/llvm/tools/clang/tools/driver/Info.plist.in +++ /dev/null @@ -1,18 +0,0 @@ - - - - - CFBundleIdentifier - @TOOL_INFO_UTI@ - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - @TOOL_INFO_NAME - CFBundleShortVersionString - @TOOL_INFO_VERSION@ - CFBundleVersion - @TOOL_INFO_BUILD_VERSION@ - CFBundleSignature - ???? - - diff --git a/contrib/llvm/tools/clang/tools/driver/Makefile b/contrib/llvm/tools/clang/tools/driver/Makefile deleted file mode 100644 index 447f0e4eb06b..000000000000 --- a/contrib/llvm/tools/clang/tools/driver/Makefile +++ /dev/null @@ -1,66 +0,0 @@ -##===- tools/driver/Makefile -------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -CLANG_LEVEL := ../.. - -TOOLNAME = clang -ifndef CLANG_IS_PRODUCTION -TOOLALIAS = clang++ -else - ifdef CLANGXX_IS_PRODUCTION - TOOLALIAS = clang++ - endif -endif - -# Include tool version information on OS X. -TOOL_INFO_PLIST := Info.plist - -# Include this here so we can get the configuration of the targets that have -# been configured for construction. We have to do this early so we can set up -# LINK_COMPONENTS before including Makefile.rules -include $(CLANG_LEVEL)/../../Makefile.config - -LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \ - ipo selectiondag -USEDLIBS = clangFrontendTool.a clangFrontend.a clangDriver.a \ - clangSerialization.a clangCodeGen.a clangParse.a clangSema.a \ - clangChecker.a clangAnalysis.a clangIndex.a clangRewrite.a \ - clangAST.a clangLex.a clangBasic.a - -include $(CLANG_LEVEL)/Makefile - -# Set the tool version information values. -ifeq ($(HOST_OS),Darwin) -ifdef CLANG_VENDOR -TOOL_INFO_NAME := $(CLANG_VENDOR) clang -else -TOOL_INFO_NAME := clang -endif - -ifdef CLANG_VENDOR_UTI -TOOL_INFO_UTI := $(CLANG_VENDOR_UTI) -else -TOOL_INFO_UTI := org.llvm.clang -endif - -TOOL_INFO_VERSION := $(word 3,$(shell grep "CLANG_VERSION " \ - $(PROJ_OBJ_DIR)/$(CLANG_LEVEL)/include/clang/Basic/Version.inc)) -ifdef LLVM_SUBMIT_VERSION -TOOL_INFO_BUILD_VERSION := $(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION) -else -TOOL_INFO_BUILD_VERSION := -endif -endif - -# Translate make variable to define when building a "production" clang. -ifdef CLANG_IS_PRODUCTION -CPP.Defines += -DCLANG_IS_PRODUCTION -endif -ifdef CLANGXX_IS_PRODUCTION -CPP.Defines += -DCLANGXX_IS_PRODUCTION -endif diff --git a/contrib/llvm/tools/clang/tools/libclang/CIndex.cpp b/contrib/llvm/tools/clang/tools/libclang/CIndex.cpp deleted file mode 100644 index 5117f2c16424..000000000000 --- a/contrib/llvm/tools/clang/tools/libclang/CIndex.cpp +++ /dev/null @@ -1,3795 +0,0 @@ -//===- CIndex.cpp - Clang-C Source Indexing Library -----------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements the main API hooks in the Clang-C Source Indexing -// library. -// -//===----------------------------------------------------------------------===// - -#include "CIndexer.h" -#include "CXCursor.h" -#include "CXType.h" -#include "CXSourceLocation.h" -#include "CIndexDiagnostic.h" - -#include "clang/Basic/Version.h" - -#include "clang/AST/DeclVisitor.h" -#include "clang/AST/StmtVisitor.h" -#include "clang/AST/TypeLocVisitor.h" -#include "clang/Basic/Diagnostic.h" -#include "clang/Frontend/ASTUnit.h" -#include "clang/Frontend/CompilerInstance.h" -#include "clang/Frontend/FrontendDiagnostic.h" -#include "clang/Lex/Lexer.h" -#include "clang/Lex/PreprocessingRecord.h" -#include "clang/Lex/Preprocessor.h" -#include "llvm/Support/CrashRecoveryContext.h" -#include "llvm/Support/MemoryBuffer.h" -#include "llvm/Support/Timer.h" -#include "llvm/System/Program.h" -#include "llvm/System/Signals.h" - -// Needed to define L_TMPNAM on some systems. -#include - -using namespace clang; -using namespace clang::cxcursor; -using namespace clang::cxstring; - -//===----------------------------------------------------------------------===// -// Crash Reporting. -//===----------------------------------------------------------------------===// - -#ifdef USE_CRASHTRACER -#include "clang/Analysis/Support/SaveAndRestore.h" -// Integrate with crash reporter. -static const char *__crashreporter_info__ = 0; -asm(".desc ___crashreporter_info__, 0x10"); -#define NUM_CRASH_STRINGS 32 -static unsigned crashtracer_counter = 0; -static unsigned crashtracer_counter_id[NUM_CRASH_STRINGS] = { 0 }; -static const char *crashtracer_strings[NUM_CRASH_STRINGS] = { 0 }; -static const char *agg_crashtracer_strings[NUM_CRASH_STRINGS] = { 0 }; - -static unsigned SetCrashTracerInfo(const char *str, - llvm::SmallString<1024> &AggStr) { - - unsigned slot = 0; - while (crashtracer_strings[slot]) { - if (++slot == NUM_CRASH_STRINGS) - slot = 0; - } - crashtracer_strings[slot] = str; - crashtracer_counter_id[slot] = ++crashtracer_counter; - - // We need to create an aggregate string because multiple threads - // may be in this method at one time. The crash reporter string - // will attempt to overapproximate the set of in-flight invocations - // of this function. Race conditions can still cause this goal - // to not be achieved. - { - llvm::raw_svector_ostream Out(AggStr); - for (unsigned i = 0; i < NUM_CRASH_STRINGS; ++i) - if (crashtracer_strings[i]) Out << crashtracer_strings[i] << '\n'; - } - __crashreporter_info__ = agg_crashtracer_strings[slot] = AggStr.c_str(); - return slot; -} - -static void ResetCrashTracerInfo(unsigned slot) { - unsigned max_slot = 0; - unsigned max_value = 0; - - crashtracer_strings[slot] = agg_crashtracer_strings[slot] = 0; - - for (unsigned i = 0 ; i < NUM_CRASH_STRINGS; ++i) - if (agg_crashtracer_strings[i] && - crashtracer_counter_id[i] > max_value) { - max_slot = i; - max_value = crashtracer_counter_id[i]; - } - - __crashreporter_info__ = agg_crashtracer_strings[max_slot]; -} - -namespace { -class ArgsCrashTracerInfo { - llvm::SmallString<1024> CrashString; - llvm::SmallString<1024> AggregateString; - unsigned crashtracerSlot; -public: - ArgsCrashTracerInfo(llvm::SmallVectorImpl &Args) - : crashtracerSlot(0) - { - { - llvm::raw_svector_ostream Out(CrashString); - Out << "ClangCIndex [" << getClangFullVersion() << "]" - << "[createTranslationUnitFromSourceFile]: clang"; - for (llvm::SmallVectorImpl::iterator I=Args.begin(), - E=Args.end(); I!=E; ++I) - Out << ' ' << *I; - } - crashtracerSlot = SetCrashTracerInfo(CrashString.c_str(), - AggregateString); - } - - ~ArgsCrashTracerInfo() { - ResetCrashTracerInfo(crashtracerSlot); - } -}; -} -#endif - -/// \brief The result of comparing two source ranges. -enum RangeComparisonResult { - /// \brief Either the ranges overlap or one of the ranges is invalid. - RangeOverlap, - - /// \brief The first range ends before the second range starts. - RangeBefore, - - /// \brief The first range starts after the second range ends. - RangeAfter -}; - -/// \brief Compare two source ranges to determine their relative position in -/// the translation unit. -static RangeComparisonResult RangeCompare(SourceManager &SM, - SourceRange R1, - SourceRange R2) { - assert(R1.isValid() && "First range is invalid?"); - assert(R2.isValid() && "Second range is invalid?"); - if (R1.getEnd() != R2.getBegin() && - SM.isBeforeInTranslationUnit(R1.getEnd(), R2.getBegin())) - return RangeBefore; - if (R2.getEnd() != R1.getBegin() && - SM.isBeforeInTranslationUnit(R2.getEnd(), R1.getBegin())) - return RangeAfter; - return RangeOverlap; -} - -/// \brief Determine if a source location falls within, before, or after a -/// a given source range. -static RangeComparisonResult LocationCompare(SourceManager &SM, - SourceLocation L, SourceRange R) { - assert(R.isValid() && "First range is invalid?"); - assert(L.isValid() && "Second range is invalid?"); - if (L == R.getBegin() || L == R.getEnd()) - return RangeOverlap; - if (SM.isBeforeInTranslationUnit(L, R.getBegin())) - return RangeBefore; - if (SM.isBeforeInTranslationUnit(R.getEnd(), L)) - return RangeAfter; - return RangeOverlap; -} - -/// \brief Translate a Clang source range into a CIndex source range. -/// -/// Clang internally represents ranges where the end location points to the -/// start of the token at the end. However, for external clients it is more -/// useful to have a CXSourceRange be a proper half-open interval. This routine -/// does the appropriate translation. -CXSourceRange cxloc::translateSourceRange(const SourceManager &SM, - const LangOptions &LangOpts, - const CharSourceRange &R) { - // We want the last character in this location, so we will adjust the - // location accordingly. - // FIXME: How do do this with a macro instantiation location? - SourceLocation EndLoc = R.getEnd(); - if (R.isTokenRange() && !EndLoc.isInvalid() && EndLoc.isFileID()) { - unsigned Length = Lexer::MeasureTokenLength(EndLoc, SM, LangOpts); - EndLoc = EndLoc.getFileLocWithOffset(Length); - } - - CXSourceRange Result = { { (void *)&SM, (void *)&LangOpts }, - R.getBegin().getRawEncoding(), - EndLoc.getRawEncoding() }; - return Result; -} - -//===----------------------------------------------------------------------===// -// Cursor visitor. -//===----------------------------------------------------------------------===// - -namespace { - -// Cursor visitor. -class CursorVisitor : public DeclVisitor, - public TypeLocVisitor, - public StmtVisitor -{ - /// \brief The translation unit we are traversing. - ASTUnit *TU; - - /// \brief The parent cursor whose children we are traversing. - CXCursor Parent; - - /// \brief The declaration that serves at the parent of any statement or - /// expression nodes. - Decl *StmtParent; - - /// \brief The visitor function. - CXCursorVisitor Visitor; - - /// \brief The opaque client data, to be passed along to the visitor. - CXClientData ClientData; - - // MaxPCHLevel - the maximum PCH level of declarations that we will pass on - // to the visitor. Declarations with a PCH level greater than this value will - // be suppressed. - unsigned MaxPCHLevel; - - /// \brief When valid, a source range to which the cursor should restrict - /// its search. - SourceRange RegionOfInterest; - - using DeclVisitor::Visit; - using TypeLocVisitor::Visit; - using StmtVisitor::Visit; - - /// \brief Determine whether this particular source range comes before, comes - /// after, or overlaps the region of interest. - /// - /// \param R a half-open source range retrieved from the abstract syntax tree. - RangeComparisonResult CompareRegionOfInterest(SourceRange R); - - class SetParentRAII { - CXCursor &Parent; - Decl *&StmtParent; - CXCursor OldParent; - - public: - SetParentRAII(CXCursor &Parent, Decl *&StmtParent, CXCursor NewParent) - : Parent(Parent), StmtParent(StmtParent), OldParent(Parent) - { - Parent = NewParent; - if (clang_isDeclaration(Parent.kind)) - StmtParent = getCursorDecl(Parent); - } - - ~SetParentRAII() { - Parent = OldParent; - if (clang_isDeclaration(Parent.kind)) - StmtParent = getCursorDecl(Parent); - } - }; - -public: - CursorVisitor(ASTUnit *TU, CXCursorVisitor Visitor, CXClientData ClientData, - unsigned MaxPCHLevel, - SourceRange RegionOfInterest = SourceRange()) - : TU(TU), Visitor(Visitor), ClientData(ClientData), - MaxPCHLevel(MaxPCHLevel), RegionOfInterest(RegionOfInterest) - { - Parent.kind = CXCursor_NoDeclFound; - Parent.data[0] = 0; - Parent.data[1] = 0; - Parent.data[2] = 0; - StmtParent = 0; - } - - bool Visit(CXCursor Cursor, bool CheckedRegionOfInterest = false); - - std::pair - getPreprocessedEntities(); - - bool VisitChildren(CXCursor Parent); - - // Declaration visitors - bool VisitAttributes(Decl *D); - bool VisitBlockDecl(BlockDecl *B); - bool VisitCXXRecordDecl(CXXRecordDecl *D); - bool VisitDeclContext(DeclContext *DC); - bool VisitTranslationUnitDecl(TranslationUnitDecl *D); - bool VisitTypedefDecl(TypedefDecl *D); - bool VisitTagDecl(TagDecl *D); - bool VisitClassTemplateSpecializationDecl(ClassTemplateSpecializationDecl *D); - bool VisitClassTemplatePartialSpecializationDecl( - ClassTemplatePartialSpecializationDecl *D); - bool VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D); - bool VisitEnumConstantDecl(EnumConstantDecl *D); - bool VisitDeclaratorDecl(DeclaratorDecl *DD); - bool VisitFunctionDecl(FunctionDecl *ND); - bool VisitFieldDecl(FieldDecl *D); - bool VisitVarDecl(VarDecl *); - bool VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D); - bool VisitFunctionTemplateDecl(FunctionTemplateDecl *D); - bool VisitClassTemplateDecl(ClassTemplateDecl *D); - bool VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D); - bool VisitObjCMethodDecl(ObjCMethodDecl *ND); - bool VisitObjCContainerDecl(ObjCContainerDecl *D); - bool VisitObjCCategoryDecl(ObjCCategoryDecl *ND); - bool VisitObjCProtocolDecl(ObjCProtocolDecl *PID); - bool VisitObjCPropertyDecl(ObjCPropertyDecl *PD); - bool VisitObjCInterfaceDecl(ObjCInterfaceDecl *D); - bool VisitObjCImplDecl(ObjCImplDecl *D); - bool VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D); - bool VisitObjCImplementationDecl(ObjCImplementationDecl *D); - // FIXME: ObjCPropertyDecl requires TypeSourceInfo, getter/setter locations, - // etc. - // FIXME: ObjCCompatibleAliasDecl requires aliased-class locations. - bool VisitObjCForwardProtocolDecl(ObjCForwardProtocolDecl *D); - bool VisitObjCClassDecl(ObjCClassDecl *D); - bool VisitLinkageSpecDecl(LinkageSpecDecl *D); - bool VisitNamespaceDecl(NamespaceDecl *D); - bool VisitNamespaceAliasDecl(NamespaceAliasDecl *D); - bool VisitUsingDirectiveDecl(UsingDirectiveDecl *D); - bool VisitUsingDecl(UsingDecl *D); - bool VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D); - bool VisitUnresolvedUsingTypenameDecl(UnresolvedUsingTypenameDecl *D); - - // Name visitor - bool VisitDeclarationNameInfo(DeclarationNameInfo Name); - bool VisitNestedNameSpecifier(NestedNameSpecifier *NNS, SourceRange Range); - - // Template visitors - bool VisitTemplateParameters(const TemplateParameterList *Params); - bool VisitTemplateName(TemplateName Name, SourceLocation Loc); - bool VisitTemplateArgumentLoc(const TemplateArgumentLoc &TAL); - - // Type visitors - bool VisitQualifiedTypeLoc(QualifiedTypeLoc TL); - bool VisitBuiltinTypeLoc(BuiltinTypeLoc TL); - bool VisitTypedefTypeLoc(TypedefTypeLoc TL); - bool VisitUnresolvedUsingTypeLoc(UnresolvedUsingTypeLoc TL); - bool VisitTagTypeLoc(TagTypeLoc TL); - bool VisitTemplateTypeParmTypeLoc(TemplateTypeParmTypeLoc TL); - bool VisitObjCInterfaceTypeLoc(ObjCInterfaceTypeLoc TL); - bool VisitObjCObjectTypeLoc(ObjCObjectTypeLoc TL); - bool VisitObjCObjectPointerTypeLoc(ObjCObjectPointerTypeLoc TL); - bool VisitPointerTypeLoc(PointerTypeLoc TL); - bool VisitBlockPointerTypeLoc(BlockPointerTypeLoc TL); - bool VisitMemberPointerTypeLoc(MemberPointerTypeLoc TL); - bool VisitLValueReferenceTypeLoc(LValueReferenceTypeLoc TL); - bool VisitRValueReferenceTypeLoc(RValueReferenceTypeLoc TL); - bool VisitFunctionTypeLoc(FunctionTypeLoc TL, bool SkipResultType = false); - bool VisitArrayTypeLoc(ArrayTypeLoc TL); - bool VisitTemplateSpecializationTypeLoc(TemplateSpecializationTypeLoc TL); - // FIXME: Implement visitors here when the unimplemented TypeLocs get - // implemented - bool VisitTypeOfExprTypeLoc(TypeOfExprTypeLoc TL); - bool VisitTypeOfTypeLoc(TypeOfTypeLoc TL); - - // Statement visitors - bool VisitStmt(Stmt *S); - bool VisitDeclStmt(DeclStmt *S); - // FIXME: LabelStmt label? - bool VisitIfStmt(IfStmt *S); - bool VisitSwitchStmt(SwitchStmt *S); - bool VisitCaseStmt(CaseStmt *S); - bool VisitWhileStmt(WhileStmt *S); - bool VisitForStmt(ForStmt *S); -// bool VisitSwitchCase(SwitchCase *S); - - // Expression visitors - bool VisitDeclRefExpr(DeclRefExpr *E); - bool VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E); - bool VisitBlockExpr(BlockExpr *B); - bool VisitCompoundLiteralExpr(CompoundLiteralExpr *E); - bool VisitExplicitCastExpr(ExplicitCastExpr *E); - bool VisitObjCMessageExpr(ObjCMessageExpr *E); - bool VisitObjCEncodeExpr(ObjCEncodeExpr *E); - bool VisitOffsetOfExpr(OffsetOfExpr *E); - bool VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E); - bool VisitMemberExpr(MemberExpr *E); - // FIXME: AddrLabelExpr (once we have cursors for labels) - bool VisitTypesCompatibleExpr(TypesCompatibleExpr *E); - bool VisitVAArgExpr(VAArgExpr *E); - // FIXME: InitListExpr (for the designators) - // FIXME: DesignatedInitExpr - bool VisitCXXTypeidExpr(CXXTypeidExpr *E); - bool VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) { return false; } - // FIXME: CXXTemporaryObjectExpr has poor source-location information. - // FIXME: CXXScalarValueInitExpr has poor source-location information. - // FIXME: CXXNewExpr has poor source-location information - bool VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E); - // FIXME: UnaryTypeTraitExpr has poor source-location information. - bool VisitOverloadExpr(OverloadExpr *E); - bool VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E); - // FIXME: CXXUnresolvedConstructExpr has poor source-location information. - bool VisitCXXDependentScopeMemberExpr(CXXDependentScopeMemberExpr *E); - bool VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E); -}; - -} // end anonymous namespace - -static SourceRange getRawCursorExtent(CXCursor C); - -RangeComparisonResult CursorVisitor::CompareRegionOfInterest(SourceRange R) { - return RangeCompare(TU->getSourceManager(), R, RegionOfInterest); -} - -/// \brief Visit the given cursor and, if requested by the visitor, -/// its children. -/// -/// \param Cursor the cursor to visit. -/// -/// \param CheckRegionOfInterest if true, then the caller already checked that -/// this cursor is within the region of interest. -/// -/// \returns true if the visitation should be aborted, false if it -/// should continue. -bool CursorVisitor::Visit(CXCursor Cursor, bool CheckedRegionOfInterest) { - if (clang_isInvalid(Cursor.kind)) - return false; - - if (clang_isDeclaration(Cursor.kind)) { - Decl *D = getCursorDecl(Cursor); - assert(D && "Invalid declaration cursor"); - if (D->getPCHLevel() > MaxPCHLevel) - return false; - - if (D->isImplicit()) - return false; - } - - // If we have a range of interest, and this cursor doesn't intersect with it, - // we're done. - if (RegionOfInterest.isValid() && !CheckedRegionOfInterest) { - SourceRange Range = getRawCursorExtent(Cursor); - if (Range.isInvalid() || CompareRegionOfInterest(Range)) - return false; - } - - switch (Visitor(Cursor, Parent, ClientData)) { - case CXChildVisit_Break: - return true; - - case CXChildVisit_Continue: - return false; - - case CXChildVisit_Recurse: - return VisitChildren(Cursor); - } - - return false; -} - -std::pair -CursorVisitor::getPreprocessedEntities() { - PreprocessingRecord &PPRec - = *TU->getPreprocessor().getPreprocessingRecord(); - - bool OnlyLocalDecls - = !TU->isMainFileAST() && TU->getOnlyLocalDecls(); - - // There is no region of interest; we have to walk everything. - if (RegionOfInterest.isInvalid()) - return std::make_pair(PPRec.begin(OnlyLocalDecls), - PPRec.end(OnlyLocalDecls)); - - // Find the file in which the region of interest lands. - SourceManager &SM = TU->getSourceManager(); - std::pair Begin - = SM.getDecomposedInstantiationLoc(RegionOfInterest.getBegin()); - std::pair End - = SM.getDecomposedInstantiationLoc(RegionOfInterest.getEnd()); - - // The region of interest spans files; we have to walk everything. - if (Begin.first != End.first) - return std::make_pair(PPRec.begin(OnlyLocalDecls), - PPRec.end(OnlyLocalDecls)); - - ASTUnit::PreprocessedEntitiesByFileMap &ByFileMap - = TU->getPreprocessedEntitiesByFile(); - if (ByFileMap.empty()) { - // Build the mapping from files to sets of preprocessed entities. - for (PreprocessingRecord::iterator E = PPRec.begin(OnlyLocalDecls), - EEnd = PPRec.end(OnlyLocalDecls); - E != EEnd; ++E) { - std::pair P - = SM.getDecomposedInstantiationLoc((*E)->getSourceRange().getBegin()); - ByFileMap[P.first].push_back(*E); - } - } - - return std::make_pair(ByFileMap[Begin.first].begin(), - ByFileMap[Begin.first].end()); -} - -/// \brief Visit the children of the given cursor. -/// -/// \returns true if the visitation should be aborted, false if it -/// should continue. -bool CursorVisitor::VisitChildren(CXCursor Cursor) { - if (clang_isReference(Cursor.kind)) { - // By definition, references have no children. - return false; - } - - // Set the Parent field to Cursor, then back to its old value once we're - // done. - SetParentRAII SetParent(Parent, StmtParent, Cursor); - - if (clang_isDeclaration(Cursor.kind)) { - Decl *D = getCursorDecl(Cursor); - assert(D && "Invalid declaration cursor"); - return VisitAttributes(D) || Visit(D); - } - - if (clang_isStatement(Cursor.kind)) - return Visit(getCursorStmt(Cursor)); - if (clang_isExpression(Cursor.kind)) - return Visit(getCursorExpr(Cursor)); - - if (clang_isTranslationUnit(Cursor.kind)) { - ASTUnit *CXXUnit = getCursorASTUnit(Cursor); - if (!CXXUnit->isMainFileAST() && CXXUnit->getOnlyLocalDecls() && - RegionOfInterest.isInvalid()) { - for (ASTUnit::top_level_iterator TL = CXXUnit->top_level_begin(), - TLEnd = CXXUnit->top_level_end(); - TL != TLEnd; ++TL) { - if (Visit(MakeCXCursor(*TL, CXXUnit), true)) - return true; - } - } else if (VisitDeclContext( - CXXUnit->getASTContext().getTranslationUnitDecl())) - return true; - - // Walk the preprocessing record. - if (CXXUnit->getPreprocessor().getPreprocessingRecord()) { - // FIXME: Once we have the ability to deserialize a preprocessing record, - // do so. - PreprocessingRecord::iterator E, EEnd; - for (llvm::tie(E, EEnd) = getPreprocessedEntities(); E != EEnd; ++E) { - if (MacroInstantiation *MI = dyn_cast(*E)) { - if (Visit(MakeMacroInstantiationCursor(MI, CXXUnit))) - return true; - - continue; - } - - if (MacroDefinition *MD = dyn_cast(*E)) { - if (Visit(MakeMacroDefinitionCursor(MD, CXXUnit))) - return true; - - continue; - } - } - } - return false; - } - - // Nothing to visit at the moment. - return false; -} - -bool CursorVisitor::VisitBlockDecl(BlockDecl *B) { - if (Visit(B->getSignatureAsWritten()->getTypeLoc())) - return true; - - if (Stmt *Body = B->getBody()) - return Visit(MakeCXCursor(Body, StmtParent, TU)); - - return false; -} - -bool CursorVisitor::VisitDeclContext(DeclContext *DC) { - for (DeclContext::decl_iterator - I = DC->decls_begin(), E = DC->decls_end(); I != E; ++I) { - - Decl *D = *I; - if (D->getLexicalDeclContext() != DC) - continue; - - CXCursor Cursor = MakeCXCursor(D, TU); - - if (RegionOfInterest.isValid()) { - SourceRange Range = getRawCursorExtent(Cursor); - if (Range.isInvalid()) - continue; - - switch (CompareRegionOfInterest(Range)) { - case RangeBefore: - // This declaration comes before the region of interest; skip it. - continue; - - case RangeAfter: - // This declaration comes after the region of interest; we're done. - return false; - - case RangeOverlap: - // This declaration overlaps the region of interest; visit it. - break; - } - } - - if (Visit(Cursor, true)) - return true; - } - - return false; -} - -bool CursorVisitor::VisitTranslationUnitDecl(TranslationUnitDecl *D) { - llvm_unreachable("Translation units are visited directly by Visit()"); - return false; -} - -bool CursorVisitor::VisitTypedefDecl(TypedefDecl *D) { - if (TypeSourceInfo *TSInfo = D->getTypeSourceInfo()) - return Visit(TSInfo->getTypeLoc()); - - return false; -} - -bool CursorVisitor::VisitTagDecl(TagDecl *D) { - return VisitDeclContext(D); -} - -bool CursorVisitor::VisitClassTemplateSpecializationDecl( - ClassTemplateSpecializationDecl *D) { - bool ShouldVisitBody = false; - switch (D->getSpecializationKind()) { - case TSK_Undeclared: - case TSK_ImplicitInstantiation: - // Nothing to visit - return false; - - case TSK_ExplicitInstantiationDeclaration: - case TSK_ExplicitInstantiationDefinition: - break; - - case TSK_ExplicitSpecialization: - ShouldVisitBody = true; - break; - } - - // Visit the template arguments used in the specialization. - if (TypeSourceInfo *SpecType = D->getTypeAsWritten()) { - TypeLoc TL = SpecType->getTypeLoc(); - if (TemplateSpecializationTypeLoc *TSTLoc - = dyn_cast(&TL)) { - for (unsigned I = 0, N = TSTLoc->getNumArgs(); I != N; ++I) - if (VisitTemplateArgumentLoc(TSTLoc->getArgLoc(I))) - return true; - } - } - - if (ShouldVisitBody && VisitCXXRecordDecl(D)) - return true; - - return false; -} - -bool CursorVisitor::VisitClassTemplatePartialSpecializationDecl( - ClassTemplatePartialSpecializationDecl *D) { - // FIXME: Visit the "outer" template parameter lists on the TagDecl - // before visiting these template parameters. - if (VisitTemplateParameters(D->getTemplateParameters())) - return true; - - // Visit the partial specialization arguments. - const TemplateArgumentLoc *TemplateArgs = D->getTemplateArgsAsWritten(); - for (unsigned I = 0, N = D->getNumTemplateArgsAsWritten(); I != N; ++I) - if (VisitTemplateArgumentLoc(TemplateArgs[I])) - return true; - - return VisitCXXRecordDecl(D); -} - -bool CursorVisitor::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) { - // Visit the default argument. - if (D->hasDefaultArgument() && !D->defaultArgumentWasInherited()) - if (TypeSourceInfo *DefArg = D->getDefaultArgumentInfo()) - if (Visit(DefArg->getTypeLoc())) - return true; - - return false; -} - -bool CursorVisitor::VisitEnumConstantDecl(EnumConstantDecl *D) { - if (Expr *Init = D->getInitExpr()) - return Visit(MakeCXCursor(Init, StmtParent, TU)); - return false; -} - -bool CursorVisitor::VisitDeclaratorDecl(DeclaratorDecl *DD) { - if (TypeSourceInfo *TSInfo = DD->getTypeSourceInfo()) - if (Visit(TSInfo->getTypeLoc())) - return true; - - return false; -} - -bool CursorVisitor::VisitFunctionDecl(FunctionDecl *ND) { - if (TypeSourceInfo *TSInfo = ND->getTypeSourceInfo()) { - // Visit the function declaration's syntactic components in the order - // written. This requires a bit of work. - TypeLoc TL = TSInfo->getTypeLoc(); - FunctionTypeLoc *FTL = dyn_cast(&TL); - - // If we have a function declared directly (without the use of a typedef), - // visit just the return type. Otherwise, just visit the function's type - // now. - if ((FTL && !isa(ND) && Visit(FTL->getResultLoc())) || - (!FTL && Visit(TL))) - return true; - - // Visit the nested-name-specifier, if present. - if (NestedNameSpecifier *Qualifier = ND->getQualifier()) - if (VisitNestedNameSpecifier(Qualifier, ND->getQualifierRange())) - return true; - - // Visit the declaration name. - if (VisitDeclarationNameInfo(ND->getNameInfo())) - return true; - - // FIXME: Visit explicitly-specified template arguments! - - // Visit the function parameters, if we have a function type. - if (FTL && VisitFunctionTypeLoc(*FTL, true)) - return true; - - // FIXME: Attributes? - } - - if (ND->isThisDeclarationADefinition() && - Visit(MakeCXCursor(ND->getBody(), StmtParent, TU))) - return true; - - return false; -} - -bool CursorVisitor::VisitFieldDecl(FieldDecl *D) { - if (VisitDeclaratorDecl(D)) - return true; - - if (Expr *BitWidth = D->getBitWidth()) - return Visit(MakeCXCursor(BitWidth, StmtParent, TU)); - - return false; -} - -bool CursorVisitor::VisitVarDecl(VarDecl *D) { - if (VisitDeclaratorDecl(D)) - return true; - - if (Expr *Init = D->getInit()) - return Visit(MakeCXCursor(Init, StmtParent, TU)); - - return false; -} - -bool CursorVisitor::VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D) { - if (VisitDeclaratorDecl(D)) - return true; - - if (D->hasDefaultArgument() && !D->defaultArgumentWasInherited()) - if (Expr *DefArg = D->getDefaultArgument()) - return Visit(MakeCXCursor(DefArg, StmtParent, TU)); - - return false; -} - -bool CursorVisitor::VisitFunctionTemplateDecl(FunctionTemplateDecl *D) { - // FIXME: Visit the "outer" template parameter lists on the FunctionDecl - // before visiting these template parameters. - if (VisitTemplateParameters(D->getTemplateParameters())) - return true; - - return VisitFunctionDecl(D->getTemplatedDecl()); -} - -bool CursorVisitor::VisitClassTemplateDecl(ClassTemplateDecl *D) { - // FIXME: Visit the "outer" template parameter lists on the TagDecl - // before visiting these template parameters. - if (VisitTemplateParameters(D->getTemplateParameters())) - return true; - - return VisitCXXRecordDecl(D->getTemplatedDecl()); -} - -bool CursorVisitor::VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D) { - if (VisitTemplateParameters(D->getTemplateParameters())) - return true; - - if (D->hasDefaultArgument() && !D->defaultArgumentWasInherited() && - VisitTemplateArgumentLoc(D->getDefaultArgument())) - return true; - - return false; -} - -bool CursorVisitor::VisitObjCMethodDecl(ObjCMethodDecl *ND) { - if (TypeSourceInfo *TSInfo = ND->getResultTypeSourceInfo()) - if (Visit(TSInfo->getTypeLoc())) - return true; - - for (ObjCMethodDecl::param_iterator P = ND->param_begin(), - PEnd = ND->param_end(); - P != PEnd; ++P) { - if (Visit(MakeCXCursor(*P, TU))) - return true; - } - - if (ND->isThisDeclarationADefinition() && - Visit(MakeCXCursor(ND->getBody(), StmtParent, TU))) - return true; - - return false; -} - -bool CursorVisitor::VisitObjCContainerDecl(ObjCContainerDecl *D) { - return VisitDeclContext(D); -} - -bool CursorVisitor::VisitObjCCategoryDecl(ObjCCategoryDecl *ND) { - if (Visit(MakeCursorObjCClassRef(ND->getClassInterface(), ND->getLocation(), - TU))) - return true; - - ObjCCategoryDecl::protocol_loc_iterator PL = ND->protocol_loc_begin(); - for (ObjCCategoryDecl::protocol_iterator I = ND->protocol_begin(), - E = ND->protocol_end(); I != E; ++I, ++PL) - if (Visit(MakeCursorObjCProtocolRef(*I, *PL, TU))) - return true; - - return VisitObjCContainerDecl(ND); -} - -bool CursorVisitor::VisitObjCProtocolDecl(ObjCProtocolDecl *PID) { - ObjCProtocolDecl::protocol_loc_iterator PL = PID->protocol_loc_begin(); - for (ObjCProtocolDecl::protocol_iterator I = PID->protocol_begin(), - E = PID->protocol_end(); I != E; ++I, ++PL) - if (Visit(MakeCursorObjCProtocolRef(*I, *PL, TU))) - return true; - - return VisitObjCContainerDecl(PID); -} - -bool CursorVisitor::VisitObjCPropertyDecl(ObjCPropertyDecl *PD) { - if (Visit(PD->getTypeSourceInfo()->getTypeLoc())) - return true; - - // FIXME: This implements a workaround with @property declarations also being - // installed in the DeclContext for the @interface. Eventually this code - // should be removed. - ObjCCategoryDecl *CDecl = dyn_cast(PD->getDeclContext()); - if (!CDecl || !CDecl->IsClassExtension()) - return false; - - ObjCInterfaceDecl *ID = CDecl->getClassInterface(); - if (!ID) - return false; - - IdentifierInfo *PropertyId = PD->getIdentifier(); - ObjCPropertyDecl *prevDecl = - ObjCPropertyDecl::findPropertyDecl(cast(ID), PropertyId); - - if (!prevDecl) - return false; - - // Visit synthesized methods since they will be skipped when visiting - // the @interface. - if (ObjCMethodDecl *MD = prevDecl->getGetterMethodDecl()) - if (MD->isSynthesized()) - if (Visit(MakeCXCursor(MD, TU))) - return true; - - if (ObjCMethodDecl *MD = prevDecl->getSetterMethodDecl()) - if (MD->isSynthesized()) - if (Visit(MakeCXCursor(MD, TU))) - return true; - - return false; -} - -bool CursorVisitor::VisitObjCInterfaceDecl(ObjCInterfaceDecl *D) { - // Issue callbacks for super class. - if (D->getSuperClass() && - Visit(MakeCursorObjCSuperClassRef(D->getSuperClass(), - D->getSuperClassLoc(), - TU))) - return true; - - ObjCInterfaceDecl::protocol_loc_iterator PL = D->protocol_loc_begin(); - for (ObjCInterfaceDecl::protocol_iterator I = D->protocol_begin(), - E = D->protocol_end(); I != E; ++I, ++PL) - if (Visit(MakeCursorObjCProtocolRef(*I, *PL, TU))) - return true; - - return VisitObjCContainerDecl(D); -} - -bool CursorVisitor::VisitObjCImplDecl(ObjCImplDecl *D) { - return VisitObjCContainerDecl(D); -} - -bool CursorVisitor::VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D) { - // 'ID' could be null when dealing with invalid code. - if (ObjCInterfaceDecl *ID = D->getClassInterface()) - if (Visit(MakeCursorObjCClassRef(ID, D->getLocation(), TU))) - return true; - - return VisitObjCImplDecl(D); -} - -bool CursorVisitor::VisitObjCImplementationDecl(ObjCImplementationDecl *D) { -#if 0 - // Issue callbacks for super class. - // FIXME: No source location information! - if (D->getSuperClass() && - Visit(MakeCursorObjCSuperClassRef(D->getSuperClass(), - D->getSuperClassLoc(), - TU))) - return true; -#endif - - return VisitObjCImplDecl(D); -} - -bool CursorVisitor::VisitObjCForwardProtocolDecl(ObjCForwardProtocolDecl *D) { - ObjCForwardProtocolDecl::protocol_loc_iterator PL = D->protocol_loc_begin(); - for (ObjCForwardProtocolDecl::protocol_iterator I = D->protocol_begin(), - E = D->protocol_end(); - I != E; ++I, ++PL) - if (Visit(MakeCursorObjCProtocolRef(*I, *PL, TU))) - return true; - - return false; -} - -bool CursorVisitor::VisitObjCClassDecl(ObjCClassDecl *D) { - for (ObjCClassDecl::iterator C = D->begin(), CEnd = D->end(); C != CEnd; ++C) - if (Visit(MakeCursorObjCClassRef(C->getInterface(), C->getLocation(), TU))) - return true; - - return false; -} - -bool CursorVisitor::VisitNamespaceDecl(NamespaceDecl *D) { - return VisitDeclContext(D); -} - -bool CursorVisitor::VisitNamespaceAliasDecl(NamespaceAliasDecl *D) { - // Visit nested-name-specifier. - if (NestedNameSpecifier *Qualifier = D->getQualifier()) - if (VisitNestedNameSpecifier(Qualifier, D->getQualifierRange())) - return true; - - return Visit(MakeCursorNamespaceRef(D->getAliasedNamespace(), - D->getTargetNameLoc(), TU)); -} - -bool CursorVisitor::VisitUsingDecl(UsingDecl *D) { - // Visit nested-name-specifier. - if (NestedNameSpecifier *Qualifier = D->getTargetNestedNameDecl()) - if (VisitNestedNameSpecifier(Qualifier, D->getNestedNameRange())) - return true; - - // FIXME: Provide a multi-reference of some kind for all of the declarations - // that the using declaration refers to. We don't have this kind of cursor - // yet. - - return VisitDeclarationNameInfo(D->getNameInfo()); -} - -bool CursorVisitor::VisitUsingDirectiveDecl(UsingDirectiveDecl *D) { - // Visit nested-name-specifier. - if (NestedNameSpecifier *Qualifier = D->getQualifier()) - if (VisitNestedNameSpecifier(Qualifier, D->getQualifierRange())) - return true; - - return Visit(MakeCursorNamespaceRef(D->getNominatedNamespaceAsWritten(), - D->getIdentLocation(), TU)); -} - -bool CursorVisitor::VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D) { - // Visit nested-name-specifier. - if (NestedNameSpecifier *Qualifier = D->getTargetNestedNameSpecifier()) - if (VisitNestedNameSpecifier(Qualifier, D->getTargetNestedNameRange())) - return true; - - return VisitDeclarationNameInfo(D->getNameInfo()); -} - -bool CursorVisitor::VisitUnresolvedUsingTypenameDecl( - UnresolvedUsingTypenameDecl *D) { - // Visit nested-name-specifier. - if (NestedNameSpecifier *Qualifier = D->getTargetNestedNameSpecifier()) - if (VisitNestedNameSpecifier(Qualifier, D->getTargetNestedNameRange())) - return true; - - return false; -} - -bool CursorVisitor::VisitDeclarationNameInfo(DeclarationNameInfo Name) { - switch (Name.getName().getNameKind()) { - case clang::DeclarationName::Identifier: - case clang::DeclarationName::CXXLiteralOperatorName: - case clang::DeclarationName::CXXOperatorName: - case clang::DeclarationName::CXXUsingDirective: - return false; - - case clang::DeclarationName::CXXConstructorName: - case clang::DeclarationName::CXXDestructorName: - case clang::DeclarationName::CXXConversionFunctionName: - if (TypeSourceInfo *TSInfo = Name.getNamedTypeInfo()) - return Visit(TSInfo->getTypeLoc()); - return false; - - case clang::DeclarationName::ObjCZeroArgSelector: - case clang::DeclarationName::ObjCOneArgSelector: - case clang::DeclarationName::ObjCMultiArgSelector: - // FIXME: Per-identifier location info? - return false; - } - - return false; -} - -bool CursorVisitor::VisitNestedNameSpecifier(NestedNameSpecifier *NNS, - SourceRange Range) { - // FIXME: This whole routine is a hack to work around the lack of proper - // source information in nested-name-specifiers (PR5791). Since we do have - // a beginning source location, we can visit the first component of the - // nested-name-specifier, if it's a single-token component. - if (!NNS) - return false; - - // Get the first component in the nested-name-specifier. - while (NestedNameSpecifier *Prefix = NNS->getPrefix()) - NNS = Prefix; - - switch (NNS->getKind()) { - case NestedNameSpecifier::Namespace: - // FIXME: The token at this source location might actually have been a - // namespace alias, but we don't model that. Lame! - return Visit(MakeCursorNamespaceRef(NNS->getAsNamespace(), Range.getBegin(), - TU)); - - case NestedNameSpecifier::TypeSpec: { - // If the type has a form where we know that the beginning of the source - // range matches up with a reference cursor. Visit the appropriate reference - // cursor. - Type *T = NNS->getAsType(); - if (const TypedefType *Typedef = dyn_cast(T)) - return Visit(MakeCursorTypeRef(Typedef->getDecl(), Range.getBegin(), TU)); - if (const TagType *Tag = dyn_cast(T)) - return Visit(MakeCursorTypeRef(Tag->getDecl(), Range.getBegin(), TU)); - if (const TemplateSpecializationType *TST - = dyn_cast(T)) - return VisitTemplateName(TST->getTemplateName(), Range.getBegin()); - break; - } - - case NestedNameSpecifier::TypeSpecWithTemplate: - case NestedNameSpecifier::Global: - case NestedNameSpecifier::Identifier: - break; - } - - return false; -} - -bool CursorVisitor::VisitTemplateParameters( - const TemplateParameterList *Params) { - if (!Params) - return false; - - for (TemplateParameterList::const_iterator P = Params->begin(), - PEnd = Params->end(); - P != PEnd; ++P) { - if (Visit(MakeCXCursor(*P, TU))) - return true; - } - - return false; -} - -bool CursorVisitor::VisitTemplateName(TemplateName Name, SourceLocation Loc) { - switch (Name.getKind()) { - case TemplateName::Template: - return Visit(MakeCursorTemplateRef(Name.getAsTemplateDecl(), Loc, TU)); - - case TemplateName::OverloadedTemplate: - // FIXME: We need a way to return multiple lookup results in a single - // cursor. - return false; - - case TemplateName::DependentTemplate: - // FIXME: Visit nested-name-specifier. - return false; - - case TemplateName::QualifiedTemplate: - // FIXME: Visit nested-name-specifier. - return Visit(MakeCursorTemplateRef( - Name.getAsQualifiedTemplateName()->getDecl(), - Loc, TU)); - } - - return false; -} - -bool CursorVisitor::VisitTemplateArgumentLoc(const TemplateArgumentLoc &TAL) { - switch (TAL.getArgument().getKind()) { - case TemplateArgument::Null: - case TemplateArgument::Integral: - return false; - - case TemplateArgument::Pack: - // FIXME: Implement when variadic templates come along. - return false; - - case TemplateArgument::Type: - if (TypeSourceInfo *TSInfo = TAL.getTypeSourceInfo()) - return Visit(TSInfo->getTypeLoc()); - return false; - - case TemplateArgument::Declaration: - if (Expr *E = TAL.getSourceDeclExpression()) - return Visit(MakeCXCursor(E, StmtParent, TU)); - return false; - - case TemplateArgument::Expression: - if (Expr *E = TAL.getSourceExpression()) - return Visit(MakeCXCursor(E, StmtParent, TU)); - return false; - - case TemplateArgument::Template: - return VisitTemplateName(TAL.getArgument().getAsTemplate(), - TAL.getTemplateNameLoc()); - } - - return false; -} - -bool CursorVisitor::VisitLinkageSpecDecl(LinkageSpecDecl *D) { - return VisitDeclContext(D); -} - -bool CursorVisitor::VisitQualifiedTypeLoc(QualifiedTypeLoc TL) { - return Visit(TL.getUnqualifiedLoc()); -} - -bool CursorVisitor::VisitBuiltinTypeLoc(BuiltinTypeLoc TL) { - ASTContext &Context = TU->getASTContext(); - - // Some builtin types (such as Objective-C's "id", "sel", and - // "Class") have associated declarations. Create cursors for those. - QualType VisitType; - switch (TL.getType()->getAs()->getKind()) { - case BuiltinType::Void: - case BuiltinType::Bool: - case BuiltinType::Char_U: - case BuiltinType::UChar: - case BuiltinType::Char16: - case BuiltinType::Char32: - case BuiltinType::UShort: - case BuiltinType::UInt: - case BuiltinType::ULong: - case BuiltinType::ULongLong: - case BuiltinType::UInt128: - case BuiltinType::Char_S: - case BuiltinType::SChar: - case BuiltinType::WChar: - case BuiltinType::Short: - case BuiltinType::Int: - case BuiltinType::Long: - case BuiltinType::LongLong: - case BuiltinType::Int128: - case BuiltinType::Float: - case BuiltinType::Double: - case BuiltinType::LongDouble: - case BuiltinType::NullPtr: - case BuiltinType::Overload: - case BuiltinType::Dependent: - break; - - case BuiltinType::UndeducedAuto: // FIXME: Deserves a cursor? - break; - - case BuiltinType::ObjCId: - VisitType = Context.getObjCIdType(); - break; - - case BuiltinType::ObjCClass: - VisitType = Context.getObjCClassType(); - break; - - case BuiltinType::ObjCSel: - VisitType = Context.getObjCSelType(); - break; - } - - if (!VisitType.isNull()) { - if (const TypedefType *Typedef = VisitType->getAs()) - return Visit(MakeCursorTypeRef(Typedef->getDecl(), TL.getBuiltinLoc(), - TU)); - } - - return false; -} - -bool CursorVisitor::VisitTypedefTypeLoc(TypedefTypeLoc TL) { - return Visit(MakeCursorTypeRef(TL.getTypedefDecl(), TL.getNameLoc(), TU)); -} - -bool CursorVisitor::VisitUnresolvedUsingTypeLoc(UnresolvedUsingTypeLoc TL) { - return Visit(MakeCursorTypeRef(TL.getDecl(), TL.getNameLoc(), TU)); -} - -bool CursorVisitor::VisitTagTypeLoc(TagTypeLoc TL) { - return Visit(MakeCursorTypeRef(TL.getDecl(), TL.getNameLoc(), TU)); -} - -bool CursorVisitor::VisitTemplateTypeParmTypeLoc(TemplateTypeParmTypeLoc TL) { - // FIXME: We can't visit the template template parameter, but there's - // no context information with which we can match up the depth/index in the - // type to the appropriate - return false; -} - -bool CursorVisitor::VisitObjCInterfaceTypeLoc(ObjCInterfaceTypeLoc TL) { - if (Visit(MakeCursorObjCClassRef(TL.getIFaceDecl(), TL.getNameLoc(), TU))) - return true; - - return false; -} - -bool CursorVisitor::VisitObjCObjectTypeLoc(ObjCObjectTypeLoc TL) { - if (TL.hasBaseTypeAsWritten() && Visit(TL.getBaseLoc())) - return true; - - for (unsigned I = 0, N = TL.getNumProtocols(); I != N; ++I) { - if (Visit(MakeCursorObjCProtocolRef(TL.getProtocol(I), TL.getProtocolLoc(I), - TU))) - return true; - } - - return false; -} - -bool CursorVisitor::VisitObjCObjectPointerTypeLoc(ObjCObjectPointerTypeLoc TL) { - return Visit(TL.getPointeeLoc()); -} - -bool CursorVisitor::VisitPointerTypeLoc(PointerTypeLoc TL) { - return Visit(TL.getPointeeLoc()); -} - -bool CursorVisitor::VisitBlockPointerTypeLoc(BlockPointerTypeLoc TL) { - return Visit(TL.getPointeeLoc()); -} - -bool CursorVisitor::VisitMemberPointerTypeLoc(MemberPointerTypeLoc TL) { - return Visit(TL.getPointeeLoc()); -} - -bool CursorVisitor::VisitLValueReferenceTypeLoc(LValueReferenceTypeLoc TL) { - return Visit(TL.getPointeeLoc()); -} - -bool CursorVisitor::VisitRValueReferenceTypeLoc(RValueReferenceTypeLoc TL) { - return Visit(TL.getPointeeLoc()); -} - -bool CursorVisitor::VisitFunctionTypeLoc(FunctionTypeLoc TL, - bool SkipResultType) { - if (!SkipResultType && Visit(TL.getResultLoc())) - return true; - - for (unsigned I = 0, N = TL.getNumArgs(); I != N; ++I) - if (Decl *D = TL.getArg(I)) - if (Visit(MakeCXCursor(D, TU))) - return true; - - return false; -} - -bool CursorVisitor::VisitArrayTypeLoc(ArrayTypeLoc TL) { - if (Visit(TL.getElementLoc())) - return true; - - if (Expr *Size = TL.getSizeExpr()) - return Visit(MakeCXCursor(Size, StmtParent, TU)); - - return false; -} - -bool CursorVisitor::VisitTemplateSpecializationTypeLoc( - TemplateSpecializationTypeLoc TL) { - // Visit the template name. - if (VisitTemplateName(TL.getTypePtr()->getTemplateName(), - TL.getTemplateNameLoc())) - return true; - - // Visit the template arguments. - for (unsigned I = 0, N = TL.getNumArgs(); I != N; ++I) - if (VisitTemplateArgumentLoc(TL.getArgLoc(I))) - return true; - - return false; -} - -bool CursorVisitor::VisitTypeOfExprTypeLoc(TypeOfExprTypeLoc TL) { - return Visit(MakeCXCursor(TL.getUnderlyingExpr(), StmtParent, TU)); -} - -bool CursorVisitor::VisitTypeOfTypeLoc(TypeOfTypeLoc TL) { - if (TypeSourceInfo *TSInfo = TL.getUnderlyingTInfo()) - return Visit(TSInfo->getTypeLoc()); - - return false; -} - -bool CursorVisitor::VisitStmt(Stmt *S) { - for (Stmt::child_iterator Child = S->child_begin(), ChildEnd = S->child_end(); - Child != ChildEnd; ++Child) { - if (Stmt *C = *Child) - if (Visit(MakeCXCursor(C, StmtParent, TU))) - return true; - } - - return false; -} - -bool CursorVisitor::VisitCaseStmt(CaseStmt *S) { - // Specially handle CaseStmts because they can be nested, e.g.: - // - // case 1: - // case 2: - // - // In this case the second CaseStmt is the child of the first. Walking - // these recursively can blow out the stack. - CXCursor Cursor = MakeCXCursor(S, StmtParent, TU); - while (true) { - // Set the Parent field to Cursor, then back to its old value once we're - // done. - SetParentRAII SetParent(Parent, StmtParent, Cursor); - - if (Stmt *LHS = S->getLHS()) - if (Visit(MakeCXCursor(LHS, StmtParent, TU))) - return true; - if (Stmt *RHS = S->getRHS()) - if (Visit(MakeCXCursor(RHS, StmtParent, TU))) - return true; - if (Stmt *SubStmt = S->getSubStmt()) { - if (!isa(SubStmt)) - return Visit(MakeCXCursor(SubStmt, StmtParent, TU)); - - // Specially handle 'CaseStmt' so that we don't blow out the stack. - CaseStmt *CS = cast(SubStmt); - Cursor = MakeCXCursor(CS, StmtParent, TU); - if (RegionOfInterest.isValid()) { - SourceRange Range = CS->getSourceRange(); - if (Range.isInvalid() || CompareRegionOfInterest(Range)) - return false; - } - - switch (Visitor(Cursor, Parent, ClientData)) { - case CXChildVisit_Break: return true; - case CXChildVisit_Continue: return false; - case CXChildVisit_Recurse: - // Perform tail-recursion manually. - S = CS; - continue; - } - } - return false; - } -} - -bool CursorVisitor::VisitDeclStmt(DeclStmt *S) { - for (DeclStmt::decl_iterator D = S->decl_begin(), DEnd = S->decl_end(); - D != DEnd; ++D) { - if (*D && Visit(MakeCXCursor(*D, TU))) - return true; - } - - return false; -} - -bool CursorVisitor::VisitIfStmt(IfStmt *S) { - if (VarDecl *Var = S->getConditionVariable()) { - if (Visit(MakeCXCursor(Var, TU))) - return true; - } - - if (S->getCond() && Visit(MakeCXCursor(S->getCond(), StmtParent, TU))) - return true; - if (S->getThen() && Visit(MakeCXCursor(S->getThen(), StmtParent, TU))) - return true; - if (S->getElse() && Visit(MakeCXCursor(S->getElse(), StmtParent, TU))) - return true; - - return false; -} - -bool CursorVisitor::VisitSwitchStmt(SwitchStmt *S) { - if (VarDecl *Var = S->getConditionVariable()) { - if (Visit(MakeCXCursor(Var, TU))) - return true; - } - - if (S->getCond() && Visit(MakeCXCursor(S->getCond(), StmtParent, TU))) - return true; - if (S->getBody() && Visit(MakeCXCursor(S->getBody(), StmtParent, TU))) - return true; - - return false; -} - -bool CursorVisitor::VisitWhileStmt(WhileStmt *S) { - if (VarDecl *Var = S->getConditionVariable()) { - if (Visit(MakeCXCursor(Var, TU))) - return true; - } - - if (S->getCond() && Visit(MakeCXCursor(S->getCond(), StmtParent, TU))) - return true; - if (S->getBody() && Visit(MakeCXCursor(S->getBody(), StmtParent, TU))) - return true; - - return false; -} - -bool CursorVisitor::VisitForStmt(ForStmt *S) { - if (S->getInit() && Visit(MakeCXCursor(S->getInit(), StmtParent, TU))) - return true; - if (VarDecl *Var = S->getConditionVariable()) { - if (Visit(MakeCXCursor(Var, TU))) - return true; - } - - if (S->getCond() && Visit(MakeCXCursor(S->getCond(), StmtParent, TU))) - return true; - if (S->getInc() && Visit(MakeCXCursor(S->getInc(), StmtParent, TU))) - return true; - if (S->getBody() && Visit(MakeCXCursor(S->getBody(), StmtParent, TU))) - return true; - - return false; -} - -bool CursorVisitor::VisitDeclRefExpr(DeclRefExpr *E) { - // Visit nested-name-specifier, if present. - if (NestedNameSpecifier *Qualifier = E->getQualifier()) - if (VisitNestedNameSpecifier(Qualifier, E->getQualifierRange())) - return true; - - // Visit declaration name. - if (VisitDeclarationNameInfo(E->getNameInfo())) - return true; - - // Visit explicitly-specified template arguments. - if (E->hasExplicitTemplateArgs()) { - ExplicitTemplateArgumentList &Args = E->getExplicitTemplateArgs(); - for (TemplateArgumentLoc *Arg = Args.getTemplateArgs(), - *ArgEnd = Arg + Args.NumTemplateArgs; - Arg != ArgEnd; ++Arg) - if (VisitTemplateArgumentLoc(*Arg)) - return true; - } - - return false; -} - -bool CursorVisitor::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) { - if (Visit(MakeCXCursor(E->getArg(0), StmtParent, TU))) - return true; - - if (Visit(MakeCXCursor(E->getCallee(), StmtParent, TU))) - return true; - - for (unsigned I = 1, N = E->getNumArgs(); I != N; ++I) - if (Visit(MakeCXCursor(E->getArg(I), StmtParent, TU))) - return true; - - return false; -} - -bool CursorVisitor::VisitCXXRecordDecl(CXXRecordDecl *D) { - if (D->isDefinition()) { - for (CXXRecordDecl::base_class_iterator I = D->bases_begin(), - E = D->bases_end(); I != E; ++I) { - if (Visit(cxcursor::MakeCursorCXXBaseSpecifier(I, TU))) - return true; - } - } - - return VisitTagDecl(D); -} - - -bool CursorVisitor::VisitBlockExpr(BlockExpr *B) { - return Visit(B->getBlockDecl()); -} - -bool CursorVisitor::VisitOffsetOfExpr(OffsetOfExpr *E) { - // FIXME: Visit fields as well? - if (Visit(E->getTypeSourceInfo()->getTypeLoc())) - return true; - - return VisitExpr(E); -} - -bool CursorVisitor::VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *E) { - if (E->isArgumentType()) { - if (TypeSourceInfo *TSInfo = E->getArgumentTypeInfo()) - return Visit(TSInfo->getTypeLoc()); - - return false; - } - - return VisitExpr(E); -} - -bool CursorVisitor::VisitMemberExpr(MemberExpr *E) { - // Visit the base expression. - if (Visit(MakeCXCursor(E->getBase(), StmtParent, TU))) - return true; - - // Visit the nested-name-specifier - if (NestedNameSpecifier *Qualifier = E->getQualifier()) - if (VisitNestedNameSpecifier(Qualifier, E->getQualifierRange())) - return true; - - // Visit the declaration name. - if (VisitDeclarationNameInfo(E->getMemberNameInfo())) - return true; - - // Visit the explicitly-specified template arguments, if any. - if (E->hasExplicitTemplateArgs()) { - for (const TemplateArgumentLoc *Arg = E->getTemplateArgs(), - *ArgEnd = Arg + E->getNumTemplateArgs(); - Arg != ArgEnd; - ++Arg) { - if (VisitTemplateArgumentLoc(*Arg)) - return true; - } - } - - return false; -} - -bool CursorVisitor::VisitExplicitCastExpr(ExplicitCastExpr *E) { - if (TypeSourceInfo *TSInfo = E->getTypeInfoAsWritten()) - if (Visit(TSInfo->getTypeLoc())) - return true; - - return VisitCastExpr(E); -} - -bool CursorVisitor::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) { - if (TypeSourceInfo *TSInfo = E->getTypeSourceInfo()) - if (Visit(TSInfo->getTypeLoc())) - return true; - - return VisitExpr(E); -} - -bool CursorVisitor::VisitTypesCompatibleExpr(TypesCompatibleExpr *E) { - return Visit(E->getArgTInfo1()->getTypeLoc()) || - Visit(E->getArgTInfo2()->getTypeLoc()); -} - -bool CursorVisitor::VisitVAArgExpr(VAArgExpr *E) { - if (Visit(E->getWrittenTypeInfo()->getTypeLoc())) - return true; - - return Visit(MakeCXCursor(E->getSubExpr(), StmtParent, TU)); -} - -bool CursorVisitor::VisitCXXTypeidExpr(CXXTypeidExpr *E) { - if (E->isTypeOperand()) { - if (TypeSourceInfo *TSInfo = E->getTypeOperandSourceInfo()) - return Visit(TSInfo->getTypeLoc()); - - return false; - } - - return VisitExpr(E); -} - -bool CursorVisitor::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) { - // Visit base expression. - if (Visit(MakeCXCursor(E->getBase(), StmtParent, TU))) - return true; - - // Visit the nested-name-specifier. - if (NestedNameSpecifier *Qualifier = E->getQualifier()) - if (VisitNestedNameSpecifier(Qualifier, E->getQualifierRange())) - return true; - - // Visit the scope type that looks disturbingly like the nested-name-specifier - // but isn't. - if (TypeSourceInfo *TSInfo = E->getScopeTypeInfo()) - if (Visit(TSInfo->getTypeLoc())) - return true; - - // Visit the name of the type being destroyed. - if (TypeSourceInfo *TSInfo = E->getDestroyedTypeInfo()) - if (Visit(TSInfo->getTypeLoc())) - return true; - - return false; -} - -bool CursorVisitor::VisitOverloadExpr(OverloadExpr *E) { - // Visit the nested-name-specifier. - if (NestedNameSpecifier *Qualifier = E->getQualifier()) - if (VisitNestedNameSpecifier(Qualifier, E->getQualifierRange())) - return true; - - // Visit the declaration name. - if (VisitDeclarationNameInfo(E->getNameInfo())) - return true; - - // Visit the explicitly-specified template arguments. - if (const ExplicitTemplateArgumentList *ArgList - = E->getOptionalExplicitTemplateArgs()) { - for (const TemplateArgumentLoc *Arg = ArgList->getTemplateArgs(), - *ArgEnd = Arg + ArgList->NumTemplateArgs; - Arg != ArgEnd; ++Arg) { - if (VisitTemplateArgumentLoc(*Arg)) - return true; - } - } - - // FIXME: We don't have a way to visit all of the declarations referenced - // here. - return false; -} - -bool CursorVisitor::VisitDependentScopeDeclRefExpr( - DependentScopeDeclRefExpr *E) { - // Visit the nested-name-specifier. - if (NestedNameSpecifier *Qualifier = E->getQualifier()) - if (VisitNestedNameSpecifier(Qualifier, E->getQualifierRange())) - return true; - - // Visit the declaration name. - if (VisitDeclarationNameInfo(E->getNameInfo())) - return true; - - // Visit the explicitly-specified template arguments. - if (const ExplicitTemplateArgumentList *ArgList - = E->getOptionalExplicitTemplateArgs()) { - for (const TemplateArgumentLoc *Arg = ArgList->getTemplateArgs(), - *ArgEnd = Arg + ArgList->NumTemplateArgs; - Arg != ArgEnd; ++Arg) { - if (VisitTemplateArgumentLoc(*Arg)) - return true; - } - } - - return false; -} - -bool CursorVisitor::VisitCXXDependentScopeMemberExpr( - CXXDependentScopeMemberExpr *E) { - // Visit the base expression, if there is one. - if (!E->isImplicitAccess() && - Visit(MakeCXCursor(E->getBase(), StmtParent, TU))) - return true; - - // Visit the nested-name-specifier. - if (NestedNameSpecifier *Qualifier = E->getQualifier()) - if (VisitNestedNameSpecifier(Qualifier, E->getQualifierRange())) - return true; - - // Visit the declaration name. - if (VisitDeclarationNameInfo(E->getMemberNameInfo())) - return true; - - // Visit the explicitly-specified template arguments. - if (const ExplicitTemplateArgumentList *ArgList - = E->getOptionalExplicitTemplateArgs()) { - for (const TemplateArgumentLoc *Arg = ArgList->getTemplateArgs(), - *ArgEnd = Arg + ArgList->NumTemplateArgs; - Arg != ArgEnd; ++Arg) { - if (VisitTemplateArgumentLoc(*Arg)) - return true; - } - } - - return false; -} - -bool CursorVisitor::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *E) { - // Visit the base expression, if there is one. - if (!E->isImplicitAccess() && - Visit(MakeCXCursor(E->getBase(), StmtParent, TU))) - return true; - - return VisitOverloadExpr(E); -} - -bool CursorVisitor::VisitObjCMessageExpr(ObjCMessageExpr *E) { - if (TypeSourceInfo *TSInfo = E->getClassReceiverTypeInfo()) - if (Visit(TSInfo->getTypeLoc())) - return true; - - return VisitExpr(E); -} - -bool CursorVisitor::VisitObjCEncodeExpr(ObjCEncodeExpr *E) { - return Visit(E->getEncodedTypeSourceInfo()->getTypeLoc()); -} - - -bool CursorVisitor::VisitAttributes(Decl *D) { - for (AttrVec::const_iterator i = D->attr_begin(), e = D->attr_end(); - i != e; ++i) - if (Visit(MakeCXCursor(*i, D, TU))) - return true; - - return false; -} - -extern "C" { -CXIndex clang_createIndex(int excludeDeclarationsFromPCH, - int displayDiagnostics) { - // We use crash recovery to make some of our APIs more reliable, implicitly - // enable it. - llvm::CrashRecoveryContext::Enable(); - - CIndexer *CIdxr = new CIndexer(); - if (excludeDeclarationsFromPCH) - CIdxr->setOnlyLocalDecls(); - if (displayDiagnostics) - CIdxr->setDisplayDiagnostics(); - return CIdxr; -} - -void clang_disposeIndex(CXIndex CIdx) { - if (CIdx) - delete static_cast(CIdx); - if (getenv("LIBCLANG_TIMING")) - llvm::TimerGroup::printAll(llvm::errs()); -} - -void clang_setUseExternalASTGeneration(CXIndex CIdx, int value) { - if (CIdx) { - CIndexer *CXXIdx = static_cast(CIdx); - CXXIdx->setUseExternalASTGeneration(value); - } -} - -CXTranslationUnit clang_createTranslationUnit(CXIndex CIdx, - const char *ast_filename) { - if (!CIdx) - return 0; - - CIndexer *CXXIdx = static_cast(CIdx); - - llvm::IntrusiveRefCntPtr Diags; - return ASTUnit::LoadFromASTFile(ast_filename, Diags, - CXXIdx->getOnlyLocalDecls(), - 0, 0, true); -} - -unsigned clang_defaultEditingTranslationUnitOptions() { - return CXTranslationUnit_PrecompiledPreamble; -} - -CXTranslationUnit -clang_createTranslationUnitFromSourceFile(CXIndex CIdx, - const char *source_filename, - int num_command_line_args, - const char * const *command_line_args, - unsigned num_unsaved_files, - struct CXUnsavedFile *unsaved_files) { - return clang_parseTranslationUnit(CIdx, source_filename, - command_line_args, num_command_line_args, - unsaved_files, num_unsaved_files, - CXTranslationUnit_DetailedPreprocessingRecord); -} - -struct ParseTranslationUnitInfo { - CXIndex CIdx; - const char *source_filename; - const char *const *command_line_args; - int num_command_line_args; - struct CXUnsavedFile *unsaved_files; - unsigned num_unsaved_files; - unsigned options; - CXTranslationUnit result; -}; -static void clang_parseTranslationUnit_Impl(void *UserData) { - ParseTranslationUnitInfo *PTUI = - static_cast(UserData); - CXIndex CIdx = PTUI->CIdx; - const char *source_filename = PTUI->source_filename; - const char * const *command_line_args = PTUI->command_line_args; - int num_command_line_args = PTUI->num_command_line_args; - struct CXUnsavedFile *unsaved_files = PTUI->unsaved_files; - unsigned num_unsaved_files = PTUI->num_unsaved_files; - unsigned options = PTUI->options; - PTUI->result = 0; - - if (!CIdx) - return; - - CIndexer *CXXIdx = static_cast(CIdx); - - bool PrecompilePreamble = options & CXTranslationUnit_PrecompiledPreamble; - bool CompleteTranslationUnit - = ((options & CXTranslationUnit_Incomplete) == 0); - bool CacheCodeCompetionResults - = options & CXTranslationUnit_CacheCompletionResults; - - // Configure the diagnostics. - DiagnosticOptions DiagOpts; - llvm::IntrusiveRefCntPtr Diags; - Diags = CompilerInstance::createDiagnostics(DiagOpts, 0, 0); - - llvm::SmallVector RemappedFiles; - for (unsigned I = 0; I != num_unsaved_files; ++I) { - llvm::StringRef Data(unsaved_files[I].Contents, unsaved_files[I].Length); - const llvm::MemoryBuffer *Buffer - = llvm::MemoryBuffer::getMemBufferCopy(Data, unsaved_files[I].Filename); - RemappedFiles.push_back(std::make_pair(unsaved_files[I].Filename, - Buffer)); - } - - if (!CXXIdx->getUseExternalASTGeneration()) { - llvm::SmallVector Args; - - // The 'source_filename' argument is optional. If the caller does not - // specify it then it is assumed that the source file is specified - // in the actual argument list. - if (source_filename) - Args.push_back(source_filename); - - // Since the Clang C library is primarily used by batch tools dealing with - // (often very broken) source code, where spell-checking can have a - // significant negative impact on performance (particularly when - // precompiled headers are involved), we disable it by default. - // Note that we place this argument early in the list, so that it can be - // overridden by the caller with "-fspell-checking". - Args.push_back("-fno-spell-checking"); - - Args.insert(Args.end(), command_line_args, - command_line_args + num_command_line_args); - - // Do we need the detailed preprocessing record? - if (options & CXTranslationUnit_DetailedPreprocessingRecord) { - Args.push_back("-Xclang"); - Args.push_back("-detailed-preprocessing-record"); - } - - unsigned NumErrors = Diags->getNumErrors(); - -#ifdef USE_CRASHTRACER - ArgsCrashTracerInfo ACTI(Args); -#endif - - llvm::OwningPtr Unit( - ASTUnit::LoadFromCommandLine(Args.data(), Args.data() + Args.size(), - Diags, - CXXIdx->getClangResourcesPath(), - CXXIdx->getOnlyLocalDecls(), - RemappedFiles.data(), - RemappedFiles.size(), - /*CaptureDiagnostics=*/true, - PrecompilePreamble, - CompleteTranslationUnit, - CacheCodeCompetionResults)); - - if (NumErrors != Diags->getNumErrors()) { - // Make sure to check that 'Unit' is non-NULL. - if (CXXIdx->getDisplayDiagnostics() && Unit.get()) { - for (ASTUnit::stored_diag_iterator D = Unit->stored_diag_begin(), - DEnd = Unit->stored_diag_end(); - D != DEnd; ++D) { - CXStoredDiagnostic Diag(*D, Unit->getASTContext().getLangOptions()); - CXString Msg = clang_formatDiagnostic(&Diag, - clang_defaultDiagnosticDisplayOptions()); - fprintf(stderr, "%s\n", clang_getCString(Msg)); - clang_disposeString(Msg); - } -#ifdef LLVM_ON_WIN32 - // On Windows, force a flush, since there may be multiple copies of - // stderr and stdout in the file system, all with different buffers - // but writing to the same device. - fflush(stderr); -#endif - } - } - - PTUI->result = Unit.take(); - return; - } - - // Build up the arguments for invoking 'clang'. - std::vector argv; - - // First add the complete path to the 'clang' executable. - llvm::sys::Path ClangPath = static_cast(CIdx)->getClangPath(); - argv.push_back(ClangPath.c_str()); - - // Add the '-emit-ast' option as our execution mode for 'clang'. - argv.push_back("-emit-ast"); - - // The 'source_filename' argument is optional. If the caller does not - // specify it then it is assumed that the source file is specified - // in the actual argument list. - if (source_filename) - argv.push_back(source_filename); - - // Generate a temporary name for the AST file. - argv.push_back("-o"); - char astTmpFile[L_tmpnam]; - argv.push_back(tmpnam(astTmpFile)); - - // Since the Clang C library is primarily used by batch tools dealing with - // (often very broken) source code, where spell-checking can have a - // significant negative impact on performance (particularly when - // precompiled headers are involved), we disable it by default. - // Note that we place this argument early in the list, so that it can be - // overridden by the caller with "-fspell-checking". - argv.push_back("-fno-spell-checking"); - - // Remap any unsaved files to temporary files. - std::vector TemporaryFiles; - std::vector RemapArgs; - if (RemapFiles(num_unsaved_files, unsaved_files, RemapArgs, TemporaryFiles)) - return; - - // The pointers into the elements of RemapArgs are stable because we - // won't be adding anything to RemapArgs after this point. - for (unsigned i = 0, e = RemapArgs.size(); i != e; ++i) - argv.push_back(RemapArgs[i].c_str()); - - // Process the compiler options, stripping off '-o', '-c', '-fsyntax-only'. - for (int i = 0; i < num_command_line_args; ++i) - if (const char *arg = command_line_args[i]) { - if (strcmp(arg, "-o") == 0) { - ++i; // Also skip the matching argument. - continue; - } - if (strcmp(arg, "-emit-ast") == 0 || - strcmp(arg, "-c") == 0 || - strcmp(arg, "-fsyntax-only") == 0) { - continue; - } - - // Keep the argument. - argv.push_back(arg); - } - - // Generate a temporary name for the diagnostics file. - char tmpFileResults[L_tmpnam]; - char *tmpResultsFileName = tmpnam(tmpFileResults); - llvm::sys::Path DiagnosticsFile(tmpResultsFileName); - TemporaryFiles.push_back(DiagnosticsFile); - argv.push_back("-fdiagnostics-binary"); - - // Do we need the detailed preprocessing record? - if (options & CXTranslationUnit_DetailedPreprocessingRecord) { - argv.push_back("-Xclang"); - argv.push_back("-detailed-preprocessing-record"); - } - - // Add the null terminator. - argv.push_back(NULL); - - // Invoke 'clang'. - llvm::sys::Path DevNull; // leave empty, causes redirection to /dev/null - // on Unix or NUL (Windows). - std::string ErrMsg; - const llvm::sys::Path *Redirects[] = { &DevNull, &DevNull, &DiagnosticsFile, - NULL }; - llvm::sys::Program::ExecuteAndWait(ClangPath, &argv[0], /* env */ NULL, - /* redirects */ &Redirects[0], - /* secondsToWait */ 0, /* memoryLimits */ 0, &ErrMsg); - - if (!ErrMsg.empty()) { - std::string AllArgs; - for (std::vector::iterator I = argv.begin(), E = argv.end(); - I != E; ++I) { - AllArgs += ' '; - if (*I) - AllArgs += *I; - } - - Diags->Report(diag::err_fe_invoking) << AllArgs << ErrMsg; - } - - ASTUnit *ATU = ASTUnit::LoadFromASTFile(astTmpFile, Diags, - CXXIdx->getOnlyLocalDecls(), - RemappedFiles.data(), - RemappedFiles.size(), - /*CaptureDiagnostics=*/true); - if (ATU) { - LoadSerializedDiagnostics(DiagnosticsFile, - num_unsaved_files, unsaved_files, - ATU->getFileManager(), - ATU->getSourceManager(), - ATU->getStoredDiagnostics()); - } else if (CXXIdx->getDisplayDiagnostics()) { - // We failed to load the ASTUnit, but we can still deserialize the - // diagnostics and emit them. - FileManager FileMgr; - Diagnostic Diag; - SourceManager SourceMgr(Diag); - // FIXME: Faked LangOpts! - LangOptions LangOpts; - llvm::SmallVector Diags; - LoadSerializedDiagnostics(DiagnosticsFile, - num_unsaved_files, unsaved_files, - FileMgr, SourceMgr, Diags); - for (llvm::SmallVector::iterator D = Diags.begin(), - DEnd = Diags.end(); - D != DEnd; ++D) { - CXStoredDiagnostic Diag(*D, LangOpts); - CXString Msg = clang_formatDiagnostic(&Diag, - clang_defaultDiagnosticDisplayOptions()); - fprintf(stderr, "%s\n", clang_getCString(Msg)); - clang_disposeString(Msg); - } - -#ifdef LLVM_ON_WIN32 - // On Windows, force a flush, since there may be multiple copies of - // stderr and stdout in the file system, all with different buffers - // but writing to the same device. - fflush(stderr); -#endif - } - - if (ATU) { - // Make the translation unit responsible for destroying all temporary files. - for (unsigned i = 0, e = TemporaryFiles.size(); i != e; ++i) - ATU->addTemporaryFile(TemporaryFiles[i]); - ATU->addTemporaryFile(llvm::sys::Path(ATU->getASTFileName())); - } else { - // Destroy all of the temporary files now; they can't be referenced any - // longer. - llvm::sys::Path(astTmpFile).eraseFromDisk(); - for (unsigned i = 0, e = TemporaryFiles.size(); i != e; ++i) - TemporaryFiles[i].eraseFromDisk(); - } - - PTUI->result = ATU; -} -CXTranslationUnit clang_parseTranslationUnit(CXIndex CIdx, - const char *source_filename, - const char * const *command_line_args, - int num_command_line_args, - struct CXUnsavedFile *unsaved_files, - unsigned num_unsaved_files, - unsigned options) { - ParseTranslationUnitInfo PTUI = { CIdx, source_filename, command_line_args, - num_command_line_args, unsaved_files, num_unsaved_files, - options, 0 }; - llvm::CrashRecoveryContext CRC; - - if (!CRC.RunSafely(clang_parseTranslationUnit_Impl, &PTUI)) { - fprintf(stderr, "libclang: crash detected during parsing: {\n"); - fprintf(stderr, " 'source_filename' : '%s'\n", source_filename); - fprintf(stderr, " 'command_line_args' : ["); - for (int i = 0; i != num_command_line_args; ++i) { - if (i) - fprintf(stderr, ", "); - fprintf(stderr, "'%s'", command_line_args[i]); - } - fprintf(stderr, "],\n"); - fprintf(stderr, " 'unsaved_files' : ["); - for (unsigned i = 0; i != num_unsaved_files; ++i) { - if (i) - fprintf(stderr, ", "); - fprintf(stderr, "('%s', '...', %ld)", unsaved_files[i].Filename, - unsaved_files[i].Length); - } - fprintf(stderr, "],\n"); - fprintf(stderr, " 'options' : %d,\n", options); - fprintf(stderr, "}\n"); - - return 0; - } - - return PTUI.result; -} - -unsigned clang_defaultSaveOptions(CXTranslationUnit TU) { - return CXSaveTranslationUnit_None; -} - -int clang_saveTranslationUnit(CXTranslationUnit TU, const char *FileName, - unsigned options) { - if (!TU) - return 1; - - return static_cast(TU)->Save(FileName); -} - -void clang_disposeTranslationUnit(CXTranslationUnit CTUnit) { - if (CTUnit) { - // If the translation unit has been marked as unsafe to free, just discard - // it. - if (static_cast(CTUnit)->isUnsafeToFree()) - return; - - delete static_cast(CTUnit); - } -} - -unsigned clang_defaultReparseOptions(CXTranslationUnit TU) { - return CXReparse_None; -} - -struct ReparseTranslationUnitInfo { - CXTranslationUnit TU; - unsigned num_unsaved_files; - struct CXUnsavedFile *unsaved_files; - unsigned options; - int result; -}; -static void clang_reparseTranslationUnit_Impl(void *UserData) { - ReparseTranslationUnitInfo *RTUI = - static_cast(UserData); - CXTranslationUnit TU = RTUI->TU; - unsigned num_unsaved_files = RTUI->num_unsaved_files; - struct CXUnsavedFile *unsaved_files = RTUI->unsaved_files; - unsigned options = RTUI->options; - (void) options; - RTUI->result = 1; - - if (!TU) - return; - - llvm::SmallVector RemappedFiles; - for (unsigned I = 0; I != num_unsaved_files; ++I) { - llvm::StringRef Data(unsaved_files[I].Contents, unsaved_files[I].Length); - const llvm::MemoryBuffer *Buffer - = llvm::MemoryBuffer::getMemBufferCopy(Data, unsaved_files[I].Filename); - RemappedFiles.push_back(std::make_pair(unsaved_files[I].Filename, - Buffer)); - } - - if (!static_cast(TU)->Reparse(RemappedFiles.data(), - RemappedFiles.size())) - RTUI->result = 0; -} -int clang_reparseTranslationUnit(CXTranslationUnit TU, - unsigned num_unsaved_files, - struct CXUnsavedFile *unsaved_files, - unsigned options) { - ReparseTranslationUnitInfo RTUI = { TU, num_unsaved_files, unsaved_files, - options, 0 }; - llvm::CrashRecoveryContext CRC; - - if (!CRC.RunSafely(clang_reparseTranslationUnit_Impl, &RTUI)) { - fprintf(stderr, "libclang: crash detected during reparsing\n"); - static_cast(TU)->setUnsafeToFree(true); - return 1; - } - - return RTUI.result; -} - - -CXString clang_getTranslationUnitSpelling(CXTranslationUnit CTUnit) { - if (!CTUnit) - return createCXString(""); - - ASTUnit *CXXUnit = static_cast(CTUnit); - return createCXString(CXXUnit->getOriginalSourceFileName(), true); -} - -CXCursor clang_getTranslationUnitCursor(CXTranslationUnit TU) { - CXCursor Result = { CXCursor_TranslationUnit, { 0, 0, TU } }; - return Result; -} - -} // end: extern "C" - -//===----------------------------------------------------------------------===// -// CXSourceLocation and CXSourceRange Operations. -//===----------------------------------------------------------------------===// - -extern "C" { -CXSourceLocation clang_getNullLocation() { - CXSourceLocation Result = { { 0, 0 }, 0 }; - return Result; -} - -unsigned clang_equalLocations(CXSourceLocation loc1, CXSourceLocation loc2) { - return (loc1.ptr_data[0] == loc2.ptr_data[0] && - loc1.ptr_data[1] == loc2.ptr_data[1] && - loc1.int_data == loc2.int_data); -} - -CXSourceLocation clang_getLocation(CXTranslationUnit tu, - CXFile file, - unsigned line, - unsigned column) { - if (!tu || !file) - return clang_getNullLocation(); - - ASTUnit *CXXUnit = static_cast(tu); - SourceLocation SLoc - = CXXUnit->getSourceManager().getLocation( - static_cast(file), - line, column); - - return cxloc::translateSourceLocation(CXXUnit->getASTContext(), SLoc); -} - -CXSourceRange clang_getNullRange() { - CXSourceRange Result = { { 0, 0 }, 0, 0 }; - return Result; -} - -CXSourceRange clang_getRange(CXSourceLocation begin, CXSourceLocation end) { - if (begin.ptr_data[0] != end.ptr_data[0] || - begin.ptr_data[1] != end.ptr_data[1]) - return clang_getNullRange(); - - CXSourceRange Result = { { begin.ptr_data[0], begin.ptr_data[1] }, - begin.int_data, end.int_data }; - return Result; -} - -void clang_getInstantiationLocation(CXSourceLocation location, - CXFile *file, - unsigned *line, - unsigned *column, - unsigned *offset) { - SourceLocation Loc = SourceLocation::getFromRawEncoding(location.int_data); - - if (!location.ptr_data[0] || Loc.isInvalid()) { - if (file) - *file = 0; - if (line) - *line = 0; - if (column) - *column = 0; - if (offset) - *offset = 0; - return; - } - - const SourceManager &SM = - *static_cast(location.ptr_data[0]); - SourceLocation InstLoc = SM.getInstantiationLoc(Loc); - - if (file) - *file = (void *)SM.getFileEntryForID(SM.getFileID(InstLoc)); - if (line) - *line = SM.getInstantiationLineNumber(InstLoc); - if (column) - *column = SM.getInstantiationColumnNumber(InstLoc); - if (offset) - *offset = SM.getDecomposedLoc(InstLoc).second; -} - -CXSourceLocation clang_getRangeStart(CXSourceRange range) { - CXSourceLocation Result = { { range.ptr_data[0], range.ptr_data[1] }, - range.begin_int_data }; - return Result; -} - -CXSourceLocation clang_getRangeEnd(CXSourceRange range) { - CXSourceLocation Result = { { range.ptr_data[0], range.ptr_data[1] }, - range.end_int_data }; - return Result; -} - -} // end: extern "C" - -//===----------------------------------------------------------------------===// -// CXFile Operations. -//===----------------------------------------------------------------------===// - -extern "C" { -CXString clang_getFileName(CXFile SFile) { - if (!SFile) - return createCXString(NULL); - - FileEntry *FEnt = static_cast(SFile); - return createCXString(FEnt->getName()); -} - -time_t clang_getFileTime(CXFile SFile) { - if (!SFile) - return 0; - - FileEntry *FEnt = static_cast(SFile); - return FEnt->getModificationTime(); -} - -CXFile clang_getFile(CXTranslationUnit tu, const char *file_name) { - if (!tu) - return 0; - - ASTUnit *CXXUnit = static_cast(tu); - - FileManager &FMgr = CXXUnit->getFileManager(); - const FileEntry *File = FMgr.getFile(file_name, file_name+strlen(file_name)); - return const_cast(File); -} - -} // end: extern "C" - -//===----------------------------------------------------------------------===// -// CXCursor Operations. -//===----------------------------------------------------------------------===// - -static Decl *getDeclFromExpr(Stmt *E) { - if (DeclRefExpr *RefExpr = dyn_cast(E)) - return RefExpr->getDecl(); - if (MemberExpr *ME = dyn_cast(E)) - return ME->getMemberDecl(); - if (ObjCIvarRefExpr *RE = dyn_cast(E)) - return RE->getDecl(); - - if (CallExpr *CE = dyn_cast(E)) - return getDeclFromExpr(CE->getCallee()); - if (CastExpr *CE = dyn_cast(E)) - return getDeclFromExpr(CE->getSubExpr()); - if (ObjCMessageExpr *OME = dyn_cast(E)) - return OME->getMethodDecl(); - - return 0; -} - -static SourceLocation getLocationFromExpr(Expr *E) { - if (ObjCMessageExpr *Msg = dyn_cast(E)) - return /*FIXME:*/Msg->getLeftLoc(); - if (DeclRefExpr *DRE = dyn_cast(E)) - return DRE->getLocation(); - if (MemberExpr *Member = dyn_cast(E)) - return Member->getMemberLoc(); - if (ObjCIvarRefExpr *Ivar = dyn_cast(E)) - return Ivar->getLocation(); - return E->getLocStart(); -} - -extern "C" { - -unsigned clang_visitChildren(CXCursor parent, - CXCursorVisitor visitor, - CXClientData client_data) { - ASTUnit *CXXUnit = getCursorASTUnit(parent); - - CursorVisitor CursorVis(CXXUnit, visitor, client_data, - CXXUnit->getMaxPCHLevel()); - return CursorVis.VisitChildren(parent); -} - -static CXString getDeclSpelling(Decl *D) { - NamedDecl *ND = dyn_cast_or_null(D); - if (!ND) - return createCXString(""); - - if (ObjCMethodDecl *OMD = dyn_cast(ND)) - return createCXString(OMD->getSelector().getAsString()); - - if (ObjCCategoryImplDecl *CIMP = dyn_cast(ND)) - // No, this isn't the same as the code below. getIdentifier() is non-virtual - // and returns different names. NamedDecl returns the class name and - // ObjCCategoryImplDecl returns the category name. - return createCXString(CIMP->getIdentifier()->getNameStart()); - - if (isa(D)) - return createCXString(""); - - llvm::SmallString<1024> S; - llvm::raw_svector_ostream os(S); - ND->printName(os); - - return createCXString(os.str()); -} - -CXString clang_getCursorSpelling(CXCursor C) { - if (clang_isTranslationUnit(C.kind)) - return clang_getTranslationUnitSpelling(C.data[2]); - - if (clang_isReference(C.kind)) { - switch (C.kind) { - case CXCursor_ObjCSuperClassRef: { - ObjCInterfaceDecl *Super = getCursorObjCSuperClassRef(C).first; - return createCXString(Super->getIdentifier()->getNameStart()); - } - case CXCursor_ObjCClassRef: { - ObjCInterfaceDecl *Class = getCursorObjCClassRef(C).first; - return createCXString(Class->getIdentifier()->getNameStart()); - } - case CXCursor_ObjCProtocolRef: { - ObjCProtocolDecl *OID = getCursorObjCProtocolRef(C).first; - assert(OID && "getCursorSpelling(): Missing protocol decl"); - return createCXString(OID->getIdentifier()->getNameStart()); - } - case CXCursor_CXXBaseSpecifier: { - CXXBaseSpecifier *B = getCursorCXXBaseSpecifier(C); - return createCXString(B->getType().getAsString()); - } - case CXCursor_TypeRef: { - TypeDecl *Type = getCursorTypeRef(C).first; - assert(Type && "Missing type decl"); - - return createCXString(getCursorContext(C).getTypeDeclType(Type). - getAsString()); - } - case CXCursor_TemplateRef: { - TemplateDecl *Template = getCursorTemplateRef(C).first; - assert(Template && "Missing template decl"); - - return createCXString(Template->getNameAsString()); - } - - case CXCursor_NamespaceRef: { - NamedDecl *NS = getCursorNamespaceRef(C).first; - assert(NS && "Missing namespace decl"); - - return createCXString(NS->getNameAsString()); - } - - default: - return createCXString(""); - } - } - - if (clang_isExpression(C.kind)) { - Decl *D = getDeclFromExpr(getCursorExpr(C)); - if (D) - return getDeclSpelling(D); - return createCXString(""); - } - - if (C.kind == CXCursor_MacroInstantiation) - return createCXString(getCursorMacroInstantiation(C)->getName() - ->getNameStart()); - - if (C.kind == CXCursor_MacroDefinition) - return createCXString(getCursorMacroDefinition(C)->getName() - ->getNameStart()); - - if (clang_isDeclaration(C.kind)) - return getDeclSpelling(getCursorDecl(C)); - - return createCXString(""); -} - -CXString clang_getCursorKindSpelling(enum CXCursorKind Kind) { - switch (Kind) { - case CXCursor_FunctionDecl: - return createCXString("FunctionDecl"); - case CXCursor_TypedefDecl: - return createCXString("TypedefDecl"); - case CXCursor_EnumDecl: - return createCXString("EnumDecl"); - case CXCursor_EnumConstantDecl: - return createCXString("EnumConstantDecl"); - case CXCursor_StructDecl: - return createCXString("StructDecl"); - case CXCursor_UnionDecl: - return createCXString("UnionDecl"); - case CXCursor_ClassDecl: - return createCXString("ClassDecl"); - case CXCursor_FieldDecl: - return createCXString("FieldDecl"); - case CXCursor_VarDecl: - return createCXString("VarDecl"); - case CXCursor_ParmDecl: - return createCXString("ParmDecl"); - case CXCursor_ObjCInterfaceDecl: - return createCXString("ObjCInterfaceDecl"); - case CXCursor_ObjCCategoryDecl: - return createCXString("ObjCCategoryDecl"); - case CXCursor_ObjCProtocolDecl: - return createCXString("ObjCProtocolDecl"); - case CXCursor_ObjCPropertyDecl: - return createCXString("ObjCPropertyDecl"); - case CXCursor_ObjCIvarDecl: - return createCXString("ObjCIvarDecl"); - case CXCursor_ObjCInstanceMethodDecl: - return createCXString("ObjCInstanceMethodDecl"); - case CXCursor_ObjCClassMethodDecl: - return createCXString("ObjCClassMethodDecl"); - case CXCursor_ObjCImplementationDecl: - return createCXString("ObjCImplementationDecl"); - case CXCursor_ObjCCategoryImplDecl: - return createCXString("ObjCCategoryImplDecl"); - case CXCursor_CXXMethod: - return createCXString("CXXMethod"); - case CXCursor_UnexposedDecl: - return createCXString("UnexposedDecl"); - case CXCursor_ObjCSuperClassRef: - return createCXString("ObjCSuperClassRef"); - case CXCursor_ObjCProtocolRef: - return createCXString("ObjCProtocolRef"); - case CXCursor_ObjCClassRef: - return createCXString("ObjCClassRef"); - case CXCursor_TypeRef: - return createCXString("TypeRef"); - case CXCursor_TemplateRef: - return createCXString("TemplateRef"); - case CXCursor_NamespaceRef: - return createCXString("NamespaceRef"); - case CXCursor_UnexposedExpr: - return createCXString("UnexposedExpr"); - case CXCursor_BlockExpr: - return createCXString("BlockExpr"); - case CXCursor_DeclRefExpr: - return createCXString("DeclRefExpr"); - case CXCursor_MemberRefExpr: - return createCXString("MemberRefExpr"); - case CXCursor_CallExpr: - return createCXString("CallExpr"); - case CXCursor_ObjCMessageExpr: - return createCXString("ObjCMessageExpr"); - case CXCursor_UnexposedStmt: - return createCXString("UnexposedStmt"); - case CXCursor_InvalidFile: - return createCXString("InvalidFile"); - case CXCursor_InvalidCode: - return createCXString("InvalidCode"); - case CXCursor_NoDeclFound: - return createCXString("NoDeclFound"); - case CXCursor_NotImplemented: - return createCXString("NotImplemented"); - case CXCursor_TranslationUnit: - return createCXString("TranslationUnit"); - case CXCursor_UnexposedAttr: - return createCXString("UnexposedAttr"); - case CXCursor_IBActionAttr: - return createCXString("attribute(ibaction)"); - case CXCursor_IBOutletAttr: - return createCXString("attribute(iboutlet)"); - case CXCursor_IBOutletCollectionAttr: - return createCXString("attribute(iboutletcollection)"); - case CXCursor_PreprocessingDirective: - return createCXString("preprocessing directive"); - case CXCursor_MacroDefinition: - return createCXString("macro definition"); - case CXCursor_MacroInstantiation: - return createCXString("macro instantiation"); - case CXCursor_Namespace: - return createCXString("Namespace"); - case CXCursor_LinkageSpec: - return createCXString("LinkageSpec"); - case CXCursor_CXXBaseSpecifier: - return createCXString("C++ base class specifier"); - case CXCursor_Constructor: - return createCXString("CXXConstructor"); - case CXCursor_Destructor: - return createCXString("CXXDestructor"); - case CXCursor_ConversionFunction: - return createCXString("CXXConversion"); - case CXCursor_TemplateTypeParameter: - return createCXString("TemplateTypeParameter"); - case CXCursor_NonTypeTemplateParameter: - return createCXString("NonTypeTemplateParameter"); - case CXCursor_TemplateTemplateParameter: - return createCXString("TemplateTemplateParameter"); - case CXCursor_FunctionTemplate: - return createCXString("FunctionTemplate"); - case CXCursor_ClassTemplate: - return createCXString("ClassTemplate"); - case CXCursor_ClassTemplatePartialSpecialization: - return createCXString("ClassTemplatePartialSpecialization"); - case CXCursor_NamespaceAlias: - return createCXString("NamespaceAlias"); - case CXCursor_UsingDirective: - return createCXString("UsingDirective"); - case CXCursor_UsingDeclaration: - return createCXString("UsingDeclaration"); - } - - llvm_unreachable("Unhandled CXCursorKind"); - return createCXString(NULL); -} - -enum CXChildVisitResult GetCursorVisitor(CXCursor cursor, - CXCursor parent, - CXClientData client_data) { - CXCursor *BestCursor = static_cast(client_data); - *BestCursor = cursor; - return CXChildVisit_Recurse; -} - -CXCursor clang_getCursor(CXTranslationUnit TU, CXSourceLocation Loc) { - if (!TU) - return clang_getNullCursor(); - - ASTUnit *CXXUnit = static_cast(TU); - ASTUnit::ConcurrencyCheck Check(*CXXUnit); - - // Translate the given source location to make it point at the beginning of - // the token under the cursor. - SourceLocation SLoc = cxloc::translateSourceLocation(Loc); - - // Guard against an invalid SourceLocation, or we may assert in one - // of the following calls. - if (SLoc.isInvalid()) - return clang_getNullCursor(); - - SLoc = Lexer::GetBeginningOfToken(SLoc, CXXUnit->getSourceManager(), - CXXUnit->getASTContext().getLangOptions()); - - CXCursor Result = MakeCXCursorInvalid(CXCursor_NoDeclFound); - if (SLoc.isValid()) { - // FIXME: Would be great to have a "hint" cursor, then walk from that - // hint cursor upward until we find a cursor whose source range encloses - // the region of interest, rather than starting from the translation unit. - CXCursor Parent = clang_getTranslationUnitCursor(CXXUnit); - CursorVisitor CursorVis(CXXUnit, GetCursorVisitor, &Result, - Decl::MaxPCHLevel, SourceLocation(SLoc)); - CursorVis.VisitChildren(Parent); - } - return Result; -} - -CXCursor clang_getNullCursor(void) { - return MakeCXCursorInvalid(CXCursor_InvalidFile); -} - -unsigned clang_equalCursors(CXCursor X, CXCursor Y) { - return X == Y; -} - -unsigned clang_isInvalid(enum CXCursorKind K) { - return K >= CXCursor_FirstInvalid && K <= CXCursor_LastInvalid; -} - -unsigned clang_isDeclaration(enum CXCursorKind K) { - return K >= CXCursor_FirstDecl && K <= CXCursor_LastDecl; -} - -unsigned clang_isReference(enum CXCursorKind K) { - return K >= CXCursor_FirstRef && K <= CXCursor_LastRef; -} - -unsigned clang_isExpression(enum CXCursorKind K) { - return K >= CXCursor_FirstExpr && K <= CXCursor_LastExpr; -} - -unsigned clang_isStatement(enum CXCursorKind K) { - return K >= CXCursor_FirstStmt && K <= CXCursor_LastStmt; -} - -unsigned clang_isTranslationUnit(enum CXCursorKind K) { - return K == CXCursor_TranslationUnit; -} - -unsigned clang_isPreprocessing(enum CXCursorKind K) { - return K >= CXCursor_FirstPreprocessing && K <= CXCursor_LastPreprocessing; -} - -unsigned clang_isUnexposed(enum CXCursorKind K) { - switch (K) { - case CXCursor_UnexposedDecl: - case CXCursor_UnexposedExpr: - case CXCursor_UnexposedStmt: - case CXCursor_UnexposedAttr: - return true; - default: - return false; - } -} - -CXCursorKind clang_getCursorKind(CXCursor C) { - return C.kind; -} - -CXSourceLocation clang_getCursorLocation(CXCursor C) { - if (clang_isReference(C.kind)) { - switch (C.kind) { - case CXCursor_ObjCSuperClassRef: { - std::pair P - = getCursorObjCSuperClassRef(C); - return cxloc::translateSourceLocation(P.first->getASTContext(), P.second); - } - - case CXCursor_ObjCProtocolRef: { - std::pair P - = getCursorObjCProtocolRef(C); - return cxloc::translateSourceLocation(P.first->getASTContext(), P.second); - } - - case CXCursor_ObjCClassRef: { - std::pair P - = getCursorObjCClassRef(C); - return cxloc::translateSourceLocation(P.first->getASTContext(), P.second); - } - - case CXCursor_TypeRef: { - std::pair P = getCursorTypeRef(C); - return cxloc::translateSourceLocation(P.first->getASTContext(), P.second); - } - - case CXCursor_TemplateRef: { - std::pair P = getCursorTemplateRef(C); - return cxloc::translateSourceLocation(P.first->getASTContext(), P.second); - } - - case CXCursor_NamespaceRef: { - std::pair P = getCursorNamespaceRef(C); - return cxloc::translateSourceLocation(P.first->getASTContext(), P.second); - } - - case CXCursor_CXXBaseSpecifier: { - // FIXME: Figure out what location to return for a CXXBaseSpecifier. - return clang_getNullLocation(); - } - - default: - // FIXME: Need a way to enumerate all non-reference cases. - llvm_unreachable("Missed a reference kind"); - } - } - - if (clang_isExpression(C.kind)) - return cxloc::translateSourceLocation(getCursorContext(C), - getLocationFromExpr(getCursorExpr(C))); - - if (C.kind == CXCursor_PreprocessingDirective) { - SourceLocation L = cxcursor::getCursorPreprocessingDirective(C).getBegin(); - return cxloc::translateSourceLocation(getCursorContext(C), L); - } - - if (C.kind == CXCursor_MacroInstantiation) { - SourceLocation L - = cxcursor::getCursorMacroInstantiation(C)->getSourceRange().getBegin(); - return cxloc::translateSourceLocation(getCursorContext(C), L); - } - - if (C.kind == CXCursor_MacroDefinition) { - SourceLocation L = cxcursor::getCursorMacroDefinition(C)->getLocation(); - return cxloc::translateSourceLocation(getCursorContext(C), L); - } - - if (C.kind < CXCursor_FirstDecl || C.kind > CXCursor_LastDecl) - return clang_getNullLocation(); - - Decl *D = getCursorDecl(C); - SourceLocation Loc = D->getLocation(); - if (ObjCInterfaceDecl *Class = dyn_cast(D)) - Loc = Class->getClassLoc(); - return cxloc::translateSourceLocation(getCursorContext(C), Loc); -} - -} // end extern "C" - -static SourceRange getRawCursorExtent(CXCursor C) { - if (clang_isReference(C.kind)) { - switch (C.kind) { - case CXCursor_ObjCSuperClassRef: - return getCursorObjCSuperClassRef(C).second; - - case CXCursor_ObjCProtocolRef: - return getCursorObjCProtocolRef(C).second; - - case CXCursor_ObjCClassRef: - return getCursorObjCClassRef(C).second; - - case CXCursor_TypeRef: - return getCursorTypeRef(C).second; - - case CXCursor_TemplateRef: - return getCursorTemplateRef(C).second; - - case CXCursor_NamespaceRef: - return getCursorNamespaceRef(C).second; - - case CXCursor_CXXBaseSpecifier: - // FIXME: Figure out what source range to use for a CXBaseSpecifier. - return SourceRange(); - - default: - // FIXME: Need a way to enumerate all non-reference cases. - llvm_unreachable("Missed a reference kind"); - } - } - - if (clang_isExpression(C.kind)) - return getCursorExpr(C)->getSourceRange(); - - if (clang_isStatement(C.kind)) - return getCursorStmt(C)->getSourceRange(); - - if (C.kind == CXCursor_PreprocessingDirective) - return cxcursor::getCursorPreprocessingDirective(C); - - if (C.kind == CXCursor_MacroInstantiation) - return cxcursor::getCursorMacroInstantiation(C)->getSourceRange(); - - if (C.kind == CXCursor_MacroDefinition) - return cxcursor::getCursorMacroDefinition(C)->getSourceRange(); - - if (C.kind >= CXCursor_FirstDecl && C.kind <= CXCursor_LastDecl) - return getCursorDecl(C)->getSourceRange(); - - return SourceRange(); -} - -extern "C" { - -CXSourceRange clang_getCursorExtent(CXCursor C) { - SourceRange R = getRawCursorExtent(C); - if (R.isInvalid()) - return clang_getNullRange(); - - return cxloc::translateSourceRange(getCursorContext(C), R); -} - -CXCursor clang_getCursorReferenced(CXCursor C) { - if (clang_isInvalid(C.kind)) - return clang_getNullCursor(); - - ASTUnit *CXXUnit = getCursorASTUnit(C); - if (clang_isDeclaration(C.kind)) - return C; - - if (clang_isExpression(C.kind)) { - Decl *D = getDeclFromExpr(getCursorExpr(C)); - if (D) - return MakeCXCursor(D, CXXUnit); - return clang_getNullCursor(); - } - - if (C.kind == CXCursor_MacroInstantiation) { - if (MacroDefinition *Def = getCursorMacroInstantiation(C)->getDefinition()) - return MakeMacroDefinitionCursor(Def, CXXUnit); - } - - if (!clang_isReference(C.kind)) - return clang_getNullCursor(); - - switch (C.kind) { - case CXCursor_ObjCSuperClassRef: - return MakeCXCursor(getCursorObjCSuperClassRef(C).first, CXXUnit); - - case CXCursor_ObjCProtocolRef: { - return MakeCXCursor(getCursorObjCProtocolRef(C).first, CXXUnit); - - case CXCursor_ObjCClassRef: - return MakeCXCursor(getCursorObjCClassRef(C).first, CXXUnit); - - case CXCursor_TypeRef: - return MakeCXCursor(getCursorTypeRef(C).first, CXXUnit); - - case CXCursor_TemplateRef: - return MakeCXCursor(getCursorTemplateRef(C).first, CXXUnit); - - case CXCursor_NamespaceRef: - return MakeCXCursor(getCursorNamespaceRef(C).first, CXXUnit); - - case CXCursor_CXXBaseSpecifier: { - CXXBaseSpecifier *B = cxcursor::getCursorCXXBaseSpecifier(C); - return clang_getTypeDeclaration(cxtype::MakeCXType(B->getType(), - CXXUnit)); - } - - default: - // We would prefer to enumerate all non-reference cursor kinds here. - llvm_unreachable("Unhandled reference cursor kind"); - break; - } - } - - return clang_getNullCursor(); -} - -CXCursor clang_getCursorDefinition(CXCursor C) { - if (clang_isInvalid(C.kind)) - return clang_getNullCursor(); - - ASTUnit *CXXUnit = getCursorASTUnit(C); - - bool WasReference = false; - if (clang_isReference(C.kind) || clang_isExpression(C.kind)) { - C = clang_getCursorReferenced(C); - WasReference = true; - } - - if (C.kind == CXCursor_MacroInstantiation) - return clang_getCursorReferenced(C); - - if (!clang_isDeclaration(C.kind)) - return clang_getNullCursor(); - - Decl *D = getCursorDecl(C); - if (!D) - return clang_getNullCursor(); - - switch (D->getKind()) { - // Declaration kinds that don't really separate the notions of - // declaration and definition. - case Decl::Namespace: - case Decl::Typedef: - case Decl::TemplateTypeParm: - case Decl::EnumConstant: - case Decl::Field: - case Decl::ObjCIvar: - case Decl::ObjCAtDefsField: - case Decl::ImplicitParam: - case Decl::ParmVar: - case Decl::NonTypeTemplateParm: - case Decl::TemplateTemplateParm: - case Decl::ObjCCategoryImpl: - case Decl::ObjCImplementation: - case Decl::AccessSpec: - case Decl::LinkageSpec: - case Decl::ObjCPropertyImpl: - case Decl::FileScopeAsm: - case Decl::StaticAssert: - case Decl::Block: - return C; - - // Declaration kinds that don't make any sense here, but are - // nonetheless harmless. - case Decl::TranslationUnit: - break; - - // Declaration kinds for which the definition is not resolvable. - case Decl::UnresolvedUsingTypename: - case Decl::UnresolvedUsingValue: - break; - - case Decl::UsingDirective: - return MakeCXCursor(cast(D)->getNominatedNamespace(), - CXXUnit); - - case Decl::NamespaceAlias: - return MakeCXCursor(cast(D)->getNamespace(), CXXUnit); - - case Decl::Enum: - case Decl::Record: - case Decl::CXXRecord: - case Decl::ClassTemplateSpecialization: - case Decl::ClassTemplatePartialSpecialization: - if (TagDecl *Def = cast(D)->getDefinition()) - return MakeCXCursor(Def, CXXUnit); - return clang_getNullCursor(); - - case Decl::Function: - case Decl::CXXMethod: - case Decl::CXXConstructor: - case Decl::CXXDestructor: - case Decl::CXXConversion: { - const FunctionDecl *Def = 0; - if (cast(D)->getBody(Def)) - return MakeCXCursor(const_cast(Def), CXXUnit); - return clang_getNullCursor(); - } - - case Decl::Var: { - // Ask the variable if it has a definition. - if (VarDecl *Def = cast(D)->getDefinition()) - return MakeCXCursor(Def, CXXUnit); - return clang_getNullCursor(); - } - - case Decl::FunctionTemplate: { - const FunctionDecl *Def = 0; - if (cast(D)->getTemplatedDecl()->getBody(Def)) - return MakeCXCursor(Def->getDescribedFunctionTemplate(), CXXUnit); - return clang_getNullCursor(); - } - - case Decl::ClassTemplate: { - if (RecordDecl *Def = cast(D)->getTemplatedDecl() - ->getDefinition()) - return MakeCXCursor(cast(Def)->getDescribedClassTemplate(), - CXXUnit); - return clang_getNullCursor(); - } - - case Decl::Using: { - UsingDecl *Using = cast(D); - CXCursor Def = clang_getNullCursor(); - for (UsingDecl::shadow_iterator S = Using->shadow_begin(), - SEnd = Using->shadow_end(); - S != SEnd; ++S) { - if (Def != clang_getNullCursor()) { - // FIXME: We have no way to return multiple results. - return clang_getNullCursor(); - } - - Def = clang_getCursorDefinition(MakeCXCursor((*S)->getTargetDecl(), - CXXUnit)); - } - - return Def; - } - - case Decl::UsingShadow: - return clang_getCursorDefinition( - MakeCXCursor(cast(D)->getTargetDecl(), - CXXUnit)); - - case Decl::ObjCMethod: { - ObjCMethodDecl *Method = cast(D); - if (Method->isThisDeclarationADefinition()) - return C; - - // Dig out the method definition in the associated - // @implementation, if we have it. - // FIXME: The ASTs should make finding the definition easier. - if (ObjCInterfaceDecl *Class - = dyn_cast(Method->getDeclContext())) - if (ObjCImplementationDecl *ClassImpl = Class->getImplementation()) - if (ObjCMethodDecl *Def = ClassImpl->getMethod(Method->getSelector(), - Method->isInstanceMethod())) - if (Def->isThisDeclarationADefinition()) - return MakeCXCursor(Def, CXXUnit); - - return clang_getNullCursor(); - } - - case Decl::ObjCCategory: - if (ObjCCategoryImplDecl *Impl - = cast(D)->getImplementation()) - return MakeCXCursor(Impl, CXXUnit); - return clang_getNullCursor(); - - case Decl::ObjCProtocol: - if (!cast(D)->isForwardDecl()) - return C; - return clang_getNullCursor(); - - case Decl::ObjCInterface: - // There are two notions of a "definition" for an Objective-C - // class: the interface and its implementation. When we resolved a - // reference to an Objective-C class, produce the @interface as - // the definition; when we were provided with the interface, - // produce the @implementation as the definition. - if (WasReference) { - if (!cast(D)->isForwardDecl()) - return C; - } else if (ObjCImplementationDecl *Impl - = cast(D)->getImplementation()) - return MakeCXCursor(Impl, CXXUnit); - return clang_getNullCursor(); - - case Decl::ObjCProperty: - // FIXME: We don't really know where to find the - // ObjCPropertyImplDecls that implement this property. - return clang_getNullCursor(); - - case Decl::ObjCCompatibleAlias: - if (ObjCInterfaceDecl *Class - = cast(D)->getClassInterface()) - if (!Class->isForwardDecl()) - return MakeCXCursor(Class, CXXUnit); - - return clang_getNullCursor(); - - case Decl::ObjCForwardProtocol: { - ObjCForwardProtocolDecl *Forward = cast(D); - if (Forward->protocol_size() == 1) - return clang_getCursorDefinition( - MakeCXCursor(*Forward->protocol_begin(), - CXXUnit)); - - // FIXME: Cannot return multiple definitions. - return clang_getNullCursor(); - } - - case Decl::ObjCClass: { - ObjCClassDecl *Class = cast(D); - if (Class->size() == 1) { - ObjCInterfaceDecl *IFace = Class->begin()->getInterface(); - if (!IFace->isForwardDecl()) - return MakeCXCursor(IFace, CXXUnit); - return clang_getNullCursor(); - } - - // FIXME: Cannot return multiple definitions. - return clang_getNullCursor(); - } - - case Decl::Friend: - if (NamedDecl *Friend = cast(D)->getFriendDecl()) - return clang_getCursorDefinition(MakeCXCursor(Friend, CXXUnit)); - return clang_getNullCursor(); - - case Decl::FriendTemplate: - if (NamedDecl *Friend = cast(D)->getFriendDecl()) - return clang_getCursorDefinition(MakeCXCursor(Friend, CXXUnit)); - return clang_getNullCursor(); - } - - return clang_getNullCursor(); -} - -unsigned clang_isCursorDefinition(CXCursor C) { - if (!clang_isDeclaration(C.kind)) - return 0; - - return clang_getCursorDefinition(C) == C; -} - -void clang_getDefinitionSpellingAndExtent(CXCursor C, - const char **startBuf, - const char **endBuf, - unsigned *startLine, - unsigned *startColumn, - unsigned *endLine, - unsigned *endColumn) { - assert(getCursorDecl(C) && "CXCursor has null decl"); - NamedDecl *ND = static_cast(getCursorDecl(C)); - FunctionDecl *FD = dyn_cast(ND); - CompoundStmt *Body = dyn_cast(FD->getBody()); - - SourceManager &SM = FD->getASTContext().getSourceManager(); - *startBuf = SM.getCharacterData(Body->getLBracLoc()); - *endBuf = SM.getCharacterData(Body->getRBracLoc()); - *startLine = SM.getSpellingLineNumber(Body->getLBracLoc()); - *startColumn = SM.getSpellingColumnNumber(Body->getLBracLoc()); - *endLine = SM.getSpellingLineNumber(Body->getRBracLoc()); - *endColumn = SM.getSpellingColumnNumber(Body->getRBracLoc()); -} - -void clang_enableStackTraces(void) { - llvm::sys::PrintStackTraceOnErrorSignal(); -} - -} // end: extern "C" - -//===----------------------------------------------------------------------===// -// Token-based Operations. -//===----------------------------------------------------------------------===// - -/* CXToken layout: - * int_data[0]: a CXTokenKind - * int_data[1]: starting token location - * int_data[2]: token length - * int_data[3]: reserved - * ptr_data: for identifiers and keywords, an IdentifierInfo*. - * otherwise unused. - */ -extern "C" { - -CXTokenKind clang_getTokenKind(CXToken CXTok) { - return static_cast(CXTok.int_data[0]); -} - -CXString clang_getTokenSpelling(CXTranslationUnit TU, CXToken CXTok) { - switch (clang_getTokenKind(CXTok)) { - case CXToken_Identifier: - case CXToken_Keyword: - // We know we have an IdentifierInfo*, so use that. - return createCXString(static_cast(CXTok.ptr_data) - ->getNameStart()); - - case CXToken_Literal: { - // We have stashed the starting pointer in the ptr_data field. Use it. - const char *Text = static_cast(CXTok.ptr_data); - return createCXString(llvm::StringRef(Text, CXTok.int_data[2])); - } - - case CXToken_Punctuation: - case CXToken_Comment: - break; - } - - // We have to find the starting buffer pointer the hard way, by - // deconstructing the source location. - ASTUnit *CXXUnit = static_cast(TU); - if (!CXXUnit) - return createCXString(""); - - SourceLocation Loc = SourceLocation::getFromRawEncoding(CXTok.int_data[1]); - std::pair LocInfo - = CXXUnit->getSourceManager().getDecomposedLoc(Loc); - bool Invalid = false; - llvm::StringRef Buffer - = CXXUnit->getSourceManager().getBufferData(LocInfo.first, &Invalid); - if (Invalid) - return createCXString(""); - - return createCXString(Buffer.substr(LocInfo.second, CXTok.int_data[2])); -} - -CXSourceLocation clang_getTokenLocation(CXTranslationUnit TU, CXToken CXTok) { - ASTUnit *CXXUnit = static_cast(TU); - if (!CXXUnit) - return clang_getNullLocation(); - - return cxloc::translateSourceLocation(CXXUnit->getASTContext(), - SourceLocation::getFromRawEncoding(CXTok.int_data[1])); -} - -CXSourceRange clang_getTokenExtent(CXTranslationUnit TU, CXToken CXTok) { - ASTUnit *CXXUnit = static_cast(TU); - if (!CXXUnit) - return clang_getNullRange(); - - return cxloc::translateSourceRange(CXXUnit->getASTContext(), - SourceLocation::getFromRawEncoding(CXTok.int_data[1])); -} - -void clang_tokenize(CXTranslationUnit TU, CXSourceRange Range, - CXToken **Tokens, unsigned *NumTokens) { - if (Tokens) - *Tokens = 0; - if (NumTokens) - *NumTokens = 0; - - ASTUnit *CXXUnit = static_cast(TU); - if (!CXXUnit || !Tokens || !NumTokens) - return; - - ASTUnit::ConcurrencyCheck Check(*CXXUnit); - - SourceRange R = cxloc::translateCXSourceRange(Range); - if (R.isInvalid()) - return; - - SourceManager &SourceMgr = CXXUnit->getSourceManager(); - std::pair BeginLocInfo - = SourceMgr.getDecomposedLoc(R.getBegin()); - std::pair EndLocInfo - = SourceMgr.getDecomposedLoc(R.getEnd()); - - // Cannot tokenize across files. - if (BeginLocInfo.first != EndLocInfo.first) - return; - - // Create a lexer - bool Invalid = false; - llvm::StringRef Buffer - = SourceMgr.getBufferData(BeginLocInfo.first, &Invalid); - if (Invalid) - return; - - Lexer Lex(SourceMgr.getLocForStartOfFile(BeginLocInfo.first), - CXXUnit->getASTContext().getLangOptions(), - Buffer.begin(), Buffer.data() + BeginLocInfo.second, Buffer.end()); - Lex.SetCommentRetentionState(true); - - // Lex tokens until we hit the end of the range. - const char *EffectiveBufferEnd = Buffer.data() + EndLocInfo.second; - llvm::SmallVector CXTokens; - Token Tok; - do { - // Lex the next token - Lex.LexFromRawLexer(Tok); - if (Tok.is(tok::eof)) - break; - - // Initialize the CXToken. - CXToken CXTok; - - // - Common fields - CXTok.int_data[1] = Tok.getLocation().getRawEncoding(); - CXTok.int_data[2] = Tok.getLength(); - CXTok.int_data[3] = 0; - - // - Kind-specific fields - if (Tok.isLiteral()) { - CXTok.int_data[0] = CXToken_Literal; - CXTok.ptr_data = (void *)Tok.getLiteralData(); - } else if (Tok.is(tok::identifier)) { - // Lookup the identifier to determine whether we have a keyword. - std::pair LocInfo - = SourceMgr.getDecomposedLoc(Tok.getLocation()); - bool Invalid = false; - llvm::StringRef Buf - = CXXUnit->getSourceManager().getBufferData(LocInfo.first, &Invalid); - if (Invalid) - return; - - const char *StartPos = Buf.data() + LocInfo.second; - IdentifierInfo *II - = CXXUnit->getPreprocessor().LookUpIdentifierInfo(Tok, StartPos); - - if (II->getObjCKeywordID() != tok::objc_not_keyword) { - CXTok.int_data[0] = CXToken_Keyword; - } - else { - CXTok.int_data[0] = II->getTokenID() == tok::identifier? - CXToken_Identifier - : CXToken_Keyword; - } - CXTok.ptr_data = II; - } else if (Tok.is(tok::comment)) { - CXTok.int_data[0] = CXToken_Comment; - CXTok.ptr_data = 0; - } else { - CXTok.int_data[0] = CXToken_Punctuation; - CXTok.ptr_data = 0; - } - CXTokens.push_back(CXTok); - } while (Lex.getBufferLocation() <= EffectiveBufferEnd); - - if (CXTokens.empty()) - return; - - *Tokens = (CXToken *)malloc(sizeof(CXToken) * CXTokens.size()); - memmove(*Tokens, CXTokens.data(), sizeof(CXToken) * CXTokens.size()); - *NumTokens = CXTokens.size(); -} - -void clang_disposeTokens(CXTranslationUnit TU, - CXToken *Tokens, unsigned NumTokens) { - free(Tokens); -} - -} // end: extern "C" - -//===----------------------------------------------------------------------===// -// Token annotation APIs. -//===----------------------------------------------------------------------===// - -typedef llvm::DenseMap AnnotateTokensData; -static enum CXChildVisitResult AnnotateTokensVisitor(CXCursor cursor, - CXCursor parent, - CXClientData client_data); -namespace { -class AnnotateTokensWorker { - AnnotateTokensData &Annotated; - CXToken *Tokens; - CXCursor *Cursors; - unsigned NumTokens; - unsigned TokIdx; - CursorVisitor AnnotateVis; - SourceManager &SrcMgr; - - bool MoreTokens() const { return TokIdx < NumTokens; } - unsigned NextToken() const { return TokIdx; } - void AdvanceToken() { ++TokIdx; } - SourceLocation GetTokenLoc(unsigned tokI) { - return SourceLocation::getFromRawEncoding(Tokens[tokI].int_data[1]); - } - -public: - AnnotateTokensWorker(AnnotateTokensData &annotated, - CXToken *tokens, CXCursor *cursors, unsigned numTokens, - ASTUnit *CXXUnit, SourceRange RegionOfInterest) - : Annotated(annotated), Tokens(tokens), Cursors(cursors), - NumTokens(numTokens), TokIdx(0), - AnnotateVis(CXXUnit, AnnotateTokensVisitor, this, - Decl::MaxPCHLevel, RegionOfInterest), - SrcMgr(CXXUnit->getSourceManager()) {} - - void VisitChildren(CXCursor C) { AnnotateVis.VisitChildren(C); } - enum CXChildVisitResult Visit(CXCursor cursor, CXCursor parent); - void AnnotateTokens(CXCursor parent); -}; -} - -void AnnotateTokensWorker::AnnotateTokens(CXCursor parent) { - // Walk the AST within the region of interest, annotating tokens - // along the way. - VisitChildren(parent); - - for (unsigned I = 0 ; I < TokIdx ; ++I) { - AnnotateTokensData::iterator Pos = Annotated.find(Tokens[I].int_data[1]); - if (Pos != Annotated.end()) - Cursors[I] = Pos->second; - } - - // Finish up annotating any tokens left. - if (!MoreTokens()) - return; - - const CXCursor &C = clang_getNullCursor(); - for (unsigned I = TokIdx ; I < NumTokens ; ++I) { - AnnotateTokensData::iterator Pos = Annotated.find(Tokens[I].int_data[1]); - Cursors[I] = (Pos == Annotated.end()) ? C : Pos->second; - } -} - -enum CXChildVisitResult -AnnotateTokensWorker::Visit(CXCursor cursor, CXCursor parent) { - CXSourceLocation Loc = clang_getCursorLocation(cursor); - // We can always annotate a preprocessing directive/macro instantiation. - if (clang_isPreprocessing(cursor.kind)) { - Annotated[Loc.int_data] = cursor; - return CXChildVisit_Recurse; - } - - SourceRange cursorRange = getRawCursorExtent(cursor); - - if (cursorRange.isInvalid()) - return CXChildVisit_Continue; - - SourceLocation L = SourceLocation::getFromRawEncoding(Loc.int_data); - - // Adjust the annotated range based specific declarations. - const enum CXCursorKind cursorK = clang_getCursorKind(cursor); - if (cursorK >= CXCursor_FirstDecl && cursorK <= CXCursor_LastDecl) { - Decl *D = cxcursor::getCursorDecl(cursor); - // Don't visit synthesized ObjC methods, since they have no syntatic - // representation in the source. - if (const ObjCMethodDecl *MD = dyn_cast(D)) { - if (MD->isSynthesized()) - return CXChildVisit_Continue; - } - if (const DeclaratorDecl *DD = dyn_cast(D)) { - if (TypeSourceInfo *TI = DD->getTypeSourceInfo()) { - TypeLoc TL = TI->getTypeLoc(); - SourceLocation TLoc = TL.getSourceRange().getBegin(); - if (TLoc.isValid() && - SrcMgr.isBeforeInTranslationUnit(TLoc, L)) - cursorRange.setBegin(TLoc); - } - } - } - - // If the location of the cursor occurs within a macro instantiation, record - // the spelling location of the cursor in our annotation map. We can then - // paper over the token labelings during a post-processing step to try and - // get cursor mappings for tokens that are the *arguments* of a macro - // instantiation. - if (L.isMacroID()) { - unsigned rawEncoding = SrcMgr.getSpellingLoc(L).getRawEncoding(); - // Only invalidate the old annotation if it isn't part of a preprocessing - // directive. Here we assume that the default construction of CXCursor - // results in CXCursor.kind being an initialized value (i.e., 0). If - // this isn't the case, we can fix by doing lookup + insertion. - - CXCursor &oldC = Annotated[rawEncoding]; - if (!clang_isPreprocessing(oldC.kind)) - oldC = cursor; - } - - const enum CXCursorKind K = clang_getCursorKind(parent); - const CXCursor updateC = - (clang_isInvalid(K) || K == CXCursor_TranslationUnit) - ? clang_getNullCursor() : parent; - - while (MoreTokens()) { - const unsigned I = NextToken(); - SourceLocation TokLoc = GetTokenLoc(I); - switch (LocationCompare(SrcMgr, TokLoc, cursorRange)) { - case RangeBefore: - Cursors[I] = updateC; - AdvanceToken(); - continue; - case RangeAfter: - case RangeOverlap: - break; - } - break; - } - - // Visit children to get their cursor information. - const unsigned BeforeChildren = NextToken(); - VisitChildren(cursor); - const unsigned AfterChildren = NextToken(); - - // Adjust 'Last' to the last token within the extent of the cursor. - while (MoreTokens()) { - const unsigned I = NextToken(); - SourceLocation TokLoc = GetTokenLoc(I); - switch (LocationCompare(SrcMgr, TokLoc, cursorRange)) { - case RangeBefore: - assert(0 && "Infeasible"); - case RangeAfter: - break; - case RangeOverlap: - Cursors[I] = updateC; - AdvanceToken(); - continue; - } - break; - } - const unsigned Last = NextToken(); - - // Scan the tokens that are at the beginning of the cursor, but are not - // capture by the child cursors. - - // For AST elements within macros, rely on a post-annotate pass to - // to correctly annotate the tokens with cursors. Otherwise we can - // get confusing results of having tokens that map to cursors that really - // are expanded by an instantiation. - if (L.isMacroID()) - cursor = clang_getNullCursor(); - - for (unsigned I = BeforeChildren; I != AfterChildren; ++I) { - if (!clang_isInvalid(clang_getCursorKind(Cursors[I]))) - break; - Cursors[I] = cursor; - } - // Scan the tokens that are at the end of the cursor, but are not captured - // but the child cursors. - for (unsigned I = AfterChildren; I != Last; ++I) - Cursors[I] = cursor; - - TokIdx = Last; - return CXChildVisit_Continue; -} - -static enum CXChildVisitResult AnnotateTokensVisitor(CXCursor cursor, - CXCursor parent, - CXClientData client_data) { - return static_cast(client_data)->Visit(cursor, parent); -} - -extern "C" { - -void clang_annotateTokens(CXTranslationUnit TU, - CXToken *Tokens, unsigned NumTokens, - CXCursor *Cursors) { - - if (NumTokens == 0 || !Tokens || !Cursors) - return; - - ASTUnit *CXXUnit = static_cast(TU); - if (!CXXUnit) { - // Any token we don't specifically annotate will have a NULL cursor. - const CXCursor &C = clang_getNullCursor(); - for (unsigned I = 0; I != NumTokens; ++I) - Cursors[I] = C; - return; - } - - ASTUnit::ConcurrencyCheck Check(*CXXUnit); - - // Determine the region of interest, which contains all of the tokens. - SourceRange RegionOfInterest; - RegionOfInterest.setBegin(cxloc::translateSourceLocation( - clang_getTokenLocation(TU, Tokens[0]))); - RegionOfInterest.setEnd(cxloc::translateSourceLocation( - clang_getTokenLocation(TU, - Tokens[NumTokens - 1]))); - - // A mapping from the source locations found when re-lexing or traversing the - // region of interest to the corresponding cursors. - AnnotateTokensData Annotated; - - // Relex the tokens within the source range to look for preprocessing - // directives. - SourceManager &SourceMgr = CXXUnit->getSourceManager(); - std::pair BeginLocInfo - = SourceMgr.getDecomposedLoc(RegionOfInterest.getBegin()); - std::pair EndLocInfo - = SourceMgr.getDecomposedLoc(RegionOfInterest.getEnd()); - - llvm::StringRef Buffer; - bool Invalid = false; - if (BeginLocInfo.first == EndLocInfo.first && - ((Buffer = SourceMgr.getBufferData(BeginLocInfo.first, &Invalid)),true) && - !Invalid) { - Lexer Lex(SourceMgr.getLocForStartOfFile(BeginLocInfo.first), - CXXUnit->getASTContext().getLangOptions(), - Buffer.begin(), Buffer.data() + BeginLocInfo.second, - Buffer.end()); - Lex.SetCommentRetentionState(true); - - // Lex tokens in raw mode until we hit the end of the range, to avoid - // entering #includes or expanding macros. - while (true) { - Token Tok; - Lex.LexFromRawLexer(Tok); - - reprocess: - if (Tok.is(tok::hash) && Tok.isAtStartOfLine()) { - // We have found a preprocessing directive. Gobble it up so that we - // don't see it while preprocessing these tokens later, but keep track of - // all of the token locations inside this preprocessing directive so that - // we can annotate them appropriately. - // - // FIXME: Some simple tests here could identify macro definitions and - // #undefs, to provide specific cursor kinds for those. - std::vector Locations; - do { - Locations.push_back(Tok.getLocation()); - Lex.LexFromRawLexer(Tok); - } while (!Tok.isAtStartOfLine() && !Tok.is(tok::eof)); - - using namespace cxcursor; - CXCursor Cursor - = MakePreprocessingDirectiveCursor(SourceRange(Locations.front(), - Locations.back()), - CXXUnit); - for (unsigned I = 0, N = Locations.size(); I != N; ++I) { - Annotated[Locations[I].getRawEncoding()] = Cursor; - } - - if (Tok.isAtStartOfLine()) - goto reprocess; - - continue; - } - - if (Tok.is(tok::eof)) - break; - } - } - - // Annotate all of the source locations in the region of interest that map to - // a specific cursor. - AnnotateTokensWorker W(Annotated, Tokens, Cursors, NumTokens, - CXXUnit, RegionOfInterest); - W.AnnotateTokens(clang_getTranslationUnitCursor(CXXUnit)); -} -} // end: extern "C" - -//===----------------------------------------------------------------------===// -// Operations for querying linkage of a cursor. -//===----------------------------------------------------------------------===// - -extern "C" { -CXLinkageKind clang_getCursorLinkage(CXCursor cursor) { - if (!clang_isDeclaration(cursor.kind)) - return CXLinkage_Invalid; - - Decl *D = cxcursor::getCursorDecl(cursor); - if (NamedDecl *ND = dyn_cast_or_null(D)) - switch (ND->getLinkage()) { - case NoLinkage: return CXLinkage_NoLinkage; - case InternalLinkage: return CXLinkage_Internal; - case UniqueExternalLinkage: return CXLinkage_UniqueExternal; - case ExternalLinkage: return CXLinkage_External; - }; - - return CXLinkage_Invalid; -} -} // end: extern "C" - -//===----------------------------------------------------------------------===// -// Operations for querying language of a cursor. -//===----------------------------------------------------------------------===// - -static CXLanguageKind getDeclLanguage(const Decl *D) { - switch (D->getKind()) { - default: - break; - case Decl::ImplicitParam: - case Decl::ObjCAtDefsField: - case Decl::ObjCCategory: - case Decl::ObjCCategoryImpl: - case Decl::ObjCClass: - case Decl::ObjCCompatibleAlias: - case Decl::ObjCForwardProtocol: - case Decl::ObjCImplementation: - case Decl::ObjCInterface: - case Decl::ObjCIvar: - case Decl::ObjCMethod: - case Decl::ObjCProperty: - case Decl::ObjCPropertyImpl: - case Decl::ObjCProtocol: - return CXLanguage_ObjC; - case Decl::CXXConstructor: - case Decl::CXXConversion: - case Decl::CXXDestructor: - case Decl::CXXMethod: - case Decl::CXXRecord: - case Decl::ClassTemplate: - case Decl::ClassTemplatePartialSpecialization: - case Decl::ClassTemplateSpecialization: - case Decl::Friend: - case Decl::FriendTemplate: - case Decl::FunctionTemplate: - case Decl::LinkageSpec: - case Decl::Namespace: - case Decl::NamespaceAlias: - case Decl::NonTypeTemplateParm: - case Decl::StaticAssert: - case Decl::TemplateTemplateParm: - case Decl::TemplateTypeParm: - case Decl::UnresolvedUsingTypename: - case Decl::UnresolvedUsingValue: - case Decl::Using: - case Decl::UsingDirective: - case Decl::UsingShadow: - return CXLanguage_CPlusPlus; - } - - return CXLanguage_C; -} - -extern "C" { - -enum CXAvailabilityKind clang_getCursorAvailability(CXCursor cursor) { - if (clang_isDeclaration(cursor.kind)) - if (Decl *D = cxcursor::getCursorDecl(cursor)) { - if (D->hasAttr() || - (isa(D) && cast(D)->isDeleted())) - return CXAvailability_Available; - - if (D->hasAttr()) - return CXAvailability_Deprecated; - } - - return CXAvailability_Available; -} - -CXLanguageKind clang_getCursorLanguage(CXCursor cursor) { - if (clang_isDeclaration(cursor.kind)) - return getDeclLanguage(cxcursor::getCursorDecl(cursor)); - - return CXLanguage_Invalid; -} -} // end: extern "C" - - -//===----------------------------------------------------------------------===// -// C++ AST instrospection. -//===----------------------------------------------------------------------===// - -extern "C" { -unsigned clang_CXXMethod_isStatic(CXCursor C) { - if (!clang_isDeclaration(C.kind)) - return 0; - - CXXMethodDecl *Method = 0; - Decl *D = cxcursor::getCursorDecl(C); - if (FunctionTemplateDecl *FunTmpl = dyn_cast_or_null(D)) - Method = dyn_cast(FunTmpl->getTemplatedDecl()); - else - Method = dyn_cast_or_null(D); - return (Method && Method->isStatic()) ? 1 : 0; -} - -} // end: extern "C" - -//===----------------------------------------------------------------------===// -// Attribute introspection. -//===----------------------------------------------------------------------===// - -extern "C" { -CXType clang_getIBOutletCollectionType(CXCursor C) { - if (C.kind != CXCursor_IBOutletCollectionAttr) - return cxtype::MakeCXType(QualType(), cxcursor::getCursorASTUnit(C)); - - IBOutletCollectionAttr *A = - cast(cxcursor::getCursorAttr(C)); - - return cxtype::MakeCXType(A->getInterface(), cxcursor::getCursorASTUnit(C)); -} -} // end: extern "C" - -//===----------------------------------------------------------------------===// -// CXString Operations. -//===----------------------------------------------------------------------===// - -extern "C" { -const char *clang_getCString(CXString string) { - return string.Spelling; -} - -void clang_disposeString(CXString string) { - if (string.MustFreeString && string.Spelling) - free((void*)string.Spelling); -} - -} // end: extern "C" - -namespace clang { namespace cxstring { -CXString createCXString(const char *String, bool DupString){ - CXString Str; - if (DupString) { - Str.Spelling = strdup(String); - Str.MustFreeString = 1; - } else { - Str.Spelling = String; - Str.MustFreeString = 0; - } - return Str; -} - -CXString createCXString(llvm::StringRef String, bool DupString) { - CXString Result; - if (DupString || (!String.empty() && String.data()[String.size()] != 0)) { - char *Spelling = (char *)malloc(String.size() + 1); - memmove(Spelling, String.data(), String.size()); - Spelling[String.size()] = 0; - Result.Spelling = Spelling; - Result.MustFreeString = 1; - } else { - Result.Spelling = String.data(); - Result.MustFreeString = 0; - } - return Result; -} -}} - -//===----------------------------------------------------------------------===// -// Misc. utility functions. -//===----------------------------------------------------------------------===// - -extern "C" { - -CXString clang_getClangVersion() { - return createCXString(getClangFullVersion()); -} - -} // end: extern "C" diff --git a/contrib/llvm/tools/clang/tools/libclang/CIndexCXX.cpp b/contrib/llvm/tools/clang/tools/libclang/CIndexCXX.cpp deleted file mode 100644 index 3ade5195d8f8..000000000000 --- a/contrib/llvm/tools/clang/tools/libclang/CIndexCXX.cpp +++ /dev/null @@ -1,124 +0,0 @@ -//===- CIndexCXX.cpp - Clang-C Source Indexing Library --------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements the libclang support for C++ cursors. -// -//===----------------------------------------------------------------------===// - -#include "CIndexer.h" -#include "CXCursor.h" -#include "CXType.h" -#include "clang/AST/DeclCXX.h" -#include "clang/AST/DeclTemplate.h" - -using namespace clang; -using namespace clang::cxstring; -using namespace clang::cxcursor; - -extern "C" { - -unsigned clang_isVirtualBase(CXCursor C) { - if (C.kind != CXCursor_CXXBaseSpecifier) - return 0; - - CXXBaseSpecifier *B = getCursorCXXBaseSpecifier(C); - return B->isVirtual(); -} - -enum CX_CXXAccessSpecifier clang_getCXXAccessSpecifier(CXCursor C) { - if (C.kind != CXCursor_CXXBaseSpecifier) - return CX_CXXInvalidAccessSpecifier; - - CXXBaseSpecifier *B = getCursorCXXBaseSpecifier(C); - switch (B->getAccessSpecifier()) { - case AS_public: return CX_CXXPublic; - case AS_protected: return CX_CXXProtected; - case AS_private: return CX_CXXPrivate; - case AS_none: return CX_CXXInvalidAccessSpecifier; - } - - // FIXME: Clang currently thinks this is reachable. - return CX_CXXInvalidAccessSpecifier; -} - -enum CXCursorKind clang_getTemplateCursorKind(CXCursor C) { - using namespace clang::cxcursor; - - switch (C.kind) { - case CXCursor_ClassTemplate: - case CXCursor_FunctionTemplate: - if (TemplateDecl *Template - = dyn_cast_or_null(getCursorDecl(C))) - return MakeCXCursor(Template->getTemplatedDecl(), - getCursorASTUnit(C)).kind; - break; - - case CXCursor_ClassTemplatePartialSpecialization: - if (ClassTemplateSpecializationDecl *PartialSpec - = dyn_cast_or_null( - getCursorDecl(C))) { - switch (PartialSpec->getTagKind()) { - case TTK_Class: return CXCursor_ClassDecl; - case TTK_Struct: return CXCursor_StructDecl; - case TTK_Union: return CXCursor_UnionDecl; - case TTK_Enum: return CXCursor_NoDeclFound; - } - } - break; - - default: - break; - } - - return CXCursor_NoDeclFound; -} - -CXCursor clang_getSpecializedCursorTemplate(CXCursor C) { - if (!clang_isDeclaration(C.kind)) - return clang_getNullCursor(); - - Decl *D = getCursorDecl(C); - if (!D) - return clang_getNullCursor(); - - Decl *Template = 0; - if (CXXRecordDecl *CXXRecord = dyn_cast(D)) { - if (ClassTemplatePartialSpecializationDecl *PartialSpec - = dyn_cast(CXXRecord)) - Template = PartialSpec->getSpecializedTemplate(); - else if (ClassTemplateSpecializationDecl *ClassSpec - = dyn_cast(CXXRecord)) { - llvm::PointerUnion Result - = ClassSpec->getSpecializedTemplateOrPartial(); - if (Result.is()) - Template = Result.get(); - else - Template = Result.get(); - - } else - Template = CXXRecord->getInstantiatedFromMemberClass(); - } else if (FunctionDecl *Function = dyn_cast(D)) { - Template = Function->getPrimaryTemplate(); - if (!Template) - Template = Function->getInstantiatedFromMemberFunction(); - } else if (VarDecl *Var = dyn_cast(D)) { - if (Var->isStaticDataMember()) - Template = Var->getInstantiatedFromStaticDataMember(); - } else if (RedeclarableTemplateDecl *Tmpl - = dyn_cast(D)) - Template = Tmpl->getInstantiatedFromMemberTemplate(); - - if (!Template) - return clang_getNullCursor(); - - return MakeCXCursor(Template, getCursorASTUnit(C)); -} - -} // end extern "C" diff --git a/contrib/llvm/tools/clang/tools/libclang/CIndexCodeCompletion.cpp b/contrib/llvm/tools/clang/tools/libclang/CIndexCodeCompletion.cpp deleted file mode 100644 index d591c5defb2e..000000000000 --- a/contrib/llvm/tools/clang/tools/libclang/CIndexCodeCompletion.cpp +++ /dev/null @@ -1,822 +0,0 @@ -//===- CIndexCodeCompletion.cpp - Code Completion API hooks ---------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements the Clang-C Source Indexing library hooks for -// code completion. -// -//===----------------------------------------------------------------------===// - -#include "CIndexer.h" -#include "CIndexDiagnostic.h" -#include "clang/Basic/SourceManager.h" -#include "clang/Basic/FileManager.h" -#include "clang/Frontend/ASTUnit.h" -#include "clang/Frontend/CompilerInstance.h" -#include "clang/Frontend/FrontendDiagnostic.h" -#include "clang/Sema/CodeCompleteConsumer.h" -#include "llvm/ADT/SmallString.h" -#include "llvm/ADT/StringExtras.h" -#include "llvm/Support/CrashRecoveryContext.h" -#include "llvm/Support/MemoryBuffer.h" -#include "llvm/Support/Timer.h" -#include "llvm/Support/raw_ostream.h" -#include "llvm/System/Program.h" -#include -#include - - -#ifdef UDP_CODE_COMPLETION_LOGGER -#include "clang/Basic/Version.h" -#include -#include -#include -#include -#endif - -using namespace clang; -using namespace clang::cxstring; - -namespace { - /// \brief Stored representation of a completion string. - /// - /// This is the representation behind a CXCompletionString. - class CXStoredCodeCompletionString : public CodeCompletionString { - unsigned Priority; - CXAvailabilityKind Availability; - - public: - CXStoredCodeCompletionString(unsigned Priority, - CXAvailabilityKind Availability) - : Priority(Priority), Availability(Availability) { } - - unsigned getPriority() const { return Priority; } - CXAvailabilityKind getAvailability() const { return Availability; } - }; -} - -extern "C" { - -enum CXCompletionChunkKind -clang_getCompletionChunkKind(CXCompletionString completion_string, - unsigned chunk_number) { - CXStoredCodeCompletionString *CCStr - = (CXStoredCodeCompletionString *)completion_string; - if (!CCStr || chunk_number >= CCStr->size()) - return CXCompletionChunk_Text; - - switch ((*CCStr)[chunk_number].Kind) { - case CodeCompletionString::CK_TypedText: - return CXCompletionChunk_TypedText; - case CodeCompletionString::CK_Text: - return CXCompletionChunk_Text; - case CodeCompletionString::CK_Optional: - return CXCompletionChunk_Optional; - case CodeCompletionString::CK_Placeholder: - return CXCompletionChunk_Placeholder; - case CodeCompletionString::CK_Informative: - return CXCompletionChunk_Informative; - case CodeCompletionString::CK_ResultType: - return CXCompletionChunk_ResultType; - case CodeCompletionString::CK_CurrentParameter: - return CXCompletionChunk_CurrentParameter; - case CodeCompletionString::CK_LeftParen: - return CXCompletionChunk_LeftParen; - case CodeCompletionString::CK_RightParen: - return CXCompletionChunk_RightParen; - case CodeCompletionString::CK_LeftBracket: - return CXCompletionChunk_LeftBracket; - case CodeCompletionString::CK_RightBracket: - return CXCompletionChunk_RightBracket; - case CodeCompletionString::CK_LeftBrace: - return CXCompletionChunk_LeftBrace; - case CodeCompletionString::CK_RightBrace: - return CXCompletionChunk_RightBrace; - case CodeCompletionString::CK_LeftAngle: - return CXCompletionChunk_LeftAngle; - case CodeCompletionString::CK_RightAngle: - return CXCompletionChunk_RightAngle; - case CodeCompletionString::CK_Comma: - return CXCompletionChunk_Comma; - case CodeCompletionString::CK_Colon: - return CXCompletionChunk_Colon; - case CodeCompletionString::CK_SemiColon: - return CXCompletionChunk_SemiColon; - case CodeCompletionString::CK_Equal: - return CXCompletionChunk_Equal; - case CodeCompletionString::CK_HorizontalSpace: - return CXCompletionChunk_HorizontalSpace; - case CodeCompletionString::CK_VerticalSpace: - return CXCompletionChunk_VerticalSpace; - } - - // Should be unreachable, but let's be careful. - return CXCompletionChunk_Text; -} - -CXString clang_getCompletionChunkText(CXCompletionString completion_string, - unsigned chunk_number) { - CXStoredCodeCompletionString *CCStr - = (CXStoredCodeCompletionString *)completion_string; - if (!CCStr || chunk_number >= CCStr->size()) - return createCXString(0); - - switch ((*CCStr)[chunk_number].Kind) { - case CodeCompletionString::CK_TypedText: - case CodeCompletionString::CK_Text: - case CodeCompletionString::CK_Placeholder: - case CodeCompletionString::CK_CurrentParameter: - case CodeCompletionString::CK_Informative: - case CodeCompletionString::CK_LeftParen: - case CodeCompletionString::CK_RightParen: - case CodeCompletionString::CK_LeftBracket: - case CodeCompletionString::CK_RightBracket: - case CodeCompletionString::CK_LeftBrace: - case CodeCompletionString::CK_RightBrace: - case CodeCompletionString::CK_LeftAngle: - case CodeCompletionString::CK_RightAngle: - case CodeCompletionString::CK_Comma: - case CodeCompletionString::CK_ResultType: - case CodeCompletionString::CK_Colon: - case CodeCompletionString::CK_SemiColon: - case CodeCompletionString::CK_Equal: - case CodeCompletionString::CK_HorizontalSpace: - return createCXString((*CCStr)[chunk_number].Text, false); - - case CodeCompletionString::CK_VerticalSpace: - // FIXME: Temporary hack until we figure out how to handle vertical space. - return createCXString(" "); - - case CodeCompletionString::CK_Optional: - // Note: treated as an empty text block. - return createCXString(""); - } - - // Should be unreachable, but let's be careful. - return createCXString(0); -} - - -CXCompletionString -clang_getCompletionChunkCompletionString(CXCompletionString completion_string, - unsigned chunk_number) { - CXStoredCodeCompletionString *CCStr - = (CXStoredCodeCompletionString *)completion_string; - if (!CCStr || chunk_number >= CCStr->size()) - return 0; - - switch ((*CCStr)[chunk_number].Kind) { - case CodeCompletionString::CK_TypedText: - case CodeCompletionString::CK_Text: - case CodeCompletionString::CK_Placeholder: - case CodeCompletionString::CK_CurrentParameter: - case CodeCompletionString::CK_Informative: - case CodeCompletionString::CK_LeftParen: - case CodeCompletionString::CK_RightParen: - case CodeCompletionString::CK_LeftBracket: - case CodeCompletionString::CK_RightBracket: - case CodeCompletionString::CK_LeftBrace: - case CodeCompletionString::CK_RightBrace: - case CodeCompletionString::CK_LeftAngle: - case CodeCompletionString::CK_RightAngle: - case CodeCompletionString::CK_Comma: - case CodeCompletionString::CK_ResultType: - case CodeCompletionString::CK_Colon: - case CodeCompletionString::CK_SemiColon: - case CodeCompletionString::CK_Equal: - case CodeCompletionString::CK_HorizontalSpace: - case CodeCompletionString::CK_VerticalSpace: - return 0; - - case CodeCompletionString::CK_Optional: - // Note: treated as an empty text block. - return (*CCStr)[chunk_number].Optional; - } - - // Should be unreachable, but let's be careful. - return 0; -} - -unsigned clang_getNumCompletionChunks(CXCompletionString completion_string) { - CXStoredCodeCompletionString *CCStr - = (CXStoredCodeCompletionString *)completion_string; - return CCStr? CCStr->size() : 0; -} - -unsigned clang_getCompletionPriority(CXCompletionString completion_string) { - CXStoredCodeCompletionString *CCStr - = (CXStoredCodeCompletionString *)completion_string; - return CCStr? CCStr->getPriority() : unsigned(CCP_Unlikely); -} - -enum CXAvailabilityKind -clang_getCompletionAvailability(CXCompletionString completion_string) { - CXStoredCodeCompletionString *CCStr - = (CXStoredCodeCompletionString *)completion_string; - return CCStr? CCStr->getAvailability() : CXAvailability_Available; -} - -static bool ReadUnsigned(const char *&Memory, const char *MemoryEnd, - unsigned &Value) { - if (Memory + sizeof(unsigned) > MemoryEnd) - return true; - - memmove(&Value, Memory, sizeof(unsigned)); - Memory += sizeof(unsigned); - return false; -} - -/// \brief The CXCodeCompleteResults structure we allocate internally; -/// the client only sees the initial CXCodeCompleteResults structure. -struct AllocatedCXCodeCompleteResults : public CXCodeCompleteResults { - AllocatedCXCodeCompleteResults(); - ~AllocatedCXCodeCompleteResults(); - - /// \brief Diagnostics produced while performing code completion. - llvm::SmallVector Diagnostics; - - /// \brief Diag object - llvm::IntrusiveRefCntPtr Diag; - - /// \brief Language options used to adjust source locations. - LangOptions LangOpts; - - /// \brief Source manager, used for diagnostics. - SourceManager SourceMgr; - - /// \brief File manager, used for diagnostics. - FileManager FileMgr; - - /// \brief Temporary files that should be removed once we have finished - /// with the code-completion results. - std::vector TemporaryFiles; - - /// \brief Temporary buffers that will be deleted once we have finished with the code-completion results. - llvm::SmallVector TemporaryBuffers; -}; - -AllocatedCXCodeCompleteResults::AllocatedCXCodeCompleteResults() - : CXCodeCompleteResults(), Diag(new Diagnostic), SourceMgr(*Diag) { } - -AllocatedCXCodeCompleteResults::~AllocatedCXCodeCompleteResults() { - for (unsigned I = 0, N = NumResults; I != N; ++I) - delete (CXStoredCodeCompletionString *)Results[I].CompletionString; - delete [] Results; - - for (unsigned I = 0, N = TemporaryFiles.size(); I != N; ++I) - TemporaryFiles[I].eraseFromDisk(); - for (unsigned I = 0, N = TemporaryBuffers.size(); I != N; ++I) - delete TemporaryBuffers[I]; -} - -CXCodeCompleteResults *clang_codeComplete(CXIndex CIdx, - const char *source_filename, - int num_command_line_args, - const char * const *command_line_args, - unsigned num_unsaved_files, - struct CXUnsavedFile *unsaved_files, - const char *complete_filename, - unsigned complete_line, - unsigned complete_column) { -#ifdef UDP_CODE_COMPLETION_LOGGER -#ifdef UDP_CODE_COMPLETION_LOGGER_PORT - const llvm::TimeRecord &StartTime = llvm::TimeRecord::getCurrentTime(); -#endif -#endif - - bool EnableLogging = getenv("LIBCLANG_CODE_COMPLETION_LOGGING") != 0; - - llvm::OwningPtr CCTimer; - if (getenv("LIBCLANG_TIMING")) { - llvm::SmallString<128> TimerName; - llvm::raw_svector_ostream TimerNameOut(TimerName); - TimerNameOut << "Code completion (out-of-process) @ " << complete_filename - << ":" << complete_line << ":" << complete_column; - CCTimer.reset(new llvm::NamedRegionTimer(TimerNameOut.str())); - } - - // The indexer, which is mainly used to determine where diagnostics go. - CIndexer *CXXIdx = static_cast(CIdx); - - // Configure the diagnostics. - DiagnosticOptions DiagOpts; - llvm::IntrusiveRefCntPtr Diags; - Diags = CompilerInstance::createDiagnostics(DiagOpts, 0, 0); - - // The set of temporary files that we've built. - std::vector TemporaryFiles; - - // Build up the arguments for invoking 'clang'. - std::vector argv; - - // First add the complete path to the 'clang' executable. - llvm::sys::Path ClangPath = CXXIdx->getClangPath(); - argv.push_back(ClangPath.c_str()); - - // Always use Clang C++ support. - argv.push_back("-ccc-clang-cxx"); - - // Add the '-fsyntax-only' argument so that we only perform a basic - // syntax check of the code. - argv.push_back("-fsyntax-only"); - - // Add the appropriate '-code-completion-at=file:line:column' argument - // to perform code completion, with an "-Xclang" preceding it. - std::string code_complete_at; - code_complete_at += complete_filename; - code_complete_at += ":"; - code_complete_at += llvm::utostr(complete_line); - code_complete_at += ":"; - code_complete_at += llvm::utostr(complete_column); - argv.push_back("-Xclang"); - argv.push_back("-code-completion-at"); - argv.push_back("-Xclang"); - argv.push_back(code_complete_at.c_str()); - argv.push_back("-Xclang"); - argv.push_back("-no-code-completion-debug-printer"); - argv.push_back("-Xclang"); - argv.push_back("-code-completion-macros"); - argv.push_back("-fdiagnostics-binary"); - - // Remap any unsaved files to temporary files. - std::vector RemapArgs; - if (RemapFiles(num_unsaved_files, unsaved_files, RemapArgs, TemporaryFiles)) - return 0; - - // The pointers into the elements of RemapArgs are stable because we - // won't be adding anything to RemapArgs after this point. - for (unsigned i = 0, e = RemapArgs.size(); i != e; ++i) - argv.push_back(RemapArgs[i].c_str()); - - // Add the source file name (FIXME: later, we'll want to build temporary - // file from the buffer, or just feed the source text via standard input). - if (source_filename) - argv.push_back(source_filename); - - // Process the compiler options, stripping off '-o', '-c', '-fsyntax-only'. - for (int i = 0; i < num_command_line_args; ++i) - if (const char *arg = command_line_args[i]) { - if (strcmp(arg, "-o") == 0) { - ++i; // Also skip the matching argument. - continue; - } - if (strcmp(arg, "-emit-ast") == 0 || - strcmp(arg, "-c") == 0 || - strcmp(arg, "-fsyntax-only") == 0) { - continue; - } - - // Keep the argument. - argv.push_back(arg); - } - - if (EnableLogging) { - std::string Log = ClangPath.str(); - for (unsigned I = 0, N = argv.size(); I != N; ++I) { - Log += ' '; - Log += argv[I]; - } - fprintf(stderr, "libclang (Code Completion): %s\n", Log.c_str()); - } - - // Add the null terminator. - argv.push_back(NULL); - - // Generate a temporary name for the code-completion results file. - char tmpFile[L_tmpnam]; - char *tmpFileName = tmpnam(tmpFile); - llvm::sys::Path ResultsFile(tmpFileName); - TemporaryFiles.push_back(ResultsFile); - - // Generate a temporary name for the diagnostics file. - char tmpFileResults[L_tmpnam]; - char *tmpResultsFileName = tmpnam(tmpFileResults); - llvm::sys::Path DiagnosticsFile(tmpResultsFileName); - TemporaryFiles.push_back(DiagnosticsFile); - - - - // Invoke 'clang'. - llvm::sys::Path DevNull; // leave empty, causes redirection to /dev/null - // on Unix or NUL (Windows). - std::string ErrMsg; - const llvm::sys::Path *Redirects[] = { &DevNull, &ResultsFile, - &DiagnosticsFile, 0 }; - llvm::sys::Program::ExecuteAndWait(ClangPath, &argv[0], /* env */ NULL, - /* redirects */ &Redirects[0], - /* secondsToWait */ 0, - /* memoryLimits */ 0, &ErrMsg); - - if (!ErrMsg.empty()) { - std::string AllArgs; - for (std::vector::iterator I = argv.begin(), E = argv.end(); - I != E; ++I) { - AllArgs += ' '; - if (*I) - AllArgs += *I; - } - - Diags->Report(diag::err_fe_invoking) << AllArgs << ErrMsg; - } - - // Parse the resulting source file to find code-completion results. - using llvm::MemoryBuffer; - using llvm::StringRef; - AllocatedCXCodeCompleteResults *Results = new AllocatedCXCodeCompleteResults; - Results->Results = 0; - Results->NumResults = 0; - // FIXME: Set Results->LangOpts! - if (MemoryBuffer *F = MemoryBuffer::getFile(ResultsFile.c_str())) { - llvm::SmallVector CompletionResults; - StringRef Buffer = F->getBuffer(); - for (const char *Str = Buffer.data(), *StrEnd = Str + Buffer.size(); - Str < StrEnd;) { - unsigned KindValue; - if (ReadUnsigned(Str, StrEnd, KindValue)) - break; - - unsigned Priority; - if (ReadUnsigned(Str, StrEnd, Priority)) - break; - - unsigned Availability; - if (ReadUnsigned(Str, StrEnd, Availability)) - break; - - CXStoredCodeCompletionString *CCStr - = new CXStoredCodeCompletionString(Priority, - (CXAvailabilityKind)Availability); - if (!CCStr->Deserialize(Str, StrEnd)) { - delete CCStr; - continue; - } - - if (!CCStr->empty()) { - // Vend the code-completion result to the caller. - CXCompletionResult Result; - Result.CursorKind = (CXCursorKind)KindValue; - Result.CompletionString = CCStr; - CompletionResults.push_back(Result); - } - }; - - // Allocate the results. - Results->Results = new CXCompletionResult [CompletionResults.size()]; - Results->NumResults = CompletionResults.size(); - memcpy(Results->Results, CompletionResults.data(), - CompletionResults.size() * sizeof(CXCompletionResult)); - Results->TemporaryBuffers.push_back(F); - } - - LoadSerializedDiagnostics(DiagnosticsFile, num_unsaved_files, unsaved_files, - Results->FileMgr, Results->SourceMgr, - Results->Diagnostics); - - // Make sure we delete temporary files when the code-completion results are - // destroyed. - Results->TemporaryFiles.swap(TemporaryFiles); - -#ifdef UDP_CODE_COMPLETION_LOGGER -#ifdef UDP_CODE_COMPLETION_LOGGER_PORT - const llvm::TimeRecord &EndTime = llvm::TimeRecord::getCurrentTime(); - llvm::SmallString<256> LogResult; - llvm::raw_svector_ostream os(LogResult); - - // Figure out the language and whether or not it uses PCH. - const char *lang = 0; - bool usesPCH = false; - - for (std::vector::iterator I = argv.begin(), E = argv.end(); - I != E; ++I) { - if (*I == 0) - continue; - if (strcmp(*I, "-x") == 0) { - if (I + 1 != E) { - lang = *(++I); - continue; - } - } - else if (strcmp(*I, "-include") == 0) { - if (I+1 != E) { - const char *arg = *(++I); - llvm::SmallString<512> pchName; - { - llvm::raw_svector_ostream os(pchName); - os << arg << ".pth"; - } - pchName.push_back('\0'); - struct stat stat_results; - if (stat(pchName.data(), &stat_results) == 0) - usesPCH = true; - continue; - } - } - } - - os << "{ "; - os << "\"wall\": " << (EndTime.getWallTime() - StartTime.getWallTime()); - os << ", \"numRes\": " << Results->NumResults; - os << ", \"diags\": " << Results->Diagnostics.size(); - os << ", \"pch\": " << (usesPCH ? "true" : "false"); - os << ", \"lang\": \"" << (lang ? lang : "") << '"'; - const char *name = getlogin(); - os << ", \"user\": \"" << (name ? name : "unknown") << '"'; - os << ", \"clangVer\": \"" << getClangFullVersion() << '"'; - os << " }"; - - llvm::StringRef res = os.str(); - if (res.size() > 0) { - do { - // Setup the UDP socket. - struct sockaddr_in servaddr; - bzero(&servaddr, sizeof(servaddr)); - servaddr.sin_family = AF_INET; - servaddr.sin_port = htons(UDP_CODE_COMPLETION_LOGGER_PORT); - if (inet_pton(AF_INET, UDP_CODE_COMPLETION_LOGGER, - &servaddr.sin_addr) <= 0) - break; - - int sockfd = socket(AF_INET, SOCK_DGRAM, 0); - if (sockfd < 0) - break; - - sendto(sockfd, res.data(), res.size(), 0, - (struct sockaddr *)&servaddr, sizeof(servaddr)); - close(sockfd); - } - while (false); - } -#endif -#endif - clang_sortCodeCompletionResults(Results->Results, Results->NumResults); - return Results; -} - -} // end extern "C" - -namespace { - class CaptureCompletionResults : public CodeCompleteConsumer { - AllocatedCXCodeCompleteResults &AllocatedResults; - - public: - explicit CaptureCompletionResults(AllocatedCXCodeCompleteResults &Results) - : CodeCompleteConsumer(true, false, true, false), - AllocatedResults(Results) { } - - virtual void ProcessCodeCompleteResults(Sema &S, - CodeCompletionContext Context, - CodeCompletionResult *Results, - unsigned NumResults) { - AllocatedResults.Results = new CXCompletionResult [NumResults]; - AllocatedResults.NumResults = NumResults; - for (unsigned I = 0; I != NumResults; ++I) { - CXStoredCodeCompletionString *StoredCompletion - = new CXStoredCodeCompletionString(Results[I].Priority, - Results[I].Availability); - (void)Results[I].CreateCodeCompletionString(S, StoredCompletion); - AllocatedResults.Results[I].CursorKind = Results[I].CursorKind; - AllocatedResults.Results[I].CompletionString = StoredCompletion; - } - } - - // FIXME: Add ProcessOverloadCandidates? - }; -} - -extern "C" { -struct CodeCompleteAtInfo { - CXTranslationUnit TU; - const char *complete_filename; - unsigned complete_line; - unsigned complete_column; - struct CXUnsavedFile *unsaved_files; - unsigned num_unsaved_files; - unsigned options; - CXCodeCompleteResults *result; -}; -void clang_codeCompleteAt_Impl(void *UserData) { - CodeCompleteAtInfo *CCAI = static_cast(UserData); - CXTranslationUnit TU = CCAI->TU; - const char *complete_filename = CCAI->complete_filename; - unsigned complete_line = CCAI->complete_line; - unsigned complete_column = CCAI->complete_column; - struct CXUnsavedFile *unsaved_files = CCAI->unsaved_files; - unsigned num_unsaved_files = CCAI->num_unsaved_files; - unsigned options = CCAI->options; - CCAI->result = 0; - -#ifdef UDP_CODE_COMPLETION_LOGGER -#ifdef UDP_CODE_COMPLETION_LOGGER_PORT - const llvm::TimeRecord &StartTime = llvm::TimeRecord::getCurrentTime(); -#endif -#endif - - bool EnableLogging = getenv("LIBCLANG_CODE_COMPLETION_LOGGING") != 0; - - ASTUnit *AST = static_cast(TU); - if (!AST) - return; - - // Perform the remapping of source files. - llvm::SmallVector RemappedFiles; - for (unsigned I = 0; I != num_unsaved_files; ++I) { - llvm::StringRef Data(unsaved_files[I].Contents, unsaved_files[I].Length); - const llvm::MemoryBuffer *Buffer - = llvm::MemoryBuffer::getMemBufferCopy(Data, unsaved_files[I].Filename); - RemappedFiles.push_back(std::make_pair(unsaved_files[I].Filename, - Buffer)); - } - - if (EnableLogging) { - // FIXME: Add logging. - } - - // Parse the resulting source file to find code-completion results. - AllocatedCXCodeCompleteResults *Results = new AllocatedCXCodeCompleteResults; - Results->Results = 0; - Results->NumResults = 0; - - // Create a code-completion consumer to capture the results. - CaptureCompletionResults Capture(*Results); - - // Perform completion. - AST->CodeComplete(complete_filename, complete_line, complete_column, - RemappedFiles.data(), RemappedFiles.size(), - (options & CXCodeComplete_IncludeMacros), - (options & CXCodeComplete_IncludeCodePatterns), - Capture, - *Results->Diag, Results->LangOpts, Results->SourceMgr, - Results->FileMgr, Results->Diagnostics, - Results->TemporaryBuffers); - - - -#ifdef UDP_CODE_COMPLETION_LOGGER -#ifdef UDP_CODE_COMPLETION_LOGGER_PORT - const llvm::TimeRecord &EndTime = llvm::TimeRecord::getCurrentTime(); - llvm::SmallString<256> LogResult; - llvm::raw_svector_ostream os(LogResult); - - // Figure out the language and whether or not it uses PCH. - const char *lang = 0; - bool usesPCH = false; - - for (std::vector::iterator I = argv.begin(), E = argv.end(); - I != E; ++I) { - if (*I == 0) - continue; - if (strcmp(*I, "-x") == 0) { - if (I + 1 != E) { - lang = *(++I); - continue; - } - } - else if (strcmp(*I, "-include") == 0) { - if (I+1 != E) { - const char *arg = *(++I); - llvm::SmallString<512> pchName; - { - llvm::raw_svector_ostream os(pchName); - os << arg << ".pth"; - } - pchName.push_back('\0'); - struct stat stat_results; - if (stat(pchName.data(), &stat_results) == 0) - usesPCH = true; - continue; - } - } - } - - os << "{ "; - os << "\"wall\": " << (EndTime.getWallTime() - StartTime.getWallTime()); - os << ", \"numRes\": " << Results->NumResults; - os << ", \"diags\": " << Results->Diagnostics.size(); - os << ", \"pch\": " << (usesPCH ? "true" : "false"); - os << ", \"lang\": \"" << (lang ? lang : "") << '"'; - const char *name = getlogin(); - os << ", \"user\": \"" << (name ? name : "unknown") << '"'; - os << ", \"clangVer\": \"" << getClangFullVersion() << '"'; - os << " }"; - - llvm::StringRef res = os.str(); - if (res.size() > 0) { - do { - // Setup the UDP socket. - struct sockaddr_in servaddr; - bzero(&servaddr, sizeof(servaddr)); - servaddr.sin_family = AF_INET; - servaddr.sin_port = htons(UDP_CODE_COMPLETION_LOGGER_PORT); - if (inet_pton(AF_INET, UDP_CODE_COMPLETION_LOGGER, - &servaddr.sin_addr) <= 0) - break; - - int sockfd = socket(AF_INET, SOCK_DGRAM, 0); - if (sockfd < 0) - break; - - sendto(sockfd, res.data(), res.size(), 0, - (struct sockaddr *)&servaddr, sizeof(servaddr)); - close(sockfd); - } - while (false); - } -#endif -#endif - CCAI->result = Results; -} -CXCodeCompleteResults *clang_codeCompleteAt(CXTranslationUnit TU, - const char *complete_filename, - unsigned complete_line, - unsigned complete_column, - struct CXUnsavedFile *unsaved_files, - unsigned num_unsaved_files, - unsigned options) { - CodeCompleteAtInfo CCAI = { TU, complete_filename, complete_line, - complete_column, unsaved_files, num_unsaved_files, - options, 0 }; - llvm::CrashRecoveryContext CRC; - - if (!CRC.RunSafely(clang_codeCompleteAt_Impl, &CCAI)) { - fprintf(stderr, "libclang: crash detected in code completion\n"); - static_cast(TU)->setUnsafeToFree(true); - return 0; - } - - return CCAI.result; -} - -unsigned clang_defaultCodeCompleteOptions(void) { - return CXCodeComplete_IncludeMacros; -} - -void clang_disposeCodeCompleteResults(CXCodeCompleteResults *ResultsIn) { - if (!ResultsIn) - return; - - AllocatedCXCodeCompleteResults *Results - = static_cast(ResultsIn); - delete Results; -} - -unsigned -clang_codeCompleteGetNumDiagnostics(CXCodeCompleteResults *ResultsIn) { - AllocatedCXCodeCompleteResults *Results - = static_cast(ResultsIn); - if (!Results) - return 0; - - return Results->Diagnostics.size(); -} - -CXDiagnostic -clang_codeCompleteGetDiagnostic(CXCodeCompleteResults *ResultsIn, - unsigned Index) { - AllocatedCXCodeCompleteResults *Results - = static_cast(ResultsIn); - if (!Results || Index >= Results->Diagnostics.size()) - return 0; - - return new CXStoredDiagnostic(Results->Diagnostics[Index], Results->LangOpts); -} - - -} // end extern "C" - -namespace { - struct OrderCompletionResults { - bool operator()(const CXCompletionResult &XR, - const CXCompletionResult &YR) const { - CXStoredCodeCompletionString *X - = (CXStoredCodeCompletionString *)XR.CompletionString; - CXStoredCodeCompletionString *Y - = (CXStoredCodeCompletionString *)YR.CompletionString; - - const char *XText = X->getTypedText(); - const char *YText = Y->getTypedText(); - if (!XText || !YText) - return XText != 0; - - int result = llvm::StringRef(XText).compare_lower(YText); - if (result < 0) - return true; - if (result > 0) - return false; - - result = llvm::StringRef(XText).compare(YText); - return result; - } - }; -} - -extern "C" { - void clang_sortCodeCompletionResults(CXCompletionResult *Results, - unsigned NumResults) { - std::stable_sort(Results, Results + NumResults, OrderCompletionResults()); - } -} diff --git a/contrib/llvm/tools/clang/tools/libclang/CIndexDiagnostic.cpp b/contrib/llvm/tools/clang/tools/libclang/CIndexDiagnostic.cpp deleted file mode 100644 index 531992efebce..000000000000 --- a/contrib/llvm/tools/clang/tools/libclang/CIndexDiagnostic.cpp +++ /dev/null @@ -1,272 +0,0 @@ -/*===-- CIndexDiagnostics.cpp - Diagnostics C Interface ---------*- C++ -*-===*\ -|* *| -|* The LLVM Compiler Infrastructure *| -|* *| -|* This file is distributed under the University of Illinois Open Source *| -|* License. See LICENSE.TXT for details. *| -|* *| -|*===----------------------------------------------------------------------===*| -|* *| -|* Implements the diagnostic functions of the Clang C interface. *| -|* *| -\*===----------------------------------------------------------------------===*/ -#include "CIndexDiagnostic.h" -#include "CIndexer.h" -#include "CXSourceLocation.h" - -#include "clang/Frontend/ASTUnit.h" -#include "clang/Frontend/FrontendDiagnostic.h" -#include "llvm/ADT/SmallString.h" -#include "llvm/ADT/Twine.h" -#include "llvm/Support/MemoryBuffer.h" -#include "llvm/Support/raw_ostream.h" - -using namespace clang; -using namespace clang::cxloc; -using namespace clang::cxstring; -using namespace llvm; - -//----------------------------------------------------------------------------- -// C Interface Routines -//----------------------------------------------------------------------------- -extern "C" { - -unsigned clang_getNumDiagnostics(CXTranslationUnit Unit) { - ASTUnit *CXXUnit = static_cast(Unit); - return CXXUnit? CXXUnit->stored_diag_size() : 0; -} - -CXDiagnostic clang_getDiagnostic(CXTranslationUnit Unit, unsigned Index) { - ASTUnit *CXXUnit = static_cast(Unit); - if (!CXXUnit || Index >= CXXUnit->stored_diag_size()) - return 0; - - return new CXStoredDiagnostic(CXXUnit->stored_diag_begin()[Index], - CXXUnit->getASTContext().getLangOptions()); -} - -void clang_disposeDiagnostic(CXDiagnostic Diagnostic) { - CXStoredDiagnostic *Stored = static_cast(Diagnostic); - delete Stored; -} - -CXString clang_formatDiagnostic(CXDiagnostic Diagnostic, unsigned Options) { - if (!Diagnostic) - return createCXString(""); - - CXDiagnosticSeverity Severity = clang_getDiagnosticSeverity(Diagnostic); - - // Ignore diagnostics that should be ignored. - if (Severity == CXDiagnostic_Ignored) - return createCXString(""); - - llvm::SmallString<256> Str; - llvm::raw_svector_ostream Out(Str); - - if (Options & CXDiagnostic_DisplaySourceLocation) { - // Print source location (file:line), along with optional column - // and source ranges. - CXFile File; - unsigned Line, Column; - clang_getInstantiationLocation(clang_getDiagnosticLocation(Diagnostic), - &File, &Line, &Column, 0); - if (File) { - CXString FName = clang_getFileName(File); - Out << clang_getCString(FName) << ":" << Line << ":"; - clang_disposeString(FName); - if (Options & CXDiagnostic_DisplayColumn) - Out << Column << ":"; - - if (Options & CXDiagnostic_DisplaySourceRanges) { - unsigned N = clang_getDiagnosticNumRanges(Diagnostic); - bool PrintedRange = false; - for (unsigned I = 0; I != N; ++I) { - CXFile StartFile, EndFile; - CXSourceRange Range = clang_getDiagnosticRange(Diagnostic, I); - - unsigned StartLine, StartColumn, EndLine, EndColumn; - clang_getInstantiationLocation(clang_getRangeStart(Range), - &StartFile, &StartLine, &StartColumn, - 0); - clang_getInstantiationLocation(clang_getRangeEnd(Range), - &EndFile, &EndLine, &EndColumn, 0); - - if (StartFile != EndFile || StartFile != File) - continue; - - Out << "{" << StartLine << ":" << StartColumn << "-" - << EndLine << ":" << EndColumn << "}"; - PrintedRange = true; - } - if (PrintedRange) - Out << ":"; - } - } - - Out << " "; - } - - /* Print warning/error/etc. */ - switch (Severity) { - case CXDiagnostic_Ignored: assert(0 && "impossible"); break; - case CXDiagnostic_Note: Out << "note: "; break; - case CXDiagnostic_Warning: Out << "warning: "; break; - case CXDiagnostic_Error: Out << "error: "; break; - case CXDiagnostic_Fatal: Out << "fatal error: "; break; - } - - CXString Text = clang_getDiagnosticSpelling(Diagnostic); - if (clang_getCString(Text)) - Out << clang_getCString(Text); - else - Out << ""; - clang_disposeString(Text); - return createCXString(Out.str(), true); -} - -unsigned clang_defaultDiagnosticDisplayOptions() { - return CXDiagnostic_DisplaySourceLocation | CXDiagnostic_DisplayColumn; -} - -enum CXDiagnosticSeverity clang_getDiagnosticSeverity(CXDiagnostic Diag) { - CXStoredDiagnostic *StoredDiag = static_cast(Diag); - if (!StoredDiag) - return CXDiagnostic_Ignored; - - switch (StoredDiag->Diag.getLevel()) { - case Diagnostic::Ignored: return CXDiagnostic_Ignored; - case Diagnostic::Note: return CXDiagnostic_Note; - case Diagnostic::Warning: return CXDiagnostic_Warning; - case Diagnostic::Error: return CXDiagnostic_Error; - case Diagnostic::Fatal: return CXDiagnostic_Fatal; - } - - llvm_unreachable("Invalid diagnostic level"); - return CXDiagnostic_Ignored; -} - -CXSourceLocation clang_getDiagnosticLocation(CXDiagnostic Diag) { - CXStoredDiagnostic *StoredDiag = static_cast(Diag); - if (!StoredDiag || StoredDiag->Diag.getLocation().isInvalid()) - return clang_getNullLocation(); - - return translateSourceLocation(StoredDiag->Diag.getLocation().getManager(), - StoredDiag->LangOpts, - StoredDiag->Diag.getLocation()); -} - -CXString clang_getDiagnosticSpelling(CXDiagnostic Diag) { - CXStoredDiagnostic *StoredDiag = static_cast(Diag); - if (!StoredDiag) - return createCXString(""); - - return createCXString(StoredDiag->Diag.getMessage(), false); -} - -unsigned clang_getDiagnosticNumRanges(CXDiagnostic Diag) { - CXStoredDiagnostic *StoredDiag = static_cast(Diag); - if (!StoredDiag || StoredDiag->Diag.getLocation().isInvalid()) - return 0; - - return StoredDiag->Diag.range_size(); -} - -CXSourceRange clang_getDiagnosticRange(CXDiagnostic Diag, unsigned Range) { - CXStoredDiagnostic *StoredDiag = static_cast(Diag); - if (!StoredDiag || Range >= StoredDiag->Diag.range_size() || - StoredDiag->Diag.getLocation().isInvalid()) - return clang_getNullRange(); - - return translateSourceRange(StoredDiag->Diag.getLocation().getManager(), - StoredDiag->LangOpts, - StoredDiag->Diag.range_begin()[Range]); -} - -unsigned clang_getDiagnosticNumFixIts(CXDiagnostic Diag) { - CXStoredDiagnostic *StoredDiag = static_cast(Diag); - if (!StoredDiag) - return 0; - - return StoredDiag->Diag.fixit_size(); -} - -CXString clang_getDiagnosticFixIt(CXDiagnostic Diagnostic, unsigned FixIt, - CXSourceRange *ReplacementRange) { - CXStoredDiagnostic *StoredDiag - = static_cast(Diagnostic); - if (!StoredDiag || FixIt >= StoredDiag->Diag.fixit_size() || - StoredDiag->Diag.getLocation().isInvalid()) { - if (ReplacementRange) - *ReplacementRange = clang_getNullRange(); - - return createCXString(""); - } - - const FixItHint &Hint = StoredDiag->Diag.fixit_begin()[FixIt]; - if (ReplacementRange) { - // Create a range that covers the entire replacement (or - // removal) range, adjusting the end of the range to point to - // the end of the token. - *ReplacementRange - = translateSourceRange(StoredDiag->Diag.getLocation().getManager(), - StoredDiag->LangOpts, - Hint.RemoveRange); - } - - return createCXString(Hint.CodeToInsert); -} - -} // end extern "C" - -void clang::LoadSerializedDiagnostics(const llvm::sys::Path &DiagnosticsPath, - unsigned num_unsaved_files, - struct CXUnsavedFile *unsaved_files, - FileManager &FileMgr, - SourceManager &SourceMgr, - SmallVectorImpl &Diags) { - using llvm::MemoryBuffer; - using llvm::StringRef; - MemoryBuffer *F = MemoryBuffer::getFile(DiagnosticsPath.c_str()); - if (!F) - return; - - // Enter the unsaved files into the file manager. - for (unsigned I = 0; I != num_unsaved_files; ++I) { - const FileEntry *File = FileMgr.getVirtualFile(unsaved_files[I].Filename, - unsaved_files[I].Length, - 0); - if (!File) { - // FIXME: Hard to localize when we have no diagnostics engine! - Diags.push_back(StoredDiagnostic(Diagnostic::Fatal, - (Twine("could not remap from missing file ") + - unsaved_files[I].Filename).str())); - delete F; - return; - } - - MemoryBuffer *Buffer - = MemoryBuffer::getMemBuffer(unsaved_files[I].Contents, - unsaved_files[I].Contents + unsaved_files[I].Length); - if (!Buffer) { - delete F; - return; - } - - SourceMgr.overrideFileContents(File, Buffer); - SourceMgr.createFileID(File, SourceLocation(), SrcMgr::C_User); - } - - // Parse the diagnostics, emitting them one by one until we've - // exhausted the data. - StringRef Buffer = F->getBuffer(); - const char *Memory = Buffer.data(), *MemoryEnd = Memory + Buffer.size(); - while (Memory != MemoryEnd) { - StoredDiagnostic Stored = StoredDiagnostic::Deserialize(FileMgr, SourceMgr, - Memory, MemoryEnd); - if (!Stored) - break; - - Diags.push_back(Stored); - } - delete F; -} diff --git a/contrib/llvm/tools/clang/tools/libclang/CIndexDiagnostic.h b/contrib/llvm/tools/clang/tools/libclang/CIndexDiagnostic.h deleted file mode 100644 index 919c21cfdbe4..000000000000 --- a/contrib/llvm/tools/clang/tools/libclang/CIndexDiagnostic.h +++ /dev/null @@ -1,53 +0,0 @@ -/*===-- CIndexDiagnostic.h - Diagnostics C Interface ------------*- C++ -*-===*\ -|* *| -|* The LLVM Compiler Infrastructure *| -|* *| -|* This file is distributed under the University of Illinois Open Source *| -|* License. See LICENSE.TXT for details. *| -|* *| -|*===----------------------------------------------------------------------===*| -|* *| -|* Implements the diagnostic functions of the Clang C interface. *| -|* *| -\*===----------------------------------------------------------------------===*/ -#ifndef LLVM_CLANG_CINDEX_DIAGNOSTIC_H -#define LLVM_CLANG_CINDEX_DIAGNOSTIC_H - -struct CXUnsavedFile; - -namespace llvm { -template class SmallVectorImpl; -namespace sys { class Path; } -} - -namespace clang { - -class Diagnostic; -class FileManager; -class LangOptions; -class Preprocessor; -class StoredDiagnostic; -class SourceManager; - -/// \brief The storage behind a CXDiagnostic -struct CXStoredDiagnostic { - const StoredDiagnostic &Diag; - const LangOptions &LangOpts; - - CXStoredDiagnostic(const StoredDiagnostic &Diag, - const LangOptions &LangOpts) - : Diag(Diag), LangOpts(LangOpts) { } -}; - -/// \brief Given the path to a file that contains binary, serialized -/// diagnostics produced by Clang, load those diagnostics. -void LoadSerializedDiagnostics(const llvm::sys::Path &DiagnosticsPath, - unsigned num_unsaved_files, - struct CXUnsavedFile *unsaved_files, - FileManager &FileMgr, - SourceManager &SourceMgr, - llvm::SmallVectorImpl &Diags); - -} // end namespace clang - -#endif // LLVM_CLANG_CINDEX_DIAGNOSTIC_H diff --git a/contrib/llvm/tools/clang/tools/libclang/CIndexInclusionStack.cpp b/contrib/llvm/tools/clang/tools/libclang/CIndexInclusionStack.cpp deleted file mode 100644 index e86323956f91..000000000000 --- a/contrib/llvm/tools/clang/tools/libclang/CIndexInclusionStack.cpp +++ /dev/null @@ -1,67 +0,0 @@ -//===- CIndexInclusionStack.cpp - Clang-C Source Indexing Library ---------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines a callback mechanism for clients to get the inclusion -// stack from a translation unit. -// -//===----------------------------------------------------------------------===// - -#include "CIndexer.h" -#include "CXSourceLocation.h" -#include "clang/AST/DeclVisitor.h" -#include "clang/Frontend/ASTUnit.h" -#include "llvm/ADT/SmallString.h" -#include "llvm/Support/raw_ostream.h" -using namespace clang; - -extern "C" { -void clang_getInclusions(CXTranslationUnit TU, CXInclusionVisitor CB, - CXClientData clientData) { - - ASTUnit *CXXUnit = static_cast(TU); - SourceManager &SM = CXXUnit->getSourceManager(); - ASTContext &Ctx = CXXUnit->getASTContext(); - - llvm::SmallVector InclusionStack; - unsigned i = SM.sloc_loaded_entry_size(); - unsigned n = SM.sloc_entry_size(); - - // In the case where all the SLocEntries are in an external source, traverse - // those SLocEntries as well. This is the case where we are looking - // at the inclusion stack of an AST/PCH file. - if (i >= n) - i = 0; - - for ( ; i < n ; ++i) { - - const SrcMgr::SLocEntry &SL = SM.getSLocEntry(i); - - if (!SL.isFile()) - continue; - - const SrcMgr::FileInfo &FI = SL.getFile(); - if (!FI.getContentCache()->Entry) - continue; - - // Build the inclusion stack. - SourceLocation L = FI.getIncludeLoc(); - InclusionStack.clear(); - while (L.isValid()) { - PresumedLoc PLoc = SM.getPresumedLoc(L); - InclusionStack.push_back(cxloc::translateSourceLocation(Ctx, L)); - L = PLoc.getIncludeLoc(); - } - - // Callback to the client. - // FIXME: We should have a function to construct CXFiles. - CB((CXFile) FI.getContentCache()->Entry, - InclusionStack.data(), InclusionStack.size(), clientData); - } -} -} // end extern C diff --git a/contrib/llvm/tools/clang/tools/libclang/CIndexUSRs.cpp b/contrib/llvm/tools/clang/tools/libclang/CIndexUSRs.cpp deleted file mode 100644 index 8f3dacfad218..000000000000 --- a/contrib/llvm/tools/clang/tools/libclang/CIndexUSRs.cpp +++ /dev/null @@ -1,847 +0,0 @@ -//===- CIndexUSR.cpp - Clang-C Source Indexing Library --------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements the generation and use of USRs from CXEntities. -// -//===----------------------------------------------------------------------===// - -#include "CIndexer.h" -#include "CXCursor.h" -#include "clang/AST/DeclTemplate.h" -#include "clang/AST/DeclVisitor.h" -#include "clang/Frontend/ASTUnit.h" -#include "clang/Lex/PreprocessingRecord.h" -#include "llvm/ADT/SmallString.h" -#include "llvm/Support/raw_ostream.h" - -using namespace clang; -using namespace clang::cxstring; - -//===----------------------------------------------------------------------===// -// USR generation. -//===----------------------------------------------------------------------===// - -namespace { -class USRGenerator : public DeclVisitor { - llvm::SmallString<1024> Buf; - llvm::raw_svector_ostream Out; - bool IgnoreResults; - ASTUnit *AU; - bool generatedLoc; -public: - USRGenerator(const CXCursor *C = 0) - : Out(Buf), - IgnoreResults(false), - AU(C ? cxcursor::getCursorASTUnit(*C) : 0), - generatedLoc(false) - { - // Add the USR space prefix. - Out << "c:"; - } - - llvm::StringRef str() { - return Out.str(); - } - - USRGenerator* operator->() { return this; } - - template - llvm::raw_svector_ostream &operator<<(const T &x) { - Out << x; - return Out; - } - - bool ignoreResults() const { return IgnoreResults; } - - // Visitation methods from generating USRs from AST elements. - void VisitDeclContext(DeclContext *D); - void VisitFieldDecl(FieldDecl *D); - void VisitFunctionDecl(FunctionDecl *D); - void VisitNamedDecl(NamedDecl *D); - void VisitNamespaceDecl(NamespaceDecl *D); - void VisitNamespaceAliasDecl(NamespaceAliasDecl *D); - void VisitFunctionTemplateDecl(FunctionTemplateDecl *D); - void VisitClassTemplateDecl(ClassTemplateDecl *D); - void VisitObjCClassDecl(ObjCClassDecl *CD); - void VisitObjCContainerDecl(ObjCContainerDecl *CD); - void VisitObjCForwardProtocolDecl(ObjCForwardProtocolDecl *P); - void VisitObjCMethodDecl(ObjCMethodDecl *MD); - void VisitObjCPropertyDecl(ObjCPropertyDecl *D); - void VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D); - void VisitTagDecl(TagDecl *D); - void VisitTypedefDecl(TypedefDecl *D); - void VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D); - void VisitVarDecl(VarDecl *D); - void VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D); - void VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D); - void VisitLinkageSpecDecl(LinkageSpecDecl *D) { - IgnoreResults = true; - } - void VisitUsingDirectiveDecl(UsingDirectiveDecl *D) { - IgnoreResults = true; - } - void VisitUsingDecl(UsingDecl *D) { - IgnoreResults = true; - } - void VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D) { - IgnoreResults = true; - } - void VisitUnresolvedUsingTypenameDecl(UnresolvedUsingTypenameDecl *D) { - IgnoreResults = true; - } - - /// Generate the string component containing the location of the - /// declaration. - bool GenLoc(const Decl *D); - - /// String generation methods used both by the visitation methods - /// and from other clients that want to directly generate USRs. These - /// methods do not construct complete USRs (which incorporate the parents - /// of an AST element), but only the fragments concerning the AST element - /// itself. - - /// Generate a USR for an Objective-C class. - void GenObjCClass(llvm::StringRef cls); - /// Generate a USR for an Objective-C class category. - void GenObjCCategory(llvm::StringRef cls, llvm::StringRef cat); - /// Generate a USR fragment for an Objective-C instance variable. The - /// complete USR can be created by concatenating the USR for the - /// encompassing class with this USR fragment. - void GenObjCIvar(llvm::StringRef ivar); - /// Generate a USR fragment for an Objective-C method. - void GenObjCMethod(llvm::StringRef sel, bool isInstanceMethod); - /// Generate a USR fragment for an Objective-C property. - void GenObjCProperty(llvm::StringRef prop); - /// Generate a USR for an Objective-C protocol. - void GenObjCProtocol(llvm::StringRef prot); - - void VisitType(QualType T); - void VisitTemplateParameterList(const TemplateParameterList *Params); - void VisitTemplateName(TemplateName Name); - void VisitTemplateArgument(const TemplateArgument &Arg); - - /// Emit a Decl's name using NamedDecl::printName() and return true if - /// the decl had no name. - bool EmitDeclName(const NamedDecl *D); -}; - -} // end anonymous namespace - -//===----------------------------------------------------------------------===// -// Generating USRs from ASTS. -//===----------------------------------------------------------------------===// - -bool USRGenerator::EmitDeclName(const NamedDecl *D) { - Out.flush(); - const unsigned startSize = Buf.size(); - D->printName(Out); - Out.flush(); - const unsigned endSize = Buf.size(); - return startSize == endSize; -} - -static bool InAnonymousNamespace(const Decl *D) { - if (const NamespaceDecl *ND = dyn_cast(D->getDeclContext())) - return ND->isAnonymousNamespace(); - return false; -} - -static inline bool ShouldGenerateLocation(const NamedDecl *D) { - return D->getLinkage() != ExternalLinkage && !InAnonymousNamespace(D); -} - -void USRGenerator::VisitDeclContext(DeclContext *DC) { - if (NamedDecl *D = dyn_cast(DC)) - Visit(D); -} - -void USRGenerator::VisitFieldDecl(FieldDecl *D) { - VisitDeclContext(D->getDeclContext()); - Out << (isa(D) ? "@" : "@FI@"); - if (EmitDeclName(D)) { - // Bit fields can be anonymous. - IgnoreResults = true; - return; - } -} - -void USRGenerator::VisitFunctionDecl(FunctionDecl *D) { - if (ShouldGenerateLocation(D) && GenLoc(D)) - return; - - VisitDeclContext(D->getDeclContext()); - if (FunctionTemplateDecl *FunTmpl = D->getDescribedFunctionTemplate()) { - Out << "@FT@"; - VisitTemplateParameterList(FunTmpl->getTemplateParameters()); - } else - Out << "@F@"; - D->printName(Out); - - ASTContext &Ctx = AU->getASTContext(); - if (!Ctx.getLangOptions().CPlusPlus || D->isExternC()) - return; - - // Mangle in type information for the arguments. - for (FunctionDecl::param_iterator I = D->param_begin(), E = D->param_end(); - I != E; ++I) { - Out << '#'; - if (ParmVarDecl *PD = *I) - VisitType(PD->getType()); - } - if (D->isVariadic()) - Out << '.'; - Out << '#'; - if (CXXMethodDecl *MD = dyn_cast(D)) { - if (MD->isStatic()) - Out << 'S'; - if (unsigned quals = MD->getTypeQualifiers()) - Out << (char)('0' + quals); - } -} - -void USRGenerator::VisitNamedDecl(NamedDecl *D) { - VisitDeclContext(D->getDeclContext()); - Out << "@"; - - if (EmitDeclName(D)) { - // The string can be empty if the declaration has no name; e.g., it is - // the ParmDecl with no name for declaration of a function pointer type, - // e.g.: void (*f)(void *); - // In this case, don't generate a USR. - IgnoreResults = true; - } -} - -void USRGenerator::VisitVarDecl(VarDecl *D) { - // VarDecls can be declared 'extern' within a function or method body, - // but their enclosing DeclContext is the function, not the TU. We need - // to check the storage class to correctly generate the USR. - if (ShouldGenerateLocation(D) && GenLoc(D)) - return; - - VisitDeclContext(D->getDeclContext()); - - // Variables always have simple names. - llvm::StringRef s = D->getName(); - - // The string can be empty if the declaration has no name; e.g., it is - // the ParmDecl with no name for declaration of a function pointer type, e.g.: - // void (*f)(void *); - // In this case, don't generate a USR. - if (s.empty()) - IgnoreResults = true; - else - Out << '@' << s; -} - -void USRGenerator::VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D) { - GenLoc(D); - return; -} - -void USRGenerator::VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D) { - GenLoc(D); - return; -} - -void USRGenerator::VisitNamespaceDecl(NamespaceDecl *D) { - if (D->isAnonymousNamespace()) { - Out << "@aN"; - return; - } - - VisitDeclContext(D->getDeclContext()); - if (!IgnoreResults) - Out << "@N@" << D->getName(); -} - -void USRGenerator::VisitFunctionTemplateDecl(FunctionTemplateDecl *D) { - VisitFunctionDecl(D->getTemplatedDecl()); -} - -void USRGenerator::VisitClassTemplateDecl(ClassTemplateDecl *D) { - VisitTagDecl(D->getTemplatedDecl()); -} - -void USRGenerator::VisitNamespaceAliasDecl(NamespaceAliasDecl *D) { - VisitDeclContext(D->getDeclContext()); - if (!IgnoreResults) - Out << "@NA@" << D->getName(); -} - -void USRGenerator::VisitObjCMethodDecl(ObjCMethodDecl *D) { - Decl *container = cast(D->getDeclContext()); - - // The USR for a method declared in a class extension is based on - // the ObjCInterfaceDecl, not the ObjCCategoryDecl. - do { - if (ObjCCategoryDecl *CD = dyn_cast(container)) - if (CD->IsClassExtension()) { - Visit(CD->getClassInterface()); - break; - } - Visit(cast(D->getDeclContext())); - } - while (false); - - // Ideally we would use 'GenObjCMethod', but this is such a hot path - // for Objective-C code that we don't want to use - // DeclarationName::getAsString(). - Out << (D->isInstanceMethod() ? "(im)" : "(cm)"); - DeclarationName N(D->getSelector()); - N.printName(Out); -} - -void USRGenerator::VisitObjCClassDecl(ObjCClassDecl *D) { - // FIXME: @class declarations can refer to multiple classes. We need - // to be able to traverse these. - IgnoreResults = true; -} - -void USRGenerator::VisitObjCForwardProtocolDecl(ObjCForwardProtocolDecl *D) { - // FIXME: @protocol declarations can refer to multiple protocols. We need - // to be able to traverse these. - IgnoreResults = true; -} - -void USRGenerator::VisitObjCContainerDecl(ObjCContainerDecl *D) { - switch (D->getKind()) { - default: - assert(false && "Invalid ObjC container."); - case Decl::ObjCInterface: - case Decl::ObjCImplementation: - GenObjCClass(D->getName()); - break; - case Decl::ObjCCategory: { - ObjCCategoryDecl *CD = cast(D); - ObjCInterfaceDecl *ID = CD->getClassInterface(); - if (!ID) { - // Handle invalid code where the @interface might not - // have been specified. - // FIXME: We should be able to generate this USR even if the - // @interface isn't available. - IgnoreResults = true; - return; - } - // Specially handle class extensions, which are anonymous categories. - // We want to mangle in the location to uniquely distinguish them. - if (CD->IsClassExtension()) { - Out << "objc(ext)" << ID->getName() << '@'; - GenLoc(CD); - } - else - GenObjCCategory(ID->getName(), CD->getName()); - - break; - } - case Decl::ObjCCategoryImpl: { - ObjCCategoryImplDecl *CD = cast(D); - ObjCInterfaceDecl *ID = CD->getClassInterface(); - if (!ID) { - // Handle invalid code where the @interface might not - // have been specified. - // FIXME: We should be able to generate this USR even if the - // @interface isn't available. - IgnoreResults = true; - return; - } - GenObjCCategory(ID->getName(), CD->getName()); - break; - } - case Decl::ObjCProtocol: - GenObjCProtocol(cast(D)->getName()); - break; - } -} - -void USRGenerator::VisitObjCPropertyDecl(ObjCPropertyDecl *D) { - Visit(cast(D->getDeclContext())); - GenObjCProperty(D->getName()); -} - -void USRGenerator::VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D) { - if (ObjCPropertyDecl *PD = D->getPropertyDecl()) { - VisitObjCPropertyDecl(PD); - return; - } - - IgnoreResults = true; -} - -void USRGenerator::VisitTagDecl(TagDecl *D) { - // Add the location of the tag decl to handle resolution across - // translation units. - if (ShouldGenerateLocation(D) && GenLoc(D)) - return; - - D = D->getCanonicalDecl(); - VisitDeclContext(D->getDeclContext()); - - bool AlreadyStarted = false; - if (CXXRecordDecl *CXXRecord = dyn_cast(D)) { - if (ClassTemplateDecl *ClassTmpl = CXXRecord->getDescribedClassTemplate()) { - AlreadyStarted = true; - - switch (D->getTagKind()) { - case TTK_Struct: Out << "@ST"; break; - case TTK_Class: Out << "@CT"; break; - case TTK_Union: Out << "@UT"; break; - case TTK_Enum: llvm_unreachable("enum template"); break; - } - VisitTemplateParameterList(ClassTmpl->getTemplateParameters()); - } else if (ClassTemplatePartialSpecializationDecl *PartialSpec - = dyn_cast(CXXRecord)) { - AlreadyStarted = true; - - switch (D->getTagKind()) { - case TTK_Struct: Out << "@SP"; break; - case TTK_Class: Out << "@CP"; break; - case TTK_Union: Out << "@UP"; break; - case TTK_Enum: llvm_unreachable("enum partial specialization"); break; - } - VisitTemplateParameterList(PartialSpec->getTemplateParameters()); - } - } - - if (!AlreadyStarted) { - switch (D->getTagKind()) { - case TTK_Struct: Out << "@S"; break; - case TTK_Class: Out << "@C"; break; - case TTK_Union: Out << "@U"; break; - case TTK_Enum: Out << "@E"; break; - } - } - - Out << '@'; - Out.flush(); - assert(Buf.size() > 0); - const unsigned off = Buf.size() - 1; - - if (EmitDeclName(D)) { - if (const TypedefDecl *TD = D->getTypedefForAnonDecl()) { - Buf[off] = 'A'; - Out << '@' << TD; - } - else - Buf[off] = 'a'; - } - - // For a class template specialization, mangle the template arguments. - if (ClassTemplateSpecializationDecl *Spec - = dyn_cast(D)) { - const TemplateArgumentList &Args = Spec->getTemplateInstantiationArgs(); - Out << '>'; - for (unsigned I = 0, N = Args.size(); I != N; ++I) { - Out << '#'; - VisitTemplateArgument(Args.get(I)); - } - } -} - -void USRGenerator::VisitTypedefDecl(TypedefDecl *D) { - if (ShouldGenerateLocation(D) && GenLoc(D)) - return; - DeclContext *DC = D->getDeclContext(); - if (NamedDecl *DCN = dyn_cast(DC)) - Visit(DCN); - Out << "@T@"; - Out << D->getName(); -} - -void USRGenerator::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) { - GenLoc(D); - return; -} - -bool USRGenerator::GenLoc(const Decl *D) { - if (generatedLoc) - return IgnoreResults; - generatedLoc = true; - - const SourceManager &SM = AU->getSourceManager(); - SourceLocation L = D->getLocStart(); - if (L.isInvalid()) { - IgnoreResults = true; - return true; - } - L = SM.getInstantiationLoc(L); - const std::pair &Decomposed = SM.getDecomposedLoc(L); - const FileEntry *FE = SM.getFileEntryForID(Decomposed.first); - if (FE) { - llvm::sys::Path P(FE->getName()); - Out << P.getLast(); - } - else { - // This case really isn't interesting. - IgnoreResults = true; - return true; - } - // Use the offest into the FileID to represent the location. Using - // a line/column can cause us to look back at the original source file, - // which is expensive. - Out << '@' << Decomposed.second; - return IgnoreResults; -} - -void USRGenerator::VisitType(QualType T) { - // This method mangles in USR information for types. It can possibly - // just reuse the naming-mangling logic used by codegen, although the - // requirements for USRs might not be the same. - ASTContext &Ctx = AU->getASTContext(); - - do { - T = Ctx.getCanonicalType(T); - Qualifiers Q = T.getQualifiers(); - unsigned qVal = 0; - if (Q.hasConst()) - qVal |= 0x1; - if (Q.hasVolatile()) - qVal |= 0x2; - if (Q.hasRestrict()) - qVal |= 0x4; - if(qVal) - Out << ((char) ('0' + qVal)); - - // Mangle in ObjC GC qualifiers? - - if (const PointerType *PT = T->getAs()) { - Out << '*'; - T = PT->getPointeeType(); - continue; - } - if (const ReferenceType *RT = T->getAs()) { - Out << '&'; - T = RT->getPointeeType(); - continue; - } - if (const FunctionProtoType *FT = T->getAs()) { - Out << 'F'; - VisitType(FT->getResultType()); - for (FunctionProtoType::arg_type_iterator - I = FT->arg_type_begin(), E = FT->arg_type_end(); I!=E; ++I) { - VisitType(*I); - } - if (FT->isVariadic()) - Out << '.'; - return; - } - if (const BlockPointerType *BT = T->getAs()) { - Out << 'B'; - T = BT->getPointeeType(); - continue; - } - if (const BuiltinType *BT = T->getAs()) { - unsigned char c = '\0'; - switch (BT->getKind()) { - case BuiltinType::Void: - c = 'v'; break; - case BuiltinType::Bool: - c = 'b'; break; - case BuiltinType::Char_U: - case BuiltinType::UChar: - c = 'c'; break; - case BuiltinType::Char16: - c = 'q'; break; - case BuiltinType::Char32: - c = 'w'; break; - case BuiltinType::UShort: - c = 's'; break; - case BuiltinType::UInt: - c = 'i'; break; - case BuiltinType::ULong: - c = 'l'; break; - case BuiltinType::ULongLong: - c = 'k'; break; - case BuiltinType::UInt128: - c = 'j'; break; - case BuiltinType::Char_S: - case BuiltinType::SChar: - c = 'C'; break; - case BuiltinType::WChar: - c = 'W'; break; - case BuiltinType::Short: - c = 'S'; break; - case BuiltinType::Int: - c = 'I'; break; - case BuiltinType::Long: - c = 'L'; break; - case BuiltinType::LongLong: - c = 'K'; break; - case BuiltinType::Int128: - c = 'J'; break; - case BuiltinType::Float: - c = 'f'; break; - case BuiltinType::Double: - c = 'd'; break; - case BuiltinType::LongDouble: - c = 'D'; break; - case BuiltinType::NullPtr: - c = 'n'; break; - case BuiltinType::Overload: - case BuiltinType::Dependent: - case BuiltinType::UndeducedAuto: - IgnoreResults = true; - return; - case BuiltinType::ObjCId: - c = 'o'; break; - case BuiltinType::ObjCClass: - c = 'O'; break; - case BuiltinType::ObjCSel: - c = 'e'; break; - } - Out << c; - return; - } - if (const ComplexType *CT = T->getAs()) { - Out << '<'; - T = CT->getElementType(); - continue; - } - if (const TagType *TT = T->getAs()) { - Out << '$'; - VisitTagDecl(TT->getDecl()); - return; - } - if (const TemplateTypeParmType *TTP = T->getAs()) { - Out << 't' << TTP->getDepth() << '.' << TTP->getIndex(); - return; - } - if (const TemplateSpecializationType *Spec - = T->getAs()) { - Out << '>'; - VisitTemplateName(Spec->getTemplateName()); - Out << Spec->getNumArgs(); - for (unsigned I = 0, N = Spec->getNumArgs(); I != N; ++I) - VisitTemplateArgument(Spec->getArg(I)); - return; - } - - // Unhandled type. - Out << ' '; - break; - } while (true); -} - -void USRGenerator::VisitTemplateParameterList( - const TemplateParameterList *Params) { - if (!Params) - return; - Out << '>' << Params->size(); - for (TemplateParameterList::const_iterator P = Params->begin(), - PEnd = Params->end(); - P != PEnd; ++P) { - Out << '#'; - if (isa(*P)) { - Out << 'T'; - continue; - } - - if (NonTypeTemplateParmDecl *NTTP = dyn_cast(*P)) { - Out << 'N'; - VisitType(NTTP->getType()); - continue; - } - - TemplateTemplateParmDecl *TTP = cast(*P); - Out << 't'; - VisitTemplateParameterList(TTP->getTemplateParameters()); - } -} - -void USRGenerator::VisitTemplateName(TemplateName Name) { - if (TemplateDecl *Template = Name.getAsTemplateDecl()) { - if (TemplateTemplateParmDecl *TTP - = dyn_cast(Template)) { - Out << 't' << TTP->getDepth() << '.' << TTP->getIndex(); - return; - } - - Visit(Template); - return; - } - - // FIXME: Visit dependent template names. -} - -void USRGenerator::VisitTemplateArgument(const TemplateArgument &Arg) { - switch (Arg.getKind()) { - case TemplateArgument::Null: - break; - - case TemplateArgument::Declaration: - Visit(Arg.getAsDecl()); - break; - - case TemplateArgument::Template: - VisitTemplateName(Arg.getAsTemplate()); - break; - - case TemplateArgument::Expression: - // FIXME: Visit expressions. - break; - - case TemplateArgument::Pack: - // FIXME: Variadic templates - break; - - case TemplateArgument::Type: - VisitType(Arg.getAsType()); - break; - - case TemplateArgument::Integral: - Out << 'V'; - VisitType(Arg.getIntegralType()); - Out << *Arg.getAsIntegral(); - break; - } -} - -//===----------------------------------------------------------------------===// -// General purpose USR generation methods. -//===----------------------------------------------------------------------===// - -void USRGenerator::GenObjCClass(llvm::StringRef cls) { - Out << "objc(cs)" << cls; -} - -void USRGenerator::GenObjCCategory(llvm::StringRef cls, llvm::StringRef cat) { - Out << "objc(cy)" << cls << '@' << cat; -} - -void USRGenerator::GenObjCIvar(llvm::StringRef ivar) { - Out << '@' << ivar; -} - -void USRGenerator::GenObjCMethod(llvm::StringRef meth, bool isInstanceMethod) { - Out << (isInstanceMethod ? "(im)" : "(cm)") << meth; -} - -void USRGenerator::GenObjCProperty(llvm::StringRef prop) { - Out << "(py)" << prop; -} - -void USRGenerator::GenObjCProtocol(llvm::StringRef prot) { - Out << "objc(pl)" << prot; -} - -//===----------------------------------------------------------------------===// -// API hooks. -//===----------------------------------------------------------------------===// - -static inline llvm::StringRef extractUSRSuffix(llvm::StringRef s) { - return s.startswith("c:") ? s.substr(2) : ""; -} - -static CXString getDeclCursorUSR(const CXCursor &C) { - Decl *D = cxcursor::getCursorDecl(C); - - // Don't generate USRs for things with invalid locations. - if (!D || D->getLocStart().isInvalid()) - return createCXString(""); - - // Check if the cursor has 'NoLinkage'. - if (const NamedDecl *ND = dyn_cast(D)) - switch (ND->getLinkage()) { - case ExternalLinkage: - // Generate USRs for all entities with external linkage. - break; - case NoLinkage: - case UniqueExternalLinkage: - // We allow enums, typedefs, and structs that have no linkage to - // have USRs that are anchored to the file they were defined in - // (e.g., the header). This is a little gross, but in principal - // enums/anonymous structs/etc. defined in a common header file - // are referred to across multiple translation units. - if (isa(ND) || isa(ND) || - isa(ND) || isa(ND) || - isa(ND) || isa(ND)) - break; - // Fall-through. - case InternalLinkage: - if (isa(ND)) - break; - } - - USRGenerator UG(&C); - UG->Visit(D); - - if (UG->ignoreResults()) - return createCXString(""); - -#if 0 - // For development testing. - assert(UG.str().size() > 2); -#endif - - // Return a copy of the string that must be disposed by the caller. - return createCXString(UG.str(), true); -} - -extern "C" { - -CXString clang_getCursorUSR(CXCursor C) { - const CXCursorKind &K = clang_getCursorKind(C); - - if (clang_isDeclaration(K)) - return getDeclCursorUSR(C); - - if (K == CXCursor_MacroDefinition) { - USRGenerator UG(&C); - UG << "macro@" - << cxcursor::getCursorMacroDefinition(C)->getName()->getNameStart(); - return createCXString(UG.str(), true); - } - - return createCXString(""); -} - -CXString clang_constructUSR_ObjCIvar(const char *name, CXString classUSR) { - USRGenerator UG; - UG << extractUSRSuffix(clang_getCString(classUSR)); - UG->GenObjCIvar(name); - return createCXString(UG.str(), true); -} - -CXString clang_constructUSR_ObjCMethod(const char *name, - unsigned isInstanceMethod, - CXString classUSR) { - USRGenerator UG; - UG << extractUSRSuffix(clang_getCString(classUSR)); - UG->GenObjCMethod(name, isInstanceMethod); - return createCXString(UG.str(), true); -} - -CXString clang_constructUSR_ObjCClass(const char *name) { - USRGenerator UG; - UG->GenObjCClass(name); - return createCXString(UG.str(), true); -} - -CXString clang_constructUSR_ObjCProtocol(const char *name) { - USRGenerator UG; - UG->GenObjCProtocol(name); - return createCXString(UG.str(), true); -} - -CXString clang_constructUSR_ObjCCategory(const char *class_name, - const char *category_name) { - USRGenerator UG; - UG->GenObjCCategory(class_name, category_name); - return createCXString(UG.str(), true); -} - -CXString clang_constructUSR_ObjCProperty(const char *property, - CXString classUSR) { - USRGenerator UG; - UG << extractUSRSuffix(clang_getCString(classUSR)); - UG->GenObjCProperty(property); - return createCXString(UG.str(), true); -} - -} // end extern "C" diff --git a/contrib/llvm/tools/clang/tools/libclang/CIndexer.cpp b/contrib/llvm/tools/clang/tools/libclang/CIndexer.cpp deleted file mode 100644 index cdf6c61a09e2..000000000000 --- a/contrib/llvm/tools/clang/tools/libclang/CIndexer.cpp +++ /dev/null @@ -1,155 +0,0 @@ -//===- CIndex.cpp - Clang-C Source Indexing Library -----------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements the Clang-C Source Indexing library. -// -//===----------------------------------------------------------------------===// - -#include "CIndexer.h" - -#include "clang/AST/Decl.h" -#include "clang/AST/DeclVisitor.h" -#include "clang/AST/StmtVisitor.h" -#include "clang/Basic/FileManager.h" -#include "clang/Basic/SourceManager.h" -#include "clang/Basic/Version.h" -#include "clang/Sema/CodeCompleteConsumer.h" -#include "llvm/ADT/StringExtras.h" -#include "llvm/Config/config.h" -#include "llvm/Support/Compiler.h" -#include "llvm/Support/MemoryBuffer.h" -#include "llvm/Support/raw_ostream.h" -#include "llvm/System/Program.h" - -#include -#include -#include - -#ifdef LLVM_ON_WIN32 -#include -#else -#include -#endif - -using namespace clang; - -const llvm::sys::Path& CIndexer::getClangPath() { - // Did we already compute the path? - if (!ClangPath.empty()) - return ClangPath; - - // Find the location where this library lives (libCIndex.dylib). -#ifdef LLVM_ON_WIN32 - MEMORY_BASIC_INFORMATION mbi; - char path[MAX_PATH]; - VirtualQuery((void *)(uintptr_t)clang_createTranslationUnit, &mbi, - sizeof(mbi)); - GetModuleFileNameA((HINSTANCE)mbi.AllocationBase, path, MAX_PATH); - - llvm::sys::Path CIndexPath(path); - - CIndexPath.eraseComponent(); - CIndexPath.appendComponent("clang"); - CIndexPath.appendSuffix("exe"); - CIndexPath.makeAbsolute(); -#else - // This silly cast below avoids a C++ warning. - Dl_info info; - if (dladdr((void *)(uintptr_t)clang_createTranslationUnit, &info) == 0) - assert(0 && "Call to dladdr() failed"); - - llvm::sys::Path CIndexPath(info.dli_fname); - - // We now have the CIndex directory, locate clang relative to it. - CIndexPath.eraseComponent(); - CIndexPath.appendComponent(".."); - CIndexPath.appendComponent("bin"); - CIndexPath.appendComponent("clang"); -#endif - - // Cache our result. - ClangPath = CIndexPath; - return ClangPath; -} - -std::string CIndexer::getClangResourcesPath() { - llvm::sys::Path P = getClangPath(); - - if (!P.empty()) { - P.eraseComponent(); // Remove /clang from foo/bin/clang - P.eraseComponent(); // Remove /bin from foo/bin - - // Get foo/lib/clang//include - P.appendComponent("lib"); - P.appendComponent("clang"); - P.appendComponent(CLANG_VERSION_STRING); - } - - return P.str(); -} - -static llvm::sys::Path GetTemporaryPath() { - // FIXME: This is lame; sys::Path should provide this function (in particular, - // it should know how to find the temporary files dir). - std::string Error; - const char *TmpDir = ::getenv("TMPDIR"); - if (!TmpDir) - TmpDir = ::getenv("TEMP"); - if (!TmpDir) - TmpDir = ::getenv("TMP"); - if (!TmpDir) - TmpDir = "/tmp"; - llvm::sys::Path P(TmpDir); - P.appendComponent("remap"); - if (P.makeUnique(false, &Error)) - return llvm::sys::Path(""); - - // FIXME: Grumble, makeUnique sometimes leaves the file around!? PR3837. - P.eraseFromDisk(false, 0); - - return P; -} - -bool clang::RemapFiles(unsigned num_unsaved_files, - struct CXUnsavedFile *unsaved_files, - std::vector &RemapArgs, - std::vector &TemporaryFiles) { - for (unsigned i = 0; i != num_unsaved_files; ++i) { - // Write the contents of this unsaved file into the temporary file. - llvm::sys::Path SavedFile(GetTemporaryPath()); - if (SavedFile.empty()) - return true; - - std::string ErrorInfo; - llvm::raw_fd_ostream OS(SavedFile.c_str(), ErrorInfo); - if (!ErrorInfo.empty()) - return true; - - OS.write(unsaved_files[i].Contents, unsaved_files[i].Length); - OS.close(); - if (OS.has_error()) { - SavedFile.eraseFromDisk(); - OS.clear_error(); - return true; - } - - // Remap the file. - std::string RemapArg = unsaved_files[i].Filename; - RemapArg += ';'; - RemapArg += SavedFile.str(); - RemapArgs.push_back("-Xclang"); - RemapArgs.push_back("-remap-file"); - RemapArgs.push_back("-Xclang"); - RemapArgs.push_back(RemapArg); - TemporaryFiles.push_back(SavedFile); - } - - return false; -} - diff --git a/contrib/llvm/tools/clang/tools/libclang/CIndexer.h b/contrib/llvm/tools/clang/tools/libclang/CIndexer.h deleted file mode 100644 index 31bf779ea4a5..000000000000 --- a/contrib/llvm/tools/clang/tools/libclang/CIndexer.h +++ /dev/null @@ -1,78 +0,0 @@ -//===- CIndexer.h - Clang-C Source Indexing Library -----------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines CIndexer, a subclass of Indexer that provides extra -// functionality needed by the CIndex library. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_CINDEXER_H -#define LLVM_CLANG_CINDEXER_H - -#include "clang-c/Index.h" -#include "llvm/ADT/StringRef.h" -#include "llvm/System/Path.h" -#include - -namespace clang { -namespace cxstring { - CXString createCXString(const char *String, bool DupString = false); - CXString createCXString(llvm::StringRef String, bool DupString = true); -} -} - -class CIndexer { - bool UseExternalASTGeneration; - bool OnlyLocalDecls; - bool DisplayDiagnostics; - - llvm::sys::Path ClangPath; - -public: - CIndexer() - : UseExternalASTGeneration(false), OnlyLocalDecls(false), - DisplayDiagnostics(false) { } - - /// \brief Whether we only want to see "local" declarations (that did not - /// come from a previous precompiled header). If false, we want to see all - /// declarations. - bool getOnlyLocalDecls() const { return OnlyLocalDecls; } - void setOnlyLocalDecls(bool Local = true) { OnlyLocalDecls = Local; } - - bool getDisplayDiagnostics() const { return DisplayDiagnostics; } - void setDisplayDiagnostics(bool Display = true) { - DisplayDiagnostics = Display; - } - - bool getUseExternalASTGeneration() const { return UseExternalASTGeneration; } - void setUseExternalASTGeneration(bool Value) { - UseExternalASTGeneration = Value; - } - - /// \brief Get the path of the clang binary. - const llvm::sys::Path& getClangPath(); - - /// \brief Get the path of the clang resource files. - std::string getClangResourcesPath(); -}; - -namespace clang { - /** - * \brief Given a set of "unsaved" files, create temporary files and - * construct the clang -cc1 argument list needed to perform the remapping. - * - * \returns true if an error occurred. - */ - bool RemapFiles(unsigned num_unsaved_files, - struct CXUnsavedFile *unsaved_files, - std::vector &RemapArgs, - std::vector &TemporaryFiles); -} - -#endif diff --git a/contrib/llvm/tools/clang/tools/libclang/CMakeLists.txt b/contrib/llvm/tools/clang/tools/libclang/CMakeLists.txt deleted file mode 100644 index 29ef574fff6a..000000000000 --- a/contrib/llvm/tools/clang/tools/libclang/CMakeLists.txt +++ /dev/null @@ -1,64 +0,0 @@ -set(SHARED_LIBRARY TRUE) - -set(LLVM_NO_RTTI 1) - -set(LLVM_USED_LIBS - clangFrontend - clangDriver - clangSerialization - clangParse - clangSema - clangAnalysis - clangAST - clangLex - clangBasic) - -set( LLVM_LINK_COMPONENTS - bitreader - mc - core - ) - -add_clang_library(libclang - CIndex.cpp - CIndexCXX.cpp - CIndexCodeCompletion.cpp - CIndexDiagnostic.cpp - CIndexInclusionStack.cpp - CIndexUSRs.cpp - CIndexer.cpp - CXCursor.cpp - CXType.cpp - ../../include/clang-c/Index.h -) - -if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - # dylib versioning information - # FIXME: Is there a more CMake-ish way to handle this? - set(LIBCLANG_VERSION 1 - CACHE STRING "Version number of the libclang library") - set(LIBCLANG_SUBVERSION 0 - CACHE STRING "Minor version number of the libclang library") - set(LIBCLANG_LINK_FLAGS - "-Wl,-current_version -Wl,${LIBCLANG_VERSION}.${LIBCLANG_SUBVERSION} -Wl,-compatibility_version -Wl,1") - - set(LIBCLANG_LINK_FLAGS - "${LIBCLANG_LINK_FLAGS} -Wl,-dead_strip -Wl,-seg1addr -Wl,0xE0000000") - - set_target_properties(libclang - PROPERTIES - LINK_FLAGS "${LIBCLANG_LINK_FLAGS}" - INSTALL_NAME_DIR "@executable_path/../lib") -endif() - -if(MSVC) - # windows.h doesn't compile with /Za - get_target_property(NON_ANSI_COMPILE_FLAGS libclang COMPILE_FLAGS) - string(REPLACE /Za "" NON_ANSI_COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS}) - set_target_properties(libclang PROPERTIES COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS}) -endif(MSVC) - -set_target_properties(libclang - PROPERTIES - LINKER_LANGUAGE CXX - DEFINE_SYMBOL _CINDEX_LIB_) diff --git a/contrib/llvm/tools/clang/tools/libclang/CXCursor.cpp b/contrib/llvm/tools/clang/tools/libclang/CXCursor.cpp deleted file mode 100644 index a8fd049c9965..000000000000 --- a/contrib/llvm/tools/clang/tools/libclang/CXCursor.cpp +++ /dev/null @@ -1,374 +0,0 @@ -//===- CXCursor.cpp - Routines for manipulating CXCursors -----------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines routines for manipulating CXCursors. It should be the -// only file that has internal knowledge of the encoding of the data in -// CXCursor. -// -//===----------------------------------------------------------------------===// - -#include "CXCursor.h" -#include "clang/Frontend/ASTUnit.h" -#include "clang/AST/Decl.h" -#include "clang/AST/DeclCXX.h" -#include "clang/AST/DeclObjC.h" -#include "clang/AST/Expr.h" -#include "llvm/Support/ErrorHandling.h" - -using namespace clang; - -CXCursor cxcursor::MakeCXCursorInvalid(CXCursorKind K) { - assert(K >= CXCursor_FirstInvalid && K <= CXCursor_LastInvalid); - CXCursor C = { K, { 0, 0, 0 } }; - return C; -} - -static CXCursorKind GetCursorKind(const Attr *A) { - assert(A && "Invalid arguments!"); - switch (A->getKind()) { - default: break; - case attr::IBAction: return CXCursor_IBActionAttr; - case attr::IBOutlet: return CXCursor_IBOutletAttr; - case attr::IBOutletCollection: return CXCursor_IBOutletCollectionAttr; - } - - return CXCursor_UnexposedAttr; -} - -CXCursor cxcursor::MakeCXCursor(const Attr *A, Decl *Parent, ASTUnit *TU) { - assert(A && Parent && TU && "Invalid arguments!"); - CXCursor C = { GetCursorKind(A), { Parent, (void*)A, TU } }; - return C; -} - -CXCursor cxcursor::MakeCXCursor(Decl *D, ASTUnit *TU) { - assert(D && TU && "Invalid arguments!"); - CXCursor C = { getCursorKindForDecl(D), { D, 0, TU } }; - return C; -} - -CXCursor cxcursor::MakeCXCursor(Stmt *S, Decl *Parent, ASTUnit *TU) { - assert(S && TU && "Invalid arguments!"); - CXCursorKind K = CXCursor_NotImplemented; - - switch (S->getStmtClass()) { - case Stmt::NoStmtClass: - break; - - case Stmt::NullStmtClass: - case Stmt::CompoundStmtClass: - case Stmt::CaseStmtClass: - case Stmt::DefaultStmtClass: - case Stmt::LabelStmtClass: - case Stmt::IfStmtClass: - case Stmt::SwitchStmtClass: - case Stmt::WhileStmtClass: - case Stmt::DoStmtClass: - case Stmt::ForStmtClass: - case Stmt::GotoStmtClass: - case Stmt::IndirectGotoStmtClass: - case Stmt::ContinueStmtClass: - case Stmt::BreakStmtClass: - case Stmt::ReturnStmtClass: - case Stmt::DeclStmtClass: - case Stmt::SwitchCaseClass: - case Stmt::AsmStmtClass: - case Stmt::ObjCAtTryStmtClass: - case Stmt::ObjCAtCatchStmtClass: - case Stmt::ObjCAtFinallyStmtClass: - case Stmt::ObjCAtThrowStmtClass: - case Stmt::ObjCAtSynchronizedStmtClass: - case Stmt::ObjCForCollectionStmtClass: - case Stmt::CXXCatchStmtClass: - case Stmt::CXXTryStmtClass: - K = CXCursor_UnexposedStmt; - break; - - case Stmt::PredefinedExprClass: - case Stmt::IntegerLiteralClass: - case Stmt::FloatingLiteralClass: - case Stmt::ImaginaryLiteralClass: - case Stmt::StringLiteralClass: - case Stmt::CharacterLiteralClass: - case Stmt::ParenExprClass: - case Stmt::UnaryOperatorClass: - case Stmt::OffsetOfExprClass: - case Stmt::SizeOfAlignOfExprClass: - case Stmt::ArraySubscriptExprClass: - case Stmt::BinaryOperatorClass: - case Stmt::CompoundAssignOperatorClass: - case Stmt::ConditionalOperatorClass: - case Stmt::ImplicitCastExprClass: - case Stmt::CStyleCastExprClass: - case Stmt::CompoundLiteralExprClass: - case Stmt::ExtVectorElementExprClass: - case Stmt::InitListExprClass: - case Stmt::DesignatedInitExprClass: - case Stmt::ImplicitValueInitExprClass: - case Stmt::ParenListExprClass: - case Stmt::VAArgExprClass: - case Stmt::AddrLabelExprClass: - case Stmt::StmtExprClass: - case Stmt::TypesCompatibleExprClass: - case Stmt::ChooseExprClass: - case Stmt::GNUNullExprClass: - case Stmt::CXXStaticCastExprClass: - case Stmt::CXXDynamicCastExprClass: - case Stmt::CXXReinterpretCastExprClass: - case Stmt::CXXConstCastExprClass: - case Stmt::CXXFunctionalCastExprClass: - case Stmt::CXXTypeidExprClass: - case Stmt::CXXBoolLiteralExprClass: - case Stmt::CXXNullPtrLiteralExprClass: - case Stmt::CXXThisExprClass: - case Stmt::CXXThrowExprClass: - case Stmt::CXXDefaultArgExprClass: - case Stmt::CXXScalarValueInitExprClass: - case Stmt::CXXNewExprClass: - case Stmt::CXXDeleteExprClass: - case Stmt::CXXPseudoDestructorExprClass: - case Stmt::UnresolvedLookupExprClass: - case Stmt::UnaryTypeTraitExprClass: - case Stmt::DependentScopeDeclRefExprClass: - case Stmt::CXXBindTemporaryExprClass: - case Stmt::CXXExprWithTemporariesClass: - case Stmt::CXXUnresolvedConstructExprClass: - case Stmt::CXXDependentScopeMemberExprClass: - case Stmt::UnresolvedMemberExprClass: - case Stmt::ObjCStringLiteralClass: - case Stmt::ObjCEncodeExprClass: - case Stmt::ObjCSelectorExprClass: - case Stmt::ObjCProtocolExprClass: - case Stmt::ObjCImplicitSetterGetterRefExprClass: - case Stmt::ObjCSuperExprClass: - case Stmt::ObjCIsaExprClass: - case Stmt::ShuffleVectorExprClass: - case Stmt::BlockExprClass: - K = CXCursor_UnexposedExpr; - break; - case Stmt::DeclRefExprClass: - case Stmt::BlockDeclRefExprClass: - // FIXME: UnresolvedLookupExpr? - // FIXME: DependentScopeDeclRefExpr? - K = CXCursor_DeclRefExpr; - break; - - case Stmt::MemberExprClass: - case Stmt::ObjCIvarRefExprClass: - case Stmt::ObjCPropertyRefExprClass: - // FIXME: UnresolvedMemberExpr? - // FIXME: CXXDependentScopeMemberExpr? - K = CXCursor_MemberRefExpr; - break; - - case Stmt::CallExprClass: - case Stmt::CXXOperatorCallExprClass: - case Stmt::CXXMemberCallExprClass: - case Stmt::CXXConstructExprClass: - case Stmt::CXXTemporaryObjectExprClass: - // FIXME: CXXUnresolvedConstructExpr - // FIXME: ObjCImplicitSetterGetterRefExpr? - K = CXCursor_CallExpr; - break; - - case Stmt::ObjCMessageExprClass: - K = CXCursor_ObjCMessageExpr; - break; - } - - CXCursor C = { K, { Parent, S, TU } }; - return C; -} - -CXCursor cxcursor::MakeCursorObjCSuperClassRef(ObjCInterfaceDecl *Super, - SourceLocation Loc, - ASTUnit *TU) { - assert(Super && TU && "Invalid arguments!"); - void *RawLoc = reinterpret_cast(Loc.getRawEncoding()); - CXCursor C = { CXCursor_ObjCSuperClassRef, { Super, RawLoc, TU } }; - return C; -} - -std::pair -cxcursor::getCursorObjCSuperClassRef(CXCursor C) { - assert(C.kind == CXCursor_ObjCSuperClassRef); - return std::make_pair(static_cast(C.data[0]), - SourceLocation::getFromRawEncoding( - reinterpret_cast(C.data[1]))); -} - -CXCursor cxcursor::MakeCursorObjCProtocolRef(ObjCProtocolDecl *Super, - SourceLocation Loc, - ASTUnit *TU) { - assert(Super && TU && "Invalid arguments!"); - void *RawLoc = reinterpret_cast(Loc.getRawEncoding()); - CXCursor C = { CXCursor_ObjCProtocolRef, { Super, RawLoc, TU } }; - return C; -} - -std::pair -cxcursor::getCursorObjCProtocolRef(CXCursor C) { - assert(C.kind == CXCursor_ObjCProtocolRef); - return std::make_pair(static_cast(C.data[0]), - SourceLocation::getFromRawEncoding( - reinterpret_cast(C.data[1]))); -} - -CXCursor cxcursor::MakeCursorObjCClassRef(ObjCInterfaceDecl *Class, - SourceLocation Loc, - ASTUnit *TU) { - // 'Class' can be null for invalid code. - if (!Class) - return MakeCXCursorInvalid(CXCursor_InvalidCode); - assert(TU && "Invalid arguments!"); - void *RawLoc = reinterpret_cast(Loc.getRawEncoding()); - CXCursor C = { CXCursor_ObjCClassRef, { Class, RawLoc, TU } }; - return C; -} - -std::pair -cxcursor::getCursorObjCClassRef(CXCursor C) { - assert(C.kind == CXCursor_ObjCClassRef); - return std::make_pair(static_cast(C.data[0]), - SourceLocation::getFromRawEncoding( - reinterpret_cast(C.data[1]))); -} - -CXCursor cxcursor::MakeCursorTypeRef(TypeDecl *Type, SourceLocation Loc, - ASTUnit *TU) { - assert(Type && TU && "Invalid arguments!"); - void *RawLoc = reinterpret_cast(Loc.getRawEncoding()); - CXCursor C = { CXCursor_TypeRef, { Type, RawLoc, TU } }; - return C; -} - -std::pair -cxcursor::getCursorTypeRef(CXCursor C) { - assert(C.kind == CXCursor_TypeRef); - return std::make_pair(static_cast(C.data[0]), - SourceLocation::getFromRawEncoding( - reinterpret_cast(C.data[1]))); -} - -CXCursor cxcursor::MakeCursorTemplateRef(TemplateDecl *Template, - SourceLocation Loc, ASTUnit *TU) { - assert(Template && TU && "Invalid arguments!"); - void *RawLoc = reinterpret_cast(Loc.getRawEncoding()); - CXCursor C = { CXCursor_TemplateRef, { Template, RawLoc, TU } }; - return C; -} - -std::pair -cxcursor::getCursorTemplateRef(CXCursor C) { - assert(C.kind == CXCursor_TemplateRef); - return std::make_pair(static_cast(C.data[0]), - SourceLocation::getFromRawEncoding( - reinterpret_cast(C.data[1]))); -} - -CXCursor cxcursor::MakeCursorNamespaceRef(NamedDecl *NS, SourceLocation Loc, - ASTUnit *TU) { - - assert(NS && (isa(NS) || isa(NS)) && TU && - "Invalid arguments!"); - void *RawLoc = reinterpret_cast(Loc.getRawEncoding()); - CXCursor C = { CXCursor_NamespaceRef, { NS, RawLoc, TU } }; - return C; -} - -std::pair -cxcursor::getCursorNamespaceRef(CXCursor C) { - assert(C.kind == CXCursor_NamespaceRef); - return std::make_pair(static_cast(C.data[0]), - SourceLocation::getFromRawEncoding( - reinterpret_cast(C.data[1]))); -} - -CXCursor cxcursor::MakeCursorCXXBaseSpecifier(CXXBaseSpecifier *B, ASTUnit *TU){ - CXCursor C = { CXCursor_CXXBaseSpecifier, { B, 0, TU } }; - return C; -} - -CXXBaseSpecifier *cxcursor::getCursorCXXBaseSpecifier(CXCursor C) { - assert(C.kind == CXCursor_CXXBaseSpecifier); - return static_cast(C.data[0]); -} - -CXCursor cxcursor::MakePreprocessingDirectiveCursor(SourceRange Range, - ASTUnit *TU) { - CXCursor C = { CXCursor_PreprocessingDirective, - { reinterpret_cast(Range.getBegin().getRawEncoding()), - reinterpret_cast(Range.getEnd().getRawEncoding()), - TU } - }; - return C; -} - -SourceRange cxcursor::getCursorPreprocessingDirective(CXCursor C) { - assert(C.kind == CXCursor_PreprocessingDirective); - return SourceRange(SourceLocation::getFromRawEncoding( - reinterpret_cast (C.data[0])), - SourceLocation::getFromRawEncoding( - reinterpret_cast (C.data[1]))); -} - -CXCursor cxcursor::MakeMacroDefinitionCursor(MacroDefinition *MI, ASTUnit *TU) { - CXCursor C = { CXCursor_MacroDefinition, { MI, 0, TU } }; - return C; -} - -MacroDefinition *cxcursor::getCursorMacroDefinition(CXCursor C) { - assert(C.kind == CXCursor_MacroDefinition); - return static_cast(C.data[0]); -} - -CXCursor cxcursor::MakeMacroInstantiationCursor(MacroInstantiation *MI, - ASTUnit *TU) { - CXCursor C = { CXCursor_MacroInstantiation, { MI, 0, TU } }; - return C; -} - -MacroInstantiation *cxcursor::getCursorMacroInstantiation(CXCursor C) { - assert(C.kind == CXCursor_MacroInstantiation); - return static_cast(C.data[0]); -} - -Decl *cxcursor::getCursorDecl(CXCursor Cursor) { - return (Decl *)Cursor.data[0]; -} - -Expr *cxcursor::getCursorExpr(CXCursor Cursor) { - return dyn_cast_or_null(getCursorStmt(Cursor)); -} - -Stmt *cxcursor::getCursorStmt(CXCursor Cursor) { - if (Cursor.kind == CXCursor_ObjCSuperClassRef || - Cursor.kind == CXCursor_ObjCProtocolRef || - Cursor.kind == CXCursor_ObjCClassRef) - return 0; - - return (Stmt *)Cursor.data[1]; -} - -Attr *cxcursor::getCursorAttr(CXCursor Cursor) { - return (Attr *)Cursor.data[1]; -} - -ASTContext &cxcursor::getCursorContext(CXCursor Cursor) { - return getCursorASTUnit(Cursor)->getASTContext(); -} - -ASTUnit *cxcursor::getCursorASTUnit(CXCursor Cursor) { - return static_cast(Cursor.data[2]); -} - -bool cxcursor::operator==(CXCursor X, CXCursor Y) { - return X.kind == Y.kind && X.data[0] == Y.data[0] && X.data[1] == Y.data[1] && - X.data[2] == Y.data[2]; -} diff --git a/contrib/llvm/tools/clang/tools/libclang/CXCursor.h b/contrib/llvm/tools/clang/tools/libclang/CXCursor.h deleted file mode 100644 index a5f111edc1d8..000000000000 --- a/contrib/llvm/tools/clang/tools/libclang/CXCursor.h +++ /dev/null @@ -1,138 +0,0 @@ -//===- CXCursor.h - Routines for manipulating CXCursors -------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines routines for manipulating CXCursors. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_CXCURSOR_H -#define LLVM_CLANG_CXCURSOR_H - -#include "clang-c/Index.h" -#include "clang/Basic/SourceLocation.h" -#include - -namespace clang { - -class ASTContext; -class ASTUnit; -class Attr; -class CXXBaseSpecifier; -class Decl; -class Expr; -class MacroDefinition; -class MacroInstantiation; -class NamedDecl; -class ObjCInterfaceDecl; -class ObjCProtocolDecl; -class Stmt; -class TemplateDecl; -class TypeDecl; - -namespace cxcursor { - -CXCursor MakeCXCursor(const clang::Attr *A, clang::Decl *Parent, ASTUnit *TU); -CXCursor MakeCXCursor(clang::Decl *D, ASTUnit *TU); -CXCursor MakeCXCursor(clang::Stmt *S, clang::Decl *Parent, ASTUnit *TU); -CXCursor MakeCXCursorInvalid(CXCursorKind K); - -/// \brief Create an Objective-C superclass reference at the given location. -CXCursor MakeCursorObjCSuperClassRef(ObjCInterfaceDecl *Super, - SourceLocation Loc, - ASTUnit *TU); - -/// \brief Unpack an ObjCSuperClassRef cursor into the interface it references -/// and optionally the location where the reference occurred. -std::pair - getCursorObjCSuperClassRef(CXCursor C); - -/// \brief Create an Objective-C protocol reference at the given location. -CXCursor MakeCursorObjCProtocolRef(ObjCProtocolDecl *Proto, SourceLocation Loc, - ASTUnit *TU); - -/// \brief Unpack an ObjCProtocolRef cursor into the protocol it references -/// and optionally the location where the reference occurred. -std::pair - getCursorObjCProtocolRef(CXCursor C); - -/// \brief Create an Objective-C class reference at the given location. -CXCursor MakeCursorObjCClassRef(ObjCInterfaceDecl *Class, SourceLocation Loc, - ASTUnit *TU); - -/// \brief Unpack an ObjCClassRef cursor into the class it references -/// and optionally the location where the reference occurred. -std::pair - getCursorObjCClassRef(CXCursor C); - -/// \brief Create a type reference at the given location. -CXCursor MakeCursorTypeRef(TypeDecl *Type, SourceLocation Loc, ASTUnit *TU); - -/// \brief Unpack a TypeRef cursor into the class it references -/// and optionally the location where the reference occurred. -std::pair getCursorTypeRef(CXCursor C); - -/// \brief Create a reference to a template at the given location. -CXCursor MakeCursorTemplateRef(TemplateDecl *Template, SourceLocation Loc, - ASTUnit *TU); - -/// \brief Unpack a TemplateRef cursor into the template it references and -/// the location where the reference occurred. -std::pair getCursorTemplateRef(CXCursor C); - -/// \brief Create a reference to a namespace or namespace alias at the given -/// location. -CXCursor MakeCursorNamespaceRef(NamedDecl *NS, SourceLocation Loc, ASTUnit *TU); - -/// \brief Unpack a NamespaceRef cursor into the namespace or namespace alias -/// it references and the location where the reference occurred. -std::pair getCursorNamespaceRef(CXCursor C); - -/// \brief Create a CXX base specifier cursor. -CXCursor MakeCursorCXXBaseSpecifier(CXXBaseSpecifier *B, ASTUnit *TU); - -/// \brief Unpack a CXXBaseSpecifier cursor into a CXXBaseSpecifier. -CXXBaseSpecifier *getCursorCXXBaseSpecifier(CXCursor C); - -/// \brief Create a preprocessing directive cursor. -CXCursor MakePreprocessingDirectiveCursor(SourceRange Range, ASTUnit *TU); - -/// \brief Unpack a given preprocessing directive to retrieve its source range. -SourceRange getCursorPreprocessingDirective(CXCursor C); - -/// \brief Create a macro definition cursor. -CXCursor MakeMacroDefinitionCursor(MacroDefinition *, ASTUnit *TU); - -/// \brief Unpack a given macro definition cursor to retrieve its -/// source range. -MacroDefinition *getCursorMacroDefinition(CXCursor C); - -/// \brief Create a macro instantiation cursor. -CXCursor MakeMacroInstantiationCursor(MacroInstantiation *, ASTUnit *TU); - -/// \brief Unpack a given macro instantiation cursor to retrieve its -/// source range. -MacroInstantiation *getCursorMacroInstantiation(CXCursor C); - -Decl *getCursorDecl(CXCursor Cursor); -Expr *getCursorExpr(CXCursor Cursor); -Stmt *getCursorStmt(CXCursor Cursor); -Attr *getCursorAttr(CXCursor Cursor); - -ASTContext &getCursorContext(CXCursor Cursor); -ASTUnit *getCursorASTUnit(CXCursor Cursor); - -bool operator==(CXCursor X, CXCursor Y); - -inline bool operator!=(CXCursor X, CXCursor Y) { - return !(X == Y); -} - -}} // end namespace: clang::cxcursor - -#endif diff --git a/contrib/llvm/tools/clang/tools/libclang/CXSourceLocation.h b/contrib/llvm/tools/clang/tools/libclang/CXSourceLocation.h deleted file mode 100644 index 7a502059634a..000000000000 --- a/contrib/llvm/tools/clang/tools/libclang/CXSourceLocation.h +++ /dev/null @@ -1,78 +0,0 @@ -//===- CXSourceLocation.h - CXSourceLocations Utilities ---------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines routines for manipulating CXSourceLocations. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_CXSOURCELOCATION_H -#define LLVM_CLANG_CXSOURCELOCATION_H - -#include "clang-c/Index.h" -#include "clang/Basic/SourceLocation.h" -#include "clang/Basic/LangOptions.h" -#include "clang/AST/ASTContext.h" - -namespace clang { - -class SourceManager; - -namespace cxloc { - -/// \brief Translate a Clang source location into a CIndex source location. -static inline CXSourceLocation -translateSourceLocation(const SourceManager &SM, const LangOptions &LangOpts, - SourceLocation Loc) { - if (Loc.isInvalid()) - clang_getNullLocation(); - - CXSourceLocation Result = { { (void*) &SM, (void*) &LangOpts, }, - Loc.getRawEncoding() }; - return Result; -} - -/// \brief Translate a Clang source location into a CIndex source location. -static inline CXSourceLocation translateSourceLocation(ASTContext &Context, - SourceLocation Loc) { - return translateSourceLocation(Context.getSourceManager(), - Context.getLangOptions(), - Loc); -} - -/// \brief Translate a Clang source range into a CIndex source range. -/// -/// Clang internally represents ranges where the end location points to the -/// start of the token at the end. However, for external clients it is more -/// useful to have a CXSourceRange be a proper half-open interval. This routine -/// does the appropriate translation. -CXSourceRange translateSourceRange(const SourceManager &SM, - const LangOptions &LangOpts, - const CharSourceRange &R); - -/// \brief Translate a Clang source range into a CIndex source range. -static inline CXSourceRange translateSourceRange(ASTContext &Context, - SourceRange R) { - return translateSourceRange(Context.getSourceManager(), - Context.getLangOptions(), - CharSourceRange::getTokenRange(R)); -} - -static inline SourceLocation translateSourceLocation(CXSourceLocation L) { - return SourceLocation::getFromRawEncoding(L.int_data); -} - -static inline SourceRange translateCXSourceRange(CXSourceRange R) { - return SourceRange(SourceLocation::getFromRawEncoding(R.begin_int_data), - SourceLocation::getFromRawEncoding(R.end_int_data)); -} - - -}} // end namespace: clang::cxloc - -#endif diff --git a/contrib/llvm/tools/clang/tools/libclang/CXType.cpp b/contrib/llvm/tools/clang/tools/libclang/CXType.cpp deleted file mode 100644 index aa173cae32c0..000000000000 --- a/contrib/llvm/tools/clang/tools/libclang/CXType.cpp +++ /dev/null @@ -1,297 +0,0 @@ -//===- CXTypes.cpp - Implements 'CXTypes' aspect of libclang ------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===--------------------------------------------------------------------===// -// -// This file implements the 'CXTypes' API hooks in the Clang-C library. -// -//===--------------------------------------------------------------------===// - -#include "CIndexer.h" -#include "CXCursor.h" -#include "CXType.h" -#include "clang/AST/Expr.h" -#include "clang/AST/Type.h" -#include "clang/AST/Decl.h" -#include "clang/AST/DeclObjC.h" -#include "clang/Frontend/ASTUnit.h" - -using namespace clang; - -static CXTypeKind GetBuiltinTypeKind(const BuiltinType *BT) { -#define BTCASE(K) case BuiltinType::K: return CXType_##K - switch (BT->getKind()) { - BTCASE(Void); - BTCASE(Bool); - BTCASE(Char_U); - BTCASE(UChar); - BTCASE(Char16); - BTCASE(Char32); - BTCASE(UShort); - BTCASE(UInt); - BTCASE(ULong); - BTCASE(ULongLong); - BTCASE(UInt128); - BTCASE(Char_S); - BTCASE(SChar); - BTCASE(WChar); - BTCASE(Short); - BTCASE(Int); - BTCASE(Long); - BTCASE(LongLong); - BTCASE(Int128); - BTCASE(Float); - BTCASE(Double); - BTCASE(LongDouble); - BTCASE(NullPtr); - BTCASE(Overload); - BTCASE(Dependent); - BTCASE(ObjCId); - BTCASE(ObjCClass); - BTCASE(ObjCSel); - default: - return CXType_Unexposed; - } -#undef BTCASE -} - -static CXTypeKind GetTypeKind(QualType T) { - Type *TP = T.getTypePtr(); - if (!TP) - return CXType_Invalid; - -#define TKCASE(K) case Type::K: return CXType_##K - switch (TP->getTypeClass()) { - case Type::Builtin: - return GetBuiltinTypeKind(cast(TP)); - TKCASE(Complex); - TKCASE(Pointer); - TKCASE(BlockPointer); - TKCASE(LValueReference); - TKCASE(RValueReference); - TKCASE(Record); - TKCASE(Enum); - TKCASE(Typedef); - TKCASE(ObjCInterface); - TKCASE(ObjCObjectPointer); - TKCASE(FunctionNoProto); - TKCASE(FunctionProto); - default: - return CXType_Unexposed; - } -#undef TKCASE -} - - -CXType cxtype::MakeCXType(QualType T, ASTUnit *TU) { - CXTypeKind TK = GetTypeKind(T); - CXType CT = { TK, { TK == CXType_Invalid ? 0 : T.getAsOpaquePtr(), TU }}; - return CT; -} - -using cxtype::MakeCXType; - -static inline QualType GetQualType(CXType CT) { - return QualType::getFromOpaquePtr(CT.data[0]); -} - -static inline ASTUnit* GetASTU(CXType CT) { - return static_cast(CT.data[1]); -} - -extern "C" { - -CXType clang_getCursorType(CXCursor C) { - ASTUnit *AU = cxcursor::getCursorASTUnit(C); - - if (clang_isExpression(C.kind)) { - QualType T = cxcursor::getCursorExpr(C)->getType(); - return MakeCXType(T, AU); - } - - if (clang_isDeclaration(C.kind)) { - Decl *D = cxcursor::getCursorDecl(C); - - if (TypeDecl *TD = dyn_cast(D)) - return MakeCXType(QualType(TD->getTypeForDecl(), 0), AU); - if (ObjCInterfaceDecl *ID = dyn_cast(D)) - return MakeCXType(QualType(ID->getTypeForDecl(), 0), AU); - if (ValueDecl *VD = dyn_cast(D)) - return MakeCXType(VD->getType(), AU); - if (ObjCPropertyDecl *PD = dyn_cast(D)) - return MakeCXType(PD->getType(), AU); - if (FunctionDecl *FD = dyn_cast(D)) - return MakeCXType(FD->getType(), AU); - return MakeCXType(QualType(), AU); - } - - return MakeCXType(QualType(), AU); -} - -CXType clang_getCanonicalType(CXType CT) { - if (CT.kind == CXType_Invalid) - return CT; - - QualType T = GetQualType(CT); - - if (T.isNull()) - return MakeCXType(QualType(), GetASTU(CT)); - - ASTUnit *AU = GetASTU(CT); - return MakeCXType(AU->getASTContext().getCanonicalType(T), AU); -} - -CXType clang_getPointeeType(CXType CT) { - QualType T = GetQualType(CT); - Type *TP = T.getTypePtr(); - - if (!TP) - return MakeCXType(QualType(), GetASTU(CT)); - - switch (TP->getTypeClass()) { - case Type::Pointer: - T = cast(TP)->getPointeeType(); - break; - case Type::BlockPointer: - T = cast(TP)->getPointeeType(); - break; - case Type::LValueReference: - case Type::RValueReference: - T = cast(TP)->getPointeeType(); - break; - case Type::ObjCObjectPointer: - T = cast(TP)->getPointeeType(); - break; - default: - T = QualType(); - break; - } - return MakeCXType(T, GetASTU(CT)); -} - -CXCursor clang_getTypeDeclaration(CXType CT) { - if (CT.kind == CXType_Invalid) - return cxcursor::MakeCXCursorInvalid(CXCursor_NoDeclFound); - - QualType T = GetQualType(CT); - Type *TP = T.getTypePtr(); - - if (!TP) - return cxcursor::MakeCXCursorInvalid(CXCursor_NoDeclFound); - - Decl *D = 0; - - switch (TP->getTypeClass()) { - case Type::Typedef: - D = cast(TP)->getDecl(); - break; - case Type::ObjCObject: - D = cast(TP)->getInterface(); - break; - case Type::ObjCInterface: - D = cast(TP)->getDecl(); - break; - case Type::Record: - case Type::Enum: - D = cast(TP)->getDecl(); - break; - default: - break; - } - - if (!D) - return cxcursor::MakeCXCursorInvalid(CXCursor_NoDeclFound); - - return cxcursor::MakeCXCursor(D, GetASTU(CT)); -} - -CXString clang_getTypeKindSpelling(enum CXTypeKind K) { - const char *s = 0; -#define TKIND(X) case CXType_##X: s = "" #X ""; break - switch (K) { - TKIND(Invalid); - TKIND(Unexposed); - TKIND(Void); - TKIND(Bool); - TKIND(Char_U); - TKIND(UChar); - TKIND(Char16); - TKIND(Char32); - TKIND(UShort); - TKIND(UInt); - TKIND(ULong); - TKIND(ULongLong); - TKIND(UInt128); - TKIND(Char_S); - TKIND(SChar); - TKIND(WChar); - TKIND(Short); - TKIND(Int); - TKIND(Long); - TKIND(LongLong); - TKIND(Int128); - TKIND(Float); - TKIND(Double); - TKIND(LongDouble); - TKIND(NullPtr); - TKIND(Overload); - TKIND(Dependent); - TKIND(ObjCId); - TKIND(ObjCClass); - TKIND(ObjCSel); - TKIND(Complex); - TKIND(Pointer); - TKIND(BlockPointer); - TKIND(LValueReference); - TKIND(RValueReference); - TKIND(Record); - TKIND(Enum); - TKIND(Typedef); - TKIND(ObjCInterface); - TKIND(ObjCObjectPointer); - TKIND(FunctionNoProto); - TKIND(FunctionProto); - } -#undef TKIND - return cxstring::createCXString(s); -} - -unsigned clang_equalTypes(CXType A, CXType B) { - return A.data[0] == B.data[0] && A.data[1] == B.data[1];; -} - -CXType clang_getResultType(CXType X) { - QualType T = GetQualType(X); - if (!T.getTypePtr()) - return MakeCXType(QualType(), GetASTU(X)); - - if (const FunctionType *FD = T->getAs()) - return MakeCXType(FD->getResultType(), GetASTU(X)); - - return MakeCXType(QualType(), GetASTU(X)); -} - -CXType clang_getCursorResultType(CXCursor C) { - if (clang_isDeclaration(C.kind)) { - Decl *D = cxcursor::getCursorDecl(C); - if (const ObjCMethodDecl *MD = dyn_cast(D)) - return MakeCXType(MD->getResultType(), cxcursor::getCursorASTUnit(C)); - - return clang_getResultType(clang_getCursorType(C)); - } - - return MakeCXType(QualType(), cxcursor::getCursorASTUnit(C)); -} - -unsigned clang_isPODType(CXType X) { - QualType T = GetQualType(X); - if (!T.getTypePtr()) - return 0; - return T->isPODType() ? 1 : 0; -} - -} // end: extern "C" diff --git a/contrib/llvm/tools/clang/tools/libclang/CXType.h b/contrib/llvm/tools/clang/tools/libclang/CXType.h deleted file mode 100644 index 94151ed6b98b..000000000000 --- a/contrib/llvm/tools/clang/tools/libclang/CXType.h +++ /dev/null @@ -1,29 +0,0 @@ -//===- CXTypes.h - Routines for manipulating CXTypes ----------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines routines for manipulating CXCursors. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_CXTYPES_H -#define LLVM_CLANG_CXTYPES_H - -#include "clang-c/Index.h" -#include "clang/AST/Type.h" - -namespace clang { - -class ASTUnit; - -namespace cxtype { - -CXType MakeCXType(QualType T, ASTUnit *TU); - -}} // end namespace clang::cxtype -#endif diff --git a/contrib/llvm/tools/clang/tools/libclang/Makefile b/contrib/llvm/tools/clang/tools/libclang/Makefile deleted file mode 100644 index 6d2a13cfc0b4..000000000000 --- a/contrib/llvm/tools/clang/tools/libclang/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -##===- tools/libclang/Makefile -----------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -CLANG_LEVEL := ../.. -LIBRARYNAME = clang - -EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/libclang.exports - -LINK_LIBS_IN_SHARED = 1 -SHARED_LIBRARY = 1 - -LINK_COMPONENTS := bitreader mc core -USEDLIBS = clangFrontend.a clangDriver.a clangSerialization.a clangParse.a \ - clangSema.a clangAnalysis.a clangAST.a clangLex.a clangBasic.a - -include $(CLANG_LEVEL)/Makefile - -##===----------------------------------------------------------------------===## -# FIXME: This is copied from the 'lto' makefile. Should we share this? -##===----------------------------------------------------------------------===## - -ifeq ($(HOST_OS),Darwin) - LLVMLibsOptions += -Wl,-compatibility_version,1 - - # Set dylib internal version number to submission number. - ifdef LLVM_SUBMIT_VERSION - LLVMLibsOptions += -Wl,-current_version \ - -Wl,$(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION) - endif - - # Extra options to override libtool defaults. - LLVMLibsOptions += -Wl,-dead_strip -Wl,-seg1addr,0xE0000000 - - # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line - DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/') - ifneq ($(DARWIN_VERS),8) - LLVMLibsOptions += -Wl,-install_name \ - -Wl,"@rpath/lib$(LIBRARYNAME)$(SHLIBEXT)" - endif -endif diff --git a/contrib/llvm/tools/clang/tools/libclang/libclang.darwin.exports b/contrib/llvm/tools/clang/tools/libclang/libclang.darwin.exports deleted file mode 100644 index d1b45a248674..000000000000 --- a/contrib/llvm/tools/clang/tools/libclang/libclang.darwin.exports +++ /dev/null @@ -1,108 +0,0 @@ -_clang_CXXMethod_isStatic -_clang_annotateTokens -_clang_codeComplete -_clang_codeCompleteAt -_clang_codeCompleteGetDiagnostic -_clang_codeCompleteGetNumDiagnostics -_clang_constructUSR_ObjCCategory -_clang_constructUSR_ObjCClass -_clang_constructUSR_ObjCIvar -_clang_constructUSR_ObjCMethod -_clang_constructUSR_ObjCProperty -_clang_constructUSR_ObjCProtocol -_clang_createIndex -_clang_createTranslationUnit -_clang_createTranslationUnitFromSourceFile -_clang_defaultCodeCompleteOptions -_clang_defaultDiagnosticDisplayOptions -_clang_defaultEditingTranslationUnitOptions -_clang_defaultReparseOptions -_clang_defaultSaveOptions -_clang_disposeCodeCompleteResults -_clang_disposeDiagnostic -_clang_disposeIndex -_clang_disposeString -_clang_disposeTokens -_clang_disposeTranslationUnit -_clang_enableStackTraces -_clang_equalCursors -_clang_equalLocations -_clang_equalTypes -_clang_formatDiagnostic -_clang_getCString -_clang_getCXXAccessSpecifier -_clang_getCanonicalType -_clang_getClangVersion -_clang_getCompletionAvailability -_clang_getCompletionChunkCompletionString -_clang_getCompletionChunkKind -_clang_getCompletionChunkText -_clang_getCompletionPriority -_clang_getCursor -_clang_getCursorAvailability -_clang_getCursorDefinition -_clang_getCursorExtent -_clang_getCursorKind -_clang_getCursorKindSpelling -_clang_getCursorLanguage -_clang_getCursorLinkage -_clang_getCursorLocation -_clang_getCursorReferenced -_clang_getCursorResultType -_clang_getCursorSpelling -_clang_getCursorType -_clang_getCursorUSR -_clang_getDefinitionSpellingAndExtent -_clang_getDiagnostic -_clang_getDiagnosticFixIt -_clang_getDiagnosticLocation -_clang_getDiagnosticNumFixIts -_clang_getDiagnosticNumRanges -_clang_getDiagnosticRange -_clang_getDiagnosticSeverity -_clang_getDiagnosticSpelling -_clang_getFile -_clang_getFileName -_clang_getFileTime -_clang_getIBOutletCollectionType -_clang_getInclusions -_clang_getInstantiationLocation -_clang_getLocation -_clang_getNullCursor -_clang_getNullLocation -_clang_getNullRange -_clang_getNumCompletionChunks -_clang_getNumDiagnostics -_clang_getPointeeType -_clang_getRange -_clang_getRangeEnd -_clang_getRangeStart -_clang_getResultType -_clang_getSpecializedCursorTemplate -_clang_getTemplateCursorKind -_clang_getTokenExtent -_clang_getTokenKind -_clang_getTokenLocation -_clang_getTokenSpelling -_clang_getTranslationUnitCursor -_clang_getTranslationUnitSpelling -_clang_getTypeDeclaration -_clang_getTypeKindSpelling -_clang_isCursorDefinition -_clang_isDeclaration -_clang_isExpression -_clang_isInvalid -_clang_isPODType -_clang_isPreprocessing -_clang_isReference -_clang_isStatement -_clang_isTranslationUnit -_clang_isUnexposed -_clang_isVirtualBase -_clang_parseTranslationUnit -_clang_reparseTranslationUnit -_clang_saveTranslationUnit -_clang_setUseExternalASTGeneration -_clang_sortCodeCompletionResults -_clang_tokenize -_clang_visitChildren diff --git a/contrib/llvm/tools/clang/tools/libclang/libclang.exports b/contrib/llvm/tools/clang/tools/libclang/libclang.exports deleted file mode 100644 index 0ea6993b218c..000000000000 --- a/contrib/llvm/tools/clang/tools/libclang/libclang.exports +++ /dev/null @@ -1,108 +0,0 @@ -clang_CXXMethod_isStatic -clang_annotateTokens -clang_codeComplete -clang_codeCompleteAt -clang_codeCompleteGetDiagnostic -clang_codeCompleteGetNumDiagnostics -clang_constructUSR_ObjCCategory -clang_constructUSR_ObjCClass -clang_constructUSR_ObjCIvar -clang_constructUSR_ObjCMethod -clang_constructUSR_ObjCProperty -clang_constructUSR_ObjCProtocol -clang_createIndex -clang_createTranslationUnit -clang_createTranslationUnitFromSourceFile -clang_defaultCodeCompleteOptions -clang_defaultDiagnosticDisplayOptions -clang_defaultEditingTranslationUnitOptions -clang_defaultReparseOptions -clang_defaultSaveOptions -clang_disposeCodeCompleteResults -clang_disposeDiagnostic -clang_disposeIndex -clang_disposeString -clang_disposeTokens -clang_disposeTranslationUnit -clang_enableStackTraces -clang_equalCursors -clang_equalLocations -clang_equalTypes -clang_formatDiagnostic -clang_getCString -clang_getCXXAccessSpecifier -clang_getCanonicalType -clang_getClangVersion -clang_getCompletionAvailability -clang_getCompletionChunkCompletionString -clang_getCompletionChunkKind -clang_getCompletionChunkText -clang_getCompletionPriority -clang_getCursor -clang_getCursorAvailability -clang_getCursorDefinition -clang_getCursorExtent -clang_getCursorKind -clang_getCursorKindSpelling -clang_getCursorLanguage -clang_getCursorLinkage -clang_getCursorLocation -clang_getCursorReferenced -clang_getCursorResultType -clang_getCursorSpelling -clang_getCursorType -clang_getCursorUSR -clang_getDefinitionSpellingAndExtent -clang_getDiagnostic -clang_getDiagnosticFixIt -clang_getDiagnosticLocation -clang_getDiagnosticNumFixIts -clang_getDiagnosticNumRanges -clang_getDiagnosticRange -clang_getDiagnosticSeverity -clang_getDiagnosticSpelling -clang_getFile -clang_getFileName -clang_getFileTime -clang_getIBOutletCollectionType -clang_getInclusions -clang_getInstantiationLocation -clang_getLocation -clang_getNullCursor -clang_getNullLocation -clang_getNullRange -clang_getNumCompletionChunks -clang_getNumDiagnostics -clang_getPointeeType -clang_getRange -clang_getRangeEnd -clang_getRangeStart -clang_getResultType -clang_getSpecializedCursorTemplate -clang_getTemplateCursorKind -clang_getTokenExtent -clang_getTokenKind -clang_getTokenLocation -clang_getTokenSpelling -clang_getTranslationUnitCursor -clang_getTranslationUnitSpelling -clang_getTypeDeclaration -clang_getTypeKindSpelling -clang_isCursorDefinition -clang_isDeclaration -clang_isExpression -clang_isInvalid -clang_isPODType -clang_isPreprocessing -clang_isReference -clang_isStatement -clang_isTranslationUnit -clang_isUnexposed -clang_isVirtualBase -clang_parseTranslationUnit -clang_reparseTranslationUnit -clang_saveTranslationUnit -clang_setUseExternalASTGeneration -clang_sortCodeCompletionResults -clang_tokenize -clang_visitChildren diff --git a/contrib/llvm/tools/clang/tools/scan-build/c++-analyzer b/contrib/llvm/tools/clang/tools/scan-build/c++-analyzer deleted file mode 120000 index ca10bf547dc2..000000000000 --- a/contrib/llvm/tools/clang/tools/scan-build/c++-analyzer +++ /dev/null @@ -1 +0,0 @@ -ccc-analyzer \ No newline at end of file diff --git a/contrib/llvm/tools/clang/tools/scan-build/ccc-analyzer b/contrib/llvm/tools/clang/tools/scan-build/ccc-analyzer deleted file mode 100755 index c182a686202f..000000000000 --- a/contrib/llvm/tools/clang/tools/scan-build/ccc-analyzer +++ /dev/null @@ -1,661 +0,0 @@ -#!/usr/bin/env perl -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -# -# A script designed to interpose between the build system and gcc. It invokes -# both gcc and the static analyzer. -# -##===----------------------------------------------------------------------===## - -use strict; -use warnings; -use FindBin; -use Cwd qw/ getcwd abs_path /; -use File::Temp qw/ tempfile /; -use File::Path qw / mkpath /; -use File::Basename; -use Text::ParseWords; - -##===----------------------------------------------------------------------===## -# Compiler command setup. -##===----------------------------------------------------------------------===## - -my $Compiler; -my $Clang; - -if ($FindBin::Script =~ /c\+\+-analyzer/) { - $Compiler = $ENV{'CCC_CXX'}; - if (!defined $Compiler) { $Compiler = "g++"; } - - $Clang = $ENV{'CLANG_CXX'}; - if (!defined $Clang) { $Clang = 'clang++'; } -} -else { - $Compiler = $ENV{'CCC_CC'}; - if (!defined $Compiler) { $Compiler = "gcc"; } - - $Clang = $ENV{'CLANG'}; - if (!defined $Clang) { $Clang = 'clang'; } -} - -##===----------------------------------------------------------------------===## -# Cleanup. -##===----------------------------------------------------------------------===## - -my $ReportFailures = $ENV{'CCC_REPORT_FAILURES'}; -if (!defined $ReportFailures) { $ReportFailures = 1; } - -my $CleanupFile; -my $ResultFile; - -# Remove any stale files at exit. -END { - if (defined $CleanupFile && -z $CleanupFile) { - `rm -f $CleanupFile`; - } -} - -##----------------------------------------------------------------------------## -# Process Clang Crashes. -##----------------------------------------------------------------------------## - -sub GetPPExt { - my $Lang = shift; - if ($Lang =~ /objective-c\+\+/) { return ".mii" }; - if ($Lang =~ /objective-c/) { return ".mi"; } - if ($Lang =~ /c\+\+/) { return ".ii"; } - return ".i"; -} - -# Set this to 1 if we want to include 'parser rejects' files. -my $IncludeParserRejects = 0; -my $ParserRejects = "Parser Rejects"; - -my $AttributeIgnored = "Attribute Ignored"; - -sub ProcessClangFailure { - my ($Clang, $Lang, $file, $Args, $HtmlDir, $ErrorType, $ofile) = @_; - my $Dir = "$HtmlDir/failures"; - mkpath $Dir; - - my $prefix = "clang_crash"; - if ($ErrorType eq $ParserRejects) { - $prefix = "clang_parser_rejects"; - } - elsif ($ErrorType eq $AttributeIgnored) { - $prefix = "clang_attribute_ignored"; - } - - # Generate the preprocessed file with Clang. - my ($PPH, $PPFile) = tempfile( $prefix . "_XXXXXX", - SUFFIX => GetPPExt($Lang), - DIR => $Dir); - system $Clang, @$Args, "-E", "-o", $PPFile; - close ($PPH); - - # Create the info file. - open (OUT, ">", "$PPFile.info.txt") or die "Cannot open $PPFile.info.txt\n"; - print OUT abs_path($file), "\n"; - print OUT "$ErrorType\n"; - print OUT "@$Args\n"; - close OUT; - `uname -a >> $PPFile.info.txt 2>&1`; - `$Compiler -v >> $PPFile.info.txt 2>&1`; - system 'mv',$ofile,"$PPFile.stderr.txt"; - return (basename $PPFile); -} - -##----------------------------------------------------------------------------## -# Running the analyzer. -##----------------------------------------------------------------------------## - -sub GetCCArgs { - my $Args = shift; - - pipe (FROM_CHILD, TO_PARENT); - my $pid = fork(); - if ($pid == 0) { - close FROM_CHILD; - open(STDOUT,">&", \*TO_PARENT); - open(STDERR,">&", \*TO_PARENT); - exec $Clang, "-###", "-fsyntax-only", @$Args; - } - close(TO_PARENT); - my $line; - while () { - next if (!/-cc1/); - $line = $_; - } - - waitpid($pid,0); - close(FROM_CHILD); - - die "could not find clang line\n" if (!defined $line); - # Strip the newline and initial whitspace - chomp $line; - $line =~ s/^\s+//; - my @items = quotewords('\s+', 0, $line); - my $cmd = shift @items; - die "cannot find 'clang' in 'clang' command\n" if (!($cmd =~ /clang/)); - return \@items; -} - -sub Analyze { - my ($Clang, $Args, $AnalyzeArgs, $Lang, $Output, $Verbose, $HtmlDir, - $file, $Analyses) = @_; - - $Args = GetCCArgs($Args); - - my $RunAnalyzer = 0; - my $Cmd; - my @CmdArgs; - my @CmdArgsSansAnalyses; - - if ($Lang =~ /header/) { - exit 0 if (!defined ($Output)); - $Cmd = 'cp'; - push @CmdArgs,$file; - # Remove the PCH extension. - $Output =~ s/[.]gch$//; - push @CmdArgs,$Output; - @CmdArgsSansAnalyses = @CmdArgs; - } - else { - $Cmd = $Clang; - push @CmdArgs, "-cc1"; - push @CmdArgs,'-DIBOutlet=__attribute__((iboutlet))'; - push @CmdArgs, @$Args; - @CmdArgsSansAnalyses = @CmdArgs; - push @CmdArgs,'-analyze'; - push @CmdArgs,"-analyzer-display-progress"; - push @CmdArgs,"-analyzer-eagerly-assume"; - push @CmdArgs,"-analyzer-opt-analyze-nested-blocks"; - push @CmdArgs,(split /\s/,$Analyses); - - if (defined $ENV{"CCC_EXPERIMENTAL_CHECKS"}) { - push @CmdArgs,"-analyzer-experimental-internal-checks"; - push @CmdArgs,"-analyzer-experimental-checks"; - } - - $RunAnalyzer = 1; - } - - # Add the analysis arguments passed down from scan-build. - foreach my $Arg (@$AnalyzeArgs) { - push @CmdArgs, $Arg; - } - - my @PrintArgs; - my $dir; - - if ($RunAnalyzer) { - if (defined $ResultFile) { - push @CmdArgs,'-o'; - push @CmdArgs, $ResultFile; - } - elsif (defined $HtmlDir) { - push @CmdArgs,'-o'; - push @CmdArgs, $HtmlDir; - } - } - - if ($Verbose) { - $dir = getcwd(); - print STDERR "\n[LOCATION]: $dir\n"; - push @PrintArgs,"'$Cmd'"; - foreach my $arg (@CmdArgs) { push @PrintArgs,"\'$arg\'"; } - } - - if ($Verbose == 1) { - # We MUST print to stderr. Some clients use the stdout output of - # gcc for various purposes. - print STDERR join(' ',@PrintArgs); - print STDERR "\n"; - } - elsif ($Verbose == 2) { - print STDERR "#SHELL (cd '$dir' && @PrintArgs)\n"; - } - - if (defined $ENV{'CCC_UBI'}) { - push @CmdArgs,"--analyzer-viz-egraph-ubigraph"; - } - - # Capture the STDERR of clang and send it to a temporary file. - # Capture the STDOUT of clang and reroute it to ccc-analyzer's STDERR. - # We save the output file in the 'crashes' directory if clang encounters - # any problems with the file. - pipe (FROM_CHILD, TO_PARENT); - my $pid = fork(); - if ($pid == 0) { - close FROM_CHILD; - open(STDOUT,">&", \*TO_PARENT); - open(STDERR,">&", \*TO_PARENT); - exec $Cmd, @CmdArgs; - } - - close TO_PARENT; - my ($ofh, $ofile) = tempfile("clang_output_XXXXXX", DIR => $HtmlDir); - - while () { - print $ofh $_; - print STDERR $_; - } - - waitpid($pid,0); - close(FROM_CHILD); - my $Result = $?; - - # Did the command die because of a signal? - if ($ReportFailures) { - if ($Result & 127 and $Cmd eq $Clang and defined $HtmlDir) { - ProcessClangFailure($Clang, $Lang, $file, \@CmdArgsSansAnalyses, - $HtmlDir, "Crash", $ofile); - } - elsif ($Result) { - if ($IncludeParserRejects && !($file =~/conftest/)) { - ProcessClangFailure($Clang, $Lang, $file, \@CmdArgsSansAnalyses, - $HtmlDir, $ParserRejects, $ofile); - } - } - else { - # Check if there were any unhandled attributes. - if (open(CHILD, $ofile)) { - my %attributes_not_handled; - - # Don't flag warnings about the following attributes that we - # know are currently not supported by Clang. - $attributes_not_handled{"cdecl"} = 1; - - my $ppfile; - while () { - next if (! /warning: '([^\']+)' attribute ignored/); - - # Have we already spotted this unhandled attribute? - next if (defined $attributes_not_handled{$1}); - $attributes_not_handled{$1} = 1; - - # Get the name of the attribute file. - my $dir = "$HtmlDir/failures"; - my $afile = "$dir/attribute_ignored_$1.txt"; - - # Only create another preprocessed file if the attribute file - # doesn't exist yet. - next if (-e $afile); - - # Add this file to the list of files that contained this attribute. - # Generate a preprocessed file if we haven't already. - if (!(defined $ppfile)) { - $ppfile = ProcessClangFailure($Clang, $Lang, $file, - \@CmdArgsSansAnalyses, - $HtmlDir, $AttributeIgnored, $ofile); - } - - mkpath $dir; - open(AFILE, ">$afile"); - print AFILE "$ppfile\n"; - close(AFILE); - } - close CHILD; - } - } - } - - unlink($ofile); -} - -##----------------------------------------------------------------------------## -# Lookup tables. -##----------------------------------------------------------------------------## - -my %CompileOptionMap = ( - '-nostdinc' => 0, - '-fblocks' => 0, - '-fno-builtin' => 0, - '-fobjc-gc-only' => 0, - '-fobjc-gc' => 0, - '-ffreestanding' => 0, - '-include' => 1, - '-idirafter' => 1, - '-imacros' => 1, - '-iprefix' => 1, - '-iquote' => 1, - '-isystem' => 1, - '-iwithprefix' => 1, - '-iwithprefixbefore' => 1 -); - -my %LinkerOptionMap = ( - '-framework' => 1 -); - -my %CompilerLinkerOptionMap = ( - '-isysroot' => 1, - '-arch' => 1, - '-m32' => 0, - '-m64' => 0, - '-v' => 0, - '-fpascal-strings' => 0, - '-mmacosx-version-min' => 0, # This is really a 1 argument, but always has '=' - '-miphoneos-version-min' => 0 # This is really a 1 argument, but always has '=' -); - -my %IgnoredOptionMap = ( - '-MT' => 1, # Ignore these preprocessor options. - '-MF' => 1, - - '-fsyntax-only' => 0, - '-save-temps' => 0, - '-install_name' => 1, - '-exported_symbols_list' => 1, - '-current_version' => 1, - '-compatibility_version' => 1, - '-init' => 1, - '-e' => 1, - '-seg1addr' => 1, - '-bundle_loader' => 1, - '-multiply_defined' => 1, - '-sectorder' => 3, - '--param' => 1, - '-u' => 1 -); - -my %LangMap = ( - 'c' => 'c', - 'cp' => 'c++', - 'cpp' => 'c++', - 'cc' => 'c++', - 'i' => 'c-cpp-output', - 'm' => 'objective-c', - 'mi' => 'objective-c-cpp-output' -); - -my %UniqueOptions = ( - '-isysroot' => 0 -); - -##----------------------------------------------------------------------------## -# Languages accepted. -##----------------------------------------------------------------------------## - -my %LangsAccepted = ( - "objective-c" => 1, - "c" => 1 -); - -if (defined $ENV{'CCC_ANALYZER_CPLUSPLUS'}) { - $LangsAccepted{"c++"} = 1; - $LangsAccepted{"objective-c++"} = 1; -} - -##----------------------------------------------------------------------------## -# Main Logic. -##----------------------------------------------------------------------------## - -my $Action = 'link'; -my @CompileOpts; -my @LinkOpts; -my @Files; -my $Lang; -my $Output; -my %Uniqued; - -# Forward arguments to gcc. -my $Status = system($Compiler,@ARGV); -if ($Status) { exit($Status >> 8); } - -# Get the analysis options. -my $Analyses = $ENV{'CCC_ANALYZER_ANALYSIS'}; -if (!defined($Analyses)) { $Analyses = '-analyzer-check-objc-mem'; } - -# Get the store model. -my $StoreModel = $ENV{'CCC_ANALYZER_STORE_MODEL'}; -if (!defined $StoreModel) { $StoreModel = "region"; } - -# Get the constraints engine. -my $ConstraintsModel = $ENV{'CCC_ANALYZER_CONSTRAINTS_MODEL'}; -if (!defined $ConstraintsModel) { $ConstraintsModel = "range"; } - -# Get the output format. -my $OutputFormat = $ENV{'CCC_ANALYZER_OUTPUT_FORMAT'}; -if (!defined $OutputFormat) { $OutputFormat = "html"; } - -# Determine the level of verbosity. -my $Verbose = 0; -if (defined $ENV{CCC_ANALYZER_VERBOSE}) { $Verbose = 1; } -if (defined $ENV{CCC_ANALYZER_LOG}) { $Verbose = 2; } - -# Get the HTML output directory. -my $HtmlDir = $ENV{'CCC_ANALYZER_HTML'}; - -my %DisabledArchs = ('ppc' => 1, 'ppc64' => 1); -my %ArchsSeen; -my $HadArch = 0; - -# Process the arguments. -foreach (my $i = 0; $i < scalar(@ARGV); ++$i) { - my $Arg = $ARGV[$i]; - my ($ArgKey) = split /=/,$Arg,2; - - # Modes ccc-analyzer supports - if ($Arg =~ /^-(E|MM?)$/) { $Action = 'preprocess'; } - elsif ($Arg eq '-c') { $Action = 'compile'; } - elsif ($Arg =~ /^-print-prog-name/) { exit 0; } - - # Specially handle duplicate cases of -arch - if ($Arg eq "-arch") { - my $arch = $ARGV[$i+1]; - # We don't want to process 'ppc' because of Clang's lack of support - # for Altivec (also some #defines won't likely be defined correctly, etc.) - if (!(defined $DisabledArchs{$arch})) { $ArchsSeen{$arch} = 1; } - $HadArch = 1; - ++$i; - next; - } - - # Options with possible arguments that should pass through to compiler. - if (defined $CompileOptionMap{$ArgKey}) { - my $Cnt = $CompileOptionMap{$ArgKey}; - push @CompileOpts,$Arg; - while ($Cnt > 0) { ++$i; --$Cnt; push @CompileOpts, $ARGV[$i]; } - next; - } - - # Options with possible arguments that should pass through to linker. - if (defined $LinkerOptionMap{$ArgKey}) { - my $Cnt = $LinkerOptionMap{$ArgKey}; - push @LinkOpts,$Arg; - while ($Cnt > 0) { ++$i; --$Cnt; push @LinkOpts, $ARGV[$i]; } - next; - } - - # Options with possible arguments that should pass through to both compiler - # and the linker. - if (defined $CompilerLinkerOptionMap{$ArgKey}) { - my $Cnt = $CompilerLinkerOptionMap{$ArgKey}; - - # Check if this is an option that should have a unique value, and if so - # determine if the value was checked before. - if ($UniqueOptions{$Arg}) { - if (defined $Uniqued{$Arg}) { - $i += $Cnt; - next; - } - $Uniqued{$Arg} = 1; - } - - push @CompileOpts,$Arg; - push @LinkOpts,$Arg; - - while ($Cnt > 0) { - ++$i; --$Cnt; - push @CompileOpts, $ARGV[$i]; - push @LinkOpts, $ARGV[$i]; - } - next; - } - - # Ignored options. - if (defined $IgnoredOptionMap{$ArgKey}) { - my $Cnt = $IgnoredOptionMap{$ArgKey}; - while ($Cnt > 0) { - ++$i; --$Cnt; - } - next; - } - - # Compile mode flags. - if ($Arg =~ /^-[D,I,U](.*)$/) { - my $Tmp = $Arg; - if ($1 eq '') { - # FIXME: Check if we are going off the end. - ++$i; - $Tmp = $Arg . $ARGV[$i]; - } - push @CompileOpts,$Tmp; - next; - } - - # Language. - if ($Arg eq '-x') { - $Lang = $ARGV[$i+1]; - ++$i; next; - } - - # Output file. - if ($Arg eq '-o') { - ++$i; - $Output = $ARGV[$i]; - next; - } - - # Get the link mode. - if ($Arg =~ /^-[l,L,O]/) { - if ($Arg eq '-O') { push @LinkOpts,'-O1'; } - elsif ($Arg eq '-Os') { push @LinkOpts,'-O2'; } - else { push @LinkOpts,$Arg; } - next; - } - - if ($Arg =~ /^-std=/) { - push @CompileOpts,$Arg; - next; - } - -# if ($Arg =~ /^-f/) { -# # FIXME: Not sure if the remaining -fxxxx options have no arguments. -# push @CompileOpts,$Arg; -# push @LinkOpts,$Arg; # FIXME: Not sure if these are link opts. -# } - - # Get the compiler/link mode. - if ($Arg =~ /^-F(.+)$/) { - my $Tmp = $Arg; - if ($1 eq '') { - # FIXME: Check if we are going off the end. - ++$i; - $Tmp = $Arg . $ARGV[$i]; - } - push @CompileOpts,$Tmp; - push @LinkOpts,$Tmp; - next; - } - - # Input files. - if ($Arg eq '-filelist') { - # FIXME: Make sure we aren't walking off the end. - open(IN, $ARGV[$i+1]); - while () { s/\015?\012//; push @Files,$_; } - close(IN); - ++$i; - next; - } - - # Handle -Wno-. We don't care about extra warnings, but - # we should suppress ones that we don't want to see. - if ($Arg =~ /^-Wno-/) { - push @CompileOpts, $Arg; - next; - } - - if (!($Arg =~ /^-/)) { - push @Files, $Arg; - next; - } -} - -if ($Action eq 'compile' or $Action eq 'link') { - my @Archs = keys %ArchsSeen; - # Skip the file if we don't support the architectures specified. - exit 0 if ($HadArch && scalar(@Archs) == 0); - - foreach my $file (@Files) { - # Determine the language for the file. - my $FileLang = $Lang; - - if (!defined($FileLang)) { - # Infer the language from the extension. - if ($file =~ /[.]([^.]+)$/) { - $FileLang = $LangMap{$1}; - } - } - - # FileLang still not defined? Skip the file. - next if (!defined $FileLang); - - # Language not accepted? - next if (!defined $LangsAccepted{$FileLang}); - - my @CmdArgs; - my @AnalyzeArgs; - - if ($FileLang ne 'unknown') { - push @CmdArgs,'-x'; - push @CmdArgs,$FileLang; - } - - if (defined $StoreModel) { - push @AnalyzeArgs, "-analyzer-store=$StoreModel"; - } - - if (defined $ConstraintsModel) { - push @AnalyzeArgs, "-analyzer-constraints=$ConstraintsModel"; - } - - if (defined $OutputFormat) { - push @AnalyzeArgs, "-analyzer-output=" . $OutputFormat; - if ($OutputFormat =~ /plist/) { - # Change "Output" to be a file. - my ($h, $f) = tempfile("report-XXXXXX", SUFFIX => ".plist", - DIR => $HtmlDir); - $ResultFile = $f; - $CleanupFile = $f; - } - } - - push @CmdArgs,@CompileOpts; - push @CmdArgs,$file; - - if (scalar @Archs) { - foreach my $arch (@Archs) { - my @NewArgs; - push @NewArgs, '-arch'; - push @NewArgs, $arch; - push @NewArgs, @CmdArgs; - Analyze($Clang, \@NewArgs, \@AnalyzeArgs, $FileLang, $Output, - $Verbose, $HtmlDir, $file, $Analyses); - } - } - else { - Analyze($Clang, \@CmdArgs, \@AnalyzeArgs, $FileLang, $Output, - $Verbose, $HtmlDir, $file, $Analyses); - } - } -} - -exit($Status >> 8); - diff --git a/contrib/llvm/tools/clang/tools/scan-build/scan-build b/contrib/llvm/tools/clang/tools/scan-build/scan-build deleted file mode 100755 index 8a7afbb3eaee..000000000000 --- a/contrib/llvm/tools/clang/tools/scan-build/scan-build +++ /dev/null @@ -1,1265 +0,0 @@ -#!/usr/bin/env perl -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -# -# A script designed to wrap a build so that all calls to gcc are intercepted -# and piped to the static analyzer. -# -##===----------------------------------------------------------------------===## - -use strict; -use warnings; -use FindBin qw($RealBin); -use Digest::MD5; -use File::Basename; -use Term::ANSIColor; -use Term::ANSIColor qw(:constants); -use Cwd qw/ getcwd abs_path /; -use Sys::Hostname; - -my $Verbose = 0; # Verbose output from this script. -my $Prog = "scan-build"; -my $BuildName; -my $BuildDate; - -my $TERM = $ENV{'TERM'}; -my $UseColor = (defined $TERM and $TERM eq 'xterm-color' and -t STDOUT - and defined $ENV{'SCAN_BUILD_COLOR'}); - -my $UserName = HtmlEscape(getpwuid($<) || 'unknown'); -my $HostName = HtmlEscape(hostname() || 'unknown'); -my $CurrentDir = HtmlEscape(getcwd()); -my $CurrentDirSuffix = basename($CurrentDir); - -my $CmdArgs; - -my $HtmlTitle; - -my $Date = localtime(); - -##----------------------------------------------------------------------------## -# Diagnostics -##----------------------------------------------------------------------------## - -sub Diag { - if ($UseColor) { - print BOLD, MAGENTA "$Prog: @_"; - print RESET; - } - else { - print "$Prog: @_"; - } -} - -sub DiagCrashes { - my $Dir = shift; - Diag ("The analyzer encountered problems on some source files.\n"); - Diag ("Preprocessed versions of these sources were deposited in '$Dir/failures'.\n"); - Diag ("Please consider submitting a bug report using these files:\n"); - Diag (" http://clang.llvm.org/StaticAnalysisUsage.html#filingbugs\n") -} - -sub DieDiag { - if ($UseColor) { - print BOLD, RED "$Prog: "; - print RESET, RED @_; - print RESET; - } - else { - print "$Prog: ", @_; - } - exit(0); -} - -##----------------------------------------------------------------------------## -# Some initial preprocessing of Clang options. -##----------------------------------------------------------------------------## - -# Find 'clang' -my $ClangSB = Cwd::realpath("$RealBin/bin/clang"); -if (!defined $ClangSB || ! -x $ClangSB) { - $ClangSB = Cwd::realpath("$RealBin/clang"); -} -my $Clang; -if (!defined $ClangSB || ! -x $ClangSB) { - # Default to looking for 'clang' in the path. - $Clang = `which clang`; - chomp $Clang; - if ($Clang eq "") { - DieDiag("No 'clang' executable found in path."); - } -} -else { - $Clang = $ClangSB; -} -my $ClangCXX = $Clang . "++"; - -my %AvailableAnalyses; - -# Query clang for analysis options. -open(PIPE, "-|", $Clang, "-cc1", "-help") or - DieDiag("Cannot execute '$Clang'\n"); - -while() { - if (/(-analyzer-check-[^\s]+)/) { - $AvailableAnalyses{$1} = 1; - next; - } -} -close (PIPE); - -my %AnalysesDefaultEnabled = ( - '-analyzer-check-dead-stores' => 1, - '-analyzer-check-objc-mem' => 1, - '-analyzer-check-objc-methodsigs' => 1, - # Do not enable the missing -dealloc check by default. - # '-analyzer-check-objc-missing-dealloc' => 1, - '-analyzer-check-objc-unused-ivars' => 1, - '-analyzer-check-security-syntactic' => 1 -); - -##----------------------------------------------------------------------------## -# GetHTMLRunDir - Construct an HTML directory name for the current sub-run. -##----------------------------------------------------------------------------## - -sub GetHTMLRunDir { - die "Not enough arguments." if (@_ == 0); - my $Dir = shift @_; - my $TmpMode = 0; - if (!defined $Dir) { - if (`uname` =~ /Darwin/) { - $Dir = $ENV{'TMPDIR'}; - if (!defined $Dir) { $Dir = "/tmp"; } - } - else { - $Dir = "/tmp"; - } - $TmpMode = 1; - } - - # Chop off any trailing '/' characters. - while ($Dir =~ /\/$/) { chop $Dir; } - - # Get current date and time. - my @CurrentTime = localtime(); - my $year = $CurrentTime[5] + 1900; - my $day = $CurrentTime[3]; - my $month = $CurrentTime[4] + 1; - my $DateString = sprintf("%d-%02d-%02d", $year, $month, $day); - - # Determine the run number. - my $RunNumber; - - if (-d $Dir) { - if (! -r $Dir) { - DieDiag("directory '$Dir' exists but is not readable.\n"); - } - # Iterate over all files in the specified directory. - my $max = 0; - opendir(DIR, $Dir); - my @FILES = grep { -d "$Dir/$_" } readdir(DIR); - closedir(DIR); - - foreach my $f (@FILES) { - # Strip the prefix '$Prog-' if we are dumping files to /tmp. - if ($TmpMode) { - next if (!($f =~ /^$Prog-(.+)/)); - $f = $1; - } - - my @x = split/-/, $f; - next if (scalar(@x) != 4); - next if ($x[0] != $year); - next if ($x[1] != $month); - next if ($x[2] != $day); - - if ($x[3] > $max) { - $max = $x[3]; - } - } - - $RunNumber = $max + 1; - } - else { - - if (-x $Dir) { - DieDiag("'$Dir' exists but is not a directory.\n"); - } - - if ($TmpMode) { - DieDiag("The directory '/tmp' does not exist or cannot be accessed.\n"); - } - - # $Dir does not exist. It will be automatically created by the - # clang driver. Set the run number to 1. - - $RunNumber = 1; - } - - die "RunNumber must be defined!" if (!defined $RunNumber); - - # Append the run number. - my $NewDir; - if ($TmpMode) { - $NewDir = "$Dir/$Prog-$DateString-$RunNumber"; - } - else { - $NewDir = "$Dir/$DateString-$RunNumber"; - } - system 'mkdir','-p',$NewDir; - return $NewDir; -} - -sub SetHtmlEnv { - - die "Wrong number of arguments." if (scalar(@_) != 2); - - my $Args = shift; - my $Dir = shift; - - die "No build command." if (scalar(@$Args) == 0); - - my $Cmd = $$Args[0]; - - if ($Cmd =~ /configure/) { - return; - } - - if ($Verbose) { - Diag("Emitting reports for this run to '$Dir'.\n"); - } - - $ENV{'CCC_ANALYZER_HTML'} = $Dir; -} - -##----------------------------------------------------------------------------## -# ComputeDigest - Compute a digest of the specified file. -##----------------------------------------------------------------------------## - -sub ComputeDigest { - my $FName = shift; - DieDiag("Cannot read $FName to compute Digest.\n") if (! -r $FName); - - # Use Digest::MD5. We don't have to be cryptographically secure. We're - # just looking for duplicate files that come from a non-malicious source. - # We use Digest::MD5 because it is a standard Perl module that should - # come bundled on most systems. - open(FILE, $FName) or DieDiag("Cannot open $FName when computing Digest.\n"); - binmode FILE; - my $Result = Digest::MD5->new->addfile(*FILE)->hexdigest; - close(FILE); - - # Return the digest. - return $Result; -} - -##----------------------------------------------------------------------------## -# UpdatePrefix - Compute the common prefix of files. -##----------------------------------------------------------------------------## - -my $Prefix; - -sub UpdatePrefix { - my $x = shift; - my $y = basename($x); - $x =~ s/\Q$y\E$//; - - if (!defined $Prefix) { - $Prefix = $x; - return; - } - - chop $Prefix while (!($x =~ /^\Q$Prefix/)); -} - -sub GetPrefix { - return $Prefix; -} - -##----------------------------------------------------------------------------## -# UpdateInFilePath - Update the path in the report file. -##----------------------------------------------------------------------------## - -sub UpdateInFilePath { - my $fname = shift; - my $regex = shift; - my $newtext = shift; - - open (RIN, $fname) or die "cannot open $fname"; - open (ROUT, ">", "$fname.tmp") or die "cannot open $fname.tmp"; - - while () { - s/$regex/$newtext/; - print ROUT $_; - } - - close (ROUT); - close (RIN); - system("mv", "$fname.tmp", $fname); -} - -##----------------------------------------------------------------------------## -# ScanFile - Scan a report file for various identifying attributes. -##----------------------------------------------------------------------------## - -# Sometimes a source file is scanned more than once, and thus produces -# multiple error reports. We use a cache to solve this problem. - -my %AlreadyScanned; - -sub ScanFile { - - my $Index = shift; - my $Dir = shift; - my $FName = shift; - - # Compute a digest for the report file. Determine if we have already - # scanned a file that looks just like it. - - my $digest = ComputeDigest("$Dir/$FName"); - - if (defined $AlreadyScanned{$digest}) { - # Redundant file. Remove it. - system ("rm", "-f", "$Dir/$FName"); - return; - } - - $AlreadyScanned{$digest} = 1; - - # At this point the report file is not world readable. Make it happen. - system ("chmod", "644", "$Dir/$FName"); - - # Scan the report file for tags. - open(IN, "$Dir/$FName") or DieDiag("Cannot open '$Dir/$FName'\n"); - - my $BugType = ""; - my $BugFile = ""; - my $BugCategory; - my $BugPathLength = 1; - my $BugLine = 0; - - while () { - last if (//); - - if (/$/) { - $BugType = $1; - } - elsif (/$/) { - $BugFile = abs_path($1); - UpdatePrefix($BugFile); - } - elsif (/$/) { - $BugPathLength = $1; - } - elsif (/$/) { - $BugLine = $1; - } - elsif (/$/) { - $BugCategory = $1; - } - } - - close(IN); - - if (!defined $BugCategory) { - $BugCategory = "Other"; - } - - push @$Index,[ $FName, $BugCategory, $BugType, $BugFile, $BugLine, - $BugPathLength ]; -} - -##----------------------------------------------------------------------------## -# CopyFiles - Copy resource files to target directory. -##----------------------------------------------------------------------------## - -sub CopyFiles { - - my $Dir = shift; - - my $JS = Cwd::realpath("$RealBin/sorttable.js"); - - DieDiag("Cannot find 'sorttable.js'.\n") - if (! -r $JS); - - system ("cp", $JS, "$Dir"); - - DieDiag("Could not copy 'sorttable.js' to '$Dir'.\n") - if (! -r "$Dir/sorttable.js"); - - my $CSS = Cwd::realpath("$RealBin/scanview.css"); - - DieDiag("Cannot find 'scanview.css'.\n") - if (! -r $CSS); - - system ("cp", $CSS, "$Dir"); - - DieDiag("Could not copy 'scanview.css' to '$Dir'.\n") - if (! -r $CSS); -} - -##----------------------------------------------------------------------------## -# Postprocess - Postprocess the results of an analysis scan. -##----------------------------------------------------------------------------## - -sub Postprocess { - - my $Dir = shift; - my $BaseDir = shift; - - die "No directory specified." if (!defined $Dir); - - if (! -d $Dir) { - Diag("No bugs found.\n"); - return 0; - } - - opendir(DIR, $Dir); - my @files = grep { /^report-.*\.html$/ } readdir(DIR); - closedir(DIR); - - if (scalar(@files) == 0 and ! -e "$Dir/failures") { - Diag("Removing directory '$Dir' because it contains no reports.\n"); - system ("rm", "-fR", $Dir); - return 0; - } - - # Scan each report file and build an index. - my @Index; - foreach my $file (@files) { ScanFile(\@Index, $Dir, $file); } - - # Scan the failures directory and use the information in the .info files - # to update the common prefix directory. - my @failures; - my @attributes_ignored; - if (-d "$Dir/failures") { - opendir(DIR, "$Dir/failures"); - @failures = grep { /[.]info.txt$/ && !/attribute_ignored/; } readdir(DIR); - closedir(DIR); - opendir(DIR, "$Dir/failures"); - @attributes_ignored = grep { /^attribute_ignored/; } readdir(DIR); - closedir(DIR); - foreach my $file (@failures) { - open IN, "$Dir/failures/$file" or DieDiag("cannot open $file\n"); - my $Path = ; - if (defined $Path) { UpdatePrefix($Path); } - close IN; - } - } - - # Generate an index.html file. - my $FName = "$Dir/index.html"; - open(OUT, ">", $FName) or DieDiag("Cannot create file '$FName'\n"); - - # Print out the header. - -print OUT < - -${HtmlTitle} - - - - - - -

${HtmlTitle}

- - - - - - -ENDTEXT - -print OUT "\n" - if (defined($BuildName) && defined($BuildDate)); - -print OUT < -ENDTEXT - - if (scalar(@files)) { - # Print out the summary table. - my %Totals; - - for my $row ( @Index ) { - my $bug_type = ($row->[2]); - my $bug_category = ($row->[1]); - my $key = "$bug_category:$bug_type"; - - if (!defined $Totals{$key}) { $Totals{$key} = [1,$bug_category,$bug_type]; } - else { $Totals{$key}->[0]++; } - } - - print OUT "

Bug Summary

"; - - if (defined $BuildName) { - print OUT "\n

Results in this analysis run are based on analyzer build $BuildName.

\n" - } - - my $TotalBugs = scalar(@Index); -print OUT < -
- -ENDTEXT - - my $last_category; - - for my $key ( - sort { - my $x = $Totals{$a}; - my $y = $Totals{$b}; - my $res = $x->[1] cmp $y->[1]; - $res = $x->[2] cmp $y->[2] if ($res == 0); - $res - } keys %Totals ) - { - my $val = $Totals{$key}; - my $category = $val->[1]; - if (!defined $last_category or $last_category ne $category) { - $last_category = $category; - print OUT "\n"; - } - my $x = lc $key; - $x =~ s/[ ,'":\/()]+/_/g; - print OUT "\n"; - } - - # Print out the table of errors. - -print OUT < -

Reports

- -
User:${UserName}\@${HostName}
Working Directory:${CurrentDir}
Command Line:${CmdArgs}
Date:${Date}
Version:${BuildName} (${BuildDate})
Bug TypeQuantityDisplay?
All Bugs$TotalBugs
$category
"; - print OUT $val->[2]; - print OUT ""; - print OUT $val->[0]; - print OUT "
- - - - - - - - - - -ENDTEXT - - my $prefix = GetPrefix(); - my $regex; - my $InFileRegex; - my $InFilePrefix = "File:"; - print OUT ""; - print OUT ""; - - # Update the file prefix. - my $fname = $row->[3]; - - if (defined $regex) { - $fname =~ s/$regex//; - UpdateInFilePath("$Dir/$ReportFile", $InFileRegex, $InFilePrefix) - } - - print OUT ""; - - # Print out the quantities. - for my $j ( 4 .. 5 ) { - print OUT ""; - } - - # Print the rest of the columns. - for (my $j = 6; $j <= $#{$row}; ++$j) { - print OUT "" - } - - # Emit the "View" link. - print OUT ""; - - # Emit REPORTBUG markers. - print OUT "\n\n"; - - # End the row. - print OUT "\n"; - } - - print OUT "\n
Bug GroupBug Type ▾FileLinePath Length
"; - - if (defined $prefix) { - $regex = qr/^\Q$prefix\E/is; - $InFileRegex = qr/\Q$InFilePrefix$prefix\E/is; - } - - for my $row ( sort { $a->[2] cmp $b->[2] } @Index ) { - my $x = "$row->[1]:$row->[2]"; - $x = lc $x; - $x =~ s/[ ,'":\/()]+/_/g; - - my $ReportFile = $row->[0]; - - print OUT "
"; - print OUT $row->[1]; - print OUT ""; - print OUT $row->[2]; - print OUT ""; - my @fname = split /\//,$fname; - if ($#fname > 0) { - while ($#fname >= 0) { - my $x = shift @fname; - print OUT $x; - if ($#fname >= 0) { - print OUT " /"; - } - } - } - else { - print OUT $fname; - } - print OUT "$row->[$j]$row->[$j]View Report
\n\n"; - } - - if (scalar (@failures) || scalar(@attributes_ignored)) { - print OUT "

Analyzer Failures

\n"; - - if (scalar @attributes_ignored) { - print OUT "The analyzer's parser ignored the following attributes:

\n"; - print OUT "\n"; - print OUT "\n"; - foreach my $file (sort @attributes_ignored) { - die "cannot demangle attribute name\n" if (! ($file =~ /^attribute_ignored_(.+).txt/)); - my $attribute = $1; - # Open the attribute file to get the first file that failed. - next if (!open (ATTR, "$Dir/failures/$file")); - my $ppfile = ; - chomp $ppfile; - close ATTR; - next if (! -e "$Dir/failures/$ppfile"); - # Open the info file and get the name of the source file. - open (INFO, "$Dir/failures/$ppfile.info.txt") or - die "Cannot open $Dir/failures/$ppfile.info.txt\n"; - my $srcfile = ; - chomp $srcfile; - close (INFO); - # Print the information in the table. - my $prefix = GetPrefix(); - if (defined $prefix) { $srcfile =~ s/^\Q$prefix//; } - print OUT "\n"; - my $ppfile_clang = $ppfile; - $ppfile_clang =~ s/[.](.+)$/.clang.$1/; - print OUT " \n"; - } - print OUT "
AttributeSource FilePreprocessed FileSTDERR Output
$attribute$srcfile$ppfile$ppfile.stderr.txt
\n"; - } - - if (scalar @failures) { - print OUT "

The analyzer had problems processing the following files:

\n"; - print OUT "\n"; - print OUT "\n"; - foreach my $file (sort @failures) { - $file =~ /(.+).info.txt$/; - # Get the preprocessed file. - my $ppfile = $1; - # Open the info file and get the name of the source file. - open (INFO, "$Dir/failures/$file") or - die "Cannot open $Dir/failures/$file\n"; - my $srcfile = ; - chomp $srcfile; - my $problem = ; - chomp $problem; - close (INFO); - # Print the information in the table. - my $prefix = GetPrefix(); - if (defined $prefix) { $srcfile =~ s/^\Q$prefix//; } - print OUT "\n"; - my $ppfile_clang = $ppfile; - $ppfile_clang =~ s/[.](.+)$/.clang.$1/; - print OUT " \n"; - } - print OUT "
ProblemSource FilePreprocessed FileSTDERR Output
$problem$srcfile$ppfile$ppfile.stderr.txt
\n"; - } - print OUT "

Please consider submitting preprocessed files as bug reports.

\n"; - } - - print OUT "\n"; - close(OUT); - CopyFiles($Dir); - - # Make sure $Dir and $BaseDir are world readable/executable. - system("chmod", "755", $Dir); - if (defined $BaseDir) { system("chmod", "755", $BaseDir); } - - my $Num = scalar(@Index); - Diag("$Num bugs found.\n"); - if ($Num > 0 && -r "$Dir/index.html") { - Diag("Run 'scan-view $Dir' to examine bug reports.\n"); - } - - DiagCrashes($Dir) if (scalar @failures || scalar @attributes_ignored); - - return $Num; -} - -##----------------------------------------------------------------------------## -# RunBuildCommand - Run the build command. -##----------------------------------------------------------------------------## - -sub AddIfNotPresent { - my $Args = shift; - my $Arg = shift; - my $found = 0; - - foreach my $k (@$Args) { - if ($k eq $Arg) { - $found = 1; - last; - } - } - - if ($found == 0) { - push @$Args, $Arg; - } -} - -sub RunBuildCommand { - - my $Args = shift; - my $IgnoreErrors = shift; - my $Cmd = $Args->[0]; - my $CCAnalyzer = shift; - my $CXXAnalyzer = shift; - - # Get only the part of the command after the last '/'. - if ($Cmd =~ /\/([^\/]+)$/) { - $Cmd = $1; - } - - if ($Cmd =~ /(.*\/?gcc[^\/]*$)/ or - $Cmd =~ /(.*\/?cc[^\/]*$)/ or - $Cmd =~ /(.*\/?llvm-gcc[^\/]*$)/ or - $Cmd =~ /(.*\/?ccc-analyzer[^\/]*$)/) { - - if (!($Cmd =~ /ccc-analyzer/) and !defined $ENV{"CCC_CC"}) { - $ENV{"CCC_CC"} = $1; - } - - shift @$Args; - unshift @$Args, $CCAnalyzer; - } - elsif ($Cmd =~ /(.*\/?g\+\+[^\/]*$)/ or - $Cmd =~ /(.*\/?c\+\+[^\/]*$)/ or - $Cmd =~ /(.*\/?llvm-g\+\+[^\/]*$)/ or - $Cmd =~ /(.*\/?c\+\+-analyzer[^\/]*$)/) { - if (!($Cmd =~ /c\+\+-analyzer/) and !defined $ENV{"CCC_CXX"}) { - $ENV{"CCC_CXX"} = $1; - } - shift @$Args; - unshift @$Args, $CXXAnalyzer; - } - elsif ($IgnoreErrors) { - if ($Cmd eq "make" or $Cmd eq "gmake") { - AddIfNotPresent($Args, "CC=$CCAnalyzer"); - AddIfNotPresent($Args, "CXX=$CXXAnalyzer"); - AddIfNotPresent($Args,"-k"); - AddIfNotPresent($Args,"-i"); - } - elsif ($Cmd eq "xcodebuild") { - AddIfNotPresent($Args,"-PBXBuildsContinueAfterErrors=YES"); - } - } - - if ($Cmd eq "xcodebuild") { - # Check if using iPhone SDK 3.0 (simulator). If so the compiler being - # used should be gcc-4.2. - if (!defined $ENV{"CCC_CC"}) { - for (my $i = 0 ; $i < scalar(@$Args); ++$i) { - if ($Args->[$i] eq "-sdk" && $i + 1 < scalar(@$Args)) { - if (@$Args[$i+1] =~ /^iphonesimulator3/) { - $ENV{"CCC_CC"} = "gcc-4.2"; - $ENV{"CCC_CXX"} = "g++-4.2"; - } - } - } - } - - # Disable distributed builds for xcodebuild. - AddIfNotPresent($Args,"-nodistribute"); - - # Disable PCH files until clang supports them. - AddIfNotPresent($Args,"GCC_PRECOMPILE_PREFIX_HEADER=NO"); - - # When 'CC' is set, xcodebuild uses it to do all linking, even if we are - # linking C++ object files. Set 'LDPLUSPLUS' so that xcodebuild uses 'g++' - # (via c++-analyzer) when linking such files. - $ENV{"LDPLUSPLUS"} = $CXXAnalyzer; - } - - return (system(@$Args) >> 8); -} - -##----------------------------------------------------------------------------## -# DisplayHelp - Utility function to display all help options. -##----------------------------------------------------------------------------## - -sub DisplayHelp { - -print < [build options] - -ENDTEXT - - if (defined $BuildName) { - print "ANALYZER BUILD: $BuildName ($BuildDate)\n\n"; - } - -print </>/g; - return $tmp; -} - -##----------------------------------------------------------------------------## -# ShellEscape - backslash escape characters that are special to the shell -##----------------------------------------------------------------------------## - -sub ShellEscape { - # copy argument to new variable so we don't clobber the original - my $arg = shift || ''; - if ($arg =~ /["\s]/) { return "'" . $arg . "'"; } - return $arg; -} - -##----------------------------------------------------------------------------## -# Process command-line arguments. -##----------------------------------------------------------------------------## - -my $AnalyzeHeaders = 0; -my $HtmlDir; # Parent directory to store HTML files. -my $IgnoreErrors = 0; # Ignore build errors. -my $ViewResults = 0; # View results when the build terminates. -my $ExitStatusFoundBugs = 0; # Exit status reflects whether bugs were found -my @AnalysesToRun; -my $StoreModel; -my $ConstraintsModel; -my $OutputFormat = "html"; - -if (!@ARGV) { - DisplayHelp(); - exit 1; -} - -while (@ARGV) { - - # Scan for options we recognize. - - my $arg = $ARGV[0]; - - if ($arg eq "-h" or $arg eq "--help") { - DisplayHelp(); - exit 0; - } - - if ($arg eq '-analyze-headers') { - shift @ARGV; - $AnalyzeHeaders = 1; - next; - } - - if (defined $AvailableAnalyses{$arg}) { - shift @ARGV; - push @AnalysesToRun, $arg; - next; - } - - if ($arg eq "-o") { - shift @ARGV; - - if (!@ARGV) { - DieDiag("'-o' option requires a target directory name.\n"); - } - - # Construct an absolute path. Uses the current working directory - # as a base if the original path was not absolute. - $HtmlDir = abs_path(shift @ARGV); - - next; - } - - if ($arg =~ /^--html-title(=(.+))?$/) { - shift @ARGV; - - if (!defined $2 || $2 eq '') { - if (!@ARGV) { - DieDiag("'--html-title' option requires a string.\n"); - } - - $HtmlTitle = shift @ARGV; - } else { - $HtmlTitle = $2; - } - - next; - } - - if ($arg eq "-k" or $arg eq "--keep-going") { - shift @ARGV; - $IgnoreErrors = 1; - next; - } - - if ($arg eq "--experimental-checks") { - shift @ARGV; - $ENV{"CCC_EXPERIMENTAL_CHECKS"} = 1; - next; - } - - if ($arg =~ /^--use-cc(=(.+))?$/) { - shift @ARGV; - my $cc; - - if (!defined $2 || $2 eq "") { - if (!@ARGV) { - DieDiag("'--use-cc' option requires a compiler executable name.\n"); - } - $cc = shift @ARGV; - } - else { - $cc = $2; - } - - $ENV{"CCC_CC"} = $cc; - next; - } - - if ($arg =~ /^--use-c\+\+(=(.+))?$/) { - shift @ARGV; - my $cxx; - - if (!defined $2 || $2 eq "") { - if (!@ARGV) { - DieDiag("'--use-c++' option requires a compiler executable name.\n"); - } - $cxx = shift @ARGV; - } - else { - $cxx = $2; - } - - $ENV{"CCC_CXX"} = $cxx; - next; - } - - if ($arg eq "-v") { - shift @ARGV; - $Verbose++; - next; - } - - if ($arg eq "-V" or $arg eq "--view") { - shift @ARGV; - $ViewResults = 1; - next; - } - - if ($arg eq "--status-bugs") { - shift @ARGV; - $ExitStatusFoundBugs = 1; - next; - } - - if ($arg eq "-store") { - shift @ARGV; - $StoreModel = shift @ARGV; - next; - } - - if ($arg eq "-constraints") { - shift @ARGV; - $ConstraintsModel = shift @ARGV; - next; - } - - if ($arg eq "-plist") { - shift @ARGV; - $OutputFormat = "plist"; - next; - } - if ($arg eq "-plist-html") { - shift @ARGV; - $OutputFormat = "plist-html"; - next; - } - - if ($arg eq "-no-failure-reports") { - $ENV{"CCC_REPORT_FAILURES"} = 0; - next; - } - - DieDiag("unrecognized option '$arg'\n") if ($arg =~ /^-/); - - last; -} - -if (!@ARGV) { - Diag("No build command specified.\n\n"); - DisplayHelp(); - exit 1; -} - -$CmdArgs = HtmlEscape(join(' ', map(ShellEscape($_), @ARGV))); -$HtmlTitle = "${CurrentDirSuffix} - scan-build results" - unless (defined($HtmlTitle)); - -# Determine the output directory for the HTML reports. -my $BaseDir = $HtmlDir; -$HtmlDir = GetHTMLRunDir($HtmlDir); - -# Set the appropriate environment variables. -SetHtmlEnv(\@ARGV, $HtmlDir); - -my $AbsRealBin = Cwd::realpath($RealBin); -my $Cmd = "$AbsRealBin/libexec/ccc-analyzer"; -my $CmdCXX = "$AbsRealBin/libexec/c++-analyzer"; - -if (!defined $Cmd || ! -x $Cmd) { - $Cmd = "$AbsRealBin/ccc-analyzer"; - DieDiag("Executable 'ccc-analyzer' does not exist at '$Cmd'\n") if(! -x $Cmd); -} -if (!defined $CmdCXX || ! -x $CmdCXX) { - $CmdCXX = "$AbsRealBin/c++-analyzer"; - DieDiag("Executable 'c++-analyzer' does not exist at '$CmdCXX'\n") if(! -x $CmdCXX); -} - -if (!defined $ClangSB || ! -x $ClangSB) { - Diag("'clang' executable not found in '$RealBin/bin'.\n"); - Diag("Using 'clang' from path: $Clang\n"); -} - -$ENV{'CC'} = $Cmd; -$ENV{'CXX'} = $CmdCXX; -$ENV{'CLANG'} = $Clang; -$ENV{'CLANG_CXX'} = $ClangCXX; - -if ($Verbose >= 2) { - $ENV{'CCC_ANALYZER_VERBOSE'} = 1; -} - -if ($Verbose >= 3) { - $ENV{'CCC_ANALYZER_LOG'} = 1; -} - -if (scalar(@AnalysesToRun) == 0) { - foreach my $key (keys %AnalysesDefaultEnabled) { - push @AnalysesToRun,$key; - } -} - -if ($AnalyzeHeaders) { - push @AnalysesToRun,"-analyzer-opt-analyze-headers"; -} - -$ENV{'CCC_ANALYZER_ANALYSIS'} = join ' ',@AnalysesToRun; - -if (defined $StoreModel) { - $ENV{'CCC_ANALYZER_STORE_MODEL'} = $StoreModel; -} - -if (defined $ConstraintsModel) { - $ENV{'CCC_ANALYZER_CONSTRAINTS_MODEL'} = $ConstraintsModel; -} - -if (defined $OutputFormat) { - $ENV{'CCC_ANALYZER_OUTPUT_FORMAT'} = $OutputFormat; -} - -# Run the build. -my $ExitStatus = RunBuildCommand(\@ARGV, $IgnoreErrors, $Cmd, $CmdCXX); - -if (defined $OutputFormat) { - if ($OutputFormat =~ /plist/) { - Diag "Analysis run complete.\n"; - Diag "Analysis results (plist files) deposited in '$HtmlDir'\n"; - } - elsif ($OutputFormat =~ /html/) { - # Postprocess the HTML directory. - my $NumBugs = Postprocess($HtmlDir, $BaseDir); - - if ($ViewResults and -r "$HtmlDir/index.html") { - Diag "Analysis run complete.\n"; - Diag "Viewing analysis results in '$HtmlDir' using scan-view.\n"; - my $ScanView = Cwd::realpath("$RealBin/scan-view"); - if (! -x $ScanView) { $ScanView = "scan-view"; } - exec $ScanView, "$HtmlDir"; - } - - if ($ExitStatusFoundBugs) { - exit 1 if ($NumBugs > 0); - exit 0; - } - } -} - -exit $ExitStatus; - diff --git a/contrib/llvm/tools/clang/tools/scan-build/scanview.css b/contrib/llvm/tools/clang/tools/scan-build/scanview.css deleted file mode 100644 index a0406f37a038..000000000000 --- a/contrib/llvm/tools/clang/tools/scan-build/scanview.css +++ /dev/null @@ -1,62 +0,0 @@ -body { color:#000000; background-color:#ffffff } -body { font-family: Helvetica, sans-serif; font-size:9pt } -h1 { font-size: 14pt; } -h2 { font-size: 12pt; } -table { font-size:9pt } -table { border-spacing: 0px; border: 1px solid black } -th, table thead { - background-color:#eee; color:#666666; - font-weight: bold; cursor: default; - text-align:center; - font-weight: bold; font-family: Verdana; - white-space:nowrap; -} -.W { font-size:0px } -th, td { padding:5px; padding-left:8px; text-align:left } -td.SUMM_DESC { padding-left:12px } -td.DESC { white-space:pre } -td.Q { text-align:right } -td { text-align:left } -tbody.scrollContent { overflow:auto } - -table.form_group { - background-color: #ccc; - border: 1px solid #333; - padding: 2px; -} - -table.form_inner_group { - background-color: #ccc; - border: 1px solid #333; - padding: 0px; -} - -table.form { - background-color: #999; - border: 1px solid #333; - padding: 2px; -} - -td.form_label { - text-align: right; - vertical-align: top; -} -/* For one line entires */ -td.form_clabel { - text-align: right; - vertical-align: center; -} -td.form_value { - text-align: left; - vertical-align: top; -} -td.form_submit { - text-align: right; - vertical-align: top; -} - -h1.SubmitFail { - color: #f00; -} -h1.SubmitOk { -} diff --git a/contrib/llvm/tools/clang/tools/scan-build/set-xcode-analyzer b/contrib/llvm/tools/clang/tools/scan-build/set-xcode-analyzer deleted file mode 100755 index cc068a56adf9..000000000000 --- a/contrib/llvm/tools/clang/tools/scan-build/set-xcode-analyzer +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env python - -import os -import sys -import re -import tempfile -import shutil -import stat -from AppKit import * - -def FindClangSpecs(path): - for root, dirs, files in os.walk(path): - for f in files: - if f.endswith(".xcspec") and f.startswith("Clang LLVM"): - yield os.path.join(root, f) - -def ModifySpec(path, pathToChecker): - t = tempfile.NamedTemporaryFile(delete=False) - foundAnalyzer = False - with open(path) as f: - for line in f: - if not foundAnalyzer: - if line.find("Static Analyzer") >= 0: - foundAnalyzer = True - else: - m = re.search('^(\s*ExecPath\s*=\s*")', line) - if m: - line = "".join([m.group(0), pathToChecker, '";\n']) - t.write(line) - t.close() - print "(+) processing:", path - try: - shutil.copy(t.name, path) - os.chmod(path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH) - except IOError, why: - print " (-) Cannot update file:", why, "\n" - except OSError, why: - print " (-) Cannot update file:", why, "\n" - os.unlink(t.name) - -def main(): - from optparse import OptionParser - parser = OptionParser('usage: %prog [options]') - parser.set_description(__doc__) - parser.add_option("--use-checker-build", dest="path", - help="Use the Clang located at the provided absolute path, e.g. /Users/foo/checker-1") - parser.add_option("--use-xcode-clang", action="store_const", - const="$(CLANG)", dest="default", - help="Use the Clang bundled with Xcode") - (options, args) = parser.parse_args() - if options.path is None and options.default is None: - parser.error("You must specify a version of Clang to use for static analysis. Specify '-h' for details") - - # determine if Xcode is running - for x in NSWorkspace.sharedWorkspace().runningApplications(): - if x.localizedName().find("Xcode") >= 0: - print "(-) You must quit Xcode first before modifying its configuration files." - return - - if options.path: - # Expand tildes. - path = os.path.expanduser(options.path) - if not path.endswith("clang"): - print "(+) Using Clang bundled with checker build:", path - path = os.path.join(path, "bin", "clang"); - else: - print "(+) Using Clang located at:", path - else: - print "(+) Using the Clang bundled with Xcode" - path = options.default - - for x in FindClangSpecs('/Developer'): - ModifySpec(x, path) - -if __name__ == '__main__': - main() - diff --git a/contrib/llvm/tools/clang/tools/scan-build/sorttable.js b/contrib/llvm/tools/clang/tools/scan-build/sorttable.js deleted file mode 100644 index 4352d3be0a5f..000000000000 --- a/contrib/llvm/tools/clang/tools/scan-build/sorttable.js +++ /dev/null @@ -1,493 +0,0 @@ -/* - SortTable - version 2 - 7th April 2007 - Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/ - - Instructions: - Download this file - Add to your HTML - Add class="sortable" to any table you'd like to make sortable - Click on the headers to sort - - Thanks to many, many people for contributions and suggestions. - Licenced as X11: http://www.kryogenix.org/code/browser/licence.html - This basically means: do what you want with it. -*/ - - -var stIsIE = /*@cc_on!@*/false; - -sorttable = { - init: function() { - // quit if this function has already been called - if (arguments.callee.done) return; - // flag this function so we don't do the same thing twice - arguments.callee.done = true; - // kill the timer - if (_timer) clearInterval(_timer); - - if (!document.createElement || !document.getElementsByTagName) return; - - sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; - - forEach(document.getElementsByTagName('table'), function(table) { - if (table.className.search(/\bsortable\b/) != -1) { - sorttable.makeSortable(table); - } - }); - - }, - - makeSortable: function(table) { - if (table.getElementsByTagName('thead').length == 0) { - // table doesn't have a tHead. Since it should have, create one and - // put the first table row in it. - the = document.createElement('thead'); - the.appendChild(table.rows[0]); - table.insertBefore(the,table.firstChild); - } - // Safari doesn't support table.tHead, sigh - if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; - - if (table.tHead.rows.length != 1) return; // can't cope with two header rows - - // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as - // "total" rows, for example). This is B&R, since what you're supposed - // to do is put them in a tfoot. So, if there are sortbottom rows, - // for backwards compatibility, move them to tfoot (creating it if needed). - sortbottomrows = []; - for (var i=0; i5' : ' ▴'; - this.appendChild(sortrevind); - return; - } - if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) { - // if we're already sorted by this column in reverse, just - // re-reverse the table, which is quicker - sorttable.reverse(this.sorttable_tbody); - this.className = this.className.replace('sorttable_sorted_reverse', - 'sorttable_sorted'); - this.removeChild(document.getElementById('sorttable_sortrevind')); - sortfwdind = document.createElement('span'); - sortfwdind.id = "sorttable_sortfwdind"; - sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; - this.appendChild(sortfwdind); - return; - } - - // remove sorttable_sorted classes - theadrow = this.parentNode; - forEach(theadrow.childNodes, function(cell) { - if (cell.nodeType == 1) { // an element - cell.className = cell.className.replace('sorttable_sorted_reverse',''); - cell.className = cell.className.replace('sorttable_sorted',''); - } - }); - sortfwdind = document.getElementById('sorttable_sortfwdind'); - if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); } - sortrevind = document.getElementById('sorttable_sortrevind'); - if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); } - - this.className += ' sorttable_sorted'; - sortfwdind = document.createElement('span'); - sortfwdind.id = "sorttable_sortfwdind"; - sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; - this.appendChild(sortfwdind); - - // build an array to sort. This is a Schwartzian transform thing, - // i.e., we "decorate" each row with the actual sort key, - // sort based on the sort keys, and then put the rows back in order - // which is a lot faster because you only do getInnerText once per row - row_array = []; - col = this.sorttable_columnindex; - rows = this.sorttable_tbody.rows; - for (var j=0; j 12) { - // definitely dd/mm - return sorttable.sort_ddmm; - } else if (second > 12) { - return sorttable.sort_mmdd; - } else { - // looks like a date, but we can't tell which, so assume - // that it's dd/mm (English imperialism!) and keep looking - sortfn = sorttable.sort_ddmm; - } - } - } - } - return sortfn; - }, - - getInnerText: function(node) { - // gets the text we want to use for sorting for a cell. - // strips leading and trailing whitespace. - // this is *not* a generic getInnerText function; it's special to sorttable. - // for example, you can override the cell text with a customkey attribute. - // it also gets .value for fields. - - hasInputs = (typeof node.getElementsByTagName == 'function') && - node.getElementsByTagName('input').length; - - if (node.getAttribute("sorttable_customkey") != null) { - return node.getAttribute("sorttable_customkey"); - } - else if (typeof node.textContent != 'undefined' && !hasInputs) { - return node.textContent.replace(/^\s+|\s+$/g, ''); - } - else if (typeof node.innerText != 'undefined' && !hasInputs) { - return node.innerText.replace(/^\s+|\s+$/g, ''); - } - else if (typeof node.text != 'undefined' && !hasInputs) { - return node.text.replace(/^\s+|\s+$/g, ''); - } - else { - switch (node.nodeType) { - case 3: - if (node.nodeName.toLowerCase() == 'input') { - return node.value.replace(/^\s+|\s+$/g, ''); - } - case 4: - return node.nodeValue.replace(/^\s+|\s+$/g, ''); - break; - case 1: - case 11: - var innerText = ''; - for (var i = 0; i < node.childNodes.length; i++) { - innerText += sorttable.getInnerText(node.childNodes[i]); - } - return innerText.replace(/^\s+|\s+$/g, ''); - break; - default: - return ''; - } - } - }, - - reverse: function(tbody) { - // reverse the rows in a tbody - newrows = []; - for (var i=0; i=0; i--) { - tbody.appendChild(newrows[i]); - } - delete newrows; - }, - - /* sort functions - each sort function takes two parameters, a and b - you are comparing a[0] and b[0] */ - sort_numeric: function(a,b) { - aa = parseFloat(a[0].replace(/[^0-9.-]/g,'')); - if (isNaN(aa)) aa = 0; - bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); - if (isNaN(bb)) bb = 0; - return aa-bb; - }, - sort_alpha: function(a,b) { - if (a[0]==b[0]) return 0; - if (a[0] 0 ) { - var q = list[i]; list[i] = list[i+1]; list[i+1] = q; - swap = true; - } - } // for - t--; - - if (!swap) break; - - for(var i = t; i > b; --i) { - if ( comp_func(list[i], list[i-1]) < 0 ) { - var q = list[i]; list[i] = list[i-1]; list[i-1] = q; - swap = true; - } - } // for - b++; - - } // while(swap) - } -} - -/* ****************************************************************** - Supporting functions: bundled here to avoid depending on a library - ****************************************************************** */ - -// Dean Edwards/Matthias Miller/John Resig - -/* for Mozilla/Opera9 */ -if (document.addEventListener) { - document.addEventListener("DOMContentLoaded", sorttable.init, false); -} - -/* for Internet Explorer */ -/*@cc_on @*/ -/*@if (@_win32) - document.write("""")) - -# Insert additional columns. -kReportReplacements.append((re.compile(''), - '')) - -# Insert report bug and open file links. -kReportReplacements.append((re.compile(''), - ('Report Bug' + - 'Open File'))) - -kReportReplacements.append((re.compile(''), - '

Summary > Report %(report)s

')) - -kReportReplacements.append((re.compile(''), - 'Report Bug')) - -# Insert report crashes link. - -# Disabled for the time being until we decide exactly when this should -# be enabled. Also the radar reporter needs to be fixed to report -# multiple files. - -#kReportReplacements.append((re.compile(''), -# '
These files will automatically be attached to ' + -# 'reports filed here: Report Crashes.')) - -### -# Other simple parameters - -kResources = posixpath.join(posixpath.dirname(__file__), 'Resources') -kConfigPath = os.path.expanduser('~/.scanview.cfg') - -### - -__version__ = "0.1" - -__all__ = ["create_server"] - -class ReporterThread(threading.Thread): - def __init__(self, report, reporter, parameters, server): - threading.Thread.__init__(self) - self.report = report - self.server = server - self.reporter = reporter - self.parameters = parameters - self.success = False - self.status = None - - def run(self): - result = None - try: - if self.server.options.debug: - print >>sys.stderr, "%s: SERVER: submitting bug."%(sys.argv[0],) - self.status = self.reporter.fileReport(self.report, self.parameters) - self.success = True - time.sleep(3) - if self.server.options.debug: - print >>sys.stderr, "%s: SERVER: submission complete."%(sys.argv[0],) - except Reporter.ReportFailure,e: - self.status = e.value - except Exception,e: - s = StringIO.StringIO() - import traceback - print >>s,'Unhandled Exception
'
-            traceback.print_exc(e,file=s)
-            print >>s,'
' - self.status = s.getvalue() - -class ScanViewServer(BaseHTTPServer.HTTPServer): - def __init__(self, address, handler, root, reporters, options): - BaseHTTPServer.HTTPServer.__init__(self, address, handler) - self.root = root - self.reporters = reporters - self.options = options - self.halted = False - self.config = None - self.load_config() - - def load_config(self): - self.config = ConfigParser.RawConfigParser() - - # Add defaults - self.config.add_section('ScanView') - for r in self.reporters: - self.config.add_section(r.getName()) - for p in r.getParameters(): - if p.saveConfigValue(): - self.config.set(r.getName(), p.getName(), '') - - # Ignore parse errors - try: - self.config.read([kConfigPath]) - except: - pass - - # Save on exit - import atexit - atexit.register(lambda: self.save_config()) - - def save_config(self): - # Ignore errors (only called on exit). - try: - f = open(kConfigPath,'w') - self.config.write(f) - f.close() - except: - pass - - def halt(self): - self.halted = True - if self.options.debug: - print >>sys.stderr, "%s: SERVER: halting." % (sys.argv[0],) - - def serve_forever(self): - while not self.halted: - if self.options.debug > 1: - print >>sys.stderr, "%s: SERVER: waiting..." % (sys.argv[0],) - try: - self.handle_request() - except OSError,e: - print 'OSError',e.errno - - def finish_request(self, request, client_address): - if self.options.autoReload: - import ScanView - self.RequestHandlerClass = reload(ScanView).ScanViewRequestHandler - BaseHTTPServer.HTTPServer.finish_request(self, request, client_address) - - def handle_error(self, request, client_address): - # Ignore socket errors - info = sys.exc_info() - if info and isinstance(info[1], socket.error): - if self.options.debug > 1: - print >>sys.stderr, "%s: SERVER: ignored socket error." % (sys.argv[0],) - return - BaseHTTPServer.HTTPServer.handle_error(self, request, client_address) - -# Borrowed from Quixote, with simplifications. -def parse_query(qs, fields=None): - if fields is None: - fields = {} - for chunk in filter(None, qs.split('&')): - if '=' not in chunk: - name = chunk - value = '' - else: - name, value = chunk.split('=', 1) - name = urllib.unquote(name.replace('+', ' ')) - value = urllib.unquote(value.replace('+', ' ')) - item = fields.get(name) - if item is None: - fields[name] = [value] - else: - item.append(value) - return fields - -class ScanViewRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): - server_version = "ScanViewServer/" + __version__ - dynamic_mtime = time.time() - - def do_HEAD(self): - try: - SimpleHTTPServer.SimpleHTTPRequestHandler.do_HEAD(self) - except Exception,e: - self.handle_exception(e) - - def do_GET(self): - try: - SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self) - except Exception,e: - self.handle_exception(e) - - def do_POST(self): - """Serve a POST request.""" - try: - length = self.headers.getheader('content-length') or "0" - try: - length = int(length) - except: - length = 0 - content = self.rfile.read(length) - fields = parse_query(content) - f = self.send_head(fields) - if f: - self.copyfile(f, self.wfile) - f.close() - except Exception,e: - self.handle_exception(e) - - def log_message(self, format, *args): - if self.server.options.debug: - sys.stderr.write("%s: SERVER: %s - - [%s] %s\n" % - (sys.argv[0], - self.address_string(), - self.log_date_time_string(), - format%args)) - - def load_report(self, report): - path = os.path.join(self.server.root, 'report-%s.html'%report) - data = open(path).read() - keys = {} - for item in kBugKeyValueRE.finditer(data): - k,v = item.groups() - keys[k] = v - return keys - - def load_crashes(self): - path = posixpath.join(self.server.root, 'index.html') - data = open(path).read() - problems = [] - for item in kReportCrashEntryRE.finditer(data): - fieldData = item.group(1) - fields = dict([i.groups() for i in - kReportCrashEntryKeyValueRE.finditer(fieldData)]) - problems.append(fields) - return problems - - def handle_exception(self, exc): - import traceback - s = StringIO.StringIO() - print >>s, "INTERNAL ERROR\n" - traceback.print_exc(exc, s) - f = self.send_string(s.getvalue(), 'text/plain') - if f: - self.copyfile(f, self.wfile) - f.close() - - def get_scalar_field(self, name): - if name in self.fields: - return self.fields[name][0] - else: - return None - - def submit_bug(self, c): - title = self.get_scalar_field('title') - description = self.get_scalar_field('description') - report = self.get_scalar_field('report') - reporterIndex = self.get_scalar_field('reporter') - files = [] - for fileID in self.fields.get('files',[]): - try: - i = int(fileID) - except: - i = None - if i is None or i<0 or i>=len(c.files): - return (False, 'Invalid file ID') - files.append(c.files[i]) - - if not title: - return (False, "Missing title.") - if not description: - return (False, "Missing description.") - try: - reporterIndex = int(reporterIndex) - except: - return (False, "Invalid report method.") - - # Get the reporter and parameters. - reporter = self.server.reporters[reporterIndex] - parameters = {} - for o in reporter.getParameters(): - name = '%s_%s'%(reporter.getName(),o.getName()) - if name not in self.fields: - return (False, - 'Missing field "%s" for %s report method.'%(name, - reporter.getName())) - parameters[o.getName()] = self.get_scalar_field(name) - - # Update config defaults. - if report != 'None': - self.server.config.set('ScanView', 'reporter', reporterIndex) - for o in reporter.getParameters(): - if o.saveConfigValue(): - name = o.getName() - self.server.config.set(reporter.getName(), name, parameters[name]) - - # Create the report. - bug = Reporter.BugReport(title, description, files) - - # Kick off a reporting thread. - t = ReporterThread(bug, reporter, parameters, self.server) - t.start() - - # Wait for thread to die... - while t.isAlive(): - time.sleep(.25) - submitStatus = t.status - - return (t.success, t.status) - - def send_report_submit(self): - report = self.get_scalar_field('report') - c = self.get_report_context(report) - if c.reportSource is None: - reportingFor = "Report Crashes > " - fileBug = """\ -File Bug > """%locals() - else: - reportingFor = 'Report %s > ' % (c.reportSource, - report) - fileBug = 'File Bug > ' % report - title = self.get_scalar_field('title') - description = self.get_scalar_field('description') - - res,message = self.submit_bug(c) - - if res: - statusClass = 'SubmitOk' - statusName = 'Succeeded' - else: - statusClass = 'SubmitFail' - statusName = 'Failed' - - result = """ - - Bug Submission - - - -

-Summary > -%(reportingFor)s -%(fileBug)s -Submit

-
- - -
- - - - - - - - -
Title: - -
Description: - -
-
-
-

Submission %(statusName)s

-%(message)s -

-


-Return to Summary - -"""%locals() - return self.send_string(result) - - def send_open_report(self, report): - try: - keys = self.load_report(report) - except IOError: - return self.send_error(400, 'Invalid report.') - - file = keys.get('FILE') - if not file or not posixpath.exists(file): - return self.send_error(400, 'File does not exist: "%s"' % file) - - import startfile - if self.server.options.debug: - print >>sys.stderr, '%s: SERVER: opening "%s"'%(sys.argv[0], - file) - - status = startfile.open(file) - if status: - res = 'Opened: "%s"' % file - else: - res = 'Open failed: "%s"' % file - - return self.send_string(res, 'text/plain') - - def get_report_context(self, report): - class Context: - pass - if report is None or report == 'None': - data = self.load_crashes() - # Don't allow empty reports. - if not data: - raise ValueError, 'No crashes detected!' - c = Context() - c.title = 'clang static analyzer failures' - - stderrSummary = "" - for item in data: - if 'stderr' in item: - path = posixpath.join(self.server.root, item['stderr']) - if os.path.exists(path): - lns = itertools.islice(open(path), 0, 10) - stderrSummary += '%s\n--\n%s' % (item.get('src', - ''), - ''.join(lns)) - - c.description = """\ -The clang static analyzer failed on these inputs: -%s - -STDERR Summary --------------- -%s -""" % ('\n'.join([item.get('src','') for item in data]), - stderrSummary) - c.reportSource = None - c.navMarkup = "Report Crashes > " - c.files = [] - for item in data: - c.files.append(item.get('src','')) - c.files.append(posixpath.join(self.server.root, - item.get('file',''))) - c.files.append(posixpath.join(self.server.root, - item.get('clangfile',''))) - c.files.append(posixpath.join(self.server.root, - item.get('stderr',''))) - c.files.append(posixpath.join(self.server.root, - item.get('info',''))) - # Just in case something failed, ignore files which don't - # exist. - c.files = [f for f in c.files - if os.path.exists(f) and os.path.isfile(f)] - else: - # Check that this is a valid report. - path = posixpath.join(self.server.root, 'report-%s.html' % report) - if not posixpath.exists(path): - raise ValueError, 'Invalid report ID' - keys = self.load_report(report) - c = Context() - c.title = keys.get('DESC','clang error (unrecognized') - c.description = """\ -Bug reported by the clang static analyzer. - -Description: %s -File: %s -Line: %s -"""%(c.title, keys.get('FILE',''), keys.get('LINE', '')) - c.reportSource = 'report-%s.html' % report - c.navMarkup = """Report %s > """ % (c.reportSource, - report) - - c.files = [path] - return c - - def send_report(self, report, configOverrides=None): - def getConfigOption(section, field): - if (configOverrides is not None and - section in configOverrides and - field in configOverrides[section]): - return configOverrides[section][field] - return self.server.config.get(section, field) - - # report is None is used for crashes - try: - c = self.get_report_context(report) - except ValueError, e: - return self.send_error(400, e.message) - - title = c.title - description= c.description - reportingFor = c.navMarkup - if c.reportSource is None: - extraIFrame = "" - else: - extraIFrame = """\ -""" % (c.reportSource, c.reportSource) - - reporterSelections = [] - reporterOptions = [] - - try: - active = int(getConfigOption('ScanView','reporter')) - except: - active = 0 - for i,r in enumerate(self.server.reporters): - selected = (i == active) - if selected: - selectedStr = ' selected' - else: - selectedStr = '' - reporterSelections.append(''%(i,selectedStr,r.getName())) - options = '\n'.join([ o.getHTML(r,title,getConfigOption) for o in r.getParameters()]) - display = ('none','')[selected] - reporterOptions.append("""\ - - %s Options - - -%s -
- - -"""%(r.getName(),display,r.getName(),options)) - reporterSelections = '\n'.join(reporterSelections) - reporterOptionsDivs = '\n'.join(reporterOptions) - reportersArray = '[%s]'%(','.join([`r.getName()` for r in self.server.reporters])) - - if c.files: - fieldSize = min(5, len(c.files)) - attachFileOptions = '\n'.join(["""\ -""" % (i,v) for i,v in enumerate(c.files)]) - attachFileRow = """\ - - Attach: - - - - -""" % (min(5, len(c.files)), attachFileOptions) - else: - attachFileRow = "" - - result = """ - - File Bug - - - - -

-Summary > -%(reportingFor)s -File Bug

-
- - - - - -
- - - - - - - - - - -%(attachFileRow)s - -
Title: - -
Description: - -
-
- - - - - -%(reporterOptionsDivs)s -
Method: - -
-
-
- -
-
- -%(extraIFrame)s - - -"""%locals() - - return self.send_string(result) - - def send_head(self, fields=None): - if (self.server.options.onlyServeLocal and - self.client_address[0] != '127.0.0.1'): - return self.send_error('401', 'Unauthorized host.') - - if fields is None: - fields = {} - self.fields = fields - - o = urlparse.urlparse(self.path) - self.fields = parse_query(o.query, fields) - path = posixpath.normpath(urllib.unquote(o.path)) - - # Split the components and strip the root prefix. - components = path.split('/')[1:] - - # Special case some top-level entries. - if components: - name = components[0] - if len(components)==2: - if name=='report': - return self.send_report(components[1]) - elif name=='open': - return self.send_open_report(components[1]) - elif len(components)==1: - if name=='quit': - self.server.halt() - return self.send_string('Goodbye.', 'text/plain') - elif name=='report_submit': - return self.send_report_submit() - elif name=='report_crashes': - overrides = { 'ScanView' : {}, - 'Radar' : {}, - 'Email' : {} } - for i,r in enumerate(self.server.reporters): - if r.getName() == 'Radar': - overrides['ScanView']['reporter'] = i - break - overrides['Radar']['Component'] = 'llvm - checker' - overrides['Radar']['Component Version'] = 'X' - return self.send_report(None, overrides) - elif name=='favicon.ico': - return self.send_path(posixpath.join(kResources,'bugcatcher.ico')) - - # Match directory entries. - if components[-1] == '': - components[-1] = 'index.html' - - suffix = '/'.join(components) - - # The summary may reference source files on disk using rooted - # paths. Make sure these resolve correctly for now. - # FIXME: This isn't a very good idea... we should probably - # mark rooted paths somehow. - if os.path.exists(posixpath.join('/', suffix)): - path = posixpath.join('/', suffix) - else: - path = posixpath.join(self.server.root, suffix) - - if self.server.options.debug > 1: - print >>sys.stderr, '%s: SERVER: sending path "%s"'%(sys.argv[0], - path) - return self.send_path(path) - - def send_404(self): - self.send_error(404, "File not found") - return None - - def send_path(self, path): - ctype = self.guess_type(path) - if ctype.startswith('text/'): - # Patch file instead - return self.send_patched_file(path, ctype) - else: - mode = 'rb' - try: - f = open(path, mode) - except IOError: - return self.send_404() - return self.send_file(f, ctype) - - def send_file(self, f, ctype): - # Patch files to add links, but skip binary files. - self.send_response(200) - self.send_header("Content-type", ctype) - fs = os.fstat(f.fileno()) - self.send_header("Content-Length", str(fs[6])) - self.send_header("Last-Modified", self.date_time_string(fs.st_mtime)) - self.end_headers() - return f - - def send_string(self, s, ctype='text/html', headers=True, mtime=None): - if headers: - self.send_response(200) - self.send_header("Content-type", ctype) - self.send_header("Content-Length", str(len(s))) - if mtime is None: - mtime = self.dynamic_mtime - self.send_header("Last-Modified", self.date_time_string(mtime)) - self.end_headers() - return StringIO.StringIO(s) - - def send_patched_file(self, path, ctype): - # Allow a very limited set of variables. This is pretty gross. - variables = {} - variables['report'] = '' - m = kReportFileRE.match(path) - if m: - variables['report'] = m.group(2) - - try: - f = open(path,'r') - except IOError: - return self.send_404() - fs = os.fstat(f.fileno()) - data = f.read() - for a,b in kReportReplacements: - data = a.sub(b % variables, data) - return self.send_string(data, ctype, mtime=fs.st_mtime) - - -def create_server(address, options, root): - import Reporter - - reporters = Reporter.getReporters() - - return ScanViewServer(address, ScanViewRequestHandler, - root, - reporters, - options) diff --git a/contrib/llvm/tools/clang/tools/scan-view/scan-view b/contrib/llvm/tools/clang/tools/scan-view/scan-view deleted file mode 100755 index fb27da698882..000000000000 --- a/contrib/llvm/tools/clang/tools/scan-view/scan-view +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env python - -"""The clang static analyzer results viewer. -""" - -import sys -import posixpath -import thread -import time -import urllib -import webbrowser - -# How long to wait for server to start. -kSleepTimeout = .05 -kMaxSleeps = int(60 / kSleepTimeout) - -# Default server parameters - -kDefaultHost = '127.0.0.1' -kDefaultPort = 8181 -kMaxPortsToTry = 100 - -### - -def url_is_up(url): - try: - o = urllib.urlopen(url) - except IOError: - return False - o.close() - return True - -def start_browser(port, options): - import urllib, webbrowser - - url = 'http://%s:%d'%(options.host, port) - - # Wait for server to start... - if options.debug: - sys.stderr.write('%s: Waiting for server.' % sys.argv[0]) - sys.stderr.flush() - for i in range(kMaxSleeps): - if url_is_up(url): - break - if options.debug: - sys.stderr.write('.') - sys.stderr.flush() - time.sleep(kSleepTimeout) - else: - print >>sys.stderr,'WARNING: Unable to detect that server started.' - - if options.debug: - print >>sys.stderr,'%s: Starting webbrowser...' % sys.argv[0] - webbrowser.open(url) - -def run(port, options, root): - import ScanView - try: - print 'Starting scan-view at: http://%s:%d'%(options.host, - port) - print ' Use Ctrl-C to exit.' - httpd = ScanView.create_server((options.host, port), - options, root) - httpd.serve_forever() - except KeyboardInterrupt: - pass - -def port_is_open(port): - import SocketServer - try: - t = SocketServer.TCPServer((kDefaultHost,port),None) - except: - return False - t.server_close() - return True - -def main(): - from optparse import OptionParser - parser = OptionParser('usage: %prog [options] ') - parser.set_description(__doc__) - parser.add_option( - '--host', dest="host", default=kDefaultHost, type="string", - help="Host interface to listen on. (default=%s)" % kDefaultHost) - parser.add_option( - '--port', dest="port", default=None, type="int", - help="Port to listen on. (default=%s)" % kDefaultPort) - parser.add_option("--debug", dest="debug", default=0, - action="count", - help="Print additional debugging information.") - parser.add_option("--auto-reload", dest="autoReload", default=False, - action="store_true", - help="Automatically update module for each request.") - parser.add_option("--no-browser", dest="startBrowser", default=True, - action="store_false", - help="Don't open a webbrowser on startup.") - parser.add_option("--allow-all-hosts", dest="onlyServeLocal", default=True, - action="store_false", - help='Allow connections from any host (access restricted to "127.0.0.1" by default)') - (options, args) = parser.parse_args() - - if len(args) != 1: - parser.error('No results directory specified.') - root, = args - - # Make sure this directory is in a reasonable state to view. - if not posixpath.exists(posixpath.join(root,'index.html')): - parser.error('Invalid directory, analysis results not found!') - - # Find an open port. We aren't particularly worried about race - # conditions here. Note that if the user specified a port we only - # use that one. - if options.port is not None: - port = options.port - else: - for i in range(kMaxPortsToTry): - if port_is_open(kDefaultPort + i): - port = kDefaultPort + i - break - else: - parser.error('Unable to find usable port in [%d,%d)'%(kDefaultPort, - kDefaultPort+kMaxPortsToTry)) - - # Kick off thread to wait for server and start web browser, if - # requested. - if options.startBrowser: - t = thread.start_new_thread(start_browser, (port,options)) - - run(port, options, root) - -if __name__ == '__main__': - main() diff --git a/contrib/llvm/tools/clang/tools/scan-view/startfile.py b/contrib/llvm/tools/clang/tools/scan-view/startfile.py deleted file mode 100644 index e8fbe2d5a84e..000000000000 --- a/contrib/llvm/tools/clang/tools/scan-view/startfile.py +++ /dev/null @@ -1,203 +0,0 @@ -"""Utility for opening a file using the default application in a cross-platform -manner. Modified from http://code.activestate.com/recipes/511443/. -""" - -__version__ = '1.1x' -__all__ = ['open'] - -import os -import sys -import webbrowser -import subprocess - -_controllers = {} -_open = None - - -class BaseController(object): - '''Base class for open program controllers.''' - - def __init__(self, name): - self.name = name - - def open(self, filename): - raise NotImplementedError - - -class Controller(BaseController): - '''Controller for a generic open program.''' - - def __init__(self, *args): - super(Controller, self).__init__(os.path.basename(args[0])) - self.args = list(args) - - def _invoke(self, cmdline): - if sys.platform[:3] == 'win': - closefds = False - startupinfo = subprocess.STARTUPINFO() - startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW - else: - closefds = True - startupinfo = None - - if (os.environ.get('DISPLAY') or sys.platform[:3] == 'win' or - sys.platform == 'darwin'): - inout = file(os.devnull, 'r+') - else: - # for TTY programs, we need stdin/out - inout = None - - # if possible, put the child precess in separate process group, - # so keyboard interrupts don't affect child precess as well as - # Python - setsid = getattr(os, 'setsid', None) - if not setsid: - setsid = getattr(os, 'setpgrp', None) - - pipe = subprocess.Popen(cmdline, stdin=inout, stdout=inout, - stderr=inout, close_fds=closefds, - preexec_fn=setsid, startupinfo=startupinfo) - - # It is assumed that this kind of tools (gnome-open, kfmclient, - # exo-open, xdg-open and open for OSX) immediately exit after lauching - # the specific application - returncode = pipe.wait() - if hasattr(self, 'fixreturncode'): - returncode = self.fixreturncode(returncode) - return not returncode - - def open(self, filename): - if isinstance(filename, basestring): - cmdline = self.args + [filename] - else: - # assume it is a sequence - cmdline = self.args + filename - try: - return self._invoke(cmdline) - except OSError: - return False - - -# Platform support for Windows -if sys.platform[:3] == 'win': - - class Start(BaseController): - '''Controller for the win32 start progam through os.startfile.''' - - def open(self, filename): - try: - os.startfile(filename) - except WindowsError: - # [Error 22] No application is associated with the specified - # file for this operation: '' - return False - else: - return True - - _controllers['windows-default'] = Start('start') - _open = _controllers['windows-default'].open - - -# Platform support for MacOS -elif sys.platform == 'darwin': - _controllers['open']= Controller('open') - _open = _controllers['open'].open - - -# Platform support for Unix -else: - - import commands - - # @WARNING: use the private API of the webbrowser module - from webbrowser import _iscommand - - class KfmClient(Controller): - '''Controller for the KDE kfmclient program.''' - - def __init__(self, kfmclient='kfmclient'): - super(KfmClient, self).__init__(kfmclient, 'exec') - self.kde_version = self.detect_kde_version() - - def detect_kde_version(self): - kde_version = None - try: - info = commands.getoutput('kde-config --version') - - for line in info.splitlines(): - if line.startswith('KDE'): - kde_version = line.split(':')[-1].strip() - break - except (OSError, RuntimeError): - pass - - return kde_version - - def fixreturncode(self, returncode): - if returncode is not None and self.kde_version > '3.5.4': - return returncode - else: - return os.EX_OK - - def detect_desktop_environment(): - '''Checks for known desktop environments - - Return the desktop environments name, lowercase (kde, gnome, xfce) - or "generic" - - ''' - - desktop_environment = 'generic' - - if os.environ.get('KDE_FULL_SESSION') == 'true': - desktop_environment = 'kde' - elif os.environ.get('GNOME_DESKTOP_SESSION_ID'): - desktop_environment = 'gnome' - else: - try: - info = commands.getoutput('xprop -root _DT_SAVE_MODE') - if ' = "xfce4"' in info: - desktop_environment = 'xfce' - except (OSError, RuntimeError): - pass - - return desktop_environment - - - def register_X_controllers(): - if _iscommand('kfmclient'): - _controllers['kde-open'] = KfmClient() - - for command in ('gnome-open', 'exo-open', 'xdg-open'): - if _iscommand(command): - _controllers[command] = Controller(command) - - def get(): - controllers_map = { - 'gnome': 'gnome-open', - 'kde': 'kde-open', - 'xfce': 'exo-open', - } - - desktop_environment = detect_desktop_environment() - - try: - controller_name = controllers_map[desktop_environment] - return _controllers[controller_name].open - - except KeyError: - if _controllers.has_key('xdg-open'): - return _controllers['xdg-open'].open - else: - return webbrowser.open - - - if os.environ.get("DISPLAY"): - register_X_controllers() - _open = get() - - -def open(filename): - '''Open a file or an URL in the registered default application.''' - - return _open(filename) diff --git a/contrib/llvm/tools/clang/utils/ABITest/ABITestGen.py b/contrib/llvm/tools/clang/utils/ABITest/ABITestGen.py deleted file mode 100755 index c45a0c343270..000000000000 --- a/contrib/llvm/tools/clang/utils/ABITest/ABITestGen.py +++ /dev/null @@ -1,653 +0,0 @@ -#!/usr/bin/env python - -from pprint import pprint -import random, atexit, time -from random import randrange -import re - -from Enumeration import * -from TypeGen import * - -#### - -class TypePrinter: - def __init__(self, output, outputHeader=None, - outputTests=None, outputDriver=None, - headerName=None, info=None): - self.output = output - self.outputHeader = outputHeader - self.outputTests = outputTests - self.outputDriver = outputDriver - self.writeBody = outputHeader or outputTests or outputDriver - self.types = {} - self.testValues = {} - self.testReturnValues = {} - self.layoutTests = [] - - if info: - for f in (self.output,self.outputHeader,self.outputTests,self.outputDriver): - if f: - print >>f,info - - if self.writeBody: - print >>self.output, '#include \n' - if self.outputTests: - print >>self.outputTests, '#include ' - print >>self.outputTests, '#include ' - print >>self.outputTests, '#include \n' - - if headerName: - for f in (self.output,self.outputTests,self.outputDriver): - if f is not None: - print >>f, '#include "%s"\n'%(headerName,) - - if self.outputDriver: - print >>self.outputDriver, '#include ' - print >>self.outputDriver, '#include \n' - print >>self.outputDriver, 'int main(int argc, char **argv) {' - print >>self.outputDriver, ' int index = -1;' - print >>self.outputDriver, ' if (argc > 1) index = atoi(argv[1]);' - - def finish(self): - if self.layoutTests: - print >>self.output, 'int main(int argc, char **argv) {' - print >>self.output, ' int index = -1;' - print >>self.output, ' if (argc > 1) index = atoi(argv[1]);' - for i,f in self.layoutTests: - print >>self.output, ' if (index == -1 || index == %d)' % i - print >>self.output, ' %s();' % f - print >>self.output, ' return 0;' - print >>self.output, '}' - - if self.outputDriver: - print >>self.outputDriver, ' printf("DONE\\n");' - print >>self.outputDriver, ' return 0;' - print >>self.outputDriver, '}' - - def getTypeName(self, T): - if isinstance(T,BuiltinType): - return T.name - name = self.types.get(T) - if name is None: - name = 'T%d'%(len(self.types),) - # Reserve slot - self.types[T] = None - if self.outputHeader: - print >>self.outputHeader,T.getTypedefDef(name, self) - else: - print >>self.output,T.getTypedefDef(name, self) - if self.outputTests: - print >>self.outputTests,T.getTypedefDef(name, self) - self.types[T] = name - return name - - def writeLayoutTest(self, i, ty): - tyName = self.getTypeName(ty) - tyNameClean = tyName.replace(' ','_').replace('*','star') - fnName = 'test_%s' % tyNameClean - - print >>self.output,'void %s(void) {' % fnName - self.printSizeOfType(' %s'%fnName, tyName, ty, self.output) - self.printAlignOfType(' %s'%fnName, tyName, ty, self.output) - self.printOffsetsOfType(' %s'%fnName, tyName, ty, self.output) - print >>self.output,'}' - print >>self.output - - self.layoutTests.append((i,fnName)) - - def writeFunction(self, i, FT): - args = ', '.join(['%s arg%d'%(self.getTypeName(t),i) for i,t in enumerate(FT.argTypes)]) - if not args: - args = 'void' - - if FT.returnType is None: - retvalName = None - retvalTypeName = 'void' - else: - retvalTypeName = self.getTypeName(FT.returnType) - if self.writeBody or self.outputTests: - retvalName = self.getTestReturnValue(FT.returnType) - - fnName = 'fn%d'%(FT.index,) - if self.outputHeader: - print >>self.outputHeader,'%s %s(%s);'%(retvalTypeName, fnName, args) - elif self.outputTests: - print >>self.outputTests,'%s %s(%s);'%(retvalTypeName, fnName, args) - - print >>self.output,'%s %s(%s)'%(retvalTypeName, fnName, args), - if self.writeBody: - print >>self.output, '{' - - for i,t in enumerate(FT.argTypes): - self.printValueOfType(' %s'%fnName, 'arg%d'%i, t) - - if retvalName is not None: - print >>self.output, ' return %s;'%(retvalName,) - print >>self.output, '}' - else: - print >>self.output, '{}' - print >>self.output - - if self.outputDriver: - print >>self.outputDriver, ' if (index == -1 || index == %d) {' % i - print >>self.outputDriver, ' extern void test_%s(void);' % fnName - print >>self.outputDriver, ' test_%s();' % fnName - print >>self.outputDriver, ' }' - - if self.outputTests: - if self.outputHeader: - print >>self.outputHeader, 'void test_%s(void);'%(fnName,) - - if retvalName is None: - retvalTests = None - else: - retvalTests = self.getTestValuesArray(FT.returnType) - tests = map(self.getTestValuesArray, FT.argTypes) - print >>self.outputTests, 'void test_%s(void) {'%(fnName,) - - if retvalTests is not None: - print >>self.outputTests, ' printf("%s: testing return.\\n");'%(fnName,) - print >>self.outputTests, ' for (int i=0; i<%d; ++i) {'%(retvalTests[1],) - args = ', '.join(['%s[%d]'%(t,randrange(l)) for t,l in tests]) - print >>self.outputTests, ' %s RV;'%(retvalTypeName,) - print >>self.outputTests, ' %s = %s[i];'%(retvalName, retvalTests[0]) - print >>self.outputTests, ' RV = %s(%s);'%(fnName, args) - self.printValueOfType(' %s_RV'%fnName, 'RV', FT.returnType, output=self.outputTests, indent=4) - self.checkTypeValues('RV', '%s[i]' % retvalTests[0], FT.returnType, output=self.outputTests, indent=4) - print >>self.outputTests, ' }' - - if tests: - print >>self.outputTests, ' printf("%s: testing arguments.\\n");'%(fnName,) - for i,(array,length) in enumerate(tests): - for j in range(length): - args = ['%s[%d]'%(t,randrange(l)) for t,l in tests] - args[i] = '%s[%d]'%(array,j) - print >>self.outputTests, ' %s(%s);'%(fnName, ', '.join(args),) - print >>self.outputTests, '}' - - def getTestReturnValue(self, type): - typeName = self.getTypeName(type) - info = self.testReturnValues.get(typeName) - if info is None: - name = '%s_retval'%(typeName.replace(' ','_').replace('*','star'),) - print >>self.output, '%s %s;'%(typeName,name) - if self.outputHeader: - print >>self.outputHeader, 'extern %s %s;'%(typeName,name) - elif self.outputTests: - print >>self.outputTests, 'extern %s %s;'%(typeName,name) - info = self.testReturnValues[typeName] = name - return info - - def getTestValuesArray(self, type): - typeName = self.getTypeName(type) - info = self.testValues.get(typeName) - if info is None: - name = '%s_values'%(typeName.replace(' ','_').replace('*','star'),) - print >>self.outputTests, 'static %s %s[] = {'%(typeName,name) - length = 0 - for item in self.getTestValues(type): - print >>self.outputTests, '\t%s,'%(item,) - length += 1 - print >>self.outputTests,'};' - info = self.testValues[typeName] = (name,length) - return info - - def getTestValues(self, t): - if isinstance(t, BuiltinType): - if t.name=='float': - for i in ['0.0','-1.0','1.0']: - yield i+'f' - elif t.name=='double': - for i in ['0.0','-1.0','1.0']: - yield i - elif t.name in ('void *'): - yield '(void*) 0' - yield '(void*) -1' - else: - yield '(%s) 0'%(t.name,) - yield '(%s) -1'%(t.name,) - yield '(%s) 1'%(t.name,) - elif isinstance(t, EnumType): - for i in range(0, len(t.enumerators)): - yield 'enum%dval%d' % (t.index, i) - elif isinstance(t, RecordType): - nonPadding = [f for f in t.fields - if not f.isPaddingBitField()] - - if not nonPadding: - yield '{ }' - return - - # FIXME: Use designated initializers to access non-first - # fields of unions. - if t.isUnion: - for v in self.getTestValues(nonPadding[0]): - yield '{ %s }' % v - return - - fieldValues = map(list, map(self.getTestValues, nonPadding)) - for i,values in enumerate(fieldValues): - for v in values: - elements = map(random.choice,fieldValues) - elements[i] = v - yield '{ %s }'%(', '.join(elements)) - - elif isinstance(t, ComplexType): - for t in self.getTestValues(t.elementType): - yield '%s + %s * 1i'%(t,t) - elif isinstance(t, ArrayType): - values = list(self.getTestValues(t.elementType)) - if not values: - yield '{ }' - for i in range(t.numElements): - for v in values: - elements = [random.choice(values) for i in range(t.numElements)] - elements[i] = v - yield '{ %s }'%(', '.join(elements)) - else: - raise NotImplementedError,'Cannot make tests values of type: "%s"'%(t,) - - def printSizeOfType(self, prefix, name, t, output=None, indent=2): - print >>output, '%*sprintf("%s: sizeof(%s) = %%ld\\n", (long)sizeof(%s));'%(indent, '', prefix, name, name) - def printAlignOfType(self, prefix, name, t, output=None, indent=2): - print >>output, '%*sprintf("%s: __alignof__(%s) = %%ld\\n", (long)__alignof__(%s));'%(indent, '', prefix, name, name) - def printOffsetsOfType(self, prefix, name, t, output=None, indent=2): - if isinstance(t, RecordType): - for i,f in enumerate(t.fields): - if f.isBitField(): - continue - fname = 'field%d' % i - print >>output, '%*sprintf("%s: __builtin_offsetof(%s, %s) = %%ld\\n", (long)__builtin_offsetof(%s, %s));'%(indent, '', prefix, name, fname, name, fname) - - def printValueOfType(self, prefix, name, t, output=None, indent=2): - if output is None: - output = self.output - if isinstance(t, BuiltinType): - if t.name.endswith('long long'): - code = 'lld' - elif t.name.endswith('long'): - code = 'ld' - elif t.name.split(' ')[-1] in ('_Bool','char','short','int'): - code = 'd' - elif t.name in ('float','double'): - code = 'f' - elif t.name == 'long double': - code = 'Lf' - else: - code = 'p' - print >>output, '%*sprintf("%s: %s = %%%s\\n", %s);'%(indent, '', prefix, name, code, name) - elif isinstance(t, EnumType): - print >>output, '%*sprintf("%s: %s = %%d\\n", %s);'%(indent, '', prefix, name, name) - elif isinstance(t, RecordType): - if not t.fields: - print >>output, '%*sprintf("%s: %s (empty)\\n");'%(indent, '', prefix, name) - for i,f in enumerate(t.fields): - if f.isPaddingBitField(): - continue - fname = '%s.field%d'%(name,i) - self.printValueOfType(prefix, fname, f, output=output, indent=indent) - elif isinstance(t, ComplexType): - self.printValueOfType(prefix, '(__real %s)'%name, t.elementType, output=output,indent=indent) - self.printValueOfType(prefix, '(__imag %s)'%name, t.elementType, output=output,indent=indent) - elif isinstance(t, ArrayType): - for i in range(t.numElements): - # Access in this fashion as a hackish way to portably - # access vectors. - if t.isVector: - self.printValueOfType(prefix, '((%s*) &%s)[%d]'%(t.elementType,name,i), t.elementType, output=output,indent=indent) - else: - self.printValueOfType(prefix, '%s[%d]'%(name,i), t.elementType, output=output,indent=indent) - else: - raise NotImplementedError,'Cannot print value of type: "%s"'%(t,) - - def checkTypeValues(self, nameLHS, nameRHS, t, output=None, indent=2): - prefix = 'foo' - if output is None: - output = self.output - if isinstance(t, BuiltinType): - print >>output, '%*sassert(%s == %s);' % (indent, '', nameLHS, nameRHS) - elif isinstance(t, EnumType): - print >>output, '%*sassert(%s == %s);' % (indent, '', nameLHS, nameRHS) - elif isinstance(t, RecordType): - for i,f in enumerate(t.fields): - if f.isPaddingBitField(): - continue - self.checkTypeValues('%s.field%d'%(nameLHS,i), '%s.field%d'%(nameRHS,i), - f, output=output, indent=indent) - if t.isUnion: - break - elif isinstance(t, ComplexType): - self.checkTypeValues('(__real %s)'%nameLHS, '(__real %s)'%nameRHS, t.elementType, output=output,indent=indent) - self.checkTypeValues('(__imag %s)'%nameLHS, '(__imag %s)'%nameRHS, t.elementType, output=output,indent=indent) - elif isinstance(t, ArrayType): - for i in range(t.numElements): - # Access in this fashion as a hackish way to portably - # access vectors. - if t.isVector: - self.checkTypeValues('((%s*) &%s)[%d]'%(t.elementType,nameLHS,i), - '((%s*) &%s)[%d]'%(t.elementType,nameRHS,i), - t.elementType, output=output,indent=indent) - else: - self.checkTypeValues('%s[%d]'%(nameLHS,i), '%s[%d]'%(nameRHS,i), - t.elementType, output=output,indent=indent) - else: - raise NotImplementedError,'Cannot print value of type: "%s"'%(t,) - -import sys - -def main(): - from optparse import OptionParser, OptionGroup - parser = OptionParser("%prog [options] {indices}") - parser.add_option("", "--mode", dest="mode", - help="autogeneration mode (random or linear) [default %default]", - type='choice', choices=('random','linear'), default='linear') - parser.add_option("", "--count", dest="count", - help="autogenerate COUNT functions according to MODE", - type=int, default=0) - parser.add_option("", "--min", dest="minIndex", metavar="N", - help="start autogeneration with the Nth function type [default %default]", - type=int, default=0) - parser.add_option("", "--max", dest="maxIndex", metavar="N", - help="maximum index for random autogeneration [default %default]", - type=int, default=10000000) - parser.add_option("", "--seed", dest="seed", - help="random number generator seed [default %default]", - type=int, default=1) - parser.add_option("", "--use-random-seed", dest="useRandomSeed", - help="use random value for initial random number generator seed", - action='store_true', default=False) - parser.add_option("-o", "--output", dest="output", metavar="FILE", - help="write output to FILE [default %default]", - type=str, default='-') - parser.add_option("-O", "--output-header", dest="outputHeader", metavar="FILE", - help="write header file for output to FILE [default %default]", - type=str, default=None) - parser.add_option("-T", "--output-tests", dest="outputTests", metavar="FILE", - help="write function tests to FILE [default %default]", - type=str, default=None) - parser.add_option("-D", "--output-driver", dest="outputDriver", metavar="FILE", - help="write test driver to FILE [default %default]", - type=str, default=None) - parser.add_option("", "--test-layout", dest="testLayout", metavar="FILE", - help="test structure layout", - action='store_true', default=False) - - group = OptionGroup(parser, "Type Enumeration Options") - # Builtins - Ints - group.add_option("", "--no-char", dest="useChar", - help="do not generate char types", - action="store_false", default=True) - group.add_option("", "--no-short", dest="useShort", - help="do not generate short types", - action="store_false", default=True) - group.add_option("", "--no-int", dest="useInt", - help="do not generate int types", - action="store_false", default=True) - group.add_option("", "--no-long", dest="useLong", - help="do not generate long types", - action="store_false", default=True) - group.add_option("", "--no-long-long", dest="useLongLong", - help="do not generate long long types", - action="store_false", default=True) - group.add_option("", "--no-unsigned", dest="useUnsigned", - help="do not generate unsigned integer types", - action="store_false", default=True) - - # Other builtins - group.add_option("", "--no-bool", dest="useBool", - help="do not generate bool types", - action="store_false", default=True) - group.add_option("", "--no-float", dest="useFloat", - help="do not generate float types", - action="store_false", default=True) - group.add_option("", "--no-double", dest="useDouble", - help="do not generate double types", - action="store_false", default=True) - group.add_option("", "--no-long-double", dest="useLongDouble", - help="do not generate long double types", - action="store_false", default=True) - group.add_option("", "--no-void-pointer", dest="useVoidPointer", - help="do not generate void* types", - action="store_false", default=True) - - # Enumerations - group.add_option("", "--no-enums", dest="useEnum", - help="do not generate enum types", - action="store_false", default=True) - - # Derived types - group.add_option("", "--no-array", dest="useArray", - help="do not generate record types", - action="store_false", default=True) - group.add_option("", "--no-complex", dest="useComplex", - help="do not generate complex types", - action="store_false", default=True) - group.add_option("", "--no-record", dest="useRecord", - help="do not generate record types", - action="store_false", default=True) - group.add_option("", "--no-union", dest="recordUseUnion", - help="do not generate union types", - action="store_false", default=True) - group.add_option("", "--no-vector", dest="useVector", - help="do not generate vector types", - action="store_false", default=True) - group.add_option("", "--no-bit-field", dest="useBitField", - help="do not generate bit-field record members", - action="store_false", default=True) - group.add_option("", "--no-builtins", dest="useBuiltins", - help="do not use any types", - action="store_false", default=True) - - # Tuning - group.add_option("", "--no-function-return", dest="functionUseReturn", - help="do not generate return types for functions", - action="store_false", default=True) - group.add_option("", "--vector-types", dest="vectorTypes", - help="comma separated list of vector types (e.g., v2i32) [default %default]", - action="store", type=str, default='v2i16, v1i64, v2i32, v4i16, v8i8, v2f32, v2i64, v4i32, v8i16, v16i8, v2f64, v4f32, v16f32', metavar="N") - group.add_option("", "--bit-fields", dest="bitFields", - help="comma separated list 'type:width' bit-field specifiers [default %default]", - action="store", type=str, default="char:0,char:4,unsigned:0,unsigned:4,unsigned:13,unsigned:24") - group.add_option("", "--max-args", dest="functionMaxArgs", - help="maximum number of arguments per function [default %default]", - action="store", type=int, default=4, metavar="N") - group.add_option("", "--max-array", dest="arrayMaxSize", - help="maximum array size [default %default]", - action="store", type=int, default=4, metavar="N") - group.add_option("", "--max-record", dest="recordMaxSize", - help="maximum number of fields per record [default %default]", - action="store", type=int, default=4, metavar="N") - group.add_option("", "--max-record-depth", dest="recordMaxDepth", - help="maximum nested structure depth [default %default]", - action="store", type=int, default=None, metavar="N") - parser.add_option_group(group) - (opts, args) = parser.parse_args() - - if not opts.useRandomSeed: - random.seed(opts.seed) - - # Contruct type generator - builtins = [] - if opts.useBuiltins: - ints = [] - if opts.useChar: ints.append(('char',1)) - if opts.useShort: ints.append(('short',2)) - if opts.useInt: ints.append(('int',4)) - # FIXME: Wrong size. - if opts.useLong: ints.append(('long',4)) - if opts.useLongLong: ints.append(('long long',8)) - if opts.useUnsigned: - ints = ([('unsigned %s'%i,s) for i,s in ints] + - [('signed %s'%i,s) for i,s in ints]) - builtins.extend(ints) - - if opts.useBool: builtins.append(('_Bool',1)) - if opts.useFloat: builtins.append(('float',4)) - if opts.useDouble: builtins.append(('double',8)) - if opts.useLongDouble: builtins.append(('long double',16)) - # FIXME: Wrong size. - if opts.useVoidPointer: builtins.append(('void*',4)) - - btg = FixedTypeGenerator([BuiltinType(n,s) for n,s in builtins]) - - bitfields = [] - for specifier in opts.bitFields.split(','): - if not specifier.strip(): - continue - name,width = specifier.strip().split(':', 1) - bitfields.append(BuiltinType(name,None,int(width))) - bftg = FixedTypeGenerator(bitfields) - - charType = BuiltinType('char',1) - shortType = BuiltinType('short',2) - intType = BuiltinType('int',4) - longlongType = BuiltinType('long long',8) - floatType = BuiltinType('float',4) - doubleType = BuiltinType('double',8) - sbtg = FixedTypeGenerator([charType, intType, floatType, doubleType]) - - atg = AnyTypeGenerator() - artg = AnyTypeGenerator() - def makeGenerator(atg, subgen, subfieldgen, useRecord, useArray, useBitField): - atg.addGenerator(btg) - if useBitField and opts.useBitField: - atg.addGenerator(bftg) - if useRecord and opts.useRecord: - assert subgen - atg.addGenerator(RecordTypeGenerator(subfieldgen, opts.recordUseUnion, - opts.recordMaxSize)) - if opts.useComplex: - # FIXME: Allow overriding builtins here - atg.addGenerator(ComplexTypeGenerator(sbtg)) - if useArray and opts.useArray: - assert subgen - atg.addGenerator(ArrayTypeGenerator(subgen, opts.arrayMaxSize)) - if opts.useVector: - vTypes = [] - for i,t in enumerate(opts.vectorTypes.split(',')): - m = re.match('v([1-9][0-9]*)([if][1-9][0-9]*)', t.strip()) - if not m: - parser.error('Invalid vector type: %r' % t) - count,kind = m.groups() - count = int(count) - type = { 'i8' : charType, - 'i16' : shortType, - 'i32' : intType, - 'i64' : longlongType, - 'f32' : floatType, - 'f64' : doubleType, - }.get(kind) - if not type: - parser.error('Invalid vector type: %r' % t) - vTypes.append(ArrayType(i, True, type, count * type.size)) - - atg.addGenerator(FixedTypeGenerator(vTypes)) - if opts.useEnum: - atg.addGenerator(EnumTypeGenerator([None, '-1', '1', '1u'], 1, 4)) - - if opts.recordMaxDepth is None: - # Fully recursive, just avoid top-level arrays. - subFTG = AnyTypeGenerator() - subTG = AnyTypeGenerator() - atg = AnyTypeGenerator() - makeGenerator(subFTG, atg, atg, True, True, True) - makeGenerator(subTG, atg, subFTG, True, True, False) - makeGenerator(atg, subTG, subFTG, True, False, False) - else: - # Make a chain of type generators, each builds smaller - # structures. - base = AnyTypeGenerator() - fbase = AnyTypeGenerator() - makeGenerator(base, None, None, False, False, False) - makeGenerator(fbase, None, None, False, False, True) - for i in range(opts.recordMaxDepth): - n = AnyTypeGenerator() - fn = AnyTypeGenerator() - makeGenerator(n, base, fbase, True, True, False) - makeGenerator(fn, base, fbase, True, True, True) - base = n - fbase = fn - atg = AnyTypeGenerator() - makeGenerator(atg, base, fbase, True, False, False) - - if opts.testLayout: - ftg = atg - else: - ftg = FunctionTypeGenerator(atg, opts.functionUseReturn, opts.functionMaxArgs) - - # Override max,min,count if finite - if opts.maxIndex is None: - if ftg.cardinality is aleph0: - opts.maxIndex = 10000000 - else: - opts.maxIndex = ftg.cardinality - opts.maxIndex = min(opts.maxIndex, ftg.cardinality) - opts.minIndex = max(0,min(opts.maxIndex-1, opts.minIndex)) - if not opts.mode=='random': - opts.count = min(opts.count, opts.maxIndex-opts.minIndex) - - if opts.output=='-': - output = sys.stdout - else: - output = open(opts.output,'w') - atexit.register(lambda: output.close()) - - outputHeader = None - if opts.outputHeader: - outputHeader = open(opts.outputHeader,'w') - atexit.register(lambda: outputHeader.close()) - - outputTests = None - if opts.outputTests: - outputTests = open(opts.outputTests,'w') - atexit.register(lambda: outputTests.close()) - - outputDriver = None - if opts.outputDriver: - outputDriver = open(opts.outputDriver,'w') - atexit.register(lambda: outputDriver.close()) - - info = '' - info += '// %s\n'%(' '.join(sys.argv),) - info += '// Generated: %s\n'%(time.strftime('%Y-%m-%d %H:%M'),) - info += '// Cardinality of function generator: %s\n'%(ftg.cardinality,) - info += '// Cardinality of type generator: %s\n'%(atg.cardinality,) - - if opts.testLayout: - info += '\n#include ' - - P = TypePrinter(output, - outputHeader=outputHeader, - outputTests=outputTests, - outputDriver=outputDriver, - headerName=opts.outputHeader, - info=info) - - def write(N): - try: - FT = ftg.get(N) - except RuntimeError,e: - if e.args[0]=='maximum recursion depth exceeded': - print >>sys.stderr,'WARNING: Skipped %d, recursion limit exceeded (bad arguments?)'%(N,) - return - raise - if opts.testLayout: - P.writeLayoutTest(N, FT) - else: - P.writeFunction(N, FT) - - if args: - [write(int(a)) for a in args] - - for i in range(opts.count): - if opts.mode=='linear': - index = opts.minIndex + i - else: - index = opts.minIndex + int((opts.maxIndex-opts.minIndex) * random.random()) - write(index) - - P.finish() - -if __name__=='__main__': - main() - diff --git a/contrib/llvm/tools/clang/utils/ABITest/Enumeration.py b/contrib/llvm/tools/clang/utils/ABITest/Enumeration.py deleted file mode 100644 index 47e47026db08..000000000000 --- a/contrib/llvm/tools/clang/utils/ABITest/Enumeration.py +++ /dev/null @@ -1,276 +0,0 @@ -"""Utilities for enumeration of finite and countably infinite sets. -""" -### -# Countable iteration - -# Simplifies some calculations -class Aleph0(int): - _singleton = None - def __new__(type): - if type._singleton is None: - type._singleton = int.__new__(type) - return type._singleton - def __repr__(self): return '' - def __str__(self): return 'inf' - - def __cmp__(self, b): - return 1 - - def __sub__(self, b): - raise ValueError,"Cannot subtract aleph0" - __rsub__ = __sub__ - - def __add__(self, b): - return self - __radd__ = __add__ - - def __mul__(self, b): - if b == 0: return b - return self - __rmul__ = __mul__ - - def __floordiv__(self, b): - if b == 0: raise ZeroDivisionError - return self - __rfloordiv__ = __floordiv__ - __truediv__ = __floordiv__ - __rtuediv__ = __floordiv__ - __div__ = __floordiv__ - __rdiv__ = __floordiv__ - - def __pow__(self, b): - if b == 0: return 1 - return self -aleph0 = Aleph0() - -def base(line): - return line*(line+1)//2 - -def pairToN((x,y)): - line,index = x+y,y - return base(line)+index - -def getNthPairInfo(N): - # Avoid various singularities - if N==0: - return (0,0) - - # Gallop to find bounds for line - line = 1 - next = 2 - while base(next)<=N: - line = next - next = line << 1 - - # Binary search for starting line - lo = line - hi = line<<1 - while lo + 1 != hi: - #assert base(lo) <= N < base(hi) - mid = (lo + hi)>>1 - if base(mid)<=N: - lo = mid - else: - hi = mid - - line = lo - return line, N - base(line) - -def getNthPair(N): - line,index = getNthPairInfo(N) - return (line - index, index) - -def getNthPairBounded(N,W=aleph0,H=aleph0,useDivmod=False): - """getNthPairBounded(N, W, H) -> (x, y) - - Return the N-th pair such that 0 <= x < W and 0 <= y < H.""" - - if W <= 0 or H <= 0: - raise ValueError,"Invalid bounds" - elif N >= W*H: - raise ValueError,"Invalid input (out of bounds)" - - # Simple case... - if W is aleph0 and H is aleph0: - return getNthPair(N) - - # Otherwise simplify by assuming W < H - if H < W: - x,y = getNthPairBounded(N,H,W,useDivmod=useDivmod) - return y,x - - if useDivmod: - return N%W,N//W - else: - # Conceptually we want to slide a diagonal line across a - # rectangle. This gives more interesting results for large - # bounds than using divmod. - - # If in lower left, just return as usual - cornerSize = base(W) - if N < cornerSize: - return getNthPair(N) - - # Otherwise if in upper right, subtract from corner - if H is not aleph0: - M = W*H - N - 1 - if M < cornerSize: - x,y = getNthPair(M) - return (W-1-x,H-1-y) - - # Otherwise, compile line and index from number of times we - # wrap. - N = N - cornerSize - index,offset = N%W,N//W - # p = (W-1, 1+offset) + (-1,1)*index - return (W-1-index, 1+offset+index) -def getNthPairBoundedChecked(N,W=aleph0,H=aleph0,useDivmod=False,GNP=getNthPairBounded): - x,y = GNP(N,W,H,useDivmod) - assert 0 <= x < W and 0 <= y < H - return x,y - -def getNthNTuple(N, W, H=aleph0, useLeftToRight=False): - """getNthNTuple(N, W, H) -> (x_0, x_1, ..., x_W) - - Return the N-th W-tuple, where for 0 <= x_i < H.""" - - if useLeftToRight: - elts = [None]*W - for i in range(W): - elts[i],N = getNthPairBounded(N, H) - return tuple(elts) - else: - if W==0: - return () - elif W==1: - return (N,) - elif W==2: - return getNthPairBounded(N, H, H) - else: - LW,RW = W//2, W - (W//2) - L,R = getNthPairBounded(N, H**LW, H**RW) - return (getNthNTuple(L,LW,H=H,useLeftToRight=useLeftToRight) + - getNthNTuple(R,RW,H=H,useLeftToRight=useLeftToRight)) -def getNthNTupleChecked(N, W, H=aleph0, useLeftToRight=False, GNT=getNthNTuple): - t = GNT(N,W,H,useLeftToRight) - assert len(t) == W - for i in t: - assert i < H - return t - -def getNthTuple(N, maxSize=aleph0, maxElement=aleph0, useDivmod=False, useLeftToRight=False): - """getNthTuple(N, maxSize, maxElement) -> x - - Return the N-th tuple where len(x) < maxSize and for y in x, 0 <= - y < maxElement.""" - - # All zero sized tuples are isomorphic, don't ya know. - if N == 0: - return () - N -= 1 - if maxElement is not aleph0: - if maxSize is aleph0: - raise NotImplementedError,'Max element size without max size unhandled' - bounds = [maxElement**i for i in range(1, maxSize+1)] - S,M = getNthPairVariableBounds(N, bounds) - else: - S,M = getNthPairBounded(N, maxSize, useDivmod=useDivmod) - return getNthNTuple(M, S+1, maxElement, useLeftToRight=useLeftToRight) -def getNthTupleChecked(N, maxSize=aleph0, maxElement=aleph0, - useDivmod=False, useLeftToRight=False, GNT=getNthTuple): - # FIXME: maxsize is inclusive - t = GNT(N,maxSize,maxElement,useDivmod,useLeftToRight) - assert len(t) <= maxSize - for i in t: - assert i < maxElement - return t - -def getNthPairVariableBounds(N, bounds): - """getNthPairVariableBounds(N, bounds) -> (x, y) - - Given a finite list of bounds (which may be finite or aleph0), - return the N-th pair such that 0 <= x < len(bounds) and 0 <= y < - bounds[x].""" - - if not bounds: - raise ValueError,"Invalid bounds" - if not (0 <= N < sum(bounds)): - raise ValueError,"Invalid input (out of bounds)" - - level = 0 - active = range(len(bounds)) - active.sort(key=lambda i: bounds[i]) - prevLevel = 0 - for i,index in enumerate(active): - level = bounds[index] - W = len(active) - i - if level is aleph0: - H = aleph0 - else: - H = level - prevLevel - levelSize = W*H - if N $@ || true -.PRECIOUS: temps/test.%.xy.diff -temps/test.%.xy.diff: temps/test.%.ref.out temps/test.%.xy.out - $(Verb) diff $^ > $@ || true -.PRECIOUS: temps/test.%.yx.diff -temps/test.%.yx.diff: temps/test.%.ref.out temps/test.%.yx.out - $(Verb) diff $^ > $@ || true -.PRECIOUS: temps/test.%.yy.diff -temps/test.%.yy.diff: temps/test.%.ref.out temps/test.%.yy.out - $(Verb) diff $^ > $@ || true -.PRECIOUS: temps/test.%.defs.diff -temps/test.%.defs.diff: temps/test.%.x.defs temps/test.%.y.defs - $(Verb) zipdifflines \ - --replace "%struct.T[0-9]+" "%struct.s" \ - --replace "%union.T[0-9]+" "%struct.s" \ - --replace "byval align [0-9]+" "byval" \ - $^ > $@ - -.PRECIOUS: temps/test.%.out -temps/test.%.out: temps/test.% - -$(Verb) ./$< > $@ - -# Executables - -.PRECIOUS: temps/test.%.ref -temps/test.%.ref: temps/test.%.driver.ref.o temps/test.%.a.ref.o temps/test.%.b.ref.o - $(Verb) $(CC) $(CFLAGS) $(CC_CFLAGS) -O3 -o $@ $^ -.PRECIOUS: temps/test.%.xx -temps/test.%.xx: temps/test.%.driver.ref.o temps/test.%.a.x.o temps/test.%.b.x.o - $(Verb) $(CC) $(CFLAGS) $(CC_CFLAGS) -O3 -o $@ $^ -.PRECIOUS: temps/test.%.xy -temps/test.%.xy: temps/test.%.driver.ref.o temps/test.%.a.x.o temps/test.%.b.y.o - $(Verb) $(CC) $(CFLAGS) $(CC_CFLAGS) -O3 -o $@ $^ -.PRECIOUS: temps/test.%.yx -temps/test.%.yx: temps/test.%.driver.ref.o temps/test.%.a.y.o temps/test.%.b.x.o - $(Verb) $(CC) $(CFLAGS) $(CC_CFLAGS) -O3 -o $@ $^ -.PRECIOUS: temps/test.%.yy -temps/test.%.yy: temps/test.%.driver.ref.o temps/test.%.a.y.o temps/test.%.b.y.o - $(Verb) $(CC) $(CFLAGS) $(CC_CFLAGS) -O3 -o $@ $^ - -# Object files - -.PRECIOUS: temps/test.%.ref.o -temps/test.%.ref.o: inputs/test.%.c temps/.dir - $(Verb) $(CC) -c $(CFLAGS) $(CC_CFLAGS) -o $@ $< -.PRECIOUS: temps/test.%.x.o -temps/test.%.x.o: inputs/test.%.c temps/.dir - $(Verb) $(X_COMPILER) -c $(CFLAGS) $(X_CFLAGS) -o $@ $< -.PRECIOUS: temps/test.%.y.o -temps/test.%.y.o: inputs/test.%.c temps/.dir - $(Verb) $(Y_COMPILER) -c $(CFLAGS) $(Y_CFLAGS) -o $@ $< - -.PRECIOUS: temps/test.%.x.defs -temps/test.%.x.defs: temps/test.%.a.x.ll temps/.dir - -$(Verb) -grep '^define ' $< > $@ -.PRECIOUS: temps/test.%.y.defs -temps/test.%.y.defs: temps/test.%.a.y.ll temps/.dir - -$(Verb) -grep '^define ' $< > $@ - -.PRECIOUS: temps/test.%.a.x.ll -temps/test.%.a.x.ll: inputs/test.%.a.c temps/.dir - $(Verb) $(X_COMPILER) $(CFLAGS) $(X_LL_CFLAGS) $(X_CFLAGS) -o $@ $< -.PRECIOUS: temps/test.%.b.x.ll -temps/test.%.b.x.ll: inputs/test.%.b.c temps/.dir - $(Verb) $(X_COMPILER) $(CFLAGS) $(X_LL_CFLAGS) $(X_CFLAGS) -o $@ $< -.PRECIOUS: temps/test.%.a.y.ll -temps/test.%.a.y.ll: inputs/test.%.a.c temps/.dir - $(Verb) $(Y_COMPILER) $(CFLAGS) $(Y_LL_CFLAGS) $(Y_CFLAGS) -o $@ $< -.PRECIOUS: temps/test.%.b.y.ll -temps/test.%.b.y.ll: inputs/test.%.b.c temps/.dir - $(Verb) $(Y_COMPILER) $(CFLAGS) $(Y_LL_CFLAGS) $(Y_CFLAGS) -o $@ $< - -# Input generation - -.PHONY: test.%.top -test.%.top: inputs/test.%.a.c inputs/test.%.b.c inputs/test.%.driver.c - @true - -.PRECIOUS: inputs/test.%.a.c inputs/test.%.b.c inputs/test.%.driver.c -inputs/test.%.a.c: test.%.generate - @true -inputs/test.%.b.c: test.%.generate - @true -inputs/test.%.driver.c: test.%.generate - @true - -.PHONY: test.%.generate -.PRECIOUS: inputs/.dir -test.%.generate: $(ABITESTGEN) inputs/.dir - $(Verb) $(ABITESTGEN) $(TESTARGS) -o inputs/test.$*.a.c -T inputs/test.$*.b.c -D inputs/test.$*.driver.c --min=$(shell expr $* '*' $(COUNT)) --count=$(COUNT) - -# Cleaning - -clean-temps: - $(Verb) rm -rf temps - -clean: - $(Verb) rm -rf temps inputs - -# Etc. - -%/.dir: - $(Verb) mkdir -p $* > /dev/null - $(Verb) $(DATE) > $@ diff --git a/contrib/llvm/tools/clang/utils/ABITest/TypeGen.py b/contrib/llvm/tools/clang/utils/ABITest/TypeGen.py deleted file mode 100644 index 40ea791eb515..000000000000 --- a/contrib/llvm/tools/clang/utils/ABITest/TypeGen.py +++ /dev/null @@ -1,462 +0,0 @@ -"""Flexible enumeration of C types.""" - -from Enumeration import * - -# TODO: - -# - struct improvements (flexible arrays, packed & -# unpacked, alignment) -# - objective-c qualified id -# - anonymous / transparent unions -# - VLAs -# - block types -# - K&R functions -# - pass arguments of different types (test extension, transparent union) -# - varargs - -### -# Actual type types - -class Type: - def isBitField(self): - return False - - def isPaddingBitField(self): - return False - -class BuiltinType(Type): - def __init__(self, name, size, bitFieldSize=None): - self.name = name - self.size = size - self.bitFieldSize = bitFieldSize - - def isBitField(self): - return self.bitFieldSize is not None - - def isPaddingBitField(self): - return self.bitFieldSize is 0 - - def getBitFieldSize(self): - assert self.isBitField() - return self.bitFieldSize - - def sizeof(self): - return self.size - - def __str__(self): - return self.name - -class EnumType(Type): - def __init__(self, index, enumerators): - self.index = index - self.enumerators = enumerators - - def getEnumerators(self): - result = '' - for i, init in enumerate(self.enumerators): - if i > 0: - result = result + ', ' - result = result + 'enum%dval%d' % (self.index, i) - if init: - result = result + ' = %s' % (init) - - return result - - def __str__(self): - return 'enum { %s }' % (self.getEnumerators()) - - def getTypedefDef(self, name, printer): - return 'typedef enum %s { %s } %s;'%(name, self.getEnumerators(), name) - -class RecordType(Type): - def __init__(self, index, isUnion, fields): - self.index = index - self.isUnion = isUnion - self.fields = fields - self.name = None - - def __str__(self): - def getField(t): - if t.isBitField(): - return "%s : %d;" % (t, t.getBitFieldSize()) - else: - return "%s;" % t - - return '%s { %s }'%(('struct','union')[self.isUnion], - ' '.join(map(getField, self.fields))) - - def getTypedefDef(self, name, printer): - def getField((i, t)): - if t.isBitField(): - if t.isPaddingBitField(): - return '%s : 0;'%(printer.getTypeName(t),) - else: - return '%s field%d : %d;'%(printer.getTypeName(t),i, - t.getBitFieldSize()) - else: - return '%s field%d;'%(printer.getTypeName(t),i) - fields = map(getField, enumerate(self.fields)) - # Name the struct for more readable LLVM IR. - return 'typedef %s %s { %s } %s;'%(('struct','union')[self.isUnion], - name, ' '.join(fields), name) - -class ArrayType(Type): - def __init__(self, index, isVector, elementType, size): - if isVector: - # Note that for vectors, this is the size in bytes. - assert size > 0 - else: - assert size is None or size >= 0 - self.index = index - self.isVector = isVector - self.elementType = elementType - self.size = size - if isVector: - eltSize = self.elementType.sizeof() - assert not (self.size % eltSize) - self.numElements = self.size // eltSize - else: - self.numElements = self.size - - def __str__(self): - if self.isVector: - return 'vector (%s)[%d]'%(self.elementType,self.size) - elif self.size is not None: - return '(%s)[%d]'%(self.elementType,self.size) - else: - return '(%s)[]'%(self.elementType,) - - def getTypedefDef(self, name, printer): - elementName = printer.getTypeName(self.elementType) - if self.isVector: - return 'typedef %s %s __attribute__ ((vector_size (%d)));'%(elementName, - name, - self.size) - else: - if self.size is None: - sizeStr = '' - else: - sizeStr = str(self.size) - return 'typedef %s %s[%s];'%(elementName, name, sizeStr) - -class ComplexType(Type): - def __init__(self, index, elementType): - self.index = index - self.elementType = elementType - - def __str__(self): - return '_Complex (%s)'%(self.elementType) - - def getTypedefDef(self, name, printer): - return 'typedef _Complex %s %s;'%(printer.getTypeName(self.elementType), name) - -class FunctionType(Type): - def __init__(self, index, returnType, argTypes): - self.index = index - self.returnType = returnType - self.argTypes = argTypes - - def __str__(self): - if self.returnType is None: - rt = 'void' - else: - rt = str(self.returnType) - if not self.argTypes: - at = 'void' - else: - at = ', '.join(map(str, self.argTypes)) - return '%s (*)(%s)'%(rt, at) - - def getTypedefDef(self, name, printer): - if self.returnType is None: - rt = 'void' - else: - rt = str(self.returnType) - if not self.argTypes: - at = 'void' - else: - at = ', '.join(map(str, self.argTypes)) - return 'typedef %s (*%s)(%s);'%(rt, name, at) - -### -# Type enumerators - -class TypeGenerator(object): - def __init__(self): - self.cache = {} - - def setCardinality(self): - abstract - - def get(self, N): - T = self.cache.get(N) - if T is None: - assert 0 <= N < self.cardinality - T = self.cache[N] = self.generateType(N) - return T - - def generateType(self, N): - abstract - -class FixedTypeGenerator(TypeGenerator): - def __init__(self, types): - TypeGenerator.__init__(self) - self.types = types - self.setCardinality() - - def setCardinality(self): - self.cardinality = len(self.types) - - def generateType(self, N): - return self.types[N] - -# Factorial -def fact(n): - result = 1 - while n > 0: - result = result * n - n = n - 1 - return result - -# Compute the number of combinations (n choose k) -def num_combinations(n, k): - return fact(n) / (fact(k) * fact(n - k)) - -# Enumerate the combinations choosing k elements from the list of values -def combinations(values, k): - # From ActiveState Recipe 190465: Generator for permutations, - # combinations, selections of a sequence - if k==0: yield [] - else: - for i in xrange(len(values)-k+1): - for cc in combinations(values[i+1:],k-1): - yield [values[i]]+cc - -class EnumTypeGenerator(TypeGenerator): - def __init__(self, values, minEnumerators, maxEnumerators): - TypeGenerator.__init__(self) - self.values = values - self.minEnumerators = minEnumerators - self.maxEnumerators = maxEnumerators - self.setCardinality() - - def setCardinality(self): - self.cardinality = 0 - for num in range(self.minEnumerators, self.maxEnumerators + 1): - self.cardinality += num_combinations(len(self.values), num) - - def generateType(self, n): - # Figure out the number of enumerators in this type - numEnumerators = self.minEnumerators - valuesCovered = 0 - while numEnumerators < self.maxEnumerators: - comb = num_combinations(len(self.values), numEnumerators) - if valuesCovered + comb > n: - break - numEnumerators = numEnumerators + 1 - valuesCovered += comb - - # Find the requested combination of enumerators and build a - # type from it. - i = 0 - for enumerators in combinations(self.values, numEnumerators): - if i == n - valuesCovered: - return EnumType(n, enumerators) - - i = i + 1 - - assert False - -class ComplexTypeGenerator(TypeGenerator): - def __init__(self, typeGen): - TypeGenerator.__init__(self) - self.typeGen = typeGen - self.setCardinality() - - def setCardinality(self): - self.cardinality = self.typeGen.cardinality - - def generateType(self, N): - return ComplexType(N, self.typeGen.get(N)) - -class VectorTypeGenerator(TypeGenerator): - def __init__(self, typeGen, sizes): - TypeGenerator.__init__(self) - self.typeGen = typeGen - self.sizes = tuple(map(int,sizes)) - self.setCardinality() - - def setCardinality(self): - self.cardinality = len(self.sizes)*self.typeGen.cardinality - - def generateType(self, N): - S,T = getNthPairBounded(N, len(self.sizes), self.typeGen.cardinality) - return ArrayType(N, True, self.typeGen.get(T), self.sizes[S]) - -class FixedArrayTypeGenerator(TypeGenerator): - def __init__(self, typeGen, sizes): - TypeGenerator.__init__(self) - self.typeGen = typeGen - self.sizes = tuple(size) - self.setCardinality() - - def setCardinality(self): - self.cardinality = len(self.sizes)*self.typeGen.cardinality - - def generateType(self, N): - S,T = getNthPairBounded(N, len(self.sizes), self.typeGen.cardinality) - return ArrayType(N, false, self.typeGen.get(T), self.sizes[S]) - -class ArrayTypeGenerator(TypeGenerator): - def __init__(self, typeGen, maxSize, useIncomplete=False, useZero=False): - TypeGenerator.__init__(self) - self.typeGen = typeGen - self.useIncomplete = useIncomplete - self.useZero = useZero - self.maxSize = int(maxSize) - self.W = useIncomplete + useZero + self.maxSize - self.setCardinality() - - def setCardinality(self): - self.cardinality = self.W * self.typeGen.cardinality - - def generateType(self, N): - S,T = getNthPairBounded(N, self.W, self.typeGen.cardinality) - if self.useIncomplete: - if S==0: - size = None - S = None - else: - S = S - 1 - if S is not None: - if self.useZero: - size = S - else: - size = S + 1 - return ArrayType(N, False, self.typeGen.get(T), size) - -class RecordTypeGenerator(TypeGenerator): - def __init__(self, typeGen, useUnion, maxSize): - TypeGenerator.__init__(self) - self.typeGen = typeGen - self.useUnion = bool(useUnion) - self.maxSize = int(maxSize) - self.setCardinality() - - def setCardinality(self): - M = 1 + self.useUnion - if self.maxSize is aleph0: - S = aleph0 * self.typeGen.cardinality - else: - S = 0 - for i in range(self.maxSize+1): - S += M * (self.typeGen.cardinality ** i) - self.cardinality = S - - def generateType(self, N): - isUnion,I = False,N - if self.useUnion: - isUnion,I = (I&1),I>>1 - fields = map(self.typeGen.get,getNthTuple(I,self.maxSize,self.typeGen.cardinality)) - return RecordType(N, isUnion, fields) - -class FunctionTypeGenerator(TypeGenerator): - def __init__(self, typeGen, useReturn, maxSize): - TypeGenerator.__init__(self) - self.typeGen = typeGen - self.useReturn = useReturn - self.maxSize = maxSize - self.setCardinality() - - def setCardinality(self): - if self.maxSize is aleph0: - S = aleph0 * self.typeGen.cardinality() - elif self.useReturn: - S = 0 - for i in range(1,self.maxSize+1+1): - S += self.typeGen.cardinality ** i - else: - S = 0 - for i in range(self.maxSize+1): - S += self.typeGen.cardinality ** i - self.cardinality = S - - def generateType(self, N): - if self.useReturn: - # Skip the empty tuple - argIndices = getNthTuple(N+1, self.maxSize+1, self.typeGen.cardinality) - retIndex,argIndices = argIndices[0],argIndices[1:] - retTy = self.typeGen.get(retIndex) - else: - retTy = None - argIndices = getNthTuple(N, self.maxSize, self.typeGen.cardinality) - args = map(self.typeGen.get, argIndices) - return FunctionType(N, retTy, args) - -class AnyTypeGenerator(TypeGenerator): - def __init__(self): - TypeGenerator.__init__(self) - self.generators = [] - self.bounds = [] - self.setCardinality() - self._cardinality = None - - def getCardinality(self): - if self._cardinality is None: - return aleph0 - else: - return self._cardinality - def setCardinality(self): - self.bounds = [g.cardinality for g in self.generators] - self._cardinality = sum(self.bounds) - cardinality = property(getCardinality, None) - - def addGenerator(self, g): - self.generators.append(g) - for i in range(100): - prev = self._cardinality - self._cardinality = None - for g in self.generators: - g.setCardinality() - self.setCardinality() - if (self._cardinality is aleph0) or prev==self._cardinality: - break - else: - raise RuntimeError,"Infinite loop in setting cardinality" - - def generateType(self, N): - index,M = getNthPairVariableBounds(N, self.bounds) - return self.generators[index].get(M) - -def test(): - fbtg = FixedTypeGenerator([BuiltinType('char', 4), - BuiltinType('char', 4, 0), - BuiltinType('int', 4, 5)]) - - fields1 = AnyTypeGenerator() - fields1.addGenerator( fbtg ) - - fields0 = AnyTypeGenerator() - fields0.addGenerator( fbtg ) -# fields0.addGenerator( RecordTypeGenerator(fields1, False, 4) ) - - btg = FixedTypeGenerator([BuiltinType('char', 4), - BuiltinType('int', 4)]) - etg = EnumTypeGenerator([None, '-1', '1', '1u'], 0, 3) - - atg = AnyTypeGenerator() - atg.addGenerator( btg ) - atg.addGenerator( RecordTypeGenerator(fields0, False, 4) ) - atg.addGenerator( etg ) - print 'Cardinality:',atg.cardinality - for i in range(100): - if i == atg.cardinality: - try: - atg.get(i) - raise RuntimeError,"Cardinality was wrong" - except AssertionError: - break - print '%4d: %s'%(i, atg.get(i)) - -if __name__ == '__main__': - test() diff --git a/contrib/llvm/tools/clang/utils/ABITest/build-and-summarize-all.sh b/contrib/llvm/tools/clang/utils/ABITest/build-and-summarize-all.sh deleted file mode 100755 index 23e34a4669b6..000000000000 --- a/contrib/llvm/tools/clang/utils/ABITest/build-and-summarize-all.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -set -eu - -if [ $# != 1 ]; then - echo "usage: $0 " - exit 1 -fi - -for bits in 32 64; do - for kind in return-types single-args; do - echo "-- $kind-$bits --" - (cd $kind-$bits && ../build-and-summarize.sh $1) - done -done diff --git a/contrib/llvm/tools/clang/utils/ABITest/build-and-summarize.sh b/contrib/llvm/tools/clang/utils/ABITest/build-and-summarize.sh deleted file mode 100755 index 602728b79f91..000000000000 --- a/contrib/llvm/tools/clang/utils/ABITest/build-and-summarize.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -set -eu - -if [ $# != 1 ]; then - echo "usage: $0 " - exit 1 -fi - -dir=$(dirname $0) -$dir/build.sh $1 &> /dev/null || true -../summarize.sh $1 &> fails-x.txt -cat fails-x.txt -wc -l fails-x.txt diff --git a/contrib/llvm/tools/clang/utils/ABITest/build.sh b/contrib/llvm/tools/clang/utils/ABITest/build.sh deleted file mode 100755 index a50d14ab8d06..000000000000 --- a/contrib/llvm/tools/clang/utils/ABITest/build.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -set -eu - -if [ $# != 1 ]; then - echo "usage: $0 " - exit 1 -fi - -CPUS=2 -make -j $CPUS \ - $(for i in $(seq 0 $1); do echo test.$i.report; done) -k diff --git a/contrib/llvm/tools/clang/utils/ABITest/layout/Makefile b/contrib/llvm/tools/clang/utils/ABITest/layout/Makefile deleted file mode 100644 index 0520625fcf29..000000000000 --- a/contrib/llvm/tools/clang/utils/ABITest/layout/Makefile +++ /dev/null @@ -1,68 +0,0 @@ -# Usage: make test.N.report -# -# COUNT can be over-ridden to change the number of tests generated per -# file, and TESTARGS is used to change the type generation. Make sure -# to 'make clean' after changing either of these parameters. - -ABITESTGEN := ../ABITestGen.py -TESTARGS := --max-args 0 --test-layout -COUNT := 1000 -TIMEOUT := 5 - -CFLAGS := -std=gnu99 - -X_COMPILER := llvm-gcc -Y_COMPILER := clang -CC := gcc - -ifeq (0, 0) -X_CFLAGS := -m32 -Y_CFLAGS := -m32 -CC_CFLAGS := -m32 -else -X_CFLAGS := -m64 -Y_CFLAGS := -m64 -CC_CFLAGS := -m64 -endif - -.PHONY: test.%.report -test.%.report: test.%.x.diff test.%.y.diff - @for t in $^; do \ - if [ -s $$t ]; then \ - echo "TEST $*: $$t failed"; \ - fi; \ - done - -.PHONY: test.%.build -test.%.build: test.%.ref test.%.x test.%.y - @true - -### - -.PRECIOUS: test.%.x.diff -test.%.x.diff: test.%.ref.out test.%.x.out - -diff $^ > $@ -.PRECIOUS: test.%.y.diff -test.%.y.diff: test.%.ref.out test.%.y.out - -diff $^ > $@ - -.PRECIOUS: test.%.out -test.%.out: test.% - -./$< > $@ - -.PRECIOUS: test.%.ref -test.%.ref: test.%.c - $(CC) $(CFLAGS) $(CC_CFLAGS) -o $@ $^ -.PRECIOUS: test.%.x -test.%.x: test.%.c - $(X_COMPILER) $(CFLAGS) $(X_CFLAGS) -o $@ $^ -.PRECIOUS: test.%.y -test.%.y: test.%.c - $(Y_COMPILER) $(CFLAGS) $(Y_CFLAGS) -o $@ $^ - -.PRECIOUS: test.%.c -test.%.c: $(ABITESTGEN) - $(ABITESTGEN) $(TESTARGS) -o $@ --min=$(shell expr $* '*' $(COUNT)) --count=$(COUNT) - -clean: - rm -f test.* *~ diff --git a/contrib/llvm/tools/clang/utils/ABITest/return-types-32/Makefile b/contrib/llvm/tools/clang/utils/ABITest/return-types-32/Makefile deleted file mode 100644 index df1c53f1a166..000000000000 --- a/contrib/llvm/tools/clang/utils/ABITest/return-types-32/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -X_CFLAGS := -m32 -Y_CFLAGS := -m32 -CC_CFLAGS := -m32 - -include ../Makefile.test.common - -TESTARGS += --max-args 0 diff --git a/contrib/llvm/tools/clang/utils/ABITest/return-types-64/Makefile b/contrib/llvm/tools/clang/utils/ABITest/return-types-64/Makefile deleted file mode 100644 index 9616e45cba94..000000000000 --- a/contrib/llvm/tools/clang/utils/ABITest/return-types-64/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -X_CFLAGS := -m64 -Y_CFLAGS := -m64 -CC_CFLAGS := -m64 - -include ../Makefile.test.common - -TESTARGS += --max-args 0 diff --git a/contrib/llvm/tools/clang/utils/ABITest/single-args-32/Makefile b/contrib/llvm/tools/clang/utils/ABITest/single-args-32/Makefile deleted file mode 100644 index 9ff417fc29e5..000000000000 --- a/contrib/llvm/tools/clang/utils/ABITest/single-args-32/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -X_CFLAGS := -m32 -Y_CFLAGS := -m32 -CC_CFLAGS := -m32 - -include ../Makefile.test.common - -TESTARGS += --no-function-return --max-args 1 diff --git a/contrib/llvm/tools/clang/utils/ABITest/single-args-64/Makefile b/contrib/llvm/tools/clang/utils/ABITest/single-args-64/Makefile deleted file mode 100644 index b8acb70c1354..000000000000 --- a/contrib/llvm/tools/clang/utils/ABITest/single-args-64/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -# Usage: make test.N.report -# -# COUNT can be over-ridden to change the number of tests generated per -# file, and TESTARGS is used to change the type generation. Make sure -# to 'make clean' after changing either of these parameters. - -X_CFLAGS := -m64 -Y_CFLAGS := -m64 -CC_CFLAGS := -m64 - -include ../Makefile.test.common - -TESTARGS += --no-function-return --max-args 1 diff --git a/contrib/llvm/tools/clang/utils/ABITest/summarize.sh b/contrib/llvm/tools/clang/utils/ABITest/summarize.sh deleted file mode 100755 index 3efb52bf7227..000000000000 --- a/contrib/llvm/tools/clang/utils/ABITest/summarize.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -set -eu - -if [ $# != 1 ]; then - echo "usage: $0 " - exit 1 -fi - -for i in $(seq 0 $1); do - if (! make test.$i.report &> /dev/null); then - echo "FAIL: $i"; - fi; -done - diff --git a/contrib/llvm/tools/clang/utils/C++Tests/Clang-Code-Compile/lit.local.cfg b/contrib/llvm/tools/clang/utils/C++Tests/Clang-Code-Compile/lit.local.cfg deleted file mode 100644 index 59d346665cbe..000000000000 --- a/contrib/llvm/tools/clang/utils/C++Tests/Clang-Code-Compile/lit.local.cfg +++ /dev/null @@ -1,26 +0,0 @@ -# -*- Python -*- - -# Configuration file for the 'lit' test runner. - -def getRoot(config): - if not config.parent: - return config - return getRoot(config.parent) - -root = getRoot(config) - -# testFormat: The test format to use to interpret tests. -cxxflags = ['-D__STDC_LIMIT_MACROS', - '-D__STDC_CONSTANT_MACROS', - '-Wno-sign-compare', - '-I%s/include' % root.llvm_src_root, - '-I%s/include' % root.llvm_obj_root, - '-I%s/tools/clang/include' % root.llvm_src_root, - '-I%s/tools/clang/include' % root.llvm_obj_root] -config.test_format = \ - lit.formats.OneCommandPerFileTest(command=[root.clang, '-emit-llvm', '-c', - '-o', '/dev/null'] + cxxflags, - dir='%s/tools/clang/lib' % root.llvm_src_root, - recursive=True, - pattern='^(.*\\.cpp)$') - diff --git a/contrib/llvm/tools/clang/utils/C++Tests/Clang-Code-Syntax/lit.local.cfg b/contrib/llvm/tools/clang/utils/C++Tests/Clang-Code-Syntax/lit.local.cfg deleted file mode 100644 index 8f00c8df739e..000000000000 --- a/contrib/llvm/tools/clang/utils/C++Tests/Clang-Code-Syntax/lit.local.cfg +++ /dev/null @@ -1,25 +0,0 @@ -# -*- Python -*- - -# Configuration file for the 'lit' test runner. - -def getRoot(config): - if not config.parent: - return config - return getRoot(config.parent) - -root = getRoot(config) - -# testFormat: The test format to use to interpret tests. -cxxflags = ['-D__STDC_LIMIT_MACROS', - '-D__STDC_CONSTANT_MACROS', - '-Wno-sign-compare', - '-I%s/include' % root.llvm_src_root, - '-I%s/include' % root.llvm_obj_root, - '-I%s/tools/clang/include' % root.llvm_src_root, - '-I%s/tools/clang/include' % root.llvm_obj_root] -config.test_format = \ - lit.formats.OneCommandPerFileTest(command=[root.clang, - '-fsyntax-only'] + cxxflags, - dir='%s/tools/clang/lib' % root.llvm_src_root, - recursive=True, - pattern='^(.*\\.cpp)$') diff --git a/contrib/llvm/tools/clang/utils/C++Tests/Clang-Syntax/lit.local.cfg b/contrib/llvm/tools/clang/utils/C++Tests/Clang-Syntax/lit.local.cfg deleted file mode 100644 index 89fdd8e15997..000000000000 --- a/contrib/llvm/tools/clang/utils/C++Tests/Clang-Syntax/lit.local.cfg +++ /dev/null @@ -1,24 +0,0 @@ -# -*- Python -*- - -# Configuration file for the 'lit' test runner. - -def getRoot(config): - if not config.parent: - return config - return getRoot(config.parent) - -root = getRoot(config) - -# testFormat: The test format to use to interpret tests. -config.test_format = lit.formats.SyntaxCheckTest(compiler=root.clang, - dir='%s/tools/clang/include/clang' % root.llvm_src_root, - recursive=True, - pattern='^(.*\\.h)$', - extra_cxx_args=['-D__STDC_LIMIT_MACROS', - '-D__STDC_CONSTANT_MACROS', - '-Wno-sign-compare', - '-Werror', - '-I%s/include' % root.llvm_src_root, - '-I%s/include' % root.llvm_obj_root, - '-I%s/tools/clang/include' % root.llvm_src_root, - '-I%s/tools/clang/include' % root.llvm_obj_root]) diff --git a/contrib/llvm/tools/clang/utils/C++Tests/LLVM-Code-Compile/lit.local.cfg b/contrib/llvm/tools/clang/utils/C++Tests/LLVM-Code-Compile/lit.local.cfg deleted file mode 100644 index 6676e311e3ec..000000000000 --- a/contrib/llvm/tools/clang/utils/C++Tests/LLVM-Code-Compile/lit.local.cfg +++ /dev/null @@ -1,56 +0,0 @@ -# -*- Python -*- - -# Configuration file for the 'lit' test runner. - -def getRoot(config): - if not config.parent: - return config - return getRoot(config.parent) - -root = getRoot(config) - -# testFormat: The test format to use to interpret tests. -target_obj_root = root.llvm_obj_root -cxxflags = ['-D__STDC_LIMIT_MACROS', - '-D__STDC_CONSTANT_MACROS', - '-Wno-sign-compare', - '-I%s/include' % root.llvm_src_root, - '-I%s/include' % root.llvm_obj_root, - '-I%s/lib/Target/Alpha' % root.llvm_src_root, - '-I%s/lib/Target/ARM' % root.llvm_src_root, - '-I%s/lib/Target/Blackfin' % root.llvm_src_root, - '-I%s/lib/Target/CBackend' % root.llvm_src_root, - '-I%s/lib/Target/CellSPU' % root.llvm_src_root, - '-I%s/lib/Target/CppBackend' % root.llvm_src_root, - '-I%s/lib/Target/Mips' % root.llvm_src_root, - '-I%s/lib/Target/MSIL' % root.llvm_src_root, - '-I%s/lib/Target/MSP430' % root.llvm_src_root, - '-I%s/lib/Target/PIC16' % root.llvm_src_root, - '-I%s/lib/Target/PowerPC' % root.llvm_src_root, - '-I%s/lib/Target/Sparc' % root.llvm_src_root, - '-I%s/lib/Target/SystemZ' % root.llvm_src_root, - '-I%s/lib/Target/X86' % root.llvm_src_root, - '-I%s/lib/Target/XCore' % root.llvm_src_root, - '-I%s/lib/Target/Alpha' % target_obj_root, - '-I%s/lib/Target/ARM' % target_obj_root, - '-I%s/lib/Target/Blackfin' % target_obj_root, - '-I%s/lib/Target/CBackend' % target_obj_root, - '-I%s/lib/Target/CellSPU' % target_obj_root, - '-I%s/lib/Target/CppBackend' % target_obj_root, - '-I%s/lib/Target/Mips' % target_obj_root, - '-I%s/lib/Target/MSIL' % target_obj_root, - '-I%s/lib/Target/MSP430' % target_obj_root, - '-I%s/lib/Target/PIC16' % target_obj_root, - '-I%s/lib/Target/PowerPC' % target_obj_root, - '-I%s/lib/Target/Sparc' % target_obj_root, - '-I%s/lib/Target/SystemZ' % target_obj_root, - '-I%s/lib/Target/X86' % target_obj_root, - '-I%s/lib/Target/XCore' % target_obj_root]; - -config.test_format = \ - lit.formats.OneCommandPerFileTest(command=[root.clang, '-emit-llvm', '-c', - '-o', '/dev/null'] + cxxflags, - dir='%s/lib' % root.llvm_src_root, - recursive=True, - pattern='^(.*\\.cpp)$') - diff --git a/contrib/llvm/tools/clang/utils/C++Tests/LLVM-Code-Symbols/check-symbols b/contrib/llvm/tools/clang/utils/C++Tests/LLVM-Code-Symbols/check-symbols deleted file mode 100755 index cd54eed4a0d0..000000000000 --- a/contrib/llvm/tools/clang/utils/C++Tests/LLVM-Code-Symbols/check-symbols +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python - -import subprocess -import difflib - -def capture_2(args0, args1): - import subprocess - p0 = subprocess.Popen(args0, stdin=None, stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - p1 = subprocess.Popen(args1, stdin=p0.stdout, stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - out,_ = p1.communicate() - return out - -def normalize_nm(data): - lines = data.split('\n') - lines.sort() - - # FIXME: Ignore common symbols for now. - lines = [ln for ln in lines - if not ln.startswith(' C')] - - return lines - -def main(): - import sys - clang = sys.argv[1] - flags = sys.argv[2:] - - # FIXME: Relax to include undefined symbols. - nm_args = ["llvm-nm", "-extern-only", "-defined-only"] - - llvmgcc_args = ["llvm-gcc"] + flags + ["-emit-llvm","-c","-o","-"] - clang_args = [clang] + flags + ["-emit-llvm","-c","-o","-"] - - llvmgcc_nm = capture_2(llvmgcc_args, nm_args) - clang_nm = capture_2(clang_args, nm_args) - - llvmgcc_nm = normalize_nm(llvmgcc_nm) - clang_nm = normalize_nm(clang_nm) - - if llvmgcc_nm == clang_nm: - sys.exit(0) - - print ' '.join(llvmgcc_args), '|', ' '.join(nm_args) - print ' '.join(clang_args), '|', ' '.join(nm_args) - for line in difflib.unified_diff(llvmgcc_nm, clang_nm, - fromfile="llvm-gcc symbols", - tofile="clang symbols"): - print line - sys.exit(1) - -if __name__ == '__main__': - main() diff --git a/contrib/llvm/tools/clang/utils/C++Tests/LLVM-Code-Symbols/lit.local.cfg b/contrib/llvm/tools/clang/utils/C++Tests/LLVM-Code-Symbols/lit.local.cfg deleted file mode 100644 index c328a25127d9..000000000000 --- a/contrib/llvm/tools/clang/utils/C++Tests/LLVM-Code-Symbols/lit.local.cfg +++ /dev/null @@ -1,56 +0,0 @@ -# -*- Python -*- - -# Configuration file for the 'lit' test runner. - -def getRoot(config): - if not config.parent: - return config - return getRoot(config.parent) - -root = getRoot(config) - -# testFormat: The test format to use to interpret tests. -target_obj_root = root.llvm_obj_root -cxxflags = ['-D__STDC_LIMIT_MACROS', - '-D__STDC_CONSTANT_MACROS', - '-Wno-sign-compare', - '-I%s/include' % root.llvm_src_root, - '-I%s/include' % root.llvm_obj_root, - '-I%s/lib/Target/Alpha' % root.llvm_src_root, - '-I%s/lib/Target/ARM' % root.llvm_src_root, - '-I%s/lib/Target/Blackfin' % root.llvm_src_root, - '-I%s/lib/Target/CBackend' % root.llvm_src_root, - '-I%s/lib/Target/CellSPU' % root.llvm_src_root, - '-I%s/lib/Target/CppBackend' % root.llvm_src_root, - '-I%s/lib/Target/Mips' % root.llvm_src_root, - '-I%s/lib/Target/MSIL' % root.llvm_src_root, - '-I%s/lib/Target/MSP430' % root.llvm_src_root, - '-I%s/lib/Target/PIC16' % root.llvm_src_root, - '-I%s/lib/Target/PowerPC' % root.llvm_src_root, - '-I%s/lib/Target/Sparc' % root.llvm_src_root, - '-I%s/lib/Target/SystemZ' % root.llvm_src_root, - '-I%s/lib/Target/X86' % root.llvm_src_root, - '-I%s/lib/Target/XCore' % root.llvm_src_root, - '-I%s/lib/Target/Alpha' % target_obj_root, - '-I%s/lib/Target/ARM' % target_obj_root, - '-I%s/lib/Target/Blackfin' % target_obj_root, - '-I%s/lib/Target/CBackend' % target_obj_root, - '-I%s/lib/Target/CellSPU' % target_obj_root, - '-I%s/lib/Target/CppBackend' % target_obj_root, - '-I%s/lib/Target/Mips' % target_obj_root, - '-I%s/lib/Target/MSIL' % target_obj_root, - '-I%s/lib/Target/MSP430' % target_obj_root, - '-I%s/lib/Target/PIC16' % target_obj_root, - '-I%s/lib/Target/PowerPC' % target_obj_root, - '-I%s/lib/Target/Sparc' % target_obj_root, - '-I%s/lib/Target/SystemZ' % target_obj_root, - '-I%s/lib/Target/X86' % target_obj_root, - '-I%s/lib/Target/XCore' % target_obj_root]; - -kScript = os.path.join(os.path.dirname(__file__), "check-symbols") -config.test_format = \ - lit.formats.OneCommandPerFileTest(command=[kScript, root.clang] + cxxflags, - dir='%s/lib' % root.llvm_src_root, - recursive=True, - pattern='^(.*\\.cpp)$') - diff --git a/contrib/llvm/tools/clang/utils/C++Tests/LLVM-Code-Syntax/lit.local.cfg b/contrib/llvm/tools/clang/utils/C++Tests/LLVM-Code-Syntax/lit.local.cfg deleted file mode 100644 index 6e679659c44c..000000000000 --- a/contrib/llvm/tools/clang/utils/C++Tests/LLVM-Code-Syntax/lit.local.cfg +++ /dev/null @@ -1,54 +0,0 @@ -# -*- Python -*- - -# Configuration file for the 'lit' test runner. - -def getRoot(config): - if not config.parent: - return config - return getRoot(config.parent) - -root = getRoot(config) - -# testFormat: The test format to use to interpret tests. -target_obj_root = root.llvm_obj_root -cxxflags = ['-D__STDC_LIMIT_MACROS', - '-D__STDC_CONSTANT_MACROS', - '-I%s/include' % root.llvm_src_root, - '-I%s/include' % root.llvm_obj_root, - '-I%s/lib/Target/Alpha' % root.llvm_src_root, - '-I%s/lib/Target/ARM' % root.llvm_src_root, - '-I%s/lib/Target/Blackfin' % root.llvm_src_root, - '-I%s/lib/Target/CBackend' % root.llvm_src_root, - '-I%s/lib/Target/CellSPU' % root.llvm_src_root, - '-I%s/lib/Target/CppBackend' % root.llvm_src_root, - '-I%s/lib/Target/Mips' % root.llvm_src_root, - '-I%s/lib/Target/MSIL' % root.llvm_src_root, - '-I%s/lib/Target/MSP430' % root.llvm_src_root, - '-I%s/lib/Target/PIC16' % root.llvm_src_root, - '-I%s/lib/Target/PowerPC' % root.llvm_src_root, - '-I%s/lib/Target/Sparc' % root.llvm_src_root, - '-I%s/lib/Target/SystemZ' % root.llvm_src_root, - '-I%s/lib/Target/X86' % root.llvm_src_root, - '-I%s/lib/Target/XCore' % root.llvm_src_root, - '-I%s/lib/Target/Alpha' % target_obj_root, - '-I%s/lib/Target/ARM' % target_obj_root, - '-I%s/lib/Target/Blackfin' % target_obj_root, - '-I%s/lib/Target/CBackend' % target_obj_root, - '-I%s/lib/Target/CellSPU' % target_obj_root, - '-I%s/lib/Target/CppBackend' % target_obj_root, - '-I%s/lib/Target/Mips' % target_obj_root, - '-I%s/lib/Target/MSIL' % target_obj_root, - '-I%s/lib/Target/MSP430' % target_obj_root, - '-I%s/lib/Target/PIC16' % target_obj_root, - '-I%s/lib/Target/PowerPC' % target_obj_root, - '-I%s/lib/Target/Sparc' % target_obj_root, - '-I%s/lib/Target/SystemZ' % target_obj_root, - '-I%s/lib/Target/X86' % target_obj_root, - '-I%s/lib/Target/XCore' % target_obj_root]; - -config.test_format = \ - lit.formats.OneCommandPerFileTest(command=[root.clang, - '-fsyntax-only'] + cxxflags, - dir='%s/lib' % root.llvm_src_root, - recursive=True, - pattern='^(.*\\.cpp)$') diff --git a/contrib/llvm/tools/clang/utils/C++Tests/LLVM-Syntax/lit.local.cfg b/contrib/llvm/tools/clang/utils/C++Tests/LLVM-Syntax/lit.local.cfg deleted file mode 100644 index cb0e566a7fd7..000000000000 --- a/contrib/llvm/tools/clang/utils/C++Tests/LLVM-Syntax/lit.local.cfg +++ /dev/null @@ -1,24 +0,0 @@ -# -*- Python -*- - -# Configuration file for the 'lit' test runner. - -def getRoot(config): - if not config.parent: - return config - return getRoot(config.parent) - -root = getRoot(config) - -# testFormat: The test format to use to interpret tests. -config.test_format = lit.formats.SyntaxCheckTest(compiler=root.clang, - dir='%s/include/llvm' % root.llvm_src_root, - recursive=True, - pattern='^(.*\\.h|[^.]*)$', - extra_cxx_args=['-D__STDC_LIMIT_MACROS', - '-D__STDC_CONSTANT_MACROS', - '-Werror', - '-I%s/include' % root.llvm_src_root, - '-I%s/include' % root.llvm_obj_root]) - -config.excludes = ['AbstractTypeUser.h', 'DAGISelHeader.h', - 'AIXDataTypesFix.h', 'Solaris.h'] diff --git a/contrib/llvm/tools/clang/utils/C++Tests/lit.cfg b/contrib/llvm/tools/clang/utils/C++Tests/lit.cfg deleted file mode 100644 index 274ca103f4ae..000000000000 --- a/contrib/llvm/tools/clang/utils/C++Tests/lit.cfg +++ /dev/null @@ -1,27 +0,0 @@ -# -*- Python -*- - -# Configuration file for the 'lit' test runner. - -# Load the main clang test config so we can leech its clang finding logic. -lit.load_config(config, os.path.join(os.path.dirname(__file__), - '..', '..', 'test', 'lit.cfg')) -assert config.clang, "Failed to set clang!?" - -# name: The name of this test suite. -config.name = 'Clang++' - -# suffixes: A list of file extensions to treat as test files, this is actually -# set by on_clone(). -config.suffixes = [] - -# Reset these from the Clang config. -config.test_source_root = config.test_exec_root = None - -# Don't run Clang and LLVM code checks by default. -config.excludes = [] -if not lit.params.get('run_clang_all'): - config.excludes.append('Clang-Code-Syntax') - config.excludes.append('Clang-Code-Compile') - config.excludes.append('LLVM-Code-Syntax') - config.excludes.append('LLVM-Code-Compile') - config.excludes.append('LLVM-Code-Symbols') diff --git a/contrib/llvm/tools/clang/utils/C++Tests/stdc++-Syntax/lit.local.cfg b/contrib/llvm/tools/clang/utils/C++Tests/stdc++-Syntax/lit.local.cfg deleted file mode 100644 index eb04866e340b..000000000000 --- a/contrib/llvm/tools/clang/utils/C++Tests/stdc++-Syntax/lit.local.cfg +++ /dev/null @@ -1,17 +0,0 @@ -# -*- Python -*- - -# Configuration file for the 'lit' test runner. - -def getRoot(config): - if not config.parent: - return config - return getRoot(config.parent) - -root = getRoot(config) - -# testFormat: The test format to use to interpret tests. -config.test_format = lit.formats.SyntaxCheckTest(compiler=root.clang, - dir='/usr/include/c++/4.2.1', - recursive=False, - pattern='^(.*\\.h|[^.]*)$') - diff --git a/contrib/llvm/tools/clang/utils/CIndex/completion_logger_server.py b/contrib/llvm/tools/clang/utils/CIndex/completion_logger_server.py deleted file mode 100755 index 0652b1f4a8ee..000000000000 --- a/contrib/llvm/tools/clang/utils/CIndex/completion_logger_server.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python -import sys -from socket import * -from time import strftime -import datetime - -def main(): - if len(sys.argv) < 4: - print "completion_logger_server.py " - exit(1) - - host = sys.argv[1] - port = int(sys.argv[2]) - buf = 1024 * 8 - addr = (host,port) - - # Create socket and bind to address - UDPSock = socket(AF_INET,SOCK_DGRAM) - UDPSock.bind(addr) - - print "Listing on {0}:{1} and logging to '{2}'".format(host, port, sys.argv[3]) - - # Open the logging file. - f = open(sys.argv[3], "a") - - # Receive messages - while 1: - data,addr = UDPSock.recvfrom(buf) - if not data: - break - else: - f.write("{ "); - f.write("\"time\": \"{0}\"".format(datetime.datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S'))) - f.write(", \"sender\": \"{0}\" ".format(addr[0])) - f.write(", \"data\": ") - f.write(data) - f.write(" }\n") - f.flush() - - # Close socket - UDPSock.close() - -if __name__ == '__main__': - main() diff --git a/contrib/llvm/tools/clang/utils/CaptureCmd b/contrib/llvm/tools/clang/utils/CaptureCmd deleted file mode 100755 index 705585c3bb04..000000000000 --- a/contrib/llvm/tools/clang/utils/CaptureCmd +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env python - -"""CaptureCmd - A generic tool for capturing information about the -invocations of another program. - -Usage --- -1. Move the original tool to a safe known location. - -2. Link CaptureCmd to the original tool's location. - -3. Define CAPTURE_CMD_PROGRAM to the known location of the original -tool; this must be an absolute path. - -4. Define CAPTURE_CMD_DIR to a directory to write invocation -information to. -""" - -import hashlib -import os -import sys -import time - -def saveCaptureData(prefix, dir, object): - string = repr(object) + '\n' - key = hashlib.sha1(string).hexdigest() - path = os.path.join(dir, - prefix + key) - if not os.path.exists(path): - f = open(path, 'wb') - f.write(string) - f.close() - return prefix + key - -def main(): - program = os.getenv('CAPTURE_CMD_PROGRAM') - dir = os.getenv('CAPTURE_CMD_DIR') - fallback = os.getenv('CAPTURE_CMD_FALLBACK') - if not program: - raise ValueError('CAPTURE_CMD_PROGRAM is not defined!') - if not dir: - raise ValueError('CAPTURE_CMD_DIR is not defined!') - - # Make the output directory if it doesn't already exist. - if not os.path.exists(dir): - os.mkdir(dir, 0700) - - # Get keys for various data. - env = os.environ.items() - env.sort() - envKey = saveCaptureData('env-', dir, env) - cwdKey = saveCaptureData('cwd-', dir, os.getcwd()) - argvKey = saveCaptureData('argv-', dir, sys.argv) - entry = (time.time(), envKey, cwdKey, argvKey) - saveCaptureData('cmd-', dir, entry) - - if fallback: - pid = os.fork() - if not pid: - os.execv(program, sys.argv) - os._exit(1) - else: - res = os.waitpid(pid, 0) - if not res: - os.execv(fallback, sys.argv) - os._exit(1) - os._exit(res) - else: - os.execv(program, sys.argv) - os._exit(1) - -if __name__ == '__main__': - main() diff --git a/contrib/llvm/tools/clang/utils/CmpDriver b/contrib/llvm/tools/clang/utils/CmpDriver deleted file mode 100755 index 16b108117d3e..000000000000 --- a/contrib/llvm/tools/clang/utils/CmpDriver +++ /dev/null @@ -1,210 +0,0 @@ -#!/usr/bin/env python - -import subprocess - -def splitArgs(s): - it = iter(s) - current = '' - inQuote = False - for c in it: - if c == '"': - if inQuote: - inQuote = False - yield current + '"' - else: - inQuote = True - current = '"' - elif inQuote: - if c == '\\': - current += c - current += it.next() - else: - current += c - elif not c.isspace(): - yield c - -def insertMinimumPadding(a, b, dist): - """insertMinimumPadding(a,b) -> (a',b') - - Return two lists of equal length, where some number of Nones have - been inserted into the shorter list such that sum(map(dist, a', - b')) is minimized. - - Assumes dist(X, Y) -> int and non-negative. - """ - - def cost(a, b): - return sum(map(dist, a + [None] * (len(b) - len(a)), b)) - - # Normalize so a is shortest. - if len(b) < len(a): - b, a = insertMinimumPadding(b, a, dist) - return a,b - - # For each None we have to insert... - for i in range(len(b) - len(a)): - # For each position we could insert it... - current = cost(a, b) - best = None - for j in range(len(a) + 1): - a_0 = a[:j] + [None] + a[j:] - candidate = cost(a_0, b) - if best is None or candidate < best[0]: - best = (candidate, a_0, j) - a = best[1] - return a,b - -class ZipperDiff(object): - """ZipperDiff - Simple (slow) diff only accomodating inserts.""" - - def __init__(self, a, b): - self.a = a - self.b = b - - def dist(self, a, b): - return a != b - - def getDiffs(self): - a,b = insertMinimumPadding(self.a, self.b, self.dist) - for aElt,bElt in zip(a,b): - if self.dist(aElt, bElt): - yield aElt,bElt - -class DriverZipperDiff(ZipperDiff): - def isTempFile(self, filename): - if filename[0] != '"' or filename[-1] != '"': - return False - return (filename.startswith('/tmp/', 1) or - filename.startswith('/var/', 1)) - - def dist(self, a, b): - if a and b and self.isTempFile(a) and self.isTempFile(b): - return 0 - return super(DriverZipperDiff, self).dist(a,b) - -class CompileInfo: - def __init__(self, out, err, res): - self.commands = [] - - # Standard out isn't used for much. - self.stdout = out - self.stderr = '' - - # FIXME: Compare error messages as well. - for ln in err.split('\n'): - if (ln == 'Using built-in specs.' or - ln.startswith('Target: ') or - ln.startswith('Configured with: ') or - ln.startswith('Thread model: ') or - ln.startswith('gcc version') or - ln.startswith('clang version')): - pass - elif ln.strip().startswith('"'): - self.commands.append(list(splitArgs(ln))) - else: - self.stderr += ln + '\n' - - self.stderr = self.stderr.strip() - self.exitCode = res - -def captureDriverInfo(cmd, args): - p = subprocess.Popen([cmd,'-###'] + args, - stdin=None, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - out,err = p.communicate() - res = p.wait() - return CompileInfo(out,err,res) - -def main(): - import os, sys - - args = sys.argv[1:] - driverA = os.getenv('DRIVER_A') or 'gcc' - driverB = os.getenv('DRIVER_B') or 'clang' - - infoA = captureDriverInfo(driverA, args) - infoB = captureDriverInfo(driverB, args) - - differ = False - - # Compare stdout. - if infoA.stdout != infoB.stdout: - print '-- STDOUT DIFFERS -' - print 'A OUTPUT: ',infoA.stdout - print 'B OUTPUT: ',infoB.stdout - print - - diff = ZipperDiff(infoA.stdout.split('\n'), - infoB.stdout.split('\n')) - for i,(aElt,bElt) in enumerate(diff.getDiffs()): - if aElt is None: - print 'A missing: %s' % bElt - elif bElt is None: - print 'B missing: %s' % aElt - else: - print 'mismatch: A: %s' % aElt - print ' B: %s' % bElt - - differ = True - - # Compare stderr. - if infoA.stderr != infoB.stderr: - print '-- STDERR DIFFERS -' - print 'A STDERR: ',infoA.stderr - print 'B STDERR: ',infoB.stderr - print - - diff = ZipperDiff(infoA.stderr.split('\n'), - infoB.stderr.split('\n')) - for i,(aElt,bElt) in enumerate(diff.getDiffs()): - if aElt is None: - print 'A missing: %s' % bElt - elif bElt is None: - print 'B missing: %s' % aElt - else: - print 'mismatch: A: %s' % aElt - print ' B: %s' % bElt - - differ = True - - # Compare commands. - for i,(a,b) in enumerate(map(None, infoA.commands, infoB.commands)): - if a is None: - print 'A MISSING:',' '.join(b) - differ = True - continue - elif b is None: - print 'B MISSING:',' '.join(a) - differ = True - continue - - diff = DriverZipperDiff(a,b) - diffs = list(diff.getDiffs()) - if diffs: - print '-- COMMAND %d DIFFERS -' % i - print 'A COMMAND:',' '.join(a) - print 'B COMMAND:',' '.join(b) - print - for i,(aElt,bElt) in enumerate(diffs): - if aElt is None: - print 'A missing: %s' % bElt - elif bElt is None: - print 'B missing: %s' % aElt - else: - print 'mismatch: A: %s' % aElt - print ' B: %s' % bElt - differ = True - - # Compare result codes. - if infoA.exitCode != infoB.exitCode: - print '-- EXIT CODES DIFFER -' - print 'A: ',infoA.exitCode - print 'B: ',infoB.exitCode - differ = True - - if differ: - sys.exit(1) - -if __name__ == '__main__': - main() diff --git a/contrib/llvm/tools/clang/utils/FindSpecRefs b/contrib/llvm/tools/clang/utils/FindSpecRefs deleted file mode 100755 index 9097f93f28d6..000000000000 --- a/contrib/llvm/tools/clang/utils/FindSpecRefs +++ /dev/null @@ -1,910 +0,0 @@ -#!/usr/bin/env python - -import os -import re -import time -from pprint import pprint - -### - -c99URL = 'http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf' -c99TOC = [('Foreword', 'xi'), -('Introduction', 'xiv'), -('1. Scope', '1'), -('2. Normative references', '2'), -('3. Terms, definitions, and symbols', '3'), -('4. Conformance', '7'), -('5. Environment', '9'), -('5.1 Conceptual models', '9'), -('5.1.1 Translation environment', '9'), -('5.1.2 Execution environments', '11'), -('5.2 Environmental considerations', '17'), -('5.2.1 Character sets', '17'), -('5.2.2 Character display semantics', '19'), -('5.2.3 Signals and interrupts', '20'), -('5.2.4 Environmental limits', '20'), -('6. Language', '29'), -('6.1 Notation', '29'), -('6.2 Concepts', '29'), -('6.2.1 Scopes of identifiers', '29'), -('6.2.2 Linkages of identifiers', '30'), -('6.2.3 Name spaces of identifiers', '31'), -('6.2.4 Storage durations of objects', '32'), -('6.2.5 Types', '33'), -('6.2.6 Representations of types', '37'), -('6.2.7 Compatible type and composite type', '40'), -('6.3 Conversions', '42'), -('6.3.1 Arithmetic operands', '42'), -('6.3.2 Other operands', '46'), -('6.4 Lexical elements', '49'), -('6.4.1 Keywords', '50'), -('6.4.2 Identifiers', '51'), -('6.4.3 Universal character names', '53'), -('6.4.4 Constants', '54'), -('6.4.5 String literals', '62'), -('6.4.6 Punctuators', '63'), -('6.4.7 Header names', '64'), -('6.4.8 Preprocessing numbers', '65'), -('6.4.9 Comments', '66'), -('6.5 Expressions', '67'), -('6.5.1 Primary expressions', '69'), -('6.5.2 Postfix operators', '69'), -('6.5.3 Unary operators', '78'), -('6.5.4 Cast operators', '81'), -('6.5.5 Multiplicative operators', '82'), -('6.5.6 Additive operators', '82'), -('6.5.7 Bitwise shift operators', '84'), -('6.5.8 Relational operators', '85'), -('6.5.9 Equality operators', '86'), -('6.5.10 Bitwise AND operator', '87'), -('6.5.11 Bitwise exclusive OR operator', '88'), -('6.5.12 Bitwise inclusive OR operator', '88'), -('6.5.13 Logical AND operator', '89'), -('6.5.14 Logical OR operator', '89'), -('6.5.15 Conditional operator', '90'), -('6.5.16 Assignment operators', '91'), -('6.5.17 Comma operator', '94'), -('6.6 Constant expressions', '95'), -('6.7 Declarations', '97'), -('6.7.1 Storage-class specifiers', '98'), -('6.7.2 Type specifiers', '99'), -('6.7.3 Type qualifiers', '108'), -('6.7.4 Function specifiers', '112'), -('6.7.5 Declarators', '114'), -('6.7.6 Type names', '122'), -('6.7.7 Type definitions', '123'), -('6.7.8 Initialization', '125'), -('6.8 Statements and blocks', '131'), -('6.8.1 Labeled statements', '131'), -('6.8.2 Compound statement', '132'), -('6.8.3 Expression and null statements', '132'), -('6.8.4 Selection statements', '133'), -('6.8.5 Iteration statements', '135'), -('6.8.6 Jump statements', '136'), -('6.9 External definitions', '140'), -('6.9.1 Function definitions', '141'), -('6.9.2 External object definitions', '143'), -('6.10 Preprocessing directives', '145'), -('6.10.1 Conditional inclusion', '147'), -('6.10.2 Source file inclusion', '149'), -('6.10.3 Macro replacement', '151'), -('6.10.4 Line control', '158'), -('6.10.5 Error directive', '159'), -('6.10.6 Pragma directive', '159'), -('6.10.7 Null directive', '160'), -('6.10.8 Predefined macro names', '160'), -('6.10.9 Pragma operator', '161'), -('6.11 Future language directions', '163'), -('6.11.1 Floating types', '163'), -('6.11.2 Linkages of identifiers', '163'), -('6.11.3 External names', '163'), -('6.11.4 Character escape sequences', '163'), -('6.11.5 Storage-class specifiers', '163'), -('6.11.6 Function declarators', '163'), -('6.11.7 Function definitions', '163'), -('6.11.8 Pragma directives', '163'), -('6.11.9 Predefined macro names', '163'), -('7. Library', '164'), -('7.1 Introduction', '164'), -('7.1.1 Definitions of terms', '164'), -('7.1.2 Standard headers', '165'), -('7.1.3 Reserved identifiers', '166'), -('7.1.4 Use of library functions', '166'), -('7.2 Diagnostics ', '169'), -('7.2.1 Program diagnostics', '169'), -('7.3 Complex arithmetic ', '170'), -('7.3.1 Introduction', '170'), -('7.3.2 Conventions', '170'), -('7.3.3 Branch cuts', '171'), -('7.3.4 The CX_LIMITED_RANGE pragma', '171'), -('7.3.5 Trigonometric functions', '172'), -('7.3.6 Hyperbolic functions', '174'), -('7.3.7 Exponential and logarithmic functions', '176'), -('7.3.8 Power and absolute-value functions', '177'), -('7.3.9 Manipulation functions', '178'), -('7.4 Character handling ', '181'), -('7.4.1 Character classification functions', '181'), -('7.4.2 Character case mapping functions', '184'), -('7.5 Errors ', '186'), -('7.6 Floating-point environment ', '187'), -('7.6.1 The FENV_ACCESS pragma', '189'), -('7.6.2 Floating-point exceptions', '190'), -('7.6.3 Rounding', '193'), -('7.6.4 Environment', '194'), -('7.7 Characteristics of floating types ', '197'), -('7.8 Format conversion of integer types ', '198'), -('7.8.1 Macros for format specifiers', '198'), -('7.8.2 Functions for greatest-width integer types', '199'), -('7.9 Alternative spellings ', '202'), -('7.10 Sizes of integer types ', '203'), -('7.11 Localization ', '204'), -('7.11.1 Locale control', '205'), -('7.11.2 Numeric formatting convention inquiry', '206'), -('7.12 Mathematics ', '212'), -('7.12.1 Treatment of error conditions', '214'), -('7.12.2 The FP_CONTRACT pragma', '215'), -('7.12.3 Classification macros', '216'), -('7.12.4 Trigonometric functions', '218'), -('7.12.5 Hyperbolic functions', '221'), -('7.12.6 Exponential and logarithmic functions', '223'), -('7.12.7 Power and absolute-value functions', '228'), -('7.12.8 Error and gamma functions', '230'), -('7.12.9 Nearest integer functions', '231'), -('7.12.10 Remainder functions', '235'), -('7.12.11 Manipulation functions', '236'), -('7.12.12 Maximum, minimum, and positive difference functions', '238'), -('7.12.13 Floating multiply-add', '239'), -('7.12.14 Comparison macros', '240'), -('7.13 Nonlocal jumps ', '243'), -('7.13.1 Save calling environment', '243'), -('7.13.2 Restore calling environment', '244'), -('7.14 Signal handling ', '246'), -('7.14.1 Specify signal handling', '247'), -('7.14.2 Send signal', '248'), -('7.15 Variable arguments ', '249'), -('7.15.1 Variable argument list access macros', '249'), -('7.16 Boolean type and values ', '253'), -('7.17 Common definitions ', '254'), -('7.18 Integer types ', '255'), -('7.18.1 Integer types', '255'), -('7.18.2 Limits of specified-width integer types', '257'), -('7.18.3 Limits of other integer types', '259'), -('7.18.4 Macros for integer constants', '260'), -('7.19 Input/output ', '262'), -('7.19.1 Introduction', '262'), -('7.19.2 Streams', '264'), -('7.19.3 Files', '266'), -('7.19.4 Operations on files', '268'), -('7.19.5 File access functions', '270'), -('7.19.6 Formatted input/output functions', '274'), -('7.19.7 Character input/output functions', '296'), -('7.19.8 Direct input/output functions', '301'), -('7.19.9 File positioning functions', '302'), -('7.19.10 Error-handling functions', '304'), -('7.20 General utilities ', '306'), -('7.20.1 Numeric conversion functions', '307'), -('7.20.2 Pseudo-random sequence generation functions', '312'), -('7.20.3 Memory management functions', '313'), -('7.20.4 Communication with the environment', '315'), -('7.20.5 Searching and sorting utilities', '318'), -('7.20.6 Integer arithmetic functions', '320'), -('7.20.7 Multibyte/wide character conversion functions', '321'), -('7.20.8 Multibyte/wide string conversion functions', '323'), -('7.21 String handling ', '325'), -('7.21.1 String function conventions', '325'), -('7.21.2 Copying functions', '325'), -('7.21.3 Concatenation functions', '327'), -('7.21.4 Comparison functions', '328'), -('7.21.5 Search functions', '330'), -('7.21.6 Miscellaneous functions', '333'), -('7.22 Type-generic math ', '335'), -('7.23 Date and time ', '338'), -('7.23.1 Components of time', '338'), -('7.23.2 Time manipulation functions', '339'), -('7.23.3 Time conversion functions', '341'), -('7.24 Extended multibyte and wide character utilities ', '348'), -('7.24.1 Introduction', '348'), -('7.24.2 Formatted wide character input/output functions', '349'), -('7.24.3 Wide character input/output functions', '367'), -('7.24.4 General wide string utilities', '371'), -('7.24.5 Wide character time conversion functions', '385'), -('7.24.6 Extended multibyte/wide character conversion utilities', '386'), -('7.25 Wide character classification and mapping utilities ', - '393'), -('7.25.1 Introduction', '393'), -('7.25.2 Wide character classification utilities', '394'), -('7.25.3 Wide character case mapping utilities', '399'), -('7.26 Future library directions', '401'), -('7.26.1 Complex arithmetic ', '401'), -('7.26.2 Character handling ', '401'), -('7.26.3 Errors ', '401'), -('7.26.4 Format conversion of integer types ', '401'), -('7.26.5 Localization ', '401'), -('7.26.6 Signal handling ', '401'), -('7.26.7 Boolean type and values ', '401'), -('7.26.8 Integer types ', '401'), -('7.26.9 Input/output ', '402'), -('7.26.10 General utilities ', '402'), -('7.26.11 String handling ', '402'), -('', '402'), -('', '402'), -('Annex A (informative) Language syntax summary', '403'), -('A.1 Lexical grammar', '403'), -('A.2 Phrase structure grammar', '409'), -('A.3 Preprocessing directives', '416'), -('Annex B (informative) Library summary', '418'), -('B.1 Diagnostics ', '418'), -('B.2 Complex ', '418'), -('B.3 Character handling ', '420'), -('B.4 Errors ', '420'), -('B.5 Floating-point environment ', '420'), -('B.6 Characteristics of floating types ', '421'), -('B.7 Format conversion of integer types ', '421'), -('B.8 Alternative spellings ', '422'), -('B.9 Sizes of integer types ', '422'), -('B.10 Localization ', '422'), -('B.11 Mathematics ', '422'), -('B.12 Nonlocal jumps ', '427'), -('B.13 Signal handling ', '427'), -('B.14 Variable arguments ', '427'), -('B.15 Boolean type and values ', '427'), -('B.16 Common definitions ', '428'), -('B.17 Integer types ', '428'), -('B.18 Input/output ', '428'), -('B.19 General utilities ', '430'), -('B.20 String handling ', '432'), -('B.21 Type-generic math ', '433'), -('B.22 Date and time ', '433'), -('B.23 Extended multibyte/wide character utilities ', '434'), -('B.24 Wide character classification and mapping utilities ', - '436'), -('Annex C (informative) Sequence points', '438'), -('Annex D (normative) Universal character names for identifiers', '439'), -('Annex E (informative) Implementation limits', '441'), -('Annex F (normative) IEC 60559 floating-point arithmetic', '443'), -('F.1 Introduction', '443'), -('F.2 Types', '443'), -('F.3 Operators and functions', '444'), -('F.4 Floating to integer conversion', '446'), -('F.5 Binary-decimal conversion', '446'), -('F.6 Contracted expressions', '447'), -('F.7 Floating-point environment', '447'), -('F.8 Optimization', '450'), -('F.9 Mathematics ', '453'), -('Annex G (informative) IEC 60559-compatible complex arithmetic', '466'), -('G.1 Introduction', '466'), -('G.2 Types', '466'), -('G.3 Conventions', '466'), -('G.4 Conversions', '467'), -('G.5 Binary operators', '467'), -('G.6 Complex arithmetic ', '471'), -('G.7 Type-generic math ', '479'), -('Annex H (informative) Language independent arithmetic', '480'), -('H.1 Introduction', '480'), -('H.2 Types', '480'), -('H.3 Notification', '484'), -('Annex I (informative) Common warnings', '486'), -('Annex J (informative) Portability issues', '488'), -('J.1 Unspecified behavior', '488'), -('J.2 Undefined behavior', '491'), -('J.3 Implementation-defined behavior', '504'), -('J.4 Locale-specific behavior', '511'), -('J.5 Common extensions', '512'), -('Bibliography', '515'), -('Index', '517')] - -cXXURL = 'http://open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2723.pdf' -cXXTOC = [('Contents', 'ii'), -('List of Tables', 'ix'), -('1 General', '1'), -('1.1 Scope', '1'), -('1.2 Normative references', '1'), -('1.3 Definitions', '2'), -('1.4 Implementation compliance', '4'), -('1.5 Structure of this International Standard', '5'), -('1.6 Syntax notation', '5'), -('1.7 The C++ memory model', '6'), -('1.8 The C++ object model', '6'), -('1.9 Program execution', '7'), -('1.10 Multi-threaded executions and data races', '10'), -('1.11 Acknowledgments', '13'), -('2 Lexical conventions', '15'), -('2.1 Phases of translation', '15'), -('2.2 Character sets', '16'), -('2.3 Trigraph sequences', '17'), -('2.4 Preprocessing tokens', '17'), -('2.5 Alternative tokens', '18'), -('2.6 Tokens', '19'), -('2.7 Comments', '19'), -('2.8 Header names', '19'), -('2.9 Preprocessing numbers', '20'), -('2.10 Identifiers', '20'), -('2.11 Keywords', '20'), -('2.12 Operators and punctuators', '21'), -('2.13 Literals', '21'), -('3 Basic concepts', '29'), -('3.1 Declarations and definitions', '29'), -('3.2 One definition rule', '31'), -('3.3 Declarative regions and scopes', '33'), -('3.4 Name lookup', '38'), -('3.5 Program and linkage', '51'), -('3.6 Start and termination', '54'), -('3.7 Storage duration', '58'), -('3.8 Object Lifetime', '62'), -('3.9 Types', '65'), -('3.10 Lvalues and rvalues', '70'), -('3.11 Alignment', '72'), -('4 Standard conversions', '73'), -('4.1 Lvalue-to-rvalue conversion', '74'), -('4.2 Array-to-pointer conversion', '74'), -('4.3 Function-to-pointer conversion', '74'), -('4.4 Qualification conversions', '74'), -('4.5 Integral promotions', '75'), -('4.6 Floating point promotion', '76'), -('4.7 Integral conversions', '76'), -('4.8 Floating point conversions', '76'), -('4.9 Floating-integral conversions', '77'), -('4.10 Pointer conversions', '77'), -('4.11 Pointer to member conversions', '77'), -('4.12 Boolean conversions', '78'), -('4.13 Integer conversion rank', '78'), -('5 Expressions', '79'), -('5.1 Primary expressions', '80'), -('5.2 Postfix expressions', '85'), -('5.3 Unary expressions', '96'), -('5.4 Explicit type conversion (cast notation)', '104'), -('5.5 Pointer-to-member operators', '105'), -('5.6 Multiplicative operators', '106'), -('5.7 Additive operators', '106'), -('5.8 Shift operators', '107'), -('5.9 Relational operators', '108'), -('5.10 Equality operators', '109'), -('5.11 Bitwise AND operator', '110'), -('5.12 Bitwise exclusive OR operator', '110'), -('5.13 Bitwise inclusive OR operator', '110'), -('5.14 Logical AND operator', '110'), -('5.15 Logical OR operator', '110'), -('5.16 Conditional operator', '111'), -('5.17 Assignment and compound assignment operators', '112'), -('5.18 Comma operator', '113'), -('5.19 Constant expressions', '113'), -('6 Statements', '116'), -('6.1 Labeled statement', '116'), -('6.2 Expression statement', '116'), -('6.3 Compound statement or block', '116'), -('6.4 Selection statements', '117'), -('6.5 Iteration statements', '118'), -('6.6 Jump statements', '121'), -('6.7 Declaration statement', '122'), -('6.8 Ambiguity resolution', '123'), -('7 Declarations', '125'), -('7.1 Specifiers', '126'), -('7.2 Enumeration declarations', '140'), -('7.3 Namespaces', '143'), -('7.4 The asm declaration', '156'), -('7.5 Linkage specifications', '156'), -('8 Declarators', '160'), -('8.1 Type names', '161'), -('8.2 Ambiguity resolution', '161'), -('8.3 Meaning of declarators', '163'), -('8.4 Function definitions', '175'), -('8.5 Initializers', '177'), -('9 Classes', '191'), -('9.1 Class names', '193'), -('9.2 Class members', '194'), -('9.3 Member functions', '197'), -('9.4 Static members', '200'), -('9.5 Unions', '202'), -('9.6 Bit-fields', '203'), -('9.7 Nested class declarations', '204'), -('9.8 Local class declarations', '205'), -('9.9 Nested type names', '206'), -('10 Derived classes', '207'), -('10.1 Multiple base classes', '208'), -('10.2 Member name lookup', '210'), -('10.3 Virtual functions', '213'), -('10.4 Abstract classes', '217'), -('11 Member access control', '219'), -('11.1 Access specifiers', '221'), -('11.2 Accessibility of base classes and base class members', '222'), -('11.3 Access declarations', '224'), -('11.4 Friends', '225'), -('11.5 Protected member access', '228'), -('11.6 Access to virtual functions', '229'), -('11.7 Multiple access', '230'), -('11.8 Nested classes', '230'), -('12 Special member functions', '231'), -('12.1 Constructors', '231'), -('12.2 Temporary objects', '233'), -('12.3 Conversions', '235'), -('12.4 Destructors', '238'), -('12.5 Free store', '240'), -('12.6 Initialization', '242'), -('12.7 Construction and destruction', '247'), -('12.8 Copying class objects', '250'), -('12.9 Inheriting Constructors', '255'), -('13 Overloading', '259'), -('13.1 Overloadable declarations', '259'), -('13.2 Declaration matching', '261'), -('13.3 Overload resolution', '262'), -('13.4 Address of overloaded function', '281'), -('13.5 Overloaded operators', '282'), -('13.6 Built-in operators', '286'), -('14 Templates', '290'), -('14.1 Template parameters', '291'), -('14.2 Names of template specializations', '294'), -('14.3 Template arguments', '296'), -('14.4 Type equivalence', '302'), -('14.5 Template declarations', '303'), -('14.6 Name resolution', '318'), -('14.7 Template instantiation and specialization', '331'), -('14.8 Function template specializations', '343'), -('15 Exception handling', '363'), -('15.1 Throwing an exception', '364'), -('15.2 Constructors and destructors', '366'), -('15.3 Handling an exception', '366'), -('15.4 Exception specifications', '368'), -('15.5 Special functions', '371'), -('15.6 Exceptions and access', '372'), -('16 Preprocessing directives', '373'), -('16.1 Conditional inclusion', '375'), -('16.2 Source file inclusion', '376'), -('16.3 Macro replacement', '377'), -('16.4 Line control', '382'), -('16.5 Error directive', '383'), -('16.6 Pragma directive', '383'), -('16.7 Null directive', '383'), -('16.8 Predefined macro names', '383'), -('16.9 Pragma operator', '384'), -('17 Library introduction', '386'), -('17.1 General', '386'), -('17.2 Overview', '386'), -('17.3 Definitions', '386'), -('17.4 Additional definitions', '390'), -('17.5 Method of description (Informative)', '390'), -('17.6 Library-wide requirements', '396'), -('18 Language support library', '407'), -('18.1 Types', '407'), -('18.2 Implementation properties', '408'), -('18.3 Integer types', '417'), -('18.4 Start and termination', '418'), -('18.5 Dynamic memory management', '420'), -('18.6 Type identification', '424'), -('18.7 Exception handling', '427'), -('18.8 Initializer lists', '432'), -('18.9 Other runtime support', '434'), -('19 Diagnostics library', '435'), -('19.1 Exception classes', '435'), -('19.2 Assertions', '439'), -('19.3 Error numbers', '440'), -('19.4 System error support', '440'), -('20 General utilities library', '452'), -('20.1 Requirements', '452'), -('20.2 Utility components', '457'), -('20.3 Compile-time rational arithmetic', '463'), -('20.4 Tuples', '465'), -('20.5 Metaprogramming and type traits', '473'), -('20.6 Function objects', '486'), -('20.7 Memory', '509'), -('20.8 Time utilities', '548'), -('20.9 Date and time functions', '562'), -('21 Strings library', '563'), -('21.1 Character traits', '563'), -('21.2 String classes', '569'), -('21.3 Class template basic_string', '572'), -('21.4 Numeric Conversions', '599'), -('21.5 Null-terminated sequence utilities', '600'), -('22 Localization library', '604'), -('22.1 Locales', '604'), -('22.2 Standard locale categories', '617'), -('22.3 Standard code conversion facets', '657'), -('22.4 C Library Locales', '659'), -('23 Containers library', '660'), -('23.1 Container requirements', '660'), -('23.2 Sequence containers', '681'), -('23.3 Associative containers', '719'), -('23.4 Unordered associative containers', '744'), -('24 Iterators library', '759'), -('24.1 Iterator requirements', '759'), -('24.2 Header synopsis', '764'), -('24.3 Iterator primitives', '767'), -('24.4 Predefined iterators', '770'), -('24.5 Stream iterators', '784'), -('25 Algorithms library', '792'), -('25.1 Non-modifying sequence operations', '802'), -('25.2 Mutating sequence operations', '806'), -('25.3 Sorting and related operations', '815'), -('25.4 C library algorithms', '829'), -('26 Numerics library', '831'), -('26.1 Numeric type requirements', '831'), -('26.2 The floating-point environment', '832'), -('26.3 Complex numbers', '833'), -('26.4 Random number generation', '842'), -('26.5 Numeric arrays', '884'), -('26.6 Generalized numeric operations', '904'), -('26.7 C Library', '907'), -('27 Input/output library', '912'), -('27.1 Iostreams requirements', '912'), -('27.2 Forward declarations', '912'), -('27.3 Standard iostream objects', '915'), -('27.4 Iostreams base classes', '916'), -('27.5 Stream buffers', '934'), -('27.6 Formatting and manipulators', '944'), -('27.7 String-based streams', '972'), -('27.8 File-based streams', '984'), -('28 Regular expressions library', '1000'), -('28.1 Definitions', '1000'), -('28.2 Requirements', '1000'), -('28.3 Regular expressions summary', '1002'), -('28.4 Header synopsis', '1003'), -('28.5 Namespace std::regex_constants', '1009'), -('28.6 Class regex_error', '1012'), -('28.7 Class template regex_traits', '1012'), -('28.8 Class template basic_regex', '1015'), -('28.9 Class template sub_match', '1020'), -('28.10Class template match_results', '1025'), -('28.11Regular expression algorithms', '1029'), -('28.12Regular expression Iterators', '1033'), -('28.13Modified ECMAScript regular expression grammar', '1039'), -('29 Atomic operations library', '1042'), -('29.1 Order and Consistency', '1044'), -('29.2 Lock-free Property', '1046'), -('29.3 Atomic Types', '1046'), -('29.4 Operations on Atomic Types', '1051'), -('29.5 Flag Type and Operations', '1054'), -('30 Thread support library', '1057'), -('30.1 Requirements', '1057'), -('30.2 Threads', '1058'), -('30.3 Mutual exclusion', '1063'), -('30.4 Condition variables', '1077'), -('A Grammar summary', '1085'), -('A.1 Keywords', '1085'), -('A.2 Lexical conventions', '1085'), -('A.3 Basic concepts', '1089'), -('A.4 Expressions', '1090'), -('A.5 Statements', '1093'), -('A.6 Declarations', '1094'), -('A.7 Declarators', '1097'), -('A.8 Classes', '1098'), -('A.9 Derived classes', '1099'), -('A.10 Special member functions', '1099'), -('A.11 Overloading', '1100'), -('A.12 Templates', '1100'), -('A.13 Exception handling', '1101'), -('A.14 Preprocessing directives', '1101'), -('B Implementation quantities', '1103'), -('C Compatibility', '1105'), -('C.1 C++ and ISO C', '1105'), -('C.2 Standard C library', '1114'), -('D Compatibility features', '1119'), -('D.1 Increment operator with bool operand', '1119'), -('D.2 static keyword', '1119'), -('D.3 Access declarations', '1119'), -('D.4 Implicit conversion from const strings', '1119'), -('D.5 C standard library headers', '1119'), -('D.6 Old iostreams members', '1120'), -('D.7 char* streams', '1121'), -('D.8 Binders', '1130'), -('D.9 auto_ptr', '1132'), -('E Universal-character-names', '1135'), -('F Cross references', '1137'), -('Index', '1153')] - -kDocuments = { - 'C99' : (c99URL, c99TOC, 12), - 'C++' : (cXXURL, cXXTOC, 12), -} - -def findClosestTOCEntry(data, target): - # FIXME: Fix for named spec references - if isinstance(target[0],str): - return ('.'.join(target),'',1) - - offset = data[2] - best = None - for (name,page) in data[1]: - if ' ' in name: - section,name = name.split(' ',1) - if section == 'Annex': - section,name = name.split(' ',1) - section = 'Annex '+section - else: - section = None - try: - page = int(page) + offset - except: - page = 1 - try: - spec = SpecIndex.fromstring(section) - except: - spec = None - - # Meh, could be better... - if spec is not None: - dist = spec - target - if best is None or dist < best[0]: - best = (dist, (section, name, page)) - return best[1] - -# What a hack. Slow to boot. -doxyLineRefRE = re.compile(r"") -def findClosestLineReference(clangRoot, doxyName, target): - try: - f = open(os.path.join(clangRoot, 'docs', 'doxygen', 'html', doxyName)) - except: - return None - - best = None - for m in doxyLineRefRE.finditer(f.read()): - line = int(m.group(1), 10) - dist = abs(line - target) - if best is None or dist < best[0]: - best = (dist,'l'+m.group(1)) - f.close() - if best is not None: - return best[1] - return None - -### - -nameAndSpecRefRE = re.compile(r"(C99|C90|C\+\+|H\&S) ((([0-9]+)(\.[0-9]+)*|\[[^]]+\])(p[0-9]+)?)") -loneSpecRefRE = re.compile(r" (([0-9]+)(\.[0-9]+){2,100}(p[0-9]+)?)") -def scanFile(path, filename): - try: - f = open(path) - except IOError: - print >>sys.stderr,'WARNING: Unable to open:',path - return - - for i,ln in enumerate(f): - ignore = set() - for m in nameAndSpecRefRE.finditer(ln): - section = m.group(2) - name = m.group(1) - if section.endswith('.'): - section = section[:-1] - yield RefItem(name, section, filename, path, i+1) - ignore.add(section) - for m in loneSpecRefRE.finditer(ln): - section = m.group(1) - if section.endswith('.'): - section = section[:-1] - if section not in ignore: - yield RefItem(None, section, filename, path, i+1) - -### - -class SpecIndex: - @staticmethod - def fromstring(str): - # Check for named sections - if str[0] == '[': - assert ']' in str - secs = str[1:str.index(']')].split('.') - tail = str[str.index(']')+1:] - if tail: - assert tail[0] == 'p' - paragraph = int(tail[1:]) - else: - paragraph = None - indices = secs - else: - secs = str.split('.') - paragraph = None - if 'p' in secs[-1]: - secs[-1],p = secs[-1].split('p',1) - paragraph = int(p) - indices = map(int, secs) - return SpecIndex(indices, paragraph) - - def __init__(self, indices, paragraph=None): - assert len(indices)>0 - self.indices = tuple(indices) - self.paragraph = paragraph - - def __str__(self): - s = '.'.join(map(str,self.indices)) - if self.paragraph is not None: - s += '.p%d'%(self.paragraph,) - return s - - def __repr__(self): - return 'SpecIndex(%s, %s)'%(self.indices, self.paragraph) - - def __cmp__(self, b): - return cmp((self.indices,self.paragraph), - (b.indices,b.paragraph)) - - def __hash__(self): - return hash((self.indices,self.paragraph)) - - def __sub__(self, indices): - def sub(a,b): - a = a or 0 - b = b or 0 - return abs(a-b) - return map(sub,self.indices,indices) - -class RefItem: - def __init__(self, name, section, filename, path, line): - self.name = name - self.section = SpecIndex.fromstring(section) - self.filename = filename - self.path = path - self.line = line - - def __str__(self): - if self.name is not None: - return '%s %s'%(self.name, self.section) - else: - return '--- %s'%(self.section,) - - def __repr__(self): - return 'RefItem(%s, %r, "%s", "%s", %d)'%(self.name, - self.section, - self.filename, - self.path, - self.line) - - def __cmp__(self, b): - return cmp((self.name,self.section,self.filename,self.path,self.line), - (b.name,b.section,self.filename,self.path,self.line)) - - def __hash__(self): - return hash((self.name,self.section,self.filename,self.path,self.line)) - -### - -def sorted(l): - l = list(l) - l.sort() - return l - -def getRevision(path): - import subprocess - p = subprocess.Popen(['svn', 'info', path], - stdin=open('/dev/null','r'), - stdout=subprocess.PIPE) - for ln in p.stdout.read(1024).split('\n'): - if ln.startswith('Revision:'): - return ln.split(':',1)[1].strip() - return None - -def buildRefTree(references): - root = (None, {}, []) - - def getNode(keys): - if not keys: - return root - key,parent = keys[-1],getNode(keys[:-1]) - node = parent[1].get(key) - if node is None: - parent[1][key] = node = (key, {}, []) - return node - - for ref in references: - n = getNode((ref.name,) + ref.section.indices) - n[2].append(ref) - - def flatten((key, children, data)): - children = sorted(map(flatten,children.values())) - return (key, children, sorted(data)) - - return flatten(root) - -def preorder(node,parents=(),first=True): - (key,children,data) = node - if first: - yield parents+(node,) - for c in children: - for item in preorder(c, parents+(node,)): - yield item - -def main(): - global options - from optparse import OptionParser - parser = OptionParser("usage: %prog [options] CLANG_ROOT ") - parser.add_option("", "--debug", dest="debug", - help="Print extra debugging output", - action="store_true", - default=False) - (opts, args) = parser.parse_args() - - if len(args) != 2: - parser.error("incorrect number of arguments") - - references = [] - root,outputDir = args - if os.path.isdir(root): - for (dirpath, dirnames, filenames) in os.walk(root): - for filename in filenames: - name,ext = os.path.splitext(filename) - if ext in ('.c', '.cpp', '.h', '.def'): - fullpath = os.path.join(dirpath, filename) - references.extend(list(scanFile(fullpath, filename))) - else: - references.extend(list(scanFile(root, root))) - - refTree = buildRefTree(references) - - specs = {} - for ref in references: - spec = specs[ref.name] = specs.get(ref.name,{}) - items = spec[ref.section] = spec.get(ref.section,[]) - items.append(ref) - - print 'Found %d references.'%(len(references),) - - if opts.debug: - pprint(refTree) - - referencesPath = os.path.join(outputDir,'references.html') - print 'Writing: %s'%(referencesPath,) - f = open(referencesPath,'w') - print >>f, 'clang: Specification References' - print >>f, '' - print >>f, '\t

Specification References

' - for i,node in enumerate(refTree[1]): - specName = node[0] or 'Unknown' - print >>f, '%s
'%(i,specName) - for i,node in enumerate(refTree[1]): - specName = node[0] or 'Unknown' - print >>f, '
' - print >>f, ''%(i,) - print >>f, '

Document: %s

'%(specName or 'Unknown',) - print >>f, '' - print >>f, '' - docData = kDocuments.get(specName) - for path in preorder(node,first=False): - if not path[-1][2]: - continue - components = '.'.join([str(p[0]) for p in path[1:]]) - print >>f, '\t' - tocEntry = None - if docData is not None: - tocEntry = findClosestTOCEntry(docData, [p[0] for p in path[1:]]) - if tocEntry is not None: - section,name,page = tocEntry - # If section is exact print the TOC name - if page is not None: - linkStr = '%s (pg.%d)'%(docData[0],page,components,page) - else: - linkStr = components - if section == components: - print >>f, '\t\t'%(linkStr,name) - else: - print >>f, '\t\t'%(linkStr,) - else: - print >>f, '\t\t'%(components,) - print >>f, '\t\t' - print >>f, '\t' - print >>f, '
NameReferences
%s
%s
%s%s' - for item in path[-1][2]: - # XXX total hack - relativePath = item.path[len(root):] - if relativePath.startswith('/'): - relativePath = relativePath[1:] - # XXX this is broken, how does doxygen mangle w/ multiple - # refs? Can we just read its map? - filename = os.path.basename(relativePath) - doxyName = '%s-source.html'%(filename.replace('.','_8'),) - # Grrr, why can't doxygen write line number references. - lineReference = findClosestLineReference(root,doxyName,item.line) - if lineReference is not None: - linkStr = 'http://clang.llvm.org/doxygen/%s#%s'%(doxyName,lineReference) - else: - linkStr = 'http://clang.llvm.org/doxygen/%s'%(doxyName,) - if item.section.paragraph is not None: - paraText = ' (p%d)'%(item.section.paragraph,) - else: - paraText = '' - print >>f,'%s:%d%s
'%(linkStr,relativePath,item.line,paraText) - print >>f, '\t\t
' - print >>f, '
' - print >>f, 'Generated: %s
'%(time.strftime('%Y-%m-%d %H:%M'),) - print >>f, 'SVN Revision: %s'%(getRevision(root),) - print >>f, '' - f.close() - -if __name__=='__main__': - main() diff --git a/contrib/llvm/tools/clang/utils/FuzzTest b/contrib/llvm/tools/clang/utils/FuzzTest deleted file mode 100755 index 2aa5989a80d4..000000000000 --- a/contrib/llvm/tools/clang/utils/FuzzTest +++ /dev/null @@ -1,340 +0,0 @@ -#!/usr/bin/env python - -""" -This is a generic fuzz testing tool, see --help for more information. -""" - -import os -import sys -import random -import subprocess -import itertools - -class TestGenerator: - def __init__(self, inputs, delete, insert, replace, - insert_strings, pick_input): - self.inputs = [(s, open(s).read()) for s in inputs] - - self.delete = bool(delete) - self.insert = bool(insert) - self.replace = bool(replace) - self.pick_input = bool(pick_input) - self.insert_strings = list(insert_strings) - - self.num_positions = sum([len(d) for _,d in self.inputs]) - self.num_insert_strings = len(insert_strings) - self.num_tests = ((delete + (insert + replace)*self.num_insert_strings) - * self.num_positions) - self.num_tests += 1 - - if self.pick_input: - self.num_tests *= self.num_positions - - def position_to_source_index(self, position): - for i,(s,d) in enumerate(self.inputs): - n = len(d) - if position < n: - return (i,position) - position -= n - raise ValueError,'Invalid position.' - - def get_test(self, index): - assert 0 <= index < self.num_tests - - picked_position = None - if self.pick_input: - index,picked_position = divmod(index, self.num_positions) - picked_position = self.position_to_source_index(picked_position) - - if index == 0: - return ('nothing', None, None, picked_position) - - index -= 1 - index,position = divmod(index, self.num_positions) - position = self.position_to_source_index(position) - if self.delete: - if index == 0: - return ('delete', position, None, picked_position) - index -= 1 - - index,insert_index = divmod(index, self.num_insert_strings) - insert_str = self.insert_strings[insert_index] - if self.insert: - if index == 0: - return ('insert', position, insert_str, picked_position) - index -= 1 - - assert self.replace - assert index == 0 - return ('replace', position, insert_str, picked_position) - -class TestApplication: - def __init__(self, tg, test): - self.tg = tg - self.test = test - - def apply(self): - if self.test[0] == 'nothing': - pass - else: - i,j = self.test[1] - name,data = self.tg.inputs[i] - if self.test[0] == 'delete': - data = data[:j] + data[j+1:] - elif self.test[0] == 'insert': - data = data[:j] + self.test[2] + data[j:] - elif self.test[0] == 'replace': - data = data[:j] + self.test[2] + data[j+1:] - else: - raise ValueError,'Invalid test %r' % self.test - open(name,'wb').write(data) - - def revert(self): - if self.test[0] != 'nothing': - i,j = self.test[1] - name,data = self.tg.inputs[i] - open(name,'wb').write(data) - -def quote(str): - return '"' + str + '"' - -def run_one_test(test_application, index, input_files, args): - test = test_application.test - - # Interpolate arguments. - options = { 'index' : index, - 'inputs' : ' '.join(quote(f) for f in input_files) } - - # Add picked input interpolation arguments, if used. - if test[3] is not None: - pos = test[3][1] - options['picked_input'] = input_files[test[3][0]] - options['picked_input_pos'] = pos - # Compute the line and column. - file_data = test_application.tg.inputs[test[3][0]][1] - line = column = 1 - for i in range(pos): - c = file_data[i] - if c == '\n': - line += 1 - column = 1 - else: - column += 1 - options['picked_input_line'] = line - options['picked_input_col'] = column - - test_args = [a % options for a in args] - if opts.verbose: - print '%s: note: executing %r' % (sys.argv[0], test_args) - - stdout = None - stderr = None - if opts.log_dir: - stdout_log_path = os.path.join(opts.log_dir, '%s.out' % index) - stderr_log_path = os.path.join(opts.log_dir, '%s.err' % index) - stdout = open(stdout_log_path, 'wb') - stderr = open(stderr_log_path, 'wb') - else: - sys.stdout.flush() - p = subprocess.Popen(test_args, stdout=stdout, stderr=stderr) - p.communicate() - exit_code = p.wait() - - test_result = (exit_code == opts.expected_exit_code or - exit_code in opts.extra_exit_codes) - - if stdout is not None: - stdout.close() - stderr.close() - - # Remove the logs for passes, unless logging all results. - if not opts.log_all and test_result: - os.remove(stdout_log_path) - os.remove(stderr_log_path) - - if not test_result: - print 'FAIL: %d' % index - elif not opts.succinct: - print 'PASS: %d' % index - -def main(): - global opts - from optparse import OptionParser, OptionGroup - parser = OptionParser("""%prog [options] ... test command args ... - -%prog is a tool for fuzzing inputs and testing them. - -The most basic usage is something like: - - $ %prog --file foo.txt ./test.sh - -which will run a default list of fuzzing strategies on the input. For each -fuzzed input, it will overwrite the input files (in place), run the test script, -then restore the files back to their original contents. - -NOTE: You should make sure you have a backup copy of your inputs, in case -something goes wrong!!! - -You can cause the fuzzing to not restore the original files with -'--no-revert'. Generally this is used with '--test ' to run one failing -test and then leave the fuzzed inputs in place to examine the failure. - -For each fuzzed input, %prog will run the test command given on the command -line. Each argument in the command is subject to string interpolation before -being executed. The syntax is "%(VARIABLE)FORMAT" where FORMAT is a standard -printf format, and VARIBLE is one of: - - 'index' - the test index being run - 'inputs' - the full list of test inputs - 'picked_input' - (with --pick-input) the selected input file - 'picked_input_pos' - (with --pick-input) the selected input position - 'picked_input_line' - (with --pick-input) the selected input line - 'picked_input_col' - (with --pick-input) the selected input column - -By default, the script will run forever continually picking new tests to -run. You can limit the number of tests that are run with '--max-tests ', -and you can run a particular test with '--test '. -""") - parser.add_option("-v", "--verbose", help="Show more output", - action='store_true', dest="verbose", default=False) - parser.add_option("-s", "--succinct", help="Reduce amount of output", - action="store_true", dest="succinct", default=False) - - group = OptionGroup(parser, "Test Execution") - group.add_option("", "--expected-exit-code", help="Set expected exit code", - type=int, dest="expected_exit_code", - default=0) - group.add_option("", "--extra-exit-code", - help="Set additional expected exit code", - type=int, action="append", dest="extra_exit_codes", - default=[]) - group.add_option("", "--log-dir", - help="Capture test logs to an output directory", - type=str, dest="log_dir", - default=None) - group.add_option("", "--log-all", - help="Log all outputs (not just failures)", - action="store_true", dest="log_all", default=False) - parser.add_option_group(group) - - group = OptionGroup(parser, "Input Files") - group.add_option("", "--file", metavar="PATH", - help="Add an input file to fuzz", - type=str, action="append", dest="input_files", default=[]) - group.add_option("", "--filelist", metavar="LIST", - help="Add a list of inputs files to fuzz (one per line)", - type=int, action="append", dest="filelists", default=[]) - parser.add_option_group(group) - - group = OptionGroup(parser, "Fuzz Options") - group.add_option("", "--replacement-chars", dest="replacement_chars", - help="Characters to insert/replace", - default="0{}[]<>\;@#$^%& ") - group.add_option("", "--replacement-string", dest="replacement_strings", - action="append", help="Add a replacement string to use", - default=[]) - group.add_option("", "--replacement-list", dest="replacement_lists", - help="Add a list of replacement strings (one per line)", - action="append", default=[]) - group.add_option("", "--no-delete", help="Don't delete characters", - action='store_false', dest="enable_delete", default=True) - group.add_option("", "--no-insert", help="Don't insert strings", - action='store_false', dest="enable_insert", default=True) - group.add_option("", "--no-replace", help="Don't replace strings", - action='store_false', dest="enable_replace", default=True) - group.add_option("", "--no-revert", help="Don't revert changes", - action='store_false', dest="revert", default=True) - parser.add_option_group(group) - - group = OptionGroup(parser, "Test Selection") - group.add_option("", "--test", help="Run a particular test", - type=int, dest="test", default=None, metavar="INDEX") - group.add_option("", "--max-tests", help="Maximum number of tests", - type=int, dest="max_tests", default=10, metavar="COUNT") - group.add_option("", "--pick-input", - help="Randomly select an input byte as well as fuzzing", - action='store_true', dest="pick_input", default=False) - parser.add_option_group(group) - - parser.disable_interspersed_args() - - (opts, args) = parser.parse_args() - - if not args: - parser.error("Invalid number of arguments") - - # Collect the list of inputs. - input_files = list(opts.input_files) - for filelist in opts.filelists: - f = open(filelist) - try: - for ln in f: - ln = ln.strip() - if ln: - input_files.append(ln) - finally: - f.close() - input_files.sort() - - if not input_files: - parser.error("No input files!") - - print '%s: note: fuzzing %d files.' % (sys.argv[0], len(input_files)) - - # Make sure the log directory exists if used. - if opts.log_dir: - if not os.path.exists(opts.log_dir): - try: - os.mkdir(opts.log_dir) - except OSError: - print "%s: error: log directory couldn't be created!" % ( - sys.argv[0],) - raise SystemExit,1 - - # Get the list if insert/replacement strings. - replacements = list(opts.replacement_chars) - replacements.extend(opts.replacement_strings) - for replacement_list in opts.replacement_lists: - f = open(replacement_list) - try: - for ln in f: - ln = ln[:-1] - if ln: - replacements.append(ln) - finally: - f.close() - - # Unique and order the replacement list. - replacements = list(set(replacements)) - replacements.sort() - - # Create the test generator. - tg = TestGenerator(input_files, opts.enable_delete, opts.enable_insert, - opts.enable_replace, replacements, opts.pick_input) - - print '%s: note: %d input bytes.' % (sys.argv[0], tg.num_positions) - print '%s: note: %d total tests.' % (sys.argv[0], tg.num_tests) - if opts.test is not None: - it = [opts.test] - elif opts.max_tests is not None: - it = itertools.imap(random.randrange, - itertools.repeat(tg.num_tests, opts.max_tests)) - else: - it = itertools.imap(random.randrange, itertools.repeat(tg.num_tests)) - for test in it: - t = tg.get_test(test) - - if opts.verbose: - print '%s: note: running test %d: %r' % (sys.argv[0], test, t) - ta = TestApplication(tg, t) - try: - ta.apply() - run_one_test(ta, test, input_files, args) - finally: - if opts.revert: - ta.revert() - - sys.stdout.flush() - -if __name__ == '__main__': - main() diff --git a/contrib/llvm/tools/clang/utils/OptionalTests/Extra/README.txt b/contrib/llvm/tools/clang/utils/OptionalTests/Extra/README.txt deleted file mode 100644 index 565241b51b7f..000000000000 --- a/contrib/llvm/tools/clang/utils/OptionalTests/Extra/README.txt +++ /dev/null @@ -1,3 +0,0 @@ -This directory is for extra unit style tests following the structure of -clang/tests, but which are not portable or not suitable for inclusion in the -regular test suite. diff --git a/contrib/llvm/tools/clang/utils/OptionalTests/Extra/Runtime/darwin-clang_rt.c b/contrib/llvm/tools/clang/utils/OptionalTests/Extra/Runtime/darwin-clang_rt.c deleted file mode 100644 index d22c0bd0bca0..000000000000 --- a/contrib/llvm/tools/clang/utils/OptionalTests/Extra/Runtime/darwin-clang_rt.c +++ /dev/null @@ -1,338 +0,0 @@ -/* This file tests that we can succesfully call each compiler-rt function. It is - designed to check that the runtime libraries are available for linking and - that they contain the expected contents. It is not designed to test the - correctness of the individual functions in compiler-rt. - - This test is assumed to be run on a 10.6 machine. The two environment - variables below should be set to 10.4 and 10.5 machines which can be directly - ssh/rsync'd to in order to actually test the executables can run on the - desired targets. -*/ - -// RUN: export TENFOUR_X86_MACHINE=localhost -// RUN: export TENFIVE_X86_MACHINE=localhost -// RUN: export ARM_MACHINE=localhost -// RUN: export ARM_SYSROOT=$(xcodebuild -sdk iphoneos -version Path) - -// RUN: echo iPhoneOS, ARM, v6, thumb -// RUN: %clang -isysroot $ARM_SYSROOT -arch armv6 -mthumb -c %s -o %t.o -// RUN: %clang -isysroot $ARM_SYSROOT -arch armv6 -mthumb -v -Wl,-t,-v -o %t %t.o 1>&2 -// RUN: rsync -arv %t $ARM_MACHINE:/tmp/a.out -// RUN: ssh $ARM_MACHINE /tmp/a.out -// RUN: echo - -// RUN: echo iPhoneOS, ARM, v6, no-thumb -// RUN: %clang -isysroot $ARM_SYSROOT -arch armv6 -mno-thumb -c %s -o %t.o -// RUN: %clang -isysroot $ARM_SYSROOT -arch armv6 -mno-thumb -v -Wl,-t,-v -o %t %t.o 1>&2 -// RUN: rsync -arv %t $ARM_MACHINE:/tmp/a.out -// RUN: ssh $ARM_MACHINE /tmp/a.out -// RUN: echo - -// RUN: echo iPhoneOS, ARM, v7, thumb -// RUN: %clang -isysroot $ARM_SYSROOT -arch armv7 -mthumb -c %s -o %t.o -// RUN: %clang -isysroot $ARM_SYSROOT -arch armv7 -mthumb -v -Wl,-t,-v -o %t %t.o 1>&2 -// RUN: rsync -arv %t $ARM_MACHINE:/tmp/a.out -// RUN: ssh $ARM_MACHINE /tmp/a.out -// RUN: echo - -// RUN: echo iPhoneOS, ARM, v7, no-thumb -// RUN: %clang -isysroot $ARM_SYSROOT -arch armv7 -mno-thumb -c %s -o %t.o -// RUN: %clang -isysroot $ARM_SYSROOT -arch armv7 -mno-thumb -v -Wl,-t,-v -o %t %t.o 1>&2 -// RUN: rsync -arv %t $ARM_MACHINE:/tmp/a.out -// RUN: ssh $ARM_MACHINE /tmp/a.out -// RUN: echo - -// RUN: echo 10.4, i386 -// RUN: %clang -arch i386 -mmacosx-version-min=10.4 -c %s -o %t.o -// RUN: %clang -arch i386 -mmacosx-version-min=10.4 -v -Wl,-t,-v -o %t %t.o 1>&2 -// RUN: %t -// RUN: echo - -// RUN: rsync -arv %t $TENFOUR_X86_MACHINE:/tmp/a.out -// RUN: ssh $TENFOUR_X86_MACHINE /tmp/a.out -// RUN: echo - -// RUX: rsync -arv %t $TENFIVE_X86_MACHINE:/tmp/a.out -// RUX: ssh $TENFIVE_X86_MACHINE /tmp/a.out -// RUN: echo - -// RUN: echo 10.5, i386 -// RUN: %clang -arch i386 -mmacosx-version-min=10.5 -c %s -o %t.o -// RUN: %clang -arch i386 -mmacosx-version-min=10.5 -v -Wl,-t,-v -o %t %t.o 1>&2 -// RUN: %t -// RUN: echo - -// RUN: rsync -arv %t $TENFIVE_X86_MACHINE:/tmp/a.out -// RUN: ssh $TENFIVE_X86_MACHINE /tmp/a.out -// RUN: echo - -// RUN: echo 10.6, i386 -// RUN: %clang -arch i386 -mmacosx-version-min=10.6 -c %s -o %t.o -// RUN: %clang -arch i386 -mmacosx-version-min=10.6 -v -Wl,-t,-v -o %t %t.o 1>&2 -// RUN: %t -// RUN: echo - -// RUN: echo 10.4, x86_64 -// RUN: %clang -arch x86_64 -mmacosx-version-min=10.4 -c %s -o %t.o -// RUN: %clang -arch x86_64 -mmacosx-version-min=10.4 -v -Wl,-t,-v -o %t %t.o 1>&2 -// RUN: %t -// RUN: echo - -// RUN: rsync -arv %t $TENFOUR_X86_MACHINE:/tmp/a.out -// RUN: ssh $TENFOUR_X86_MACHINE /tmp/a.out -// RUN: echo - -// RUN: rsync -arv %t $TENFIVE_X86_MACHINE:/tmp/a.out -// RUN: ssh $TENFIVE_X86_MACHINE /tmp/a.out -// RUN: echo - -// RUN: echo 10.5, x86_64 -// RUN: %clang -arch x86_64 -mmacosx-version-min=10.5 -c %s -o %t.o -// RUN: %clang -arch x86_64 -mmacosx-version-min=10.5 -v -Wl,-t,-v -o %t %t.o 1>&2 -// RUN: %t -// RUN: echo - -// RUN: rsync -arv %t $TENFIVE_X86_MACHINE:/tmp/a.out -// RUN: ssh $TENFIVE_X86_MACHINE /tmp/a.out -// RUN: echo - -// RUN: echo 10.6, x86_64 -// RUN: %clang -arch x86_64 -mmacosx-version-min=10.6 -c %s -o %t.o -// RUN: %clang -arch x86_64 -mmacosx-version-min=10.6 -v -Wl,-t,-v -o %t %t.o 1>&2 -// RUN: %t -// RUN: echo - -#include -#include -#include - -typedef int si_int; -typedef unsigned su_int; - -typedef long long di_int; -typedef unsigned long long du_int; - -// Integral bit manipulation - -di_int __ashldi3(di_int a, si_int b); // a << b -di_int __ashrdi3(di_int a, si_int b); // a >> b arithmetic (sign fill) -di_int __lshrdi3(di_int a, si_int b); // a >> b logical (zero fill) - -si_int __clzsi2(si_int a); // count leading zeros -si_int __clzdi2(di_int a); // count leading zeros -si_int __ctzsi2(si_int a); // count trailing zeros -si_int __ctzdi2(di_int a); // count trailing zeros - -si_int __ffsdi2(di_int a); // find least significant 1 bit - -si_int __paritysi2(si_int a); // bit parity -si_int __paritydi2(di_int a); // bit parity - -si_int __popcountsi2(si_int a); // bit population -si_int __popcountdi2(di_int a); // bit population - -// Integral arithmetic - -di_int __negdi2 (di_int a); // -a -di_int __muldi3 (di_int a, di_int b); // a * b -di_int __divdi3 (di_int a, di_int b); // a / b signed -du_int __udivdi3 (du_int a, du_int b); // a / b unsigned -di_int __moddi3 (di_int a, di_int b); // a % b signed -du_int __umoddi3 (du_int a, du_int b); // a % b unsigned -du_int __udivmoddi4(du_int a, du_int b, du_int* rem); // a / b, *rem = a % b - -// Integral arithmetic with trapping overflow - -si_int __absvsi2(si_int a); // abs(a) -di_int __absvdi2(di_int a); // abs(a) - -si_int __negvsi2(si_int a); // -a -di_int __negvdi2(di_int a); // -a - -si_int __addvsi3(si_int a, si_int b); // a + b -di_int __addvdi3(di_int a, di_int b); // a + b - -si_int __subvsi3(si_int a, si_int b); // a - b -di_int __subvdi3(di_int a, di_int b); // a - b - -si_int __mulvsi3(si_int a, si_int b); // a * b -di_int __mulvdi3(di_int a, di_int b); // a * b - -// Integral comparison: a < b -> 0 -// a == b -> 1 -// a > b -> 2 - -si_int __cmpdi2 (di_int a, di_int b); -si_int __ucmpdi2(du_int a, du_int b); - -// Integral / floating point conversion - -di_int __fixsfdi( float a); -di_int __fixdfdi( double a); -di_int __fixxfdi(long double a); - -su_int __fixunssfsi( float a); -su_int __fixunsdfsi( double a); -su_int __fixunsxfsi(long double a); - -du_int __fixunssfdi( float a); -du_int __fixunsdfdi( double a); -du_int __fixunsxfdi(long double a); - -float __floatdisf(di_int a); -double __floatdidf(di_int a); -long double __floatdixf(di_int a); - -float __floatundisf(du_int a); -double __floatundidf(du_int a); -long double __floatundixf(du_int a); - -// Floating point raised to integer power - -float __powisf2( float a, si_int b); // a ^ b -double __powidf2( double a, si_int b); // a ^ b -long double __powixf2(long double a, si_int b); // a ^ b - -// Complex arithmetic - -// (a + ib) * (c + id) - - float _Complex __mulsc3( float a, float b, float c, float d); - double _Complex __muldc3(double a, double b, double c, double d); -long double _Complex __mulxc3(long double a, long double b, - long double c, long double d); - -// (a + ib) / (c + id) - - float _Complex __divsc3( float a, float b, float c, float d); - double _Complex __divdc3(double a, double b, double c, double d); -long double _Complex __divxc3(long double a, long double b, - long double c, long double d); - -#ifndef __arm -#define HAS_LONG_DOUBLE -#endif - -int main(int argc, char **argv) { - du_int du_tmp; - struct utsname name; -#ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ - const char *target_name = "OS X"; - unsigned target_version = __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__; - unsigned target_maj = target_version / 100; - unsigned target_min = (target_version / 10) % 10; - unsigned target_micro = target_version % 10; -#else - const char *target_name = "iPhoneOS"; - unsigned target_version = __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__; - unsigned target_maj = target_version / 10000; - unsigned target_min = (target_version / 100) % 100; - unsigned target_micro = target_version % 100; -#endif - - if (uname(&name)) - return 1; - - fprintf(stderr, "%s: clang_rt test:\n", argv[0]); - fprintf(stderr, " target : %s %d.%d.%d\n\n", target_name, - target_maj, target_min, target_micro); - fprintf(stderr, " sysname : %s\n", name.sysname); - fprintf(stderr, " nodename: %s\n", name.nodename); - fprintf(stderr, " release : %s\n", name.release); - fprintf(stderr, " version : %s\n", name.version); - fprintf(stderr, " machine : %s\n", name.machine); - - assert(__ashldi3(1, 1) == 2); - assert(__ashrdi3(2, 1) == 1); - assert(__lshrdi3(2, 1) == 1); - assert(__clzsi2(1) == 31); - assert(__clzdi2(1) == 63); - assert(__ctzsi2(2) == 1); - assert(__ctzdi2(2) == 1); - assert(__ffsdi2(12) == 3); - assert(__paritysi2(13) == 1); - assert(__paritydi2(13) == 1); - assert(__popcountsi2(13) == 3); - assert(__popcountdi2(13) == 3); - assert(__negdi2(3) == -3); - assert(__muldi3(2,2) == 4); - assert(__divdi3(-4,2) == -2); - assert(__udivdi3(4,2) == 2); - assert(__moddi3(3,2) == 1); - assert(__umoddi3(3,2) == 1); - assert(__udivmoddi4(5,2,&du_tmp) == 2 && du_tmp == 1); - assert(__absvsi2(-2) == 2); - assert(__absvdi2(-2) == 2); - assert(__negvsi2(2) == -2); - assert(__negvdi2(2) == -2); - assert(__addvsi3(2, 3) == 5); - assert(__addvdi3(2, 3) == 5); - assert(__subvsi3(2, 3) == -1); - assert(__subvdi3(2, 3) == -1); - assert(__mulvsi3(2, 3) == 6); - assert(__mulvdi3(2, 3) == 6); - assert(__cmpdi2(3, 2) == 2); - assert(__ucmpdi2(3, 2) == 2); - assert(__fixsfdi(2.0) == 2); - assert(__fixdfdi(2.0) == 2); - assert(__fixunssfsi(2.0) == 2); - assert(__fixunsdfsi(2.0) == 2); - assert(__fixunssfdi(2.0) == 2); - assert(__fixunsdfdi(2.0) == 2); - assert(__floatdisf(2) == 2.0); - assert(__floatdidf(2) == 2.0); - assert(__floatundisf(2) == 2.0); - assert(__floatundidf(2) == 2.0); - assert(__powisf2(2.0, 2) == 4.0); - assert(__powidf2(2.0, 2) == 4.0); - - // FIXME: Clang/LLVM seems to be miscompiling _Complex currently, probably an - // ABI issue. -#ifndef __arm - { - _Complex float a = __mulsc3(1.0, 2.0, 4.0, 8.0); - _Complex float b = (-12.0 + 16.0j); - fprintf(stderr, "a: (%f + %f), b: (%f + %f)\n", - __real a, __imag a, __real b, __imag b); - } - assert(__mulsc3(1.0, 2.0, 4.0, 8.0) == (-12.0 + 16.0j)); - assert(__muldc3(1.0, 2.0, 4.0, 8.0) == (-12.0 + 16.0j)); - assert(__divsc3(1.0, 2.0, 4.0, 8.0) == (0.25 + 0j)); - assert(__divdc3(1.0, 2.0, 4.0, 8.0) == (0.25 + 0j)); -#endif - -#ifdef HAS_LONG_DOUBLE - assert(__divxc3(1.0, 2.0, 4.0, 8.0) == (0.25 + 0j)); - assert(__fixunsxfdi(2.0) == 2); - assert(__fixunsxfsi(2.0) == 2); - assert(__fixxfdi(2.0) == 2); - assert(__floatdixf(2) == 2.0); - assert(__floatundixf(2) == 2); - assert(__mulxc3(1.0, 2.0, 4.0, 8.0) == (-12.0 + 16.0j)); - assert(__powixf2(2.0, 2) == 4.0); -#endif - - // Test some calls which are used on armv6/thumb. The calls/prototypes are - // fake, it would be nice to test correctness, but mostly we just want to - // make sure we resolve symbols correctly. -#if defined(__arm) && defined(__ARM_ARCH_6K__) && defined(__thumb__) - if (argc == 100) { - extern void __restore_vfp_d8_d15_regs(void), __save_vfp_d8_d15_regs(void); - extern void __switch8(void), __switchu8(void), - __switch16(void), __switch32(void); - extern void __addsf3vfp(void); - - __addsf3vfp(); - __restore_vfp_d8_d15_regs(); - __save_vfp_d8_d15_regs(); - __switch8(); - __switchu8(); - __switch16(); - __switch32(); - } -#endif - - fprintf(stderr, " OK!\n"); - - return 0; -} diff --git a/contrib/llvm/tools/clang/utils/OptionalTests/README.txt b/contrib/llvm/tools/clang/utils/OptionalTests/README.txt deleted file mode 100644 index 4ffdb3bb0d1a..000000000000 --- a/contrib/llvm/tools/clang/utils/OptionalTests/README.txt +++ /dev/null @@ -1,4 +0,0 @@ -This is a dumping ground for additional tests which do not fit cleanly into the -clang regression tests. For example, tests which are not portable, require -additional software or configuration, take an excessive time to run, or are -flaky can be kept here. diff --git a/contrib/llvm/tools/clang/utils/OptionalTests/lit.cfg b/contrib/llvm/tools/clang/utils/OptionalTests/lit.cfg deleted file mode 100644 index 592c42472525..000000000000 --- a/contrib/llvm/tools/clang/utils/OptionalTests/lit.cfg +++ /dev/null @@ -1,26 +0,0 @@ -# -*- Python -*- - -# Configuration file for the 'lit' test runner. - -# Load the main clang test config so we can leech its clang finding logic. -lit.load_config(config, os.path.join(os.path.dirname(__file__), - '..', '..', 'test', 'lit.cfg')) -assert config.clang, "Failed to set clang!?" - -# name: The name of this test suite. -config.name = 'Clang-Opt-Tests' - -# suffixes: A list of file extensions to treat as test files. -config.suffixes = [] - -# Reset these from the Clang config. - -# test_source_root: The root path where tests are located. -config.test_source_root = os.path.dirname(__file__) - -# test_exec_root: The root path where tests should be run. -clang_obj_root = getattr(config, 'clang_obj_root', None) -if clang_obj_root is not None: - config.test_exec_root = os.path.join(clang_obj_root, 'utils', - 'OptionalTests') - diff --git a/contrib/llvm/tools/clang/utils/SummarizeErrors b/contrib/llvm/tools/clang/utils/SummarizeErrors deleted file mode 100755 index b6e9122b74cf..000000000000 --- a/contrib/llvm/tools/clang/utils/SummarizeErrors +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env python - -import os, sys, re - -class multidict: - def __init__(self, elts=()): - self.data = {} - for key,value in elts: - self[key] = value - - def __getitem__(self, item): - return self.data[item] - def __setitem__(self, key, value): - if key in self.data: - self.data[key].append(value) - else: - self.data[key] = [value] - def items(self): - return self.data.items() - def values(self): - return self.data.values() - def keys(self): - return self.data.keys() - def __len__(self): - return len(self.data) - -kDiagnosticRE = re.compile(': (error|warning): (.*)') -kAssertionRE = re.compile('Assertion failed: (.*, function .*, file .*, line [0-9]+\\.)') - -def readInfo(path, opts): - lastProgress = [-100,0] - def progress(pos): - pct = (100. * pos) / (size * 2) - if (pct - lastProgress[0]) >= 10: - lastProgress[0] = pct - print '%d/%d = %.2f%%' % (pos, size*2, pct) - - f = open(path) - data = f.read() - f.close() - - if opts.truncate != -1: - data = data[:opts.truncate] - - size = len(data) - warnings = multidict() - errors = multidict() - for m in kDiagnosticRE.finditer(data): - progress(m.end()) - if m.group(1) == 'error': - d = errors - else: - d = warnings - d[m.group(2)] = m - warnings = warnings.items() - errors = errors.items() - assertions = multidict() - for m in kAssertionRE.finditer(data): - print '%d/%d = %.2f%%' % (size + m.end(), size, (float(m.end()) / (size*2)) * 100.) - assertions[m.group(1)] = m - assertions = assertions.items() - - # Manual scan for stack traces - aborts = multidict() - if 0: - prevLine = None - lnIter = iter(data.split('\n')) - for ln in lnIter: - m = kStackDumpLineRE.match(ln) - if m: - stack = [m.group(2)] - for ln in lnIter: - m = kStackDumpLineRE.match(ln) - if not m: - break - stack.append(m.group(2)) - if prevLine is None or not kAssertionRE.match(prevLine): - aborts[tuple(stack)] = stack - prevLine = ln - - sections = [ - (warnings, 'Warnings'), - (errors, 'Errors'), - (assertions, 'Assertions'), - (aborts.items(), 'Aborts'), - ] - - if opts.ascending: - sections.reverse() - - for l,title in sections: - l.sort(key = lambda (a,b): -len(b)) - if l: - print '-- %d %s (%d kinds) --' % (sum([len(b) for a,b in l]), title, len(l)) - for name,elts in l: - print '%5d:' % len(elts), name - -def main(): - global options - from optparse import OptionParser - parser = OptionParser("usage: %prog [options] {inputs}") - parser.add_option("", "--ascending", dest="ascending", - help="Print output in ascending order of severity.", - action="store_true", default=False) - parser.add_option("", "--truncate", dest="truncate", - help="Truncate input file (for testing).", - type=int, action="store", default=-1) - (opts, args) = parser.parse_args() - - if not args: - parser.error('No inputs specified') - - for arg in args: - readInfo(arg, opts) - -if __name__=='__main__': - main() diff --git a/contrib/llvm/tools/clang/utils/TestUtils/deep-stack.py b/contrib/llvm/tools/clang/utils/TestUtils/deep-stack.py deleted file mode 100755 index 1750a5fca031..000000000000 --- a/contrib/llvm/tools/clang/utils/TestUtils/deep-stack.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python - -def pcall(f, N): - if N == 0: - print >>f, ' f(0)' - return - - print >>f, ' f(' - pcall(f, N - 1) - print >>f, ' )' - -def main(): - f = open('t.c','w') - print >>f, 'int f(int n) { return n; }' - print >>f, 'int t() {' - print >>f, ' return' - pcall(f, 10000) - print >>f, ' ;' - print >>f, '}' - -if __name__ == "__main__": - import sys - sys.setrecursionlimit(100000) - main() diff --git a/contrib/llvm/tools/clang/utils/TestUtils/pch-test.pl b/contrib/llvm/tools/clang/utils/TestUtils/pch-test.pl deleted file mode 100755 index e4311e965bb7..000000000000 --- a/contrib/llvm/tools/clang/utils/TestUtils/pch-test.pl +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/perl -w - -# This tiny little script, which should be run from the clang -# directory (with clang in your patch), tries to take each -# compilable Clang test and build a PCH file from that test, then read -# and dump the contents of the PCH file just created. -use POSIX; - -$exitcode = 0; -sub testfiles($$) { - my $suffix = shift; - my $language = shift; - my $passed = 0; - my $failed = 0; - my $skipped = 0; - - @files = `ls test/*/*.$suffix`; - foreach $file (@files) { - chomp($file); - my $code = system("clang -fsyntax-only -x $language $file > /dev/null 2>&1"); - if ($code == 0) { - print("."); - $code = system("clang -cc1 -emit-pch -x $language -o $file.pch $file > /dev/null 2>&1"); - if ($code == 0) { - $code = system("clang -cc1 -include-pch $file.pch -x $language -ast-dump /dev/null > /dev/null 2>&1"); - if ($code == 0) { - $passed++; - } elsif (($code & 0xFF) == SIGINT) { - exit($exitcode); - } else { - print("\n---Failed to dump AST file for \"$file\"---\n"); - $exitcode = 1; - $failed++; - } - unlink "$file.pch"; - } elsif (($code & 0xFF) == SIGINT) { - exit($exitcode); - } else { - print("\n---Failed to build PCH file for \"$file\"---\n"); - $exitcode = 1; - $failed++; - } - } elsif (($code & 0xFF) == SIGINT) { - exit($exitcode); - } else { - print("x"); - $skipped++; - } - } - - print("\n\n$passed tests passed\n"); - print("$failed tests failed\n"); - print("$skipped tests skipped ('x')\n") -} - -printf("-----Testing precompiled headers for C-----\n"); -testfiles("c", "c"); -printf("\n-----Testing precompiled headers for Objective-C-----\n"); -testfiles("m", "objective-c"); -print("\n"); -exit($exitcode); diff --git a/contrib/llvm/tools/clang/utils/VtableTest/Makefile b/contrib/llvm/tools/clang/utils/VtableTest/Makefile deleted file mode 100644 index dd615aef6a92..000000000000 --- a/contrib/llvm/tools/clang/utils/VtableTest/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -GXX := llvm-g++-4.2 -CLANGXX := clang++ - -all: one - -test.cc: gen.cc - g++ gen.cc -o gen - ./gen >test.cc - -test-gcc.sum: test.cc - time $(GXX) test.cc -o test-gcc.s -S - $(GXX) test-gcc.s -o test-gcc - ./test-gcc >test-gcc.sum - -test-clang.sum: test.cc - time $(CLANGXX) test.cc -o test-clang.s -S - $(CLANGXX) test-clang.s -o test-clang - ./test-clang >test-clang.sum - -one: test-gcc.sum test-clang.sum - cmp test-gcc.sum test-clang.sum - -clean: - rm -f gen test-gcc test-clang test.cc test-gcc.sum test-clang.sum test-gcc.s test-clang.s diff --git a/contrib/llvm/tools/clang/utils/VtableTest/check-zti b/contrib/llvm/tools/clang/utils/VtableTest/check-zti deleted file mode 100755 index bf5b045d81d2..000000000000 --- a/contrib/llvm/tools/clang/utils/VtableTest/check-zti +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -N_STRUCTS=300 - -# Utility routine to "hand" check type infos. - -let i=1; -while [ $i != $N_STRUCTS ]; do - sed -n "/^__ZTI.*s$i:/,/\.[sg][el]/p" test-clang.s | - grep -v '\.[sg][el]' | sed 's/(\([0-9][0-9]*\))/\1/' >test-clang-zti - sed -n "/^__ZTI.*s$i:/,/\.[sg][el]/p" test-gcc.s | - grep -v '\.[sg][el]' | sed 's/(\([0-9][0-9]*\))/\1/' >test-gcc-zti - diff -U3 test-gcc-zti test-clang-zti - if [ $? != 0 ]; then - echo "FAIL: s$i type info" - else - echo "PASS: s$i type info" - fi - let i=i+1 -done diff --git a/contrib/llvm/tools/clang/utils/VtableTest/check-ztt b/contrib/llvm/tools/clang/utils/VtableTest/check-ztt deleted file mode 100755 index 4a83c55796a4..000000000000 --- a/contrib/llvm/tools/clang/utils/VtableTest/check-ztt +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -N_STRUCTS=300 - -# Utility routine to "hand" check VTTs. - -let i=1; -while [ $i != $N_STRUCTS ]; do - sed -n "/^__ZTT.*s$i:/,/\.[sgm][elo]/p" test-clang.s | - grep -v '\.[sgm][elo]' | sed -e 's/[()]//g' -e '/^$/d' >test-clang-ztt - sed -n "/^__ZTT.*s$i:/,/\.[sgm][elo]/p" test-gcc.s | - grep -v '\.[sgm][elo]' | sed -e 's/[()]//g' -e 's/ + /+/' >test-gcc-ztt - diff -U3 test-gcc-ztt test-clang-ztt - if [ $? != 0 ]; then - echo "FAIL: s$i VTT" - else - echo "PASS: s$i VTT" - fi - let i=i+1 -done diff --git a/contrib/llvm/tools/clang/utils/VtableTest/check-zvt b/contrib/llvm/tools/clang/utils/VtableTest/check-zvt deleted file mode 100755 index d8b93bd01fa1..000000000000 --- a/contrib/llvm/tools/clang/utils/VtableTest/check-zvt +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -N_STRUCTS=300 - -# Utility routine to "hand" check vtables. - -let i=1; -while [ $i != $N_STRUCTS ]; do - sed -n "/^__ZTV.*s$i:/,/\.[sg][el]/p" test-clang.s | grep -v '\.[sg][el]' >test-clang-ztv - sed -n "/^__ZTV.*s$i:/,/\.[sg][el]/p" test-gcc.s | grep -v '\.[sg][el]' >test-gcc-ztv - diff -U3 test-gcc-ztv test-clang-ztv - if [ $? != 0 ]; then - echo "FAIL: s$i vtable" - else - echo "PASS: s$i vtable" - fi - let i=i+1 -done diff --git a/contrib/llvm/tools/clang/utils/VtableTest/gen.cc b/contrib/llvm/tools/clang/utils/VtableTest/gen.cc deleted file mode 100644 index 8396f8d138b3..000000000000 --- a/contrib/llvm/tools/clang/utils/VtableTest/gen.cc +++ /dev/null @@ -1,350 +0,0 @@ -#include -#include - -#define N_FIELDS 7 -#define N_FUNCS 128 -#define FUNCSPACING 20 -#define N_STRUCTS 180 /* 1280 */ -#define N_BASES 6 -#define COVARIANT 0 - -const char *simple_types[] = { "bool", "char", "short", "int", "float", - "double", "long double", "wchar_t", "void *", - "char *" -}; - -void gl(const char *c) { - printf("%s\n", c); -} - -void g(const char *c) { - printf("%s", c); -} - -void g(int i) { - printf("%d", i); -} - -int uuid = 0; -char base_present[N_STRUCTS][N_STRUCTS]; - -// The return type for each function when doing covariant testcase generation. -short ret_types[N_STRUCTS][N_FUNCS*FUNCSPACING]; - -bool is_ambiguous(int s, int base) { - for (int i = 0; i < N_STRUCTS; ++i) { - if ((base_present[base][i] & base_present[s][i]) == 1) - return true; - } - return false; -} - -void add_bases(int s, int base) { - for (int i = 0; i < N_STRUCTS; ++i) - base_present[s][i] |= base_present[base][i]; - if (!COVARIANT) - return; - for (int i = 0; i < N_FUNCS*FUNCSPACING; ++i) { - if (!ret_types[base][i]) - continue; - if (!ret_types[s][i]) { - ret_types[s][i] = ret_types[base][i]; - continue; - } - if (base_present[ret_types[base][i]][ret_types[s][i]]) - // If the return type of the function from this base dominates - ret_types[s][i] = ret_types[base][i]; - if (base_present[ret_types[s][i]][ret_types[base][i]]) - // If a previous base dominates - continue; - // If neither dominates, we'll use this class. - ret_types[s][i] = s; - } -} - -// This contains the class that has the final override for -// each class, for each function. -short final_override[N_STRUCTS][N_FUNCS*FUNCSPACING]; - -void gs(int s) { - bool polymorphic = false; - - static int bases[N_BASES]; - int i_bases = random() % (N_BASES*2); - if (i_bases >= N_BASES) - // PARAM: 1/2 of all clases should have no bases - i_bases = 0; - int n_bases = 0; - bool first_base = true; - - // PARAM: 3/4 of all should be class, the rest are structs - if (random() % 4 == 0) - g("struct s"); - else - g("class s"); - g(s); - int old_base = -1; - if (s == 0 || s == 1) - i_bases = 0; - while (i_bases) { - --i_bases; - int base = random() % (s-1) + 1; - if (!base_present[s][base]) { - if (is_ambiguous(s, base)) - continue; - if (first_base) { - first_base = false; - g(": "); - } else - g(", "); - int base_type = 1; - if (random()%8 == 0) { - // PARAM: 1/8th the bases are virtual - g("virtual "); - // We have a vtable and rtti, but technically we're not polymorphic - // polymorphic = true; - base_type = 3; - } - // PARAM: 1/4 are public, 1/8 are privare, 1/8 are protected, the reset, default - int base_protection = 0; - if (!COVARIANT) - base_protection = random()%8; - switch (base_protection) { - case 0: - case 1: - g("public "); break; - case 2: - case 3: - case 4: - case 5: - break; - case 6: - g("private "); break; - case 7: - g("protected "); break; - } - g("s"); - add_bases(s, base); - bases[n_bases] = base; - base_present[s][base] = base_type; - ++n_bases; - g(base); - old_base = base; - } - } - gl(" {"); - - /* Fields */ - int n_fields = N_FIELDS == 0 ? 0 : random() % (N_FIELDS*4); - // PARAM: 3/4 of all structs should have no members - if (n_fields >= N_FIELDS) - n_fields = 0; - for (int i = 0; i < n_fields; ++i) { - int t = random() % (sizeof(simple_types) / sizeof(simple_types[0])); - g(" "); g(simple_types[t]); g(" field"); g(i); gl(";"); - } - - /* Virtual functions */ - static int funcs[N_FUNCS*FUNCSPACING]; - // PARAM: 1/2 of all structs should have no virtual functions - int n_funcs = random() % (N_FUNCS*2); - if (n_funcs > N_FUNCS) - n_funcs = 0; - int old_func = -1; - for (int i = 0; i < n_funcs; ++i) { - int fn = old_func + random() % FUNCSPACING + 1; - funcs[i] = fn; - int ret_type = 0; - if (COVARIANT) { - ret_type = random() % s + 1; - if (!base_present[s][ret_type] - || !base_present[ret_type][ret_types[s][fn]]) - if (ret_types[s][fn]) { - printf(" // Found one for s%d for s%d* fun%d.\n", s, - ret_types[s][fn], fn); - ret_type = ret_types[s][fn]; - } else - ret_type = s; - else - printf(" // Wow found one for s%d for fun%d.\n", s, fn); - ret_types[s][fn] = ret_type; - } - if (ret_type) { - g(" virtual s"); g(ret_type); g("* fun"); - } else - g(" virtual void fun"); - g(fn); g("(char *t) { mix(\"vfn this offset\", (char *)this - t); mix(\"vfn uuid\", "); g(++uuid); - if (ret_type) - gl("); return 0; }"); - else - gl("); }"); - final_override[s][fn] = s; - old_func = fn; - } - - // Add required overriders for correctness - for (int i = 0; i < n_bases; ++i) { - // For each base - int base = bases[i]; - for (int fn = 0; fn < N_FUNCS*FUNCSPACING; ++fn) { - // For each possible function - int new_base = final_override[base][fn]; - if (new_base == 0) - // If the base didn't have a final overrider, skip - continue; - - int prev_base = final_override[s][fn]; - if (prev_base == s) - // Skip functions defined in this class - continue; - - // If we don't want to change the info, skip - if (prev_base == new_base) - continue; - - if (prev_base == 0) { - // record the final override - final_override[s][fn] = new_base; - continue; - } - - if (base_present[prev_base][new_base]) { - // The previous base dominates the new base, no update necessary - printf(" // No override for fun%d in s%d as s%d dominates s%d.\n", - fn, s, prev_base, new_base); - continue; - } - - if (base_present[new_base][prev_base]) { - // The new base dominates the old base, no override necessary - printf(" // No override for fun%d in s%d as s%d dominates s%d.\n", - fn, s, new_base, prev_base); - // record the final override - final_override[s][fn] = new_base; - continue; - } - - printf(" // Found we needed override for fun%d in s%d.\n", fn, s); - - // record the final override - funcs[n_funcs++] = fn; - if (n_funcs == (N_FUNCS*FUNCSPACING-1)) - abort(); - int ret_type = 0; - if (COVARIANT) { - if (!ret_types[s][fn]) { - ret_types[s][fn] = ret_type = s; - } else { - ret_type = ret_types[s][fn]; - if (ret_type != s) - printf(" // Calculated return type in s%d as s%d* fun%d.\n", - s, ret_type, fn); - } - } - if (ret_type) { - g(" virtual s"); g(ret_type); g("* fun"); - } else - g(" virtual void fun"); - g(fn); g("(char *t) { mix(\"vfn this offset\", (char *)this - t); mix(\"vfn uuid\", "); g(++uuid); - if (ret_type) - gl("); return 0; }"); - else - gl("); }"); - final_override[s][fn] = s; - } - } - - gl("public:"); - gl(" void calc(char *t) {"); - - // mix in the type number - g(" mix(\"type num\", "); g(s); gl(");"); - // mix in the size - g(" mix(\"type size\", sizeof (s"); g(s); gl("));"); - // mix in the this offset - gl(" mix(\"subobject offset\", (char *)this - t);"); - if (n_funcs) - polymorphic = true; - if (polymorphic) { - // mix in offset to the complete object under construction - gl(" mix(\"real top v current top\", t - (char *)dynamic_cast(this));"); - } - - /* check base layout and overrides */ - for (int i = 0; i < n_bases; ++i) { - g(" calc_s"); g(bases[i]); gl("(t);"); - } - - if (polymorphic) { - /* check dynamic_cast to each direct base */ - for (int i = 0; i < n_bases; ++i) { - g(" if ((char *)dynamic_cast(this))"); - g(" mix(\"base dyn cast\", t - (char *)dynamic_cast(this));"); - g(" else mix(\"no dyncast\", "); g(++uuid); gl(");"); - } - } - - /* check field layout */ - for (int i = 0; i < n_fields; ++i) { - g(" mix(\"field offset\", (char *)&field"); g(i); gl(" - (char *)this);"); - } - if (n_fields == 0) { - g(" mix(\"no fields\", "); g(++uuid); gl(");"); - } - - /* check functions */ - for (int i = 0; i < n_funcs; ++i) { - g(" fun"); g(funcs[i]); gl("(t);"); - } - if (n_funcs == 0) { - g(" mix(\"no funcs\", "); g(++uuid); gl(");"); - } - - gl(" }"); - - // default ctor - g(" s"); g(s); g("() "); - first_base = true; - for (int i = 0; i < n_bases; ++i) { - if (first_base) { - g(": "); - first_base = false; - } else - g(", "); - g("s"); g(bases[i]); g("((char *)this)"); - } - gl(" { calc((char *)this); }"); - g(" ~s"); g(s); gl("() { calc((char *)this); }"); - - // ctor with this to the complete object - g(" s"); g(s); gl("(char *t) { calc(t); }"); - g(" void calc_s"); g(s); gl("(char *t) { calc(t); }"); - g("} a"); g(s); gl(";"); -} - -main(int argc, char **argv) { - unsigned seed = 0; - char state[16]; - if (argc > 1) - seed = atol(argv[1]); - - initstate(seed, state, sizeof(state)); - gl("extern \"C\" int printf(const char *...);"); - gl(""); - gl("long long sum;"); - gl("void mix(const char *desc, long long i) {"); - // If this ever becomes too slow, we can remove this after we improve the - // mixing function - gl(" printf(\"%s: %lld\\n\", desc, i);"); - gl(" sum += ((sum ^ i) << 3) + (sum<<1) - i;"); - gl("}"); - gl(""); - // PARAM: Randomly size testcases or large testcases? - int n_structs = /* random() % */ N_STRUCTS; - for (int i = 1; i < n_structs; ++i) - gs(i); - gl("int main() {"); - gl(" printf(\"%llx\\n\", sum);"); - gl("}"); - return 0; -} diff --git a/contrib/llvm/tools/clang/utils/analyzer/CmpRuns b/contrib/llvm/tools/clang/utils/analyzer/CmpRuns deleted file mode 100755 index 739d5847734d..000000000000 --- a/contrib/llvm/tools/clang/utils/analyzer/CmpRuns +++ /dev/null @@ -1,230 +0,0 @@ -#!/usr/bin/env python - -""" -CmpRuns - A simple tool for comparing two static analyzer runs to determine -which reports have been added, removed, or changed. - -This is designed to support automated testing using the static analyzer, from -two perspectives: - 1. To monitor changes in the static analyzer's reports on real code bases, for - regression testing. - - 2. For use by end users who want to integrate regular static analyzer testing - into a buildbot like environment. -""" - -import os -import plistlib - -# - -class multidict: - def __init__(self, elts=()): - self.data = {} - for key,value in elts: - self[key] = value - - def __getitem__(self, item): - return self.data[item] - def __setitem__(self, key, value): - if key in self.data: - self.data[key].append(value) - else: - self.data[key] = [value] - def items(self): - return self.data.items() - def values(self): - return self.data.values() - def keys(self): - return self.data.keys() - def __len__(self): - return len(self.data) - def get(self, key, default=None): - return self.data.get(key, default) - -# - -class AnalysisReport: - def __init__(self, run, files): - self.run = run - self.files = files - -class AnalysisDiagnostic: - def __init__(self, data, report, htmlReport): - self.data = data - self.report = report - self.htmlReport = htmlReport - - def getReadableName(self): - loc = self.data['location'] - filename = self.report.run.getSourceName(self.report.files[loc['file']]) - line = loc['line'] - column = loc['col'] - - # FIXME: Get a report number based on this key, to 'distinguish' - # reports, or something. - - return '%s:%d:%d' % (filename, line, column) - - def getReportData(self): - if self.htmlReport is None: - return "This diagnostic does not have any report data." - - return open(os.path.join(self.report.run.path, - self.htmlReport), "rb").read() - -class AnalysisRun: - def __init__(self, path, opts): - self.path = path - self.reports = [] - self.diagnostics = [] - self.opts = opts - - def getSourceName(self, path): - if path.startswith(self.opts.root): - return path[len(self.opts.root):] - return path - -def loadResults(path, opts): - run = AnalysisRun(path, opts) - - for f in os.listdir(path): - if (not f.startswith('report') or - not f.endswith('plist')): - continue - - p = os.path.join(path, f) - data = plistlib.readPlist(p) - - # Ignore empty reports. - if not data['files']: - continue - - # Extract the HTML reports, if they exists. - if 'HTMLDiagnostics_files' in data['diagnostics'][0]: - htmlFiles = [] - for d in data['diagnostics']: - # FIXME: Why is this named files, when does it have multiple - # files? - assert len(d['HTMLDiagnostics_files']) == 1 - htmlFiles.append(d.pop('HTMLDiagnostics_files')[0]) - else: - htmlFiles = [None] * len(data['diagnostics']) - - report = AnalysisReport(run, data.pop('files')) - diagnostics = [AnalysisDiagnostic(d, report, h) - for d,h in zip(data.pop('diagnostics'), - htmlFiles)] - - assert not data - - run.reports.append(report) - run.diagnostics.extend(diagnostics) - - return run - -def compareResults(A, B): - """ - compareResults - Generate a relation from diagnostics in run A to - diagnostics in run B. - - The result is the relation as a list of triples (a, b, confidence) where - each element {a,b} is None or an element from the respective run, and - confidence is a measure of the match quality (where 0 indicates equality, - and None is used if either element is None). - """ - - res = [] - - # Quickly eliminate equal elements. - neqA = [] - neqB = [] - eltsA = list(A.diagnostics) - eltsB = list(B.diagnostics) - eltsA.sort(key = lambda d: d.data) - eltsB.sort(key = lambda d: d.data) - while eltsA and eltsB: - a = eltsA.pop() - b = eltsB.pop() - if a.data == b.data: - res.append((a, b, 0)) - elif a.data > b.data: - neqA.append(a) - eltsB.append(b) - else: - neqB.append(b) - eltsA.append(a) - neqA.extend(eltsA) - neqB.extend(eltsB) - - # FIXME: Add fuzzy matching. One simple and possible effective idea would be - # to bin the diagnostics, print them in a normalized form (based solely on - # the structure of the diagnostic), compute the diff, then use that as the - # basis for matching. This has the nice property that we don't depend in any - # way on the diagnostic format. - - for a in neqA: - res.append((a, None, None)) - for b in neqB: - res.append((None, b, None)) - - return res - -def main(): - from optparse import OptionParser - parser = OptionParser("usage: %prog [options] [dir A] [dir B]") - parser.add_option("", "--root", dest="root", - help="Prefix to ignore on source files", - action="store", type=str, default="") - parser.add_option("", "--verbose-log", dest="verboseLog", - help="Write additional information to LOG [default=None]", - action="store", type=str, default=None, - metavar="LOG") - (opts, args) = parser.parse_args() - - if len(args) != 2: - parser.error("invalid number of arguments") - - dirA,dirB = args - - # Load the run results. - resultsA = loadResults(dirA, opts) - resultsB = loadResults(dirB, opts) - - # Open the verbose log, if given. - if opts.verboseLog: - auxLog = open(opts.verboseLog, "wb") - else: - auxLog = None - - diff = compareResults(resultsA, resultsB) - for res in diff: - a,b,confidence = res - if a is None: - print "ADDED: %r" % b.getReadableName() - if auxLog: - print >>auxLog, ("('ADDED', %r, %r)" % (b.getReadableName(), - b.getReportData())) - elif b is None: - print "REMOVED: %r" % a.getReadableName() - if auxLog: - print >>auxLog, ("('REMOVED', %r, %r)" % (a.getReadableName(), - a.getReportData())) - elif confidence: - print "CHANGED: %r to %r" % (a.getReadableName(), - b.getReadableName()) - if auxLog: - print >>auxLog, ("('CHANGED', %r, %r, %r, %r)" - % (a.getReadableName(), - b.getReadableName(), - a.getReportData(), - b.getReportData())) - else: - pass - - print "TOTAL REPORTS: %r" % len(resultsB.diagnostics) - if auxLog: - print >>auxLog, "('TOTAL', %r)" % len(resultsB.diagnostics) - -if __name__ == '__main__': - main() diff --git a/contrib/llvm/tools/clang/utils/analyzer/ubiviz b/contrib/llvm/tools/clang/utils/analyzer/ubiviz deleted file mode 100755 index 1582797c63f9..000000000000 --- a/contrib/llvm/tools/clang/utils/analyzer/ubiviz +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -# -# This script reads visualization data emitted by the static analyzer for -# display in Ubigraph. -# -##===----------------------------------------------------------------------===## - -import xmlrpclib -import sys - -def Error(message): - print >> sys.stderr, 'ubiviz: ' + message - sys.exit(1) - -def StreamData(filename): - file = open(filename) - for ln in file: - yield eval(ln) - file.close() - -def Display(G, data): - action = data[0] - if action == 'vertex': - vertex = data[1] - G.new_vertex_w_id(vertex) - for attribute in data[2:]: - G.set_vertex_attribute(vertex, attribute[0], attribute[1]) - elif action == 'edge': - src = data[1] - dst = data[2] - edge = G.new_edge(src,dst) - for attribute in data[3:]: - G.set_edge_attribute(edge, attribute[0], attribute[1]) - elif action == "vertex_style": - style_id = data[1] - parent_id = data[2] - G.new_vertex_style_w_id(style_id, parent_id) - for attribute in data[3:]: - G.set_vertex_style_attribute(style_id, attribute[0], attribute[1]) - elif action == "vertex_style_attribute": - style_id = data[1] - for attribute in data[2:]: - G.set_vertex_style_attribute(style_id, attribute[0], attribute[1]) - elif action == "change_vertex_style": - vertex_id = data[1] - style_id = data[2] - G.change_vertex_style(vertex_id,style_id) - -def main(args): - if len(args) == 0: - Error('no input files') - - server = xmlrpclib.Server('http://127.0.0.1:20738/RPC2') - G = server.ubigraph - - for arg in args: - G.clear() - for x in StreamData(arg): - Display(G,x) - - sys.exit(0) - - -if __name__ == '__main__': - main(sys.argv[1:]) - - \ No newline at end of file diff --git a/contrib/llvm/tools/clang/utils/builtin-defines.c b/contrib/llvm/tools/clang/utils/builtin-defines.c deleted file mode 100644 index 9bbe5be25026..000000000000 --- a/contrib/llvm/tools/clang/utils/builtin-defines.c +++ /dev/null @@ -1,85 +0,0 @@ -/* -This is a clang style test case for checking that preprocessor -defines match gcc. -*/ - -/* -RUN: for arch in -m32 -m64; do \ -RUN: for lang in -std=gnu89 -ansi -std=c99 -std=gnu99; do \ -RUN: for input in c objective-c; do \ -RUN: for opts in "-O0" "-O1 -dynamic" "-O2 -static" "-Os"; do \ -RUN: echo "-- $arch, $lang, $input, $opts --"; \ -RUN: for cc in 0 1; do \ -RUN: if [ "$cc" == 0 ]; then \ -RUN: cc_prog=clang; \ -RUN: output=%t0; \ -RUN: else \ -RUN: cc_prog=gcc; \ -RUN: output=%t1; \ -RUN: fi; \ -RUN: $cc_prog $arch $lang $opts -march=core2 -dM -E -x $input %s | sort > $output; \ -RUN: done; \ -RUN: if (! diff %t0 %t1); then exit 1; fi; \ -RUN: done; \ -RUN: done; \ -RUN: done; \ -RUN: done; -*/ - -/* We don't care about this difference */ -#ifdef __PIC__ -#if __PIC__ == 1 -#undef __PIC__ -#undef __pic__ -#define __PIC__ 2 -#define __pic__ 2 -#endif -#endif - -/* Undefine things we don't expect to match. */ -#undef __core2 -#undef __core2__ -#undef __SSSE3__ - -/* Undefine things we don't expect to match. */ -#undef __DEC_EVAL_METHOD__ -#undef __INT16_TYPE__ -#undef __INT32_TYPE__ -#undef __INT64_TYPE__ -#undef __INT8_TYPE__ -#undef __SSP__ -#undef __APPLE_CC__ -#undef __VERSION__ -#undef __clang__ -#undef __llvm__ -#undef __nocona -#undef __nocona__ -#undef __k8 -#undef __k8__ -#undef __tune_nocona__ -#undef __tune_core2__ -#undef __POINTER_WIDTH__ -#undef __INTPTR_TYPE__ -#undef __NO_MATH_INLINES - -#undef __DEC128_DEN__ -#undef __DEC128_EPSILON__ -#undef __DEC128_MANT_DIG__ -#undef __DEC128_MAX_EXP__ -#undef __DEC128_MAX__ -#undef __DEC128_MIN_EXP__ -#undef __DEC128_MIN__ -#undef __DEC32_DEN__ -#undef __DEC32_EPSILON__ -#undef __DEC32_MANT_DIG__ -#undef __DEC32_MAX_EXP__ -#undef __DEC32_MAX__ -#undef __DEC32_MIN_EXP__ -#undef __DEC32_MIN__ -#undef __DEC64_DEN__ -#undef __DEC64_EPSILON__ -#undef __DEC64_MANT_DIG__ -#undef __DEC64_MAX_EXP__ -#undef __DEC64_MAX__ -#undef __DEC64_MIN_EXP__ -#undef __DEC64_MIN__ diff --git a/contrib/llvm/tools/clang/utils/clang-completion-mode.el b/contrib/llvm/tools/clang/utils/clang-completion-mode.el deleted file mode 100644 index 873127f5cd33..000000000000 --- a/contrib/llvm/tools/clang/utils/clang-completion-mode.el +++ /dev/null @@ -1,257 +0,0 @@ -;;; Clang Code-Completion minor mode, for use with C/Objective-C/C++. - -;;; Commentary: - -;; This minor mode uses Clang's command line interface for code -;; completion to provide code completion results for C, Objective-C, -;; and C++ source files. When enabled, Clang will provide -;; code-completion results in a secondary buffer based on the code -;; being typed. For example, after typing "struct " (triggered via the -;; space), Clang will provide the names of all structs visible from -;; the current scope. After typing "p->" (triggered via the ">"), -;; Clang will provide the names of all of the members of whatever -;; class/struct/union "p" points to. Note that this minor mode isn't -;; meant for serious use: it is meant to help experiment with code -;; completion based on Clang. It needs your help to make it better! -;; -;; To use the Clang code completion mode, first make sure that the -;; "clang" variable below refers to the "clang" executable, -;; which is typically installed in libexec/. Then, place -;; clang-completion-mode.el somewhere in your Emacs load path. You can -;; add a new load path to Emacs by adding some like the following to -;; your .emacs: -;; -;; (setq load-path (cons "~/.emacs.d" load-path)) -;; -;; Then, use -;; -;; M-x load-library -;; -;; to load the library in your Emacs session or add the following to -;; your .emacs to always load this mode (not recommended): -;; -;; (load-library "clang-completion-mode") -;; -;; Finally, to try Clang-based code completion in a particular buffer, -;; use M-x clang-completion-mode. When "Clang-CC" shows up in the mode -;; line, Clang's code-completion is enabled. -;; -;; Clang's code completion is based on parsing the complete source -;; file up to the point where the cursor is located. Therefore, Clang -;; needs all of the various compilation flags (include paths, dialect -;; options, etc.) to provide code-completion results. Currently, these -;; need to be placed into the clang-flags variable in a format -;; acceptable to clang. This is a hack: patches are welcome to -;; improve the interface between this Emacs mode and Clang! -;; - -;;; Code: -;;; The clang executable -(defcustom clang "clang" - "The location of the Clang compiler executable" - :type 'file - :group 'clang-completion-mode) - -;;; Extra compilation flags to pass to clang. -(defcustom clang-flags "" - "Extra flags to pass to the Clang executable. -This variable will typically contain include paths, e.g., -I~/MyProject." - :type 'string - :group 'clang-completion-mode) - -;;; The prefix header to use with Clang code completion. -(setq clang-completion-prefix-header "") - -;;; The substring we will use to filter completion results -(setq clang-completion-substring "") - -;;; The current completion buffer -(setq clang-completion-buffer nil) - -(setq clang-result-string "") - -;;; Compute the current line in the buffer -(defun current-line () - "Return the vertical position of point..." - (+ (count-lines (point-min) (point)) - (if (= (current-column) 0) 1 0) - -1)) - -;;; Set the Clang prefix header -(defun clang-prefix-header () - (interactive) - (setq clang-completion-prefix-header - (read-string "Clang prefix header> " "" clang-completion-prefix-header - ""))) - -;; Process "filter" that keeps track of the code-completion results -;; produced. We store all of the results in a string, then the -;; sentinel processes the entire string at once. -(defun clang-completion-stash-filter (proc string) - (setq clang-result-string (concat clang-result-string string))) - -;; Filter the given list based on a predicate. -(defun filter (condp lst) - (delq nil - (mapcar (lambda (x) (and (funcall condp x) x)) lst))) - -;; Determine whether -(defun is-completion-line (line) - (or (string-match "OVERLOAD:" line) - (string-match (concat "COMPLETION: " clang-completion-substring) line))) - -(defun clang-completion-display (buffer) - (let* ((all-lines (split-string clang-result-string "\n")) - (completion-lines (filter 'is-completion-line all-lines))) - (if (consp completion-lines) - (progn - ;; Erase the process buffer - (let ((cur (current-buffer))) - (set-buffer buffer) - (goto-char (point-min)) - (erase-buffer) - (set-buffer cur)) - - ;; Display the process buffer - (display-buffer buffer) - - ;; Insert the code-completion string into the process buffer. - (with-current-buffer buffer - (insert (mapconcat 'identity completion-lines "\n"))) - )))) - -;; Process "sentinal" that, on successful code completion, replaces the -;; contents of the code-completion buffer with the new code-completion results -;; and ensures that the buffer is visible. -(defun clang-completion-sentinel (proc event) - (let* ((all-lines (split-string clang-result-string "\n")) - (completion-lines (filter 'is-completion-line all-lines))) - (if (consp completion-lines) - (progn - ;; Erase the process buffer - (let ((cur (current-buffer))) - (set-buffer (process-buffer proc)) - (goto-char (point-min)) - (erase-buffer) - (set-buffer cur)) - - ;; Display the process buffer - (display-buffer (process-buffer proc)) - - ;; Insert the code-completion string into the process buffer. - (with-current-buffer (process-buffer proc) - (insert (mapconcat 'identity completion-lines "\n"))) - )))) - -(defun clang-complete () - (let* ((cc-point (concat (buffer-file-name) - ":" - (number-to-string (+ 1 (current-line))) - ":" - (number-to-string (+ 1 (current-column))))) - (cc-pch (if (equal clang-completion-prefix-header "") nil - (list "-include-pch" - (concat clang-completion-prefix-header ".pch")))) - (cc-flags (if (listp clang-flags) clang-flags nil)) - (cc-command (append `(,clang "-cc1" "-fsyntax-only") - cc-flags - cc-pch - `("-code-completion-at" ,cc-point) - (list (buffer-file-name)))) - (cc-buffer-name (concat "*Clang Completion for " (buffer-name) "*"))) - ;; Start the code-completion process - (if (buffer-file-name) - (progn - ;; If there is already a code-completion process, kill it first. - (let ((cc-proc (get-process "Clang Code-Completion"))) - (if cc-proc - (delete-process cc-proc))) - - (setq clang-completion-substring "") - (setq clang-result-string "") - (setq clang-completion-buffer cc-buffer-name) - - (let ((cc-proc (apply 'start-process - (append (list "Clang Code-Completion" cc-buffer-name) - cc-command)))) - (set-process-filter cc-proc 'clang-completion-stash-filter) - (set-process-sentinel cc-proc 'clang-completion-sentinel) - ))))) - -;; Code-completion when one of the trigger characters is typed into -;; the buffer, e.g., '(', ',' or '.'. -(defun clang-complete-self-insert (arg) - (interactive "p") - (self-insert-command arg) - (save-buffer) - (clang-complete)) - -;; When the user has typed a character that requires the filter to be -;; updated, do so (and update the display of results). -(defun clang-update-filter () - (setq clang-completion-substring (thing-at-point 'symbol)) - (if (get-process "Clang Code-Completion") - () - (clang-completion-display clang-completion-buffer) - )) - -;; Invoked when the user types an alphanumeric character or "_" to -;; update the filter for the currently-active code completion. -(defun clang-filter-self-insert (arg) - (interactive "p") - (self-insert-command arg) - (clang-update-filter) - ) - -;; Invoked when the user types the backspace key to update the filter -;; for the currently-active code completion. -(defun clang-backspace () - (interactive) - (delete-backward-char 1) - (clang-update-filter)) - -;; Invoked when the user types the delete key to update the filter -;; for the currently-active code completion. -(defun clang-delete () - (interactive) - (delete-backward-char 1) - (clang-update-filter)) - -;; Set up the keymap for the Clang minor mode. -(defvar clang-completion-mode-map nil - "Keymap for Clang Completion Mode.") - -(if (null clang-completion-mode-map) - (fset 'clang-completion-mode-map - (setq clang-completion-mode-map (make-sparse-keymap)))) - -(if (not (assq 'clang-completion-mode minor-mode-map-alist)) - (setq minor-mode-map-alist - (cons (cons 'clang-completion-mode clang-completion-mode-map) - minor-mode-map-alist))) - -;; Punctuation characters trigger code completion. -(dolist (char '("(" "," "." ">" ":" "=" ")" " ")) - (define-key clang-completion-mode-map char 'clang-complete-self-insert)) - -;; Alphanumeric characters (and "_") filter the results of the -;; currently-active code completion. -(dolist (char '("A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O" - "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z" - "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" - "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z" - "_" "0" "1" "2" "3" "4" "5" "6" "7" "8" "9")) - (define-key clang-completion-mode-map char 'clang-filter-self-insert)) - -;; Delete and backspace filter the results of the currently-active -;; code completion. -(define-key clang-completion-mode-map [(backspace)] 'clang-backspace) -(define-key clang-completion-mode-map [(delete)] 'clang-delete) - -;; Set up the Clang minor mode. -(define-minor-mode clang-completion-mode - "Clang code-completion mode" - nil - " Clang" - clang-completion-mode-map) - diff --git a/contrib/llvm/tools/clang/utils/token-delta.py b/contrib/llvm/tools/clang/utils/token-delta.py deleted file mode 100755 index 327fa9221f05..000000000000 --- a/contrib/llvm/tools/clang/utils/token-delta.py +++ /dev/null @@ -1,251 +0,0 @@ -#!/usr/bin/env python - -import os -import re -import subprocess -import sys -import tempfile - -### - -class DeltaAlgorithm(object): - def __init__(self): - self.cache = set() - - def test(self, changes): - abstract - - ### - - def getTestResult(self, changes): - # There is no reason to cache successful tests because we will - # always reduce the changeset when we see one. - - changeset = frozenset(changes) - if changeset in self.cache: - return False - elif not self.test(changes): - self.cache.add(changeset) - return False - else: - return True - - def run(self, changes, force=False): - # Make sure the initial test passes, if not then (a) either - # the user doesn't expect monotonicity, and we may end up - # doing O(N^2) tests, or (b) the test is wrong. Avoid the - # O(N^2) case unless user requests it. - if not force: - if not self.getTestResult(changes): - raise ValueError,'Initial test passed to delta fails.' - - # Check empty set first to quickly find poor test functions. - if self.getTestResult(set()): - return set() - else: - return self.delta(changes, self.split(changes)) - - def split(self, S): - """split(set) -> [sets] - - Partition a set into one or two pieces. - """ - - # There are many ways to split, we could do a better job with more - # context information (but then the API becomes grosser). - L = list(S) - mid = len(L)//2 - if mid==0: - return L, - else: - return L[:mid],L[mid:] - - def delta(self, c, sets): - # assert(reduce(set.union, sets, set()) == c) - - # If there is nothing left we can remove, we are done. - if len(sets) <= 1: - return c - - # Look for a passing subset. - res = self.search(c, sets) - if res is not None: - return res - - # Otherwise, partition sets if possible; if not we are done. - refined = sum(map(list, map(self.split, sets)), []) - if len(refined) == len(sets): - return c - - return self.delta(c, refined) - - def search(self, c, sets): - for i,S in enumerate(sets): - # If test passes on this subset alone, recurse. - if self.getTestResult(S): - return self.delta(S, self.split(S)) - - # Otherwise if we have more than two sets, see if test - # pases without this subset. - if len(sets) > 2: - complement = sum(sets[:i] + sets[i+1:],[]) - if self.getTestResult(complement): - return self.delta(complement, sets[:i] + sets[i+1:]) - -### - -class Token: - def __init__(self, type, data, flags, file, line, column): - self.type = type - self.data = data - self.flags = flags - self.file = file - self.line = line - self.column = column - -kTokenRE = re.compile(r"""([a-z_]+) '(.*)'\t(.*)\tLoc=<(.*):(.*):(.*)>""", - re.DOTALL | re.MULTILINE) - -def getTokens(path): - p = subprocess.Popen(['clang','-dump-raw-tokens',path], - stdin=subprocess.PIPE, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - out,err = p.communicate() - - tokens = [] - collect = None - for ln in err.split('\n'): - # Silly programmers refuse to print in simple machine readable - # formats. Whatever. - if collect is None: - collect = ln - else: - collect = collect + '\n' + ln - if 'Loc=<' in ln and ln.endswith('>'): - ln,collect = collect,None - tokens.append(Token(*kTokenRE.match(ln).groups())) - - return tokens - -### - -class TMBDDelta(DeltaAlgorithm): - def __init__(self, testProgram, tokenLists, log): - def patchName(name, suffix): - base,ext = os.path.splitext(name) - return base + '.' + suffix + ext - super(TMBDDelta, self).__init__() - self.testProgram = testProgram - self.tokenLists = tokenLists - self.tempFiles = [patchName(f,'tmp') - for f,_ in self.tokenLists] - self.targetFiles = [patchName(f,'ok') - for f,_ in self.tokenLists] - self.log = log - self.numTests = 0 - - def writeFiles(self, changes, fileNames): - assert len(fileNames) == len(self.tokenLists) - byFile = [[] for i in self.tokenLists] - for i,j in changes: - byFile[i].append(j) - - for i,(file,tokens) in enumerate(self.tokenLists): - f = open(fileNames[i],'w') - for j in byFile[i]: - f.write(tokens[j]) - f.close() - - return byFile - - def test(self, changes): - self.numTests += 1 - - byFile = self.writeFiles(changes, self.tempFiles) - - if self.log: - print >>sys.stderr, 'TEST - ', - if self.log > 1: - for i,(file,_) in enumerate(self.tokenLists): - indices = byFile[i] - if i: - sys.stderr.write('\n ') - sys.stderr.write('%s:%d tokens: [' % (file,len(byFile[i]))) - prev = None - for j in byFile[i]: - if prev is None or j != prev + 1: - if prev: - sys.stderr.write('%d][' % prev) - sys.stderr.write(str(j)) - sys.stderr.write(':') - prev = j - if byFile[i]: - sys.stderr.write(str(byFile[i][-1])) - sys.stderr.write('] ') - else: - print >>sys.stderr, ', '.join(['%s:%d tokens' % (file, len(byFile[i])) - for i,(file,_) in enumerate(self.tokenLists)]), - - p = subprocess.Popen([self.testProgram] + self.tempFiles) - res = p.wait() == 0 - - if res: - self.writeFiles(changes, self.targetFiles) - - if self.log: - print >>sys.stderr, '=> %s' % res - else: - if res: - print '\nSUCCESS (%d tokens)' % len(changes) - else: - sys.stderr.write('.') - - return res - - def run(self): - res = super(TMBDDelta, self).run([(i,j) - for i,(file,tokens) in enumerate(self.tokenLists) - for j in range(len(tokens))]) - self.writeFiles(res, self.targetFiles) - if not self.log: - print >>sys.stderr - return res - -def tokenBasedMultiDelta(program, files, log): - # Read in the lists of tokens. - tokenLists = [(file, [t.data for t in getTokens(file)]) - for file in files] - - numTokens = sum([len(tokens) for _,tokens in tokenLists]) - print "Delta on %s with %d tokens." % (', '.join(files), numTokens) - - tbmd = TMBDDelta(program, tokenLists, log) - - res = tbmd.run() - - print "Finished %s with %d tokens (in %d tests)." % (', '.join(tbmd.targetFiles), - len(res), - tbmd.numTests) - -def main(): - from optparse import OptionParser, OptionGroup - parser = OptionParser("%prog {files+}") - parser.add_option("", "--debug", dest="debugLevel", - help="set debug level [default %default]", - action="store", type=int, default=0) - (opts, args) = parser.parse_args() - - if len(args) <= 1: - parser.error('Invalid number of arguments.') - - program,files = args[0],args[1:] - - md = tokenBasedMultiDelta(program, files, log=opts.debugLevel) - -if __name__ == '__main__': - try: - main() - except KeyboardInterrupt: - print >>sys.stderr,'Interrupted.' - os._exit(1) # Avoid freeing our giant cache. diff --git a/contrib/llvm/tools/clang/utils/valgrind/x86_64-pc-linux-gnu_gcc-4.3.3.supp b/contrib/llvm/tools/clang/utils/valgrind/x86_64-pc-linux-gnu_gcc-4.3.3.supp deleted file mode 100644 index a86be6cb5dd7..000000000000 --- a/contrib/llvm/tools/clang/utils/valgrind/x86_64-pc-linux-gnu_gcc-4.3.3.supp +++ /dev/null @@ -1,23 +0,0 @@ -{ - libstdcxx_overlapped_memcpy_in_stable_sort_1 - Memcheck:Overlap - fun:memcpy - ... - fun:_ZSt11stable_sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIPKN4llvm5ValueEjESt6vectorIS7_SaIS7_EEEEN12_GLOBAL__N_116CstSortPredicateEEvT_SF_T0_ -} - -{ - libstdcxx_overlapped_memcpy_in_stable_sort_2 - Memcheck:Overlap - fun:memcpy - ... - fun:_ZSt11stable_sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIPKN4llvm5ValueEjESt6vectorIS7_SaIS7_EEEEN12_GLOBAL__N_116CstSortPredicateEEvT_SF_T0_ -} - -{ - libstdcxx_overlapped_memcpy_in_stable_sort_3 - Memcheck:Overlap - fun:memcpy - ... - fun:_ZSt11stable_sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIPKN4llvm4TypeEjESt6vectorIS7_SaIS7_EEEEPFbRKS7_SE_EEvT_SH_T0_ -} diff --git a/contrib/llvm/tools/edis/CMakeLists.txt b/contrib/llvm/tools/edis/CMakeLists.txt deleted file mode 100644 index 2019995dcb79..000000000000 --- a/contrib/llvm/tools/edis/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(LLVM_NO_RTTI 1) - -include_directories(${CMAKE_CURRENT_BINARY_DIR}) - -add_llvm_library(EnhancedDisassembly - ../../include/llvm-c/EnhancedDisassembly.h - EDMain.cpp -) - -set_target_properties(EnhancedDisassembly - PROPERTIES - LINKER_LANGUAGE CXX) - diff --git a/contrib/llvm/tools/edis/EDMain.cpp b/contrib/llvm/tools/edis/EDMain.cpp deleted file mode 100644 index 16855b3f45d8..000000000000 --- a/contrib/llvm/tools/edis/EDMain.cpp +++ /dev/null @@ -1,284 +0,0 @@ -//===-- EDMain.cpp - LLVM Enhanced Disassembly C API ----------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements the enhanced disassembler's public C API. -// -//===----------------------------------------------------------------------===// - -// FIXME: This code isn't layered right, the headers should be moved to -// include llvm/MC/MCDisassembler or something. -#include "../../lib/MC/MCDisassembler/EDDisassembler.h" -#include "../../lib/MC/MCDisassembler/EDInst.h" -#include "../../lib/MC/MCDisassembler/EDOperand.h" -#include "../../lib/MC/MCDisassembler/EDToken.h" -#include "llvm-c/EnhancedDisassembly.h" -using namespace llvm; - -int EDGetDisassembler(EDDisassemblerRef *disassembler, - const char *triple, - EDAssemblySyntax_t syntax) { - EDDisassembler::initialize(); - - EDDisassembler::AssemblySyntax Syntax; - switch (syntax) { - default: assert(0 && "Unknown assembly syntax!"); - case kEDAssemblySyntaxX86Intel: - Syntax = EDDisassembler::kEDAssemblySyntaxX86Intel; - break; - case kEDAssemblySyntaxX86ATT: - Syntax = EDDisassembler::kEDAssemblySyntaxX86ATT; - break; - case kEDAssemblySyntaxARMUAL: - Syntax = EDDisassembler::kEDAssemblySyntaxARMUAL; - break; - } - - EDDisassemblerRef ret = EDDisassembler::getDisassembler(triple, Syntax); - - if (!ret) - return -1; - *disassembler = ret; - return 0; -} - -int EDGetRegisterName(const char** regName, - EDDisassemblerRef disassembler, - unsigned regID) { - const char *name = ((EDDisassembler*)disassembler)->nameWithRegisterID(regID); - if (!name) - return -1; - *regName = name; - return 0; -} - -int EDRegisterIsStackPointer(EDDisassemblerRef disassembler, - unsigned regID) { - return ((EDDisassembler*)disassembler)->registerIsStackPointer(regID) ? 1 : 0; -} - -int EDRegisterIsProgramCounter(EDDisassemblerRef disassembler, - unsigned regID) { - return ((EDDisassembler*)disassembler)->registerIsProgramCounter(regID) ? 1:0; -} - -unsigned int EDCreateInsts(EDInstRef *insts, - unsigned int count, - EDDisassemblerRef disassembler, - ::EDByteReaderCallback byteReader, - uint64_t address, - void *arg) { - unsigned int index; - - for (index = 0; index < count; ++index) { - EDInst *inst = ((EDDisassembler*)disassembler)->createInst(byteReader, - address, arg); - - if (!inst) - return index; - - insts[index] = inst; - address += inst->byteSize(); - } - - return count; -} - -void EDReleaseInst(EDInstRef inst) { - delete ((EDInst*)inst); -} - -int EDInstByteSize(EDInstRef inst) { - return ((EDInst*)inst)->byteSize(); -} - -int EDGetInstString(const char **buf, - EDInstRef inst) { - return ((EDInst*)inst)->getString(*buf); -} - -int EDInstID(unsigned *instID, EDInstRef inst) { - *instID = ((EDInst*)inst)->instID(); - return 0; -} - -int EDInstIsBranch(EDInstRef inst) { - return ((EDInst*)inst)->isBranch(); -} - -int EDInstIsMove(EDInstRef inst) { - return ((EDInst*)inst)->isMove(); -} - -int EDBranchTargetID(EDInstRef inst) { - return ((EDInst*)inst)->branchTargetID(); -} - -int EDMoveSourceID(EDInstRef inst) { - return ((EDInst*)inst)->moveSourceID(); -} - -int EDMoveTargetID(EDInstRef inst) { - return ((EDInst*)inst)->moveTargetID(); -} - -int EDNumTokens(EDInstRef inst) { - return ((EDInst*)inst)->numTokens(); -} - -int EDGetToken(EDTokenRef *token, - EDInstRef inst, - int index) { - return ((EDInst*)inst)->getToken(*(EDToken**)token, index); -} - -int EDGetTokenString(const char **buf, - EDTokenRef token) { - return ((EDToken*)token)->getString(*buf); -} - -int EDOperandIndexForToken(EDTokenRef token) { - return ((EDToken*)token)->operandID(); -} - -int EDTokenIsWhitespace(EDTokenRef token) { - return ((EDToken*)token)->type() == EDToken::kTokenWhitespace; -} - -int EDTokenIsPunctuation(EDTokenRef token) { - return ((EDToken*)token)->type() == EDToken::kTokenPunctuation; -} - -int EDTokenIsOpcode(EDTokenRef token) { - return ((EDToken*)token)->type() == EDToken::kTokenOpcode; -} - -int EDTokenIsLiteral(EDTokenRef token) { - return ((EDToken*)token)->type() == EDToken::kTokenLiteral; -} - -int EDTokenIsRegister(EDTokenRef token) { - return ((EDToken*)token)->type() == EDToken::kTokenRegister; -} - -int EDTokenIsNegativeLiteral(EDTokenRef token) { - if (((EDToken*)token)->type() != EDToken::kTokenLiteral) - return -1; - - return ((EDToken*)token)->literalSign(); -} - -int EDLiteralTokenAbsoluteValue(uint64_t *value, EDTokenRef token) { - if (((EDToken*)token)->type() != EDToken::kTokenLiteral) - return -1; - - return ((EDToken*)token)->literalAbsoluteValue(*value); -} - -int EDRegisterTokenValue(unsigned *registerID, - EDTokenRef token) { - if (((EDToken*)token)->type() != EDToken::kTokenRegister) - return -1; - - return ((EDToken*)token)->registerID(*registerID); -} - -int EDNumOperands(EDInstRef inst) { - return ((EDInst*)inst)->numOperands(); -} - -int EDGetOperand(EDOperandRef *operand, - EDInstRef inst, - int index) { - return ((EDInst*)inst)->getOperand(*(EDOperand**)operand, index); -} - -int EDOperandIsRegister(EDOperandRef operand) { - return ((EDOperand*)operand)->isRegister(); -} - -int EDOperandIsImmediate(EDOperandRef operand) { - return ((EDOperand*)operand)->isImmediate(); -} - -int EDOperandIsMemory(EDOperandRef operand) { - return ((EDOperand*)operand)->isMemory(); -} - -int EDRegisterOperandValue(unsigned *value, EDOperandRef operand) { - if (!((EDOperand*)operand)->isRegister()) - return -1; - *value = ((EDOperand*)operand)->regVal(); - return 0; -} - -int EDImmediateOperandValue(uint64_t *value, EDOperandRef operand) { - if (!((EDOperand*)operand)->isImmediate()) - return -1; - *value = ((EDOperand*)operand)->immediateVal(); - return 0; -} - -int EDEvaluateOperand(uint64_t *result, EDOperandRef operand, - ::EDRegisterReaderCallback regReader, void *arg) { - return ((EDOperand*)operand)->evaluate(*result, regReader, arg); -} - -#ifdef __BLOCKS__ - -struct ByteReaderWrapper { - EDByteBlock_t byteBlock; -}; - -static int readerWrapperCallback(uint8_t *byte, - uint64_t address, - void *arg) { - struct ByteReaderWrapper *wrapper = (struct ByteReaderWrapper *)arg; - return wrapper->byteBlock(byte, address); -} - -unsigned int EDBlockCreateInsts(EDInstRef *insts, - int count, - EDDisassemblerRef disassembler, - EDByteBlock_t byteBlock, - uint64_t address) { - struct ByteReaderWrapper wrapper; - wrapper.byteBlock = byteBlock; - - return EDCreateInsts(insts, - count, - disassembler, - readerWrapperCallback, - address, - (void*)&wrapper); -} - -int EDBlockEvaluateOperand(uint64_t *result, EDOperandRef operand, - EDRegisterBlock_t regBlock) { - return ((EDOperand*)operand)->evaluate(*result, regBlock); -} - -int EDBlockVisitTokens(EDInstRef inst, ::EDTokenVisitor_t visitor) { - return ((EDInst*)inst)->visitTokens((llvm::EDTokenVisitor_t)visitor); -} - -#else - -extern "C" unsigned int EDBlockCreateInsts() { - return 0; -} - -extern "C" int EDBlockEvaluateOperand() { - return -1; -} - -extern "C" int EDBlockVisitTokens() { - return -1; -} - -#endif diff --git a/contrib/llvm/tools/edis/EnhancedDisassembly.exports b/contrib/llvm/tools/edis/EnhancedDisassembly.exports deleted file mode 100644 index 7050f7f32948..000000000000 --- a/contrib/llvm/tools/edis/EnhancedDisassembly.exports +++ /dev/null @@ -1,36 +0,0 @@ -EDGetDisassembler -EDGetRegisterName -EDRegisterIsStackPointer -EDRegisterIsProgramCounter -EDCreateInsts -EDReleaseInst -EDInstByteSize -EDGetInstString -EDInstIsBranch -EDInstIsMove -EDBranchTargetID -EDMoveSourceID -EDMoveTargetID -EDNumTokens -EDGetToken -EDGetTokenString -EDOperandIndexForToken -EDTokenIsWhitespace -EDTokenIsPunctuation -EDTokenIsOpcode -EDTokenIsLiteral -EDTokenIsRegister -EDTokenIsNegativeLiteral -EDLiteralTokenAbsoluteValue -EDRegisterTokenValue -EDNumOperands -EDGetOperand -EDOperandIsRegister -EDOperandIsImmediate -EDOperandIsMemory -EDRegisterOperandValue -EDImmediateOperandValue -EDEvaluateOperand -EDBlockCreateInsts -EDBlockEvaluateOperand -EDBlockVisitTokens diff --git a/contrib/llvm/tools/edis/Makefile b/contrib/llvm/tools/edis/Makefile deleted file mode 100644 index 92484bf0ac4d..000000000000 --- a/contrib/llvm/tools/edis/Makefile +++ /dev/null @@ -1,54 +0,0 @@ -##===- tools/ed/Makefile -----------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../.. -LIBRARYNAME = EnhancedDisassembly -LINK_LIBS_IN_SHARED = 1 -SHARED_LIBRARY = 1 - -EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/EnhancedDisassembly.exports - -# Include this here so we can get the configuration of the targets -# that have been configured for construction. We have to do this -# early so we can set up LINK_COMPONENTS before including Makefile.rules -include $(LEVEL)/Makefile.config - -LINK_COMPONENTS := mcdisassembler - -# If the X86 target is enabled, link in the asmprinter and disassembler. -ifneq ($(filter $(TARGETS_TO_BUILD), X86),) -LINK_COMPONENTS += x86asmprinter x86disassembler -endif - -# If the X86 target is enabled, link in the asmprinter and disassembler. -ifneq ($(filter $(TARGETS_TO_BUILD), ARM),) -LINK_COMPONENTS += armasmprinter armdisassembler -endif - -include $(LEVEL)/Makefile.common - -ifeq ($(HOST_OS),Darwin) - # extra options to override libtool defaults - LLVMLibsOptions := $(LLVMLibsOptions) \ - -Wl,-dead_strip - - ifdef EDIS_VERSION - LLVMLibsOptions := $(LLVMLibsOptions) -Wl,-current_version -Wl,$(EDIS_VERSION) \ - -Wl,-compatibility_version -Wl,1 - endif - - # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line - DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/') - ifneq ($(DARWIN_VERS),8) - LLVMLibsOptions := $(LLVMLibsOptions) \ - -Wl,-install_name \ - -Wl,"@rpath/lib$(LIBRARYNAME)$(SHLIBEXT)" - endif -endif - diff --git a/contrib/llvm/tools/gold/Makefile b/contrib/llvm/tools/gold/Makefile deleted file mode 100644 index 162734681070..000000000000 --- a/contrib/llvm/tools/gold/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -#===- tools/gold/Makefile ----------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../.. -LIBRARYNAME = LLVMgold - -EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/gold.exports - -# Include this here so we can get the configuration of the targets -# that have been configured for construction. We have to do this -# early so we can set up LINK_COMPONENTS before including Makefile.rules -include $(LEVEL)/Makefile.config - -LINK_LIBS_IN_SHARED=1 -SHARED_LIBRARY = 1 -BUILD_ARCHIVE = 0 -LOADABLE_MODULE = 1 - -LINK_COMPONENTS := support system -LIBS += -llto - -# Because off_t is used in the public API, the largefile parts are required for -# ABI compatibility. -CXXFLAGS+=-I$(BINUTILS_INCDIR) -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -lLTO - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/tools/gold/README.txt b/contrib/llvm/tools/gold/README.txt deleted file mode 100644 index a906a9083ec4..000000000000 --- a/contrib/llvm/tools/gold/README.txt +++ /dev/null @@ -1,21 +0,0 @@ -This directory contains a plugin that is designed to work with binutils -gold linker. At present time, this is not the default linker in -binutils, and the default build of gold does not support plugins. - -Obtaining binutils: - - cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src login - {enter "anoncvs" as the password} - cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src co binutils - -This will create a src/ directory. Make a build/ directory and from -there configure binutils with "../src/configure --enable-gold --enable-plugins". -Then build binutils with "make all-gold". - -To build the LLVMgold plugin, configure LLVM with the option ---with-binutils-include=/path/to/binutils/src/include/ --enable-pic. To use the -plugin, run "ld-new --plugin /path/to/LLVMgold.so". -Without PIC libLTO and LLVMgold are not being built (because they would fail -link on x86-64 with a relocation error: PIC and non-PIC can't be combined). -As an alternative to passing --enable-pic, you can use 'make ENABLE_PIC=1' in -your entire LLVM build. diff --git a/contrib/llvm/tools/gold/gold-plugin.cpp b/contrib/llvm/tools/gold/gold-plugin.cpp deleted file mode 100644 index 4b58fae96de4..000000000000 --- a/contrib/llvm/tools/gold/gold-plugin.cpp +++ /dev/null @@ -1,519 +0,0 @@ -//===-- gold-plugin.cpp - Plugin to gold for Link Time Optimization ------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This is a gold plugin for LLVM. It provides an LLVM implementation of the -// interface described in http://gcc.gnu.org/wiki/whopr/driver . -// -//===----------------------------------------------------------------------===// - -#include "llvm/Config/config.h" -#include "plugin-api.h" - -#include "llvm-c/lto.h" - -#include "llvm/Support/raw_ostream.h" -#include "llvm/System/Errno.h" -#include "llvm/System/Path.h" -#include "llvm/System/Program.h" - -#include -#include -#include -#include -#include -#include - -using namespace llvm; - -namespace { - ld_plugin_status discard_message(int level, const char *format, ...) { - // Die loudly. Recent versions of Gold pass ld_plugin_message as the first - // callback in the transfer vector. This should never be called. - abort(); - } - - ld_plugin_add_symbols add_symbols = NULL; - ld_plugin_get_symbols get_symbols = NULL; - ld_plugin_add_input_file add_input_file = NULL; - ld_plugin_add_input_library add_input_library = NULL; - ld_plugin_set_extra_library_path set_extra_library_path = NULL; - ld_plugin_message message = discard_message; - - int api_version = 0; - int gold_version = 0; - - struct claimed_file { - lto_module_t M; - void *handle; - std::vector syms; - }; - - lto_codegen_model output_type = LTO_CODEGEN_PIC_MODEL_STATIC; - std::string output_name = ""; - std::list Modules; - std::vector Cleanup; -} - -namespace options { - enum generate_bc { BC_NO, BC_ALSO, BC_ONLY }; - static bool generate_api_file = false; - static generate_bc generate_bc_file = BC_NO; - static std::string bc_path; - static std::string as_path; - static std::vector as_args; - static std::vector pass_through; - static std::string extra_library_path; - static std::string triple; - static std::string mcpu; - // Additional options to pass into the code generator. - // Note: This array will contain all plugin options which are not claimed - // as plugin exclusive to pass to the code generator. - // For example, "generate-api-file" and "as"options are for the plugin - // use only and will not be passed. - static std::vector extra; - - static void process_plugin_option(const char* opt_) - { - if (opt_ == NULL) - return; - llvm::StringRef opt = opt_; - - if (opt == "generate-api-file") { - generate_api_file = true; - } else if (opt.startswith("mcpu=")) { - mcpu = opt.substr(strlen("mcpu=")); - } else if (opt.startswith("as=")) { - if (!as_path.empty()) { - (*message)(LDPL_WARNING, "Path to as specified twice. " - "Discarding %s", opt_); - } else { - as_path = opt.substr(strlen("as=")); - } - } else if (opt.startswith("as-arg=")) { - llvm::StringRef item = opt.substr(strlen("as-arg=")); - as_args.push_back(item.str()); - } else if (opt.startswith("extra-library-path=")) { - extra_library_path = opt.substr(strlen("extra_library_path=")); - } else if (opt.startswith("pass-through=")) { - llvm::StringRef item = opt.substr(strlen("pass-through=")); - pass_through.push_back(item.str()); - } else if (opt.startswith("mtriple=")) { - triple = opt.substr(strlen("mtriple=")); - } else if (opt == "emit-llvm") { - generate_bc_file = BC_ONLY; - } else if (opt == "also-emit-llvm") { - generate_bc_file = BC_ALSO; - } else if (opt.startswith("also-emit-llvm=")) { - llvm::StringRef path = opt.substr(strlen("also-emit-llvm=")); - generate_bc_file = BC_ALSO; - if (!bc_path.empty()) { - (*message)(LDPL_WARNING, "Path to the output IL file specified twice. " - "Discarding %s", opt_); - } else { - bc_path = path; - } - } else { - // Save this option to pass to the code generator. - extra.push_back(opt); - } - } -} - -static ld_plugin_status claim_file_hook(const ld_plugin_input_file *file, - int *claimed); -static ld_plugin_status all_symbols_read_hook(void); -static ld_plugin_status cleanup_hook(void); - -extern "C" ld_plugin_status onload(ld_plugin_tv *tv); -ld_plugin_status onload(ld_plugin_tv *tv) { - // We're given a pointer to the first transfer vector. We read through them - // until we find one where tv_tag == LDPT_NULL. The REGISTER_* tagged values - // contain pointers to functions that we need to call to register our own - // hooks. The others are addresses of functions we can use to call into gold - // for services. - - bool registeredClaimFile = false; - - for (; tv->tv_tag != LDPT_NULL; ++tv) { - switch (tv->tv_tag) { - case LDPT_API_VERSION: - api_version = tv->tv_u.tv_val; - break; - case LDPT_GOLD_VERSION: // major * 100 + minor - gold_version = tv->tv_u.tv_val; - break; - case LDPT_OUTPUT_NAME: - output_name = tv->tv_u.tv_string; - break; - case LDPT_LINKER_OUTPUT: - switch (tv->tv_u.tv_val) { - case LDPO_REL: // .o - case LDPO_DYN: // .so - output_type = LTO_CODEGEN_PIC_MODEL_DYNAMIC; - break; - case LDPO_EXEC: // .exe - output_type = LTO_CODEGEN_PIC_MODEL_STATIC; - break; - default: - (*message)(LDPL_ERROR, "Unknown output file type %d", - tv->tv_u.tv_val); - return LDPS_ERR; - } - // TODO: add an option to disable PIC. - //output_type = LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC; - break; - case LDPT_OPTION: - options::process_plugin_option(tv->tv_u.tv_string); - break; - case LDPT_REGISTER_CLAIM_FILE_HOOK: { - ld_plugin_register_claim_file callback; - callback = tv->tv_u.tv_register_claim_file; - - if ((*callback)(claim_file_hook) != LDPS_OK) - return LDPS_ERR; - - registeredClaimFile = true; - } break; - case LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK: { - ld_plugin_register_all_symbols_read callback; - callback = tv->tv_u.tv_register_all_symbols_read; - - if ((*callback)(all_symbols_read_hook) != LDPS_OK) - return LDPS_ERR; - } break; - case LDPT_REGISTER_CLEANUP_HOOK: { - ld_plugin_register_cleanup callback; - callback = tv->tv_u.tv_register_cleanup; - - if ((*callback)(cleanup_hook) != LDPS_OK) - return LDPS_ERR; - } break; - case LDPT_ADD_SYMBOLS: - add_symbols = tv->tv_u.tv_add_symbols; - break; - case LDPT_GET_SYMBOLS: - get_symbols = tv->tv_u.tv_get_symbols; - break; - case LDPT_ADD_INPUT_FILE: - add_input_file = tv->tv_u.tv_add_input_file; - break; - case LDPT_ADD_INPUT_LIBRARY: - add_input_library = tv->tv_u.tv_add_input_file; - break; - case LDPT_SET_EXTRA_LIBRARY_PATH: - set_extra_library_path = tv->tv_u.tv_set_extra_library_path; - break; - case LDPT_MESSAGE: - message = tv->tv_u.tv_message; - break; - default: - break; - } - } - - if (!registeredClaimFile) { - (*message)(LDPL_ERROR, "register_claim_file not passed to LLVMgold."); - return LDPS_ERR; - } - if (!add_symbols) { - (*message)(LDPL_ERROR, "add_symbols not passed to LLVMgold."); - return LDPS_ERR; - } - - return LDPS_OK; -} - -/// claim_file_hook - called by gold to see whether this file is one that -/// our plugin can handle. We'll try to open it and register all the symbols -/// with add_symbol if possible. -static ld_plugin_status claim_file_hook(const ld_plugin_input_file *file, - int *claimed) { - void *buf = NULL; - if (file->offset) { - // Gold has found what might be IR part-way inside of a file, such as - // an .a archive. - if (lseek(file->fd, file->offset, SEEK_SET) == -1) { - (*message)(LDPL_ERROR, - "Failed to seek to archive member of %s at offset %d: %s\n", - file->name, - file->offset, sys::StrError(errno).c_str()); - return LDPS_ERR; - } - buf = malloc(file->filesize); - if (!buf) { - (*message)(LDPL_ERROR, - "Failed to allocate buffer for archive member of size: %d\n", - file->filesize); - return LDPS_ERR; - } - if (read(file->fd, buf, file->filesize) != file->filesize) { - (*message)(LDPL_ERROR, - "Failed to read archive member of %s at offset %d: %s\n", - file->name, - file->offset, - sys::StrError(errno).c_str()); - free(buf); - return LDPS_ERR; - } - if (!lto_module_is_object_file_in_memory(buf, file->filesize)) { - free(buf); - return LDPS_OK; - } - } else if (!lto_module_is_object_file(file->name)) - return LDPS_OK; - - *claimed = 1; - Modules.resize(Modules.size() + 1); - claimed_file &cf = Modules.back(); - - cf.M = buf ? lto_module_create_from_memory(buf, file->filesize) : - lto_module_create(file->name); - free(buf); - if (!cf.M) { - (*message)(LDPL_ERROR, "Failed to create LLVM module: %s", - lto_get_error_message()); - return LDPS_ERR; - } - - if (!options::triple.empty()) - lto_module_set_target_triple(cf.M, options::triple.c_str()); - - cf.handle = file->handle; - unsigned sym_count = lto_module_get_num_symbols(cf.M); - cf.syms.reserve(sym_count); - - for (unsigned i = 0; i != sym_count; ++i) { - lto_symbol_attributes attrs = lto_module_get_symbol_attribute(cf.M, i); - if ((attrs & LTO_SYMBOL_SCOPE_MASK) == LTO_SYMBOL_SCOPE_INTERNAL) - continue; - - cf.syms.push_back(ld_plugin_symbol()); - ld_plugin_symbol &sym = cf.syms.back(); - sym.name = const_cast(lto_module_get_symbol_name(cf.M, i)); - sym.version = NULL; - - int scope = attrs & LTO_SYMBOL_SCOPE_MASK; - switch (scope) { - case LTO_SYMBOL_SCOPE_HIDDEN: - sym.visibility = LDPV_HIDDEN; - break; - case LTO_SYMBOL_SCOPE_PROTECTED: - sym.visibility = LDPV_PROTECTED; - break; - case 0: // extern - case LTO_SYMBOL_SCOPE_DEFAULT: - sym.visibility = LDPV_DEFAULT; - break; - default: - (*message)(LDPL_ERROR, "Unknown scope attribute: %d", scope); - return LDPS_ERR; - } - - int definition = attrs & LTO_SYMBOL_DEFINITION_MASK; - switch (definition) { - case LTO_SYMBOL_DEFINITION_REGULAR: - sym.def = LDPK_DEF; - break; - case LTO_SYMBOL_DEFINITION_UNDEFINED: - sym.def = LDPK_UNDEF; - break; - case LTO_SYMBOL_DEFINITION_TENTATIVE: - sym.def = LDPK_COMMON; - break; - case LTO_SYMBOL_DEFINITION_WEAK: - sym.def = LDPK_WEAKDEF; - break; - case LTO_SYMBOL_DEFINITION_WEAKUNDEF: - sym.def = LDPK_WEAKUNDEF; - break; - default: - (*message)(LDPL_ERROR, "Unknown definition attribute: %d", definition); - return LDPS_ERR; - } - - // LLVM never emits COMDAT. - sym.size = 0; - sym.comdat_key = NULL; - - sym.resolution = LDPR_UNKNOWN; - } - - cf.syms.reserve(cf.syms.size()); - - if (!cf.syms.empty()) { - if ((*add_symbols)(cf.handle, cf.syms.size(), &cf.syms[0]) != LDPS_OK) { - (*message)(LDPL_ERROR, "Unable to add symbols!"); - return LDPS_ERR; - } - } - - return LDPS_OK; -} - -/// all_symbols_read_hook - gold informs us that all symbols have been read. -/// At this point, we use get_symbols to see if any of our definitions have -/// been overridden by a native object file. Then, perform optimization and -/// codegen. -static ld_plugin_status all_symbols_read_hook(void) { - lto_code_gen_t cg = lto_codegen_create(); - - for (std::list::iterator I = Modules.begin(), - E = Modules.end(); I != E; ++I) - lto_codegen_add_module(cg, I->M); - - std::ofstream api_file; - if (options::generate_api_file) { - api_file.open("apifile.txt", std::ofstream::out | std::ofstream::trunc); - if (!api_file.is_open()) { - (*message)(LDPL_FATAL, "Unable to open apifile.txt for writing."); - abort(); - } - } - - // If we don't preserve any symbols, libLTO will assume that all symbols are - // needed. Keep all symbols unless we're producing a final executable. - bool anySymbolsPreserved = false; - for (std::list::iterator I = Modules.begin(), - E = Modules.end(); I != E; ++I) { - (*get_symbols)(I->handle, I->syms.size(), &I->syms[0]); - for (unsigned i = 0, e = I->syms.size(); i != e; i++) { - if (I->syms[i].resolution == LDPR_PREVAILING_DEF) { - lto_codegen_add_must_preserve_symbol(cg, I->syms[i].name); - anySymbolsPreserved = true; - - if (options::generate_api_file) - api_file << I->syms[i].name << "\n"; - } - } - } - - if (options::generate_api_file) - api_file.close(); - - if (!anySymbolsPreserved) { - // All of the IL is unnecessary! - lto_codegen_dispose(cg); - return LDPS_OK; - } - - lto_codegen_set_pic_model(cg, output_type); - lto_codegen_set_debug_model(cg, LTO_DEBUG_MODEL_DWARF); - if (!options::as_path.empty()) { - sys::Path p = sys::Program::FindProgramByName(options::as_path); - lto_codegen_set_assembler_path(cg, p.c_str()); - } - if (!options::as_args.empty()) { - std::vector as_args_p; - for (std::vector::iterator I = options::as_args.begin(), - E = options::as_args.end(); I != E; ++I) { - as_args_p.push_back(I->c_str()); - } - lto_codegen_set_assembler_args(cg, &as_args_p[0], as_args_p.size()); - } - if (!options::mcpu.empty()) - lto_codegen_set_cpu(cg, options::mcpu.c_str()); - - // Pass through extra options to the code generator. - if (!options::extra.empty()) { - for (std::vector::iterator it = options::extra.begin(); - it != options::extra.end(); ++it) { - lto_codegen_debug_options(cg, (*it).c_str()); - } - } - - - if (options::generate_bc_file != options::BC_NO) { - std::string path; - if (options::generate_bc_file == options::BC_ONLY) - path = output_name; - else if (!options::bc_path.empty()) - path = options::bc_path; - else - path = output_name + ".bc"; - bool err = lto_codegen_write_merged_modules(cg, path.c_str()); - if (err) - (*message)(LDPL_FATAL, "Failed to write the output file."); - if (options::generate_bc_file == options::BC_ONLY) - exit(0); - } - size_t bufsize = 0; - const char *buffer = static_cast(lto_codegen_compile(cg, - &bufsize)); - - std::string ErrMsg; - - sys::Path uniqueObjPath("/tmp/llvmgold.o"); - if (uniqueObjPath.createTemporaryFileOnDisk(true, &ErrMsg)) { - (*message)(LDPL_ERROR, "%s", ErrMsg.c_str()); - return LDPS_ERR; - } - tool_output_file objFile(uniqueObjPath.c_str(), ErrMsg, - raw_fd_ostream::F_Binary); - if (!ErrMsg.empty()) { - (*message)(LDPL_ERROR, "%s", ErrMsg.c_str()); - return LDPS_ERR; - } - - objFile.os().write(buffer, bufsize); - objFile.os().close(); - if (objFile.os().has_error()) { - (*message)(LDPL_ERROR, "Error writing output file '%s'", - uniqueObjPath.c_str()); - objFile.os().clear_error(); - return LDPS_ERR; - } - objFile.keep(); - - lto_codegen_dispose(cg); - - if ((*add_input_file)(uniqueObjPath.c_str()) != LDPS_OK) { - (*message)(LDPL_ERROR, "Unable to add .o file to the link."); - (*message)(LDPL_ERROR, "File left behind in: %s", uniqueObjPath.c_str()); - return LDPS_ERR; - } - - if (!options::extra_library_path.empty() && - set_extra_library_path(options::extra_library_path.c_str()) != LDPS_OK) { - (*message)(LDPL_ERROR, "Unable to set the extra library path."); - return LDPS_ERR; - } - - for (std::vector::iterator i = options::pass_through.begin(), - e = options::pass_through.end(); - i != e; ++i) { - std::string &item = *i; - const char *item_p = item.c_str(); - if (llvm::StringRef(item).startswith("-l")) { - if (add_input_library(item_p + 2) != LDPS_OK) { - (*message)(LDPL_ERROR, "Unable to add library to the link."); - return LDPS_ERR; - } - } else { - if (add_input_file(item_p) != LDPS_OK) { - (*message)(LDPL_ERROR, "Unable to add .o file to the link."); - return LDPS_ERR; - } - } - } - - Cleanup.push_back(uniqueObjPath); - - return LDPS_OK; -} - -static ld_plugin_status cleanup_hook(void) { - std::string ErrMsg; - - for (int i = 0, e = Cleanup.size(); i != e; ++i) - if (Cleanup[i].eraseFromDisk(false, &ErrMsg)) - (*message)(LDPL_ERROR, "Failed to delete '%s': %s", Cleanup[i].c_str(), - ErrMsg.c_str()); - - return LDPS_OK; -} diff --git a/contrib/llvm/tools/gold/gold.exports b/contrib/llvm/tools/gold/gold.exports deleted file mode 100644 index 277a33a1ec34..000000000000 --- a/contrib/llvm/tools/gold/gold.exports +++ /dev/null @@ -1 +0,0 @@ -onload diff --git a/contrib/llvm/tools/llc/CMakeLists.txt b/contrib/llvm/tools/llc/CMakeLists.txt deleted file mode 100644 index 683f29862d5c..000000000000 --- a/contrib/llvm/tools/llc/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} bitreader asmparser) - -add_llvm_tool(llc - llc.cpp - ) diff --git a/contrib/llvm/tools/llc/Makefile b/contrib/llvm/tools/llc/Makefile deleted file mode 100644 index 7319aada489e..000000000000 --- a/contrib/llvm/tools/llc/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -#===- tools/llc/Makefile -----------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../.. -TOOLNAME = llc - -# Include this here so we can get the configuration of the targets -# that have been configured for construction. We have to do this -# early so we can set up LINK_COMPONENTS before including Makefile.rules -include $(LEVEL)/Makefile.config - -LINK_COMPONENTS := $(TARGETS_TO_BUILD) bitreader asmparser - -include $(LLVM_SRC_ROOT)/Makefile.rules - diff --git a/contrib/llvm/tools/llc/llc.cpp b/contrib/llvm/tools/llc/llc.cpp deleted file mode 100644 index 8bcc2d8d27e9..000000000000 --- a/contrib/llvm/tools/llc/llc.cpp +++ /dev/null @@ -1,330 +0,0 @@ -//===-- llc.cpp - Implement the LLVM Native Code Generator ----------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This is the llc code generator driver. It provides a convenient -// command-line interface for generating native assembly-language code -// or C code, given LLVM bitcode. -// -//===----------------------------------------------------------------------===// - -#include "llvm/LLVMContext.h" -#include "llvm/Module.h" -#include "llvm/PassManager.h" -#include "llvm/Pass.h" -#include "llvm/ADT/Triple.h" -#include "llvm/Support/IRReader.h" -#include "llvm/CodeGen/LinkAllAsmWriterComponents.h" -#include "llvm/CodeGen/LinkAllCodegenComponents.h" -#include "llvm/Config/config.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/Debug.h" -#include "llvm/Support/FormattedStream.h" -#include "llvm/Support/ManagedStatic.h" -#include "llvm/Support/PluginLoader.h" -#include "llvm/Support/PrettyStackTrace.h" -#include "llvm/System/Host.h" -#include "llvm/System/Signals.h" -#include "llvm/Target/SubtargetFeature.h" -#include "llvm/Target/TargetData.h" -#include "llvm/Target/TargetMachine.h" -#include "llvm/Target/TargetRegistry.h" -#include "llvm/Target/TargetSelect.h" -#include -using namespace llvm; - -// General options for llc. Other pass-specific options are specified -// within the corresponding llc passes, and target-specific options -// and back-end code generation options are specified with the target machine. -// -static cl::opt -InputFilename(cl::Positional, cl::desc(""), cl::init("-")); - -static cl::opt -OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename")); - -// Determine optimization level. -static cl::opt -OptLevel("O", - cl::desc("Optimization level. [-O0, -O1, -O2, or -O3] " - "(default = '-O2')"), - cl::Prefix, - cl::ZeroOrMore, - cl::init(' ')); - -static cl::opt -TargetTriple("mtriple", cl::desc("Override target triple for module")); - -static cl::opt -MArch("march", cl::desc("Architecture to generate code for (see --version)")); - -static cl::opt -MCPU("mcpu", - cl::desc("Target a specific cpu type (-mcpu=help for details)"), - cl::value_desc("cpu-name"), - cl::init("")); - -static cl::list -MAttrs("mattr", - cl::CommaSeparated, - cl::desc("Target specific attributes (-mattr=help for details)"), - cl::value_desc("a1,+a2,-a3,...")); - -static cl::opt -RelaxAll("mc-relax-all", - cl::desc("When used with filetype=obj, " - "relax all fixups in the emitted object file")); - -cl::opt -FileType("filetype", cl::init(TargetMachine::CGFT_AssemblyFile), - cl::desc("Choose a file type (not all types are supported by all targets):"), - cl::values( - clEnumValN(TargetMachine::CGFT_AssemblyFile, "asm", - "Emit an assembly ('.s') file"), - clEnumValN(TargetMachine::CGFT_ObjectFile, "obj", - "Emit a native object ('.o') file [experimental]"), - clEnumValN(TargetMachine::CGFT_Null, "null", - "Emit nothing, for performance testing"), - clEnumValEnd)); - -cl::opt NoVerify("disable-verify", cl::Hidden, - cl::desc("Do not verify input module")); - - -static cl::opt -DisableRedZone("disable-red-zone", - cl::desc("Do not emit code that uses the red zone."), - cl::init(false)); - -static cl::opt -NoImplicitFloats("no-implicit-float", - cl::desc("Don't generate implicit floating point instructions (x86-only)"), - cl::init(false)); - -// GetFileNameRoot - Helper function to get the basename of a filename. -static inline std::string -GetFileNameRoot(const std::string &InputFilename) { - std::string IFN = InputFilename; - std::string outputFilename; - int Len = IFN.length(); - if ((Len > 2) && - IFN[Len-3] == '.' && - ((IFN[Len-2] == 'b' && IFN[Len-1] == 'c') || - (IFN[Len-2] == 'l' && IFN[Len-1] == 'l'))) { - outputFilename = std::string(IFN.begin(), IFN.end()-3); // s/.bc/.s/ - } else { - outputFilename = IFN; - } - return outputFilename; -} - -static tool_output_file *GetOutputStream(const char *TargetName, - Triple::OSType OS, - const char *ProgName) { - // If we don't yet have an output filename, make one. - if (OutputFilename.empty()) { - if (InputFilename == "-") - OutputFilename = "-"; - else { - OutputFilename = GetFileNameRoot(InputFilename); - - switch (FileType) { - default: assert(0 && "Unknown file type"); - case TargetMachine::CGFT_AssemblyFile: - if (TargetName[0] == 'c') { - if (TargetName[1] == 0) - OutputFilename += ".cbe.c"; - else if (TargetName[1] == 'p' && TargetName[2] == 'p') - OutputFilename += ".cpp"; - else - OutputFilename += ".s"; - } else - OutputFilename += ".s"; - break; - case TargetMachine::CGFT_ObjectFile: - if (OS == Triple::Win32) - OutputFilename += ".obj"; - else - OutputFilename += ".o"; - break; - case TargetMachine::CGFT_Null: - OutputFilename += ".null"; - break; - } - } - } - - // Decide if we need "binary" output. - bool Binary = false; - switch (FileType) { - default: assert(0 && "Unknown file type"); - case TargetMachine::CGFT_AssemblyFile: - break; - case TargetMachine::CGFT_ObjectFile: - case TargetMachine::CGFT_Null: - Binary = true; - break; - } - - // Open the file. - std::string error; - unsigned OpenFlags = 0; - if (Binary) OpenFlags |= raw_fd_ostream::F_Binary; - tool_output_file *FDOut = new tool_output_file(OutputFilename.c_str(), error, - OpenFlags); - if (!error.empty()) { - errs() << error << '\n'; - delete FDOut; - return 0; - } - - return FDOut; -} - -// main - Entry point for the llc compiler. -// -int main(int argc, char **argv) { - sys::PrintStackTraceOnErrorSignal(); - PrettyStackTraceProgram X(argc, argv); - - // Enable debug stream buffering. - EnableDebugBuffering = true; - - LLVMContext &Context = getGlobalContext(); - llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. - - // Initialize targets first, so that --version shows registered targets. - InitializeAllTargets(); - InitializeAllAsmPrinters(); - InitializeAllAsmParsers(); - - cl::ParseCommandLineOptions(argc, argv, "llvm system compiler\n"); - - // Load the module to be compiled... - SMDiagnostic Err; - std::auto_ptr M; - - M.reset(ParseIRFile(InputFilename, Err, Context)); - if (M.get() == 0) { - Err.Print(argv[0], errs()); - return 1; - } - Module &mod = *M.get(); - - // If we are supposed to override the target triple, do so now. - if (!TargetTriple.empty()) - mod.setTargetTriple(Triple::normalize(TargetTriple)); - - Triple TheTriple(mod.getTargetTriple()); - if (TheTriple.getTriple().empty()) - TheTriple.setTriple(sys::getHostTriple()); - - // Allocate target machine. First, check whether the user has explicitly - // specified an architecture to compile for. If so we have to look it up by - // name, because it might be a backend that has no mapping to a target triple. - const Target *TheTarget = 0; - if (!MArch.empty()) { - for (TargetRegistry::iterator it = TargetRegistry::begin(), - ie = TargetRegistry::end(); it != ie; ++it) { - if (MArch == it->getName()) { - TheTarget = &*it; - break; - } - } - - if (!TheTarget) { - errs() << argv[0] << ": error: invalid target '" << MArch << "'.\n"; - return 1; - } - - // Adjust the triple to match (if known), otherwise stick with the - // module/host triple. - Triple::ArchType Type = Triple::getArchTypeForLLVMName(MArch); - if (Type != Triple::UnknownArch) - TheTriple.setArch(Type); - } else { - std::string Err; - TheTarget = TargetRegistry::lookupTarget(TheTriple.getTriple(), Err); - if (TheTarget == 0) { - errs() << argv[0] << ": error auto-selecting target for module '" - << Err << "'. Please use the -march option to explicitly " - << "pick a target.\n"; - return 1; - } - } - - // Package up features to be passed to target/subtarget - std::string FeaturesStr; - if (MCPU.size() || MAttrs.size()) { - SubtargetFeatures Features; - Features.setCPU(MCPU); - for (unsigned i = 0; i != MAttrs.size(); ++i) - Features.AddFeature(MAttrs[i]); - FeaturesStr = Features.getString(); - } - - std::auto_ptr - target(TheTarget->createTargetMachine(TheTriple.getTriple(), FeaturesStr)); - assert(target.get() && "Could not allocate target machine!"); - TargetMachine &Target = *target.get(); - - // Figure out where we are going to send the output... - OwningPtr Out - (GetOutputStream(TheTarget->getName(), TheTriple.getOS(), argv[0])); - if (!Out) return 1; - - CodeGenOpt::Level OLvl = CodeGenOpt::Default; - switch (OptLevel) { - default: - errs() << argv[0] << ": invalid optimization level.\n"; - return 1; - case ' ': break; - case '0': OLvl = CodeGenOpt::None; break; - case '1': OLvl = CodeGenOpt::Less; break; - case '2': OLvl = CodeGenOpt::Default; break; - case '3': OLvl = CodeGenOpt::Aggressive; break; - } - - // Build up all of the passes that we want to do to the module. - PassManager PM; - - // Add the target data from the target machine, if it exists, or the module. - if (const TargetData *TD = Target.getTargetData()) - PM.add(new TargetData(*TD)); - else - PM.add(new TargetData(&mod)); - - // Override default to generate verbose assembly. - Target.setAsmVerbosityDefault(true); - - if (RelaxAll) { - if (FileType != TargetMachine::CGFT_ObjectFile) - errs() << argv[0] - << ": warning: ignoring -mc-relax-all because filetype != obj"; - else - Target.setMCRelaxAll(true); - } - - { - formatted_raw_ostream FOS(Out->os()); - - // Ask the target to add backend passes as necessary. - if (Target.addPassesToEmitFile(PM, FOS, FileType, OLvl, NoVerify)) { - errs() << argv[0] << ": target does not support generation of this" - << " file type!\n"; - return 1; - } - - PM.run(mod); - } - - // Declare success. - Out->keep(); - - return 0; -} diff --git a/contrib/llvm/tools/lli/CMakeLists.txt b/contrib/llvm/tools/lli/CMakeLists.txt deleted file mode 100644 index ce70d46e4a5e..000000000000 --- a/contrib/llvm/tools/lli/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -set(LLVM_LINK_COMPONENTS jit interpreter nativecodegen bitreader selectiondag) - -add_llvm_tool(lli - lli.cpp - ) diff --git a/contrib/llvm/tools/lli/Makefile b/contrib/llvm/tools/lli/Makefile deleted file mode 100644 index 8f6eeed486bb..000000000000 --- a/contrib/llvm/tools/lli/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -##===- tools/lli/Makefile ------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL := ../.. -TOOLNAME := lli -LINK_COMPONENTS := jit interpreter nativecodegen bitreader selectiondag - -# Enable JIT support -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/tools/lli/lli.cpp b/contrib/llvm/tools/lli/lli.cpp deleted file mode 100644 index 4c377805e6a3..000000000000 --- a/contrib/llvm/tools/lli/lli.cpp +++ /dev/null @@ -1,254 +0,0 @@ -//===- lli.cpp - LLVM Interpreter / Dynamic compiler ----------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This utility provides a simple wrapper around the LLVM Execution Engines, -// which allow the direct execution of LLVM programs through a Just-In-Time -// compiler, or through an interpreter if no JIT is available for this platform. -// -//===----------------------------------------------------------------------===// - -#include "llvm/LLVMContext.h" -#include "llvm/Module.h" -#include "llvm/Type.h" -#include "llvm/ADT/Triple.h" -#include "llvm/Bitcode/ReaderWriter.h" -#include "llvm/CodeGen/LinkAllCodegenComponents.h" -#include "llvm/ExecutionEngine/GenericValue.h" -#include "llvm/ExecutionEngine/Interpreter.h" -#include "llvm/ExecutionEngine/JIT.h" -#include "llvm/ExecutionEngine/JITEventListener.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/ManagedStatic.h" -#include "llvm/Support/MemoryBuffer.h" -#include "llvm/Support/PluginLoader.h" -#include "llvm/Support/PrettyStackTrace.h" -#include "llvm/Support/raw_ostream.h" -#include "llvm/System/Process.h" -#include "llvm/System/Signals.h" -#include "llvm/Target/TargetSelect.h" -#include -using namespace llvm; - -namespace { - cl::opt - InputFile(cl::desc(""), cl::Positional, cl::init("-")); - - cl::list - InputArgv(cl::ConsumeAfter, cl::desc("...")); - - cl::opt ForceInterpreter("force-interpreter", - cl::desc("Force interpretation: disable JIT"), - cl::init(false)); - - // Determine optimization level. - cl::opt - OptLevel("O", - cl::desc("Optimization level. [-O0, -O1, -O2, or -O3] " - "(default = '-O2')"), - cl::Prefix, - cl::ZeroOrMore, - cl::init(' ')); - - cl::opt - TargetTriple("mtriple", cl::desc("Override target triple for module")); - - cl::opt - MArch("march", - cl::desc("Architecture to generate assembly for (see --version)")); - - cl::opt - MCPU("mcpu", - cl::desc("Target a specific cpu type (-mcpu=help for details)"), - cl::value_desc("cpu-name"), - cl::init("")); - - cl::list - MAttrs("mattr", - cl::CommaSeparated, - cl::desc("Target specific attributes (-mattr=help for details)"), - cl::value_desc("a1,+a2,-a3,...")); - - cl::opt - EntryFunc("entry-function", - cl::desc("Specify the entry function (default = 'main') " - "of the executable"), - cl::value_desc("function"), - cl::init("main")); - - cl::opt - FakeArgv0("fake-argv0", - cl::desc("Override the 'argv[0]' value passed into the executing" - " program"), cl::value_desc("executable")); - - cl::opt - DisableCoreFiles("disable-core-files", cl::Hidden, - cl::desc("Disable emission of core files if possible")); - - cl::opt - NoLazyCompilation("disable-lazy-compilation", - cl::desc("Disable JIT lazy compilation"), - cl::init(false)); -} - -static ExecutionEngine *EE = 0; - -static void do_shutdown() { - delete EE; - llvm_shutdown(); -} - -//===----------------------------------------------------------------------===// -// main Driver function -// -int main(int argc, char **argv, char * const *envp) { - sys::PrintStackTraceOnErrorSignal(); - PrettyStackTraceProgram X(argc, argv); - - LLVMContext &Context = getGlobalContext(); - atexit(do_shutdown); // Call llvm_shutdown() on exit. - - // If we have a native target, initialize it to ensure it is linked in and - // usable by the JIT. - InitializeNativeTarget(); - - cl::ParseCommandLineOptions(argc, argv, - "llvm interpreter & dynamic compiler\n"); - - // If the user doesn't want core files, disable them. - if (DisableCoreFiles) - sys::Process::PreventCoreFiles(); - - // Load the bitcode... - std::string ErrorMsg; - Module *Mod = NULL; - if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(InputFile,&ErrorMsg)){ - Mod = getLazyBitcodeModule(Buffer, Context, &ErrorMsg); - if (!Mod) delete Buffer; - } - - if (!Mod) { - errs() << argv[0] << ": error loading program '" << InputFile << "': " - << ErrorMsg << "\n"; - exit(1); - } - - // If not jitting lazily, load the whole bitcode file eagerly too. - if (NoLazyCompilation) { - if (Mod->MaterializeAllPermanently(&ErrorMsg)) { - errs() << argv[0] << ": bitcode didn't read correctly.\n"; - errs() << "Reason: " << ErrorMsg << "\n"; - exit(1); - } - } - - EngineBuilder builder(Mod); - builder.setMArch(MArch); - builder.setMCPU(MCPU); - builder.setMAttrs(MAttrs); - builder.setErrorStr(&ErrorMsg); - builder.setEngineKind(ForceInterpreter - ? EngineKind::Interpreter - : EngineKind::JIT); - - // If we are supposed to override the target triple, do so now. - if (!TargetTriple.empty()) - Mod->setTargetTriple(Triple::normalize(TargetTriple)); - - CodeGenOpt::Level OLvl = CodeGenOpt::Default; - switch (OptLevel) { - default: - errs() << argv[0] << ": invalid optimization level.\n"; - return 1; - case ' ': break; - case '0': OLvl = CodeGenOpt::None; break; - case '1': OLvl = CodeGenOpt::Less; break; - case '2': OLvl = CodeGenOpt::Default; break; - case '3': OLvl = CodeGenOpt::Aggressive; break; - } - builder.setOptLevel(OLvl); - - EE = builder.create(); - if (!EE) { - if (!ErrorMsg.empty()) - errs() << argv[0] << ": error creating EE: " << ErrorMsg << "\n"; - else - errs() << argv[0] << ": unknown error creating EE!\n"; - exit(1); - } - - EE->RegisterJITEventListener(createOProfileJITEventListener()); - - EE->DisableLazyCompilation(NoLazyCompilation); - - // If the user specifically requested an argv[0] to pass into the program, - // do it now. - if (!FakeArgv0.empty()) { - InputFile = FakeArgv0; - } else { - // Otherwise, if there is a .bc suffix on the executable strip it off, it - // might confuse the program. - if (StringRef(InputFile).endswith(".bc")) - InputFile.erase(InputFile.length() - 3); - } - - // Add the module's name to the start of the vector of arguments to main(). - InputArgv.insert(InputArgv.begin(), InputFile); - - // Call the main function from M as if its signature were: - // int main (int argc, char **argv, const char **envp) - // using the contents of Args to determine argc & argv, and the contents of - // EnvVars to determine envp. - // - Function *EntryFn = Mod->getFunction(EntryFunc); - if (!EntryFn) { - errs() << '\'' << EntryFunc << "\' function not found in module.\n"; - return -1; - } - - // If the program doesn't explicitly call exit, we will need the Exit - // function later on to make an explicit call, so get the function now. - Constant *Exit = Mod->getOrInsertFunction("exit", Type::getVoidTy(Context), - Type::getInt32Ty(Context), - NULL); - - // Reset errno to zero on entry to main. - errno = 0; - - // Run static constructors. - EE->runStaticConstructorsDestructors(false); - - if (NoLazyCompilation) { - for (Module::iterator I = Mod->begin(), E = Mod->end(); I != E; ++I) { - Function *Fn = &*I; - if (Fn != EntryFn && !Fn->isDeclaration()) - EE->getPointerToFunction(Fn); - } - } - - // Run main. - int Result = EE->runFunctionAsMain(EntryFn, InputArgv, envp); - - // Run static destructors. - EE->runStaticConstructorsDestructors(true); - - // If the program didn't call exit explicitly, we should call it now. - // This ensures that any atexit handlers get called correctly. - if (Function *ExitF = dyn_cast(Exit)) { - std::vector Args; - GenericValue ResultGV; - ResultGV.IntVal = APInt(32, Result); - Args.push_back(ResultGV); - EE->runFunction(ExitF, Args); - errs() << "ERROR: exit(" << Result << ") returned!\n"; - abort(); - } else { - errs() << "ERROR: exit defined with wrong prototype!\n"; - abort(); - } -} diff --git a/contrib/llvm/tools/llvm-ar/CMakeLists.txt b/contrib/llvm/tools/llvm-ar/CMakeLists.txt deleted file mode 100644 index c8b0b725d83c..000000000000 --- a/contrib/llvm/tools/llvm-ar/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -set(LLVM_LINK_COMPONENTS archive) -set(LLVM_REQUIRES_EH 1) - -add_llvm_tool(llvm-ar - llvm-ar.cpp - ) - -# TODO: Support check-local. diff --git a/contrib/llvm/tools/llvm-ar/Makefile b/contrib/llvm/tools/llvm-ar/Makefile deleted file mode 100644 index e4fe4e8ca39a..000000000000 --- a/contrib/llvm/tools/llvm-ar/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -##===- tools/llvm-ar/Makefile ------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../.. - -TOOLNAME = llvm-ar -LINK_COMPONENTS = archive -REQUIRES_EH := 1 - -# This tool has no plugins, optimize startup time. -TOOL_NO_EXPORTS = 1 - -include $(LEVEL)/Makefile.common - -check-local:: - $(Echo) Checking llvm-ar - $(Verb) $(ToolDir)/llvm-ar zRrS nada.a . - $(Verb) $(ToolDir)/llvm-ar tv nada.a | \ - grep Debug/llvm-ar.d >/dev/null 2>&1 - $(Verb) $(RM) -f nada.a diff --git a/contrib/llvm/tools/llvm-ar/llvm-ar.cpp b/contrib/llvm/tools/llvm-ar/llvm-ar.cpp deleted file mode 100644 index 021a3691e850..000000000000 --- a/contrib/llvm/tools/llvm-ar/llvm-ar.cpp +++ /dev/null @@ -1,779 +0,0 @@ -//===-- llvm-ar.cpp - LLVM archive librarian utility ----------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// Builds up (relatively) standard unix archive files (.a) containing LLVM -// bitcode or other files. -// -//===----------------------------------------------------------------------===// - -#include "llvm/LLVMContext.h" -#include "llvm/Module.h" -#include "llvm/Bitcode/Archive.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/ManagedStatic.h" -#include "llvm/Support/PrettyStackTrace.h" -#include "llvm/Support/raw_ostream.h" -#include "llvm/System/Signals.h" -#include -#include -#include -#include -#include -using namespace llvm; - -// Option for compatibility with AIX, not used but must allow it to be present. -static cl::opt -X32Option ("X32_64", cl::Hidden, - cl::desc("Ignored option for compatibility with AIX")); - -// llvm-ar operation code and modifier flags. This must come first. -static cl::opt -Options(cl::Positional, cl::Required, cl::desc("{operation}[modifiers]...")); - -// llvm-ar remaining positional arguments. -static cl::list -RestOfArgs(cl::Positional, cl::OneOrMore, - cl::desc("[relpos] [count] [members]...")); - -// MoreHelp - Provide additional help output explaining the operations and -// modifiers of llvm-ar. This object instructs the CommandLine library -// to print the text of the constructor when the --help option is given. -static cl::extrahelp MoreHelp( - "\nOPERATIONS:\n" - " d[NsS] - delete file(s) from the archive\n" - " m[abiSs] - move file(s) in the archive\n" - " p[kN] - print file(s) found in the archive\n" - " q[ufsS] - quick append file(s) to the archive\n" - " r[abfiuzRsS] - replace or insert file(s) into the archive\n" - " t - display contents of archive\n" - " x[No] - extract file(s) from the archive\n" - "\nMODIFIERS (operation specific):\n" - " [a] - put file(s) after [relpos]\n" - " [b] - put file(s) before [relpos] (same as [i])\n" - " [f] - truncate inserted file names\n" - " [i] - put file(s) before [relpos] (same as [b])\n" - " [k] - always print bitcode files (default is to skip them)\n" - " [N] - use instance [count] of name\n" - " [o] - preserve original dates\n" - " [P] - use full path names when matching\n" - " [R] - recurse through directories when inserting\n" - " [s] - create an archive index (cf. ranlib)\n" - " [S] - do not build a symbol table\n" - " [u] - update only files newer than archive contents\n" - " [z] - compress files before inserting/extracting\n" - "\nMODIFIERS (generic):\n" - " [c] - do not warn if the library had to be created\n" - " [v] - be verbose about actions taken\n" - " [V] - be *really* verbose about actions taken\n" -); - -// This enumeration delineates the kinds of operations on an archive -// that are permitted. -enum ArchiveOperation { - NoOperation, ///< An operation hasn't been specified - Print, ///< Print the contents of the archive - Delete, ///< Delete the specified members - Move, ///< Move members to end or as given by {a,b,i} modifiers - QuickAppend, ///< Quickly append to end of archive - ReplaceOrInsert, ///< Replace or Insert members - DisplayTable, ///< Display the table of contents - Extract ///< Extract files back to file system -}; - -// Modifiers to follow operation to vary behavior -bool AddAfter = false; ///< 'a' modifier -bool AddBefore = false; ///< 'b' modifier -bool Create = false; ///< 'c' modifier -bool TruncateNames = false; ///< 'f' modifier -bool InsertBefore = false; ///< 'i' modifier -bool DontSkipBitcode = false; ///< 'k' modifier -bool UseCount = false; ///< 'N' modifier -bool OriginalDates = false; ///< 'o' modifier -bool FullPath = false; ///< 'P' modifier -bool RecurseDirectories = false; ///< 'R' modifier -bool SymTable = true; ///< 's' & 'S' modifiers -bool OnlyUpdate = false; ///< 'u' modifier -bool Verbose = false; ///< 'v' modifier -bool ReallyVerbose = false; ///< 'V' modifier -bool Compression = false; ///< 'z' modifier - -// Relative Positional Argument (for insert/move). This variable holds -// the name of the archive member to which the 'a', 'b' or 'i' modifier -// refers. Only one of 'a', 'b' or 'i' can be specified so we only need -// one variable. -std::string RelPos; - -// Select which of multiple entries in the archive with the same name should be -// used (specified with -N) for the delete and extract operations. -int Count = 1; - -// This variable holds the name of the archive file as given on the -// command line. -std::string ArchiveName; - -// This variable holds the list of member files to proecess, as given -// on the command line. -std::vector Members; - -// This variable holds the (possibly expanded) list of path objects that -// correspond to files we will -std::set Paths; - -// The Archive object to which all the editing operations will be sent. -Archive* TheArchive = 0; - -// getRelPos - Extract the member filename from the command line for -// the [relpos] argument associated with a, b, and i modifiers -void getRelPos() { - if(RestOfArgs.size() > 0) { - RelPos = RestOfArgs[0]; - RestOfArgs.erase(RestOfArgs.begin()); - } - else - throw "Expected [relpos] for a, b, or i modifier"; -} - -// getCount - Extract the [count] argument associated with the N modifier -// from the command line and check its value. -void getCount() { - if(RestOfArgs.size() > 0) { - Count = atoi(RestOfArgs[0].c_str()); - RestOfArgs.erase(RestOfArgs.begin()); - } - else - throw "Expected [count] value with N modifier"; - - // Non-positive counts are not allowed - if (Count < 1) - throw "Invalid [count] value (not a positive integer)"; -} - -// getArchive - Get the archive file name from the command line -void getArchive() { - if(RestOfArgs.size() > 0) { - ArchiveName = RestOfArgs[0]; - RestOfArgs.erase(RestOfArgs.begin()); - } - else - throw "An archive name must be specified."; -} - -// getMembers - Copy over remaining items in RestOfArgs to our Members vector -// This is just for clarity. -void getMembers() { - if(RestOfArgs.size() > 0) - Members = std::vector(RestOfArgs); -} - -// parseCommandLine - Parse the command line options as presented and return the -// operation specified. Process all modifiers and check to make sure that -// constraints on modifier/operation pairs have not been violated. -ArchiveOperation parseCommandLine() { - - // Keep track of number of operations. We can only specify one - // per execution. - unsigned NumOperations = 0; - - // Keep track of the number of positional modifiers (a,b,i). Only - // one can be specified. - unsigned NumPositional = 0; - - // Keep track of which operation was requested - ArchiveOperation Operation = NoOperation; - - for(unsigned i=0; i 1) - throw "Only one operation may be specified"; - if (NumPositional > 1) - throw "You may only specify one of a, b, and i modifiers"; - if (AddAfter || AddBefore || InsertBefore) - if (Operation != Move && Operation != ReplaceOrInsert) - throw "The 'a', 'b' and 'i' modifiers can only be specified with " - "the 'm' or 'r' operations"; - if (RecurseDirectories && Operation != ReplaceOrInsert) - throw "The 'R' modifiers is only applicabe to the 'r' operation"; - if (OriginalDates && Operation != Extract) - throw "The 'o' modifier is only applicable to the 'x' operation"; - if (TruncateNames && Operation!=QuickAppend && Operation!=ReplaceOrInsert) - throw "The 'f' modifier is only applicable to the 'q' and 'r' operations"; - if (OnlyUpdate && Operation != ReplaceOrInsert) - throw "The 'u' modifier is only applicable to the 'r' operation"; - if (Compression && Operation!=ReplaceOrInsert && Operation!=Extract) - throw "The 'z' modifier is only applicable to the 'r' and 'x' operations"; - if (Count > 1 && Members.size() > 1) - throw "Only one member name may be specified with the 'N' modifier"; - - // Return the parsed operation to the caller - return Operation; -} - -// recurseDirectories - Implements the "R" modifier. This function scans through -// the Paths vector (built by buildPaths, below) and replaces any directories it -// finds with all the files in that directory (recursively). It uses the -// sys::Path::getDirectoryContent method to perform the actual directory scans. -bool -recurseDirectories(const sys::Path& path, - std::set& result, std::string* ErrMsg) { - result.clear(); - if (RecurseDirectories) { - std::set content; - if (path.getDirectoryContents(content, ErrMsg)) - return true; - - for (std::set::iterator I = content.begin(), E = content.end(); - I != E; ++I) { - // Make sure it exists and is a directory - sys::PathWithStatus PwS(*I); - const sys::FileStatus *Status = PwS.getFileStatus(false, ErrMsg); - if (!Status) - return true; - if (Status->isDir) { - std::set moreResults; - if (recurseDirectories(*I, moreResults, ErrMsg)) - return true; - result.insert(moreResults.begin(), moreResults.end()); - } else { - result.insert(*I); - } - } - } - return false; -} - -// buildPaths - Convert the strings in the Members vector to sys::Path objects -// and make sure they are valid and exist exist. This check is only needed for -// the operations that add/replace files to the archive ('q' and 'r') -bool buildPaths(bool checkExistence, std::string* ErrMsg) { - for (unsigned i = 0; i < Members.size(); i++) { - sys::Path aPath; - if (!aPath.set(Members[i])) - throw std::string("File member name invalid: ") + Members[i]; - if (checkExistence) { - if (!aPath.exists()) - throw std::string("File does not exist: ") + Members[i]; - std::string Err; - sys::PathWithStatus PwS(aPath); - const sys::FileStatus *si = PwS.getFileStatus(false, &Err); - if (!si) - throw Err; - if (si->isDir) { - std::set dirpaths; - if (recurseDirectories(aPath, dirpaths, ErrMsg)) - return true; - Paths.insert(dirpaths.begin(),dirpaths.end()); - } else { - Paths.insert(aPath); - } - } else { - Paths.insert(aPath); - } - } - return false; -} - -// printSymbolTable - print out the archive's symbol table. -void printSymbolTable() { - std::cout << "\nArchive Symbol Table:\n"; - const Archive::SymTabType& symtab = TheArchive->getSymbolTable(); - for (Archive::SymTabType::const_iterator I=symtab.begin(), E=symtab.end(); - I != E; ++I ) { - unsigned offset = TheArchive->getFirstFileOffset() + I->second; - std::cout << " " << std::setw(9) << offset << "\t" << I->first <<"\n"; - } -} - -// doPrint - Implements the 'p' operation. This function traverses the archive -// looking for members that match the path list. It is careful to uncompress -// things that should be and to skip bitcode files unless the 'k' modifier was -// given. -bool doPrint(std::string* ErrMsg) { - if (buildPaths(false, ErrMsg)) - return true; - unsigned countDown = Count; - for (Archive::iterator I = TheArchive->begin(), E = TheArchive->end(); - I != E; ++I ) { - if (Paths.empty() || - (std::find(Paths.begin(), Paths.end(), I->getPath()) != Paths.end())) { - if (countDown == 1) { - const char* data = reinterpret_cast(I->getData()); - - // Skip things that don't make sense to print - if (I->isLLVMSymbolTable() || I->isSVR4SymbolTable() || - I->isBSD4SymbolTable() || (!DontSkipBitcode && I->isBitcode())) - continue; - - if (Verbose) - std::cout << "Printing " << I->getPath().str() << "\n"; - - unsigned len = I->getSize(); - std::cout.write(data, len); - } else { - countDown--; - } - } - } - return false; -} - -// putMode - utility function for printing out the file mode when the 't' -// operation is in verbose mode. -void -printMode(unsigned mode) { - if (mode & 004) - std::cout << "r"; - else - std::cout << "-"; - if (mode & 002) - std::cout << "w"; - else - std::cout << "-"; - if (mode & 001) - std::cout << "x"; - else - std::cout << "-"; -} - -// doDisplayTable - Implement the 't' operation. This function prints out just -// the file names of each of the members. However, if verbose mode is requested -// ('v' modifier) then the file type, permission mode, user, group, size, and -// modification time are also printed. -bool -doDisplayTable(std::string* ErrMsg) { - if (buildPaths(false, ErrMsg)) - return true; - for (Archive::iterator I = TheArchive->begin(), E = TheArchive->end(); - I != E; ++I ) { - if (Paths.empty() || - (std::find(Paths.begin(), Paths.end(), I->getPath()) != Paths.end())) { - if (Verbose) { - // FIXME: Output should be this format: - // Zrw-r--r-- 500/ 500 525 Nov 8 17:42 2004 Makefile - if (I->isBitcode()) - std::cout << "b"; - else if (I->isCompressed()) - std::cout << "Z"; - else - std::cout << " "; - unsigned mode = I->getMode(); - printMode((mode >> 6) & 007); - printMode((mode >> 3) & 007); - printMode(mode & 007); - std::cout << " " << std::setw(4) << I->getUser(); - std::cout << "/" << std::setw(4) << I->getGroup(); - std::cout << " " << std::setw(8) << I->getSize(); - std::cout << " " << std::setw(20) << I->getModTime().str().substr(4); - std::cout << " " << I->getPath().str() << "\n"; - } else { - std::cout << I->getPath().str() << "\n"; - } - } - } - if (ReallyVerbose) - printSymbolTable(); - return false; -} - -// doExtract - Implement the 'x' operation. This function extracts files back to -// the file system, making sure to uncompress any that were compressed -bool -doExtract(std::string* ErrMsg) { - if (buildPaths(false, ErrMsg)) - return true; - for (Archive::iterator I = TheArchive->begin(), E = TheArchive->end(); - I != E; ++I ) { - if (Paths.empty() || - (std::find(Paths.begin(), Paths.end(), I->getPath()) != Paths.end())) { - - // Make sure the intervening directories are created - if (I->hasPath()) { - sys::Path dirs(I->getPath()); - dirs.eraseComponent(); - if (dirs.createDirectoryOnDisk(/*create_parents=*/true, ErrMsg)) - return true; - } - - // Open up a file stream for writing - std::ios::openmode io_mode = std::ios::out | std::ios::trunc | - std::ios::binary; - std::ofstream file(I->getPath().c_str(), io_mode); - - // Get the data and its length - const char* data = reinterpret_cast(I->getData()); - unsigned len = I->getSize(); - - // Write the data. - file.write(data,len); - file.close(); - - // If we're supposed to retain the original modification times, etc. do so - // now. - if (OriginalDates) - I->getPath().setStatusInfoOnDisk(I->getFileStatus()); - } - } - return false; -} - -// doDelete - Implement the delete operation. This function deletes zero or more -// members from the archive. Note that if the count is specified, there should -// be no more than one path in the Paths list or else this algorithm breaks. -// That check is enforced in parseCommandLine (above). -bool -doDelete(std::string* ErrMsg) { - if (buildPaths(false, ErrMsg)) - return true; - if (Paths.empty()) - return false; - unsigned countDown = Count; - for (Archive::iterator I = TheArchive->begin(), E = TheArchive->end(); - I != E; ) { - if (std::find(Paths.begin(), Paths.end(), I->getPath()) != Paths.end()) { - if (countDown == 1) { - Archive::iterator J = I; - ++I; - TheArchive->erase(J); - } else - countDown--; - } else { - ++I; - } - } - - // We're done editting, reconstruct the archive. - if (TheArchive->writeToDisk(SymTable,TruncateNames,Compression,ErrMsg)) - return true; - if (ReallyVerbose) - printSymbolTable(); - return false; -} - -// doMore - Implement the move operation. This function re-arranges just the -// order of the archive members so that when the archive is written the move -// of the members is accomplished. Note the use of the RelPos variable to -// determine where the items should be moved to. -bool -doMove(std::string* ErrMsg) { - if (buildPaths(false, ErrMsg)) - return true; - - // By default and convention the place to move members to is the end of the - // archive. - Archive::iterator moveto_spot = TheArchive->end(); - - // However, if the relative positioning modifiers were used, we need to scan - // the archive to find the member in question. If we don't find it, its no - // crime, we just move to the end. - if (AddBefore || InsertBefore || AddAfter) { - for (Archive::iterator I = TheArchive->begin(), E= TheArchive->end(); - I != E; ++I ) { - if (RelPos == I->getPath().str()) { - if (AddAfter) { - moveto_spot = I; - moveto_spot++; - } else { - moveto_spot = I; - } - break; - } - } - } - - // Keep a list of the paths remaining to be moved - std::set remaining(Paths); - - // Scan the archive again, this time looking for the members to move to the - // moveto_spot. - for (Archive::iterator I = TheArchive->begin(), E= TheArchive->end(); - I != E && !remaining.empty(); ++I ) { - std::set::iterator found = - std::find(remaining.begin(),remaining.end(),I->getPath()); - if (found != remaining.end()) { - if (I != moveto_spot) - TheArchive->splice(moveto_spot,*TheArchive,I); - remaining.erase(found); - } - } - - // We're done editting, reconstruct the archive. - if (TheArchive->writeToDisk(SymTable,TruncateNames,Compression,ErrMsg)) - return true; - if (ReallyVerbose) - printSymbolTable(); - return false; -} - -// doQuickAppend - Implements the 'q' operation. This function just -// indiscriminantly adds the members to the archive and rebuilds it. -bool -doQuickAppend(std::string* ErrMsg) { - // Get the list of paths to append. - if (buildPaths(true, ErrMsg)) - return true; - if (Paths.empty()) - return false; - - // Append them quickly. - for (std::set::iterator PI = Paths.begin(), PE = Paths.end(); - PI != PE; ++PI) { - if (TheArchive->addFileBefore(*PI,TheArchive->end(),ErrMsg)) - return true; - } - - // We're done editting, reconstruct the archive. - if (TheArchive->writeToDisk(SymTable,TruncateNames,Compression,ErrMsg)) - return true; - if (ReallyVerbose) - printSymbolTable(); - return false; -} - -// doReplaceOrInsert - Implements the 'r' operation. This function will replace -// any existing files or insert new ones into the archive. -bool -doReplaceOrInsert(std::string* ErrMsg) { - - // Build the list of files to be added/replaced. - if (buildPaths(true, ErrMsg)) - return true; - if (Paths.empty()) - return false; - - // Keep track of the paths that remain to be inserted. - std::set remaining(Paths); - - // Default the insertion spot to the end of the archive - Archive::iterator insert_spot = TheArchive->end(); - - // Iterate over the archive contents - for (Archive::iterator I = TheArchive->begin(), E = TheArchive->end(); - I != E && !remaining.empty(); ++I ) { - - // Determine if this archive member matches one of the paths we're trying - // to replace. - - std::set::iterator found = remaining.end(); - for (std::set::iterator RI = remaining.begin(), - RE = remaining.end(); RI != RE; ++RI ) { - std::string compare(RI->str()); - if (TruncateNames && compare.length() > 15) { - const char* nm = compare.c_str(); - unsigned len = compare.length(); - size_t slashpos = compare.rfind('/'); - if (slashpos != std::string::npos) { - nm += slashpos + 1; - len -= slashpos +1; - } - if (len > 15) - len = 15; - compare.assign(nm,len); - } - if (compare == I->getPath().str()) { - found = RI; - break; - } - } - - if (found != remaining.end()) { - std::string Err; - sys::PathWithStatus PwS(*found); - const sys::FileStatus *si = PwS.getFileStatus(false, &Err); - if (!si) - return true; - if (!si->isDir) { - if (OnlyUpdate) { - // Replace the item only if it is newer. - if (si->modTime > I->getModTime()) - if (I->replaceWith(*found, ErrMsg)) - return true; - } else { - // Replace the item regardless of time stamp - if (I->replaceWith(*found, ErrMsg)) - return true; - } - } else { - // We purposefully ignore directories. - } - - // Remove it from our "to do" list - remaining.erase(found); - } - - // Determine if this is the place where we should insert - if ((AddBefore || InsertBefore) && RelPos == I->getPath().str()) - insert_spot = I; - else if (AddAfter && RelPos == I->getPath().str()) { - insert_spot = I; - insert_spot++; - } - } - - // If we didn't replace all the members, some will remain and need to be - // inserted at the previously computed insert-spot. - if (!remaining.empty()) { - for (std::set::iterator PI = remaining.begin(), - PE = remaining.end(); PI != PE; ++PI) { - if (TheArchive->addFileBefore(*PI,insert_spot, ErrMsg)) - return true; - } - } - - // We're done editting, reconstruct the archive. - if (TheArchive->writeToDisk(SymTable,TruncateNames,Compression,ErrMsg)) - return true; - if (ReallyVerbose) - printSymbolTable(); - return false; -} - -// main - main program for llvm-ar .. see comments in the code -int main(int argc, char **argv) { - // Print a stack trace if we signal out. - sys::PrintStackTraceOnErrorSignal(); - PrettyStackTraceProgram X(argc, argv); - LLVMContext &Context = getGlobalContext(); - llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. - - // Have the command line options parsed and handle things - // like --help and --version. - cl::ParseCommandLineOptions(argc, argv, - "LLVM Archiver (llvm-ar)\n\n" - " This program archives bitcode files into single libraries\n" - ); - - int exitCode = 0; - - // Make sure we don't exit with "unhandled exception". - try { - // Do our own parsing of the command line because the CommandLine utility - // can't handle the grouped positional parameters without a dash. - ArchiveOperation Operation = parseCommandLine(); - - // Check the path name of the archive - sys::Path ArchivePath; - if (!ArchivePath.set(ArchiveName)) - throw std::string("Archive name invalid: ") + ArchiveName; - - // Create or open the archive object. - if (!ArchivePath.exists()) { - // Produce a warning if we should and we're creating the archive - if (!Create) - errs() << argv[0] << ": creating " << ArchivePath.str() << "\n"; - TheArchive = Archive::CreateEmpty(ArchivePath, Context); - TheArchive->writeToDisk(); - } else { - std::string Error; - TheArchive = Archive::OpenAndLoad(ArchivePath, Context, &Error); - if (TheArchive == 0) { - errs() << argv[0] << ": error loading '" << ArchivePath.str() << "': " - << Error << "!\n"; - return 1; - } - } - - // Make sure we're not fooling ourselves. - assert(TheArchive && "Unable to instantiate the archive"); - - // Make sure we clean up the archive even on failure. - std::auto_ptr AutoArchive(TheArchive); - - // Perform the operation - std::string ErrMsg; - bool haveError = false; - switch (Operation) { - case Print: haveError = doPrint(&ErrMsg); break; - case Delete: haveError = doDelete(&ErrMsg); break; - case Move: haveError = doMove(&ErrMsg); break; - case QuickAppend: haveError = doQuickAppend(&ErrMsg); break; - case ReplaceOrInsert: haveError = doReplaceOrInsert(&ErrMsg); break; - case DisplayTable: haveError = doDisplayTable(&ErrMsg); break; - case Extract: haveError = doExtract(&ErrMsg); break; - case NoOperation: - errs() << argv[0] << ": No operation was selected.\n"; - break; - } - if (haveError) { - errs() << argv[0] << ": " << ErrMsg << "\n"; - return 1; - } - } catch (const char*msg) { - // These errors are usage errors, thrown only by the various checks in the - // code above. - errs() << argv[0] << ": " << msg << "\n\n"; - cl::PrintHelpMessage(); - exitCode = 1; - } catch (const std::string& msg) { - // These errors are thrown by LLVM libraries (e.g. lib System) and represent - // a more serious error so we bump the exitCode and don't print the usage. - errs() << argv[0] << ": " << msg << "\n"; - exitCode = 2; - } catch (...) { - // This really shouldn't happen, but just in case .... - errs() << argv[0] << ": An unexpected unknown exception occurred.\n"; - exitCode = 3; - } - - // Return result code back to operating system. - return exitCode; -} diff --git a/contrib/llvm/tools/llvm-as/CMakeLists.txt b/contrib/llvm/tools/llvm-as/CMakeLists.txt deleted file mode 100644 index eef4a13e29dc..000000000000 --- a/contrib/llvm/tools/llvm-as/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -set(LLVM_LINK_COMPONENTS asmparser bitwriter) -set(LLVM_REQUIRES_EH 1) - -add_llvm_tool(llvm-as - llvm-as.cpp - ) diff --git a/contrib/llvm/tools/llvm-as/Makefile b/contrib/llvm/tools/llvm-as/Makefile deleted file mode 100644 index e1e5853a7b6a..000000000000 --- a/contrib/llvm/tools/llvm-as/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -##===- tools/llvm-as/Makefile ------------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../.. -TOOLNAME = llvm-as -LINK_COMPONENTS := asmparser bitwriter - -# This tool has no plugins, optimize startup time. -TOOL_NO_EXPORTS = 1 - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/tools/llvm-as/llvm-as.cpp b/contrib/llvm/tools/llvm-as/llvm-as.cpp deleted file mode 100644 index 1eaa4b3bea44..000000000000 --- a/contrib/llvm/tools/llvm-as/llvm-as.cpp +++ /dev/null @@ -1,119 +0,0 @@ -//===--- llvm-as.cpp - The low-level LLVM assembler -----------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This utility may be invoked in the following manner: -// llvm-as --help - Output information about command line switches -// llvm-as [options] - Read LLVM asm from stdin, write bitcode to stdout -// llvm-as [options] x.ll - Read LLVM asm from the x.ll file, write bitcode -// to the x.bc file. -// -//===----------------------------------------------------------------------===// - -#include "llvm/LLVMContext.h" -#include "llvm/Module.h" -#include "llvm/Assembly/Parser.h" -#include "llvm/Analysis/Verifier.h" -#include "llvm/Bitcode/ReaderWriter.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/ManagedStatic.h" -#include "llvm/Support/PrettyStackTrace.h" -#include "llvm/Support/SourceMgr.h" -#include "llvm/Support/SystemUtils.h" -#include "llvm/Support/raw_ostream.h" -#include "llvm/System/Signals.h" -#include -using namespace llvm; - -static cl::opt -InputFilename(cl::Positional, cl::desc(""), cl::init("-")); - -static cl::opt -OutputFilename("o", cl::desc("Override output filename"), - cl::value_desc("filename")); - -static cl::opt -Force("f", cl::desc("Enable binary output on terminals")); - -static cl::opt -DisableOutput("disable-output", cl::desc("Disable output"), cl::init(false)); - -static cl::opt -DumpAsm("d", cl::desc("Print assembly as parsed"), cl::Hidden); - -static cl::opt -DisableVerify("disable-verify", cl::Hidden, - cl::desc("Do not run verifier on input LLVM (dangerous!)")); - -static void WriteOutputFile(const Module *M) { - // Infer the output filename if needed. - if (OutputFilename.empty()) { - if (InputFilename == "-") { - OutputFilename = "-"; - } else { - std::string IFN = InputFilename; - int Len = IFN.length(); - if (IFN[Len-3] == '.' && IFN[Len-2] == 'l' && IFN[Len-1] == 'l') { - // Source ends in .ll - OutputFilename = std::string(IFN.begin(), IFN.end()-3); - } else { - OutputFilename = IFN; // Append a .bc to it - } - OutputFilename += ".bc"; - } - } - - std::string ErrorInfo; - OwningPtr Out - (new tool_output_file(OutputFilename.c_str(), ErrorInfo, - raw_fd_ostream::F_Binary)); - if (!ErrorInfo.empty()) { - errs() << ErrorInfo << '\n'; - exit(1); - } - - if (Force || !CheckBitcodeOutputToConsole(Out->os(), true)) - WriteBitcodeToFile(M, Out->os()); - - // Declare success. - Out->keep(); -} - -int main(int argc, char **argv) { - // Print a stack trace if we signal out. - sys::PrintStackTraceOnErrorSignal(); - PrettyStackTraceProgram X(argc, argv); - LLVMContext &Context = getGlobalContext(); - llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. - cl::ParseCommandLineOptions(argc, argv, "llvm .ll -> .bc assembler\n"); - - // Parse the file now... - SMDiagnostic Err; - std::auto_ptr M(ParseAssemblyFile(InputFilename, Err, Context)); - if (M.get() == 0) { - Err.Print(argv[0], errs()); - return 1; - } - - if (!DisableVerify) { - std::string Err; - if (verifyModule(*M.get(), ReturnStatusAction, &Err)) { - errs() << argv[0] - << ": assembly parsed, but does not verify as correct!\n"; - errs() << Err; - return 1; - } - } - - if (DumpAsm) errs() << "Here's the assembly:\n" << *M.get(); - - if (!DisableOutput) - WriteOutputFile(M.get()); - - return 0; -} diff --git a/contrib/llvm/tools/llvm-bcanalyzer/CMakeLists.txt b/contrib/llvm/tools/llvm-bcanalyzer/CMakeLists.txt deleted file mode 100644 index 732bc3296f2c..000000000000 --- a/contrib/llvm/tools/llvm-bcanalyzer/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -set(LLVM_LINK_COMPONENTS bitreader) -set(LLVM_REQUIRES_EH 1) - -add_llvm_tool(llvm-bcanalyzer - llvm-bcanalyzer.cpp - ) diff --git a/contrib/llvm/tools/llvm-bcanalyzer/Makefile b/contrib/llvm/tools/llvm-bcanalyzer/Makefile deleted file mode 100644 index 488387d5da24..000000000000 --- a/contrib/llvm/tools/llvm-bcanalyzer/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -##===- tools/llvm-bcanalyzer/Makefile ----------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -LEVEL = ../.. - -TOOLNAME = llvm-bcanalyzer -LINK_COMPONENTS := bitreader - -# This tool has no plugins, optimize startup time. -TOOL_NO_EXPORTS = 1 - -include $(LEVEL)/Makefile.common diff --git a/contrib/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp b/contrib/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp deleted file mode 100644 index 9c0d675793d3..000000000000 --- a/contrib/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp +++ /dev/null @@ -1,625 +0,0 @@ -//===-- llvm-bcanalyzer.cpp - Bitcode Analyzer --------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This tool may be invoked in the following manner: -// llvm-bcanalyzer [options] - Read LLVM bitcode from stdin -// llvm-bcanalyzer [options] x.bc - Read LLVM bitcode from the x.bc file -// -// Options: -// --help - Output information about command line switches -// --dump - Dump low-level bitcode structure in readable format -// -// This tool provides analytical information about a bitcode file. It is -// intended as an aid to developers of bitcode reading and writing software. It -// produces on std::out a summary of the bitcode file that shows various -// statistics about the contents of the file. By default this information is -// detailed and contains information about individual bitcode blocks and the -// functions in the module. -// The tool is also able to print a bitcode file in a straight forward text -// format that shows the containment and relationships of the information in -// the bitcode file (-dump option). -// -//===----------------------------------------------------------------------===// - -#include "llvm/Analysis/Verifier.h" -#include "llvm/Bitcode/BitstreamReader.h" -#include "llvm/Bitcode/LLVMBitCodes.h" -#include "llvm/Bitcode/ReaderWriter.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/Format.h" -#include "llvm/Support/ManagedStatic.h" -#include "llvm/Support/MemoryBuffer.h" -#include "llvm/Support/PrettyStackTrace.h" -#include "llvm/Support/raw_ostream.h" -#include "llvm/System/Signals.h" -#include -#include -#include -using namespace llvm; - -static cl::opt - InputFilename(cl::Positional, cl::desc(""), cl::init("-")); - -static cl::opt Dump("dump", cl::desc("Dump low level bitcode trace")); - -//===----------------------------------------------------------------------===// -// Bitcode specific analysis. -//===----------------------------------------------------------------------===// - -static cl::opt NoHistogram("disable-histogram", - cl::desc("Do not print per-code histogram")); - -static cl::opt -NonSymbolic("non-symbolic", - cl::desc("Emit numberic info in dump even if" - " symbolic info is available")); - -/// CurStreamType - If we can sniff the flavor of this stream, we can produce -/// better dump info. -static enum { - UnknownBitstream, - LLVMIRBitstream -} CurStreamType; - - -/// GetBlockName - Return a symbolic block name if known, otherwise return -/// null. -static const char *GetBlockName(unsigned BlockID, - const BitstreamReader &StreamFile) { - // Standard blocks for all bitcode files. - if (BlockID < bitc::FIRST_APPLICATION_BLOCKID) { - if (BlockID == bitc::BLOCKINFO_BLOCK_ID) - return "BLOCKINFO_BLOCK"; - return 0; - } - - // Check to see if we have a blockinfo record for this block, with a name. - if (const BitstreamReader::BlockInfo *Info = - StreamFile.getBlockInfo(BlockID)) { - if (!Info->Name.empty()) - return Info->Name.c_str(); - } - - - if (CurStreamType != LLVMIRBitstream) return 0; - - switch (BlockID) { - default: return 0; - case bitc::MODULE_BLOCK_ID: return "MODULE_BLOCK"; - case bitc::PARAMATTR_BLOCK_ID: return "PARAMATTR_BLOCK"; - case bitc::TYPE_BLOCK_ID: return "TYPE_BLOCK"; - case bitc::CONSTANTS_BLOCK_ID: return "CONSTANTS_BLOCK"; - case bitc::FUNCTION_BLOCK_ID: return "FUNCTION_BLOCK"; - case bitc::TYPE_SYMTAB_BLOCK_ID: return "TYPE_SYMTAB"; - case bitc::VALUE_SYMTAB_BLOCK_ID: return "VALUE_SYMTAB"; - case bitc::METADATA_BLOCK_ID: return "METADATA_BLOCK"; - case bitc::METADATA_ATTACHMENT_ID: return "METADATA_ATTACHMENT_BLOCK"; - } -} - -/// GetCodeName - Return a symbolic code name if known, otherwise return -/// null. -static const char *GetCodeName(unsigned CodeID, unsigned BlockID, - const BitstreamReader &StreamFile) { - // Standard blocks for all bitcode files. - if (BlockID < bitc::FIRST_APPLICATION_BLOCKID) { - if (BlockID == bitc::BLOCKINFO_BLOCK_ID) { - switch (CodeID) { - default: return 0; - case bitc::BLOCKINFO_CODE_SETBID: return "SETBID"; - case bitc::BLOCKINFO_CODE_BLOCKNAME: return "BLOCKNAME"; - case bitc::BLOCKINFO_CODE_SETRECORDNAME: return "SETRECORDNAME"; - } - } - return 0; - } - - // Check to see if we have a blockinfo record for this record, with a name. - if (const BitstreamReader::BlockInfo *Info = - StreamFile.getBlockInfo(BlockID)) { - for (unsigned i = 0, e = Info->RecordNames.size(); i != e; ++i) - if (Info->RecordNames[i].first == CodeID) - return Info->RecordNames[i].second.c_str(); - } - - - if (CurStreamType != LLVMIRBitstream) return 0; - - switch (BlockID) { - default: return 0; - case bitc::MODULE_BLOCK_ID: - switch (CodeID) { - default: return 0; - case bitc::MODULE_CODE_VERSION: return "VERSION"; - case bitc::MODULE_CODE_TRIPLE: return "TRIPLE"; - case bitc::MODULE_CODE_DATALAYOUT: return "DATALAYOUT"; - case bitc::MODULE_CODE_ASM: return "ASM"; - case bitc::MODULE_CODE_SECTIONNAME: return "SECTIONNAME"; - case bitc::MODULE_CODE_DEPLIB: return "DEPLIB"; - case bitc::MODULE_CODE_GLOBALVAR: return "GLOBALVAR"; - case bitc::MODULE_CODE_FUNCTION: return "FUNCTION"; - case bitc::MODULE_CODE_ALIAS: return "ALIAS"; - case bitc::MODULE_CODE_PURGEVALS: return "PURGEVALS"; - case bitc::MODULE_CODE_GCNAME: return "GCNAME"; - } - case bitc::PARAMATTR_BLOCK_ID: - switch (CodeID) { - default: return 0; - case bitc::PARAMATTR_CODE_ENTRY: return "ENTRY"; - } - case bitc::TYPE_BLOCK_ID: - switch (CodeID) { - default: return 0; - case bitc::TYPE_CODE_NUMENTRY: return "NUMENTRY"; - case bitc::TYPE_CODE_VOID: return "VOID"; - case bitc::TYPE_CODE_FLOAT: return "FLOAT"; - case bitc::TYPE_CODE_DOUBLE: return "DOUBLE"; - case bitc::TYPE_CODE_LABEL: return "LABEL"; - case bitc::TYPE_CODE_OPAQUE: return "OPAQUE"; - case bitc::TYPE_CODE_INTEGER: return "INTEGER"; - case bitc::TYPE_CODE_POINTER: return "POINTER"; - case bitc::TYPE_CODE_FUNCTION: return "FUNCTION"; - case bitc::TYPE_CODE_STRUCT: return "STRUCT"; - case bitc::TYPE_CODE_ARRAY: return "ARRAY"; - case bitc::TYPE_CODE_VECTOR: return "VECTOR"; - case bitc::TYPE_CODE_X86_FP80: return "X86_FP80"; - case bitc::TYPE_CODE_FP128: return "FP128"; - case bitc::TYPE_CODE_PPC_FP128: return "PPC_FP128"; - case bitc::TYPE_CODE_METADATA: return "METADATA"; - } - - case bitc::CONSTANTS_BLOCK_ID: - switch (CodeID) { - default: return 0; - case bitc::CST_CODE_SETTYPE: return "SETTYPE"; - case bitc::CST_CODE_NULL: return "NULL"; - case bitc::CST_CODE_UNDEF: return "UNDEF"; - case bitc::CST_CODE_INTEGER: return "INTEGER"; - case bitc::CST_CODE_WIDE_INTEGER: return "WIDE_INTEGER"; - case bitc::CST_CODE_FLOAT: return "FLOAT"; - case bitc::CST_CODE_AGGREGATE: return "AGGREGATE"; - case bitc::CST_CODE_STRING: return "STRING"; - case bitc::CST_CODE_CSTRING: return "CSTRING"; - case bitc::CST_CODE_CE_BINOP: return "CE_BINOP"; - case bitc::CST_CODE_CE_CAST: return "CE_CAST"; - case bitc::CST_CODE_CE_GEP: return "CE_GEP"; - case bitc::CST_CODE_CE_INBOUNDS_GEP: return "CE_INBOUNDS_GEP"; - case bitc::CST_CODE_CE_SELECT: return "CE_SELECT"; - case bitc::CST_CODE_CE_EXTRACTELT: return "CE_EXTRACTELT"; - case bitc::CST_CODE_CE_INSERTELT: return "CE_INSERTELT"; - case bitc::CST_CODE_CE_SHUFFLEVEC: return "CE_SHUFFLEVEC"; - case bitc::CST_CODE_CE_CMP: return "CE_CMP"; - case bitc::CST_CODE_INLINEASM: return "INLINEASM"; - case bitc::CST_CODE_CE_SHUFVEC_EX: return "CE_SHUFVEC_EX"; - } - case bitc::FUNCTION_BLOCK_ID: - switch (CodeID) { - default: return 0; - case bitc::FUNC_CODE_DECLAREBLOCKS: return "DECLAREBLOCKS"; - - case bitc::FUNC_CODE_INST_BINOP: return "INST_BINOP"; - case bitc::FUNC_CODE_INST_CAST: return "INST_CAST"; - case bitc::FUNC_CODE_INST_GEP: return "INST_GEP"; - case bitc::FUNC_CODE_INST_INBOUNDS_GEP: return "INST_INBOUNDS_GEP"; - case bitc::FUNC_CODE_INST_SELECT: return "INST_SELECT"; - case bitc::FUNC_CODE_INST_EXTRACTELT: return "INST_EXTRACTELT"; - case bitc::FUNC_CODE_INST_INSERTELT: return "INST_INSERTELT"; - case bitc::FUNC_CODE_INST_SHUFFLEVEC: return "INST_SHUFFLEVEC"; - case bitc::FUNC_CODE_INST_CMP: return "INST_CMP"; - - case bitc::FUNC_CODE_INST_RET: return "INST_RET"; - case bitc::FUNC_CODE_INST_BR: return "INST_BR"; - case bitc::FUNC_CODE_INST_SWITCH: return "INST_SWITCH"; - case bitc::FUNC_CODE_INST_INVOKE: return "INST_INVOKE"; - case bitc::FUNC_CODE_INST_UNWIND: return "INST_UNWIND"; - case bitc::FUNC_CODE_INST_UNREACHABLE: return "INST_UNREACHABLE"; - - case bitc::FUNC_CODE_INST_PHI: return "INST_PHI"; - case bitc::FUNC_CODE_INST_MALLOC: return "INST_MALLOC"; - case bitc::FUNC_CODE_INST_FREE: return "INST_FREE"; - case bitc::FUNC_CODE_INST_ALLOCA: return "INST_ALLOCA"; - case bitc::FUNC_CODE_INST_LOAD: return "INST_LOAD"; - case bitc::FUNC_CODE_INST_STORE: return "INST_STORE"; - case bitc::FUNC_CODE_INST_CALL: return "INST_CALL"; - case bitc::FUNC_CODE_INST_VAARG: return "INST_VAARG"; - case bitc::FUNC_CODE_INST_STORE2: return "INST_STORE2"; - case bitc::FUNC_CODE_INST_GETRESULT: return "INST_GETRESULT"; - case bitc::FUNC_CODE_INST_EXTRACTVAL: return "INST_EXTRACTVAL"; - case bitc::FUNC_CODE_INST_INSERTVAL: return "INST_INSERTVAL"; - case bitc::FUNC_CODE_INST_CMP2: return "INST_CMP2"; - case bitc::FUNC_CODE_INST_VSELECT: return "INST_VSELECT"; - case bitc::FUNC_CODE_DEBUG_LOC: return "DEBUG_LOC"; - case bitc::FUNC_CODE_DEBUG_LOC_AGAIN: return "DEBUG_LOC_AGAIN"; - case bitc::FUNC_CODE_INST_CALL2: return "INST_CALL2"; - case bitc::FUNC_CODE_DEBUG_LOC2: return "DEBUG_LOC2"; - } - case bitc::TYPE_SYMTAB_BLOCK_ID: - switch (CodeID) { - default: return 0; - case bitc::TST_CODE_ENTRY: return "ENTRY"; - } - case bitc::VALUE_SYMTAB_BLOCK_ID: - switch (CodeID) { - default: return 0; - case bitc::VST_CODE_ENTRY: return "ENTRY"; - case bitc::VST_CODE_BBENTRY: return "BBENTRY"; - } - case bitc::METADATA_ATTACHMENT_ID: - switch(CodeID) { - default:return 0; - case bitc::METADATA_ATTACHMENT: return "METADATA_ATTACHMENT"; - } - case bitc::METADATA_BLOCK_ID: - switch(CodeID) { - default:return 0; - case bitc::METADATA_STRING: return "METADATA_STRING"; - case bitc::METADATA_NODE: return "METADATA_NODE"; - case bitc::METADATA_FN_NODE: return "METADATA_FN_NODE"; - case bitc::METADATA_NAME: return "METADATA_NAME"; - case bitc::METADATA_NAMED_NODE: return "METADATA_NAMED_NODE"; - case bitc::METADATA_KIND: return "METADATA_KIND"; - case bitc::METADATA_ATTACHMENT: return "METADATA_ATTACHMENT"; - case bitc::METADATA_NODE2: return "METADATA_NODE2"; - case bitc::METADATA_FN_NODE2: return "METADATA_FN_NODE2"; - case bitc::METADATA_NAMED_NODE2: return "METADATA_NAMED_NODE2"; - case bitc::METADATA_ATTACHMENT2: return "METADATA_ATTACHMENT2"; - } - } -} - -struct PerRecordStats { - unsigned NumInstances; - unsigned NumAbbrev; - uint64_t TotalBits; - - PerRecordStats() : NumInstances(0), NumAbbrev(0), TotalBits(0) {} -}; - -struct PerBlockIDStats { - /// NumInstances - This the number of times this block ID has been seen. - unsigned NumInstances; - - /// NumBits - The total size in bits of all of these blocks. - uint64_t NumBits; - - /// NumSubBlocks - The total number of blocks these blocks contain. - unsigned NumSubBlocks; - - /// NumAbbrevs - The total number of abbreviations. - unsigned NumAbbrevs; - - /// NumRecords - The total number of records these blocks contain, and the - /// number that are abbreviated. - unsigned NumRecords, NumAbbreviatedRecords; - - /// CodeFreq - Keep track of the number of times we see each code. - std::vector CodeFreq; - - PerBlockIDStats() - : NumInstances(0), NumBits(0), - NumSubBlocks(0), NumAbbrevs(0), NumRecords(0), NumAbbreviatedRecords(0) {} -}; - -static std::map BlockIDStats; - - - -/// Error - All bitcode analysis errors go through this function, making this a -/// good place to breakpoint if debugging. -static bool Error(const std::string &Err) { - errs() << Err << "\n"; - return true; -} - -/// ParseBlock - Read a block, updating statistics, etc. -static bool ParseBlock(BitstreamCursor &Stream, unsigned IndentLevel) { - std::string Indent(IndentLevel*2, ' '); - uint64_t BlockBitStart = Stream.GetCurrentBitNo(); - unsigned BlockID = Stream.ReadSubBlockID(); - - // Get the statistics for this BlockID. - PerBlockIDStats &BlockStats = BlockIDStats[BlockID]; - - BlockStats.NumInstances++; - - // BLOCKINFO is a special part of the stream. - if (BlockID == bitc::BLOCKINFO_BLOCK_ID) { - if (Dump) errs() << Indent << "\n"; - if (Stream.ReadBlockInfoBlock()) - return Error("Malformed BlockInfoBlock"); - uint64_t BlockBitEnd = Stream.GetCurrentBitNo(); - BlockStats.NumBits += BlockBitEnd-BlockBitStart; - return false; - } - - unsigned NumWords = 0; - if (Stream.EnterSubBlock(BlockID, &NumWords)) - return Error("Malformed block record"); - - const char *BlockName = 0; - if (Dump) { - errs() << Indent << "<"; - if ((BlockName = GetBlockName(BlockID, *Stream.getBitStreamReader()))) - errs() << BlockName; - else - errs() << "UnknownBlock" << BlockID; - - if (NonSymbolic && BlockName) - errs() << " BlockID=" << BlockID; - - errs() << " NumWords=" << NumWords - << " BlockCodeSize=" << Stream.GetAbbrevIDWidth() << ">\n"; - } - - SmallVector Record; - - // Read all the records for this block. - while (1) { - if (Stream.AtEndOfStream()) - return Error("Premature end of bitstream"); - - uint64_t RecordStartBit = Stream.GetCurrentBitNo(); - - // Read the code for this record. - unsigned AbbrevID = Stream.ReadCode(); - switch (AbbrevID) { - case bitc::END_BLOCK: { - if (Stream.ReadBlockEnd()) - return Error("Error at end of block"); - uint64_t BlockBitEnd = Stream.GetCurrentBitNo(); - BlockStats.NumBits += BlockBitEnd-BlockBitStart; - if (Dump) { - errs() << Indent << "\n"; - else - errs() << "UnknownBlock" << BlockID << ">\n"; - } - return false; - } - case bitc::ENTER_SUBBLOCK: { - uint64_t SubBlockBitStart = Stream.GetCurrentBitNo(); - if (ParseBlock(Stream, IndentLevel+1)) - return true; - ++BlockStats.NumSubBlocks; - uint64_t SubBlockBitEnd = Stream.GetCurrentBitNo(); - - // Don't include subblock sizes in the size of this block. - BlockBitStart += SubBlockBitEnd-SubBlockBitStart; - break; - } - case bitc::DEFINE_ABBREV: - Stream.ReadAbbrevRecord(); - ++BlockStats.NumAbbrevs; - break; - default: - Record.clear(); - - ++BlockStats.NumRecords; - if (AbbrevID != bitc::UNABBREV_RECORD) - ++BlockStats.NumAbbreviatedRecords; - - const char *BlobStart = 0; - unsigned BlobLen = 0; - unsigned Code = Stream.ReadRecord(AbbrevID, Record, BlobStart, BlobLen); - - - - // Increment the # occurrences of this code. - if (BlockStats.CodeFreq.size() <= Code) - BlockStats.CodeFreq.resize(Code+1); - BlockStats.CodeFreq[Code].NumInstances++; - BlockStats.CodeFreq[Code].TotalBits += - Stream.GetCurrentBitNo()-RecordStartBit; - if (AbbrevID != bitc::UNABBREV_RECORD) - BlockStats.CodeFreq[Code].NumAbbrev++; - - if (Dump) { - errs() << Indent << " <"; - if (const char *CodeName = - GetCodeName(Code, BlockID, *Stream.getBitStreamReader())) - errs() << CodeName; - else - errs() << "UnknownCode" << Code; - if (NonSymbolic && - GetCodeName(Code, BlockID, *Stream.getBitStreamReader())) - errs() << " codeid=" << Code; - if (AbbrevID != bitc::UNABBREV_RECORD) - errs() << " abbrevid=" << AbbrevID; - - for (unsigned i = 0, e = Record.size(); i != e; ++i) - errs() << " op" << i << "=" << (int64_t)Record[i]; - - errs() << "/>"; - - if (BlobStart) { - errs() << " blob data = "; - bool BlobIsPrintable = true; - for (unsigned i = 0; i != BlobLen; ++i) - if (!isprint(BlobStart[i])) { - BlobIsPrintable = false; - break; - } - - if (BlobIsPrintable) - errs() << "'" << std::string(BlobStart, BlobStart+BlobLen) <<"'"; - else - errs() << "unprintable, " << BlobLen << " bytes."; - } - - errs() << "\n"; - } - - break; - } - } -} - -static void PrintSize(double Bits) { - fprintf(stderr, "%.2f/%.2fB/%lluW", Bits, Bits/8,(unsigned long long)Bits/32); -} -static void PrintSize(uint64_t Bits) { - fprintf(stderr, "%llub/%.2fB/%lluW", (unsigned long long)Bits, - (double)Bits/8, (unsigned long long)Bits/32); -} - - -/// AnalyzeBitcode - Analyze the bitcode file specified by InputFilename. -static int AnalyzeBitcode() { - // Read the input file. - MemoryBuffer *MemBuf = MemoryBuffer::getFileOrSTDIN(InputFilename.c_str()); - - if (MemBuf == 0) - return Error("Error reading '" + InputFilename + "'."); - - if (MemBuf->getBufferSize() & 3) - return Error("Bitcode stream should be a multiple of 4 bytes in length"); - - unsigned char *BufPtr = (unsigned char *)MemBuf->getBufferStart(); - unsigned char *EndBufPtr = BufPtr+MemBuf->getBufferSize(); - - // If we have a wrapper header, parse it and ignore the non-bc file contents. - // The magic number is 0x0B17C0DE stored in little endian. - if (isBitcodeWrapper(BufPtr, EndBufPtr)) - if (SkipBitcodeWrapperHeader(BufPtr, EndBufPtr)) - return Error("Invalid bitcode wrapper header"); - - BitstreamReader StreamFile(BufPtr, EndBufPtr); - BitstreamCursor Stream(StreamFile); - StreamFile.CollectBlockInfoNames(); - - // Read the stream signature. - char Signature[6]; - Signature[0] = Stream.Read(8); - Signature[1] = Stream.Read(8); - Signature[2] = Stream.Read(4); - Signature[3] = Stream.Read(4); - Signature[4] = Stream.Read(4); - Signature[5] = Stream.Read(4); - - // Autodetect the file contents, if it is one we know. - CurStreamType = UnknownBitstream; - if (Signature[0] == 'B' && Signature[1] == 'C' && - Signature[2] == 0x0 && Signature[3] == 0xC && - Signature[4] == 0xE && Signature[5] == 0xD) - CurStreamType = LLVMIRBitstream; - - unsigned NumTopBlocks = 0; - - // Parse the top-level structure. We only allow blocks at the top-level. - while (!Stream.AtEndOfStream()) { - unsigned Code = Stream.ReadCode(); - if (Code != bitc::ENTER_SUBBLOCK) - return Error("Invalid record at top-level"); - - if (ParseBlock(Stream, 0)) - return true; - ++NumTopBlocks; - } - - if (Dump) errs() << "\n\n"; - - uint64_t BufferSizeBits = (EndBufPtr-BufPtr)*CHAR_BIT; - // Print a summary of the read file. - errs() << "Summary of " << InputFilename << ":\n"; - errs() << " Total size: "; - PrintSize(BufferSizeBits); - errs() << "\n"; - errs() << " Stream type: "; - switch (CurStreamType) { - default: assert(0 && "Unknown bitstream type"); - case UnknownBitstream: errs() << "unknown\n"; break; - case LLVMIRBitstream: errs() << "LLVM IR\n"; break; - } - errs() << " # Toplevel Blocks: " << NumTopBlocks << "\n"; - errs() << "\n"; - - // Emit per-block stats. - errs() << "Per-block Summary:\n"; - for (std::map::iterator I = BlockIDStats.begin(), - E = BlockIDStats.end(); I != E; ++I) { - errs() << " Block ID #" << I->first; - if (const char *BlockName = GetBlockName(I->first, StreamFile)) - errs() << " (" << BlockName << ")"; - errs() << ":\n"; - - const PerBlockIDStats &Stats = I->second; - errs() << " Num Instances: " << Stats.NumInstances << "\n"; - errs() << " Total Size: "; - PrintSize(Stats.NumBits); - errs() << "\n"; - double pct = (Stats.NumBits * 100.0) / BufferSizeBits; - errs() << " Percent of file: " << format("%2.4f%%", pct) << "\n"; - if (Stats.NumInstances > 1) { - errs() << " Average Size: "; - PrintSize(Stats.NumBits/(double)Stats.NumInstances); - errs() << "\n"; - errs() << " Tot/Avg SubBlocks: " << Stats.NumSubBlocks << "/" - << Stats.NumSubBlocks/(double)Stats.NumInstances << "\n"; - errs() << " Tot/Avg Abbrevs: " << Stats.NumAbbrevs << "/" - << Stats.NumAbbrevs/(double)Stats.NumInstances << "\n"; - errs() << " Tot/Avg Records: " << Stats.NumRecords << "/" - << Stats.NumRecords/(double)Stats.NumInstances << "\n"; - } else { - errs() << " Num SubBlocks: " << Stats.NumSubBlocks << "\n"; - errs() << " Num Abbrevs: " << Stats.NumAbbrevs << "\n"; - errs() << " Num Records: " << Stats.NumRecords << "\n"; - } - if (Stats.NumRecords) { - double pct = (Stats.NumAbbreviatedRecords * 100.0) / Stats.NumRecords; - errs() << " Percent Abbrevs: " << format("%2.4f%%", pct) << "\n"; - } - errs() << "\n"; - - // Print a histogram of the codes we see. - if (!NoHistogram && !Stats.CodeFreq.empty()) { - std::vector > FreqPairs; // - for (unsigned i = 0, e = Stats.CodeFreq.size(); i != e; ++i) - if (unsigned Freq = Stats.CodeFreq[i].NumInstances) - FreqPairs.push_back(std::make_pair(Freq, i)); - std::stable_sort(FreqPairs.begin(), FreqPairs.end()); - std::reverse(FreqPairs.begin(), FreqPairs.end()); - - errs() << "\tRecord Histogram:\n"; - fprintf(stderr, "\t\t Count # Bits %% Abv Record Kind\n"); - for (unsigned i = 0, e = FreqPairs.size(); i != e; ++i) { - const PerRecordStats &RecStats = Stats.CodeFreq[FreqPairs[i].second]; - - fprintf(stderr, "\t\t%7d %9llu ", RecStats.NumInstances, - (unsigned long long)RecStats.TotalBits); - - if (RecStats.NumAbbrev) - fprintf(stderr, "%7.2f ", - (double)RecStats.NumAbbrev/RecStats.NumInstances*100); - else - fprintf(stderr, " "); - - if (const char *CodeName = - GetCodeName(FreqPairs[i].second, I->first, StreamFile)) - fprintf(stderr, "%s\n", CodeName); - else - fprintf(stderr, "UnknownCode%d\n", FreqPairs[i].second); - } - errs() << "\n"; - - } - } - return 0; -} - - -int main(int argc, char **argv) { - // Print a stack trace if we signal out. - sys::PrintStackTraceOnErrorSignal(); - PrettyStackTraceProgram X(argc, argv); - llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. - cl::ParseCommandLineOptions(argc, argv, "llvm-bcanalyzer file analyzer\n"); - - return AnalyzeBitcode(); -} diff --git a/contrib/llvm/tools/llvm-config/CMakeLists.txt b/contrib/llvm/tools/llvm-config/CMakeLists.txt deleted file mode 100644 index 663cae5ed2d4..000000000000 --- a/contrib/llvm/tools/llvm-config/CMakeLists.txt +++ /dev/null @@ -1,146 +0,0 @@ -include(TestBigEndian) - -include(FindPerl) -if( NOT PERL_FOUND ) - message(FATAL_ERROR "Perl required but not found!") -endif( NOT PERL_FOUND ) - -set(PERL ${PERL_EXECUTABLE}) -set(VERSION PACKAGE_VERSION) -set(PREFIX ${LLVM_BINARY_DIR}) # TODO: Root for `make install'. -set(abs_top_srcdir ${LLVM_MAIN_SRC_DIR}) -set(abs_top_builddir ${LLVM_BINARY_DIR}) -execute_process(COMMAND date - OUTPUT_VARIABLE LLVM_CONFIGTIME - OUTPUT_STRIP_TRAILING_WHITESPACE) -# LLVM_ON_UNIX and LLVM_ON_WIN32 already set. -# those are set to blank by `autoconf' on MinGW, so it seems they are not required: -#set(LLVMGCCDIR "") -#set(LLVMGCC "") -#set(LLVMGXX "") -test_big_endian(IS_BIG_ENDIAN) -if( IS_BIG_ENDIAN ) - set(ENDIAN "big") -else( IS_BIG_ENDIAN ) - set(ENDIAN "little") -endif( IS_BIG_ENDIAN ) -set(SHLIBEXT ${LTDL_SHLIB_EXT}) -#EXEEXT already set. -set(OS "${CMAKE_SYSTEM}") -set(ARCH "${LLVM_NATIVE_ARCH}") - -get_system_libs(LLVM_SYSTEM_LIBS_LIST) -foreach(l ${LLVM_SYSTEM_LIBS_LIST}) - set(LLVM_SYSTEM_LIBS ${LLVM_SYSTEM_LIBS} "-l${l}") -endforeach() - -foreach(c ${LLVM_TARGETS_TO_BUILD}) - set(TARGETS_BUILT "${TARGETS_BUILT} ${c}") -endforeach(c) -set(TARGETS_TO_BUILD ${TARGETS_BUILT}) -set(TARGET_HAS_JIT "1") # TODO - -# Avoids replacement at config-time: -set(LLVM_CPPFLAGS "@LLVM_CPPFLAGS@") -set(LLVM_CFLAGS "@LLVM_CFLAGS@") -set(LLVM_CXXFLAGS "@LLVM_CXXFLAGS@") -set(LLVM_LDFLAGS "@LLVM_LDFLAGS@") -set(LIBS "@LIBS@") -set(LLVM_BUILDMODE "@LLVM_BUILDMODE@") - -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/llvm-config.in.in - ${CMAKE_CURRENT_BINARY_DIR}/llvm-config.in - @ONLY -) - -set(LIBDEPS ${CMAKE_CURRENT_BINARY_DIR}/LibDeps.txt) -set(LIBDEPS_TMP ${CMAKE_CURRENT_BINARY_DIR}/LibDeps.txt.tmp) -set(FINAL_LIBDEPS ${CMAKE_CURRENT_BINARY_DIR}/FinalLibDeps.txt) -set(LLVM_CONFIG ${LLVM_TOOLS_BINARY_DIR}/llvm-config) -set(LLVM_CONFIG_IN ${CMAKE_CURRENT_BINARY_DIR}/llvm-config.in) - -if( CMAKE_CROSSCOMPILING ) - set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) -endif() - -find_program(NM_PATH nm PATH_SUFFIXES /bin) - -if( NOT NM_PATH ) - message(FATAL_ERROR "`nm' not found") -endif() - -add_custom_command(OUTPUT ${LIBDEPS_TMP} - COMMAND ${PERL_EXECUTABLE} ${LLVM_MAIN_SRC_DIR}/utils/GenLibDeps.pl -flat ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR} ${NM_PATH} > ${LIBDEPS_TMP} - DEPENDS ${llvm_libs} - COMMENT "Regenerating ${LIBDEPS_TMP}") - -add_custom_command(OUTPUT ${LIBDEPS} - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LIBDEPS_TMP} ${LIBDEPS} - DEPENDS ${LIBDEPS_TMP} - COMMENT "Updating ${LIBDEPS} if necessary...") - -add_custom_command(OUTPUT ${FINAL_LIBDEPS} - COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/find-cycles.pl < ${LIBDEPS} > ${FINAL_LIBDEPS} || ${CMAKE_COMMAND} -E remove -f ${FINAL_LIBDEPS} - DEPENDS ${LIBDEPS} - COMMENT "Checking for cyclic dependencies between LLVM libraries.") - -set(C_FLGS "${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}") -set(CXX_FLGS "${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}") -set(CPP_FLGS "${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}") - -add_custom_command(OUTPUT ${LLVM_CONFIG} - COMMAND echo 's!@LLVM_CPPFLAGS@!${CPP_FLGS}!' > temp.sed - COMMAND echo 's!@LLVM_CFLAGS@!${C_FLGS}!' >> temp.sed - COMMAND echo 's!@LLVM_CXXFLAGS@!${CXX_FLGS}!' >> temp.sed - # TODO: Use general flags for linking! not just for shared libs: - COMMAND echo 's!@LLVM_LDFLAGS@!${CMAKE_SHARED_LINKER_FLAGS}!' >> temp.sed - COMMAND echo 's!@LIBS@!${LLVM_SYSTEM_LIBS}!' >> temp.sed - COMMAND echo 's!@LLVM_BUILDMODE@!${CMAKE_BUILD_TYPE}!' >> temp.sed - COMMAND sed -f temp.sed < ${LLVM_CONFIG_IN} > ${LLVM_CONFIG} - COMMAND ${CMAKE_COMMAND} -E remove -f temp.sed - COMMAND cat ${FINAL_LIBDEPS} >> ${LLVM_CONFIG} - COMMAND chmod +x ${LLVM_CONFIG} - DEPENDS ${FINAL_LIBDEPS} ${LLVM_CONFIG_IN} - COMMENT "Building llvm-config script." - ) - -add_custom_target(llvm-config.target ALL - DEPENDS ${LLVM_CONFIG}) - -add_dependencies(llvm-config.target ${llvm_lib_targets}) - -# Make sure that llvm-config builds before the llvm tools, so we have -# LibDeps.txt and can use it for updating the hard-coded library -# dependencies on cmake/modules/LLVMLibDeps.cmake when the tools' -# build fail due to outdated dependencies: -set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} llvm-config.target) - -install(FILES ${LLVM_CONFIG} - PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE - DESTINATION bin) - - -# Regeneration of library dependencies. - -# See the comments at the end of cmake/modules/LLVMConfig.cmake for -# notes and guidelines. - -set(LLVMLibDeps ${LLVM_MAIN_SRC_DIR}/cmake/modules/LLVMLibDeps.cmake) -set(LLVMLibDeps_TMP ${CMAKE_CURRENT_BINARY_DIR}/LLVMLibDeps.cmake.tmp) - -add_custom_command(OUTPUT ${LLVMLibDeps_TMP} - COMMAND sed -e s'@\\.a@@g' -e s'@\\.so@@g' -e 's@libLLVM@LLVM@g' -e 's@: @ @' -e 's@\\\(.*\\\)@set\(MSVC_LIB_DEPS_\\1\)@' ${FINAL_LIBDEPS} > ${LLVMLibDeps_TMP} - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LLVMLibDeps_TMP} ${LLVMLibDeps} - DEPENDS ${FINAL_LIBDEPS} - COMMENT "Updating cmake library dependencies file ${LLVMLibDeps}" - ) - -if( LLVM_TARGETS_TO_BUILD STREQUAL LLVM_ALL_TARGETS ) - add_custom_target(llvmlibdeps.target ALL DEPENDS ${LLVMLibDeps_TMP}) - add_dependencies(llvmlibdeps.target llvm-config.target) - set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} llvmlibdeps.target) -endif() - -set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} PARENT_SCOPE) diff --git a/contrib/llvm/tools/llvm-config/Makefile b/contrib/llvm/tools/llvm-config/Makefile deleted file mode 100644 index c7f7b3234d64..000000000000 --- a/contrib/llvm/tools/llvm-config/Makefile +++ /dev/null @@ -1,131 +0,0 @@ -##===- tools/llvm-config/Makefile --------------------------*- Makefile -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## - -LEVEL = ../.. - -EXTRA_DIST = LibDeps.txt FinalLibDeps.txt llvm-config.in.in find-cycles.pl - -include $(LEVEL)/Makefile.common - -# If we don't have Perl, we can't generate the library dependencies upon which -# llvm-config depends. Therefore, only if we detect perl will we do anything -# useful. -ifeq ($(HAVE_PERL),1) - -# Combine preprocessor flags (except for -I) and CXX flags. -SUB_CPPFLAGS = ${CPP.BaseFlags} -SUB_CFLAGS = ${CPP.BaseFlags} ${C.Flags} -SUB_CXXFLAGS = ${CPP.BaseFlags} ${CXX.Flags} - -# This is blank for now. We need to be careful about adding stuff here: -# LDFLAGS tend not to be portable, and we don't currently require the -# user to use libtool when linking against LLVM. -SUB_LDFLAGS = - -FinalLibDeps = $(PROJ_OBJ_DIR)/FinalLibDeps.txt -LibDeps = $(PROJ_OBJ_DIR)/LibDeps.txt -LibDepsTemp = $(PROJ_OBJ_DIR)/LibDeps.txt.tmp -GenLibDeps = $(PROJ_SRC_ROOT)/utils/GenLibDeps.pl - -$(LibDepsTemp): $(GenLibDeps) $(LibDir) $(wildcard $(LibDir)/*.a $(LibDir)/*.o) - $(Echo) "Regenerating LibDeps.txt.tmp" - $(Verb) $(PERL) $(GenLibDeps) -flat $(LibDir) "$(NM_PATH)" > $(LibDepsTemp) - -$(LibDeps): $(LibDepsTemp) - $(Verb) $(CMP) -s $@ $< || ( $(CP) $< $@ && \ - $(EchoCmd) Updated LibDeps.txt because dependencies changed ) - -# Find all the cyclic dependencies between various LLVM libraries, so we -# don't have to process them at runtime. -$(FinalLibDeps): find-cycles.pl $(LibDeps) - $(Echo) "Checking for cyclic dependencies between LLVM libraries." - $(Verb) $(PERL) $< < $(LibDeps) > $@ || rm -f $@ - -# Rerun our configure substitutions as needed. -ConfigInIn = $(PROJ_SRC_DIR)/llvm-config.in.in -llvm-config.in: $(ConfigInIn) $(ConfigStatusScript) - $(Verb) cd $(PROJ_OBJ_ROOT) ; \ - $(ConfigStatusScript) tools/llvm-config/llvm-config.in - -llvm-config-perobj: llvm-config.in $(GenLibDeps) $(LibDir) $(wildcard $(LibDir)/*.a) - $(Echo) "Generating llvm-config-perobj" - $(Verb) $(PERL) $(GenLibDeps) -perobj -flat $(LibDir) "$(NM_PATH)" >PerobjDeps.txt - $(Echo) "Checking for cyclic dependencies between LLVM objects." - $(Verb) $(PERL) $(PROJ_SRC_DIR)/find-cycles.pl < PerobjDepsIncl.txt > PerobjDepsInclFinal.txt || rm -f $@ - $(Verb) $(ECHO) 's/@LLVM_CPPFLAGS@/$(subst /,\/,$(SUB_CPPFLAGS))/' \ - > temp.sed - $(Verb) $(ECHO) 's/@LLVM_CFLAGS@/$(subst /,\/,$(SUB_CFLAGS))/' \ - >> temp.sed - $(Verb) $(ECHO) 's/@LLVM_CXXFLAGS@/$(subst /,\/,$(SUB_CXXFLAGS))/' \ - >> temp.sed - $(Verb) $(ECHO) 's/@LLVM_LDFLAGS@/$(subst /,\/,$(SUB_LDFLAGS))/' \ - >> temp.sed - $(Verb) $(ECHO) 's/@LLVM_BUILDMODE@/$(subst /,\/,$(BuildMode))/' \ - >> temp.sed - $(Verb) $(SED) -f temp.sed < $< > $@ - $(Verb) $(RM) temp.sed - $(Verb) cat PerobjDepsFinal.txt >> $@ - $(Verb) chmod +x $@ - -llvm-config-perobjincl: llvm-config.in $(GenLibDeps) $(LibDir) $(wildcard $(LibDir)/*.a) - $(Echo) "Generating llvm-config-perobjincl" - $(Verb) $(PERL) $(GenLibDeps) -perobj -perobjincl -flat $(LibDir) "$(NM_PATH)" >PerobjDepsIncl.txt - $(Echo) "Checking for cyclic dependencies between LLVM objects." - $(Verb) $(PERL) $(PROJ_SRC_DIR)/find-cycles.pl < PerobjDepsIncl.txt > PerobjDepsInclFinal.txt - $(Verb) $(ECHO) 's/@LLVM_CPPFLAGS@/$(subst /,\/,$(SUB_CPPFLAGS))/' \ - > temp.sed - $(Verb) $(ECHO) 's/@LLVM_CFLAGS@/$(subst /,\/,$(SUB_CFLAGS))/' \ - >> temp.sed - $(Verb) $(ECHO) 's/@LLVM_CXXFLAGS@/$(subst /,\/,$(SUB_CXXFLAGS))/' \ - >> temp.sed - $(Verb) $(ECHO) 's/@LLVM_LDFLAGS@/$(subst /,\/,$(SUB_LDFLAGS))/' \ - >> temp.sed - $(Verb) $(ECHO) 's/@LLVM_BUILDMODE@/$(subst /,\/,$(BuildMode))/' \ - >> temp.sed - $(Verb) $(SED) -f temp.sed < $< > $@ - $(Verb) $(RM) temp.sed - $(Verb) cat PerobjDepsInclFinal.txt >> $@ - $(Verb) chmod +x $@ - -# Build our final script. -$(ToolDir)/llvm-config: llvm-config.in $(FinalLibDeps) - $(Echo) "Building llvm-config script." - $(Verb) $(ECHO) 's/@LLVM_CPPFLAGS@/$(subst /,\/,$(SUB_CPPFLAGS))/' \ - > temp.sed - $(Verb) $(ECHO) 's/@LLVM_CFLAGS@/$(subst /,\/,$(SUB_CFLAGS))/' \ - >> temp.sed - $(Verb) $(ECHO) 's/@LLVM_CXXFLAGS@/$(subst /,\/,$(SUB_CXXFLAGS))/' \ - >> temp.sed - $(Verb) $(ECHO) 's/@LLVM_LDFLAGS@/$(subst /,\/,$(SUB_LDFLAGS))/' \ - >> temp.sed - $(Verb) $(ECHO) 's/@LLVM_BUILDMODE@/$(subst /,\/,$(BuildMode))/' \ - >> temp.sed - $(Verb) $(SED) -f temp.sed < $< > $@ - $(Verb) $(RM) temp.sed - $(Verb) cat $(FinalLibDeps) >> $@ - $(Verb) chmod +x $@ - -else -# We don't have perl, just generate a dummy llvm-config -$(ToolDir)/llvm-config: - $(Echo) "Building place holder llvm-config script." - $(Verb) $(ECHO) 'echo llvm-config: Perl not found so llvm-config could not be generated' >> $@ - $(Verb) chmod +x $@ - -endif -# Hook into the standard Makefile rules. -all-local:: $(ToolDir)/llvm-config -clean-local:: - $(Verb) $(RM) -f $(ToolDir)/llvm-config llvm-config.in $(FinalLibDeps) \ - $(LibDeps) GenLibDeps.out -install-local:: all-local - $(Echo) Installing llvm-config - $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_bindir) - $(Verb) $(ScriptInstall) $(ToolDir)/llvm-config $(DESTDIR)$(PROJ_bindir) - diff --git a/contrib/llvm/tools/llvm-config/find-cycles.pl b/contrib/llvm/tools/llvm-config/find-cycles.pl deleted file mode 100755 index 5cbf5b4b2776..000000000000 --- a/contrib/llvm/tools/llvm-config/find-cycles.pl +++ /dev/null @@ -1,170 +0,0 @@ -#!/usr/bin/perl -# -# Program: find-cycles.pl -# -# Synopsis: Given a list of possibly cyclic dependencies, merge all the -# cycles. This makes it possible to topologically sort the -# dependencies between different parts of LLVM. -# -# Syntax: find-cycles.pl < LibDeps.txt > FinalLibDeps.txt -# -# Input: cycmem1: cycmem2 dep1 dep2 -# cycmem2: cycmem1 dep3 dep4 -# boring: dep4 -# -# Output: cycmem1 cycmem2: dep1 dep2 dep3 dep4 -# boring: dep4 -# -# This file was written by Eric Kidd, and is placed into the public domain. -# - -use 5.006; -use strict; -use warnings; - -my %DEPS; -my @CYCLES; -sub find_all_cycles; - -# Read our dependency information. -while (<>) { - chomp; - my ($module, $dependency_str) = /^\s*([^:]+):\s*(.*)\s*$/; - die "Malformed data: $_" unless defined $dependency_str; - my @dependencies = split(/ /, $dependency_str); - $DEPS{$module} = \@dependencies; -} - -# Partition our raw dependencies into sets of cyclically-connected nodes. -find_all_cycles(); - -# Print out the finished cycles, with their dependencies. -my @output; -my $cycles_found = 0; -foreach my $cycle (@CYCLES) { - my @modules = sort keys %{$cycle}; - - # Merge the dependencies of all modules in this cycle. - my %dependencies; - foreach my $module (@modules) { - @dependencies{@{$DEPS{$module}}} = 1; - } - - # Prune the known cyclic dependencies. - foreach my $module (@modules) { - delete $dependencies{$module}; - } - - # Warn about possible linker problems. - my @archives = grep(/\.a$/, @modules); - if (@archives > 1) { - $cycles_found = $cycles_found + 1; - print STDERR "find-cycles.pl: Circular dependency between *.a files:\n"; - print STDERR "find-cycles.pl: ", join(' ', @archives), "\n"; - push @modules, @archives; # WORKAROUND: Duplicate *.a files. Ick. - } elsif (@modules > 1) { - $cycles_found = $cycles_found + 1; - print STDERR "find-cycles.pl: Circular dependency between *.o files:\n"; - print STDERR "find-cycles.pl: ", join(' ', @modules), "\n"; - push @modules, @modules; # WORKAROUND: Duplicate *.o files. Ick. - } - - # Add to our output. (@modules is already as sorted as we need it to be.) - push @output, (join(' ', @modules) . ': ' . - join(' ', sort keys %dependencies) . "\n"); -} -print sort @output; - -exit $cycles_found; - -#========================================================================== -# Depedency Cycle Support -#========================================================================== -# For now, we have cycles in our dependency graph. Ideally, each cycle -# would be collapsed down to a single *.a file, saving us all this work. -# -# To understand this code, you'll need a working knowledge of Perl 5, -# and possibly some quality time with 'man perlref'. - -my %SEEN; -my %CYCLES; -sub find_cycles ($@); -sub found_cycles ($@); - -sub find_all_cycles { - # Find all multi-item cycles. - my @modules = sort keys %DEPS; - foreach my $module (@modules) { find_cycles($module); } - - # Build fake one-item "cycles" for the remaining modules, so we can - # treat them uniformly. - foreach my $module (@modules) { - unless (defined $CYCLES{$module}) { - my %cycle = ($module, 1); - $CYCLES{$module} = \%cycle; - } - } - - # Find all our unique cycles. We have to do this the hard way because - # we apparently can't store hash references as hash keys without making - # 'strict refs' sad. - my %seen; - foreach my $cycle (values %CYCLES) { - unless ($seen{$cycle}) { - $seen{$cycle} = 1; - push @CYCLES, $cycle; - } - } -} - -# Walk through our graph depth-first (keeping a trail in @path), and report -# any cycles we find. -sub find_cycles ($@) { - my ($module, @path) = @_; - if (str_in_list($module, @path)) { - found_cycle($module, @path); - } else { - return if defined $SEEN{$module}; - $SEEN{$module} = 1; - foreach my $dep (@{$DEPS{$module}}) { - find_cycles($dep, @path, $module); - } - } -} - -# Give a cycle, attempt to merge it with pre-existing cycle data. -sub found_cycle ($@) { - my ($module, @path) = @_; - - # Pop any modules which aren't part of our cycle. - while ($path[0] ne $module) { shift @path; } - #print join("->", @path, $module) . "\n"; - - # Collect the modules in our cycle into a hash. - my %cycle; - foreach my $item (@path) { - $cycle{$item} = 1; - if (defined $CYCLES{$item}) { - # Looks like we intersect with an existing cycle, so merge - # all those in, too. - foreach my $old_item (keys %{$CYCLES{$item}}) { - $cycle{$old_item} = 1; - } - } - } - - # Update our global cycle table. - my $cycle_ref = \%cycle; - foreach my $item (keys %cycle) { - $CYCLES{$item} = $cycle_ref; - } - #print join(":", sort keys %cycle) . "\n"; -} - -sub str_in_list ($@) { - my ($str, @list) = @_; - foreach my $item (@list) { - return 1 if ($item eq $str); - } - return 0; -} diff --git a/contrib/llvm/tools/llvm-config/llvm-config.in.in b/contrib/llvm/tools/llvm-config/llvm-config.in.in deleted file mode 100644 index d435d57adf37..000000000000 --- a/contrib/llvm/tools/llvm-config/llvm-config.in.in +++ /dev/null @@ -1,460 +0,0 @@ -#!@PERL@ -##===- tools/llvm-config ---------------------------------------*- perl -*-===## -# -# The LLVM Compiler Infrastructure -# -# This file is distributed under the University of Illinois Open Source -# License. See LICENSE.TXT for details. -# -##===----------------------------------------------------------------------===## -# -# Synopsis: Prints out compiler options needed to build against an installed -# copy of LLVM. -# -# Syntax: llvm-config OPTIONS... [COMPONENTS...] -# -##===----------------------------------------------------------------------===## - -use 5.006; -use strict; -use warnings; -use Cwd 'abs_path'; - -#---- begin autoconf values ---- -my $PACKAGE_NAME = q{@PACKAGE_NAME@}; -my $VERSION = q{@PACKAGE_VERSION@}; -my $PREFIX = q{@LLVM_PREFIX@}; -my $LLVM_CONFIGTIME = q{@LLVM_CONFIGTIME@}; -my $LLVM_SRC_ROOT = q{@abs_top_srcdir@}; -my $LLVM_OBJ_ROOT = q{@abs_top_builddir@}; -my $ARCH = lc(q{@ARCH@}); -my $TARGET_TRIPLE = q{@target@}; -my $TARGETS_TO_BUILD = q{@TARGETS_TO_BUILD@}; -my $TARGET_HAS_JIT = q{@TARGET_HAS_JIT@}; -my @TARGETS_BUILT = map { lc($_) } qw{@TARGETS_TO_BUILD@}; -#---- end autoconf values ---- - -# Must pretend x86_64 architecture is really x86, otherwise the native backend -# won't get linked in. -$ARCH = "x86" if $ARCH eq "x86_64"; - -#---- begin Makefile values ---- -my $CPPFLAGS = q{@LLVM_CPPFLAGS@}; -my $CFLAGS = q{@LLVM_CFLAGS@}; -my $CXXFLAGS = q{@LLVM_CXXFLAGS@}; -my $LDFLAGS = q{@LLVM_LDFLAGS@}; -my $SYSTEM_LIBS = q{@LIBS@}; -my $LLVM_BUILDMODE = q{@LLVM_BUILDMODE@}; -#---- end Makefile values ---- - -# Figure out where llvm-config is being run from. Primarily, we care if it has -# been installed, or is running from the build directory, which changes the -# locations of some files. - -# Convert the current executable name into its directory (e.g. "."). -my ($RUN_DIR) = ($0 =~ /^(.*)\/.*$/); - -# Turn the directory into an absolute directory on the file system, also pop up -# from "bin" into the build or prefix dir. -my $ABS_RUN_DIR = abs_path("$RUN_DIR/.."); -chomp($ABS_RUN_DIR); - -# Compute the absolute object directory build, e.g. "foo/llvm/Debug". -my $ABS_OBJ_ROOT = "$LLVM_OBJ_ROOT/$LLVM_BUILDMODE"; -$ABS_OBJ_ROOT = abs_path("$ABS_OBJ_ROOT") if (-d $ABS_OBJ_ROOT); -chomp($ABS_OBJ_ROOT); - -my $INCLUDEDIR = "$ABS_RUN_DIR/include"; -my $INCLUDEOPTION = "-I$INCLUDEDIR"; -my $LIBDIR = "$ABS_RUN_DIR/lib"; -my $BINDIR = "$ABS_RUN_DIR/bin"; -if ($ABS_RUN_DIR eq $ABS_OBJ_ROOT) { - # If we are running out of the build directory, the include dir is in the - # srcdir. - $INCLUDEDIR = "$LLVM_SRC_ROOT/include"; - # We need include files from both the srcdir and objdir. - $INCLUDEOPTION = "-I$INCLUDEDIR -I$LLVM_OBJ_ROOT/include" -} else { - # If installed, ignore the prefix the tree was configured with, use the - # current prefix. - $PREFIX = $ABS_RUN_DIR; -} - -sub usage; -sub fix_library_names (@); -sub fix_library_files (@); -sub expand_dependencies (@); -sub name_map_entries; - -# Parse our command-line arguments. -usage if @ARGV == 0; -my @components; -my $has_opt = 0; -my $want_libs = 0; -my $want_libnames = 0; -my $want_libfiles = 0; -my $want_components = 0; -foreach my $arg (@ARGV) { - if ($arg =~ /^-/) { - if ($arg eq "--version") { - $has_opt = 1; print "$VERSION\n"; - } elsif ($arg eq "--prefix") { - $has_opt = 1; print "$PREFIX\n"; - } elsif ($arg eq "--bindir") { - $has_opt = 1; print "$BINDIR\n"; - } elsif ($arg eq "--includedir") { - $has_opt = 1; print "$INCLUDEDIR\n"; - } elsif ($arg eq "--libdir") { - $has_opt = 1; print "$LIBDIR\n"; - } elsif ($arg eq "--cppflags") { - $has_opt = 1; print "$INCLUDEOPTION $CPPFLAGS\n"; - } elsif ($arg eq "--cflags") { - $has_opt = 1; print "$INCLUDEOPTION $CFLAGS\n"; - } elsif ($arg eq "--cxxflags") { - $has_opt = 1; print "$INCLUDEOPTION $CXXFLAGS\n"; - } elsif ($arg eq "--ldflags") { - $has_opt = 1; print "-L$LIBDIR $LDFLAGS $SYSTEM_LIBS\n"; - } elsif ($arg eq "--libs") { - $has_opt = 1; $want_libs = 1; - } elsif ($arg eq "--libnames") { - $has_opt = 1; $want_libnames = 1; - } elsif ($arg eq "--libfiles") { - $has_opt = 1; $want_libfiles = 1; - } elsif ($arg eq "--components") { - $has_opt = 1; print join(' ', name_map_entries), "\n"; - } elsif ($arg eq "--targets-built") { - $has_opt = 1; print join(' ', @TARGETS_BUILT), "\n"; - } elsif ($arg eq "--host-target") { - $has_opt = 1; print "$TARGET_TRIPLE\n"; - } elsif ($arg eq "--build-mode") { - $has_opt = 1; print "$LLVM_BUILDMODE\n"; - } elsif ($arg eq "--obj-root") { - $has_opt = 1; print abs_path("$LLVM_OBJ_ROOT/"); - } elsif ($arg eq "--src-root") { - $has_opt = 1; print abs_path("$LLVM_SRC_ROOT/"); - } else { - usage(); - } - } else { - push @components, $arg; - } -} - -# If no options were specified, fail. -usage unless $has_opt; - -# If no components were specified, default to 'all'. -if (@components == 0) { - push @components, 'all'; -} - -# Force component names to lower case. -@components = map lc, @components; - -# Handle any arguments which require building our dependency graph. -if ($want_libs || $want_libnames || $want_libfiles) { - my @libs = expand_dependencies(@components); - print join(' ', fix_library_names(@libs)), "\n" if ($want_libs); - print join(' ', @libs), "\n" if ($want_libnames); - print join(' ', fix_library_files(@libs)), "\n" if ($want_libfiles); -} - -exit 0; - -#========================================================================== -# Support Routines -#========================================================================== - -sub usage { - print STDERR <<__EOD__; -Usage: llvm-config