summaryrefslogtreecommitdiffstats
path: root/contrib/llvm
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2010-10-11 17:22:16 +0000
committerdim <dim@FreeBSD.org>2010-10-11 17:22:16 +0000
commit1fc65a65fe54635d0e564559ba5a7b8a8a42d4d6 (patch)
treede75a464c5dac7eceb2dbbad8b4d4e1479d79e08 /contrib/llvm
parentf4f7191cd223adebacee3fad260ed60935be9cb9 (diff)
downloadFreeBSD-src-1fc65a65fe54635d0e564559ba5a7b8a8a42d4d6.zip
FreeBSD-src-1fc65a65fe54635d0e564559ba5a7b8a8a42d4d6.tar.gz
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)
Diffstat (limited to 'contrib/llvm')
-rw-r--r--contrib/llvm/CMakeLists.txt387
-rw-r--r--contrib/llvm/CREDITS.TXT360
-rw-r--r--contrib/llvm/LICENSE.TXT69
-rw-r--r--contrib/llvm/Makefile241
-rw-r--r--contrib/llvm/Makefile.common70
-rw-r--r--contrib/llvm/Makefile.config.in346
-rw-r--r--contrib/llvm/Makefile.rules2209
-rw-r--r--contrib/llvm/ModuleInfo.txt4
-rw-r--r--contrib/llvm/README.txt16
-rwxr-xr-xcontrib/llvm/autoconf/AutoRegen.sh58
-rw-r--r--contrib/llvm/autoconf/ExportMap.map7
-rw-r--r--contrib/llvm/autoconf/LICENSE.TXT24
-rw-r--r--contrib/llvm/autoconf/README.TXT49
-rwxr-xr-xcontrib/llvm/autoconf/config.guess1498
-rwxr-xr-xcontrib/llvm/autoconf/config.sub1702
-rw-r--r--contrib/llvm/autoconf/configure.ac1582
-rwxr-xr-xcontrib/llvm/autoconf/depcomp522
-rwxr-xr-xcontrib/llvm/autoconf/install-sh322
-rw-r--r--contrib/llvm/autoconf/ltmain.sh6863
-rw-r--r--contrib/llvm/autoconf/m4/build_exeext.m442
-rw-r--r--contrib/llvm/autoconf/m4/c_printf_a.m431
-rw-r--r--contrib/llvm/autoconf/m4/check_gnu_make.m426
-rw-r--r--contrib/llvm/autoconf/m4/config_makefile.m49
-rw-r--r--contrib/llvm/autoconf/m4/config_project.m414
-rw-r--r--contrib/llvm/autoconf/m4/cxx_flag_check.m42
-rw-r--r--contrib/llvm/autoconf/m4/find_std_program.m4118
-rw-r--r--contrib/llvm/autoconf/m4/func_isinf.m436
-rw-r--r--contrib/llvm/autoconf/m4/func_isnan.m427
-rw-r--r--contrib/llvm/autoconf/m4/func_mmap_file.m426
-rw-r--r--contrib/llvm/autoconf/m4/header_mmap_anonymous.m421
-rw-r--r--contrib/llvm/autoconf/m4/huge_val.m420
-rw-r--r--contrib/llvm/autoconf/m4/libtool.m46389
-rw-r--r--contrib/llvm/autoconf/m4/link_options.m4108
-rw-r--r--contrib/llvm/autoconf/m4/linux_mixed_64_32.m417
-rw-r--r--contrib/llvm/autoconf/m4/ltdl.m4418
-rw-r--r--contrib/llvm/autoconf/m4/need_dev_zero_for_mmap.m417
-rw-r--r--contrib/llvm/autoconf/m4/path_perl.m416
-rw-r--r--contrib/llvm/autoconf/m4/path_tclsh.m439
-rw-r--r--contrib/llvm/autoconf/m4/rand48.m412
-rw-r--r--contrib/llvm/autoconf/m4/sanity_check.m431
-rw-r--r--contrib/llvm/autoconf/m4/single_cxx_check.m410
-rw-r--r--contrib/llvm/autoconf/m4/visibility_inlines_hidden.m422
-rwxr-xr-xcontrib/llvm/autoconf/missing353
-rwxr-xr-xcontrib/llvm/autoconf/mkinstalldirs150
-rw-r--r--contrib/llvm/bindings/Makefile16
-rw-r--r--contrib/llvm/bindings/README.txt3
-rw-r--r--contrib/llvm/bindings/ada/analysis/llvm_analysis-binding.ads32
-rw-r--r--contrib/llvm/bindings/ada/analysis/llvm_analysis.ads30
-rw-r--r--contrib/llvm/bindings/ada/analysis/llvm_analysis_wrap.cxx369
-rw-r--r--contrib/llvm/bindings/ada/bitreader/llvm_bit_reader-binding.ads52
-rw-r--r--contrib/llvm/bindings/ada/bitreader/llvm_bit_reader.ads6
-rw-r--r--contrib/llvm/bindings/ada/bitreader/llvm_bitreader_wrap.cxx423
-rw-r--r--contrib/llvm/bindings/ada/bitwriter/llvm_bit_writer-binding.ads28
-rw-r--r--contrib/llvm/bindings/ada/bitwriter/llvm_bit_writer.ads6
-rw-r--r--contrib/llvm/bindings/ada/bitwriter/llvm_bitwriter_wrap.cxx335
-rw-r--r--contrib/llvm/bindings/ada/executionengine/llvm_execution_engine-binding.ads192
-rw-r--r--contrib/llvm/bindings/ada/executionengine/llvm_execution_engine.ads90
-rw-r--r--contrib/llvm/bindings/ada/executionengine/llvm_executionengine_wrap.cxx924
-rw-r--r--contrib/llvm/bindings/ada/llvm.gpr34
-rw-r--r--contrib/llvm/bindings/ada/llvm/llvm-binding.ads1974
-rw-r--r--contrib/llvm/bindings/ada/llvm/llvm.ads497
-rw-r--r--contrib/llvm/bindings/ada/llvm/llvm_link_time_optimizer-binding.ads207
-rw-r--r--contrib/llvm/bindings/ada/llvm/llvm_link_time_optimizer.ads184
-rw-r--r--contrib/llvm/bindings/ada/llvm/llvm_linktimeoptimizer_wrap.cxx923
-rw-r--r--contrib/llvm/bindings/ada/llvm/llvm_wrap.cxx8817
-rw-r--r--contrib/llvm/bindings/ada/target/llvm_target-binding.ads138
-rw-r--r--contrib/llvm/bindings/ada/target/llvm_target.ads72
-rw-r--r--contrib/llvm/bindings/ada/target/llvm_target_wrap.cxx720
-rw-r--r--contrib/llvm/bindings/ada/transforms/llvm_transforms-binding.ads206
-rw-r--r--contrib/llvm/bindings/ada/transforms/llvm_transforms.ads6
-rw-r--r--contrib/llvm/bindings/ada/transforms/llvm_transforms_wrap.cxx828
-rw-r--r--contrib/llvm/bindings/ocaml/Makefile19
-rw-r--r--contrib/llvm/bindings/ocaml/Makefile.ocaml410
-rw-r--r--contrib/llvm/bindings/ocaml/analysis/Makefile19
-rw-r--r--contrib/llvm/bindings/ocaml/analysis/analysis_ocaml.c72
-rw-r--r--contrib/llvm/bindings/ocaml/analysis/llvm_analysis.ml22
-rw-r--r--contrib/llvm/bindings/ocaml/analysis/llvm_analysis.mli46
-rw-r--r--contrib/llvm/bindings/ocaml/bitreader/Makefile19
-rw-r--r--contrib/llvm/bindings/ocaml/bitreader/bitreader_ocaml.c73
-rw-r--r--contrib/llvm/bindings/ocaml/bitreader/llvm_bitreader.ml20
-rw-r--r--contrib/llvm/bindings/ocaml/bitreader/llvm_bitreader.mli29
-rw-r--r--contrib/llvm/bindings/ocaml/bitwriter/Makefile19
-rw-r--r--contrib/llvm/bindings/ocaml/bitwriter/bitwriter_ocaml.c45
-rw-r--r--contrib/llvm/bindings/ocaml/bitwriter/llvm_bitwriter.ml25
-rw-r--r--contrib/llvm/bindings/ocaml/bitwriter/llvm_bitwriter.mli30
-rw-r--r--contrib/llvm/bindings/ocaml/executionengine/Makefile19
-rw-r--r--contrib/llvm/bindings/ocaml/executionengine/executionengine_ocaml.c323
-rw-r--r--contrib/llvm/bindings/ocaml/executionengine/llvm_executionengine.ml112
-rw-r--r--contrib/llvm/bindings/ocaml/executionengine/llvm_executionengine.mli163
-rw-r--r--contrib/llvm/bindings/ocaml/llvm/Makefile19
-rw-r--r--contrib/llvm/bindings/ocaml/llvm/llvm.ml1064
-rw-r--r--contrib/llvm/bindings/ocaml/llvm/llvm.mli2259
-rw-r--r--contrib/llvm/bindings/ocaml/llvm/llvm_ocaml.c1824
-rw-r--r--contrib/llvm/bindings/ocaml/target/Makefile19
-rw-r--r--contrib/llvm/bindings/ocaml/target/llvm_target.ml44
-rw-r--r--contrib/llvm/bindings/ocaml/target/llvm_target.mli102
-rw-r--r--contrib/llvm/bindings/ocaml/target/target_ocaml.c109
-rw-r--r--contrib/llvm/bindings/ocaml/transforms/Makefile18
-rw-r--r--contrib/llvm/bindings/ocaml/transforms/scalar/Makefile20
-rw-r--r--contrib/llvm/bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml75
-rw-r--r--contrib/llvm/bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli123
-rw-r--r--contrib/llvm/bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c152
-rwxr-xr-xcontrib/llvm/build-for-llvm-top.sh68
-rwxr-xr-xcontrib/llvm/configure22169
-rw-r--r--contrib/llvm/include/llvm/CMakeLists.txt19
-rw-r--r--contrib/llvm/include/llvm/Config/AsmParsers.def.in29
-rw-r--r--contrib/llvm/include/llvm/Config/AsmPrinters.def.in29
-rw-r--r--contrib/llvm/include/llvm/Config/Disassemblers.def.in29
-rw-r--r--contrib/llvm/include/llvm/Config/Targets.def.in28
-rw-r--r--contrib/llvm/include/llvm/Config/config.h.cmake641
-rw-r--r--contrib/llvm/include/llvm/Config/config.h.in617
-rw-r--r--contrib/llvm/include/llvm/Config/llvm-config.h.cmake97
-rw-r--r--contrib/llvm/include/llvm/Config/llvm-config.h.in97
-rw-r--r--contrib/llvm/include/llvm/System/DataTypes.h.cmake189
-rw-r--r--contrib/llvm/include/llvm/System/DataTypes.h.in111
-rw-r--r--contrib/llvm/include/llvm/System/LICENSE.TXT6
-rw-r--r--contrib/llvm/lib/Analysis/CMakeLists.txt53
-rw-r--r--contrib/llvm/lib/Analysis/IPA/CMakeLists.txt6
-rw-r--r--contrib/llvm/lib/Analysis/IPA/Makefile15
-rw-r--r--contrib/llvm/lib/Analysis/Makefile16
-rw-r--r--contrib/llvm/lib/Analysis/README.txt30
-rw-r--r--contrib/llvm/lib/Archive/CMakeLists.txt5
-rw-r--r--contrib/llvm/lib/Archive/Makefile17
-rw-r--r--contrib/llvm/lib/AsmParser/CMakeLists.txt6
-rw-r--r--contrib/llvm/lib/AsmParser/Makefile14
-rw-r--r--contrib/llvm/lib/Bitcode/Makefile14
-rw-r--r--contrib/llvm/lib/Bitcode/Reader/CMakeLists.txt4
-rw-r--r--contrib/llvm/lib/Bitcode/Reader/Makefile15
-rw-r--r--contrib/llvm/lib/Bitcode/Writer/CMakeLists.txt6
-rw-r--r--contrib/llvm/lib/Bitcode/Writer/Makefile15
-rw-r--r--contrib/llvm/lib/CodeGen/AsmPrinter/CMakeLists.txt11
-rw-r--r--contrib/llvm/lib/CodeGen/AsmPrinter/Makefile13
-rw-r--r--contrib/llvm/lib/CodeGen/CMakeLists.txt86
-rw-r--r--contrib/llvm/lib/CodeGen/Makefile22
-rw-r--r--contrib/llvm/lib/CodeGen/README.txt199
-rw-r--r--contrib/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt25
-rw-r--r--contrib/llvm/lib/CodeGen/SelectionDAG/Makefile13
-rw-r--r--contrib/llvm/lib/CompilerDriver/CMakeLists.txt10
-rw-r--r--contrib/llvm/lib/CompilerDriver/Makefile20
-rw-r--r--contrib/llvm/lib/ExecutionEngine/CMakeLists.txt4
-rw-r--r--contrib/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt5
-rw-r--r--contrib/llvm/lib/ExecutionEngine/Interpreter/Makefile13
-rw-r--r--contrib/llvm/lib/ExecutionEngine/JIT/CMakeLists.txt13
-rw-r--r--contrib/llvm/lib/ExecutionEngine/JIT/Makefile38
-rw-r--r--contrib/llvm/lib/ExecutionEngine/Makefile13
-rw-r--r--contrib/llvm/lib/Linker/CMakeLists.txt6
-rw-r--r--contrib/llvm/lib/Linker/Makefile15
-rw-r--r--contrib/llvm/lib/MC/CMakeLists.txt33
-rw-r--r--contrib/llvm/lib/MC/MCDisassembler/CMakeLists.txt7
-rw-r--r--contrib/llvm/lib/MC/MCDisassembler/Makefile14
-rw-r--r--contrib/llvm/lib/MC/MCParser/CMakeLists.txt10
-rw-r--r--contrib/llvm/lib/MC/MCParser/Makefile15
-rw-r--r--contrib/llvm/lib/MC/Makefile16
-rw-r--r--contrib/llvm/lib/Makefile17
-rw-r--r--contrib/llvm/lib/Support/CMakeLists.txt49
-rw-r--r--contrib/llvm/lib/Support/COPYRIGHT.regex54
-rw-r--r--contrib/llvm/lib/Support/Makefile17
-rw-r--r--contrib/llvm/lib/System/CMakeLists.txt48
-rw-r--r--contrib/llvm/lib/System/Makefile25
-rw-r--r--contrib/llvm/lib/System/README.txt43
-rw-r--r--contrib/llvm/lib/System/Unix/README.txt16
-rw-r--r--contrib/llvm/lib/Target/ARM/AsmParser/CMakeLists.txt7
-rw-r--r--contrib/llvm/lib/Target/ARM/AsmParser/Makefile15
-rw-r--r--contrib/llvm/lib/Target/ARM/AsmPrinter/CMakeLists.txt6
-rw-r--r--contrib/llvm/lib/Target/ARM/AsmPrinter/Makefile15
-rw-r--r--contrib/llvm/lib/Target/ARM/CMakeLists.txt50
-rw-r--r--contrib/llvm/lib/Target/ARM/Disassembler/Makefile16
-rw-r--r--contrib/llvm/lib/Target/ARM/Makefile25
-rw-r--r--contrib/llvm/lib/Target/ARM/README-Thumb.txt248
-rw-r--r--contrib/llvm/lib/Target/ARM/README-Thumb2.txt6
-rw-r--r--contrib/llvm/lib/Target/ARM/README.txt659
-rw-r--r--contrib/llvm/lib/Target/ARM/TargetInfo/CMakeLists.txt7
-rw-r--r--contrib/llvm/lib/Target/ARM/TargetInfo/Makefile15
-rw-r--r--contrib/llvm/lib/Target/Alpha/AsmPrinter/CMakeLists.txt6
-rw-r--r--contrib/llvm/lib/Target/Alpha/AsmPrinter/Makefile15
-rw-r--r--contrib/llvm/lib/Target/Alpha/CMakeLists.txt29
-rw-r--r--contrib/llvm/lib/Target/Alpha/Makefile23
-rw-r--r--contrib/llvm/lib/Target/Alpha/README.txt42
-rw-r--r--contrib/llvm/lib/Target/Alpha/TargetInfo/CMakeLists.txt7
-rw-r--r--contrib/llvm/lib/Target/Alpha/TargetInfo/Makefile15
-rw-r--r--contrib/llvm/lib/Target/Blackfin/AsmPrinter/CMakeLists.txt6
-rw-r--r--contrib/llvm/lib/Target/Blackfin/AsmPrinter/Makefile16
-rw-r--r--contrib/llvm/lib/Target/Blackfin/CMakeLists.txt24
-rw-r--r--contrib/llvm/lib/Target/Blackfin/Makefile24
-rw-r--r--contrib/llvm/lib/Target/Blackfin/README.txt244
-rw-r--r--contrib/llvm/lib/Target/Blackfin/TargetInfo/CMakeLists.txt7
-rw-r--r--contrib/llvm/lib/Target/Blackfin/TargetInfo/Makefile15
-rw-r--r--contrib/llvm/lib/Target/CBackend/CMakeLists.txt3
-rw-r--r--contrib/llvm/lib/Target/CBackend/Makefile16
-rw-r--r--contrib/llvm/lib/Target/CBackend/TargetInfo/CMakeLists.txt6
-rw-r--r--contrib/llvm/lib/Target/CBackend/TargetInfo/Makefile15
-rw-r--r--contrib/llvm/lib/Target/CMakeLists.txt15
-rw-r--r--contrib/llvm/lib/Target/CellSPU/AsmPrinter/CMakeLists.txt9
-rw-r--r--contrib/llvm/lib/Target/CellSPU/AsmPrinter/Makefile17
-rw-r--r--contrib/llvm/lib/Target/CellSPU/CMakeLists.txt27
-rw-r--r--contrib/llvm/lib/Target/CellSPU/Makefile21
-rw-r--r--contrib/llvm/lib/Target/CellSPU/README.txt92
-rw-r--r--contrib/llvm/lib/Target/CellSPU/TargetInfo/CMakeLists.txt7
-rw-r--r--contrib/llvm/lib/Target/CellSPU/TargetInfo/Makefile15
-rw-r--r--contrib/llvm/lib/Target/CppBackend/CMakeLists.txt3
-rw-r--r--contrib/llvm/lib/Target/CppBackend/Makefile16
-rw-r--r--contrib/llvm/lib/Target/CppBackend/TargetInfo/CMakeLists.txt6
-rw-r--r--contrib/llvm/lib/Target/CppBackend/TargetInfo/Makefile15
-rw-r--r--contrib/llvm/lib/Target/MBlaze/AsmPrinter/CMakeLists.txt9
-rw-r--r--contrib/llvm/lib/Target/MBlaze/AsmPrinter/Makefile17
-rw-r--r--contrib/llvm/lib/Target/MBlaze/CMakeLists.txt28
-rw-r--r--contrib/llvm/lib/Target/MBlaze/Makefile23
-rw-r--r--contrib/llvm/lib/Target/MBlaze/TargetInfo/CMakeLists.txt7
-rw-r--r--contrib/llvm/lib/Target/MBlaze/TargetInfo/Makefile15
-rw-r--r--contrib/llvm/lib/Target/MSP430/AsmPrinter/CMakeLists.txt8
-rw-r--r--contrib/llvm/lib/Target/MSP430/AsmPrinter/Makefile15
-rw-r--r--contrib/llvm/lib/Target/MSP430/CMakeLists.txt25
-rw-r--r--contrib/llvm/lib/Target/MSP430/Makefile24
-rw-r--r--contrib/llvm/lib/Target/MSP430/README.txt40
-rw-r--r--contrib/llvm/lib/Target/MSP430/TargetInfo/CMakeLists.txt7
-rw-r--r--contrib/llvm/lib/Target/MSP430/TargetInfo/Makefile15
-rw-r--r--contrib/llvm/lib/Target/Makefile20
-rw-r--r--contrib/llvm/lib/Target/Mips/AsmPrinter/CMakeLists.txt9
-rw-r--r--contrib/llvm/lib/Target/Mips/AsmPrinter/Makefile17
-rw-r--r--contrib/llvm/lib/Target/Mips/CMakeLists.txt26
-rw-r--r--contrib/llvm/lib/Target/Mips/Makefile24
-rw-r--r--contrib/llvm/lib/Target/Mips/TargetInfo/CMakeLists.txt7
-rw-r--r--contrib/llvm/lib/Target/Mips/TargetInfo/Makefile15
-rw-r--r--contrib/llvm/lib/Target/PIC16/AsmPrinter/CMakeLists.txt9
-rw-r--r--contrib/llvm/lib/Target/PIC16/AsmPrinter/Makefile15
-rw-r--r--contrib/llvm/lib/Target/PIC16/CMakeLists.txt26
-rw-r--r--contrib/llvm/lib/Target/PIC16/Makefile24
-rw-r--r--contrib/llvm/lib/Target/PIC16/PIC16Passes/Makefile15
-rw-r--r--contrib/llvm/lib/Target/PIC16/TargetInfo/CMakeLists.txt7
-rw-r--r--contrib/llvm/lib/Target/PIC16/TargetInfo/Makefile15
-rw-r--r--contrib/llvm/lib/Target/PowerPC/AsmPrinter/CMakeLists.txt6
-rw-r--r--contrib/llvm/lib/Target/PowerPC/AsmPrinter/Makefile15
-rw-r--r--contrib/llvm/lib/Target/PowerPC/CMakeLists.txt30
-rw-r--r--contrib/llvm/lib/Target/PowerPC/Makefile23
-rw-r--r--contrib/llvm/lib/Target/PowerPC/README.txt914
-rw-r--r--contrib/llvm/lib/Target/PowerPC/README_ALTIVEC.txt211
-rw-r--r--contrib/llvm/lib/Target/PowerPC/TargetInfo/CMakeLists.txt7
-rw-r--r--contrib/llvm/lib/Target/PowerPC/TargetInfo/Makefile15
-rw-r--r--contrib/llvm/lib/Target/README.txt1939
-rw-r--r--contrib/llvm/lib/Target/Sparc/AsmPrinter/CMakeLists.txt6
-rw-r--r--contrib/llvm/lib/Target/Sparc/AsmPrinter/Makefile15
-rw-r--r--contrib/llvm/lib/Target/Sparc/CMakeLists.txt26
-rw-r--r--contrib/llvm/lib/Target/Sparc/Makefile23
-rw-r--r--contrib/llvm/lib/Target/Sparc/README.txt59
-rw-r--r--contrib/llvm/lib/Target/Sparc/TargetInfo/CMakeLists.txt7
-rw-r--r--contrib/llvm/lib/Target/Sparc/TargetInfo/Makefile15
-rw-r--r--contrib/llvm/lib/Target/SystemZ/AsmPrinter/CMakeLists.txt6
-rw-r--r--contrib/llvm/lib/Target/SystemZ/AsmPrinter/Makefile15
-rw-r--r--contrib/llvm/lib/Target/SystemZ/CMakeLists.txt24
-rw-r--r--contrib/llvm/lib/Target/SystemZ/Makefile23
-rw-r--r--contrib/llvm/lib/Target/SystemZ/TargetInfo/CMakeLists.txt7
-rw-r--r--contrib/llvm/lib/Target/SystemZ/TargetInfo/Makefile15
-rw-r--r--contrib/llvm/lib/Target/X86/AsmParser/CMakeLists.txt7
-rw-r--r--contrib/llvm/lib/Target/X86/AsmParser/Makefile15
-rw-r--r--contrib/llvm/lib/Target/X86/AsmPrinter/CMakeLists.txt8
-rw-r--r--contrib/llvm/lib/Target/X86/AsmPrinter/Makefile15
-rw-r--r--contrib/llvm/lib/Target/X86/CMakeLists.txt52
-rw-r--r--contrib/llvm/lib/Target/X86/Disassembler/CMakeLists.txt14
-rw-r--r--contrib/llvm/lib/Target/X86/Disassembler/Makefile16
-rw-r--r--contrib/llvm/lib/Target/X86/Makefile25
-rw-r--r--contrib/llvm/lib/Target/X86/README-FPStack.txt85
-rw-r--r--contrib/llvm/lib/Target/X86/README-MMX.txt71
-rw-r--r--contrib/llvm/lib/Target/X86/README-SSE.txt907
-rw-r--r--contrib/llvm/lib/Target/X86/README-UNIMPLEMENTED.txt14
-rw-r--r--contrib/llvm/lib/Target/X86/README-X86-64.txt273
-rw-r--r--contrib/llvm/lib/Target/X86/README.txt1962
-rw-r--r--contrib/llvm/lib/Target/X86/TargetInfo/CMakeLists.txt7
-rw-r--r--contrib/llvm/lib/Target/X86/TargetInfo/Makefile16
-rw-r--r--contrib/llvm/lib/Target/X86/X86CompilationCallback_Win64.asm68
-rw-r--r--contrib/llvm/lib/Target/XCore/AsmPrinter/CMakeLists.txt6
-rw-r--r--contrib/llvm/lib/Target/XCore/AsmPrinter/Makefile16
-rw-r--r--contrib/llvm/lib/Target/XCore/CMakeLists.txt24
-rw-r--r--contrib/llvm/lib/Target/XCore/Makefile24
-rw-r--r--contrib/llvm/lib/Target/XCore/README.txt7
-rw-r--r--contrib/llvm/lib/Target/XCore/TargetInfo/CMakeLists.txt7
-rw-r--r--contrib/llvm/lib/Target/XCore/TargetInfo/Makefile16
-rw-r--r--contrib/llvm/lib/Transforms/Hello/CMakeLists.txt3
-rw-r--r--contrib/llvm/lib/Transforms/Hello/Hello.cpp65
-rw-r--r--contrib/llvm/lib/Transforms/Hello/Hello.exports0
-rw-r--r--contrib/llvm/lib/Transforms/Hello/Makefile24
-rw-r--r--contrib/llvm/lib/Transforms/IPO/CMakeLists.txt27
-rw-r--r--contrib/llvm/lib/Transforms/IPO/Makefile15
-rw-r--r--contrib/llvm/lib/Transforms/InstCombine/CMakeLists.txt17
-rw-r--r--contrib/llvm/lib/Transforms/InstCombine/Makefile15
-rw-r--r--contrib/llvm/lib/Transforms/Instrumentation/CMakeLists.txt5
-rw-r--r--contrib/llvm/lib/Transforms/Instrumentation/Makefile15
-rw-r--r--contrib/llvm/lib/Transforms/Makefile20
-rw-r--r--contrib/llvm/lib/Transforms/Scalar/CMakeLists.txt35
-rw-r--r--contrib/llvm/lib/Transforms/Scalar/Makefile15
-rw-r--r--contrib/llvm/lib/Transforms/Utils/CMakeLists.txt28
-rw-r--r--contrib/llvm/lib/Transforms/Utils/Makefile15
-rw-r--r--contrib/llvm/lib/VMCore/CMakeLists.txt35
-rw-r--r--contrib/llvm/lib/VMCore/Makefile34
-rw-r--r--contrib/llvm/llvm.spec.in67
-rw-r--r--contrib/llvm/runtime/Makefile31
-rw-r--r--contrib/llvm/runtime/README.txt4
-rw-r--r--contrib/llvm/runtime/libprofile/BasicBlockTracing.c67
-rw-r--r--contrib/llvm/runtime/libprofile/CommonProfiling.c117
-rw-r--r--contrib/llvm/runtime/libprofile/EdgeProfiling.c45
-rw-r--r--contrib/llvm/runtime/libprofile/Makefile22
-rw-r--r--contrib/llvm/runtime/libprofile/OptimalEdgeProfiling.c45
-rw-r--r--contrib/llvm/runtime/libprofile/Profiling.h31
-rw-r--r--contrib/llvm/runtime/libprofile/libprofile.exports4
-rw-r--r--contrib/llvm/tools/CMakeLists.txt43
-rw-r--r--contrib/llvm/tools/Makefile60
-rw-r--r--contrib/llvm/tools/bugpoint-passes/CMakeLists.txt3
-rw-r--r--contrib/llvm/tools/bugpoint-passes/Makefile23
-rw-r--r--contrib/llvm/tools/bugpoint-passes/TestPasses.cpp75
-rw-r--r--contrib/llvm/tools/bugpoint-passes/bugpoint.exports0
-rw-r--r--contrib/llvm/tools/bugpoint/BugDriver.cpp246
-rw-r--r--contrib/llvm/tools/bugpoint/BugDriver.h329
-rw-r--r--contrib/llvm/tools/bugpoint/CMakeLists.txt14
-rw-r--r--contrib/llvm/tools/bugpoint/CrashDebugger.cpp667
-rw-r--r--contrib/llvm/tools/bugpoint/ExecutionDriver.cpp501
-rw-r--r--contrib/llvm/tools/bugpoint/ExtractFunction.cpp369
-rw-r--r--contrib/llvm/tools/bugpoint/FindBugs.cpp113
-rw-r--r--contrib/llvm/tools/bugpoint/ListReducer.h201
-rw-r--r--contrib/llvm/tools/bugpoint/Makefile16
-rw-r--r--contrib/llvm/tools/bugpoint/Miscompilation.cpp1082
-rw-r--r--contrib/llvm/tools/bugpoint/OptimizerDriver.cpp260
-rw-r--r--contrib/llvm/tools/bugpoint/ToolRunner.cpp883
-rw-r--r--contrib/llvm/tools/bugpoint/ToolRunner.h242
-rw-r--r--contrib/llvm/tools/bugpoint/bugpoint.cpp159
-rw-r--r--contrib/llvm/tools/clang/CMakeLists.txt152
-rw-r--r--contrib/llvm/tools/clang/INSTALL.txt49
-rw-r--r--contrib/llvm/tools/clang/LICENSE.TXT63
-rw-r--r--contrib/llvm/tools/clang/Makefile92
-rw-r--r--contrib/llvm/tools/clang/ModuleInfo.txt5
-rw-r--r--contrib/llvm/tools/clang/NOTES.txt85
-rw-r--r--contrib/llvm/tools/clang/README.txt26
-rw-r--r--contrib/llvm/tools/clang/TODO.txt75
-rw-r--r--contrib/llvm/tools/clang/bindings/python/README.txt17
-rw-r--r--contrib/llvm/tools/clang/bindings/python/clang/__init__.py24
-rw-r--r--contrib/llvm/tools/clang/bindings/python/clang/cindex.py935
-rw-r--r--contrib/llvm/tools/clang/bindings/python/examples/cindex/cindex-dump.py87
-rw-r--r--contrib/llvm/tools/clang/bindings/python/examples/cindex/cindex-includes.py58
-rw-r--r--contrib/llvm/tools/clang/bindings/python/tests/__init__.py0
-rw-r--r--contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/header1.h6
-rw-r--r--contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/header2.h6
-rw-r--r--contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/header3.h3
-rw-r--r--contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/hello.cpp6
-rw-r--r--contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/include.cpp5
-rw-r--r--contrib/llvm/tools/clang/bindings/python/tests/cindex/INPUTS/parse_arguments.c2
-rw-r--r--contrib/llvm/tools/clang/bindings/python/tests/cindex/__init__.py0
-rw-r--r--contrib/llvm/tools/clang/bindings/python/tests/cindex/test_cursor.py59
-rw-r--r--contrib/llvm/tools/clang/bindings/python/tests/cindex/test_cursor_kind.py27
-rw-r--r--contrib/llvm/tools/clang/bindings/python/tests/cindex/test_diagnostics.py48
-rw-r--r--contrib/llvm/tools/clang/bindings/python/tests/cindex/test_index.py15
-rw-r--r--contrib/llvm/tools/clang/bindings/python/tests/cindex/test_translation_unit.py73
-rw-r--r--contrib/llvm/tools/clang/include/CMakeLists.txt1
-rw-r--r--contrib/llvm/tools/clang/include/Makefile4
-rw-r--r--contrib/llvm/tools/clang/include/clang-c/Makefile31
-rw-r--r--contrib/llvm/tools/clang/include/clang/AST/CMakeLists.txt24
-rw-r--r--contrib/llvm/tools/clang/include/clang/AST/Makefile29
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/CMakeLists.txt32
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/Makefile56
-rw-r--r--contrib/llvm/tools/clang/include/clang/Basic/Version.inc.in6
-rw-r--r--contrib/llvm/tools/clang/include/clang/CMakeLists.txt4
-rw-r--r--contrib/llvm/tools/clang/include/clang/Driver/CMakeLists.txt17
-rw-r--r--contrib/llvm/tools/clang/include/clang/Driver/Makefile18
-rw-r--r--contrib/llvm/tools/clang/include/clang/Makefile31
-rw-r--r--contrib/llvm/tools/clang/include/clang/Serialization/CMakeLists.txt12
-rw-r--r--contrib/llvm/tools/clang/include/clang/Serialization/Makefile19
-rw-r--r--contrib/llvm/tools/clang/lib/AST/CMakeLists.txt46
-rw-r--r--contrib/llvm/tools/clang/lib/AST/Makefile18
-rw-r--r--contrib/llvm/tools/clang/lib/Analysis/CMakeLists.txt17
-rw-r--r--contrib/llvm/tools/clang/lib/Analysis/Makefile18
-rw-r--r--contrib/llvm/tools/clang/lib/Basic/CMakeLists.txt39
-rw-r--r--contrib/llvm/tools/clang/lib/Basic/Makefile29
-rw-r--r--contrib/llvm/tools/clang/lib/CMakeLists.txt15
-rw-r--r--contrib/llvm/tools/clang/lib/Checker/CMakeLists.txt84
-rw-r--r--contrib/llvm/tools/clang/lib/Checker/Makefile18
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CMakeLists.txt41
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/Makefile19
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/README.txt47
-rw-r--r--contrib/llvm/tools/clang/lib/Driver/CMakeLists.txt25
-rw-r--r--contrib/llvm/tools/clang/lib/Driver/Makefile13
-rw-r--r--contrib/llvm/tools/clang/lib/Frontend/CMakeLists.txt45
-rw-r--r--contrib/llvm/tools/clang/lib/Frontend/Makefile14
-rw-r--r--contrib/llvm/tools/clang/lib/FrontendTool/CMakeLists.txt5
-rw-r--r--contrib/llvm/tools/clang/lib/FrontendTool/Makefile13
-rw-r--r--contrib/llvm/tools/clang/lib/Headers/CMakeLists.txt50
-rw-r--r--contrib/llvm/tools/clang/lib/Headers/Makefile54
-rw-r--r--contrib/llvm/tools/clang/lib/Index/CMakeLists.txt15
-rw-r--r--contrib/llvm/tools/clang/lib/Index/Makefile18
-rw-r--r--contrib/llvm/tools/clang/lib/Lex/CMakeLists.txt27
-rw-r--r--contrib/llvm/tools/clang/lib/Lex/Makefile24
-rwxr-xr-xcontrib/llvm/tools/clang/lib/Makefile15
-rw-r--r--contrib/llvm/tools/clang/lib/Parse/CMakeLists.txt19
-rw-r--r--contrib/llvm/tools/clang/lib/Parse/Makefile18
-rw-r--r--contrib/llvm/tools/clang/lib/Rewrite/CMakeLists.txt21
-rw-r--r--contrib/llvm/tools/clang/lib/Rewrite/Makefile18
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/CMakeLists.txt39
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/Makefile19
-rw-r--r--contrib/llvm/tools/clang/lib/Serialization/CMakeLists.txt23
-rw-r--r--contrib/llvm/tools/clang/lib/Serialization/Makefile19
-rw-r--r--contrib/llvm/tools/clang/runtime/Makefile104
-rw-r--r--contrib/llvm/tools/clang/tools/CMakeLists.txt3
-rw-r--r--contrib/llvm/tools/clang/tools/Makefile19
-rw-r--r--contrib/llvm/tools/clang/tools/c-index-test/CMakeLists.txt30
-rw-r--r--contrib/llvm/tools/clang/tools/c-index-test/Makefile21
-rw-r--r--contrib/llvm/tools/clang/tools/c-index-test/c-index-test.c1524
-rw-r--r--contrib/llvm/tools/clang/tools/driver/CMakeLists.txt54
-rw-r--r--contrib/llvm/tools/clang/tools/driver/Info.plist.in18
-rw-r--r--contrib/llvm/tools/clang/tools/driver/Makefile66
-rw-r--r--contrib/llvm/tools/clang/tools/libclang/CIndex.cpp3795
-rw-r--r--contrib/llvm/tools/clang/tools/libclang/CIndexCXX.cpp124
-rw-r--r--contrib/llvm/tools/clang/tools/libclang/CIndexCodeCompletion.cpp822
-rw-r--r--contrib/llvm/tools/clang/tools/libclang/CIndexDiagnostic.cpp272
-rw-r--r--contrib/llvm/tools/clang/tools/libclang/CIndexDiagnostic.h53
-rw-r--r--contrib/llvm/tools/clang/tools/libclang/CIndexInclusionStack.cpp67
-rw-r--r--contrib/llvm/tools/clang/tools/libclang/CIndexUSRs.cpp847
-rw-r--r--contrib/llvm/tools/clang/tools/libclang/CIndexer.cpp155
-rw-r--r--contrib/llvm/tools/clang/tools/libclang/CIndexer.h78
-rw-r--r--contrib/llvm/tools/clang/tools/libclang/CMakeLists.txt64
-rw-r--r--contrib/llvm/tools/clang/tools/libclang/CXCursor.cpp374
-rw-r--r--contrib/llvm/tools/clang/tools/libclang/CXCursor.h138
-rw-r--r--contrib/llvm/tools/clang/tools/libclang/CXSourceLocation.h78
-rw-r--r--contrib/llvm/tools/clang/tools/libclang/CXType.cpp297
-rw-r--r--contrib/llvm/tools/clang/tools/libclang/CXType.h29
-rw-r--r--contrib/llvm/tools/clang/tools/libclang/Makefile46
-rw-r--r--contrib/llvm/tools/clang/tools/libclang/libclang.darwin.exports108
-rw-r--r--contrib/llvm/tools/clang/tools/libclang/libclang.exports108
l---------contrib/llvm/tools/clang/tools/scan-build/c++-analyzer1
-rwxr-xr-xcontrib/llvm/tools/clang/tools/scan-build/ccc-analyzer661
-rwxr-xr-xcontrib/llvm/tools/clang/tools/scan-build/scan-build1265
-rw-r--r--contrib/llvm/tools/clang/tools/scan-build/scanview.css62
-rwxr-xr-xcontrib/llvm/tools/clang/tools/scan-build/set-xcode-analyzer77
-rw-r--r--contrib/llvm/tools/clang/tools/scan-build/sorttable.js493
-rw-r--r--contrib/llvm/tools/clang/tools/scan-view/Reporter.py248
-rw-r--r--contrib/llvm/tools/clang/tools/scan-view/Resources/FileRadar.scptbin18418 -> 0 bytes
-rw-r--r--contrib/llvm/tools/clang/tools/scan-view/Resources/GetRadarVersion.scpt0
-rw-r--r--contrib/llvm/tools/clang/tools/scan-view/Resources/bugcatcher.icobin318 -> 0 bytes
-rw-r--r--contrib/llvm/tools/clang/tools/scan-view/ScanView.py770
-rwxr-xr-xcontrib/llvm/tools/clang/tools/scan-view/scan-view131
-rw-r--r--contrib/llvm/tools/clang/tools/scan-view/startfile.py203
-rwxr-xr-xcontrib/llvm/tools/clang/utils/ABITest/ABITestGen.py653
-rw-r--r--contrib/llvm/tools/clang/utils/ABITest/Enumeration.py276
-rw-r--r--contrib/llvm/tools/clang/utils/ABITest/Makefile.test.common170
-rw-r--r--contrib/llvm/tools/clang/utils/ABITest/TypeGen.py462
-rwxr-xr-xcontrib/llvm/tools/clang/utils/ABITest/build-and-summarize-all.sh15
-rwxr-xr-xcontrib/llvm/tools/clang/utils/ABITest/build-and-summarize.sh14
-rwxr-xr-xcontrib/llvm/tools/clang/utils/ABITest/build.sh12
-rw-r--r--contrib/llvm/tools/clang/utils/ABITest/layout/Makefile68
-rw-r--r--contrib/llvm/tools/clang/utils/ABITest/return-types-32/Makefile7
-rw-r--r--contrib/llvm/tools/clang/utils/ABITest/return-types-64/Makefile7
-rw-r--r--contrib/llvm/tools/clang/utils/ABITest/single-args-32/Makefile7
-rw-r--r--contrib/llvm/tools/clang/utils/ABITest/single-args-64/Makefile13
-rwxr-xr-xcontrib/llvm/tools/clang/utils/ABITest/summarize.sh15
-rw-r--r--contrib/llvm/tools/clang/utils/C++Tests/Clang-Code-Compile/lit.local.cfg26
-rw-r--r--contrib/llvm/tools/clang/utils/C++Tests/Clang-Code-Syntax/lit.local.cfg25
-rw-r--r--contrib/llvm/tools/clang/utils/C++Tests/Clang-Syntax/lit.local.cfg24
-rw-r--r--contrib/llvm/tools/clang/utils/C++Tests/LLVM-Code-Compile/lit.local.cfg56
-rwxr-xr-xcontrib/llvm/tools/clang/utils/C++Tests/LLVM-Code-Symbols/check-symbols54
-rw-r--r--contrib/llvm/tools/clang/utils/C++Tests/LLVM-Code-Symbols/lit.local.cfg56
-rw-r--r--contrib/llvm/tools/clang/utils/C++Tests/LLVM-Code-Syntax/lit.local.cfg54
-rw-r--r--contrib/llvm/tools/clang/utils/C++Tests/LLVM-Syntax/lit.local.cfg24
-rw-r--r--contrib/llvm/tools/clang/utils/C++Tests/lit.cfg27
-rw-r--r--contrib/llvm/tools/clang/utils/C++Tests/stdc++-Syntax/lit.local.cfg17
-rwxr-xr-xcontrib/llvm/tools/clang/utils/CIndex/completion_logger_server.py44
-rwxr-xr-xcontrib/llvm/tools/clang/utils/CaptureCmd73
-rwxr-xr-xcontrib/llvm/tools/clang/utils/CmpDriver210
-rwxr-xr-xcontrib/llvm/tools/clang/utils/FindSpecRefs910
-rwxr-xr-xcontrib/llvm/tools/clang/utils/FuzzTest340
-rw-r--r--contrib/llvm/tools/clang/utils/OptionalTests/Extra/README.txt3
-rw-r--r--contrib/llvm/tools/clang/utils/OptionalTests/Extra/Runtime/darwin-clang_rt.c338
-rw-r--r--contrib/llvm/tools/clang/utils/OptionalTests/README.txt4
-rw-r--r--contrib/llvm/tools/clang/utils/OptionalTests/lit.cfg26
-rwxr-xr-xcontrib/llvm/tools/clang/utils/SummarizeErrors117
-rwxr-xr-xcontrib/llvm/tools/clang/utils/TestUtils/deep-stack.py24
-rwxr-xr-xcontrib/llvm/tools/clang/utils/TestUtils/pch-test.pl61
-rw-r--r--contrib/llvm/tools/clang/utils/VtableTest/Makefile24
-rwxr-xr-xcontrib/llvm/tools/clang/utils/VtableTest/check-zti20
-rwxr-xr-xcontrib/llvm/tools/clang/utils/VtableTest/check-ztt20
-rwxr-xr-xcontrib/llvm/tools/clang/utils/VtableTest/check-zvt18
-rw-r--r--contrib/llvm/tools/clang/utils/VtableTest/gen.cc350
-rwxr-xr-xcontrib/llvm/tools/clang/utils/analyzer/CmpRuns230
-rwxr-xr-xcontrib/llvm/tools/clang/utils/analyzer/ubiviz74
-rw-r--r--contrib/llvm/tools/clang/utils/builtin-defines.c85
-rw-r--r--contrib/llvm/tools/clang/utils/clang-completion-mode.el257
-rwxr-xr-xcontrib/llvm/tools/clang/utils/token-delta.py251
-rw-r--r--contrib/llvm/tools/clang/utils/valgrind/x86_64-pc-linux-gnu_gcc-4.3.3.supp23
-rw-r--r--contrib/llvm/tools/edis/CMakeLists.txt13
-rw-r--r--contrib/llvm/tools/edis/EDMain.cpp284
-rw-r--r--contrib/llvm/tools/edis/EnhancedDisassembly.exports36
-rw-r--r--contrib/llvm/tools/edis/Makefile54
-rw-r--r--contrib/llvm/tools/gold/Makefile32
-rw-r--r--contrib/llvm/tools/gold/README.txt21
-rw-r--r--contrib/llvm/tools/gold/gold-plugin.cpp519
-rw-r--r--contrib/llvm/tools/gold/gold.exports1
-rw-r--r--contrib/llvm/tools/llc/CMakeLists.txt5
-rw-r--r--contrib/llvm/tools/llc/Makefile21
-rw-r--r--contrib/llvm/tools/llc/llc.cpp330
-rw-r--r--contrib/llvm/tools/lli/CMakeLists.txt5
-rw-r--r--contrib/llvm/tools/lli/Makefile15
-rw-r--r--contrib/llvm/tools/lli/lli.cpp254
-rw-r--r--contrib/llvm/tools/llvm-ar/CMakeLists.txt8
-rw-r--r--contrib/llvm/tools/llvm-ar/Makefile25
-rw-r--r--contrib/llvm/tools/llvm-ar/llvm-ar.cpp779
-rw-r--r--contrib/llvm/tools/llvm-as/CMakeLists.txt6
-rw-r--r--contrib/llvm/tools/llvm-as/Makefile17
-rw-r--r--contrib/llvm/tools/llvm-as/llvm-as.cpp119
-rw-r--r--contrib/llvm/tools/llvm-bcanalyzer/CMakeLists.txt6
-rw-r--r--contrib/llvm/tools/llvm-bcanalyzer/Makefile17
-rw-r--r--contrib/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp625
-rw-r--r--contrib/llvm/tools/llvm-config/CMakeLists.txt146
-rw-r--r--contrib/llvm/tools/llvm-config/Makefile131
-rwxr-xr-xcontrib/llvm/tools/llvm-config/find-cycles.pl170
-rw-r--r--contrib/llvm/tools/llvm-config/llvm-config.in.in460
-rw-r--r--contrib/llvm/tools/llvm-diff/CMakeLists.txt6
-rw-r--r--contrib/llvm/tools/llvm-diff/DifferenceEngine.cpp676
-rw-r--r--contrib/llvm/tools/llvm-diff/DifferenceEngine.h179
-rw-r--r--contrib/llvm/tools/llvm-diff/Makefile17
-rw-r--r--contrib/llvm/tools/llvm-diff/llvm-diff.cpp331
-rw-r--r--contrib/llvm/tools/llvm-dis/CMakeLists.txt6
-rw-r--r--contrib/llvm/tools/llvm-dis/Makefile17
-rw-r--r--contrib/llvm/tools/llvm-dis/llvm-dis.cpp138
-rw-r--r--contrib/llvm/tools/llvm-extract/CMakeLists.txt5
-rw-r--r--contrib/llvm/tools/llvm-extract/Makefile18
-rw-r--r--contrib/llvm/tools/llvm-extract/llvm-extract.cpp147
-rw-r--r--contrib/llvm/tools/llvm-ld/CMakeLists.txt6
-rw-r--r--contrib/llvm/tools/llvm-ld/Makefile15
-rw-r--r--contrib/llvm/tools/llvm-ld/Optimize.cpp128
-rw-r--r--contrib/llvm/tools/llvm-ld/llvm-ld.cpp724
-rw-r--r--contrib/llvm/tools/llvm-link/CMakeLists.txt5
-rw-r--r--contrib/llvm/tools/llvm-link/Makefile17
-rw-r--r--contrib/llvm/tools/llvm-link/llvm-link.cpp141
-rw-r--r--contrib/llvm/tools/llvm-mc/CMakeLists.txt6
-rw-r--r--contrib/llvm/tools/llvm-mc/Disassembler.cpp338
-rw-r--r--contrib/llvm/tools/llvm-mc/Disassembler.h40
-rw-r--r--contrib/llvm/tools/llvm-mc/Makefile24
-rw-r--r--contrib/llvm/tools/llvm-mc/llvm-mc.cpp410
-rw-r--r--contrib/llvm/tools/llvm-nm/CMakeLists.txt5
-rw-r--r--contrib/llvm/tools/llvm-nm/Makefile17
-rw-r--r--contrib/llvm/tools/llvm-nm/llvm-nm.cpp199
-rw-r--r--contrib/llvm/tools/llvm-prof/CMakeLists.txt5
-rw-r--r--contrib/llvm/tools/llvm-prof/Makefile17
-rw-r--r--contrib/llvm/tools/llvm-prof/llvm-prof.cpp291
-rw-r--r--contrib/llvm/tools/llvm-ranlib/CMakeLists.txt6
-rw-r--r--contrib/llvm/tools/llvm-ranlib/Makefile18
-rw-r--r--contrib/llvm/tools/llvm-ranlib/llvm-ranlib.cpp101
-rw-r--r--contrib/llvm/tools/llvm-shlib/Makefile111
-rw-r--r--contrib/llvm/tools/llvm-stub/CMakeLists.txt3
-rw-r--r--contrib/llvm/tools/llvm-stub/Makefile13
-rw-r--r--contrib/llvm/tools/llvm-stub/llvm-stub.c73
-rw-r--r--contrib/llvm/tools/llvmc/CMakeLists.txt4
-rw-r--r--contrib/llvm/tools/llvmc/Makefile18
-rw-r--r--contrib/llvm/tools/llvmc/doc/LLVMC-Reference.rst839
-rw-r--r--contrib/llvm/tools/llvmc/doc/LLVMC-Tutorial.rst129
-rw-r--r--contrib/llvm/tools/llvmc/doc/Makefile33
-rw-r--r--contrib/llvm/tools/llvmc/doc/img/lines.gifbin91 -> 0 bytes
-rw-r--r--contrib/llvm/tools/llvmc/src/AutoGenerated.td17
-rw-r--r--contrib/llvm/tools/llvmc/src/Base.td.in382
-rw-r--r--contrib/llvm/tools/llvmc/src/Clang.td87
-rw-r--r--contrib/llvm/tools/llvmc/src/Hooks.cpp33
-rw-r--r--contrib/llvm/tools/llvmc/src/Main.cpp16
-rw-r--r--contrib/llvm/tools/llvmc/src/Makefile14
-rw-r--r--contrib/llvm/tools/lto/LTOCodeGenerator.cpp442
-rw-r--r--contrib/llvm/tools/lto/LTOCodeGenerator.h72
-rw-r--r--contrib/llvm/tools/lto/LTOModule.cpp508
-rw-r--r--contrib/llvm/tools/lto/LTOModule.h111
-rw-r--r--contrib/llvm/tools/lto/Makefile54
-rw-r--r--contrib/llvm/tools/lto/lto.cpp283
-rw-r--r--contrib/llvm/tools/lto/lto.exports26
-rw-r--r--contrib/llvm/tools/opt/AnalysisWrappers.cpp94
-rw-r--r--contrib/llvm/tools/opt/CMakeLists.txt8
-rw-r--r--contrib/llvm/tools/opt/GraphPrinters.cpp123
-rw-r--r--contrib/llvm/tools/opt/Makefile14
-rw-r--r--contrib/llvm/tools/opt/PrintSCC.cpp112
-rw-r--r--contrib/llvm/tools/opt/opt.cpp557
-rwxr-xr-xcontrib/llvm/utils/DSAclean.py32
-rw-r--r--contrib/llvm/utils/DSAextract.py111
-rw-r--r--contrib/llvm/utils/FileCheck/CMakeLists.txt11
-rw-r--r--contrib/llvm/utils/FileCheck/FileCheck.cpp732
-rw-r--r--contrib/llvm/utils/FileCheck/Makefile21
-rw-r--r--contrib/llvm/utils/FileUpdate/CMakeLists.txt11
-rw-r--r--contrib/llvm/utils/FileUpdate/FileUpdate.cpp87
-rw-r--r--contrib/llvm/utils/FileUpdate/Makefile21
-rwxr-xr-xcontrib/llvm/utils/GenLibDeps.pl388
-rwxr-xr-xcontrib/llvm/utils/GetSourceVersion27
-rw-r--r--contrib/llvm/utils/Makefile22
-rwxr-xr-xcontrib/llvm/utils/Misc/zkill276
-rw-r--r--contrib/llvm/utils/NLT.schema8
-rwxr-xr-xcontrib/llvm/utils/NewNightlyTest.pl836
-rw-r--r--contrib/llvm/utils/NightlyTest.gnuplot214
-rw-r--r--contrib/llvm/utils/NightlyTestTemplate.html244
-rw-r--r--contrib/llvm/utils/OldenDataRecover.pl37
-rw-r--r--contrib/llvm/utils/PerfectShuffle/Makefile18
-rw-r--r--contrib/llvm/utils/PerfectShuffle/PerfectShuffle.cpp571
-rw-r--r--contrib/llvm/utils/TableGen/CMakeLists.txt46
-rw-r--r--contrib/llvm/utils/TableGen/Makefile20
-rwxr-xr-xcontrib/llvm/utils/UpdateCMakeLists.pl119
-rw-r--r--contrib/llvm/utils/bugpoint/RemoteRunSafely.sh105
-rw-r--r--contrib/llvm/utils/buildit/GNUmakefile131
-rwxr-xr-xcontrib/llvm/utils/buildit/build_llvm373
-rwxr-xr-xcontrib/llvm/utils/cgiplotNLT.pl68
-rwxr-xr-xcontrib/llvm/utils/check-each-file150
-rwxr-xr-xcontrib/llvm/utils/codegen-diff135
-rw-r--r--contrib/llvm/utils/count/CMakeLists.txt3
-rw-r--r--contrib/llvm/utils/count/Makefile20
-rw-r--r--contrib/llvm/utils/count/count.c50
-rwxr-xr-xcontrib/llvm/utils/countloc.sh40
-rw-r--r--contrib/llvm/utils/crosstool/ARM/README37
-rwxr-xr-xcontrib/llvm/utils/crosstool/ARM/build-install-linux.sh200
-rwxr-xr-xcontrib/llvm/utils/crosstool/create-snapshots.sh41
-rw-r--r--contrib/llvm/utils/emacs/README27
-rw-r--r--contrib/llvm/utils/emacs/emacs.el39
-rw-r--r--contrib/llvm/utils/emacs/llvm-mode.el128
-rw-r--r--contrib/llvm/utils/emacs/tablegen-mode.el124
-rwxr-xr-xcontrib/llvm/utils/findmisopt178
-rwxr-xr-xcontrib/llvm/utils/findoptdiff101
-rwxr-xr-xcontrib/llvm/utils/findsym.pl33
-rw-r--r--contrib/llvm/utils/fpcmp/Makefile16
-rw-r--r--contrib/llvm/utils/fpcmp/fpcmp.cpp43
-rwxr-xr-xcontrib/llvm/utils/getsrcs.sh34
-rwxr-xr-xcontrib/llvm/utils/git/find-rev50
-rw-r--r--contrib/llvm/utils/importNLT.pl86
-rw-r--r--contrib/llvm/utils/jedit/README14
-rw-r--r--contrib/llvm/utils/jedit/tablegen.xml39
-rw-r--r--contrib/llvm/utils/lint/common_lint.py97
-rwxr-xr-xcontrib/llvm/utils/lint/cpp_lint.py94
-rwxr-xr-xcontrib/llvm/utils/lint/generic_lint.py24
-rwxr-xr-xcontrib/llvm/utils/lint/remove_trailing_whitespace.sh6
-rw-r--r--contrib/llvm/utils/lit/TODO19
-rwxr-xr-xcontrib/llvm/utils/lit/lit.py5
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests.ObjDir/lit.site.cfg15
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/Clang/fsyntax-only.c4
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/Clang/lit.cfg47
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/LLVM.InTree/test/Bar/bar-test.ll3
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/LLVM.InTree/test/Bar/dg.exp6
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/LLVM.InTree/test/lit.cfg151
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/LLVM.InTree/test/lit.site.cfg10
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/LLVM.InTree/test/site.exp28
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/lit.local.cfg1
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/obj/test/Foo/lit.local.cfg0
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/obj/test/lit.site.cfg11
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/obj/test/site.exp28
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/src/test/Foo/data.txt1
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/src/test/Foo/dg.exp6
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/src/test/Foo/pct-S.ll1
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/src/test/lit.cfg151
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/ShExternal/lit.local.cfg6
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/ShInternal/lit.local.cfg6
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/TclTest/lit.local.cfg5
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/TclTest/stderr-pipe.ll1
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/TclTest/tcl-redir-1.ll7
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/fail.c2
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/lit.cfg26
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/pass.c1
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/required-and-missing.c4
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/required-and-present.c2
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/xfail.c2
-rw-r--r--contrib/llvm/utils/lit/lit/ExampleTests/xpass.c2
-rw-r--r--contrib/llvm/utils/lit/lit/LitConfig.py112
-rw-r--r--contrib/llvm/utils/lit/lit/LitFormats.py2
-rw-r--r--contrib/llvm/utils/lit/lit/LitTestCase.py30
-rw-r--r--contrib/llvm/utils/lit/lit/ProgressBar.py267
-rw-r--r--contrib/llvm/utils/lit/lit/ShCommands.py85
-rw-r--r--contrib/llvm/utils/lit/lit/ShUtil.py353
-rw-r--r--contrib/llvm/utils/lit/lit/TclUtil.py322
-rw-r--r--contrib/llvm/utils/lit/lit/Test.py79
-rw-r--r--contrib/llvm/utils/lit/lit/TestFormats.py221
-rw-r--r--contrib/llvm/utils/lit/lit/TestRunner.py586
-rw-r--r--contrib/llvm/utils/lit/lit/TestingConfig.py101
-rw-r--r--contrib/llvm/utils/lit/lit/Util.py125
-rw-r--r--contrib/llvm/utils/lit/lit/__init__.py10
-rwxr-xr-xcontrib/llvm/utils/lit/lit/lit.py648
-rw-r--r--contrib/llvm/utils/lit/setup.py69
-rw-r--r--contrib/llvm/utils/llvm-lit/Makefile21
-rw-r--r--contrib/llvm/utils/llvm-lit/llvm-lit.in21
-rwxr-xr-xcontrib/llvm/utils/llvm-native-gcc249
-rwxr-xr-xcontrib/llvm/utils/llvm-native-gxx249
-rw-r--r--contrib/llvm/utils/llvm.grm418
-rwxr-xr-xcontrib/llvm/utils/llvmdo184
-rwxr-xr-xcontrib/llvm/utils/llvmgrep39
-rwxr-xr-xcontrib/llvm/utils/makellvm145
-rw-r--r--contrib/llvm/utils/not/CMakeLists.txt11
-rw-r--r--contrib/llvm/utils/not/Makefile21
-rw-r--r--contrib/llvm/utils/not/not.cpp17
-rw-r--r--contrib/llvm/utils/parseNLT.pl34
-rw-r--r--contrib/llvm/utils/plotNLT.pl53
-rwxr-xr-xcontrib/llvm/utils/profile.pl74
-rw-r--r--contrib/llvm/utils/unittest/Makefile13
-rw-r--r--contrib/llvm/utils/unittest/UnitTestMain/Makefile30
-rw-r--r--contrib/llvm/utils/unittest/UnitTestMain/TestMain.cpp15
-rw-r--r--contrib/llvm/utils/unittest/googletest/LICENSE.TXT28
-rw-r--r--contrib/llvm/utils/unittest/googletest/Makefile39
-rw-r--r--contrib/llvm/utils/unittest/googletest/README.LLVM31
-rw-r--r--contrib/llvm/utils/unittest/googletest/gtest-death-test.cc1172
-rw-r--r--contrib/llvm/utils/unittest/googletest/gtest-filepath.cc380
-rw-r--r--contrib/llvm/utils/unittest/googletest/gtest-port.cc711
-rw-r--r--contrib/llvm/utils/unittest/googletest/gtest-test-part.cc110
-rw-r--r--contrib/llvm/utils/unittest/googletest/gtest-typed-test.cc110
-rw-r--r--contrib/llvm/utils/unittest/googletest/gtest.cc4704
-rw-r--r--contrib/llvm/utils/unittest/googletest/include/gtest/gtest-death-test.h283
-rw-r--r--contrib/llvm/utils/unittest/googletest/include/gtest/gtest-message.h230
-rw-r--r--contrib/llvm/utils/unittest/googletest/include/gtest/gtest-param-test.h1397
-rw-r--r--contrib/llvm/utils/unittest/googletest/include/gtest/gtest-spi.h232
-rw-r--r--contrib/llvm/utils/unittest/googletest/include/gtest/gtest-test-part.h176
-rw-r--r--contrib/llvm/utils/unittest/googletest/include/gtest/gtest-typed-test.h259
-rw-r--r--contrib/llvm/utils/unittest/googletest/include/gtest/gtest.h2052
-rw-r--r--contrib/llvm/utils/unittest/googletest/include/gtest/gtest_pred_impl.h368
-rw-r--r--contrib/llvm/utils/unittest/googletest/include/gtest/gtest_prod.h58
-rw-r--r--contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h275
-rw-r--r--contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-filepath.h210
-rw-r--r--contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-internal-inl.h1074
-rw-r--r--contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-internal.h943
-rw-r--r--contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-linked_ptr.h243
-rw-r--r--contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-param-util-generated.h4820
-rw-r--r--contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-param-util.h619
-rw-r--r--contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h1501
-rw-r--r--contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-string.h350
-rw-r--r--contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-tuple.h968
-rw-r--r--contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-type-util.h3321
-rw-r--r--contrib/llvm/utils/valgrind/i386-pc-linux-gnu.supp41
-rw-r--r--contrib/llvm/utils/valgrind/x86_64-pc-linux-gnu.supp46
-rw-r--r--contrib/llvm/utils/vim/README43
-rw-r--r--contrib/llvm/utils/vim/llvm.vim109
-rw-r--r--contrib/llvm/utils/vim/tablegen.vim54
-rw-r--r--contrib/llvm/utils/vim/vimrc220
-rwxr-xr-xcontrib/llvm/utils/webNLT.pl83
721 files changed, 0 insertions, 162290 deletions
diff --git a/contrib/llvm/CMakeLists.txt b/contrib/llvm/CMakeLists.txt
deleted file mode 100644
index a6099d1..0000000
--- 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 aeecfe2..0000000
--- 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 b8d2c74..0000000
--- 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 ae650b7..0000000
--- 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 e1f5203..0000000
--- 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 5ebd803..0000000
--- 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 "<Flavor>+Profile" directories, where
-# <Flavor> is either Debug or Release depending on how other build
-# flags are set. Otherwise, output is put in the <Flavor>
-# directories.
-#ENABLE_PROFILING = 1
-@ENABLE_PROFILING@
-
-# When DISABLE_ASSERTIONS is enabled, builds of all of the LLVM code will
-# exclude assertion checks, otherwise they are included.
-#DISABLE_ASSERTIONS = 1
-@DISABLE_ASSERTIONS@
-
-# When ENABLE_EXPENSIVE_CHECKS is enabled, builds of all of the LLVM
-# code will include expensive checks, otherwise they are excluded.
-#ENABLE_EXPENSIVE_CHECKS = 0
-@ENABLE_EXPENSIVE_CHECKS@
-
-# When DEBUG_RUNTIME is enabled, the runtime libraries will retain debug
-# symbols.
-#DEBUG_RUNTIME = 1
-@DEBUG_RUNTIME@
-
-# When DEBUG_SYMBOLS is enabled, the compiler libraries will retain debug
-# symbols.
-#DEBUG_SYMBOLS = 1
-@DEBUG_SYMBOLS@
-
-# The compiler flags to use for optimized builds.
-OPTIMIZE_OPTION := @OPTIMIZE_OPTION@
-
-# When ENABLE_PROFILING is enabled, the llvm source base is built with profile
-# information to allow gprof to be used to get execution frequencies.
-#ENABLE_PROFILING = 1
-
-# When ENABLE_DOXYGEN is enabled, the doxygen documentation will be built
-ENABLE_DOXYGEN = @ENABLE_DOXYGEN@
-
-# Do we want to enable threads?
-ENABLE_THREADS := @ENABLE_THREADS@
-
-# Do we want to build with position independent code?
-ENABLE_PIC := @ENABLE_PIC@
-
-# Do we want to build a shared library and link the tools with it?
-ENABLE_SHARED := @ENABLE_SHARED@
-
-# Use -fvisibility-inlines-hidden?
-ENABLE_VISIBILITY_INLINES_HIDDEN := @ENABLE_VISIBILITY_INLINES_HIDDEN@
-
-# Do we want to allow timestamping information into builds?
-ENABLE_TIMESTAMPS := @ENABLE_TIMESTAMPS@
-
-# This option tells the Makefiles to produce verbose output.
-# It essentially prints the commands that make is executing
-#VERBOSE = 1
-
-# Enable JIT for this platform
-TARGET_HAS_JIT = @TARGET_HAS_JIT@
-
-# Environment variable to set to change the runtime shared library search path.
-SHLIBPATH_VAR = @SHLIBPATH_VAR@
-
-# Shared library extension for host platform.
-SHLIBEXT = @SHLIBEXT@
-
-# Executable file extension for host platform.
-EXEEXT = @EXEEXT@
-
-# Things we just assume are "there"
-ECHO := echo
-
-# Get the options for causing archives to link all their content instead of
-# just missing symbols, and the inverse of that. This is used for certain LLVM
-# tools that permit loadable modules. It ensures that the LLVM symbols will be
-# available to those loadable modules.
-LINKALL := @LINKALL@
-NOLINKALL := @NOLINKALL@
-
-# Get the value of HUGE_VAL_SANITY which will be either "yes" or "no" depending
-# on the check.
-HUGE_VAL_SANITY = @HUGE_VAL_SANITY@
-
-# Bindings that we should build
-BINDINGS_TO_BUILD := @BINDINGS_TO_BUILD@
-ALL_BINDINGS := @ALL_BINDINGS@
-OCAML_LIBDIR := @OCAML_LIBDIR@
-
-# When compiling under Mingw/Cygwin, executables such as tblgen
-# expect Windows paths, whereas the build system uses Unix paths.
-# The function SYSPATH transforms Unix paths into Windows paths.
-ifneq (,$(findstring -mno-cygwin, $(CXX)))
- SYSPATH = $(shell echo $(1) | cygpath -m -f -)
-else
- SYSPATH = $(1)
-endif
-
-# Location of the plugin header file for gold.
-BINUTILS_INCDIR := @BINUTILS_INCDIR@
-
-# 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 9cff105..0000000
--- 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 $(<F) register names with tblgen"
- $(Verb) $(TableGen) -gen-register-enums -o $(call SYSPATH, $@) $<
-
-$(TARGET:%=$(ObjDir)/%GenRegisterInfo.h.inc.tmp): \
-$(ObjDir)/%GenRegisterInfo.h.inc.tmp : %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) register information header with tblgen"
- $(Verb) $(TableGen) -gen-register-desc-header -o $(call SYSPATH, $@) $<
-
-$(TARGET:%=$(ObjDir)/%GenRegisterInfo.inc.tmp): \
-$(ObjDir)/%GenRegisterInfo.inc.tmp : %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) register info implementation with tblgen"
- $(Verb) $(TableGen) -gen-register-desc -o $(call SYSPATH, $@) $<
-
-$(TARGET:%=$(ObjDir)/%GenInstrNames.inc.tmp): \
-$(ObjDir)/%GenInstrNames.inc.tmp : %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) instruction names with tblgen"
- $(Verb) $(TableGen) -gen-instr-enums -o $(call SYSPATH, $@) $<
-
-$(TARGET:%=$(ObjDir)/%GenInstrInfo.inc.tmp): \
-$(ObjDir)/%GenInstrInfo.inc.tmp : %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) instruction information with tblgen"
- $(Verb) $(TableGen) -gen-instr-desc -o $(call SYSPATH, $@) $<
-
-$(TARGET:%=$(ObjDir)/%GenAsmWriter.inc.tmp): \
-$(ObjDir)/%GenAsmWriter.inc.tmp : %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) assembly writer with tblgen"
- $(Verb) $(TableGen) -gen-asm-writer -o $(call SYSPATH, $@) $<
-
-$(TARGET:%=$(ObjDir)/%GenAsmWriter1.inc.tmp): \
-$(ObjDir)/%GenAsmWriter1.inc.tmp : %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) assembly writer #1 with tblgen"
- $(Verb) $(TableGen) -gen-asm-writer -asmwriternum=1 -o $(call SYSPATH, $@) $<
-
-$(TARGET:%=$(ObjDir)/%GenAsmMatcher.inc.tmp): \
-$(ObjDir)/%GenAsmMatcher.inc.tmp : %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) assembly matcher with tblgen"
- $(Verb) $(TableGen) -gen-asm-matcher -o $(call SYSPATH, $@) $<
-
-$(TARGET:%=$(ObjDir)/%GenCodeEmitter.inc.tmp): \
-$(ObjDir)/%GenCodeEmitter.inc.tmp: %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) code emitter with tblgen"
- $(Verb) $(TableGen) -gen-emitter -o $(call SYSPATH, $@) $<
-
-$(TARGET:%=$(ObjDir)/%GenDAGISel.inc.tmp): \
-$(ObjDir)/%GenDAGISel.inc.tmp : %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) DAG instruction selector implementation with tblgen"
- $(Verb) $(TableGen) -gen-dag-isel -o $(call SYSPATH, $@) $<
-
-$(TARGET:%=$(ObjDir)/%GenDisassemblerTables.inc.tmp): \
-$(ObjDir)/%GenDisassemblerTables.inc.tmp : %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) disassembly tables with tblgen"
- $(Verb) $(TableGen) -gen-disassembler -o $(call SYSPATH, $@) $<
-
-$(TARGET:%=$(ObjDir)/%GenEDInfo.inc.tmp): \
-$(ObjDir)/%GenEDInfo.inc.tmp : %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) enhanced disassembly information with tblgen"
- $(Verb) $(TableGen) -gen-enhanced-disassembly-info -o $(call SYSPATH, $@) $<
-
-$(TARGET:%=$(ObjDir)/%GenFastISel.inc.tmp): \
-$(ObjDir)/%GenFastISel.inc.tmp : %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) \"fast\" instruction selector implementation with tblgen"
- $(Verb) $(TableGen) -gen-fast-isel -o $(call SYSPATH, $@) $<
-
-$(TARGET:%=$(ObjDir)/%GenSubtarget.inc.tmp): \
-$(ObjDir)/%GenSubtarget.inc.tmp : %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) subtarget information with tblgen"
- $(Verb) $(TableGen) -gen-subtarget -o $(call SYSPATH, $@) $<
-
-$(TARGET:%=$(ObjDir)/%GenCallingConv.inc.tmp): \
-$(ObjDir)/%GenCallingConv.inc.tmp : %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) calling convention information with tblgen"
- $(Verb) $(TableGen) -gen-callingconv -o $(call SYSPATH, $@) $<
-
-$(TARGET:%=$(ObjDir)/%GenIntrinsics.inc.tmp): \
-$(ObjDir)/%GenIntrinsics.inc.tmp : %.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) intrinsics information with tblgen"
- $(Verb) $(TableGen) -gen-tgt-intrinsic -o $(call SYSPATH, $@) $<
-
-$(ObjDir)/ARMGenDecoderTables.inc.tmp : ARM.td $(ObjDir)/.dir
- $(Echo) "Building $(<F) decoder tables with tblgen"
- $(Verb) $(TableGen) -gen-arm-decoder -o $(call SYSPATH, $@) $<
-
-
-clean-local::
- -$(Verb) $(RM) -f $(INCFiles)
-
-endif # TARGET
-
-ifdef LLVMC_BASED_DRIVER
-
-TDSrc := $(sort $(strip $(wildcard $(PROJ_SRC_DIR)/*.td)) \
- $(strip $(wildcard $(PROJ_OBJ_DIR)/*.td)))
-
-TDCommon := $(strip $(wildcard \
- $(LLVM_SRC_ROOT)/include/llvm/CompilerDriver/*.td))
-
-TDFiles := $(TDSrc) $(TDCommon)
-
-$(INCTMPFiles) : $(TBLGEN) $(TDFiles)
-
-$(ObjDir)/%.inc.tmp: %.td $(ObjDir)/.dir
- $(Echo) "Building LLVMC compilation graph description with tblgen"
- $(Verb) $(TableGen) -gen-llvmc -o $(call SYSPATH, $@) $<
-
-clean-local::
- -$(Verb) $(RM) -f $(INCFiles)
-
-endif # LLVMC_BASED_DRIVER
-
-###############################################################################
-# OTHER RULES: Other rules needed
-###############################################################################
-
-# To create postscript files from dot files...
-ifneq ($(DOT),false)
-%.ps: %.dot
- $(DOT) -Tps < $< > $@
-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 5a1d8b8..0000000
--- 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 f54f5bf..0000000
--- 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 7809667..0000000
--- 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 17b185f..0000000
--- 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 72fdd39..0000000
--- 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 3dabdf7..0000000
--- 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 <SRC>
- 2. configure/build/install libtool with --prefix=<PFX>
- 3. Copy <SRC>/ltdl.m4 to llvm/autoconf/m4
- 4. Copy <PFX>/share/aclocal/libtool.m4 to llvm/autoconf/m4/libtool.m4
- 5. Copy <PFX>/share/libtool/ltmain.sh to llvm/autoconf/ltmain.sh
- 6. Copy <PFX>/share/libtool/libltdl/ltdl.c to llvm/lib/System
- 7. Copy <PFX>/share/libtool/libltdl/ltdl.h to llvm/lib/System
- 8. Edit the ltdl.h file to #include "llvm/Config/config.h" at the very top. You
- might also need to resolve some compiler warnings (typically about
- comparison of signed vs. unsigned values). But, you won't find out about
- those until you build LLVM (step 13).
- 9. Edit the llvm/autoconf/m4/libtool.m4 file so that:
- a) in AC_PROB_LIBTOOL macro, the value of LIBTOOL is set to
- $(top_builddir)/mklib, not $(top_builddir)/libtool
- b) in AC_LIBTOOL_SETUP macro, the variable default_ofile is set to
- "mklib" instead of "libtool"
- c) s/AC_ENABLE_SHARED_DEFAULT/enable_shared_default/g
- d) s/AC_ENABLE_STATIC_DEFAULT/enable_static_default/g
- e) s/AC_ENABLE_FAST_INSTALL_DEFAULT/enable_fast_install_default/g
-10. Run "autoupdate libtool.m4 ltdl.m4" in the llvm/autoconf/m4 directory.
- This should correctly update the macro definitions in the libtool m4
- files to match the version of autoconf that LLVM uses. This converts
- AC_HELP_STRING to AS_HELP_STRING and AC_TRY_LINK to AC_LINK_IFELSE, amongst
- other things. You may need to manually adjust the files.
-11. Run AutoRegen.sh to get the new macros into configure script
-12. If there are any warnings from AutoRegen.sh, go to step 9.
-13. Rebuild LLVM, making sure it reconfigures
-14. Test the JIT which uses libltdl
-15. If it all works, only THEN commit the changes.
-
-Upgrading autoconf
-===============================================================================
-
-If you are in the mood to upgrade autoconf, you should:
-
- 1. Consider not upgrading.
- 2. No really, this is a hassle, you don't want to do it.
- 3. Get the new version of autoconf and put it in <SRC>
- 4. configure/build/install autoconf with --prefix=<PFX>
- 5. Run autoupdate on all the m4 macros in llvm/autoconf/m4
- 6. Run autoupdate on llvm/autoconf/configure.ac
- 7. Regenerate configure script with AutoRegen.sh
- 8. If there are any warnings from AutoRegen.sh, fix them and go to step 7.
- 9. Test, test, test.
diff --git a/contrib/llvm/autoconf/config.guess b/contrib/llvm/autoconf/config.guess
deleted file mode 100755
index 865fe53..0000000
--- 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 <config-patches@gnu.org> 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 <config-patches@gnu.org>."
-
-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 <stdio.h> /* 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 <sys/systemcfg.h>
-
- 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 <stdlib.h>
- #include <unistd.h>
-
- 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 <unistd.h>
- 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' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
- elif /bin/uname -X 2>/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 <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes <hewes@openmarket.com>.
- # 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 <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#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 <sys/param.h>
- 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 <sys/param.h>
-# 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 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
-and
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> 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 183976a..0000000
--- 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 <config-patches@gnu.org>. 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 <config-patches@gnu.org>."
-
-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 0596dd6..0000000
--- 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=<name>],
- [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=<path>],
- [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=<prefix>],
- [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 <cfoo> versions of <foo.h> 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 11e2d3b..0000000
--- 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 <oliva@dcc.unicamp.br>.
-
-case $1 in
- '')
- echo "$0: No command. Try \`$0 --help' for more information." 1>&2
- exit 1;
- ;;
- -h | --h*)
- cat <<\EOF
-Usage: depcomp [--help] [--version] PROGRAM [ARGS]
-
-Run PROGRAMS ARGS to compile a file, generating dependencies
-as side-effects.
-
-Environment variables:
- depmode Dependency tracking mode.
- source Source file read by `PROGRAMS ARGS'.
- object Object file output by `PROGRAMS ARGS'.
- DEPDIR directory where to store dependencies.
- depfile Dependency file to output.
- tmpdepfile Temporary file to use when outputing dependencies.
- libtool Whether libtool is used (yes/no).
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
- exit 0
- ;;
- -v | --v*)
- echo "depcomp $scriptversion"
- exit 0
- ;;
-esac
-
-if test -z "$depmode" || test -z "$source" || test -z "$object"; then
- echo "depcomp: Variables source, object and depmode must be set" 1>&2
- exit 1
-fi
-
-# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
-depfile=${depfile-`echo "$object" |
- sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
-tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
-
-rm -f "$tmpdepfile"
-
-# Some modes work just like other modes, but use different flags. We
-# parameterize here, but still list the modes in the big case below,
-# to make depend.m4 easier to write. Note that we *cannot* use a case
-# here, because this file can only contain one case statement.
-if test "$depmode" = hp; then
- # HP compiler uses -M and no extra arg.
- gccflag=-M
- depmode=gcc
-fi
-
-if test "$depmode" = dashXmstdout; then
- # This is just like dashmstdout with a different argument.
- dashmflag=-xM
- depmode=dashmstdout
-fi
-
-case "$depmode" in
-gcc3)
-## gcc 3 implements dependency tracking that does exactly what
-## we want. Yay! Note: for some reason libtool 1.4 doesn't like
-## it if -MD -MP comes after the -MF stuff. Hmm.
- "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- mv "$tmpdepfile" "$depfile"
- ;;
-
-gcc)
-## There are various ways to get dependency output from gcc. Here's
-## why we pick this rather obscure method:
-## - Don't want to use -MD because we'd like the dependencies to end
-## up in a subdir. Having to rename by hand is ugly.
-## (We might end up doing this anyway to support other compilers.)
-## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-## -MM, not -M (despite what the docs say).
-## - Using -M directly means running the compiler twice (even worse
-## than renaming).
- if test -z "$gccflag"; then
- gccflag=-MD,
- fi
- "$@" -Wp,"$gccflag$tmpdepfile"
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
-## The second -e expression handles DOS-style file names with drive letters.
- sed -e 's/^[^:]*: / /' \
- -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the `deleted header file' problem.
-## The problem is that when a header file which appears in a .P file
-## is deleted, the dependency causes make to die (because there is
-## typically no way to rebuild the header). We avoid this by adding
-## dummy dependencies for each header file. Too bad gcc doesn't do
-## this for us directly.
- tr ' ' '
-' < "$tmpdepfile" |
-## Some versions of gcc put a space before the `:'. On the theory
-## that the space means something, we add a space to the output as
-## well.
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-hp)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-sgi)
- if test "$libtool" = yes; then
- "$@" "-Wp,-MDupdate,$tmpdepfile"
- else
- "$@" -MDupdate "$tmpdepfile"
- fi
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
-
- if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
- echo "$object : \\" > "$depfile"
-
- # Clip off the initial element (the dependent). Don't try to be
- # clever and replace this with sed code, as IRIX sed won't handle
- # lines with more than a fixed number of characters (4096 in
- # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
- # the IRIX cc adds comments like `#:fec' to the end of the
- # dependency line.
- tr ' ' '
-' < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
- tr '
-' ' ' >> $depfile
- echo >> $depfile
-
- # The second pass generates a dummy entry for each header file.
- tr ' ' '
-' < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
- >> $depfile
- else
- # The sourcefile does not contain any dependencies, so just
- # store a dummy comment line, to avoid errors with the Makefile
- # "include basename.Plo" scheme.
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
-
-aix)
- # The C for AIX Compiler uses -M and outputs the dependencies
- # in a .u file. In older versions, this file always lives in the
- # current directory. Also, the AIX compiler puts `$object:' at the
- # start of each line; $object doesn't have directory information.
- # Version 6 uses the directory in both cases.
- stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
- tmpdepfile="$stripped.u"
- if test "$libtool" = yes; then
- "$@" -Wc,-M
- else
- "$@" -M
- fi
- stat=$?
-
- if test -f "$tmpdepfile"; then :
- else
- stripped=`echo "$stripped" | sed 's,^.*/,,'`
- tmpdepfile="$stripped.u"
- fi
-
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
-
- if test -f "$tmpdepfile"; then
- outname="$stripped.o"
- # Each line is of the form `foo.o: dependent.h'.
- # Do two passes, one to just change these to
- # `$object: dependent.h' and one to simply `dependent.h:'.
- sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
- sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
- else
- # The sourcefile does not contain any dependencies, so just
- # store a dummy comment line, to avoid errors with the Makefile
- # "include basename.Plo" scheme.
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
-
-icc)
- # Intel's C compiler understands `-MD -MF file'. However on
- # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
- # ICC 7.0 will fill foo.d with something like
- # foo.o: sub/foo.c
- # foo.o: sub/foo.h
- # which is wrong. We want:
- # sub/foo.o: sub/foo.c
- # sub/foo.o: sub/foo.h
- # sub/foo.c:
- # sub/foo.h:
- # ICC 7.1 will output
- # foo.o: sub/foo.c sub/foo.h
- # and will wrap long lines using \ :
- # foo.o: sub/foo.c ... \
- # sub/foo.h ... \
- # ...
-
- "$@" -MD -MF "$tmpdepfile"
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- # Each line is of the form `foo.o: dependent.h',
- # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
- # Do two passes, one to just change these to
- # `$object: dependent.h' and one to simply `dependent.h:'.
- sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
- # Some versions of the HPUX 10.20 sed can't process this invocation
- # correctly. Breaking it into two sed invocations is a workaround.
- sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
- sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-tru64)
- # The Tru64 compiler uses -MD to generate dependencies as a side
- # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
- # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
- # dependencies in `foo.d' instead, so we check for that too.
- # Subdirectories are respected.
- dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
- test "x$dir" = "x$object" && dir=
- base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
-
- if test "$libtool" = yes; then
- # Dependencies are output in .lo.d with libtool 1.4.
- # With libtool 1.5 they are output both in $dir.libs/$base.o.d
- # and in $dir.libs/$base.o.d and $dir$base.o.d. We process the
- # latter, because the former will be cleaned when $dir.libs is
- # erased.
- tmpdepfile1="$dir.libs/$base.lo.d"
- tmpdepfile2="$dir$base.o.d"
- tmpdepfile3="$dir.libs/$base.d"
- "$@" -Wc,-MD
- else
- tmpdepfile1="$dir$base.o.d"
- tmpdepfile2="$dir$base.d"
- tmpdepfile3="$dir$base.d"
- "$@" -MD
- fi
-
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- exit $stat
- fi
-
- if test -f "$tmpdepfile1"; then
- tmpdepfile="$tmpdepfile1"
- elif test -f "$tmpdepfile2"; then
- tmpdepfile="$tmpdepfile2"
- else
- tmpdepfile="$tmpdepfile3"
- fi
- if test -f "$tmpdepfile"; then
- sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
- # That's a tab and a space in the [].
- sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
- else
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
-
-#nosideeffect)
- # This comment above is used by automake to tell side-effect
- # dependency tracking mechanisms from slower ones.
-
-dashmstdout)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout, regardless of -o.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test $1 != '--mode=compile'; do
- shift
- done
- shift
- fi
-
- # Remove `-o $object'.
- IFS=" "
- for arg
- do
- case $arg in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift # fnord
- shift # $arg
- ;;
- esac
- done
-
- test -z "$dashmflag" && dashmflag=-M
- # Require at least two characters before searching for `:'
- # in the target name. This is to cope with DOS-style filenames:
- # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
- "$@" $dashmflag |
- sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
- rm -f "$depfile"
- cat < "$tmpdepfile" > "$depfile"
- tr ' ' '
-' < "$tmpdepfile" | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-dashXmstdout)
- # This case only exists to satisfy depend.m4. It is never actually
- # run, as this mode is specially recognized in the preamble.
- exit 1
- ;;
-
-makedepend)
- "$@" || exit $?
- # Remove any Libtool call
- if test "$libtool" = yes; then
- while test $1 != '--mode=compile'; do
- shift
- done
- shift
- fi
- # X makedepend
- shift
- cleared=no
- for arg in "$@"; do
- case $cleared in
- no)
- set ""; shift
- cleared=yes ;;
- esac
- case "$arg" in
- -D*|-I*)
- set fnord "$@" "$arg"; shift ;;
- # Strip any option that makedepend may not understand. Remove
- # the object too, otherwise makedepend will parse it as a source file.
- -*|$object)
- ;;
- *)
- set fnord "$@" "$arg"; shift ;;
- esac
- done
- obj_suffix="`echo $object | sed 's/^.*\././'`"
- touch "$tmpdepfile"
- ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
- rm -f "$depfile"
- cat < "$tmpdepfile" > "$depfile"
- sed '1,2d' "$tmpdepfile" | tr ' ' '
-' | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile" "$tmpdepfile".bak
- ;;
-
-cpp)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test $1 != '--mode=compile'; do
- shift
- done
- shift
- fi
-
- # Remove `-o $object'.
- IFS=" "
- for arg
- do
- case $arg in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift # fnord
- shift # $arg
- ;;
- esac
- done
-
- "$@" -E |
- sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
- sed '$ s: \\$::' > "$tmpdepfile"
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- cat < "$tmpdepfile" >> "$depfile"
- sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-msvisualcpp)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout, regardless of -o,
- # because we must use -o when running libtool.
- "$@" || exit $?
- IFS=" "
- for arg
- do
- case "$arg" in
- "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
- set fnord "$@"
- shift
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift
- shift
- ;;
- esac
- done
- "$@" -E |
- sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
- echo " " >> "$depfile"
- . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-none)
- exec "$@"
- ;;
-
-*)
- echo "Unknown depmode $depmode" 1>&2
- exit 1
- ;;
-esac
-
-exit 0
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
diff --git a/contrib/llvm/autoconf/install-sh b/contrib/llvm/autoconf/install-sh
deleted file mode 100755
index dd97db7..0000000
--- 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 06823e0..0000000
--- 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 <gord@gnu.ai.mit.edu>, 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 <<EOF
-$*
-EOF
- exit $EXIT_SUCCESS
-fi
-
-default_mode=
-help="Try \`$progname --help' for more information."
-magic="%%%MAGIC variable%%%"
-mkdir="mkdir"
-mv="mv -f"
-rm="rm -f"
-
-# 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'
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
- # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
- SP2NL='tr \040 \012'
- NL2SP='tr \015\012 \040\040'
- ;;
- *) # EBCDIC based system
- SP2NL='tr \100 \n'
- NL2SP='tr \r\n \100\100'
- ;;
-esac
-
-# NLS nuisances.
-# Only set LANG and LC_ALL to C if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-# We save the old values to restore during execute mode.
-if test "${LC_ALL+set}" = set; then
- save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
-fi
-if test "${LANG+set}" = set; then
- save_LANG="$LANG"; LANG=C; export LANG
-fi
-
-# Make sure IFS has a sensible default
-lt_nl='
-'
-IFS=" $lt_nl"
-
-if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
- $echo "$modename: not configured to build any kind of library" 1>&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 <<EOF
-# $libobj - a libtool object file
-# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# Name of the PIC object.
-EOF
-
- # Only build a PIC object if we are building libtool libraries.
- if test "$build_libtool_libs" = yes; then
- # Without this assignment, base_compile gets emptied.
- fbsd_hideous_sh_bug=$base_compile
-
- if test "$pic_mode" != no; then
- command="$base_compile $qsrcfile $pic_flag"
- else
- # Don't build PIC code
- command="$base_compile $qsrcfile"
- fi
-
- if test ! -d "${xdir}$objdir"; then
- $show "$mkdir ${xdir}$objdir"
- $run $mkdir ${xdir}$objdir
- exit_status=$?
- if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
- exit $exit_status
- fi
- fi
-
- if test -z "$output_obj"; then
- # Place PIC objects in $objdir
- command="$command -o $lobj"
- fi
-
- $run $rm "$lobj" "$output_obj"
-
- $show "$command"
- if $run eval "$command"; then :
- else
- test -n "$output_obj" && $run $rm $removelist
- exit $EXIT_FAILURE
- fi
-
- if test "$need_locks" = warn &&
- test "X`cat $lockfile 2>/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 <<EOF
-pic_object='$objdir/$objname'
-
-EOF
-
- # Allow error messages only from the first compilation.
- if test "$suppress_opt" = yes; then
- suppress_output=' >/dev/null 2>&1'
- fi
- else
- # No PIC object so indicate it doesn't exist in the libtool
- # object file.
- test -z "$run" && cat >> ${libobj}T <<EOF
-pic_object=none
-
-EOF
- fi
-
- # Only build a position-dependent object if we build old libraries.
- if test "$build_old_libs" = yes; then
- if test "$pic_mode" != yes; then
- # Don't build PIC code
- command="$base_compile $qsrcfile"
- else
- command="$base_compile $qsrcfile $pic_flag"
- fi
- if test "$compiler_c_o" = yes; then
- command="$command -o $obj"
- fi
-
- # Suppress compiler output if we already did a PIC compilation.
- command="$command$suppress_output"
- $run $rm "$obj" "$output_obj"
- $show "$command"
- if $run eval "$command"; then :
- else
- $run $rm $removelist
- exit $EXIT_FAILURE
- fi
-
- if test "$need_locks" = warn &&
- test "X`cat $lockfile 2>/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 <<EOF
-# Name of the non-PIC object.
-non_pic_object='$objname'
-
-EOF
- else
- # 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 <<EOF
-# Name of the non-PIC object.
-non_pic_object=none
-
-EOF
- fi
-
- $run $mv "${libobj}T" "${libobj}"
-
- # Unlock the critical section if it was locked
- if test "$need_locks" != no; then
- $run $rm "$lockfile"
- fi
-
- exit $EXIT_SUCCESS
- ;;
-
- # libtool link mode
- link | relink)
- modename="$modename: link"
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
- # It is impossible to link a dll without this setting, and
- # we shouldn't force the makefile maintainer to figure out
- # which system we are compiling for in order to pass an extra
- # flag for every libtool invocation.
- # allow_undefined=no
-
- # FIXME: Unfortunately, there are problems with the above when trying
- # to make a dll which has undefined symbols, in which case not
- # even a static library is built. For now, we need to specify
- # -no-undefined on the libtool link line when we can be certain
- # that all symbols are satisfied, otherwise we get a static library.
- allow_undefined=yes
- ;;
- *)
- allow_undefined=yes
- ;;
- esac
- libtool_args="$nonopt"
- base_compile="$nonopt $@"
- compile_command="$nonopt"
- finalize_command="$nonopt"
-
- compile_rpath=
- finalize_rpath=
- compile_shlibpath=
- finalize_shlibpath=
- convenience=
- old_convenience=
- deplibs=
- old_deplibs=
- compiler_flags=
- linker_flags=
- dllsearchpath=
- lib_search_path=`pwd`
- inst_prefix_dir=
-
- avoid_version=no
- dlfiles=
- dlprefiles=
- dlself=no
- export_dynamic=no
- export_symbols=
- export_symbols_regex=
- generated=
- libobjs=
- ltlibs=
- module=no
- no_install=no
- objs=
- non_pic_objects=
- notinst_path= # paths that contain not-installed libtool libraries
- precious_files_regex=
- prefer_static_libs=no
- preload=no
- prev=
- prevarg=
- release=
- rpath=
- xrpath=
- perm_rpath=
- temp_rpath=
- thread_safe=no
- vinfo=
- vinfo_number=no
-
- func_infer_tag $base_compile
-
- # We need to know -static, to get the right output filenames.
- for arg
- do
- case $arg in
- -all-static | -static)
- if test "X$arg" = "X-all-static"; then
- if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
- $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&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 <<EOF
- int main() { return 0; }
-EOF
- $rm conftest
- $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
- if test "$?" -eq 0 ; then
- ldd_output=`ldd conftest`
- for i in $deplibs; do
- name=`expr $i : '-l\(.*\)'`
- # If $name is empty we are operating on a -L argument.
- if test "$name" != "" && test "$name" -ne "0"; then
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $i "*)
- newdeplibs="$newdeplibs $i"
- i=""
- ;;
- esac
- fi
- if test -n "$i" ; then
- libname=`eval \\$echo \"$libname_spec\"`
- deplib_matches=`eval \\$echo \"$library_names_spec\"`
- set dummy $deplib_matches
- deplib_match=$2
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- newdeplibs="$newdeplibs $i"
- else
- droppeddeps=yes
- $echo
- $echo "*** Warning: dynamic linker does not accept needed library $i."
- $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 I believe you do not have"
- $echo "*** because a test_compile did reveal that the linker did not use it for"
- $echo "*** its dynamic dependency list that programs get resolved with at runtime."
- fi
- fi
- else
- newdeplibs="$newdeplibs $i"
- fi
- done
- else
- # Error occurred in the first compile. Let's try to salvage
- # the situation: Compile a separate program for each library.
- for i in $deplibs; do
- name=`expr $i : '-l\(.*\)'`
- # If $name is empty we are operating on a -L argument.
- if test "$name" != "" && test "$name" != "0"; then
- $rm conftest
- $LTCC $LTCFLAGS -o conftest conftest.c $i
- # Did it work?
- if test "$?" -eq 0 ; then
- ldd_output=`ldd conftest`
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $i "*)
- newdeplibs="$newdeplibs $i"
- i=""
- ;;
- esac
- fi
- if test -n "$i" ; then
- libname=`eval \\$echo \"$libname_spec\"`
- deplib_matches=`eval \\$echo \"$library_names_spec\"`
- set dummy $deplib_matches
- deplib_match=$2
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- newdeplibs="$newdeplibs $i"
- else
- droppeddeps=yes
- $echo
- $echo "*** Warning: dynamic linker does not accept needed library $i."
- $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 a test_compile did reveal that the linker did not use this one"
- $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
- fi
- fi
- else
- droppeddeps=yes
- $echo
- $echo "*** Warning! Library $i is needed by this library but I was not able to"
- $echo "*** make it link in! You will probably need to install it or some"
- $echo "*** library that it depends on before this library will be fully"
- $echo "*** functional. Installing it before continuing would be even better."
- fi
- else
- newdeplibs="$newdeplibs $i"
- fi
- done
- fi
- ;;
- file_magic*)
- set dummy $deplibs_check_method
- file_magic_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 "$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
- # 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 >/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 <<EOF
-
-/* $cwrappersource - temporary wrapper executable 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 executable should never be moved out of the build directory.
- If it is, it will not operate correctly.
-
- Currently, it simply execs the wrapper *script* "/bin/sh $output",
- but could eventually absorb all of the scripts functionality and
- exec $objdir/$outputname directly.
-*/
-EOF
- cat >> $cwrappersource<<"EOF"
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <malloc.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/stat.h>
-
-#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 <<EOF
- newargz[0] = (char *) xstrdup("$SHELL");
-EOF
-
- cat >> $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<argc+1; i++)
- {
- DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
- ;
- }
-
-EOF
-
- case $host_os in
- mingw*)
- cat >> $cwrappersource <<EOF
- execv("$SHELL",(char const **)newargz);
-EOF
- ;;
- *)
- cat >> $cwrappersource <<EOF
- execv("$SHELL",newargz);
-EOF
- ;;
- esac
-
- cat >> $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 <bug-libtool@gnu.org>."
- 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 1bdecc1..0000000
--- 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 61bac8c..0000000
--- 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 <stdio.h>
-#include <stdlib.h>
-]],[[
-volatile double A, B;
-char Buffer[100];
-A = 1;
-A /= 10.0;
-sprintf(Buffer, "%a", A);
-B = atof(Buffer);
-if (A != B)
- return (1);
-if (A != 0x1.999999999999ap-4)
- return (1);
-return (0);]])],
- llvm_cv_c_printf_a=yes,
- llvmac_cv_c_printf_a=no,
- llvmac_cv_c_printf_a=no)
- AC_LANG_POP([C])])
- if test "$llvm_cv_c_printf_a" = "yes"; then
- AC_DEFINE([HAVE_PRINTF_A],[1],[Define to have the %a format string])
- fi
-])
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 7355e1c..0000000
--- 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 b1eaffd..0000000
--- 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 eea7faf..0000000
--- 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 ab09f2a..0000000
--- 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 c789df8..0000000
--- 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 c936bf9..0000000
--- 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], [<math.h>],
- [float f; isinf(f);])
-if test "$ac_cv_func_isinf_in_math_h" = "yes" ; then
- AC_DEFINE([HAVE_ISINF_IN_MATH_H],1,[Set to 1 if the isinf function is found in <math.h>])
-fi
-
-AC_SINGLE_CXX_CHECK([ac_cv_func_isinf_in_cmath],
- [isinf], [<cmath>],
- [float f; isinf(f);])
-if test "$ac_cv_func_isinf_in_cmath" = "yes" ; then
- AC_DEFINE([HAVE_ISINF_IN_CMATH],1,[Set to 1 if the isinf function is found in <cmath>])
-fi
-
-AC_SINGLE_CXX_CHECK([ac_cv_func_std_isinf_in_cmath],
- [std::isinf], [<cmath>],
- [float f; std::isinf(f)}])
-if test "$ac_cv_func_std_isinf_in_cmath" = "yes" ; then
- AC_DEFINE([HAVE_STD_ISINF_IN_CMATH],1,[Set to 1 if the std::isinf function is found in <cmath>])
-fi
-
-AC_SINGLE_CXX_CHECK([ac_cv_func_finite_in_ieeefp_h],
- [finite], [<ieeefp.h>],
- [float f; finite(f);])
-if test "$ac_cv_func_finite_in_ieeefp_h" = "yes" ; then
- AC_DEFINE([HAVE_FINITE_IN_IEEEFP_H],1,[Set to 1 if the finite function is found in <ieeefp.h>])
-fi
-
-])
-
-
diff --git a/contrib/llvm/autoconf/m4/func_isnan.m4 b/contrib/llvm/autoconf/m4/func_isnan.m4
deleted file mode 100644
index eb5ca0d..0000000
--- 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], [<math.h>],
- [float f; isnan(f);])
-
-if test "$ac_cv_func_isnan_in_math_h" = "yes" ; then
- AC_DEFINE([HAVE_ISNAN_IN_MATH_H],1,[Set to 1 if the isnan function is found in <math.h>])
-fi
-
-AC_SINGLE_CXX_CHECK([ac_cv_func_isnan_in_cmath],
- [isnan], [<cmath>],
- [float f; isnan(f);])
-if test "$ac_cv_func_isnan_in_cmath" = "yes" ; then
- AC_DEFINE([HAVE_ISNAN_IN_CMATH],1,[Set to 1 if the isnan function is found in <cmath>])
-fi
-
-AC_SINGLE_CXX_CHECK([ac_cv_func_std_isnan_in_cmath],
- [std::isnan], [<cmath>],
- [float f; std::isnan(f);])
-if test "$ac_cv_func_std_isnan_in_cmath" = "yes" ; then
- AC_DEFINE([HAVE_STD_ISNAN_IN_CMATH],1,[Set to 1 if the std::isnan function is found in <cmath>])
-fi
-])
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 372c87f..0000000
--- 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 <sys/types.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-]],[[
- int fd;
- fd = creat ("foo",0777);
- fd = (int) mmap (0, 1, PROT_READ, MAP_SHARED, fd, 0);
- unlink ("foo");
- return (fd != (int) MAP_FAILED);]])],
- [ac_cv_func_mmap_file=yes],[ac_cv_func_mmap_file=no],[ac_cv_func_mmap_file=no])
- AC_LANG_POP([C])
-])
-if test "$ac_cv_func_mmap_file" = yes; then
- AC_DEFINE([HAVE_MMAP_FILE],[],[Define if mmap() can map files into memory])
- AC_SUBST(MMAP_FILE,[yes])
-fi
-])
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 2270d29..0000000
--- 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 <sys/mman.h>
-#include <unistd.h>
-#include <fcntl.h>]],
- [[mmap (0, 1, PROT_READ, MAP_ANONYMOUS, -1, 0); return (0);]])],
- ac_cv_header_mmap_anon=yes,
- ac_cv_header_mmap_anon=no)
- AC_LANG_POP([C])
-])
-if test "$ac_cv_header_mmap_anon" = yes; then
- AC_DEFINE([HAVE_MMAP_ANONYMOUS],[1],[Define if mmap() uses MAP_ANONYMOUS to map anonymous pages, or undefine if it uses MAP_ANON])
-fi
-])
diff --git a/contrib/llvm/autoconf/m4/huge_val.m4 b/contrib/llvm/autoconf/m4/huge_val.m4
deleted file mode 100644
index 5fffbfc..0000000
--- 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 <math.h>],
- [double x = HUGE_VAL; return x != x; ]),
- [ac_cv_huge_val_sanity=yes],[ac_cv_huge_val_sanity=no],
- [ac_cv_huge_val_sanity=yes])
- CXXFLAGS=$ac_save_CXXFLAGS
- AC_LANG_POP([C++])
- ])
- AC_SUBST(HUGE_VAL_SANITY,$ac_cv_huge_val_sanity)
-])
diff --git a/contrib/llvm/autoconf/m4/libtool.m4 b/contrib/llvm/autoconf/m4/libtool.m4
deleted file mode 100644
index a8b5e6a..0000000
--- 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 <gord@gnu.ai.mit.edu>, 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 <<EOF
-[$]*
-EOF
- exit 0
-fi
-
-# 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
-
-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 <<EOF
-[#line __oline__ "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#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<name>.so
- # instead of lib<name>.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 <<EOF 1>&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 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- AC_MSG_RESULT($LD)
-else
- AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-AC_PROG_LD_GNU
-])# AC_PROG_LD
-
-
-# AC_PROG_LD_GNU
-# --------------
-AC_DEFUN([AC_PROG_LD_GNU],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac])
-with_gnu_ld=$lt_cv_prog_gnu_ld
-])# AC_PROG_LD_GNU
-
-
-# AC_PROG_LD_RELOAD_FLAG
-# ----------------------
-# find reload flag for linker
-# -- PORTME Some linkers may need a different reload flag.
-AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
-[AC_CACHE_CHECK([for $LD option to reload object files],
- lt_cv_ld_reload_flag,
- [lt_cv_ld_reload_flag='-r'])
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
- darwin*)
- if test "$GCC" = yes; then
- reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r $compiler_flags -o $output$reload_objs'
- else
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- fi
- ;;
-esac
-])# AC_PROG_LD_RELOAD_FLAG
-
-
-# AC_DEPLIBS_CHECK_METHOD
-# -----------------------
-# how to check for library dependencies
-# -- PORTME fill in with the dynamic library characteristics
-AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
-[AC_CACHE_CHECK([how to recognise dependent libraries],
-lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix4* | aix5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-beos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-bsdi[[45]]*)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=/shlib/libc.so
- ;;
-
-cygwin*)
- # func_win32_libid is a shell function defined in ltmain.sh
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- ;;
-
-mingw* | pw32*)
- # Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump'.
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- ;;
-
-darwin* | rhapsody*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-freebsd* | kfreebsd*-gnu | dragonfly*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /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 <jrb3@best.com> 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 <<EOF
-int a;
-void foo (void) { a = 0; }
-EOF
-],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
-class Foo
-{
-public:
- Foo (void) { a = 0; }
-private:
- int a;
-};
-EOF
-],[$1],[F77],[cat > conftest.$ac_ext <<EOF
- subroutine foo
- implicit none
- integer*4 a
- a=0
- return
- end
-EOF
-],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
-public class foo {
- private int a;
- public void bar (void) {
- a = 0;
- }
-};
-EOF
-])
-dnl Parse the compiler output and extract the necessary
-dnl objects, libraries and library flags.
-if AC_TRY_EVAL(ac_compile); then
- # Parse the compiler output and extract the necessary
- # objects, libraries and library flags.
-
- # Sentinel used to keep track of whether or not we are before
- # the conftest object file.
- pre_test_object_deps_done=no
-
- # The `*' in the case matches for architectures that use `case' in
- # $output_verbose_cmd can trigger glob expansion during the loop
- # eval without this substitution.
- output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
-
- for p in `eval $output_verbose_link_cmd`; do
- case $p in
-
- -L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
- # Remove the space.
- if test $p = "-L" \
- || test $p = "-R"; then
- prev=$p
- continue
- else
- prev=
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- case $p in
- -L* | -R*)
- # Internal compiler library paths should come after those
- # provided the user. The postdeps already come after the
- # user supplied libs so there is no need to process them.
- if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
- _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
- else
- _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
- fi
- ;;
- # The "-l" case would never come before the object being
- # linked, so don't bother handling this case.
- esac
- else
- if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
- _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
- else
- _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
- fi
- fi
- ;;
-
- *.$objext)
- # This assumes that the test object file only shows up
- # once in the compiler output.
- if test "$p" = "conftest.$objext"; then
- pre_test_object_deps_done=yes
- continue
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
- _LT_AC_TAGVAR(predep_objects, $1)="$p"
- else
- _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
- fi
- else
- if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
- _LT_AC_TAGVAR(postdep_objects, $1)="$p"
- else
- _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
- fi
- fi
- ;;
-
- *) ;; # Ignore the rest.
-
- esac
- done
-
- # Clean up.
- rm -f a.out a.exe
-else
- echo "libtool.m4: error: problem compiling $1 test program"
-fi
-
-$rm -f confest.$objext
-
-# PORTME: override above test on systems where it is broken
-ifelse([$1],[CXX],
-[case $host_os in
-interix3*)
- # Interix 3.5 installs completely hosed .la files for C++, so rather than
- # hack all around it, let's just trust "g++" to DTRT.
- _LT_AC_TAGVAR(predep_objects,$1)=
- _LT_AC_TAGVAR(postdep_objects,$1)=
- _LT_AC_TAGVAR(postdeps,$1)=
- ;;
-
-solaris*)
- case $cc_basename in
- CC*)
- # Adding this requires a known-good setup of shared libraries for
- # Sun compiler versions before 5.6, else PIC objects from an old
- # archive will be linked into the output, leading to subtle bugs.
- _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
- ;;
- esac
- ;;
-esac
-])
-
-case " $_LT_AC_TAGVAR(postdeps, $1) " in
-*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
-esac
-])# AC_LIBTOOL_POSTDEP_PREDEP
-
-# AC_LIBTOOL_LANG_F77_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_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
-AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
-[AC_REQUIRE([AC_PROG_F77])
-AC_LANG_PUSH(Fortran 77)
-
-_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_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
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code=" subroutine t\n return\n end\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code=" program t\n end\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"
-CC=${F77-"f77"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-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])
-
-_LT_AC_TAGVAR(GCC, $1)="$G77"
-_LT_AC_TAGVAR(LD, $1)="$LD"
-
-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"
-])# AC_LIBTOOL_LANG_F77_CONFIG
-
-
-# AC_LIBTOOL_LANG_GCJ_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_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
-AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
-[AC_LANG_PUSH(C)
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\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"
-CC=${GCJ-"gcj"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-
-## 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_CONFIG($1)
-
-AC_LANG_POP([])
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_GCJ_CONFIG
-
-
-# AC_LIBTOOL_LANG_RC_CONFIG
-# -------------------------
-# Ensure that the configuration vars for the Windows resource 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_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
-AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
-[AC_LANG_PUSH(C)
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# 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"
-CC=${RC-"windres"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP([])
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_RC_CONFIG
-
-
-# AC_LIBTOOL_CONFIG([TAGNAME])
-# ----------------------------
-# If TAGNAME is not passed, then create an initial libtool script
-# with a default configuration from the untagged config vars. Otherwise
-# add code to config.status for appending the configuration named by
-# TAGNAME from the matching tagged config vars.
-AC_DEFUN([AC_LIBTOOL_CONFIG],
-[# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # 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
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- _LT_AC_TAGVAR(compiler, $1) \
- _LT_AC_TAGVAR(CC, $1) \
- _LT_AC_TAGVAR(LD, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
- _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
- _LT_AC_TAGVAR(old_archive_cmds, $1) \
- _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
- _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) \
- _LT_AC_TAGVAR(archive_cmds, $1) \
- _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
- _LT_AC_TAGVAR(postinstall_cmds, $1) \
- _LT_AC_TAGVAR(postuninstall_cmds, $1) \
- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
- _LT_AC_TAGVAR(allow_undefined_flag, $1) \
- _LT_AC_TAGVAR(no_undefined_flag, $1) \
- _LT_AC_TAGVAR(export_symbols_cmds, $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_automatic, $1) \
- _LT_AC_TAGVAR(module_cmds, $1) \
- _LT_AC_TAGVAR(module_expsym_cmds, $1) \
- _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
- _LT_AC_TAGVAR(exclude_expsyms, $1) \
- _LT_AC_TAGVAR(include_expsyms, $1); do
-
- case $var in
- _LT_AC_TAGVAR(old_archive_cmds, $1) | \
- _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
- _LT_AC_TAGVAR(archive_cmds, $1) | \
- _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
- _LT_AC_TAGVAR(module_cmds, $1) | \
- _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
- _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\[$]0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
- ;;
- esac
-
-ifelse([$1], [],
- [cfgfile="${ofile}T"
- trap "$rm \"$cfgfile\"; exit 1" 1 2 15
- $rm -f "$cfgfile"
- AC_MSG_NOTICE([creating $ofile])],
- [cfgfile="$ofile"])
-
- cat <<__EOF__ >> "$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 <gord@gnu.ai.mit.edu>, 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 <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
-
- if AC_TRY_EVAL(ac_compile); then
- # Now try to grab the symbols.
- nlist=conftest.nm
- if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $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 <<EOF > 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 <<EOF >> 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 <<EOF 1>&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 <kc5tja@dolphin.openprojects.net> 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 <jrb3@best.com> 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 <<EOF 1>&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 <windows.h>
-# #undef WIN32_LEAN_AND_MEAN
-# #include <stdio.h>
-#
-# #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 <cygwin/cygwin_dll.h>
-# 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 4c5f2f4..0000000
--- 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<path> option],[llvm_cv_link_use_r],
-[ AC_LANG_PUSH([C])
- oldcflags="$CFLAGS"
- CFLAGS="$CFLAGS -Wl,-R."
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
- [llvm_cv_link_use_r=yes],[llvm_cv_link_use_r=no])
- CFLAGS="$oldcflags"
- AC_LANG_POP([C])
-])
-if test "$llvm_cv_link_use_r" = yes ; then
- AC_DEFINE([HAVE_LINK_R],[1],[Define if you can use -Wl,-R. to pass -R. to the linker, in order to add the current directory to the dynamic linker search path.])
- fi
-])
-
-#
-# Determine if the system can handle the -R option being passed to the linker.
-#
-# This macro is specific to LLVM.
-#
-AC_DEFUN([AC_LINK_EXPORT_DYNAMIC],
-[AC_CACHE_CHECK([for compiler -Wl,-export-dynamic option],
- [llvm_cv_link_use_export_dynamic],
-[ AC_LANG_PUSH([C])
- oldcflags="$CFLAGS"
- CFLAGS="$CFLAGS -Wl,-export-dynamic"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
- [llvm_cv_link_use_export_dynamic=yes],[llvm_cv_link_use_export_dynamic=no])
- CFLAGS="$oldcflags"
- AC_LANG_POP([C])
-])
-if test "$llvm_cv_link_use_export_dynamic" = yes ; then
- AC_DEFINE([HAVE_LINK_EXPORT_DYNAMIC],[1],[Define if you can use -Wl,-export-dynamic.])
- fi
-])
-
-#
-# Determine if the system can handle the --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 123491f..0000000
--- 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 bc9e2ad..0000000
--- 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 <dlfcn.h>
-#endif
- ]], [[dlopen(0, 0);]])],[AC_DEFINE([HAVE_LIBDL], [1],
- [Define if you have the libdl library or equivalent.]) libltdl_cv_func_dlopen="yes"],[AC_CHECK_LIB([svld], [dlopen],
- [AC_DEFINE([HAVE_LIBDL], [1],
- [Define if you have the libdl library or equivalent.])
- LIBADD_DL="-lsvld" libltdl_cv_func_dlopen="yes"],
- [AC_CHECK_LIB([dld], [dld_link],
- [AC_DEFINE([HAVE_DLD], [1],
- [Define if you have the GNU dld library.])
- LIBADD_DL="$LIBADD_DL -ldld"],
- [AC_CHECK_FUNC([_dyld_func_lookup],
- [AC_DEFINE([HAVE_DYLD], [1],
- [Define if you have the _dyld_func_lookup function.])])
- ])
- ])
- ])
- ])
- ])
-])
-
-if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes
-then
- lt_save_LIBS="$LIBS"
- LIBS="$LIBS $LIBADD_DL"
- AC_CHECK_FUNCS([dlerror])
- LIBS="$lt_save_LIBS"
-fi
-AC_LANG_POP
-])# AC_LTDL_DLLIB
-
-
-# AC_LTDL_SYMBOL_USCORE
-# ---------------------
-# does the compiler prefix global symbols with an underscore?
-AC_DEFUN([AC_LTDL_SYMBOL_USCORE],
-[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])
-AC_CACHE_CHECK([for _ prefix in compiled symbols],
- [ac_cv_sys_symbol_underscore],
- [ac_cv_sys_symbol_underscore=no
- cat > conftest.$ac_ext <<EOF
-void nm_test_func(){}
-int main(){nm_test_func;return 0;}
-EOF
- if AC_TRY_EVAL(ac_compile); then
- # Now try to grab the symbols.
- ac_nlist=conftest.nm
- if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
- # See whether the symbols have a leading underscore.
- if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
- ac_cv_sys_symbol_underscore=yes
- else
- if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
- :
- else
- echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD
- fi
- fi
- else
- echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
- cat conftest.c >&AS_MESSAGE_LOG_FD
- fi
- rm -rf conftest*
- ])
-])# AC_LTDL_SYMBOL_USCORE
-
-
-# AC_LTDL_DLSYM_USCORE
-# --------------------
-AC_DEFUN([AC_LTDL_DLSYM_USCORE],
-[AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])
-if test x"$ac_cv_sys_symbol_underscore" = xyes; then
- if test x"$libltdl_cv_func_dlopen" = xyes ||
- test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then
- AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
- [libltdl_cv_need_uscore],
- [libltdl_cv_need_uscore=unknown
- save_LIBS="$LIBS"
- LIBS="$LIBS $LIBADD_DL"
- _LT_AC_TRY_DLOPEN_SELF(
- [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes],
- [], [libltdl_cv_need_uscore=cross])
- LIBS="$save_LIBS"
- ])
- fi
-fi
-
-if test x"$libltdl_cv_need_uscore" = xyes; then
- AC_DEFINE([NEED_USCORE], [1],
- [Define if dlsym() requires a leading underscore in symbol names.])
-fi
-])# AC_LTDL_DLSYM_USCORE
-
-# AC_LTDL_FUNC_ARGZ
-# -----------------
-AC_DEFUN([AC_LTDL_FUNC_ARGZ],
-[AC_CHECK_HEADERS([argz.h])
-
-AC_CHECK_TYPES([error_t],
- [],
- [AC_DEFINE([error_t], [int],
- [Define to a type to use for `error_t' if it is not otherwise available.])],
- [#if HAVE_ARGZ_H
-# include <argz.h>
-#endif])
-
-AC_CHECK_FUNCS([argz_append argz_create_sep argz_insert argz_next argz_stringify])
-])# AC_LTDL_FUNC_ARGZ
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 57b3228..0000000
--- 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 406656c..0000000
--- 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 85433de..0000000
--- 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 56705d8..0000000
--- 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], [<stdlib.h>],
- [srand48(0);lrand48();drand48();])
-if test "$ac_cv_func_rand48" = "yes" ; then
-AC_DEFINE([HAVE_RAND48],1,[Define to 1 if srand48/lrand48/drand48 exist in <stdlib.h>])
-fi
-])
diff --git a/contrib/llvm/autoconf/m4/sanity_check.m4 b/contrib/llvm/autoconf/m4/sanity_check.m4
deleted file mode 100644
index 639fccc..0000000
--- 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 21efa4b..0000000
--- 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 42ddbe9..0000000
--- 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 64b5f90..0000000
--- 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 <pinard@iro.umontreal.ca>, 1996.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-if test $# -eq 0; then
- echo 1>&2 "Try \`$0 --help' for more information"
- exit 1
-fi
-
-run=:
-
-# In the cases where this matters, `missing' is being run in the
-# srcdir already.
-if test -f configure.ac; then
- configure_ac=configure.ac
-else
- configure_ac=configure.in
-fi
-
-msg="missing on your system"
-
-case "$1" in
---run)
- # Try to run requested program, and just exit if it succeeds.
- run=
- shift
- "$@" && exit 0
- # Exit code 63 means version mismatch. This often happens
- # when the user try to use an ancient version of a tool on
- # a file that requires a minimum version. In this case we
- # we should proceed has if the program had been absent, or
- # if --run hadn't been passed.
- if test $? = 63; then
- run=:
- msg="probably too old"
- fi
- ;;
-
- -h|--h|--he|--hel|--help)
- echo "\
-$0 [OPTION]... PROGRAM [ARGUMENT]...
-
-Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
-error status if there is no known handling for PROGRAM.
-
-Options:
- -h, --help display this help and exit
- -v, --version output version information and exit
- --run try to run the given command, and emulate it if it fails
-
-Supported PROGRAM values:
- aclocal touch file \`aclocal.m4'
- autoconf touch file \`configure'
- autoheader touch file \`config.h.in'
- automake touch all \`Makefile.in' files
- bison create \`y.tab.[ch]', if possible, from existing .[ch]
- flex create \`lex.yy.c', if possible, from existing .c
- help2man touch the output file
- lex create \`lex.yy.c', if possible, from existing .c
- makeinfo touch the output file
- tar try tar, gnutar, gtar, then tar without non-portable flags
- yacc create \`y.tab.[ch]', if possible, from existing .[ch]
-
-Send bug reports to <bug-automake@gnu.org>."
- exit 0
- ;;
-
- -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
- echo "missing $scriptversion (GNU Automake)"
- exit 0
- ;;
-
- -*)
- echo 1>&2 "$0: Unknown \`$1' option"
- echo 1>&2 "Try \`$0 --help' for more information"
- exit 1
- ;;
-
-esac
-
-# Now exit if we have it, but it failed. Also exit now if we
-# don't have it and --version was passed (most likely to detect
-# the program).
-case "$1" in
- lex|yacc)
- # Not GNU programs, they don't have --version.
- ;;
-
- tar)
- if test -n "$run"; then
- echo 1>&2 "ERROR: \`tar' requires --run"
- exit 1
- elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
- exit 1
- fi
- ;;
-
- *)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
- # Could not run --version or --help. This is probably someone
- # running `$TOOL --version' or `$TOOL --help' to check whether
- # $TOOL exists and not knowing $TOOL uses missing.
- exit 1
- fi
- ;;
-esac
-
-# If it does not exist, or fails to run (possibly an outdated version),
-# try to emulate it.
-case "$1" in
- aclocal*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`acinclude.m4' or \`${configure_ac}'. You might want
- to install the \`Automake' and \`Perl' packages. Grab them from
- any GNU archive site."
- touch aclocal.m4
- ;;
-
- autoconf)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`${configure_ac}'. You might want to install the
- \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
- archive site."
- touch configure
- ;;
-
- autoheader)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`acconfig.h' or \`${configure_ac}'. You might want
- to install the \`Autoconf' and \`GNU m4' packages. Grab them
- from any GNU archive site."
- files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
- test -z "$files" && files="config.h"
- touch_files=
- for f in $files; do
- case "$f" in
- *:*) touch_files="$touch_files "`echo "$f" |
- sed -e 's/^[^:]*://' -e 's/:.*//'`;;
- *) touch_files="$touch_files $f.in";;
- esac
- done
- touch $touch_files
- ;;
-
- automake*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
- You might want to install the \`Automake' and \`Perl' packages.
- Grab them from any GNU archive site."
- find . -type f -name Makefile.am -print |
- sed 's/\.am$/.in/' |
- while read f; do touch "$f"; done
- ;;
-
- autom4te)
- echo 1>&2 "\
-WARNING: \`$1' is needed, but is $msg.
- You might have modified some files without having the
- proper tools for further handling them.
- You can get \`$1' as part of \`Autoconf' from any GNU
- archive site."
-
- file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
- test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
- if test -f "$file"; then
- touch $file
- else
- test -z "$file" || exec >$file
- echo "#! /bin/sh"
- echo "# Created by GNU Automake missing as a replacement of"
- echo "# $ $@"
- echo "exit 0"
- chmod +x $file
- exit 1
- fi
- ;;
-
- bison|yacc)
- echo 1>&2 "\
-WARNING: \`$1' $msg. You should only need it if
- you modified a \`.y' file. You may need the \`Bison' package
- in order for those modifications to take effect. You can get
- \`Bison' from any GNU archive site."
- rm -f y.tab.c y.tab.h
- if [ $# -ne 1 ]; then
- eval LASTARG="\${$#}"
- case "$LASTARG" in
- *.y)
- SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
- if [ -f "$SRCFILE" ]; then
- cp "$SRCFILE" y.tab.c
- fi
- SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
- if [ -f "$SRCFILE" ]; then
- cp "$SRCFILE" y.tab.h
- fi
- ;;
- esac
- fi
- if [ ! -f y.tab.h ]; then
- echo >y.tab.h
- fi
- if [ ! -f y.tab.c ]; then
- echo 'main() { return 0; }' >y.tab.c
- fi
- ;;
-
- lex|flex)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified a \`.l' file. You may need the \`Flex' package
- in order for those modifications to take effect. You can get
- \`Flex' from any GNU archive site."
- rm -f lex.yy.c
- if [ $# -ne 1 ]; then
- eval LASTARG="\${$#}"
- case "$LASTARG" in
- *.l)
- SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
- if [ -f "$SRCFILE" ]; then
- cp "$SRCFILE" lex.yy.c
- fi
- ;;
- esac
- fi
- if [ ! -f lex.yy.c ]; then
- echo 'main() { return 0; }' >lex.yy.c
- fi
- ;;
-
- help2man)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified a dependency of a manual page. You may need the
- \`Help2man' package in order for those modifications to take
- effect. You can get \`Help2man' from any GNU archive site."
-
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
- if test -z "$file"; then
- file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
- fi
- if [ -f "$file" ]; then
- touch $file
- else
- test -z "$file" || exec >$file
- echo ".ab help2man is required to generate this page"
- exit 1
- fi
- ;;
-
- makeinfo)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified a \`.texi' or \`.texinfo' file, or any other file
- indirectly affecting the aspect of the manual. The spurious
- call might also be the consequence of using a buggy \`make' (AIX,
- DU, IRIX). You might want to install the \`Texinfo' package or
- the \`GNU make' package. Grab either from any GNU archive site."
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
- if test -z "$file"; then
- file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
- file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
- fi
- touch $file
- ;;
-
- tar)
- shift
-
- # We have already tried tar in the generic part.
- # Look for gnutar/gtar before invocation to avoid ugly error
- # messages.
- if (gnutar --version > /dev/null 2>&1); then
- gnutar "$@" && exit 0
- fi
- if (gtar --version > /dev/null 2>&1); then
- gtar "$@" && exit 0
- fi
- firstarg="$1"
- if shift; then
- case "$firstarg" in
- *o*)
- firstarg=`echo "$firstarg" | sed s/o//`
- tar "$firstarg" "$@" && exit 0
- ;;
- esac
- case "$firstarg" in
- *h*)
- firstarg=`echo "$firstarg" | sed s/h//`
- tar "$firstarg" "$@" && exit 0
- ;;
- esac
- fi
-
- echo 1>&2 "\
-WARNING: I can't seem to be able to run \`tar' with the given arguments.
- You may want to install GNU tar or Free paxutils, or check the
- command line arguments."
- exit 1
- ;;
-
- *)
- echo 1>&2 "\
-WARNING: \`$1' is needed, and is $msg.
- You might have modified some files without having the
- proper tools for further handling them. Check the \`README' file,
- it often tells you about the needed prerequisites for installing
- this package. You may also peek at any GNU archive site, in case
- some other package would contain this missing \`$1' program."
- exit 1
- ;;
-esac
-
-exit 0
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
diff --git a/contrib/llvm/autoconf/mkinstalldirs b/contrib/llvm/autoconf/mkinstalldirs
deleted file mode 100755
index 1ee2d58..0000000
--- 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 <friedman@prep.ai.mit.edu>
-# Created: 1993-05-16
-# Public domain.
-#
-# This file is maintained in Automake, please report
-# bugs to <bug-automake@gnu.org> or send patches to
-# <automake-patches@gnu.org>.
-
-errstatus=0
-dirmode=""
-
-usage="\
-Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
-
-Create each directory DIR (with mode MODE, if specified), including all
-leading file name components.
-
-Report bugs to <bug-automake@gnu.org>."
-
-# process command line arguments
-while test $# -gt 0 ; do
- case $1 in
- -h | --help | --h*) # -h for help
- echo "$usage"
- exit 0
- ;;
- -m) # -m PERM arg
- shift
- test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
- dirmode=$1
- shift
- ;;
- --version)
- echo "$0 $scriptversion"
- exit 0
- ;;
- --) # stop option processing
- shift
- break
- ;;
- -*) # unknown option
- echo "$usage" 1>&2
- exit 1
- ;;
- *) # first non-opt arg
- break
- ;;
- esac
-done
-
-for file
-do
- if test -d "$file"; then
- shift
- else
- break
- fi
-done
-
-case $# in
- 0) exit 0 ;;
-esac
-
-# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
-# mkdir -p a/c at the same time, both will detect that a is missing,
-# one will create a, then the other will try to create a and die with
-# a "File exists" error. This is a problem when calling mkinstalldirs
-# from a parallel make. We use --version in the probe to restrict
-# ourselves to GNU mkdir, which is thread-safe.
-case $dirmode in
- '')
- if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
- # echo "mkdir -p -- $*"
- exec mkdir -p -- "$@"
- else
- # On NextStep and OpenStep, the `mkdir' command does not
- # recognize any option. It will interpret all options as
- # directories to create, and then abort because `.' already
- # exists.
- test -d ./-p && rmdir ./-p
- test -d ./--version && rmdir ./--version
- fi
- ;;
- *)
- if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
- test ! -d ./--version; then
- # echo "mkdir -m $dirmode -p -- $*"
- exec mkdir -m "$dirmode" -p -- "$@"
- else
- # Clean up after NextStep and OpenStep mkdir.
- for d in ./-m ./-p ./--version "./$dirmode";
- do
- test -d $d && rmdir $d
- done
- fi
- ;;
-esac
-
-for file
-do
- set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
- shift
-
- pathcomp=
- for d
- do
- pathcomp="$pathcomp$d"
- case $pathcomp in
- -*) pathcomp=./$pathcomp ;;
- esac
-
- if test ! -d "$pathcomp"; then
- # echo "mkdir $pathcomp"
-
- mkdir "$pathcomp" || lasterr=$?
-
- if test ! -d "$pathcomp"; then
- errstatus=$lasterr
- else
- if test ! -z "$dirmode"; then
- # echo "chmod $dirmode $pathcomp"
- lasterr=""
- chmod "$dirmode" "$pathcomp" || lasterr=$?
-
- if test ! -z "$lasterr"; then
- errstatus=$lasterr
- fi
- fi
- fi
- fi
-
- pathcomp="$pathcomp/"
- done
-done
-
-exit $errstatus
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
diff --git a/contrib/llvm/bindings/Makefile b/contrib/llvm/bindings/Makefile
deleted file mode 100644
index c545b28..0000000
--- 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 7693cb2..0000000
--- 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 c51a503..0000000
--- 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 aa7b3f0..0000000
--- 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 f2a8637..0000000
--- 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<typename T> class SwigValueWrapper {
- T *tt;
-public:
- SwigValueWrapper() : tt(0) { }
- SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
- SwigValueWrapper(const T& t) : tt(new T(t)) { }
- ~SwigValueWrapper() { delete tt; }
- SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
- operator T&() const { return *tt; }
- T *operator&() { return tt; }
-private:
- SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
-};
-
-template <typename T> T SwigValueInit() {
- return T();
-}
-#endif
-
-/* -----------------------------------------------------------------------------
- * This section contains generic SWIG labels for method/variable
- * declarations/attributes, and other compiler dependent labels.
- * ----------------------------------------------------------------------------- */
-
-/* template workaround for compilers that cannot correctly implement the C++ standard */
-#ifndef SWIGTEMPLATEDISAMBIGUATOR
-# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
-# define SWIGTEMPLATEDISAMBIGUATOR template
-# elif defined(__HP_aCC)
-/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
-/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
-# define SWIGTEMPLATEDISAMBIGUATOR template
-# else
-# define SWIGTEMPLATEDISAMBIGUATOR
-# endif
-#endif
-
-/* inline attribute */
-#ifndef SWIGINLINE
-# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
-# define SWIGINLINE inline
-# else
-# define SWIGINLINE
-# endif
-#endif
-
-/* attribute recognised by some compilers to avoid 'unused' warnings */
-#ifndef SWIGUNUSED
-# if defined(__GNUC__)
-# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-# define SWIGUNUSED __attribute__ ((__unused__))
-# else
-# define SWIGUNUSED
-# endif
-# elif defined(__ICC)
-# define SWIGUNUSED __attribute__ ((__unused__))
-# else
-# define SWIGUNUSED
-# endif
-#endif
-
-#ifndef SWIGUNUSEDPARM
-# ifdef __cplusplus
-# define SWIGUNUSEDPARM(p)
-# else
-# define SWIGUNUSEDPARM(p) p SWIGUNUSED
-# endif
-#endif
-
-/* internal SWIG method */
-#ifndef SWIGINTERN
-# define SWIGINTERN static SWIGUNUSED
-#endif
-
-/* internal inline SWIG method */
-#ifndef SWIGINTERNINLINE
-# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
-#endif
-
-/* exporting methods */
-#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-# ifndef GCC_HASCLASSVISIBILITY
-# define GCC_HASCLASSVISIBILITY
-# endif
-#endif
-
-#ifndef SWIGEXPORT
-# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-# if defined(STATIC_LINKED)
-# define SWIGEXPORT
-# else
-# define SWIGEXPORT __declspec(dllexport)
-# endif
-# else
-# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
-# define SWIGEXPORT __attribute__ ((visibility("default")))
-# else
-# define SWIGEXPORT
-# endif
-# endif
-#endif
-
-/* calling conventions for Windows */
-#ifndef SWIGSTDCALL
-# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-# define SWIGSTDCALL __stdcall
-# else
-# define SWIGSTDCALL
-# endif
-#endif
-
-/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
-#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
-# define _CRT_SECURE_NO_DEPRECATE
-#endif
-
-/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
-#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
-# define _SCL_SECURE_NO_DEPRECATE
-#endif
-
-
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#if defined(_WIN32) || defined(__CYGWIN32__)
-# define DllExport __declspec( dllexport )
-# define SWIGSTDCALL __stdcall
-#else
-# define DllExport
-# define SWIGSTDCALL
-#endif
-
-
-#ifdef __cplusplus
-# include <new>
-#endif
-
-
-
-
-/* Support for throwing Ada exceptions from C/C++ */
-
-typedef enum
-{
- SWIG_AdaException,
- SWIG_AdaOutOfMemoryException,
- SWIG_AdaIndexOutOfRangeException,
- SWIG_AdaDivideByZeroException,
- SWIG_AdaArgumentOutOfRangeException,
- SWIG_AdaNullReferenceException
-} SWIG_AdaExceptionCodes;
-
-
-typedef void (SWIGSTDCALL* SWIG_AdaExceptionCallback_t)(const char *);
-
-
-typedef struct
-{
- SWIG_AdaExceptionCodes code;
- SWIG_AdaExceptionCallback_t callback;
-}
- SWIG_AdaExceptions_t;
-
-
-static
-SWIG_AdaExceptions_t
-SWIG_ada_exceptions[] =
-{
- { SWIG_AdaException, NULL },
- { SWIG_AdaOutOfMemoryException, NULL },
- { SWIG_AdaIndexOutOfRangeException, NULL },
- { SWIG_AdaDivideByZeroException, NULL },
- { SWIG_AdaArgumentOutOfRangeException, NULL },
- { SWIG_AdaNullReferenceException, NULL }
-};
-
-
-static
-void
-SWIG_AdaThrowException (SWIG_AdaExceptionCodes code, const char *msg)
-{
- SWIG_AdaExceptionCallback_t callback = SWIG_ada_exceptions[SWIG_AdaException].callback;
- if (code >=0 && (size_t)code < sizeof(SWIG_ada_exceptions)/sizeof(SWIG_AdaExceptions_t)) {
- callback = SWIG_ada_exceptions[code].callback;
- }
- callback(msg);
-}
-
-
-
-#ifdef __cplusplus
-extern "C"
-#endif
-
-DllExport void SWIGSTDCALL SWIGRegisterExceptionCallbacks_LLVM_Analysis (SWIG_AdaExceptionCallback_t systemException,
- SWIG_AdaExceptionCallback_t outOfMemory,
- SWIG_AdaExceptionCallback_t indexOutOfRange,
- SWIG_AdaExceptionCallback_t divideByZero,
- SWIG_AdaExceptionCallback_t argumentOutOfRange,
- SWIG_AdaExceptionCallback_t nullReference)
-{
- SWIG_ada_exceptions [SWIG_AdaException].callback = systemException;
- SWIG_ada_exceptions [SWIG_AdaOutOfMemoryException].callback = outOfMemory;
- SWIG_ada_exceptions [SWIG_AdaIndexOutOfRangeException].callback = indexOutOfRange;
- SWIG_ada_exceptions [SWIG_AdaDivideByZeroException].callback = divideByZero;
- SWIG_ada_exceptions [SWIG_AdaArgumentOutOfRangeException].callback = argumentOutOfRange;
- SWIG_ada_exceptions [SWIG_AdaNullReferenceException].callback = nullReference;
-}
-
-
-/* Callback for returning strings to Ada without leaking memory */
-
-typedef char * (SWIGSTDCALL* SWIG_AdaStringHelperCallback)(const char *);
-static SWIG_AdaStringHelperCallback SWIG_ada_string_callback = NULL;
-
-
-
-/* probably obsolete ...
-#ifdef __cplusplus
-extern "C"
-#endif
-DllExport void SWIGSTDCALL SWIGRegisterStringCallback_LLVM_Analysis(SWIG_AdaStringHelperCallback callback) {
- SWIG_ada_string_callback = callback;
-}
-*/
-
-
-
-/* Contract support */
-
-#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_AdaThrowException(SWIG_AdaArgumentOutOfRangeException, msg); return nullreturn; } else
-
-
-#define protected public
-#define private public
-
-#include "llvm-c/Analysis.h"
-//#include "llvm-c/BitReader.h"
-//#include "llvm-c/BitWriter.h"
-//#include "llvm-c/Core.h"
-//#include "llvm-c/ExecutionEngine.h"
-//#include "llvm-c/LinkTimeOptimizer.h"
-//#include "llvm-c/lto.h"
-//#include "llvm-c/Target.h"
-
-
-
-// struct LLVMCtxt;
-
-
-#undef protected
-#undef private
-#ifdef __cplusplus
-extern "C" {
-#endif
-DllExport int SWIGSTDCALL Ada_LLVMVerifyModule (
- void * jarg1
- ,
-
- int jarg2
- ,
-
- void * jarg3
- )
-{
- int jresult ;
- LLVMModuleRef arg1 = (LLVMModuleRef) 0 ;
- LLVMVerifierFailureAction arg2 ;
- char **arg3 = (char **) 0 ;
- int result;
-
- arg1 = (LLVMModuleRef)jarg1;
-
- arg2 = (LLVMVerifierFailureAction) jarg2;
-
- arg3 = (char **)jarg3;
-
- result = (int)LLVMVerifyModule(arg1,arg2,arg3);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport int SWIGSTDCALL Ada_LLVMVerifyFunction (
- void * jarg1
- ,
-
- int jarg2
- )
-{
- int jresult ;
- LLVMValueRef arg1 = (LLVMValueRef) 0 ;
- LLVMVerifierFailureAction arg2 ;
- int result;
-
- arg1 = (LLVMValueRef)jarg1;
-
- arg2 = (LLVMVerifierFailureAction) jarg2;
-
- result = (int)LLVMVerifyFunction(arg1,arg2);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMViewFunctionCFG (
- void * jarg1
- )
-{
- LLVMValueRef arg1 = (LLVMValueRef) 0 ;
-
- arg1 = (LLVMValueRef)jarg1;
-
- LLVMViewFunctionCFG(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMViewFunctionCFGOnly (
- void * jarg1
- )
-{
- LLVMValueRef arg1 = (LLVMValueRef) 0 ;
-
- arg1 = (LLVMValueRef)jarg1;
-
- LLVMViewFunctionCFGOnly(arg1);
-
-
-}
-
-
-
-#ifdef __cplusplus
-}
-#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifdef __cplusplus
-}
-#endif
-
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 4fcdb4a..0000000
--- 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 7579dea..0000000
--- 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 b7ecbed..0000000
--- 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<typename T> class SwigValueWrapper {
- T *tt;
-public:
- SwigValueWrapper() : tt(0) { }
- SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
- SwigValueWrapper(const T& t) : tt(new T(t)) { }
- ~SwigValueWrapper() { delete tt; }
- SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
- operator T&() const { return *tt; }
- T *operator&() { return tt; }
-private:
- SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
-};
-
-template <typename T> T SwigValueInit() {
- return T();
-}
-#endif
-
-/* -----------------------------------------------------------------------------
- * This section contains generic SWIG labels for method/variable
- * declarations/attributes, and other compiler dependent labels.
- * ----------------------------------------------------------------------------- */
-
-/* template workaround for compilers that cannot correctly implement the C++ standard */
-#ifndef SWIGTEMPLATEDISAMBIGUATOR
-# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
-# define SWIGTEMPLATEDISAMBIGUATOR template
-# elif defined(__HP_aCC)
-/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
-/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
-# define SWIGTEMPLATEDISAMBIGUATOR template
-# else
-# define SWIGTEMPLATEDISAMBIGUATOR
-# endif
-#endif
-
-/* inline attribute */
-#ifndef SWIGINLINE
-# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
-# define SWIGINLINE inline
-# else
-# define SWIGINLINE
-# endif
-#endif
-
-/* attribute recognised by some compilers to avoid 'unused' warnings */
-#ifndef SWIGUNUSED
-# if defined(__GNUC__)
-# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-# define SWIGUNUSED __attribute__ ((__unused__))
-# else
-# define SWIGUNUSED
-# endif
-# elif defined(__ICC)
-# define SWIGUNUSED __attribute__ ((__unused__))
-# else
-# define SWIGUNUSED
-# endif
-#endif
-
-#ifndef SWIGUNUSEDPARM
-# ifdef __cplusplus
-# define SWIGUNUSEDPARM(p)
-# else
-# define SWIGUNUSEDPARM(p) p SWIGUNUSED
-# endif
-#endif
-
-/* internal SWIG method */
-#ifndef SWIGINTERN
-# define SWIGINTERN static SWIGUNUSED
-#endif
-
-/* internal inline SWIG method */
-#ifndef SWIGINTERNINLINE
-# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
-#endif
-
-/* exporting methods */
-#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-# ifndef GCC_HASCLASSVISIBILITY
-# define GCC_HASCLASSVISIBILITY
-# endif
-#endif
-
-#ifndef SWIGEXPORT
-# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-# if defined(STATIC_LINKED)
-# define SWIGEXPORT
-# else
-# define SWIGEXPORT __declspec(dllexport)
-# endif
-# else
-# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
-# define SWIGEXPORT __attribute__ ((visibility("default")))
-# else
-# define SWIGEXPORT
-# endif
-# endif
-#endif
-
-/* calling conventions for Windows */
-#ifndef SWIGSTDCALL
-# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-# define SWIGSTDCALL __stdcall
-# else
-# define SWIGSTDCALL
-# endif
-#endif
-
-/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
-#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
-# define _CRT_SECURE_NO_DEPRECATE
-#endif
-
-/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
-#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
-# define _SCL_SECURE_NO_DEPRECATE
-#endif
-
-
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#if defined(_WIN32) || defined(__CYGWIN32__)
-# define DllExport __declspec( dllexport )
-# define SWIGSTDCALL __stdcall
-#else
-# define DllExport
-# define SWIGSTDCALL
-#endif
-
-
-#ifdef __cplusplus
-# include <new>
-#endif
-
-
-
-
-/* Support for throwing Ada exceptions from C/C++ */
-
-typedef enum
-{
- SWIG_AdaException,
- SWIG_AdaOutOfMemoryException,
- SWIG_AdaIndexOutOfRangeException,
- SWIG_AdaDivideByZeroException,
- SWIG_AdaArgumentOutOfRangeException,
- SWIG_AdaNullReferenceException
-} SWIG_AdaExceptionCodes;
-
-
-typedef void (SWIGSTDCALL* SWIG_AdaExceptionCallback_t)(const char *);
-
-
-typedef struct
-{
- SWIG_AdaExceptionCodes code;
- SWIG_AdaExceptionCallback_t callback;
-}
- SWIG_AdaExceptions_t;
-
-
-static
-SWIG_AdaExceptions_t
-SWIG_ada_exceptions[] =
-{
- { SWIG_AdaException, NULL },
- { SWIG_AdaOutOfMemoryException, NULL },
- { SWIG_AdaIndexOutOfRangeException, NULL },
- { SWIG_AdaDivideByZeroException, NULL },
- { SWIG_AdaArgumentOutOfRangeException, NULL },
- { SWIG_AdaNullReferenceException, NULL }
-};
-
-
-static
-void
-SWIG_AdaThrowException (SWIG_AdaExceptionCodes code, const char *msg)
-{
- SWIG_AdaExceptionCallback_t callback = SWIG_ada_exceptions[SWIG_AdaException].callback;
- if (code >=0 && (size_t)code < sizeof(SWIG_ada_exceptions)/sizeof(SWIG_AdaExceptions_t)) {
- callback = SWIG_ada_exceptions[code].callback;
- }
- callback(msg);
-}
-
-
-
-#ifdef __cplusplus
-extern "C"
-#endif
-
-DllExport void SWIGSTDCALL SWIGRegisterExceptionCallbacks_LLVM_bit_Reader (SWIG_AdaExceptionCallback_t systemException,
- SWIG_AdaExceptionCallback_t outOfMemory,
- SWIG_AdaExceptionCallback_t indexOutOfRange,
- SWIG_AdaExceptionCallback_t divideByZero,
- SWIG_AdaExceptionCallback_t argumentOutOfRange,
- SWIG_AdaExceptionCallback_t nullReference)
-{
- SWIG_ada_exceptions [SWIG_AdaException].callback = systemException;
- SWIG_ada_exceptions [SWIG_AdaOutOfMemoryException].callback = outOfMemory;
- SWIG_ada_exceptions [SWIG_AdaIndexOutOfRangeException].callback = indexOutOfRange;
- SWIG_ada_exceptions [SWIG_AdaDivideByZeroException].callback = divideByZero;
- SWIG_ada_exceptions [SWIG_AdaArgumentOutOfRangeException].callback = argumentOutOfRange;
- SWIG_ada_exceptions [SWIG_AdaNullReferenceException].callback = nullReference;
-}
-
-
-/* Callback for returning strings to Ada without leaking memory */
-
-typedef char * (SWIGSTDCALL* SWIG_AdaStringHelperCallback)(const char *);
-static SWIG_AdaStringHelperCallback SWIG_ada_string_callback = NULL;
-
-
-
-/* probably obsolete ...
-#ifdef __cplusplus
-extern "C"
-#endif
-DllExport void SWIGSTDCALL SWIGRegisterStringCallback_LLVM_bit_Reader(SWIG_AdaStringHelperCallback callback) {
- SWIG_ada_string_callback = callback;
-}
-*/
-
-
-
-/* Contract support */
-
-#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_AdaThrowException(SWIG_AdaArgumentOutOfRangeException, msg); return nullreturn; } else
-
-
-#define protected public
-#define private public
-
-//#include "llvm-c/Analysis.h"
-#include "llvm-c/BitReader.h"
-//#include "llvm-c/BitWriter.h"
-//#include "llvm-c/Core.h"
-//#include "llvm-c/ExecutionEngine.h"
-//#include "llvm-c/LinkTimeOptimizer.h"
-//#include "llvm-c/lto.h"
-//#include "llvm-c/Target.h"
-
-
-
-// struct LLVMCtxt;
-
-
-#undef protected
-#undef private
-#ifdef __cplusplus
-extern "C" {
-#endif
-DllExport int SWIGSTDCALL Ada_LLVMParseBitcode (
- void * jarg1
- ,
-
- void * jarg2
- ,
-
- void * jarg3
- )
-{
- int jresult ;
- LLVMMemoryBufferRef arg1 = (LLVMMemoryBufferRef) 0 ;
- LLVMModuleRef *arg2 = (LLVMModuleRef *) 0 ;
- char **arg3 = (char **) 0 ;
- int result;
-
- arg1 = (LLVMMemoryBufferRef)jarg1;
-
- arg2 = (LLVMModuleRef *)jarg2;
-
- arg3 = (char **)jarg3;
-
- result = (int)LLVMParseBitcode(arg1,arg2,arg3);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport int SWIGSTDCALL Ada_LLVMParseBitcodeInContext (
- void * jarg1
- ,
-
- void * jarg2
- ,
-
- void * jarg3
- ,
-
- void * jarg4
- )
-{
- int jresult ;
- LLVMMemoryBufferRef arg1 = (LLVMMemoryBufferRef) 0 ;
- LLVMContextRef arg2 = (LLVMContextRef) 0 ;
- LLVMModuleRef *arg3 = (LLVMModuleRef *) 0 ;
- char **arg4 = (char **) 0 ;
- int result;
-
- arg1 = (LLVMMemoryBufferRef)jarg1;
-
- arg2 = (LLVMContextRef)jarg2;
-
- arg3 = (LLVMModuleRef *)jarg3;
-
- arg4 = (char **)jarg4;
-
- result = (int)LLVMParseBitcodeInContext(arg1,arg2,arg3,arg4);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport int SWIGSTDCALL Ada_LLVMGetBitcodeModuleProvider (
- void * jarg1
- ,
-
- void * jarg2
- ,
-
- void * jarg3
- )
-{
- int jresult ;
- LLVMMemoryBufferRef arg1 = (LLVMMemoryBufferRef) 0 ;
- LLVMModuleProviderRef *arg2 = (LLVMModuleProviderRef *) 0 ;
- char **arg3 = (char **) 0 ;
- int result;
-
- arg1 = (LLVMMemoryBufferRef)jarg1;
-
- arg2 = (LLVMModuleProviderRef *)jarg2;
-
- arg3 = (char **)jarg3;
-
- result = (int)LLVMGetBitcodeModuleProvider(arg1,arg2,arg3);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport int SWIGSTDCALL Ada_LLVMGetBitcodeModuleProviderInContext (
- void * jarg1
- ,
-
- void * jarg2
- ,
-
- void * jarg3
- ,
-
- void * jarg4
- )
-{
- int jresult ;
- LLVMMemoryBufferRef arg1 = (LLVMMemoryBufferRef) 0 ;
- LLVMContextRef arg2 = (LLVMContextRef) 0 ;
- LLVMModuleProviderRef *arg3 = (LLVMModuleProviderRef *) 0 ;
- char **arg4 = (char **) 0 ;
- int result;
-
- arg1 = (LLVMMemoryBufferRef)jarg1;
-
- arg2 = (LLVMContextRef)jarg2;
-
- arg3 = (LLVMModuleProviderRef *)jarg3;
-
- arg4 = (char **)jarg4;
-
- result = (int)LLVMGetBitcodeModuleProviderInContext(arg1,arg2,arg3,arg4);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-#ifdef __cplusplus
-}
-#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifdef __cplusplus
-}
-#endif
-
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 b5542df..0000000
--- 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 35b1f38..0000000
--- 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 4abf44f..0000000
--- 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<typename T> class SwigValueWrapper {
- T *tt;
-public:
- SwigValueWrapper() : tt(0) { }
- SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
- SwigValueWrapper(const T& t) : tt(new T(t)) { }
- ~SwigValueWrapper() { delete tt; }
- SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
- operator T&() const { return *tt; }
- T *operator&() { return tt; }
-private:
- SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
-};
-
-template <typename T> T SwigValueInit() {
- return T();
-}
-#endif
-
-/* -----------------------------------------------------------------------------
- * This section contains generic SWIG labels for method/variable
- * declarations/attributes, and other compiler dependent labels.
- * ----------------------------------------------------------------------------- */
-
-/* template workaround for compilers that cannot correctly implement the C++ standard */
-#ifndef SWIGTEMPLATEDISAMBIGUATOR
-# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
-# define SWIGTEMPLATEDISAMBIGUATOR template
-# elif defined(__HP_aCC)
-/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
-/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
-# define SWIGTEMPLATEDISAMBIGUATOR template
-# else
-# define SWIGTEMPLATEDISAMBIGUATOR
-# endif
-#endif
-
-/* inline attribute */
-#ifndef SWIGINLINE
-# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
-# define SWIGINLINE inline
-# else
-# define SWIGINLINE
-# endif
-#endif
-
-/* attribute recognised by some compilers to avoid 'unused' warnings */
-#ifndef SWIGUNUSED
-# if defined(__GNUC__)
-# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-# define SWIGUNUSED __attribute__ ((__unused__))
-# else
-# define SWIGUNUSED
-# endif
-# elif defined(__ICC)
-# define SWIGUNUSED __attribute__ ((__unused__))
-# else
-# define SWIGUNUSED
-# endif
-#endif
-
-#ifndef SWIGUNUSEDPARM
-# ifdef __cplusplus
-# define SWIGUNUSEDPARM(p)
-# else
-# define SWIGUNUSEDPARM(p) p SWIGUNUSED
-# endif
-#endif
-
-/* internal SWIG method */
-#ifndef SWIGINTERN
-# define SWIGINTERN static SWIGUNUSED
-#endif
-
-/* internal inline SWIG method */
-#ifndef SWIGINTERNINLINE
-# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
-#endif
-
-/* exporting methods */
-#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-# ifndef GCC_HASCLASSVISIBILITY
-# define GCC_HASCLASSVISIBILITY
-# endif
-#endif
-
-#ifndef SWIGEXPORT
-# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-# if defined(STATIC_LINKED)
-# define SWIGEXPORT
-# else
-# define SWIGEXPORT __declspec(dllexport)
-# endif
-# else
-# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
-# define SWIGEXPORT __attribute__ ((visibility("default")))
-# else
-# define SWIGEXPORT
-# endif
-# endif
-#endif
-
-/* calling conventions for Windows */
-#ifndef SWIGSTDCALL
-# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-# define SWIGSTDCALL __stdcall
-# else
-# define SWIGSTDCALL
-# endif
-#endif
-
-/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
-#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
-# define _CRT_SECURE_NO_DEPRECATE
-#endif
-
-/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
-#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
-# define _SCL_SECURE_NO_DEPRECATE
-#endif
-
-
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#if defined(_WIN32) || defined(__CYGWIN32__)
-# define DllExport __declspec( dllexport )
-# define SWIGSTDCALL __stdcall
-#else
-# define DllExport
-# define SWIGSTDCALL
-#endif
-
-
-#ifdef __cplusplus
-# include <new>
-#endif
-
-
-
-
-/* Support for throwing Ada exceptions from C/C++ */
-
-typedef enum
-{
- SWIG_AdaException,
- SWIG_AdaOutOfMemoryException,
- SWIG_AdaIndexOutOfRangeException,
- SWIG_AdaDivideByZeroException,
- SWIG_AdaArgumentOutOfRangeException,
- SWIG_AdaNullReferenceException
-} SWIG_AdaExceptionCodes;
-
-
-typedef void (SWIGSTDCALL* SWIG_AdaExceptionCallback_t)(const char *);
-
-
-typedef struct
-{
- SWIG_AdaExceptionCodes code;
- SWIG_AdaExceptionCallback_t callback;
-}
- SWIG_AdaExceptions_t;
-
-
-static
-SWIG_AdaExceptions_t
-SWIG_ada_exceptions[] =
-{
- { SWIG_AdaException, NULL },
- { SWIG_AdaOutOfMemoryException, NULL },
- { SWIG_AdaIndexOutOfRangeException, NULL },
- { SWIG_AdaDivideByZeroException, NULL },
- { SWIG_AdaArgumentOutOfRangeException, NULL },
- { SWIG_AdaNullReferenceException, NULL }
-};
-
-
-static
-void
-SWIG_AdaThrowException (SWIG_AdaExceptionCodes code, const char *msg)
-{
- SWIG_AdaExceptionCallback_t callback = SWIG_ada_exceptions[SWIG_AdaException].callback;
- if (code >=0 && (size_t)code < sizeof(SWIG_ada_exceptions)/sizeof(SWIG_AdaExceptions_t)) {
- callback = SWIG_ada_exceptions[code].callback;
- }
- callback(msg);
-}
-
-
-
-#ifdef __cplusplus
-extern "C"
-#endif
-
-DllExport void SWIGSTDCALL SWIGRegisterExceptionCallbacks_LLVM_bit_Writer (SWIG_AdaExceptionCallback_t systemException,
- SWIG_AdaExceptionCallback_t outOfMemory,
- SWIG_AdaExceptionCallback_t indexOutOfRange,
- SWIG_AdaExceptionCallback_t divideByZero,
- SWIG_AdaExceptionCallback_t argumentOutOfRange,
- SWIG_AdaExceptionCallback_t nullReference)
-{
- SWIG_ada_exceptions [SWIG_AdaException].callback = systemException;
- SWIG_ada_exceptions [SWIG_AdaOutOfMemoryException].callback = outOfMemory;
- SWIG_ada_exceptions [SWIG_AdaIndexOutOfRangeException].callback = indexOutOfRange;
- SWIG_ada_exceptions [SWIG_AdaDivideByZeroException].callback = divideByZero;
- SWIG_ada_exceptions [SWIG_AdaArgumentOutOfRangeException].callback = argumentOutOfRange;
- SWIG_ada_exceptions [SWIG_AdaNullReferenceException].callback = nullReference;
-}
-
-
-/* Callback for returning strings to Ada without leaking memory */
-
-typedef char * (SWIGSTDCALL* SWIG_AdaStringHelperCallback)(const char *);
-static SWIG_AdaStringHelperCallback SWIG_ada_string_callback = NULL;
-
-
-
-/* probably obsolete ...
-#ifdef __cplusplus
-extern "C"
-#endif
-DllExport void SWIGSTDCALL SWIGRegisterStringCallback_LLVM_bit_Writer(SWIG_AdaStringHelperCallback callback) {
- SWIG_ada_string_callback = callback;
-}
-*/
-
-
-
-/* Contract support */
-
-#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_AdaThrowException(SWIG_AdaArgumentOutOfRangeException, msg); return nullreturn; } else
-
-
-#define protected public
-#define private public
-
-#include "llvm-c/Analysis.h"
-#include "llvm-c/BitReader.h"
-#include "llvm-c/BitWriter.h"
-#include "llvm-c/Core.h"
-#include "llvm-c/ExecutionEngine.h"
-#include "llvm-c/LinkTimeOptimizer.h"
-#include "llvm-c/lto.h"
-#include "llvm-c/Target.h"
-
-
-
-// struct LLVMCtxt;
-
-
-#undef protected
-#undef private
-#ifdef __cplusplus
-extern "C" {
-#endif
-DllExport int SWIGSTDCALL Ada_LLVMWriteBitcodeToFileHandle (
- void * jarg1
- ,
-
- int jarg2
- )
-{
- int jresult ;
- LLVMModuleRef arg1 = (LLVMModuleRef) 0 ;
- int arg2 ;
- int result;
-
- arg1 = (LLVMModuleRef)jarg1;
-
-
- arg2 = (int) jarg2;
-
-
- result = (int)LLVMWriteBitcodeToFileHandle(arg1,arg2);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport int SWIGSTDCALL Ada_LLVMWriteBitcodeToFile (
- void * jarg1
- ,
-
- char * jarg2
- )
-{
- int jresult ;
- LLVMModuleRef arg1 = (LLVMModuleRef) 0 ;
- char *arg2 = (char *) 0 ;
- int result;
-
- arg1 = (LLVMModuleRef)jarg1;
-
- arg2 = jarg2;
-
- result = (int)LLVMWriteBitcodeToFile(arg1,(char const *)arg2);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-#ifdef __cplusplus
-}
-#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifdef __cplusplus
-}
-#endif
-
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 a37c462..0000000
--- 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 c766992..0000000
--- 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 b63acac..0000000
--- 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<typename T> class SwigValueWrapper {
- T *tt;
-public:
- SwigValueWrapper() : tt(0) { }
- SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
- SwigValueWrapper(const T& t) : tt(new T(t)) { }
- ~SwigValueWrapper() { delete tt; }
- SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
- operator T&() const { return *tt; }
- T *operator&() { return tt; }
-private:
- SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
-};
-
-template <typename T> T SwigValueInit() {
- return T();
-}
-#endif
-
-/* -----------------------------------------------------------------------------
- * This section contains generic SWIG labels for method/variable
- * declarations/attributes, and other compiler dependent labels.
- * ----------------------------------------------------------------------------- */
-
-/* template workaround for compilers that cannot correctly implement the C++ standard */
-#ifndef SWIGTEMPLATEDISAMBIGUATOR
-# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
-# define SWIGTEMPLATEDISAMBIGUATOR template
-# elif defined(__HP_aCC)
-/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
-/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
-# define SWIGTEMPLATEDISAMBIGUATOR template
-# else
-# define SWIGTEMPLATEDISAMBIGUATOR
-# endif
-#endif
-
-/* inline attribute */
-#ifndef SWIGINLINE
-# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
-# define SWIGINLINE inline
-# else
-# define SWIGINLINE
-# endif
-#endif
-
-/* attribute recognised by some compilers to avoid 'unused' warnings */
-#ifndef SWIGUNUSED
-# if defined(__GNUC__)
-# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-# define SWIGUNUSED __attribute__ ((__unused__))
-# else
-# define SWIGUNUSED
-# endif
-# elif defined(__ICC)
-# define SWIGUNUSED __attribute__ ((__unused__))
-# else
-# define SWIGUNUSED
-# endif
-#endif
-
-#ifndef SWIGUNUSEDPARM
-# ifdef __cplusplus
-# define SWIGUNUSEDPARM(p)
-# else
-# define SWIGUNUSEDPARM(p) p SWIGUNUSED
-# endif
-#endif
-
-/* internal SWIG method */
-#ifndef SWIGINTERN
-# define SWIGINTERN static SWIGUNUSED
-#endif
-
-/* internal inline SWIG method */
-#ifndef SWIGINTERNINLINE
-# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
-#endif
-
-/* exporting methods */
-#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-# ifndef GCC_HASCLASSVISIBILITY
-# define GCC_HASCLASSVISIBILITY
-# endif
-#endif
-
-#ifndef SWIGEXPORT
-# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-# if defined(STATIC_LINKED)
-# define SWIGEXPORT
-# else
-# define SWIGEXPORT __declspec(dllexport)
-# endif
-# else
-# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
-# define SWIGEXPORT __attribute__ ((visibility("default")))
-# else
-# define SWIGEXPORT
-# endif
-# endif
-#endif
-
-/* calling conventions for Windows */
-#ifndef SWIGSTDCALL
-# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-# define SWIGSTDCALL __stdcall
-# else
-# define SWIGSTDCALL
-# endif
-#endif
-
-/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
-#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
-# define _CRT_SECURE_NO_DEPRECATE
-#endif
-
-/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
-#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
-# define _SCL_SECURE_NO_DEPRECATE
-#endif
-
-
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#if defined(_WIN32) || defined(__CYGWIN32__)
-# define DllExport __declspec( dllexport )
-# define SWIGSTDCALL __stdcall
-#else
-# define DllExport
-# define SWIGSTDCALL
-#endif
-
-
-#ifdef __cplusplus
-# include <new>
-#endif
-
-
-
-
-/* Support for throwing Ada exceptions from C/C++ */
-
-typedef enum
-{
- SWIG_AdaException,
- SWIG_AdaOutOfMemoryException,
- SWIG_AdaIndexOutOfRangeException,
- SWIG_AdaDivideByZeroException,
- SWIG_AdaArgumentOutOfRangeException,
- SWIG_AdaNullReferenceException
-} SWIG_AdaExceptionCodes;
-
-
-typedef void (SWIGSTDCALL* SWIG_AdaExceptionCallback_t)(const char *);
-
-
-typedef struct
-{
- SWIG_AdaExceptionCodes code;
- SWIG_AdaExceptionCallback_t callback;
-}
- SWIG_AdaExceptions_t;
-
-
-static
-SWIG_AdaExceptions_t
-SWIG_ada_exceptions[] =
-{
- { SWIG_AdaException, NULL },
- { SWIG_AdaOutOfMemoryException, NULL },
- { SWIG_AdaIndexOutOfRangeException, NULL },
- { SWIG_AdaDivideByZeroException, NULL },
- { SWIG_AdaArgumentOutOfRangeException, NULL },
- { SWIG_AdaNullReferenceException, NULL }
-};
-
-
-static
-void
-SWIG_AdaThrowException (SWIG_AdaExceptionCodes code, const char *msg)
-{
- SWIG_AdaExceptionCallback_t callback = SWIG_ada_exceptions[SWIG_AdaException].callback;
- if (code >=0 && (size_t)code < sizeof(SWIG_ada_exceptions)/sizeof(SWIG_AdaExceptions_t)) {
- callback = SWIG_ada_exceptions[code].callback;
- }
- callback(msg);
-}
-
-
-
-#ifdef __cplusplus
-extern "C"
-#endif
-
-DllExport void SWIGSTDCALL SWIGRegisterExceptionCallbacks_LLVM_execution_Engine (SWIG_AdaExceptionCallback_t systemException,
- SWIG_AdaExceptionCallback_t outOfMemory,
- SWIG_AdaExceptionCallback_t indexOutOfRange,
- SWIG_AdaExceptionCallback_t divideByZero,
- SWIG_AdaExceptionCallback_t argumentOutOfRange,
- SWIG_AdaExceptionCallback_t nullReference)
-{
- SWIG_ada_exceptions [SWIG_AdaException].callback = systemException;
- SWIG_ada_exceptions [SWIG_AdaOutOfMemoryException].callback = outOfMemory;
- SWIG_ada_exceptions [SWIG_AdaIndexOutOfRangeException].callback = indexOutOfRange;
- SWIG_ada_exceptions [SWIG_AdaDivideByZeroException].callback = divideByZero;
- SWIG_ada_exceptions [SWIG_AdaArgumentOutOfRangeException].callback = argumentOutOfRange;
- SWIG_ada_exceptions [SWIG_AdaNullReferenceException].callback = nullReference;
-}
-
-
-/* Callback for returning strings to Ada without leaking memory */
-
-typedef char * (SWIGSTDCALL* SWIG_AdaStringHelperCallback)(const char *);
-static SWIG_AdaStringHelperCallback SWIG_ada_string_callback = NULL;
-
-
-
-/* probably obsolete ...
-#ifdef __cplusplus
-extern "C"
-#endif
-DllExport void SWIGSTDCALL SWIGRegisterStringCallback_LLVM_execution_Engine(SWIG_AdaStringHelperCallback callback) {
- SWIG_ada_string_callback = callback;
-}
-*/
-
-
-
-/* Contract support */
-
-#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_AdaThrowException(SWIG_AdaArgumentOutOfRangeException, msg); return nullreturn; } else
-
-
-#define protected public
-#define private public
-
-#include "llvm-c/ExecutionEngine.h"
-
-
-
-// struct LLVMCtxt;
-
-
-#undef protected
-#undef private
-#ifdef __cplusplus
-extern "C" {
-#endif
-DllExport void SWIGSTDCALL Ada_LLVMLinkInJIT (
- )
-{
- LLVMLinkInJIT();
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMLinkInInterpreter (
- )
-{
- LLVMLinkInInterpreter();
-
-
-}
-
-
-
-DllExport void * SWIGSTDCALL Ada_LLVMCreateGenericValueOfInt (
- void * jarg1
- ,
-
- unsigned long long jarg2
- ,
-
- int jarg3
- )
-{
- void * jresult ;
- LLVMTypeRef arg1 = (LLVMTypeRef) 0 ;
- unsigned long long arg2 ;
- int arg3 ;
- LLVMGenericValueRef result;
-
- arg1 = (LLVMTypeRef)jarg1;
-
-
- arg2 = (unsigned long long) jarg2;
-
-
-
- arg3 = (int) jarg3;
-
-
- result = (LLVMGenericValueRef)LLVMCreateGenericValueOfInt(arg1,arg2,arg3);
- jresult = (void *) result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport void * SWIGSTDCALL Ada_LLVMCreateGenericValueOfPointer (
- void* jarg1
- )
-{
- void * jresult ;
- void *arg1 = (void *) 0 ;
- LLVMGenericValueRef result;
-
- arg1 = (void *)jarg1;
-
- result = (LLVMGenericValueRef)LLVMCreateGenericValueOfPointer(arg1);
- jresult = (void *) result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport void * SWIGSTDCALL Ada_LLVMCreateGenericValueOfFloat (
- void * jarg1
- ,
-
- double jarg2
- )
-{
- void * jresult ;
- LLVMTypeRef arg1 = (LLVMTypeRef) 0 ;
- double arg2 ;
- LLVMGenericValueRef result;
-
- arg1 = (LLVMTypeRef)jarg1;
-
-
- arg2 = (double) jarg2;
-
-
- result = (LLVMGenericValueRef)LLVMCreateGenericValueOfFloat(arg1,arg2);
- jresult = (void *) result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport unsigned int SWIGSTDCALL Ada_LLVMGenericValueIntWidth (
- void * jarg1
- )
-{
- unsigned int jresult ;
- LLVMGenericValueRef arg1 = (LLVMGenericValueRef) 0 ;
- unsigned int result;
-
- arg1 = (LLVMGenericValueRef)jarg1;
-
- result = (unsigned int)LLVMGenericValueIntWidth(arg1);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport unsigned long long SWIGSTDCALL Ada_LLVMGenericValueToInt (
- void * jarg1
- ,
-
- int jarg2
- )
-{
- unsigned long long jresult ;
- LLVMGenericValueRef arg1 = (LLVMGenericValueRef) 0 ;
- int arg2 ;
- unsigned long long result;
-
- arg1 = (LLVMGenericValueRef)jarg1;
-
-
- arg2 = (int) jarg2;
-
-
- result = (unsigned long long)LLVMGenericValueToInt(arg1,arg2);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport void* SWIGSTDCALL Ada_LLVMGenericValueToPointer (
- void * jarg1
- )
-{
- void* jresult ;
- LLVMGenericValueRef arg1 = (LLVMGenericValueRef) 0 ;
- void *result = 0 ;
-
- arg1 = (LLVMGenericValueRef)jarg1;
-
- result = (void *)LLVMGenericValueToPointer(arg1);
- jresult = (void *) result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport double SWIGSTDCALL Ada_LLVMGenericValueToFloat (
- void * jarg1
- ,
-
- void * jarg2
- )
-{
- double jresult ;
- LLVMTypeRef arg1 = (LLVMTypeRef) 0 ;
- LLVMGenericValueRef arg2 = (LLVMGenericValueRef) 0 ;
- double result;
-
- arg1 = (LLVMTypeRef)jarg1;
-
- arg2 = (LLVMGenericValueRef)jarg2;
-
- result = (double)LLVMGenericValueToFloat(arg1,arg2);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMDisposeGenericValue (
- void * jarg1
- )
-{
- LLVMGenericValueRef arg1 = (LLVMGenericValueRef) 0 ;
-
- arg1 = (LLVMGenericValueRef)jarg1;
-
- LLVMDisposeGenericValue(arg1);
-
-
-}
-
-
-
-DllExport int SWIGSTDCALL Ada_LLVMCreateExecutionEngine (
- void * jarg1
- ,
-
- void * jarg2
- ,
-
- void * jarg3
- )
-{
- int jresult ;
- LLVMExecutionEngineRef *arg1 = (LLVMExecutionEngineRef *) 0 ;
- LLVMModuleProviderRef arg2 = (LLVMModuleProviderRef) 0 ;
- char **arg3 = (char **) 0 ;
- int result;
-
- arg1 = (LLVMExecutionEngineRef *)jarg1;
-
- arg2 = (LLVMModuleProviderRef)jarg2;
-
- arg3 = (char **)jarg3;
-
- result = (int)LLVMCreateExecutionEngine(arg1,arg2,arg3);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport int SWIGSTDCALL Ada_LLVMCreateInterpreter (
- void * jarg1
- ,
-
- void * jarg2
- ,
-
- void * jarg3
- )
-{
- int jresult ;
- LLVMExecutionEngineRef *arg1 = (LLVMExecutionEngineRef *) 0 ;
- LLVMModuleProviderRef arg2 = (LLVMModuleProviderRef) 0 ;
- char **arg3 = (char **) 0 ;
- int result;
-
- arg1 = (LLVMExecutionEngineRef *)jarg1;
-
- arg2 = (LLVMModuleProviderRef)jarg2;
-
- arg3 = (char **)jarg3;
-
- result = (int)LLVMCreateInterpreter(arg1,arg2,arg3);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport int SWIGSTDCALL Ada_LLVMCreateJITCompiler (
- void * jarg1
- ,
-
- void * jarg2
- ,
-
- unsigned int jarg3
- ,
-
- void * jarg4
- )
-{
- int jresult ;
- LLVMExecutionEngineRef *arg1 = (LLVMExecutionEngineRef *) 0 ;
- LLVMModuleProviderRef arg2 = (LLVMModuleProviderRef) 0 ;
- unsigned int arg3 ;
- char **arg4 = (char **) 0 ;
- int result;
-
- arg1 = (LLVMExecutionEngineRef *)jarg1;
-
- arg2 = (LLVMModuleProviderRef)jarg2;
-
-
- arg3 = (unsigned int) jarg3;
-
-
- arg4 = (char **)jarg4;
-
- result = (int)LLVMCreateJITCompiler(arg1,arg2,arg3,arg4);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMDisposeExecutionEngine (
- void * jarg1
- )
-{
- LLVMExecutionEngineRef arg1 = (LLVMExecutionEngineRef) 0 ;
-
- arg1 = (LLVMExecutionEngineRef)jarg1;
-
- LLVMDisposeExecutionEngine(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMRunStaticConstructors (
- void * jarg1
- )
-{
- LLVMExecutionEngineRef arg1 = (LLVMExecutionEngineRef) 0 ;
-
- arg1 = (LLVMExecutionEngineRef)jarg1;
-
- LLVMRunStaticConstructors(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMRunStaticDestructors (
- void * jarg1
- )
-{
- LLVMExecutionEngineRef arg1 = (LLVMExecutionEngineRef) 0 ;
-
- arg1 = (LLVMExecutionEngineRef)jarg1;
-
- LLVMRunStaticDestructors(arg1);
-
-
-}
-
-
-
-DllExport int SWIGSTDCALL Ada_LLVMRunFunctionAsMain (
- void * jarg1
- ,
-
- void * jarg2
- ,
-
- unsigned int jarg3
- ,
-
- void * jarg4
- ,
-
- void * jarg5
- )
-{
- int jresult ;
- LLVMExecutionEngineRef arg1 = (LLVMExecutionEngineRef) 0 ;
- LLVMValueRef arg2 = (LLVMValueRef) 0 ;
- unsigned int arg3 ;
- char **arg4 = (char **) 0 ;
- char **arg5 = (char **) 0 ;
- int result;
-
- arg1 = (LLVMExecutionEngineRef)jarg1;
-
- arg2 = (LLVMValueRef)jarg2;
-
-
- arg3 = (unsigned int) jarg3;
-
-
- arg4 = (char **)jarg4;
-
- arg5 = (char **)jarg5;
-
- result = (int)LLVMRunFunctionAsMain(arg1,arg2,arg3,(char const *const *)arg4,(char const *const *)arg5);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport void * SWIGSTDCALL Ada_LLVMRunFunction (
- void * jarg1
- ,
-
- void * jarg2
- ,
-
- unsigned int jarg3
- ,
-
- void * jarg4
- )
-{
- void * jresult ;
- LLVMExecutionEngineRef arg1 = (LLVMExecutionEngineRef) 0 ;
- LLVMValueRef arg2 = (LLVMValueRef) 0 ;
- unsigned int arg3 ;
- LLVMGenericValueRef *arg4 = (LLVMGenericValueRef *) 0 ;
- LLVMGenericValueRef result;
-
- arg1 = (LLVMExecutionEngineRef)jarg1;
-
- arg2 = (LLVMValueRef)jarg2;
-
-
- arg3 = (unsigned int) jarg3;
-
-
- arg4 = (LLVMGenericValueRef *)jarg4;
-
- result = (LLVMGenericValueRef)LLVMRunFunction(arg1,arg2,arg3,arg4);
- jresult = (void *) result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMFreeMachineCodeForFunction (
- void * jarg1
- ,
-
- void * jarg2
- )
-{
- LLVMExecutionEngineRef arg1 = (LLVMExecutionEngineRef) 0 ;
- LLVMValueRef arg2 = (LLVMValueRef) 0 ;
-
- arg1 = (LLVMExecutionEngineRef)jarg1;
-
- arg2 = (LLVMValueRef)jarg2;
-
- LLVMFreeMachineCodeForFunction(arg1,arg2);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddModuleProvider (
- void * jarg1
- ,
-
- void * jarg2
- )
-{
- LLVMExecutionEngineRef arg1 = (LLVMExecutionEngineRef) 0 ;
- LLVMModuleProviderRef arg2 = (LLVMModuleProviderRef) 0 ;
-
- arg1 = (LLVMExecutionEngineRef)jarg1;
-
- arg2 = (LLVMModuleProviderRef)jarg2;
-
- LLVMAddModuleProvider(arg1,arg2);
-
-
-}
-
-
-
-DllExport int SWIGSTDCALL Ada_LLVMRemoveModuleProvider (
- void * jarg1
- ,
-
- void * jarg2
- ,
-
- void * jarg3
- ,
-
- void * jarg4
- )
-{
- int jresult ;
- LLVMExecutionEngineRef arg1 = (LLVMExecutionEngineRef) 0 ;
- LLVMModuleProviderRef arg2 = (LLVMModuleProviderRef) 0 ;
- LLVMModuleRef *arg3 = (LLVMModuleRef *) 0 ;
- char **arg4 = (char **) 0 ;
- int result;
-
- arg1 = (LLVMExecutionEngineRef)jarg1;
-
- arg2 = (LLVMModuleProviderRef)jarg2;
-
- arg3 = (LLVMModuleRef *)jarg3;
-
- arg4 = (char **)jarg4;
-
- result = (int)LLVMRemoveModuleProvider(arg1,arg2,arg3,arg4);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport int SWIGSTDCALL Ada_LLVMFindFunction (
- void * jarg1
- ,
-
- char * jarg2
- ,
-
- void * jarg3
- )
-{
- int jresult ;
- LLVMExecutionEngineRef arg1 = (LLVMExecutionEngineRef) 0 ;
- char *arg2 = (char *) 0 ;
- LLVMValueRef *arg3 = (LLVMValueRef *) 0 ;
- int result;
-
- arg1 = (LLVMExecutionEngineRef)jarg1;
-
- arg2 = jarg2;
-
- arg3 = (LLVMValueRef *)jarg3;
-
- result = (int)LLVMFindFunction(arg1,(char const *)arg2,arg3);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport LLVMTargetDataRef SWIGSTDCALL Ada_LLVMGetExecutionEngineTargetData (
- void * jarg1
- )
-{
- LLVMTargetDataRef jresult ;
- LLVMExecutionEngineRef arg1 = (LLVMExecutionEngineRef) 0 ;
- LLVMTargetDataRef result;
-
- arg1 = (LLVMExecutionEngineRef)jarg1;
-
- result = LLVMGetExecutionEngineTargetData(arg1);
-
- jresult = result;
- //jresult = new LLVMTargetDataRef ((LLVMTargetDataRef &) result);
-
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddGlobalMapping (
- void * jarg1
- ,
-
- void * jarg2
- ,
-
- void* jarg3
- )
-{
- LLVMExecutionEngineRef arg1 = (LLVMExecutionEngineRef) 0 ;
- LLVMValueRef arg2 = (LLVMValueRef) 0 ;
- void *arg3 = (void *) 0 ;
-
- arg1 = (LLVMExecutionEngineRef)jarg1;
-
- arg2 = (LLVMValueRef)jarg2;
-
- arg3 = (void *)jarg3;
-
- LLVMAddGlobalMapping(arg1,arg2,arg3);
-
-
-}
-
-
-
-DllExport void* SWIGSTDCALL Ada_LLVMGetPointerToGlobal (
- void * jarg1
- ,
-
- void * jarg2
- )
-{
- void* jresult ;
- LLVMExecutionEngineRef arg1 = (LLVMExecutionEngineRef) 0 ;
- LLVMValueRef arg2 = (LLVMValueRef) 0 ;
- void *result = 0 ;
-
- arg1 = (LLVMExecutionEngineRef)jarg1;
-
- arg2 = (LLVMValueRef)jarg2;
-
- result = (void *)LLVMGetPointerToGlobal(arg1,arg2);
- jresult = (void *) result;
-
-
-
- return jresult;
-
-}
-
-
-
-#ifdef __cplusplus
-}
-#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifdef __cplusplus
-}
-#endif
-
diff --git a/contrib/llvm/bindings/ada/llvm.gpr b/contrib/llvm/bindings/ada/llvm.gpr
deleted file mode 100644
index 8e87af4..0000000
--- 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 c0e48a1..0000000
--- 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 20fc940..0000000
--- 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 7c0b086..0000000
--- 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 c27f7c5..0000000
--- 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 eb2e7ab..0000000
--- 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<typename T> class SwigValueWrapper {
- T *tt;
-public:
- SwigValueWrapper() : tt(0) { }
- SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
- SwigValueWrapper(const T& t) : tt(new T(t)) { }
- ~SwigValueWrapper() { delete tt; }
- SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
- operator T&() const { return *tt; }
- T *operator&() { return tt; }
-private:
- SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
-};
-
-template <typename T> T SwigValueInit() {
- return T();
-}
-#endif
-
-/* -----------------------------------------------------------------------------
- * This section contains generic SWIG labels for method/variable
- * declarations/attributes, and other compiler dependent labels.
- * ----------------------------------------------------------------------------- */
-
-/* template workaround for compilers that cannot correctly implement the C++ standard */
-#ifndef SWIGTEMPLATEDISAMBIGUATOR
-# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
-# define SWIGTEMPLATEDISAMBIGUATOR template
-# elif defined(__HP_aCC)
-/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
-/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
-# define SWIGTEMPLATEDISAMBIGUATOR template
-# else
-# define SWIGTEMPLATEDISAMBIGUATOR
-# endif
-#endif
-
-/* inline attribute */
-#ifndef SWIGINLINE
-# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
-# define SWIGINLINE inline
-# else
-# define SWIGINLINE
-# endif
-#endif
-
-/* attribute recognised by some compilers to avoid 'unused' warnings */
-#ifndef SWIGUNUSED
-# if defined(__GNUC__)
-# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-# define SWIGUNUSED __attribute__ ((__unused__))
-# else
-# define SWIGUNUSED
-# endif
-# elif defined(__ICC)
-# define SWIGUNUSED __attribute__ ((__unused__))
-# else
-# define SWIGUNUSED
-# endif
-#endif
-
-#ifndef SWIGUNUSEDPARM
-# ifdef __cplusplus
-# define SWIGUNUSEDPARM(p)
-# else
-# define SWIGUNUSEDPARM(p) p SWIGUNUSED
-# endif
-#endif
-
-/* internal SWIG method */
-#ifndef SWIGINTERN
-# define SWIGINTERN static SWIGUNUSED
-#endif
-
-/* internal inline SWIG method */
-#ifndef SWIGINTERNINLINE
-# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
-#endif
-
-/* exporting methods */
-#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-# ifndef GCC_HASCLASSVISIBILITY
-# define GCC_HASCLASSVISIBILITY
-# endif
-#endif
-
-#ifndef SWIGEXPORT
-# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-# if defined(STATIC_LINKED)
-# define SWIGEXPORT
-# else
-# define SWIGEXPORT __declspec(dllexport)
-# endif
-# else
-# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
-# define SWIGEXPORT __attribute__ ((visibility("default")))
-# else
-# define SWIGEXPORT
-# endif
-# endif
-#endif
-
-/* calling conventions for Windows */
-#ifndef SWIGSTDCALL
-# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-# define SWIGSTDCALL __stdcall
-# else
-# define SWIGSTDCALL
-# endif
-#endif
-
-/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
-#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
-# define _CRT_SECURE_NO_DEPRECATE
-#endif
-
-/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
-#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
-# define _SCL_SECURE_NO_DEPRECATE
-#endif
-
-
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#if defined(_WIN32) || defined(__CYGWIN32__)
-# define DllExport __declspec( dllexport )
-# define SWIGSTDCALL __stdcall
-#else
-# define DllExport
-# define SWIGSTDCALL
-#endif
-
-
-#ifdef __cplusplus
-# include <new>
-#endif
-
-
-
-
-/* Support for throwing Ada exceptions from C/C++ */
-
-typedef enum
-{
- SWIG_AdaException,
- SWIG_AdaOutOfMemoryException,
- SWIG_AdaIndexOutOfRangeException,
- SWIG_AdaDivideByZeroException,
- SWIG_AdaArgumentOutOfRangeException,
- SWIG_AdaNullReferenceException
-} SWIG_AdaExceptionCodes;
-
-
-typedef void (SWIGSTDCALL* SWIG_AdaExceptionCallback_t)(const char *);
-
-
-typedef struct
-{
- SWIG_AdaExceptionCodes code;
- SWIG_AdaExceptionCallback_t callback;
-}
- SWIG_AdaExceptions_t;
-
-
-static
-SWIG_AdaExceptions_t
-SWIG_ada_exceptions[] =
-{
- { SWIG_AdaException, NULL },
- { SWIG_AdaOutOfMemoryException, NULL },
- { SWIG_AdaIndexOutOfRangeException, NULL },
- { SWIG_AdaDivideByZeroException, NULL },
- { SWIG_AdaArgumentOutOfRangeException, NULL },
- { SWIG_AdaNullReferenceException, NULL }
-};
-
-
-static
-void
-SWIG_AdaThrowException (SWIG_AdaExceptionCodes code, const char *msg)
-{
- SWIG_AdaExceptionCallback_t callback = SWIG_ada_exceptions[SWIG_AdaException].callback;
- if (code >=0 && (size_t)code < sizeof(SWIG_ada_exceptions)/sizeof(SWIG_AdaExceptions_t)) {
- callback = SWIG_ada_exceptions[code].callback;
- }
- callback(msg);
-}
-
-
-
-#ifdef __cplusplus
-extern "C"
-#endif
-
-DllExport void SWIGSTDCALL SWIGRegisterExceptionCallbacks_LLVM_link_time_Optimizer (SWIG_AdaExceptionCallback_t systemException,
- SWIG_AdaExceptionCallback_t outOfMemory,
- SWIG_AdaExceptionCallback_t indexOutOfRange,
- SWIG_AdaExceptionCallback_t divideByZero,
- SWIG_AdaExceptionCallback_t argumentOutOfRange,
- SWIG_AdaExceptionCallback_t nullReference)
-{
- SWIG_ada_exceptions [SWIG_AdaException].callback = systemException;
- SWIG_ada_exceptions [SWIG_AdaOutOfMemoryException].callback = outOfMemory;
- SWIG_ada_exceptions [SWIG_AdaIndexOutOfRangeException].callback = indexOutOfRange;
- SWIG_ada_exceptions [SWIG_AdaDivideByZeroException].callback = divideByZero;
- SWIG_ada_exceptions [SWIG_AdaArgumentOutOfRangeException].callback = argumentOutOfRange;
- SWIG_ada_exceptions [SWIG_AdaNullReferenceException].callback = nullReference;
-}
-
-
-/* Callback for returning strings to Ada without leaking memory */
-
-typedef char * (SWIGSTDCALL* SWIG_AdaStringHelperCallback)(const char *);
-static SWIG_AdaStringHelperCallback SWIG_ada_string_callback = NULL;
-
-
-
-/* probably obsolete ...
-#ifdef __cplusplus
-extern "C"
-#endif
-DllExport void SWIGSTDCALL SWIGRegisterStringCallback_LLVM_link_time_Optimizer(SWIG_AdaStringHelperCallback callback) {
- SWIG_ada_string_callback = callback;
-}
-*/
-
-
-
-/* Contract support */
-
-#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_AdaThrowException(SWIG_AdaArgumentOutOfRangeException, msg); return nullreturn; } else
-
-
-#define protected public
-#define private public
-
-#include "llvm-c/lto.h"
-#include "llvm-c/LinkTimeOptimizer.h"
-
-
-
-// struct LLVMCtxt;
-
-
-#undef protected
-#undef private
-#ifdef __cplusplus
-extern "C" {
-#endif
-DllExport char * SWIGSTDCALL Ada_lto_get_version (
- )
-{
- char * jresult ;
- char *result = 0 ;
-
- result = (char *)lto_get_version();
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport char * SWIGSTDCALL Ada_lto_get_error_message (
- )
-{
- char * jresult ;
- char *result = 0 ;
-
- result = (char *)lto_get_error_message();
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport unsigned int SWIGSTDCALL Ada_lto_module_is_object_file (
- char * jarg1
- )
-{
- unsigned int jresult ;
- char *arg1 = (char *) 0 ;
- bool result;
-
- arg1 = jarg1;
-
- result = (bool)lto_module_is_object_file((char const *)arg1);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport unsigned int SWIGSTDCALL Ada_lto_module_is_object_file_for_target (
- char * jarg1
- ,
-
- char * jarg2
- )
-{
- unsigned int jresult ;
- char *arg1 = (char *) 0 ;
- char *arg2 = (char *) 0 ;
- bool result;
-
- arg1 = jarg1;
-
- arg2 = jarg2;
-
- result = (bool)lto_module_is_object_file_for_target((char const *)arg1,(char const *)arg2);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport unsigned int SWIGSTDCALL Ada_lto_module_is_object_file_in_memory (
- void* jarg1
- ,
-
- size_t jarg2
- )
-{
- unsigned int jresult ;
- void *arg1 = (void *) 0 ;
- size_t arg2 ;
- bool result;
-
- arg1 = (void *)jarg1;
-
-
- arg2 = (size_t) jarg2;
-
-
- result = (bool)lto_module_is_object_file_in_memory((void const *)arg1,arg2);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport unsigned int SWIGSTDCALL Ada_lto_module_is_object_file_in_memory_for_target (
- void* jarg1
- ,
-
- size_t jarg2
- ,
-
- char * jarg3
- )
-{
- unsigned int jresult ;
- void *arg1 = (void *) 0 ;
- size_t arg2 ;
- char *arg3 = (char *) 0 ;
- bool result;
-
- arg1 = (void *)jarg1;
-
-
- arg2 = (size_t) jarg2;
-
-
- arg3 = jarg3;
-
- result = (bool)lto_module_is_object_file_in_memory_for_target((void const *)arg1,arg2,(char const *)arg3);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport void * SWIGSTDCALL Ada_lto_module_create (
- char * jarg1
- )
-{
- void * jresult ;
- char *arg1 = (char *) 0 ;
- lto_module_t result;
-
- arg1 = jarg1;
-
- result = (lto_module_t)lto_module_create((char const *)arg1);
- jresult = (void *) result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport void * SWIGSTDCALL Ada_lto_module_create_from_memory (
- void* jarg1
- ,
-
- size_t jarg2
- )
-{
- void * jresult ;
- void *arg1 = (void *) 0 ;
- size_t arg2 ;
- lto_module_t result;
-
- arg1 = (void *)jarg1;
-
-
- arg2 = (size_t) jarg2;
-
-
- result = (lto_module_t)lto_module_create_from_memory((void const *)arg1,arg2);
- jresult = (void *) result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_lto_module_dispose (
- void * jarg1
- )
-{
- lto_module_t arg1 = (lto_module_t) 0 ;
-
- arg1 = (lto_module_t)jarg1;
-
- lto_module_dispose(arg1);
-
-
-}
-
-
-
-DllExport char * SWIGSTDCALL Ada_lto_module_get_target_triple (
- void * jarg1
- )
-{
- char * jresult ;
- lto_module_t arg1 = (lto_module_t) 0 ;
- char *result = 0 ;
-
- arg1 = (lto_module_t)jarg1;
-
- result = (char *)lto_module_get_target_triple(arg1);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport unsigned int SWIGSTDCALL Ada_lto_module_get_num_symbols (
- void * jarg1
- )
-{
- unsigned int jresult ;
- lto_module_t arg1 = (lto_module_t) 0 ;
- unsigned int result;
-
- arg1 = (lto_module_t)jarg1;
-
- result = (unsigned int)lto_module_get_num_symbols(arg1);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport char * SWIGSTDCALL Ada_lto_module_get_symbol_name (
- void * jarg1
- ,
-
- unsigned int jarg2
- )
-{
- char * jresult ;
- lto_module_t arg1 = (lto_module_t) 0 ;
- unsigned int arg2 ;
- char *result = 0 ;
-
- arg1 = (lto_module_t)jarg1;
-
-
- arg2 = (unsigned int) jarg2;
-
-
- result = (char *)lto_module_get_symbol_name(arg1,arg2);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport int SWIGSTDCALL Ada_lto_module_get_symbol_attribute (
- void * jarg1
- ,
-
- unsigned int jarg2
- )
-{
- int jresult ;
- lto_module_t arg1 = (lto_module_t) 0 ;
- unsigned int arg2 ;
- lto_symbol_attributes result;
-
- arg1 = (lto_module_t)jarg1;
-
-
- arg2 = (unsigned int) jarg2;
-
-
- result = (lto_symbol_attributes)lto_module_get_symbol_attribute(arg1,arg2);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport void * SWIGSTDCALL Ada_lto_codegen_create (
- )
-{
- void * jresult ;
- lto_code_gen_t result;
-
- result = (lto_code_gen_t)lto_codegen_create();
- jresult = (void *) result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_lto_codegen_dispose (
- void * jarg1
- )
-{
- lto_code_gen_t arg1 = (lto_code_gen_t) 0 ;
-
- arg1 = (lto_code_gen_t)jarg1;
-
- lto_codegen_dispose(arg1);
-
-
-}
-
-
-
-DllExport unsigned int SWIGSTDCALL Ada_lto_codegen_add_module (
- void * jarg1
- ,
-
- void * jarg2
- )
-{
- unsigned int jresult ;
- lto_code_gen_t arg1 = (lto_code_gen_t) 0 ;
- lto_module_t arg2 = (lto_module_t) 0 ;
- bool result;
-
- arg1 = (lto_code_gen_t)jarg1;
-
- arg2 = (lto_module_t)jarg2;
-
- result = (bool)lto_codegen_add_module(arg1,arg2);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport unsigned int SWIGSTDCALL Ada_lto_codegen_set_debug_model (
- void * jarg1
- ,
-
- int jarg2
- )
-{
- unsigned int jresult ;
- lto_code_gen_t arg1 = (lto_code_gen_t) 0 ;
- lto_debug_model arg2 ;
- bool result;
-
- arg1 = (lto_code_gen_t)jarg1;
-
- arg2 = (lto_debug_model) jarg2;
-
- result = (bool)lto_codegen_set_debug_model(arg1,arg2);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport unsigned int SWIGSTDCALL Ada_lto_codegen_set_pic_model (
- void * jarg1
- ,
-
- int jarg2
- )
-{
- unsigned int jresult ;
- lto_code_gen_t arg1 = (lto_code_gen_t) 0 ;
- lto_codegen_model arg2 ;
- bool result;
-
- arg1 = (lto_code_gen_t)jarg1;
-
- arg2 = (lto_codegen_model) jarg2;
-
- result = (bool)lto_codegen_set_pic_model(arg1,arg2);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_lto_codegen_set_gcc_path (
- void * jarg1
- ,
-
- char * jarg2
- )
-{
- lto_code_gen_t arg1 = (lto_code_gen_t) 0 ;
- char *arg2 = (char *) 0 ;
-
- arg1 = (lto_code_gen_t)jarg1;
-
- arg2 = jarg2;
-
- lto_codegen_set_gcc_path(arg1,(char const *)arg2);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_lto_codegen_set_assembler_path (
- void * jarg1
- ,
-
- char * jarg2
- )
-{
- lto_code_gen_t arg1 = (lto_code_gen_t) 0 ;
- char *arg2 = (char *) 0 ;
-
- arg1 = (lto_code_gen_t)jarg1;
-
- arg2 = jarg2;
-
- lto_codegen_set_assembler_path(arg1,(char const *)arg2);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_lto_codegen_add_must_preserve_symbol (
- void * jarg1
- ,
-
- char * jarg2
- )
-{
- lto_code_gen_t arg1 = (lto_code_gen_t) 0 ;
- char *arg2 = (char *) 0 ;
-
- arg1 = (lto_code_gen_t)jarg1;
-
- arg2 = jarg2;
-
- lto_codegen_add_must_preserve_symbol(arg1,(char const *)arg2);
-
-
-}
-
-
-
-DllExport unsigned int SWIGSTDCALL Ada_lto_codegen_write_merged_modules (
- void * jarg1
- ,
-
- char * jarg2
- )
-{
- unsigned int jresult ;
- lto_code_gen_t arg1 = (lto_code_gen_t) 0 ;
- char *arg2 = (char *) 0 ;
- bool result;
-
- arg1 = (lto_code_gen_t)jarg1;
-
- arg2 = jarg2;
-
- result = (bool)lto_codegen_write_merged_modules(arg1,(char const *)arg2);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport void* SWIGSTDCALL Ada_lto_codegen_compile (
- void * jarg1
- ,
-
- size_t* jarg2
- )
-{
- void* jresult ;
- lto_code_gen_t arg1 = (lto_code_gen_t) 0 ;
- size_t *arg2 = (size_t *) 0 ;
- void *result = 0 ;
-
- arg1 = (lto_code_gen_t)jarg1;
-
-
- arg2 = (size_t *) jarg2;
-
-
- result = (void *)lto_codegen_compile(arg1,arg2);
- jresult = (void *) result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_lto_codegen_debug_options (
- void * jarg1
- ,
-
- char * jarg2
- )
-{
- lto_code_gen_t arg1 = (lto_code_gen_t) 0 ;
- char *arg2 = (char *) 0 ;
-
- arg1 = (lto_code_gen_t)jarg1;
-
- arg2 = jarg2;
-
- lto_codegen_debug_options(arg1,(char const *)arg2);
-
-
-}
-
-
-
-DllExport void* SWIGSTDCALL Ada_llvm_create_optimizer (
- )
-{
- void* jresult ;
- llvm_lto_t result;
-
- result = (llvm_lto_t)llvm_create_optimizer();
- jresult = (void *) result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_llvm_destroy_optimizer (
- void* jarg1
- )
-{
- llvm_lto_t arg1 = (llvm_lto_t) 0 ;
-
- arg1 = (llvm_lto_t)jarg1;
-
- llvm_destroy_optimizer(arg1);
-
-
-}
-
-
-
-DllExport int SWIGSTDCALL Ada_llvm_read_object_file (
- void* jarg1
- ,
-
- char * jarg2
- )
-{
- int jresult ;
- llvm_lto_t arg1 = (llvm_lto_t) 0 ;
- char *arg2 = (char *) 0 ;
- llvm_lto_status_t result;
-
- arg1 = (llvm_lto_t)jarg1;
-
- arg2 = jarg2;
-
- result = (llvm_lto_status_t)llvm_read_object_file(arg1,(char const *)arg2);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport int SWIGSTDCALL Ada_llvm_optimize_modules (
- void* jarg1
- ,
-
- char * jarg2
- )
-{
- int jresult ;
- llvm_lto_t arg1 = (llvm_lto_t) 0 ;
- char *arg2 = (char *) 0 ;
- llvm_lto_status_t result;
-
- arg1 = (llvm_lto_t)jarg1;
-
- arg2 = jarg2;
-
- result = (llvm_lto_status_t)llvm_optimize_modules(arg1,(char const *)arg2);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-#ifdef __cplusplus
-}
-#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifdef __cplusplus
-}
-#endif
-
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 79b19ff..0000000
--- 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<typename T> class SwigValueWrapper {
- T *tt;
-public:
- SwigValueWrapper() : tt(0) { }
- SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
- SwigValueWrapper(const T& t) : tt(new T(t)) { }
- ~SwigValueWrapper() { delete tt; }
- SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
- operator T&() const { return *tt; }
- T *operator&() { return tt; }
-private:
- SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
-};
-
-template <typename T> T SwigValueInit() {
- return T();
-}
-#endif
-
-/* -----------------------------------------------------------------------------
- * This section contains generic SWIG labels for method/variable
- * declarations/attributes, and other compiler dependent labels.
- * ----------------------------------------------------------------------------- */
-
-/* template workaround for compilers that cannot correctly implement the C++ standard */
-#ifndef SWIGTEMPLATEDISAMBIGUATOR
-# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
-# define SWIGTEMPLATEDISAMBIGUATOR template
-# elif defined(__HP_aCC)
-/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
-/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
-# define SWIGTEMPLATEDISAMBIGUATOR template
-# else
-# define SWIGTEMPLATEDISAMBIGUATOR
-# endif
-#endif
-
-/* inline attribute */
-#ifndef SWIGINLINE
-# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
-# define SWIGINLINE inline
-# else
-# define SWIGINLINE
-# endif
-#endif
-
-/* attribute recognised by some compilers to avoid 'unused' warnings */
-#ifndef SWIGUNUSED
-# if defined(__GNUC__)
-# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-# define SWIGUNUSED __attribute__ ((__unused__))
-# else
-# define SWIGUNUSED
-# endif
-# elif defined(__ICC)
-# define SWIGUNUSED __attribute__ ((__unused__))
-# else
-# define SWIGUNUSED
-# endif
-#endif
-
-#ifndef SWIGUNUSEDPARM
-# ifdef __cplusplus
-# define SWIGUNUSEDPARM(p)
-# else
-# define SWIGUNUSEDPARM(p) p SWIGUNUSED
-# endif
-#endif
-
-/* internal SWIG method */
-#ifndef SWIGINTERN
-# define SWIGINTERN static SWIGUNUSED
-#endif
-
-/* internal inline SWIG method */
-#ifndef SWIGINTERNINLINE
-# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
-#endif
-
-/* exporting methods */
-#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-# ifndef GCC_HASCLASSVISIBILITY
-# define GCC_HASCLASSVISIBILITY
-# endif
-#endif
-
-#ifndef SWIGEXPORT
-# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-# if defined(STATIC_LINKED)
-# define SWIGEXPORT
-# else
-# define SWIGEXPORT __declspec(dllexport)
-# endif
-# else
-# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
-# define SWIGEXPORT __attribute__ ((visibility("default")))
-# else
-# define SWIGEXPORT
-# endif
-# endif
-#endif
-
-/* calling conventions for Windows */
-#ifndef SWIGSTDCALL
-# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-# define SWIGSTDCALL __stdcall
-# else
-# define SWIGSTDCALL
-# endif
-#endif
-
-/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
-#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
-# define _CRT_SECURE_NO_DEPRECATE
-#endif
-
-/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
-#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
-# define _SCL_SECURE_NO_DEPRECATE
-#endif
-
-
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#if defined(_WIN32) || defined(__CYGWIN32__)
-# define DllExport __declspec( dllexport )
-# define SWIGSTDCALL __stdcall
-#else
-# define DllExport
-# define SWIGSTDCALL
-#endif
-
-
-#ifdef __cplusplus
-# include <new>
-#endif
-
-
-
-
-/* Support for throwing Ada exceptions from C/C++ */
-
-typedef enum
-{
- SWIG_AdaException,
- SWIG_AdaOutOfMemoryException,
- SWIG_AdaIndexOutOfRangeException,
- SWIG_AdaDivideByZeroException,
- SWIG_AdaArgumentOutOfRangeException,
- SWIG_AdaNullReferenceException
-} SWIG_AdaExceptionCodes;
-
-
-typedef void (SWIGSTDCALL* SWIG_AdaExceptionCallback_t)(const char *);
-
-
-typedef struct
-{
- SWIG_AdaExceptionCodes code;
- SWIG_AdaExceptionCallback_t callback;
-}
- SWIG_AdaExceptions_t;
-
-
-static
-SWIG_AdaExceptions_t
-SWIG_ada_exceptions[] =
-{
- { SWIG_AdaException, NULL },
- { SWIG_AdaOutOfMemoryException, NULL },
- { SWIG_AdaIndexOutOfRangeException, NULL },
- { SWIG_AdaDivideByZeroException, NULL },
- { SWIG_AdaArgumentOutOfRangeException, NULL },
- { SWIG_AdaNullReferenceException, NULL }
-};
-
-
-static
-void
-SWIG_AdaThrowException (SWIG_AdaExceptionCodes code, const char *msg)
-{
- SWIG_AdaExceptionCallback_t callback = SWIG_ada_exceptions[SWIG_AdaException].callback;
- if (code >=0 && (size_t)code < sizeof(SWIG_ada_exceptions)/sizeof(SWIG_AdaExceptions_t)) {
- callback = SWIG_ada_exceptions[code].callback;
- }
- callback(msg);
-}
-
-
-
-#ifdef __cplusplus
-extern "C"
-#endif
-
-DllExport void SWIGSTDCALL SWIGRegisterExceptionCallbacks_llvm (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 61201c8..0000000
--- 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 11cb05d..0000000
--- 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 16aca8a..0000000
--- 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<typename T> class SwigValueWrapper {
- T *tt;
-public:
- SwigValueWrapper() : tt(0) { }
- SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
- SwigValueWrapper(const T& t) : tt(new T(t)) { }
- ~SwigValueWrapper() { delete tt; }
- SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
- operator T&() const { return *tt; }
- T *operator&() { return tt; }
-private:
- SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
-};
-
-template <typename T> T SwigValueInit() {
- return T();
-}
-#endif
-
-/* -----------------------------------------------------------------------------
- * This section contains generic SWIG labels for method/variable
- * declarations/attributes, and other compiler dependent labels.
- * ----------------------------------------------------------------------------- */
-
-/* template workaround for compilers that cannot correctly implement the C++ standard */
-#ifndef SWIGTEMPLATEDISAMBIGUATOR
-# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
-# define SWIGTEMPLATEDISAMBIGUATOR template
-# elif defined(__HP_aCC)
-/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
-/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
-# define SWIGTEMPLATEDISAMBIGUATOR template
-# else
-# define SWIGTEMPLATEDISAMBIGUATOR
-# endif
-#endif
-
-/* inline attribute */
-#ifndef SWIGINLINE
-# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
-# define SWIGINLINE inline
-# else
-# define SWIGINLINE
-# endif
-#endif
-
-/* attribute recognised by some compilers to avoid 'unused' warnings */
-#ifndef SWIGUNUSED
-# if defined(__GNUC__)
-# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-# define SWIGUNUSED __attribute__ ((__unused__))
-# else
-# define SWIGUNUSED
-# endif
-# elif defined(__ICC)
-# define SWIGUNUSED __attribute__ ((__unused__))
-# else
-# define SWIGUNUSED
-# endif
-#endif
-
-#ifndef SWIGUNUSEDPARM
-# ifdef __cplusplus
-# define SWIGUNUSEDPARM(p)
-# else
-# define SWIGUNUSEDPARM(p) p SWIGUNUSED
-# endif
-#endif
-
-/* internal SWIG method */
-#ifndef SWIGINTERN
-# define SWIGINTERN static SWIGUNUSED
-#endif
-
-/* internal inline SWIG method */
-#ifndef SWIGINTERNINLINE
-# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
-#endif
-
-/* exporting methods */
-#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-# ifndef GCC_HASCLASSVISIBILITY
-# define GCC_HASCLASSVISIBILITY
-# endif
-#endif
-
-#ifndef SWIGEXPORT
-# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-# if defined(STATIC_LINKED)
-# define SWIGEXPORT
-# else
-# define SWIGEXPORT __declspec(dllexport)
-# endif
-# else
-# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
-# define SWIGEXPORT __attribute__ ((visibility("default")))
-# else
-# define SWIGEXPORT
-# endif
-# endif
-#endif
-
-/* calling conventions for Windows */
-#ifndef SWIGSTDCALL
-# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-# define SWIGSTDCALL __stdcall
-# else
-# define SWIGSTDCALL
-# endif
-#endif
-
-/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
-#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
-# define _CRT_SECURE_NO_DEPRECATE
-#endif
-
-/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
-#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
-# define _SCL_SECURE_NO_DEPRECATE
-#endif
-
-
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#if defined(_WIN32) || defined(__CYGWIN32__)
-# define DllExport __declspec( dllexport )
-# define SWIGSTDCALL __stdcall
-#else
-# define DllExport
-# define SWIGSTDCALL
-#endif
-
-
-#ifdef __cplusplus
-# include <new>
-#endif
-
-
-
-
-/* Support for throwing Ada exceptions from C/C++ */
-
-typedef enum
-{
- SWIG_AdaException,
- SWIG_AdaOutOfMemoryException,
- SWIG_AdaIndexOutOfRangeException,
- SWIG_AdaDivideByZeroException,
- SWIG_AdaArgumentOutOfRangeException,
- SWIG_AdaNullReferenceException
-} SWIG_AdaExceptionCodes;
-
-
-typedef void (SWIGSTDCALL* SWIG_AdaExceptionCallback_t)(const char *);
-
-
-typedef struct
-{
- SWIG_AdaExceptionCodes code;
- SWIG_AdaExceptionCallback_t callback;
-}
- SWIG_AdaExceptions_t;
-
-
-static
-SWIG_AdaExceptions_t
-SWIG_ada_exceptions[] =
-{
- { SWIG_AdaException, NULL },
- { SWIG_AdaOutOfMemoryException, NULL },
- { SWIG_AdaIndexOutOfRangeException, NULL },
- { SWIG_AdaDivideByZeroException, NULL },
- { SWIG_AdaArgumentOutOfRangeException, NULL },
- { SWIG_AdaNullReferenceException, NULL }
-};
-
-
-static
-void
-SWIG_AdaThrowException (SWIG_AdaExceptionCodes code, const char *msg)
-{
- SWIG_AdaExceptionCallback_t callback = SWIG_ada_exceptions[SWIG_AdaException].callback;
- if (code >=0 && (size_t)code < sizeof(SWIG_ada_exceptions)/sizeof(SWIG_AdaExceptions_t)) {
- callback = SWIG_ada_exceptions[code].callback;
- }
- callback(msg);
-}
-
-
-
-#ifdef __cplusplus
-extern "C"
-#endif
-
-DllExport void SWIGSTDCALL SWIGRegisterExceptionCallbacks_LLVM_Target (SWIG_AdaExceptionCallback_t systemException,
- SWIG_AdaExceptionCallback_t outOfMemory,
- SWIG_AdaExceptionCallback_t indexOutOfRange,
- SWIG_AdaExceptionCallback_t divideByZero,
- SWIG_AdaExceptionCallback_t argumentOutOfRange,
- SWIG_AdaExceptionCallback_t nullReference)
-{
- SWIG_ada_exceptions [SWIG_AdaException].callback = systemException;
- SWIG_ada_exceptions [SWIG_AdaOutOfMemoryException].callback = outOfMemory;
- SWIG_ada_exceptions [SWIG_AdaIndexOutOfRangeException].callback = indexOutOfRange;
- SWIG_ada_exceptions [SWIG_AdaDivideByZeroException].callback = divideByZero;
- SWIG_ada_exceptions [SWIG_AdaArgumentOutOfRangeException].callback = argumentOutOfRange;
- SWIG_ada_exceptions [SWIG_AdaNullReferenceException].callback = nullReference;
-}
-
-
-/* Callback for returning strings to Ada without leaking memory */
-
-typedef char * (SWIGSTDCALL* SWIG_AdaStringHelperCallback)(const char *);
-static SWIG_AdaStringHelperCallback SWIG_ada_string_callback = NULL;
-
-
-
-/* probably obsolete ...
-#ifdef __cplusplus
-extern "C"
-#endif
-DllExport void SWIGSTDCALL SWIGRegisterStringCallback_LLVM_Target(SWIG_AdaStringHelperCallback callback) {
- SWIG_ada_string_callback = callback;
-}
-*/
-
-
-
-/* Contract support */
-
-#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_AdaThrowException(SWIG_AdaArgumentOutOfRangeException, msg); return nullreturn; } else
-
-
-#define protected public
-#define private public
-
-#include "llvm-c/Target.h"
-
-
-
-// struct LLVMCtxt;
-
-
-#undef protected
-#undef private
-#ifdef __cplusplus
-extern "C" {
-#endif
-DllExport void SWIGSTDCALL Ada_LLVMInitializeAllTargets (
- )
-{
- LLVMInitializeAllTargets();
-
-
-}
-
-
-
-DllExport int SWIGSTDCALL Ada_LLVMInitializeNativeTarget (
- )
-{
- int jresult ;
- int result;
-
- result = (int)LLVMInitializeNativeTarget();
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport void * SWIGSTDCALL Ada_LLVMCreateTargetData (
- char * jarg1
- )
-{
- void * jresult ;
- char *arg1 = (char *) 0 ;
- LLVMTargetDataRef result;
-
- arg1 = jarg1;
-
- result = (LLVMTargetDataRef)LLVMCreateTargetData((char const *)arg1);
- jresult = (void *) result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddTargetData (
- void * jarg1
- ,
-
- void * jarg2
- )
-{
- LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
- LLVMPassManagerRef arg2 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMTargetDataRef)jarg1;
-
- arg2 = (LLVMPassManagerRef)jarg2;
-
- LLVMAddTargetData(arg1,arg2);
-
-
-}
-
-
-
-DllExport char * SWIGSTDCALL Ada_LLVMCopyStringRepOfTargetData (
- void * jarg1
- )
-{
- char * jresult ;
- LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
- char *result = 0 ;
-
- arg1 = (LLVMTargetDataRef)jarg1;
-
- result = (char *)LLVMCopyStringRepOfTargetData(arg1);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport int SWIGSTDCALL Ada_LLVMByteOrder (
- void * jarg1
- )
-{
- int jresult ;
- LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
- LLVMByteOrdering result;
-
- arg1 = (LLVMTargetDataRef)jarg1;
-
- result = (LLVMByteOrdering)LLVMByteOrder(arg1);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport unsigned int SWIGSTDCALL Ada_LLVMPointerSize (
- void * jarg1
- )
-{
- unsigned int jresult ;
- LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
- unsigned int result;
-
- arg1 = (LLVMTargetDataRef)jarg1;
-
- result = (unsigned int)LLVMPointerSize(arg1);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport void * SWIGSTDCALL Ada_LLVMIntPtrType (
- void * jarg1
- )
-{
- void * jresult ;
- LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
- LLVMTypeRef result;
-
- arg1 = (LLVMTargetDataRef)jarg1;
-
- result = (LLVMTypeRef)LLVMIntPtrType(arg1);
- jresult = (void *) result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport unsigned long long SWIGSTDCALL Ada_LLVMSizeOfTypeInBits (
- void * jarg1
- ,
-
- void * jarg2
- )
-{
- unsigned long long jresult ;
- LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
- LLVMTypeRef arg2 = (LLVMTypeRef) 0 ;
- unsigned long long result;
-
- arg1 = (LLVMTargetDataRef)jarg1;
-
- arg2 = (LLVMTypeRef)jarg2;
-
- result = (unsigned long long)LLVMSizeOfTypeInBits(arg1,arg2);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport unsigned long long SWIGSTDCALL Ada_LLVMStoreSizeOfType (
- void * jarg1
- ,
-
- void * jarg2
- )
-{
- unsigned long long jresult ;
- LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
- LLVMTypeRef arg2 = (LLVMTypeRef) 0 ;
- unsigned long long result;
-
- arg1 = (LLVMTargetDataRef)jarg1;
-
- arg2 = (LLVMTypeRef)jarg2;
-
- result = (unsigned long long)LLVMStoreSizeOfType(arg1,arg2);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport unsigned long long SWIGSTDCALL Ada_LLVMABISizeOfType (
- void * jarg1
- ,
-
- void * jarg2
- )
-{
- unsigned long long jresult ;
- LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
- LLVMTypeRef arg2 = (LLVMTypeRef) 0 ;
- unsigned long long result;
-
- arg1 = (LLVMTargetDataRef)jarg1;
-
- arg2 = (LLVMTypeRef)jarg2;
-
- result = (unsigned long long)LLVMABISizeOfType(arg1,arg2);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport unsigned int SWIGSTDCALL Ada_LLVMABIAlignmentOfType (
- void * jarg1
- ,
-
- void * jarg2
- )
-{
- unsigned int jresult ;
- LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
- LLVMTypeRef arg2 = (LLVMTypeRef) 0 ;
- unsigned int result;
-
- arg1 = (LLVMTargetDataRef)jarg1;
-
- arg2 = (LLVMTypeRef)jarg2;
-
- result = (unsigned int)LLVMABIAlignmentOfType(arg1,arg2);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport unsigned int SWIGSTDCALL Ada_LLVMCallFrameAlignmentOfType (
- void * jarg1
- ,
-
- void * jarg2
- )
-{
- unsigned int jresult ;
- LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
- LLVMTypeRef arg2 = (LLVMTypeRef) 0 ;
- unsigned int result;
-
- arg1 = (LLVMTargetDataRef)jarg1;
-
- arg2 = (LLVMTypeRef)jarg2;
-
- result = (unsigned int)LLVMCallFrameAlignmentOfType(arg1,arg2);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport unsigned int SWIGSTDCALL Ada_LLVMPreferredAlignmentOfType (
- void * jarg1
- ,
-
- void * jarg2
- )
-{
- unsigned int jresult ;
- LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
- LLVMTypeRef arg2 = (LLVMTypeRef) 0 ;
- unsigned int result;
-
- arg1 = (LLVMTargetDataRef)jarg1;
-
- arg2 = (LLVMTypeRef)jarg2;
-
- result = (unsigned int)LLVMPreferredAlignmentOfType(arg1,arg2);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport unsigned int SWIGSTDCALL Ada_LLVMPreferredAlignmentOfGlobal (
- void * jarg1
- ,
-
- void * jarg2
- )
-{
- unsigned int jresult ;
- LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
- LLVMValueRef arg2 = (LLVMValueRef) 0 ;
- unsigned int result;
-
- arg1 = (LLVMTargetDataRef)jarg1;
-
- arg2 = (LLVMValueRef)jarg2;
-
- result = (unsigned int)LLVMPreferredAlignmentOfGlobal(arg1,arg2);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport unsigned int SWIGSTDCALL Ada_LLVMElementAtOffset (
- void * jarg1
- ,
-
- void * jarg2
- ,
-
- unsigned long long jarg3
- )
-{
- unsigned int jresult ;
- LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
- LLVMTypeRef arg2 = (LLVMTypeRef) 0 ;
- unsigned long long arg3 ;
- unsigned int result;
-
- arg1 = (LLVMTargetDataRef)jarg1;
-
- arg2 = (LLVMTypeRef)jarg2;
-
-
- arg3 = (unsigned long long) jarg3;
-
-
- result = (unsigned int)LLVMElementAtOffset(arg1,arg2,arg3);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport unsigned long long SWIGSTDCALL Ada_LLVMOffsetOfElement (
- void * jarg1
- ,
-
- void * jarg2
- ,
-
- unsigned int jarg3
- )
-{
- unsigned long long jresult ;
- LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
- LLVMTypeRef arg2 = (LLVMTypeRef) 0 ;
- unsigned int arg3 ;
- unsigned long long result;
-
- arg1 = (LLVMTargetDataRef)jarg1;
-
- arg2 = (LLVMTypeRef)jarg2;
-
-
- arg3 = (unsigned int) jarg3;
-
-
- result = (unsigned long long)LLVMOffsetOfElement(arg1,arg2,arg3);
- jresult = result;
-
-
-
- return jresult;
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMInvalidateStructLayout (
- void * jarg1
- ,
-
- void * jarg2
- )
-{
- LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
- LLVMTypeRef arg2 = (LLVMTypeRef) 0 ;
-
- arg1 = (LLVMTargetDataRef)jarg1;
-
- arg2 = (LLVMTypeRef)jarg2;
-
- LLVMInvalidateStructLayout(arg1,arg2);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMDisposeTargetData (
- void * jarg1
- )
-{
- LLVMTargetDataRef arg1 = (LLVMTargetDataRef) 0 ;
-
- arg1 = (LLVMTargetDataRef)jarg1;
-
- LLVMDisposeTargetData(arg1);
-
-
-}
-
-
-
-#ifdef __cplusplus
-}
-#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifdef __cplusplus
-}
-#endif
-
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 2254b6e..0000000
--- 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 4f37aaf..0000000
--- 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 8cb04db..0000000
--- 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<typename T> class SwigValueWrapper {
- T *tt;
-public:
- SwigValueWrapper() : tt(0) { }
- SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
- SwigValueWrapper(const T& t) : tt(new T(t)) { }
- ~SwigValueWrapper() { delete tt; }
- SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
- operator T&() const { return *tt; }
- T *operator&() { return tt; }
-private:
- SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
-};
-
-template <typename T> T SwigValueInit() {
- return T();
-}
-#endif
-
-/* -----------------------------------------------------------------------------
- * This section contains generic SWIG labels for method/variable
- * declarations/attributes, and other compiler dependent labels.
- * ----------------------------------------------------------------------------- */
-
-/* template workaround for compilers that cannot correctly implement the C++ standard */
-#ifndef SWIGTEMPLATEDISAMBIGUATOR
-# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
-# define SWIGTEMPLATEDISAMBIGUATOR template
-# elif defined(__HP_aCC)
-/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
-/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
-# define SWIGTEMPLATEDISAMBIGUATOR template
-# else
-# define SWIGTEMPLATEDISAMBIGUATOR
-# endif
-#endif
-
-/* inline attribute */
-#ifndef SWIGINLINE
-# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
-# define SWIGINLINE inline
-# else
-# define SWIGINLINE
-# endif
-#endif
-
-/* attribute recognised by some compilers to avoid 'unused' warnings */
-#ifndef SWIGUNUSED
-# if defined(__GNUC__)
-# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-# define SWIGUNUSED __attribute__ ((__unused__))
-# else
-# define SWIGUNUSED
-# endif
-# elif defined(__ICC)
-# define SWIGUNUSED __attribute__ ((__unused__))
-# else
-# define SWIGUNUSED
-# endif
-#endif
-
-#ifndef SWIGUNUSEDPARM
-# ifdef __cplusplus
-# define SWIGUNUSEDPARM(p)
-# else
-# define SWIGUNUSEDPARM(p) p SWIGUNUSED
-# endif
-#endif
-
-/* internal SWIG method */
-#ifndef SWIGINTERN
-# define SWIGINTERN static SWIGUNUSED
-#endif
-
-/* internal inline SWIG method */
-#ifndef SWIGINTERNINLINE
-# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
-#endif
-
-/* exporting methods */
-#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-# ifndef GCC_HASCLASSVISIBILITY
-# define GCC_HASCLASSVISIBILITY
-# endif
-#endif
-
-#ifndef SWIGEXPORT
-# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-# if defined(STATIC_LINKED)
-# define SWIGEXPORT
-# else
-# define SWIGEXPORT __declspec(dllexport)
-# endif
-# else
-# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
-# define SWIGEXPORT __attribute__ ((visibility("default")))
-# else
-# define SWIGEXPORT
-# endif
-# endif
-#endif
-
-/* calling conventions for Windows */
-#ifndef SWIGSTDCALL
-# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
-# define SWIGSTDCALL __stdcall
-# else
-# define SWIGSTDCALL
-# endif
-#endif
-
-/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
-#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
-# define _CRT_SECURE_NO_DEPRECATE
-#endif
-
-/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
-#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
-# define _SCL_SECURE_NO_DEPRECATE
-#endif
-
-
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#if defined(_WIN32) || defined(__CYGWIN32__)
-# define DllExport __declspec( dllexport )
-# define SWIGSTDCALL __stdcall
-#else
-# define DllExport
-# define SWIGSTDCALL
-#endif
-
-
-#ifdef __cplusplus
-# include <new>
-#endif
-
-
-
-
-/* Support for throwing Ada exceptions from C/C++ */
-
-typedef enum
-{
- SWIG_AdaException,
- SWIG_AdaOutOfMemoryException,
- SWIG_AdaIndexOutOfRangeException,
- SWIG_AdaDivideByZeroException,
- SWIG_AdaArgumentOutOfRangeException,
- SWIG_AdaNullReferenceException
-} SWIG_AdaExceptionCodes;
-
-
-typedef void (SWIGSTDCALL* SWIG_AdaExceptionCallback_t)(const char *);
-
-
-typedef struct
-{
- SWIG_AdaExceptionCodes code;
- SWIG_AdaExceptionCallback_t callback;
-}
- SWIG_AdaExceptions_t;
-
-
-static
-SWIG_AdaExceptions_t
-SWIG_ada_exceptions[] =
-{
- { SWIG_AdaException, NULL },
- { SWIG_AdaOutOfMemoryException, NULL },
- { SWIG_AdaIndexOutOfRangeException, NULL },
- { SWIG_AdaDivideByZeroException, NULL },
- { SWIG_AdaArgumentOutOfRangeException, NULL },
- { SWIG_AdaNullReferenceException, NULL }
-};
-
-
-static
-void
-SWIG_AdaThrowException (SWIG_AdaExceptionCodes code, const char *msg)
-{
- SWIG_AdaExceptionCallback_t callback = SWIG_ada_exceptions[SWIG_AdaException].callback;
- if (code >=0 && (size_t)code < sizeof(SWIG_ada_exceptions)/sizeof(SWIG_AdaExceptions_t)) {
- callback = SWIG_ada_exceptions[code].callback;
- }
- callback(msg);
-}
-
-
-
-#ifdef __cplusplus
-extern "C"
-#endif
-
-DllExport void SWIGSTDCALL SWIGRegisterExceptionCallbacks_LLVM_Transforms (SWIG_AdaExceptionCallback_t systemException,
- SWIG_AdaExceptionCallback_t outOfMemory,
- SWIG_AdaExceptionCallback_t indexOutOfRange,
- SWIG_AdaExceptionCallback_t divideByZero,
- SWIG_AdaExceptionCallback_t argumentOutOfRange,
- SWIG_AdaExceptionCallback_t nullReference)
-{
- SWIG_ada_exceptions [SWIG_AdaException].callback = systemException;
- SWIG_ada_exceptions [SWIG_AdaOutOfMemoryException].callback = outOfMemory;
- SWIG_ada_exceptions [SWIG_AdaIndexOutOfRangeException].callback = indexOutOfRange;
- SWIG_ada_exceptions [SWIG_AdaDivideByZeroException].callback = divideByZero;
- SWIG_ada_exceptions [SWIG_AdaArgumentOutOfRangeException].callback = argumentOutOfRange;
- SWIG_ada_exceptions [SWIG_AdaNullReferenceException].callback = nullReference;
-}
-
-
-/* Callback for returning strings to Ada without leaking memory */
-
-typedef char * (SWIGSTDCALL* SWIG_AdaStringHelperCallback)(const char *);
-static SWIG_AdaStringHelperCallback SWIG_ada_string_callback = NULL;
-
-
-
-/* probably obsolete ...
-#ifdef __cplusplus
-extern "C"
-#endif
-DllExport void SWIGSTDCALL SWIGRegisterStringCallback_LLVM_Transforms(SWIG_AdaStringHelperCallback callback) {
- SWIG_ada_string_callback = callback;
-}
-*/
-
-
-
-/* Contract support */
-
-#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_AdaThrowException(SWIG_AdaArgumentOutOfRangeException, msg); return nullreturn; } else
-
-
-#define protected public
-#define private public
-
-#include "llvm-c/Transforms/IPO.h"
-#include "llvm-c/Transforms/Scalar.h"
-
-
-
-// struct LLVMCtxt;
-
-
-#undef protected
-#undef private
-#ifdef __cplusplus
-extern "C" {
-#endif
-DllExport void SWIGSTDCALL Ada_LLVMAddArgumentPromotionPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddArgumentPromotionPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddConstantMergePass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddConstantMergePass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddDeadArgEliminationPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddDeadArgEliminationPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddDeadTypeEliminationPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddDeadTypeEliminationPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddFunctionAttrsPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddFunctionAttrsPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddFunctionInliningPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddFunctionInliningPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddGlobalDCEPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddGlobalDCEPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddGlobalOptimizerPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddGlobalOptimizerPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddIPConstantPropagationPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddIPConstantPropagationPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddLowerSetJmpPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddLowerSetJmpPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddPruneEHPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddPruneEHPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddRaiseAllocationsPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddRaiseAllocationsPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddStripDeadPrototypesPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddStripDeadPrototypesPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddStripSymbolsPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddStripSymbolsPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddAggressiveDCEPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddAggressiveDCEPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddCFGSimplificationPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddCFGSimplificationPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddCondPropagationPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddCondPropagationPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddDeadStoreEliminationPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddDeadStoreEliminationPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddGVNPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddGVNPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddIndVarSimplifyPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddIndVarSimplifyPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddInstructionCombiningPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddInstructionCombiningPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddJumpThreadingPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddJumpThreadingPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddLICMPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddLICMPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddLoopDeletionPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddLoopDeletionPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddLoopIndexSplitPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddLoopIndexSplitPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddLoopRotatePass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddLoopRotatePass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddLoopUnrollPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddLoopUnrollPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddLoopUnswitchPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddLoopUnswitchPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddMemCpyOptPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddMemCpyOptPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddPromoteMemoryToRegisterPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddPromoteMemoryToRegisterPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddReassociatePass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddReassociatePass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddSCCPPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddSCCPPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddScalarReplAggregatesPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddScalarReplAggregatesPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddSimplifyLibCallsPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddSimplifyLibCallsPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddTailCallEliminationPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddTailCallEliminationPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddConstantPropagationPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddConstantPropagationPass(arg1);
-
-
-}
-
-
-
-DllExport void SWIGSTDCALL Ada_LLVMAddDemoteMemoryToRegisterPass (
- void * jarg1
- )
-{
- LLVMPassManagerRef arg1 = (LLVMPassManagerRef) 0 ;
-
- arg1 = (LLVMPassManagerRef)jarg1;
-
- LLVMAddDemoteMemoryToRegisterPass(arg1);
-
-
-}
-
-
-
-#ifdef __cplusplus
-}
-#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-#ifdef __cplusplus
-}
-#endif
-
diff --git a/contrib/llvm/bindings/ocaml/Makefile b/contrib/llvm/bindings/ocaml/Makefile
deleted file mode 100644
index a89caef..0000000
--- 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 1cff422..0000000
--- 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 cbfcb24..0000000
--- 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 9716705..0000000
--- 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 fc4d203..0000000
--- 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 793f482..0000000
--- 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 a1c7de8..0000000
--- 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 ef72ce2..0000000
--- 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 8b9d01d..0000000
--- 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 5e22409..0000000
--- 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 cec0a59..0000000
--- 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 53c93cb..0000000
--- 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 3e69a3c..0000000
--- 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 ea9a876..0000000
--- 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 5fa3f22..0000000
--- 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 5b1e32e..0000000
--- 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 <string.h>
-#include <assert.h>
-
-/* Force the LLVM interpreter and JIT to be linked in. */
-void llvm_initialize(void) {
- LLVMLinkInInterpreter();
- LLVMLinkInJIT();
-}
-
-/* unit -> bool */
-CAMLprim value llvm_initialize_native_target(value Unit) {
- return Val_bool(LLVMInitializeNativeTarget());
-}
-
-/* Can't use the recommended caml_named_value mechanism for backwards
- compatibility reasons. This is largely equivalent. */
-static value llvm_ee_error_exn;
-
-CAMLprim value llvm_register_ee_exns(value Error) {
- llvm_ee_error_exn = Field(Error, 0);
- register_global_root(&llvm_ee_error_exn);
- return Val_unit;
-}
-
-static void llvm_raise(value Prototype, char *Message) {
- CAMLparam1(Prototype);
- CAMLlocal1(CamlMessage);
-
- CamlMessage = copy_string(Message);
- LLVMDisposeMessage(Message);
-
- raise_with_arg(Prototype, CamlMessage);
- abort(); /* NOTREACHED */
-#ifdef CAMLnoreturn
- CAMLnoreturn; /* Silences warnings, but is missing in some versions. */
-#endif
-}
-
-
-/*--... Operations on generic values .......................................--*/
-
-#define Genericvalue_val(v) (*(LLVMGenericValueRef *)(Data_custom_val(v)))
-
-static void llvm_finalize_generic_value(value GenVal) {
- LLVMDisposeGenericValue(Genericvalue_val(GenVal));
-}
-
-static struct custom_operations generic_value_ops = {
- (char *) "LLVMGenericValue",
- llvm_finalize_generic_value,
- custom_compare_default,
- custom_hash_default,
- custom_serialize_default,
- custom_deserialize_default
-};
-
-static value alloc_generic_value(LLVMGenericValueRef Ref) {
- value Val = alloc_custom(&generic_value_ops, sizeof(LLVMGenericValueRef), 0, 1);
- Genericvalue_val(Val) = Ref;
- return Val;
-}
-
-/* Llvm.lltype -> float -> t */
-CAMLprim value llvm_genericvalue_of_float(LLVMTypeRef Ty, value N) {
- CAMLparam1(N);
- CAMLreturn(alloc_generic_value(
- LLVMCreateGenericValueOfFloat(Ty, Double_val(N))));
-}
-
-/* 'a -> t */
-CAMLprim value llvm_genericvalue_of_pointer(value V) {
- CAMLparam1(V);
- CAMLreturn(alloc_generic_value(LLVMCreateGenericValueOfPointer(Op_val(V))));
-}
-
-/* Llvm.lltype -> int -> t */
-CAMLprim value llvm_genericvalue_of_int(LLVMTypeRef Ty, value Int) {
- return alloc_generic_value(LLVMCreateGenericValueOfInt(Ty, Int_val(Int), 1));
-}
-
-/* Llvm.lltype -> int32 -> t */
-CAMLprim value llvm_genericvalue_of_int32(LLVMTypeRef Ty, value Int32) {
- CAMLparam1(Int32);
- CAMLreturn(alloc_generic_value(
- LLVMCreateGenericValueOfInt(Ty, Int32_val(Int32), 1)));
-}
-
-/* Llvm.lltype -> nativeint -> t */
-CAMLprim value llvm_genericvalue_of_nativeint(LLVMTypeRef Ty, value NatInt) {
- CAMLparam1(NatInt);
- CAMLreturn(alloc_generic_value(
- LLVMCreateGenericValueOfInt(Ty, Nativeint_val(NatInt), 1)));
-}
-
-/* Llvm.lltype -> int64 -> t */
-CAMLprim value llvm_genericvalue_of_int64(LLVMTypeRef Ty, value Int64) {
- CAMLparam1(Int64);
- CAMLreturn(alloc_generic_value(
- LLVMCreateGenericValueOfInt(Ty, Int64_val(Int64), 1)));
-}
-
-/* Llvm.lltype -> t -> float */
-CAMLprim value llvm_genericvalue_as_float(LLVMTypeRef Ty, value GenVal) {
- CAMLparam1(GenVal);
- CAMLreturn(copy_double(
- LLVMGenericValueToFloat(Ty, Genericvalue_val(GenVal))));
-}
-
-/* t -> 'a */
-CAMLprim value llvm_genericvalue_as_pointer(value GenVal) {
- return Val_op(LLVMGenericValueToPointer(Genericvalue_val(GenVal)));
-}
-
-/* t -> int */
-CAMLprim value llvm_genericvalue_as_int(value GenVal) {
- assert(LLVMGenericValueIntWidth(Genericvalue_val(GenVal)) <= 8 * sizeof(value)
- && "Generic value too wide to treat as an int!");
- return Val_int(LLVMGenericValueToInt(Genericvalue_val(GenVal), 1));
-}
-
-/* t -> int32 */
-CAMLprim value llvm_genericvalue_as_int32(value GenVal) {
- CAMLparam1(GenVal);
- assert(LLVMGenericValueIntWidth(Genericvalue_val(GenVal)) <= 32
- && "Generic value too wide to treat as an int32!");
- CAMLreturn(copy_int32(LLVMGenericValueToInt(Genericvalue_val(GenVal), 1)));
-}
-
-/* t -> int64 */
-CAMLprim value llvm_genericvalue_as_int64(value GenVal) {
- CAMLparam1(GenVal);
- assert(LLVMGenericValueIntWidth(Genericvalue_val(GenVal)) <= 64
- && "Generic value too wide to treat as an int64!");
- CAMLreturn(copy_int64(LLVMGenericValueToInt(Genericvalue_val(GenVal), 1)));
-}
-
-/* t -> nativeint */
-CAMLprim value llvm_genericvalue_as_nativeint(value GenVal) {
- CAMLparam1(GenVal);
- assert(LLVMGenericValueIntWidth(Genericvalue_val(GenVal)) <= 8 * sizeof(value)
- && "Generic value too wide to treat as a nativeint!");
- CAMLreturn(copy_nativeint(LLVMGenericValueToInt(Genericvalue_val(GenVal),1)));
-}
-
-
-/*--... Operations on execution engines ....................................--*/
-
-/* llmodule -> ExecutionEngine.t */
-CAMLprim LLVMExecutionEngineRef llvm_ee_create(LLVMModuleRef M) {
- LLVMExecutionEngineRef Interp;
- char *Error;
- if (LLVMCreateExecutionEngineForModule(&Interp, M, &Error))
- llvm_raise(llvm_ee_error_exn, Error);
- return Interp;
-}
-
-/* llmodule -> ExecutionEngine.t */
-CAMLprim LLVMExecutionEngineRef
-llvm_ee_create_interpreter(LLVMModuleRef M) {
- LLVMExecutionEngineRef Interp;
- char *Error;
- if (LLVMCreateInterpreterForModule(&Interp, M, &Error))
- llvm_raise(llvm_ee_error_exn, Error);
- return Interp;
-}
-
-/* llmodule -> int -> ExecutionEngine.t */
-CAMLprim LLVMExecutionEngineRef
-llvm_ee_create_jit(LLVMModuleRef M, value OptLevel) {
- LLVMExecutionEngineRef JIT;
- char *Error;
- if (LLVMCreateJITCompilerForModule(&JIT, M, Int_val(OptLevel), &Error))
- llvm_raise(llvm_ee_error_exn, Error);
- return JIT;
-}
-
-/* ExecutionEngine.t -> unit */
-CAMLprim value llvm_ee_dispose(LLVMExecutionEngineRef EE) {
- LLVMDisposeExecutionEngine(EE);
- return Val_unit;
-}
-
-/* llmodule -> ExecutionEngine.t -> unit */
-CAMLprim value llvm_ee_add_module(LLVMModuleRef M, LLVMExecutionEngineRef EE) {
- LLVMAddModule(EE, M);
- return Val_unit;
-}
-
-/* llmodule -> ExecutionEngine.t -> llmodule */
-CAMLprim LLVMModuleRef llvm_ee_remove_module(LLVMModuleRef M,
- LLVMExecutionEngineRef EE) {
- LLVMModuleRef RemovedModule;
- char *Error;
- if (LLVMRemoveModule(EE, M, &RemovedModule, &Error))
- llvm_raise(llvm_ee_error_exn, Error);
- return RemovedModule;
-}
-
-/* string -> ExecutionEngine.t -> llvalue option */
-CAMLprim value llvm_ee_find_function(value Name, LLVMExecutionEngineRef EE) {
- CAMLparam1(Name);
- CAMLlocal1(Option);
- LLVMValueRef Found;
- if (LLVMFindFunction(EE, String_val(Name), &Found))
- CAMLreturn(Val_unit);
- Option = alloc(1, 0);
- Field(Option, 0) = Val_op(Found);
- CAMLreturn(Option);
-}
-
-/* llvalue -> GenericValue.t array -> ExecutionEngine.t -> GenericValue.t */
-CAMLprim value llvm_ee_run_function(LLVMValueRef F, value Args,
- LLVMExecutionEngineRef EE) {
- unsigned NumArgs;
- LLVMGenericValueRef Result, *GVArgs;
- unsigned I;
-
- NumArgs = Wosize_val(Args);
- GVArgs = (LLVMGenericValueRef*) malloc(NumArgs * sizeof(LLVMGenericValueRef));
- for (I = 0; I != NumArgs; ++I)
- GVArgs[I] = Genericvalue_val(Field(Args, I));
-
- Result = LLVMRunFunction(EE, F, NumArgs, GVArgs);
-
- free(GVArgs);
- return alloc_generic_value(Result);
-}
-
-/* ExecutionEngine.t -> unit */
-CAMLprim value llvm_ee_run_static_ctors(LLVMExecutionEngineRef EE) {
- LLVMRunStaticConstructors(EE);
- return Val_unit;
-}
-
-/* ExecutionEngine.t -> unit */
-CAMLprim value llvm_ee_run_static_dtors(LLVMExecutionEngineRef EE) {
- LLVMRunStaticDestructors(EE);
- return Val_unit;
-}
-
-/* llvalue -> string array -> (string * string) array -> ExecutionEngine.t ->
- int */
-CAMLprim value llvm_ee_run_function_as_main(LLVMValueRef F,
- value Args, value Env,
- LLVMExecutionEngineRef EE) {
- CAMLparam2(Args, Env);
- int I, NumArgs, NumEnv, EnvSize, Result;
- const char **CArgs, **CEnv;
- char *CEnvBuf, *Pos;
-
- NumArgs = Wosize_val(Args);
- NumEnv = Wosize_val(Env);
-
- /* Build the environment. */
- CArgs = (const char **) malloc(NumArgs * sizeof(char*));
- for (I = 0; I != NumArgs; ++I)
- CArgs[I] = String_val(Field(Args, I));
-
- /* Compute the size of the environment string buffer. */
- for (I = 0, EnvSize = 0; I != NumEnv; ++I) {
- EnvSize += strlen(String_val(Field(Field(Env, I), 0))) + 1;
- EnvSize += strlen(String_val(Field(Field(Env, I), 1))) + 1;
- }
-
- /* Build the environment. */
- CEnv = (const char **) malloc((NumEnv + 1) * sizeof(char*));
- CEnvBuf = (char*) malloc(EnvSize);
- Pos = CEnvBuf;
- for (I = 0; I != NumEnv; ++I) {
- char *Name = String_val(Field(Field(Env, I), 0)),
- *Value = String_val(Field(Field(Env, I), 1));
- int NameLen = strlen(Name),
- ValueLen = strlen(Value);
-
- CEnv[I] = Pos;
- memcpy(Pos, Name, NameLen);
- Pos += NameLen;
- *Pos++ = '=';
- memcpy(Pos, Value, ValueLen);
- Pos += ValueLen;
- *Pos++ = '\0';
- }
- CEnv[NumEnv] = NULL;
-
- Result = LLVMRunFunctionAsMain(EE, F, NumArgs, CArgs, CEnv);
-
- free(CArgs);
- free(CEnv);
- free(CEnvBuf);
-
- CAMLreturn(Val_int(Result));
-}
-
-/* llvalue -> ExecutionEngine.t -> unit */
-CAMLprim value llvm_ee_free_machine_code(LLVMValueRef F,
- LLVMExecutionEngineRef EE) {
- LLVMFreeMachineCodeForFunction(EE, F);
- return Val_unit;
-}
-
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 a8535b2..0000000
--- 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 ce25f9d..0000000
--- 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 99e347b..0000000
--- 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 462eb20..0000000
--- 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 ba3bbe2..0000000
--- 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<Constant>]. *)
-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<UndefValue>]. *)
-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<BasicBlock>]. *)
-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 ef2e3d6..0000000
--- 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 <assert.h>
-#include <stdlib.h>
-
-
-/* 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 3c48cd8..0000000
--- 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 ea5341d..0000000
--- 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 -> [<Llvm.PassManager.any] Llvm.PassManager.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 a82e1b6..0000000
--- 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 -> [<Llvm.PassManager.any] Llvm.PassManager.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 cc20e81..0000000
--- 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 -> [<Llvm.PassManager.any] Llvm.PassManager.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 95b00c8..0000000
--- 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 cbaffa4..0000000
--- 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 5699152..0000000
--- 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 : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_constant_propagation"
-external add_sccp : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_sccp"
-external add_dead_store_elimination : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_dead_store_elimination"
-external add_aggressive_dce : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_aggressive_dce"
-external
-add_scalar_repl_aggregation : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_scalar_repl_aggregation"
-external add_ind_var_simplification : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_ind_var_simplification"
-external
-add_instruction_combination : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_instruction_combination"
-external add_licm : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_licm"
-external add_loop_unswitch : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_loop_unswitch"
-external add_loop_unroll : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_loop_unroll"
-external add_loop_rotation : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_loop_rotation"
-external add_loop_index_split : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_loop_index_split"
-external
-add_memory_to_register_promotion : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_memory_to_register_promotion"
-external
-add_memory_to_register_demotion : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_memory_to_register_demotion"
-external add_reassociation : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_reassociation"
-external add_jump_threading : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_jump_threading"
-external add_cfg_simplification : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_cfg_simplification"
-external
-add_tail_call_elimination : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_tail_call_elimination"
-external add_gvn : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_gvn"
-external add_memcpy_opt : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_memcpy_opt"
-external add_loop_deletion : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_loop_deletion"
-external
-add_lib_call_simplification : [<Llvm.PassManager.any] Llvm.PassManager.t -> 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 9f95fbc..0000000
--- 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 : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_constant_propagation"
-
-(** See the [llvm::createSCCPPass] function. *)
-external add_sccp : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_sccp"
-
-(** See [llvm::createDeadStoreEliminationPass] function. *)
-external add_dead_store_elimination : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_dead_store_elimination"
-
-(** See The [llvm::createAggressiveDCEPass] function. *)
-external add_aggressive_dce : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_aggressive_dce"
-
-(** See the [llvm::createScalarReplAggregatesPass] function. *)
-external
-add_scalar_repl_aggregation : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_scalar_repl_aggregation"
-
-(** See the [llvm::createIndVarSimplifyPass] function. *)
-external add_ind_var_simplification : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_ind_var_simplification"
-
-(** See the [llvm::createInstructionCombiningPass] function. *)
-external
-add_instruction_combination : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_instruction_combination"
-
-(** See the [llvm::createLICMPass] function. *)
-external add_licm : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_licm"
-
-(** See the [llvm::createLoopUnswitchPass] function. *)
-external add_loop_unswitch : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_loop_unswitch"
-
-(** See the [llvm::createLoopUnrollPass] function. *)
-external add_loop_unroll : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_loop_unroll"
-
-(** See the [llvm::createLoopRotatePass] function. *)
-external add_loop_rotation : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_loop_rotation"
-
-(** See the [llvm::createLoopIndexSplitPass] function. *)
-external add_loop_index_split : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_loop_index_split"
-
-(** See the [llvm::createPromoteMemoryToRegisterPass] function. *)
-external
-add_memory_to_register_promotion : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_memory_to_register_promotion"
-
-(** See the [llvm::createDemoteMemoryToRegisterPass] function. *)
-external
-add_memory_to_register_demotion : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_memory_to_register_demotion"
-
-(** See the [llvm::createReassociatePass] function. *)
-external add_reassociation : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_reassociation"
-
-(** See the [llvm::createJumpThreadingPass] function. *)
-external add_jump_threading : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_jump_threading"
-
-(** See the [llvm::createCFGSimplificationPass] function. *)
-external add_cfg_simplification : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_cfg_simplification"
-
-(** See the [llvm::createTailCallEliminationPass] function. *)
-external
-add_tail_call_elimination : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_tail_call_elimination"
-
-(** See the [llvm::createGVNPass] function. *)
-external add_gvn : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_gvn"
-
-(** See the [llvm::createMemCpyOptPass] function. *)
-external add_memcpy_opt : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_memcpy_opt"
-
-(** See the [llvm::createLoopDeletionPass] function. *)
-external add_loop_deletion : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_loop_deletion"
-
-(** See the [llvm::createSimplifyLibCallsPass] function. *)
-external
-add_lib_call_simplification : [<Llvm.PassManager.any] Llvm.PassManager.t -> 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 c20bdde..0000000
--- 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"
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_constant_propagation(LLVMPassManagerRef PM) {
- LLVMAddConstantPropagationPass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_sccp(LLVMPassManagerRef PM) {
- LLVMAddSCCPPass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_dead_store_elimination(LLVMPassManagerRef PM) {
- LLVMAddDeadStoreEliminationPass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_aggressive_dce(LLVMPassManagerRef PM) {
- LLVMAddAggressiveDCEPass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_scalar_repl_aggregation(LLVMPassManagerRef PM) {
- LLVMAddScalarReplAggregatesPass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_ind_var_simplification(LLVMPassManagerRef PM) {
- LLVMAddIndVarSimplifyPass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_instruction_combination(LLVMPassManagerRef PM) {
- LLVMAddInstructionCombiningPass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_licm(LLVMPassManagerRef PM) {
- LLVMAddLICMPass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_loop_unswitch(LLVMPassManagerRef PM) {
- LLVMAddLoopUnrollPass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_loop_unroll(LLVMPassManagerRef PM) {
- LLVMAddLoopUnrollPass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_loop_rotation(LLVMPassManagerRef PM) {
- LLVMAddLoopRotatePass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_loop_index_split(LLVMPassManagerRef PM) {
- LLVMAddLoopIndexSplitPass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_memory_to_register_promotion(LLVMPassManagerRef PM) {
- LLVMAddPromoteMemoryToRegisterPass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_memory_to_register_demotion(LLVMPassManagerRef PM) {
- LLVMAddDemoteMemoryToRegisterPass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_reassociation(LLVMPassManagerRef PM) {
- LLVMAddReassociatePass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_jump_threading(LLVMPassManagerRef PM) {
- LLVMAddJumpThreadingPass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_cfg_simplification(LLVMPassManagerRef PM) {
- LLVMAddCFGSimplificationPass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_tail_call_elimination(LLVMPassManagerRef PM) {
- LLVMAddTailCallEliminationPass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_gvn(LLVMPassManagerRef PM) {
- LLVMAddGVNPass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_memcpy_opt(LLVMPassManagerRef PM) {
- LLVMAddMemCpyOptPass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_loop_deletion(LLVMPassManagerRef PM) {
- LLVMAddLoopDeletionPass(PM);
- return Val_unit;
-}
-
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> 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 78e3ed8..0000000
--- 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 776de36..0000000
--- 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 <llvmbugs@cs.uiuc.edu>.
-#
-# 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 </dev/null 6>&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 <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#if STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# if HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
-#endif
-#if HAVE_STRING_H
-# if !STDC_HEADERS && HAVE_MEMORY_H
-# include <memory.h>
-# endif
-# include <string.h>
-#endif
-#if HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#if HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-#if HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#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=<name> Choose the LLVM capable compiler to use (llvm-gcc,
- clang, or none; default=check)
- --with-udis86=<path> Use udis86 external x86 disassembler library
- --with-oprofile=<prefix>
- 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<lib dir> if you have libraries in a
- nonstandard directory <lib dir>
- CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
- you have headers in a nonstandard directory <include dir>
- 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 <llvmbugs@cs.uiuc.edu>.
-_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 <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* 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 <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_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 <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_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 <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_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 <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_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 <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.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_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 <string.h>
-
-_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 <stdlib.h>
-
-_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 <ctype.h>
-#include <stdlib.h>
-#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 <sys/types.h>
-#include <sys/param.h>
-
-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 <sys/types.h>
-#include <sys/param.h>
-
-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 <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_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 <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_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 <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_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 <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_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 <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* 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<path> option" >&5
-echo $ECHO_N "checking for compiler -Wl,-R<path> 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 <sys/types.h>
-#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<name>.so
- # instead of lib<name>.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 <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
-
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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 <<EOF > 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 <<EOF >> 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 <limits.h> declares shl_load.
- For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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 <dlfcn.h>
-#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 <limits.h> declares _dyld_func_lookup.
- For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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 <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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 <<EOF
-void nm_test_func(){}
-int main(){nm_test_func;return 0;}
-EOF
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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 <<EOF
-#line 11392 "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#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 <argz.h>
-#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 <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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 <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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 <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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 <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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 <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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 <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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 <opagent.h>
-_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 <opagent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_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 <sys/types.h>
-#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 <sys/mman.h>
-#include <unistd.h>
-#include <fcntl.h>
-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 <sys/types.h>
-#include <sys/stat.h>
-
-#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 <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.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_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 <string.h>
-
-_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 <stdlib.h>
-
-_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 <ctype.h>
-#include <stdlib.h>
-#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 <sys/types.h>
-#include <sys/wait.h>
-#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 <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-
-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 <math.h>
-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 <sys/types.h>
-#include <time.h>
-
-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 <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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 <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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 <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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 <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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 <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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 <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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 <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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 <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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 <stdio.h>
-#include <stdlib.h>
-
-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 <stdlib.h>" >&5
-echo $ECHO_N "checking for srand48/lrand48/drand48 in <stdlib.h>... $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 <stdlib.h>
-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 <math.h>" >&5
-echo $ECHO_N "checking for isnan in <math.h>... $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 <math.h>
-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 <cmath>" >&5
-echo $ECHO_N "checking for isnan in <cmath>... $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 <cmath>
-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 <cmath>" >&5
-echo $ECHO_N "checking for std::isnan in <cmath>... $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 <cmath>
-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 <math.h>" >&5
-echo $ECHO_N "checking for isinf in <math.h>... $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 <math.h>
-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 <cmath>" >&5
-echo $ECHO_N "checking for isinf in <cmath>... $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 <cmath>
-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 <cmath>" >&5
-echo $ECHO_N "checking for std::isinf in <cmath>... $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 <cmath>
-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 <ieeefp.h>" >&5
-echo $ECHO_N "checking for finite in <ieeefp.h>... $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 <ieeefp.h>
-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 <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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 <fcntl.h>
-#include <sys/mman.h>
-
-#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 <sys/param.h>
-# 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 <sys/types.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-
-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 <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> 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 <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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 <bug-autoconf@gnu.org>."
-
-_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 <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$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 <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$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 5e4f408..0000000
--- 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 041af83..0000000
--- 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 9729bd7..0000000
--- 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 1b13657..0000000
--- 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 d589ece..0000000
--- 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 e8feabf..0000000
--- 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 <argz.h> 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 <assert.h> 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 <ctype.h> header file. */
-#undef HAVE_CTYPE_H
-
-/* Define to 1 if you have the <dirent.h> 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 <dld.h> 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 <dlfcn.h> 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 <dl.h> 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 <errno.h> 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 <execinfo.h> header file. */
-#cmakedefine HAVE_EXECINFO_H ${HAVE_EXECINFO_H}
-
-/* Define to 1 if you have the <fcntl.h> 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 <ieeefp.h> */
-#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 <hash_map> */
-#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 <inttypes.h> 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 <cmath> */
-#cmakedefine HAVE_ISINF_IN_CMATH ${HAVE_ISINF_IN_CMATH}
-
-/* Set to 1 if the isinf function is found in <math.h> */
-#cmakedefine HAVE_ISINF_IN_MATH_H ${HAVE_ISINF_IN_MATH_H}
-
-/* Set to 1 if the isnan function is found in <cmath> */
-#cmakedefine HAVE_ISNAN_IN_CMATH ${HAVE_ISNAN_IN_CMATH}
-
-/* Set to 1 if the isnan function is found in <math.h> */
-#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 <limits.h> header file. */
-#cmakedefine HAVE_LIMITS_H ${HAVE_LIMITS_H}
-
-/* Define to 1 if you have the <link.h> 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 <mach/mach.h> header file. */
-#undef HAVE_MACH_MACH_H
-
-/* Define to 1 if you have the <mach-o/dyld.h> 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 <malloc.h> header file. */
-#cmakedefine HAVE_MALLOC_H ${HAVE_MALLOC_H}
-
-/* Define to 1 if you have the <malloc/malloc.h> 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 <memory.h> 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 <ndir.h> 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 <stdlib.h> */
-#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 <setjmp.h> 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 <signal.h> 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 <stdint.h> header file. */
-#cmakedefine HAVE_STDINT_H ${HAVE_STDINT_H}
-
-/* Define to 1 if you have the <stdio.h> header file. */
-#cmakedefine HAVE_STDIO_H ${HAVE_STDIO_H}
-
-/* Define to 1 if you have the <stdlib.h> 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 <cmath> */
-#undef HAVE_STD_ISINF_IN_CMATH
-
-/* Set to 1 if the std::isnan function is found in <cmath> */
-#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 <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> 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 <sys/dir.h> header file, and it defines `DIR'.
- */
-#cmakedefine HAVE_SYS_DIR_H ${HAVE_SYS_DIR_H}
-
-/* Define to 1 if you have the <sys/dl.h> header file. */
-#cmakedefine HAVE_SYS_DL_H ${HAVE_SYS_DL_H}
-
-/* Define to 1 if you have the <sys/ioctl.h> header file. */
-#cmakedefine HAVE_SYS_IOCTL_H ${HAVE_SYS_IOCTL_H}
-
-/* Define to 1 if you have the <sys/mman.h> header file. */
-#cmakedefine HAVE_SYS_MMAN_H ${}
-
-/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
- */
-#cmakedefine HAVE_SYS_NDIR_H ${HAVE_SYS_NDIR_H}
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#cmakedefine HAVE_SYS_PARAM_H ${HAVE_SYS_PARAM_H}
-
-/* Define to 1 if you have the <sys/resource.h> header file. */
-#cmakedefine HAVE_SYS_RESOURCE_H ${HAVE_SYS_RESOURCE_H}
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#cmakedefine HAVE_SYS_STAT_H ${HAVE_SYS_STAT_H}
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#cmakedefine HAVE_SYS_TIME_H ${HAVE_SYS_TIME_H}
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#cmakedefine HAVE_SYS_TYPES_H ${HAVE_SYS_TYPES_H}
-
-/* Define to 1 if you have <sys/wait.h> 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 <termios.h> header file. */
-#cmakedefine HAVE_TERMIOS_H ${HAVE_TERMIOS_H}
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#cmakedefine HAVE_UNISTD_H ${HAVE_UNISTD_H}
-
-/* Define to 1 if you have the <utime.h> 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 <valgrind/valgrind.h> header file. */
-#cmakedefine HAVE_VALGRIND_VALGRIND_H ${HAVE_VALGRIND_VALGRIND_H}
-
-/* Define to 1 if you have the <windows.h> 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 <sys/stat.h> 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 <sys/time.h> and <time.h>. */
-#undef TIME_WITH_SYS_TIME
-
-/* Define to 1 if your <sys/time.h> 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 <sys/types.h> does not define. */
-#undef pid_t
-
-/* Define to `unsigned int' if <sys/types.h> 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 d62da1a..0000000
--- 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 <argz.h> 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 <assert.h> 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 <CrashReporterClient.h> header file. */
-#undef HAVE_CRASHREPORTERCLIENT_H
-
-/* Define to 1 if you have the <ctype.h> header file. */
-#undef HAVE_CTYPE_H
-
-/* Define to 1 if you have the <dirent.h> 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 <dld.h> 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 <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define if dlopen() is available on this platform. */
-#undef HAVE_DLOPEN
-
-/* Define to 1 if you have the <dl.h> 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 <errno.h> 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 <execinfo.h> header file. */
-#undef HAVE_EXECINFO_H
-
-/* Define to 1 if you have the <fcntl.h> 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 <ffi/ffi.h> header file. */
-#undef HAVE_FFI_FFI_H
-
-/* Define to 1 if you have the <ffi.h> header file. */
-#undef HAVE_FFI_H
-
-/* Set to 1 if the finite function is found in <ieeefp.h> */
-#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 <inttypes.h> 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 <cmath> */
-#undef HAVE_ISINF_IN_CMATH
-
-/* Set to 1 if the isinf function is found in <math.h> */
-#undef HAVE_ISINF_IN_MATH_H
-
-/* Set to 1 if the isnan function is found in <cmath> */
-#undef HAVE_ISNAN_IN_CMATH
-
-/* Set to 1 if the isnan function is found in <math.h> */
-#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 <limits.h> 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 <link.h> 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 <mach/mach.h> header file. */
-#undef HAVE_MACH_MACH_H
-
-/* Define to 1 if you have the <mach-o/dyld.h> 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 <malloc.h> header file. */
-#undef HAVE_MALLOC_H
-
-/* Define to 1 if you have the <malloc/malloc.h> 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 <memory.h> 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 <ndir.h> 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 <pthread.h> 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 <stdlib.h> */
-#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 <setjmp.h> 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 <signal.h> 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 <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdio.h> header file. */
-#undef HAVE_STDIO_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Set to 1 if the std::isinf function is found in <cmath> */
-#undef HAVE_STD_ISINF_IN_CMATH
-
-/* Set to 1 if the std::isnan function is found in <cmath> */
-#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 <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> 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 <sys/dir.h> header file, and it defines `DIR'.
- */
-#undef HAVE_SYS_DIR_H
-
-/* Define to 1 if you have the <sys/dl.h> header file. */
-#undef HAVE_SYS_DL_H
-
-/* Define to 1 if you have the <sys/ioctl.h> header file. */
-#undef HAVE_SYS_IOCTL_H
-
-/* Define to 1 if you have the <sys/mman.h> header file. */
-#undef HAVE_SYS_MMAN_H
-
-/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
- */
-#undef HAVE_SYS_NDIR_H
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#undef HAVE_SYS_PARAM_H
-
-/* Define to 1 if you have the <sys/resource.h> header file. */
-#undef HAVE_SYS_RESOURCE_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
-#undef HAVE_SYS_WAIT_H
-
-/* Define to 1 if you have the <termios.h> 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 <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to 1 if you have the <utime.h> 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 <valgrind/valgrind.h> header file. */
-#undef HAVE_VALGRIND_VALGRIND_H
-
-/* Define to 1 if you have the <windows.h> 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 <sys/stat.h> 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 <sys/time.h> and <time.h>. */
-#undef TIME_WITH_SYS_TIME
-
-/* Define to 1 if your <sys/time.h> 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 <sys/types.h> does not define. */
-#undef pid_t
-
-/* Define to `unsigned int' if <sys/types.h> 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 8469bcc..0000000
--- 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 e7a04ee..0000000
--- 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 9efe75a..0000000
--- 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 <cmath>
-#else
-#include <math.h>
-#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 <inttypes.h> includes <stdint.h>, if this is a C99 system. */
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#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 <stdlib.h>
-#include <stddef.h>
-#include <sys/types.h>
-#ifdef __cplusplus
-#include <cmath>
-#else
-#include <math.h>
-#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 6537f30..0000000
--- 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 <cmath>
-#else
-#include <math.h>
-#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 <inttypes.h> includes <stdint.h>, if this is a C99 system. */
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#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 f569da2..0000000
--- 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 6a2ab68..0000000
--- 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 007ad22..0000000
--- 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 b850c9f..0000000
--- 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 4af6d35..0000000
--- 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 0e96e4c..0000000
--- 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}<loop>
-
-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 7ff478a..0000000
--- 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 da97804..0000000
--- 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 985ebe2..0000000
--- 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 995bb0e..0000000
--- 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 2d6b5ad..0000000
--- 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 693d431..0000000
--- 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 59af8d53..0000000
--- 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 f097b09..0000000
--- 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 7b0bd72..0000000
--- 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 ca8b843..0000000
--- 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 60aa6cb..0000000
--- 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 2ef115d..0000000
--- 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 4ab3e3c..0000000
--- 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 b655dda4..0000000
--- 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<bb76.outer,0x8b0c5f0>, %reg1037, mbb<bb27,0x8b0a7c0>
-
-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, <gap>, 4, 1, 1, 1, <gap>, 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 799988a..0000000
--- 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 ea716fd..0000000
--- 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 153dd44..0000000
--- 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 8e8b73c..0000000
--- 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 0e118cc..0000000
--- 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 dff97fa..0000000
--- 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 5def136..0000000
--- 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 42020d6..0000000
--- 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 aafa3d9..0000000
--- 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 e0e050e..0000000
--- 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 0b6d2f4..0000000
--- 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 19e646b..0000000
--- 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 60a3a3e..0000000
--- 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 5fa7b70..0000000
--- 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 7d71cd3..0000000
--- 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 25a7bf4..0000000
--- 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 4477757..0000000
--- 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 bf8b7c0..0000000
--- 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 3807f31..0000000
--- 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 0c70a40..0000000
--- 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 a6392fd..0000000
--- 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 48c21f4..0000000
--- 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 b43c3af..0000000
--- 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 bb013b9..0000000
--- 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 eacb200..0000000
--- 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</a></li>
- 5. Multiple Implementations</a></li>
- 6. Minimize Memory Allocation</a></li>
- 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 b3bace4..0000000
--- 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 9ba7c01..0000000
--- 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 841516f..0000000
--- 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 18645c0..0000000
--- 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 65d372e..0000000
--- 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 6b4dee5..0000000
--- 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 031b6ac..0000000
--- 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 b3fcfaf6..0000000
--- 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 6b605bb..0000000
--- 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 e7c2552..0000000
--- 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 9fc3fb9..0000000
--- 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* ; <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* ; <sbyte*>:1 [#uses=2]
- call void %llvm.memcpy.i32( sbyte* %1, sbyte* %0, uint 12, uint 0 )
- cast %struct.s* %memtmp to sbyte* ; <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 <algorithm>
- std::pair<unsigned, bool> 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 3910bb0..0000000
--- 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 6292ab1..0000000
--- 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 992c218..0000000
--- 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 ea13c38..0000000
--- 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 fbf7f3a..0000000
--- 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 54d53ab..0000000
--- 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 9ae1517..0000000
--- 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 2a7291b..0000000
--- 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 de01d7f..0000000
--- 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 795aebf..0000000
--- 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 a106a23..0000000
--- 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 f8847d0..0000000
--- 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 339bef9..0000000
--- 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 b4c8227..0000000
--- 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<<N, N<32 | |
-| Ks3 | imm3 | |
-| Ku3 | uimm3 | |
-| Ks4 | imm4 | |
-| Ku4 | uimm4 | |
-| Ks5 | imm5 | |
-| Ku5 | uimm5 | |
-| Ks7 | imm7 | |
-| KN7 | -imm7 | |
-| Ksh | imm16 | |
-| Kuh | uimm16 | |
-| L | ~(1<<N) | |
-| M1 | 0xff | |
-| M2 | 0xffff | |
-| P0-P4 | 0-4 | |
-| PA | Macflag, not M | |
-| PB | Macflag, only M | |
-| Q | Symbol | |
-
-** TODO Support all register classes
-* DAG combiner
-** Create test case for each Illegal SETCC case
-The DAG combiner may someimes produce illegal i16 SETCC instructions.
-
-*** TODO SETCC (ctlz x), 5) == const
-*** TODO SETCC (and load, const) == const
-*** DONE SETCC (zext x) == const
-*** TODO SETCC (sext x) == const
-
-* Instruction selection
-** TODO Better imediate constants
-Like ARM, build constants as small imm + shift.
-
-** TODO Implement cycle counter
-We have CYCLES and CYCLES2 registers, but the readcyclecounter intrinsic wants
-to return i64, and the code generator doesn't know how to legalize that.
-
-** TODO Instruction alternatives
-Some instructions come in different variants for example:
-
- D = D + D
- P = P + P
-
-Cross combinations are not allowed:
-
- P = D + D (bad)
-
-Similarly for the subreg pseudo-instructions:
-
- D16L = EXTRACT_SUBREG D16, bfin_subreg_lo16
- P16L = EXTRACT_SUBREG P16, bfin_subreg_lo16
-
-We want to take advantage of the alternative instructions. This could be done by
-changing the DAG after instruction selection.
-
-
-** Multipatterns for load/store
-We should try to identify multipatterns for load and store instructions. The
-available instruction matrix is a bit irregular.
-
-Loads:
-
-| Addr | D | P | D 16z | D 16s | D16 | D 8z | D 8s |
-|------------+---+---+-------+-------+-----+------+------|
-| P | * | * | * | * | * | * | * |
-| P++ | * | * | * | * | | * | * |
-| P-- | * | * | * | * | | * | * |
-| P+uimm5m2 | | | * | * | | | |
-| P+uimm6m4 | * | * | | | | | |
-| P+imm16 | | | | | | * | * |
-| P+imm17m2 | | | * | * | | | |
-| P+imm18m4 | * | * | | | | | |
-| P++P | * | | * | * | * | | |
-| FP-uimm7m4 | * | * | | | | | |
-| I | * | | | | * | | |
-| I++ | * | | | | * | | |
-| I-- | * | | | | * | | |
-| I++M | * | | | | | | |
-
-Stores:
-
-| Addr | D | P | D16H | D16L | D 8 |
-|------------+---+---+------+------+-----|
-| P | * | * | * | * | * |
-| P++ | * | * | | * | * |
-| P-- | * | * | | * | * |
-| P+uimm5m2 | | | | * | |
-| P+uimm6m4 | * | * | | | |
-| P+imm16 | | | | | * |
-| P+imm17m2 | | | | * | |
-| P+imm18m4 | * | * | | | |
-| P++P | * | | * | * | |
-| FP-uimm7m4 | * | * | | | |
-| I | * | | * | * | |
-| I++ | * | | * | * | |
-| I-- | * | | * | * | |
-| I++M | * | | | | |
-
-* Workarounds and features
-Blackfin CPUs have bugs. Each model comes in a number of silicon revisions with
-different bugs. We learn about the CPU model from the -mcpu switch.
-
-** Interpretation of -mcpu value
-- -mcpu=bf527 refers to the latest known BF527 revision
-- -mcpu=bf527-0.2 refers to silicon rev. 0.2
-- -mcpu=bf527-any refers to all known revisions
-- -mcpu=bf527-none disables all workarounds
-
-The -mcpu setting affects the __SILICON_REVISION__ macro and enabled workarounds:
-
-| -mcpu | __SILICON_REVISION__ | Workarounds |
-|------------+----------------------+--------------------|
-| bf527 | Def Latest | Specific to latest |
-| bf527-1.3 | Def 0x0103 | Specific to 1.3 |
-| bf527-any | Def 0xffff | All bf527-x.y |
-| bf527-none | Undefined | None |
-
-These are the known cores and revisions:
-
-| Core | Silicon | Processors |
-|-------------+--------------------+-------------------------|
-| Edinburgh | 0.3, 0.4, 0.5, 0.6 | BF531 BF532 BF533 |
-| Braemar | 0.2, 0.3 | BF534 BF536 BF537 |
-| Stirling | 0.3, 0.4, 0.5 | BF538 BF539 |
-| Moab | 0.0, 0.1, 0.2 | BF542 BF544 BF548 BF549 |
-| Teton | 0.3, 0.5 | BF561 |
-| Kookaburra | 0.0, 0.1, 0.2 | BF523 BF525 BF527 |
-| Mockingbird | 0.0, 0.1 | BF522 BF524 BF526 |
-| Brodie | 0.0, 0.1 | BF512 BF514 BF516 BF518 |
-
-
-** Compiler implemented workarounds
-Most workarounds are implemented in header files and source code using the
-__ADSPBF527__ macros. A few workarounds require compiler support.
-
-| Anomaly | Macro | GCC Switch |
-|----------+--------------------------------+------------------|
-| Any | __WORKAROUNDS_ENABLED | |
-| 05000074 | WA_05000074 | |
-| 05000244 | __WORKAROUND_SPECULATIVE_SYNCS | -mcsync-anomaly |
-| 05000245 | __WORKAROUND_SPECULATIVE_LOADS | -mspecld-anomaly |
-| 05000257 | WA_05000257 | |
-| 05000283 | WA_05000283 | |
-| 05000312 | WA_LOAD_LCREGS | |
-| 05000315 | WA_05000315 | |
-| 05000371 | __WORKAROUND_RETS | |
-| 05000426 | __WORKAROUND_INDIRECT_CALLS | Not -micplb |
-
-** GCC feature switches
-| Switch | Description |
-|---------------------------+----------------------------------------|
-| -msim | Use simulator runtime |
-| -momit-leaf-frame-pointer | Omit frame pointer for leaf functions |
-| -mlow64k | |
-| -mcsync-anomaly | |
-| -mspecld-anomaly | |
-| -mid-shared-library | |
-| -mleaf-id-shared-library | |
-| -mshared-library-id= | |
-| -msep-data | Enable separate data segment |
-| -mlong-calls | Use indirect calls |
-| -mfast-fp | |
-| -mfdpic | |
-| -minline-plt | |
-| -mstack-check-l1 | Do stack checking in L1 scratch memory |
-| -mmulticore | Enable multicore support |
-| -mcorea | Build for Core A |
-| -mcoreb | Build for Core B |
-| -msdram | Build for SDRAM |
-| -micplb | Assume ICPLBs are enabled at runtime. |
diff --git a/contrib/llvm/lib/Target/Blackfin/TargetInfo/CMakeLists.txt b/contrib/llvm/lib/Target/Blackfin/TargetInfo/CMakeLists.txt
deleted file mode 100644
index 5ca8060..0000000
--- a/contrib/llvm/lib/Target/Blackfin/TargetInfo/CMakeLists.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. )
-
-add_llvm_library(LLVMBlackfinInfo
- BlackfinTargetInfo.cpp
- )
-
-add_dependencies(LLVMBlackfinInfo BlackfinCodeGenTable_gen)
diff --git a/contrib/llvm/lib/Target/Blackfin/TargetInfo/Makefile b/contrib/llvm/lib/Target/Blackfin/TargetInfo/Makefile
deleted file mode 100644
index c49cfbe..0000000
--- a/contrib/llvm/lib/Target/Blackfin/TargetInfo/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-##===- lib/Target/Blackfin/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 = LLVMBlackfinInfo
-
-# 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/CBackend/CMakeLists.txt b/contrib/llvm/lib/Target/CBackend/CMakeLists.txt
deleted file mode 100644
index be24336..0000000
--- a/contrib/llvm/lib/Target/CBackend/CMakeLists.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-add_llvm_target(CBackend
- CBackend.cpp
- )
diff --git a/contrib/llvm/lib/Target/CBackend/Makefile b/contrib/llvm/lib/Target/CBackend/Makefile
deleted file mode 100644
index 621948a..0000000
--- a/contrib/llvm/lib/Target/CBackend/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-##===- lib/Target/CBackend/Makefile ------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../../..
-LIBRARYNAME = LLVMCBackend
-DIRS = TargetInfo
-
-include $(LEVEL)/Makefile.common
-
-CompileCommonOpts += -Wno-format
diff --git a/contrib/llvm/lib/Target/CBackend/TargetInfo/CMakeLists.txt b/contrib/llvm/lib/Target/CBackend/TargetInfo/CMakeLists.txt
deleted file mode 100644
index 5b35fa7..0000000
--- a/contrib/llvm/lib/Target/CBackend/TargetInfo/CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. )
-
-add_llvm_library(LLVMCBackendInfo
- CBackendTargetInfo.cpp
- )
-
diff --git a/contrib/llvm/lib/Target/CBackend/TargetInfo/Makefile b/contrib/llvm/lib/Target/CBackend/TargetInfo/Makefile
deleted file mode 100644
index d4d5e15..0000000
--- a/contrib/llvm/lib/Target/CBackend/TargetInfo/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-##===- lib/Target/CBackend/TargetInfo/Makefile -------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-LEVEL = ../../../..
-LIBRARYNAME = LLVMCBackendInfo
-
-# Hack: we need to include 'main' target directory to grab private headers
-CPPFLAGS = -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/..
-
-include $(LEVEL)/Makefile.common
diff --git a/contrib/llvm/lib/Target/CMakeLists.txt b/contrib/llvm/lib/Target/CMakeLists.txt
deleted file mode 100644
index 43ebdac..0000000
--- a/contrib/llvm/lib/Target/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-add_llvm_library(LLVMTarget
- Mangler.cpp
- SubtargetFeature.cpp
- Target.cpp
- TargetAsmLexer.cpp
- TargetData.cpp
- TargetELFWriterInfo.cpp
- TargetFrameInfo.cpp
- TargetInstrInfo.cpp
- TargetIntrinsicInfo.cpp
- TargetLoweringObjectFile.cpp
- TargetMachine.cpp
- TargetRegisterInfo.cpp
- TargetSubtarget.cpp
- )
diff --git a/contrib/llvm/lib/Target/CellSPU/AsmPrinter/CMakeLists.txt b/contrib/llvm/lib/Target/CellSPU/AsmPrinter/CMakeLists.txt
deleted file mode 100644
index 8a2b59a..0000000
--- a/contrib/llvm/lib/Target/CellSPU/AsmPrinter/CMakeLists.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-include_directories(
- ${CMAKE_CURRENT_BINARY_DIR}/..
- ${CMAKE_CURRENT_SOURCE_DIR}/..
- )
-
-add_llvm_library(LLVMCellSPUAsmPrinter
- SPUAsmPrinter.cpp
- )
-add_dependencies(LLVMCellSPUAsmPrinter CellSPUCodeGenTable_gen)
diff --git a/contrib/llvm/lib/Target/CellSPU/AsmPrinter/Makefile b/contrib/llvm/lib/Target/CellSPU/AsmPrinter/Makefile
deleted file mode 100644
index 4ec9d04..0000000
--- a/contrib/llvm/lib/Target/CellSPU/AsmPrinter/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-##===- lib/Target/CellSPU/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 = LLVMCellSPUAsmPrinter
-
-# Hack: we need to include 'main' CellSPU 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/CellSPU/CMakeLists.txt b/contrib/llvm/lib/Target/CellSPU/CMakeLists.txt
deleted file mode 100644
index ddfca37..0000000
--- a/contrib/llvm/lib/Target/CellSPU/CMakeLists.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-set(LLVM_TARGET_DEFINITIONS SPU.td)
-
-tablegen(SPUGenInstrNames.inc -gen-instr-enums)
-tablegen(SPUGenRegisterNames.inc -gen-register-enums)
-tablegen(SPUGenAsmWriter.inc -gen-asm-writer)
-tablegen(SPUGenCodeEmitter.inc -gen-emitter)
-tablegen(SPUGenRegisterInfo.h.inc -gen-register-desc-header)
-tablegen(SPUGenRegisterInfo.inc -gen-register-desc)
-tablegen(SPUGenInstrInfo.inc -gen-instr-desc)
-tablegen(SPUGenDAGISel.inc -gen-dag-isel)
-tablegen(SPUGenSubtarget.inc -gen-subtarget)
-tablegen(SPUGenCallingConv.inc -gen-callingconv)
-
-add_llvm_target(CellSPUCodeGen
- SPUFrameInfo.cpp
- SPUHazardRecognizers.cpp
- SPUInstrInfo.cpp
- SPUISelDAGToDAG.cpp
- SPUISelLowering.cpp
- SPUMCAsmInfo.cpp
- SPURegisterInfo.cpp
- SPUSubtarget.cpp
- SPUTargetMachine.cpp
- SPUSelectionDAGInfo.cpp
- )
-
-target_link_libraries (LLVMCellSPUCodeGen LLVMSelectionDAG)
diff --git a/contrib/llvm/lib/Target/CellSPU/Makefile b/contrib/llvm/lib/Target/CellSPU/Makefile
deleted file mode 100644
index cbdbd3c..0000000
--- a/contrib/llvm/lib/Target/CellSPU/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-##===- lib/Target/CellSPU/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 = LLVMCellSPUCodeGen
-TARGET = SPU
-BUILT_SOURCES = SPUGenInstrNames.inc SPUGenRegisterNames.inc \
- SPUGenAsmWriter.inc SPUGenCodeEmitter.inc \
- SPUGenRegisterInfo.h.inc SPUGenRegisterInfo.inc \
- SPUGenInstrInfo.inc SPUGenDAGISel.inc \
- SPUGenSubtarget.inc SPUGenCallingConv.inc
-
-DIRS = AsmPrinter TargetInfo
-
-include $(LEVEL)/Makefile.common
diff --git a/contrib/llvm/lib/Target/CellSPU/README.txt b/contrib/llvm/lib/Target/CellSPU/README.txt
deleted file mode 100644
index 0e7ad35..0000000
--- a/contrib/llvm/lib/Target/CellSPU/README.txt
+++ /dev/null
@@ -1,92 +0,0 @@
-//===- README.txt - Notes for improving CellSPU-specific code gen ---------===//
-
-This code was contributed by a team from the Computer Systems Research
-Department in The Aerospace Corporation:
-
-- Scott Michel (head bottle washer and much of the non-floating point
- instructions)
-- Mark Thomas (floating point instructions)
-- Michael AuYeung (intrinsics)
-- Chandler Carruth (LLVM expertise)
-- Nehal Desai (debugging, i32 operations, RoadRunner SPU expertise)
-
-Some minor fixes added by Kalle Raiskila.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR
-OTHERWISE. IN NO EVENT SHALL THE AEROSPACE CORPORATION BE LIABLE FOR DAMAGES
-OF ANY KIND OR NATURE WHETHER BASED IN CONTRACT, TORT, OR OTHERWISE ARISING
-OUT OF OR IN CONNECTION WITH THE USE OF THE SOFTWARE INCLUDING, WITHOUT
-LIMITATION, DAMAGES RESULTING FROM LOST OR CONTAMINATED DATA, LOST PROFITS OR
-REVENUE, COMPUTER MALFUNCTION, OR FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL,
-OR PUNITIVE DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR
-SUCH DAMAGES ARE FORESEEABLE.
-
----------------------------------------------------------------------------
---WARNING--:
---WARNING--: The CellSPU work is work-in-progress and "alpha" quality code.
---WARNING--:
-
-If you are brave enough to try this code or help to hack on it, be sure
-to add 'spu' to configure's --enable-targets option, e.g.:
-
- ./configure <your_configure_flags_here> \
- --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 928d0fe..0000000
--- 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 9cb6827..0000000
--- 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 f8182b8..0000000
--- 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 d75f4e8..0000000
--- 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 edaf5d3..0000000
--- 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 6e68283..0000000
--- 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 fac2c19..0000000
--- 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 c44651c..0000000
--- 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 7f85bf8..0000000
--- 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 19e508c..0000000
--- 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 5afb14d..0000000
--- 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 fb7ea11..0000000
--- 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 4b1f4e6..0000000
--- 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 a5293ab..0000000
--- 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 a3f60d2..0000000
--- 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 b1f33d6..0000000
--- 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 5b9634b..0000000
--- 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 1d408d0..0000000
--- 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 abb08f2..0000000
--- 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 50a360f..0000000
--- 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 d3099d2..0000000
--- 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 b1efe9b..0000000
--- 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 a77802a..0000000
--- 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 2ed8d77..0000000
--- 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 6e5d56b..0000000
--- 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 32f4e16..0000000
--- 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 d36bb8e..0000000
--- 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 e3c0684..0000000
--- 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 2b6cb9e..0000000
--- 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 9e784d1..0000000
--- 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 9684b8d..0000000
--- 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 bfc6ff4..0000000
--- 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 76609f6..0000000
--- 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 42cd486..0000000
--- 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 bd5dce1..0000000
--- 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 7ffc5eb..0000000
--- 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 1265f1d..0000000
--- 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 3465779..0000000
--- 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 <stdlib.h>
-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* ; <uint*> [#uses=1]
- %tmp = load i32* %tmp ; <uint> [#uses=1]
- %tmp3 = bitcast %struct.B* %b to i32* ; <uint*> [#uses=1]
- %tmp4 = load i32* %tmp3 ; <uint> [#uses=1]
- %tmp8 = bitcast %struct.B* %b to i32* ; <uint*> [#uses=2]
- %tmp9 = load i32* %tmp8 ; <uint> [#uses=1]
- %tmp4.mask17 = shl i32 %tmp4, i8 1 ; <uint> [#uses=1]
- %tmp1415 = and i32 %tmp4.mask17, 2147483648 ; <uint> [#uses=1]
- %tmp.masked = and i32 %tmp, 2147483648 ; <uint> [#uses=1]
- %tmp11 = or i32 %tmp1415, %tmp.masked ; <uint> [#uses=1]
- %tmp12 = and i32 %tmp9, 2147483647 ; <uint> [#uses=1]
- %tmp13 = or i32 %tmp12, %tmp11 ; <uint> [#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 ; <i1> [#uses=1]
- %neg = sext i1 %0 to i32 ; <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<N; j++)
- c[j] = a[j];
-}
-
-LBB1_1: ;bb
- lfdx f0, r3, r4
- addi r5, r5, 1 ;; Extra IV for the exit value compare.
- stfdx f0, r2, r4
- addi r4, r4, 8
-
- xoris r6, r5, 30 ;; This is due to a large immediate.
- cmplwi cr0, r6, 33920
- bne cr0, LBB1_1
-
-//===---------------------------------------------------------------------===//
-
-This:
- #include <algorithm>
- inline std::pair<unsigned, bool> 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 <math.h>
-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 ; <i1> [#uses=1]
- %tmp345 = zext i1 %tmp3 to i32 ; <i32> [#uses=1]
- ret i32 %tmp345
-}
-
-define i32 @test2(double %x, double %y) nounwind {
-entry:
- %tmp3 = fcmp one double %x, %y ; <i1> [#uses=1]
- %tmp345 = zext i1 %tmp3 to i32 ; <i32> [#uses=1]
- ret i32 %tmp345
-}
-
-define i32 @test3(double %x, double %y) nounwind {
-entry:
- %tmp3 = fcmp ugt double %x, %y ; <i1> [#uses=1]
- %tmp34 = zext i1 %tmp3 to i32 ; <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 ; <double> [#uses=1]
- %Cond = fcmp ugt double %D, -0.000000e+00 ; <i1> [#uses=1]
- %E = select i1 %Cond, double %B, double %C ; <double> [#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 1e4c6fb..0000000
--- 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 <string.h>
-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 <altivec.h>
- 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 058d599..0000000
--- 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 a101aa4..0000000
--- 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 4faf8bc..0000000
--- 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 ; <i32> [#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; i<reg->size; 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; i<reg->size; i++)
- reg->node[i].state ^= Res & 0xFFFFFFFFULL;
- } else {
- for(i=0; i<reg->size; 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 ; <i32> [#uses=1]
- %tmp.2 = icmp ne i32 %tmp.1, 0 ; <i1> [#uses=1]
- br i1 %tmp.2, label %then.0, label %else.0
-
-then.0: ; preds = %entry
- %tmp.5 = add i32 %a, -1 ; <i32> [#uses=1]
- %tmp.3 = call i32 @t4( i32 %tmp.5 ) ; <i32> [#uses=1]
- br label %return
-
-else.0: ; preds = %entry
- %tmp.7 = icmp ne i32 %a, 0 ; <i1> [#uses=1]
- br i1 %tmp.7, label %then.1, label %return
-
-then.1: ; preds = %else.0
- %tmp.11 = add i32 %a, -2 ; <i32> [#uses=1]
- %tmp.9 = call i32 @t4( i32 %tmp.11 ) ; <i32> [#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 ; <i32> [#uses=0]
- %tmp.foo = call i32 @foo( i32* %x ) ; <i32> [#uses=1]
- ret i32 %tmp.foo
-}
-
-define i32 @bar(i32* %x) {
-entry:
- %tmp3 = call i32 @foo( i32* %x ) ; <i32> [#uses=1]
- ret i32 %tmp3
-}
-
-//===---------------------------------------------------------------------===//
-
-We should investigate an instruction sinking pass. Consider this silly
-example in pic mode:
-
-#include <assert.h>
-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 <stdio.h>
-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 <cstdio>
-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 ; <i1> [#uses=1]
- %tmp24 = xor i1 %tmp1, true ; <i1> [#uses=1]
- %or.cond8 = and i1 %tmp23, %tmp24 ; <i1> [#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 ; <i8**> [#uses=2]
- %683 = load i8** %682, align 4 ; <i8*> [#uses=4]
- %684 = load i8* %683, align 1 ; <i8> [#uses=1]
- %685 = icmp eq i8 %684, 0 ; <i1> [#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 ; <i1> [#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 ; <i32> [#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 <math.h>
-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 ; <i32> [#uses=1]
- %1 = icmp eq i32 %0, 0 ; <i1> [#uses=1]
- %2 = or i32 %b, 128 ; <i32> [#uses=1]
- %3 = and i32 %b, -129 ; <i32> [#uses=1]
- %b_addr.0 = select i1 %1, i32 %3, i32 %2 ; <i32> [#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 ; <i32> [#uses=1]
- %1 = and i32 %a, 128 ; <i32> [#uses=1]
- %2 = or i32 %0, %1 ; <i32> [#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 <stdint.h>
-
-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 ; <i8> [#uses=1]
- %1 = and i8 %a, -64 ; <i8> [#uses=1]
- %2 = or i8 %1, %0 ; <i8> [#uses=1]
- ret i8 %2
-}
-
-define zeroext i8 @p2(i8 zeroext %b, i8 zeroext %a) nounwind readnone ssp {
-entry:
- %0 = and i8 %b, 63 ; <i8> [#uses=1]
- %.masked = and i8 %a, 64 ; <i8> [#uses=1]
- %1 = and i8 %a, -128 ; <i8> [#uses=1]
- %2 = or i8 %1, %0 ; <i8> [#uses=1]
- %3 = or i8 %2, %.masked ; <i8> [#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<<x)&8)==0) b(); }
-
-The shift should be optimized out. Testcase derived from gcc.
-
-//===---------------------------------------------------------------------===//
-
-Missed instcombine or reassociate transformation:
-int a(int a, int b) { return (a==12)&(b>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 ; <i1> [#uses=1]
- br i1 %cond1, label %exit, label %bb.nph
-bb.nph: ; preds = %entry
- %tmp = mul i32 %b, %a ; <i32> [#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 <complex>
-using namespace std;
-const complex<char> should_be_in_rodata (42,-42);
-complex<char> should_be_in_data (42,-42);
-complex<char> 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 ; <i128> [#uses=1]
- %1 = zext i64 %b to i128 ; <i128> [#uses=1]
- %2 = add i128 %1, %0 ; <i128> [#uses=2]
- %3 = zext i64 %c to i128 ; <i128> [#uses=1]
- %4 = shl i128 %3, 64 ; <i128> [#uses=1]
- %5 = add i128 %4, %2 ; <i128> [#uses=1]
- %6 = lshr i128 %5, 64 ; <i128> [#uses=1]
- %7 = trunc i128 %6 to i64 ; <i64> [#uses=1]
- store i64 %7, i64* %s, align 8
- %8 = trunc i128 %2 to i64 ; <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 da629f6..0000000
--- 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 fe47538..0000000
--- 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 684cadf..0000000
--- 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 e407848..0000000
--- 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 b4991fe..0000000
--- 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 870b56a..0000000
--- 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 641ed87..0000000
--- 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 c6be83a..0000000
--- 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 0f90ed3..0000000
--- 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 880e56f..0000000
--- 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 5b44090..0000000
--- 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 743d8d3..0000000
--- 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 0be80eb..0000000
--- 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 40dbdd7..0000000
--- 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 fb97607..0000000
--- 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 033973e..0000000
--- 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 c82aa33..0000000
--- 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 e9399f5..0000000
--- 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 97589c0..0000000
--- 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 8669fd8..0000000
--- 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 f4ff894..0000000
--- 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 39efd2d..0000000
--- 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 a6c8616..0000000
--- 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 <mmintrin.h>
-
-__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 f96b22f..0000000
--- 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<cond_next204,0xa914d30>
-
-Still ok. After register allocation:
-
-cond_next140 (0xa910740, LLVM BB @0xa90beb0):
- %EAX = MOV32ri -3
- %EDX = MOV32rm <fi#3>, 1, %NOREG, 0
- ADD32rm %EAX<def&use>, %EDX, 1, %NOREG, 0
- %EDX = MOV32rm <fi#7>, 1, %NOREG, 0
- %EDX = MOV32rm %EDX, 1, %NOREG, 40
- IMUL32rr %EAX<def&use>, %EDX
- %ESI = MOV32rm <fi#5>, 1, %NOREG, 0
- %ESI = MOV32rm %ESI, 1, %NOREG, 0
- MOV32mr <fi#4>, 1, %NOREG, 0, %ESI
- %EAX = LEA32r %ESI, 1, %EAX, -3
- %ESI = MOV32rm <fi#7>, 1, %NOREG, 0
- %ESI = MOV32rm %ESI, 1, %NOREG, 32
- %EDI = MOV32rr %EAX
- SHL32ri %EDI<def&use>, 4
- ADD32rr %EDI<def&use>, %ESI
- %XMM0 = MOVAPSrm %ECX, 1, %NOREG, 0
- %XMM1 = MOVAPSrr %XMM0
- SHUFPSrr %XMM1<def&use>, %XMM1, 170
- %XMM2 = MOVAPSrr %XMM0
- SHUFPSrr %XMM2<def&use>, %XMM2, 0
- %XMM3 = MOVAPSrr %XMM0
- SHUFPSrr %XMM3<def&use>, %XMM3, 255
- SHUFPSrr %XMM0<def&use>, %XMM0, 85
- %EBX = MOV32rr %EDI
- AND32ri8 %EBX<def&use>, 15
- CMP32ri8 %EBX, 0
- JE mbb<cond_next204,0xa914d30>
-
-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 <xmmintrin.h>
-__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 <math.h>
-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 ; <float> [#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<b ? c : d; }
-
-to:
-
-_test:
- ucomisd %xmm0, %xmm1
- ja LBB1_2 # entry
-LBB1_1: # entry
- movapd %xmm3, %xmm2
-LBB1_2: # entry
- movapd %xmm2, %xmm0
- ret
-
-instead of:
-
-_test:
- cmpltsd %xmm1, %xmm0
- andpd %xmm0, %xmm2
- andnpd %xmm3, %xmm0
- orpd %xmm2, %xmm0
- ret
-
-For unpredictable branches, the later is much more efficient. This should
-just be a matter of having scalar sse map to SELECT_CC and custom expanding
-or iseling it.
-
-//===---------------------------------------------------------------------===//
-
-LLVM currently generates stack realignment code, when it is not necessary
-needed. The problem is that we need to know about stack alignment too early,
-before RA runs.
-
-At that point we don't know, whether there will be vector spill, or not.
-Stack realignment logic is overly conservative here, but otherwise we can
-produce unaligned loads/stores.
-
-Fixing this will require some huge RA changes.
-
-Testcase:
-#include <emmintrin.h>
-
-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 <emmintrin.h>
-__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 <xmmintrin.h>
-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 ; <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 ; <double> [#uses=1]
- %tmp19 = bitcast double %tmp18 to i64 ; <i64> [#uses=1]
- %tmp20 = zext i64 %tmp19 to i128 ; <i128> [#uses=1]
- %tmp10 = lshr i128 %tmp20, 32 ; <i128> [#uses=1]
- %tmp11 = trunc i128 %tmp10 to i32 ; <i32> [#uses=1]
- %tmp12 = bitcast i32 %tmp11 to float ; <float> [#uses=1]
- %tmp5 = getelementptr inbounds %struct.float3* %res, i64 0, i32 1 ; <float*> [#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<def> XMM1<kill>
- 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 c26c75a..0000000
--- 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 78c4dc0..0000000
--- 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<def> = IMUL32rri8 %reg1024, 45, %EFLAGS<imp-def>
- JMP mbb<bb2,0x203afb0>
- Successors according to CFG: 0x203afb0 (#3)
-
-bb1: 0x203af60, LLVM BB @0x1e02310, ID#2:
- Predecessors according to CFG: 0x203aec0 (#0)
- %reg1026<def> = IMUL32rri8 %reg1024, 78, %EFLAGS<imp-def>
- Successors according to CFG: 0x203afb0 (#3)
-
-bb2: 0x203afb0, LLVM BB @0x1e02340, ID#3:
- Predecessors according to CFG: 0x203af10 (#1) 0x203af60 (#2)
- %reg1027<def> = PHI %reg1025, mbb<bb,0x203af10>,
- %reg1026, mbb<bb1,0x203af60>
- %reg1029<def> = 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 ; <i64> [#uses=2]
- %tmp6 = trunc i64 %tmp8 to i32 ; <i32> [#uses=1]
- %tmp7 = bitcast i32 %tmp6 to float ; <float> [#uses=1]
- %tmp2 = lshr i64 %tmp8, 32 ; <i64> [#uses=1]
- %tmp3 = trunc i64 %tmp2 to i32 ; <i32> [#uses=1]
- %tmp4 = bitcast i32 %tmp3 to float ; <float> [#uses=1]
- %0 = fadd float %tmp7, %tmp4 ; <float> [#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 <stdarg.h>
-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 a305ae6..0000000
--- 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 ] ; <i32> [#uses=3]
- %t_addr.0.0 = phi i32 [ %t, %entry ], [ %tmp7, %cond_true ] ; <i32> [#uses=1]
- %tmp2 = getelementptr i32* %a, i32 %x.0.0 ; <i32*> [#uses=1]
- %tmp3 = load i32* %tmp2 ; <i32> [#uses=1]
- %tmp5 = add i32 %t_addr.0.0, %x.0.0 ; <i32> [#uses=1]
- %tmp7 = add i32 %tmp5, %tmp3 ; <i32> [#uses=2]
- %tmp9 = add i32 %x.0.0, 1 ; <i32> [#uses=2]
- %tmp = icmp sgt i32 %tmp9, 39 ; <i1> [#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 <main+11707>
-
-//===---------------------------------------------------------------------===//
-
-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 <algorithm>
- inline std::pair<unsigned, bool> 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 ; <i32> [#uses=1]
- %tmp233 = sub i32 32, %tmp231232 ; <i32> [#uses=1]
- %tmp245246 = sext i16 %tmp65 to i32 ; <i32> [#uses=1]
- %tmp252253 = sext i16 %tmp68 to i32 ; <i32> [#uses=1]
- %tmp254 = sub i32 32, %tmp252253 ; <i32> [#uses=1]
- %tmp553554 = bitcast i16* %tmp37 to i8* ; <i8*> [#uses=2]
- %tmp583584 = sext i16 %tmp98 to i32 ; <i32> [#uses=1]
- %tmp585 = sub i32 32, %tmp583584 ; <i32> [#uses=1]
- %tmp614615 = sext i16 %tmp101 to i32 ; <i32> [#uses=1]
- %tmp621622 = sext i16 %tmp104 to i32 ; <i32> [#uses=1]
- %tmp623 = sub i32 32, %tmp621622 ; <i32> [#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 ; <i1> [#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 ; <i1> [#uses=1]
- %tmp34 = zext i1 %tmp3 to i32 ; <i32> [#uses=1]
- %tmp5 = sub i32 0, %tmp34 ; <i32> [#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 ; <i1> [#uses=1]
- %tmp34 = sext i1 %tmp3 to i32 ; <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 ; <i1> [#uses=1]
- br i1 %tmp2, label %bb7, label %bb
-
-bb: ; preds = %entry
- %tmp6 = add i32 %b, %a ; <i32> [#uses=1]
- ret i32 %tmp6
-
-bb7: ; preds = %entry
- %tmp10 = sub i32 %a, %c ; <i32> [#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 ; <i1*> [#uses=2]
-define fastcc void @abort_gzip() noreturn nounwind {
-entry:
- %tmp.b.i = load i1* @in_exit.4870.b ; <i1> [#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
- <many many more 32-bit copies>
- 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 ; <i32> [#uses=1]
- %1 = icmp ugt i32 %0, 31 ; <i1> [#uses=1]
- %2 = zext i1 %1 to i32 ; <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 ; <i32> [#uses=1]
- %and = and i32 %tmp1, 1 ; <i32> [#uses=1]
- %tobool = icmp ne i32 %and, 0 ; <i1> [#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 ; <i32> [#uses=1]
- %tmp6 = and i32 %tmp, 255 ; <i32> [#uses=1]
- %cmp = icmp eq i32 %tmp6, 0 ; <i1> [#uses=1]
- %conv5 = zext i1 %cmp to i32 ; <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 ; <i32> [#uses=1]
- %conv1 = ashr i32 %sext, 24 ; <i32> [#uses=1]
- %sext6 = shl i32 %b, 24 ; <i32> [#uses=1]
- %conv4 = ashr i32 %sext6, 24 ; <i32> [#uses=1]
- %cmp = icmp eq i32 %conv1, %conv4 ; <i1> [#uses=1]
- %conv5 = zext i1 %cmp to i32 ; <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 ; <i16*> [#uses=1]
- %2 = bitcast i16* %1 to i32* ; <i32*> [#uses=2]
- %3 = load i32* %2, align 1 ; <i32> [#uses=1]
- %4 = and i32 %3, -65537 ; <i32> [#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 ; <i16*> [#uses=1]
- %7 = bitcast i16* %6 to i32* ; <i32*> [#uses=2]
- %8 = load i32* %7, align 1 ; <i32> [#uses=1]
- %9 = and i32 %8, -131073 ; <i32> [#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 90be9f5..0000000
--- 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 ee91982..0000000
--- 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 f321778..0000000
--- 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 7c7c2f4..0000000
--- 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 581f736..0000000
--- 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 38b35d7..0000000
--- 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 1b70974..0000000
--- 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 b69205b..0000000
--- 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 0a568de..0000000
--- 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 f8a4095..0000000
--- 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 917b745..0000000
--- 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 838d550..0000000
--- 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 e69de29..0000000
--- a/contrib/llvm/lib/Transforms/Hello/Hello.exports
+++ /dev/null
diff --git a/contrib/llvm/lib/Transforms/Hello/Makefile b/contrib/llvm/lib/Transforms/Hello/Makefile
deleted file mode 100644
index f1e3148..0000000
--- 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 65483e8..0000000
--- 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 5c42374..0000000
--- 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 5b1ff3e..0000000
--- 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 0c488e78..0000000
--- 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 128bf48..0000000
--- 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 6cbc7a9..0000000
--- 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 e527be2..0000000
--- 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 b7598ea..0000000
--- 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 cc42fd0..0000000
--- 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 61cbeb2..0000000
--- 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 d1e9336..0000000
--- 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 1388c93..0000000
--- 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 03a4fc7..0000000
--- 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 9284d65..0000000
--- 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 d0e85d5..0000000
--- 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 2e2e547..0000000
--- 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 dbe81e3..0000000
--- 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 <stdlib.h>
-#include <stdio.h>
-
-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 8b27a25..0000000
--- 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 <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <stdlib.h>
-
-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 4a68a08..0000000
--- 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 <stdlib.h>
-
-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 4125af6..0000000
--- 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 eb7887b..0000000
--- 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 <stdlib.h>
-
-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 a7e3ccc..0000000
--- 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 f45ff47..0000000
--- 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 7ed10e9..0000000
--- 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 aa07a2b..0000000
--- 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 50109a5..0000000
--- 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 b4ad3e4..0000000
--- 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 1535b03..0000000
--- 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<CallInst>(*I))
- abort();
-
- return false;
- }
- };
-}
-
-char CrashOnCalls::ID = 0;
-static RegisterPass<CrashOnCalls>
- 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<CallInst>(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<DeleteCalls>
- 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 e69de29..0000000
--- a/contrib/llvm/tools/bugpoint-passes/bugpoint.exports
+++ /dev/null
diff --git a/contrib/llvm/tools/bugpoint/BugDriver.cpp b/contrib/llvm/tools/bugpoint/BugDriver.cpp
deleted file mode 100644
index 6966671..0000000
--- 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 <memory>
-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<std::string>
- 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<std::string> &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<std::string> &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<Module> 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<Function*> &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<GlobalVariable*> &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 e48806a..0000000
--- 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 <vector>
-#include <string>
-
-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<std::string> 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<std::string> &FileNames);
- void addPass(std::string p) { PassesToRun.push_back(p); }
- void setPassesToRun(const std::vector<std::string> &PTR) {
- PassesToRun = PTR;
- }
- const std::vector<std::string> &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<BasicBlock*> &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<std::string> &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<std::string> &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<std::string> &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<std::string> &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<std::string> &Passes);
-
-/// PrintFunctionList - prints out list of problematic functions
-///
-void PrintFunctionList(const std::vector<Function*> &Funcs);
-
-/// PrintGlobalVariableList - prints out list of problematic global variables
-///
-void PrintGlobalVariableList(const std::vector<GlobalVariable*> &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<Function*> &F,
- ValueMap<const Value*, Value*> &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 e06feb1..0000000
--- 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 57dc1c8..0000000
--- 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 <set>
-using namespace llvm;
-
-namespace {
- cl::opt<bool>
- KeepMain("keep-main",
- cl::desc("Force function reduction to keep main"),
- cl::init(false));
- cl::opt<bool>
- NoGlobalRM ("disable-global-remove",
- cl::desc("Do not remove global variables"),
- cl::init(false));
-}
-
-namespace llvm {
- class ReducePassList : public ListReducer<std::string> {
- 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<std::string> &Removed,
- std::vector<std::string> &Kept,
- std::string &Error);
- };
-}
-
-ReducePassList::TestResult
-ReducePassList::doTest(std::vector<std::string> &Prefix,
- std::vector<std::string> &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<GlobalVariable*> {
- 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<GlobalVariable*> &Prefix,
- std::vector<GlobalVariable*> &Kept,
- std::string &Error) {
- if (!Kept.empty() && TestGlobalVariables(Kept))
- return KeepSuffix;
- if (!Prefix.empty() && TestGlobalVariables(Prefix))
- return KeepPrefix;
- return NoFailure;
- }
-
- bool TestGlobalVariables(std::vector<GlobalVariable*> &GVs);
- };
-}
-
-bool
-ReduceCrashingGlobalVariables::TestGlobalVariables(
- std::vector<GlobalVariable*> &GVs) {
- // Clone the program to try hacking it apart...
- ValueMap<const Value*, Value*> VMap;
- Module *M = CloneModule(BD.getProgram(), VMap);
-
- // Convert list to set for fast lookup...
- std::set<GlobalVariable*> GVSet;
-
- for (unsigned i = 0, e = GVs.size(); i != e; ++i) {
- GlobalVariable* CMGV = cast<GlobalVariable>(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<Function*> {
- 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<Function*> &Prefix,
- std::vector<Function*> &Kept,
- std::string &Error) {
- if (!Kept.empty() && TestFuncs(Kept))
- return KeepSuffix;
- if (!Prefix.empty() && TestFuncs(Prefix))
- return KeepPrefix;
- return NoFailure;
- }
-
- bool TestFuncs(std::vector<Function*> &Prefix);
- };
-}
-
-bool ReduceCrashingFunctions::TestFuncs(std::vector<Function*> &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<const Value*, Value*> VMap;
- Module *M = CloneModule(BD.getProgram(), VMap);
-
- // Convert list to set for fast lookup...
- std::set<Function*> Functions;
- for (unsigned i = 0, e = Funcs.size(); i != e; ++i) {
- Function *CMF = cast<Function>(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<const BasicBlock*> {
- 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<const BasicBlock*> &Prefix,
- std::vector<const BasicBlock*> &Kept,
- std::string &Error) {
- if (!Kept.empty() && TestBlocks(Kept))
- return KeepSuffix;
- if (!Prefix.empty() && TestBlocks(Prefix))
- return KeepPrefix;
- return NoFailure;
- }
-
- bool TestBlocks(std::vector<const BasicBlock*> &Prefix);
- };
-}
-
-bool ReduceCrashingBlocks::TestBlocks(std::vector<const BasicBlock*> &BBs) {
- // Clone the program to try hacking it apart...
- ValueMap<const Value*, Value*> VMap;
- Module *M = CloneModule(BD.getProgram(), VMap);
-
- // Convert list to set for fast lookup...
- SmallPtrSet<BasicBlock*, 8> Blocks;
- for (unsigned i = 0, e = BBs.size(); i != e; ++i)
- Blocks.insert(cast<BasicBlock>(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 <function, name> pairs.
- // This won't work well if blocks are unnamed, but that is just the risk we
- // have to take.
- std::vector<std::pair<std::string, std::string> > BlockInfo;
-
- for (SmallPtrSet<BasicBlock*, 8>::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<std::string> 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<Function>(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<BasicBlock>(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<const Instruction*> {
- 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<const Instruction*> &Prefix,
- std::vector<const Instruction*> &Kept,
- std::string &Error) {
- if (!Kept.empty() && TestInsts(Kept))
- return KeepSuffix;
- if (!Prefix.empty() && TestInsts(Prefix))
- return KeepPrefix;
- return NoFailure;
- }
-
- bool TestInsts(std::vector<const Instruction*> &Prefix);
- };
-}
-
-bool ReduceCrashingInstructions::TestInsts(std::vector<const Instruction*>
- &Insts) {
- // Clone the program to try hacking it apart...
- ValueMap<const Value*, Value*> VMap;
- Module *M = CloneModule(BD.getProgram(), VMap);
-
- // Convert list to set for fast lookup...
- SmallPtrSet<Instruction*, 64> Instructions;
- for (unsigned i = 0, e = Insts.size(); i != e; ++i) {
- assert(!isa<TerminatorInst>(Insts[i]));
- Instructions.insert(cast<Instruction>(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<TerminatorInst>(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<Instruction*, 64>::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<GlobalVariable*> 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<Function*> 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<const BasicBlock*> 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<const Instruction*> 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<TerminatorInst>(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() << "<crash>\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 7312484..0000000
--- 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 <fstream>
-
-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<double>
- AbsTolerance("abs-tolerance", cl::desc("Absolute error tolerated"),
- cl::init(0.0));
- cl::opt<double>
- RelTolerance("rel-tolerance", cl::desc("Relative error tolerated"),
- cl::init(0.0));
-
- cl::opt<OutputType>
- 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<OutputType>
- 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<std::string>
- SafeInterpreterPath("safe-path",
- cl::desc("Specify the path to the \"safe\" backend program"),
- cl::init(""));
-
- cl::opt<bool>
- AppendProgramExitCode("append-exit-code",
- cl::desc("Append the exit code to the output so it gets diff'd too"),
- cl::init(false));
-
- cl::opt<std::string>
- InputFile("input", cl::init("/dev/null"),
- cl::desc("Filename to pipe in as stdin (default: /dev/null)"));
-
- cl::list<std::string>
- AdditionalSOs("additional-so",
- cl::desc("Additional shared objects to load "
- "into executing programs"));
-
- cl::list<std::string>
- AdditionalLinkerArgs("Xlinker",
- cl::desc("Additional arguments to pass to the linker"));
-
- cl::opt<std::string>
- 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<std::string>
- InputArgv("args", cl::Positional, cl::desc("<program arguments>..."),
- cl::ZeroOrMore, cl::PositionalEatsArgs);
-
- cl::opt<std::string>
- OutputPrefix("output-prefix", cl::init("bugpoint"),
- cl::desc("Prefix to use for outputs (default: 'bugpoint')"));
-}
-
-namespace {
- cl::list<std::string>
- ToolArgv("tool-args", cl::Positional, cl::desc("<tool arguments>..."),
- cl::ZeroOrMore, cl::PositionalEatsArgs);
-
- cl::list<std::string>
- SafeToolArgv("safe-tool-args", cl::Positional,
- cl::desc("<safe-tool arguments>..."),
- cl::ZeroOrMore, cl::PositionalEatsArgs);
-
- cl::opt<std::string>
- GCCBinary("gcc", cl::init("gcc"),
- cl::desc("The gcc binary to use. (default 'gcc')"));
-
- cl::list<std::string>
- GCCToolArgv("gcc-tool-args", cl::Positional,
- cl::desc("<gcc-tool arguments>..."),
- 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<std::string> SafeToolArgs = SafeToolArgv;
- switch (SafeInterpreterSel) {
- case AutoPick:
- // In "cbe-bug" mode, default to using LLC as the "safe" backend.
- if (!SafeInterpreter &&
- InterpreterSel == CBE_bug) {
- SafeInterpreterSel = RunLLC;
- SafeToolArgs.push_back("--relocation-model=pic");
- SafeInterpreter = AbstractInterpreter::createLLC(Path.c_str(), Message,
- GCCBinary,
- &SafeToolArgs,
- &GCCToolArgv);
- }
-
- // In "llc-safe" mode, default to using LLC as the "safe" backend.
- if (!SafeInterpreter &&
- InterpreterSel == LLC_Safe) {
- 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<std::string> 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() << "<timeout>";
- 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 524f130..0000000
--- 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 <set>
-using namespace llvm;
-
-namespace llvm {
- bool DisableSimplifyCFG = false;
- extern cl::opt<std::string> OutputPrefix;
-} // End llvm namespace
-
-namespace {
- cl::opt<bool>
- NoDCE ("disable-dce",
- cl::desc("Do not use the -dce pass to reduce testcases"));
- cl::opt<bool, true>
- 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<std::string> 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<std::string> 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<std::string> 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<std::pair<Function*, int> > &TorList) {
- assert(!TorList.empty() && "Don't create empty tor list!");
- std::vector<Constant*> ArrayElts;
- for (unsigned i = 0, e = TorList.size(); i != e; ++i) {
- std::vector<Constant*> 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<const Value*, Value*> &VMap) {
- GlobalVariable *GV = M1->getNamedGlobal(GlobalName);
- if (!GV || GV->isDeclaration() || GV->hasLocalLinkage() ||
- !GV->use_empty()) return;
-
- std::vector<std::pair<Function*, int> > M1Tors, M2Tors;
- ConstantArray *InitList = dyn_cast<ConstantArray>(GV->getInitializer());
- if (!InitList) return;
-
- for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i) {
- if (ConstantStruct *CS = dyn_cast<ConstantStruct>(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<ConstantInt>(CS->getOperand(0));
- int Priority = CI ? CI->getSExtValue() : 0;
-
- Constant *FP = CS->getOperand(1);
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(FP))
- if (CE->isCast())
- FP = CE->getOperand(0);
- if (Function *F = dyn_cast<Function>(FP)) {
- if (!F->isDeclaration())
- M1Tors.push_back(std::make_pair(F, Priority));
- else {
- // Map to M2's version of the function.
- F = cast<Function>(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<Function*> &F,
- ValueMap<const Value*, Value*> &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<const Value*, Value*> 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<Function *> TestFunctions;
- for (unsigned i = 0, e = F.size(); i != e; ++i) {
- Function *TNOF = cast<Function>(VMap[F[i]]);
- DEBUG(errs() << "Removing function ");
- DEBUG(WriteAsOperand(errs(), TNOF, false));
- DEBUG(errs() << "\n");
- TestFunctions.insert(cast<Function>(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<BasicBlock*> &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<BasicBlock*>::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<std::string> 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 a291f9f..0000000
--- 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 <algorithm>
-#include <ctime>
-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<std::string> &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 bd1c5da..0000000
--- 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 <vector>
-#include <cstdlib>
-#include <algorithm>
-
-namespace llvm {
-
- extern bool BugpointIsInterrupted;
-
-template<typename ElTy>
-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<ElTy> &Prefix,
- std::vector<ElTy> &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<ElTy> &TheList, std::string &Error) {
- std::vector<ElTy> 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<ElTy> 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<ElTy> Prefix(TheList.begin(), TheList.begin()+Mid);
- std::vector<ElTy> 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<ElTy> 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<ElTy> 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 5d287ef..0000000
--- 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 3f2b696..0000000
--- 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<std::string> OutputPrefix;
- extern cl::list<std::string> InputArgv;
-}
-
-namespace {
- static llvm::cl::opt<bool>
- DisableLoopExtraction("disable-loop-extraction",
- cl::desc("Don't extract loops when searching for miscompilations"),
- cl::init(false));
- static llvm::cl::opt<bool>
- DisableBlockExtraction("disable-block-extraction",
- cl::desc("Don't extract blocks when searching for miscompilations"),
- cl::init(false));
-
- class ReduceMiscompilingPasses : public ListReducer<std::string> {
- BugDriver &BD;
- public:
- ReduceMiscompilingPasses(BugDriver &bd) : BD(bd) {}
-
- virtual TestResult doTest(std::vector<std::string> &Prefix,
- std::vector<std::string> &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<std::string> &Prefix,
- std::vector<std::string> &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<Module> 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<Module> 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<Function*> {
- 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<Function*> &Prefix,
- std::vector<Function*> &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<Function*> &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<Function*> &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<const Value*, Value*> VMap;
- Module *Clone = CloneModule(BD.getProgram(), VMap);
- Module *Orig = BD.swapProgramIn(Clone);
-
- std::vector<Function*> FuncsOnClone;
- for (unsigned i = 0, e = Funcs.size(); i != e; ++i) {
- Function *F = cast<Function>(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<Function*> &MiscompiledFunctions,
- std::string &Error) {
- bool MadeChange = false;
- while (1) {
- if (BugpointIsInterrupted) return MadeChange;
-
- ValueMap<const Value*, Value*> 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<std::pair<std::string, const FunctionType*> > 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<BasicBlock*> {
- BugDriver &BD;
- bool (*TestFn)(BugDriver &, Module *, Module *, std::string &);
- std::vector<Function*> FunctionsBeingTested;
- public:
- ReduceMiscompiledBlocks(BugDriver &bd,
- bool (*F)(BugDriver &, Module *, Module *,
- std::string &),
- const std::vector<Function*> &Fns)
- : BD(bd), TestFn(F), FunctionsBeingTested(Fns) {}
-
- virtual TestResult doTest(std::vector<BasicBlock*> &Prefix,
- std::vector<BasicBlock*> &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<BasicBlock*> &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<BasicBlock*> &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<const Value*, Value*> VMap;
- Module *Clone = CloneModule(BD.getProgram(), VMap);
- Module *Orig = BD.swapProgramIn(Clone);
- std::vector<Function*> FuncsOnClone;
- std::vector<BasicBlock*> BBsOnClone;
- for (unsigned i = 0, e = FunctionsBeingTested.size(); i != e; ++i) {
- Function *F = cast<Function>(VMap[FunctionsBeingTested[i]]);
- FuncsOnClone.push_back(F);
- }
- for (unsigned i = 0, e = BBs.size(); i != e; ++i) {
- BasicBlock *BB = cast<BasicBlock>(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<Function*> &MiscompiledFunctions,
- std::string &Error) {
- if (BugpointIsInterrupted) return false;
-
- std::vector<BasicBlock*> 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<BasicBlock*>(), 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<const Value*, Value*> 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<std::pair<std::string, const FunctionType*> > 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<Function*>
-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<Function*> 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<Function *> 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<const Value*, Value*> 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<Value*> 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<Constant*> GEPargs(2,
- Constant::getNullValue(Type::getInt32Ty(F->getContext())));
- Value *GEP =
- ConstantExpr::getGetElementPtr(funcName, &GEPargs[0], 2);
- std::vector<Value*> 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<Value*> 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<Function*> Funcs = DebugAMiscompilation(*this, TestCodeGenerator,
- *Error);
- if (!Error->empty())
- return true;
-
- // Split the module into the two halves of the program we want.
- ValueMap<const Value*, Value*> 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 3600ca6..0000000
--- 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 <fstream>
-using namespace llvm;
-
-namespace llvm {
- extern cl::opt<std::string> OutputPrefix;
-}
-
-namespace {
- // ChildOutput - This option captures the name of the child output file that
- // is set up by the parent bugpoint process
- cl::opt<std::string> 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<bool> SilencePasses("silence-passes", cl::desc("Suppress output of running passes (both stdout and stderr)"));
-
-static cl::list<std::string> OptArgs("opt-args", cl::Positional,
- cl::desc("<opt arguments>..."),
- 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<std::string> &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<const char*, 8> 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<std::string> 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<std::string>::const_iterator I = Passes.begin(),
- E = Passes.end(); I != E; ++I )
- pass_args.push_back( std::string("-") + (*I) );
- for (std::vector<std::string>::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<std::string> &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 36dbe14..0000000
--- 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 <fstream>
-#include <sstream>
-using namespace llvm;
-
-namespace llvm {
- cl::opt<bool>
- SaveTemps("save-temps", cl::init(false), cl::desc("Save temporary files"));
-}
-
-namespace {
- cl::opt<std::string>
- RemoteClient("remote-client",
- cl::desc("Remote execution client (rsh/ssh)"));
-
- cl::opt<std::string>
- RemoteHost("remote-host",
- cl::desc("Remote execution (rsh/ssh) host"));
-
- cl::opt<std::string>
- RemotePort("remote-port",
- cl::desc("Remote execution (rsh/ssh) port"));
-
- cl::opt<std::string>
- RemoteUser("remote-user",
- cl::desc("Remote execution (rsh/ssh) user id"));
-
- cl::opt<std::string>
- 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<char>(ErrorFile),
- std::istreambuf_iterator<char>(),
- std::ostreambuf_iterator<char>(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<char>(ErrorFile),
- std::istreambuf_iterator<char>(),
- std::ostreambuf_iterator<char>(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<std::string> ToolArgs; // Args to pass to LLI
- public:
- LLI(const std::string &Path, const std::vector<std::string> *Args)
- : LLIPath(Path) {
- ToolArgs.clear ();
- if (Args) { ToolArgs = *Args; }
- }
-
- virtual int ExecuteProgram(const std::string &Bitcode,
- const std::vector<std::string> &Args,
- const std::string &InputFile,
- const std::string &OutputFile,
- std::string *Error,
- const std::vector<std::string> &GCCArgs,
- const std::vector<std::string> &SharedLibs =
- std::vector<std::string>(),
- unsigned Timeout = 0,
- unsigned MemoryLimit = 0);
- };
-}
-
-int LLI::ExecuteProgram(const std::string &Bitcode,
- const std::vector<std::string> &Args,
- const std::string &InputFile,
- const std::string &OutputFile,
- std::string *Error,
- const std::vector<std::string> &GCCArgs,
- const std::vector<std::string> &SharedLibs,
- unsigned Timeout,
- unsigned MemoryLimit) {
- std::vector<const char*> LLIArgs;
- LLIArgs.push_back(LLIPath.c_str());
- LLIArgs.push_back("-force-interpreter=true");
-
- for (std::vector<std::string>::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() << "<lli>"; 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<std::string> *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<std::string> ExecutorArgs;
- public:
- CustomExecutor(
- const std::string &ExecutionCmd, std::vector<std::string> ExecArgs) :
- ExecutionCommand(ExecutionCmd), ExecutorArgs(ExecArgs) {}
-
- virtual int ExecuteProgram(const std::string &Bitcode,
- const std::vector<std::string> &Args,
- const std::string &InputFile,
- const std::string &OutputFile,
- std::string *Error,
- const std::vector<std::string> &GCCArgs,
- const std::vector<std::string> &SharedLibs =
- std::vector<std::string>(),
- unsigned Timeout = 0,
- unsigned MemoryLimit = 0);
- };
-}
-
-int CustomExecutor::ExecuteProgram(const std::string &Bitcode,
- const std::vector<std::string> &Args,
- const std::string &InputFile,
- const std::string &OutputFile,
- std::string *Error,
- const std::vector<std::string> &GCCArgs,
- const std::vector<std::string> &SharedLibs,
- unsigned Timeout,
- unsigned MemoryLimit) {
-
- std::vector<const char*> 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<std::string> 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<const char *> LLCArgs;
- LLCArgs.push_back(LLCPath.c_str());
-
- // Add any extra LLC args.
- for (unsigned i = 0, e = ToolArgs.size(); i != e; ++i)
- LLCArgs.push_back(ToolArgs[i].c_str());
-
- LLCArgs.push_back("-o");
- LLCArgs.push_back(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 ? "<llc-ia>" : "<llc>");
- 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<std::string> &Args,
- const std::string &InputFile,
- const std::string &OutputFile,
- std::string *Error,
- const std::vector<std::string> &ArgsForGCC,
- const std::vector<std::string> &SharedLibs,
- unsigned Timeout,
- unsigned MemoryLimit) {
-
- sys::Path OutputAsmFile;
- GCC::FileType FileKind = OutputCode(Bitcode, OutputAsmFile, *Error, Timeout,
- MemoryLimit);
- FileRemover OutFileRemover(OutputAsmFile, !SaveTemps);
-
- std::vector<std::string> 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<std::string> *Args,
- const std::vector<std::string> *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<std::string> ToolArgs; // Args to pass to LLI
- public:
- JIT(const std::string &Path, const std::vector<std::string> *Args)
- : LLIPath(Path) {
- ToolArgs.clear ();
- if (Args) { ToolArgs = *Args; }
- }
-
- virtual int ExecuteProgram(const std::string &Bitcode,
- const std::vector<std::string> &Args,
- const std::string &InputFile,
- const std::string &OutputFile,
- std::string *Error,
- const std::vector<std::string> &GCCArgs =
- std::vector<std::string>(),
- const std::vector<std::string> &SharedLibs =
- std::vector<std::string>(),
- unsigned Timeout = 0,
- unsigned MemoryLimit = 0);
- };
-}
-
-int JIT::ExecuteProgram(const std::string &Bitcode,
- const std::vector<std::string> &Args,
- const std::string &InputFile,
- const std::string &OutputFile,
- std::string *Error,
- const std::vector<std::string> &GCCArgs,
- const std::vector<std::string> &SharedLibs,
- unsigned Timeout,
- unsigned MemoryLimit) {
- // Construct a vector of parameters, incorporating those from the command-line
- std::vector<const char*> 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() << "<jit>"; 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<std::string> *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<const char *> LLCArgs;
- LLCArgs.push_back(LLCPath.c_str());
-
- // Add any extra LLC args.
- for (unsigned i = 0, e = ToolArgs.size(); i != e; ++i)
- LLCArgs.push_back(ToolArgs[i].c_str());
-
- LLCArgs.push_back("-o");
- LLCArgs.push_back(OutputCFile.c_str()); // Output to the C file
- LLCArgs.push_back("-march=c"); // Output C language
- LLCArgs.push_back(Bitcode.c_str()); // This is the input bitcode
- LLCArgs.push_back(0);
-
- outs() << "<cbe>"; outs().flush();
- DEBUG(errs() << "\nAbout to run:\t";
- for (unsigned i = 0, e = LLCArgs.size()-1; i != e; ++i)
- errs() << " " << LLCArgs[i];
- errs() << "\n";
- );
- if (RunProgramWithTimeout(LLCPath, &LLCArgs[0], sys::Path(), sys::Path(),
- sys::Path(), Timeout, MemoryLimit))
- Error = ProcessFailure(LLCPath, &LLCArgs[0], Timeout, MemoryLimit);
- return GCC::CFile;
-}
-
-void CBE::compileProgram(const std::string &Bitcode, std::string *Error,
- unsigned Timeout, unsigned MemoryLimit) {
- sys::Path OutputCFile;
- OutputCode(Bitcode, OutputCFile, *Error, Timeout, MemoryLimit);
- OutputCFile.eraseFromDisk();
-}
-
-int CBE::ExecuteProgram(const std::string &Bitcode,
- const std::vector<std::string> &Args,
- const std::string &InputFile,
- const std::string &OutputFile,
- std::string *Error,
- const std::vector<std::string> &ArgsForGCC,
- const std::vector<std::string> &SharedLibs,
- unsigned Timeout,
- unsigned MemoryLimit) {
- sys::Path OutputCFile;
- OutputCode(Bitcode, OutputCFile, *Error, Timeout, MemoryLimit);
-
- FileRemover CFileRemove(OutputCFile, !SaveTemps);
-
- std::vector<std::string> GCCArgs(ArgsForGCC);
- GCCArgs.insert(GCCArgs.end(), SharedLibs.begin(), SharedLibs.end());
-
- return gcc->ExecuteProgram(OutputCFile.str(), Args, GCC::CFile,
- InputFile, OutputFile, Error, GCCArgs,
- Timeout, MemoryLimit);
-}
-
-/// createCBE - Try to find the 'llc' executable
-///
-CBE *AbstractInterpreter::createCBE(const char *Argv0,
- std::string &Message,
- const std::string &GCCBinary,
- const std::vector<std::string> *Args,
- const std::vector<std::string> *GCCArgs) {
- sys::Path LLCPath =
- 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<const char*> Args) {
- for (std::vector<const char*>::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<std::string> &Args,
- FileType fileType,
- const std::string &InputFile,
- const std::string &OutputFile,
- std::string *Error,
- const std::vector<std::string> &ArgsForGCC,
- unsigned Timeout,
- unsigned MemoryLimit) {
- std::vector<const char*> GCCArgs;
-
- GCCArgs.push_back(GCCPath.c_str());
-
- if (TargetTriple.getArch() == Triple::x86)
- GCCArgs.push_back("-m32");
-
- for (std::vector<std::string>::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() << "<gcc>"; 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<const char*> 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() << "<program>"; 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() << "<run locally>");
- return RunProgramWithTimeout(OutputBinary, &ProgramArgs[0],
- sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile),
- Timeout, MemoryLimit);
- } else {
- outs() << "<run remotely>"; 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<std::string> &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<const char*> GCCArgs;
-
- GCCArgs.push_back(GCCPath.c_str());
-
- if (TargetTriple.getArch() == Triple::x86)
- GCCArgs.push_back("-m32");
-
- for (std::vector<std::string>::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() << "<gcc>"; 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<std::string> *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 cda0ddf..0000000
--- 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 <exception>
-#include <vector>
-
-namespace llvm {
-
-extern cl::opt<bool> 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<std::string> gccArgs; // GCC-specific arguments.
- GCC(const sys::Path &gccPath, const sys::Path &RemotePath,
- const std::vector<std::string> *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<std::string> *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<std::string> &Args,
- FileType fileType,
- const std::string &InputFile,
- const std::string &OutputFile,
- std::string *Error = 0,
- const std::vector<std::string> &GCCArgs =
- std::vector<std::string>(),
- 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<std::string> &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<std::string> *Args = 0,
- const std::vector<std::string> *GCCArgs = 0);
- static LLC *createLLC(const char *Argv0, std::string &Message,
- const std::string &GCCBinary,
- const std::vector<std::string> *Args = 0,
- const std::vector<std::string> *GCCArgs = 0,
- bool UseIntegratedAssembler = false);
-
- static AbstractInterpreter* createLLI(const char *Argv0, std::string &Message,
- const std::vector<std::string> *Args=0);
-
- static AbstractInterpreter* createJIT(const char *Argv0, std::string &Message,
- const std::vector<std::string> *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<std::string> &Args,
- const std::string &InputFile,
- const std::string &OutputFile,
- std::string *Error,
- const std::vector<std::string> &GCCArgs =
- std::vector<std::string>(),
- const std::vector<std::string> &SharedLibs =
- std::vector<std::string>(),
- 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<std::string> ToolArgs; // Extra args to pass to LLC.
- GCC *gcc;
-public:
- CBE(const sys::Path &llcPath, GCC *Gcc,
- const std::vector<std::string> *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<std::string> &Args,
- const std::string &InputFile,
- const std::string &OutputFile,
- std::string *Error,
- const std::vector<std::string> &GCCArgs =
- std::vector<std::string>(),
- const std::vector<std::string> &SharedLibs =
- std::vector<std::string>(),
- 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<std::string> ToolArgs; // Extra args to pass to LLC.
- GCC *gcc;
- bool UseIntegratedAssembler;
-public:
- LLC(const std::string &llcPath, GCC *Gcc,
- const std::vector<std::string> *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<std::string> &Args,
- const std::string &InputFile,
- const std::string &OutputFile,
- std::string *Error,
- const std::vector<std::string> &GCCArgs =
- std::vector<std::string>(),
- const std::vector<std::string> &SharedLibs =
- std::vector<std::string>(),
- 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 79cf563..0000000
--- 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<bool>
-FindBugs("find-bugs", cl::desc("Run many different optimization sequences "
- "on program to find bugs"), cl::init(false));
-
-static cl::list<std::string>
-InputFilenames(cl::Positional, cl::OneOrMore,
- cl::desc("<input llvm ll/bc files>"));
-
-static cl::opt<unsigned>
-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<int>
-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<bool>
-UseValgrind("enable-valgrind",
- cl::desc("Run optimizations through valgrind"));
-
-// The AnalysesList is automatically populated with registered Passes by the
-// PassNameParser.
-//
-static cl::list<const PassInfo*, bool, PassNameParser>
-PassList(cl::desc("Passes available:"), cl::ZeroOrMore);
-
-static cl::opt<bool>
-StandardCompileOpts("std-compile-opts",
- cl::desc("Include the standard compile time optimizations"));
-
-static cl::opt<bool>
-StandardLinkOpts("std-link-opts",
- cl::desc("Include the standard link time optimizations"));
-
-static cl::opt<std::string>
-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<const PassInfo*>::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 1ba2a62..0000000
--- 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 e8e3209..0000000
--- 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 a378a5f..0000000
--- 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
-------- ---------
-<none yet>
-
diff --git a/contrib/llvm/tools/clang/Makefile b/contrib/llvm/tools/clang/Makefile
deleted file mode 100644
index f871c25..0000000
--- 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 4368ef0..0000000
--- 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 f66a961..0000000
--- 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 <iostream> 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 44ce723a..0000000
--- 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 c63b1b3..0000000
--- 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., <typeinfo> 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 742cf8f..0000000
--- 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 88f3081..0000000
--- 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 f0f81b5..0000000
--- 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 "<SourceLocation file %r, line %r, column %r>" % (
- 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 "<SourceRange start %r, end %r>" % (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 "<Diagnostic severity %r, location %r, spelling %r>" % (
- 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 "<FixIt range %r, value %r>" % (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 af7ddab..0000000
--- 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 1750022..0000000
--- 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 e69de29..0000000
--- a/contrib/llvm/tools/clang/bindings/python/tests/__init__.py
+++ /dev/null
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 b4eacbe..0000000
--- 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 c4eddc0..0000000
--- 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 6dca764..0000000
--- 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 7ef086e..0000000
--- 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 60cfdaa..0000000
--- 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 7196486..0000000
--- 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 e69de29..0000000
--- a/contrib/llvm/tools/clang/bindings/python/tests/cindex/__init__.py
+++ /dev/null
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 a653ba7..0000000
--- 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 bdfa318..0000000
--- 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 8518765..0000000
--- 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 dc173f0..0000000
--- 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 3c05c3f..0000000
--- 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 253a09b..0000000
--- 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 79b9adf..0000000
--- 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 98ea719..0000000
--- 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 800c583..0000000
--- 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 6ba6e89..0000000
--- 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 c595236..0000000
--- 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 bc64f6aa..0000000
--- 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 ccf8430..0000000
--- 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 e82cf42..0000000
--- 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 99be53f..0000000
--- 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 d829166..0000000
--- 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 030b072..0000000
--- 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 3712009..0000000
--- 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 79486b1..0000000
--- 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 82a81ec..0000000
--- 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 65383c5..0000000
--- 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 850e9b4..0000000
--- 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 fbbb83d..0000000
--- 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 87bf834..0000000
--- 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 c156304..0000000
--- 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 bd5e342..0000000
--- 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 5b54f0d..0000000
--- 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 4ec6f65..0000000
--- 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 b5a2329..0000000
--- 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 6032dff..0000000
--- 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 e6d6109..0000000
--- 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 00d076b..0000000
--- 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 454ab86..0000000
--- 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 5a31495..0000000
--- 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 3c13ad6..0000000
--- 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 26c9fc7..0000000
--- 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 c43213f..0000000
--- 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 a1b5f50..0000000
--- 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 d75b1a2..0000000
--- 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 61f69b2..0000000
--- 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 8607d78..0000000
--- 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 632fbc6..0000000
--- 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 d80fb55..0000000
--- 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 dbd0eb6..0000000
--- 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 189af3d..0000000
--- 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 5ec7c333..0000000
--- 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 ffeb3e6..0000000
--- 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 5fef9b2..0000000
--- 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 e65bb22..0000000
--- 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 2c02739..0000000
--- 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 d863c17..0000000
--- 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 e89ddc3..0000000
--- 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 0e8b359..0000000
--- 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 ae33b78..0000000
--- 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 0202cc5..0000000
--- 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 5cf2cd6..0000000
--- 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 f41aa80..0000000
--- 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 58eff97..0000000
--- 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 <ctype.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-/******************************************************************************/
-/* 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 "<invalid loc>";
- }
- 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 = "<unknown>";
- 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 <class name> <category name>\n"
- " ObjCClass <class name>\n"
- " ObjCIvar <ivar name> <class USR>\n"
- " ObjCMethod <selector> [0=class method|1=instance method] "
- "<class USR>\n"
- " ObjCProperty <property name> <class USR>\n"
- " ObjCProtocol <protocol name>\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, "<ivar name> <class USR>");
- if (!isUSR(I[2]))
- return not_usr("<class 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, "<class name>");
- 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, "<method selector> "
- "[0=class method|1=instance method] <class USR>");
- if (!isUSR(I[3]))
- return not_usr("<class 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, "<class name> <category name>");
- 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, "<protocol name>");
- print_usr(clang_constructUSR_ObjCProtocol(I[1]));
- I += 2;
- continue;
- }
- if (memcmp(kind, "ObjCProperty", 12) == 0) {
- if (I + 2 >= E)
- return insufficient_usr(kind, "<property name> <class USR>");
- if (!isUSR(I[2]))
- return not_usr("<class 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=<site> <compiler arguments>\n"
- " c-index-test -code-completion-timing=<site> <compiler arguments>\n"
- " c-index-test -cursor-at=<site> <compiler arguments>\n"
- " c-index-test -test-file-scan <AST file> <source file> "
- "[FileCheck prefix]\n"
- " c-index-test -test-load-tu <AST file> <symbol filter> "
- "[FileCheck prefix]\n"
- " c-index-test -test-load-tu-usrs <AST file> <symbol filter> "
- "[FileCheck prefix]\n"
- " c-index-test -test-load-source <symbol filter> {<args>}*\n");
- fprintf(stderr,
- " c-index-test -test-load-source-reparse <trials> <symbol filter> "
- " {<args>}*\n"
- " c-index-test -test-load-source-usrs <symbol filter> {<args>}*\n"
- " c-index-test -test-annotate-tokens=<range> {<args>}*\n"
- " c-index-test -test-inclusion-stack-source {<args>}*\n"
- " c-index-test -test-inclusion-stack-tu <AST file>\n"
- " c-index-test -test-print-linkage-source {<args>}*\n"
- " c-index-test -test-print-typekind {<args>}*\n"
- " c-index-test -print-usr [<CursorKind> {<args>}]*\n");
- fprintf(stderr,
- " c-index-test -print-usr-file <file>\n"
- " c-index-test -write-pch <file> <compiler arguments>\n\n");
- fprintf(stderr,
- " <symbol filter> 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 ec6e9c6..0000000
--- 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 c938fb0..0000000
--- a/contrib/llvm/tools/clang/tools/driver/Info.plist.in
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleIdentifier</key>
- <string>@TOOL_INFO_UTI@</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>@TOOL_INFO_NAME</string>
- <key>CFBundleShortVersionString</key>
- <string>@TOOL_INFO_VERSION@</string>
- <key>CFBundleVersion</key>
- <string>@TOOL_INFO_BUILD_VERSION@</string>
- <key>CFBundleSignature</key>
- <string>????</string>
-</dict>
-</plist>
diff --git a/contrib/llvm/tools/clang/tools/driver/Makefile b/contrib/llvm/tools/clang/tools/driver/Makefile
deleted file mode 100644
index 447f0e4..0000000
--- 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 5117f2c..0000000
--- 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 <cstdio>
-
-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<const char*> &Args)
- : crashtracerSlot(0)
- {
- {
- llvm::raw_svector_ostream Out(CrashString);
- Out << "ClangCIndex [" << getClangFullVersion() << "]"
- << "[createTranslationUnitFromSourceFile]: clang";
- for (llvm::SmallVectorImpl<const char*>::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<CursorVisitor, bool>,
- public TypeLocVisitor<CursorVisitor, bool>,
- public StmtVisitor<CursorVisitor, bool>
-{
- /// \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<CursorVisitor, bool>::Visit;
- using TypeLocVisitor<CursorVisitor, bool>::Visit;
- using StmtVisitor<CursorVisitor, bool>::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<PreprocessingRecord::iterator, PreprocessingRecord::iterator>
- 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<PreprocessingRecord::iterator, PreprocessingRecord::iterator>
-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<FileID, unsigned> Begin
- = SM.getDecomposedInstantiationLoc(RegionOfInterest.getBegin());
- std::pair<FileID, unsigned> 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<FileID, unsigned> 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<MacroInstantiation>(*E)) {
- if (Visit(MakeMacroInstantiationCursor(MI, CXXUnit)))
- return true;
-
- continue;
- }
-
- if (MacroDefinition *MD = dyn_cast<MacroDefinition>(*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<TemplateSpecializationTypeLoc>(&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<FunctionTypeLoc>(&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<CXXConversionDecl>(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<ObjCCategoryDecl>(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<DeclContext>(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<TypedefType>(T))
- return Visit(MakeCursorTypeRef(Typedef->getDecl(), Range.getBegin(), TU));
- if (const TagType *Tag = dyn_cast<TagType>(T))
- return Visit(MakeCursorTypeRef(Tag->getDecl(), Range.getBegin(), TU));
- if (const TemplateSpecializationType *TST
- = dyn_cast<TemplateSpecializationType>(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<BuiltinType>()->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<TypedefType>())
- 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<CaseStmt>(SubStmt))
- return Visit(MakeCXCursor(SubStmt, StmtParent, TU));
-
- // Specially handle 'CaseStmt' so that we don't blow out the stack.
- CaseStmt *CS = cast<CaseStmt>(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<CIndexer *>(CIdx);
- if (getenv("LIBCLANG_TIMING"))
- llvm::TimerGroup::printAll(llvm::errs());
-}
-
-void clang_setUseExternalASTGeneration(CXIndex CIdx, int value) {
- if (CIdx) {
- CIndexer *CXXIdx = static_cast<CIndexer *>(CIdx);
- CXXIdx->setUseExternalASTGeneration(value);
- }
-}
-
-CXTranslationUnit clang_createTranslationUnit(CXIndex CIdx,
- const char *ast_filename) {
- if (!CIdx)
- return 0;
-
- CIndexer *CXXIdx = static_cast<CIndexer *>(CIdx);
-
- llvm::IntrusiveRefCntPtr<Diagnostic> 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<ParseTranslationUnitInfo*>(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<CIndexer *>(CIdx);
-
- bool PrecompilePreamble = options & CXTranslationUnit_PrecompiledPreamble;
- bool CompleteTranslationUnit
- = ((options & CXTranslationUnit_Incomplete) == 0);
- bool CacheCodeCompetionResults
- = options & CXTranslationUnit_CacheCompletionResults;
-
- // Configure the diagnostics.
- DiagnosticOptions DiagOpts;
- llvm::IntrusiveRefCntPtr<Diagnostic> Diags;
- Diags = CompilerInstance::createDiagnostics(DiagOpts, 0, 0);
-
- llvm::SmallVector<ASTUnit::RemappedFile, 4> 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<const char *, 16> 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<ASTUnit> 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<const char *> argv;
-
- // First add the complete path to the 'clang' executable.
- llvm::sys::Path ClangPath = static_cast<CIndexer *>(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<llvm::sys::Path> TemporaryFiles;
- std::vector<std::string> 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<const char*>::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<StoredDiagnostic, 4> Diags;
- LoadSerializedDiagnostics(DiagnosticsFile,
- num_unsaved_files, unsaved_files,
- FileMgr, SourceMgr, Diags);
- for (llvm::SmallVector<StoredDiagnostic, 4>::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<ASTUnit *>(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<ASTUnit *>(CTUnit)->isUnsafeToFree())
- return;
-
- delete static_cast<ASTUnit *>(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<ReparseTranslationUnitInfo*>(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<ASTUnit::RemappedFile, 4> 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<ASTUnit *>(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<ASTUnit *>(TU)->setUnsafeToFree(true);
- return 1;
- }
-
- return RTUI.result;
-}
-
-
-CXString clang_getTranslationUnitSpelling(CXTranslationUnit CTUnit) {
- if (!CTUnit)
- return createCXString("");
-
- ASTUnit *CXXUnit = static_cast<ASTUnit *>(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<ASTUnit *>(tu);
- SourceLocation SLoc
- = CXXUnit->getSourceManager().getLocation(
- static_cast<const FileEntry *>(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<const SourceManager*>(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<FileEntry *>(SFile);
- return createCXString(FEnt->getName());
-}
-
-time_t clang_getFileTime(CXFile SFile) {
- if (!SFile)
- return 0;
-
- FileEntry *FEnt = static_cast<FileEntry *>(SFile);
- return FEnt->getModificationTime();
-}
-
-CXFile clang_getFile(CXTranslationUnit tu, const char *file_name) {
- if (!tu)
- return 0;
-
- ASTUnit *CXXUnit = static_cast<ASTUnit *>(tu);
-
- FileManager &FMgr = CXXUnit->getFileManager();
- const FileEntry *File = FMgr.getFile(file_name, file_name+strlen(file_name));
- return const_cast<FileEntry *>(File);
-}
-
-} // end: extern "C"
-
-//===----------------------------------------------------------------------===//
-// CXCursor Operations.
-//===----------------------------------------------------------------------===//
-
-static Decl *getDeclFromExpr(Stmt *E) {
- if (DeclRefExpr *RefExpr = dyn_cast<DeclRefExpr>(E))
- return RefExpr->getDecl();
- if (MemberExpr *ME = dyn_cast<MemberExpr>(E))
- return ME->getMemberDecl();
- if (ObjCIvarRefExpr *RE = dyn_cast<ObjCIvarRefExpr>(E))
- return RE->getDecl();
-
- if (CallExpr *CE = dyn_cast<CallExpr>(E))
- return getDeclFromExpr(CE->getCallee());
- if (CastExpr *CE = dyn_cast<CastExpr>(E))
- return getDeclFromExpr(CE->getSubExpr());
- if (ObjCMessageExpr *OME = dyn_cast<ObjCMessageExpr>(E))
- return OME->getMethodDecl();
-
- return 0;
-}
-
-static SourceLocation getLocationFromExpr(Expr *E) {
- if (ObjCMessageExpr *Msg = dyn_cast<ObjCMessageExpr>(E))
- return /*FIXME:*/Msg->getLeftLoc();
- if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(E))
- return DRE->getLocation();
- if (MemberExpr *Member = dyn_cast<MemberExpr>(E))
- return Member->getMemberLoc();
- if (ObjCIvarRefExpr *Ivar = dyn_cast<ObjCIvarRefExpr>(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<NamedDecl>(D);
- if (!ND)
- return createCXString("");
-
- if (ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(ND))
- return createCXString(OMD->getSelector().getAsString());
-
- if (ObjCCategoryImplDecl *CIMP = dyn_cast<ObjCCategoryImplDecl>(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<UsingDirectiveDecl>(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("<not implemented>");
- }
- }
-
- 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<CXCursor *>(client_data);
- *BestCursor = cursor;
- return CXChildVisit_Recurse;
-}
-
-CXCursor clang_getCursor(CXTranslationUnit TU, CXSourceLocation Loc) {
- if (!TU)
- return clang_getNullCursor();
-
- ASTUnit *CXXUnit = static_cast<ASTUnit *>(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<ObjCInterfaceDecl *, SourceLocation> P
- = getCursorObjCSuperClassRef(C);
- return cxloc::translateSourceLocation(P.first->getASTContext(), P.second);
- }
-
- case CXCursor_ObjCProtocolRef: {
- std::pair<ObjCProtocolDecl *, SourceLocation> P
- = getCursorObjCProtocolRef(C);
- return cxloc::translateSourceLocation(P.first->getASTContext(), P.second);
- }
-
- case CXCursor_ObjCClassRef: {
- std::pair<ObjCInterfaceDecl *, SourceLocation> P
- = getCursorObjCClassRef(C);
- return cxloc::translateSourceLocation(P.first->getASTContext(), P.second);
- }
-
- case CXCursor_TypeRef: {
- std::pair<TypeDecl *, SourceLocation> P = getCursorTypeRef(C);
- return cxloc::translateSourceLocation(P.first->getASTContext(), P.second);
- }
-
- case CXCursor_TemplateRef: {
- std::pair<TemplateDecl *, SourceLocation> P = getCursorTemplateRef(C);
- return cxloc::translateSourceLocation(P.first->getASTContext(), P.second);
- }
-
- case CXCursor_NamespaceRef: {
- std::pair<NamedDecl *, SourceLocation> 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<ObjCInterfaceDecl>(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<UsingDirectiveDecl>(D)->getNominatedNamespace(),
- CXXUnit);
-
- case Decl::NamespaceAlias:
- return MakeCXCursor(cast<NamespaceAliasDecl>(D)->getNamespace(), CXXUnit);
-
- case Decl::Enum:
- case Decl::Record:
- case Decl::CXXRecord:
- case Decl::ClassTemplateSpecialization:
- case Decl::ClassTemplatePartialSpecialization:
- if (TagDecl *Def = cast<TagDecl>(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<FunctionDecl>(D)->getBody(Def))
- return MakeCXCursor(const_cast<FunctionDecl *>(Def), CXXUnit);
- return clang_getNullCursor();
- }
-
- case Decl::Var: {
- // Ask the variable if it has a definition.
- if (VarDecl *Def = cast<VarDecl>(D)->getDefinition())
- return MakeCXCursor(Def, CXXUnit);
- return clang_getNullCursor();
- }
-
- case Decl::FunctionTemplate: {
- const FunctionDecl *Def = 0;
- if (cast<FunctionTemplateDecl>(D)->getTemplatedDecl()->getBody(Def))
- return MakeCXCursor(Def->getDescribedFunctionTemplate(), CXXUnit);
- return clang_getNullCursor();
- }
-
- case Decl::ClassTemplate: {
- if (RecordDecl *Def = cast<ClassTemplateDecl>(D)->getTemplatedDecl()
- ->getDefinition())
- return MakeCXCursor(cast<CXXRecordDecl>(Def)->getDescribedClassTemplate(),
- CXXUnit);
- return clang_getNullCursor();
- }
-
- case Decl::Using: {
- UsingDecl *Using = cast<UsingDecl>(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<UsingShadowDecl>(D)->getTargetDecl(),
- CXXUnit));
-
- case Decl::ObjCMethod: {
- ObjCMethodDecl *Method = cast<ObjCMethodDecl>(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<ObjCInterfaceDecl>(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<ObjCCategoryDecl>(D)->getImplementation())
- return MakeCXCursor(Impl, CXXUnit);
- return clang_getNullCursor();
-
- case Decl::ObjCProtocol:
- if (!cast<ObjCProtocolDecl>(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<ObjCInterfaceDecl>(D)->isForwardDecl())
- return C;
- } else if (ObjCImplementationDecl *Impl
- = cast<ObjCInterfaceDecl>(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<ObjCCompatibleAliasDecl>(D)->getClassInterface())
- if (!Class->isForwardDecl())
- return MakeCXCursor(Class, CXXUnit);
-
- return clang_getNullCursor();
-
- case Decl::ObjCForwardProtocol: {
- ObjCForwardProtocolDecl *Forward = cast<ObjCForwardProtocolDecl>(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<ObjCClassDecl>(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<FriendDecl>(D)->getFriendDecl())
- return clang_getCursorDefinition(MakeCXCursor(Friend, CXXUnit));
- return clang_getNullCursor();
-
- case Decl::FriendTemplate:
- if (NamedDecl *Friend = cast<FriendTemplateDecl>(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<NamedDecl *>(getCursorDecl(C));
- FunctionDecl *FD = dyn_cast<FunctionDecl>(ND);
- CompoundStmt *Body = dyn_cast<CompoundStmt>(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<CXTokenKind>(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<IdentifierInfo *>(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<const char *>(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<ASTUnit *>(TU);
- if (!CXXUnit)
- return createCXString("");
-
- SourceLocation Loc = SourceLocation::getFromRawEncoding(CXTok.int_data[1]);
- std::pair<FileID, unsigned> 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<ASTUnit *>(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<ASTUnit *>(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<ASTUnit *>(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<FileID, unsigned> BeginLocInfo
- = SourceMgr.getDecomposedLoc(R.getBegin());
- std::pair<FileID, unsigned> 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<CXToken, 32> 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<FileID, unsigned> 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<unsigned, CXCursor> 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<ObjCMethodDecl>(D)) {
- if (MD->isSynthesized())
- return CXChildVisit_Continue;
- }
- if (const DeclaratorDecl *DD = dyn_cast<DeclaratorDecl>(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<AnnotateTokensWorker*>(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<ASTUnit *>(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<FileID, unsigned> BeginLocInfo
- = SourceMgr.getDecomposedLoc(RegionOfInterest.getBegin());
- std::pair<FileID, unsigned> 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<SourceLocation> 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<NamedDecl>(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<UnavailableAttr>() ||
- (isa<FunctionDecl>(D) && cast<FunctionDecl>(D)->isDeleted()))
- return CXAvailability_Available;
-
- if (D->hasAttr<DeprecatedAttr>())
- 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<FunctionTemplateDecl>(D))
- Method = dyn_cast<CXXMethodDecl>(FunTmpl->getTemplatedDecl());
- else
- Method = dyn_cast_or_null<CXXMethodDecl>(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<IBOutletCollectionAttr>(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 3ade519..0000000
--- 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<TemplateDecl>(getCursorDecl(C)))
- return MakeCXCursor(Template->getTemplatedDecl(),
- getCursorASTUnit(C)).kind;
- break;
-
- case CXCursor_ClassTemplatePartialSpecialization:
- if (ClassTemplateSpecializationDecl *PartialSpec
- = dyn_cast_or_null<ClassTemplatePartialSpecializationDecl>(
- 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<CXXRecordDecl>(D)) {
- if (ClassTemplatePartialSpecializationDecl *PartialSpec
- = dyn_cast<ClassTemplatePartialSpecializationDecl>(CXXRecord))
- Template = PartialSpec->getSpecializedTemplate();
- else if (ClassTemplateSpecializationDecl *ClassSpec
- = dyn_cast<ClassTemplateSpecializationDecl>(CXXRecord)) {
- llvm::PointerUnion<ClassTemplateDecl *,
- ClassTemplatePartialSpecializationDecl *> Result
- = ClassSpec->getSpecializedTemplateOrPartial();
- if (Result.is<ClassTemplateDecl *>())
- Template = Result.get<ClassTemplateDecl *>();
- else
- Template = Result.get<ClassTemplatePartialSpecializationDecl *>();
-
- } else
- Template = CXXRecord->getInstantiatedFromMemberClass();
- } else if (FunctionDecl *Function = dyn_cast<FunctionDecl>(D)) {
- Template = Function->getPrimaryTemplate();
- if (!Template)
- Template = Function->getInstantiatedFromMemberFunction();
- } else if (VarDecl *Var = dyn_cast<VarDecl>(D)) {
- if (Var->isStaticDataMember())
- Template = Var->getInstantiatedFromStaticDataMember();
- } else if (RedeclarableTemplateDecl *Tmpl
- = dyn_cast<RedeclarableTemplateDecl>(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 d591c5d..0000000
--- 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 <cstdlib>
-#include <cstdio>
-
-
-#ifdef UDP_CODE_COMPLETION_LOGGER
-#include "clang/Basic/Version.h"
-#include <arpa/inet.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <unistd.h>
-#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<StoredDiagnostic, 8> Diagnostics;
-
- /// \brief Diag object
- llvm::IntrusiveRefCntPtr<Diagnostic> 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<llvm::sys::Path> TemporaryFiles;
-
- /// \brief Temporary buffers that will be deleted once we have finished with the code-completion results.
- llvm::SmallVector<const llvm::MemoryBuffer *, 1> 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<llvm::NamedRegionTimer> 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<CIndexer *>(CIdx);
-
- // Configure the diagnostics.
- DiagnosticOptions DiagOpts;
- llvm::IntrusiveRefCntPtr<Diagnostic> Diags;
- Diags = CompilerInstance::createDiagnostics(DiagOpts, 0, 0);
-
- // The set of temporary files that we've built.
- std::vector<llvm::sys::Path> TemporaryFiles;
-
- // Build up the arguments for invoking 'clang'.
- std::vector<const char *> 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<std::string> 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<const char*>::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<CXCompletionResult, 4> 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<const char*>::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 : "<unknown>") << '"';
- 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<CodeCompleteAtInfo*>(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<ASTUnit *>(TU);
- if (!AST)
- return;
-
- // Perform the remapping of source files.
- llvm::SmallVector<ASTUnit::RemappedFile, 4> 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<const char*>::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 : "<unknown>") << '"';
- 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<ASTUnit *>(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<AllocatedCXCodeCompleteResults*>(ResultsIn);
- delete Results;
-}
-
-unsigned
-clang_codeCompleteGetNumDiagnostics(CXCodeCompleteResults *ResultsIn) {
- AllocatedCXCodeCompleteResults *Results
- = static_cast<AllocatedCXCodeCompleteResults*>(ResultsIn);
- if (!Results)
- return 0;
-
- return Results->Diagnostics.size();
-}
-
-CXDiagnostic
-clang_codeCompleteGetDiagnostic(CXCodeCompleteResults *ResultsIn,
- unsigned Index) {
- AllocatedCXCodeCompleteResults *Results
- = static_cast<AllocatedCXCodeCompleteResults*>(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 531992e..0000000
--- 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<ASTUnit *>(Unit);
- return CXXUnit? CXXUnit->stored_diag_size() : 0;
-}
-
-CXDiagnostic clang_getDiagnostic(CXTranslationUnit Unit, unsigned Index) {
- ASTUnit *CXXUnit = static_cast<ASTUnit *>(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<CXStoredDiagnostic *>(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 << "<no diagnostic text>";
- 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<CXStoredDiagnostic *>(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<CXStoredDiagnostic *>(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<CXStoredDiagnostic *>(Diag);
- if (!StoredDiag)
- return createCXString("");
-
- return createCXString(StoredDiag->Diag.getMessage(), false);
-}
-
-unsigned clang_getDiagnosticNumRanges(CXDiagnostic Diag) {
- CXStoredDiagnostic *StoredDiag = static_cast<CXStoredDiagnostic *>(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<CXStoredDiagnostic *>(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<CXStoredDiagnostic *>(Diag);
- if (!StoredDiag)
- return 0;
-
- return StoredDiag->Diag.fixit_size();
-}
-
-CXString clang_getDiagnosticFixIt(CXDiagnostic Diagnostic, unsigned FixIt,
- CXSourceRange *ReplacementRange) {
- CXStoredDiagnostic *StoredDiag
- = static_cast<CXStoredDiagnostic *>(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<StoredDiagnostic> &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 919c21c..0000000
--- 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<typename T> 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<StoredDiagnostic> &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 e863239..0000000
--- 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<ASTUnit *>(TU);
- SourceManager &SM = CXXUnit->getSourceManager();
- ASTContext &Ctx = CXXUnit->getASTContext();
-
- llvm::SmallVector<CXSourceLocation, 10> 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 8f3dacf..0000000
--- 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<USRGenerator> {
- 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 <typename T>
- 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<NamespaceDecl>(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<NamedDecl>(DC))
- Visit(D);
-}
-
-void USRGenerator::VisitFieldDecl(FieldDecl *D) {
- VisitDeclContext(D->getDeclContext());
- Out << (isa<ObjCIvarDecl>(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<CXXMethodDecl>(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<Decl>(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<ObjCCategoryDecl>(container))
- if (CD->IsClassExtension()) {
- Visit(CD->getClassInterface());
- break;
- }
- Visit(cast<Decl>(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<ObjCCategoryDecl>(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<ObjCCategoryImplDecl>(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<ObjCProtocolDecl>(D)->getName());
- break;
- }
-}
-
-void USRGenerator::VisitObjCPropertyDecl(ObjCPropertyDecl *D) {
- Visit(cast<Decl>(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<CXXRecordDecl>(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<ClassTemplatePartialSpecializationDecl>(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<ClassTemplateSpecializationDecl>(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<NamedDecl>(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<FileID, unsigned> &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<PointerType>()) {
- Out << '*';
- T = PT->getPointeeType();
- continue;
- }
- if (const ReferenceType *RT = T->getAs<ReferenceType>()) {
- Out << '&';
- T = RT->getPointeeType();
- continue;
- }
- if (const FunctionProtoType *FT = T->getAs<FunctionProtoType>()) {
- 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<BlockPointerType>()) {
- Out << 'B';
- T = BT->getPointeeType();
- continue;
- }
- if (const BuiltinType *BT = T->getAs<BuiltinType>()) {
- 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<ComplexType>()) {
- Out << '<';
- T = CT->getElementType();
- continue;
- }
- if (const TagType *TT = T->getAs<TagType>()) {
- Out << '$';
- VisitTagDecl(TT->getDecl());
- return;
- }
- if (const TemplateTypeParmType *TTP = T->getAs<TemplateTypeParmType>()) {
- Out << 't' << TTP->getDepth() << '.' << TTP->getIndex();
- return;
- }
- if (const TemplateSpecializationType *Spec
- = T->getAs<TemplateSpecializationType>()) {
- 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<TemplateTypeParmDecl>(*P)) {
- Out << 'T';
- continue;
- }
-
- if (NonTypeTemplateParmDecl *NTTP = dyn_cast<NonTypeTemplateParmDecl>(*P)) {
- Out << 'N';
- VisitType(NTTP->getType());
- continue;
- }
-
- TemplateTemplateParmDecl *TTP = cast<TemplateTemplateParmDecl>(*P);
- Out << 't';
- VisitTemplateParameterList(TTP->getTemplateParameters());
- }
-}
-
-void USRGenerator::VisitTemplateName(TemplateName Name) {
- if (TemplateDecl *Template = Name.getAsTemplateDecl()) {
- if (TemplateTemplateParmDecl *TTP
- = dyn_cast<TemplateTemplateParmDecl>(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<NamedDecl>(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<TagDecl>(ND) || isa<TypedefDecl>(ND) ||
- isa<EnumConstantDecl>(ND) || isa<FieldDecl>(ND) ||
- isa<VarDecl>(ND) || isa<NamespaceDecl>(ND))
- break;
- // Fall-through.
- case InternalLinkage:
- if (isa<FunctionDecl>(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 cdf6c61..0000000
--- 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 <cstdio>
-#include <vector>
-#include <sstream>
-
-#ifdef LLVM_ON_WIN32
-#include <windows.h>
-#else
-#include <dlfcn.h>
-#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/<version>/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<std::string> &RemapArgs,
- std::vector<llvm::sys::Path> &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 31bf779..0000000
--- 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 <vector>
-
-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<std::string> &RemapArgs,
- std::vector<llvm::sys::Path> &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 29ef574..0000000
--- 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 a8fd049..0000000
--- 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<void *>(Loc.getRawEncoding());
- CXCursor C = { CXCursor_ObjCSuperClassRef, { Super, RawLoc, TU } };
- return C;
-}
-
-std::pair<ObjCInterfaceDecl *, SourceLocation>
-cxcursor::getCursorObjCSuperClassRef(CXCursor C) {
- assert(C.kind == CXCursor_ObjCSuperClassRef);
- return std::make_pair(static_cast<ObjCInterfaceDecl *>(C.data[0]),
- SourceLocation::getFromRawEncoding(
- reinterpret_cast<uintptr_t>(C.data[1])));
-}
-
-CXCursor cxcursor::MakeCursorObjCProtocolRef(ObjCProtocolDecl *Super,
- SourceLocation Loc,
- ASTUnit *TU) {
- assert(Super && TU && "Invalid arguments!");
- void *RawLoc = reinterpret_cast<void *>(Loc.getRawEncoding());
- CXCursor C = { CXCursor_ObjCProtocolRef, { Super, RawLoc, TU } };
- return C;
-}
-
-std::pair<ObjCProtocolDecl *, SourceLocation>
-cxcursor::getCursorObjCProtocolRef(CXCursor C) {
- assert(C.kind == CXCursor_ObjCProtocolRef);
- return std::make_pair(static_cast<ObjCProtocolDecl *>(C.data[0]),
- SourceLocation::getFromRawEncoding(
- reinterpret_cast<uintptr_t>(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<void *>(Loc.getRawEncoding());
- CXCursor C = { CXCursor_ObjCClassRef, { Class, RawLoc, TU } };
- return C;
-}
-
-std::pair<ObjCInterfaceDecl *, SourceLocation>
-cxcursor::getCursorObjCClassRef(CXCursor C) {
- assert(C.kind == CXCursor_ObjCClassRef);
- return std::make_pair(static_cast<ObjCInterfaceDecl *>(C.data[0]),
- SourceLocation::getFromRawEncoding(
- reinterpret_cast<uintptr_t>(C.data[1])));
-}
-
-CXCursor cxcursor::MakeCursorTypeRef(TypeDecl *Type, SourceLocation Loc,
- ASTUnit *TU) {
- assert(Type && TU && "Invalid arguments!");
- void *RawLoc = reinterpret_cast<void *>(Loc.getRawEncoding());
- CXCursor C = { CXCursor_TypeRef, { Type, RawLoc, TU } };
- return C;
-}
-
-std::pair<TypeDecl *, SourceLocation>
-cxcursor::getCursorTypeRef(CXCursor C) {
- assert(C.kind == CXCursor_TypeRef);
- return std::make_pair(static_cast<TypeDecl *>(C.data[0]),
- SourceLocation::getFromRawEncoding(
- reinterpret_cast<uintptr_t>(C.data[1])));
-}
-
-CXCursor cxcursor::MakeCursorTemplateRef(TemplateDecl *Template,
- SourceLocation Loc, ASTUnit *TU) {
- assert(Template && TU && "Invalid arguments!");
- void *RawLoc = reinterpret_cast<void *>(Loc.getRawEncoding());
- CXCursor C = { CXCursor_TemplateRef, { Template, RawLoc, TU } };
- return C;
-}
-
-std::pair<TemplateDecl *, SourceLocation>
-cxcursor::getCursorTemplateRef(CXCursor C) {
- assert(C.kind == CXCursor_TemplateRef);
- return std::make_pair(static_cast<TemplateDecl *>(C.data[0]),
- SourceLocation::getFromRawEncoding(
- reinterpret_cast<uintptr_t>(C.data[1])));
-}
-
-CXCursor cxcursor::MakeCursorNamespaceRef(NamedDecl *NS, SourceLocation Loc,
- ASTUnit *TU) {
-
- assert(NS && (isa<NamespaceDecl>(NS) || isa<NamespaceAliasDecl>(NS)) && TU &&
- "Invalid arguments!");
- void *RawLoc = reinterpret_cast<void *>(Loc.getRawEncoding());
- CXCursor C = { CXCursor_NamespaceRef, { NS, RawLoc, TU } };
- return C;
-}
-
-std::pair<NamedDecl *, SourceLocation>
-cxcursor::getCursorNamespaceRef(CXCursor C) {
- assert(C.kind == CXCursor_NamespaceRef);
- return std::make_pair(static_cast<NamedDecl *>(C.data[0]),
- SourceLocation::getFromRawEncoding(
- reinterpret_cast<uintptr_t>(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<CXXBaseSpecifier*>(C.data[0]);
-}
-
-CXCursor cxcursor::MakePreprocessingDirectiveCursor(SourceRange Range,
- ASTUnit *TU) {
- CXCursor C = { CXCursor_PreprocessingDirective,
- { reinterpret_cast<void *>(Range.getBegin().getRawEncoding()),
- reinterpret_cast<void *>(Range.getEnd().getRawEncoding()),
- TU }
- };
- return C;
-}
-
-SourceRange cxcursor::getCursorPreprocessingDirective(CXCursor C) {
- assert(C.kind == CXCursor_PreprocessingDirective);
- return SourceRange(SourceLocation::getFromRawEncoding(
- reinterpret_cast<uintptr_t> (C.data[0])),
- SourceLocation::getFromRawEncoding(
- reinterpret_cast<uintptr_t> (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<MacroDefinition *>(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<MacroInstantiation *>(C.data[0]);
-}
-
-Decl *cxcursor::getCursorDecl(CXCursor Cursor) {
- return (Decl *)Cursor.data[0];
-}
-
-Expr *cxcursor::getCursorExpr(CXCursor Cursor) {
- return dyn_cast_or_null<Expr>(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<ASTUnit *>(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 a5f111e..0000000
--- 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 <utility>
-
-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<ObjCInterfaceDecl *, SourceLocation>
- 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<ObjCProtocolDecl *, SourceLocation>
- 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<ObjCInterfaceDecl *, SourceLocation>
- 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<TypeDecl *, SourceLocation> 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<TemplateDecl *, SourceLocation> 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<NamedDecl *, SourceLocation> 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 7a50205..0000000
--- 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 aa173ca..0000000
--- 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<BuiltinType>(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<ASTUnit*>(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<TypeDecl>(D))
- return MakeCXType(QualType(TD->getTypeForDecl(), 0), AU);
- if (ObjCInterfaceDecl *ID = dyn_cast<ObjCInterfaceDecl>(D))
- return MakeCXType(QualType(ID->getTypeForDecl(), 0), AU);
- if (ValueDecl *VD = dyn_cast<ValueDecl>(D))
- return MakeCXType(VD->getType(), AU);
- if (ObjCPropertyDecl *PD = dyn_cast<ObjCPropertyDecl>(D))
- return MakeCXType(PD->getType(), AU);
- if (FunctionDecl *FD = dyn_cast<FunctionDecl>(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<PointerType>(TP)->getPointeeType();
- break;
- case Type::BlockPointer:
- T = cast<BlockPointerType>(TP)->getPointeeType();
- break;
- case Type::LValueReference:
- case Type::RValueReference:
- T = cast<ReferenceType>(TP)->getPointeeType();
- break;
- case Type::ObjCObjectPointer:
- T = cast<ObjCObjectPointerType>(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<TypedefType>(TP)->getDecl();
- break;
- case Type::ObjCObject:
- D = cast<ObjCObjectType>(TP)->getInterface();
- break;
- case Type::ObjCInterface:
- D = cast<ObjCInterfaceType>(TP)->getDecl();
- break;
- case Type::Record:
- case Type::Enum:
- D = cast<TagType>(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<FunctionType>())
- 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<ObjCMethodDecl>(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 94151ed..0000000
--- 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 6d2a13c..0000000
--- 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 d1b45a2..0000000
--- 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 0ea6993..0000000
--- 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 ca10bf5..0000000
--- 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 c182a68..0000000
--- 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 (<FROM_CHILD>) {
- 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 (<FROM_CHILD>) {
- 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 (<CHILD>) {
- 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 (<IN>) { 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 8a7afbb..0000000
--- 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(<PIPE>) {
- 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 (<RIN>) {
- 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 (<IN>) {
- last if (/<!-- BUGMETAEND -->/);
-
- if (/<!-- BUGTYPE (.*) -->$/) {
- $BugType = $1;
- }
- elsif (/<!-- BUGFILE (.*) -->$/) {
- $BugFile = abs_path($1);
- UpdatePrefix($BugFile);
- }
- elsif (/<!-- BUGPATHLENGTH (.*) -->$/) {
- $BugPathLength = $1;
- }
- elsif (/<!-- BUGLINE (.*) -->$/) {
- $BugLine = $1;
- }
- elsif (/<!-- BUGCATEGORY (.*) -->$/) {
- $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 = <IN>;
- 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 <<ENDTEXT;
-<html>
-<head>
-<title>${HtmlTitle}</title>
-<link type="text/css" rel="stylesheet" href="scanview.css"/>
-<script src="sorttable.js"></script>
-<script language='javascript' type="text/javascript">
-function SetDisplay(RowClass, DisplayVal)
-{
- var Rows = document.getElementsByTagName("tr");
- for ( var i = 0 ; i < Rows.length; ++i ) {
- if (Rows[i].className == RowClass) {
- Rows[i].style.display = DisplayVal;
- }
- }
-}
-
-function CopyCheckedStateToCheckButtons(SummaryCheckButton) {
- var Inputs = document.getElementsByTagName("input");
- for ( var i = 0 ; i < Inputs.length; ++i ) {
- if (Inputs[i].type == "checkbox") {
- if(Inputs[i] != SummaryCheckButton) {
- Inputs[i].checked = SummaryCheckButton.checked;
- Inputs[i].onclick();
- }
- }
- }
-}
-
-function returnObjById( id ) {
- if (document.getElementById)
- var returnVar = document.getElementById(id);
- else if (document.all)
- var returnVar = document.all[id];
- else if (document.layers)
- var returnVar = document.layers[id];
- return returnVar;
-}
-
-var NumUnchecked = 0;
-
-function ToggleDisplay(CheckButton, ClassName) {
- if (CheckButton.checked) {
- SetDisplay(ClassName, "");
- if (--NumUnchecked == 0) {
- returnObjById("AllBugsCheck").checked = true;
- }
- }
- else {
- SetDisplay(ClassName, "none");
- NumUnchecked++;
- returnObjById("AllBugsCheck").checked = false;
- }
-}
-</script>
-<!-- SUMMARYENDHEAD -->
-</head>
-<body>
-<h1>${HtmlTitle}</h1>
-
-<table>
-<tr><th>User:</th><td>${UserName}\@${HostName}</td></tr>
-<tr><th>Working Directory:</th><td>${CurrentDir}</td></tr>
-<tr><th>Command Line:</th><td>${CmdArgs}</td></tr>
-<tr><th>Date:</th><td>${Date}</td></tr>
-ENDTEXT
-
-print OUT "<tr><th>Version:</th><td>${BuildName} (${BuildDate})</td></tr>\n"
- if (defined($BuildName) && defined($BuildDate));
-
-print OUT <<ENDTEXT;
-</table>
-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 "<h2>Bug Summary</h2>";
-
- if (defined $BuildName) {
- print OUT "\n<p>Results in this analysis run are based on analyzer build <b>$BuildName</b>.</p>\n"
- }
-
- my $TotalBugs = scalar(@Index);
-print OUT <<ENDTEXT;
-<table>
-<thead><tr><td>Bug Type</td><td>Quantity</td><td class="sorttable_nosort">Display?</td></tr></thead>
-<tr style="font-weight:bold"><td class="SUMM_DESC">All Bugs</td><td class="Q">$TotalBugs</td><td><center><input type="checkbox" id="AllBugsCheck" onClick="CopyCheckedStateToCheckButtons(this);" checked/></center></td></tr>
-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 "<tr><th>$category</th><th colspan=2></th></tr>\n";
- }
- my $x = lc $key;
- $x =~ s/[ ,'":\/()]+/_/g;
- print OUT "<tr><td class=\"SUMM_DESC\">";
- print OUT $val->[2];
- print OUT "</td><td class=\"Q\">";
- print OUT $val->[0];
- print OUT "</td><td><center><input type=\"checkbox\" onClick=\"ToggleDisplay(this,'bt_$x');\" checked/></center></td></tr>\n";
- }
-
- # Print out the table of errors.
-
-print OUT <<ENDTEXT;
-</table>
-<h2>Reports</h2>
-
-<table class="sortable" style="table-layout:automatic">
-<thead><tr>
- <td>Bug Group</td>
- <td class="sorttable_sorted">Bug Type<span id="sorttable_sortfwdind">&nbsp;&#x25BE;</span></td>
- <td>File</td>
- <td class="Q">Line</td>
- <td class="Q">Path Length</td>
- <td class="sorttable_nosort"></td>
- <!-- REPORTBUGCOL -->
-</tr></thead>
-<tbody>
-ENDTEXT
-
- my $prefix = GetPrefix();
- my $regex;
- my $InFileRegex;
- my $InFilePrefix = "File:</td><td>";
-
- 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 "<tr class=\"bt_$x\">";
- print OUT "<td class=\"DESC\">";
- print OUT $row->[1];
- print OUT "</td>";
- print OUT "<td class=\"DESC\">";
- print OUT $row->[2];
- print OUT "</td>";
-
- # Update the file prefix.
- my $fname = $row->[3];
-
- if (defined $regex) {
- $fname =~ s/$regex//;
- UpdateInFilePath("$Dir/$ReportFile", $InFileRegex, $InFilePrefix)
- }
-
- print OUT "<td>";
- my @fname = split /\//,$fname;
- if ($#fname > 0) {
- while ($#fname >= 0) {
- my $x = shift @fname;
- print OUT $x;
- if ($#fname >= 0) {
- print OUT "<span class=\"W\"> </span>/";
- }
- }
- }
- else {
- print OUT $fname;
- }
- print OUT "</td>";
-
- # Print out the quantities.
- for my $j ( 4 .. 5 ) {
- print OUT "<td class=\"Q\">$row->[$j]</td>";
- }
-
- # Print the rest of the columns.
- for (my $j = 6; $j <= $#{$row}; ++$j) {
- print OUT "<td>$row->[$j]</td>"
- }
-
- # Emit the "View" link.
- print OUT "<td><a href=\"$ReportFile#EndPath\">View Report</a></td>";
-
- # Emit REPORTBUG markers.
- print OUT "\n<!-- REPORTBUG id=\"$ReportFile\" -->\n";
-
- # End the row.
- print OUT "</tr>\n";
- }
-
- print OUT "</tbody>\n</table>\n\n";
- }
-
- if (scalar (@failures) || scalar(@attributes_ignored)) {
- print OUT "<h2>Analyzer Failures</h2>\n";
-
- if (scalar @attributes_ignored) {
- print OUT "The analyzer's parser ignored the following attributes:<p>\n";
- print OUT "<table>\n";
- print OUT "<thead><tr><td>Attribute</td><td>Source File</td><td>Preprocessed File</td><td>STDERR Output</td></tr></thead>\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 = <ATTR>;
- 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 = <INFO>;
- chomp $srcfile;
- close (INFO);
- # Print the information in the table.
- my $prefix = GetPrefix();
- if (defined $prefix) { $srcfile =~ s/^\Q$prefix//; }
- print OUT "<tr><td>$attribute</td><td>$srcfile</td><td><a href=\"failures/$ppfile\">$ppfile</a></td><td><a href=\"failures/$ppfile.stderr.txt\">$ppfile.stderr.txt</a></td></tr>\n";
- my $ppfile_clang = $ppfile;
- $ppfile_clang =~ s/[.](.+)$/.clang.$1/;
- print OUT " <!-- REPORTPROBLEM src=\"$srcfile\" file=\"failures/$ppfile\" clangfile=\"failures/$ppfile_clang\" stderr=\"failures/$ppfile.stderr.txt\" info=\"failures/$ppfile.info.txt\" -->\n";
- }
- print OUT "</table>\n";
- }
-
- if (scalar @failures) {
- print OUT "<p>The analyzer had problems processing the following files:</p>\n";
- print OUT "<table>\n";
- print OUT "<thead><tr><td>Problem</td><td>Source File</td><td>Preprocessed File</td><td>STDERR Output</td></tr></thead>\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 = <INFO>;
- chomp $srcfile;
- my $problem = <INFO>;
- chomp $problem;
- close (INFO);
- # Print the information in the table.
- my $prefix = GetPrefix();
- if (defined $prefix) { $srcfile =~ s/^\Q$prefix//; }
- print OUT "<tr><td>$problem</td><td>$srcfile</td><td><a href=\"failures/$ppfile\">$ppfile</a></td><td><a href=\"failures/$ppfile.stderr.txt\">$ppfile.stderr.txt</a></td></tr>\n";
- my $ppfile_clang = $ppfile;
- $ppfile_clang =~ s/[.](.+)$/.clang.$1/;
- print OUT " <!-- REPORTPROBLEM src=\"$srcfile\" file=\"failures/$ppfile\" clangfile=\"failures/$ppfile_clang\" stderr=\"failures/$ppfile.stderr.txt\" info=\"failures/$ppfile.info.txt\" -->\n";
- }
- print OUT "</table>\n";
- }
- print OUT "<p>Please consider submitting preprocessed files as <a href=\"http://clang.llvm.org/StaticAnalysisUsage.html#filingbugs\">bug reports</a>. <!-- REPORTCRASHES --> </p>\n";
- }
-
- print OUT "</body></html>\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 <<ENDTEXT;
-USAGE: $Prog [options] <build command> [build options]
-
-ENDTEXT
-
- if (defined $BuildName) {
- print "ANALYZER BUILD: $BuildName ($BuildDate)\n\n";
- }
-
-print <<ENDTEXT;
-OPTIONS:
-
- -analyze-headers - Also analyze functions in #included files.
-
- --experimental-checks - Enable experimental checks that are currently in heavy testing
-
- -o - Target directory for HTML report files. Subdirectories
- will be created as needed to represent separate "runs" of
- the analyzer. If this option is not specified, a directory
- is created in /tmp (TMPDIR on Mac OS X) to store the reports.
-
- -h - Display this message.
- --help
-
- -k - Add a "keep on going" option to the specified build command.
- --keep-going This option currently supports make and xcodebuild.
- This is a convenience option; one can specify this
- behavior directly using build options.
-
- --html-title [title] - Specify the title used on generated HTML pages.
- --html-title=[title] If not specified, a default title will be used.
-
- -plist - By default the output of scan-build is a set of HTML files.
- This option outputs the results as a set of .plist files.
-
- --status-bugs - By default, the exit status of $Prog is the same as the
- executed build command. Specifying this option causes the
- exit status of $Prog to be 1 if it found potential bugs
- and 0 otherwise.
-
- --use-cc [compiler path] - By default, $Prog uses 'gcc' to compile and link
- --use-cc=[compiler path] your C and Objective-C code. Use this option
- to specify an alternate compiler.
-
- --use-c++ [compiler path] - By default, $Prog uses 'g++' to compile and link
- --use-c++=[compiler path] your C++ and Objective-C++ code. Use this option
- to specify an alternate compiler.
-
- -v - Verbose output from $Prog and the analyzer.
- A second and third '-v' increases verbosity.
-
- -V - View analysis results in a web browser when the build
- --view completes.
-
-ADVANCED OPTIONS:
-
- -constraints [model] - Specify the contraint engine used by the analyzer.
- By default the 'range' model is used. Specifying
- 'basic' uses a simpler, less powerful constraint model
- used by checker-0.160 and earlier.
-
- -store [model] - Specify the store model used by the analyzer. By default,
- the 'region' store model is used. 'region' specifies a field-
- sensitive store model. Users can also specify 'basic', which
- is far less precise but can more quickly analyze code.
- 'basic' was the default store model for checker-0.221 and
- earlier.
-
- -no-failure-reports - Do not create a 'failures' subdirectory that includes
- analyzer crash reports and preprocessed source files.
-
-AVAILABLE ANALYSES (multiple analyses may be specified):
-
-ENDTEXT
-
- foreach my $Analysis (sort keys %AvailableAnalyses) {
- if (defined $AnalysesDefaultEnabled{$Analysis}) {
- print " (+)";
- }
- else {
- print " ";
- }
-
- print " $Analysis\n";
- }
-
-print <<ENDTEXT
-
- NOTE: "(+)" indicates that an analysis is enabled by default unless one
- or more analysis options are specified
-
-BUILD OPTIONS
-
- You can specify any build option acceptable to the build command.
-
-EXAMPLE
-
- $Prog -o /tmp/myhtmldir make -j4
-
- The above example causes analysis reports to be deposited into
- a subdirectory of "/tmp/myhtmldir" and to run "make" with the "-j4" option.
- A different subdirectory is created each time $Prog analyzes a project.
- The analyzer should support most parallel builds, but not distributed builds.
-
-ENDTEXT
-}
-
-##----------------------------------------------------------------------------##
-# HtmlEscape - HTML entity encode characters that are special in HTML
-##----------------------------------------------------------------------------##
-
-sub HtmlEscape {
- # copy argument to new variable so we don't clobber the original
- my $arg = shift || '';
- my $tmp = $arg;
- $tmp =~ s/&/&amp;/g;
- $tmp =~ s/</&lt;/g;
- $tmp =~ s/>/&gt;/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 a0406f3..0000000
--- 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 cc068a5..0000000
--- 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 4352d3b..0000000
--- 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 <script src="sorttable.js"></script> 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; i<table.rows.length; i++) {
- if (table.rows[i].className.search(/\bsortbottom\b/) != -1) {
- sortbottomrows[sortbottomrows.length] = table.rows[i];
- }
- }
- if (sortbottomrows) {
- if (table.tFoot == null) {
- // table doesn't have a tfoot. Create one.
- tfo = document.createElement('tfoot');
- table.appendChild(tfo);
- }
- for (var i=0; i<sortbottomrows.length; i++) {
- tfo.appendChild(sortbottomrows[i]);
- }
- delete sortbottomrows;
- }
-
- // work through each column and calculate its type
- headrow = table.tHead.rows[0].cells;
- for (var i=0; i<headrow.length; i++) {
- // manually override the type with a sorttable_type attribute
- if (!headrow[i].className.match(/\bsorttable_nosort\b/)) { // skip this col
- mtch = headrow[i].className.match(/\bsorttable_([a-z0-9]+)\b/);
- if (mtch) { override = mtch[1]; }
- if (mtch && typeof sorttable["sort_"+override] == 'function') {
- headrow[i].sorttable_sortfunction = sorttable["sort_"+override];
- } else {
- headrow[i].sorttable_sortfunction = sorttable.guessType(table,i);
- }
- // make it clickable to sort
- headrow[i].sorttable_columnindex = i;
- headrow[i].sorttable_tbody = table.tBodies[0];
- dean_addEvent(headrow[i],"click", function(e) {
-
- if (this.className.search(/\bsorttable_sorted\b/) != -1) {
- // if we're already sorted by this column, just
- // reverse the table, which is quicker
- sorttable.reverse(this.sorttable_tbody);
- this.className = this.className.replace('sorttable_sorted',
- 'sorttable_sorted_reverse');
- this.removeChild(document.getElementById('sorttable_sortfwdind'));
- sortrevind = document.createElement('span');
- sortrevind.id = "sorttable_sortrevind";
- sortrevind.innerHTML = stIsIE ? '&nbsp<font face="webdings">5</font>' : '&nbsp;&#x25B4;';
- 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 ? '&nbsp<font face="webdings">6</font>' : '&nbsp;&#x25BE;';
- 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 ? '&nbsp<font face="webdings">6</font>' : '&nbsp;&#x25BE;';
- 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<rows.length; j++) {
- row_array[row_array.length] = [sorttable.getInnerText(rows[j].cells[col]), rows[j]];
- }
- /* If you want a stable sort, uncomment the following line */
- sorttable.shaker_sort(row_array, this.sorttable_sortfunction);
- /* and comment out this one */
- //row_array.sort(this.sorttable_sortfunction);
-
- tb = this.sorttable_tbody;
- for (var j=0; j<row_array.length; j++) {
- tb.appendChild(row_array[j][1]);
- }
-
- delete row_array;
- });
- }
- }
- },
-
- guessType: function(table, column) {
- // guess the type of a column based on its first non-blank row
- sortfn = sorttable.sort_alpha;
- for (var i=0; i<table.tBodies[0].rows.length; i++) {
- text = sorttable.getInnerText(table.tBodies[0].rows[i].cells[column]);
- if (text != '') {
- if (text.match(/^-?[£$¤]?[\d,.]+%?$/)) {
- return sorttable.sort_numeric;
- }
- // check for a date: dd/mm/yyyy or dd/mm/yy
- // can have / or . or - as separator
- // can be mm/dd as well
- possdate = text.match(sorttable.DATE_RE)
- if (possdate) {
- // looks like a date
- first = parseInt(possdate[1]);
- second = parseInt(possdate[2]);
- if (first > 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 <input> 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<tbody.rows.length; i++) {
- newrows[newrows.length] = tbody.rows[i];
- }
- for (var i=newrows.length-1; 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]<b[0]) return -1;
- return 1;
- },
- sort_ddmm: function(a,b) {
- mtch = a[0].match(sorttable.DATE_RE);
- y = mtch[3]; m = mtch[2]; d = mtch[1];
- if (m.length == 1) m = '0'+m;
- if (d.length == 1) d = '0'+d;
- dt1 = y+m+d;
- mtch = b[0].match(sorttable.DATE_RE);
- y = mtch[3]; m = mtch[2]; d = mtch[1];
- if (m.length == 1) m = '0'+m;
- if (d.length == 1) d = '0'+d;
- dt2 = y+m+d;
- if (dt1==dt2) return 0;
- if (dt1<dt2) return -1;
- return 1;
- },
- sort_mmdd: function(a,b) {
- mtch = a[0].match(sorttable.DATE_RE);
- y = mtch[3]; d = mtch[2]; m = mtch[1];
- if (m.length == 1) m = '0'+m;
- if (d.length == 1) d = '0'+d;
- dt1 = y+m+d;
- mtch = b[0].match(sorttable.DATE_RE);
- y = mtch[3]; d = mtch[2]; m = mtch[1];
- if (m.length == 1) m = '0'+m;
- if (d.length == 1) d = '0'+d;
- dt2 = y+m+d;
- if (dt1==dt2) return 0;
- if (dt1<dt2) return -1;
- return 1;
- },
-
- shaker_sort: function(list, comp_func) {
- // A stable sort function to allow multi-level sorting of data
- // see: http://en.wikipedia.org/wiki/Cocktail_sort
- // thanks to Joseph Nahmias
- var b = 0;
- var t = list.length - 1;
- var swap = true;
-
- while(swap) {
- swap = false;
- for(var i = b; i < t; ++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
- 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("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
- var script = document.getElementById("__ie_onload");
- script.onreadystatechange = function() {
- if (this.readyState == "complete") {
- sorttable.init(); // call the onload handler
- }
- };
-/*@end @*/
-
-/* for Safari */
-if (/WebKit/i.test(navigator.userAgent)) { // sniff
- var _timer = setInterval(function() {
- if (/loaded|complete/.test(document.readyState)) {
- sorttable.init(); // call the onload handler
- }
- }, 10);
-}
-
-/* for other browsers */
-window.onload = sorttable.init;
-
-// written by Dean Edwards, 2005
-// with input from Tino Zijdel, Matthias Miller, Diego Perini
-
-// http://dean.edwards.name/weblog/2005/10/add-event/
-
-function dean_addEvent(element, type, handler) {
- if (element.addEventListener) {
- element.addEventListener(type, handler, false);
- } else {
- // assign each event handler a unique ID
- if (!handler.$$guid) handler.$$guid = dean_addEvent.guid++;
- // create a hash table of event types for the element
- if (!element.events) element.events = {};
- // create a hash table of event handlers for each element/event pair
- var handlers = element.events[type];
- if (!handlers) {
- handlers = element.events[type] = {};
- // store the existing event handler (if there is one)
- if (element["on" + type]) {
- handlers[0] = element["on" + type];
- }
- }
- // store the event handler in the hash table
- handlers[handler.$$guid] = handler;
- // assign a global event handler to do all the work
- element["on" + type] = handleEvent;
- }
-};
-// a counter used to create unique IDs
-dean_addEvent.guid = 1;
-
-function removeEvent(element, type, handler) {
- if (element.removeEventListener) {
- element.removeEventListener(type, handler, false);
- } else {
- // delete the event handler from the hash table
- if (element.events && element.events[type]) {
- delete element.events[type][handler.$$guid];
- }
- }
-};
-
-function handleEvent(event) {
- var returnValue = true;
- // grab the event object (IE uses a global event object)
- event = event || fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event);
- // get a reference to the hash table of event handlers
- var handlers = this.events[event.type];
- // execute each event handler
- for (var i in handlers) {
- this.$$handleEvent = handlers[i];
- if (this.$$handleEvent(event) === false) {
- returnValue = false;
- }
- }
- return returnValue;
-};
-
-function fixEvent(event) {
- // add W3C standard event methods
- event.preventDefault = fixEvent.preventDefault;
- event.stopPropagation = fixEvent.stopPropagation;
- return event;
-};
-fixEvent.preventDefault = function() {
- this.returnValue = false;
-};
-fixEvent.stopPropagation = function() {
- this.cancelBubble = true;
-}
-
-// Dean's forEach: http://dean.edwards.name/base/forEach.js
-/*
- forEach, version 1.0
- Copyright 2006, Dean Edwards
- License: http://www.opensource.org/licenses/mit-license.php
-*/
-
-// array-like enumeration
-if (!Array.forEach) { // mozilla already supports this
- Array.forEach = function(array, block, context) {
- for (var i = 0; i < array.length; i++) {
- block.call(context, array[i], i, array);
- }
- };
-}
-
-// generic enumeration
-Function.prototype.forEach = function(object, block, context) {
- for (var key in object) {
- if (typeof this.prototype[key] == "undefined") {
- block.call(context, object[key], key, object);
- }
- }
-};
-
-// character enumeration
-String.forEach = function(string, block, context) {
- Array.forEach(string.split(""), function(chr, index) {
- block.call(context, chr, index, string);
- });
-};
-
-// globally resolve forEach enumeration
-var forEach = function(object, block, context) {
- if (object) {
- var resolve = Object; // default
- if (object instanceof Function) {
- // functions have a "length" property
- resolve = Function;
- } else if (object.forEach instanceof Function) {
- // the object implements a custom forEach method so use that
- object.forEach(block, context);
- return;
- } else if (typeof object == "string") {
- // the object is a string
- resolve = String;
- } else if (typeof object.length == "number") {
- // the object is array-like
- resolve = Array;
- }
- resolve.forEach(object, block, context);
- }
-};
-
diff --git a/contrib/llvm/tools/clang/tools/scan-view/Reporter.py b/contrib/llvm/tools/clang/tools/scan-view/Reporter.py
deleted file mode 100644
index 9560fc1..0000000
--- a/contrib/llvm/tools/clang/tools/scan-view/Reporter.py
+++ /dev/null
@@ -1,248 +0,0 @@
-"""Methods for reporting bugs."""
-
-import subprocess, sys, os
-
-__all__ = ['ReportFailure', 'BugReport', 'getReporters']
-
-#
-
-class ReportFailure(Exception):
- """Generic exception for failures in bug reporting."""
- def __init__(self, value):
- self.value = value
-
-# Collect information about a bug.
-
-class BugReport:
- def __init__(self, title, description, files):
- self.title = title
- self.description = description
- self.files = files
-
-# Reporter interfaces.
-
-import os
-
-import email, mimetypes, smtplib
-from email import encoders
-from email.message import Message
-from email.mime.base import MIMEBase
-from email.mime.multipart import MIMEMultipart
-from email.mime.text import MIMEText
-
-#===------------------------------------------------------------------------===#
-# ReporterParameter
-#===------------------------------------------------------------------------===#
-
-class ReporterParameter:
- def __init__(self, n):
- self.name = n
- def getName(self):
- return self.name
- def getValue(self,r,bugtype,getConfigOption):
- return getConfigOption(r.getName(),self.getName())
- def saveConfigValue(self):
- return True
-
-class TextParameter (ReporterParameter):
- def getHTML(self,r,bugtype,getConfigOption):
- return """\
-<tr>
-<td class="form_clabel">%s:</td>
-<td class="form_value"><input type="text" name="%s_%s" value="%s"></td>
-</tr>"""%(self.getName(),r.getName(),self.getName(),self.getValue(r,bugtype,getConfigOption))
-
-class SelectionParameter (ReporterParameter):
- def __init__(self, n, values):
- ReporterParameter.__init__(self,n)
- self.values = values
-
- def getHTML(self,r,bugtype,getConfigOption):
- default = self.getValue(r,bugtype,getConfigOption)
- return """\
-<tr>
-<td class="form_clabel">%s:</td><td class="form_value"><select name="%s_%s">
-%s
-</select></td>"""%(self.getName(),r.getName(),self.getName(),'\n'.join(["""\
-<option value="%s"%s>%s</option>"""%(o[0],
- o[0] == default and ' selected="selected"' or '',
- o[1]) for o in self.values]))
-
-#===------------------------------------------------------------------------===#
-# Reporters
-#===------------------------------------------------------------------------===#
-
-class EmailReporter:
- def getName(self):
- return 'Email'
-
- def getParameters(self):
- return map(lambda x:TextParameter(x),['To', 'From', 'SMTP Server', 'SMTP Port'])
-
- # Lifted from python email module examples.
- def attachFile(self, outer, path):
- # Guess the content type based on the file's extension. Encoding
- # will be ignored, although we should check for simple things like
- # gzip'd or compressed files.
- ctype, encoding = mimetypes.guess_type(path)
- if ctype is None or encoding is not None:
- # No guess could be made, or the file is encoded (compressed), so
- # use a generic bag-of-bits type.
- ctype = 'application/octet-stream'
- maintype, subtype = ctype.split('/', 1)
- if maintype == 'text':
- fp = open(path)
- # Note: we should handle calculating the charset
- msg = MIMEText(fp.read(), _subtype=subtype)
- fp.close()
- else:
- fp = open(path, 'rb')
- msg = MIMEBase(maintype, subtype)
- msg.set_payload(fp.read())
- fp.close()
- # Encode the payload using Base64
- encoders.encode_base64(msg)
- # Set the filename parameter
- msg.add_header('Content-Disposition', 'attachment', filename=os.path.basename(path))
- outer.attach(msg)
-
- def fileReport(self, report, parameters):
- mainMsg = """\
-BUG REPORT
----
-Title: %s
-Description: %s
-"""%(report.title, report.description)
-
- if not parameters.get('To'):
- raise ReportFailure('No "To" address specified.')
- if not parameters.get('From'):
- raise ReportFailure('No "From" address specified.')
-
- msg = MIMEMultipart()
- msg['Subject'] = 'BUG REPORT: %s'%(report.title)
- # FIXME: Get config parameters
- msg['To'] = parameters.get('To')
- msg['From'] = parameters.get('From')
- msg.preamble = mainMsg
-
- msg.attach(MIMEText(mainMsg, _subtype='text/plain'))
- for file in report.files:
- self.attachFile(msg, file)
-
- try:
- s = smtplib.SMTP(host=parameters.get('SMTP Server'),
- port=parameters.get('SMTP Port'))
- s.sendmail(msg['From'], msg['To'], msg.as_string())
- s.close()
- except:
- raise ReportFailure('Unable to send message via SMTP.')
-
- return "Message sent!"
-
-class BugzillaReporter:
- def getName(self):
- return 'Bugzilla'
-
- def getParameters(self):
- return map(lambda x:TextParameter(x),['URL','Product'])
-
- def fileReport(self, report, parameters):
- raise NotImplementedError
-
-
-class RadarClassificationParameter(SelectionParameter):
- def __init__(self):
- SelectionParameter.__init__(self,"Classification",
- [['1', 'Security'], ['2', 'Crash/Hang/Data Loss'],
- ['3', 'Performance'], ['4', 'UI/Usability'],
- ['6', 'Serious Bug'], ['7', 'Other']])
-
- def saveConfigValue(self):
- return False
-
- def getValue(self,r,bugtype,getConfigOption):
- if bugtype.find("leak") != -1:
- return '3'
- elif bugtype.find("dereference") != -1:
- return '2'
- elif bugtype.find("missing ivar release") != -1:
- return '3'
- else:
- return '7'
-
-class RadarReporter:
- @staticmethod
- def isAvailable():
- # FIXME: Find this .scpt better
- path = os.path.join(os.path.dirname(__file__),'Resources/GetRadarVersion.scpt')
- try:
- p = subprocess.Popen(['osascript',path],
- stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- except:
- return False
- data,err = p.communicate()
- res = p.wait()
- # FIXME: Check version? Check for no errors?
- return res == 0
-
- def getName(self):
- return 'Radar'
-
- def getParameters(self):
- return [ TextParameter('Component'), TextParameter('Component Version'),
- RadarClassificationParameter() ]
-
- def fileReport(self, report, parameters):
- component = parameters.get('Component', '')
- componentVersion = parameters.get('Component Version', '')
- classification = parameters.get('Classification', '')
- personID = ""
- diagnosis = ""
- config = ""
-
- if not component.strip():
- component = 'Bugs found by clang Analyzer'
- if not componentVersion.strip():
- componentVersion = 'X'
-
- script = os.path.join(os.path.dirname(__file__),'Resources/FileRadar.scpt')
- args = ['osascript', script, component, componentVersion, classification, personID, report.title,
- report.description, diagnosis, config] + map(os.path.abspath, report.files)
-# print >>sys.stderr, args
- try:
- p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- except:
- raise ReportFailure("Unable to file radar (AppleScript failure).")
- data, err = p.communicate()
- res = p.wait()
-
- if res:
- raise ReportFailure("Unable to file radar (AppleScript failure).")
-
- try:
- values = eval(data)
- except:
- raise ReportFailure("Unable to process radar results.")
-
- # We expect (int: bugID, str: message)
- if len(values) != 2 or not isinstance(values[0], int):
- raise ReportFailure("Unable to process radar results.")
-
- bugID,message = values
- bugID = int(bugID)
-
- if not bugID:
- raise ReportFailure(message)
-
- return "Filed: <a href=\"rdar://%d/\">%d</a>"%(bugID,bugID)
-
-###
-
-def getReporters():
- reporters = []
- if RadarReporter.isAvailable():
- reporters.append(RadarReporter())
- reporters.append(EmailReporter())
- return reporters
-
diff --git a/contrib/llvm/tools/clang/tools/scan-view/Resources/FileRadar.scpt b/contrib/llvm/tools/clang/tools/scan-view/Resources/FileRadar.scpt
deleted file mode 100644
index 1c74552..0000000
--- a/contrib/llvm/tools/clang/tools/scan-view/Resources/FileRadar.scpt
+++ /dev/null
Binary files differ
diff --git a/contrib/llvm/tools/clang/tools/scan-view/Resources/GetRadarVersion.scpt b/contrib/llvm/tools/clang/tools/scan-view/Resources/GetRadarVersion.scpt
deleted file mode 100644
index e69de29..0000000
--- a/contrib/llvm/tools/clang/tools/scan-view/Resources/GetRadarVersion.scpt
+++ /dev/null
diff --git a/contrib/llvm/tools/clang/tools/scan-view/Resources/bugcatcher.ico b/contrib/llvm/tools/clang/tools/scan-view/Resources/bugcatcher.ico
deleted file mode 100644
index 22d39b5..0000000
--- a/contrib/llvm/tools/clang/tools/scan-view/Resources/bugcatcher.ico
+++ /dev/null
Binary files differ
diff --git a/contrib/llvm/tools/clang/tools/scan-view/ScanView.py b/contrib/llvm/tools/clang/tools/scan-view/ScanView.py
deleted file mode 100644
index 837adae..0000000
--- a/contrib/llvm/tools/clang/tools/scan-view/ScanView.py
+++ /dev/null
@@ -1,770 +0,0 @@
-import BaseHTTPServer
-import SimpleHTTPServer
-import os
-import sys
-import urllib, urlparse
-import posixpath
-import StringIO
-import re
-import shutil
-import threading
-import time
-import socket
-import itertools
-
-import Reporter
-import ConfigParser
-
-###
-# Various patterns matched or replaced by server.
-
-kReportFileRE = re.compile('(.*/)?report-(.*)\\.html')
-
-kBugKeyValueRE = re.compile('<!-- BUG([^ ]*) (.*) -->')
-
-# <!-- REPORTPROBLEM file="crashes/clang_crash_ndSGF9.mi" stderr="crashes/clang_crash_ndSGF9.mi.stderr.txt" info="crashes/clang_crash_ndSGF9.mi.info" -->
-
-kReportCrashEntryRE = re.compile('<!-- REPORTPROBLEM (.*?)-->')
-kReportCrashEntryKeyValueRE = re.compile(' ?([^=]+)="(.*?)"')
-
-kReportReplacements = []
-
-# Add custom javascript.
-kReportReplacements.append((re.compile('<!-- SUMMARYENDHEAD -->'), """\
-<script language="javascript" type="text/javascript">
-function load(url) {
- if (window.XMLHttpRequest) {
- req = new XMLHttpRequest();
- } else if (window.ActiveXObject) {
- req = new ActiveXObject("Microsoft.XMLHTTP");
- }
- if (req != undefined) {
- req.open("GET", url, true);
- req.send("");
- }
-}
-</script>"""))
-
-# Insert additional columns.
-kReportReplacements.append((re.compile('<!-- REPORTBUGCOL -->'),
- '<td></td><td></td>'))
-
-# Insert report bug and open file links.
-kReportReplacements.append((re.compile('<!-- REPORTBUG id="report-(.*)\\.html" -->'),
- ('<td class="Button"><a href="report/\\1">Report Bug</a></td>' +
- '<td class="Button"><a href="javascript:load(\'open/\\1\')">Open File</a></td>')))
-
-kReportReplacements.append((re.compile('<!-- REPORTHEADER -->'),
- '<h3><a href="/">Summary</a> > Report %(report)s</h3>'))
-
-kReportReplacements.append((re.compile('<!-- REPORTSUMMARYEXTRA -->'),
- '<td class="Button"><a href="report/%(report)s">Report Bug</a></td>'))
-
-# 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('<!-- REPORTCRASHES -->'),
-# '<br>These files will automatically be attached to ' +
-# 'reports filed here: <a href="report_crashes">Report Crashes</a>.'))
-
-###
-# 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,'<b>Unhandled Exception</b><br><pre>'
- traceback.print_exc(e,file=s)
- print >>s,'</pre>'
- 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 = """\
-<a href="/report_crashes">File Bug</a> > """%locals()
- else:
- reportingFor = '<a href="/%s">Report %s</a> > ' % (c.reportSource,
- report)
- fileBug = '<a href="/report/%s">File Bug</a> > ' % 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 = """
-<head>
- <title>Bug Submission</title>
- <link rel="stylesheet" type="text/css" href="/scanview.css" />
-</head>
-<body>
-<h3>
-<a href="/">Summary</a> >
-%(reportingFor)s
-%(fileBug)s
-Submit</h3>
-<form name="form" action="">
-<table class="form">
-<tr><td>
-<table class="form_group">
-<tr>
- <td class="form_clabel">Title:</td>
- <td class="form_value">
- <input type="text" name="title" size="50" value="%(title)s" disabled>
- </td>
-</tr>
-<tr>
- <td class="form_label">Description:</td>
- <td class="form_value">
-<textarea rows="10" cols="80" name="description" disabled>
-%(description)s
-</textarea>
- </td>
-</table>
-</td></tr>
-</table>
-</form>
-<h1 class="%(statusClass)s">Submission %(statusName)s</h1>
-%(message)s
-<p>
-<hr>
-<a href="/">Return to Summary</a>
-</body>
-</html>"""%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',
- '<unknown>'),
- ''.join(lns))
-
- c.description = """\
-The clang static analyzer failed on these inputs:
-%s
-
-STDERR Summary
---------------
-%s
-""" % ('\n'.join([item.get('src','<unknown>') 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','<unknown>'), keys.get('LINE', '<unknown>'))
- c.reportSource = 'report-%s.html' % report
- c.navMarkup = """<a href="/%s">Report %s</a> > """ % (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 = """\
-<iframe src="/%s" width="100%%" height="40%%"
- scrolling="auto" frameborder="1">
- <a href="/%s">View Bug Report</a>
-</iframe>""" % (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('<option value="%d"%s>%s</option>'%(i,selectedStr,r.getName()))
- options = '\n'.join([ o.getHTML(r,title,getConfigOption) for o in r.getParameters()])
- display = ('none','')[selected]
- reporterOptions.append("""\
-<tr id="%sReporterOptions" style="display:%s">
- <td class="form_label">%s Options</td>
- <td class="form_value">
- <table class="form_inner_group">
-%s
- </table>
- </td>
-</tr>
-"""%(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(["""\
-<option value="%d" selected>%s</option>""" % (i,v) for i,v in enumerate(c.files)])
- attachFileRow = """\
-<tr>
- <td class="form_label">Attach:</td>
- <td class="form_value">
-<select style="width:100%%" name="files" multiple size=%d>
-%s
-</select>
- </td>
-</tr>
-""" % (min(5, len(c.files)), attachFileOptions)
- else:
- attachFileRow = ""
-
- result = """<html>
-<head>
- <title>File Bug</title>
- <link rel="stylesheet" type="text/css" href="/scanview.css" />
-</head>
-<script language="javascript" type="text/javascript">
-var reporters = %(reportersArray)s;
-function updateReporterOptions() {
- index = document.getElementById('reporter').selectedIndex;
- for (var i=0; i < reporters.length; ++i) {
- o = document.getElementById(reporters[i] + "ReporterOptions");
- if (i == index) {
- o.style.display = "";
- } else {
- o.style.display = "none";
- }
- }
-}
-</script>
-<body onLoad="updateReporterOptions()">
-<h3>
-<a href="/">Summary</a> >
-%(reportingFor)s
-File Bug</h3>
-<form name="form" action="/report_submit" method="post">
-<input type="hidden" name="report" value="%(report)s">
-
-<table class="form">
-<tr><td>
-<table class="form_group">
-<tr>
- <td class="form_clabel">Title:</td>
- <td class="form_value">
- <input type="text" name="title" size="50" value="%(title)s">
- </td>
-</tr>
-<tr>
- <td class="form_label">Description:</td>
- <td class="form_value">
-<textarea rows="10" cols="80" name="description">
-%(description)s
-</textarea>
- </td>
-</tr>
-
-%(attachFileRow)s
-
-</table>
-<br>
-<table class="form_group">
-<tr>
- <td class="form_clabel">Method:</td>
- <td class="form_value">
- <select id="reporter" name="reporter" onChange="updateReporterOptions()">
- %(reporterSelections)s
- </select>
- </td>
-</tr>
-%(reporterOptionsDivs)s
-</table>
-<br>
-</td></tr>
-<tr><td class="form_submit">
- <input align="right" type="submit" name="Submit" value="Submit">
-</td></tr>
-</table>
-</form>
-
-%(extraIFrame)s
-
-</body>
-</html>"""%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 fb27da6..0000000
--- 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] <results directory>')
- 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 e8fbe2d..0000000
--- 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: '<URL>'
- 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 c45a0c3..0000000
--- 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 <stdio.h>\n'
- if self.outputTests:
- print >>self.outputTests, '#include <stdio.h>'
- print >>self.outputTests, '#include <string.h>'
- print >>self.outputTests, '#include <assert.h>\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 <stdio.h>'
- print >>self.outputDriver, '#include <stdlib.h>\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 <stdio.h>'
-
- 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 47e4702..0000000
--- 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 '<aleph0>'
- 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<levelSize: # Found the level
- idelta,delta = getNthPairBounded(N, W, H)
- return active[i+idelta],prevLevel+delta
- else:
- N -= levelSize
- prevLevel = level
- else:
- raise RuntimError,"Unexpected loop completion"
-
-def getNthPairVariableBoundsChecked(N, bounds, GNVP=getNthPairVariableBounds):
- x,y = GNVP(N,bounds)
- assert 0 <= x < len(bounds) and 0 <= y < bounds[x]
- return (x,y)
-
-###
-
-def testPairs():
- W = 3
- H = 6
- a = [[' ' for x in range(10)] for y in range(10)]
- b = [[' ' for x in range(10)] for y in range(10)]
- for i in range(min(W*H,40)):
- x,y = getNthPairBounded(i,W,H)
- x2,y2 = getNthPairBounded(i,W,H,useDivmod=True)
- print i,(x,y),(x2,y2)
- a[y][x] = '%2d'%i
- b[y2][x2] = '%2d'%i
-
- print '-- a --'
- for ln in a[::-1]:
- if ''.join(ln).strip():
- print ' '.join(ln)
- print '-- b --'
- for ln in b[::-1]:
- if ''.join(ln).strip():
- print ' '.join(ln)
-
-def testPairsVB():
- bounds = [2,2,4,aleph0,5,aleph0]
- a = [[' ' for x in range(15)] for y in range(15)]
- b = [[' ' for x in range(15)] for y in range(15)]
- for i in range(min(sum(bounds),40)):
- x,y = getNthPairVariableBounds(i, bounds)
- print i,(x,y)
- a[y][x] = '%2d'%i
-
- print '-- a --'
- for ln in a[::-1]:
- if ''.join(ln).strip():
- print ' '.join(ln)
-
-###
-
-# Toggle to use checked versions of enumeration routines.
-if False:
- getNthPairVariableBounds = getNthPairVariableBoundsChecked
- getNthPairBounded = getNthPairBoundedChecked
- getNthNTuple = getNthNTupleChecked
- getNthTuple = getNthTupleChecked
-
-if __name__ == '__main__':
- testPairs()
-
- testPairsVB()
-
diff --git a/contrib/llvm/tools/clang/utils/ABITest/Makefile.test.common b/contrib/llvm/tools/clang/utils/ABITest/Makefile.test.common
deleted file mode 100644
index 3c208ad..0000000
--- a/contrib/llvm/tools/clang/utils/ABITest/Makefile.test.common
+++ /dev/null
@@ -1,170 +0,0 @@
-# -*- Makefile -*-
-
-# 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.
-
-TESTARGS := --no-unsigned --no-vector --no-complex --no-bool
-
-COUNT := 1
-TIMEOUT := 5
-
-CFLAGS := -std=gnu99
-
-X_COMPILER := gcc
-X_LL_CFLAGS := -emit-llvm -S
-Y_COMPILER := clang
-Y_LL_CFLAGS := -emit-llvm -S
-CC := gcc
-
-###
-
-ABITESTGEN := ../ABITestGen.py
-
-ifndef VERBOSE
- Verb := @
-endif
-
-.PHONY: test.%.report
-test.%.report: temps/test.%.xx.diff temps/test.%.xy.diff temps/test.%.yx.diff temps/test.%.yy.diff
- @ok=1;\
- for t in $^; do \
- if [ -s $$t ]; then \
- echo "TEST $*: $$t failed"; \
- ok=0;\
- fi; \
- done; \
- if [ $$ok -eq 1 ]; then \
- true; \
- else \
- false; \
- fi
-
-
-.PHONY: test.%.defs-report
-test.%.defs-report: temps/test.%.defs.diff
- @for t in $^; do \
- if [ -s $$t ]; then \
- echo "TEST $*: $$t failed"; \
- cat $$t; \
- fi; \
- done
-
-.PHONY: test.%.build
-test.%.build: temps/test.%.ref temps/test.%.xx temps/test.%.xy temps/test.%.yx temps/test.%.yy temps/test.%.x.defs temps/test.%.y.defs
- @true
-
-###
-
-# Diffs and output
-
-.PRECIOUS: temps/.dir
-
-.PRECIOUS: temps/test.%.xx.diff
-temps/test.%.xx.diff: temps/test.%.ref.out temps/test.%.xx.out
- $(Verb) diff $^ > $@ || 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 40ea791..0000000
--- 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 23e34a4..0000000
--- 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 <num-tests>"
- 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 602728b..0000000
--- 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 <num-tests>"
- 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 a50d14a..0000000
--- 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 <num-tests>"
- 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 0520625..0000000
--- 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 df1c53f..0000000
--- 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 9616e45..0000000
--- 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 9ff417f..0000000
--- 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 b8acb70..0000000
--- 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 3efb52b..0000000
--- 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 <num-tests>"
- 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 59d3466..0000000
--- 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 8f00c8d..0000000
--- 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 89fdd8e..0000000
--- 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 6676e31..0000000
--- 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 cd54eed..0000000
--- 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 c328a25..0000000
--- 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 6e67965..0000000
--- 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 cb0e566..0000000
--- 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 274ca10..0000000
--- 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 eb04866..0000000
--- 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 0652b1f..0000000
--- 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 <listen address> <listen port> <log file>"
- 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 705585c..0000000
--- 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 16b1081..0000000
--- 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 9097f93..0000000
--- 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 <assert.h>', '169'),
-('7.2.1 Program diagnostics', '169'),
-('7.3 Complex arithmetic <complex.h>', '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 <ctype.h>', '181'),
-('7.4.1 Character classification functions', '181'),
-('7.4.2 Character case mapping functions', '184'),
-('7.5 Errors <errno.h>', '186'),
-('7.6 Floating-point environment <fenv.h>', '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 <float.h>', '197'),
-('7.8 Format conversion of integer types <inttypes.h>', '198'),
-('7.8.1 Macros for format specifiers', '198'),
-('7.8.2 Functions for greatest-width integer types', '199'),
-('7.9 Alternative spellings <iso646.h>', '202'),
-('7.10 Sizes of integer types <limits.h>', '203'),
-('7.11 Localization <locale.h>', '204'),
-('7.11.1 Locale control', '205'),
-('7.11.2 Numeric formatting convention inquiry', '206'),
-('7.12 Mathematics <math.h>', '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 <setjmp.h>', '243'),
-('7.13.1 Save calling environment', '243'),
-('7.13.2 Restore calling environment', '244'),
-('7.14 Signal handling <signal.h>', '246'),
-('7.14.1 Specify signal handling', '247'),
-('7.14.2 Send signal', '248'),
-('7.15 Variable arguments <stdarg.h>', '249'),
-('7.15.1 Variable argument list access macros', '249'),
-('7.16 Boolean type and values <stdbool.h>', '253'),
-('7.17 Common definitions <stddef.h>', '254'),
-('7.18 Integer types <stdint.h>', '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 <stdio.h>', '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 <stdlib.h>', '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 <string.h>', '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 <tgmath.h>', '335'),
-('7.23 Date and time <time.h>', '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 <wchar.h>', '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 <wctype.h>',
- '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 <complex.h>', '401'),
-('7.26.2 Character handling <ctype.h>', '401'),
-('7.26.3 Errors <errno.h>', '401'),
-('7.26.4 Format conversion of integer types <inttypes.h>', '401'),
-('7.26.5 Localization <locale.h>', '401'),
-('7.26.6 Signal handling <signal.h>', '401'),
-('7.26.7 Boolean type and values <stdbool.h>', '401'),
-('7.26.8 Integer types <stdint.h>', '401'),
-('7.26.9 Input/output <stdio.h>', '402'),
-('7.26.10 General utilities <stdlib.h>', '402'),
-('7.26.11 String handling <string.h>', '402'),
-('<wchar.h>', '402'),
-('<wctype.h>', '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 <assert.h>', '418'),
-('B.2 Complex <complex.h>', '418'),
-('B.3 Character handling <ctype.h>', '420'),
-('B.4 Errors <errno.h>', '420'),
-('B.5 Floating-point environment <fenv.h>', '420'),
-('B.6 Characteristics of floating types <float.h>', '421'),
-('B.7 Format conversion of integer types <inttypes.h>', '421'),
-('B.8 Alternative spellings <iso646.h>', '422'),
-('B.9 Sizes of integer types <limits.h>', '422'),
-('B.10 Localization <locale.h>', '422'),
-('B.11 Mathematics <math.h>', '422'),
-('B.12 Nonlocal jumps <setjmp.h>', '427'),
-('B.13 Signal handling <signal.h>', '427'),
-('B.14 Variable arguments <stdarg.h>', '427'),
-('B.15 Boolean type and values <stdbool.h>', '427'),
-('B.16 Common definitions <stddef.h>', '428'),
-('B.17 Integer types <stdint.h>', '428'),
-('B.18 Input/output <stdio.h>', '428'),
-('B.19 General utilities <stdlib.h>', '430'),
-('B.20 String handling <string.h>', '432'),
-('B.21 Type-generic math <tgmath.h>', '433'),
-('B.22 Date and time <time.h>', '433'),
-('B.23 Extended multibyte/wide character utilities <wchar.h>', '434'),
-('B.24 Wide character classification and mapping utilities <wctype.h>',
- '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 <math.h>', '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 <complex.h>', '471'),
-('G.7 Type-generic math <tgmath.h>', '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 <iterator> 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 <regex> 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),'<named>',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"<a name=\"l([0-9]+)\"></a>")
-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 <output-dir>")
- 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, '<html><head><title>clang: Specification References</title></head>'
- print >>f, '<body>'
- print >>f, '\t<h2>Specification References</h2>'
- for i,node in enumerate(refTree[1]):
- specName = node[0] or 'Unknown'
- print >>f, '<a href="#spec%d">%s</a><br>'%(i,specName)
- for i,node in enumerate(refTree[1]):
- specName = node[0] or 'Unknown'
- print >>f, '<hr>'
- print >>f, '<a name="spec%d">'%(i,)
- print >>f, '<h3>Document: %s</h3>'%(specName or 'Unknown',)
- print >>f, '<table border="1" cellspacing="2" width="80%">'
- print >>f, '<tr><th width="20%">Name</th><th>References</th></tr>'
- 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<tr>'
- 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 = '<a href="%s#page=%d">%s</a> (pg.%d)'%(docData[0],page,components,page)
- else:
- linkStr = components
- if section == components:
- print >>f, '\t\t<td valign=top>%s<br>%s</td>'%(linkStr,name)
- else:
- print >>f, '\t\t<td valign=top>%s</td>'%(linkStr,)
- else:
- print >>f, '\t\t<td valign=top>%s</td>'%(components,)
- print >>f, '\t\t<td valign=top>'
- 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 = '&nbsp;(p%d)'%(item.section.paragraph,)
- else:
- paraText = ''
- print >>f,'<a href="%s">%s:%d</a>%s<br>'%(linkStr,relativePath,item.line,paraText)
- print >>f, '\t\t</td>'
- print >>f, '\t</tr>'
- print >>f, '</table>'
- print >>f, '<hr>'
- print >>f, 'Generated: %s<br>'%(time.strftime('%Y-%m-%d %H:%M'),)
- print >>f, 'SVN Revision: %s'%(getRevision(root),)
- print >>f, '</body>'
- 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 2aa5989..0000000
--- 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 <index>' 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 <number>',
-and you can run a particular test with '--test <index>'.
-""")
- 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 565241b..0000000
--- 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 d22c0bd..0000000
--- 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 <assert.h>
-#include <stdio.h>
-#include <sys/utsname.h>
-
-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 4ffdb3b..0000000
--- 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 592c424..0000000
--- 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 b6e9122..0000000
--- 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 1750a5f..0000000
--- 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 e4311e9..0000000
--- 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 dd615ae..0000000
--- 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 bf5b045..0000000
--- 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 4a83c55..0000000
--- 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 d8b93bd..0000000
--- 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 8396f8d..0000000
--- a/contrib/llvm/tools/clang/utils/VtableTest/gen.cc
+++ /dev/null
@@ -1,350 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-#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<void*>(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<s"); g(bases[i]); gl("*>(this))");
- g(" mix(\"base dyn cast\", t - (char *)dynamic_cast<s"); g(bases[i]); gl("*>(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 739d584..0000000
--- 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 1582797..0000000
--- 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 9bbe5be2..0000000
--- 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 873127f..0000000
--- 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 327fa92..0000000
--- 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 <test program> {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 a86be6c..0000000
--- 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 2019995..0000000
--- 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 16855b3..0000000
--- 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 7050f7f..0000000
--- 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 92484bf..0000000
--- 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 1627346..0000000
--- 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 a906a90..0000000
--- 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 4b58fae..0000000
--- 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 <cerrno>
-#include <cstdlib>
-#include <cstring>
-#include <fstream>
-#include <list>
-#include <vector>
-
-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<ld_plugin_symbol> syms;
- };
-
- lto_codegen_model output_type = LTO_CODEGEN_PIC_MODEL_STATIC;
- std::string output_name = "";
- std::list<claimed_file> Modules;
- std::vector<sys::Path> 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<std::string> as_args;
- static std::vector<std::string> 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<std::string> 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<char *>(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<claimed_file>::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<claimed_file>::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<const char *> as_args_p;
- for (std::vector<std::string>::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<std::string>::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<const char *>(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<std::string>::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 277a33a..0000000
--- 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 683f298..0000000
--- 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 7319aad..0000000
--- 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 8bcc2d8..0000000
--- 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 <memory>
-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<std::string>
-InputFilename(cl::Positional, cl::desc("<input bitcode>"), cl::init("-"));
-
-static cl::opt<std::string>
-OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename"));
-
-// Determine optimization level.
-static cl::opt<char>
-OptLevel("O",
- cl::desc("Optimization level. [-O0, -O1, -O2, or -O3] "
- "(default = '-O2')"),
- cl::Prefix,
- cl::ZeroOrMore,
- cl::init(' '));
-
-static cl::opt<std::string>
-TargetTriple("mtriple", cl::desc("Override target triple for module"));
-
-static cl::opt<std::string>
-MArch("march", cl::desc("Architecture to generate code for (see --version)"));
-
-static cl::opt<std::string>
-MCPU("mcpu",
- cl::desc("Target a specific cpu type (-mcpu=help for details)"),
- cl::value_desc("cpu-name"),
- cl::init(""));
-
-static cl::list<std::string>
-MAttrs("mattr",
- cl::CommaSeparated,
- cl::desc("Target specific attributes (-mattr=help for details)"),
- cl::value_desc("a1,+a2,-a3,..."));
-
-static cl::opt<bool>
-RelaxAll("mc-relax-all",
- cl::desc("When used with filetype=obj, "
- "relax all fixups in the emitted object file"));
-
-cl::opt<TargetMachine::CodeGenFileType>
-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<bool> NoVerify("disable-verify", cl::Hidden,
- cl::desc("Do not verify input module"));
-
-
-static cl::opt<bool>
-DisableRedZone("disable-red-zone",
- cl::desc("Do not emit code that uses the red zone."),
- cl::init(false));
-
-static cl::opt<bool>
-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<Module> 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<TargetMachine>
- 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<tool_output_file> 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 ce70d46e..0000000
--- 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 8f6eeed..0000000
--- 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 4c37780..0000000
--- 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 <cerrno>
-using namespace llvm;
-
-namespace {
- cl::opt<std::string>
- InputFile(cl::desc("<input bitcode>"), cl::Positional, cl::init("-"));
-
- cl::list<std::string>
- InputArgv(cl::ConsumeAfter, cl::desc("<program arguments>..."));
-
- cl::opt<bool> ForceInterpreter("force-interpreter",
- cl::desc("Force interpretation: disable JIT"),
- cl::init(false));
-
- // Determine optimization level.
- cl::opt<char>
- OptLevel("O",
- cl::desc("Optimization level. [-O0, -O1, -O2, or -O3] "
- "(default = '-O2')"),
- cl::Prefix,
- cl::ZeroOrMore,
- cl::init(' '));
-
- cl::opt<std::string>
- TargetTriple("mtriple", cl::desc("Override target triple for module"));
-
- cl::opt<std::string>
- MArch("march",
- cl::desc("Architecture to generate assembly for (see --version)"));
-
- cl::opt<std::string>
- MCPU("mcpu",
- cl::desc("Target a specific cpu type (-mcpu=help for details)"),
- cl::value_desc("cpu-name"),
- cl::init(""));
-
- cl::list<std::string>
- MAttrs("mattr",
- cl::CommaSeparated,
- cl::desc("Target specific attributes (-mattr=help for details)"),
- cl::value_desc("a1,+a2,-a3,..."));
-
- cl::opt<std::string>
- EntryFunc("entry-function",
- cl::desc("Specify the entry function (default = 'main') "
- "of the executable"),
- cl::value_desc("function"),
- cl::init("main"));
-
- cl::opt<std::string>
- FakeArgv0("fake-argv0",
- cl::desc("Override the 'argv[0]' value passed into the executing"
- " program"), cl::value_desc("executable"));
-
- cl::opt<bool>
- DisableCoreFiles("disable-core-files", cl::Hidden,
- cl::desc("Disable emission of core files if possible"));
-
- cl::opt<bool>
- 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<Function>(Exit)) {
- std::vector<GenericValue> 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 c8b0b72..0000000
--- 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 e4fe4e8..0000000
--- 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 021a369..0000000
--- 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 <iostream>
-#include <algorithm>
-#include <iomanip>
-#include <memory>
-#include <fstream>
-using namespace llvm;
-
-// Option for compatibility with AIX, not used but must allow it to be present.
-static cl::opt<bool>
-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<std::string>
-Options(cl::Positional, cl::Required, cl::desc("{operation}[modifiers]..."));
-
-// llvm-ar remaining positional arguments.
-static cl::list<std::string>
-RestOfArgs(cl::Positional, cl::OneOrMore,
- cl::desc("[relpos] [count] <archive-file> [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<std::string> Members;
-
-// This variable holds the (possibly expanded) list of path objects that
-// correspond to files we will
-std::set<sys::Path> 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<std::string>(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<Options.size(); ++i) {
- switch(Options[i]) {
- case 'd': ++NumOperations; Operation = Delete; break;
- case 'm': ++NumOperations; Operation = Move ; break;
- case 'p': ++NumOperations; Operation = Print; break;
- case 'q': ++NumOperations; Operation = QuickAppend; break;
- case 'r': ++NumOperations; Operation = ReplaceOrInsert; break;
- case 't': ++NumOperations; Operation = DisplayTable; break;
- case 'x': ++NumOperations; Operation = Extract; break;
- case 'c': Create = true; break;
- case 'f': TruncateNames = true; break;
- case 'k': DontSkipBitcode = true; break;
- case 'l': /* accepted but unused */ break;
- case 'o': OriginalDates = true; break;
- case 'P': FullPath = true; break;
- case 'R': RecurseDirectories = true; break;
- case 's': SymTable = true; break;
- case 'S': SymTable = false; break;
- case 'u': OnlyUpdate = true; break;
- case 'v': Verbose = true; break;
- case 'V': Verbose = ReallyVerbose = true; break;
- case 'z': Compression = true; break;
- case 'a':
- getRelPos();
- AddAfter = true;
- NumPositional++;
- break;
- case 'b':
- getRelPos();
- AddBefore = true;
- NumPositional++;
- break;
- case 'i':
- getRelPos();
- InsertBefore = true;
- NumPositional++;
- break;
- case 'N':
- getCount();
- UseCount = true;
- break;
- default:
- cl::PrintHelpMessage();
- }
- }
-
- // At this point, the next thing on the command line must be
- // the archive name.
- getArchive();
-
- // Everything on the command line at this point is a member.
- getMembers();
-
- // Perform various checks on the operation/modifier specification
- // to make sure we are dealing with a legal request.
- if (NumOperations == 0)
- throw "You must specify at least one of the operations";
- if (NumOperations > 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<sys::Path>& result, std::string* ErrMsg) {
- result.clear();
- if (RecurseDirectories) {
- std::set<sys::Path> content;
- if (path.getDirectoryContents(content, ErrMsg))
- return true;
-
- for (std::set<sys::Path>::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<sys::Path> 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<sys::Path> 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<const char*>(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<const char*>(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<sys::Path> 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<sys::Path>::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<sys::Path>::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<sys::Path> 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<sys::Path>::iterator found = remaining.end();
- for (std::set<sys::Path>::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<sys::Path>::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<Archive> 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 eef4a13..0000000
--- 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 e1e5853..0000000
--- 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 1eaa4b3..0000000
--- 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 <memory>
-using namespace llvm;
-
-static cl::opt<std::string>
-InputFilename(cl::Positional, cl::desc("<input .llvm file>"), cl::init("-"));
-
-static cl::opt<std::string>
-OutputFilename("o", cl::desc("Override output filename"),
- cl::value_desc("filename"));
-
-static cl::opt<bool>
-Force("f", cl::desc("Enable binary output on terminals"));
-
-static cl::opt<bool>
-DisableOutput("disable-output", cl::desc("Disable output"), cl::init(false));
-
-static cl::opt<bool>
-DumpAsm("d", cl::desc("Print assembly as parsed"), cl::Hidden);
-
-static cl::opt<bool>
-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<tool_output_file> 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<Module> 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 732bc32..0000000
--- 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 488387d..0000000
--- 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 9c0d675..0000000
--- 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 <cstdio>
-#include <map>
-#include <algorithm>
-using namespace llvm;
-
-static cl::opt<std::string>
- InputFilename(cl::Positional, cl::desc("<input bitcode>"), cl::init("-"));
-
-static cl::opt<bool> Dump("dump", cl::desc("Dump low level bitcode trace"));
-
-//===----------------------------------------------------------------------===//
-// Bitcode specific analysis.
-//===----------------------------------------------------------------------===//
-
-static cl::opt<bool> NoHistogram("disable-histogram",
- cl::desc("Do not print per-code histogram"));
-
-static cl::opt<bool>
-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<PerRecordStats> CodeFreq;
-
- PerBlockIDStats()
- : NumInstances(0), NumBits(0),
- NumSubBlocks(0), NumAbbrevs(0), NumRecords(0), NumAbbreviatedRecords(0) {}
-};
-
-static std::map<unsigned, PerBlockIDStats> 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 << "<BLOCKINFO_BLOCK/>\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<uint64_t, 64> 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 << "</";
- if (BlockName)
- errs() << BlockName << ">\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<unsigned, PerBlockIDStats>::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<std::pair<unsigned, unsigned> > FreqPairs; // <freq,code>
- 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 663cae5..0000000
--- 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 c7f7b32..0000000
--- 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 5cbf5b4..0000000
--- 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 d435d57..0000000
--- 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 <OPTION>... [<COMPONENT>...]
-
-Get various configuration information needed to compile programs which use
-LLVM. Typically called from 'configure' scripts. Examples:
- llvm-config --cxxflags
- llvm-config --ldflags
- llvm-config --libs engine bcreader scalaropts
-
-Options:
- --version Print LLVM version.
- --prefix Print the installation prefix.
- --src-root Print the source root LLVM was built from.
- --obj-root Print the object root used to build LLVM.
- --bindir Directory containing LLVM executables.
- --includedir Directory containing LLVM headers.
- --libdir Directory containing LLVM libraries.
- --cppflags C preprocessor flags for files that include LLVM headers.
- --cflags C compiler flags for files that include LLVM headers.
- --cxxflags C++ compiler flags for files that include LLVM headers.
- --ldflags Print Linker flags.
- --libs Libraries needed to link against LLVM components.
- --libnames Bare library names for in-tree builds.
- --libfiles Fully qualified library filenames for makefile depends.
- --components List of all possible components.
- --targets-built List of all targets currently built.
- --host-target Target triple used to configure LLVM.
- --build-mode Print build mode of LLVM tree (e.g. Debug or Release).
-Typical components:
- all All LLVM libraries (default).
- backend Either a native backend or the C backend.
- engine Either a native JIT or a bytecode interpreter.
-__EOD__
- exit(1);
-}
-
-# Use -lfoo instead of libfoo.a whenever possible, and add directories to
-# files which can't be found using -L.
-sub fix_library_names (@) {
- my @libs = @_;
- my @result;
- foreach my $lib (@libs) {
- # Transform the bare library name appropriately.
- my ($basename) = ($lib =~ /^lib([^.]*)\.a/);
- if (defined $basename) {
- push @result, "-l$basename";
- } else {
- push @result, "$LIBDIR/$lib";
- }
- }
- return @result;
-}
-
-# Turn the list of libraries into a list of files.
-sub fix_library_files(@) {
- my @libs = @_;
- my @result;
- foreach my $lib (@libs) {
- # Transform the bare library name into a filename.
- push @result, "$LIBDIR/$lib";
- }
- return @result;
-}
-
-#==========================================================================
-# Library Dependency Analysis
-#==========================================================================
-# Given a few human-readable library names, find all their dependencies
-# and sort them into an order which the linker will like. If we packed
-# our libraries into fewer archives, we could make the linker do much
-# of this work for us.
-#
-# Libraries have two different types of names in this code: Human-friendly
-# "component" names entered on the command-line, and the raw file names
-# we use internally (and ultimately pass to the linker).
-#
-# To understand this code, you'll need a working knowledge of Perl 5,
-# and possibly some quality time with 'man perlref'.
-
-sub load_dependencies;
-sub build_name_map;
-sub have_native_backend;
-sub find_best_engine;
-sub expand_names (@);
-sub find_all_required_sets (@);
-sub find_all_required_sets_helper ($$@);
-
-# Each "set" contains one or more libraries which must be included as a
-# group (due to cyclic dependencies). Sets are represented as a Perl array
-# reference pointing to a list of internal library names.
-my @SETS;
-
-# Various mapping tables.
-my %LIB_TO_SET_MAP; # Maps internal library names to their sets.
-my %SET_DEPS; # Maps sets to a list of libraries they depend on.
-my %NAME_MAP; # Maps human-entered names to internal names.
-
-# Have our dependencies been loaded yet?
-my $DEPENDENCIES_LOADED = 0;
-
-# Given a list of human-friendly component names, translate them into a
-# complete set of linker arguments.
-sub expand_dependencies (@) {
- my @libs = @_;
- load_dependencies;
- my @required_sets = find_all_required_sets(expand_names(@libs));
- my @sorted_sets = topologically_sort_sets(@required_sets);
-
- # Expand the library sets into libraries.
- my @result;
- foreach my $set (@sorted_sets) { push @result, @{$set}; }
- return @result;
-}
-
-# Load in the raw dependency data stored at the end of this file.
-sub load_dependencies {
- return if $DEPENDENCIES_LOADED;
- $DEPENDENCIES_LOADED = 1;
- while (<DATA>) {
- # Parse our line.
- my ($libs, $deps) = /^\s*([^:]+):\s*(.*)\s*$/;
- die "Malformed dependency data" unless defined $deps;
- my @libs = split(' ', $libs);
- my @deps = split(' ', $deps);
-
- # Record our dependency data.
- my $set = \@libs;
- push @SETS, $set;
- foreach my $lib (@libs) { $LIB_TO_SET_MAP{$lib} = $set; }
- $SET_DEPS{$set} = \@deps;
- }
- build_name_map;
-}
-
-# Build a map converting human-friendly component names into internal
-# library names.
-sub build_name_map {
- # Add entries for all the actual libraries.
- foreach my $set (@SETS) {
- foreach my $lib (sort @$set) {
- my $short_name = $lib;
- $short_name =~ s/^(lib)?LLVM([^.]*)\..*$/$2/;
- $short_name =~ tr/A-Z/a-z/;
- $NAME_MAP{$short_name} = [$lib];
- }
- }
-
- # Add target-specific entries
- foreach my $target (@TARGETS_BUILT) {
- # FIXME: Temporary, until we don't switch all targets
- if (defined $NAME_MAP{$target.'asmprinter'}) {
- $NAME_MAP{$target} = [$target.'info',
- $target.'asmprinter',
- $target.'codegen']
- } else {
- $NAME_MAP{$target} = [$target.'info',
- $NAME_MAP{$target}[0]]
- }
-
- if (defined $NAME_MAP{$target.'asmparser'}) {
- push @{$NAME_MAP{$target}},$target.'asmparser'
- }
-
- if (defined $NAME_MAP{$target.'disassembler'}) {
- push @{$NAME_MAP{$target}},$target.'disassembler'
- }
- }
-
- # Add virtual entries.
- $NAME_MAP{'native'} = have_native_backend() ? [$ARCH] : [];
- $NAME_MAP{'nativecodegen'} = have_native_backend() ? [$ARCH.'codegen'] : [];
- $NAME_MAP{'backend'} = have_native_backend() ? ['native'] : ['cbackend'];
- $NAME_MAP{'engine'} = find_best_engine;
- $NAME_MAP{'all'} = [name_map_entries]; # Must be last.
-}
-
-# Return true if we have a native backend to use.
-sub have_native_backend {
- my %BUILT;
- foreach my $target (@TARGETS_BUILT) { $BUILT{$target} = 1; }
- return defined $NAME_MAP{$ARCH} && defined $BUILT{$ARCH};
-}
-
-# Find a working subclass of ExecutionEngine for this platform.
-sub find_best_engine {
- if (have_native_backend && $TARGET_HAS_JIT) {
- return ['jit', 'native'];
- } else {
- return ['interpreter'];
- }
-}
-
-# Get all the human-friendly component names.
-sub name_map_entries {
- load_dependencies;
- return sort keys %NAME_MAP;
-}
-
-# Map human-readable names to internal library names.
-sub expand_names (@) {
- my @names = @_;
- my @result;
- foreach my $name (@names) {
- if (defined $LIB_TO_SET_MAP{$name}) {
- # We've hit bottom: An actual library name.
- push @result, $name;
- } elsif (defined $NAME_MAP{$name}) {
- # We've found a short name to expand.
- push @result, expand_names(@{$NAME_MAP{$name}});
- } else {
- print STDERR "llvm-config: unknown component name: $name\n";
- exit(1);
- }
- }
- return @result;
-}
-
-# Given a list of internal library names, return all sets of libraries which
-# will need to be included by the linker (in no particular order).
-sub find_all_required_sets (@) {
- my @libs = @_;
- my %sets_added;
- my @result;
- find_all_required_sets_helper(\%sets_added, \@result, @libs);
- return @result;
-}
-
-# Recursive closures are pretty broken in Perl, so we're going to separate
-# this function from find_all_required_sets and pass in the state we need
-# manually, as references. Yes, this is fairly unpleasant.
-sub find_all_required_sets_helper ($$@) {
- my ($sets_added, $result, @libs) = @_;
- foreach my $lib (@libs) {
- my $set = $LIB_TO_SET_MAP{$lib};
- next if defined $$sets_added{$set};
- $$sets_added{$set} = 1;
- push @$result, $set;
- find_all_required_sets_helper($sets_added, $result, @{$SET_DEPS{$set}});
- }
-}
-
-# Print a list of sets, with a label. Used for debugging.
-sub print_sets ($@) {
- my ($label, @sets) = @_;
- my @output;
- foreach my $set (@sets) { push @output, join(',', @$set); }
- print "$label: ", join(';', @output), "\n";
-}
-
-# Returns true if $lib is a key in $added.
-sub has_lib_been_added ($$) {
- my ($added, $lib) = @_;
- return defined $$added{$LIB_TO_SET_MAP{$lib}};
-}
-
-# Returns true if all the dependencies of $set appear in $added.
-sub have_all_deps_been_added ($$) {
- my ($added, $set) = @_;
- #print_sets(" Checking", $set);
- #print_sets(" Wants", $SET_DEPS{$set});
- foreach my $lib (@{$SET_DEPS{$set}}) {
- return 0 unless has_lib_been_added($added, $lib);
- }
- return 1;
-}
-
-# Given a list of sets, topologically sort them using dependencies.
-sub topologically_sort_sets (@) {
- my @sets = @_;
- my %added;
- my @result;
- SCAN: while (@sets) { # We'll delete items from @sets as we go.
- #print_sets("So far", reverse(@result));
- #print_sets("Remaining", @sets);
- for (my $i = 0; $i < @sets; ++$i) {
- my $set = $sets[$i];
- if (have_all_deps_been_added(\%added, $set)) {
- push @result, $set;
- $added{$set} = 1;
- #print "Removing $i.\n";
- splice(@sets, $i, 1);
- next SCAN; # Restart our scan.
- }
- }
- die "Can't find a library with no dependencies";
- }
- return reverse(@result);
-}
-
-# Our library dependency data will be added after the '__END__' token, and will
-# be read through the magic <DATA> filehandle.
-__END__
diff --git a/contrib/llvm/tools/llvm-diff/CMakeLists.txt b/contrib/llvm/tools/llvm-diff/CMakeLists.txt
deleted file mode 100644
index f6d65c9..0000000
--- a/contrib/llvm/tools/llvm-diff/CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-set(LLVM_LINK_COMPONENTS support asmparser bitreader)
-
-add_llvm_tool(llvm-diff
- llvm-diff.cpp
- DifferenceEngine.cpp
- )
diff --git a/contrib/llvm/tools/llvm-diff/DifferenceEngine.cpp b/contrib/llvm/tools/llvm-diff/DifferenceEngine.cpp
deleted file mode 100644
index b0a24d0..0000000
--- a/contrib/llvm/tools/llvm-diff/DifferenceEngine.cpp
+++ /dev/null
@@ -1,676 +0,0 @@
-//===-- DifferenceEngine.cpp - Structural function/module comparison ------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header defines the implementation of the LLVM difference
-// engine, which structurally compares global values within a module.
-//
-//===----------------------------------------------------------------------===//
-
-#include "DifferenceEngine.h"
-
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/DenseSet.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/StringRef.h"
-#include "llvm/ADT/StringSet.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/ErrorHandling.h"
-#include "llvm/Support/raw_ostream.h"
-#include "llvm/Support/type_traits.h"
-
-#include <utility>
-
-using namespace llvm;
-
-namespace {
-
-/// A priority queue, implemented as a heap.
-template <class T, class Sorter, unsigned InlineCapacity>
-class PriorityQueue {
- Sorter Precedes;
- llvm::SmallVector<T, InlineCapacity> Storage;
-
-public:
- PriorityQueue(const Sorter &Precedes) : Precedes(Precedes) {}
-
- /// Checks whether the heap is empty.
- bool empty() const { return Storage.empty(); }
-
- /// Insert a new value on the heap.
- void insert(const T &V) {
- unsigned Index = Storage.size();
- Storage.push_back(V);
- if (Index == 0) return;
-
- T *data = Storage.data();
- while (true) {
- unsigned Target = (Index + 1) / 2 - 1;
- if (!Precedes(data[Index], data[Target])) return;
- std::swap(data[Index], data[Target]);
- if (Target == 0) return;
- Index = Target;
- }
- }
-
- /// Remove the minimum value in the heap. Only valid on a non-empty heap.
- T remove_min() {
- assert(!empty());
- T tmp = Storage[0];
-
- unsigned NewSize = Storage.size() - 1;
- if (NewSize) {
- // Move the slot at the end to the beginning.
- if (isPodLike<T>::value)
- Storage[0] = Storage[NewSize];
- else
- std::swap(Storage[0], Storage[NewSize]);
-
- // Bubble the root up as necessary.
- unsigned Index = 0;
- while (true) {
- // With a 1-based index, the children would be Index*2 and Index*2+1.
- unsigned R = (Index + 1) * 2;
- unsigned L = R - 1;
-
- // If R is out of bounds, we're done after this in any case.
- if (R >= NewSize) {
- // If L is also out of bounds, we're done immediately.
- if (L >= NewSize) break;
-
- // Otherwise, test whether we should swap L and Index.
- if (Precedes(Storage[L], Storage[Index]))
- std::swap(Storage[L], Storage[Index]);
- break;
- }
-
- // Otherwise, we need to compare with the smaller of L and R.
- // Prefer R because it's closer to the end of the array.
- unsigned IndexToTest = (Precedes(Storage[L], Storage[R]) ? L : R);
-
- // If Index is >= the min of L and R, then heap ordering is restored.
- if (!Precedes(Storage[IndexToTest], Storage[Index]))
- break;
-
- // Otherwise, keep bubbling up.
- std::swap(Storage[IndexToTest], Storage[Index]);
- Index = IndexToTest;
- }
- }
- Storage.pop_back();
-
- return tmp;
- }
-};
-
-/// A function-scope difference engine.
-class FunctionDifferenceEngine {
- DifferenceEngine &Engine;
-
- /// The current mapping from old local values to new local values.
- DenseMap<Value*, Value*> Values;
-
- /// The current mapping from old blocks to new blocks.
- DenseMap<BasicBlock*, BasicBlock*> Blocks;
-
- DenseSet<std::pair<Value*, Value*> > TentativeValues;
-
- unsigned getUnprocPredCount(BasicBlock *Block) const {
- unsigned Count = 0;
- for (pred_iterator I = pred_begin(Block), E = pred_end(Block); I != E; ++I)
- if (!Blocks.count(*I)) Count++;
- return Count;
- }
-
- typedef std::pair<BasicBlock*, BasicBlock*> BlockPair;
-
- /// A type which sorts a priority queue by the number of unprocessed
- /// predecessor blocks it has remaining.
- ///
- /// This is actually really expensive to calculate.
- struct QueueSorter {
- const FunctionDifferenceEngine &fde;
- explicit QueueSorter(const FunctionDifferenceEngine &fde) : fde(fde) {}
-
- bool operator()(const BlockPair &Old, const BlockPair &New) {
- return fde.getUnprocPredCount(Old.first)
- < fde.getUnprocPredCount(New.first);
- }
- };
-
- /// A queue of unified blocks to process.
- PriorityQueue<BlockPair, QueueSorter, 20> Queue;
-
- /// Try to unify the given two blocks. Enqueues them for processing
- /// if they haven't already been processed.
- ///
- /// Returns true if there was a problem unifying them.
- bool tryUnify(BasicBlock *L, BasicBlock *R) {
- BasicBlock *&Ref = Blocks[L];
-
- if (Ref) {
- if (Ref == R) return false;
-
- Engine.logf("successor %l cannot be equivalent to %r; "
- "it's already equivalent to %r")
- << L << R << Ref;
- return true;
- }
-
- Ref = R;
- Queue.insert(BlockPair(L, R));
- return false;
- }
-
- /// Unifies two instructions, given that they're known not to have
- /// structural differences.
- void unify(Instruction *L, Instruction *R) {
- DifferenceEngine::Context C(Engine, L, R);
-
- bool Result = diff(L, R, true, true);
- assert(!Result && "structural differences second time around?");
- (void) Result;
- if (!L->use_empty())
- Values[L] = R;
- }
-
- void processQueue() {
- while (!Queue.empty()) {
- BlockPair Pair = Queue.remove_min();
- diff(Pair.first, Pair.second);
- }
- }
-
- void diff(BasicBlock *L, BasicBlock *R) {
- DifferenceEngine::Context C(Engine, L, R);
-
- BasicBlock::iterator LI = L->begin(), LE = L->end();
- BasicBlock::iterator RI = R->begin(), RE = R->end();
-
- llvm::SmallVector<std::pair<Instruction*,Instruction*>, 20> TentativePairs;
-
- do {
- assert(LI != LE && RI != RE);
- Instruction *LeftI = &*LI, *RightI = &*RI;
-
- // If the instructions differ, start the more sophisticated diff
- // algorithm at the start of the block.
- if (diff(LeftI, RightI, false, false)) {
- TentativeValues.clear();
- return runBlockDiff(L->begin(), R->begin());
- }
-
- // Otherwise, tentatively unify them.
- if (!LeftI->use_empty())
- TentativeValues.insert(std::make_pair(LeftI, RightI));
-
- ++LI, ++RI;
- } while (LI != LE); // This is sufficient: we can't get equality of
- // terminators if there are residual instructions.
-
- // Unify everything in the block, non-tentatively this time.
- TentativeValues.clear();
- for (LI = L->begin(), RI = R->begin(); LI != LE; ++LI, ++RI)
- unify(&*LI, &*RI);
- }
-
- bool matchForBlockDiff(Instruction *L, Instruction *R);
- void runBlockDiff(BasicBlock::iterator LI, BasicBlock::iterator RI);
-
- bool diffCallSites(CallSite L, CallSite R, bool Complain) {
- // FIXME: call attributes
- if (!equivalentAsOperands(L.getCalledValue(), R.getCalledValue())) {
- if (Complain) Engine.log("called functions differ");
- return true;
- }
- if (L.arg_size() != R.arg_size()) {
- if (Complain) Engine.log("argument counts differ");
- return true;
- }
- for (unsigned I = 0, E = L.arg_size(); I != E; ++I)
- if (!equivalentAsOperands(L.getArgument(I), R.getArgument(I))) {
- if (Complain)
- Engine.logf("arguments %l and %r differ")
- << L.getArgument(I) << R.getArgument(I);
- return true;
- }
- return false;
- }
-
- bool diff(Instruction *L, Instruction *R, bool Complain, bool TryUnify) {
- // FIXME: metadata (if Complain is set)
-
- // Different opcodes always imply different operations.
- if (L->getOpcode() != R->getOpcode()) {
- if (Complain) Engine.log("different instruction types");
- return true;
- }
-
- if (isa<CmpInst>(L)) {
- if (cast<CmpInst>(L)->getPredicate()
- != cast<CmpInst>(R)->getPredicate()) {
- if (Complain) Engine.log("different predicates");
- return true;
- }
- } else if (isa<CallInst>(L)) {
- return diffCallSites(CallSite(L), CallSite(R), Complain);
- } else if (isa<PHINode>(L)) {
- // FIXME: implement.
-
- // This is really wierd; type uniquing is broken?
- if (L->getType() != R->getType()) {
- if (!L->getType()->isPointerTy() || !R->getType()->isPointerTy()) {
- if (Complain) Engine.log("different phi types");
- return true;
- }
- }
- return false;
-
- // Terminators.
- } else if (isa<InvokeInst>(L)) {
- InvokeInst *LI = cast<InvokeInst>(L);
- InvokeInst *RI = cast<InvokeInst>(R);
- if (diffCallSites(CallSite(LI), CallSite(RI), Complain))
- return true;
-
- if (TryUnify) {
- tryUnify(LI->getNormalDest(), RI->getNormalDest());
- tryUnify(LI->getUnwindDest(), RI->getUnwindDest());
- }
- return false;
-
- } else if (isa<BranchInst>(L)) {
- BranchInst *LI = cast<BranchInst>(L);
- BranchInst *RI = cast<BranchInst>(R);
- if (LI->isConditional() != RI->isConditional()) {
- if (Complain) Engine.log("branch conditionality differs");
- return true;
- }
-
- if (LI->isConditional()) {
- if (!equivalentAsOperands(LI->getCondition(), RI->getCondition())) {
- if (Complain) Engine.log("branch conditions differ");
- return true;
- }
- if (TryUnify) tryUnify(LI->getSuccessor(1), RI->getSuccessor(1));
- }
- if (TryUnify) tryUnify(LI->getSuccessor(0), RI->getSuccessor(0));
- return false;
-
- } else if (isa<SwitchInst>(L)) {
- SwitchInst *LI = cast<SwitchInst>(L);
- SwitchInst *RI = cast<SwitchInst>(R);
- if (!equivalentAsOperands(LI->getCondition(), RI->getCondition())) {
- if (Complain) Engine.log("switch conditions differ");
- return true;
- }
- if (TryUnify) tryUnify(LI->getDefaultDest(), RI->getDefaultDest());
-
- bool Difference = false;
-
- DenseMap<ConstantInt*,BasicBlock*> LCases;
- for (unsigned I = 1, E = LI->getNumCases(); I != E; ++I)
- LCases[LI->getCaseValue(I)] = LI->getSuccessor(I);
- for (unsigned I = 1, E = RI->getNumCases(); I != E; ++I) {
- ConstantInt *CaseValue = RI->getCaseValue(I);
- BasicBlock *LCase = LCases[CaseValue];
- if (LCase) {
- if (TryUnify) tryUnify(LCase, RI->getSuccessor(I));
- LCases.erase(CaseValue);
- } else if (!Difference) {
- if (Complain)
- Engine.logf("right switch has extra case %r") << CaseValue;
- Difference = true;
- }
- }
- if (!Difference)
- for (DenseMap<ConstantInt*,BasicBlock*>::iterator
- I = LCases.begin(), E = LCases.end(); I != E; ++I) {
- if (Complain)
- Engine.logf("left switch has extra case %l") << I->first;
- Difference = true;
- }
- return Difference;
- } else if (isa<UnreachableInst>(L)) {
- return false;
- }
-
- if (L->getNumOperands() != R->getNumOperands()) {
- if (Complain) Engine.log("instructions have different operand counts");
- return true;
- }
-
- for (unsigned I = 0, E = L->getNumOperands(); I != E; ++I) {
- Value *LO = L->getOperand(I), *RO = R->getOperand(I);
- if (!equivalentAsOperands(LO, RO)) {
- if (Complain) Engine.logf("operands %l and %r differ") << LO << RO;
- return true;
- }
- }
-
- return false;
- }
-
- bool equivalentAsOperands(Constant *L, Constant *R) {
- // Use equality as a preliminary filter.
- if (L == R)
- return true;
-
- if (L->getValueID() != R->getValueID())
- return false;
-
- // Ask the engine about global values.
- if (isa<GlobalValue>(L))
- return Engine.equivalentAsOperands(cast<GlobalValue>(L),
- cast<GlobalValue>(R));
-
- // Compare constant expressions structurally.
- if (isa<ConstantExpr>(L))
- return equivalentAsOperands(cast<ConstantExpr>(L),
- cast<ConstantExpr>(R));
-
- // Nulls of the "same type" don't always actually have the same
- // type; I don't know why. Just white-list them.
- if (isa<ConstantPointerNull>(L))
- return true;
-
- // Block addresses only match if we've already encountered the
- // block. FIXME: tentative matches?
- if (isa<BlockAddress>(L))
- return Blocks[cast<BlockAddress>(L)->getBasicBlock()]
- == cast<BlockAddress>(R)->getBasicBlock();
-
- return false;
- }
-
- bool equivalentAsOperands(ConstantExpr *L, ConstantExpr *R) {
- if (L == R)
- return true;
- if (L->getOpcode() != R->getOpcode())
- return false;
-
- switch (L->getOpcode()) {
- case Instruction::ICmp:
- case Instruction::FCmp:
- if (L->getPredicate() != R->getPredicate())
- return false;
- break;
-
- case Instruction::GetElementPtr:
- // FIXME: inbounds?
- break;
-
- default:
- break;
- }
-
- if (L->getNumOperands() != R->getNumOperands())
- return false;
-
- for (unsigned I = 0, E = L->getNumOperands(); I != E; ++I)
- if (!equivalentAsOperands(L->getOperand(I), R->getOperand(I)))
- return false;
-
- return true;
- }
-
- bool equivalentAsOperands(Value *L, Value *R) {
- // Fall out if the values have different kind.
- // This possibly shouldn't take priority over oracles.
- if (L->getValueID() != R->getValueID())
- return false;
-
- // Value subtypes: Argument, Constant, Instruction, BasicBlock,
- // InlineAsm, MDNode, MDString, PseudoSourceValue
-
- if (isa<Constant>(L))
- return equivalentAsOperands(cast<Constant>(L), cast<Constant>(R));
-
- if (isa<Instruction>(L))
- return Values[L] == R || TentativeValues.count(std::make_pair(L, R));
-
- if (isa<Argument>(L))
- return Values[L] == R;
-
- if (isa<BasicBlock>(L))
- return Blocks[cast<BasicBlock>(L)] != R;
-
- // Pretend everything else is identical.
- return true;
- }
-
- // Avoid a gcc warning about accessing 'this' in an initializer.
- FunctionDifferenceEngine *this_() { return this; }
-
-public:
- FunctionDifferenceEngine(DifferenceEngine &Engine) :
- Engine(Engine), Queue(QueueSorter(*this_())) {}
-
- void diff(Function *L, Function *R) {
- if (L->arg_size() != R->arg_size())
- Engine.log("different argument counts");
-
- // Map the arguments.
- for (Function::arg_iterator
- LI = L->arg_begin(), LE = L->arg_end(),
- RI = R->arg_begin(), RE = R->arg_end();
- LI != LE && RI != RE; ++LI, ++RI)
- Values[&*LI] = &*RI;
-
- tryUnify(&*L->begin(), &*R->begin());
- processQueue();
- }
-};
-
-struct DiffEntry {
- DiffEntry() : Cost(0) {}
-
- unsigned Cost;
- llvm::SmallVector<char, 8> Path; // actually of DifferenceEngine::DiffChange
-};
-
-bool FunctionDifferenceEngine::matchForBlockDiff(Instruction *L,
- Instruction *R) {
- return !diff(L, R, false, false);
-}
-
-void FunctionDifferenceEngine::runBlockDiff(BasicBlock::iterator LStart,
- BasicBlock::iterator RStart) {
- BasicBlock::iterator LE = LStart->getParent()->end();
- BasicBlock::iterator RE = RStart->getParent()->end();
-
- unsigned NL = std::distance(LStart, LE);
-
- SmallVector<DiffEntry, 20> Paths1(NL+1);
- SmallVector<DiffEntry, 20> Paths2(NL+1);
-
- DiffEntry *Cur = Paths1.data();
- DiffEntry *Next = Paths2.data();
-
- const unsigned LeftCost = 2;
- const unsigned RightCost = 2;
- const unsigned MatchCost = 0;
-
- assert(TentativeValues.empty());
-
- // Initialize the first column.
- for (unsigned I = 0; I != NL+1; ++I) {
- Cur[I].Cost = I * LeftCost;
- for (unsigned J = 0; J != I; ++J)
- Cur[I].Path.push_back(DifferenceEngine::DC_left);
- }
-
- for (BasicBlock::iterator RI = RStart; RI != RE; ++RI) {
- // Initialize the first row.
- Next[0] = Cur[0];
- Next[0].Cost += RightCost;
- Next[0].Path.push_back(DifferenceEngine::DC_right);
-
- unsigned Index = 1;
- for (BasicBlock::iterator LI = LStart; LI != LE; ++LI, ++Index) {
- if (matchForBlockDiff(&*LI, &*RI)) {
- Next[Index] = Cur[Index-1];
- Next[Index].Cost += MatchCost;
- Next[Index].Path.push_back(DifferenceEngine::DC_match);
- TentativeValues.insert(std::make_pair(&*LI, &*RI));
- } else if (Next[Index-1].Cost <= Cur[Index].Cost) {
- Next[Index] = Next[Index-1];
- Next[Index].Cost += LeftCost;
- Next[Index].Path.push_back(DifferenceEngine::DC_left);
- } else {
- Next[Index] = Cur[Index];
- Next[Index].Cost += RightCost;
- Next[Index].Path.push_back(DifferenceEngine::DC_right);
- }
- }
-
- std::swap(Cur, Next);
- }
-
- // We don't need the tentative values anymore; everything from here
- // on out should be non-tentative.
- TentativeValues.clear();
-
- SmallVectorImpl<char> &Path = Cur[NL].Path;
- BasicBlock::iterator LI = LStart, RI = RStart;
-
- DifferenceEngine::DiffLogBuilder Diff(Engine);
-
- // Drop trailing matches.
- while (Path.back() == DifferenceEngine::DC_match)
- Path.pop_back();
-
- // Skip leading matches.
- SmallVectorImpl<char>::iterator
- PI = Path.begin(), PE = Path.end();
- while (PI != PE && *PI == DifferenceEngine::DC_match) {
- unify(&*LI, &*RI);
- ++PI, ++LI, ++RI;
- }
-
- for (; PI != PE; ++PI) {
- switch (static_cast<DifferenceEngine::DiffChange>(*PI)) {
- case DifferenceEngine::DC_match:
- assert(LI != LE && RI != RE);
- {
- Instruction *L = &*LI, *R = &*RI;
- unify(L, R);
- Diff.addMatch(L, R);
- }
- ++LI; ++RI;
- break;
-
- case DifferenceEngine::DC_left:
- assert(LI != LE);
- Diff.addLeft(&*LI);
- ++LI;
- break;
-
- case DifferenceEngine::DC_right:
- assert(RI != RE);
- Diff.addRight(&*RI);
- ++RI;
- break;
- }
- }
-
- // Finishing unifying and complaining about the tails of the block,
- // which should be matches all the way through.
- while (LI != LE) {
- assert(RI != RE);
- unify(&*LI, &*RI);
- ++LI, ++RI;
- }
-
- // If the terminators have different kinds, but one is an invoke and the
- // other is an unconditional branch immediately following a call, unify
- // the results and the destinations.
- TerminatorInst *LTerm = LStart->getParent()->getTerminator();
- TerminatorInst *RTerm = RStart->getParent()->getTerminator();
- if (isa<BranchInst>(LTerm) && isa<InvokeInst>(RTerm)) {
- if (cast<BranchInst>(LTerm)->isConditional()) return;
- BasicBlock::iterator I = LTerm;
- if (I == LStart->getParent()->begin()) return;
- --I;
- if (!isa<CallInst>(*I)) return;
- CallInst *LCall = cast<CallInst>(&*I);
- InvokeInst *RInvoke = cast<InvokeInst>(RTerm);
- if (!equivalentAsOperands(LCall->getCalledValue(), RInvoke->getCalledValue()))
- return;
- if (!LCall->use_empty())
- Values[LCall] = RInvoke;
- tryUnify(LTerm->getSuccessor(0), RInvoke->getNormalDest());
- } else if (isa<InvokeInst>(LTerm) && isa<BranchInst>(RTerm)) {
- if (cast<BranchInst>(RTerm)->isConditional()) return;
- BasicBlock::iterator I = RTerm;
- if (I == RStart->getParent()->begin()) return;
- --I;
- if (!isa<CallInst>(*I)) return;
- CallInst *RCall = cast<CallInst>(I);
- InvokeInst *LInvoke = cast<InvokeInst>(LTerm);
- if (!equivalentAsOperands(LInvoke->getCalledValue(), RCall->getCalledValue()))
- return;
- if (!LInvoke->use_empty())
- Values[LInvoke] = RCall;
- tryUnify(LInvoke->getNormalDest(), RTerm->getSuccessor(0));
- }
-}
-
-}
-
-void DifferenceEngine::diff(Function *L, Function *R) {
- Context C(*this, L, R);
-
- // FIXME: types
- // FIXME: attributes and CC
- // FIXME: parameter attributes
-
- // If both are declarations, we're done.
- if (L->empty() && R->empty())
- return;
- else if (L->empty())
- log("left function is declaration, right function is definition");
- else if (R->empty())
- log("right function is declaration, left function is definition");
- else
- FunctionDifferenceEngine(*this).diff(L, R);
-}
-
-void DifferenceEngine::diff(Module *L, Module *R) {
- StringSet<> LNames;
- SmallVector<std::pair<Function*,Function*>, 20> Queue;
-
- for (Module::iterator I = L->begin(), E = L->end(); I != E; ++I) {
- Function *LFn = &*I;
- LNames.insert(LFn->getName());
-
- if (Function *RFn = R->getFunction(LFn->getName()))
- Queue.push_back(std::make_pair(LFn, RFn));
- else
- logf("function %l exists only in left module") << LFn;
- }
-
- for (Module::iterator I = R->begin(), E = R->end(); I != E; ++I) {
- Function *RFn = &*I;
- if (!LNames.count(RFn->getName()))
- logf("function %r exists only in right module") << RFn;
- }
-
- for (SmallVectorImpl<std::pair<Function*,Function*> >::iterator
- I = Queue.begin(), E = Queue.end(); I != E; ++I)
- diff(I->first, I->second);
-}
-
-bool DifferenceEngine::equivalentAsOperands(GlobalValue *L, GlobalValue *R) {
- if (globalValueOracle) return (*globalValueOracle)(L, R);
- return L->getName() == R->getName();
-}
diff --git a/contrib/llvm/tools/llvm-diff/DifferenceEngine.h b/contrib/llvm/tools/llvm-diff/DifferenceEngine.h
deleted file mode 100644
index 6eefb06..0000000
--- a/contrib/llvm/tools/llvm-diff/DifferenceEngine.h
+++ /dev/null
@@ -1,179 +0,0 @@
-//===-- DifferenceEngine.h - Module comparator ------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This header defines the interface to the LLVM difference engine,
-// which structurally compares functions within a module.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LLVM_DIFFERENCE_ENGINE_H_
-#define _LLVM_DIFFERENCE_ENGINE_H_
-
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/StringRef.h"
-
-#include <utility>
-
-namespace llvm {
- class Function;
- class GlobalValue;
- class Instruction;
- class LLVMContext;
- class Module;
- class Twine;
- class Value;
-
- /// A class for performing structural comparisons of LLVM assembly.
- class DifferenceEngine {
- public:
- /// A temporary-object class for building up log messages.
- class LogBuilder {
- DifferenceEngine &Engine;
-
- /// The use of a stored StringRef here is okay because
- /// LogBuilder should be used only as a temporary, and as a
- /// temporary it will be destructed before whatever temporary
- /// might be initializing this format.
- StringRef Format;
-
- SmallVector<Value*, 4> Arguments;
-
- public:
- LogBuilder(DifferenceEngine &Engine, StringRef Format)
- : Engine(Engine), Format(Format) {}
-
- LogBuilder &operator<<(Value *V) {
- Arguments.push_back(V);
- return *this;
- }
-
- ~LogBuilder() {
- Engine.consumer.logf(*this);
- }
-
- StringRef getFormat() const { return Format; }
-
- unsigned getNumArguments() const { return Arguments.size(); }
- Value *getArgument(unsigned I) const { return Arguments[I]; }
- };
-
- enum DiffChange { DC_match, DC_left, DC_right };
-
- /// A temporary-object class for building up diff messages.
- class DiffLogBuilder {
- typedef std::pair<Instruction*,Instruction*> DiffRecord;
- SmallVector<DiffRecord, 20> Diff;
-
- DifferenceEngine &Engine;
-
- public:
- DiffLogBuilder(DifferenceEngine &Engine) : Engine(Engine) {}
- ~DiffLogBuilder() { Engine.consumer.logd(*this); }
-
- void addMatch(Instruction *L, Instruction *R) {
- Diff.push_back(DiffRecord(L, R));
- }
- void addLeft(Instruction *L) {
- // HACK: VS 2010 has a bug in the stdlib that requires this.
- Diff.push_back(DiffRecord(L, DiffRecord::second_type(0)));
- }
- void addRight(Instruction *R) {
- // HACK: VS 2010 has a bug in the stdlib that requires this.
- Diff.push_back(DiffRecord(DiffRecord::first_type(0), R));
- }
-
- unsigned getNumLines() const { return Diff.size(); }
- DiffChange getLineKind(unsigned I) const {
- return (Diff[I].first ? (Diff[I].second ? DC_match : DC_left)
- : DC_right);
- }
- Instruction *getLeft(unsigned I) const { return Diff[I].first; }
- Instruction *getRight(unsigned I) const { return Diff[I].second; }
- };
-
- /// The interface for consumers of difference data.
- struct Consumer {
- /// Record that a local context has been entered. Left and
- /// Right are IR "containers" of some sort which are being
- /// considered for structural equivalence: global variables,
- /// functions, blocks, instructions, etc.
- virtual void enterContext(Value *Left, Value *Right) = 0;
-
- /// Record that a local context has been exited.
- virtual void exitContext() = 0;
-
- /// Record a difference within the current context.
- virtual void log(StringRef Text) = 0;
-
- /// Record a formatted difference within the current context.
- virtual void logf(const LogBuilder &Log) = 0;
-
- /// Record a line-by-line instruction diff.
- virtual void logd(const DiffLogBuilder &Log) = 0;
-
- protected:
- virtual ~Consumer() {}
- };
-
- /// A RAII object for recording the current context.
- struct Context {
- Context(DifferenceEngine &Engine, Value *L, Value *R) : Engine(Engine) {
- Engine.consumer.enterContext(L, R);
- }
-
- ~Context() {
- Engine.consumer.exitContext();
- }
-
- private:
- DifferenceEngine &Engine;
- };
-
- /// An oracle for answering whether two values are equivalent as
- /// operands.
- struct Oracle {
- virtual bool operator()(Value *L, Value *R) = 0;
-
- protected:
- virtual ~Oracle() {}
- };
-
- DifferenceEngine(LLVMContext &context, Consumer &consumer)
- : context(context), consumer(consumer), globalValueOracle(0) {}
-
- void diff(Module *L, Module *R);
- void diff(Function *L, Function *R);
-
- void log(StringRef text) {
- consumer.log(text);
- }
-
- LogBuilder logf(StringRef text) {
- return LogBuilder(*this, text);
- }
-
- /// Installs an oracle to decide whether two global values are
- /// equivalent as operands. Without an oracle, global values are
- /// considered equivalent as operands precisely when they have the
- /// same name.
- void setGlobalValueOracle(Oracle *oracle) {
- globalValueOracle = oracle;
- }
-
- /// Determines whether two global values are equivalent.
- bool equivalentAsOperands(GlobalValue *L, GlobalValue *R);
-
- private:
- LLVMContext &context;
- Consumer &consumer;
- Oracle *globalValueOracle;
- };
-}
-
-#endif
diff --git a/contrib/llvm/tools/llvm-diff/Makefile b/contrib/llvm/tools/llvm-diff/Makefile
deleted file mode 100644
index 58e49fa..0000000
--- a/contrib/llvm/tools/llvm-diff/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-##===- tools/llvm-diff/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-diff
-LINK_COMPONENTS := asmparser bitreader
-
-# This tool has no plugins, optimize startup time.
-TOOL_NO_EXPORTS = 1
-
-include $(LEVEL)/Makefile.common
diff --git a/contrib/llvm/tools/llvm-diff/llvm-diff.cpp b/contrib/llvm/tools/llvm-diff/llvm-diff.cpp
deleted file mode 100644
index 16a990f..0000000
--- a/contrib/llvm/tools/llvm-diff/llvm-diff.cpp
+++ /dev/null
@@ -1,331 +0,0 @@
-//===-- llvm-diff.cpp - Module comparator command-line driver ---*- 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 the command-line driver for the difference engine.
-//
-//===----------------------------------------------------------------------===//
-
-#include "DifferenceEngine.h"
-
-#include "llvm/Instructions.h"
-#include "llvm/LLVMContext.h"
-#include "llvm/Module.h"
-#include "llvm/Type.h"
-#include "llvm/Assembly/Parser.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/StringRef.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/ErrorHandling.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/raw_ostream.h"
-#include "llvm/Support/SourceMgr.h"
-
-#include <string>
-#include <utility>
-
-
-using namespace llvm;
-
-/// Reads a module from a file. If the filename ends in .ll, it is
-/// interpreted as an assembly file; otherwise, it is interpreted as
-/// bitcode. On error, messages are written to stderr and null is
-/// returned.
-static Module *ReadModule(LLVMContext &Context, StringRef Name) {
- // LLVM assembly path.
- if (Name.endswith(".ll")) {
- SMDiagnostic Diag;
- Module *M = ParseAssemblyFile(Name, Diag, Context);
- if (M) return M;
-
- Diag.Print("llvmdiff", errs());
- return 0;
- }
-
- // Bitcode path.
- MemoryBuffer *Buffer = MemoryBuffer::getFile(Name);
-
- // ParseBitcodeFile takes ownership of the buffer if it succeeds.
- std::string Error;
- Module *M = ParseBitcodeFile(Buffer, Context, &Error);
- if (M) return M;
-
- errs() << "error parsing " << Name << ": " << Error;
- delete Buffer;
- return 0;
-}
-
-namespace {
-struct DiffContext {
- DiffContext(Value *L, Value *R)
- : L(L), R(R), Differences(false), IsFunction(isa<Function>(L)) {}
- Value *L;
- Value *R;
- bool Differences;
- bool IsFunction;
- DenseMap<Value*,unsigned> LNumbering;
- DenseMap<Value*,unsigned> RNumbering;
-};
-
-void ComputeNumbering(Function *F, DenseMap<Value*,unsigned> &Numbering) {
- unsigned IN = 0;
-
- // Arguments get the first numbers.
- for (Function::arg_iterator
- AI = F->arg_begin(), AE = F->arg_end(); AI != AE; ++AI)
- if (!AI->hasName())
- Numbering[&*AI] = IN++;
-
- // Walk the basic blocks in order.
- for (Function::iterator FI = F->begin(), FE = F->end(); FI != FE; ++FI) {
- if (!FI->hasName())
- Numbering[&*FI] = IN++;
-
- // Walk the instructions in order.
- for (BasicBlock::iterator BI = FI->begin(), BE = FI->end(); BI != BE; ++BI)
- // void instructions don't get numbers.
- if (!BI->hasName() && !BI->getType()->isVoidTy())
- Numbering[&*BI] = IN++;
- }
-
- assert(!Numbering.empty() && "asked for numbering but numbering was no-op");
-}
-
-class DiffConsumer : public DifferenceEngine::Consumer {
-private:
- raw_ostream &out;
- Module *LModule;
- Module *RModule;
- SmallVector<DiffContext, 5> contexts;
- bool Differences;
- unsigned Indent;
-
- void printValue(Value *V, bool isL) {
- if (V->hasName()) {
- out << (isa<GlobalValue>(V) ? '@' : '%') << V->getName();
- return;
- }
- if (V->getType()->isVoidTy()) {
- if (isa<StoreInst>(V)) {
- out << "store to ";
- printValue(cast<StoreInst>(V)->getPointerOperand(), isL);
- } else if (isa<CallInst>(V)) {
- out << "call to ";
- printValue(cast<CallInst>(V)->getCalledValue(), isL);
- } else if (isa<InvokeInst>(V)) {
- out << "invoke to ";
- printValue(cast<InvokeInst>(V)->getCalledValue(), isL);
- } else {
- out << *V;
- }
- return;
- }
-
- unsigned N = contexts.size();
- while (N > 0) {
- --N;
- DiffContext &ctxt = contexts[N];
- if (!ctxt.IsFunction) continue;
- if (isL) {
- if (ctxt.LNumbering.empty())
- ComputeNumbering(cast<Function>(ctxt.L), ctxt.LNumbering);
- out << '%' << ctxt.LNumbering[V];
- return;
- } else {
- if (ctxt.RNumbering.empty())
- ComputeNumbering(cast<Function>(ctxt.R), ctxt.RNumbering);
- out << '%' << ctxt.RNumbering[V];
- return;
- }
- }
-
- out << "<anonymous>";
- }
-
- void header() {
- if (contexts.empty()) return;
- for (SmallVectorImpl<DiffContext>::iterator
- I = contexts.begin(), E = contexts.end(); I != E; ++I) {
- if (I->Differences) continue;
- if (isa<Function>(I->L)) {
- // Extra newline between functions.
- if (Differences) out << "\n";
-
- Function *L = cast<Function>(I->L);
- Function *R = cast<Function>(I->R);
- if (L->getName() != R->getName())
- out << "in function " << L->getName()
- << " / " << R->getName() << ":\n";
- else
- out << "in function " << L->getName() << ":\n";
- } else if (isa<BasicBlock>(I->L)) {
- BasicBlock *L = cast<BasicBlock>(I->L);
- BasicBlock *R = cast<BasicBlock>(I->R);
- if (L->hasName() && R->hasName() && L->getName() == R->getName())
- out << " in block %" << L->getName() << ":\n";
- else {
- out << " in block ";
- printValue(L, true);
- out << " / ";
- printValue(R, false);
- out << ":\n";
- }
- } else if (isa<Instruction>(I->L)) {
- out << " in instruction ";
- printValue(I->L, true);
- out << " / ";
- printValue(I->R, false);
- out << ":\n";
- }
-
- I->Differences = true;
- }
- }
-
- void indent() {
- unsigned N = Indent;
- while (N--) out << ' ';
- }
-
-public:
- DiffConsumer(Module *L, Module *R)
- : out(errs()), LModule(L), RModule(R), Differences(false), Indent(0) {}
-
- bool hadDifferences() const { return Differences; }
-
- void enterContext(Value *L, Value *R) {
- contexts.push_back(DiffContext(L, R));
- Indent += 2;
- }
- void exitContext() {
- Differences |= contexts.back().Differences;
- contexts.pop_back();
- Indent -= 2;
- }
-
- void log(StringRef text) {
- header();
- indent();
- out << text << '\n';
- }
-
- void logf(const DifferenceEngine::LogBuilder &Log) {
- header();
- indent();
-
- unsigned arg = 0;
-
- StringRef format = Log.getFormat();
- while (true) {
- size_t percent = format.find('%');
- if (percent == StringRef::npos) {
- out << format;
- break;
- }
- assert(format[percent] == '%');
-
- if (percent > 0) out << format.substr(0, percent);
-
- switch (format[percent+1]) {
- case '%': out << '%'; break;
- case 'l': printValue(Log.getArgument(arg++), true); break;
- case 'r': printValue(Log.getArgument(arg++), false); break;
- default: llvm_unreachable("unknown format character");
- }
-
- format = format.substr(percent+2);
- }
-
- out << '\n';
- }
-
- void logd(const DifferenceEngine::DiffLogBuilder &Log) {
- header();
-
- for (unsigned I = 0, E = Log.getNumLines(); I != E; ++I) {
- indent();
- switch (Log.getLineKind(I)) {
- case DifferenceEngine::DC_match:
- out << " ";
- Log.getLeft(I)->dump();
- //printValue(Log.getLeft(I), true);
- break;
- case DifferenceEngine::DC_left:
- out << "< ";
- Log.getLeft(I)->dump();
- //printValue(Log.getLeft(I), true);
- break;
- case DifferenceEngine::DC_right:
- out << "> ";
- Log.getRight(I)->dump();
- //printValue(Log.getRight(I), false);
- break;
- }
- //out << "\n";
- }
- }
-
-};
-}
-
-static void diffGlobal(DifferenceEngine &Engine, Module *L, Module *R,
- StringRef Name) {
- // Drop leading sigils from the global name.
- if (Name.startswith("@")) Name = Name.substr(1);
-
- Function *LFn = L->getFunction(Name);
- Function *RFn = R->getFunction(Name);
- if (LFn && RFn)
- Engine.diff(LFn, RFn);
- else if (!LFn && !RFn)
- errs() << "No function named @" << Name << " in either module\n";
- else if (!LFn)
- errs() << "No function named @" << Name << " in left module\n";
- else
- errs() << "No function named @" << Name << " in right module\n";
-}
-
-cl::opt<std::string> LeftFilename(cl::Positional,
- cl::desc("<first file>"),
- cl::Required);
-cl::opt<std::string> RightFilename(cl::Positional,
- cl::desc("<second file>"),
- cl::Required);
-cl::list<std::string> GlobalsToCompare(cl::Positional,
- cl::desc("<globals to compare>"));
-
-int main(int argc, char **argv) {
- cl::ParseCommandLineOptions(argc, argv);
-
- LLVMContext Context;
-
- // Load both modules. Die if that fails.
- Module *LModule = ReadModule(Context, LeftFilename);
- Module *RModule = ReadModule(Context, RightFilename);
- if (!LModule || !RModule) return 1;
-
- DiffConsumer Consumer(LModule, RModule);
- DifferenceEngine Engine(Context, Consumer);
-
- // If any global names were given, just diff those.
- if (!GlobalsToCompare.empty()) {
- for (unsigned I = 0, E = GlobalsToCompare.size(); I != E; ++I)
- diffGlobal(Engine, LModule, RModule, GlobalsToCompare[I]);
-
- // Otherwise, diff everything in the module.
- } else {
- Engine.diff(LModule, RModule);
- }
-
- delete LModule;
- delete RModule;
-
- return Consumer.hadDifferences();
-}
diff --git a/contrib/llvm/tools/llvm-dis/CMakeLists.txt b/contrib/llvm/tools/llvm-dis/CMakeLists.txt
deleted file mode 100644
index d62a6b5..0000000
--- a/contrib/llvm/tools/llvm-dis/CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-set(LLVM_LINK_COMPONENTS bitreader)
-set(LLVM_REQUIRES_EH 1)
-
-add_llvm_tool(llvm-dis
- llvm-dis.cpp
- )
diff --git a/contrib/llvm/tools/llvm-dis/Makefile b/contrib/llvm/tools/llvm-dis/Makefile
deleted file mode 100644
index 22c9ecc..0000000
--- a/contrib/llvm/tools/llvm-dis/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-##===- tools/llvm-dis/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-dis
-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-dis/llvm-dis.cpp b/contrib/llvm/tools/llvm-dis/llvm-dis.cpp
deleted file mode 100644
index 9d2d31d..0000000
--- a/contrib/llvm/tools/llvm-dis/llvm-dis.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-//===-- llvm-dis.cpp - The low-level LLVM disassembler --------------------===//
-//
-// 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-dis [options] - Read LLVM bitcode from stdin, write asm to stdout
-// llvm-dis [options] x.bc - Read LLVM bitcode from the x.bc file, write asm
-// to the x.ll file.
-// Options:
-// --help - Output information about command line switches
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/LLVMContext.h"
-#include "llvm/Module.h"
-#include "llvm/Type.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Assembly/AssemblyAnnotationWriter.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/FormattedStream.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"
-using namespace llvm;
-
-static cl::opt<std::string>
-InputFilename(cl::Positional, cl::desc("<input bitcode>"), cl::init("-"));
-
-static cl::opt<std::string>
-OutputFilename("o", cl::desc("Override output filename"),
- cl::value_desc("filename"));
-
-static cl::opt<bool>
-Force("f", cl::desc("Enable binary output on terminals"));
-
-static cl::opt<bool>
-DontPrint("disable-output", cl::desc("Don't output the .ll file"), cl::Hidden);
-
-static cl::opt<bool>
-ShowAnnotations("show-annotations",
- cl::desc("Add informational comments to the .ll file"));
-
-namespace {
-
-class CommentWriter : public AssemblyAnnotationWriter {
-public:
- void emitFunctionAnnot(const Function *F,
- formatted_raw_ostream &OS) {
- OS << "; [#uses=" << F->getNumUses() << ']'; // Output # uses
- OS << '\n';
- }
- void printInfoComment(const Value &V, formatted_raw_ostream &OS) {
- if (V.getType()->isVoidTy()) return;
-
- OS.PadToColumn(50);
- OS << "; [#uses=" << V.getNumUses() << ']'; // Output # uses
- }
-};
-
-} // end anon namespace
-
-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 .bc -> .ll disassembler\n");
-
- std::string ErrorMessage;
- std::auto_ptr<Module> M;
-
- if (MemoryBuffer *Buffer
- = MemoryBuffer::getFileOrSTDIN(InputFilename, &ErrorMessage)) {
- M.reset(ParseBitcodeFile(Buffer, Context, &ErrorMessage));
- delete Buffer;
- }
-
- if (M.get() == 0) {
- errs() << argv[0] << ": ";
- if (ErrorMessage.size())
- errs() << ErrorMessage << "\n";
- else
- errs() << "bitcode didn't read correctly.\n";
- return 1;
- }
-
- // Just use stdout. We won't actually print anything on it.
- if (DontPrint)
- OutputFilename = "-";
-
- if (OutputFilename.empty()) { // Unspecified output, infer it.
- if (InputFilename == "-") {
- OutputFilename = "-";
- } else {
- const std::string &IFN = InputFilename;
- int Len = IFN.length();
- // If the source ends in .bc, strip it off.
- if (IFN[Len-3] == '.' && IFN[Len-2] == 'b' && IFN[Len-1] == 'c')
- OutputFilename = std::string(IFN.begin(), IFN.end()-3)+".ll";
- else
- OutputFilename = IFN+".ll";
- }
- }
-
- std::string ErrorInfo;
- OwningPtr<tool_output_file>
- Out(new tool_output_file(OutputFilename.c_str(), ErrorInfo,
- raw_fd_ostream::F_Binary));
- if (!ErrorInfo.empty()) {
- errs() << ErrorInfo << '\n';
- return 1;
- }
-
- OwningPtr<AssemblyAnnotationWriter> Annotator;
- if (ShowAnnotations)
- Annotator.reset(new CommentWriter());
-
- // All that llvm-dis does is write the assembly to a file.
- if (!DontPrint)
- M->print(Out->os(), Annotator.get());
-
- // Declare success.
- Out->keep();
-
- return 0;
-}
-
diff --git a/contrib/llvm/tools/llvm-extract/CMakeLists.txt b/contrib/llvm/tools/llvm-extract/CMakeLists.txt
deleted file mode 100644
index a4e3266..0000000
--- a/contrib/llvm/tools/llvm-extract/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-set(LLVM_LINK_COMPONENTS asmparser ipo bitreader bitwriter)
-
-add_llvm_tool(llvm-extract
- llvm-extract.cpp
- )
diff --git a/contrib/llvm/tools/llvm-extract/Makefile b/contrib/llvm/tools/llvm-extract/Makefile
deleted file mode 100644
index 5672aa3..0000000
--- a/contrib/llvm/tools/llvm-extract/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-##===- tools/llvm-extract/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-extract
-LINK_COMPONENTS := ipo bitreader bitwriter asmparser
-
-# This tool has no plugins, optimize startup time.
-TOOL_NO_EXPORTS = 1
-
-include $(LEVEL)/Makefile.common
diff --git a/contrib/llvm/tools/llvm-extract/llvm-extract.cpp b/contrib/llvm/tools/llvm-extract/llvm-extract.cpp
deleted file mode 100644
index 91a59e5..0000000
--- a/contrib/llvm/tools/llvm-extract/llvm-extract.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-//===- llvm-extract.cpp - LLVM function extraction utility ----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This utility changes the input module to only contain a single function,
-// which is primarily used for debugging transformations.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/LLVMContext.h"
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/Assembly/PrintModulePass.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/IRReader.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/PrettyStackTrace.h"
-#include "llvm/Support/raw_ostream.h"
-#include "llvm/Support/SystemUtils.h"
-#include "llvm/System/Signals.h"
-#include <memory>
-using namespace llvm;
-
-// InputFilename - The filename to read from.
-static cl::opt<std::string>
-InputFilename(cl::Positional, cl::desc("<input bitcode file>"),
- cl::init("-"), cl::value_desc("filename"));
-
-static cl::opt<std::string>
-OutputFilename("o", cl::desc("Specify output filename"),
- cl::value_desc("filename"), cl::init("-"));
-
-static cl::opt<bool>
-Force("f", cl::desc("Enable binary output on terminals"));
-
-static cl::opt<bool>
-DeleteFn("delete", cl::desc("Delete specified Globals from Module"));
-
-// ExtractFuncs - The functions to extract from the module...
-static cl::list<std::string>
-ExtractFuncs("func", cl::desc("Specify function to extract"),
- cl::ZeroOrMore, cl::value_desc("function"));
-
-// ExtractGlobals - The globals to extract from the module...
-static cl::list<std::string>
-ExtractGlobals("glob", cl::desc("Specify global to extract"),
- cl::ZeroOrMore, cl::value_desc("global"));
-
-static cl::opt<bool>
-OutputAssembly("S",
- cl::desc("Write output as LLVM assembly"), cl::Hidden);
-
-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 extractor\n");
-
- // Use lazy loading, since we only care about selected global values.
- SMDiagnostic Err;
- std::auto_ptr<Module> M;
- M.reset(getLazyIRFileModule(InputFilename, Err, Context));
-
- if (M.get() == 0) {
- Err.Print(argv[0], errs());
- return 1;
- }
-
- std::vector<GlobalValue *> GVs;
-
- // Figure out which globals we should extract.
- for (size_t i = 0, e = ExtractGlobals.size(); i != e; ++i) {
- GlobalValue *GV = M.get()->getNamedGlobal(ExtractGlobals[i]);
- if (!GV) {
- errs() << argv[0] << ": program doesn't contain global named '"
- << ExtractGlobals[i] << "'!\n";
- return 1;
- }
- GVs.push_back(GV);
- }
-
- // Figure out which functions we should extract.
- for (size_t i = 0, e = ExtractFuncs.size(); i != e; ++i) {
- GlobalValue *GV = M.get()->getFunction(ExtractFuncs[i]);
- if (!GV) {
- errs() << argv[0] << ": program doesn't contain function named '"
- << ExtractFuncs[i] << "'!\n";
- return 1;
- }
- GVs.push_back(GV);
- }
-
- // Materialize requisite global values.
- for (size_t i = 0, e = GVs.size(); i != e; ++i) {
- GlobalValue *GV = GVs[i];
- if (GV->isMaterializable()) {
- std::string ErrInfo;
- if (GV->Materialize(&ErrInfo)) {
- errs() << argv[0] << ": error reading input: " << ErrInfo << "\n";
- return 1;
- }
- }
- }
-
- // In addition to deleting all other functions, we also want to spiff it
- // up a little bit. Do this now.
- PassManager Passes;
- Passes.add(new TargetData(M.get())); // Use correct TargetData
-
- Passes.add(createGVExtractionPass(GVs, DeleteFn));
- if (!DeleteFn)
- Passes.add(createGlobalDCEPass()); // Delete unreachable globals
- Passes.add(createStripDeadDebugInfoPass()); // Remove dead debug info
- Passes.add(createDeadTypeEliminationPass()); // Remove dead types...
- Passes.add(createStripDeadPrototypesPass()); // Remove dead func decls
-
- std::string ErrorInfo;
- tool_output_file Out(OutputFilename.c_str(), ErrorInfo,
- raw_fd_ostream::F_Binary);
- if (!ErrorInfo.empty()) {
- errs() << ErrorInfo << '\n';
- return 1;
- }
-
- if (OutputAssembly)
- Passes.add(createPrintModulePass(&Out.os()));
- else if (Force || !CheckBitcodeOutputToConsole(Out.os(), true))
- Passes.add(createBitcodeWriterPass(Out.os()));
-
- Passes.run(*M.get());
-
- // Declare success.
- Out.keep();
-
- return 0;
-}
diff --git a/contrib/llvm/tools/llvm-ld/CMakeLists.txt b/contrib/llvm/tools/llvm-ld/CMakeLists.txt
deleted file mode 100644
index 2ae4a1d..0000000
--- a/contrib/llvm/tools/llvm-ld/CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-set(LLVM_LINK_COMPONENTS ipo scalaropts linker archive bitwriter)
-
-add_llvm_tool(llvm-ld
- Optimize.cpp
- llvm-ld.cpp
- )
diff --git a/contrib/llvm/tools/llvm-ld/Makefile b/contrib/llvm/tools/llvm-ld/Makefile
deleted file mode 100644
index 1ef9bf1..0000000
--- a/contrib/llvm/tools/llvm-ld/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-##===- tools/llvm-ld/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-ld
-LINK_COMPONENTS = ipo scalaropts linker archive bitwriter
-
-include $(LEVEL)/Makefile.common
diff --git a/contrib/llvm/tools/llvm-ld/Optimize.cpp b/contrib/llvm/tools/llvm-ld/Optimize.cpp
deleted file mode 100644
index 3fb0079..0000000
--- a/contrib/llvm/tools/llvm-ld/Optimize.cpp
+++ /dev/null
@@ -1,128 +0,0 @@
-//===- Optimize.cpp - Optimize a complete 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 all optimization of the linked module for llvm-ld.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/StandardPasses.h"
-#include "llvm/Support/raw_ostream.h"
-#include "llvm/System/DynamicLibrary.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/PassNameParser.h"
-#include "llvm/Support/PluginLoader.h"
-using namespace llvm;
-
-// Pass Name Options as generated by the PassNameParser
-static cl::list<const PassInfo*, bool, PassNameParser>
- OptimizationList(cl::desc("Optimizations available:"));
-
-//Don't verify at the end
-static cl::opt<bool> DontVerify("disable-verify", cl::ReallyHidden);
-
-static cl::opt<bool> DisableInline("disable-inlining",
- cl::desc("Do not run the inliner pass"));
-
-static cl::opt<bool>
-DisableOptimizations("disable-opt",
- cl::desc("Do not run any optimization passes"));
-
-static cl::opt<bool> DisableInternalize("disable-internalize",
- cl::desc("Do not mark all symbols as internal"));
-
-static cl::opt<bool> VerifyEach("verify-each",
- cl::desc("Verify intermediate results of all passes"));
-
-static cl::alias ExportDynamic("export-dynamic",
- cl::aliasopt(DisableInternalize),
- cl::desc("Alias for -disable-internalize"));
-
-static cl::opt<bool> Strip("strip-all",
- cl::desc("Strip all symbol info from executable"));
-
-static cl::alias A0("s", cl::desc("Alias for --strip-all"),
- cl::aliasopt(Strip));
-
-static cl::opt<bool> StripDebug("strip-debug",
- cl::desc("Strip debugger symbol info from executable"));
-
-static cl::alias A1("S", cl::desc("Alias for --strip-debug"),
- cl::aliasopt(StripDebug));
-
-// A utility function that adds a pass to the pass manager but will also add
-// a verifier pass after if we're supposed to verify.
-static inline void addPass(PassManager &PM, Pass *P) {
- // Add the pass to the pass manager...
- PM.add(P);
-
- // If we are verifying all of the intermediate steps, add the verifier...
- if (VerifyEach)
- PM.add(createVerifierPass());
-}
-
-namespace llvm {
-
-/// Optimize - Perform link time optimizations. This will run the scalar
-/// optimizations, any loaded plugin-optimization modules, and then the
-/// inter-procedural optimizations if applicable.
-void Optimize(Module* M) {
-
- // Instantiate the pass manager to organize the passes.
- PassManager Passes;
-
- // If we're verifying, start off with a verification pass.
- if (VerifyEach)
- Passes.add(createVerifierPass());
-
- // Add an appropriate TargetData instance for this module...
- addPass(Passes, new TargetData(M));
-
- if (!DisableOptimizations)
- createStandardLTOPasses(&Passes, !DisableInternalize, !DisableInline,
- VerifyEach);
-
- // If the -s or -S command line options were specified, strip the symbols out
- // of the resulting program to make it smaller. -s and -S are GNU ld options
- // that we are supporting; they alias -strip-all and -strip-debug.
- if (Strip || StripDebug)
- addPass(Passes, createStripSymbolsPass(StripDebug && !Strip));
-
- // Create a new optimization pass for each one specified on the command line
- std::auto_ptr<TargetMachine> target;
- for (unsigned i = 0; i < OptimizationList.size(); ++i) {
- const PassInfo *Opt = OptimizationList[i];
- if (Opt->getNormalCtor())
- addPass(Passes, Opt->getNormalCtor()());
- else
- errs() << "llvm-ld: cannot create pass: " << Opt->getPassName()
- << "\n";
- }
-
- // The user's passes may leave cruft around. Clean up after them them but
- // only if we haven't got DisableOptimizations set
- if (!DisableOptimizations) {
- addPass(Passes, createInstructionCombiningPass());
- addPass(Passes, createCFGSimplificationPass());
- addPass(Passes, createAggressiveDCEPass());
- addPass(Passes, createGlobalDCEPass());
- }
-
- // Make sure everything is still good.
- if (!DontVerify)
- Passes.add(createVerifierPass());
-
- // Run our queue of passes all at once now, efficiently.
- Passes.run(*M);
-}
-
-}
diff --git a/contrib/llvm/tools/llvm-ld/llvm-ld.cpp b/contrib/llvm/tools/llvm-ld/llvm-ld.cpp
deleted file mode 100644
index 3bbea9d..0000000
--- a/contrib/llvm/tools/llvm-ld/llvm-ld.cpp
+++ /dev/null
@@ -1,724 +0,0 @@
-//===- llvm-ld.cpp - LLVM 'ld' compatible linker --------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This utility is intended to be compatible with GCC, and follows standard
-// system 'ld' conventions. As such, the default output file is ./a.out.
-// Additionally, this program outputs a shell script that is used to invoke LLI
-// to execute the program. In this manner, the generated executable (a.out for
-// example), is directly executable, whereas the bitcode file actually lives in
-// the a.out.bc file generated by this program.
-//
-// Note that if someone (or a script) deletes the executable program generated,
-// the .bc file will be left around. Considering that this is a temporary hack,
-// I'm not too worried about this.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/LinkAllVMCore.h"
-#include "llvm/Linker.h"
-#include "llvm/LLVMContext.h"
-#include "llvm/System/Program.h"
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/FileUtilities.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/PrettyStackTrace.h"
-#include "llvm/Support/SystemUtils.h"
-#include "llvm/Support/raw_ostream.h"
-#include "llvm/System/Signals.h"
-#include "llvm/Config/config.h"
-#include <memory>
-#include <cstring>
-using namespace llvm;
-
-// Rightly this should go in a header file but it just seems such a waste.
-namespace llvm {
-extern void Optimize(Module*);
-}
-
-// Input/Output Options
-static cl::list<std::string> InputFilenames(cl::Positional, cl::OneOrMore,
- cl::desc("<input bitcode files>"));
-
-static cl::opt<std::string> OutputFilename("o", cl::init("a.out"),
- cl::desc("Override output filename"),
- cl::value_desc("filename"));
-
-static cl::opt<std::string> BitcodeOutputFilename("b", cl::init(""),
- cl::desc("Override bitcode output filename"),
- cl::value_desc("filename"));
-
-static cl::opt<bool> Verbose("v",
- cl::desc("Print information about actions taken"));
-
-static cl::list<std::string> LibPaths("L", cl::Prefix,
- cl::desc("Specify a library search path"),
- cl::value_desc("directory"));
-
-static cl::list<std::string> FrameworkPaths("F", cl::Prefix,
- cl::desc("Specify a framework search path"),
- cl::value_desc("directory"));
-
-static cl::list<std::string> Libraries("l", cl::Prefix,
- cl::desc("Specify libraries to link to"),
- cl::value_desc("library prefix"));
-
-static cl::list<std::string> Frameworks("framework",
- cl::desc("Specify frameworks to link to"),
- cl::value_desc("framework"));
-
-// Options to control the linking, optimization, and code gen processes
-static cl::opt<bool> LinkAsLibrary("link-as-library",
- cl::desc("Link the .bc files together as a library, not an executable"));
-
-static cl::alias Relink("r", cl::aliasopt(LinkAsLibrary),
- cl::desc("Alias for -link-as-library"));
-
-static cl::opt<bool> Native("native",
- cl::desc("Generate a native binary instead of a shell script"));
-
-static cl::opt<bool>NativeCBE("native-cbe",
- cl::desc("Generate a native binary with the C backend and GCC"));
-
-static cl::list<std::string> PostLinkOpts("post-link-opts",
- cl::value_desc("path"),
- cl::desc("Run one or more optimization programs after linking"));
-
-static cl::list<std::string> XLinker("Xlinker", cl::value_desc("option"),
- cl::desc("Pass options to the system linker"));
-
-// Compatibility options that llvm-ld ignores but are supported for
-// compatibility with LD
-static cl::opt<std::string> CO3("soname", cl::Hidden,
- cl::desc("Compatibility option: ignored"));
-
-static cl::opt<std::string> CO4("version-script", cl::Hidden,
- cl::desc("Compatibility option: ignored"));
-
-static cl::opt<bool> CO5("eh-frame-hdr", cl::Hidden,
- cl::desc("Compatibility option: ignored"));
-
-static cl::opt<std::string> CO6("h", cl::Hidden,
- cl::desc("Compatibility option: ignored"));
-
-static cl::opt<bool> CO7("start-group", cl::Hidden,
- cl::desc("Compatibility option: ignored"));
-
-static cl::opt<bool> CO8("end-group", cl::Hidden,
- cl::desc("Compatibility option: ignored"));
-
-static cl::opt<std::string> CO9("m", cl::Hidden,
- cl::desc("Compatibility option: ignored"));
-
-/// This is just for convenience so it doesn't have to be passed around
-/// everywhere.
-static std::string progname;
-
-/// FileRemover objects to clean up output files in the event of an error.
-static FileRemover OutputRemover;
-static FileRemover BitcodeOutputRemover;
-
-/// PrintAndExit - Prints a message to standard error and exits with error code
-///
-/// Inputs:
-/// Message - The message to print to standard error.
-///
-static void PrintAndExit(const std::string &Message, Module *M, int errcode = 1) {
- errs() << progname << ": " << Message << "\n";
- delete M;
- llvm_shutdown();
- exit(errcode);
-}
-
-static void PrintCommand(const std::vector<const char*> &args) {
- std::vector<const char*>::const_iterator I = args.begin(), E = args.end();
- for (; I != E; ++I)
- if (*I)
- errs() << "'" << *I << "'" << " ";
- errs() << "\n";
-}
-
-/// CopyEnv - This function takes an array of environment variables and makes a
-/// copy of it. This copy can then be manipulated any way the caller likes
-/// without affecting the process's real environment.
-///
-/// Inputs:
-/// envp - An array of C strings containing an environment.
-///
-/// Return value:
-/// NULL - An error occurred.
-///
-/// Otherwise, a pointer to a new array of C strings is returned. Every string
-/// in the array is a duplicate of the one in the original array (i.e. we do
-/// not copy the char *'s from one array to another).
-///
-static char ** CopyEnv(char ** const envp) {
- // Count the number of entries in the old list;
- unsigned entries; // The number of entries in the old environment list
- for (entries = 0; envp[entries] != NULL; entries++)
- /*empty*/;
-
- // Add one more entry for the NULL pointer that ends the list.
- ++entries;
-
- // If there are no entries at all, just return NULL.
- if (entries == 0)
- return NULL;
-
- // Allocate a new environment list.
- char **newenv = new char* [entries];
- if ((newenv = new char* [entries]) == NULL)
- return NULL;
-
- // Make a copy of the list. Don't forget the NULL that ends the list.
- entries = 0;
- while (envp[entries] != NULL) {
- size_t len = strlen(envp[entries]) + 1;
- newenv[entries] = new char[len];
- memcpy(newenv[entries], envp[entries], len);
- ++entries;
- }
- newenv[entries] = NULL;
-
- return newenv;
-}
-
-
-/// RemoveEnv - Remove the specified environment variable from the environment
-/// array.
-///
-/// Inputs:
-/// name - The name of the variable to remove. It cannot be NULL.
-/// envp - The array of environment variables. It cannot be NULL.
-///
-/// Notes:
-/// This is mainly done because functions to remove items from the environment
-/// are not available across all platforms. In particular, Solaris does not
-/// seem to have an unsetenv() function or a setenv() function (or they are
-/// undocumented if they do exist).
-///
-static void RemoveEnv(const char * name, char ** const envp) {
- for (unsigned index=0; envp[index] != NULL; index++) {
- // Find the first equals sign in the array and make it an EOS character.
- char *p = strchr (envp[index], '=');
- if (p == NULL)
- continue;
- else
- *p = '\0';
-
- // Compare the two strings. If they are equal, zap this string.
- // Otherwise, restore it.
- if (!strcmp(name, envp[index]))
- *envp[index] = '\0';
- else
- *p = '=';
- }
-
- return;
-}
-
-/// GenerateBitcode - generates a bitcode file from the module provided
-void GenerateBitcode(Module* M, const std::string& FileName) {
-
- if (Verbose)
- errs() << "Generating Bitcode To " << FileName << '\n';
-
- // Create the output file.
- std::string ErrorInfo;
- tool_output_file Out(FileName.c_str(), ErrorInfo,
- raw_fd_ostream::F_Binary);
- if (!ErrorInfo.empty()) {
- PrintAndExit(ErrorInfo, M);
- return;
- }
-
- // Write it out
- WriteBitcodeToFile(M, Out.os());
- Out.keep();
-}
-
-/// GenerateAssembly - generates a native assembly language source file from the
-/// specified bitcode file.
-///
-/// Inputs:
-/// InputFilename - The name of the input bitcode file.
-/// OutputFilename - The name of the file to generate.
-/// llc - The pathname to use for LLC.
-/// envp - The environment to use when running LLC.
-///
-/// Return non-zero value on error.
-///
-static int GenerateAssembly(const std::string &OutputFilename,
- const std::string &InputFilename,
- const sys::Path &llc,
- std::string &ErrMsg ) {
- // Run LLC to convert the bitcode file into assembly code.
- std::vector<const char*> args;
- args.push_back(llc.c_str());
- // We will use GCC to assemble the program so set the assembly syntax to AT&T,
- // regardless of what the target in the bitcode file is.
- args.push_back("-x86-asm-syntax=att");
- args.push_back("-o");
- args.push_back(OutputFilename.c_str());
- args.push_back(InputFilename.c_str());
- args.push_back(0);
-
- if (Verbose) {
- errs() << "Generating Assembly With: \n";
- PrintCommand(args);
- }
-
- return sys::Program::ExecuteAndWait(llc, &args[0], 0, 0, 0, 0, &ErrMsg);
-}
-
-/// GenerateCFile - generates a C source file from the specified bitcode file.
-static int GenerateCFile(const std::string &OutputFile,
- const std::string &InputFile,
- const sys::Path &llc,
- std::string& ErrMsg) {
- // Run LLC to convert the bitcode file into C.
- std::vector<const char*> args;
- args.push_back(llc.c_str());
- args.push_back("-march=c");
- args.push_back("-o");
- args.push_back(OutputFile.c_str());
- args.push_back(InputFile.c_str());
- args.push_back(0);
-
- if (Verbose) {
- errs() << "Generating C Source With: \n";
- PrintCommand(args);
- }
-
- return sys::Program::ExecuteAndWait(llc, &args[0], 0, 0, 0, 0, &ErrMsg);
-}
-
-/// GenerateNative - generates a native object file from the
-/// specified bitcode file.
-///
-/// Inputs:
-/// InputFilename - The name of the input bitcode file.
-/// OutputFilename - The name of the file to generate.
-/// NativeLinkItems - The native libraries, files, code with which to link
-/// LibPaths - The list of directories in which to find libraries.
-/// FrameworksPaths - The list of directories in which to find frameworks.
-/// Frameworks - The list of frameworks (dynamic libraries)
-/// gcc - The pathname to use for GGC.
-/// envp - A copy of the process's current environment.
-///
-/// Outputs:
-/// None.
-///
-/// Returns non-zero value on error.
-///
-static int GenerateNative(const std::string &OutputFilename,
- const std::string &InputFilename,
- const Linker::ItemList &LinkItems,
- const sys::Path &gcc, char ** const envp,
- std::string& ErrMsg) {
- // Remove these environment variables from the environment of the
- // programs that we will execute. It appears that GCC sets these
- // environment variables so that the programs it uses can configure
- // themselves identically.
- //
- // However, when we invoke GCC below, we want it to use its normal
- // configuration. Hence, we must sanitize its environment.
- char ** clean_env = CopyEnv(envp);
- if (clean_env == NULL)
- return 1;
- RemoveEnv("LIBRARY_PATH", clean_env);
- RemoveEnv("COLLECT_GCC_OPTIONS", clean_env);
- RemoveEnv("GCC_EXEC_PREFIX", clean_env);
- RemoveEnv("COMPILER_PATH", clean_env);
- RemoveEnv("COLLECT_GCC", clean_env);
-
-
- // Run GCC to assemble and link the program into native code.
- //
- // Note:
- // We can't just assemble and link the file with the system assembler
- // and linker because we don't know where to put the _start symbol.
- // GCC mysteriously knows how to do it.
- std::vector<std::string> args;
- args.push_back(gcc.c_str());
- args.push_back("-fno-strict-aliasing");
- args.push_back("-O3");
- args.push_back("-o");
- args.push_back(OutputFilename);
- args.push_back(InputFilename);
-
- // Add in the library and framework paths
- for (unsigned index = 0; index < LibPaths.size(); index++) {
- args.push_back("-L" + LibPaths[index]);
- }
- for (unsigned index = 0; index < FrameworkPaths.size(); index++) {
- args.push_back("-F" + FrameworkPaths[index]);
- }
-
- // Add the requested options
- for (unsigned index = 0; index < XLinker.size(); index++)
- args.push_back(XLinker[index]);
-
- // Add in the libraries to link.
- for (unsigned index = 0; index < LinkItems.size(); index++)
- if (LinkItems[index].first != "crtend") {
- if (LinkItems[index].second)
- args.push_back("-l" + LinkItems[index].first);
- else
- args.push_back(LinkItems[index].first);
- }
-
- // Add in frameworks to link.
- for (unsigned index = 0; index < Frameworks.size(); index++) {
- args.push_back("-framework");
- args.push_back(Frameworks[index]);
- }
-
- // Now that "args" owns all the std::strings for the arguments, call the c_str
- // method to get the underlying string array. We do this game so that the
- // std::string array is guaranteed to outlive the const char* array.
- std::vector<const char *> Args;
- for (unsigned i = 0, e = args.size(); i != e; ++i)
- Args.push_back(args[i].c_str());
- Args.push_back(0);
-
- if (Verbose) {
- errs() << "Generating Native Executable With:\n";
- PrintCommand(Args);
- }
-
- // Run the compiler to assembly and link together the program.
- int R = sys::Program::ExecuteAndWait(
- gcc, &Args[0], const_cast<const char **>(clean_env), 0, 0, 0, &ErrMsg);
- delete [] clean_env;
- return R;
-}
-
-/// EmitShellScript - Output the wrapper file that invokes the JIT on the LLVM
-/// bitcode file for the program.
-static void EmitShellScript(char **argv, Module *M) {
- if (Verbose)
- errs() << "Emitting Shell Script\n";
-#if defined(_WIN32) || defined(__CYGWIN__)
- // Windows doesn't support #!/bin/sh style shell scripts in .exe files. To
- // support windows systems, we copy the llvm-stub.exe executable from the
- // build tree to the destination file.
- std::string ErrMsg;
- sys::Path llvmstub = FindExecutable("llvm-stub.exe", argv[0],
- (void *)(intptr_t)&Optimize);
- if (llvmstub.isEmpty())
- PrintAndExit("Could not find llvm-stub.exe executable!", M);
-
- if (0 != sys::CopyFile(sys::Path(OutputFilename), llvmstub, &ErrMsg))
- PrintAndExit(ErrMsg, M);
-
- return;
-#endif
-
- // Output the script to start the program...
- std::string ErrorInfo;
- tool_output_file Out2(OutputFilename.c_str(), ErrorInfo);
- if (!ErrorInfo.empty())
- PrintAndExit(ErrorInfo, M);
-
- Out2.os() << "#!/bin/sh\n";
- // Allow user to setenv LLVMINTERP if lli is not in their PATH.
- Out2.os() << "lli=${LLVMINTERP-lli}\n";
- Out2.os() << "exec $lli \\\n";
- // gcc accepts -l<lib> and implicitly searches /lib and /usr/lib.
- LibPaths.push_back("/lib");
- LibPaths.push_back("/usr/lib");
- LibPaths.push_back("/usr/X11R6/lib");
- // We don't need to link in libc! In fact, /usr/lib/libc.so may not be a
- // shared object at all! See RH 8: plain text.
- std::vector<std::string>::iterator libc =
- std::find(Libraries.begin(), Libraries.end(), "c");
- if (libc != Libraries.end()) Libraries.erase(libc);
- // List all the shared object (native) libraries this executable will need
- // on the command line, so that we don't have to do this manually!
- for (std::vector<std::string>::iterator i = Libraries.begin(),
- e = Libraries.end(); i != e; ++i) {
- // try explicit -L arguments first:
- sys::Path FullLibraryPath;
- for (cl::list<std::string>::const_iterator P = LibPaths.begin(),
- E = LibPaths.end(); P != E; ++P) {
- FullLibraryPath = *P;
- FullLibraryPath.appendComponent("lib" + *i);
- FullLibraryPath.appendSuffix(&(LTDL_SHLIB_EXT[1]));
- if (!FullLibraryPath.isEmpty()) {
- if (!FullLibraryPath.isDynamicLibrary()) {
- // Not a native shared library; mark as invalid
- FullLibraryPath = sys::Path();
- } else break;
- }
- }
- if (FullLibraryPath.isEmpty())
- FullLibraryPath = sys::Path::FindLibrary(*i);
- if (!FullLibraryPath.isEmpty())
- Out2.os() << " -load=" << FullLibraryPath.str() << " \\\n";
- }
- Out2.os() << " " << BitcodeOutputFilename << " ${1+\"$@\"}\n";
- Out2.keep();
-}
-
-// BuildLinkItems -- This function generates a LinkItemList for the LinkItems
-// linker function by combining the Files and Libraries in the order they were
-// declared on the command line.
-static void BuildLinkItems(
- Linker::ItemList& Items,
- const cl::list<std::string>& Files,
- const cl::list<std::string>& Libraries) {
-
- // Build the list of linkage items for LinkItems.
-
- cl::list<std::string>::const_iterator fileIt = Files.begin();
- cl::list<std::string>::const_iterator libIt = Libraries.begin();
-
- int libPos = -1, filePos = -1;
- while ( libIt != Libraries.end() || fileIt != Files.end() ) {
- if (libIt != Libraries.end())
- libPos = Libraries.getPosition(libIt - Libraries.begin());
- else
- libPos = -1;
- if (fileIt != Files.end())
- filePos = Files.getPosition(fileIt - Files.begin());
- else
- filePos = -1;
-
- if (filePos != -1 && (libPos == -1 || filePos < libPos)) {
- // Add a source file
- Items.push_back(std::make_pair(*fileIt++, false));
- } else if (libPos != -1 && (filePos == -1 || libPos < filePos)) {
- // Add a library
- Items.push_back(std::make_pair(*libIt++, true));
- }
- }
-}
-
-int main(int argc, char **argv, char **envp) {
- // 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.
-
- // Initial global variable above for convenience printing of program name.
- progname = sys::Path(argv[0]).getBasename();
-
- // Parse the command line options
- cl::ParseCommandLineOptions(argc, argv, "llvm linker\n");
-
-#if defined(_WIN32) || defined(__CYGWIN__)
- if (!LinkAsLibrary) {
- // Default to "a.exe" instead of "a.out".
- if (OutputFilename.getNumOccurrences() == 0)
- OutputFilename = "a.exe";
-
- // If there is no suffix add an "exe" one.
- sys::Path ExeFile( OutputFilename );
- if (ExeFile.getSuffix() == "") {
- ExeFile.appendSuffix("exe");
- OutputFilename = ExeFile.str();
- }
- }
-#endif
-
- // Generate the bitcode for the optimized module.
- // If -b wasn't specified, use the name specified
- // with -o to construct BitcodeOutputFilename.
- if (BitcodeOutputFilename.empty()) {
- BitcodeOutputFilename = OutputFilename;
- if (!LinkAsLibrary) BitcodeOutputFilename += ".bc";
- }
-
- // Arrange for the bitcode output file to be deleted on any errors.
- BitcodeOutputRemover.setFile(sys::Path(BitcodeOutputFilename));
- sys::RemoveFileOnSignal(sys::Path(BitcodeOutputFilename));
-
- // Arrange for the output file to be deleted on any errors.
- if (!LinkAsLibrary) {
- OutputRemover.setFile(sys::Path(OutputFilename));
- sys::RemoveFileOnSignal(sys::Path(OutputFilename));
- }
-
- // Construct a Linker (now that Verbose is set)
- Linker TheLinker(progname, OutputFilename, Context, Verbose);
-
- // Keep track of the native link items (versus the bitcode items)
- Linker::ItemList NativeLinkItems;
-
- // Add library paths to the linker
- TheLinker.addPaths(LibPaths);
- TheLinker.addSystemPaths();
-
- // Remove any consecutive duplicates of the same library...
- Libraries.erase(std::unique(Libraries.begin(), Libraries.end()),
- Libraries.end());
-
- if (LinkAsLibrary) {
- std::vector<sys::Path> Files;
- for (unsigned i = 0; i < InputFilenames.size(); ++i )
- Files.push_back(sys::Path(InputFilenames[i]));
- if (TheLinker.LinkInFiles(Files))
- return 1; // Error already printed
-
- // The libraries aren't linked in but are noted as "dependent" in the
- // module.
- for (cl::list<std::string>::const_iterator I = Libraries.begin(),
- E = Libraries.end(); I != E ; ++I) {
- TheLinker.getModule()->addLibrary(*I);
- }
- } else {
- // Build a list of the items from our command line
- Linker::ItemList Items;
- BuildLinkItems(Items, InputFilenames, Libraries);
-
- // Link all the items together
- if (TheLinker.LinkInItems(Items, NativeLinkItems) )
- return 1; // Error already printed
- }
-
- std::auto_ptr<Module> Composite(TheLinker.releaseModule());
-
- // Optimize the module
- Optimize(Composite.get());
-
- // Generate the bitcode output.
- GenerateBitcode(Composite.get(), BitcodeOutputFilename);
-
- // If we are not linking a library, generate either a native executable
- // or a JIT shell script, depending upon what the user wants.
- if (!LinkAsLibrary) {
- // If the user wants to run a post-link optimization, run it now.
- if (!PostLinkOpts.empty()) {
- std::vector<std::string> opts = PostLinkOpts;
- for (std::vector<std::string>::iterator I = opts.begin(),
- E = opts.end(); I != E; ++I) {
- sys::Path prog(*I);
- if (!prog.canExecute()) {
- prog = sys::Program::FindProgramByName(*I);
- if (prog.isEmpty())
- PrintAndExit(std::string("Optimization program '") + *I +
- "' is not found or not executable.", Composite.get());
- }
- // Get the program arguments
- sys::Path tmp_output("opt_result");
- std::string ErrMsg;
- if (tmp_output.createTemporaryFileOnDisk(true, &ErrMsg))
- PrintAndExit(ErrMsg, Composite.get());
-
- const char* args[4];
- args[0] = I->c_str();
- args[1] = BitcodeOutputFilename.c_str();
- args[2] = tmp_output.c_str();
- args[3] = 0;
- if (0 == sys::Program::ExecuteAndWait(prog, args, 0,0,0,0, &ErrMsg)) {
- if (tmp_output.isBitcodeFile()) {
- sys::Path target(BitcodeOutputFilename);
- target.eraseFromDisk();
- if (tmp_output.renamePathOnDisk(target, &ErrMsg))
- PrintAndExit(ErrMsg, Composite.get(), 2);
- } else
- PrintAndExit("Post-link optimization output is not bitcode",
- Composite.get());
- } else {
- PrintAndExit(ErrMsg, Composite.get());
- }
- }
- }
-
- // If the user wants to generate a native executable, compile it from the
- // bitcode file.
- //
- // Otherwise, create a script that will run the bitcode through the JIT.
- if (Native) {
- // Name of the Assembly Language output file
- sys::Path AssemblyFile ( OutputFilename);
- AssemblyFile.appendSuffix("s");
-
- // Mark the output files for removal.
- FileRemover AssemblyFileRemover(AssemblyFile);
- sys::RemoveFileOnSignal(AssemblyFile);
-
- // Determine the locations of the llc and gcc programs.
- sys::Path llc = FindExecutable("llc", argv[0],
- (void *)(intptr_t)&Optimize);
- if (llc.isEmpty())
- PrintAndExit("Failed to find llc", Composite.get());
-
- sys::Path gcc = sys::Program::FindProgramByName("gcc");
- if (gcc.isEmpty())
- PrintAndExit("Failed to find gcc", Composite.get());
-
- // Generate an assembly language file for the bitcode.
- std::string ErrMsg;
- if (0 != GenerateAssembly(AssemblyFile.str(), BitcodeOutputFilename,
- llc, ErrMsg))
- PrintAndExit(ErrMsg, Composite.get());
-
- if (0 != GenerateNative(OutputFilename, AssemblyFile.str(),
- NativeLinkItems, gcc, envp, ErrMsg))
- PrintAndExit(ErrMsg, Composite.get());
- } else if (NativeCBE) {
- sys::Path CFile (OutputFilename);
- CFile.appendSuffix("cbe.c");
-
- // Mark the output files for removal.
- FileRemover CFileRemover(CFile);
- sys::RemoveFileOnSignal(CFile);
-
- // Determine the locations of the llc and gcc programs.
- sys::Path llc = FindExecutable("llc", argv[0],
- (void *)(intptr_t)&Optimize);
- if (llc.isEmpty())
- PrintAndExit("Failed to find llc", Composite.get());
-
- sys::Path gcc = sys::Program::FindProgramByName("gcc");
- if (gcc.isEmpty())
- PrintAndExit("Failed to find gcc", Composite.get());
-
- // Generate an assembly language file for the bitcode.
- std::string ErrMsg;
- if (GenerateCFile(CFile.str(), BitcodeOutputFilename, llc, ErrMsg))
- PrintAndExit(ErrMsg, Composite.get());
-
- if (GenerateNative(OutputFilename, CFile.str(),
- NativeLinkItems, gcc, envp, ErrMsg))
- PrintAndExit(ErrMsg, Composite.get());
- } else {
- EmitShellScript(argv, Composite.get());
- }
-
- // Make the script executable...
- std::string ErrMsg;
- if (sys::Path(OutputFilename).makeExecutableOnDisk(&ErrMsg))
- PrintAndExit(ErrMsg, Composite.get());
-
- // Make the bitcode file readable and directly executable in LLEE as well
- if (sys::Path(BitcodeOutputFilename).makeExecutableOnDisk(&ErrMsg))
- PrintAndExit(ErrMsg, Composite.get());
-
- if (sys::Path(BitcodeOutputFilename).makeReadableOnDisk(&ErrMsg))
- PrintAndExit(ErrMsg, Composite.get());
- }
-
- // Operations which may fail are now complete.
- BitcodeOutputRemover.releaseFile();
- if (!LinkAsLibrary)
- OutputRemover.releaseFile();
-
- // Graceful exit
- return 0;
-}
diff --git a/contrib/llvm/tools/llvm-link/CMakeLists.txt b/contrib/llvm/tools/llvm-link/CMakeLists.txt
deleted file mode 100644
index 11933f7..0000000
--- a/contrib/llvm/tools/llvm-link/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-set(LLVM_LINK_COMPONENTS linker bitreader bitwriter asmparser)
-
-add_llvm_tool(llvm-link
- llvm-link.cpp
- )
diff --git a/contrib/llvm/tools/llvm-link/Makefile b/contrib/llvm/tools/llvm-link/Makefile
deleted file mode 100644
index 2637018..0000000
--- a/contrib/llvm/tools/llvm-link/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-##===- tools/llvm-link/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-link
-LINK_COMPONENTS = linker bitreader bitwriter asmparser
-
-# This tool has no plugins, optimize startup time.
-TOOL_NO_EXPORTS = 1
-
-include $(LEVEL)/Makefile.common
diff --git a/contrib/llvm/tools/llvm-link/llvm-link.cpp b/contrib/llvm/tools/llvm-link/llvm-link.cpp
deleted file mode 100644
index e55d0de..0000000
--- a/contrib/llvm/tools/llvm-link/llvm-link.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-//===- llvm-link.cpp - Low-level LLVM linker ------------------------------===//
-//
-// 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-link a.bc b.bc c.bc -o x.bc
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Linker.h"
-#include "llvm/LLVMContext.h"
-#include "llvm/Module.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/raw_ostream.h"
-#include "llvm/Support/SystemUtils.h"
-#include "llvm/Support/IRReader.h"
-#include "llvm/System/Signals.h"
-#include "llvm/System/Path.h"
-#include <memory>
-using namespace llvm;
-
-static cl::list<std::string>
-InputFilenames(cl::Positional, cl::OneOrMore,
- cl::desc("<input bitcode files>"));
-
-static cl::opt<std::string>
-OutputFilename("o", cl::desc("Override output filename"), cl::init("-"),
- cl::value_desc("filename"));
-
-static cl::opt<bool>
-Force("f", cl::desc("Enable binary output on terminals"));
-
-static cl::opt<bool>
-OutputAssembly("S",
- cl::desc("Write output as LLVM assembly"), cl::Hidden);
-
-static cl::opt<bool>
-Verbose("v", cl::desc("Print information about actions taken"));
-
-static cl::opt<bool>
-DumpAsm("d", cl::desc("Print assembly as linked"), cl::Hidden);
-
-// LoadFile - Read the specified bitcode file in and return it. This routine
-// searches the link path for the specified file to try to find it...
-//
-static inline std::auto_ptr<Module> LoadFile(const char *argv0,
- const std::string &FN,
- LLVMContext& Context) {
- sys::Path Filename;
- if (!Filename.set(FN)) {
- errs() << "Invalid file name: '" << FN << "'\n";
- return std::auto_ptr<Module>();
- }
-
- SMDiagnostic Err;
- if (Verbose) errs() << "Loading '" << Filename.c_str() << "'\n";
- Module* Result = 0;
-
- const std::string &FNStr = Filename.str();
- Result = ParseIRFile(FNStr, Err, Context);
- if (Result) return std::auto_ptr<Module>(Result); // Load successful!
-
- Err.Print(argv0, errs());
- return std::auto_ptr<Module>();
-}
-
-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 linker\n");
-
- unsigned BaseArg = 0;
- std::string ErrorMessage;
-
- std::auto_ptr<Module> Composite(LoadFile(argv[0],
- InputFilenames[BaseArg], Context));
- if (Composite.get() == 0) {
- errs() << argv[0] << ": error loading file '"
- << InputFilenames[BaseArg] << "'\n";
- return 1;
- }
-
- for (unsigned i = BaseArg+1; i < InputFilenames.size(); ++i) {
- std::auto_ptr<Module> M(LoadFile(argv[0],
- InputFilenames[i], Context));
- if (M.get() == 0) {
- errs() << argv[0] << ": error loading file '" <<InputFilenames[i]<< "'\n";
- return 1;
- }
-
- if (Verbose) errs() << "Linking in '" << InputFilenames[i] << "'\n";
-
- if (Linker::LinkModules(Composite.get(), M.get(), &ErrorMessage)) {
- errs() << argv[0] << ": link error in '" << InputFilenames[i]
- << "': " << ErrorMessage << "\n";
- return 1;
- }
- }
-
- // TODO: Iterate over the -l list and link in any modules containing
- // global symbols that have not been resolved so far.
-
- if (DumpAsm) errs() << "Here's the assembly:\n" << *Composite;
-
- std::string ErrorInfo;
- tool_output_file Out(OutputFilename.c_str(), ErrorInfo,
- raw_fd_ostream::F_Binary);
- if (!ErrorInfo.empty()) {
- errs() << ErrorInfo << '\n';
- return 1;
- }
-
- if (verifyModule(*Composite)) {
- errs() << argv[0] << ": linked module is broken!\n";
- return 1;
- }
-
- if (Verbose) errs() << "Writing bitcode...\n";
- if (OutputAssembly) {
- Out.os() << *Composite;
- } else if (Force || !CheckBitcodeOutputToConsole(Out.os(), true))
- WriteBitcodeToFile(Composite.get(), Out.os());
-
- // Declare success.
- Out.keep();
-
- return 0;
-}
diff --git a/contrib/llvm/tools/llvm-mc/CMakeLists.txt b/contrib/llvm/tools/llvm-mc/CMakeLists.txt
deleted file mode 100644
index 805caf4..0000000
--- a/contrib/llvm/tools/llvm-mc/CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} support MC MCParser MCDisassembler)
-
-add_llvm_tool(llvm-mc
- llvm-mc.cpp
- Disassembler.cpp
- )
diff --git a/contrib/llvm/tools/llvm-mc/Disassembler.cpp b/contrib/llvm/tools/llvm-mc/Disassembler.cpp
deleted file mode 100644
index 13080b4..0000000
--- a/contrib/llvm/tools/llvm-mc/Disassembler.cpp
+++ /dev/null
@@ -1,338 +0,0 @@
-//===- Disassembler.cpp - Disassembler for hex strings --------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This class implements the disassembler of strings of bytes written in
-// hexadecimal, from standard input or from a file.
-//
-//===----------------------------------------------------------------------===//
-
-#include "Disassembler.h"
-#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/MC/MCAsmInfo.h"
-#include "llvm/MC/MCDisassembler.h"
-#include "llvm/MC/MCInst.h"
-#include "llvm/MC/MCInstPrinter.h"
-#include "llvm/Target/TargetRegistry.h"
-#include "llvm/ADT/OwningPtr.h"
-#include "llvm/ADT/Triple.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/MemoryObject.h"
-#include "llvm/Support/raw_ostream.h"
-#include "llvm/Support/SourceMgr.h"
-using namespace llvm;
-
-typedef std::vector<std::pair<unsigned char, const char*> > ByteArrayTy;
-
-namespace {
-class VectorMemoryObject : public MemoryObject {
-private:
- const ByteArrayTy &Bytes;
-public:
- VectorMemoryObject(const ByteArrayTy &bytes) : Bytes(bytes) {}
-
- uint64_t getBase() const { return 0; }
- uint64_t getExtent() const { return Bytes.size(); }
-
- int readByte(uint64_t Addr, uint8_t *Byte) const {
- if (Addr > getExtent())
- return -1;
- *Byte = Bytes[Addr].first;
- return 0;
- }
-};
-}
-
-static bool PrintInsts(const MCDisassembler &DisAsm,
- MCInstPrinter &Printer, const ByteArrayTy &Bytes,
- SourceMgr &SM, raw_ostream &Out) {
- // Wrap the vector in a MemoryObject.
- VectorMemoryObject memoryObject(Bytes);
-
- // Disassemble it to strings.
- uint64_t Size;
- uint64_t Index;
-
- for (Index = 0; Index < Bytes.size(); Index += Size) {
- MCInst Inst;
-
- if (DisAsm.getInstruction(Inst, Size, memoryObject, Index,
- /*REMOVE*/ nulls())) {
- Printer.printInst(&Inst, Out);
- Out << "\n";
- } else {
- SM.PrintMessage(SMLoc::getFromPointer(Bytes[Index].second),
- "invalid instruction encoding", "warning");
- if (Size == 0)
- Size = 1; // skip illegible bytes
- }
- }
-
- return false;
-}
-
-static bool ByteArrayFromString(ByteArrayTy &ByteArray,
- StringRef &Str,
- SourceMgr &SM) {
- while (!Str.empty()) {
- // Strip horizontal whitespace.
- if (size_t Pos = Str.find_first_not_of(" \t\r")) {
- Str = Str.substr(Pos);
- continue;
- }
-
- // If this is the end of a line or start of a comment, remove the rest of
- // the line.
- if (Str[0] == '\n' || Str[0] == '#') {
- // Strip to the end of line if we already processed any bytes on this
- // line. This strips the comment and/or the \n.
- if (Str[0] == '\n') {
- Str = Str.substr(1);
- } else {
- Str = Str.substr(Str.find_first_of('\n'));
- if (!Str.empty())
- Str = Str.substr(1);
- }
- continue;
- }
-
- // Get the current token.
- size_t Next = Str.find_first_of(" \t\n\r#");
- StringRef Value = Str.substr(0, Next);
-
- // Convert to a byte and add to the byte vector.
- unsigned ByteVal;
- if (Value.getAsInteger(0, ByteVal) || ByteVal > 255) {
- // If we have an error, print it and skip to the end of line.
- SM.PrintMessage(SMLoc::getFromPointer(Value.data()),
- "invalid input token", "error");
- Str = Str.substr(Str.find('\n'));
- ByteArray.clear();
- continue;
- }
-
- ByteArray.push_back(std::make_pair((unsigned char)ByteVal, Value.data()));
- Str = Str.substr(Next);
- }
-
- return false;
-}
-
-int Disassembler::disassemble(const Target &T, const std::string &Triple,
- MemoryBuffer &Buffer,
- raw_ostream &Out) {
- // Set up disassembler.
- OwningPtr<const MCAsmInfo> AsmInfo(T.createAsmInfo(Triple));
-
- if (!AsmInfo) {
- errs() << "error: no assembly info for target " << Triple << "\n";
- return -1;
- }
-
- OwningPtr<const MCDisassembler> DisAsm(T.createMCDisassembler());
- if (!DisAsm) {
- errs() << "error: no disassembler for target " << Triple << "\n";
- return -1;
- }
-
- int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
- OwningPtr<MCInstPrinter> IP(T.createMCInstPrinter(AsmPrinterVariant,
- *AsmInfo));
- if (!IP) {
- errs() << "error: no instruction printer for target " << Triple << '\n';
- return -1;
- }
-
- bool ErrorOccurred = false;
-
- SourceMgr SM;
- SM.AddNewSourceBuffer(&Buffer, SMLoc());
-
- // Convert the input to a vector for disassembly.
- ByteArrayTy ByteArray;
- StringRef Str = Buffer.getBuffer();
-
- ErrorOccurred |= ByteArrayFromString(ByteArray, Str, SM);
-
- if (!ByteArray.empty())
- ErrorOccurred |= PrintInsts(*DisAsm, *IP, ByteArray, SM, Out);
-
- return ErrorOccurred;
-}
-
-static int byteArrayReader(uint8_t *B, uint64_t A, void *Arg) {
- ByteArrayTy &ByteArray = *((ByteArrayTy*)Arg);
-
- if (A >= ByteArray.size())
- return -1;
-
- *B = ByteArray[A].first;
-
- return 0;
-}
-
-static int verboseEvaluator(uint64_t *V, unsigned R, void *Arg) {
- EDDisassembler &disassembler = *(EDDisassembler *)((void **)Arg)[0];
- raw_ostream &Out = *(raw_ostream *)((void **)Arg)[1];
-
- if (const char *regName = disassembler.nameWithRegisterID(R))
- Out << "[" << regName << "/" << R << "]";
-
- if (disassembler.registerIsStackPointer(R))
- Out << "(sp)";
- if (disassembler.registerIsProgramCounter(R))
- Out << "(pc)";
-
- *V = 0;
- return 0;
-}
-
-int Disassembler::disassembleEnhanced(const std::string &TS,
- MemoryBuffer &Buffer,
- raw_ostream &Out) {
- ByteArrayTy ByteArray;
- StringRef Str = Buffer.getBuffer();
- SourceMgr SM;
-
- SM.AddNewSourceBuffer(&Buffer, SMLoc());
-
- if (ByteArrayFromString(ByteArray, Str, SM)) {
- return -1;
- }
-
- Triple T(TS);
- EDDisassembler::AssemblySyntax AS;
-
- switch (T.getArch()) {
- default:
- errs() << "error: no default assembly syntax for " << TS.c_str() << "\n";
- return -1;
- case Triple::arm:
- case Triple::thumb:
- AS = EDDisassembler::kEDAssemblySyntaxARMUAL;
- break;
- case Triple::x86:
- case Triple::x86_64:
- AS = EDDisassembler::kEDAssemblySyntaxX86ATT;
- break;
- }
-
- EDDisassembler::initialize();
- EDDisassembler *disassembler =
- EDDisassembler::getDisassembler(TS.c_str(), AS);
-
- if (disassembler == 0) {
- errs() << "error: couldn't get disassembler for " << TS << '\n';
- return -1;
- }
-
- EDInst *inst =
- disassembler->createInst(byteArrayReader, 0, &ByteArray);
-
- if (inst == 0) {
- errs() << "error: Didn't get an instruction\n";
- return -1;
- }
-
- unsigned numTokens = inst->numTokens();
- if ((int)numTokens < 0) {
- errs() << "error: couldn't count the instruction's tokens\n";
- return -1;
- }
-
- for (unsigned tokenIndex = 0; tokenIndex != numTokens; ++tokenIndex) {
- EDToken *token;
-
- if (inst->getToken(token, tokenIndex)) {
- errs() << "error: Couldn't get token\n";
- return -1;
- }
-
- const char *buf;
- if (token->getString(buf)) {
- errs() << "error: Couldn't get string for token\n";
- return -1;
- }
-
- Out << '[';
- int operandIndex = token->operandID();
-
- if (operandIndex >= 0)
- Out << operandIndex << "-";
-
- switch (token->type()) {
- default: Out << "?"; break;
- case EDToken::kTokenWhitespace: Out << "w"; break;
- case EDToken::kTokenPunctuation: Out << "p"; break;
- case EDToken::kTokenOpcode: Out << "o"; break;
- case EDToken::kTokenLiteral: Out << "l"; break;
- case EDToken::kTokenRegister: Out << "r"; break;
- }
-
- Out << ":" << buf;
-
- if (token->type() == EDToken::kTokenLiteral) {
- Out << "=";
- if (token->literalSign())
- Out << "-";
- uint64_t absoluteValue;
- if (token->literalAbsoluteValue(absoluteValue)) {
- errs() << "error: Couldn't get the value of a literal token\n";
- return -1;
- }
- Out << absoluteValue;
- } else if (token->type() == EDToken::kTokenRegister) {
- Out << "=";
- unsigned regID;
- if (token->registerID(regID)) {
- errs() << "error: Couldn't get the ID of a register token\n";
- return -1;
- }
- Out << "r" << regID;
- }
-
- Out << "]";
- }
-
- Out << " ";
-
- if (inst->isBranch())
- Out << "<br> ";
- if (inst->isMove())
- Out << "<mov> ";
-
- unsigned numOperands = inst->numOperands();
-
- if ((int)numOperands < 0) {
- errs() << "error: Couldn't count operands\n";
- return -1;
- }
-
- for (unsigned operandIndex = 0; operandIndex != numOperands; ++operandIndex) {
- Out << operandIndex << ":";
-
- EDOperand *operand;
- if (inst->getOperand(operand, operandIndex)) {
- errs() << "error: couldn't get operand\n";
- return -1;
- }
-
- uint64_t evaluatedResult;
- void *Arg[] = { disassembler, &Out };
- evaluatedResult = operand->evaluate(evaluatedResult, verboseEvaluator, Arg);
- Out << "=" << evaluatedResult << " ";
- }
-
- Out << '\n';
-
- return 0;
-}
-
diff --git a/contrib/llvm/tools/llvm-mc/Disassembler.h b/contrib/llvm/tools/llvm-mc/Disassembler.h
deleted file mode 100644
index b56f2e9..0000000
--- a/contrib/llvm/tools/llvm-mc/Disassembler.h
+++ /dev/null
@@ -1,40 +0,0 @@
-//===- Disassembler.h - Text File Disassembler ----------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This class implements the disassembler of strings of bytes written in
-// hexadecimal, from standard input or from a file.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef DISASSEMBLER_H
-#define DISASSEMBLER_H
-
-#include <string>
-
-namespace llvm {
-
-class Target;
-class MemoryBuffer;
-class raw_ostream;
-
-class Disassembler {
-public:
- static int disassemble(const Target &target,
- const std::string &tripleString,
- MemoryBuffer &buffer,
- raw_ostream &Out);
-
- static int disassembleEnhanced(const std::string &tripleString,
- MemoryBuffer &buffer,
- raw_ostream &Out);
-};
-
-} // namespace llvm
-
-#endif
diff --git a/contrib/llvm/tools/llvm-mc/Makefile b/contrib/llvm/tools/llvm-mc/Makefile
deleted file mode 100644
index 934a6e4..0000000
--- a/contrib/llvm/tools/llvm-mc/Makefile
+++ /dev/null
@@ -1,24 +0,0 @@
-##===- tools/llvm-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 = ../..
-TOOLNAME = llvm-mc
-
-# This tool has no plugins, optimize startup time.
-TOOL_NO_EXPORTS = 1
-
-# 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) MCDisassembler MCParser MC support
-
-include $(LLVM_SRC_ROOT)/Makefile.rules
-
diff --git a/contrib/llvm/tools/llvm-mc/llvm-mc.cpp b/contrib/llvm/tools/llvm-mc/llvm-mc.cpp
deleted file mode 100644
index aef0a3d..0000000
--- a/contrib/llvm/tools/llvm-mc/llvm-mc.cpp
+++ /dev/null
@@ -1,410 +0,0 @@
-//===-- llvm-mc.cpp - Machine Code Hacking Driver -------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This utility is a simple driver that allows command line hacking on machine
-// code.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/MC/MCParser/AsmLexer.h"
-#include "llvm/MC/MCParser/MCAsmLexer.h"
-#include "llvm/MC/MCContext.h"
-#include "llvm/MC/MCCodeEmitter.h"
-#include "llvm/MC/MCInstPrinter.h"
-#include "llvm/MC/MCSectionMachO.h"
-#include "llvm/MC/MCStreamer.h"
-#include "llvm/Target/TargetAsmBackend.h"
-#include "llvm/Target/TargetAsmParser.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetRegistry.h"
-#include "llvm/Target/TargetMachine.h" // FIXME.
-#include "llvm/Target/TargetSelect.h"
-#include "llvm/ADT/OwningPtr.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/FileUtilities.h"
-#include "llvm/Support/FormattedStream.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/PrettyStackTrace.h"
-#include "llvm/Support/SourceMgr.h"
-#include "llvm/Support/raw_ostream.h"
-#include "llvm/System/Host.h"
-#include "llvm/System/Signals.h"
-#include "Disassembler.h"
-using namespace llvm;
-
-static cl::opt<std::string>
-InputFilename(cl::Positional, cl::desc("<input file>"), cl::init("-"));
-
-static cl::opt<std::string>
-OutputFilename("o", cl::desc("Output filename"),
- cl::value_desc("filename"));
-
-static cl::opt<bool>
-ShowEncoding("show-encoding", cl::desc("Show instruction encodings"));
-
-static cl::opt<bool>
-ShowInst("show-inst", cl::desc("Show internal instruction representation"));
-
-static cl::opt<bool>
-ShowInstOperands("show-inst-operands",
- cl::desc("Show instructions operands as parsed"));
-
-static cl::opt<unsigned>
-OutputAsmVariant("output-asm-variant",
- cl::desc("Syntax variant to use for output printing"));
-
-static cl::opt<bool>
-RelaxAll("mc-relax-all", cl::desc("Relax all fixups"));
-
-static cl::opt<bool>
-EnableLogging("enable-api-logging", cl::desc("Enable MC API logging"));
-
-enum OutputFileType {
- OFT_Null,
- OFT_AssemblyFile,
- OFT_ObjectFile
-};
-static cl::opt<OutputFileType>
-FileType("filetype", cl::init(OFT_AssemblyFile),
- cl::desc("Choose an output file type:"),
- cl::values(
- clEnumValN(OFT_AssemblyFile, "asm",
- "Emit an assembly ('.s') file"),
- clEnumValN(OFT_Null, "null",
- "Don't emit anything (for timing purposes)"),
- clEnumValN(OFT_ObjectFile, "obj",
- "Emit a native object ('.o') file"),
- clEnumValEnd));
-
-static cl::list<std::string>
-IncludeDirs("I", cl::desc("Directory of include files"),
- cl::value_desc("directory"), cl::Prefix);
-
-static cl::opt<std::string>
-ArchName("arch", cl::desc("Target arch to assemble for, "
- "see -version for available targets"));
-
-static cl::opt<std::string>
-TripleName("triple", cl::desc("Target triple to assemble for, "
- "see -version for available targets"));
-
-static cl::opt<bool>
-NoInitialTextSection("n", cl::desc(
- "Don't assume assembly file starts in the text section"));
-
-enum ActionType {
- AC_AsLex,
- AC_Assemble,
- AC_Disassemble,
- AC_EDisassemble
-};
-
-static cl::opt<ActionType>
-Action(cl::desc("Action to perform:"),
- cl::init(AC_Assemble),
- cl::values(clEnumValN(AC_AsLex, "as-lex",
- "Lex tokens from a .s file"),
- clEnumValN(AC_Assemble, "assemble",
- "Assemble a .s file (default)"),
- clEnumValN(AC_Disassemble, "disassemble",
- "Disassemble strings of hex bytes"),
- clEnumValN(AC_EDisassemble, "edis",
- "Enhanced disassembly of strings of hex bytes"),
- clEnumValEnd));
-
-static const Target *GetTarget(const char *ProgName) {
- // Figure out the target triple.
- if (TripleName.empty())
- TripleName = sys::getHostTriple();
- if (!ArchName.empty()) {
- llvm::Triple TT(TripleName);
- TT.setArchName(ArchName);
- TripleName = TT.str();
- }
-
- // Get the target specific parser.
- std::string Error;
- const Target *TheTarget = TargetRegistry::lookupTarget(TripleName, Error);
- if (TheTarget)
- return TheTarget;
-
- errs() << ProgName << ": error: unable to get target for '" << TripleName
- << "', see --version and --triple.\n";
- return 0;
-}
-
-static tool_output_file *GetOutputStream() {
- if (OutputFilename == "")
- OutputFilename = "-";
-
- std::string Err;
- tool_output_file *Out = new tool_output_file(OutputFilename.c_str(), Err,
- raw_fd_ostream::F_Binary);
- if (!Err.empty()) {
- errs() << Err << '\n';
- delete Out;
- return 0;
- }
-
- return Out;
-}
-
-static int AsLexInput(const char *ProgName) {
- std::string ErrorMessage;
- MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(InputFilename,
- &ErrorMessage);
- if (Buffer == 0) {
- errs() << ProgName << ": ";
- if (ErrorMessage.size())
- errs() << ErrorMessage << "\n";
- else
- errs() << "input file didn't read correctly.\n";
- return 1;
- }
-
- SourceMgr SrcMgr;
-
- // Tell SrcMgr about this buffer, which is what TGParser will pick up.
- SrcMgr.AddNewSourceBuffer(Buffer, SMLoc());
-
- // Record the location of the include directories so that the lexer can find
- // it later.
- SrcMgr.setIncludeDirs(IncludeDirs);
-
- const Target *TheTarget = GetTarget(ProgName);
- if (!TheTarget)
- return 1;
-
- llvm::OwningPtr<MCAsmInfo> MAI(TheTarget->createAsmInfo(TripleName));
- assert(MAI && "Unable to create target asm info!");
-
- AsmLexer Lexer(*MAI);
- Lexer.setBuffer(SrcMgr.getMemoryBuffer(0));
-
- OwningPtr<tool_output_file> Out(GetOutputStream());
- if (!Out)
- return 1;
-
- bool Error = false;
- while (Lexer.Lex().isNot(AsmToken::Eof)) {
- switch (Lexer.getKind()) {
- default:
- SrcMgr.PrintMessage(Lexer.getLoc(), "unknown token", "warning");
- Error = true;
- break;
- case AsmToken::Error:
- Error = true; // error already printed.
- break;
- case AsmToken::Identifier:
- Out->os() << "identifier: " << Lexer.getTok().getString() << '\n';
- break;
- case AsmToken::String:
- Out->os() << "string: " << Lexer.getTok().getString() << '\n';
- break;
- case AsmToken::Integer:
- Out->os() << "int: " << Lexer.getTok().getString() << '\n';
- break;
-
- case AsmToken::Amp: Out->os() << "Amp\n"; break;
- case AsmToken::AmpAmp: Out->os() << "AmpAmp\n"; break;
- case AsmToken::Caret: Out->os() << "Caret\n"; break;
- case AsmToken::Colon: Out->os() << "Colon\n"; break;
- case AsmToken::Comma: Out->os() << "Comma\n"; break;
- case AsmToken::Dollar: Out->os() << "Dollar\n"; break;
- case AsmToken::EndOfStatement: Out->os() << "EndOfStatement\n"; break;
- case AsmToken::Eof: Out->os() << "Eof\n"; break;
- case AsmToken::Equal: Out->os() << "Equal\n"; break;
- case AsmToken::EqualEqual: Out->os() << "EqualEqual\n"; break;
- case AsmToken::Exclaim: Out->os() << "Exclaim\n"; break;
- case AsmToken::ExclaimEqual: Out->os() << "ExclaimEqual\n"; break;
- case AsmToken::Greater: Out->os() << "Greater\n"; break;
- case AsmToken::GreaterEqual: Out->os() << "GreaterEqual\n"; break;
- case AsmToken::GreaterGreater: Out->os() << "GreaterGreater\n"; break;
- case AsmToken::LParen: Out->os() << "LParen\n"; break;
- case AsmToken::Less: Out->os() << "Less\n"; break;
- case AsmToken::LessEqual: Out->os() << "LessEqual\n"; break;
- case AsmToken::LessGreater: Out->os() << "LessGreater\n"; break;
- case AsmToken::LessLess: Out->os() << "LessLess\n"; break;
- case AsmToken::Minus: Out->os() << "Minus\n"; break;
- case AsmToken::Percent: Out->os() << "Percent\n"; break;
- case AsmToken::Pipe: Out->os() << "Pipe\n"; break;
- case AsmToken::PipePipe: Out->os() << "PipePipe\n"; break;
- case AsmToken::Plus: Out->os() << "Plus\n"; break;
- case AsmToken::RParen: Out->os() << "RParen\n"; break;
- case AsmToken::Slash: Out->os() << "Slash\n"; break;
- case AsmToken::Star: Out->os() << "Star\n"; break;
- case AsmToken::Tilde: Out->os() << "Tilde\n"; break;
- }
- }
-
- // Keep output if no errors.
- if (Error == 0) Out->keep();
-
- return Error;
-}
-
-static int AssembleInput(const char *ProgName) {
- const Target *TheTarget = GetTarget(ProgName);
- if (!TheTarget)
- return 1;
-
- std::string Error;
- MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(InputFilename, &Error);
- if (Buffer == 0) {
- errs() << ProgName << ": ";
- if (Error.size())
- errs() << Error << "\n";
- else
- errs() << "input file didn't read correctly.\n";
- return 1;
- }
-
- SourceMgr SrcMgr;
-
- // Tell SrcMgr about this buffer, which is what the parser will pick up.
- SrcMgr.AddNewSourceBuffer(Buffer, SMLoc());
-
- // Record the location of the include directories so that the lexer can find
- // it later.
- SrcMgr.setIncludeDirs(IncludeDirs);
-
-
- llvm::OwningPtr<MCAsmInfo> MAI(TheTarget->createAsmInfo(TripleName));
- assert(MAI && "Unable to create target asm info!");
-
- MCContext Ctx(*MAI);
-
- // FIXME: We shouldn't need to do this (and link in codegen).
- OwningPtr<TargetMachine> TM(TheTarget->createTargetMachine(TripleName, ""));
-
- if (!TM) {
- errs() << ProgName << ": error: could not create target for triple '"
- << TripleName << "'.\n";
- return 1;
- }
-
- OwningPtr<tool_output_file> Out(GetOutputStream());
- if (!Out)
- return 1;
-
- formatted_raw_ostream FOS(Out->os());
- OwningPtr<MCStreamer> Str;
-
- if (FileType == OFT_AssemblyFile) {
- MCInstPrinter *IP =
- TheTarget->createMCInstPrinter(OutputAsmVariant, *MAI);
- MCCodeEmitter *CE = 0;
- if (ShowEncoding)
- CE = TheTarget->createCodeEmitter(*TM, Ctx);
- Str.reset(createAsmStreamer(Ctx, FOS,
- TM->getTargetData()->isLittleEndian(),
- /*asmverbose*/true, IP, CE, ShowInst));
- } else if (FileType == OFT_Null) {
- Str.reset(createNullStreamer(Ctx));
- } else {
- assert(FileType == OFT_ObjectFile && "Invalid file type!");
- MCCodeEmitter *CE = TheTarget->createCodeEmitter(*TM, Ctx);
- TargetAsmBackend *TAB = TheTarget->createAsmBackend(TripleName);
- Str.reset(TheTarget->createObjectStreamer(TripleName, Ctx, *TAB,
- FOS, CE, RelaxAll));
- }
-
- if (EnableLogging) {
- Str.reset(createLoggingStreamer(Str.take(), errs()));
- }
-
- OwningPtr<MCAsmParser> Parser(createMCAsmParser(*TheTarget, SrcMgr, Ctx,
- *Str.get(), *MAI));
- OwningPtr<TargetAsmParser> TAP(TheTarget->createAsmParser(*Parser, *TM));
- if (!TAP) {
- errs() << ProgName
- << ": error: this target does not support assembly parsing.\n";
- return 1;
- }
-
- Parser->setShowParsedOperands(ShowInstOperands);
- Parser->setTargetParser(*TAP.get());
-
- int Res = Parser->Run(NoInitialTextSection);
-
- // Keep output if no errors.
- if (Res == 0) Out->keep();
-
- return Res;
-}
-
-static int DisassembleInput(const char *ProgName, bool Enhanced) {
- const Target *TheTarget = GetTarget(ProgName);
- if (!TheTarget)
- return 0;
-
- std::string ErrorMessage;
-
- MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(InputFilename,
- &ErrorMessage);
-
- if (Buffer == 0) {
- errs() << ProgName << ": ";
- if (ErrorMessage.size())
- errs() << ErrorMessage << "\n";
- else
- errs() << "input file didn't read correctly.\n";
- return 1;
- }
-
- OwningPtr<tool_output_file> Out(GetOutputStream());
- if (!Out)
- return 1;
-
- int Res;
- if (Enhanced)
- Res = Disassembler::disassembleEnhanced(TripleName, *Buffer, Out->os());
- else
- Res = Disassembler::disassemble(*TheTarget, TripleName, *Buffer, Out->os());
-
- // Keep output if no errors.
- if (Res == 0) Out->keep();
-
- return Res;
-}
-
-
-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.
-
- // Initialize targets and assembly printers/parsers.
- llvm::InitializeAllTargetInfos();
- // FIXME: We shouldn't need to initialize the Target(Machine)s.
- llvm::InitializeAllTargets();
- llvm::InitializeAllAsmPrinters();
- llvm::InitializeAllAsmParsers();
- llvm::InitializeAllDisassemblers();
-
- cl::ParseCommandLineOptions(argc, argv, "llvm machine code playground\n");
- TripleName = Triple::normalize(TripleName);
-
- switch (Action) {
- default:
- case AC_AsLex:
- return AsLexInput(argv[0]);
- case AC_Assemble:
- return AssembleInput(argv[0]);
- case AC_Disassemble:
- return DisassembleInput(argv[0], false);
- case AC_EDisassemble:
- return DisassembleInput(argv[0], true);
- }
-
- return 0;
-}
-
diff --git a/contrib/llvm/tools/llvm-nm/CMakeLists.txt b/contrib/llvm/tools/llvm-nm/CMakeLists.txt
deleted file mode 100644
index 45cf1b6..0000000
--- a/contrib/llvm/tools/llvm-nm/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-set(LLVM_LINK_COMPONENTS archive bitreader)
-
-add_llvm_tool(llvm-nm
- llvm-nm.cpp
- )
diff --git a/contrib/llvm/tools/llvm-nm/Makefile b/contrib/llvm/tools/llvm-nm/Makefile
deleted file mode 100644
index ecf5f8c..0000000
--- a/contrib/llvm/tools/llvm-nm/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-##===- tools/llvm-nm/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-nm
-LINK_COMPONENTS = archive bitreader
-
-# This tool has no plugins, optimize startup time.
-TOOL_NO_EXPORTS = 1
-
-include $(LEVEL)/Makefile.common
diff --git a/contrib/llvm/tools/llvm-nm/llvm-nm.cpp b/contrib/llvm/tools/llvm-nm/llvm-nm.cpp
deleted file mode 100644
index daa8571..0000000
--- a/contrib/llvm/tools/llvm-nm/llvm-nm.cpp
+++ /dev/null
@@ -1,199 +0,0 @@
-//===-- llvm-nm.cpp - Symbol table dumping utility for llvm ---------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This program is a utility that works like traditional Unix "nm",
-// that is, it prints out the names of symbols in a bitcode file,
-// along with some information about each symbol.
-//
-// This "nm" does not print symbols' addresses. It supports many of
-// the features of GNU "nm", including its different output formats.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/LLVMContext.h"
-#include "llvm/Module.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Bitcode/Archive.h"
-#include "llvm/Support/CommandLine.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 <algorithm>
-#include <cctype>
-#include <cerrno>
-#include <cstring>
-using namespace llvm;
-
-namespace {
- enum OutputFormatTy { bsd, sysv, posix };
- cl::opt<OutputFormatTy>
- OutputFormat("format",
- cl::desc("Specify output format"),
- cl::values(clEnumVal(bsd, "BSD format"),
- clEnumVal(sysv, "System V format"),
- clEnumVal(posix, "POSIX.2 format"),
- clEnumValEnd), cl::init(bsd));
- cl::alias OutputFormat2("f", cl::desc("Alias for --format"),
- cl::aliasopt(OutputFormat));
-
- cl::list<std::string>
- InputFilenames(cl::Positional, cl::desc("<input bitcode files>"),
- cl::ZeroOrMore);
-
- cl::opt<bool> UndefinedOnly("undefined-only",
- cl::desc("Show only undefined symbols"));
- cl::alias UndefinedOnly2("u", cl::desc("Alias for --undefined-only"),
- cl::aliasopt(UndefinedOnly));
-
- cl::opt<bool> DefinedOnly("defined-only",
- cl::desc("Show only defined symbols"));
-
- cl::opt<bool> ExternalOnly("extern-only",
- cl::desc("Show only external symbols"));
- cl::alias ExternalOnly2("g", cl::desc("Alias for --extern-only"),
- cl::aliasopt(ExternalOnly));
-
- cl::opt<bool> BSDFormat("B", cl::desc("Alias for --format=bsd"));
- cl::opt<bool> POSIXFormat("P", cl::desc("Alias for --format=posix"));
-
- bool MultipleFiles = false;
-
- std::string ToolName;
-}
-
-static char TypeCharForSymbol(GlobalValue &GV) {
- if (GV.isDeclaration()) return 'U';
- if (GV.hasLinkOnceLinkage()) return 'C';
- if (GV.hasCommonLinkage()) return 'C';
- if (GV.hasWeakLinkage()) return 'W';
- if (isa<Function>(GV) && GV.hasInternalLinkage()) return 't';
- if (isa<Function>(GV)) return 'T';
- if (isa<GlobalVariable>(GV) && GV.hasInternalLinkage()) return 'd';
- if (isa<GlobalVariable>(GV)) return 'D';
- if (const GlobalAlias *GA = dyn_cast<GlobalAlias>(&GV)) {
- const GlobalValue *AliasedGV = GA->getAliasedGlobal();
- if (isa<Function>(AliasedGV)) return 'T';
- if (isa<GlobalVariable>(AliasedGV)) return 'D';
- }
- return '?';
-}
-
-static void DumpSymbolNameForGlobalValue(GlobalValue &GV) {
- // Private linkage and available_externally linkage don't exist in symtab.
- if (GV.hasPrivateLinkage() ||
- GV.hasLinkerPrivateLinkage() ||
- GV.hasLinkerPrivateWeakLinkage() ||
- GV.hasLinkerPrivateWeakDefAutoLinkage() ||
- GV.hasAvailableExternallyLinkage())
- return;
-
- const std::string SymbolAddrStr = " "; // Not used yet...
- char TypeChar = TypeCharForSymbol(GV);
- if ((TypeChar != 'U') && UndefinedOnly)
- return;
- if ((TypeChar == 'U') && DefinedOnly)
- return;
- if (GV.hasLocalLinkage () && ExternalOnly)
- return;
- if (OutputFormat == posix) {
- outs() << GV.getName () << " " << TypeCharForSymbol(GV) << " "
- << SymbolAddrStr << "\n";
- } else if (OutputFormat == bsd) {
- outs() << SymbolAddrStr << " " << TypeCharForSymbol(GV) << " "
- << GV.getName () << "\n";
- } else if (OutputFormat == sysv) {
- std::string PaddedName (GV.getName ());
- while (PaddedName.length () < 20)
- PaddedName += " ";
- outs() << PaddedName << "|" << SymbolAddrStr << "| "
- << TypeCharForSymbol(GV)
- << " | | | |\n";
- }
-}
-
-static void DumpSymbolNamesFromModule(Module *M) {
- const std::string &Filename = M->getModuleIdentifier ();
- if (OutputFormat == posix && MultipleFiles) {
- outs() << Filename << ":\n";
- } else if (OutputFormat == bsd && MultipleFiles) {
- outs() << "\n" << Filename << ":\n";
- } else if (OutputFormat == sysv) {
- outs() << "\n\nSymbols from " << Filename << ":\n\n"
- << "Name Value Class Type"
- << " Size Line Section\n";
- }
- std::for_each (M->begin(), M->end(), DumpSymbolNameForGlobalValue);
- std::for_each (M->global_begin(), M->global_end(),
- DumpSymbolNameForGlobalValue);
- std::for_each (M->alias_begin(), M->alias_end(),
- DumpSymbolNameForGlobalValue);
-}
-
-static void DumpSymbolNamesFromFile(std::string &Filename) {
- LLVMContext &Context = getGlobalContext();
- std::string ErrorMessage;
- sys::Path aPath(Filename);
- // Note: Currently we do not support reading an archive from stdin.
- if (Filename == "-" || aPath.isBitcodeFile()) {
- std::auto_ptr<MemoryBuffer> Buffer(
- MemoryBuffer::getFileOrSTDIN(Filename, &ErrorMessage));
- Module *Result = 0;
- if (Buffer.get())
- Result = ParseBitcodeFile(Buffer.get(), Context, &ErrorMessage);
-
- if (Result) {
- DumpSymbolNamesFromModule(Result);
- delete Result;
- } else
- errs() << ToolName << ": " << Filename << ": " << ErrorMessage << "\n";
-
- } else if (aPath.isArchive()) {
- std::string ErrMsg;
- Archive* archive = Archive::OpenAndLoad(sys::Path(Filename), Context,
- &ErrorMessage);
- if (!archive)
- errs() << ToolName << ": " << Filename << ": " << ErrorMessage << "\n";
- std::vector<Module *> Modules;
- if (archive->getAllModules(Modules, &ErrorMessage)) {
- errs() << ToolName << ": " << Filename << ": " << ErrorMessage << "\n";
- return;
- }
- MultipleFiles = true;
- std::for_each (Modules.begin(), Modules.end(), DumpSymbolNamesFromModule);
- } else {
- errs() << ToolName << ": " << Filename << ": "
- << "unrecognizable file type\n";
- return;
- }
-}
-
-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 symbol table dumper\n");
-
- ToolName = argv[0];
- if (BSDFormat) OutputFormat = bsd;
- if (POSIXFormat) OutputFormat = posix;
-
- switch (InputFilenames.size()) {
- case 0: InputFilenames.push_back("-");
- case 1: break;
- default: MultipleFiles = true;
- }
-
- std::for_each(InputFilenames.begin(), InputFilenames.end(),
- DumpSymbolNamesFromFile);
- return 0;
-}
diff --git a/contrib/llvm/tools/llvm-prof/CMakeLists.txt b/contrib/llvm/tools/llvm-prof/CMakeLists.txt
deleted file mode 100644
index 442112b..0000000
--- a/contrib/llvm/tools/llvm-prof/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-set(LLVM_LINK_COMPONENTS bitreader analysis)
-
-add_llvm_tool(llvm-prof
- llvm-prof.cpp
- )
diff --git a/contrib/llvm/tools/llvm-prof/Makefile b/contrib/llvm/tools/llvm-prof/Makefile
deleted file mode 100644
index 86eb54d..0000000
--- a/contrib/llvm/tools/llvm-prof/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-##===- tools/llvm-prof/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-prof
-LINK_COMPONENTS = bitreader analysis
-
-# This tool has no plugins, optimize startup time.
-TOOL_NO_EXPORTS = 1
-
-include $(LEVEL)/Makefile.common
diff --git a/contrib/llvm/tools/llvm-prof/llvm-prof.cpp b/contrib/llvm/tools/llvm-prof/llvm-prof.cpp
deleted file mode 100644
index 1c63d97..0000000
--- a/contrib/llvm/tools/llvm-prof/llvm-prof.cpp
+++ /dev/null
@@ -1,291 +0,0 @@
-//===- llvm-prof.cpp - Read in and process llvmprof.out data files --------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tools is meant for use with the various LLVM profiling instrumentation
-// passes. It reads in the data file produced by executing an instrumented
-// program, and outputs a nice report.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/InstrTypes.h"
-#include "llvm/LLVMContext.h"
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/Assembly/AssemblyAnnotationWriter.h"
-#include "llvm/Analysis/ProfileInfo.h"
-#include "llvm/Analysis/ProfileInfoLoader.h"
-#include "llvm/Analysis/Passes.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/FormattedStream.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/PrettyStackTrace.h"
-#include "llvm/Support/raw_ostream.h"
-#include "llvm/Support/Format.h"
-#include "llvm/System/Signals.h"
-#include <algorithm>
-#include <iomanip>
-#include <map>
-#include <set>
-
-using namespace llvm;
-
-namespace {
- cl::opt<std::string>
- BitcodeFile(cl::Positional, cl::desc("<program bitcode file>"),
- cl::Required);
-
- cl::opt<std::string>
- ProfileDataFile(cl::Positional, cl::desc("<llvmprof.out file>"),
- cl::Optional, cl::init("llvmprof.out"));
-
- cl::opt<bool>
- PrintAnnotatedLLVM("annotated-llvm",
- cl::desc("Print LLVM code with frequency annotations"));
- cl::alias PrintAnnotated2("A", cl::desc("Alias for --annotated-llvm"),
- cl::aliasopt(PrintAnnotatedLLVM));
- cl::opt<bool>
- PrintAllCode("print-all-code",
- cl::desc("Print annotated code for the entire program"));
-}
-
-// PairSecondSort - A sorting predicate to sort by the second element of a pair.
-template<class T>
-struct PairSecondSortReverse
- : public std::binary_function<std::pair<T, double>,
- std::pair<T, double>, bool> {
- bool operator()(const std::pair<T, double> &LHS,
- const std::pair<T, double> &RHS) const {
- return LHS.second > RHS.second;
- }
-};
-
-static double ignoreMissing(double w) {
- if (w == ProfileInfo::MissingValue) return 0;
- return w;
-}
-
-namespace {
- class ProfileAnnotator : public AssemblyAnnotationWriter {
- ProfileInfo &PI;
- public:
- ProfileAnnotator(ProfileInfo &pi) : PI(pi) {}
-
- virtual void emitFunctionAnnot(const Function *F,
- formatted_raw_ostream &OS) {
- double w = PI.getExecutionCount(F);
- if (w != ProfileInfo::MissingValue) {
- OS << ";;; %" << F->getName() << " called "<<(unsigned)w
- <<" times.\n;;;\n";
- }
- }
- virtual void emitBasicBlockStartAnnot(const BasicBlock *BB,
- formatted_raw_ostream &OS) {
- double w = PI.getExecutionCount(BB);
- if (w != ProfileInfo::MissingValue) {
- if (w != 0) {
- OS << "\t;;; Basic block executed " << (unsigned)w << " times.\n";
- } else {
- OS << "\t;;; Never executed!\n";
- }
- }
- }
-
- virtual void emitBasicBlockEndAnnot(const BasicBlock *BB,
- formatted_raw_ostream &OS) {
- // Figure out how many times each successor executed.
- std::vector<std::pair<ProfileInfo::Edge, double> > SuccCounts;
-
- const TerminatorInst *TI = BB->getTerminator();
- for (unsigned s = 0, e = TI->getNumSuccessors(); s != e; ++s) {
- BasicBlock* Succ = TI->getSuccessor(s);
- double w = ignoreMissing(PI.getEdgeWeight(std::make_pair(BB, Succ)));
- if (w != 0)
- SuccCounts.push_back(std::make_pair(std::make_pair(BB, Succ), w));
- }
- if (!SuccCounts.empty()) {
- OS << "\t;;; Out-edge counts:";
- for (unsigned i = 0, e = SuccCounts.size(); i != e; ++i)
- OS << " [" << (SuccCounts[i]).second << " -> "
- << (SuccCounts[i]).first.second->getName() << "]";
- OS << "\n";
- }
- }
- };
-}
-
-namespace {
- /// ProfileInfoPrinterPass - Helper pass to dump the profile information for
- /// a module.
- //
- // FIXME: This should move elsewhere.
- class ProfileInfoPrinterPass : public ModulePass {
- ProfileInfoLoader &PIL;
- public:
- static char ID; // Class identification, replacement for typeinfo.
- explicit ProfileInfoPrinterPass(ProfileInfoLoader &_PIL)
- : ModulePass(ID), PIL(_PIL) {}
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- AU.addRequired<ProfileInfo>();
- }
-
- bool runOnModule(Module &M);
- };
-}
-
-char ProfileInfoPrinterPass::ID = 0;
-
-bool ProfileInfoPrinterPass::runOnModule(Module &M) {
- ProfileInfo &PI = getAnalysis<ProfileInfo>();
- std::map<const Function *, unsigned> FuncFreqs;
- std::map<const BasicBlock*, unsigned> BlockFreqs;
- std::map<ProfileInfo::Edge, unsigned> EdgeFreqs;
-
- // Output a report. Eventually, there will be multiple reports selectable on
- // the command line, for now, just keep things simple.
-
- // Emit the most frequent function table...
- std::vector<std::pair<Function*, double> > FunctionCounts;
- std::vector<std::pair<BasicBlock*, double> > Counts;
- for (Module::iterator FI = M.begin(), FE = M.end(); FI != FE; ++FI) {
- if (FI->isDeclaration()) continue;
- double w = ignoreMissing(PI.getExecutionCount(FI));
- FunctionCounts.push_back(std::make_pair(FI, w));
- for (Function::iterator BB = FI->begin(), BBE = FI->end();
- BB != BBE; ++BB) {
- double w = ignoreMissing(PI.getExecutionCount(BB));
- Counts.push_back(std::make_pair(BB, w));
- }
- }
-
- // Sort by the frequency, backwards.
- sort(FunctionCounts.begin(), FunctionCounts.end(),
- PairSecondSortReverse<Function*>());
-
- double TotalExecutions = 0;
- for (unsigned i = 0, e = FunctionCounts.size(); i != e; ++i)
- TotalExecutions += FunctionCounts[i].second;
-
- outs() << "===" << std::string(73, '-') << "===\n"
- << "LLVM profiling output for execution";
- if (PIL.getNumExecutions() != 1) outs() << "s";
- outs() << ":\n";
-
- for (unsigned i = 0, e = PIL.getNumExecutions(); i != e; ++i) {
- outs() << " ";
- if (e != 1) outs() << i+1 << ". ";
- outs() << PIL.getExecution(i) << "\n";
- }
-
- outs() << "\n===" << std::string(73, '-') << "===\n";
- outs() << "Function execution frequencies:\n\n";
-
- // Print out the function frequencies...
- outs() << " ## Frequency\n";
- for (unsigned i = 0, e = FunctionCounts.size(); i != e; ++i) {
- if (FunctionCounts[i].second == 0) {
- outs() << "\n NOTE: " << e-i << " function"
- << (e-i-1 ? "s were" : " was") << " never executed!\n";
- break;
- }
-
- outs() << format("%3d", i+1) << ". "
- << format("%5.2g", FunctionCounts[i].second) << "/"
- << format("%g", TotalExecutions) << " "
- << FunctionCounts[i].first->getNameStr() << "\n";
- }
-
- std::set<Function*> FunctionsToPrint;
-
- TotalExecutions = 0;
- for (unsigned i = 0, e = Counts.size(); i != e; ++i)
- TotalExecutions += Counts[i].second;
-
- // Sort by the frequency, backwards.
- sort(Counts.begin(), Counts.end(),
- PairSecondSortReverse<BasicBlock*>());
-
- outs() << "\n===" << std::string(73, '-') << "===\n";
- outs() << "Top 20 most frequently executed basic blocks:\n\n";
-
- // Print out the function frequencies...
- outs() <<" ## %% \tFrequency\n";
- unsigned BlocksToPrint = Counts.size();
- if (BlocksToPrint > 20) BlocksToPrint = 20;
- for (unsigned i = 0; i != BlocksToPrint; ++i) {
- if (Counts[i].second == 0) break;
- Function *F = Counts[i].first->getParent();
- outs() << format("%3d", i+1) << ". "
- << format("%5g", Counts[i].second/(double)TotalExecutions*100) << "% "
- << format("%5.0f", Counts[i].second) << "/"
- << format("%g", TotalExecutions) << "\t"
- << F->getNameStr() << "() - "
- << Counts[i].first->getNameStr() << "\n";
- FunctionsToPrint.insert(F);
- }
-
- if (PrintAnnotatedLLVM || PrintAllCode) {
- outs() << "\n===" << std::string(73, '-') << "===\n";
- outs() << "Annotated LLVM code for the module:\n\n";
-
- ProfileAnnotator PA(PI);
-
- if (FunctionsToPrint.empty() || PrintAllCode)
- M.print(outs(), &PA);
- else
- // Print just a subset of the functions.
- for (std::set<Function*>::iterator I = FunctionsToPrint.begin(),
- E = FunctionsToPrint.end(); I != E; ++I)
- (*I)->print(outs(), &PA);
- }
-
- return false;
-}
-
-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 profile dump decoder\n");
-
- // Read in the bitcode file...
- std::string ErrorMessage;
- Module *M = 0;
- if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(BitcodeFile,
- &ErrorMessage)) {
- M = ParseBitcodeFile(Buffer, Context, &ErrorMessage);
- delete Buffer;
- }
- if (M == 0) {
- errs() << argv[0] << ": " << BitcodeFile << ": "
- << ErrorMessage << "\n";
- return 1;
- }
-
- // Read the profiling information. This is redundant since we load it again
- // using the standard profile info provider pass, but for now this gives us
- // access to additional information not exposed via the ProfileInfo
- // interface.
- ProfileInfoLoader PIL(argv[0], ProfileDataFile, *M);
-
- // Run the printer pass.
- PassManager PassMgr;
- PassMgr.add(createProfileLoaderPass(ProfileDataFile));
- PassMgr.add(new ProfileInfoPrinterPass(PIL));
- PassMgr.run(*M);
-
- return 0;
-}
diff --git a/contrib/llvm/tools/llvm-ranlib/CMakeLists.txt b/contrib/llvm/tools/llvm-ranlib/CMakeLists.txt
deleted file mode 100644
index 3116d2e..0000000
--- a/contrib/llvm/tools/llvm-ranlib/CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-set(LLVM_LINK_COMPONENTS archive)
-set(LLVM_REQUIRES_EH 1)
-
-add_llvm_tool(llvm-ranlib
- llvm-ranlib.cpp
- )
diff --git a/contrib/llvm/tools/llvm-ranlib/Makefile b/contrib/llvm/tools/llvm-ranlib/Makefile
deleted file mode 100644
index 46a10e6..0000000
--- a/contrib/llvm/tools/llvm-ranlib/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-##===- tools/llvm-ranlib/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-ranlib
-LINK_COMPONENTS = archive
-REQUIRES_EH := 1
-
-# This tool has no plugins, optimize startup time.
-TOOL_NO_EXPORTS = 1
-
-include $(LEVEL)/Makefile.common
diff --git a/contrib/llvm/tools/llvm-ranlib/llvm-ranlib.cpp b/contrib/llvm/tools/llvm-ranlib/llvm-ranlib.cpp
deleted file mode 100644
index dffe3ad..0000000
--- a/contrib/llvm/tools/llvm-ranlib/llvm-ranlib.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-//===-- llvm-ranlib.cpp - LLVM archive index generator --------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Adds or updates an index (symbol table) for an LLVM archive file.
-//
-//===----------------------------------------------------------------------===//
-
-#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 <iostream>
-#include <iomanip>
-#include <memory>
-
-using namespace llvm;
-
-// llvm-ar operation code and modifier flags
-static cl::opt<std::string>
-ArchiveName(cl::Positional, cl::Optional, cl::desc("<archive-file>"));
-
-static cl::opt<bool>
-Verbose("verbose",cl::Optional,cl::init(false),
- cl::desc("Print the symbol table"));
-
-// printSymbolTable - print out the archive's symbol table.
-void printSymbolTable(Archive* TheArchive) {
- 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";
- }
-}
-
-int main(int argc, char **argv) {
- // Print a stack trace if we signal out.
- llvm::sys::PrintStackTraceOnErrorSignal();
- llvm::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 Archive Index Generator (llvm-ranlib)\n\n"
- " This program adds or updates an index of bitcode symbols\n"
- " to an LLVM archive file."
- );
-
- int exitCode = 0;
-
- // Make sure we don't exit with "unhandled exception".
- try {
-
- // Check the path name of the archive
- sys::Path ArchivePath;
- if (!ArchivePath.set(ArchiveName))
- throw std::string("Archive name invalid: ") + ArchiveName;
-
- // Make sure it exists, we don't create empty archives
- if (!ArchivePath.exists())
- throw std::string("Archive file does not exist");
-
- std::string err_msg;
- std::auto_ptr<Archive>
- AutoArchive(Archive::OpenAndLoad(ArchivePath, Context, &err_msg));
- Archive* TheArchive = AutoArchive.get();
- if (!TheArchive)
- throw err_msg;
-
- if (TheArchive->writeToDisk(true, false, false, &err_msg ))
- throw err_msg;
-
- if (Verbose)
- printSymbolTable(TheArchive);
-
- } catch (const char* msg) {
- errs() << argv[0] << ": " << msg << "\n\n";
- exitCode = 1;
- } catch (const std::string& msg) {
- errs() << argv[0] << ": " << msg << "\n";
- exitCode = 2;
- } catch (...) {
- errs() << argv[0] << ": An unexpected unknown exception occurred.\n";
- exitCode = 3;
- }
- return exitCode;
-}
diff --git a/contrib/llvm/tools/llvm-shlib/Makefile b/contrib/llvm/tools/llvm-shlib/Makefile
deleted file mode 100644
index 5238130..0000000
--- a/contrib/llvm/tools/llvm-shlib/Makefile
+++ /dev/null
@@ -1,111 +0,0 @@
-##===- tools/shlib/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 = LLVM-$(LLVMVersion)
-
-NO_BUILD_ARCHIVE = 1
-LINK_LIBS_IN_SHARED = 1
-SHARED_LIBRARY = 1
-
-include $(LEVEL)/Makefile.config
-
-ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
- EXPORTED_SYMBOL_FILE = $(ObjDir)/$(LIBRARYNAME).exports
-
- # It is needed to force static-stdc++.a linked.
- # FIXME: It should be omitted when configure detects system's stdc++.dll.
- SHLIB_FRAG_NAMES += stdc++.a.o
-
-endif
-
-include $(LEVEL)/Makefile.common
-
-# Include all archives in libLLVM.(so|dylib) except the ones that have
-# their own dynamic libraries.
-Archives := $(wildcard $(LibDir)/libLLVM*.a)
-SharedLibraries := $(wildcard $(LibDir)/libLLVM*$(SHLIBEXT))
-IncludeInLibLlvm := $(filter-out $(basename $(SharedLibraries)).a, $(Archives))
-LLVMLibsOptions := $(IncludeInLibLlvm:$(LibDir)/lib%.a=-l%)
-LLVMLibsPaths := $(IncludeInLibLlvm)
-
-$(LibName.SO): $(LLVMLibsPaths)
-
-ifeq ($(HOST_OS),Darwin)
- # set dylib internal version number to llvmCore submission number
- ifdef LLVM_SUBMIT_VERSION
- LLVMLibsOptions := $(LLVMLibsOptions) -Wl,-current_version \
- -Wl,$(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION) \
- -Wl,-compatibility_version -Wl,1
- endif
- # Include everything from the .a's into the shared library.
- LLVMLibsOptions := $(LLVMLibsOptions) -all_load
- # extra options to override libtool defaults
- LLVMLibsOptions := $(LLVMLibsOptions) \
- -Wl,-dead_strip \
- -Wl,-seg1addr -Wl,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 := $(LLVMLibsOptions) \
- -Wl,-install_name \
- -Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)"
- endif
-endif
-
-ifeq ($(HOST_OS), Linux)
- # Include everything from the .a's into the shared library.
- LLVMLibsOptions := -Wl,--whole-archive $(LLVMLibsOptions) \
- -Wl,--no-whole-archive
- # Don't allow unresolved symbols.
- LLVMLibsOptions += -Wl,--no-undefined
-endif
-
-ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
-
-SHLIB_STUBS := $(addprefix $(ObjDir)/, $(SHLIB_FRAG_NAMES))
-SHLIB_FRAGS := $(patsubst %.a.o, $(ObjDir)/%.syms.txt, $(LIBRARYNAME).a.o $(SHLIB_FRAG_NAMES))
-LLVMLibsOptions := $(SHLIB_STUBS) $(LLVMLibsOptions)
-
-$(LibName.SO): $(SHLIB_STUBS)
-
-%.syms.txt: %.a.o
- $(Echo) Collecting global symbols of $(notdir $*)
- $(Verb) $(NM_PATH) -g $< > $@
-
-$(ObjDir)/$(LIBRARYNAME).exports: $(SHLIB_FRAGS) $(ObjDir)/.dir
- $(Echo) Generating exports for $(LIBRARYNAME)
- $(Verb) ($(SED) -n \
- -e "s/^.* T _\([^.][^.]*\)$$/\1/p" \
- -e "s/^.* [BDR] _\([^.][^.]*\)$$/\1 DATA/p" \
- $(SHLIB_FRAGS) \
- | sort -u) > $@
-
-$(ObjDir)/$(LIBRARYNAME).a.o: $(LLVMLibsPaths) $(ObjDir)/.dir
- $(Echo) Linking all LLVMLibs together for $(LIBRARYNAME)
- $(Verb) $(Link) -nostartfiles -Wl,-r -nodefaultlibs -o $@ \
- -Wl,--whole-archive $(LLVMLibsPaths) \
- -Wl,--no-whole-archive
-
-$(ObjDir)/stdc++.a.o: $(ObjDir)/.dir
- $(Echo) Linking all libs together for static libstdc++.a
- $(Verb) $(Link) -nostartfiles -Wl,-r -nodefaultlibs -o $@ \
- -Wl,--whole-archive -lstdc++ \
- -Wl,--no-whole-archive
-# FIXME: workaround to invalidate -lstdc++
- $(Echo) Making dummy -lstdc++ to lib
- $(Verb) $(AR) rc $(ToolDir)/libstdc++.dll.a
-# FIXME: Is install-local needed?
-
-clean-local::
- $(Verb) $(RM) -f $(ToolDir)/libstdc++.dll.a
-
-endif
diff --git a/contrib/llvm/tools/llvm-stub/CMakeLists.txt b/contrib/llvm/tools/llvm-stub/CMakeLists.txt
deleted file mode 100644
index a98dc9e..0000000
--- a/contrib/llvm/tools/llvm-stub/CMakeLists.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-add_llvm_tool(llvm-stub
- llvm-stub.c
- )
diff --git a/contrib/llvm/tools/llvm-stub/Makefile b/contrib/llvm/tools/llvm-stub/Makefile
deleted file mode 100644
index 7ffe149..0000000
--- a/contrib/llvm/tools/llvm-stub/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-##===- tools/llvm-stub/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-stub
-include $(LEVEL)/Makefile.common
-
diff --git a/contrib/llvm/tools/llvm-stub/llvm-stub.c b/contrib/llvm/tools/llvm-stub/llvm-stub.c
deleted file mode 100644
index f2e478e..0000000
--- a/contrib/llvm/tools/llvm-stub/llvm-stub.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*===- llvm-stub.c - Stub executable to run llvm bitcode files ------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tool is used by the gccld program to enable transparent execution of
-// bitcode files by the user. Specifically, gccld outputs two files when asked
-// to compile a <program> file:
-// 1. It outputs the LLVM bitcode file to <program>.bc
-// 2. It outputs a stub executable that runs lli on <program>.bc
-//
-// This allows the end user to just say ./<program> and have the JIT executed
-// automatically. On unix, the stub executable emitted is actually a bourne
-// shell script that does the forwarding. Windows does not like #!/bin/sh
-// programs in .exe files, so we make it an actual program, defined here.
-//
-//===----------------------------------------------------------------------===*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "llvm/Config/config.h"
-
-#if defined(HAVE_UNISTD_H) && !defined(_MSC_VER)
-#include <unistd.h>
-#endif
-
-#ifdef _WIN32
-#include <process.h>
-#include <io.h>
-#endif
-
-int main(int argc, char** argv) {
- const char *Interp = getenv("LLVMINTERP");
- const char **Args;
- if (Interp == 0) Interp = "lli";
-
- /* Set up the command line options to pass to the JIT. */
- Args = (const char**)malloc(sizeof(char*) * (argc+2));
- /* argv[0] is the JIT */
- Args[0] = Interp;
-
-#ifdef LLVM_ON_WIN32
- {
- int len = strlen(argv[0]);
- if (len < 4 || strcmp(argv[0] + len - 4, ".exe") != 0) {
- /* .exe suffix is stripped off of argv[0] if the executable was run on the
- * command line without one. Put it back on.
- */
- argv[0] = strcat(strcpy((char*)malloc(len + 5), argv[0]), ".exe");
- }
- }
-#endif
-
- /* argv[1] is argv[0] + ".bc". */
- Args[1] = strcat(strcpy((char*)malloc(strlen(argv[0])+4), argv[0]), ".bc");
-
- /* The rest of the args are as before. */
- memcpy((char **)Args+2, argv+1, sizeof(char*)*argc);
-
- /* Run the JIT. */
- execvp(Interp, (char **)Args);
- /* if _execv returns, the JIT could not be started. */
- fprintf(stderr, "Could not execute the LLVM JIT. Either add 'lli' to your"
- " path, or set the\ninterpreter you want to use in the LLVMINTERP "
- "environment variable.\n");
- return 1;
-}
diff --git a/contrib/llvm/tools/llvmc/CMakeLists.txt b/contrib/llvm/tools/llvmc/CMakeLists.txt
deleted file mode 100644
index 10ad5d8..0000000
--- a/contrib/llvm/tools/llvmc/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-# add_subdirectory(src)
-
-# TODO: support plugins and user-configured builds.
-# See ./doc/LLVMC-Reference.rst "Customizing LLVMC: the compilation graph"
diff --git a/contrib/llvm/tools/llvmc/Makefile b/contrib/llvm/tools/llvmc/Makefile
deleted file mode 100644
index 7c03e2a..0000000
--- a/contrib/llvm/tools/llvmc/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-##===- tools/llvmc/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 = src
-
-ifeq ($(BUILD_EXAMPLES),1)
- OPTIONAL_DIRS += examples
-endif
-
-include $(LEVEL)/Makefile.common
diff --git a/contrib/llvm/tools/llvmc/doc/LLVMC-Reference.rst b/contrib/llvm/tools/llvmc/doc/LLVMC-Reference.rst
deleted file mode 100644
index d160e75..0000000
--- a/contrib/llvm/tools/llvmc/doc/LLVMC-Reference.rst
+++ /dev/null
@@ -1,839 +0,0 @@
-===================================
-Customizing LLVMC: Reference Manual
-===================================
-..
- This file was automatically generated by rst2html.
- Please do not edit directly!
- The ReST source lives in the directory 'tools/llvmc/doc'.
-
-.. contents::
-
-.. raw:: html
-
- <div class="doc_author">
- <p>Written by <a href="mailto:foldr@codedgers.com">Mikhail Glushenkov</a></p>
- </div>
-
-Introduction
-============
-
-LLVMC is a generic compiler driver, designed to be customizable and
-extensible. It plays the same role for LLVM as the ``gcc`` program
-does for GCC - LLVMC's job is essentially to transform a set of input
-files into a set of targets depending on configuration rules and user
-options. What makes LLVMC different is that these transformation rules
-are completely customizable - in fact, LLVMC knows nothing about the
-specifics of transformation (even the command-line options are mostly
-not hard-coded) and regards the transformation structure as an
-abstract graph. The structure of this graph is completely determined
-by plugins, which can be either statically or dynamically linked. This
-makes it possible to easily adapt LLVMC for other purposes - for
-example, as a build tool for game resources.
-
-Because LLVMC employs TableGen_ as its configuration language, you
-need to be familiar with it to customize LLVMC.
-
-.. _TableGen: http://llvm.org/docs/TableGenFundamentals.html
-
-
-Compiling with LLVMC
-====================
-
-LLVMC tries hard to be as compatible with ``gcc`` as possible,
-although there are some small differences. Most of the time, however,
-you shouldn't be able to notice them::
-
- $ # This works as expected:
- $ llvmc -O3 -Wall hello.cpp
- $ ./a.out
- hello
-
-One nice feature of LLVMC is that one doesn't have to distinguish between
-different compilers for different languages (think ``g++`` vs. ``gcc``) - the
-right toolchain is chosen automatically based on input language names (which
-are, in turn, determined from file extensions). If you want to force files
-ending with ".c" to compile as C++, use the ``-x`` option, just like you would
-do it with ``gcc``::
-
- $ # hello.c is really a C++ file
- $ llvmc -x c++ hello.c
- $ ./a.out
- hello
-
-On the other hand, when using LLVMC as a linker to combine several C++
-object files you should provide the ``--linker`` option since it's
-impossible for LLVMC to choose the right linker in that case::
-
- $ llvmc -c hello.cpp
- $ llvmc hello.o
- [A lot of link-time errors skipped]
- $ llvmc --linker=c++ hello.o
- $ ./a.out
- hello
-
-By default, LLVMC uses ``llvm-gcc`` to compile the source code. It is also
-possible to choose the ``clang`` compiler with the ``-clang`` option.
-
-
-Predefined options
-==================
-
-LLVMC has some built-in options that can't be overridden in the
-configuration libraries:
-
-* ``-o FILE`` - Output file name.
-
-* ``-x LANGUAGE`` - Specify the language of the following input files
- until the next -x option.
-
-* ``-load PLUGIN_NAME`` - Load the specified plugin DLL. Example:
- ``-load $LLVM_DIR/Release/lib/LLVMCSimple.so``.
-
-* ``-v`` - Enable verbose mode, i.e. print out all executed commands.
-
-* ``--save-temps`` - Write temporary files to the current directory and do not
- delete them on exit. This option can also take an argument: the
- ``--save-temps=obj`` switch will write files into the directory specified with
- the ``-o`` option. The ``--save-temps=cwd`` and ``--save-temps`` switches are
- both synonyms for the default behaviour.
-
-* ``--temp-dir DIRECTORY`` - Store temporary files in the given directory. This
- directory is deleted on exit unless ``--save-temps`` is specified. If
- ``--save-temps=obj`` is also specified, ``--temp-dir`` is given the
- precedence.
-
-* ``--check-graph`` - Check the compilation for common errors like mismatched
- output/input language names, multiple default edges and cycles. Because of
- plugins, these checks can't be performed at compile-time. Exit with code zero
- if no errors were found, and return the number of found errors
- otherwise. Hidden option, useful for debugging LLVMC plugins.
-
-* ``--view-graph`` - Show a graphical representation of the compilation graph
- and exit. Requires that you have ``dot`` and ``gv`` programs installed. Hidden
- option, useful for debugging LLVMC plugins.
-
-* ``--write-graph`` - Write a ``compilation-graph.dot`` file in the current
- directory with the compilation graph description in Graphviz format (identical
- to the file used by the ``--view-graph`` option). The ``-o`` option can be
- used to set the output file name. Hidden option, useful for debugging LLVMC
- plugins.
-
-* ``--help``, ``--help-hidden``, ``--version`` - These options have
- their standard meaning.
-
-Compiling LLVMC plugins
-=======================
-
-It's easiest to start working on your own LLVMC plugin by copying the
-skeleton project which lives under ``$LLVMC_DIR/plugins/Simple``::
-
- $ cd $LLVMC_DIR/plugins
- $ cp -r Simple MyPlugin
- $ cd MyPlugin
- $ ls
- Makefile PluginMain.cpp Simple.td
-
-As you can see, our basic plugin consists of only two files (not
-counting the build script). ``Simple.td`` contains TableGen
-description of the compilation graph; its format is documented in the
-following sections. ``PluginMain.cpp`` is just a helper file used to
-compile the auto-generated C++ code produced from TableGen source. It
-can also contain hook definitions (see `below`__).
-
-__ hooks_
-
-The first thing that you should do is to change the ``LLVMC_PLUGIN``
-variable in the ``Makefile`` to avoid conflicts (since this variable
-is used to name the resulting library)::
-
- LLVMC_PLUGIN=MyPlugin
-
-It is also a good idea to rename ``Simple.td`` to something less
-generic::
-
- $ mv Simple.td MyPlugin.td
-
-To build your plugin as a dynamic library, just ``cd`` to its source
-directory and run ``make``. The resulting file will be called
-``plugin_llvmc_$(LLVMC_PLUGIN).$(DLL_EXTENSION)`` (in our case,
-``plugin_llvmc_MyPlugin.so``). This library can be then loaded in with the
-``-load`` option. Example::
-
- $ cd $LLVMC_DIR/plugins/Simple
- $ make
- $ llvmc -load $LLVM_DIR/Release/lib/plugin_llvmc_Simple.so
-
-Compiling standalone LLVMC-based drivers
-========================================
-
-By default, the ``llvmc`` executable consists of a driver core plus several
-statically linked plugins (``Base`` and ``Clang`` at the moment). You can
-produce a standalone LLVMC-based driver executable by linking the core with your
-own plugins. The recommended way to do this is by starting with the provided
-``Skeleton`` example (``$LLVMC_DIR/example/Skeleton``)::
-
- $ cd $LLVMC_DIR/example/
- $ cp -r Skeleton mydriver
- $ cd mydriver
- $ vim Makefile
- [...]
- $ make
-
-If you're compiling LLVM with different source and object directories, then you
-must perform the following additional steps before running ``make``::
-
- # LLVMC_SRC_DIR = $LLVM_SRC_DIR/tools/llvmc/
- # LLVMC_OBJ_DIR = $LLVM_OBJ_DIR/tools/llvmc/
- $ cp $LLVMC_SRC_DIR/example/mydriver/Makefile \
- $LLVMC_OBJ_DIR/example/mydriver/
- $ cd $LLVMC_OBJ_DIR/example/mydriver
- $ make
-
-Another way to do the same thing is by using the following command::
-
- $ cd $LLVMC_DIR
- $ make LLVMC_BUILTIN_PLUGINS=MyPlugin LLVMC_BASED_DRIVER_NAME=mydriver
-
-This works with both srcdir == objdir and srcdir != objdir, but assumes that the
-plugin source directory was placed under ``$LLVMC_DIR/plugins``.
-
-Sometimes, you will want a 'bare-bones' version of LLVMC that has no
-built-in plugins. It can be compiled with the following command::
-
- $ cd $LLVMC_DIR
- $ make LLVMC_BUILTIN_PLUGINS=""
-
-
-Customizing LLVMC: the compilation graph
-========================================
-
-Each TableGen configuration file should include the common
-definitions::
-
- include "llvm/CompilerDriver/Common.td"
-
-Internally, LLVMC stores information about possible source
-transformations in form of a graph. Nodes in this graph represent
-tools, and edges between two nodes represent a transformation path. A
-special "root" node is used to mark entry points for the
-transformations. LLVMC also assigns a weight to each edge (more on
-this later) to choose between several alternative edges.
-
-The definition of the compilation graph (see file
-``plugins/Base/Base.td`` for an example) is just a list of edges::
-
- def CompilationGraph : CompilationGraph<[
- Edge<"root", "llvm_gcc_c">,
- Edge<"root", "llvm_gcc_assembler">,
- ...
-
- Edge<"llvm_gcc_c", "llc">,
- Edge<"llvm_gcc_cpp", "llc">,
- ...
-
- OptionalEdge<"llvm_gcc_c", "opt", (case (switch_on "opt"),
- (inc_weight))>,
- OptionalEdge<"llvm_gcc_cpp", "opt", (case (switch_on "opt"),
- (inc_weight))>,
- ...
-
- OptionalEdge<"llvm_gcc_assembler", "llvm_gcc_cpp_linker",
- (case (input_languages_contain "c++"), (inc_weight),
- (or (parameter_equals "linker", "g++"),
- (parameter_equals "linker", "c++")), (inc_weight))>,
- ...
-
- ]>;
-
-As you can see, the edges can be either default or optional, where
-optional edges are differentiated by an additional ``case`` expression
-used to calculate the weight of this edge. Notice also that we refer
-to tools via their names (as strings). This makes it possible to add
-edges to an existing compilation graph in plugins without having to
-know about all tool definitions used in the graph.
-
-The default edges are assigned a weight of 1, and optional edges get a
-weight of 0 + 2*N where N is the number of tests that evaluated to
-true in the ``case`` expression. It is also possible to provide an
-integer parameter to ``inc_weight`` and ``dec_weight`` - in this case,
-the weight is increased (or decreased) by the provided value instead
-of the default 2. It is also possible to change the default weight of
-an optional edge by using the ``default`` clause of the ``case``
-construct.
-
-When passing an input file through the graph, LLVMC picks the edge
-with the maximum weight. To avoid ambiguity, there should be only one
-default edge between two nodes (with the exception of the root node,
-which gets a special treatment - there you are allowed to specify one
-default edge *per language*).
-
-When multiple plugins are loaded, their compilation graphs are merged
-together. Since multiple edges that have the same end nodes are not
-allowed (i.e. the graph is not a multigraph), an edge defined in
-several plugins will be replaced by the definition from the plugin
-that was loaded last. Plugin load order can be controlled by using the
-plugin priority feature described above.
-
-To get a visual representation of the compilation graph (useful for
-debugging), run ``llvmc --view-graph``. You will need ``dot`` and
-``gsview`` installed for this to work properly.
-
-Describing options
-==================
-
-Command-line options that the plugin supports are defined by using an
-``OptionList``::
-
- def Options : OptionList<[
- (switch_option "E", (help "Help string")),
- (alias_option "quiet", "q")
- ...
- ]>;
-
-As you can see, the option list is just a list of DAGs, where each DAG
-is an option description consisting of the option name and some
-properties. A plugin can define more than one option list (they are
-all merged together in the end), which can be handy if one wants to
-separate option groups syntactically.
-
-* Possible option types:
-
- - ``switch_option`` - a simple boolean switch without arguments, for example
- ``-O2`` or ``-time``. At most one occurrence is allowed by default.
-
- - ``parameter_option`` - option that takes one argument, for example
- ``-std=c99``. It is also allowed to use spaces instead of the equality
- sign: ``-std c99``. At most one occurrence is allowed.
-
- - ``parameter_list_option`` - same as the above, but more than one option
- occurence is allowed.
-
- - ``prefix_option`` - same as the parameter_option, but the option name and
- argument do not have to be separated. Example: ``-ofile``. This can be also
- specified as ``-o file``; however, ``-o=file`` will be parsed incorrectly
- (``=file`` will be interpreted as option value). At most one occurrence is
- allowed.
-
- - ``prefix_list_option`` - same as the above, but more than one occurence of
- the option is allowed; example: ``-lm -lpthread``.
-
- - ``alias_option`` - a special option type for creating aliases. Unlike other
- option types, aliases are not allowed to have any properties besides the
- aliased option name. Usage example: ``(alias_option "preprocess", "E")``
-
- - ``switch_list_option`` - like ``switch_option`` with the ``zero_or_more``
- property, but remembers how many times the switch was turned on. Useful
- mostly for forwarding. Example: when ``-foo`` is a switch option (with the
- ``zero_or_more`` property), the command ``driver -foo -foo`` is forwarded
- as ``some-tool -foo``, but when ``-foo`` is a switch list, the same command
- is forwarded as ``some-tool -foo -foo``.
-
-
-* Possible option properties:
-
- - ``help`` - help string associated with this option. Used for ``--help``
- output.
-
- - ``required`` - this option must be specified exactly once (or, in case of
- the list options without the ``multi_val`` property, at least
- once). Incompatible with ``optional`` and ``one_or_more``.
-
- - ``optional`` - the option can be specified either zero times or exactly
- once. The default for switch options. Useful only for list options in
- conjunction with ``multi_val``. Incompatible with ``required``,
- ``zero_or_more`` and ``one_or_more``.
-
- - ``one_or_more`` - the option must be specified at least once. Can be useful
- to allow switch options be both obligatory and be specified multiple
- times. For list options is useful only in conjunction with ``multi_val``;
- for ordinary it is synonymous with ``required``. Incompatible with
- ``required``, ``optional`` and ``zero_or_more``.
-
- - ``zero_or_more`` - the option can be specified zero or more times. Useful
- to allow a single switch option to be specified more than
- once. Incompatible with ``required``, ``optional`` and ``one_or_more``.
-
- - ``hidden`` - the description of this option will not appear in
- the ``--help`` output (but will appear in the ``--help-hidden``
- output).
-
- - ``really_hidden`` - the option will not be mentioned in any help
- output.
-
- - ``comma_separated`` - Indicates that any commas specified for an option's
- value should be used to split the value up into multiple values for the
- option. This property is valid only for list options. In conjunction with
- ``forward_value`` can be used to implement option forwarding in style of
- gcc's ``-Wa,``.
-
- - ``multi_val n`` - this option takes *n* arguments (can be useful in some
- special cases). Usage example: ``(parameter_list_option "foo", (multi_val
- 3))``; the command-line syntax is '-foo a b c'. Only list options can have
- this attribute; you can, however, use the ``one_or_more``, ``optional``
- and ``required`` properties.
-
- - ``init`` - this option has a default value, either a string (if it is a
- parameter), or a boolean (if it is a switch; as in C++, boolean constants
- are called ``true`` and ``false``). List options can't have ``init``
- attribute.
- Usage examples: ``(switch_option "foo", (init true))``; ``(prefix_option
- "bar", (init "baz"))``.
-
- - ``extern`` - this option is defined in some other plugin, see `below`__.
-
- __ extern_
-
-.. _extern:
-
-External options
-----------------
-
-Sometimes, when linking several plugins together, one plugin needs to
-access options defined in some other plugin. Because of the way
-options are implemented, such options must be marked as
-``extern``. This is what the ``extern`` option property is
-for. Example::
-
- ...
- (switch_option "E", (extern))
- ...
-
-If an external option has additional attributes besides 'extern', they are
-ignored. See also the section on plugin `priorities`__.
-
-__ priorities_
-
-.. _case:
-
-Conditional evaluation
-======================
-
-The 'case' construct is the main means by which programmability is
-achieved in LLVMC. It can be used to calculate edge weights, program
-actions and modify the shell commands to be executed. The 'case'
-expression is designed after the similarly-named construct in
-functional languages and takes the form ``(case (test_1), statement_1,
-(test_2), statement_2, ... (test_N), statement_N)``. The statements
-are evaluated only if the corresponding tests evaluate to true.
-
-Examples::
-
- // Edge weight calculation
-
- // Increases edge weight by 5 if "-A" is provided on the
- // command-line, and by 5 more if "-B" is also provided.
- (case
- (switch_on "A"), (inc_weight 5),
- (switch_on "B"), (inc_weight 5))
-
-
- // Tool command line specification
-
- // Evaluates to "cmdline1" if the option "-A" is provided on the
- // command line; to "cmdline2" if "-B" is provided;
- // otherwise to "cmdline3".
-
- (case
- (switch_on "A"), "cmdline1",
- (switch_on "B"), "cmdline2",
- (default), "cmdline3")
-
-Note the slight difference in 'case' expression handling in contexts
-of edge weights and command line specification - in the second example
-the value of the ``"B"`` switch is never checked when switch ``"A"`` is
-enabled, and the whole expression always evaluates to ``"cmdline1"`` in
-that case.
-
-Case expressions can also be nested, i.e. the following is legal::
-
- (case (switch_on "E"), (case (switch_on "o"), ..., (default), ...)
- (default), ...)
-
-You should, however, try to avoid doing that because it hurts
-readability. It is usually better to split tool descriptions and/or
-use TableGen inheritance instead.
-
-* Possible tests are:
-
- - ``switch_on`` - Returns true if a given command-line switch is provided by
- the user. Can be given a list as argument, in that case ``(switch_on ["foo",
- "bar", "baz"])`` is equivalent to ``(and (switch_on "foo"), (switch_on
- "bar"), (switch_on "baz"))``.
- Example: ``(switch_on "opt")``.
-
- - ``any_switch_on`` - Given a list of switch options, returns true if any of
- the switches is turned on.
- Example: ``(any_switch_on ["foo", "bar", "baz"])`` is equivalent to ``(or
- (switch_on "foo"), (switch_on "bar"), (switch_on "baz"))``.
-
- - ``parameter_equals`` - Returns true if a command-line parameter equals
- a given value.
- Example: ``(parameter_equals "W", "all")``.
-
- - ``element_in_list`` - Returns true if a command-line parameter
- list contains a given value.
- Example: ``(element_in_list "l", "pthread")``.
-
- - ``input_languages_contain`` - Returns true if a given language
- belongs to the current input language set.
- Example: ``(input_languages_contain "c++")``.
-
- - ``in_language`` - Evaluates to true if the input file language is equal to
- the argument. At the moment works only with ``cmd_line`` and ``actions`` (on
- non-join nodes).
- Example: ``(in_language "c++")``.
-
- - ``not_empty`` - Returns true if a given option (which should be either a
- parameter or a parameter list) is set by the user. Like ``switch_on``, can
- be also given a list as argument.
- Example: ``(not_empty "o")``.
-
- - ``any_not_empty`` - Returns true if ``not_empty`` returns true for any of
- the options in the list.
- Example: ``(any_not_empty ["foo", "bar", "baz"])`` is equivalent to ``(or
- (not_empty "foo"), (not_empty "bar"), (not_empty "baz"))``.
-
- - ``empty`` - The opposite of ``not_empty``. Equivalent to ``(not (not_empty
- X))``. Provided for convenience. Can be given a list as argument.
-
- - ``any_not_empty`` - Returns true if ``not_empty`` returns true for any of
- the options in the list.
- Example: ``(any_empty ["foo", "bar", "baz"])`` is equivalent to ``(not (and
- (not_empty "foo"), (not_empty "bar"), (not_empty "baz")))``.
-
- - ``single_input_file`` - Returns true if there was only one input file
- provided on the command-line. Used without arguments:
- ``(single_input_file)``.
-
- - ``multiple_input_files`` - Equivalent to ``(not (single_input_file))`` (the
- case of zero input files is considered an error).
-
- - ``default`` - Always evaluates to true. Should always be the last
- test in the ``case`` expression.
-
- - ``and`` - A standard binary logical combinator that returns true iff all of
- its arguments return true. Used like this: ``(and (test1), (test2),
- ... (testN))``. Nesting of ``and`` and ``or`` is allowed, but not
- encouraged.
-
- - ``or`` - A binary logical combinator that returns true iff any of its
- arguments returns true. Example: ``(or (test1), (test2), ... (testN))``.
-
- - ``not`` - Standard unary logical combinator that negates its
- argument. Example: ``(not (or (test1), (test2), ... (testN)))``.
-
-
-
-Writing a tool description
-==========================
-
-As was said earlier, nodes in the compilation graph represent tools,
-which are described separately. A tool definition looks like this
-(taken from the ``include/llvm/CompilerDriver/Tools.td`` file)::
-
- def llvm_gcc_cpp : Tool<[
- (in_language "c++"),
- (out_language "llvm-assembler"),
- (output_suffix "bc"),
- (cmd_line "llvm-g++ -c $INFILE -o $OUTFILE -emit-llvm"),
- (sink)
- ]>;
-
-This defines a new tool called ``llvm_gcc_cpp``, which is an alias for
-``llvm-g++``. As you can see, a tool definition is just a list of
-properties; most of them should be self-explanatory. The ``sink``
-property means that this tool should be passed all command-line
-options that aren't mentioned in the option list.
-
-The complete list of all currently implemented tool properties follows.
-
-* Possible tool properties:
-
- - ``in_language`` - input language name. Can be either a string or a
- list, in case the tool supports multiple input languages.
-
- - ``out_language`` - output language name. Multiple output languages are not
- allowed.
-
- - ``output_suffix`` - output file suffix. Can also be changed
- dynamically, see documentation on actions.
-
- - ``cmd_line`` - the actual command used to run the tool. You can
- use ``$INFILE`` and ``$OUTFILE`` variables, output redirection
- with ``>``, hook invocations (``$CALL``), environment variables
- (via ``$ENV``) and the ``case`` construct.
-
- - ``join`` - this tool is a "join node" in the graph, i.e. it gets a
- list of input files and joins them together. Used for linkers.
-
- - ``sink`` - all command-line options that are not handled by other
- tools are passed to this tool.
-
- - ``actions`` - A single big ``case`` expression that specifies how
- this tool reacts on command-line options (described in more detail
- `below`__).
-
-__ actions_
-
-.. _actions:
-
-Actions
--------
-
-A tool often needs to react to command-line options, and this is
-precisely what the ``actions`` property is for. The next example
-illustrates this feature::
-
- def llvm_gcc_linker : Tool<[
- (in_language "object-code"),
- (out_language "executable"),
- (output_suffix "out"),
- (cmd_line "llvm-gcc $INFILE -o $OUTFILE"),
- (join),
- (actions (case (not_empty "L"), (forward "L"),
- (not_empty "l"), (forward "l"),
- (not_empty "dummy"),
- [(append_cmd "-dummy1"), (append_cmd "-dummy2")])
- ]>;
-
-The ``actions`` tool property is implemented on top of the omnipresent
-``case`` expression. It associates one or more different *actions*
-with given conditions - in the example, the actions are ``forward``,
-which forwards a given option unchanged, and ``append_cmd``, which
-appends a given string to the tool execution command. Multiple actions
-can be associated with a single condition by using a list of actions
-(used in the example to append some dummy options). The same ``case``
-construct can also be used in the ``cmd_line`` property to modify the
-tool command line.
-
-The "join" property used in the example means that this tool behaves
-like a linker.
-
-The list of all possible actions follows.
-
-* Possible actions:
-
- - ``append_cmd`` - Append a string to the tool invocation command.
- Example: ``(case (switch_on "pthread"), (append_cmd "-lpthread"))``.
-
- - ``error`` - Exit with error.
- Example: ``(error "Mixing -c and -S is not allowed!")``.
-
- - ``warning`` - Print a warning.
- Example: ``(warning "Specifying both -O1 and -O2 is meaningless!")``.
-
- - ``forward`` - Forward the option unchanged.
- Example: ``(forward "Wall")``.
-
- - ``forward_as`` - Change the option's name, but forward the argument
- unchanged.
- Example: ``(forward_as "O0", "--disable-optimization")``.
-
- - ``forward_value`` - Forward only option's value. Cannot be used with switch
- options (since they don't have values), but works fine with lists.
- Example: ``(forward_value "Wa,")``.
-
- - ``forward_transformed_value`` - As above, but applies a hook to the
- option's value before forwarding (see `below`__). When
- ``forward_transformed_value`` is applied to a list
- option, the hook must have signature
- ``std::string hooks::HookName (const std::vector<std::string>&)``.
- Example: ``(forward_transformed_value "m", "ConvertToMAttr")``.
-
- __ hooks_
-
- - ``output_suffix`` - Modify the output suffix of this tool.
- Example: ``(output_suffix "i")``.
-
- - ``stop_compilation`` - Stop compilation after this tool processes its
- input. Used without arguments.
- Example: ``(stop_compilation)``.
-
-
-Language map
-============
-
-If you are adding support for a new language to LLVMC, you'll need to
-modify the language map, which defines mappings from file extensions
-to language names. It is used to choose the proper toolchain(s) for a
-given input file set. Language map definition looks like this::
-
- def LanguageMap : LanguageMap<
- [LangToSuffixes<"c++", ["cc", "cp", "cxx", "cpp", "CPP", "c++", "C"]>,
- LangToSuffixes<"c", ["c"]>,
- ...
- ]>;
-
-For example, without those definitions the following command wouldn't work::
-
- $ llvmc hello.cpp
- llvmc: Unknown suffix: cpp
-
-The language map entries are needed only for the tools that are linked from the
-root node. Since a tool can't have multiple output languages, for inner nodes of
-the graph the input and output languages should match. This is enforced at
-compile-time.
-
-Option preprocessor
-===================
-
-It is sometimes useful to run error-checking code before processing the
-compilation graph. For example, if optimization options "-O1" and "-O2" are
-implemented as switches, we might want to output a warning if the user invokes
-the driver with both of these options enabled.
-
-The ``OptionPreprocessor`` feature is reserved specially for these
-occasions. Example (adapted from the built-in Base plugin)::
-
-
- def Preprocess : OptionPreprocessor<
- (case (not (any_switch_on ["O0", "O1", "O2", "O3"])),
- (set_option "O2"),
- (and (switch_on "O3"), (any_switch_on ["O0", "O1", "O2"])),
- (unset_option ["O0", "O1", "O2"]),
- (and (switch_on "O2"), (any_switch_on ["O0", "O1"])),
- (unset_option ["O0", "O1"]),
- (and (switch_on "O1"), (switch_on "O0")),
- (unset_option "O0"))
- >;
-
-Here, ``OptionPreprocessor`` is used to unset all spurious ``-O`` options so
-that they are not forwarded to the compiler. If no optimization options are
-specified, ``-O2`` is enabled.
-
-``OptionPreprocessor`` is basically a single big ``case`` expression, which is
-evaluated only once right after the plugin is loaded. The only allowed actions
-in ``OptionPreprocessor`` are ``error``, ``warning``, and two special actions:
-``unset_option`` and ``set_option``. As their names suggest, they can be used to
-set or unset a given option. To set an option with ``set_option``, use the
-two-argument form: ``(set_option "parameter", VALUE)``. Here, ``VALUE`` can be
-either a string, a string list, or a boolean constant.
-
-For convenience, ``set_option`` and ``unset_option`` also work on lists. That
-is, instead of ``[(unset_option "A"), (unset_option "B")]`` you can use
-``(unset_option ["A", "B"])``. Obviously, ``(set_option ["A", "B"])`` is valid
-only if both ``A`` and ``B`` are switches.
-
-
-More advanced topics
-====================
-
-.. _hooks:
-
-Hooks and environment variables
--------------------------------
-
-Normally, LLVMC executes programs from the system ``PATH``. Sometimes,
-this is not sufficient: for example, we may want to specify tool paths
-or names in the configuration file. This can be easily achieved via
-the hooks mechanism. To write your own hooks, just add their
-definitions to the ``PluginMain.cpp`` or drop a ``.cpp`` file into the
-your plugin directory. Hooks should live in the ``hooks`` namespace
-and have the signature ``std::string hooks::MyHookName ([const char*
-Arg0 [ const char* Arg2 [, ...]]])``. They can be used from the
-``cmd_line`` tool property::
-
- (cmd_line "$CALL(MyHook)/path/to/file -o $CALL(AnotherHook)")
-
-To pass arguments to hooks, use the following syntax::
-
- (cmd_line "$CALL(MyHook, 'Arg1', 'Arg2', 'Arg # 3')/path/to/file -o1 -o2")
-
-It is also possible to use environment variables in the same manner::
-
- (cmd_line "$ENV(VAR1)/path/to/file -o $ENV(VAR2)")
-
-To change the command line string based on user-provided options use
-the ``case`` expression (documented `above`__)::
-
- (cmd_line
- (case
- (switch_on "E"),
- "llvm-g++ -E -x c $INFILE -o $OUTFILE",
- (default),
- "llvm-g++ -c -x c $INFILE -o $OUTFILE -emit-llvm"))
-
-__ case_
-
-.. _priorities:
-
-How plugins are loaded
-----------------------
-
-It is possible for LLVMC plugins to depend on each other. For example,
-one can create edges between nodes defined in some other plugin. To
-make this work, however, that plugin should be loaded first. To
-achieve this, the concept of plugin priority was introduced. By
-default, every plugin has priority zero; to specify the priority
-explicitly, put the following line in your plugin's TableGen file::
-
- def Priority : PluginPriority<$PRIORITY_VALUE>;
- # Where PRIORITY_VALUE is some integer > 0
-
-Plugins are loaded in order of their (increasing) priority, starting
-with 0. Therefore, the plugin with the highest priority value will be
-loaded last.
-
-Debugging
----------
-
-When writing LLVMC plugins, it can be useful to get a visual view of
-the resulting compilation graph. This can be achieved via the command
-line option ``--view-graph``. This command assumes that Graphviz_ and
-Ghostview_ are installed. There is also a ``--write-graph`` option that
-creates a Graphviz source file (``compilation-graph.dot``) in the
-current directory.
-
-Another useful ``llvmc`` option is ``--check-graph``. It checks the
-compilation graph for common errors like mismatched output/input
-language names, multiple default edges and cycles. These checks can't
-be performed at compile-time because the plugins can load code
-dynamically. When invoked with ``--check-graph``, ``llvmc`` doesn't
-perform any compilation tasks and returns the number of encountered
-errors as its status code.
-
-.. _Graphviz: http://www.graphviz.org/
-.. _Ghostview: http://pages.cs.wisc.edu/~ghost/
-
-Conditioning on the executable name
------------------------------------
-
-For now, the executable name (the value passed to the driver in ``argv[0]``) is
-accessible only in the C++ code (i.e. hooks). Use the following code::
-
- namespace llvmc {
- extern const char* ProgramName;
- }
-
- namespace hooks {
-
- std::string MyHook() {
- //...
- if (strcmp(ProgramName, "mydriver") == 0) {
- //...
-
- }
-
- } // end namespace hooks
-
-In general, you're encouraged not to make the behaviour dependent on the
-executable file name, and use command-line switches instead. See for example how
-the ``Base`` plugin behaves when it needs to choose the correct linker options
-(think ``g++`` vs. ``gcc``).
-
-.. raw:: html
-
- <hr />
- <address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer">
- <img src="http://jigsaw.w3.org/css-validator/images/vcss-blue"
- alt="Valid CSS" /></a>
- <a href="http://validator.w3.org/check?uri=referer">
- <img src="http://www.w3.org/Icons/valid-xhtml10-blue"
- alt="Valid XHTML 1.0 Transitional"/></a>
-
- <a href="mailto:foldr@codedgers.com">Mikhail Glushenkov</a><br />
- <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br />
-
- Last modified: $Date: 2008-12-11 11:34:48 -0600 (Thu, 11 Dec 2008) $
- </address>
diff --git a/contrib/llvm/tools/llvmc/doc/LLVMC-Tutorial.rst b/contrib/llvm/tools/llvmc/doc/LLVMC-Tutorial.rst
deleted file mode 100644
index e7e8f08..0000000
--- a/contrib/llvm/tools/llvmc/doc/LLVMC-Tutorial.rst
+++ /dev/null
@@ -1,129 +0,0 @@
-======================
-Tutorial - Using LLVMC
-======================
-..
- This file was automatically generated by rst2html.
- Please do not edit directly!
- The ReST source lives in the directory 'tools/llvmc/doc'.
-
-.. contents::
-
-.. raw:: html
-
- <div class="doc_author">
- <p>Written by <a href="mailto:foldr@codedgers.com">Mikhail Glushenkov</a></p>
- </div>
-
-Introduction
-============
-
-LLVMC is a generic compiler driver, which plays the same role for LLVM
-as the ``gcc`` program does for GCC - the difference being that LLVMC
-is designed to be more adaptable and easier to customize. Most of
-LLVMC functionality is implemented via plugins, which can be loaded
-dynamically or compiled in. This tutorial describes the basic usage
-and configuration of LLVMC.
-
-
-Compiling with LLVMC
-====================
-
-In general, LLVMC tries to be command-line compatible with ``gcc`` as
-much as possible, so most of the familiar options work::
-
- $ llvmc -O3 -Wall hello.cpp
- $ ./a.out
- hello
-
-This will invoke ``llvm-g++`` under the hood (you can see which
-commands are executed by using the ``-v`` option). For further help on
-command-line LLVMC usage, refer to the ``llvmc --help`` output.
-
-
-Using LLVMC to generate toolchain drivers
-=========================================
-
-LLVMC plugins are written mostly using TableGen_, so you need to
-be familiar with it to get anything done.
-
-.. _TableGen: http://llvm.org/docs/TableGenFundamentals.html
-
-Start by compiling ``example/Simple``, which is a primitive wrapper for
-``gcc``::
-
- $ cd $LLVM_DIR/tools/llvmc
- $ cp -r example/Simple plugins/Simple
-
- # NB: A less verbose way to compile standalone LLVMC-based drivers is
- # described in the reference manual.
-
- $ make LLVMC_BASED_DRIVER_NAME=mygcc LLVMC_BUILTIN_PLUGINS=Simple
- $ cat > hello.c
- [...]
- $ mygcc hello.c
- $ ./hello.out
- Hello
-
-Here we link our plugin with the LLVMC core statically to form an executable
-file called ``mygcc``. It is also possible to build our plugin as a dynamic
-library to be loaded by the ``llvmc`` executable (or any other LLVMC-based
-standalone driver); this is described in the reference manual.
-
-Contents of the file ``Simple.td`` look like this::
-
- // Include common definitions
- include "llvm/CompilerDriver/Common.td"
-
- // Tool descriptions
- def gcc : Tool<
- [(in_language "c"),
- (out_language "executable"),
- (output_suffix "out"),
- (cmd_line "gcc $INFILE -o $OUTFILE"),
- (sink)
- ]>;
-
- // Language map
- def LanguageMap : LanguageMap<[LangToSuffixes<"c", ["c"]>]>;
-
- // Compilation graph
- def CompilationGraph : CompilationGraph<[Edge<"root", "gcc">]>;
-
-As you can see, this file consists of three parts: tool descriptions,
-language map, and the compilation graph definition.
-
-At the heart of LLVMC is the idea of a compilation graph: vertices in
-this graph are tools, and edges represent a transformation path
-between two tools (for example, assembly source produced by the
-compiler can be transformed into executable code by an assembler). The
-compilation graph is basically a list of edges; a special node named
-``root`` is used to mark graph entry points.
-
-Tool descriptions are represented as property lists: most properties
-in the example above should be self-explanatory; the ``sink`` property
-means that all options lacking an explicit description should be
-forwarded to this tool.
-
-The ``LanguageMap`` associates a language name with a list of suffixes
-and is used for deciding which toolchain corresponds to a given input
-file.
-
-To learn more about LLVMC customization, refer to the reference
-manual and plugin source code in the ``plugins`` directory.
-
-.. raw:: html
-
- <hr />
- <address>
- <a href="http://jigsaw.w3.org/css-validator/check/referer">
- <img src="http://jigsaw.w3.org/css-validator/images/vcss-blue"
- alt="Valid CSS" /></a>
- <a href="http://validator.w3.org/check?uri=referer">
- <img src="http://www.w3.org/Icons/valid-xhtml10-blue"
- alt="Valid XHTML 1.0 Transitional"/></a>
-
- <a href="mailto:foldr@codedgers.com">Mikhail Glushenkov</a><br />
- <a href="http://llvm.org">LLVM Compiler Infrastructure</a><br />
-
- Last modified: $Date: 2008-12-11 11:34:48 -0600 (Thu, 11 Dec 2008) $
- </address>
diff --git a/contrib/llvm/tools/llvmc/doc/Makefile b/contrib/llvm/tools/llvmc/doc/Makefile
deleted file mode 100644
index ef98767..0000000
--- a/contrib/llvm/tools/llvmc/doc/Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
-##===- tools/llvmc/doc/Makefile ----------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL=../../..
-
-ifneq (,$(strip $(wildcard $(LEVEL)/Makefile.config)))
-include $(LEVEL)/Makefile.config
-else
-CP=cp
-RM=rm
-endif
-
-DOC_DIR=../../../docs
-RST2HTML=rst2html --stylesheet=llvm.css --link-stylesheet
-
-all : LLVMC-Reference.html LLVMC-Tutorial.html
- $(CP) LLVMC-Reference.html $(DOC_DIR)/CompilerDriver.html
- $(CP) LLVMC-Tutorial.html $(DOC_DIR)/CompilerDriverTutorial.html
-
-LLVMC-Tutorial.html : LLVMC-Tutorial.rst
- $(RST2HTML) $< $@
-
-LLVMC-Reference.html : LLVMC-Reference.rst
- $(RST2HTML) $< $@
-
-clean :
- $(RM) LLVMC-Tutorial.html LLVMC-Reference.html
diff --git a/contrib/llvm/tools/llvmc/doc/img/lines.gif b/contrib/llvm/tools/llvmc/doc/img/lines.gif
deleted file mode 100644
index 88f491e..0000000
--- a/contrib/llvm/tools/llvmc/doc/img/lines.gif
+++ /dev/null
Binary files differ
diff --git a/contrib/llvm/tools/llvmc/src/AutoGenerated.td b/contrib/llvm/tools/llvmc/src/AutoGenerated.td
deleted file mode 100644
index 8507b1f..0000000
--- a/contrib/llvm/tools/llvmc/src/AutoGenerated.td
+++ /dev/null
@@ -1,17 +0,0 @@
-//===- AutoGenerated.td - LLVMC toolchain descriptions -----*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains compilation graph description used by llvmc.
-//
-//===----------------------------------------------------------------------===//
-
-include "llvm/CompilerDriver/Common.td"
-
-include "Base.td"
-include "Clang.td"
diff --git a/contrib/llvm/tools/llvmc/src/Base.td.in b/contrib/llvm/tools/llvmc/src/Base.td.in
deleted file mode 100644
index 0c4de4c..0000000
--- a/contrib/llvm/tools/llvmc/src/Base.td.in
+++ /dev/null
@@ -1,382 +0,0 @@
-//===- Base.td - LLVMC toolchain descriptions --------------*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains compilation graph description used by llvmc.
-//
-//===----------------------------------------------------------------------===//
-
-
-// Options
-
-def OptList : OptionList<[
- (switch_option "emit-llvm",
- (help "Emit LLVM .ll files instead of native object files")),
- (switch_option "E",
- (help "Stop after the preprocessing stage, do not run the compiler")),
- (switch_option "fsyntax-only",
- (help "Stop after checking the input for syntax errors")),
- (switch_option "opt",
- (help "Enable opt")),
- (switch_option "O0",
- (help "Turn off optimization"), (zero_or_more)),
- (switch_option "O1",
- (help "Optimization level 1"), (zero_or_more)),
- (switch_option "O2",
- (help "Optimization level 2"), (zero_or_more)),
- (switch_option "O3",
- (help "Optimization level 3"), (zero_or_more)),
- (switch_option "S",
- (help "Stop after compilation, do not assemble")),
- (switch_option "c",
- (help "Compile and assemble, but do not link")),
- (switch_option "pthread",
- (help "Enable threads")),
- (switch_option "m32",
- (help "Generate code for a 32-bit environment"), (hidden)),
- (switch_option "m64",
- (help "Generate code for a 64-bit environment"), (hidden)),
- (switch_option "fPIC",
- (help "Relocation model: PIC"), (hidden)),
- (switch_option "mdynamic-no-pic",
- (help "Relocation model: dynamic-no-pic"), (hidden)),
- (switch_option "shared",
- (help "Create a DLL instead of the regular executable")),
- (parameter_option "linker",
- (help "Choose linker (possible values: gcc, g++)")),
- (parameter_option "mtune",
- (help "Target a specific CPU type"), (hidden), (forward_not_split)),
-
- // TODO: Add a conditional compilation mechanism to make Darwin-only options
- // like '-arch' really Darwin-only.
-
- (parameter_option "arch",
- (help "Compile for the specified target architecture"), (hidden)),
- (parameter_option "march",
- (help "A synonym for -mtune"), (hidden), (forward_not_split)),
- (parameter_option "mcpu",
- (help "A deprecated synonym for -mtune"), (hidden), (forward_not_split)),
- (switch_option "mfix-and-continue",
- (help "Needed by gdb to load .o files dynamically"), (hidden)),
- (parameter_option "MF",
- (help "Specify a file to write dependencies to"), (hidden)),
- (parameter_list_option "MT",
- (help "Change the name of the rule emitted by dependency generation"),
- (hidden)),
- (parameter_list_option "include",
- (help "Include the named file prior to preprocessing")),
- (parameter_list_option "iquote",
- (help "Search dir only for files requested with #inlcude \"file\""),
- (hidden)),
- (parameter_list_option "framework",
- (help "Specifies a framework to link against")),
- (parameter_list_option "weak_framework",
- (help "Specifies a framework to weakly link against"), (hidden)),
- (parameter_option "filelist", (hidden),
- (help "Link the files listed in file")),
- (prefix_list_option "F",
- (help "Add a directory to framework search path")),
- (prefix_list_option "I",
- (help "Add a directory to include path")),
- (prefix_list_option "D",
- (help "Define a macro")),
- (parameter_list_option "Xpreprocessor", (hidden),
- (help "Pass options to preprocessor")),
- (prefix_list_option "Wa,", (comma_separated),
- (help "Pass options to assembler")),
- (parameter_list_option "Xassembler", (hidden),
- (help "Pass options to assembler")),
- (prefix_list_option "Wllc,", (comma_separated),
- (help "Pass options to llc")),
- (prefix_list_option "L",
- (help "Add a directory to link path")),
- (prefix_list_option "l",
- (help "Search a library when linking")),
- (prefix_list_option "Wl,",
- (help "Pass options to linker")),
- (parameter_list_option "Xlinker", (hidden),
- (help "Pass options to linker")),
- (prefix_list_option "Wo,", (comma_separated),
- (help "Pass options to opt")),
- (prefix_list_option "m",
- (help "Enable or disable various extensions (-mmmx, -msse, etc.)"),
- (hidden)),
- (switch_option "dynamiclib", (hidden),
- (help "Produce a dynamic library")),
- (switch_option "prebind", (hidden),
- (help "Prebind all undefined symbols")),
- (switch_option "dead_strip", (hidden),
- (help "Remove unreachable blocks of code")),
- (switch_option "single_module", (hidden),
- (help "Build the library so it contains only one module")),
- (parameter_option "install_name", (hidden),
- (help "File name the library will be installed in")),
- (parameter_option "compatibility_version", (hidden),
- (help "Compatibility version number")),
- (parameter_option "current_version", (hidden),
- (help "Current version number"))
-]>;
-
-// Option preprocessor.
-
-def Preprocess : OptionPreprocessor<
-(case (not (any_switch_on ["O0", "O1", "O2", "O3"])),
- (set_option "O2"),
- (and (switch_on "O3"), (any_switch_on ["O0", "O1", "O2"])),
- (unset_option ["O0", "O1", "O2"]),
- (and (switch_on "O2"), (any_switch_on ["O0", "O1"])),
- (unset_option ["O0", "O1"]),
- (switch_on ["O1", "O0"]),
- (unset_option "O0"))
->;
-
-// Tools
-
-class llvm_gcc_based <string cmd_prefix, string in_lang,
- string E_ext, string out_lang> : Tool<
-[(in_language in_lang),
- (out_language "llvm-bitcode"),
- (output_suffix out_lang),
- (command cmd_prefix),
- (actions
- (case
- (and (not_empty "o"),
- (multiple_input_files), (or (switch_on "S"), (switch_on "c"))),
- (error "cannot specify -o with -c or -S with multiple files"),
- (switch_on "E"),
- [(forward "E"), (stop_compilation), (output_suffix E_ext)],
- (and (switch_on "E"), (empty "o")), (no_out_file),
- (switch_on ["emit-llvm", "S"]),
- [(output_suffix "ll"), (stop_compilation)],
- (switch_on ["emit-llvm", "c"]), (stop_compilation),
- (switch_on "fsyntax-only"), [(forward "fsyntax-only"),
- (no_out_file), (stop_compilation)],
- (switch_on ["S", "emit-llvm"]), [(forward "S"), (forward "emit-llvm")],
- (not (or (switch_on ["S", "emit-llvm"]), (switch_on "fsyntax-only"))),
- [(append_cmd "-c"), (append_cmd "-emit-llvm")],
-
- // Forwards
- (not_empty "Xpreprocessor"), (forward "Xpreprocessor"),
- (not_empty "include"), (forward "include"),
- (not_empty "iquote"), (forward "iquote"),
- (not_empty "save-temps"), (append_cmd "-save-temps"),
- (not_empty "I"), (forward "I"),
- (not_empty "F"), (forward "F"),
- (not_empty "D"), (forward "D"),
- (not_empty "arch"), (forward "arch"),
- (not_empty "march"), (forward "march"),
- (not_empty "mtune"), (forward "mtune"),
- (not_empty "mcpu"), (forward "mcpu"),
- (not_empty "m"), (forward "m"),
- (switch_on "mfix-and-continue"), (forward "mfix-and-continue"),
- (switch_on "m32"), (forward "m32"),
- (switch_on "m64"), (forward "m64"),
- (switch_on "O0"), (forward "O0"),
- (switch_on "O1"), (forward "O1"),
- (switch_on "O2"), (forward "O2"),
- (switch_on "O3"), (forward "O3"),
- (switch_on "fPIC"), (forward "fPIC"),
- (switch_on "mdynamic-no-pic"), (forward "mdynamic-no-pic"),
- (not_empty "MF"), (forward "MF"),
- (not_empty "MT"), (forward "MT"))),
- (sink)
-]>;
-
-def llvm_gcc_c : llvm_gcc_based<"@LLVMGCCCOMMAND@ -x c", "c", "i", "bc">;
-def llvm_gcc_cpp : llvm_gcc_based<"@LLVMGXXCOMMAND@ -x c++", "c++", "i", "bc">;
-def llvm_gcc_m : llvm_gcc_based<"@LLVMGCCCOMMAND@ -x objective-c",
- "objective-c", "mi", "bc">;
-def llvm_gcc_mxx : llvm_gcc_based<"@LLVMGCCCOMMAND@ -x objective-c++",
- "objective-c++", "mi", "bc">;
-
-def llvm_gcc_c_pch : llvm_gcc_based<"@LLVMGCCCOMMAND@ -x c-header",
- "c-header", "i", "gch">;
-def llvm_gcc_cpp_pch : llvm_gcc_based<"@LLVMGXXCOMMAND@ -x c++-header",
- "c++-header",
- "i", "gch">;
-def llvm_gcc_m_pch : llvm_gcc_based<"@LLVMGCCCOMMAND@ -x objective-c-header",
- "objective-c-header",
- "mi", "gch">;
-def llvm_gcc_mxx_pch
- : llvm_gcc_based<"@LLVMGCCCOMMAND@ -x objective-c++-header",
- "objective-c++-header", "mi", "gch">;
-
-def opt : Tool<
-[(in_language "llvm-bitcode"),
- (out_language "llvm-bitcode"),
- (output_suffix "bc"),
- (actions (case (not_empty "Wo,"), (forward_value "Wo,"),
- (switch_on "O1"), (forward "O1"),
- (switch_on "O2"), (forward "O2"),
- (switch_on "O3"), (forward "O3"))),
- (command "opt -f")
-]>;
-
-def llvm_as : Tool<
-[(in_language "llvm-assembler"),
- (out_language "llvm-bitcode"),
- (output_suffix "bc"),
- (command "llvm-as"),
- (actions (case (switch_on "emit-llvm"), (stop_compilation)))
-]>;
-
-def llvm_gcc_assembler : Tool<
-[(in_language "assembler"),
- (out_language "object-code"),
- (output_suffix "o"),
- (command "@LLVMGCCCOMMAND@ -c -x assembler"),
- (actions (case
- (switch_on "c"), (stop_compilation),
- (not_empty "arch"), (forward "arch"),
- (not_empty "Xassembler"), (forward "Xassembler"),
- (switch_on "m32"), (forward "m32"),
- (switch_on "m64"), (forward "m64"),
- (not_empty "Wa,"), (forward "Wa,")))
-]>;
-
-def llc : Tool<
-[(in_language ["llvm-bitcode", "llvm-assembler"]),
- (out_language "assembler"),
- (output_suffix "s"),
- (command "llc"),
- (actions (case
- (switch_on "S"), (stop_compilation),
- (switch_on "O0"), (forward "O0"),
- (switch_on "O1"), (forward "O1"),
- (switch_on "O2"), (forward "O2"),
- (switch_on "O3"), (forward "O3"),
- (switch_on "fPIC"), (append_cmd "-relocation-model=pic"),
- (switch_on "mdynamic-no-pic"),
- (append_cmd "-relocation-model=dynamic-no-pic"),
- (not_empty "march"), (forward_as "mtune", "-mcpu"),
- (not_empty "mtune"), (forward_as "mtune", "-mcpu"),
- (not_empty "mcpu"), (forward "mcpu"),
- (not_empty "m"), (forward_transformed_value "m", "ConvertToMAttr"),
- (not_empty "Wllc,"), (forward_value "Wllc,")))
-]>;
-
-// Base class for linkers
-class llvm_gcc_based_linker <string cmd_prefix, dag on_empty> : Tool<
-[(in_language ["object-code", "static-library", "dynamic-library"]),
- (out_language "executable"),
- (output_suffix "out"),
- (command cmd_prefix),
- (works_on_empty (case (and (not_empty "filelist"), on_empty), true,
- (default), false)),
- (join),
- (actions (case
- (switch_on "pthread"), (append_cmd "-lpthread"),
- (not_empty "L"), (forward "L"),
- (not_empty "F"), (forward "F"),
- (not_empty "arch"), (forward "arch"),
- (not_empty "framework"), (forward "framework"),
- (not_empty "weak_framework"), (forward "weak_framework"),
- (not_empty "filelist"), (forward "filelist"),
- (switch_on "m32"), (forward "m32"),
- (switch_on "m64"), (forward "m64"),
- (not_empty "l"), (forward "l"),
- (not_empty "Xlinker"), (forward "Xlinker"),
- (not_empty "Wl,"), (forward "Wl,"),
- (switch_on "shared"), (forward "shared"),
- (switch_on "dynamiclib"), (forward "dynamiclib"),
- (switch_on "prebind"), (forward "prebind"),
- (switch_on "dead_strip"), (forward "dead_strip"),
- (switch_on "single_module"), (forward "single_module"),
- (not_empty "compatibility_version"),
- (forward "compatibility_version"),
- (not_empty "current_version"), (forward "current_version"),
- (not_empty "install_name"), (forward "install_name")))
-]>;
-
-// Default linker
-def llvm_gcc_linker : llvm_gcc_based_linker<"@LLVMGCCCOMMAND@",
- (not (or (parameter_equals "linker", "g++"),
- (parameter_equals "linker", "c++")))>;
-// Alternative linker for C++
-def llvm_gcc_cpp_linker : llvm_gcc_based_linker<"@LLVMGXXCOMMAND@",
- (or (parameter_equals "linker", "g++"),
- (parameter_equals "linker", "c++"))>;
-
-// Language map
-
-def LanguageMap : LanguageMap<[
- (lang_to_suffixes "c++", ["cc", "cp", "cxx", "cpp", "CPP", "c++", "C"]),
- (lang_to_suffixes "c++-header", "hpp"),
- (lang_to_suffixes "c", "c"),
- (lang_to_suffixes "c-header", "h"),
- (lang_to_suffixes "c-cpp-output", "i"),
- (lang_to_suffixes "objective-c-cpp-output", "mi"),
- (lang_to_suffixes "objective-c++", "mm"),
- (lang_to_suffixes "objective-c++-header", "hmm"),
- (lang_to_suffixes "objective-c", "m"),
- (lang_to_suffixes "objective-c-header", "hm"),
- (lang_to_suffixes "assembler", "s"),
- (lang_to_suffixes "assembler-with-cpp", "S"),
- (lang_to_suffixes "llvm-assembler", "ll"),
- (lang_to_suffixes "llvm-bitcode", "bc"),
- (lang_to_suffixes "object-code", ["o", "*empty*"]),
- (lang_to_suffixes "static-library", ["a", "lib"]),
- (lang_to_suffixes "dynamic-library", ["so", "dylib", "dll"]),
- (lang_to_suffixes "executable", ["out"])
-]>;
-
-// Compilation graph
-
-def CompilationGraph : CompilationGraph<[
- (edge "root", "llvm_gcc_c"),
- (edge "root", "llvm_gcc_assembler"),
- (edge "root", "llvm_gcc_cpp"),
- (edge "root", "llvm_gcc_m"),
- (edge "root", "llvm_gcc_mxx"),
- (edge "root", "llc"),
-
- (edge "root", "llvm_gcc_c_pch"),
- (edge "root", "llvm_gcc_cpp_pch"),
- (edge "root", "llvm_gcc_m_pch"),
- (edge "root", "llvm_gcc_mxx_pch"),
-
- (edge "llvm_gcc_c", "llc"),
- (edge "llvm_gcc_cpp", "llc"),
- (edge "llvm_gcc_m", "llc"),
- (edge "llvm_gcc_mxx", "llc"),
- (edge "llvm_as", "llc"),
-
- (optional_edge "root", "llvm_as",
- (case (switch_on "emit-llvm"), (inc_weight))),
- (optional_edge "llvm_gcc_c", "opt",
- (case (switch_on "opt"), (inc_weight))),
- (optional_edge "llvm_gcc_cpp", "opt",
- (case (switch_on "opt"), (inc_weight))),
- (optional_edge "llvm_gcc_m", "opt",
- (case (switch_on "opt"), (inc_weight))),
- (optional_edge "llvm_gcc_mxx", "opt",
- (case (switch_on "opt"), (inc_weight))),
- (optional_edge "llvm_as", "opt",
- (case (switch_on "opt"), (inc_weight))),
- (edge "opt", "llc"),
-
- (edge "llc", "llvm_gcc_assembler"),
- (edge "llvm_gcc_assembler", "llvm_gcc_linker"),
- (optional_edge "llvm_gcc_assembler", "llvm_gcc_cpp_linker",
- (case
- (or (input_languages_contain "c++"),
- (input_languages_contain "objective-c++")),
- (inc_weight),
- (or (parameter_equals "linker", "g++"),
- (parameter_equals "linker", "c++")), (inc_weight))),
-
-
- (edge "root", "llvm_gcc_linker"),
- (optional_edge "root", "llvm_gcc_cpp_linker",
- (case
- (or (input_languages_contain "c++"),
- (input_languages_contain "objective-c++")),
- (inc_weight),
- (or (parameter_equals "linker", "g++"),
- (parameter_equals "linker", "c++")), (inc_weight)))
-]>;
diff --git a/contrib/llvm/tools/llvmc/src/Clang.td b/contrib/llvm/tools/llvmc/src/Clang.td
deleted file mode 100644
index 1d75743..0000000
--- a/contrib/llvm/tools/llvmc/src/Clang.td
+++ /dev/null
@@ -1,87 +0,0 @@
-//===- Clang.td - LLVMC toolchain descriptions -------------*- tablegen -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains compilation graph description used by llvmc.
-//
-//===----------------------------------------------------------------------===//
-
-
-def Options : OptionList<[
-(switch_option "clang", (help "Use Clang instead of llvm-gcc"))
-]>;
-
-class clang_based<string language, string cmd, string ext_E> : Tool<
-[(in_language language),
- (out_language "llvm-bitcode"),
- (output_suffix "bc"),
- (command cmd),
- (actions (case (switch_on "E"),
- [(forward "E"), (stop_compilation), (output_suffix ext_E)],
- (and (switch_on "E"), (empty "o")), (no_out_file),
- (switch_on "fsyntax-only"), (stop_compilation),
- (switch_on ["S", "emit-llvm"]),
- [(append_cmd "-emit-llvm"),
- (stop_compilation), (output_suffix "ll")],
- (not (switch_on ["S", "emit-llvm"])),
- (append_cmd "-emit-llvm-bc"),
- (switch_on ["c", "emit-llvm"]),
- (stop_compilation),
- (not_empty "include"), (forward "include"),
- (not_empty "I"), (forward "I"))),
- (sink)
-]>;
-
-def clang_c : clang_based<"c", "clang -x c", "i">;
-def clang_cpp : clang_based<"c++", "clang -x c++", "i">;
-def clang_objective_c : clang_based<"objective-c",
- "clang -x objective-c", "mi">;
-def clang_objective_cpp : clang_based<"objective-c++",
- "clang -x objective-c++", "mi">;
-
-def as : Tool<
-[(in_language "assembler"),
- (out_language "object-code"),
- (output_suffix "o"),
- (command "as"),
- (actions (case (not_empty "Wa,"), (forward_value "Wa,"),
- (switch_on "c"), (stop_compilation)))
-]>;
-
-// Default linker
-def llvm_ld : Tool<
-[(in_language "object-code"),
- (out_language "executable"),
- (output_suffix "out"),
- (command "llvm-ld -native -disable-internalize"),
- (actions (case
- (switch_on "pthread"), (append_cmd "-lpthread"),
- (not_empty "L"), (forward "L"),
- (not_empty "l"), (forward "l"),
- (not_empty "Wl,"), (forward_value "Wl,"))),
- (join)
-]>;
-
-// Compilation graph
-
-def ClangCompilationGraph : CompilationGraph<[
- (optional_edge "root", "clang_c",
- (case (switch_on "clang"), (inc_weight))),
- (optional_edge "root", "clang_cpp",
- (case (switch_on "clang"), (inc_weight))),
- (optional_edge "root", "clang_objective_c",
- (case (switch_on "clang"), (inc_weight))),
- (optional_edge "root", "clang_objective_cpp",
- (case (switch_on "clang"), (inc_weight))),
- (edge "clang_c", "llc"),
- (edge "clang_cpp", "llc"),
- (edge "clang_objective_c", "llc"),
- (edge "clang_objective_cpp", "llc"),
- (optional_edge "llc", "as", (case (switch_on "clang"), (inc_weight))),
- (edge "as", "llvm_ld")
-]>;
diff --git a/contrib/llvm/tools/llvmc/src/Hooks.cpp b/contrib/llvm/tools/llvmc/src/Hooks.cpp
deleted file mode 100644
index 661a914..0000000
--- a/contrib/llvm/tools/llvmc/src/Hooks.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <string>
-#include <vector>
-
-namespace hooks {
-typedef std::vector<std::string> StrVec;
-
-/// ConvertToMAttr - Convert -m* and -mno-* to -mattr=+*,-*
-std::string ConvertToMAttr(const StrVec& Opts) {
- std::string out("-mattr=");
-
- bool firstIter = true;
- for (StrVec::const_iterator B = Opts.begin(), E = Opts.end(); B!=E; ++B) {
- const std::string& Arg = *B;
-
- if (firstIter)
- firstIter = false;
- else
- out += ",";
-
- if (Arg.find("no-") == 0 && Arg[3] != 0) {
- out += '-';
- out += Arg.c_str() + 3;
- }
- else {
- out += '+';
- out += Arg;
- }
- }
-
- return out;
-}
-
-}
diff --git a/contrib/llvm/tools/llvmc/src/Main.cpp b/contrib/llvm/tools/llvmc/src/Main.cpp
deleted file mode 100644
index 9f9c71a..0000000
--- a/contrib/llvm/tools/llvmc/src/Main.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-//===--- Main.cpp - The LLVM Compiler Driver -------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open
-// Source License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Just include AutoGenerated.inc and CompilerDriver/Main.inc.
-//
-//===----------------------------------------------------------------------===//
-
-#include "AutoGenerated.inc"
-
-#include "llvm/CompilerDriver/Main.inc"
diff --git a/contrib/llvm/tools/llvmc/src/Makefile b/contrib/llvm/tools/llvmc/src/Makefile
deleted file mode 100644
index f3f3091..0000000
--- a/contrib/llvm/tools/llvmc/src/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-##===- tools/llvmc/src/Makefile ----------------------------*- Makefile -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open
-# Source License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-LEVEL = ../../..
-LLVMC_BASED_DRIVER = llvmc
-BUILT_SOURCES = AutoGenerated.inc
-
-include $(LEVEL)/Makefile.common
diff --git a/contrib/llvm/tools/lto/LTOCodeGenerator.cpp b/contrib/llvm/tools/lto/LTOCodeGenerator.cpp
deleted file mode 100644
index 671348c..0000000
--- a/contrib/llvm/tools/lto/LTOCodeGenerator.cpp
+++ /dev/null
@@ -1,442 +0,0 @@
-//===-LTOCodeGenerator.cpp - LLVM Link Time Optimizer ---------------------===//
-//
-// 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 Link Time Optimization library. This library is
-// intended to be used by linker to optimize code at link time.
-//
-//===----------------------------------------------------------------------===//
-
-#include "LTOModule.h"
-#include "LTOCodeGenerator.h"
-
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Linker.h"
-#include "llvm/LLVMContext.h"
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/ADT/Triple.h"
-#include "llvm/Analysis/Passes.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/MC/MCAsmInfo.h"
-#include "llvm/MC/MCContext.h"
-#include "llvm/Target/Mangler.h"
-#include "llvm/Target/SubtargetFeature.h"
-#include "llvm/Target/TargetOptions.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetRegistry.h"
-#include "llvm/Target/TargetSelect.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/FormattedStream.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/StandardPasses.h"
-#include "llvm/Support/SystemUtils.h"
-#include "llvm/System/Host.h"
-#include "llvm/System/Program.h"
-#include "llvm/System/Signals.h"
-#include "llvm/Config/config.h"
-#include <cstdlib>
-#include <unistd.h>
-#include <fcntl.h>
-
-
-using namespace llvm;
-
-static cl::opt<bool> DisableInline("disable-inlining",
- cl::desc("Do not run the inliner pass"));
-
-
-const char* LTOCodeGenerator::getVersionString()
-{
-#ifdef LLVM_VERSION_INFO
- return PACKAGE_NAME " version " PACKAGE_VERSION ", " LLVM_VERSION_INFO;
-#else
- return PACKAGE_NAME " version " PACKAGE_VERSION;
-#endif
-}
-
-
-LTOCodeGenerator::LTOCodeGenerator()
- : _context(getGlobalContext()),
- _linker("LinkTimeOptimizer", "ld-temp.o", _context), _target(NULL),
- _emitDwarfDebugInfo(false), _scopeRestrictionsDone(false),
- _codeModel(LTO_CODEGEN_PIC_MODEL_DYNAMIC),
- _nativeObjectFile(NULL), _assemblerPath(NULL)
-{
- InitializeAllTargets();
- InitializeAllAsmPrinters();
-}
-
-LTOCodeGenerator::~LTOCodeGenerator()
-{
- delete _target;
- delete _nativeObjectFile;
-}
-
-
-
-bool LTOCodeGenerator::addModule(LTOModule* mod, std::string& errMsg)
-{
- return _linker.LinkInModule(mod->getLLVVMModule(), &errMsg);
-}
-
-
-bool LTOCodeGenerator::setDebugInfo(lto_debug_model debug, std::string& errMsg)
-{
- switch (debug) {
- case LTO_DEBUG_MODEL_NONE:
- _emitDwarfDebugInfo = false;
- return false;
-
- case LTO_DEBUG_MODEL_DWARF:
- _emitDwarfDebugInfo = true;
- return false;
- }
- errMsg = "unknown debug format";
- return true;
-}
-
-
-bool LTOCodeGenerator::setCodePICModel(lto_codegen_model model,
- std::string& errMsg)
-{
- switch (model) {
- case LTO_CODEGEN_PIC_MODEL_STATIC:
- case LTO_CODEGEN_PIC_MODEL_DYNAMIC:
- case LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC:
- _codeModel = model;
- return false;
- }
- errMsg = "unknown pic model";
- return true;
-}
-
-void LTOCodeGenerator::setCpu(const char* mCpu)
-{
- _mCpu = mCpu;
-}
-
-void LTOCodeGenerator::setAssemblerPath(const char* path)
-{
- if ( _assemblerPath )
- delete _assemblerPath;
- _assemblerPath = new sys::Path(path);
-}
-
-void LTOCodeGenerator::setAssemblerArgs(const char** args, int nargs)
-{
- for (int i = 0; i < nargs; ++i) {
- const char *arg = args[i];
- _assemblerArgs.push_back(arg);
- }
-}
-
-void LTOCodeGenerator::addMustPreserveSymbol(const char* sym)
-{
- _mustPreserveSymbols[sym] = 1;
-}
-
-
-bool LTOCodeGenerator::writeMergedModules(const char *path,
- std::string &errMsg) {
- if (determineTarget(errMsg))
- return true;
-
- // mark which symbols can not be internalized
- applyScopeRestrictions();
-
- // create output file
- std::string ErrInfo;
- tool_output_file Out(path, ErrInfo,
- raw_fd_ostream::F_Binary);
- if (!ErrInfo.empty()) {
- errMsg = "could not open bitcode file for writing: ";
- errMsg += path;
- return true;
- }
-
- // write bitcode to it
- WriteBitcodeToFile(_linker.getModule(), Out.os());
- Out.os().close();
-
- if (Out.os().has_error()) {
- errMsg = "could not write bitcode file: ";
- errMsg += path;
- Out.os().clear_error();
- return true;
- }
-
- Out.keep();
- return false;
-}
-
-
-const void* LTOCodeGenerator::compile(size_t* length, std::string& errMsg)
-{
- // make unique temp .s file to put generated assembly code
- sys::Path uniqueAsmPath("lto-llvm.s");
- if ( uniqueAsmPath.createTemporaryFileOnDisk(true, &errMsg) )
- return NULL;
- sys::RemoveFileOnSignal(uniqueAsmPath);
-
- // generate assembly code
- bool genResult = false;
- {
- tool_output_file asmFile(uniqueAsmPath.c_str(), errMsg);
- if (!errMsg.empty())
- return NULL;
- genResult = this->generateAssemblyCode(asmFile.os(), errMsg);
- asmFile.os().close();
- if (asmFile.os().has_error()) {
- asmFile.os().clear_error();
- return NULL;
- }
- asmFile.keep();
- }
- if ( genResult ) {
- uniqueAsmPath.eraseFromDisk();
- return NULL;
- }
-
- // make unique temp .o file to put generated object file
- sys::PathWithStatus uniqueObjPath("lto-llvm.o");
- if ( uniqueObjPath.createTemporaryFileOnDisk(true, &errMsg) ) {
- uniqueAsmPath.eraseFromDisk();
- return NULL;
- }
- sys::RemoveFileOnSignal(uniqueObjPath);
-
- // assemble the assembly code
- const std::string& uniqueObjStr = uniqueObjPath.str();
- bool asmResult = this->assemble(uniqueAsmPath.str(), uniqueObjStr, errMsg);
- if ( !asmResult ) {
- // remove old buffer if compile() called twice
- delete _nativeObjectFile;
-
- // read .o file into memory buffer
- _nativeObjectFile = MemoryBuffer::getFile(uniqueObjStr.c_str(),&errMsg);
- }
-
- // remove temp files
- uniqueAsmPath.eraseFromDisk();
- uniqueObjPath.eraseFromDisk();
-
- // return buffer, unless error
- if ( _nativeObjectFile == NULL )
- return NULL;
- *length = _nativeObjectFile->getBufferSize();
- return _nativeObjectFile->getBufferStart();
-}
-
-
-bool LTOCodeGenerator::assemble(const std::string& asmPath,
- const std::string& objPath, std::string& errMsg)
-{
- sys::Path tool;
- bool needsCompilerOptions = true;
- if ( _assemblerPath ) {
- tool = *_assemblerPath;
- needsCompilerOptions = false;
- } else {
- // find compiler driver
- tool = sys::Program::FindProgramByName("gcc");
- if ( tool.isEmpty() ) {
- errMsg = "can't locate gcc";
- return true;
- }
- }
-
- // build argument list
- std::vector<const char*> args;
- llvm::Triple targetTriple(_linker.getModule()->getTargetTriple());
- const char *arch = targetTriple.getArchNameForAssembler();
-
- args.push_back(tool.c_str());
-
- if (targetTriple.getOS() == Triple::Darwin) {
- // darwin specific command line options
- if (arch != NULL) {
- args.push_back("-arch");
- args.push_back(arch);
- }
- // add -static to assembler command line when code model requires
- if ( (_assemblerPath != NULL) &&
- (_codeModel == LTO_CODEGEN_PIC_MODEL_STATIC) )
- args.push_back("-static");
- }
- if ( needsCompilerOptions ) {
- args.push_back("-c");
- args.push_back("-x");
- args.push_back("assembler");
- } else {
- for (std::vector<std::string>::iterator I = _assemblerArgs.begin(),
- E = _assemblerArgs.end(); I != E; ++I) {
- args.push_back(I->c_str());
- }
- }
- args.push_back("-o");
- args.push_back(objPath.c_str());
- args.push_back(asmPath.c_str());
- args.push_back(0);
-
- // invoke assembler
- if ( sys::Program::ExecuteAndWait(tool, &args[0], 0, 0, 0, 0, &errMsg) ) {
- errMsg = "error in assembly";
- return true;
- }
- return false; // success
-}
-
-
-
-bool LTOCodeGenerator::determineTarget(std::string& errMsg)
-{
- if ( _target == NULL ) {
- std::string Triple = _linker.getModule()->getTargetTriple();
- if (Triple.empty())
- Triple = sys::getHostTriple();
-
- // create target machine from info for merged modules
- const Target *march = TargetRegistry::lookupTarget(Triple, errMsg);
- if ( march == NULL )
- return true;
-
- // The relocation model is actually a static member of TargetMachine
- // and needs to be set before the TargetMachine is instantiated.
- switch( _codeModel ) {
- case LTO_CODEGEN_PIC_MODEL_STATIC:
- TargetMachine::setRelocationModel(Reloc::Static);
- break;
- case LTO_CODEGEN_PIC_MODEL_DYNAMIC:
- TargetMachine::setRelocationModel(Reloc::PIC_);
- break;
- case LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC:
- TargetMachine::setRelocationModel(Reloc::DynamicNoPIC);
- break;
- }
-
- // construct LTModule, hand over ownership of module and target
- SubtargetFeatures Features;
- Features.getDefaultSubtargetFeatures(_mCpu, llvm::Triple(Triple));
- std::string FeatureStr = Features.getString();
- _target = march->createTargetMachine(Triple, FeatureStr);
- }
- return false;
-}
-
-void LTOCodeGenerator::applyScopeRestrictions() {
- if (_scopeRestrictionsDone) return;
- Module *mergedModule = _linker.getModule();
-
- // Start off with a verification pass.
- PassManager passes;
- passes.add(createVerifierPass());
-
- // mark which symbols can not be internalized
- if (!_mustPreserveSymbols.empty()) {
- MCContext Context(*_target->getMCAsmInfo());
- Mangler mangler(Context, *_target->getTargetData());
- std::vector<const char*> mustPreserveList;
- for (Module::iterator f = mergedModule->begin(),
- e = mergedModule->end(); f != e; ++f) {
- if (!f->isDeclaration() &&
- _mustPreserveSymbols.count(mangler.getNameWithPrefix(f)))
- mustPreserveList.push_back(::strdup(f->getNameStr().c_str()));
- }
- for (Module::global_iterator v = mergedModule->global_begin(),
- e = mergedModule->global_end(); v != e; ++v) {
- if (!v->isDeclaration() &&
- _mustPreserveSymbols.count(mangler.getNameWithPrefix(v)))
- mustPreserveList.push_back(::strdup(v->getNameStr().c_str()));
- }
- passes.add(createInternalizePass(mustPreserveList));
- }
-
- // apply scope restrictions
- passes.run(*mergedModule);
-
- _scopeRestrictionsDone = true;
-}
-
-/// Optimize merged modules using various IPO passes
-bool LTOCodeGenerator::generateAssemblyCode(raw_ostream& out,
- std::string& errMsg)
-{
- if ( this->determineTarget(errMsg) )
- return true;
-
- // mark which symbols can not be internalized
- this->applyScopeRestrictions();
-
- Module* mergedModule = _linker.getModule();
-
- // if options were requested, set them
- if ( !_codegenOptions.empty() )
- cl::ParseCommandLineOptions(_codegenOptions.size(),
- const_cast<char **>(&_codegenOptions[0]));
-
- // Instantiate the pass manager to organize the passes.
- PassManager passes;
-
- // Start off with a verification pass.
- passes.add(createVerifierPass());
-
- // Add an appropriate TargetData instance for this module...
- passes.add(new TargetData(*_target->getTargetData()));
-
- createStandardLTOPasses(&passes, /*Internalize=*/ false, !DisableInline,
- /*VerifyEach=*/ false);
-
- // Make sure everything is still good.
- passes.add(createVerifierPass());
-
- FunctionPassManager* codeGenPasses = new FunctionPassManager(mergedModule);
-
- codeGenPasses->add(new TargetData(*_target->getTargetData()));
-
- formatted_raw_ostream Out(out);
-
- if (_target->addPassesToEmitFile(*codeGenPasses, Out,
- TargetMachine::CGFT_AssemblyFile,
- CodeGenOpt::Aggressive)) {
- errMsg = "target file type not supported";
- return true;
- }
-
- // Run our queue of passes all at once now, efficiently.
- passes.run(*mergedModule);
-
- // Run the code generator, and write assembly file
- codeGenPasses->doInitialization();
-
- for (Module::iterator
- it = mergedModule->begin(), e = mergedModule->end(); it != e; ++it)
- if (!it->isDeclaration())
- codeGenPasses->run(*it);
-
- codeGenPasses->doFinalization();
-
- return false; // success
-}
-
-
-/// Optimize merged modules using various IPO passes
-void LTOCodeGenerator::setCodeGenDebugOptions(const char* options)
-{
- for (std::pair<StringRef, StringRef> o = getToken(options);
- !o.first.empty(); o = getToken(o.second)) {
- // ParseCommandLineOptions() expects argv[0] to be program name.
- // Lazily add that.
- if ( _codegenOptions.empty() )
- _codegenOptions.push_back("libLTO");
- _codegenOptions.push_back(strdup(o.first.str().c_str()));
- }
-}
diff --git a/contrib/llvm/tools/lto/LTOCodeGenerator.h b/contrib/llvm/tools/lto/LTOCodeGenerator.h
deleted file mode 100644
index f5b78a6..0000000
--- a/contrib/llvm/tools/lto/LTOCodeGenerator.h
+++ /dev/null
@@ -1,72 +0,0 @@
-//===-LTOCodeGenerator.h - LLVM Link Time Optimizer -----------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the LTOCodeGenerator class.
-//
-//===----------------------------------------------------------------------===//
-
-
-#ifndef LTO_CODE_GENERATOR_H
-#define LTO_CODE_GENERATOR_H
-
-#include "llvm/Linker.h"
-#include "llvm/LLVMContext.h"
-#include "llvm/ADT/StringMap.h"
-#include "llvm/ADT/SmallVector.h"
-
-#include <string>
-
-
-//
-// C++ class which implements the opaque lto_code_gen_t
-//
-
-struct LTOCodeGenerator {
- static const char* getVersionString();
-
- LTOCodeGenerator();
- ~LTOCodeGenerator();
-
- bool addModule(struct LTOModule*, std::string& errMsg);
- bool setDebugInfo(lto_debug_model, std::string& errMsg);
- bool setCodePICModel(lto_codegen_model, std::string& errMsg);
- void setCpu(const char *cpu);
- void setAssemblerPath(const char* path);
- void setAssemblerArgs(const char** args, int nargs);
- void addMustPreserveSymbol(const char* sym);
- bool writeMergedModules(const char* path,
- std::string& errMsg);
- const void* compile(size_t* length, std::string& errMsg);
- void setCodeGenDebugOptions(const char *opts);
-private:
- bool generateAssemblyCode(llvm::raw_ostream& out,
- std::string& errMsg);
- bool assemble(const std::string& asmPath,
- const std::string& objPath, std::string& errMsg);
- void applyScopeRestrictions();
- bool determineTarget(std::string& errMsg);
-
- typedef llvm::StringMap<uint8_t> StringSet;
-
- llvm::LLVMContext& _context;
- llvm::Linker _linker;
- llvm::TargetMachine* _target;
- bool _emitDwarfDebugInfo;
- bool _scopeRestrictionsDone;
- lto_codegen_model _codeModel;
- StringSet _mustPreserveSymbols;
- llvm::MemoryBuffer* _nativeObjectFile;
- std::vector<const char*> _codegenOptions;
- llvm::sys::Path* _assemblerPath;
- std::string _mCpu;
- std::vector<std::string> _assemblerArgs;
-};
-
-#endif // LTO_CODE_GENERATOR_H
-
diff --git a/contrib/llvm/tools/lto/LTOModule.cpp b/contrib/llvm/tools/lto/LTOModule.cpp
deleted file mode 100644
index c7cd585..0000000
--- a/contrib/llvm/tools/lto/LTOModule.cpp
+++ /dev/null
@@ -1,508 +0,0 @@
-//===-- LTOModule.cpp - LLVM Link Time Optimizer --------------------------===//
-//
-// 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 Link Time Optimization library. This library is
-// intended to be used by linker to optimize code at link time.
-//
-//===----------------------------------------------------------------------===//
-
-#include "LTOModule.h"
-
-#include "llvm/Constants.h"
-#include "llvm/LLVMContext.h"
-#include "llvm/Module.h"
-#include "llvm/ADT/OwningPtr.h"
-#include "llvm/ADT/Triple.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Support/SystemUtils.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/MathExtras.h"
-#include "llvm/System/Host.h"
-#include "llvm/System/Path.h"
-#include "llvm/System/Process.h"
-#include "llvm/Target/Mangler.h"
-#include "llvm/Target/SubtargetFeature.h"
-#include "llvm/MC/MCAsmInfo.h"
-#include "llvm/MC/MCContext.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetRegistry.h"
-#include "llvm/Target/TargetSelect.h"
-
-using namespace llvm;
-
-bool LTOModule::isBitcodeFile(const void *mem, size_t length) {
- return llvm::sys::IdentifyFileType((char*)mem, length)
- == llvm::sys::Bitcode_FileType;
-}
-
-bool LTOModule::isBitcodeFile(const char *path) {
- return llvm::sys::Path(path).isBitcodeFile();
-}
-
-bool LTOModule::isBitcodeFileForTarget(const void *mem, size_t length,
- const char *triplePrefix) {
- MemoryBuffer *buffer = makeBuffer(mem, length);
- if (!buffer)
- return false;
- return isTargetMatch(buffer, triplePrefix);
-}
-
-
-bool LTOModule::isBitcodeFileForTarget(const char *path,
- const char *triplePrefix) {
- MemoryBuffer *buffer = MemoryBuffer::getFile(path);
- if (buffer == NULL)
- return false;
- return isTargetMatch(buffer, triplePrefix);
-}
-
-// Takes ownership of buffer.
-bool LTOModule::isTargetMatch(MemoryBuffer *buffer, const char *triplePrefix) {
- OwningPtr<Module> m(getLazyBitcodeModule(buffer, getGlobalContext()));
- // On success, m owns buffer and both are deleted at end of this method.
- if (!m) {
- delete buffer;
- return false;
- }
- std::string actualTarget = m->getTargetTriple();
- return (strncmp(actualTarget.c_str(), triplePrefix,
- strlen(triplePrefix)) == 0);
-}
-
-
-LTOModule::LTOModule(Module *m, TargetMachine *t)
- : _module(m), _target(t), _symbolsParsed(false)
-{
-}
-
-LTOModule *LTOModule::makeLTOModule(const char *path,
- std::string &errMsg) {
- OwningPtr<MemoryBuffer> buffer(MemoryBuffer::getFile(path, &errMsg));
- if (!buffer)
- return NULL;
- return makeLTOModule(buffer.get(), errMsg);
-}
-
-/// makeBuffer - Create a MemoryBuffer from a memory range. MemoryBuffer
-/// requires the byte past end of the buffer to be a zero. We might get lucky
-/// and already be that way, otherwise make a copy. Also if next byte is on a
-/// different page, don't assume it is readable.
-MemoryBuffer *LTOModule::makeBuffer(const void *mem, size_t length) {
- const char *startPtr = (char*)mem;
- const char *endPtr = startPtr+length;
- if (((uintptr_t)endPtr & (sys::Process::GetPageSize()-1)) == 0 ||
- *endPtr != 0)
- return MemoryBuffer::getMemBufferCopy(StringRef(startPtr, length));
-
- return MemoryBuffer::getMemBuffer(StringRef(startPtr, length));
-}
-
-
-LTOModule *LTOModule::makeLTOModule(const void *mem, size_t length,
- std::string &errMsg) {
- OwningPtr<MemoryBuffer> buffer(makeBuffer(mem, length));
- if (!buffer)
- return NULL;
- return makeLTOModule(buffer.get(), errMsg);
-}
-
-LTOModule *LTOModule::makeLTOModule(MemoryBuffer *buffer,
- std::string &errMsg) {
- InitializeAllTargets();
-
- // parse bitcode buffer
- OwningPtr<Module> m(ParseBitcodeFile(buffer, getGlobalContext(), &errMsg));
- if (!m)
- return NULL;
-
- std::string Triple = m->getTargetTriple();
- if (Triple.empty())
- Triple = sys::getHostTriple();
-
- // find machine architecture for this module
- const Target *march = TargetRegistry::lookupTarget(Triple, errMsg);
- if (!march)
- return NULL;
-
- // construct LTModule, hand over ownership of module and target
- SubtargetFeatures Features;
- Features.getDefaultSubtargetFeatures("" /* cpu */, llvm::Triple(Triple));
- std::string FeatureStr = Features.getString();
- TargetMachine *target = march->createTargetMachine(Triple, FeatureStr);
- return new LTOModule(m.take(), target);
-}
-
-
-const char *LTOModule::getTargetTriple() {
- return _module->getTargetTriple().c_str();
-}
-
-void LTOModule::setTargetTriple(const char *triple) {
- _module->setTargetTriple(triple);
-}
-
-void LTOModule::addDefinedFunctionSymbol(Function *f, Mangler &mangler) {
- // add to list of defined symbols
- addDefinedSymbol(f, mangler, true);
-
- // add external symbols referenced by this function.
- for (Function::iterator b = f->begin(); b != f->end(); ++b) {
- for (BasicBlock::iterator i = b->begin(); i != b->end(); ++i) {
- for (unsigned count = 0, total = i->getNumOperands();
- count != total; ++count) {
- findExternalRefs(i->getOperand(count), mangler);
- }
- }
- }
-}
-
-// Get string that data pointer points to.
-bool LTOModule::objcClassNameFromExpression(Constant *c, std::string &name) {
- if (ConstantExpr *ce = dyn_cast<ConstantExpr>(c)) {
- Constant *op = ce->getOperand(0);
- if (GlobalVariable *gvn = dyn_cast<GlobalVariable>(op)) {
- Constant *cn = gvn->getInitializer();
- if (ConstantArray *ca = dyn_cast<ConstantArray>(cn)) {
- if (ca->isCString()) {
- name = ".objc_class_name_" + ca->getAsString();
- return true;
- }
- }
- }
- }
- return false;
-}
-
-// Parse i386/ppc ObjC class data structure.
-void LTOModule::addObjCClass(GlobalVariable *clgv) {
- if (ConstantStruct *c = dyn_cast<ConstantStruct>(clgv->getInitializer())) {
- // second slot in __OBJC,__class is pointer to superclass name
- std::string superclassName;
- if (objcClassNameFromExpression(c->getOperand(1), superclassName)) {
- NameAndAttributes info;
- if (_undefines.find(superclassName.c_str()) == _undefines.end()) {
- const char *symbolName = ::strdup(superclassName.c_str());
- info.name = symbolName;
- info.attributes = LTO_SYMBOL_DEFINITION_UNDEFINED;
- // string is owned by _undefines
- _undefines[info.name] = info;
- }
- }
- // third slot in __OBJC,__class is pointer to class name
- std::string className;
- if (objcClassNameFromExpression(c->getOperand(2), className)) {
- const char *symbolName = ::strdup(className.c_str());
- NameAndAttributes info;
- info.name = symbolName;
- info.attributes = (lto_symbol_attributes)
- (LTO_SYMBOL_PERMISSIONS_DATA |
- LTO_SYMBOL_DEFINITION_REGULAR |
- LTO_SYMBOL_SCOPE_DEFAULT);
- _symbols.push_back(info);
- _defines[info.name] = 1;
- }
- }
-}
-
-
-// Parse i386/ppc ObjC category data structure.
-void LTOModule::addObjCCategory(GlobalVariable *clgv) {
- if (ConstantStruct *c = dyn_cast<ConstantStruct>(clgv->getInitializer())) {
- // second slot in __OBJC,__category is pointer to target class name
- std::string targetclassName;
- if (objcClassNameFromExpression(c->getOperand(1), targetclassName)) {
- NameAndAttributes info;
- if (_undefines.find(targetclassName.c_str()) == _undefines.end()) {
- const char *symbolName = ::strdup(targetclassName.c_str());
- info.name = symbolName;
- info.attributes = LTO_SYMBOL_DEFINITION_UNDEFINED;
- // string is owned by _undefines
- _undefines[info.name] = info;
- }
- }
- }
-}
-
-
-// Parse i386/ppc ObjC class list data structure.
-void LTOModule::addObjCClassRef(GlobalVariable *clgv) {
- std::string targetclassName;
- if (objcClassNameFromExpression(clgv->getInitializer(), targetclassName)) {
- NameAndAttributes info;
- if (_undefines.find(targetclassName.c_str()) == _undefines.end()) {
- const char *symbolName = ::strdup(targetclassName.c_str());
- info.name = symbolName;
- info.attributes = LTO_SYMBOL_DEFINITION_UNDEFINED;
- // string is owned by _undefines
- _undefines[info.name] = info;
- }
- }
-}
-
-
-void LTOModule::addDefinedDataSymbol(GlobalValue *v, Mangler &mangler) {
- // Add to list of defined symbols.
- addDefinedSymbol(v, mangler, false);
-
- // Special case i386/ppc ObjC data structures in magic sections:
- // The issue is that the old ObjC object format did some strange
- // contortions to avoid real linker symbols. For instance, the
- // ObjC class data structure is allocated statically in the executable
- // that defines that class. That data structures contains a pointer to
- // its superclass. But instead of just initializing that part of the
- // struct to the address of its superclass, and letting the static and
- // dynamic linkers do the rest, the runtime works by having that field
- // instead point to a C-string that is the name of the superclass.
- // At runtime the objc initialization updates that pointer and sets
- // it to point to the actual super class. As far as the linker
- // knows it is just a pointer to a string. But then someone wanted the
- // linker to issue errors at build time if the superclass was not found.
- // So they figured out a way in mach-o object format to use an absolute
- // symbols (.objc_class_name_Foo = 0) and a floating reference
- // (.reference .objc_class_name_Bar) to cause the linker into erroring when
- // a class was missing.
- // The following synthesizes the implicit .objc_* symbols for the linker
- // from the ObjC data structures generated by the front end.
- if (v->hasSection() /* && isTargetDarwin */) {
- // special case if this data blob is an ObjC class definition
- if (v->getSection().compare(0, 15, "__OBJC,__class,") == 0) {
- if (GlobalVariable *gv = dyn_cast<GlobalVariable>(v)) {
- addObjCClass(gv);
- }
- }
-
- // special case if this data blob is an ObjC category definition
- else if (v->getSection().compare(0, 18, "__OBJC,__category,") == 0) {
- if (GlobalVariable *gv = dyn_cast<GlobalVariable>(v)) {
- addObjCCategory(gv);
- }
- }
-
- // special case if this data blob is the list of referenced classes
- else if (v->getSection().compare(0, 18, "__OBJC,__cls_refs,") == 0) {
- if (GlobalVariable *gv = dyn_cast<GlobalVariable>(v)) {
- addObjCClassRef(gv);
- }
- }
- }
-
- // add external symbols referenced by this data.
- for (unsigned count = 0, total = v->getNumOperands();
- count != total; ++count) {
- findExternalRefs(v->getOperand(count), mangler);
- }
-}
-
-
-void LTOModule::addDefinedSymbol(GlobalValue *def, Mangler &mangler,
- bool isFunction) {
- // ignore all llvm.* symbols
- if (def->getName().startswith("llvm."))
- return;
-
- // string is owned by _defines
- const char *symbolName = ::strdup(mangler.getNameWithPrefix(def).c_str());
-
- // set alignment part log2() can have rounding errors
- uint32_t align = def->getAlignment();
- uint32_t attr = align ? CountTrailingZeros_32(def->getAlignment()) : 0;
-
- // set permissions part
- if (isFunction)
- attr |= LTO_SYMBOL_PERMISSIONS_CODE;
- else {
- GlobalVariable *gv = dyn_cast<GlobalVariable>(def);
- if (gv && gv->isConstant())
- attr |= LTO_SYMBOL_PERMISSIONS_RODATA;
- else
- attr |= LTO_SYMBOL_PERMISSIONS_DATA;
- }
-
- // set definition part
- if (def->hasWeakLinkage() || def->hasLinkOnceLinkage()) {
- attr |= LTO_SYMBOL_DEFINITION_WEAK;
- }
- else if (def->hasCommonLinkage()) {
- attr |= LTO_SYMBOL_DEFINITION_TENTATIVE;
- }
- else {
- attr |= LTO_SYMBOL_DEFINITION_REGULAR;
- }
-
- // set scope part
- if (def->hasHiddenVisibility())
- attr |= LTO_SYMBOL_SCOPE_HIDDEN;
- else if (def->hasProtectedVisibility())
- attr |= LTO_SYMBOL_SCOPE_PROTECTED;
- else if (def->hasExternalLinkage() || def->hasWeakLinkage()
- || def->hasLinkOnceLinkage() || def->hasCommonLinkage())
- attr |= LTO_SYMBOL_SCOPE_DEFAULT;
- else
- attr |= LTO_SYMBOL_SCOPE_INTERNAL;
-
- // add to table of symbols
- NameAndAttributes info;
- info.name = symbolName;
- info.attributes = (lto_symbol_attributes)attr;
- _symbols.push_back(info);
- _defines[info.name] = 1;
-}
-
-void LTOModule::addAsmGlobalSymbol(const char *name) {
- // only add new define if not already defined
- if (_defines.count(name))
- return;
-
- // string is owned by _defines
- const char *symbolName = ::strdup(name);
- uint32_t attr = LTO_SYMBOL_DEFINITION_REGULAR;
- attr |= LTO_SYMBOL_SCOPE_DEFAULT;
- NameAndAttributes info;
- info.name = symbolName;
- info.attributes = (lto_symbol_attributes)attr;
- _symbols.push_back(info);
- _defines[info.name] = 1;
-}
-
-void LTOModule::addPotentialUndefinedSymbol(GlobalValue *decl,
- Mangler &mangler) {
- // ignore all llvm.* symbols
- if (decl->getName().startswith("llvm."))
- return;
-
- // ignore all aliases
- if (isa<GlobalAlias>(decl))
- return;
-
- std::string name = mangler.getNameWithPrefix(decl);
-
- // we already have the symbol
- if (_undefines.find(name) != _undefines.end())
- return;
-
- NameAndAttributes info;
- // string is owned by _undefines
- info.name = ::strdup(name.c_str());
- if (decl->hasExternalWeakLinkage())
- info.attributes = LTO_SYMBOL_DEFINITION_WEAKUNDEF;
- else
- info.attributes = LTO_SYMBOL_DEFINITION_UNDEFINED;
- _undefines[name] = info;
-}
-
-
-
-// Find external symbols referenced by VALUE. This is a recursive function.
-void LTOModule::findExternalRefs(Value *value, Mangler &mangler) {
- if (GlobalValue *gv = dyn_cast<GlobalValue>(value)) {
- if (!gv->hasExternalLinkage())
- addPotentialUndefinedSymbol(gv, mangler);
- // If this is a variable definition, do not recursively process
- // initializer. It might contain a reference to this variable
- // and cause an infinite loop. The initializer will be
- // processed in addDefinedDataSymbol().
- return;
- }
-
- // GlobalValue, even with InternalLinkage type, may have operands with
- // ExternalLinkage type. Do not ignore these operands.
- if (Constant *c = dyn_cast<Constant>(value)) {
- // Handle ConstantExpr, ConstantStruct, ConstantArry etc.
- for (unsigned i = 0, e = c->getNumOperands(); i != e; ++i)
- findExternalRefs(c->getOperand(i), mangler);
- }
-}
-
-void LTOModule::lazyParseSymbols() {
- if (_symbolsParsed)
- return;
-
- _symbolsParsed = true;
-
- // Use mangler to add GlobalPrefix to names to match linker names.
- MCContext Context(*_target->getMCAsmInfo());
- Mangler mangler(Context, *_target->getTargetData());
-
- // add functions
- for (Module::iterator f = _module->begin(); f != _module->end(); ++f) {
- if (f->isDeclaration())
- addPotentialUndefinedSymbol(f, mangler);
- else
- addDefinedFunctionSymbol(f, mangler);
- }
-
- // add data
- for (Module::global_iterator v = _module->global_begin(),
- e = _module->global_end(); v != e; ++v) {
- if (v->isDeclaration())
- addPotentialUndefinedSymbol(v, mangler);
- else
- addDefinedDataSymbol(v, mangler);
- }
-
- // add asm globals
- const std::string &inlineAsm = _module->getModuleInlineAsm();
- const std::string glbl = ".globl";
- std::string asmSymbolName;
- std::string::size_type pos = inlineAsm.find(glbl, 0);
- while (pos != std::string::npos) {
- // eat .globl
- pos = pos + 6;
-
- // skip white space between .globl and symbol name
- std::string::size_type pbegin = inlineAsm.find_first_not_of(' ', pos);
- if (pbegin == std::string::npos)
- break;
-
- // find end-of-line
- std::string::size_type pend = inlineAsm.find_first_of('\n', pbegin);
- if (pend == std::string::npos)
- break;
-
- asmSymbolName.assign(inlineAsm, pbegin, pend - pbegin);
- addAsmGlobalSymbol(asmSymbolName.c_str());
-
- // search next .globl
- pos = inlineAsm.find(glbl, pend);
- }
-
- // make symbols for all undefines
- for (StringMap<NameAndAttributes>::iterator it=_undefines.begin();
- it != _undefines.end(); ++it) {
- // if this symbol also has a definition, then don't make an undefine
- // because it is a tentative definition
- if (_defines.count(it->getKey()) == 0) {
- NameAndAttributes info = it->getValue();
- _symbols.push_back(info);
- }
- }
-}
-
-
-uint32_t LTOModule::getSymbolCount() {
- lazyParseSymbols();
- return _symbols.size();
-}
-
-
-lto_symbol_attributes LTOModule::getSymbolAttributes(uint32_t index) {
- lazyParseSymbols();
- if (index < _symbols.size())
- return _symbols[index].attributes;
- else
- return lto_symbol_attributes(0);
-}
-
-const char *LTOModule::getSymbolName(uint32_t index) {
- lazyParseSymbols();
- if (index < _symbols.size())
- return _symbols[index].name;
- else
- return NULL;
-}
diff --git a/contrib/llvm/tools/lto/LTOModule.h b/contrib/llvm/tools/lto/LTOModule.h
deleted file mode 100644
index a19acc0..0000000
--- a/contrib/llvm/tools/lto/LTOModule.h
+++ /dev/null
@@ -1,111 +0,0 @@
-//===-LTOModule.h - LLVM Link Time Optimizer ------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the LTOModule class.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LTO_MODULE_H
-#define LTO_MODULE_H
-
-#include "llvm/Module.h"
-#include "llvm/ADT/OwningPtr.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/ADT/StringMap.h"
-
-#include "llvm-c/lto.h"
-
-#include <vector>
-#include <string>
-
-
-// forward references to llvm classes
-namespace llvm {
- class Mangler;
- class MemoryBuffer;
- class GlobalValue;
- class Value;
- class Function;
-}
-
-
-//
-// C++ class which implements the opaque lto_module_t
-//
-struct LTOModule {
-
- static bool isBitcodeFile(const void* mem, size_t length);
- static bool isBitcodeFile(const char* path);
-
- static bool isBitcodeFileForTarget(const void* mem,
- size_t length, const char* triplePrefix);
-
- static bool isBitcodeFileForTarget(const char* path,
- const char* triplePrefix);
-
- static LTOModule* makeLTOModule(const char* path,
- std::string& errMsg);
- static LTOModule* makeLTOModule(const void* mem, size_t length,
- std::string& errMsg);
-
- const char* getTargetTriple();
- void setTargetTriple(const char*);
- uint32_t getSymbolCount();
- lto_symbol_attributes getSymbolAttributes(uint32_t index);
- const char* getSymbolName(uint32_t index);
-
- llvm::Module * getLLVVMModule() { return _module.get(); }
-
-private:
- LTOModule(llvm::Module* m, llvm::TargetMachine* t);
-
- void lazyParseSymbols();
- void addDefinedSymbol(llvm::GlobalValue* def,
- llvm::Mangler& mangler,
- bool isFunction);
- void addPotentialUndefinedSymbol(llvm::GlobalValue* decl,
- llvm::Mangler &mangler);
- void findExternalRefs(llvm::Value* value,
- llvm::Mangler& mangler);
- void addDefinedFunctionSymbol(llvm::Function* f,
- llvm::Mangler &mangler);
- void addDefinedDataSymbol(llvm::GlobalValue* v,
- llvm::Mangler &mangler);
- void addAsmGlobalSymbol(const char *);
- void addObjCClass(llvm::GlobalVariable* clgv);
- void addObjCCategory(llvm::GlobalVariable* clgv);
- void addObjCClassRef(llvm::GlobalVariable* clgv);
- bool objcClassNameFromExpression(llvm::Constant* c,
- std::string& name);
-
- static bool isTargetMatch(llvm::MemoryBuffer* memBuffer,
- const char* triplePrefix);
-
- static LTOModule* makeLTOModule(llvm::MemoryBuffer* buffer,
- std::string& errMsg);
- static llvm::MemoryBuffer* makeBuffer(const void* mem, size_t length);
-
- typedef llvm::StringMap<uint8_t> StringSet;
-
- struct NameAndAttributes {
- const char* name;
- lto_symbol_attributes attributes;
- };
-
- llvm::OwningPtr<llvm::Module> _module;
- llvm::OwningPtr<llvm::TargetMachine> _target;
- bool _symbolsParsed;
- std::vector<NameAndAttributes> _symbols;
- // _defines and _undefines only needed to disambiguate tentative definitions
- StringSet _defines;
- llvm::StringMap<NameAndAttributes> _undefines;
-};
-
-#endif // LTO_MODULE_H
-
diff --git a/contrib/llvm/tools/lto/Makefile b/contrib/llvm/tools/lto/Makefile
deleted file mode 100644
index e157a4c..0000000
--- a/contrib/llvm/tools/lto/Makefile
+++ /dev/null
@@ -1,54 +0,0 @@
-##===- tools/lto/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 = LTO
-
-EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/lto.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
-
-LINK_COMPONENTS := $(TARGETS_TO_BUILD) ipo scalaropts linker bitreader bitwriter
-
-include $(LEVEL)/Makefile.common
-
-ifeq ($(HOST_OS),Darwin)
- # Special hack to allow libLTO to have an offset version number.
- ifdef LLVM_LTO_VERSION_OFFSET
- LTO_LIBRARY_VERSION := $(shell expr $(LLVM_SUBMIT_VERSION) + \
- $(LLVM_LTO_VERSION_OFFSET))
- else
- LTO_LIBRARY_VERSION := $(LLVM_SUBMIT_VERSION)
- endif
-
- # set dylib internal version number to llvmCore submission number
- ifdef LLVM_SUBMIT_VERSION
- LLVMLibsOptions := $(LLVMLibsOptions) -Wl,-current_version \
- -Wl,$(LTO_LIBRARY_VERSION).$(LLVM_SUBMIT_SUBVERSION) \
- -Wl,-compatibility_version -Wl,1
- endif
- # extra options to override libtool defaults
- LLVMLibsOptions := $(LLVMLibsOptions) \
- -Wl,-dead_strip \
- -Wl,-seg1addr -Wl,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 := $(LLVMLibsOptions) \
- -Wl,-install_name \
- -Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)"
- endif
-endif
diff --git a/contrib/llvm/tools/lto/lto.cpp b/contrib/llvm/tools/lto/lto.cpp
deleted file mode 100644
index 3d7ef0a..0000000
--- a/contrib/llvm/tools/lto/lto.cpp
+++ /dev/null
@@ -1,283 +0,0 @@
-//===-lto.cpp - LLVM Link Time Optimizer ----------------------------------===//
-//
-// 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 Link Time Optimization library. This library is
-// intended to be used by linker to optimize code at link time.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm-c/lto.h"
-#include "llvm-c/Core.h"
-
-#include "LTOModule.h"
-#include "LTOCodeGenerator.h"
-
-
-// holds most recent error string
-// *** not thread safe ***
-static std::string sLastErrorString;
-
-
-
-//
-// returns a printable string
-//
-extern const char* lto_get_version()
-{
- return LTOCodeGenerator::getVersionString();
-}
-
-//
-// returns the last error string or NULL if last operation was successful
-//
-const char* lto_get_error_message()
-{
- return sLastErrorString.c_str();
-}
-
-
-
-//
-// validates if a file is a loadable object file
-//
-bool lto_module_is_object_file(const char* path)
-{
- return LTOModule::isBitcodeFile(path);
-}
-
-
-//
-// validates if a file is a loadable object file compilable for requested target
-//
-bool lto_module_is_object_file_for_target(const char* path,
- const char* target_triplet_prefix)
-{
- return LTOModule::isBitcodeFileForTarget(path, target_triplet_prefix);
-}
-
-
-//
-// validates if a buffer is a loadable object file
-//
-bool lto_module_is_object_file_in_memory(const void* mem, size_t length)
-{
- return LTOModule::isBitcodeFile(mem, length);
-}
-
-
-//
-// validates if a buffer is a loadable object file compilable for the target
-//
-bool lto_module_is_object_file_in_memory_for_target(const void* mem,
- size_t length, const char* target_triplet_prefix)
-{
- return LTOModule::isBitcodeFileForTarget(mem, length, target_triplet_prefix);
-}
-
-
-
-//
-// loads an object file from disk
-// returns NULL on error (check lto_get_error_message() for details)
-//
-lto_module_t lto_module_create(const char* path)
-{
- return LTOModule::makeLTOModule(path, sLastErrorString);
-}
-
-
-//
-// loads an object file from memory
-// returns NULL on error (check lto_get_error_message() for details)
-//
-lto_module_t lto_module_create_from_memory(const void* mem, size_t length)
-{
- return LTOModule::makeLTOModule(mem, length, sLastErrorString);
-}
-
-
-//
-// frees all memory for a module
-// upon return the lto_module_t is no longer valid
-//
-void lto_module_dispose(lto_module_t mod)
-{
- delete mod;
-}
-
-
-//
-// returns triplet string which the object module was compiled under
-//
-const char* lto_module_get_target_triple(lto_module_t mod)
-{
- return mod->getTargetTriple();
-}
-
-//
-// sets triple string with which the object will be codegened.
-//
-void lto_module_set_target_triple(lto_module_t mod, const char *triple)
-{
- return mod->setTargetTriple(triple);
-}
-
-
-//
-// returns the number of symbols in the object module
-//
-uint32_t lto_module_get_num_symbols(lto_module_t mod)
-{
- return mod->getSymbolCount();
-}
-
-//
-// returns the name of the ith symbol in the object module
-//
-const char* lto_module_get_symbol_name(lto_module_t mod, uint32_t index)
-{
- return mod->getSymbolName(index);
-}
-
-
-//
-// returns the attributes of the ith symbol in the object module
-//
-lto_symbol_attributes lto_module_get_symbol_attribute(lto_module_t mod,
- uint32_t index)
-{
- return mod->getSymbolAttributes(index);
-}
-
-
-
-
-
-//
-// instantiates a code generator
-// returns NULL if there is an error
-//
-lto_code_gen_t lto_codegen_create(void)
-{
- return new LTOCodeGenerator();
-}
-
-
-
-//
-// frees all memory for a code generator
-// upon return the lto_code_gen_t is no longer valid
-//
-void lto_codegen_dispose(lto_code_gen_t cg)
-{
- delete cg;
-}
-
-
-
-//
-// add an object module to the set of modules for which code will be generated
-// returns true on error (check lto_get_error_message() for details)
-//
-bool lto_codegen_add_module(lto_code_gen_t cg, lto_module_t mod)
-{
- return cg->addModule(mod, sLastErrorString);
-}
-
-
-//
-// sets what if any format of debug info should be generated
-// returns true on error (check lto_get_error_message() for details)
-//
-bool lto_codegen_set_debug_model(lto_code_gen_t cg, lto_debug_model debug)
-{
- return cg->setDebugInfo(debug, sLastErrorString);
-}
-
-
-//
-// sets what code model to generated
-// returns true on error (check lto_get_error_message() for details)
-//
-bool lto_codegen_set_pic_model(lto_code_gen_t cg, lto_codegen_model model)
-{
- return cg->setCodePICModel(model, sLastErrorString);
-}
-
-//
-// sets the cpu to generate code for
-//
-void lto_codegen_set_cpu(lto_code_gen_t cg, const char* cpu)
-{
- return cg->setCpu(cpu);
-}
-
-//
-// sets the path to the assembler tool
-//
-void lto_codegen_set_assembler_path(lto_code_gen_t cg, const char* path)
-{
- cg->setAssemblerPath(path);
-}
-
-
-//
-// sets extra arguments that libLTO should pass to the assembler
-//
-void lto_codegen_set_assembler_args(lto_code_gen_t cg, const char** args,
- int nargs)
-{
- cg->setAssemblerArgs(args, nargs);
-}
-
-//
-// adds to a list of all global symbols that must exist in the final
-// generated code. If a function is not listed there, it might be
-// inlined into every usage and optimized away.
-//
-void lto_codegen_add_must_preserve_symbol(lto_code_gen_t cg, const char* symbol)
-{
- cg->addMustPreserveSymbol(symbol);
-}
-
-
-//
-// writes a new file at the specified path that contains the
-// merged contents of all modules added so far.
-// returns true on error (check lto_get_error_message() for details)
-//
-bool lto_codegen_write_merged_modules(lto_code_gen_t cg, const char* path)
-{
- return cg->writeMergedModules(path, sLastErrorString);
-}
-
-
-//
-// Generates code for all added modules into one native object file.
-// On sucess returns a pointer to a generated mach-o/ELF buffer and
-// length set to the buffer size. The buffer is owned by the
-// lto_code_gen_t and will be freed when lto_codegen_dispose()
-// is called, or lto_codegen_compile() is called again.
-// On failure, returns NULL (check lto_get_error_message() for details).
-//
-extern const void*
-lto_codegen_compile(lto_code_gen_t cg, size_t* length)
-{
- return cg->compile(length, sLastErrorString);
-}
-
-
-//
-// Used to pass extra options to the code generator
-//
-extern void
-lto_codegen_debug_options(lto_code_gen_t cg, const char * opt)
-{
- cg->setCodeGenDebugOptions(opt);
-}
diff --git a/contrib/llvm/tools/lto/lto.exports b/contrib/llvm/tools/lto/lto.exports
deleted file mode 100644
index 4dbf760..0000000
--- a/contrib/llvm/tools/lto/lto.exports
+++ /dev/null
@@ -1,26 +0,0 @@
-lto_get_error_message
-lto_get_version
-lto_module_create
-lto_module_create_from_memory
-lto_module_get_num_symbols
-lto_module_get_symbol_attribute
-lto_module_get_symbol_name
-lto_module_get_target_triple
-lto_module_set_target_triple
-lto_module_is_object_file
-lto_module_is_object_file_for_target
-lto_module_is_object_file_in_memory
-lto_module_is_object_file_in_memory_for_target
-lto_module_dispose
-lto_codegen_add_module
-lto_codegen_add_must_preserve_symbol
-lto_codegen_compile
-lto_codegen_create
-lto_codegen_dispose
-lto_codegen_set_debug_model
-lto_codegen_set_pic_model
-lto_codegen_write_merged_modules
-lto_codegen_debug_options
-lto_codegen_set_assembler_args
-lto_codegen_set_assembler_path
-lto_codegen_set_cpu
diff --git a/contrib/llvm/tools/opt/AnalysisWrappers.cpp b/contrib/llvm/tools/opt/AnalysisWrappers.cpp
deleted file mode 100644
index a2b57bb..0000000
--- a/contrib/llvm/tools/opt/AnalysisWrappers.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-//===- AnalysisWrappers.cpp - Wrappers around non-pass analyses -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines pass wrappers around LLVM analyses that don't make sense to
-// be passes. It provides a nice standard pass interface to these classes so
-// that they can be printed out by analyze.
-//
-// These classes are separated out of analyze.cpp so that it is more clear which
-// code is the integral part of the analyze tool, and which part of the code is
-// just making it so more passes are available.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Analysis/CallGraph.h"
-#include "llvm/Support/raw_ostream.h"
-using namespace llvm;
-
-namespace {
- /// ExternalFunctionsPassedConstants - This pass prints out call sites to
- /// external functions that are called with constant arguments. This can be
- /// useful when looking for standard library functions we should constant fold
- /// or handle in alias analyses.
- struct ExternalFunctionsPassedConstants : public ModulePass {
- static char ID; // Pass ID, replacement for typeid
- ExternalFunctionsPassedConstants() : ModulePass(ID) {}
- virtual bool runOnModule(Module &M) {
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
- if (!I->isDeclaration()) continue;
-
- bool PrintedFn = false;
- for (Value::use_iterator UI = I->use_begin(), E = I->use_end();
- UI != E; ++UI) {
- Instruction *User = dyn_cast<Instruction>(*UI);
- if (!User) continue;
-
- CallSite CS(cast<Value>(User));
- if (!CS) continue;
-
- for (CallSite::arg_iterator AI = CS.arg_begin(),
- E = CS.arg_end(); AI != E; ++AI) {
- if (!isa<Constant>(*AI)) continue;
-
- if (!PrintedFn) {
- errs() << "Function '" << I->getName() << "':\n";
- PrintedFn = true;
- }
- errs() << *User;
- break;
- }
- }
- }
-
- return false;
- }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- }
- };
-}
-
-char ExternalFunctionsPassedConstants::ID = 0;
-static RegisterPass<ExternalFunctionsPassedConstants>
- P1("print-externalfnconstants",
- "Print external fn callsites passed constants");
-
-namespace {
- struct CallGraphPrinter : public ModulePass {
- static char ID; // Pass ID, replacement for typeid
- CallGraphPrinter() : ModulePass(ID) {}
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- AU.addRequiredTransitive<CallGraph>();
- }
- virtual bool runOnModule(Module &M) {
- getAnalysis<CallGraph>().print(errs(), &M);
- return false;
- }
- };
-}
-
-char CallGraphPrinter::ID = 0;
-static RegisterPass<CallGraphPrinter>
- P2("print-callgraph", "Print a call graph");
diff --git a/contrib/llvm/tools/opt/CMakeLists.txt b/contrib/llvm/tools/opt/CMakeLists.txt
deleted file mode 100644
index 0570d0e..0000000
--- a/contrib/llvm/tools/opt/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-set(LLVM_LINK_COMPONENTS bitreader asmparser bitwriter instrumentation scalaropts ipo)
-
-add_llvm_tool(opt
- AnalysisWrappers.cpp
- GraphPrinters.cpp
- PrintSCC.cpp
- opt.cpp
- )
diff --git a/contrib/llvm/tools/opt/GraphPrinters.cpp b/contrib/llvm/tools/opt/GraphPrinters.cpp
deleted file mode 100644
index 9de7d6a..0000000
--- a/contrib/llvm/tools/opt/GraphPrinters.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-//===- GraphPrinters.cpp - DOT printers for various graph types -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines several printers for various different types of graphs used
-// by the LLVM infrastructure. It uses the generic graph interface to convert
-// the graph into a .dot graph. These graphs can then be processed with the
-// "dot" tool to convert them to postscript or some other suitable format.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/GraphWriter.h"
-#include "llvm/Pass.h"
-#include "llvm/Value.h"
-#include "llvm/Analysis/CallGraph.h"
-#include "llvm/Analysis/Dominators.h"
-#include "llvm/Support/raw_ostream.h"
-using namespace llvm;
-
-template<typename GraphType>
-static void WriteGraphToFile(raw_ostream &O, const std::string &GraphName,
- const GraphType &GT) {
- std::string Filename = GraphName + ".dot";
- O << "Writing '" << Filename << "'...";
- std::string ErrInfo;
- tool_output_file F(Filename.c_str(), ErrInfo);
-
- if (ErrInfo.empty()) {
- WriteGraph(F.os(), GT);
- F.os().close();
- if (!F.os().has_error()) {
- O << "\n";
- F.keep();
- return;
- }
- }
- O << " error opening file for writing!\n";
- F.os().clear_error();
-}
-
-
-//===----------------------------------------------------------------------===//
-// Call Graph Printer
-//===----------------------------------------------------------------------===//
-
-namespace llvm {
- template<>
- struct DOTGraphTraits<CallGraph*> : public DefaultDOTGraphTraits {
-
- DOTGraphTraits (bool isSimple=false) : DefaultDOTGraphTraits(isSimple) {}
-
- static std::string getGraphName(CallGraph *F) {
- return "Call Graph";
- }
-
- static std::string getNodeLabel(CallGraphNode *Node, CallGraph *Graph) {
- if (Node->getFunction())
- return ((Value*)Node->getFunction())->getName();
- else
- return "external node";
- }
- };
-}
-
-
-namespace {
- struct CallGraphPrinter : public ModulePass {
- static char ID; // Pass ID, replacement for typeid
- CallGraphPrinter() : ModulePass(ID) {}
-
- virtual bool runOnModule(Module &M) {
- WriteGraphToFile(llvm::errs(), "callgraph", &getAnalysis<CallGraph>());
- return false;
- }
-
- void print(raw_ostream &OS, const llvm::Module*) const {}
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<CallGraph>();
- AU.setPreservesAll();
- }
- };
-}
-
-char CallGraphPrinter::ID = 0;
-static RegisterPass<CallGraphPrinter> P2("dot-callgraph",
- "Print Call Graph to 'dot' file");
-
-//===----------------------------------------------------------------------===//
-// DomInfoPrinter Pass
-//===----------------------------------------------------------------------===//
-
-namespace {
- class DomInfoPrinter : public FunctionPass {
- public:
- static char ID; // Pass identification, replacement for typeid
- DomInfoPrinter() : FunctionPass(ID) {}
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- AU.addRequired<DominatorTree>();
- AU.addRequired<DominanceFrontier>();
-
- }
-
- virtual bool runOnFunction(Function &F) {
- DominatorTree &DT = getAnalysis<DominatorTree>();
- DT.dump();
- DominanceFrontier &DF = getAnalysis<DominanceFrontier>();
- DF.dump();
- return false;
- }
- };
-}
-
-char DomInfoPrinter::ID = 0;
-static RegisterPass<DomInfoPrinter>
-DIP("print-dom-info", "Dominator Info Printer", true, true);
diff --git a/contrib/llvm/tools/opt/Makefile b/contrib/llvm/tools/opt/Makefile
deleted file mode 100644
index 726cad8..0000000
--- a/contrib/llvm/tools/opt/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-##===- tools/opt/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 = opt
-
-LINK_COMPONENTS := bitreader bitwriter asmparser instrumentation scalaropts ipo
-
-include $(LEVEL)/Makefile.common
diff --git a/contrib/llvm/tools/opt/PrintSCC.cpp b/contrib/llvm/tools/opt/PrintSCC.cpp
deleted file mode 100644
index 533f49e..0000000
--- a/contrib/llvm/tools/opt/PrintSCC.cpp
+++ /dev/null
@@ -1,112 +0,0 @@
-//===- PrintSCC.cpp - Enumerate SCCs in some key graphs -------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file provides passes to print out SCCs in a CFG or a CallGraph.
-// Normally, you would not use these passes; instead, you would use the
-// scc_iterator directly to enumerate SCCs and process them in some way. These
-// passes serve three purposes:
-//
-// (1) As a reference for how to use the scc_iterator.
-// (2) To print out the SCCs for a CFG or a CallGraph:
-// analyze -print-cfg-sccs to print the SCCs in each CFG of a module.
-// analyze -print-cfg-sccs -stats to print the #SCCs and the maximum SCC size.
-// analyze -print-cfg-sccs -debug > /dev/null to watch the algorithm in action.
-//
-// and similarly:
-// analyze -print-callgraph-sccs [-stats] [-debug] to print SCCs in the CallGraph
-//
-// (3) To test the scc_iterator.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Pass.h"
-#include "llvm/Module.h"
-#include "llvm/Analysis/CallGraph.h"
-#include "llvm/Support/CFG.h"
-#include "llvm/Support/raw_ostream.h"
-#include "llvm/ADT/SCCIterator.h"
-using namespace llvm;
-
-namespace {
- struct CFGSCC : public FunctionPass {
- static char ID; // Pass identification, replacement for typeid
- CFGSCC() : FunctionPass(ID) {}
- bool runOnFunction(Function& func);
-
- void print(raw_ostream &O, const Module* = 0) const { }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- }
- };
-
- struct CallGraphSCC : public ModulePass {
- static char ID; // Pass identification, replacement for typeid
- CallGraphSCC() : ModulePass(ID) {}
-
- // run - Print out SCCs in the call graph for the specified module.
- bool runOnModule(Module &M);
-
- void print(raw_ostream &O, const Module* = 0) const { }
-
- // getAnalysisUsage - This pass requires the CallGraph.
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- AU.addRequired<CallGraph>();
- }
- };
-}
-
-char CFGSCC::ID = 0;
-static RegisterPass<CFGSCC>
-Y("print-cfg-sccs", "Print SCCs of each function CFG");
-
-char CallGraphSCC::ID = 0;
-static RegisterPass<CallGraphSCC>
-Z("print-callgraph-sccs", "Print SCCs of the Call Graph");
-
-bool CFGSCC::runOnFunction(Function &F) {
- unsigned sccNum = 0;
- errs() << "SCCs for Function " << F.getName() << " in PostOrder:";
- for (scc_iterator<Function*> SCCI = scc_begin(&F),
- E = scc_end(&F); SCCI != E; ++SCCI) {
- std::vector<BasicBlock*> &nextSCC = *SCCI;
- errs() << "\nSCC #" << ++sccNum << " : ";
- for (std::vector<BasicBlock*>::const_iterator I = nextSCC.begin(),
- E = nextSCC.end(); I != E; ++I)
- errs() << (*I)->getName() << ", ";
- if (nextSCC.size() == 1 && SCCI.hasLoop())
- errs() << " (Has self-loop).";
- }
- errs() << "\n";
-
- return true;
-}
-
-
-// run - Print out SCCs in the call graph for the specified module.
-bool CallGraphSCC::runOnModule(Module &M) {
- CallGraphNode* rootNode = getAnalysis<CallGraph>().getRoot();
- unsigned sccNum = 0;
- errs() << "SCCs for the program in PostOrder:";
- for (scc_iterator<CallGraphNode*> SCCI = scc_begin(rootNode),
- E = scc_end(rootNode); SCCI != E; ++SCCI) {
- const std::vector<CallGraphNode*> &nextSCC = *SCCI;
- errs() << "\nSCC #" << ++sccNum << " : ";
- for (std::vector<CallGraphNode*>::const_iterator I = nextSCC.begin(),
- E = nextSCC.end(); I != E; ++I)
- errs() << ((*I)->getFunction() ? (*I)->getFunction()->getNameStr()
- : std::string("external node")) << ", ";
- if (nextSCC.size() == 1 && SCCI.hasLoop())
- errs() << " (Has self-loop).";
- }
- errs() << "\n";
-
- return true;
-}
diff --git a/contrib/llvm/tools/opt/opt.cpp b/contrib/llvm/tools/opt/opt.cpp
deleted file mode 100644
index d837185..0000000
--- a/contrib/llvm/tools/opt/opt.cpp
+++ /dev/null
@@ -1,557 +0,0 @@
-//===- opt.cpp - The LLVM Modular Optimizer -------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Optimizations may be specified an arbitrary number of times on the command
-// line, They are run in the order specified.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/LLVMContext.h"
-#include "llvm/Module.h"
-#include "llvm/PassManager.h"
-#include "llvm/CallGraphSCCPass.h"
-#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Assembly/PrintModulePass.h"
-#include "llvm/Analysis/Verifier.h"
-#include "llvm/Analysis/LoopPass.h"
-#include "llvm/Analysis/CallGraph.h"
-#include "llvm/Target/TargetData.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Support/PassNameParser.h"
-#include "llvm/System/Signals.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/IRReader.h"
-#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/PluginLoader.h"
-#include "llvm/Support/PrettyStackTrace.h"
-#include "llvm/Support/StandardPasses.h"
-#include "llvm/Support/SystemUtils.h"
-#include "llvm/Support/raw_ostream.h"
-#include "llvm/LinkAllPasses.h"
-#include "llvm/LinkAllVMCore.h"
-#include <memory>
-#include <algorithm>
-using namespace llvm;
-
-// The OptimizationList is automatically populated with registered Passes by the
-// PassNameParser.
-//
-static cl::list<const PassInfo*, bool, PassNameParser>
-PassList(cl::desc("Optimizations available:"));
-
-// Other command line options...
-//
-static cl::opt<std::string>
-InputFilename(cl::Positional, cl::desc("<input bitcode file>"),
- cl::init("-"), cl::value_desc("filename"));
-
-static cl::opt<std::string>
-OutputFilename("o", cl::desc("Override output filename"),
- cl::value_desc("filename"));
-
-static cl::opt<bool>
-Force("f", cl::desc("Enable binary output on terminals"));
-
-static cl::opt<bool>
-PrintEachXForm("p", cl::desc("Print module after each transformation"));
-
-static cl::opt<bool>
-NoOutput("disable-output",
- cl::desc("Do not write result bitcode file"), cl::Hidden);
-
-static cl::opt<bool>
-OutputAssembly("S", cl::desc("Write output as LLVM assembly"));
-
-static cl::opt<bool>
-NoVerify("disable-verify", cl::desc("Do not verify result module"), cl::Hidden);
-
-static cl::opt<bool>
-VerifyEach("verify-each", cl::desc("Verify after each transform"));
-
-static cl::opt<bool>
-StripDebug("strip-debug",
- cl::desc("Strip debugger symbol info from translation unit"));
-
-static cl::opt<bool>
-DisableInline("disable-inlining", cl::desc("Do not run the inliner pass"));
-
-static cl::opt<bool>
-DisableOptimizations("disable-opt",
- cl::desc("Do not run any optimization passes"));
-
-static cl::opt<bool>
-DisableInternalize("disable-internalize",
- cl::desc("Do not mark all symbols as internal"));
-
-static cl::opt<bool>
-StandardCompileOpts("std-compile-opts",
- cl::desc("Include the standard compile time optimizations"));
-
-static cl::opt<bool>
-StandardLinkOpts("std-link-opts",
- cl::desc("Include the standard link time optimizations"));
-
-static cl::opt<bool>
-OptLevelO1("O1",
- cl::desc("Optimization level 1. Similar to llvm-gcc -O1"));
-
-static cl::opt<bool>
-OptLevelO2("O2",
- cl::desc("Optimization level 2. Similar to llvm-gcc -O2"));
-
-static cl::opt<bool>
-OptLevelO3("O3",
- cl::desc("Optimization level 3. Similar to llvm-gcc -O3"));
-
-static cl::opt<bool>
-UnitAtATime("funit-at-a-time",
- cl::desc("Enable IPO. This is same as llvm-gcc's -funit-at-a-time"),
- cl::init(true));
-
-static cl::opt<bool>
-DisableSimplifyLibCalls("disable-simplify-libcalls",
- cl::desc("Disable simplify-libcalls"));
-
-static cl::opt<bool>
-Quiet("q", cl::desc("Obsolete option"), cl::Hidden);
-
-static cl::alias
-QuietA("quiet", cl::desc("Alias for -q"), cl::aliasopt(Quiet));
-
-static cl::opt<bool>
-AnalyzeOnly("analyze", cl::desc("Only perform analysis, no optimization"));
-
-static cl::opt<std::string>
-DefaultDataLayout("default-data-layout",
- cl::desc("data layout string to use if not specified by module"),
- cl::value_desc("layout-string"), cl::init(""));
-
-// ---------- Define Printers for module and function passes ------------
-namespace {
-
-struct CallGraphSCCPassPrinter : public CallGraphSCCPass {
- static char ID;
- const PassInfo *PassToPrint;
- raw_ostream &Out;
- CallGraphSCCPassPrinter(const PassInfo *PI, raw_ostream &out) :
- CallGraphSCCPass(ID), PassToPrint(PI), Out(out) {}
-
- virtual bool runOnSCC(CallGraphSCC &SCC) {
- if (!Quiet) {
- Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
-
- for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I) {
- Function *F = (*I)->getFunction();
- if (F)
- getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out,
- F->getParent());
- }
- }
- // Get and print pass...
- return false;
- }
-
- virtual const char *getPassName() const { return "'Pass' Printer"; }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequiredID(PassToPrint->getTypeInfo());
- AU.setPreservesAll();
- }
-};
-
-char CallGraphSCCPassPrinter::ID = 0;
-
-struct ModulePassPrinter : public ModulePass {
- static char ID;
- const PassInfo *PassToPrint;
- raw_ostream &Out;
- ModulePassPrinter(const PassInfo *PI, raw_ostream &out)
- : ModulePass(ID), PassToPrint(PI), Out(out) {}
-
- virtual bool runOnModule(Module &M) {
- if (!Quiet) {
- Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
- getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out, &M);
- }
-
- // Get and print pass...
- return false;
- }
-
- virtual const char *getPassName() const { return "'Pass' Printer"; }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequiredID(PassToPrint->getTypeInfo());
- AU.setPreservesAll();
- }
-};
-
-char ModulePassPrinter::ID = 0;
-struct FunctionPassPrinter : public FunctionPass {
- const PassInfo *PassToPrint;
- raw_ostream &Out;
- static char ID;
- FunctionPassPrinter(const PassInfo *PI, raw_ostream &out)
- : FunctionPass(ID), PassToPrint(PI), Out(out) {}
-
- virtual bool runOnFunction(Function &F) {
- if (!Quiet) {
- Out << "Printing analysis '" << PassToPrint->getPassName()
- << "' for function '" << F.getName() << "':\n";
- }
- // Get and print pass...
- getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out,
- F.getParent());
- return false;
- }
-
- virtual const char *getPassName() const { return "FunctionPass Printer"; }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequiredID(PassToPrint->getTypeInfo());
- AU.setPreservesAll();
- }
-};
-
-char FunctionPassPrinter::ID = 0;
-
-struct LoopPassPrinter : public LoopPass {
- static char ID;
- const PassInfo *PassToPrint;
- raw_ostream &Out;
- LoopPassPrinter(const PassInfo *PI, raw_ostream &out) :
- LoopPass(ID), PassToPrint(PI), Out(out) {}
-
- virtual bool runOnLoop(Loop *L, LPPassManager &LPM) {
- if (!Quiet) {
- Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
- getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out,
- L->getHeader()->getParent()->getParent());
- }
- // Get and print pass...
- return false;
- }
-
- virtual const char *getPassName() const { return "'Pass' Printer"; }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequiredID(PassToPrint->getTypeInfo());
- AU.setPreservesAll();
- }
-};
-
-char LoopPassPrinter::ID = 0;
-
-struct BasicBlockPassPrinter : public BasicBlockPass {
- const PassInfo *PassToPrint;
- raw_ostream &Out;
- static char ID;
- BasicBlockPassPrinter(const PassInfo *PI, raw_ostream &out)
- : BasicBlockPass(ID), PassToPrint(PI), Out(out) {}
-
- virtual bool runOnBasicBlock(BasicBlock &BB) {
- if (!Quiet) {
- Out << "Printing Analysis info for BasicBlock '" << BB.getName()
- << "': Pass " << PassToPrint->getPassName() << ":\n";
- }
-
- // Get and print pass...
- getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out,
- BB.getParent()->getParent());
- return false;
- }
-
- virtual const char *getPassName() const { return "BasicBlockPass Printer"; }
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequiredID(PassToPrint->getTypeInfo());
- AU.setPreservesAll();
- }
-};
-
-char BasicBlockPassPrinter::ID = 0;
-inline void addPass(PassManagerBase &PM, Pass *P) {
- // Add the pass to the pass manager...
- PM.add(P);
-
- // If we are verifying all of the intermediate steps, add the verifier...
- if (VerifyEach) PM.add(createVerifierPass());
-}
-
-/// AddOptimizationPasses - This routine adds optimization passes
-/// based on selected optimization level, OptLevel. This routine
-/// duplicates llvm-gcc behaviour.
-///
-/// OptLevel - Optimization Level
-void AddOptimizationPasses(PassManagerBase &MPM, PassManagerBase &FPM,
- unsigned OptLevel) {
- createStandardFunctionPasses(&FPM, OptLevel);
-
- llvm::Pass *InliningPass = 0;
- if (DisableInline) {
- // No inlining pass
- } else if (OptLevel) {
- unsigned Threshold = 200;
- if (OptLevel > 2)
- Threshold = 250;
- InliningPass = createFunctionInliningPass(Threshold);
- } else {
- InliningPass = createAlwaysInlinerPass();
- }
- createStandardModulePasses(&MPM, OptLevel,
- /*OptimizeSize=*/ false,
- UnitAtATime,
- /*UnrollLoops=*/ OptLevel > 1,
- !DisableSimplifyLibCalls,
- /*HaveExceptions=*/ true,
- InliningPass);
-}
-
-void AddStandardCompilePasses(PassManagerBase &PM) {
- PM.add(createVerifierPass()); // Verify that input is correct
-
- addPass(PM, createLowerSetJmpPass()); // Lower llvm.setjmp/.longjmp
-
- // If the -strip-debug command line option was specified, do it.
- if (StripDebug)
- addPass(PM, createStripSymbolsPass(true));
-
- if (DisableOptimizations) return;
-
- llvm::Pass *InliningPass = !DisableInline ? createFunctionInliningPass() : 0;
-
- // -std-compile-opts adds the same module passes as -O3.
- createStandardModulePasses(&PM, 3,
- /*OptimizeSize=*/ false,
- /*UnitAtATime=*/ true,
- /*UnrollLoops=*/ true,
- /*SimplifyLibCalls=*/ true,
- /*HaveExceptions=*/ true,
- InliningPass);
-}
-
-void AddStandardLinkPasses(PassManagerBase &PM) {
- PM.add(createVerifierPass()); // Verify that input is correct
-
- // If the -strip-debug command line option was specified, do it.
- if (StripDebug)
- addPass(PM, createStripSymbolsPass(true));
-
- if (DisableOptimizations) return;
-
- createStandardLTOPasses(&PM, /*Internalize=*/ !DisableInternalize,
- /*RunInliner=*/ !DisableInline,
- /*VerifyEach=*/ VerifyEach);
-}
-
-} // anonymous namespace
-
-
-//===----------------------------------------------------------------------===//
-// main for opt
-//
-int main(int argc, char **argv) {
- sys::PrintStackTraceOnErrorSignal();
- llvm::PrettyStackTraceProgram X(argc, argv);
-
- if (AnalyzeOnly && NoOutput) {
- errs() << argv[0] << ": analyze mode conflicts with no-output mode.\n";
- return 1;
- }
-
- // Enable debug stream buffering.
- EnableDebugBuffering = true;
-
- llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
- LLVMContext &Context = getGlobalContext();
-
- cl::ParseCommandLineOptions(argc, argv,
- "llvm .bc -> .bc modular optimizer and analysis printer\n");
-
- // Allocate a full target machine description only if necessary.
- // FIXME: The choice of target should be controllable on the command line.
- std::auto_ptr<TargetMachine> target;
-
- SMDiagnostic Err;
-
- // Load the input module...
- std::auto_ptr<Module> M;
- M.reset(ParseIRFile(InputFilename, Err, Context));
-
- if (M.get() == 0) {
- Err.Print(argv[0], errs());
- return 1;
- }
-
- // Figure out what stream we are supposed to write to...
- OwningPtr<tool_output_file> Out;
- if (NoOutput) {
- if (!OutputFilename.empty())
- errs() << "WARNING: The -o (output filename) option is ignored when\n"
- "the --disable-output option is used.\n";
- } else {
- // Default to standard output.
- if (OutputFilename.empty())
- OutputFilename = "-";
-
- std::string ErrorInfo;
- Out.reset(new tool_output_file(OutputFilename.c_str(), ErrorInfo,
- raw_fd_ostream::F_Binary));
- if (!ErrorInfo.empty()) {
- errs() << ErrorInfo << '\n';
- return 1;
- }
- }
-
- // If the output is set to be emitted to standard out, and standard out is a
- // console, print out a warning message and refuse to do it. We don't
- // impress anyone by spewing tons of binary goo to a terminal.
- if (!Force && !NoOutput && !AnalyzeOnly && !OutputAssembly)
- if (CheckBitcodeOutputToConsole(Out->os(), !Quiet))
- NoOutput = true;
-
- // Create a PassManager to hold and optimize the collection of passes we are
- // about to build...
- //
- PassManager Passes;
-
- // Add an appropriate TargetData instance for this module...
- TargetData *TD = 0;
- const std::string &ModuleDataLayout = M.get()->getDataLayout();
- if (!ModuleDataLayout.empty())
- TD = new TargetData(ModuleDataLayout);
- else if (!DefaultDataLayout.empty())
- TD = new TargetData(DefaultDataLayout);
-
- if (TD)
- Passes.add(TD);
-
- OwningPtr<PassManager> FPasses;
- if (OptLevelO1 || OptLevelO2 || OptLevelO3) {
- FPasses.reset(new PassManager());
- if (TD)
- FPasses->add(new TargetData(*TD));
- }
-
- // If the -strip-debug command line option was specified, add it. If
- // -std-compile-opts was also specified, it will handle StripDebug.
- if (StripDebug && !StandardCompileOpts)
- addPass(Passes, createStripSymbolsPass(true));
-
- // Create a new optimization pass for each one specified on the command line
- for (unsigned i = 0; i < PassList.size(); ++i) {
- // Check to see if -std-compile-opts was specified before this option. If
- // so, handle it.
- if (StandardCompileOpts &&
- StandardCompileOpts.getPosition() < PassList.getPosition(i)) {
- AddStandardCompilePasses(Passes);
- StandardCompileOpts = false;
- }
-
- if (StandardLinkOpts &&
- StandardLinkOpts.getPosition() < PassList.getPosition(i)) {
- AddStandardLinkPasses(Passes);
- StandardLinkOpts = false;
- }
-
- if (OptLevelO1 && OptLevelO1.getPosition() < PassList.getPosition(i)) {
- AddOptimizationPasses(Passes, *FPasses, 1);
- OptLevelO1 = false;
- }
-
- if (OptLevelO2 && OptLevelO2.getPosition() < PassList.getPosition(i)) {
- AddOptimizationPasses(Passes, *FPasses, 2);
- OptLevelO2 = false;
- }
-
- if (OptLevelO3 && OptLevelO3.getPosition() < PassList.getPosition(i)) {
- AddOptimizationPasses(Passes, *FPasses, 3);
- OptLevelO3 = false;
- }
-
- const PassInfo *PassInf = PassList[i];
- Pass *P = 0;
- if (PassInf->getNormalCtor())
- P = PassInf->getNormalCtor()();
- else
- errs() << argv[0] << ": cannot create pass: "
- << PassInf->getPassName() << "\n";
- if (P) {
- PassKind Kind = P->getPassKind();
- addPass(Passes, P);
-
- if (AnalyzeOnly) {
- switch (Kind) {
- case PT_BasicBlock:
- Passes.add(new BasicBlockPassPrinter(PassInf, Out->os()));
- break;
- case PT_Loop:
- Passes.add(new LoopPassPrinter(PassInf, Out->os()));
- break;
- case PT_Function:
- Passes.add(new FunctionPassPrinter(PassInf, Out->os()));
- break;
- case PT_CallGraphSCC:
- Passes.add(new CallGraphSCCPassPrinter(PassInf, Out->os()));
- break;
- default:
- Passes.add(new ModulePassPrinter(PassInf, Out->os()));
- break;
- }
- }
- }
-
- if (PrintEachXForm)
- Passes.add(createPrintModulePass(&errs()));
- }
-
- // If -std-compile-opts was specified at the end of the pass list, add them.
- if (StandardCompileOpts) {
- AddStandardCompilePasses(Passes);
- StandardCompileOpts = false;
- }
-
- if (StandardLinkOpts) {
- AddStandardLinkPasses(Passes);
- StandardLinkOpts = false;
- }
-
- if (OptLevelO1)
- AddOptimizationPasses(Passes, *FPasses, 1);
-
- if (OptLevelO2)
- AddOptimizationPasses(Passes, *FPasses, 2);
-
- if (OptLevelO3)
- AddOptimizationPasses(Passes, *FPasses, 3);
-
- if (OptLevelO1 || OptLevelO2 || OptLevelO3)
- FPasses->run(*M.get());
-
- // Check that the module is well formed on completion of optimization
- if (!NoVerify && !VerifyEach)
- Passes.add(createVerifierPass());
-
- // Write bitcode or assembly to the output as the last step...
- if (!NoOutput && !AnalyzeOnly) {
- if (OutputAssembly)
- Passes.add(createPrintModulePass(&Out->os()));
- else
- Passes.add(createBitcodeWriterPass(Out->os()));
- }
-
- // Now that we have all of the passes ready, run them.
- Passes.run(*M.get());
-
- // Declare success.
- if (!NoOutput)
- Out->keep();
-
- return 0;
-}
diff --git a/contrib/llvm/utils/DSAclean.py b/contrib/llvm/utils/DSAclean.py
deleted file mode 100755
index 6c43357..0000000
--- a/contrib/llvm/utils/DSAclean.py
+++ /dev/null
@@ -1,32 +0,0 @@
-#! /usr/bin/python
-
-#changelog:
-#10/13/2005b: replaced the # in tmp(.#*)* with alphanumeric and _, this will then remove
-#nodes such as %tmp.1.i and %tmp._i.3
-#10/13/2005: exntended to remove variables of the form %tmp(.#)* rather than just
-#%tmp.#, i.e. it now will remove %tmp.12.3.15 etc, additionally fixed a spelling error in
-#the comments
-#10/12/2005: now it only removes nodes and edges for which the label is %tmp.# rather
-#than removing all lines for which the lable CONTAINS %tmp.#
-import re
-import sys
-if( len(sys.argv) < 3 ):
- print 'usage is: ./DSAclean <dot_file_to_be_cleaned> <out_put_file>'
- sys.exit(1)
-#get a file object
-input = open(sys.argv[1], 'r')
-output = open(sys.argv[2], 'w')
-#we'll get this one line at a time...while we could just put the whole thing in a string
-#it would kill old computers
-buffer = input.readline()
-while buffer != '':
- if re.compile("label(\s*)=(\s*)\"\s%tmp(.\w*)*(\s*)\"").search(buffer):
- #skip next line, write neither this line nor the next
- buffer = input.readline()
- else:
- #this isn't a tmp Node, we can write it
- output.write(buffer)
- #prepare for the next iteration
- buffer = input.readline()
-input.close()
-output.close()
diff --git a/contrib/llvm/utils/DSAextract.py b/contrib/llvm/utils/DSAextract.py
deleted file mode 100644
index 134e945..0000000
--- a/contrib/llvm/utils/DSAextract.py
+++ /dev/null
@@ -1,111 +0,0 @@
-#! /usr/bin/python
-
-#this is a script to extract given named nodes from a dot file, with
-#the associated edges. An edge is kept iff for edge x -> y
-# x and y are both nodes specified to be kept.
-
-#known issues: if a line contains '->' and is not an edge line
-#problems will occur. If node labels do not begin with
-#Node this also will not work. Since this is designed to work
-#on DSA dot output and not general dot files this is ok.
-#If you want to use this on other files rename the node labels
-#to Node[.*] with a script or something. This also relies on
-#the length of a node name being 13 characters (as it is in all
-#DSA dot output files)
-
-#Note that the name of the node can be any substring of the actual
-#name in the dot file. Thus if you say specify COLLAPSED
-#as a parameter this script will pull out all COLLAPSED
-#nodes in the file
-
-#Specifying escape characters in the name like \n also will not work,
-#as Python
-#will make it \\n, I'm not really sure how to fix this
-
-#currently the script prints the names it is searching for
-#to STDOUT, so you can check to see if they are what you intend
-
-import re
-import string
-import sys
-
-
-if len(sys.argv) < 3:
- print 'usage is ./DSAextract <dot_file_to_modify> \
- <output_file> [list of nodes to extract]'
-
-#open the input file
-input = open(sys.argv[1], 'r')
-
-#construct a set of node names
-node_name_set = set()
-for name in sys.argv[3:]:
- node_name_set |= set([name])
-
-#construct a list of compiled regular expressions from the
-#node_name_set
-regexp_list = []
-for name in node_name_set:
- regexp_list.append(re.compile(name))
-
-#used to see what kind of line we are on
-nodeexp = re.compile('Node')
-#used to check to see if the current line is an edge line
-arrowexp = re.compile('->')
-
-node_set = set()
-
-#read the file one line at a time
-buffer = input.readline()
-while buffer != '':
- #filter out the unecessary checks on all the edge lines
- if not arrowexp.search(buffer):
- #check to see if this is a node we are looking for
- for regexp in regexp_list:
- #if this name is for the current node, add the dot variable name
- #for the node (it will be Node(hex number)) to our set of nodes
- if regexp.search(buffer):
- node_set |= set([re.split('\s+',buffer,2)[1]])
- break
- buffer = input.readline()
-
-
-#test code
-#print '\n'
-
-print node_name_set
-
-#print node_set
-
-
-#open the output file
-output = open(sys.argv[2], 'w')
-#start the second pass over the file
-input = open(sys.argv[1], 'r')
-
-buffer = input.readline()
-while buffer != '':
- #there are three types of lines we are looking for
- #1) node lines, 2) edge lines 3) support lines (like page size, etc)
-
- #is this an edge line?
- #note that this is no completely robust, if a none edge line
- #for some reason contains -> it will be missidentified
- #hand edit the file if this happens
- if arrowexp.search(buffer):
- #check to make sure that both nodes are in the node list
- #if they are print this to output
- nodes = arrowexp.split(buffer)
- nodes[0] = string.strip(nodes[0])
- nodes[1] = string.strip(nodes[1])
- if nodes[0][:13] in node_set and \
- nodes[1][:13] in node_set:
- output.write(buffer)
- elif nodeexp.search(buffer): #this is a node line
- node = re.split('\s+', buffer,2)[1]
- if node in node_set:
- output.write(buffer)
- else: #this is a support line
- output.write(buffer)
- buffer = input.readline()
-
diff --git a/contrib/llvm/utils/FileCheck/CMakeLists.txt b/contrib/llvm/utils/FileCheck/CMakeLists.txt
deleted file mode 100644
index 8fee03f..0000000
--- a/contrib/llvm/utils/FileCheck/CMakeLists.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-add_executable(FileCheck
- FileCheck.cpp
- )
-
-target_link_libraries(FileCheck LLVMSupport LLVMSystem)
-if( MINGW )
- target_link_libraries(FileCheck imagehlp psapi)
-endif( MINGW )
-if( LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD )
- target_link_libraries(FileCheck pthread)
-endif()
diff --git a/contrib/llvm/utils/FileCheck/FileCheck.cpp b/contrib/llvm/utils/FileCheck/FileCheck.cpp
deleted file mode 100644
index cd76d44..0000000
--- a/contrib/llvm/utils/FileCheck/FileCheck.cpp
+++ /dev/null
@@ -1,732 +0,0 @@
-//===- FileCheck.cpp - Check that File's Contents match what is expected --===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// FileCheck does a line-by line check of a file that validates whether it
-// contains the expected content. This is useful for regression tests etc.
-//
-// This program exits with an error status of 2 on error, exit status of 0 if
-// the file matched the expected contents, and exit status of 1 if it did not
-// contain the expected contents.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/PrettyStackTrace.h"
-#include "llvm/Support/Regex.h"
-#include "llvm/Support/SourceMgr.h"
-#include "llvm/Support/raw_ostream.h"
-#include "llvm/System/Signals.h"
-#include "llvm/ADT/SmallString.h"
-#include "llvm/ADT/StringMap.h"
-#include <algorithm>
-using namespace llvm;
-
-static cl::opt<std::string>
-CheckFilename(cl::Positional, cl::desc("<check-file>"), cl::Required);
-
-static cl::opt<std::string>
-InputFilename("input-file", cl::desc("File to check (defaults to stdin)"),
- cl::init("-"), cl::value_desc("filename"));
-
-static cl::opt<std::string>
-CheckPrefix("check-prefix", cl::init("CHECK"),
- cl::desc("Prefix to use from check file (defaults to 'CHECK')"));
-
-static cl::opt<bool>
-NoCanonicalizeWhiteSpace("strict-whitespace",
- cl::desc("Do not treat all horizontal whitespace as equivalent"));
-
-//===----------------------------------------------------------------------===//
-// Pattern Handling Code.
-//===----------------------------------------------------------------------===//
-
-class Pattern {
- SMLoc PatternLoc;
-
- /// FixedStr - If non-empty, this pattern is a fixed string match with the
- /// specified fixed string.
- StringRef FixedStr;
-
- /// RegEx - If non-empty, this is a regex pattern.
- std::string RegExStr;
-
- /// VariableUses - Entries in this vector map to uses of a variable in the
- /// pattern, e.g. "foo[[bar]]baz". In this case, the RegExStr will contain
- /// "foobaz" and we'll get an entry in this vector that tells us to insert the
- /// value of bar at offset 3.
- std::vector<std::pair<StringRef, unsigned> > VariableUses;
-
- /// VariableDefs - Entries in this vector map to definitions of a variable in
- /// the pattern, e.g. "foo[[bar:.*]]baz". In this case, the RegExStr will
- /// contain "foo(.*)baz" and VariableDefs will contain the pair "bar",1. The
- /// index indicates what parenthesized value captures the variable value.
- std::vector<std::pair<StringRef, unsigned> > VariableDefs;
-
-public:
-
- Pattern() { }
-
- bool ParsePattern(StringRef PatternStr, SourceMgr &SM);
-
- /// Match - Match the pattern string against the input buffer Buffer. This
- /// returns the position that is matched or npos if there is no match. If
- /// there is a match, the size of the matched string is returned in MatchLen.
- ///
- /// The VariableTable StringMap provides the current values of filecheck
- /// variables and is updated if this match defines new values.
- size_t Match(StringRef Buffer, size_t &MatchLen,
- StringMap<StringRef> &VariableTable) const;
-
- /// PrintFailureInfo - Print additional information about a failure to match
- /// involving this pattern.
- void PrintFailureInfo(const SourceMgr &SM, StringRef Buffer,
- const StringMap<StringRef> &VariableTable) const;
-
-private:
- static void AddFixedStringToRegEx(StringRef FixedStr, std::string &TheStr);
- bool AddRegExToRegEx(StringRef RegExStr, unsigned &CurParen, SourceMgr &SM);
-
- /// ComputeMatchDistance - Compute an arbitrary estimate for the quality of
- /// matching this pattern at the start of \arg Buffer; a distance of zero
- /// should correspond to a perfect match.
- unsigned ComputeMatchDistance(StringRef Buffer,
- const StringMap<StringRef> &VariableTable) const;
-};
-
-
-bool Pattern::ParsePattern(StringRef PatternStr, SourceMgr &SM) {
- PatternLoc = SMLoc::getFromPointer(PatternStr.data());
-
- // Ignore trailing whitespace.
- while (!PatternStr.empty() &&
- (PatternStr.back() == ' ' || PatternStr.back() == '\t'))
- PatternStr = PatternStr.substr(0, PatternStr.size()-1);
-
- // Check that there is something on the line.
- if (PatternStr.empty()) {
- SM.PrintMessage(PatternLoc, "found empty check string with prefix '" +
- CheckPrefix+":'", "error");
- return true;
- }
-
- // Check to see if this is a fixed string, or if it has regex pieces.
- if (PatternStr.size() < 2 ||
- (PatternStr.find("{{") == StringRef::npos &&
- PatternStr.find("[[") == StringRef::npos)) {
- FixedStr = PatternStr;
- return false;
- }
-
- // Paren value #0 is for the fully matched string. Any new parenthesized
- // values add from their.
- unsigned CurParen = 1;
-
- // Otherwise, there is at least one regex piece. Build up the regex pattern
- // by escaping scary characters in fixed strings, building up one big regex.
- while (!PatternStr.empty()) {
- // RegEx matches.
- if (PatternStr.size() >= 2 &&
- PatternStr[0] == '{' && PatternStr[1] == '{') {
-
- // Otherwise, this is the start of a regex match. Scan for the }}.
- size_t End = PatternStr.find("}}");
- if (End == StringRef::npos) {
- SM.PrintMessage(SMLoc::getFromPointer(PatternStr.data()),
- "found start of regex string with no end '}}'", "error");
- return true;
- }
-
- if (AddRegExToRegEx(PatternStr.substr(2, End-2), CurParen, SM))
- return true;
- PatternStr = PatternStr.substr(End+2);
- continue;
- }
-
- // Named RegEx matches. These are of two forms: [[foo:.*]] which matches .*
- // (or some other regex) and assigns it to the FileCheck variable 'foo'. The
- // second form is [[foo]] which is a reference to foo. The variable name
- // itself must be of the form "[a-zA-Z_][0-9a-zA-Z_]*", otherwise we reject
- // it. This is to catch some common errors.
- if (PatternStr.size() >= 2 &&
- PatternStr[0] == '[' && PatternStr[1] == '[') {
- // Verify that it is terminated properly.
- size_t End = PatternStr.find("]]");
- if (End == StringRef::npos) {
- SM.PrintMessage(SMLoc::getFromPointer(PatternStr.data()),
- "invalid named regex reference, no ]] found", "error");
- return true;
- }
-
- StringRef MatchStr = PatternStr.substr(2, End-2);
- PatternStr = PatternStr.substr(End+2);
-
- // Get the regex name (e.g. "foo").
- size_t NameEnd = MatchStr.find(':');
- StringRef Name = MatchStr.substr(0, NameEnd);
-
- if (Name.empty()) {
- SM.PrintMessage(SMLoc::getFromPointer(Name.data()),
- "invalid name in named regex: empty name", "error");
- return true;
- }
-
- // Verify that the name is well formed.
- for (unsigned i = 0, e = Name.size(); i != e; ++i)
- if (Name[i] != '_' &&
- (Name[i] < 'a' || Name[i] > 'z') &&
- (Name[i] < 'A' || Name[i] > 'Z') &&
- (Name[i] < '0' || Name[i] > '9')) {
- SM.PrintMessage(SMLoc::getFromPointer(Name.data()+i),
- "invalid name in named regex", "error");
- return true;
- }
-
- // Name can't start with a digit.
- if (isdigit(Name[0])) {
- SM.PrintMessage(SMLoc::getFromPointer(Name.data()),
- "invalid name in named regex", "error");
- return true;
- }
-
- // Handle [[foo]].
- if (NameEnd == StringRef::npos) {
- VariableUses.push_back(std::make_pair(Name, RegExStr.size()));
- continue;
- }
-
- // Handle [[foo:.*]].
- VariableDefs.push_back(std::make_pair(Name, CurParen));
- RegExStr += '(';
- ++CurParen;
-
- if (AddRegExToRegEx(MatchStr.substr(NameEnd+1), CurParen, SM))
- return true;
-
- RegExStr += ')';
- }
-
- // Handle fixed string matches.
- // Find the end, which is the start of the next regex.
- size_t FixedMatchEnd = PatternStr.find("{{");
- FixedMatchEnd = std::min(FixedMatchEnd, PatternStr.find("[["));
- AddFixedStringToRegEx(PatternStr.substr(0, FixedMatchEnd), RegExStr);
- PatternStr = PatternStr.substr(FixedMatchEnd);
- continue;
- }
-
- return false;
-}
-
-void Pattern::AddFixedStringToRegEx(StringRef FixedStr, std::string &TheStr) {
- // Add the characters from FixedStr to the regex, escaping as needed. This
- // avoids "leaning toothpicks" in common patterns.
- for (unsigned i = 0, e = FixedStr.size(); i != e; ++i) {
- switch (FixedStr[i]) {
- // These are the special characters matched in "p_ere_exp".
- case '(':
- case ')':
- case '^':
- case '$':
- case '|':
- case '*':
- case '+':
- case '?':
- case '.':
- case '[':
- case '\\':
- case '{':
- TheStr += '\\';
- // FALL THROUGH.
- default:
- TheStr += FixedStr[i];
- break;
- }
- }
-}
-
-bool Pattern::AddRegExToRegEx(StringRef RegexStr, unsigned &CurParen,
- SourceMgr &SM) {
- Regex R(RegexStr);
- std::string Error;
- if (!R.isValid(Error)) {
- SM.PrintMessage(SMLoc::getFromPointer(RegexStr.data()),
- "invalid regex: " + Error, "error");
- return true;
- }
-
- RegExStr += RegexStr.str();
- CurParen += R.getNumMatches();
- return false;
-}
-
-/// Match - Match the pattern string against the input buffer Buffer. This
-/// returns the position that is matched or npos if there is no match. If
-/// there is a match, the size of the matched string is returned in MatchLen.
-size_t Pattern::Match(StringRef Buffer, size_t &MatchLen,
- StringMap<StringRef> &VariableTable) const {
- // If this is a fixed string pattern, just match it now.
- if (!FixedStr.empty()) {
- MatchLen = FixedStr.size();
- return Buffer.find(FixedStr);
- }
-
- // Regex match.
-
- // If there are variable uses, we need to create a temporary string with the
- // actual value.
- StringRef RegExToMatch = RegExStr;
- std::string TmpStr;
- if (!VariableUses.empty()) {
- TmpStr = RegExStr;
-
- unsigned InsertOffset = 0;
- for (unsigned i = 0, e = VariableUses.size(); i != e; ++i) {
- StringMap<StringRef>::iterator it =
- VariableTable.find(VariableUses[i].first);
- // If the variable is undefined, return an error.
- if (it == VariableTable.end())
- return StringRef::npos;
-
- // Look up the value and escape it so that we can plop it into the regex.
- std::string Value;
- AddFixedStringToRegEx(it->second, Value);
-
- // Plop it into the regex at the adjusted offset.
- TmpStr.insert(TmpStr.begin()+VariableUses[i].second+InsertOffset,
- Value.begin(), Value.end());
- InsertOffset += Value.size();
- }
-
- // Match the newly constructed regex.
- RegExToMatch = TmpStr;
- }
-
-
- SmallVector<StringRef, 4> MatchInfo;
- if (!Regex(RegExToMatch, Regex::Newline).match(Buffer, &MatchInfo))
- return StringRef::npos;
-
- // Successful regex match.
- assert(!MatchInfo.empty() && "Didn't get any match");
- StringRef FullMatch = MatchInfo[0];
-
- // If this defines any variables, remember their values.
- for (unsigned i = 0, e = VariableDefs.size(); i != e; ++i) {
- assert(VariableDefs[i].second < MatchInfo.size() &&
- "Internal paren error");
- VariableTable[VariableDefs[i].first] = MatchInfo[VariableDefs[i].second];
- }
-
- MatchLen = FullMatch.size();
- return FullMatch.data()-Buffer.data();
-}
-
-unsigned Pattern::ComputeMatchDistance(StringRef Buffer,
- const StringMap<StringRef> &VariableTable) const {
- // Just compute the number of matching characters. For regular expressions, we
- // just compare against the regex itself and hope for the best.
- //
- // FIXME: One easy improvement here is have the regex lib generate a single
- // example regular expression which matches, and use that as the example
- // string.
- StringRef ExampleString(FixedStr);
- if (ExampleString.empty())
- ExampleString = RegExStr;
-
- // Only compare up to the first line in the buffer, or the string size.
- StringRef BufferPrefix = Buffer.substr(0, ExampleString.size());
- BufferPrefix = BufferPrefix.split('\n').first;
- return BufferPrefix.edit_distance(ExampleString);
-}
-
-void Pattern::PrintFailureInfo(const SourceMgr &SM, StringRef Buffer,
- const StringMap<StringRef> &VariableTable) const{
- // If this was a regular expression using variables, print the current
- // variable values.
- if (!VariableUses.empty()) {
- for (unsigned i = 0, e = VariableUses.size(); i != e; ++i) {
- StringRef Var = VariableUses[i].first;
- StringMap<StringRef>::const_iterator it = VariableTable.find(Var);
- SmallString<256> Msg;
- raw_svector_ostream OS(Msg);
-
- // Check for undefined variable references.
- if (it == VariableTable.end()) {
- OS << "uses undefined variable \"";
- OS.write_escaped(Var) << "\"";;
- } else {
- OS << "with variable \"";
- OS.write_escaped(Var) << "\" equal to \"";
- OS.write_escaped(it->second) << "\"";
- }
-
- SM.PrintMessage(SMLoc::getFromPointer(Buffer.data()), OS.str(), "note",
- /*ShowLine=*/false);
- }
- }
-
- // Attempt to find the closest/best fuzzy match. Usually an error happens
- // because some string in the output didn't exactly match. In these cases, we
- // would like to show the user a best guess at what "should have" matched, to
- // save them having to actually check the input manually.
- size_t NumLinesForward = 0;
- size_t Best = StringRef::npos;
- double BestQuality = 0;
-
- // Use an arbitrary 4k limit on how far we will search.
- for (size_t i = 0, e = std::min(size_t(4096), Buffer.size()); i != e; ++i) {
- if (Buffer[i] == '\n')
- ++NumLinesForward;
-
- // Patterns have leading whitespace stripped, so skip whitespace when
- // looking for something which looks like a pattern.
- if (Buffer[i] == ' ' || Buffer[i] == '\t')
- continue;
-
- // Compute the "quality" of this match as an arbitrary combination of the
- // match distance and the number of lines skipped to get to this match.
- unsigned Distance = ComputeMatchDistance(Buffer.substr(i), VariableTable);
- double Quality = Distance + (NumLinesForward / 100.);
-
- if (Quality < BestQuality || Best == StringRef::npos) {
- Best = i;
- BestQuality = Quality;
- }
- }
-
- // Print the "possible intended match here" line if we found something
- // reasonable and not equal to what we showed in the "scanning from here"
- // line.
- if (Best && Best != StringRef::npos && BestQuality < 50) {
- SM.PrintMessage(SMLoc::getFromPointer(Buffer.data() + Best),
- "possible intended match here", "note");
-
- // FIXME: If we wanted to be really friendly we would show why the match
- // failed, as it can be hard to spot simple one character differences.
- }
-}
-
-//===----------------------------------------------------------------------===//
-// Check Strings.
-//===----------------------------------------------------------------------===//
-
-/// CheckString - This is a check that we found in the input file.
-struct CheckString {
- /// Pat - The pattern to match.
- Pattern Pat;
-
- /// Loc - The location in the match file that the check string was specified.
- SMLoc Loc;
-
- /// IsCheckNext - This is true if this is a CHECK-NEXT: directive (as opposed
- /// to a CHECK: directive.
- bool IsCheckNext;
-
- /// NotStrings - These are all of the strings that are disallowed from
- /// occurring between this match string and the previous one (or start of
- /// file).
- std::vector<std::pair<SMLoc, Pattern> > NotStrings;
-
- CheckString(const Pattern &P, SMLoc L, bool isCheckNext)
- : Pat(P), Loc(L), IsCheckNext(isCheckNext) {}
-};
-
-/// CanonicalizeInputFile - Remove duplicate horizontal space from the specified
-/// memory buffer, free it, and return a new one.
-static MemoryBuffer *CanonicalizeInputFile(MemoryBuffer *MB) {
- SmallString<128> NewFile;
- NewFile.reserve(MB->getBufferSize());
-
- for (const char *Ptr = MB->getBufferStart(), *End = MB->getBufferEnd();
- Ptr != End; ++Ptr) {
- // If C is not a horizontal whitespace, skip it.
- if (*Ptr != ' ' && *Ptr != '\t') {
- NewFile.push_back(*Ptr);
- continue;
- }
-
- // Otherwise, add one space and advance over neighboring space.
- NewFile.push_back(' ');
- while (Ptr+1 != End &&
- (Ptr[1] == ' ' || Ptr[1] == '\t'))
- ++Ptr;
- }
-
- // Free the old buffer and return a new one.
- MemoryBuffer *MB2 =
- MemoryBuffer::getMemBufferCopy(NewFile.str(), MB->getBufferIdentifier());
-
- delete MB;
- return MB2;
-}
-
-
-/// ReadCheckFile - Read the check file, which specifies the sequence of
-/// expected strings. The strings are added to the CheckStrings vector.
-static bool ReadCheckFile(SourceMgr &SM,
- std::vector<CheckString> &CheckStrings) {
- // Open the check file, and tell SourceMgr about it.
- std::string ErrorStr;
- MemoryBuffer *F =
- MemoryBuffer::getFileOrSTDIN(CheckFilename.c_str(), &ErrorStr);
- if (F == 0) {
- errs() << "Could not open check file '" << CheckFilename << "': "
- << ErrorStr << '\n';
- return true;
- }
-
- // If we want to canonicalize whitespace, strip excess whitespace from the
- // buffer containing the CHECK lines.
- if (!NoCanonicalizeWhiteSpace)
- F = CanonicalizeInputFile(F);
-
- SM.AddNewSourceBuffer(F, SMLoc());
-
- // Find all instances of CheckPrefix followed by : in the file.
- StringRef Buffer = F->getBuffer();
-
- std::vector<std::pair<SMLoc, Pattern> > NotMatches;
-
- while (1) {
- // See if Prefix occurs in the memory buffer.
- Buffer = Buffer.substr(Buffer.find(CheckPrefix));
-
- // If we didn't find a match, we're done.
- if (Buffer.empty())
- break;
-
- const char *CheckPrefixStart = Buffer.data();
-
- // When we find a check prefix, keep track of whether we find CHECK: or
- // CHECK-NEXT:
- bool IsCheckNext = false, IsCheckNot = false;
-
- // Verify that the : is present after the prefix.
- if (Buffer[CheckPrefix.size()] == ':') {
- Buffer = Buffer.substr(CheckPrefix.size()+1);
- } else if (Buffer.size() > CheckPrefix.size()+6 &&
- memcmp(Buffer.data()+CheckPrefix.size(), "-NEXT:", 6) == 0) {
- Buffer = Buffer.substr(CheckPrefix.size()+7);
- IsCheckNext = true;
- } else if (Buffer.size() > CheckPrefix.size()+5 &&
- memcmp(Buffer.data()+CheckPrefix.size(), "-NOT:", 5) == 0) {
- Buffer = Buffer.substr(CheckPrefix.size()+6);
- IsCheckNot = true;
- } else {
- Buffer = Buffer.substr(1);
- continue;
- }
-
- // Okay, we found the prefix, yay. Remember the rest of the line, but
- // ignore leading and trailing whitespace.
- Buffer = Buffer.substr(Buffer.find_first_not_of(" \t"));
-
- // Scan ahead to the end of line.
- size_t EOL = Buffer.find_first_of("\n\r");
-
- // Remember the location of the start of the pattern, for diagnostics.
- SMLoc PatternLoc = SMLoc::getFromPointer(Buffer.data());
-
- // Parse the pattern.
- Pattern P;
- if (P.ParsePattern(Buffer.substr(0, EOL), SM))
- return true;
-
- Buffer = Buffer.substr(EOL);
-
-
- // Verify that CHECK-NEXT lines have at least one CHECK line before them.
- if (IsCheckNext && CheckStrings.empty()) {
- SM.PrintMessage(SMLoc::getFromPointer(CheckPrefixStart),
- "found '"+CheckPrefix+"-NEXT:' without previous '"+
- CheckPrefix+ ": line", "error");
- return true;
- }
-
- // Handle CHECK-NOT.
- if (IsCheckNot) {
- NotMatches.push_back(std::make_pair(SMLoc::getFromPointer(Buffer.data()),
- P));
- continue;
- }
-
-
- // Okay, add the string we captured to the output vector and move on.
- CheckStrings.push_back(CheckString(P,
- PatternLoc,
- IsCheckNext));
- std::swap(NotMatches, CheckStrings.back().NotStrings);
- }
-
- if (CheckStrings.empty()) {
- errs() << "error: no check strings found with prefix '" << CheckPrefix
- << ":'\n";
- return true;
- }
-
- if (!NotMatches.empty()) {
- errs() << "error: '" << CheckPrefix
- << "-NOT:' not supported after last check line.\n";
- return true;
- }
-
- return false;
-}
-
-static void PrintCheckFailed(const SourceMgr &SM, const CheckString &CheckStr,
- StringRef Buffer,
- StringMap<StringRef> &VariableTable) {
- // Otherwise, we have an error, emit an error message.
- SM.PrintMessage(CheckStr.Loc, "expected string not found in input",
- "error");
-
- // Print the "scanning from here" line. If the current position is at the
- // end of a line, advance to the start of the next line.
- Buffer = Buffer.substr(Buffer.find_first_not_of(" \t\n\r"));
-
- SM.PrintMessage(SMLoc::getFromPointer(Buffer.data()), "scanning from here",
- "note");
-
- // Allow the pattern to print additional information if desired.
- CheckStr.Pat.PrintFailureInfo(SM, Buffer, VariableTable);
-}
-
-/// CountNumNewlinesBetween - Count the number of newlines in the specified
-/// range.
-static unsigned CountNumNewlinesBetween(StringRef Range) {
- unsigned NumNewLines = 0;
- while (1) {
- // Scan for newline.
- Range = Range.substr(Range.find_first_of("\n\r"));
- if (Range.empty()) return NumNewLines;
-
- ++NumNewLines;
-
- // Handle \n\r and \r\n as a single newline.
- if (Range.size() > 1 &&
- (Range[1] == '\n' || Range[1] == '\r') &&
- (Range[0] != Range[1]))
- Range = Range.substr(1);
- Range = Range.substr(1);
- }
-}
-
-int main(int argc, char **argv) {
- sys::PrintStackTraceOnErrorSignal();
- PrettyStackTraceProgram X(argc, argv);
- cl::ParseCommandLineOptions(argc, argv);
-
- SourceMgr SM;
-
- // Read the expected strings from the check file.
- std::vector<CheckString> CheckStrings;
- if (ReadCheckFile(SM, CheckStrings))
- return 2;
-
- // Open the file to check and add it to SourceMgr.
- std::string ErrorStr;
- MemoryBuffer *F =
- MemoryBuffer::getFileOrSTDIN(InputFilename.c_str(), &ErrorStr);
- if (F == 0) {
- errs() << "Could not open input file '" << InputFilename << "': "
- << ErrorStr << '\n';
- return true;
- }
-
- // Remove duplicate spaces in the input file if requested.
- if (!NoCanonicalizeWhiteSpace)
- F = CanonicalizeInputFile(F);
-
- SM.AddNewSourceBuffer(F, SMLoc());
-
- /// VariableTable - This holds all the current filecheck variables.
- StringMap<StringRef> VariableTable;
-
- // Check that we have all of the expected strings, in order, in the input
- // file.
- StringRef Buffer = F->getBuffer();
-
- const char *LastMatch = Buffer.data();
-
- for (unsigned StrNo = 0, e = CheckStrings.size(); StrNo != e; ++StrNo) {
- const CheckString &CheckStr = CheckStrings[StrNo];
-
- StringRef SearchFrom = Buffer;
-
- // Find StrNo in the file.
- size_t MatchLen = 0;
- Buffer = Buffer.substr(CheckStr.Pat.Match(Buffer, MatchLen, VariableTable));
-
- // If we didn't find a match, reject the input.
- if (Buffer.empty()) {
- PrintCheckFailed(SM, CheckStr, SearchFrom, VariableTable);
- return 1;
- }
-
- StringRef SkippedRegion(LastMatch, Buffer.data()-LastMatch);
-
- // If this check is a "CHECK-NEXT", verify that the previous match was on
- // the previous line (i.e. that there is one newline between them).
- if (CheckStr.IsCheckNext) {
- // Count the number of newlines between the previous match and this one.
- assert(LastMatch != F->getBufferStart() &&
- "CHECK-NEXT can't be the first check in a file");
-
- unsigned NumNewLines = CountNumNewlinesBetween(SkippedRegion);
- if (NumNewLines == 0) {
- SM.PrintMessage(CheckStr.Loc,
- CheckPrefix+"-NEXT: is on the same line as previous match",
- "error");
- SM.PrintMessage(SMLoc::getFromPointer(Buffer.data()),
- "'next' match was here", "note");
- SM.PrintMessage(SMLoc::getFromPointer(LastMatch),
- "previous match was here", "note");
- return 1;
- }
-
- if (NumNewLines != 1) {
- SM.PrintMessage(CheckStr.Loc,
- CheckPrefix+
- "-NEXT: is not on the line after the previous match",
- "error");
- SM.PrintMessage(SMLoc::getFromPointer(Buffer.data()),
- "'next' match was here", "note");
- SM.PrintMessage(SMLoc::getFromPointer(LastMatch),
- "previous match was here", "note");
- return 1;
- }
- }
-
- // If this match had "not strings", verify that they don't exist in the
- // skipped region.
- for (unsigned ChunkNo = 0, e = CheckStr.NotStrings.size();
- ChunkNo != e; ++ChunkNo) {
- size_t MatchLen = 0;
- size_t Pos = CheckStr.NotStrings[ChunkNo].second.Match(SkippedRegion,
- MatchLen,
- VariableTable);
- if (Pos == StringRef::npos) continue;
-
- SM.PrintMessage(SMLoc::getFromPointer(LastMatch+Pos),
- CheckPrefix+"-NOT: string occurred!", "error");
- SM.PrintMessage(CheckStr.NotStrings[ChunkNo].first,
- CheckPrefix+"-NOT: pattern specified here", "note");
- return 1;
- }
-
-
- // Otherwise, everything is good. Step over the matched text and remember
- // the position after the match as the end of the last match.
- Buffer = Buffer.substr(MatchLen);
- LastMatch = Buffer.data();
- }
-
- return 0;
-}
diff --git a/contrib/llvm/utils/FileCheck/Makefile b/contrib/llvm/utils/FileCheck/Makefile
deleted file mode 100644
index f1af5b6..0000000
--- a/contrib/llvm/utils/FileCheck/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-##===- utils/FileCheck/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 = FileCheck
-USEDLIBS = LLVMSupport.a LLVMSystem.a
-
-# This tool has no plugins, optimize startup time.
-TOOL_NO_EXPORTS = 1
-
-# Don't install this utility
-NO_INSTALL = 1
-
-include $(LEVEL)/Makefile.common
-
diff --git a/contrib/llvm/utils/FileUpdate/CMakeLists.txt b/contrib/llvm/utils/FileUpdate/CMakeLists.txt
deleted file mode 100644
index bacbd16..0000000
--- a/contrib/llvm/utils/FileUpdate/CMakeLists.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-add_executable(FileUpdate
- FileUpdate.cpp
- )
-
-target_link_libraries(FileUpdate LLVMSupport LLVMSystem)
-if( MINGW )
- target_link_libraries(FileUpdate imagehlp psapi)
-endif( MINGW )
-if( LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD )
- target_link_libraries(FileUpdate pthread)
-endif()
diff --git a/contrib/llvm/utils/FileUpdate/FileUpdate.cpp b/contrib/llvm/utils/FileUpdate/FileUpdate.cpp
deleted file mode 100644
index 2cf366f..0000000
--- a/contrib/llvm/utils/FileUpdate/FileUpdate.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-//===- FileUpdate.cpp - Conditionally update a file -----------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// FileUpdate is a utility for conditionally updating a file from its input
-// based on whether the input differs from the output. It is used to avoid
-// unnecessary modifications in a build system.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/PrettyStackTrace.h"
-#include "llvm/Support/raw_ostream.h"
-#include "llvm/System/Signals.h"
-using namespace llvm;
-
-static cl::opt<bool>
-Quiet("quiet", cl::desc("Don't print unnecessary status information"),
- cl::init(false));
-
-static cl::opt<std::string>
-InputFilename("input-file", cl::desc("Input file (defaults to stdin)"),
- cl::init("-"), cl::value_desc("filename"));
-
-static cl::opt<std::string>
-OutputFilename(cl::Positional, cl::desc("<output-file>"), cl::Required);
-
-int main(int argc, char **argv) {
- sys::PrintStackTraceOnErrorSignal();
- PrettyStackTraceProgram X(argc, argv);
- cl::ParseCommandLineOptions(argc, argv);
-
- if (OutputFilename == "-") {
- errs() << argv[0] << ": error: Can't update standard output\n";
- return 1;
- }
-
- // Get the input data.
- std::string ErrorStr;
- MemoryBuffer *In =
- MemoryBuffer::getFileOrSTDIN(InputFilename.c_str(), &ErrorStr);
- if (In == 0) {
- errs() << argv[0] << ": error: Unable to get input '"
- << InputFilename << "': " << ErrorStr << '\n';
- return 1;
- }
-
- // Get the output data.
- MemoryBuffer *Out = MemoryBuffer::getFile(OutputFilename.c_str(), &ErrorStr);
-
- // If the output exists and the contents match, we are done.
- if (Out && In->getBufferSize() == Out->getBufferSize() &&
- memcmp(In->getBufferStart(), Out->getBufferStart(),
- Out->getBufferSize()) == 0) {
- if (!Quiet)
- errs() << argv[0] << ": Not updating '" << OutputFilename
- << "', contents match input.\n";
- return 0;
- }
-
- delete Out;
-
- // Otherwise, overwrite the output.
- if (!Quiet)
- errs() << argv[0] << ": Updating '" << OutputFilename
- << "', contents changed.\n";
- tool_output_file OutStream(OutputFilename.c_str(), ErrorStr,
- raw_fd_ostream::F_Binary);
- if (!ErrorStr.empty()) {
- errs() << argv[0] << ": Unable to write output '"
- << OutputFilename << "': " << ErrorStr << '\n';
- return 1;
- }
-
- OutStream.os().write(In->getBufferStart(), In->getBufferSize());
-
- // Declare success.
- OutStream.keep();
-
- return 0;
-}
diff --git a/contrib/llvm/utils/FileUpdate/Makefile b/contrib/llvm/utils/FileUpdate/Makefile
deleted file mode 100644
index 5b545c2..0000000
--- a/contrib/llvm/utils/FileUpdate/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-##===- utils/FileUpdate/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 = FileUpdate
-USEDLIBS = LLVMSupport.a LLVMSystem.a
-
-# This tool has no plugins, optimize startup time.
-TOOL_NO_EXPORTS = 1
-
-# Don't install this utility
-NO_INSTALL = 1
-
-include $(LEVEL)/Makefile.common
-
diff --git a/contrib/llvm/utils/GenLibDeps.pl b/contrib/llvm/utils/GenLibDeps.pl
deleted file mode 100755
index f1f7e72..0000000
--- a/contrib/llvm/utils/GenLibDeps.pl
+++ /dev/null
@@ -1,388 +0,0 @@
-#!/usr/bin/perl -w
-#
-# Program: GenLibDeps.pl
-#
-# Synopsis: Generate HTML output that shows the dependencies between a set of
-# libraries. The output of this script should periodically replace
-# the similar content in the UsingLibraries.html document.
-#
-# Syntax: GenLibDeps.pl [-flat] <directory_with_libraries_in_it> [path_to_nm_binary]
-#
-use strict;
-use warnings;
-# Parse arguments...
-my $FLAT = 0;
-my $WHY = 0;
-my $PEROBJ = 0;
-my $PEROBJINCL = 0;
-while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
- shift;
- last if /^--$/; # Stop processing arguments on --
-
- # List command line options here...
- if (/^-flat$/) { $FLAT = 1; next; }
- if (/^-why/) { $WHY = 1; $FLAT = 1; next; }
- if (/^-perobj$/) { $PEROBJ = 1; next; }
- if (/^-perobjincl/) { $PEROBJINCL = 1; next;}
- print "Unknown option: $_ : ignoring!\n";
-}
-
-# Give first option a name.
-my $Directory = $ARGV[0];
-if (!defined($Directory) || ! -d "$Directory") {
- die "First argument must specify the directory containing LLVM libs\n";
-}
-
-my $nmPath = $ARGV[1];
-
-# Find the "dot" program
-my $DotPath="";
-if (!$FLAT) {
- chomp($DotPath = `which dot`);
- die "Can't find 'dot'" if (! -x "$DotPath");
-}
-
-if (defined($ENV{NM})) {
- chomp($nmPath=$ENV{NM});
-}
-
-if (!defined($nmPath) || $nmPath eq "") {
- chomp($nmPath=`which nm`);
- die "Can't find 'nm'" if (! -x "$nmPath");
-}
-
-my $ranlibPath;
-if ($PEROBJ) {
- $ranlibPath = $ARGV[2];
- if (defined($ENV{RANLIB})) {
- chomp($ranlibPath=$ENV{RANLIB});
- }
-
- if (!defined($ranlibPath) || $ranlibPath eq "") {
- chomp($ranlibPath=`which ranlib`);
- die "Can't find 'ranlib'" if (! -x "$ranlibPath");
- }
-}
-
-# Open the directory and read its contents, sorting by name and differentiating
-# by whether its a library (.a) or an object file (.o)
-opendir DIR,$Directory;
-my @files = readdir DIR;
-closedir DIR;
-my @libs = grep(/libLLVM.*\.(dylib|so|a)$/,sort(@files));
-# Omit the all-of-llvm shared library.
-@libs = grep(!/libLLVM-\d\.\d(svn)?\.(dylib|so)/, @libs);
-my @objs = grep(/LLVM.*\.o$/,sort(@files));
-
-# Declare the hashes we will use to keep track of the library and object file
-# symbol definitions.
-my %libdefs;
-my %objdefs;
-
-my %libobjs;
-my %objdeps=();
-# Gather library definitions at object file granularity (optional)
-if ($PEROBJ) {
- foreach my $lib (@libs ) {
- `$ranlibPath $Directory/$lib`;
- my $libpath = $lib;
- $libpath =~ s/^libLLVM(.*)\.a/$1/;
- $libpath =~ s/(.+)CodeGen$/Target\/$1/;
- $libpath =~ s/(.+)AsmPrinter$/Target\/$1\/AsmPrinter/;
- $libpath =~ s/(.+)AsmParser$/Target\/$1\/AsmParser/;
- $libpath =~ s/(.+)Info$/Target\/$1\/TargetInfo/;
- $libpath =~ s/(.+)Disassembler$/Target\/$1\/Disassembler/;
- $libpath =~ s/SelectionDAG/CodeGen\/SelectionDAG/;
- $libpath =~ s/^AsmPrinter/CodeGen\/AsmPrinter/;
- $libpath =~ s/^BitReader/Bitcode\/Reader/;
- $libpath =~ s/^BitWriter/Bitcode\/Writer/;
- $libpath =~ s/^CBackend/Target\/CBackend/;
- $libpath =~ s/^CppBackend/Target\/CppBackend/;
- $libpath =~ s/^MSIL/Target\/MSIL/;
- $libpath =~ s/^Core/VMCore/;
- $libpath =~ s/^Instrumentation/Transforms\/Instrumentation/;
- $libpath =~ s/^Interpreter/ExecutionEngine\/Interpreter/;
- $libpath =~ s/^JIT/ExecutionEngine\/JIT/;
- $libpath =~ s/^ScalarOpts/Transforms\/Scalar/;
- $libpath =~ s/^TransformUtils/Transforms\/Utils/;
- $libpath =~ s/^ipa/Analysis\/IPA/;
- $libpath =~ s/^ipo/Transforms\/IPO/;
- $libpath =~ s/^pic16passes/Target\/PIC16\/PIC16Passes/;
- $libpath = "lib/".$libpath."/";
- open DEFS, "$nmPath -sg $Directory/$lib|";
- while (<DEFS>) {
- chomp;
- if (/^([^ ]*) in ([^ ]*)/) {
- my $objfile = $libpath.$2;
- $objdefs{$1} = $objfile;
- $objdeps{$objfile} = {};
- $libobjs{$lib}{$objfile}=1;
-# my $p = "../llvm/".$objfile;
-# $p =~ s/Support\/reg(.*).o/Support\/reg$1.c/;
-# $p =~ s/.o$/.cpp/;
-# unless (-e $p) {
-# die "$p\n"
-# }
- }
- }
- close DEFS or die "nm failed";
- }
- foreach my $lib (@libs ) {
- my $libpath = $lib;
- $libpath =~ s/^libLLVM(.*)\.a/$1/;
- $libpath =~ s/(.+)CodeGen$/Target\/$1/;
- $libpath =~ s/(.+)AsmPrinter$/Target\/$1\/AsmPrinter/;
- $libpath =~ s/(.+)AsmParser$/Target\/$1\/AsmParser/;
- $libpath =~ s/(.+)Info$/Target\/$1\/TargetInfo/;
- $libpath =~ s/(.+)Disassembler$/Target\/$1\/Disassembler/;
- $libpath =~ s/SelectionDAG/CodeGen\/SelectionDAG/;
- $libpath =~ s/^AsmPrinter/CodeGen\/AsmPrinter/;
- $libpath =~ s/^BitReader/Bitcode\/Reader/;
- $libpath =~ s/^BitWriter/Bitcode\/Writer/;
- $libpath =~ s/^CBackend/Target\/CBackend/;
- $libpath =~ s/^CppBackend/Target\/CppBackend/;
- $libpath =~ s/^MSIL/Target\/MSIL/;
- $libpath =~ s/^Core/VMCore/;
- $libpath =~ s/^Instrumentation/Transforms\/Instrumentation/;
- $libpath =~ s/^Interpreter/ExecutionEngine\/Interpreter/;
- $libpath =~ s/^JIT/ExecutionEngine\/JIT/;
- $libpath =~ s/^ScalarOpts/Transforms\/Scalar/;
- $libpath =~ s/^TransformUtils/Transforms\/Utils/;
- $libpath =~ s/^ipa/Analysis\/IPA/;
- $libpath =~ s/^ipo/Transforms\/IPO/;
- $libpath =~ s/^pic16passes/Target\/PIC16\/PIC16Passes/;
- $libpath = "lib/".$libpath."/";
- open UDEFS, "$nmPath -Aup $Directory/$lib|";
- while (<UDEFS>) {
- chomp;
- if (/:([^:]+):/) {
- my $obj = $libpath.$1;
- s/[^ ]+: *U //;
- if (defined($objdefs{$_})) {
- $objdeps{$obj}{$objdefs{$_}}=1;
- }
- }
- }
- close UDEFS or die "nm failed"
- }
-} else {
-# Gather definitions from the libraries
-foreach my $lib (@libs ) {
- open DEFS, "$nmPath -g $Directory/$lib|";
- while (<DEFS>) {
- next if (! / [ABCDGRST] /);
- s/^[^ ]* [ABCDGRST] //;
- s/\015?\012//; # not sure if <DEFS> is in binmode and uses LF or CRLF.
- # this strips both LF and CRLF.
- $libdefs{$_} = $lib;
- }
- close DEFS or die "nm failed";
-}
-}
-
-# Gather definitions from the object files.
-foreach my $obj (@objs ) {
- open DEFS, "$nmPath -g $Directory/$obj |";
- while (<DEFS>) {
- next if (! / [ABCDGRST] /);
- s/^[^ ]* [ABCDGRST] //;
- s/\015?\012//; # not sure if <DEFS> is in binmode and uses LF or CRLF.
- # this strips both LF and CRLF.
- $objdefs{$_} = $obj;
- }
- close DEFS or die "nm failed";
-}
-
-# Generate one entry in the <dl> list. This generates the <dt> and <dd> elements
-# for one library or object file. The <dt> provides the name of the library or
-# object. The <dd> provides a list of the libraries/objects it depends on.
-sub gen_one_entry {
- my $lib = $_[0];
- my $lib_ns = $lib;
- $lib_ns =~ s/(.*)\.[oa]/$1/;
- if ($FLAT) {
- print "$lib:";
- if ($WHY) { print "\n"; }
- } else {
- print " <dt><b>$lib</b</dt><dd><ul>\n";
- }
- open UNDEFS,
- "$nmPath -u $Directory/$lib | sed -e 's/^[ 0]* U //' | sort | uniq |";
- my %DepLibs;
- while (<UNDEFS>) {
- chomp;
- my $lib_printed = 0;
- if (defined($libdefs{$_}) && $libdefs{$_} ne $lib) {
- $DepLibs{$libdefs{$_}} = [] unless exists $DepLibs{$libdefs{$_}};
- push(@{$DepLibs{$libdefs{$_}}}, $_);
- } elsif (defined($objdefs{$_}) && $objdefs{$_} ne $lib) {
- if ($PEROBJ && !$PEROBJINCL) {
- # -perobjincl makes .a files depend on .o files they contain themselves
- # default is don't depend on these.
- next if defined $libobjs{$lib}{$objdefs{$_}};
- }
- my $libroot = $lib;
- $libroot =~ s/lib(.*).a/$1/;
- if ($objdefs{$_} ne "$libroot.o") {
- $DepLibs{$objdefs{$_}} = [] unless exists $DepLibs{$objdefs{$_}};
- push(@{$DepLibs{$objdefs{$_}}}, $_);
- }
- }
- }
- close UNDEFS or die "nm failed";
- unless(keys %DepLibs) {
- # above failed
- open UNDEFS, "$nmPath -u $Directory/$lib |";
- while (<UNDEFS>) {
- # to bypass non-working sed
- if (' ' eq substr($_,0,2) and index($_,'U ')) {
- $_ = substr($_,index($_,'U ')+2)
- };
- $_ = substr($_,index($_,' *U ')+5) if -1!=index($_,' *U ');
-
- chomp;
- my $lib_printed = 0;
- if (defined($libdefs{$_}) && $libdefs{$_} ne $lib) {
- $DepLibs{$libdefs{$_}} = [] unless exists $DepLibs{$libdefs{$_}};
- push(@{$DepLibs{$libdefs{$_}}}, $_);
- } elsif (defined($objdefs{$_}) && $objdefs{$_} ne $lib) {
- my $libroot = $lib;
- $libroot =~ s/lib(.*).a/$1/;
- if ($objdefs{$_} ne "$libroot.o") {
- $DepLibs{$objdefs{$_}} = [] unless exists $DepLibs{$objdefs{$_}};
- push(@{$DepLibs{$objdefs{$_}}}, $_);
- }
- }
- }
- close UNDEFS or die "nm failed";
- }
- if ($PEROBJINCL) {
- # include the .a's objects
- for my $obj (keys %{$libobjs{$lib}}) {
- $DepLibs{$obj} = ["<.a object>"] unless exists $DepLibs{$obj};
- }
- my $madechange = 1;
- while($madechange) {
- $madechange = 0;
- my %temp = %DepLibs;
- foreach my $obj (keys %DepLibs) {
- foreach my $objdeps (keys %{$objdeps{$obj}}) {
- next if defined $temp{$objdeps};
- push(@{$temp{$objdeps}}, $obj);
- $madechange = 1;
- }
- }
- %DepLibs = %temp;
- }
- }
-
- for my $key (sort keys %DepLibs) {
- if ($FLAT) {
- print " $key";
- if ($WHY) {
- print "\n";
- my @syms = @{$DepLibs{$key}};
- foreach my $sym (@syms) {
- print " $sym\n";
- }
- }
- } else {
- print " <li>$key</li>\n";
- }
- my $suffix = substr($key,length($key)-1,1);
- $key =~ s/(.*)\.[oa]/$1/;
- if ($suffix eq "a") {
- if (!$FLAT) { print DOT "$lib_ns -> $key [ weight=0 ];\n" };
- } else {
- if (!$FLAT) { print DOT "$lib_ns -> $key [ weight=10];\n" };
- }
- }
- if ($FLAT) {
- if (!$WHY) {
- print "\n";
- }
- } else {
- print " </ul></dd>\n";
- }
-}
-
-# Make sure we flush on write. This is slower but correct based on the way we
-# write I/O in gen_one_entry.
-$| = 1;
-
-# Print the definition list tag
-if (!$FLAT) {
- print "<dl>\n";
-
- open DOT, "| $DotPath -Tgif > libdeps.gif";
-
- print DOT "digraph LibDeps {\n";
- print DOT " size=\"40,15\"; \n";
- print DOT " ratio=\"1.33333\"; \n";
- print DOT " margin=\"0.25\"; \n";
- print DOT " rankdir=\"LR\"; \n";
- print DOT " mclimit=\"50.0\"; \n";
- print DOT " ordering=\"out\"; \n";
- print DOT " center=\"1\";\n";
- print DOT "node [shape=\"box\",\n";
- print DOT " color=\"#000088\",\n";
- print DOT " fillcolor=\"#FFFACD\",\n";
- print DOT " fontcolor=\"#3355BB\",\n";
- print DOT " style=\"filled\",\n";
- print DOT " fontname=\"sans\",\n";
- print DOT " fontsize=\"24\"\n";
- print DOT "];\n";
- print DOT "edge [dir=\"forward\",style=\"solid\",color=\"#000088\"];\n";
-}
-
-# Print libraries first
-foreach my $lib (@libs) {
- gen_one_entry($lib);
-}
-
-if ($PEROBJ) {
- foreach my $obj (keys %objdeps) {
- print "$obj:";
- if (!$PEROBJINCL) {
- foreach my $dep (keys %{$objdeps{$obj}}) {
- print " $dep";
- }
- }
- print "\n";
- }
-}
-
-if (!$FLAT) {
- print DOT "}\n";
- close DOT;
- open DOT, "| $DotPath -Tgif > objdeps.gif";
- print DOT "digraph ObjDeps {\n";
- print DOT " size=\"8,10\";\n";
- print DOT " margin=\"0.25\";\n";
- print DOT " rankdir=\"LR\";\n";
- print DOT " mclimit=\"50.0\";\n";
- print DOT " ordering=\"out\";\n";
- print DOT " center=\"1\";\n";
- print DOT "node [shape=\"box\",\n";
- print DOT " color=\"#000088\",\n";
- print DOT " fillcolor=\"#FFFACD\",\n";
- print DOT " fontcolor=\"#3355BB\",\n";
- print DOT " fontname=\"sans\",\n";
- print DOT " style=\"filled\",\n";
- print DOT " fontsize=\"24\"\n";
- print DOT "];\n";
- print DOT "edge [dir=\"forward\",style=\"solid\",color=\"#000088\"];\n";
-}
-
-# Print objects second
-foreach my $obj (@objs) {
- gen_one_entry($obj);
-}
-
-if (!$FLAT) {
- print DOT "}\n";
- close DOT;
-
-# Print end tag of definition list element
- print "</dl>\n";
-}
diff --git a/contrib/llvm/utils/GetSourceVersion b/contrib/llvm/utils/GetSourceVersion
deleted file mode 100755
index b25f2f9..0000000
--- a/contrib/llvm/utils/GetSourceVersion
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-usage() {
- echo "usage: $0 <source root>"
- echo " Prints the source control revision of the given source directory,"
- echo " the exact format of the revision string depends on the source "
- echo " control system. If the source control system isn't known, the output"
- echo " is empty and the exit code is 1."
- exit 1
-}
-
-if [ $# != 1 ] || [ ! -d $1 ]; then
- usage;
-fi
-
-cd $1
-if [ -d .svn ]; then
- svnversion
-elif [ -d .git/svn ]; then
- git svn info | grep 'Revision:' | cut -d: -f2-
-elif [ -d .git ]; then
- git log -1 --pretty=format:%H
-else
- exit 1;
-fi
-
-exit 0
diff --git a/contrib/llvm/utils/Makefile b/contrib/llvm/utils/Makefile
deleted file mode 100644
index 1a4dcca..0000000
--- a/contrib/llvm/utils/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-##===- 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 = ..
-PARALLEL_DIRS := FileCheck FileUpdate TableGen PerfectShuffle \
- count fpcmp llvm-lit not unittest
-
-EXTRA_DIST := cgiplotNLT.pl check-each-file codegen-diff countloc.sh \
- DSAclean.py DSAextract.py emacs findsym.pl GenLibDeps.pl \
- getsrcs.sh importNLT.pl llvmdo llvmgrep llvm-native-gcc \
- llvm-native-gxx makellvm NightlyTest.gnuplot NightlyTest.pl \
- NightlyTestTemplate.html NLT.schema OldenDataRecover.pl \
- parseNLT.pl plotNLT.pl profile.pl \
- webNLT.pl vim
-
-include $(LEVEL)/Makefile.common
diff --git a/contrib/llvm/utils/Misc/zkill b/contrib/llvm/utils/Misc/zkill
deleted file mode 100755
index bc0bfd5..0000000
--- a/contrib/llvm/utils/Misc/zkill
+++ /dev/null
@@ -1,276 +0,0 @@
-#!/usr/bin/env python
-
-import os
-import re
-import sys
-
-def _write_message(kind, message):
- import inspect, os, sys
-
- # Get the file/line where this message was generated.
- f = inspect.currentframe()
- # Step out of _write_message, and then out of wrapper.
- f = f.f_back.f_back
- file,line,_,_,_ = inspect.getframeinfo(f)
- location = '%s:%d' % (os.path.basename(file), line)
-
- print >>sys.stderr, '%s: %s: %s' % (location, kind, message)
-
-note = lambda message: _write_message('note', message)
-warning = lambda message: _write_message('warning', message)
-error = lambda message: (_write_message('error', message), sys.exit(1))
-
-def re_full_match(pattern, str):
- m = re.match(pattern, str)
- if m and m.end() != len(str):
- m = None
- return m
-
-def parse_time(value):
- minutes,value = value.split(':',1)
- if '.' in value:
- seconds,fseconds = value.split('.',1)
- else:
- seconds = value
- return int(minutes) * 60 + int(seconds) + float('.'+fseconds)
-
-def extractExecutable(command):
- """extractExecutable - Given a string representing a command line, attempt
- to extract the executable path, even if it includes spaces."""
-
- # Split into potential arguments.
- args = command.split(' ')
-
- # Scanning from the beginning, try to see if the first N args, when joined,
- # exist. If so that's probably the executable.
- for i in range(1,len(args)):
- cmd = ' '.join(args[:i])
- if os.path.exists(cmd):
- return cmd
-
- # Otherwise give up and return the first "argument".
- return args[0]
-
-class Struct:
- def __init__(self, **kwargs):
- self.fields = kwargs.keys()
- self.__dict__.update(kwargs)
-
- def __repr__(self):
- return 'Struct(%s)' % ', '.join(['%s=%r' % (k,getattr(self,k))
- for k in self.fields])
-
-kExpectedPSFields = [('PID', int, 'pid'),
- ('USER', str, 'user'),
- ('COMMAND', str, 'command'),
- ('%CPU', float, 'cpu_percent'),
- ('TIME', parse_time, 'cpu_time'),
- ('VSZ', int, 'vmem_size'),
- ('RSS', int, 'rss')]
-def getProcessTable():
- import subprocess
- p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
- out,err = p.communicate()
- res = p.wait()
- if p.wait():
- error('unable to get process table')
- elif err.strip():
- error('unable to get process table: %s' % err)
-
- lns = out.split('\n')
- it = iter(lns)
- header = it.next().split()
- numRows = len(header)
-
- # Make sure we have the expected fields.
- indexes = []
- for field in kExpectedPSFields:
- try:
- indexes.append(header.index(field[0]))
- except:
- if opts.debug:
- raise
- error('unable to get process table, no %r field.' % field[0])
-
- table = []
- for i,ln in enumerate(it):
- if not ln.strip():
- continue
-
- fields = ln.split(None, numRows - 1)
- if len(fields) != numRows:
- warning('unable to process row: %r' % ln)
- continue
-
- record = {}
- for field,idx in zip(kExpectedPSFields, indexes):
- value = fields[idx]
- try:
- record[field[2]] = field[1](value)
- except:
- if opts.debug:
- raise
- warning('unable to process %r in row: %r' % (field[0], ln))
- break
- else:
- # Add our best guess at the executable.
- record['executable'] = extractExecutable(record['command'])
- table.append(Struct(**record))
-
- return table
-
-def getSignalValue(name):
- import signal
- if name.startswith('SIG'):
- value = getattr(signal, name)
- if value and isinstance(value, int):
- return value
- error('unknown signal: %r' % name)
-
-import signal
-kSignals = {}
-for name in dir(signal):
- if name.startswith('SIG') and name == name.upper() and name.isalpha():
- kSignals[name[3:]] = getattr(signal, name)
-
-def main():
- global opts
- from optparse import OptionParser, OptionGroup
- parser = OptionParser("usage: %prog [options] {pid}*")
-
- # FIXME: Add -NNN and -SIGNAME options.
-
- parser.add_option("-s", "", dest="signalName",
- help="Name of the signal to use (default=%default)",
- action="store", default='INT',
- choices=kSignals.keys())
- parser.add_option("-l", "", dest="listSignals",
- help="List known signal names",
- action="store_true", default=False)
-
- parser.add_option("-n", "--dry-run", dest="dryRun",
- help="Only print the actions that would be taken",
- action="store_true", default=False)
- parser.add_option("-v", "--verbose", dest="verbose",
- help="Print more verbose output",
- action="store_true", default=False)
- parser.add_option("", "--debug", dest="debug",
- help="Enable debugging output",
- action="store_true", default=False)
- parser.add_option("", "--force", dest="force",
- help="Perform the specified commands, even if it seems like a bad idea",
- action="store_true", default=False)
-
- inf = float('inf')
- group = OptionGroup(parser, "Process Filters")
- group.add_option("", "--name", dest="execName", metavar="REGEX",
- help="Kill processes whose name matches the given regexp",
- action="store", default=None)
- group.add_option("", "--exec", dest="execPath", metavar="REGEX",
- help="Kill processes whose executable matches the given regexp",
- action="store", default=None)
- group.add_option("", "--user", dest="userName", metavar="REGEX",
- help="Kill processes whose user matches the given regexp",
- action="store", default=None)
- group.add_option("", "--min-cpu", dest="minCPU", metavar="PCT",
- help="Kill processes with CPU usage >= PCT",
- action="store", type=float, default=None)
- group.add_option("", "--max-cpu", dest="maxCPU", metavar="PCT",
- help="Kill processes with CPU usage <= PCT",
- action="store", type=float, default=inf)
- group.add_option("", "--min-mem", dest="minMem", metavar="N",
- help="Kill processes with virtual size >= N (MB)",
- action="store", type=float, default=None)
- group.add_option("", "--max-mem", dest="maxMem", metavar="N",
- help="Kill processes with virtual size <= N (MB)",
- action="store", type=float, default=inf)
- group.add_option("", "--min-rss", dest="minRSS", metavar="N",
- help="Kill processes with RSS >= N",
- action="store", type=float, default=None)
- group.add_option("", "--max-rss", dest="maxRSS", metavar="N",
- help="Kill processes with RSS <= N",
- action="store", type=float, default=inf)
- group.add_option("", "--min-time", dest="minTime", metavar="N",
- help="Kill processes with CPU time >= N (seconds)",
- action="store", type=float, default=None)
- group.add_option("", "--max-time", dest="maxTime", metavar="N",
- help="Kill processes with CPU time <= N (seconds)",
- action="store", type=float, default=inf)
- parser.add_option_group(group)
-
- (opts, args) = parser.parse_args()
-
- if opts.listSignals:
- items = [(v,k) for k,v in kSignals.items()]
- items.sort()
- for i in range(0, len(items), 4):
- print '\t'.join(['%2d) SIG%s' % (k,v)
- for k,v in items[i:i+4]])
- sys.exit(0)
-
- # Figure out the signal to use.
- signal = kSignals[opts.signalName]
- signalValueName = str(signal)
- if opts.verbose:
- name = dict((v,k) for k,v in kSignals.items()).get(signal,None)
- if name:
- signalValueName = name
- note('using signal %d (SIG%s)' % (signal, name))
- else:
- note('using signal %d' % signal)
-
- # Get the pid list to consider.
- pids = set()
- for arg in args:
- try:
- pids.add(int(arg))
- except:
- parser.error('invalid positional argument: %r' % arg)
-
- filtered = ps = getProcessTable()
-
- # Apply filters.
- if pids:
- filtered = [p for p in filtered
- if p.pid in pids]
- if opts.execName is not None:
- filtered = [p for p in filtered
- if re_full_match(opts.execName,
- os.path.basename(p.executable))]
- if opts.execPath is not None:
- filtered = [p for p in filtered
- if re_full_match(opts.execPath, p.executable)]
- if opts.userName is not None:
- filtered = [p for p in filtered
- if re_full_match(opts.userName, p.user)]
- filtered = [p for p in filtered
- if opts.minCPU <= p.cpu_percent <= opts.maxCPU]
- filtered = [p for p in filtered
- if opts.minMem <= float(p.vmem_size) / (1<<20) <= opts.maxMem]
- filtered = [p for p in filtered
- if opts.minRSS <= p.rss <= opts.maxRSS]
- filtered = [p for p in filtered
- if opts.minTime <= p.cpu_time <= opts.maxTime]
-
- if len(filtered) == len(ps):
- if not opts.force and not opts.dryRun:
- error('refusing to kill all processes without --force')
-
- if not filtered:
- warning('no processes selected')
-
- for p in filtered:
- if opts.verbose:
- note('kill(%r, %s) # (user=%r, executable=%r, CPU=%2.2f%%, time=%r, vmem=%r, rss=%r)' %
- (p.pid, signalValueName, p.user, p.executable, p.cpu_percent, p.cpu_time, p.vmem_size, p.rss))
- if not opts.dryRun:
- try:
- os.kill(p.pid, signal)
- except OSError:
- if opts.debug:
- raise
- warning('unable to kill PID: %r' % p.pid)
-
-if __name__ == '__main__':
- main()
diff --git a/contrib/llvm/utils/NLT.schema b/contrib/llvm/utils/NLT.schema
deleted file mode 100644
index 4bcddbc..0000000
--- a/contrib/llvm/utils/NLT.schema
+++ /dev/null
@@ -1,8 +0,0 @@
-CREATE TABLE `Tests` (
- `NAME` varchar(255) NOT NULL default '',
- `RUN` date NOT NULL default '0000-00-00',
- `TEST` varchar(32) NOT NULL default '',
- `VALUE` double NOT NULL default '0',
- KEY `name_index` (`NAME`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
diff --git a/contrib/llvm/utils/NewNightlyTest.pl b/contrib/llvm/utils/NewNightlyTest.pl
deleted file mode 100755
index 1b48168..0000000
--- a/contrib/llvm/utils/NewNightlyTest.pl
+++ /dev/null
@@ -1,836 +0,0 @@
-#!/usr/bin/perl
-use POSIX qw(strftime);
-use File::Copy;
-use File::Find;
-use Socket;
-
-#
-# Program: NewNightlyTest.pl
-#
-# Synopsis: Perform a series of tests which are designed to be run nightly.
-# This is used to keep track of the status of the LLVM tree, tracking
-# regressions and performance changes. Submits this information
-# to llvm.org where it is placed into the nightlytestresults database.
-#
-# Syntax: NightlyTest.pl [OPTIONS] [CVSROOT BUILDDIR WEBDIR]
-# where
-# OPTIONS may include one or more of the following:
-#
-# MAIN OPTIONS:
-# -config LLVMPATH If specified, use an existing LLVM build and only run and
-# report the test information. The LLVMCONFIG argument should
-# be the path to the llvm-config executable in the LLVM build.
-# This should be the first argument if given. NOT YET
-# IMPLEMENTED.
-# -nickname NAME The NAME argument specifieds the nickname this script
-# will submit to the nightlytest results repository.
-# -nouname Don't include uname data (machine will be identified by nickname only).
-# -submit-server Specifies a server to submit the test results too. If this
-# option is not specified it defaults to
-# llvm.org. This is basically just the address of the
-# webserver
-# -submit-script Specifies which script to call on the submit server. If
-# this option is not specified it defaults to
-# /nightlytest/NightlyTestAccept.php. This is basically
-# everything after the www.yourserver.org.
-# -submit-aux If specified, an auxiliary script to run in addition to the
-# normal submit script. The script will be passed the path to
-# the "sentdata.txt" file as its sole argument.
-# -nosubmit Do not report the test results back to a submit server.
-#
-#
-# BUILD OPTIONS (not used with -config):
-# -nocheckout Do not create, checkout, update, or configure
-# the source tree.
-# -noremove Do not remove the BUILDDIR after it has been built.
-# -noremoveresults Do not remove the WEBDIR after it has been built.
-# -noclean Do not run 'make clean' before building.
-# -nobuild Do not build llvm. If tests are enabled perform them
-# on the llvm build specified in the build directory
-# -release Build an LLVM Release+Asserts version
-# -release-asserts Build an LLVM Release version
-# -disable-bindings Disable building LLVM bindings.
-# -with-clang Checkout Clang source into tools/clang.
-# -compileflags Next argument specifies extra options passed to make when
-# building LLVM.
-# -use-gmake Use gmake instead of the default make command to build
-# llvm and run tests.
-# -llvmgccdir Next argument specifies the llvm-gcc install prefix.
-#
-# TESTING OPTIONS:
-# -notest Do not even attempt to run the test programs.
-# -nodejagnu Do not run feature or regression tests
-# -enable-llcbeta Enable testing of beta features in llc.
-# -enable-lli Enable testing of lli (interpreter) features, default is off
-# -disable-pic Disable building with Position Independent Code.
-# -disable-llc Disable LLC tests in the nightly tester.
-# -disable-jit Disable JIT tests in the nightly tester.
-# -disable-cbe Disable C backend tests in the nightly tester.
-# -disable-lto Disable link time optimization.
-# -test-cflags Next argument specifies that C compilation options that
-# override the default when running the testsuite.
-# -test-cxxflags Next argument specifies that C++ compilation options that
-# override the default when running the testsuite.
-# -extraflags Next argument specifies extra options that are passed to
-# compile the tests.
-# -noexternals Do not run the external tests (for cases where povray
-# or SPEC are not installed)
-# -with-externals Specify a directory where the external tests are located.
-#
-# OTHER OPTIONS:
-# -parallel Run parallel jobs with GNU Make (see -parallel-jobs).
-# -parallel-jobs The number of parallel Make jobs to use (default is two).
-# -parallel-test Allow parallel execution of llvm-test
-# -verbose Turn on some debug output
-# -nice Checkout/Configure/Build with "nice" to reduce impact
-# on busy servers.
-# -f2c Next argument specifies path to F2C utility
-# -gccpath Path to gcc/g++ used to build LLVM
-# -target Specify the target triplet
-# -cflags Next argument specifies that C compilation options that
-# override the default.
-# -cxxflags Next argument specifies that C++ compilation options that
-# override the default.
-# -ldflags Next argument specifies that linker options that override
-# the default.
-#
-# CVSROOT is ignored, it is passed for backwards compatibility.
-# BUILDDIR is the directory where sources for this test run will be checked out
-# AND objects for this test run will be built. This directory MUST NOT
-# exist before the script is run; it will be created by the svn checkout
-# process and erased (unless -noremove is specified; see above.)
-# WEBDIR is the directory into which the test results web page will be written,
-# AND in which the "index.html" is assumed to be a symlink to the most recent
-# copy of the results. This directory will be created if it does not exist.
-# LLVMGCCDIR is the directory in which the LLVM GCC Front End is installed
-# to. This is the same as you would have for a normal LLVM build.
-#
-##############################################################
-#
-# Getting environment variables
-#
-##############################################################
-my $HOME = $ENV{'HOME'};
-my $SVNURL = $ENV{"SVNURL"};
-$SVNURL = 'http://llvm.org/svn/llvm-project' unless $SVNURL;
-my $TestSVNURL = $ENV{"TestSVNURL"};
-$TestSVNURL = 'http://llvm.org/svn/llvm-project' unless $TestSVNURL;
-my $BuildDir = $ENV{'BUILDDIR'};
-my $WebDir = $ENV{'WEBDIR'};
-
-##############################################################
-#
-# Calculate the date prefix...
-#
-##############################################################
-use POSIX;
-@TIME = localtime;
-my $DATE = strftime("%Y-%m-%d_%H-%M-%S", localtime());
-
-##############################################################
-#
-# Parse arguments...
-#
-##############################################################
-$CONFIG_PATH="";
-$CONFIGUREARGS="";
-$nickname="";
-$NOTEST=0;
-$MAKECMD="make";
-$SUBMITSERVER = "llvm.org";
-$SUBMITSCRIPT = "/nightlytest/NightlyTestAccept.php";
-$SUBMITAUX="";
-$SUBMIT = 1;
-$PARALLELJOBS = "2";
-my $TESTFLAGS="";
-
-if ($ENV{'LLVMGCCDIR'}) {
- $CONFIGUREARGS .= " --with-llvmgccdir=" . $ENV{'LLVMGCCDIR'};
- $LLVMGCCPATH = $ENV{'LLVMGCCDIR'} . '/bin';
-}
-else {
- $LLVMGCCPATH = "";
-}
-
-while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
- shift;
- last if /^--$/; # Stop processing arguments on --
-
- # List command line options here...
- if (/^-config$/) { $CONFIG_PATH = "$ARGV[0]"; shift; next; }
- if (/^-nocheckout$/) { $NOCHECKOUT = 1; next; }
- if (/^-noclean$/) { $NOCLEAN = 1; next; }
- if (/^-noremove$/) { $NOREMOVE = 1; next; }
- if (/^-noremoveatend$/) { $NOREMOVEATEND = 1; next; }
- if (/^-noremoveresults$/){ $NOREMOVERESULTS = 1; next; }
- if (/^-notest$/) { $NOTEST = 1; next; }
- if (/^-norunningtests$/) { next; } # Backward compatibility, ignored.
- if (/^-parallel-jobs$/) { $PARALLELJOBS = "$ARGV[0]"; shift; next;}
- if (/^-parallel$/) { $MAKEOPTS = "$MAKEOPTS -j$PARALLELJOBS"; next; }
- if (/^-parallel-test$/) { $PROGTESTOPTS .= " ENABLE_PARALLEL_REPORT=1"; next; }
- if (/^-with-clang$/) { $WITHCLANG = 1; next; }
- if (/^-release$/) { $MAKEOPTS = "$MAKEOPTS ENABLE_OPTIMIZED=1 ".
- "OPTIMIZE_OPTION=-O2"; next;}
- if (/^-release-asserts$/){ $MAKEOPTS = "$MAKEOPTS ENABLE_OPTIMIZED=1 ".
- "DISABLE_ASSERTIONS=1 ".
- "OPTIMIZE_OPTION=-O2"; next;}
- if (/^-enable-llcbeta$/) { $PROGTESTOPTS .= " ENABLE_LLCBETA=1"; next; }
- if (/^-disable-pic$/) { $CONFIGUREARGS .= " --enable-pic=no"; next; }
- if (/^-enable-lli$/) { $PROGTESTOPTS .= " ENABLE_LLI=1";
- $CONFIGUREARGS .= " --enable-lli"; next; }
- if (/^-disable-llc$/) { $PROGTESTOPTS .= " DISABLE_LLC=1";
- $CONFIGUREARGS .= " --disable-llc_diffs"; next; }
- if (/^-disable-jit$/) { $PROGTESTOPTS .= " DISABLE_JIT=1";
- $CONFIGUREARGS .= " --disable-jit"; next; }
- if (/^-disable-bindings$/) { $CONFIGUREARGS .= " --disable-bindings"; next; }
- if (/^-disable-cbe$/) { $PROGTESTOPTS .= " DISABLE_CBE=1"; next; }
- if (/^-disable-lto$/) { $PROGTESTOPTS .= " DISABLE_LTO=1"; next; }
- if (/^-test-opts$/) { $PROGTESTOPTS .= " $ARGV[0]"; shift; next; }
- if (/^-verbose$/) { $VERBOSE = 1; next; }
- if (/^-teelogs$/) { $TEELOGS = 1; next; }
- if (/^-nice$/) { $NICE = "nice "; next; }
- if (/^-f2c$/) { $CONFIGUREARGS .= " --with-f2c=$ARGV[0]";
- shift; next; }
- if (/^-with-externals$/) { $CONFIGUREARGS .= " --with-externals=$ARGV[0]";
- shift; next; }
- if (/^-configure-args$/) { $CONFIGUREARGS .= " $ARGV[0]";
- shift; next; }
- if (/^-submit-server/) { $SUBMITSERVER = "$ARGV[0]"; shift; next; }
- if (/^-submit-script/) { $SUBMITSCRIPT = "$ARGV[0]"; shift; next; }
- if (/^-submit-aux/) { $SUBMITAUX = "$ARGV[0]"; shift; next; }
- if (/^-nosubmit$/) { $SUBMIT = 0; next; }
- if (/^-nickname$/) { $nickname = "$ARGV[0]"; shift; next; }
- if (/^-gccpath/) { $CONFIGUREARGS .=
- " CC=$ARGV[0]/gcc CXX=$ARGV[0]/g++";
- $GCCPATH=$ARGV[0]; shift; next; }
- else { $GCCPATH=""; }
- if (/^-target/) { $CONFIGUREARGS .= " --target=$ARGV[0]";
- shift; next; }
- if (/^-cflags/) { $MAKEOPTS = "$MAKEOPTS C.Flags=\'$ARGV[0]\'";
- shift; next; }
- if (/^-cxxflags/) { $MAKEOPTS = "$MAKEOPTS CXX.Flags=\'$ARGV[0]\'";
- shift; next; }
- if (/^-ldflags/) { $MAKEOPTS = "$MAKEOPTS LD.Flags=\'$ARGV[0]\'";
- shift; next; }
- if (/^-test-cflags/) { $TESTFLAGS = "$TESTFLAGS CFLAGS=\'$ARGV[0]\'";
- shift; next; }
- if (/^-test-cxxflags/) { $TESTFLAGS = "$TESTFLAGS CXXFLAGS=\'$ARGV[0]\'";
- shift; next; }
- if (/^-compileflags/) { $MAKEOPTS = "$MAKEOPTS $ARGV[0]"; shift; next; }
- if (/^-llvmgccdir/) { $CONFIGUREARGS .= " --with-llvmgccdir=\'$ARGV[0]\'";
- $LLVMGCCPATH = $ARGV[0] . '/bin';
- shift; next;}
- if (/^-noexternals$/) { $NOEXTERNALS = 1; next; }
- if (/^-nouname$/) { $NOUNAME = 1; next; }
- if (/^-use-gmake/) { $MAKECMD = "gmake"; shift; next; }
- if (/^-extraflags/) { $CONFIGUREARGS .=
- " --with-extra-options=\'$ARGV[0]\'"; shift; next;}
- if (/^-noexternals$/) { $NOEXTERNALS = 1; next; }
- if (/^-nodejagnu$/) { next; }
- if (/^-nobuild$/) { $NOBUILD = 1; next; }
- print "Unknown option: $_ : ignoring!\n";
-}
-
-if ($CONFIGUREARGS !~ /--disable-jit/) {
- $CONFIGUREARGS .= " --enable-jit";
-}
-
-if (@ARGV != 0 and @ARGV != 3) {
- die "error: must specify 0 or 3 options!";
-}
-
-if (@ARGV == 3) {
- if ($CONFIG_PATH ne "") {
- die "error: arguments are unsupported in -config mode,";
- }
-
- # ARGV[0] used to be the CVS root, ignored for backward compatibility.
- $BuildDir = $ARGV[1];
- $WebDir = $ARGV[2];
-}
-
-if ($CONFIG_PATH ne "") {
- $BuildDir = "";
- $SVNURL = $TestSVNURL = "";
- if ($WebDir eq "") {
- die("please specify a web directory");
- }
-} else {
- if ($BuildDir eq "" or
- $WebDir eq "") {
- die("please specify a build directory, and a web directory");
- }
-}
-
-if ($nickname eq "") {
- die ("Please invoke NewNightlyTest.pl with command line option " .
- "\"-nickname <nickname>\"");
-}
-
-my $LLVMSrcDir = $ENV{'LLVMSRCDIR'};
-$LLVMSrcDir = "$BuildDir/llvm" unless $LLVMSrcDir;
-my $LLVMObjDir = $ENV{'LLVMOBJDIR'};
-$LLVMObjDir = "$BuildDir/llvm" unless $LLVMObjDir;
-my $LLVMTestDir = $ENV{'LLVMTESTDIR'};
-$LLVMTestDir = "$BuildDir/llvm/projects/llvm-test" unless $LLVMTestDir;
-
-##############################################################
-#
-# Define the file names we'll use
-#
-##############################################################
-
-my $Prefix = "$WebDir/$DATE";
-my $SingleSourceLog = "$Prefix-SingleSource-ProgramTest.txt.gz";
-my $MultiSourceLog = "$Prefix-MultiSource-ProgramTest.txt.gz";
-my $ExternalLog = "$Prefix-External-ProgramTest.txt.gz";
-
-# These are only valid in non-config mode.
-my $ConfigureLog = "", $BuildLog = "", $COLog = "";
-my $DejagnuLog = "", $DejagnuSum = "", $DejagnuLog = "";
-
-# Are we in config mode?
-my $ConfigMode = 0;
-
-##############################################################
-#
-# Helper functions
-#
-##############################################################
-
-sub GetDir {
- my $Suffix = shift;
- opendir DH, $WebDir;
- my @Result = reverse sort grep !/$DATE/, grep /[-0-9]+$Suffix/, readdir DH;
- closedir DH;
- return @Result;
-}
-
-sub RunLoggedCommand {
- my $Command = shift;
- my $Log = shift;
- my $Title = shift;
- if ($TEELOGS) {
- if ($VERBOSE) {
- print "$Title\n";
- print "$Command 2>&1 | tee $Log\n";
- }
- system "$Command 2>&1 | tee $Log";
- } else {
- if ($VERBOSE) {
- print "$Title\n";
- print "$Command > $Log 2>&1\n";
- }
- system "$Command > $Log 2>&1";
- }
-}
-
-sub RunAppendingLoggedCommand {
- my $Command = shift;
- my $Log = shift;
- my $Title = shift;
- if ($TEELOGS) {
- if ($VERBOSE) {
- print "$Title\n";
- print "$Command 2>&1 | tee -a $Log\n";
- }
- system "$Command 2>&1 | tee -a $Log";
- } else {
- if ($VERBOSE) {
- print "$Title\n";
- print "$Command >> $Log 2>&1\n";
- }
- system "$Command >> $Log 2>&1";
- }
-}
-
-sub GetRegex { # (Regex with ()'s, value)
- if ($_[1] =~ /$_[0]/m) {
- return $1;
- }
- return "0";
-}
-
-sub ChangeDir { # directory, logical name
- my ($dir,$name) = @_;
- chomp($dir);
- if ( $VERBOSE ) { print "Changing To: $name ($dir)\n"; }
- $result = chdir($dir);
- if (!$result) {
- print "ERROR!!! Cannot change directory to: $name ($dir) because $!\n";
- return false;
- }
- return true;
-}
-
-sub ReadFile {
- if (open (FILE, $_[0])) {
- undef $/;
- my $Ret = <FILE>;
- close FILE;
- $/ = '\n';
- return $Ret;
- } else {
- print "Could not open file '$_[0]' for reading!\n";
- return "";
- }
-}
-
-sub WriteFile { # (filename, contents)
- open (FILE, ">$_[0]") or die "Could not open file '$_[0]' for writing!\n";
- print FILE $_[1];
- close FILE;
-}
-
-sub CopyFile { #filename, newfile
- my ($file, $newfile) = @_;
- chomp($file);
- if ($VERBOSE) { print "Copying $file to $newfile\n"; }
- copy($file, $newfile);
-}
-
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-# This function acts as a mini web browswer submitting data
-# to our central server via the post method
-#
-#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-sub WriteSentData {
- $variables = $_[0];
-
- # Write out the "...-sentdata.txt" file.
-
- my $sentdata="";
- foreach $x (keys (%$variables)){
- $value = $variables->{$x};
- $sentdata.= "$x => $value\n";
- }
- WriteFile "$Prefix-sentdata.txt", $sentdata;
-}
-
-sub SendData {
- $host = $_[0];
- $file = $_[1];
- $variables = $_[2];
-
- if (!($SUBMITAUX eq "")) {
- system "$SUBMITAUX \"$Prefix-sentdata.txt\"";
- }
-
- if (!$SUBMIT) {
- return "Skipped standard submit.\n";
- }
-
- # Create the content to send to the server.
-
- my $content;
- foreach $key (keys (%$variables)){
- $value = $variables->{$key};
- $value =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
- $content .= "$key=$value&";
- }
-
- # Send the data to the server.
- #
- # FIXME: This code should be more robust?
-
- $port=80;
- $socketaddr= sockaddr_in $port, inet_aton $host or die "Bad hostname\n";
- socket SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp') or
- die "Bad socket\n";
- connect SOCK, $socketaddr or die "Bad connection\n";
- select((select(SOCK), $| = 1)[0]);
-
- $length = length($content);
-
- my $send= "POST $file HTTP/1.0\n";
- $send.= "Host: $host\n";
- $send.= "Content-Type: application/x-www-form-urlencoded\n";
- $send.= "Content-length: $length\n\n";
- $send.= "$content";
-
- print SOCK $send;
- my $result;
- while(<SOCK>){
- $result .= $_;
- }
- close(SOCK);
-
- return $result;
-}
-
-##############################################################
-#
-# Individual Build & Test Functions
-#
-##############################################################
-
-# Create the source repository directory.
-sub CheckoutSource {
- die "Invalid call!" unless $ConfigMode == 0;
- if (-d $BuildDir) {
- if (!$NOREMOVE) {
- if ( $VERBOSE ) {
- print "Build directory exists! Removing it\n";
- }
- system "rm -rf $BuildDir";
- mkdir $BuildDir or die "Could not create checkout directory $BuildDir!";
- } else {
- if ( $VERBOSE ) {
- print "Build directory exists!\n";
- }
- }
- } else {
- mkdir $BuildDir or die "Could not create checkout directory $BuildDir!";
- }
-
- ChangeDir( $BuildDir, "checkout directory" );
- my $SVNCMD = "$NICE svn co --non-interactive";
- RunLoggedCommand("( time -p $SVNCMD $SVNURL/llvm/trunk llvm; cd llvm/projects ; " .
- " $SVNCMD $TestSVNURL/test-suite/trunk llvm-test )", $COLog,
- "CHECKOUT LLVM");
- if ($WITHCLANG) {
- RunLoggedCommand("( cd llvm/tools ; " .
- " $SVNCMD $SVNURL/cfe/trunk clang )", $COLog,
- "CHECKOUT CLANG");
- }
-}
-
-# Build the entire tree, saving build messages to the build log. Returns false
-# on build failure.
-sub BuildLLVM {
- die "Invalid call!" unless $ConfigMode == 0;
- my $EXTRAFLAGS = "--enable-spec --with-objroot=.";
- RunLoggedCommand("(time -p $NICE ./configure $CONFIGUREARGS $EXTRAFLAGS) ",
- $ConfigureLog, "CONFIGURE");
- # Build the entire tree, capturing the output into $BuildLog
- if (!$NOCLEAN) {
- RunAppendingLoggedCommand("($NICE $MAKECMD $MAKEOPTS clean)", $BuildLog, "BUILD CLEAN");
- }
- RunAppendingLoggedCommand("(time -p $NICE $MAKECMD $MAKEOPTS)", $BuildLog, "BUILD");
-
- if (`grep -a '^$MAKECMD\[^:]*: .*Error' $BuildLog | wc -l` + 0 ||
- `grep -a '^$MAKECMD: \*\*\*.*Stop.' $BuildLog | wc -l` + 0) {
- return 0;
- }
-
- return 1;
-}
-
-# Run the named tests (i.e. "SingleSource" "MultiSource" "External")
-sub TestDirectory {
- my $SubDir = shift;
- ChangeDir( "$LLVMTestDir/$SubDir",
- "Programs Test Subdirectory" ) || return ("", "");
-
- my $ProgramTestLog = "$Prefix-$SubDir-ProgramTest.txt";
-
- # Make sure to clean the test results.
- RunLoggedCommand("$MAKECMD -k $MAKEOPTS $PROGTESTOPTS clean $TESTFLAGS",
- $ProgramTestLog, "TEST DIRECTORY $SubDir");
-
- # Run the programs tests... creating a report.nightly.csv file.
- my $LLCBetaOpts = "";
- RunLoggedCommand("$MAKECMD -k $MAKEOPTS $PROGTESTOPTS report.nightly.csv ".
- "$TESTFLAGS TEST=nightly",
- $ProgramTestLog, "TEST DIRECTORY $SubDir");
- $LLCBetaOpts = `$MAKECMD print-llcbeta-option`;
-
- my $ProgramsTable;
- if (`grep -a '^$MAKECMD\[^:]: .*Error' $ProgramTestLog | wc -l` + 0) {
- $ProgramsTable="Error running test $SubDir\n";
- print "ERROR TESTING\n";
- } elsif (`grep -a '^$MAKECMD\[^:]: .*No rule to make target' $ProgramTestLog | wc -l` + 0) {
- $ProgramsTable="Makefile error running tests $SubDir!\n";
- print "ERROR TESTING\n";
- } else {
- # Create a list of the tests which were run...
- system "egrep -a 'TEST-(PASS|FAIL)' < $ProgramTestLog ".
- "| sort > $Prefix-$SubDir-Tests.txt";
- }
- $ProgramsTable = ReadFile "report.nightly.csv";
-
- ChangeDir( "../../..", "Programs Test Parent Directory" );
- return ($ProgramsTable, $LLCBetaOpts);
-}
-
-# Run all the nightly tests and return the program tables and the list of tests,
-# passes, fails, and xfails.
-sub RunNightlyTest() {
- ($SSProgs, $llcbeta_options) = TestDirectory("SingleSource");
- WriteFile "$Prefix-SingleSource-Performance.txt", $SSProgs;
- ($MSProgs, $llcbeta_options) = TestDirectory("MultiSource");
- WriteFile "$Prefix-MultiSource-Performance.txt", $MSProgs;
- if ( ! $NOEXTERNALS ) {
- ($ExtProgs, $llcbeta_options) = TestDirectory("External");
- WriteFile "$Prefix-External-Performance.txt", $ExtProgs;
- system "cat $Prefix-SingleSource-Tests.txt " .
- "$Prefix-MultiSource-Tests.txt ".
- "$Prefix-External-Tests.txt | sort > $Prefix-Tests.txt";
- system "cat $Prefix-SingleSource-Performance.txt " .
- "$Prefix-MultiSource-Performance.txt ".
- "$Prefix-External-Performance.txt | sort > $Prefix-Performance.txt";
- } else {
- $ExtProgs = "External TEST STAGE SKIPPED\n";
- if ( $VERBOSE ) {
- print "External TEST STAGE SKIPPED\n";
- }
- system "cat $Prefix-SingleSource-Tests.txt " .
- "$Prefix-MultiSource-Tests.txt ".
- " | sort > $Prefix-Tests.txt";
- system "cat $Prefix-SingleSource-Performance.txt " .
- "$Prefix-MultiSource-Performance.txt ".
- " | sort > $Prefix-Performance.txt";
- }
-
- # Compile passes, fails, xfails.
- my $All = (ReadFile "$Prefix-Tests.txt");
- my @TestSuiteResultLines = split "\n", $All;
- my ($Passes, $Fails, $XFails) = "";
-
- for ($x=0; $x < @TestSuiteResultLines; $x++) {
- if (@TestSuiteResultLines[$x] =~ m/^PASS:/) {
- $Passes .= "$TestSuiteResultLines[$x]\n";
- }
- elsif (@TestSuiteResultLines[$x] =~ m/^FAIL:/) {
- $Fails .= "$TestSuiteResultLines[$x]\n";
- }
- elsif (@TestSuiteResultLines[$x] =~ m/^XFAIL:/) {
- $XFails .= "$TestSuiteResultLines[$x]\n";
- }
- }
-
- return ($SSProgs, $MSProgs, $ExtProgs, $All, $Passes, $Fails, $XFails);
-}
-
-##############################################################
-#
-# Initialize filenames
-#
-##############################################################
-
-if (! -d $WebDir) {
- mkdir $WebDir, 0777 or die "Unable to create web directory: '$WebDir'.";
- if($VERBOSE){
- warn "$WebDir did not exist; creating it.\n";
- }
-}
-
-if ($CONFIG_PATH ne "") {
- $ConfigMode = 1;
- $LLVMSrcDir = GetRegex "^(.*)\\s+", `$CONFIG_PATH --src-root`;
- $LLVMObjDir = GetRegex "^(.*)\\s+", `$CONFIG_PATH --obj-root`;
- # FIXME: Add llvm-config hook for this?
- $LLVMTestDir = $LLVMObjDir . "/projects/test-suite";
-} else {
- $ConfigureLog = "$Prefix-Configure-Log.txt";
- $BuildLog = "$Prefix-Build-Log.txt";
- $COLog = "$Prefix-CVS-Log.txt";
-}
-
-if ($VERBOSE) {
- if ($CONFIG_PATH ne "") {
- print "INITIALIZED (config mode)\n";
- print "WebDir = $WebDir\n";
- print "Prefix = $Prefix\n";
- print "LLVM Src = $LLVMSrcDir\n";
- print "LLVM Obj = $LLVMObjDir\n";
- print "LLVM Test = $LLVMTestDir\n";
- } else {
- print "INITIALIZED\n";
- print "SVN URL = $SVNURL\n";
- print "COLog = $COLog\n";
- print "BuildDir = $BuildDir\n";
- print "WebDir = $WebDir\n";
- print "Prefix = $Prefix\n";
- print "BuildLog = $BuildLog\n";
- }
-}
-
-##############################################################
-#
-# The actual NewNightlyTest logic.
-#
-##############################################################
-
-$starttime = `date "+20%y-%m-%d %H:%M:%S"`;
-
-my $BuildError = 0, $BuildStatus = "OK";
-if ($ConfigMode == 0) {
- if (!$NOCHECKOUT) {
- CheckoutSource();
- }
-
- # Build LLVM.
- ChangeDir( $LLVMSrcDir , "llvm source directory") ;
- if ($NOCHECKOUT || $NOBUILD) {
- $BuildStatus = "Skipped by user";
- } else {
- if (!BuildLLVM()) {
- if( $VERBOSE) { print "\n***ERROR BUILDING TREE\n\n"; }
- $BuildError = 1;
- $BuildStatus = "Error: compilation aborted";
- }
- }
-}
-
-# Run the llvm-test tests.
-my ($SingleSourceProgramsTable, $MultiSourceProgramsTable, $ExternalProgramsTable,
- $all_tests, $passes, $fails, $xfails) = "";
-if (!$NOTEST && !$BuildError) {
- ($SingleSourceProgramsTable, $MultiSourceProgramsTable, $ExternalProgramsTable,
- $all_tests, $passes, $fails, $xfails) = RunNightlyTest();
-}
-
-$endtime = `date "+20%y-%m-%d %H:%M:%S"`;
-
-# The last bit of logic is to remove the build and web dirs, after sending data
-# to the server.
-
-##############################################################
-#
-# Accumulate the information to send to the server.
-#
-##############################################################
-
-if ( $VERBOSE ) { print "PREPARING LOGS TO BE SENT TO SERVER\n"; }
-
-if ( ! $NOUNAME ) {
- $machine_data = "uname: ".`uname -a`.
- "hardware: ".`uname -m`.
- "os: ".`uname -sr`.
- "name: ".`uname -n`.
- "date: ".`date \"+20%y-%m-%d\"`.
- "time: ".`date +\"%H:%M:%S\"`;
-} else {
- $machine_data = "uname: (excluded)\n".
- "hardware: ".`uname -m`.
- "os: ".`uname -sr`.
- "name: $nickname\n".
- "date: ".`date \"+20%y-%m-%d\"`.
- "time: ".`date +\"%H:%M:%S\"`;
-}
-
-# Get gcc version.
-my $gcc_version_long = "";
-if ($GCCPATH ne "") {
- $gcc_version_long = `$GCCPATH/gcc --version`;
-} elsif ($ENV{"CC"}) {
- $gcc_version_long = `$ENV{"CC"} --version`;
-} else {
- $gcc_version_long = `gcc --version`;
-}
-my $gcc_version = (split '\n', $gcc_version_long)[0];
-
-# Get llvm-gcc target triple.
-#
-# FIXME: This shouldn't be hardwired to llvm-gcc.
-my $llvmgcc_version_long = "";
-if ($LLVMGCCPATH ne "") {
- $llvmgcc_version_long = `$LLVMGCCPATH/llvm-gcc -v 2>&1`;
-} else {
- $llvmgcc_version_long = `llvm-gcc -v 2>&1`;
-}
-(split '\n', $llvmgcc_version_long)[1] =~ /Target: (.+)/;
-my $targetTriple = $1;
-
-# Logs.
-my ($ConfigureLogData, $BuildLogData, $CheckoutLogData) = "";
-if ($ConfigMode == 0) {
- $ConfigureLogData = ReadFile $ConfigureLog;
- $BuildLogData = ReadFile $BuildLog;
- $CheckoutLogData = ReadFile $COLog;
-}
-
-# Checkout info.
-my $CheckoutTime_Wall = GetRegex "^real ([0-9.]+)", $CheckoutLogData;
-my $CheckoutTime_User = GetRegex "^user ([0-9.]+)", $CheckoutLogData;
-my $CheckoutTime_Sys = GetRegex "^sys ([0-9.]+)", $CheckoutLogData;
-my $CheckoutTime_CPU = $CVSCheckoutTime_User + $CVSCheckoutTime_Sys;
-
-# Configure info.
-my $ConfigTimeU = GetRegex "^user ([0-9.]+)", $ConfigureLogData;
-my $ConfigTimeS = GetRegex "^sys ([0-9.]+)", $ConfigureLogData;
-my $ConfigTime = $ConfigTimeU+$ConfigTimeS; # ConfigTime = User+System
-my $ConfigWallTime = GetRegex "^real ([0-9.]+)",$ConfigureLogData;
-$ConfigTime=-1 unless $ConfigTime;
-$ConfigWallTime=-1 unless $ConfigWallTime;
-
-# Build info.
-my $BuildTimeU = GetRegex "^user ([0-9.]+)", $BuildLogData;
-my $BuildTimeS = GetRegex "^sys ([0-9.]+)", $BuildLogData;
-my $BuildTime = $BuildTimeU+$BuildTimeS; # BuildTime = User+System
-my $BuildWallTime = GetRegex "^real ([0-9.]+)", $BuildLogData;
-$BuildTime=-1 unless $BuildTime;
-$BuildWallTime=-1 unless $BuildWallTime;
-
-if ( $VERBOSE ) { print "SEND THE DATA VIA THE POST REQUEST\n"; }
-
-my %hash_of_data = (
- 'machine_data' => $machine_data,
- 'build_data' => $ConfigureLogData . $BuildLogData,
- 'gcc_version' => $gcc_version,
- 'nickname' => $nickname,
- 'dejagnutime_wall' => "0.0",
- 'dejagnutime_cpu' => "0.0",
- 'cvscheckouttime_wall' => $CheckoutTime_Wall,
- 'cvscheckouttime_cpu' => $CheckoutTime_CPU,
- 'configtime_wall' => $ConfigWallTime,
- 'configtime_cpu'=> $ConfigTime,
- 'buildtime_wall' => $BuildWallTime,
- 'buildtime_cpu' => $BuildTime,
- 'buildstatus' => $BuildStatus,
- 'singlesource_programstable' => $SingleSourceProgramsTable,
- 'multisource_programstable' => $MultiSourceProgramsTable,
- 'externalsource_programstable' => $ExternalProgramsTable,
- 'llcbeta_options' => $llcbeta_options,
- 'passing_tests' => $passes,
- 'expfail_tests' => $xfails,
- 'unexpfail_tests' => $fails,
- 'all_tests' => $all_tests,
- 'dejagnutests_results' => "Dejagnu skipped by user choice.",
- 'dejagnutests_log' => "",
- 'starttime' => $starttime,
- 'endtime' => $endtime,
- 'target_triple' => $targetTriple,
-
- # Unused, but left around for backwards compatability.
- 'warnings' => "",
- 'cvsusercommitlist' => "",
- 'cvsuserupdatelist' => "",
- 'cvsaddedfiles' => "",
- 'cvsmodifiedfiles' => "",
- 'cvsremovedfiles' => "",
- 'lines_of_code' => "",
- 'cvs_file_count' => 0,
- 'cvs_dir_count' => 0,
- 'warnings_removed' => "",
- 'warnings_added' => "",
- 'new_tests' => "",
- 'removed_tests' => "",
- 'o_file_sizes' => "",
- 'a_file_sizes' => ""
-);
-
-# Write out the "...-sentdata.txt" file.
-WriteSentData \%hash_of_data;
-
-if ($SUBMIT || !($SUBMITAUX eq "")) {
- my $response = SendData $SUBMITSERVER,$SUBMITSCRIPT,\%hash_of_data;
- if( $VERBOSE) { print "============================\n$response"; }
-} else {
- print "============================\n";
- foreach $x(keys %hash_of_data){
- print "$x => $hash_of_data{$x}\n";
- }
-}
-
-##############################################################
-#
-# Remove the source tree...
-#
-##############################################################
-system ( "$NICE rm -rf $BuildDir")
- if (!$NOCHECKOUT and !$NOREMOVE and !$NOREMOVEATEND);
-system ( "$NICE rm -rf $WebDir")
- if (!$NOCHECKOUT and !$NOREMOVE and !$NOREMOVERESULTS);
diff --git a/contrib/llvm/utils/NightlyTest.gnuplot b/contrib/llvm/utils/NightlyTest.gnuplot
deleted file mode 100644
index 514b72a..0000000
--- a/contrib/llvm/utils/NightlyTest.gnuplot
+++ /dev/null
@@ -1,214 +0,0 @@
-set terminal png
-
-##------- Plot small Date vs LOC ----
-set output "running_loc.png"
-set xlabel "Date"
-set ylabel "Lines of Code"
-set xdata time
-set timefmt "%Y-%m-%d-%H:%M:%S:"
-set format x "%b %d, %Y"
-
-set size .75,.75
-set xtics rotate
-set xlabel 0,-1
-plot "running_loc.txt" using 1:2 title '' with lines, \
- "running_loc.txt" using 1:2 title "Date vs. Lines of Code" with lines
-
-##------- Plot large Date vs LOC ----
-set size 1.5,1.5
-set xtics norotate
-set xlabel 0,0
-set output "running_loc_large.png"
-plot "running_loc.txt" using 1:2 title '', \
- "running_loc.txt" using 1:2 title "Date vs. Lines of Code" with lines
-
-
-# Delete all labels...
-set nolabel
-
-##------- Olden CBE performance ----
-
-set size .75,.75
-set xtics rotate
-set xlabel 0,-1
-set output "running_Olden_cbe_time.png"
-set ylabel "CBE compiled execution time (s)"
-plot "running_Olden_cbe_time.txt" u 1:2 t '' with lines, \
- "running_Olden_cbe_time.txt" u 1:2 t "bh" with lines, \
- "running_Olden_cbe_time.txt" u 1:3 t "em3d" with lines, \
- "running_Olden_cbe_time.txt" u 1:4 t "mst" with lines, \
- "running_Olden_cbe_time.txt" u 1:5 t "power" with lines, \
- "running_Olden_cbe_time.txt" u 1:6 t "tsp" with lines, \
- "running_Olden_cbe_time.txt" u 1:7 t "bisort" with lines, \
- "running_Olden_cbe_time.txt" u 1:8 t "health" with lines, \
- "running_Olden_cbe_time.txt" u 1:9 t "perimeter" with lines, \
- "running_Olden_cbe_time.txt" u 1:10 t "treeadd" with lines, \
- "running_Olden_cbe_time.txt" u 1:11 t "voronoi" \
- with lines
-
-set size 1.5,1.5
-set xtics norotate
-set xlabel 0,0
-set output "running_Olden_cbe_time_large.png"
-plot "running_Olden_cbe_time.txt" u 1:2 t '' with lines, \
- "running_Olden_cbe_time.txt" u 1:2 t "bh" with lines, \
- "running_Olden_cbe_time.txt" u 1:3 t "em3d" with lines, \
- "running_Olden_cbe_time.txt" u 1:4 t "mst" with lines, \
- "running_Olden_cbe_time.txt" u 1:5 t "power" with lines, \
- "running_Olden_cbe_time.txt" u 1:6 t "tsp" with lines, \
- "running_Olden_cbe_time.txt" u 1:7 t "bisort" with lines, \
- "running_Olden_cbe_time.txt" u 1:8 t "health" with lines, \
- "running_Olden_cbe_time.txt" u 1:9 t "perimeter" with lines, \
- "running_Olden_cbe_time.txt" u 1:10 t "treeadd" with lines, \
- "running_Olden_cbe_time.txt" u 1:11 t "voronoi" \
- with lines
-
-##------- Olden JIT performance ----
-
-set size .75,.75
-set xtics rotate
-set xlabel 0,-1
-set output "running_Olden_jit_time.png"
-set ylabel "JIT execution time (s)"
-plot "running_Olden_jit_time.txt" u 1:2 t '' with lines, \
- "running_Olden_jit_time.txt" u 1:2 t "bh" with lines, \
- "running_Olden_jit_time.txt" u 1:3 t "em3d" with lines, \
- "running_Olden_jit_time.txt" u 1:4 t "mst" with lines, \
- "running_Olden_jit_time.txt" u 1:5 t "power" with lines, \
- "running_Olden_jit_time.txt" u 1:6 t "tsp" with lines, \
- "running_Olden_jit_time.txt" u 1:7 t "bisort" with lines, \
- "running_Olden_jit_time.txt" u 1:8 t "health" with lines, \
- "running_Olden_jit_time.txt" u 1:9 t "perimeter" with lines, \
- "running_Olden_jit_time.txt" u 1:10 t "treeadd" with lines, \
- "running_Olden_jit_time.txt" u 1:11 t "voronoi" \
- with lines
-
-set size 1.5,1.5
-set xtics norotate
-set xlabel 0,0
-set output "running_Olden_jit_time_large.png"
-plot "running_Olden_jit_time.txt" u 1:2 t '' with lines, \
- "running_Olden_jit_time.txt" u 1:2 t "bh" with lines, \
- "running_Olden_jit_time.txt" u 1:3 t "em3d" with lines, \
- "running_Olden_jit_time.txt" u 1:4 t "mst" with lines, \
- "running_Olden_jit_time.txt" u 1:5 t "power" with lines, \
- "running_Olden_jit_time.txt" u 1:6 t "tsp" with lines, \
- "running_Olden_jit_time.txt" u 1:7 t "bisort" with lines, \
- "running_Olden_jit_time.txt" u 1:8 t "health" with lines, \
- "running_Olden_jit_time.txt" u 1:9 t "perimeter" with lines, \
- "running_Olden_jit_time.txt" u 1:10 t "treeadd" with lines, \
- "running_Olden_jit_time.txt" u 1:11 t "voronoi" \
- with lines
-
-##------- Olden LLC performance ----
-
-set size .75,.75
-set xtics rotate
-set xlabel 0,-1
-set output "running_Olden_llc_time.png"
-set ylabel "LLC compiled execution time (s)"
-plot "running_Olden_llc_time.txt" u 1:2 t '' with lines, \
- "running_Olden_llc_time.txt" u 1:2 t "bh" with lines, \
- "running_Olden_llc_time.txt" u 1:3 t "em3d" with lines, \
- "running_Olden_llc_time.txt" u 1:4 t "mst" with lines, \
- "running_Olden_llc_time.txt" u 1:5 t "power" with lines, \
- "running_Olden_llc_time.txt" u 1:6 t "tsp" with lines, \
- "running_Olden_llc_time.txt" u 1:7 t "bisort" with lines, \
- "running_Olden_llc_time.txt" u 1:8 t "health" with lines, \
- "running_Olden_llc_time.txt" u 1:9 t "perimeter" with lines, \
- "running_Olden_llc_time.txt" u 1:10 t "treeadd" with lines, \
- "running_Olden_llc_time.txt" u 1:11 t "voronoi" \
- with lines
-
-set size 1.5,1.5
-set xtics norotate
-set xlabel 0,0
-set output "running_Olden_llc_time_large.png"
-plot "running_Olden_llc_time.txt" u 1:2 t '' with lines, \
- "running_Olden_llc_time.txt" u 1:2 t "bh" with lines, \
- "running_Olden_llc_time.txt" u 1:3 t "em3d" with lines, \
- "running_Olden_llc_time.txt" u 1:4 t "mst" with lines, \
- "running_Olden_llc_time.txt" u 1:5 t "power" with lines, \
- "running_Olden_llc_time.txt" u 1:6 t "tsp" with lines, \
- "running_Olden_llc_time.txt" u 1:7 t "bisort" with lines, \
- "running_Olden_llc_time.txt" u 1:8 t "health" with lines, \
- "running_Olden_llc_time.txt" u 1:9 t "perimeter" with lines, \
- "running_Olden_llc_time.txt" u 1:10 t "treeadd" with lines, \
- "running_Olden_llc_time.txt" u 1:11 t "voronoi" \
- with lines
-
-
-##------- Olden optimizer time ----
-
-set size .75,.75
-set xtics rotate
-set xlabel 0,-1
-set output "running_Olden_opt_time.png"
-set ylabel "Time to run the optimizer (s)"
-plot "running_Olden_opt_time.txt" u 1:2 t '' with lines, \
- "running_Olden_opt_time.txt" u 1:2 t "bh" with lines, \
- "running_Olden_opt_time.txt" u 1:3 t "em3d" with lines, \
- "running_Olden_opt_time.txt" u 1:4 t "mst" with lines, \
- "running_Olden_opt_time.txt" u 1:5 t "power" with lines, \
- "running_Olden_opt_time.txt" u 1:6 t "tsp" with lines, \
- "running_Olden_opt_time.txt" u 1:7 t "bisort" with lines, \
- "running_Olden_opt_time.txt" u 1:8 t "health" with lines, \
- "running_Olden_opt_time.txt" u 1:9 t "perimeter" with lines, \
- "running_Olden_opt_time.txt" u 1:10 t "treeadd" with lines, \
- "running_Olden_opt_time.txt" u 1:11 t "voronoi" \
- with lines
-
-set size 1.5,1.5
-set xtics norotate
-set xlabel 0,0
-set output "running_Olden_opt_time_large.png"
-plot "running_Olden_opt_time.txt" u 1:2 t '' with lines, \
- "running_Olden_opt_time.txt" u 1:2 t "bh" with lines, \
- "running_Olden_opt_time.txt" u 1:3 t "em3d" with lines, \
- "running_Olden_opt_time.txt" u 1:4 t "mst" with lines, \
- "running_Olden_opt_time.txt" u 1:5 t "power" with lines, \
- "running_Olden_opt_time.txt" u 1:6 t "tsp" with lines, \
- "running_Olden_opt_time.txt" u 1:7 t "bisort" with lines, \
- "running_Olden_opt_time.txt" u 1:8 t "health" with lines, \
- "running_Olden_opt_time.txt" u 1:9 t "perimeter" with lines, \
- "running_Olden_opt_time.txt" u 1:10 t "treeadd" with lines, \
- "running_Olden_opt_time.txt" u 1:11 t "voronoi" \
- with lines
-
-
-##------- Bytecode size ----
-
-set size .75,.75
-set xtics rotate
-set xlabel 0,-1
-set output "running_Olden_bytecode.png"
-set ylabel "Program bytecode size (bytes)"
-plot "running_Olden_bytecode.txt" u 1:2 t '' with lines, \
- "running_Olden_bytecode.txt" u 1:2 t "bh" with lines, \
- "running_Olden_bytecode.txt" u 1:3 t "em3d" with lines, \
- "running_Olden_bytecode.txt" u 1:4 t "mst" with lines, \
- "running_Olden_bytecode.txt" u 1:5 t "power" with lines, \
- "running_Olden_bytecode.txt" u 1:6 t "tsp" with lines, \
- "running_Olden_bytecode.txt" u 1:7 t "bisort" with lines, \
- "running_Olden_bytecode.txt" u 1:8 t "health" with lines, \
- "running_Olden_bytecode.txt" u 1:9 t "perimeter" with lines, \
- "running_Olden_bytecode.txt" u 1:10 t "treeadd" with lines, \
- "running_Olden_bytecode.txt" u 1:11 t "voronoi" \
- with lines
-
-set size 1.5,1.5
-set xtics norotate
-set xlabel 0,0
-set output "running_Olden_bytecode_large.png"
-plot "running_Olden_bytecode.txt" u 1:2 t '' with lines, \
- "running_Olden_bytecode.txt" u 1:2 t "bh" with lines, \
- "running_Olden_bytecode.txt" u 1:3 t "em3d" with lines, \
- "running_Olden_bytecode.txt" u 1:4 t "mst" with lines, \
- "running_Olden_bytecode.txt" u 1:5 t "power" with lines, \
- "running_Olden_bytecode.txt" u 1:6 t "tsp" with lines, \
- "running_Olden_bytecode.txt" u 1:7 t "bisort" with lines, \
- "running_Olden_bytecode.txt" u 1:8 t "health" with lines, \
- "running_Olden_bytecode.txt" u 1:9 t "perimeter" with lines, \
- "running_Olden_bytecode.txt" u 1:10 t "treeadd" with lines, \
- "running_Olden_bytecode.txt" u 1:11 t "voronoi" \
- with lines
diff --git a/contrib/llvm/utils/NightlyTestTemplate.html b/contrib/llvm/utils/NightlyTestTemplate.html
deleted file mode 100644
index c38bb2e..0000000
--- a/contrib/llvm/utils/NightlyTestTemplate.html
+++ /dev/null
@@ -1,244 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><title>LLVM Test Results for $DateString</title></head>
-
-<body bgcolor=white>
-<center><font size=+3 face=Verdana><b>LLVM Test Results for $DateString</b></font></center>
-<hr height=1>
-
-<table width=100%>
-<tr><td valign=top align=center>
-
-<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#000000">
-<table border="0" cellpadding="5" cellspacing="0"><tr><td bgcolor="#DDAA77">
-<font size=+1><b>Sections:</b></font><br>
-</td></tr><tr><td bgcolor="#FFCC99" align=center>
-<a href="#Overview">Overview</a><br>
-<a href="#Changes">Changes</a><br>
-<a href="#Dejagnu">Dejagnu Tests</a><br>
-<a href="#Trends">Trends</a><br>
-<a href="#Programs">Programs</a><br>
-</td></tr></table></td></tr></table>
-
-<p>
-<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#000000">
-<table border="0" cellpadding="5" cellspacing="0"><tr><td bgcolor="#DDAA77"
-<font size=+1><b>Previous:</b></font><br>
-</td></tr><tr><td bgcolor="#FFCC99">
- $PrevDaysList
-</td></tr></table></td></tr></table>
-<p>
-
-<font size=+1><b>Back to:</b></font><br>
-<a href="http://llvm.org/testresults/">Test&nbsp;Results</a><br>
-<a href="http://llvm.org/">LLVM&nbsp;Page</a><p>
-
-</td><td valign=top>
-
-<center>
-<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#000000">
-<table border="0" cellpadding="10" cellspacing="0"><tr><td bgcolor="#DDAA77"
-<font size=+2 face=Verdana><b><a name="Overview">Today's Test Results Overview</font></b>
-</td></tr></table></td></tr></table></center><p>
-
-<!-- Running LOC graph -->
-<table align=right>
-<tr><td>
-<a href="running_loc_large.png"
- ><img border=0 width=480 height=360 src="running_loc.png"></a>
-</td></tr>
-<tr><td align=center>Lines Of Code over Time<br>
-<font size=-1><a href="running_loc_large.png">Click for larger view</a></font>
-</td></tr>
-</table>
-
-<h2>Nightly Test Overview:</h2>
-<ul>
- <li>Start: <b>$TestStartTime</b></li>
- <li>Finish: <b>$TestFinishTime</b></li>
- <li>Platform: <b>$TestPlatform</b></li>
-</ul>
-<h2>CVS Tree Overview:</h2>
-<ul>
-<li><a href="$DATE-CVS-Log.txt">CVS Checkout Log</a>
-<ul>
- <b>$NumDirsInCVS</b> dirs, <b>$NumFilesInCVS</b> files, <b>$LOC</b>
- lines of code, checked out in <b>$CVSCheckoutTime</b> seconds<br></ul>
-<li><a href="$DATE-Build-Log.txt">Compilation Log</a>
-<table>
-<tr><td><b>Item</b></td><td><b>CPU Time</b></td><td><b>Wall Clock</b></td></tr>
-<tr><td>Configure CVS Tree</td><td>$ConfigTime</td><td>$ConfigWallTime</td></tr>
-<tr><td>Build CVS Tree</td><td>$BuildTime</td><td>$BuildWallTime</td></tr>
-<tr><td>Run Dejagnu Tests</td><td>$DejagnuTime</td><td>$DejagnuWallTime</td></tr>
-</table></li>
-<li>Number of object files compiled: <b>$NumObjects</b></li>
-<li>Number of libraries linked: <b>$NumLibraries</b></li>
-<li>Number of executables linked:<b> $NumExecutables</b></li>
-<li>Build Status: $BuildStatus</li>
-</ul>
-
-<h2>Warnings during the build:</h2>
-$WarningsList
-
-<br><br><center>
-<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#000000">
-<table border="0" cellpadding="10" cellspacing="0"><tr><td bgcolor="#DDAA77"
-<font size=+2 face=Verdana><b><a name="Changes">Changes from Yesterday</font></b>
-</td></tr></table></td></tr></table></center><p>
-
-<h2>Changes to CVS:</h2>
-<ul>
-<li>Users who committed to CVS: <b>$UserCommitList</b>
-<li>Users who updated from CVS: <b>$UserUpdateList</b>
-<li>Added Files: $AddedFilesList
-<li>Modified Files: $ModifiedFilesList
-<li>Removed Files: $RemovedFilesList
-</ul><p>
-
-<h2>Changes to Warnings:</h2>
-<p>Warnings Added:</p>
-$WarningsAdded
-<p>Warnings Removed:</p>
-$WarningsRemoved
-
-<h2>Changes in the test suite:</h2>
-<ul>
-<li>New Tests: $TestsAdded
-<li>Removed Tests: $TestsRemoved
-<li>Newly passing tests: $TestsFixed
-<li>Newly failing tests: $TestsBroken
-</ul>
-</td></tr></tbody></table>
-
-
-<br/><br/><center>
-<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#000000">
-<table border="0" cellpadding="10" cellspacing="0"><tr><td bgcolor="#DDAA77"
-<font size=+2 face=Verdana><b><a name="Dejagnu">Dejagnu Test Results</font></b>
-</td></tr></table></td></tr></table></center>
-<br/>
-$DejagnuTestResults
-<p>A complete log of testing <a href="$DATE-Dejagnu-testrun.log">Feature and Regression</a> is available for further analysis.</p>
-
-<br><br><center>
-<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#000000">
-<table border="0" cellpadding="10" cellspacing="0"><tr><td bgcolor="#DDAA77"
-<font size=+2 face=Verdana><b><a name="Trends">Changes Over Time</font></b>
-</td></tr></table></td></tr></table></center><p>
-
-
-Here are some charts showing how the LLVM optimizer and code generators are
-changing over time. For now we use the Olden benchmark suite to measure this,
-but eventually we will switch to using SPEC CPU2000. All programs are run with
-"LARGE_PROBLEM_SIZE" enabled. Click on any of the charts to get a larger
-version.<p>
-
-<h2>Compilation Measurements:</h2>
-
-<table border="0" align=center>
-<tr>
-<td width=50% align=center>
-<a href="running_Olden_bytecode_large.png"><img width=480 height=360 border=0 src="running_Olden_bytecode.png"></a><br>
-Size of LLVM bytecode files
-</td>
-<td width=50% align=center>
-<a href="running_Olden_opt_time_large.png"><img width=480 height=360 border=0 src="running_Olden_opt_time.png"></a><br>
-Time to run the LLVM optimizer on each program
-</td></tr>
-</table>
-
-<h2>Program Execution Measurements:</h2>
-
-<table border="0" align=center>
-<tr>
-<td width=50% align=center>
-<a href="running_Olden_cbe_time_large.png"><img width=480 height=360 border=0 src="running_Olden_cbe_time.png"></a><br>
-Execution time for CBE generated executable
-</td>
-<td width=50% align=center>
-<a href="running_Olden_llc_time_large.png"><img width=480 height=360 border=0 src="running_Olden_llc_time.png"></a><br>
-Execution time for the LLC generated executable
-</td></tr>
-
-<tr>
-<td align=center>
-<a href="running_Olden_jit_time_large.png"><img width=480 height=360 border=0 src="running_Olden_jit_time.png"></a><br>
-Execution time for program in the JIT
-</td>
-<td></td></tr>
-</table>
-
-
-
-
-<br><br><center>
-<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#000000">
-<table border="0" cellpadding="10" cellspacing="0"><tr><td bgcolor="#DDAA77"
-<font size=+2 face=Verdana><b><a name="Programs">Program Tests</font></b>
-</td></tr></table></td></tr></table></center><p>
-
-This section tests LLVM on a variety of programs in the test suite. This
-includes benchmark suites like the Olden, McCat, Ptrdist, and SPEC benchmarks as
-well as a few random programs with test inputs. This section is meant to track
-how stable LLVM is as a whole. A failure in the execution of any test is marked
-with an asterisk: `*'. The columns of the tables are:<p>
-
-<ol>
-<li><a name="Program">Program</a> - The name of the program for that row.</li>
-<li><a name="GCCAS">GCCAS</a> - Time to run LLVM optimizers on the program.</li>
-<li><a name="Bytecode">Bytecode</a> - The size of the bytecode for the
- program</li>
-<li><a name="Instrs">Instrs</a> - The number of LLVM instructions in the
- compiled bytecode</li>
-<li><a name="LLC<br>compile">LLC compile</a> - The time taken compile with
- LLC (the static backend)</li>
-<li><a name="JIT<br>codegen">JIT codegen</a> - The amount of time spent in the
- JIT itself, instead of executing the program.</li>
-<li><a name="Machine<br>code">Machine code</a> - The number of bytes of machine
- code generated by the JIT.</li>
-<li><a name="GCC">GCC</a> - The time taken to execute the program when compiled
- with GCC -O2.</li>
-<li><a name="CBE">CBE</a> - The time taken to execute the program after
- compilation through the C backend, compiled with -O2.</li>
-<li><a name="LLC">LLC</a> - How long does the program generated by the static
- backend LLC take to execute </li>
-<li><a name="JIT">JIT</a> - The amount of time spent running the
- program with the JIT; this includes the code generation phase (listed above)
- and actually running the program.</li>
-<li><a name="GCC/LLC">GCC/LLC</a> - The speed-up of the LLC output vs the native
- GCC output: greater than 1 is a speedup, less than 1 is a slowdown.</li>
-<li><a name="GCC/CBE">GCC/CBE</a> - The speed-up of the CBE output vs the native
- GCC output: greater than 1 is a speedup, less than 1 is a slowdown.</li>
-<li><a name="LLC-BETA">LLC-BETA</a> - How long does the program generated by the static
- backend LLC take to execute the program, when compiled with new experimental
- features. This is temporary, for tuning.</li>
-</ol><p>
-
-A complete log of testing
-<a href="$DATE-SingleSource-ProgramTest.txt.gz">SingleSource</a>,
-<a href="$DATE-MultiSource-ProgramTest.txt.gz">MultiSource</a>, and
-<a href="$DATE-External-ProgramTest.txt.gz">External</a> programs are
-available for further analysis.
-
-<h2>Programs/External</h2>
-
-<center>
-<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#000000">
-$ExternalProgramsTable
-</td></tr></table></center>
-
-<h2>Programs/MultiSource</h2>
-
-<center>
-<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#000000">
-$MultiSourceProgramsTable
-</td></tr></table></center>
-
-<h2>Programs/SingleSource</h2>
-
-<center>
-<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#000000">
-$SingleSourceProgramsTable
-</td></tr></table></center>
-
-</td></tr></html>
-
diff --git a/contrib/llvm/utils/OldenDataRecover.pl b/contrib/llvm/utils/OldenDataRecover.pl
deleted file mode 100644
index 7678394..0000000
--- a/contrib/llvm/utils/OldenDataRecover.pl
+++ /dev/null
@@ -1,37 +0,0 @@
-#this script is intended to help recover the running graphs when
-#the nightly tester decides to eat them.
-
-#zgrep -E "(=========)|(TEST-RESULT-llc-time)" *-Olden-tests.txt* |perl this > file
-#zgrep -E "(=========)|(TEST-RESULT-compile.*bc)" *-Olden-tests.tx* |perl this >file
-
-while (<>) {
- if (/(\d*-\d*-\d*)-.*=========.*\/(.*)\' Program/) {
-# print "$1 $2\n";
- $curP = $2;
- $curD = $1;
- $dates{$1} = 1;
- } elsif (/(\d*-\d*-\d*)-.*TEST-RESULT-.*: program (\d*\.\d*)/) {
-# print "$1 $2\n";
- if ($curD eq $1) {
- $$data{$curD}{$curP} = $2;
- }
- } elsif (/(\d*-\d*-\d*)-.*TEST-RESULT-.*: (\d*)/) {
-# print "$1 $2\n";
- if ($curD eq $1) {
- $$data{$curD}{$curP} = $2;
- }
- }
-}
-@progs = ("bh", "em3d", "mst", "power", "tsp", "bisort", "health", "perimeter", "treeadd", "voronoi");
-
-foreach $date (sort keys %dates) {
- print "$date: ";
- foreach $prog (@progs) {
- if ($$data{$date}{$prog}) {
- print " $$data{$date}{$prog}";
- } else {
- print " 0";
- }
- }
- print "\n";
-}
diff --git a/contrib/llvm/utils/PerfectShuffle/Makefile b/contrib/llvm/utils/PerfectShuffle/Makefile
deleted file mode 100644
index 28709fe..0000000
--- a/contrib/llvm/utils/PerfectShuffle/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-##===- utils/PerfectShuffle/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-PerfectShuffle
-NO_INSTALL = 1
-
-# This tool has no plugins, optimize startup time.
-TOOL_NO_EXPORTS = 1
-
-include $(LEVEL)/Makefile.common
-
diff --git a/contrib/llvm/utils/PerfectShuffle/PerfectShuffle.cpp b/contrib/llvm/utils/PerfectShuffle/PerfectShuffle.cpp
deleted file mode 100644
index b94a7d3..0000000
--- a/contrib/llvm/utils/PerfectShuffle/PerfectShuffle.cpp
+++ /dev/null
@@ -1,571 +0,0 @@
-//===-- PerfectShuffle.cpp - Perfect Shuffle Generator --------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file computes an optimal sequence of instructions for doing all shuffles
-// of two 4-element vectors. With a release build and when configured to emit
-// an altivec instruction table, this takes about 30s to run on a 2.7Ghz
-// PowerPC G5.
-//
-//===----------------------------------------------------------------------===//
-
-#include <iostream>
-#include <vector>
-#include <cassert>
-#include <cstdlib>
-struct Operator;
-
-// Masks are 4-nibble hex numbers. Values 0-7 in any nibble means that it takes
-// an element from that value of the input vectors. A value of 8 means the
-// entry is undefined.
-
-// Mask manipulation functions.
-static inline unsigned short MakeMask(unsigned V0, unsigned V1,
- unsigned V2, unsigned V3) {
- return (V0 << (3*4)) | (V1 << (2*4)) | (V2 << (1*4)) | (V3 << (0*4));
-}
-
-/// getMaskElt - Return element N of the specified mask.
-static unsigned getMaskElt(unsigned Mask, unsigned Elt) {
- return (Mask >> ((3-Elt)*4)) & 0xF;
-}
-
-static unsigned setMaskElt(unsigned Mask, unsigned Elt, unsigned NewVal) {
- unsigned FieldShift = ((3-Elt)*4);
- return (Mask & ~(0xF << FieldShift)) | (NewVal << FieldShift);
-}
-
-// Reject elements where the values are 9-15.
-static bool isValidMask(unsigned short Mask) {
- unsigned short UndefBits = Mask & 0x8888;
- return (Mask & ((UndefBits >> 1)|(UndefBits>>2)|(UndefBits>>3))) == 0;
-}
-
-/// hasUndefElements - Return true if any of the elements in the mask are undefs
-///
-static bool hasUndefElements(unsigned short Mask) {
- return (Mask & 0x8888) != 0;
-}
-
-/// isOnlyLHSMask - Return true if this mask only refers to its LHS, not
-/// including undef values..
-static bool isOnlyLHSMask(unsigned short Mask) {
- return (Mask & 0x4444) == 0;
-}
-
-/// getLHSOnlyMask - Given a mask that refers to its LHS and RHS, modify it to
-/// refer to the LHS only (for when one argument value is passed into the same
-/// function twice).
-#if 0
-static unsigned short getLHSOnlyMask(unsigned short Mask) {
- return Mask & 0xBBBB; // Keep only LHS and Undefs.
-}
-#endif
-
-/// getCompressedMask - Turn a 16-bit uncompressed mask (where each elt uses 4
-/// bits) into a compressed 13-bit mask, where each elt is multiplied by 9.
-static unsigned getCompressedMask(unsigned short Mask) {
- return getMaskElt(Mask, 0)*9*9*9 + getMaskElt(Mask, 1)*9*9 +
- getMaskElt(Mask, 2)*9 + getMaskElt(Mask, 3);
-}
-
-static void PrintMask(unsigned i, std::ostream &OS) {
- OS << "<" << (char)(getMaskElt(i, 0) == 8 ? 'u' : ('0'+getMaskElt(i, 0)))
- << "," << (char)(getMaskElt(i, 1) == 8 ? 'u' : ('0'+getMaskElt(i, 1)))
- << "," << (char)(getMaskElt(i, 2) == 8 ? 'u' : ('0'+getMaskElt(i, 2)))
- << "," << (char)(getMaskElt(i, 3) == 8 ? 'u' : ('0'+getMaskElt(i, 3)))
- << ">";
-}
-
-/// ShuffleVal - This represents a shufflevector operation.
-struct ShuffleVal {
- unsigned Cost; // Number of instrs used to generate this value.
- Operator *Op; // The Operation used to generate this value.
- unsigned short Arg0, Arg1; // Input operands for this value.
-
- ShuffleVal() : Cost(1000000) {}
-};
-
-
-/// ShufTab - This is the actual shuffle table that we are trying to generate.
-///
-static ShuffleVal ShufTab[65536];
-
-/// TheOperators - All of the operators that this target supports.
-static std::vector<Operator*> TheOperators;
-
-/// Operator - This is a vector operation that is available for use.
-struct Operator {
- unsigned short ShuffleMask;
- unsigned short OpNum;
- const char *Name;
- unsigned Cost;
-
- Operator(unsigned short shufflemask, const char *name, unsigned opnum,
- unsigned cost = 1)
- : ShuffleMask(shufflemask), OpNum(opnum), Name(name), Cost(cost) {
- TheOperators.push_back(this);
- }
- ~Operator() {
- assert(TheOperators.back() == this);
- TheOperators.pop_back();
- }
-
- bool isOnlyLHSOperator() const {
- return isOnlyLHSMask(ShuffleMask);
- }
-
- const char *getName() const { return Name; }
- unsigned getCost() const { return Cost; }
-
- unsigned short getTransformedMask(unsigned short LHSMask, unsigned RHSMask) {
- // Extract the elements from LHSMask and RHSMask, as appropriate.
- unsigned Result = 0;
- for (unsigned i = 0; i != 4; ++i) {
- unsigned SrcElt = (ShuffleMask >> (4*i)) & 0xF;
- unsigned ResElt;
- if (SrcElt < 4)
- ResElt = getMaskElt(LHSMask, SrcElt);
- else if (SrcElt < 8)
- ResElt = getMaskElt(RHSMask, SrcElt-4);
- else {
- assert(SrcElt == 8 && "Bad src elt!");
- ResElt = 8;
- }
- Result |= ResElt << (4*i);
- }
- return Result;
- }
-};
-
-static const char *getZeroCostOpName(unsigned short Op) {
- if (ShufTab[Op].Arg0 == 0x0123)
- return "LHS";
- else if (ShufTab[Op].Arg0 == 0x4567)
- return "RHS";
- else {
- assert(0 && "bad zero cost operation");
- abort();
- }
-}
-
-static void PrintOperation(unsigned ValNo, unsigned short Vals[]) {
- unsigned short ThisOp = Vals[ValNo];
- std::cerr << "t" << ValNo;
- PrintMask(ThisOp, std::cerr);
- std::cerr << " = " << ShufTab[ThisOp].Op->getName() << "(";
-
- if (ShufTab[ShufTab[ThisOp].Arg0].Cost == 0) {
- std::cerr << getZeroCostOpName(ShufTab[ThisOp].Arg0);
- PrintMask(ShufTab[ThisOp].Arg0, std::cerr);
- } else {
- // Figure out what tmp # it is.
- for (unsigned i = 0; ; ++i)
- if (Vals[i] == ShufTab[ThisOp].Arg0) {
- std::cerr << "t" << i;
- break;
- }
- }
-
- if (!ShufTab[Vals[ValNo]].Op->isOnlyLHSOperator()) {
- std::cerr << ", ";
- if (ShufTab[ShufTab[ThisOp].Arg1].Cost == 0) {
- std::cerr << getZeroCostOpName(ShufTab[ThisOp].Arg1);
- PrintMask(ShufTab[ThisOp].Arg1, std::cerr);
- } else {
- // Figure out what tmp # it is.
- for (unsigned i = 0; ; ++i)
- if (Vals[i] == ShufTab[ThisOp].Arg1) {
- std::cerr << "t" << i;
- break;
- }
- }
- }
- std::cerr << ") ";
-}
-
-static unsigned getNumEntered() {
- unsigned Count = 0;
- for (unsigned i = 0; i != 65536; ++i)
- Count += ShufTab[i].Cost < 100;
- return Count;
-}
-
-static void EvaluateOps(unsigned short Elt, unsigned short Vals[],
- unsigned &NumVals) {
- if (ShufTab[Elt].Cost == 0) return;
-
- // If this value has already been evaluated, it is free. FIXME: match undefs.
- for (unsigned i = 0, e = NumVals; i != e; ++i)
- if (Vals[i] == Elt) return;
-
- // Otherwise, get the operands of the value, then add it.
- unsigned Arg0 = ShufTab[Elt].Arg0, Arg1 = ShufTab[Elt].Arg1;
- if (ShufTab[Arg0].Cost)
- EvaluateOps(Arg0, Vals, NumVals);
- if (Arg0 != Arg1 && ShufTab[Arg1].Cost)
- EvaluateOps(Arg1, Vals, NumVals);
-
- Vals[NumVals++] = Elt;
-}
-
-
-int main() {
- // Seed the table with accesses to the LHS and RHS.
- ShufTab[0x0123].Cost = 0;
- ShufTab[0x0123].Op = 0;
- ShufTab[0x0123].Arg0 = 0x0123;
- ShufTab[0x4567].Cost = 0;
- ShufTab[0x4567].Op = 0;
- ShufTab[0x4567].Arg0 = 0x4567;
-
- // Seed the first-level of shuffles, shuffles whose inputs are the input to
- // the vectorshuffle operation.
- bool MadeChange = true;
- unsigned OpCount = 0;
- while (MadeChange) {
- MadeChange = false;
- ++OpCount;
- std::cerr << "Starting iteration #" << OpCount << " with "
- << getNumEntered() << " entries established.\n";
-
- // Scan the table for two reasons: First, compute the maximum cost of any
- // operation left in the table. Second, make sure that values with undefs
- // have the cheapest alternative that they match.
- unsigned MaxCost = ShufTab[0].Cost;
- for (unsigned i = 1; i != 0x8889; ++i) {
- if (!isValidMask(i)) continue;
- if (ShufTab[i].Cost > MaxCost)
- MaxCost = ShufTab[i].Cost;
-
- // If this value has an undef, make it be computed the cheapest possible
- // way of any of the things that it matches.
- if (hasUndefElements(i)) {
- // This code is a little bit tricky, so here's the idea: consider some
- // permutation, like 7u4u. To compute the lowest cost for 7u4u, we
- // need to take the minimum cost of all of 7[0-8]4[0-8], 81 entries. If
- // there are 3 undefs, the number rises to 729 entries we have to scan,
- // and for the 4 undef case, we have to scan the whole table.
- //
- // Instead of doing this huge amount of scanning, we process the table
- // entries *in order*, and use the fact that 'u' is 8, larger than any
- // valid index. Given an entry like 7u4u then, we only need to scan
- // 7[0-7]4u - 8 entries. We can get away with this, because we already
- // know that each of 704u, 714u, 724u, etc contain the minimum value of
- // all of the 704[0-8], 714[0-8] and 724[0-8] entries respectively.
- unsigned UndefIdx;
- if (i & 0x8000)
- UndefIdx = 0;
- else if (i & 0x0800)
- UndefIdx = 1;
- else if (i & 0x0080)
- UndefIdx = 2;
- else if (i & 0x0008)
- UndefIdx = 3;
- else
- abort();
-
- unsigned MinVal = i;
- unsigned MinCost = ShufTab[i].Cost;
-
- // Scan the 8 entries.
- for (unsigned j = 0; j != 8; ++j) {
- unsigned NewElt = setMaskElt(i, UndefIdx, j);
- if (ShufTab[NewElt].Cost < MinCost) {
- MinCost = ShufTab[NewElt].Cost;
- MinVal = NewElt;
- }
- }
-
- // If we found something cheaper than what was here before, use it.
- if (i != MinVal) {
- MadeChange = true;
- ShufTab[i] = ShufTab[MinVal];
- }
- }
- }
-
- for (unsigned LHS = 0; LHS != 0x8889; ++LHS) {
- if (!isValidMask(LHS)) continue;
- if (ShufTab[LHS].Cost > 1000) continue;
-
- // If nothing involving this operand could possibly be cheaper than what
- // we already have, don't consider it.
- if (ShufTab[LHS].Cost + 1 >= MaxCost)
- continue;
-
- for (unsigned opnum = 0, e = TheOperators.size(); opnum != e; ++opnum) {
- Operator *Op = TheOperators[opnum];
-
- // Evaluate op(LHS,LHS)
- unsigned ResultMask = Op->getTransformedMask(LHS, LHS);
-
- unsigned Cost = ShufTab[LHS].Cost + Op->getCost();
- if (Cost < ShufTab[ResultMask].Cost) {
- ShufTab[ResultMask].Cost = Cost;
- ShufTab[ResultMask].Op = Op;
- ShufTab[ResultMask].Arg0 = LHS;
- ShufTab[ResultMask].Arg1 = LHS;
- MadeChange = true;
- }
-
- // If this is a two input instruction, include the op(x,y) cases. If
- // this is a one input instruction, skip this.
- if (Op->isOnlyLHSOperator()) continue;
-
- for (unsigned RHS = 0; RHS != 0x8889; ++RHS) {
- if (!isValidMask(RHS)) continue;
- if (ShufTab[RHS].Cost > 1000) continue;
-
- // If nothing involving this operand could possibly be cheaper than
- // what we already have, don't consider it.
- if (ShufTab[RHS].Cost + 1 >= MaxCost)
- continue;
-
-
- // Evaluate op(LHS,RHS)
- unsigned ResultMask = Op->getTransformedMask(LHS, RHS);
-
- if (ShufTab[ResultMask].Cost <= OpCount ||
- ShufTab[ResultMask].Cost <= ShufTab[LHS].Cost ||
- ShufTab[ResultMask].Cost <= ShufTab[RHS].Cost)
- continue;
-
- // Figure out the cost to evaluate this, knowing that CSE's only need
- // to be evaluated once.
- unsigned short Vals[30];
- unsigned NumVals = 0;
- EvaluateOps(LHS, Vals, NumVals);
- EvaluateOps(RHS, Vals, NumVals);
-
- unsigned Cost = NumVals + Op->getCost();
- if (Cost < ShufTab[ResultMask].Cost) {
- ShufTab[ResultMask].Cost = Cost;
- ShufTab[ResultMask].Op = Op;
- ShufTab[ResultMask].Arg0 = LHS;
- ShufTab[ResultMask].Arg1 = RHS;
- MadeChange = true;
- }
- }
- }
- }
- }
-
- std::cerr << "Finished Table has " << getNumEntered()
- << " entries established.\n";
-
- unsigned CostArray[10] = { 0 };
-
- // Compute a cost histogram.
- for (unsigned i = 0; i != 65536; ++i) {
- if (!isValidMask(i)) continue;
- if (ShufTab[i].Cost > 9)
- ++CostArray[9];
- else
- ++CostArray[ShufTab[i].Cost];
- }
-
- for (unsigned i = 0; i != 9; ++i)
- if (CostArray[i])
- std::cout << "// " << CostArray[i] << " entries have cost " << i << "\n";
- if (CostArray[9])
- std::cout << "// " << CostArray[9] << " entries have higher cost!\n";
-
-
- // Build up the table to emit.
- std::cout << "\n// This table is 6561*4 = 26244 bytes in size.\n";
- std::cout << "static const unsigned PerfectShuffleTable[6561+1] = {\n";
-
- for (unsigned i = 0; i != 0x8889; ++i) {
- if (!isValidMask(i)) continue;
-
- // CostSat - The cost of this operation saturated to two bits.
- unsigned CostSat = ShufTab[i].Cost;
- if (CostSat > 4) CostSat = 4;
- if (CostSat == 0) CostSat = 1;
- --CostSat; // Cost is now between 0-3.
-
- unsigned OpNum = ShufTab[i].Op ? ShufTab[i].Op->OpNum : 0;
- assert(OpNum < 16 && "Too few bits to encode operation!");
-
- unsigned LHS = getCompressedMask(ShufTab[i].Arg0);
- unsigned RHS = getCompressedMask(ShufTab[i].Arg1);
-
- // Encode this as 2 bits of saturated cost, 4 bits of opcodes, 13 bits of
- // LHS, and 13 bits of RHS = 32 bits.
- unsigned Val = (CostSat << 30) | (OpNum << 26) | (LHS << 13) | RHS;
-
- std::cout << " " << Val << "U,\t// ";
- PrintMask(i, std::cout);
- std::cout << ": Cost " << ShufTab[i].Cost;
- std::cout << " " << (ShufTab[i].Op ? ShufTab[i].Op->getName() : "copy");
- std::cout << " ";
- if (ShufTab[ShufTab[i].Arg0].Cost == 0) {
- std::cout << getZeroCostOpName(ShufTab[i].Arg0);
- } else {
- PrintMask(ShufTab[i].Arg0, std::cout);
- }
-
- if (ShufTab[i].Op && !ShufTab[i].Op->isOnlyLHSOperator()) {
- std::cout << ", ";
- if (ShufTab[ShufTab[i].Arg1].Cost == 0) {
- std::cout << getZeroCostOpName(ShufTab[i].Arg1);
- } else {
- PrintMask(ShufTab[i].Arg1, std::cout);
- }
- }
- std::cout << "\n";
- }
- std::cout << " 0\n};\n";
-
- if (0) {
- // Print out the table.
- for (unsigned i = 0; i != 0x8889; ++i) {
- if (!isValidMask(i)) continue;
- if (ShufTab[i].Cost < 1000) {
- PrintMask(i, std::cerr);
- std::cerr << " - Cost " << ShufTab[i].Cost << " - ";
-
- unsigned short Vals[30];
- unsigned NumVals = 0;
- EvaluateOps(i, Vals, NumVals);
-
- for (unsigned j = 0, e = NumVals; j != e; ++j)
- PrintOperation(j, Vals);
- std::cerr << "\n";
- }
- }
- }
-}
-
-
-#ifdef GENERATE_ALTIVEC
-
-///===---------------------------------------------------------------------===//
-/// The altivec instruction definitions. This is the altivec-specific part of
-/// this file.
-///===---------------------------------------------------------------------===//
-
-// Note that the opcode numbers here must match those in the PPC backend.
-enum {
- OP_COPY = 0, // Copy, used for things like <u,u,u,3> to say it is <0,1,2,3>
- OP_VMRGHW,
- OP_VMRGLW,
- OP_VSPLTISW0,
- OP_VSPLTISW1,
- OP_VSPLTISW2,
- OP_VSPLTISW3,
- OP_VSLDOI4,
- OP_VSLDOI8,
- OP_VSLDOI12
-};
-
-struct vmrghw : public Operator {
- vmrghw() : Operator(0x0415, "vmrghw", OP_VMRGHW) {}
-} the_vmrghw;
-
-struct vmrglw : public Operator {
- vmrglw() : Operator(0x2637, "vmrglw", OP_VMRGLW) {}
-} the_vmrglw;
-
-template<unsigned Elt>
-struct vspltisw : public Operator {
- vspltisw(const char *N, unsigned Opc)
- : Operator(MakeMask(Elt, Elt, Elt, Elt), N, Opc) {}
-};
-
-vspltisw<0> the_vspltisw0("vspltisw0", OP_VSPLTISW0);
-vspltisw<1> the_vspltisw1("vspltisw1", OP_VSPLTISW1);
-vspltisw<2> the_vspltisw2("vspltisw2", OP_VSPLTISW2);
-vspltisw<3> the_vspltisw3("vspltisw3", OP_VSPLTISW3);
-
-template<unsigned N>
-struct vsldoi : public Operator {
- vsldoi(const char *Name, unsigned Opc)
- : Operator(MakeMask(N&7, (N+1)&7, (N+2)&7, (N+3)&7), Name, Opc) {
- }
-};
-
-vsldoi<1> the_vsldoi1("vsldoi4" , OP_VSLDOI4);
-vsldoi<2> the_vsldoi2("vsldoi8" , OP_VSLDOI8);
-vsldoi<3> the_vsldoi3("vsldoi12", OP_VSLDOI12);
-
-#endif
-
-#define GENERATE_NEON
-
-#ifdef GENERATE_NEON
-enum {
- OP_COPY = 0, // Copy, used for things like <u,u,u,3> to say it is <0,1,2,3>
- OP_VREV,
- OP_VDUP0,
- OP_VDUP1,
- OP_VDUP2,
- OP_VDUP3,
- OP_VEXT1,
- OP_VEXT2,
- OP_VEXT3,
- OP_VUZPL, // VUZP, left result
- OP_VUZPR, // VUZP, right result
- OP_VZIPL, // VZIP, left result
- OP_VZIPR, // VZIP, right result
- OP_VTRNL, // VTRN, left result
- OP_VTRNR // VTRN, right result
-};
-
-struct vrev : public Operator {
- vrev() : Operator(0x1032, "vrev", OP_VREV) {}
-} the_vrev;
-
-template<unsigned Elt>
-struct vdup : public Operator {
- vdup(const char *N, unsigned Opc)
- : Operator(MakeMask(Elt, Elt, Elt, Elt), N, Opc) {}
-};
-
-vdup<0> the_vdup0("vdup0", OP_VDUP0);
-vdup<1> the_vdup1("vdup1", OP_VDUP1);
-vdup<2> the_vdup2("vdup2", OP_VDUP2);
-vdup<3> the_vdup3("vdup3", OP_VDUP3);
-
-template<unsigned N>
-struct vext : public Operator {
- vext(const char *Name, unsigned Opc)
- : Operator(MakeMask(N&7, (N+1)&7, (N+2)&7, (N+3)&7), Name, Opc) {
- }
-};
-
-vext<1> the_vext1("vext1", OP_VEXT1);
-vext<2> the_vext2("vext2", OP_VEXT2);
-vext<3> the_vext3("vext3", OP_VEXT3);
-
-struct vuzpl : public Operator {
- vuzpl() : Operator(0x0246, "vuzpl", OP_VUZPL, 2) {}
-} the_vuzpl;
-
-struct vuzpr : public Operator {
- vuzpr() : Operator(0x1357, "vuzpr", OP_VUZPR, 2) {}
-} the_vuzpr;
-
-struct vzipl : public Operator {
- vzipl() : Operator(0x0415, "vzipl", OP_VZIPL, 2) {}
-} the_vzipl;
-
-struct vzipr : public Operator {
- vzipr() : Operator(0x2637, "vzipr", OP_VZIPR, 2) {}
-} the_vzipr;
-
-struct vtrnl : public Operator {
- vtrnl() : Operator(0x0426, "vtrnl", OP_VTRNL, 2) {}
-} the_vtrnl;
-
-struct vtrnr : public Operator {
- vtrnr() : Operator(0x1537, "vtrnr", OP_VTRNR, 2) {}
-} the_vtrnr;
-
-#endif
diff --git a/contrib/llvm/utils/TableGen/CMakeLists.txt b/contrib/llvm/utils/TableGen/CMakeLists.txt
deleted file mode 100644
index 972989b..0000000
--- a/contrib/llvm/utils/TableGen/CMakeLists.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-add_executable(tblgen
- ARMDecoderEmitter.cpp
- AsmMatcherEmitter.cpp
- AsmWriterEmitter.cpp
- AsmWriterInst.cpp
- CallingConvEmitter.cpp
- ClangASTNodesEmitter.cpp
- ClangAttrEmitter.cpp
- ClangDiagnosticsEmitter.cpp
- CodeEmitterGen.cpp
- CodeGenDAGPatterns.cpp
- CodeGenInstruction.cpp
- CodeGenTarget.cpp
- DAGISelEmitter.cpp
- DAGISelMatcherEmitter.cpp
- DAGISelMatcherGen.cpp
- DAGISelMatcherOpt.cpp
- DAGISelMatcher.cpp
- DisassemblerEmitter.cpp
- EDEmitter.cpp
- FastISelEmitter.cpp
- InstrEnumEmitter.cpp
- InstrInfoEmitter.cpp
- IntrinsicEmitter.cpp
- LLVMCConfigurationEmitter.cpp
- NeonEmitter.cpp
- OptParserEmitter.cpp
- Record.cpp
- RegisterInfoEmitter.cpp
- SubtargetEmitter.cpp
- TGLexer.cpp
- TGParser.cpp
- TGValueTypes.cpp
- TableGen.cpp
- TableGenBackend.cpp
- X86DisassemblerTables.cpp
- X86RecognizableInstr.cpp
- )
-
-target_link_libraries(tblgen LLVMSupport LLVMSystem)
-if( MINGW )
- target_link_libraries(tblgen imagehlp psapi)
-endif( MINGW )
-if( LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD AND NOT BEOS )
- target_link_libraries(tblgen pthread)
-endif()
diff --git a/contrib/llvm/utils/TableGen/Makefile b/contrib/llvm/utils/TableGen/Makefile
deleted file mode 100644
index f27cd99..0000000
--- a/contrib/llvm/utils/TableGen/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-##===- utils/TableGen/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 = tblgen
-USEDLIBS = LLVMSupport.a LLVMSystem.a
-REQUIRES_EH := 1
-REQUIRES_RTTI := 1
-
-# This tool has no plugins, optimize startup time.
-TOOL_NO_EXPORTS = 1
-
-include $(LEVEL)/Makefile.common
-
diff --git a/contrib/llvm/utils/UpdateCMakeLists.pl b/contrib/llvm/utils/UpdateCMakeLists.pl
deleted file mode 100755
index 8f535145..0000000
--- a/contrib/llvm/utils/UpdateCMakeLists.pl
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/usr/bin/env perl
-use strict;
-use File::Find;
-use File::Copy;
-use Digest::MD5;
-
-my @fileTypes = ("cpp", "c");
-my %dirFiles;
-my %dirCMake;
-
-sub GetFiles {
- my $dir = shift;
- my $x = $dirFiles{$dir};
- if (!defined $x) {
- $x = [];
- $dirFiles{$dir} = $x;
- }
- return $x;
-}
-
-sub ProcessFile {
- my $file = $_;
- my $dir = $File::Find::dir;
- # Record if a CMake file was found.
- if ($file eq "CMakeLists.txt") {
- $dirCMake{$dir} = $File::Find::name;
- return 0;
- }
- # Grab the extension of the file.
- $file =~ /\.([^.]+)$/;
- my $ext = $1;
- my $files;
- foreach my $x (@fileTypes) {
- if ($ext eq $x) {
- if (!defined $files) {
- $files = GetFiles($dir);
- }
- push @$files, $file;
- return 0;
- }
- }
- return 0;
-}
-
-sub EmitCMakeList {
- my $dir = shift;
- my $files = $dirFiles{$dir};
-
- if (!defined $files) {
- return;
- }
-
- foreach my $file (sort @$files) {
- print OUT " ";
- print OUT $file;
- print OUT "\n";
- }
-}
-
-sub UpdateCMake {
- my $cmakeList = shift;
- my $dir = shift;
- my $cmakeListNew = $cmakeList . ".new";
- open(IN, $cmakeList);
- open(OUT, ">", $cmakeListNew);
- my $foundLibrary = 0;
-
- while(<IN>) {
- if (!$foundLibrary) {
- print OUT $_;
- if (/^add_clang_library\(/ || /^add_llvm_library\(/ || /^add_llvm_target\(/
- || /^add_executable\(/) {
- $foundLibrary = 1;
- EmitCMakeList($dir);
- }
- }
- else {
- if (/\)/) {
- print OUT $_;
- $foundLibrary = 0;
- }
- }
- }
-
- close(IN);
- close(OUT);
-
- open(FILE, $cmakeList) or
- die("Cannot open $cmakeList when computing digest\n");
- binmode FILE;
- my $digestA = Digest::MD5->new->addfile(*FILE)->hexdigest;
- close(FILE);
-
- open(FILE, $cmakeListNew) or
- die("Cannot open $cmakeListNew when computing digest\n");
- binmode FILE;
- my $digestB = Digest::MD5->new->addfile(*FILE)->hexdigest;
- close(FILE);
-
- if ($digestA ne $digestB) {
- move($cmakeListNew, $cmakeList);
- return 1;
- }
-
- unlink($cmakeListNew);
- return 0;
-}
-
-sub UpdateCMakeFiles {
- foreach my $dir (sort keys %dirCMake) {
- if (UpdateCMake($dirCMake{$dir}, $dir)) {
- print "Updated: $dir\n";
- }
- }
-}
-
-find({ wanted => \&ProcessFile, follow => 1 }, '.');
-UpdateCMakeFiles();
-
diff --git a/contrib/llvm/utils/bugpoint/RemoteRunSafely.sh b/contrib/llvm/utils/bugpoint/RemoteRunSafely.sh
deleted file mode 100644
index f390e33..0000000
--- a/contrib/llvm/utils/bugpoint/RemoteRunSafely.sh
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/bin/sh
-#
-# Program: RemoteRunSafely.sh
-#
-# Synopsis: This script simply runs another program remotely using ssh.
-# It always returns the another program exit code or exit with
-# code 255 which indicates that the program could not be executed.
-#
-# Syntax:
-#
-# RemoteRunSafely.sh <hostname> [-l <login_name>] [-p <port>]
-# <program> <args...>
-#
-# where:
-# <hostname> is the remote host to execute the program,
-# <login_name> is the username on the remote host,
-# <port> is the port used by the remote client,
-# <program> is the path to the program to run,
-# <args...> are the arguments to pass to the program.
-#
-
-printUsageAndExit()
-{
- echo "Usage:"
- echo "./RemoteRunSafely.sh <hostname> [-l <login_name>] [-p <port>] " \
- "<program> <args...>"
- exit 255
-}
-
-moreArgsExpected()
-{
- # $1 - remaining number of arguments
- # $2 - number of arguments to shift
- if [ $1 -lt $2 ]
- then
- echo "Error: Wrong number of argumants."
- printUsageAndExit
- fi
-}
-
-# Save a copy of the original arguments in a string before we
-# clobber them with the shift command.
-ORIG_ARGS="$*"
-#DEBUG: echo 'GOT: '$ORIG_ARGS
-
-moreArgsExpected $# 1
-RHOST=$1
-shift 1
-
-RUSER=`id -un`
-RCLIENT=ssh
-RPORT=
-WORKING_DIR=
-
-moreArgsExpected $# 1
-if [ $1 = "-l" ]; then
- moreArgsExpected $# 2
- RUSER=$2
- shift 2
-fi
-moreArgsExpected $# 1
-if [ $1 = "-p" ]; then
- moreArgsExpected $# 2
- RPORT="-p $2"
- shift 2
-fi
-
-moreArgsExpected $# 1
-PROGRAM=$(basename $1)
-WORKING_DIR=$(dirname $1)
-shift 1
-
-#DEBUG: echo 'DIR='${0%%`basename $0`}
-#DEBUG: echo 'RHOST='$RHOST
-#DEBUG: echo 'RUSER='$RUSER
-#DEBUG: echo 'PROGRAM='$PROGRAM
-#DEBUG: echo 'WORKING_DIR='$WORKING_DIR
-#DEBUG: echo 'ARGS='$*
-
-# Sanity check
-if [ "$RHOST" = "" -o "$PROGRAM" = "" ]; then
- printUsageAndExit
-fi
-
-# Local program file must exist and be execuatble
-local_program=$WORKING_DIR"/"$PROGRAM
-if [ ! -x "$local_program" ]; then
- echo "File "$local_program" does not exist or is not an executable.."
- exit 255
-fi
-
-connection=$RUSER'@'$RHOST
-remote="./"$PROGRAM
-(
- cat $local_program | \
- $RCLIENT $connection $RPORT \
- 'rm -f '$remote' ; ' \
- 'cat > '$remote' ; chmod +x '$remote' ; '$remote' '$*' ; ' \
- 'err=$? ; rm -f '$remote' ; exit $err'
-)
-err=$?
-
-#DEBUG: echo script exit $err
-exit $err
-
diff --git a/contrib/llvm/utils/buildit/GNUmakefile b/contrib/llvm/utils/buildit/GNUmakefile
deleted file mode 100644
index 54577e2..0000000
--- a/contrib/llvm/utils/buildit/GNUmakefile
+++ /dev/null
@@ -1,131 +0,0 @@
-# LLVM LOCAL file build machinery
-# LLVM Compiler Makefile for use by buildit.
-#
-# This makefile is intended only for use with B&I buildit. For "normal" builds
-# use the conventional top-level makefile.
-#
-# You can specify TARGETS=ppc (or i386) on the buildit command line to limit the
-# build to just one target. The default is for ppc and i386. The compiler
-# targetted at this host gets built anyway, but not installed unless it's listed
-# in TARGETS.
-
-# Include the set of standard Apple makefile definitions.
-ifndef CoreOSMakefiles
-CoreOSMakefiles = $(MAKEFILEPATH)/CoreOS
-endif
-include $(CoreOSMakefiles)/Standard/Standard.make
-
-# Enable Apple extensions to (gnu)make.
-USE_APPLE_PB_SUPPORT = all
-
-RC_ARCHS := ppc i386
-HOSTS = $(RC_ARCHS)
-targets = echo $(RC_ARCHS)
-TARGETS := $(shell $(targets))
-
-SRCROOT = .
-
-SRC = $(shell cd $(SRCROOT) && pwd | sed s,/private,,)
-OBJROOT = $(SRC)/obj
-SYMROOT = $(OBJROOT)/../sym
-DSTROOT = $(OBJROOT)/../dst
-
-#######################################################################
-
-PREFIX = /Developer/usr/local
-
-# Unless assertions are forced on in the GMAKE command line, disable them.
-ifndef ENABLE_ASSERTIONS
-ENABLE_ASSERTIONS := no
-endif
-
-# Default is optimized build.
-ifeq ($(LLVM_DEBUG),1)
-LLVM_OPTIMIZED := no
-else
-LLVM_OPTIMIZED := yes
-endif
-
-# Default to not install libLTO.dylib.
-INSTALL_LIBLTO := no
-
-# Default to do a native build, not a cross-build for an ARM host or simulator.
-ARM_HOSTED_BUILD := no
-IOS_SIM_BUILD := no
-
-ifndef RC_ProjectSourceVersion
-RC_ProjectSourceVersion = 9999
-endif
-
-ifndef RC_ProjectSourceSubversion
-RC_ProjectSourceSubversion = 0
-endif
-
-# NOTE : Always put version numbers at the end because they are optional.
-install: $(OBJROOT) $(SYMROOT) $(DSTROOT)
- cd $(OBJROOT) && \
- $(SRC)/utils/buildit/build_llvm "$(RC_ARCHS)" "$(TARGETS)" \
- $(SRC) $(PREFIX) $(DSTROOT) $(SYMROOT) \
- $(ENABLE_ASSERTIONS) $(LLVM_OPTIMIZED) $(INSTALL_LIBLTO) \
- $(ARM_HOSTED_BUILD) $(IOS_SIM_BUILD) \
- $(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion)
-
-EmbeddedHosted:
- $(MAKE) ARM_HOSTED_BUILD=yes PREFIX=/usr/local install
-
-# When building for the iOS simulator, MACOSX_DEPLOYMENT_TARGET is not set
-# by default, but it needs to be set when building tools that run on the host
-# (e.g., tblgen), so set it here.
-EmbeddedSim:
- export MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion`; \
- $(MAKE) IOS_SIM_BUILD=yes PREFIX=$(SDKROOT)/usr/local install
-
-# installhdrs does nothing, because the headers aren't useful until
-# the compiler is installed.
-installhdrs:
-
-# We build and install in one shell script.
-build:
-
-installsrc:
- @echo
- @echo ++++++++++++++++++++++
- @echo + Installing sources +
- @echo ++++++++++++++++++++++
- @echo
- if [ $(SRCROOT) != . ]; then \
- $(PAX) -rw . $(SRCROOT); \
- fi
- find -d "$(SRCROOT)" \( -type d -a -name .svn -o \
- -type f -a -name .DS_Store -o \
- -name \*~ -o -name .\#\* \) \
- -exec rm -rf {} \;
- rm -rf "$(SRCROOT)/test"
-
-#######################################################################
-
-clean:
- @echo
- @echo ++++++++++++
- @echo + Cleaning +
- @echo ++++++++++++
- @echo
- @if [ -d $(OBJROOT) -a "$(OBJROOT)" != / ]; then \
- echo '*** DELETING ' $(OBJROOT); \
- rm -rf $(OBJROOT); \
- fi
- @if [ -d $(SYMROOT) -a "$(SYMROOT)" != / ]; then \
- echo '*** DELETING ' $(SYMROOT); \
- rm -rf $(SYMROOT); \
- fi
- @if [ -d $(DSTROOT) -a "$(DSTROOT)" != / ]; then \
- echo '*** DELETING ' $(DSTROOT); \
- rm -rf $(DSTROOT); \
- fi
-
-#######################################################################
-
-$(OBJROOT) $(SYMROOT) $(DSTROOT):
- mkdir -p $@
-
-.PHONY: install installsrc clean EmbeddedHosted EmbeddedSim
diff --git a/contrib/llvm/utils/buildit/build_llvm b/contrib/llvm/utils/buildit/build_llvm
deleted file mode 100755
index 39ec1cc..0000000
--- a/contrib/llvm/utils/buildit/build_llvm
+++ /dev/null
@@ -1,373 +0,0 @@
-#!/bin/sh
-# LLVM LOCAL file B&I
-
-set -x
-
-# Build LLVM the "Apple way".
-# Parameters:
-
-# The first parameter is a space-separated list of the architectures the
-# compilers will run on. For instance, "ppc i386". If the current machine
-# isn't in the list, it will (effectively) be added.
-HOSTS="$1"
-
-# The second parameter is a space-separated list of the architectures the
-# compilers will generate code for. If the current machine isn't in the list, a
-# compiler for it will get built anyway, but won't be installed.
-# FIXME: The list of targets is currently hard-coded and TARGETS is not used.
-TARGETS="$2"
-
-# The third parameter is the path to the compiler sources. There should be a
-# shell script named 'configure' in this directory. This script makes a copy...
-ORIG_SRC_DIR="$3"
-
-# The fourth parameter is the location where the LLVM will be installed. You can
-# move it once it's built, so this mostly controls the layout of $DEST_DIR.
-DEST_ROOT="$4"
-
-# The fifth parameter is the place where the compiler will be copied once it's
-# built.
-DEST_DIR="$5"
-
-# The sixth parameter is a directory in which to place information (like
-# unstripped executables and generated source files) helpful in debugging the
-# resulting compiler.
-SYM_DIR="$6"
-
-# The seventh parameter is a yes/no that indicates whether assertions should be
-# enabled in the LLVM libs/tools.
-LLVM_ASSERTIONS="$7"
-
-# The eighth parameter is a yes/no that indicates whether this is an optimized
-# build.
-LLVM_OPTIMIZED="$8"
-
-# The ninth parameter is a yes/no that indicates whether libLTO.dylib
-# should be installed.
-INSTALL_LIBLTO="$9"
-
-# A yes/no parameter that controls whether to cross-build for an ARM host.
-ARM_HOSTED_BUILD="${10}"
-
-# A yes/no parameter that controls whether to cross-build for the iOS simulator
-IOS_SIM_BUILD="${11}"
-
-# The version number of the submission, e.g. 1007.
-LLVM_SUBMIT_VERSION="${12}"
-
-# The subversion number of the submission, e.g. 03.
-LLVM_SUBMIT_SUBVERSION="${13}"
-
-# The current working directory is where the build will happen. It may already
-# contain a partial result of an interrupted build, in which case this script
-# will continue where it left off.
-DIR=`pwd`
-
-DARWIN_VERS=`uname -r | sed 's/\..*//'`
-echo DARWIN_VERS = $DARWIN_VERS
-
-################################################################################
-# Run the build.
-
-# Create the source tree we'll actually use to build, deleting
-# tcl since it doesn't actually build properly in a cross environment
-# and we don't really need it.
-SRC_DIR=$DIR/src
-rm -rf $SRC_DIR || exit 1
-mkdir $SRC_DIR || exit 1
-ln -s $ORIG_SRC_DIR/* $SRC_DIR/ || exit 1
-# We can't use the top-level Makefile as-is. Remove the soft link:
-rm $SRC_DIR/Makefile || exit 1
-# Now create our own by editing the top-level Makefile, deleting every line marked "Apple-style":
-sed -e '/[Aa]pple-style/d' -e '/include.*GNUmakefile/d' $ORIG_SRC_DIR/Makefile > $SRC_DIR/Makefile || exit 1
-
-# Build the LLVM tree universal.
-mkdir -p $DIR/obj-llvm || exit 1
-cd $DIR/obj-llvm || exit 1
-
-if [ "$ARM_HOSTED_BUILD" = yes ]; then
- # The cross-tools' build process expects to find an existing cross toolchain
- # under names like 'arm-apple-darwin$DARWIN_VERS-as'; so make them.
- rm -rf $DIR/bin || exit 1
- mkdir $DIR/bin || exit 1
- for prog in ar nm ranlib strip lipo ld as ; do
- P=$DIR/bin/arm-apple-darwin$DARWIN_VERS-${prog}
- T=`xcrun -sdk $SDKROOT -find ${prog}`
- echo '#!/bin/sh' > $P || exit 1
- echo 'exec '$T' "$@"' >> $P || exit 1
- chmod a+x $P || exit 1
- done
- # Try to use the platform llvm-gcc. Fall back to gcc if it's not available.
- for prog in gcc g++ ; do
- P=$DIR/bin/arm-apple-darwin$DARWIN_VERS-${prog}
- T=`xcrun -sdk $SDKROOT -find llvm-${prog}`
- if [ "x$T" = "x" ] ; then
- T=`xcrun -sdk $SDKROOT -find ${prog}`
- fi
- echo '#!/bin/sh' > $P || exit 1
- echo 'exec '$T' -arch armv6 -isysroot '${SDKROOT}' "$@"' >> $P || exit 1
- chmod a+x $P || exit 1
- done
-
- PATH=$DIR/bin:$PATH
-# otherwise, try to use llvm-gcc if it's available
-elif [ $DARWIN_VERS -gt 9 ]; then
- # If the user has set CC or CXX, respect their wishes. If not,
- # compile with LLVM-GCC/LLVM-G++ if available; if LLVM is not
- # available, fall back to usual GCC/G++ default.
- savedPATH=$PATH ; PATH="/Developer/usr/bin:$PATH"
- XTMPCC=$(which llvm-gcc)
- if [ x$CC = x -a x$XTMPCC != x ] ; then export CC=$XTMPCC ; fi
- XTMPCC=$(which llvm-g++)
- if [ x$CXX = x -a x$XTMPCC != x ] ; then export CXX=$XTMPCC ; fi
- PATH=$savedPATH
- unset XTMPCC savedPATH
-fi
-
-if [ "$ARM_HOSTED_BUILD" = yes ]; then
- configure_opts="--enable-targets=arm --host=arm-apple-darwin10 \
- --target=arm-apple-darwin10 --build=i686-apple-darwin10"
-elif [ "$IOS_SIM_BUILD" = yes ]; then
- # Use a non-standard "darwin_sim" host triple to trigger a cross-build.
- configure_opts="--enable-targets=x86 --host=i686-apple-darwin_sim \
- --build=i686-apple-darwin10"
-else
- configure_opts="--enable-targets=arm,x86,powerpc,cbe"
-fi
-
-if [ \! -f Makefile.config ]; then
- $SRC_DIR/configure --prefix=$DEST_DIR$DEST_ROOT $configure_opts \
- --enable-assertions=$LLVM_ASSERTIONS \
- --enable-optimized=$LLVM_OPTIMIZED \
- --disable-bindings \
- || exit 1
-fi
-
-SUBVERSION=`echo $RC_ProjectSourceVersion | sed -e 's/[^.]*\.\([0-9]*\).*/\1/'`
-
-if [ "x$SUBVERSION" != "x$RC_ProjectSourceVersion" ]; then
- LLVM_SUBMIT_SUBVERSION=`printf "%02d" $SUBVERSION`
- RC_ProjectSourceVersion=`echo $RC_ProjectSourceVersion | sed -e 's/\..*//'`
- LLVM_SUBMIT_VERSION=$RC_ProjectSourceVersion
-fi
-
-if [ "x$LLVM_SUBMIT_SUBVERSION" = "x00" -o "x$LLVM_SUBMIT_SUBVERSION" = "x0" ]; then
- LLVM_VERSION="$LLVM_SUBMIT_VERSION"
-else
- LLVM_VERSION="$LLVM_SUBMIT_VERSION-$LLVM_SUBMIT_SUBVERSION"
-fi
-
-GCC_VER=`cc --version 2>/dev/null | sed 1q`
-
-if echo "$GCC_VER" | grep GCC > /dev/null; then
- GCC_VER=`echo $GCC_VER | sed -e 's/.*(GCC) \([0-9.][0-9.]*\).*/\1/'`
- MAJ_VER=`echo $GCC_VER | sed 's/\..*//'`
- MIN_VER=`echo $GCC_VER | sed 's/[^.]*\.\([0-9]*\).*/\1/'`
-fi
-
-JOBS_FLAG=""
-
-# Note: If compiling with GCC 4.0, don't pass the -jN flag. Building universal
-# already has parallelism and we don't want to make the builders hit swap by
-# firing off too many gccs at the same time.
-if [ "x$MAJ_VER" != "x4" -o "x$MIN_VER" != "x0" ]; then
- # Figure out how many make processes to run.
- SYSCTL=`sysctl -n hw.activecpu`
-
- # hw.activecpu only available in 10.2.6 and later
- if [ -z "$SYSCTL" ]; then
- SYSCTL=`sysctl -n hw.ncpu`
- fi
-
- # sysctl -n hw.* does not work when invoked via B&I chroot /BuildRoot.
- # Builders can default to 2, since even if they are single processor,
- # nothing else is running on the machine.
- if [ -z "$SYSCTL" ]; then
- SYSCTL=2
- fi
-
- JOBS_FLAG="-j $SYSCTL"
-fi
-
-make $JOBS_FLAG $OPTIMIZE_OPTS UNIVERSAL=1 UNIVERSAL_ARCH="$HOSTS" \
- UNIVERSAL_SDK_PATH=$SDKROOT \
- NO_RUNTIME_LIBS=1 \
- DISABLE_EDIS=1 \
- DEBUG_SYMBOLS=1 \
- LLVM_SUBMIT_VERSION=$LLVM_SUBMIT_VERSION \
- LLVM_SUBMIT_SUBVERSION=$LLVM_SUBMIT_SUBVERSION \
- CXXFLAGS="-DLLVM_VERSION_INFO='\" Apple Build #$LLVM_VERSION\"'" \
- VERBOSE=1
-
-if [ $? != 0 ] ; then
- echo "error: LLVM 'make' failed!"
- exit 1
-fi
-
-################################################################################
-# Construct the actual destination root, by copying stuff from $DIR/dst-* to
-# $DEST_DIR, with occasional 'lipo' commands.
-
-cd $DEST_DIR || exit 1
-
-# Clean out DEST_DIR in case -noclean was passed to buildit.
-rm -rf * || exit 1
-
-cd $DIR/obj-llvm || exit 1
-
-# Install the tree into the destination directory.
-make $LOCAL_MAKEFLAGS $OPTIMIZE_OPTS UNIVERSAL=1 UNIVERSAL_ARCH="$HOSTS" \
- NO_RUNTIME_LIBS=1 \
- DISABLE_EDIS=1 \
- DEBUG_SYMBOLS=1 \
- LLVM_SUBMIT_VERSION=$LLVM_SUBMIT_VERSION \
- LLVM_SUBMIT_SUBVERSION=$LLVM_SUBMIT_SUBVERSION \
- OPTIMIZE_OPTION='-O3' VERBOSE=1 install
-
-if ! test $? == 0 ; then
- echo "error: LLVM 'make install' failed!"
- exit 1
-fi
-
-# Install Version.h
-LLVM_MINOR_VERSION=`echo $LLVM_SUBMIT_SUBVERSION | sed -e 's,0*\([1-9][0-9]*\),\1,'`
-if [ "x$LLVM_MINOR_VERSION" = "x" ]; then
- LLVM_MINOR_VERSION=0
-fi
-RC_ProjectSourceSubversion=`printf "%d" $LLVM_MINOR_VERSION`
-echo "#define LLVM_VERSION ${RC_ProjectSourceVersion}" > $DEST_DIR$DEST_ROOT/include/llvm/Version.h
-echo "#define LLVM_MINOR_VERSION ${RC_ProjectSourceSubversion}" >> $DEST_DIR$DEST_ROOT/include/llvm/Version.h
-
-if [ "x$LLVM_DEBUG" != "x1" ]; then
- # Strip local symbols from llvm libraries.
- #
- # Use '-l' to strip i386 modules. N.B. that flag doesn't work with kext or
- # PPC objects!
- strip -Sl $DEST_DIR$DEST_ROOT/lib/*.[oa]
- for f in `ls $DEST_DIR$DEST_ROOT/lib/*.so`; do
- strip -Sxl $f
- done
-fi
-
-# Copy over the tblgen utility.
-cp `find $DIR -name tblgen` $DEST_DIR$DEST_ROOT/bin
-
-# Remove .dir files
-cd $DEST_DIR$DEST_ROOT
-rm -f bin/.dir etc/llvm/.dir lib/.dir
-
-# Remove PPC64 fat slices.
-cd $DEST_DIR$DEST_ROOT/bin
-if [ $MACOSX_DEPLOYMENT_TARGET = "10.4" ]; then
- find . -perm 755 -type f \! \( -name '*gccas' -o -name '*gccld' -o -name llvm-config \) \
- -exec lipo -extract ppc -extract i386 {} -output {} \;
-elif [ $MACOSX_DEPLOYMENT_TARGET = "10.5" ]; then
- find . -perm 755 -type f \! \( -name '*gccas' -o -name '*gccld' -o -name llvm-config \) \
- -exec lipo -extract ppc7400 -extract i386 {} -output {} \;
-else
- find . -perm 755 -type f \! \( -name '*gccas' -o -name '*gccld' -o -name llvm-config \) \
- -exec lipo -extract ppc7400 -extract i386 -extract x86_64 {} -output {} \;
-fi
-
-# The Hello dylib is an example of how to build a pass. No need to install it.
-rm $DEST_DIR$DEST_ROOT/lib/LLVMHello.dylib
-
-# Compress manpages
-MDIR=$DEST_DIR$DEST_ROOT/share/man/man1
-gzip -f $MDIR/*
-
-################################################################################
-# Create SYM_DIR with information required for debugging.
-
-# Figure out how many make processes to run.
-SYSCTL=`sysctl -n hw.activecpu`
-
-# hw.activecpu only available in 10.2.6 and later
-if [ -z "$SYSCTL" ]; then
- SYSCTL=`sysctl -n hw.ncpu`
-fi
-
-# sysctl -n hw.* does not work when invoked via B&I chroot /BuildRoot. Builders
-# can default to 2, since even if they are single processor, nothing else is
-# running on the machine.
-if [ -z "$SYSCTL" ]; then
- SYSCTL=2
-fi
-
-cd $SYM_DIR || exit 1
-
-# Clean out SYM_DIR in case -noclean was passed to buildit.
-rm -rf * || exit 1
-
-# Generate .dSYM files
-find $DEST_DIR -perm -0111 -type f \
- ! \( -name '*.la' -o -name gccas -o -name gccld -o -name llvm-config -o -name '*.a' \) \
- -print | xargs -n 1 -P ${SYSCTL} dsymutil
-
-# Save .dSYM files and .a archives
-cd $DEST_DIR || exit 1
-find . \( -path \*.dSYM/\* -or -name \*.a \) -print \
- | cpio -pdml $SYM_DIR || exit 1
-
-# Save source files.
-mkdir $SYM_DIR/src || exit 1
-cd $DIR || exit 1
-find obj-* -name \*.\[chy\] -o -name \*.cpp -print \
- | cpio -pdml $SYM_DIR/src || exit 1
-
-################################################################################
-# Install and strip libLTO.dylib
-
-cd $DEST_DIR$DEST_ROOT
-if [ "$INSTALL_LIBLTO" = "yes" ]; then
- DT_HOME="$DEST_DIR/Developer/usr"
- mkdir -p $DT_HOME/lib
- mv lib/libLTO.dylib $DT_HOME/lib/libLTO.dylib
-
- # Save a copy of the unstripped dylib
- mkdir -p $SYM_DIR/Developer/usr/lib
- cp $DT_HOME/lib/libLTO.dylib $SYM_DIR/Developer/usr/lib/libLTO.dylib
-
- # Use '-l' to strip i386 modules. N.B. that flag doesn't work with kext or
- # PPC objects!
- strip -arch all -Sl $DT_HOME/lib/libLTO.dylib
-
- if [ "x$DISABLE_USR_LINKS" == "x" ]; then
- # Add a symlink in /usr/lib for B&I.
- mkdir -p $DEST_DIR/usr/lib/
- (cd $DEST_DIR/usr/lib && \
- ln -s ../../Developer/usr/lib/libLTO.dylib ./libLTO.dylib)
- fi
-else
- rm -f lib/libLTO.dylib
-fi
-rm -f lib/libLTO.a lib/libLTO.la
-
-################################################################################
-# Remove debugging information from DEST_DIR.
-
-cd $DIR || exit 1
-
-find $DEST_DIR -name \*.a -print | xargs ranlib || exit 1
-find $DEST_DIR -name \*.dSYM -print | xargs rm -r || exit 1
-
-# Strip debugging information from files
-#
-# Use '-l' to strip i386 modules. N.B. that flag doesn't work with kext or
-# PPC objects!
-find $DEST_DIR -perm -0111 -type f \
- ! \( -name '*.la' -o -name gccas -o -name gccld -o -name llvm-config \) \
- -print | xargs -n 1 -P ${SYSCTL} strip -arch all -Sl
-
-chgrp -h -R wheel $DEST_DIR
-chgrp -R wheel $DEST_DIR
-
-################################################################################
-# Remove the docs directory
-
-rm -rf $DEST_DIR$DEST_ROOT/docs
-
-################################################################################
-# w00t! Done!
-
-exit 0
diff --git a/contrib/llvm/utils/cgiplotNLT.pl b/contrib/llvm/utils/cgiplotNLT.pl
deleted file mode 100755
index 0360e41..0000000
--- a/contrib/llvm/utils/cgiplotNLT.pl
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/usr/bin/perl
-#takes a test and a program from a dp and produces a gnuplot script
-#use like perl plotNLT.pl password Programs/MultiSource/Benchmarks/ASCI_Purple/SMG2000/smg2000 llc
-
-use CGI;
-use DBI;
-my $q = new CGI;
-
-# database information
-$db="llvmalpha";
-$host="localhost";
-$userid="llvmdbuser";
-$passwd=$q->param('pwd');
-$connectionInfo="dbi:mysql:$db;$host";
-
-# make connection to database
-$dbh = DBI->connect($connectionInfo,$userid,$passwd) or die DBI->errstr;
-
-
-$count = 0;
-while ($q->param('n' . $count))
- {
- $count++;
- }
-
-$| = 1;
-print "Content-type: image/png", "\n\n";
-
-open CMDSTREAM, "|gnuplot";
-#open CMDSTREAM, "|echo";
-
-print CMDSTREAM "set terminal png\n";
-print CMDSTREAM "set output\n";
-print CMDSTREAM "set xdata time\n";
-print CMDSTREAM 'set timefmt "%Y-%m-%d"';
-print CMDSTREAM "\nplot";
-for ($iter = 0; $iter < $count; $iter++) {
- if ($iter)
- { print CMDSTREAM ","; }
- print CMDSTREAM " '-' using 1:2 title \"" . $q->param('t' . $iter) . "," . $q->param('n' . $iter) . "\"with lines";
-}
-
-print CMDSTREAM "\n";
-
-for ($iter = 0; $iter < $count; $iter++) {
-
- $prog = $q->param('n' . $iter);
- $test = $q->param('t' . $iter);
-
- $query = "Select RUN, VALUE from Tests where TEST = '$test' AND NAME = '$prog' ORDER BY RUN";
- #print "\n$query\n";
-
- my $sth = $dbh->prepare( $query) || die "Can't prepare statement: $DBI::errstr";;
-
- my $rc = $sth->execute or die DBI->errstr;
-
- while(($da,$v) = $sth->fetchrow_array)
- {
- print CMDSTREAM "$da $v\n";
- }
-
- print CMDSTREAM "e\n";
-}
-print CMDSTREAM "exit\n";
-close CMDSTREAM;
-
-# disconnect from database
-$dbh->disconnect;
diff --git a/contrib/llvm/utils/check-each-file b/contrib/llvm/utils/check-each-file
deleted file mode 100755
index bd76333..0000000
--- a/contrib/llvm/utils/check-each-file
+++ /dev/null
@@ -1,150 +0,0 @@
-#!/bin/sh
-# check-each-file
-# Used to narrow down a miscompilation to one .o file from a list. Please read
-# the usage procedure, below, for command-line syntax (or run it with --help).
-# This script depends on the llvm-native-gcc script.
-
-if [ x$1 = x--make-linker-script ]
-then
- program=$2
- linker=./link-$program
- echo "Building $program with llvm-native-gcc"
- rm -f $program
- gmake -e $program CC=llvm-native-gcc CXX=llvm-native-gxx
- echo "Erasing $program and re-linking it"
- rm -f $program
- echo "rm -f $program" > $linker
- gmake -n $program >> $linker
- chmod 755 $linker
- echo "Linker script created in $linker; testing it out"
- output=`./$linker 2>&1`
- case "$output" in
- *undefined*reference*__main*)
- echo "$program appears to need a dummy __main function; adding one"
- echo "void __main () { }" > __main.c
- gcc -c __main.c
- echo "Done; rebuilding $linker"
- echo "rm -f $program" > $linker
- gmake -n $program 2>&1 | sed '/gcc/s/$/__main.o/' >> $linker
- ./$linker > /dev/null 2>&1
- if [ ! -x $program ]
- then
- echo "WARNING: linker script didn't work"
- fi
- ;;
- *)
- if [ ! -x $program ]
- then
- echo "WARNING: linker script didn't work"
- fi
- ;;
- esac
- echo "Linker script created in $linker; please check it manually"
- exit 0
-fi
-
-checkfiles="$1"
-program="$2"
-linker="$3"
-checker="$4"
-
-usage () {
- myname=`basename $0`
- echo "$myname --make-linker-script PROGRAM"
- echo "$myname OBJECTS-FILE PROGRAM LINKER CHECKER"
- echo ""
- echo "OBJECTS-FILE is a text file containing the names of all the .o files"
- echo "PROGRAM is the name of the executable under test"
- echo "(there must also exist a Makefile in the current directory which"
- echo "has PROGRAM as a target)"
- echo "LINKER is the script that builds PROGRAM; try --make-linker-script"
- echo "to automatically generate it"
- echo "CHECKER is the script that exits 0 if PROGRAM is ok, 1 if it is not OK"
- echo "(LINKER and CHECKER must be in your PATH, or you should specify ./)"
- echo ""
- echo "Bugs to <gaeke@uiuc.edu>."
- exit 1
-}
-
-if [ x$1 = x--help ]
-then
- usage
-fi
-
-if [ -z "$checkfiles" ]
-then
- echo "ERROR: Must specify name of file w/ list of objects as 1st arg."
- echo "(got \"$checkfiles\")"
- usage
-fi
-if [ ! -f "$checkfiles" ]
-then
- echo "ERROR: $checkfiles not found"
- usage
-fi
-if [ -z "$program" ]
-then
- echo "ERROR: Must specify name of program as 2nd arg."
- usage
-fi
-if [ -z "$linker" ]
-then
- echo "ERROR: Must specify name of link script as 3rd arg."
- usage
-fi
-if [ ! -x "$linker" ]
-then
- echo "ERROR: $linker not found or not executable"
- echo "You may wish to try: $0 --make-linker-script $program"
- usage
-fi
-if [ -z "$checker" ]
-then
- echo "ERROR: Must specify name of $program check script as 3rd arg."
- usage
-fi
-if [ ! -x "$checker" ]
-then
- echo "ERROR: $checker not found or not executable"
- usage
-fi
-
-files=`cat $checkfiles`
-echo "Recompiling everything with llvm-native-gcc"
-for f in $files
-do
- rm -f $f
- gmake $f CC=llvm-native-gcc CXX=llvm-native-gxx
-done
-rm -f $program
-$linker
-if $checker
-then
- echo "Sorry, I can't help you, $program is OK when compiled with llvm-native-gcc"
- exit 1
-fi
-for f in $files
-do
- echo Trying to compile $f with native gcc and rebuild $program
- mv ${f} ${f}__OLD__
- gmake ${f} CC=gcc > /dev/null 2>&1
- $linker
- echo Checking validity of new $program
- if $checker
- then
- echo Program is OK
- okfiles="$okfiles $f"
- else
- echo Program is not OK
- notokfiles="$notokfiles $f"
- fi
- mv ${f}__OLD__ ${f}
-done
-echo ""
-echo "Program is OK when these files are recompiled with native gcc: "
-echo "$okfiles"
-echo ""
-echo "Program is not OK when these files are recompiled with native gcc: "
-echo "$notokfiles"
-echo ""
-exit 0
diff --git a/contrib/llvm/utils/codegen-diff b/contrib/llvm/utils/codegen-diff
deleted file mode 100755
index 2c3ac4c..0000000
--- a/contrib/llvm/utils/codegen-diff
+++ /dev/null
@@ -1,135 +0,0 @@
-#!/usr/bin/perl
-
-use Getopt::Std;
-$DEBUG = 0;
-
-sub parse_objdump_file {
- my ($filename) = @_;
- my @result;
- open (INPUT, $filename) or die "$filename: $!\n";
- print "opened objdump output file $filename\n" if $DEBUG;
- while (<INPUT>) {
- if (/\s*([0-9a-f]*):\t(([0-9a-f]{2} )+) *\t(.*)$/) {
- my ($addr, $bytes, $instr) = ($1, $2, $4);
- $addr = "0x" . $addr;
- $bytes =~ s/\s*(.*\S)\s*/$1/; # trim any remaining whitespace
- $instr =~ s/\s*(.*\S)\s*/$1/;
- push (@result, {'addr' => $addr, 'bytes' => $bytes, 'instr' => $instr});
- print "addr=$addr bytes='$bytes' instr='$instr'\n" if $DEBUG;
- }
- }
- close INPUT;
- return @result;
-}
-
-sub parse_gdb_file {
- my ($filename) = @_;
- my @result;
- my $got_addr;
- open (INPUT, $filename) or die "$filename: $!\n";
- print "opened gdb output file $filename\n" if $DEBUG;
- while (<INPUT>) {
- if (/^(0x[0-9a-f]*):\t([^\t]*)\t[^:]*:\t((0x[0-9a-f]{2}\s*)+)\s*$/) {
- my ($addr, $bytes, $instr) = ($1, $3, $2);
- $bytes =~ s/0x//g;
- $bytes =~ s/\s+/ /g; # regularize whitespace
- $bytes =~ s/\s*(.*\S)\s*/$1/; # trim any remaining whitespace
- $instr =~ s/\s*(.*\S)\s*/$1/;
- push (@result, {'addr' => $addr, 'bytes' => $bytes, 'instr' => $instr});
- print "addr=$addr bytes='$bytes' instr='$instr'\n" if $DEBUG;
- } elsif (/^(0x[0-9a-f]*):\t$/) { # deal with gdb's line breaker
- $got_addr = $1;
- } elsif ($got_addr && /^ ([^\t]*)\t[^:]*:\t((0x[0-9a-f]{2}\s*)+)\s*$/) {
- my ($addr, $bytes, $instr) = ($got_addr, $2, $1);
- $bytes =~ s/0x//g;
- $bytes =~ s/\s+/ /g; # regularize whitespace
- $bytes =~ s/\s*(.*\S)\s*/$1/; # trim any remaining whitespace
- $instr =~ s/\s*(.*\S)\s*/$1/;
- push (@result, {'addr' => $addr, 'bytes' => $bytes, 'instr' => $instr});
- print "addr=$addr bytes='$bytes' instr='$instr'\n" if $DEBUG;
- undef $got_addr;
- }
- }
- close INPUT;
- return @result;
-}
-
-sub binary_diffs {
- my ($objdump_file, $gdb_file) = @_;
- my @file1 = parse_objdump_file ($objdump_file);
- my @file2 = parse_gdb_file ($gdb_file);
- my $lastrecord = ($#file1 >= $#file2) ? ($#file1) : ($#file2);
- for (my $i = 0; $i <= $lastrecord; ++$i) {
- my $d1 = $file1[$i];
- my $d2 = $file2[$i];
- if ($d1->{'bytes'} ne $d2->{'bytes'}) {
- next if (($d1->{'instr'} eq $d2->{'instr'}) && $opt_d);
- printf "0x%08x:\t%30s \t%s\n", 0+$d1->{'addr'}, $d1->{'bytes'}, $d1->{'instr'};
- printf "0x%08x:\t%30s \t%s\n\n", 0+$d2->{'addr'}, $d2->{'bytes'}, $d2->{'instr'};
- }
- }
-}
-
-&getopts('d');
-$objdump_file = $ARGV[0];
-$gdb_file = $ARGV[1];
-binary_diffs ($objdump_file, $gdb_file);
-exit (0);
-__END__
-=pod
-
-=head1 NAME
-
-codegen-diff
-
-=head1 SYNOPSIS
-
-codegen-diff [-d] I<OBJDUMP-OUTPUT-FILE> I<GDB-DISASSEMBLY-FILE>
-
-=head1 DESCRIPTION
-
-B<codegen-diff> is a program that tries to show you the differences
-between the code that B<llc> generated and the code that B<lli> generated.
-
-The way you use it is as follows: first, you create I<OBJDUMP-OUTPUT-FILE>
-by running B<objdump> on the B<llc> compiled and linked binary. You need to
-trim down the result so it contains only the function of interest.
-
-Second, you create I<GDB-DISASSEMBLY-FILE> by running B<gdb>, with my patch
-to print out hex bytes in the B<disassemble> command output, on
-B<lli>. Set a breakpoint in C<Emitter::finishFunction()> and wait until
-the function you want is compiled. Then use the B<disassemble> command
-to print out the assembly dump of the function B<lli> just compiled.
-(Use C<lli -debug> to find out where the function starts and ends in memory.)
-It's easiest to save this output by using B<script>.
-
-Finally, you run B<codegen-diff>, as indicated in the Synopsis section of
-this manpage. It will print out a two-line stanza for each mismatched
-instruction, with the B<llc> version first, and the B<lli> version second.
-
-=head1 OPTIONS
-
-=over 4
-
-=item -d
-
-Don't show instructions where the bytes are different but they
-disassemble to the same thing. This puts a lot of trust in the
-disassembler, but it might help you highlight the more egregious cases
-of misassembly.
-
-=back
-
-=head1 AUTHOR
-
-B<codegen-diff> was written by Brian Gaeke.
-
-=head1 SEE ALSO
-
-L<gdb(1)>, L<objdump(1)>, L<script(1)>.
-
-You will need my B<gdb> patch:
-
- http://llvm.cs.uiuc.edu/~gaeke/gdb-disassembly-print-bytes.patch
-
-=cut
diff --git a/contrib/llvm/utils/count/CMakeLists.txt b/contrib/llvm/utils/count/CMakeLists.txt
deleted file mode 100644
index e124f61..0000000
--- a/contrib/llvm/utils/count/CMakeLists.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-add_executable(count
- count.c
- )
diff --git a/contrib/llvm/utils/count/Makefile b/contrib/llvm/utils/count/Makefile
deleted file mode 100644
index 8de076a..0000000
--- a/contrib/llvm/utils/count/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-##===- utils/count/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 = count
-USEDLIBS =
-
-# This tool has no plugins, optimize startup time.
-TOOL_NO_EXPORTS = 1
-
-# Don't install this utility
-NO_INSTALL = 1
-
-include $(LEVEL)/Makefile.common
diff --git a/contrib/llvm/utils/count/count.c b/contrib/llvm/utils/count/count.c
deleted file mode 100644
index ae96791..0000000
--- a/contrib/llvm/utils/count/count.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*===- count.c - The 'count' testing tool ---------------------------------===*\
- *
- * The LLVM Compiler Infrastructure
- *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
- *
-\*===----------------------------------------------------------------------===*/
-
-#include <stdlib.h>
-#include <stdio.h>
-
-int main(int argc, char **argv) {
- unsigned Count, NumLines, NumRead;
- char Buffer[4096], *End;
-
- if (argc != 2) {
- fprintf(stderr, "usage: %s <expected line count>\n", argv[0]);
- return 2;
- }
-
- Count = strtol(argv[1], &End, 10);
- if (*End != '\0' && End != argv[1]) {
- fprintf(stderr, "%s: invalid count argument '%s'\n", argv[0], argv[1]);
- return 2;
- }
-
- NumLines = 0;
- do {
- unsigned i;
-
- NumRead = fread(Buffer, 1, sizeof(Buffer), stdin);
-
- for (i = 0; i != NumRead; ++i)
- if (Buffer[i] == '\n')
- ++NumLines;
- } while (NumRead == sizeof(Buffer));
-
- if (!feof(stdin)) {
- fprintf(stderr, "%s: error reading stdin\n", argv[0]);
- return 3;
- }
-
- if (Count != NumLines) {
- fprintf(stderr, "Expected %d lines, got %d.\n", Count, NumLines);
- return 1;
- }
-
- return 0;
-}
diff --git a/contrib/llvm/utils/countloc.sh b/contrib/llvm/utils/countloc.sh
deleted file mode 100755
index 4d1b775..0000000
--- a/contrib/llvm/utils/countloc.sh
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/sh
-##===- utils/countloc.sh - Counts Lines Of Code --------------*- Script -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-#
-# This script finds all the source code files in the source code directories
-# (excluding certain things), runs "wc -l" on them to get the number of lines in
-# each file and then sums up and prints the total with awk.
-#
-# The script takes one optional option, -topdir, which specifies the top llvm
-# source directory. If it is not specified then the llvm-config tool is
-# consulted to find top source dir.
-#
-# Note that the implementation is based on llvmdo. See that script for more
-# details.
-##===----------------------------------------------------------------------===##
-
-if test $# -gt 1 ; then
- if test "$1" = "-topdir" ; then
- TOPDIR="$2"
- shift; shift;
- else
- TOPDIR=`llvm-config --src-root`
- fi
-fi
-
-if test -d "$TOPDIR" ; then
- cd $TOPDIR
- ./utils/llvmdo -topdir "$TOPDIR" -dirs "include lib tools test utils examples" -code-only wc -l | awk '\
- BEGIN { loc=0; } \
- { loc += $1; } \
- END { print loc; }'
-else
- echo "Can't find LLVM top directory"
-fi
diff --git a/contrib/llvm/utils/crosstool/ARM/README b/contrib/llvm/utils/crosstool/ARM/README
deleted file mode 100644
index ba58583..0000000
--- a/contrib/llvm/utils/crosstool/ARM/README
+++ /dev/null
@@ -1,37 +0,0 @@
-HOWTO create an LLVM crosstool from x86_64/Linux to ARM/Linux
-=============================================================
-
-1. % llvm/utils/crosstool/create-snapshots.sh
-
- This will create llvm-[REV_L].tar.bz2 and llvm-gcc-4.2-[REV_G].tar.bz2,
- where:
- REV_L is the revision at which "llvm" was checked out, and
- REV_G is the revision at which "llvm-gcc-4.2" was checked out
-
- Note that REV_L might REV_G might not be the same revision.
-
-2. Download CodeSourcery toolchain. The exact location depends on your
- $CROSS_TARGET but the script will tell you what the location of the file is
- if you run it without having the file available.
-
- For example, if you're using $CROSS_TARGET == "arm-none-linux-gnueabi" then
- you need to download:
-
- http://www.codesourcery.com/sgpp/lite/arm/portal/package1787/public/arm-none-linux-gnueabi/arm-2007q3-51-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
-
- NOTE: simply changing $CROSS_TARGET and modifying the URL accordingly will
- not work -- you'll need to go to http://www.codesourcery.com and find the
- correct file, as the release number in the file will also be different (e.g.,
- in the file above, the release number is "51").
-
-3. You can override most values in the script without modifying it, e.g.
- $INSTALL_ROOT (if you want to install in directory other than /usr/local).
-
- Run the script as:
-
- % env INSTALL_ROOT=[dir to install in] \
- CODE_SOURCERY_PKG_PATH=[dir where you downloaded CodeSourcery tarball] \
- LLVM_PKG_PATH=[dir where you stored your LLVM and LLVM-GCC snapshots] \
- LLVM_SVN_REV=${REV_L} \
- LLVMGCC_SVN_REV=${REV_G} \
- build-install-linux.sh
diff --git a/contrib/llvm/utils/crosstool/ARM/build-install-linux.sh b/contrib/llvm/utils/crosstool/ARM/build-install-linux.sh
deleted file mode 100755
index f3f8df9..0000000
--- a/contrib/llvm/utils/crosstool/ARM/build-install-linux.sh
+++ /dev/null
@@ -1,200 +0,0 @@
-#!/bin/bash
-#
-# Compiles and installs a Linux/x86_64 -> Linux/ARM crosstool based on LLVM and
-# LLVM-GCC-4.2 using SVN snapshots in provided tarballs.
-
-set -o nounset
-set -o errexit
-
-echo -n "Welcome to LLVM Linux/X86_64 -> Linux/ARM crosstool "
-echo "builder/installer; some steps will require sudo privileges."
-
-readonly INSTALL_ROOT="${INSTALL_ROOT:-/usr/local/crosstool}"
-# Both $USER and root *must* have read/write access to this dir.
-readonly SCRATCH_ROOT=$(mktemp -d "${TMPDIR:-/tmp}/llvm-project.XXXXXX")
-readonly SRC_ROOT="${SCRATCH_ROOT}/src"
-readonly OBJ_ROOT="${SCRATCH_ROOT}/obj"
-
-readonly CROSS_HOST="x86_64-unknown-linux-gnu"
-readonly CROSS_TARGET="arm-none-linux-gnueabi"
-readonly CROSS_MARCH="${CROSS_MARCH:-armv6}"
-
-readonly CODE_SOURCERY="${INSTALL_ROOT}/codesourcery"
-readonly CODE_SOURCERY_PKG_PATH="${CODE_SOURCERY_PKG_PATH:-${HOME}/codesourcery}"
-readonly CODE_SOURCERY_HTTP="http://www.codesourcery.com/sgpp/lite/arm/portal/package1787/public"
-readonly CODE_SOURCERY_PKG="arm-2007q3-51-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2"
-readonly CODE_SOURCERY_ROOT="${CODE_SOURCERY}/arm-2007q3"
-readonly CODE_SOURCERY_BIN="${CODE_SOURCERY_ROOT}/bin"
-# Make sure ${CROSS_TARGET}-* binutils are in command path
-export PATH="${CODE_SOURCERY_BIN}:${PATH}"
-
-readonly CROSS_TARGET_AS="${CODE_SOURCERY_BIN}/${CROSS_TARGET}-as"
-readonly CROSS_TARGET_LD="${CODE_SOURCERY_BIN}/${CROSS_TARGET}-ld"
-
-readonly SYSROOT="${CODE_SOURCERY_ROOT}/${CROSS_TARGET}/libc"
-
-readonly LLVM_PKG_PATH="${LLVM_PKG_PATH:-${HOME}/llvm-project/snapshots}"
-
-# Latest SVN revisions known to be working in this configuration.
-readonly LLVM_DEFAULT_REV="74530"
-readonly LLVMGCC_DEFAULT_REV="74535"
-
-readonly LLVM_PKG="llvm-${LLVM_SVN_REV:-${LLVM_DEFAULT_REV}}.tar.bz2"
-readonly LLVM_SRC_DIR="${SRC_ROOT}/llvm"
-readonly LLVM_OBJ_DIR="${OBJ_ROOT}/llvm"
-readonly LLVM_INSTALL_DIR="${INSTALL_ROOT}/${CROSS_TARGET}/llvm"
-
-readonly LLVMGCC_PKG="llvm-gcc-4.2-${LLVMGCC_SVN_REV:-${LLVMGCC_DEFAULT_REV}}.tar.bz2"
-readonly LLVMGCC_SRC_DIR="${SRC_ROOT}/llvm-gcc-4.2"
-readonly LLVMGCC_OBJ_DIR="${OBJ_ROOT}/llvm-gcc-4.2"
-readonly LLVMGCC_INSTALL_DIR="${INSTALL_ROOT}/${CROSS_TARGET}/llvm-gcc-4.2"
-
-readonly MAKE_OPTS="${MAKE_OPTS:--j2}"
-
-# Params:
-# $1: directory to be created
-# $2: optional mkdir command prefix, e.g. "sudo"
-createDir() {
- if [[ ! -e $1 ]]; then
- ${2:-} mkdir -p $1
- elif [[ -e $1 && ! -d $1 ]]; then
- echo "$1 exists but is not a directory; exiting."
- exit 3
- fi
-}
-
-sudoCreateDir() {
- createDir $1 sudo
- sudo chown ${USER} $1
-}
-
-# Prints out and runs the command, but without logging -- intended for use with
-# lightweight commands that don't have useful output to parse, e.g. mkdir, tar,
-# etc.
-runCommand() {
- local message="$1"
- shift
- echo "=> $message"
- echo "==> Running: $*"
- $*
-}
-
-runAndLog() {
- local message="$1"
- local log_file="$2"
- shift 2
- echo "=> $message; log in $log_file"
- echo "==> Running: $*"
- # Pop-up a terminal with the output of the current command?
- # e.g.: xterm -e /bin/bash -c "$* >| tee $log_file"
- $* &> $log_file
- if [[ $? != 0 ]]; then
- echo "Error occurred: see most recent log file for details."
- exit
- fi
-}
-
-installCodeSourcery() {
- # Unpack the tarball, creating the CodeSourcery dir, if necessary.
- if [[ ! -d ${CODE_SOURCERY_ROOT} ]]; then
- sudoCreateDir ${CODE_SOURCERY}
- cd ${CODE_SOURCERY}
- if [[ -e ${CODE_SOURCERY_PKG_PATH}/${CODE_SOURCERY_PKG} ]]; then
- runCommand "Unpacking CodeSourcery in ${CODE_SOURCERY}" \
- tar jxf ${CODE_SOURCERY_PKG_PATH}/${CODE_SOURCERY_PKG}
- else
- echo -n "CodeSourcery tarball not found in "
- echo "${CODE_SOURCERY_PKG_PATH}/${CODE_SOURCERY_PKG}"
- echo -n "Fix the path or download it from "
- echo "${CODE_SOURCERY_HTTP}/${CROSS_TARGET}/${CODE_SOURCERY_PKG}"
- exit
- fi
- else
- echo "CodeSourcery install dir already exists; skipping."
- fi
-
- # Verify our CodeSourcery toolchain installation.
- if [[ ! -d "${SYSROOT}" ]]; then
- echo -n "Error: CodeSourcery does not contain libc for ${CROSS_TARGET}: "
- echo "${SYSROOT} not found."
- exit
- fi
-
- for tool in ${CROSS_TARGET_AS} ${CROSS_TARGET_LD}; do
- if [[ ! -e $tool ]]; then
- echo "${tool} not found; exiting."
- exit
- fi
- done
-}
-
-installLLVM() {
- if [[ -d ${LLVM_INSTALL_DIR} ]]; then
- echo "LLVM install dir ${LLVM_INSTALL_DIR} exists; skipping."
- return
- fi
-
- sudoCreateDir ${LLVM_INSTALL_DIR}
-
- # Unpack LLVM tarball; should create the directory "llvm".
- cd ${SRC_ROOT}
- runCommand "Unpacking LLVM" tar jxf ${LLVM_PKG_PATH}/${LLVM_PKG}
-
- # Configure, build, and install LLVM.
- createDir ${LLVM_OBJ_DIR}
- cd ${LLVM_OBJ_DIR}
- runAndLog "Configuring LLVM" ${LLVM_OBJ_DIR}/llvm-configure.log \
- ${LLVM_SRC_DIR}/configure \
- --disable-jit \
- --enable-optimized \
- --prefix=${LLVM_INSTALL_DIR} \
- --target=${CROSS_TARGET} \
- --with-llvmgccdir=${LLVMGCC_INSTALL_DIR}
- runAndLog "Building LLVM" ${LLVM_OBJ_DIR}/llvm-build.log \
- make ${MAKE_OPTS}
- runAndLog "Installing LLVM" ${LLVM_OBJ_DIR}/llvm-install.log \
- make ${MAKE_OPTS} install
-}
-
-installLLVMGCC() {
- if [[ -d ${LLVMGCC_INSTALL_DIR} ]]; then
- echo "LLVM-GCC install dir ${LLVMGCC_INSTALL_DIR} exists; skipping."
- return
- fi
-
- sudoCreateDir ${LLVMGCC_INSTALL_DIR}
-
- # Unpack LLVM-GCC tarball; should create the directory "llvm-gcc-4.2".
- cd ${SRC_ROOT}
- runCommand "Unpacking LLVM-GCC" tar jxf ${LLVM_PKG_PATH}/${LLVMGCC_PKG}
-
- # Configure, build, and install LLVM-GCC.
- createDir ${LLVMGCC_OBJ_DIR}
- cd ${LLVMGCC_OBJ_DIR}
- runAndLog "Configuring LLVM-GCC" ${LLVMGCC_OBJ_DIR}/llvmgcc-configure.log \
- ${LLVMGCC_SRC_DIR}/configure \
- --enable-languages=c,c++ \
- --enable-llvm=${LLVM_INSTALL_DIR} \
- --prefix=${LLVMGCC_INSTALL_DIR} \
- --program-prefix=llvm- \
- --target=${CROSS_TARGET} \
- --with-arch=${CROSS_MARCH} \
- --with-as=${CROSS_TARGET_AS} \
- --with-ld=${CROSS_TARGET_LD} \
- --with-sysroot=${SYSROOT}
- runAndLog "Building LLVM-GCC" ${LLVMGCC_OBJ_DIR}/llvmgcc-build.log \
- make
- runAndLog "Installing LLVM-GCC" ${LLVMGCC_OBJ_DIR}/llvmgcc-install.log \
- make install
-}
-
-echo "Building in ${SCRATCH_ROOT}; installing in ${INSTALL_ROOT}"
-
-createDir ${SRC_ROOT}
-createDir ${OBJ_ROOT}
-
-installCodeSourcery
-installLLVM
-installLLVMGCC
-
-echo "Done."
diff --git a/contrib/llvm/utils/crosstool/create-snapshots.sh b/contrib/llvm/utils/crosstool/create-snapshots.sh
deleted file mode 100755
index d70232a..0000000
--- a/contrib/llvm/utils/crosstool/create-snapshots.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/bash
-#
-# Creates LLVM SVN snapshots: llvm-$REV.tar.bz2 and llvm-gcc-4.2-$REV.tar.bz2,
-# where $REV is an SVN revision of LLVM. This is used for creating stable
-# tarballs which can be used to build known-to-work crosstools.
-#
-# Syntax:
-# $0 [REV] -- grabs the revision $REV from SVN; if not specified, grabs the
-# latest SVN revision.
-
-set -o nounset
-set -o errexit
-
-readonly LLVM_PROJECT_SVN="http://llvm.org/svn/llvm-project"
-
-getLatestRevisionFromSVN() {
- svn info ${LLVM_PROJECT_SVN} | egrep ^Revision | sed 's/^Revision: //'
-}
-
-readonly REV="${1:-$(getLatestRevisionFromSVN)}"
-
-createTarballFromSVN() {
- local module=$1
- local log="${module}.log"
- echo "Running: svn export -r ${REV} ${module}; log in ${log}"
- svn -q export -r ${REV} ${LLVM_PROJECT_SVN}/${module}/trunk \
- ${module} > ${log} 2>&1
-
- # Create "module-revision.tar.bz2" packages from the SVN checkout dirs.
- local tarball="${module}-${REV}.tar.bz2"
- echo "Creating tarball: ${tarball}"
- tar cjf ${tarball} ${module}
-
- echo "Cleaning up '${module}'"
- rm -rf ${module} ${log}
-}
-
-for module in "llvm" "llvm-gcc-4.2"; do
- createTarballFromSVN ${module}
-done
-
diff --git a/contrib/llvm/utils/emacs/README b/contrib/llvm/utils/emacs/README
deleted file mode 100644
index e83eeae..0000000
--- a/contrib/llvm/utils/emacs/README
+++ /dev/null
@@ -1,27 +0,0 @@
--*- llvm/utils/emacs/README -*-
-
-These are syntax highlighting files for the Emacs and XEmacs editors. Included
-are:
-
-* llvm-mode.el
-
- Syntax highlighting mode for LLVM assembly files. To use, add this code to
- your ~/.emacs :
-
- (setq load-path
- (cons (expand-file-name "path-to-llvm/utils/emacs") load-path))
- (require 'llvm-mode)
-
-* tablegen-mode.el
-
- Syntax highlighting mode for TableGen description files. To use, add this code
- to your ~/.emacs:
-
- (setq load-path
- (cons (expand-file-name "path-to-llvm/utils/emacs") load-path))
- (require 'tablegen-mode)
-
-
-Note: If you notice missing or incorrect syntax highlighting, please contact
-<llvmbugs [at] cs.uiuc.edu>; if you wish to provide a patch to improve the
-functionality, it will be most appreciated. Thank you.
diff --git a/contrib/llvm/utils/emacs/emacs.el b/contrib/llvm/utils/emacs/emacs.el
deleted file mode 100644
index 969f538..0000000
--- a/contrib/llvm/utils/emacs/emacs.el
+++ /dev/null
@@ -1,39 +0,0 @@
-;; LLVM coding style guidelines in emacs
-;; Maintainer: LLVM Team, http://llvm.org/
-;; Modified: 2009-07-28
-
-;; Max 80 cols per line, indent by two spaces, no tabs.
-;; Apparently, this does not affect tabs in Makefiles.
-(custom-set-variables
- '(fill-column 80)
- '(c++-indent-level 2)
- '(c-basic-offset 2)
- '(indent-tabs-mode nil))
-
-
-;; Alternative to setting the global style. Only files with "llvm" in
-;; their names will automatically set to the llvm.org coding style.
-(c-add-style "llvm.org"
- '((fill-column . 80)
- (c++-indent-level . 2)
- (c-basic-offset . 2)
- (indent-tabs-mode . nil)
- (c-offsets-alist . ((innamespace 0)))))
-
-(add-hook 'c-mode-hook
- (function
- (lambda nil
- (if (string-match "llvm" buffer-file-name)
- (progn
- (c-set-style "llvm.org")
- )
- ))))
-
-(add-hook 'c++-mode-hook
- (function
- (lambda nil
- (if (string-match "llvm" buffer-file-name)
- (progn
- (c-set-style "llvm.org")
- )
- ))))
diff --git a/contrib/llvm/utils/emacs/llvm-mode.el b/contrib/llvm/utils/emacs/llvm-mode.el
deleted file mode 100644
index b1af853..0000000
--- a/contrib/llvm/utils/emacs/llvm-mode.el
+++ /dev/null
@@ -1,128 +0,0 @@
-;; Maintainer: The LLVM team, http://llvm.org/
-;; Description: Major mode for the LLVM assembler language.
-;; Updated: 2007-09-19
-
-;; Create mode-specific tables.
-(defvar llvm-mode-syntax-table nil
- "Syntax table used while in LLVM mode.")
-
-(defvar llvm-font-lock-keywords
- (list
- ;; Comments
- '(";.*" . font-lock-comment-face)
- ;; Variables
- '("%[-a-zA-Z$\._][-a-zA-Z$\._0-9]*" . font-lock-variable-name-face)
- ;; Labels
- '("[-a-zA-Z$\._0-9]+:" . font-lock-variable-name-face)
- ;; Strings
- '("\"[^\"]+\"" . font-lock-string-face)
- ;; Unnamed variable slots
- '("%[-]?[0-9]+" . font-lock-variable-name-face)
- ;; Types
- '("\\bvoid\\b\\|\\bi[0-9]+\\b\\|\\float\\b\\|\\bdouble\\b\\|\\btype\\b\\|\\blabel\\b\\|\\bopaque\\b" . font-lock-type-face)
- ;; Integer literals
- '("\\b[-]?[0-9]+\\b" . font-lock-preprocessor-face)
- ;; Floating point constants
- '("\\b[-+]?[0-9]+\.[0-9]*\([eE][-+]?[0-9]+\)?\\b" . font-lock-preprocessor-face)
- ;; Hex constants
- '("\\b0x[0-9A-Fa-f]+\\b" . font-lock-preprocessor-face)
- ;; Keywords
- '("\\bbegin\\b\\|\\bend\\b\\|\\btrue\\b\\|\\bfalse\\b\\|\\bzeroinitializer\\b\\|\\bdeclare\\b\\|\\bdefine\\b\\|\\bglobal\\b\\|\\bconstant\\b\\|\\bconst\\b\\|\\binternal\\b\\|\\blinkonce\\b\\|\\blinkonce_odr\\b\\|\\bweak\\b\\|\\bweak_odr\\b\\|\\bappending\\b\\|\\buninitialized\\b\\|\\bimplementation\\b\\|\\b\\.\\.\\.\\b\\|\\bnull\\b\\|\\bundef\\b\\|\\bto\\b\\|\\bexcept\\b\\|\\bnot\\b\\|\\btarget\\b\\|\\bendian\\b\\|\\blittle\\b\\|\\bbig\\b\\|\\bpointersize\\b\\|\\bdeplibs\\b\\|\\bvolatile\\b\\|\\bfastcc\\b\\|\\bcoldcc\\b\\|\\bcc\\b" . font-lock-keyword-face)
- ;; Arithmetic and Logical Operators
- '("\\badd\\b\\|\\bsub\\b\\|\\bmul\\b\\|\\bdiv\\b\\|\\brem\\b\\|\\band\\b\\|\\bor\\b\\|\\bxor\\b\\|\\bset\\(ne\\b\\|\\beq\\b\\|\\blt\\b\\|\\bgt\\b\\|\\ble\\b\\|\\bge\\b\\)" . font-lock-keyword-face)
- ;; Special instructions
- '("\\bphi\\b\\|\\btail\\b\\|\\bcall\\b\\|\\bcast\\b\\|\\bselect\\b\\|\\bto\\b\\|\\bshl\\b\\|\\bshr\\b\\|\\bvaarg\\b\\|\\bvanext\\b" . font-lock-keyword-face)
- ;; Control instructions
- '("\\bret\\b\\|\\bbr\\b\\|\\bswitch\\b\\|\\binvoke\\b\\|\\bunwind\\b\\|\\bunreachable\\b" . font-lock-keyword-face)
- ;; Memory operators
- '("\\bmalloc\\b\\|\\balloca\\b\\|\\bfree\\b\\|\\bload\\b\\|\\bstore\\b\\|\\bgetelementptr\\b" . font-lock-keyword-face)
- )
- "Syntax highlighting for LLVM"
- )
-
-;; ---------------------- Syntax table ---------------------------
-;; Shamelessly ripped from jasmin.el
-;; URL: http://www.neilvandyke.org/jasmin-emacs/jasmin.el.html
-
-(if (not llvm-mode-syntax-table)
- (progn
- (setq llvm-mode-syntax-table (make-syntax-table))
- (mapcar (function (lambda (n)
- (modify-syntax-entry (aref n 0)
- (aref n 1)
- llvm-mode-syntax-table)))
- '(
- ;; whitespace (` ')
- [?\^m " "]
- [?\f " "]
- [?\n " "]
- [?\t " "]
- [?\ " "]
- ;; word constituents (`w')
- ;;[?< "w"]
- ;;[?> "w"]
- [?\% "w"]
- ;;[?_ "w "]
- ;; comments
- [?\; "< "]
- [?\n "> "]
- ;;[?\r "> "]
- ;;[?\^m "> "]
- ;; symbol constituents (`_')
- ;; punctuation (`.')
- ;; open paren (`(')
- [?\( "("]
- [?\[ "("]
- [?\{ "("]
- ;; close paren (`)')
- [?\) ")"]
- [?\] ")"]
- [?\} ")"]
- ;; string quote ('"')
- [?\" "\""]
- ))))
-
-;; --------------------- Abbrev table -----------------------------
-
-(defvar llvm-mode-abbrev-table nil
- "Abbrev table used while in LLVM mode.")
-(define-abbrev-table 'llvm-mode-abbrev-table ())
-
-(defvar llvm-mode-hook nil)
-(defvar llvm-mode-map nil) ; Create a mode-specific keymap.
-
-(if (not llvm-mode-map)
- () ; Do not change the keymap if it is already set up.
- (setq llvm-mode-map (make-sparse-keymap))
- (define-key llvm-mode-map "\t" 'tab-to-tab-stop)
- (define-key llvm-mode-map "\es" 'center-line)
- (define-key llvm-mode-map "\eS" 'center-paragraph))
-
-
-(defun llvm-mode ()
- "Major mode for editing LLVM source files.
- \\{llvm-mode-map}
- Runs llvm-mode-hook on startup."
- (interactive)
- (kill-all-local-variables)
- (use-local-map llvm-mode-map) ; Provides the local keymap.
- (setq major-mode 'llvm-mode)
-
- (make-local-variable 'font-lock-defaults)
- (setq major-mode 'llvm-mode ; This is how describe-mode
- ; finds the doc string to print.
- mode-name "LLVM" ; This name goes into the modeline.
- font-lock-defaults `(llvm-font-lock-keywords))
-
- (setq local-abbrev-table llvm-mode-abbrev-table)
- (set-syntax-table llvm-mode-syntax-table)
- (setq comment-start ";")
- (run-hooks 'llvm-mode-hook)) ; Finally, this permits the user to
- ; customize the mode with a hook.
-
-;; Associate .ll files with llvm-mode
-(setq auto-mode-alist
- (append '(("\\.ll$" . llvm-mode)) auto-mode-alist))
-
-(provide 'llvm-mode)
-;; end of llvm-mode.el
diff --git a/contrib/llvm/utils/emacs/tablegen-mode.el b/contrib/llvm/utils/emacs/tablegen-mode.el
deleted file mode 100644
index 833c16c..0000000
--- a/contrib/llvm/utils/emacs/tablegen-mode.el
+++ /dev/null
@@ -1,124 +0,0 @@
-;; Maintainer: The LLVM team, http://llvm.org/
-;; Description: Major mode for TableGen description files (part of LLVM project)
-;; Updated: 2007-12-18
-
-(require 'comint)
-(require 'custom)
-(require 'ansi-color)
-
-;; Create mode-specific tables.
-(defvar td-decorators-face 'td-decorators-face
- "Face method decorators.")
-(make-face 'td-decorators-face)
-
-(defvar tablegen-font-lock-keywords
- (let ((kw (mapconcat 'identity
- '("class" "defm" "def" "field" "include" "in"
- "let" "multiclass")
- "\\|"))
- (type-kw (mapconcat 'identity
- '("bit" "bits" "code" "dag" "int" "list" "string")
- "\\|"))
- )
- (list
- ;; Comments
-;; '("\/\/" . font-lock-comment-face)
- ;; Strings
- '("\"[^\"]+\"" . font-lock-string-face)
- ;; Hex constants
- '("\\<0x[0-9A-Fa-f]+\\>" . font-lock-preprocessor-face)
- ;; Binary constants
- '("\\<0b[01]+\\>" . font-lock-preprocessor-face)
- ;; Integer literals
- '("\\<[-]?[0-9]+\\>" . font-lock-preprocessor-face)
- ;; Floating point constants
- '("\\<[-+]?[0-9]+\.[0-9]*\([eE][-+]?[0-9]+\)?\\>" . font-lock-preprocessor-face)
-
- '("^[ \t]*\\(@.+\\)" 1 'td-decorators-face)
- ;; Keywords
- (cons (concat "\\<\\(" kw "\\)\\>[ \n\t(]") 1)
-
- ;; Type keywords
- (cons (concat "\\<\\(" type-kw "\\)[ \n\t(]") 1)
- ))
- "Additional expressions to highlight in TableGen mode.")
-(put 'tablegen-mode 'font-lock-defaults '(tablegen-font-lock-keywords))
-
-;; ---------------------- Syntax table ---------------------------
-;; Shamelessly ripped from jasmin.el
-;; URL: http://www.neilvandyke.org/jasmin-emacs/jasmin.el
-
-(defvar tablegen-mode-syntax-table nil
- "Syntax table used in `tablegen-mode' buffers.")
-(when (not tablegen-mode-syntax-table)
- (setq tablegen-mode-syntax-table (make-syntax-table))
- ;; whitespace (` ')
- (modify-syntax-entry ?\ " " tablegen-mode-syntax-table)
- (modify-syntax-entry ?\t " " tablegen-mode-syntax-table)
- (modify-syntax-entry ?\r " " tablegen-mode-syntax-table)
- (modify-syntax-entry ?\n " " tablegen-mode-syntax-table)
- (modify-syntax-entry ?\f " " tablegen-mode-syntax-table)
- ;; word constituents (`w')
- (modify-syntax-entry ?\% "w" tablegen-mode-syntax-table)
- (modify-syntax-entry ?\_ "w" tablegen-mode-syntax-table)
- ;; comments
- (modify-syntax-entry ?/ ". 124b" tablegen-mode-syntax-table)
- (modify-syntax-entry ?* ". 23" tablegen-mode-syntax-table)
- (modify-syntax-entry ?\n "> b" tablegen-mode-syntax-table)
- ;; open paren (`(')
- (modify-syntax-entry ?\( "(" tablegen-mode-syntax-table)
- (modify-syntax-entry ?\[ "(" tablegen-mode-syntax-table)
- (modify-syntax-entry ?\{ "(" tablegen-mode-syntax-table)
- (modify-syntax-entry ?\< "(" tablegen-mode-syntax-table)
- ;; close paren (`)')
- (modify-syntax-entry ?\) ")" tablegen-mode-syntax-table)
- (modify-syntax-entry ?\] ")" tablegen-mode-syntax-table)
- (modify-syntax-entry ?\} ")" tablegen-mode-syntax-table)
- (modify-syntax-entry ?\> ")" tablegen-mode-syntax-table)
- ;; string quote ('"')
- (modify-syntax-entry ?\" "\"" tablegen-mode-syntax-table)
- )
-
-;; --------------------- Abbrev table -----------------------------
-
-(defvar tablegen-mode-abbrev-table nil
- "Abbrev table used while in TableGen mode.")
-(define-abbrev-table 'tablegen-mode-abbrev-table ())
-
-(defvar tablegen-mode-hook nil)
-(defvar tablegen-mode-map nil) ; Create a mode-specific keymap.
-
-(if (not tablegen-mode-map)
- () ; Do not change the keymap if it is already set up.
- (setq tablegen-mode-map (make-sparse-keymap))
- (define-key tablegen-mode-map "\t" 'tab-to-tab-stop)
- (define-key tablegen-mode-map "\es" 'center-line)
- (define-key tablegen-mode-map "\eS" 'center-paragraph))
-
-(defun tablegen-mode ()
- "Major mode for editing TableGen description files.
- \\{tablegen-mode-map}
- Runs tablegen-mode-hook on startup."
- (interactive)
- (kill-all-local-variables)
- (use-local-map tablegen-mode-map) ; Provides the local keymap.
- (make-local-variable 'font-lock-defaults)
- (setq major-mode 'tablegen-mode ; This is how describe-mode
- ; finds the doc string to print.
- mode-name "TableGen" ; This name goes into the modeline.
- local-abbrev-table tablegen-mode-abbrev-table
- font-lock-defaults `(tablegen-font-lock-keywords)
- require-final-newline t
- )
-
- (set-syntax-table tablegen-mode-syntax-table)
- (make-local-variable 'comment-start)
- (setq comment-start "//")
- (run-hooks 'tablegen-mode-hook)) ; Finally, this permits the user to
- ; customize the mode with a hook.
-
-;; Associate .td files with tablegen-mode
-(setq auto-mode-alist (append '(("\\.td$" . tablegen-mode)) auto-mode-alist))
-
-(provide 'tablegen-mode)
-;; end of tablegen-mode.el
diff --git a/contrib/llvm/utils/findmisopt b/contrib/llvm/utils/findmisopt
deleted file mode 100755
index b7ffbd9..0000000
--- a/contrib/llvm/utils/findmisopt
+++ /dev/null
@@ -1,178 +0,0 @@
-#!/bin/bash
-#
-# findmisopt
-#
-# This is a quick and dirty hack to potentially find a misoptimization
-# problem. Mostly its to work around problems in bugpoint that prevent
-# it from finding a problem unless the set of failing optimizations are
-# known and given to it on the command line.
-#
-# Given a bytecode file that produces correct output (or return code),
-# this script will run through all the optimizations passes that gccas
-# uses (in the same order) and will narrow down which optimizations
-# cause the program either generate different output or return a
-# different result code. When the passes have been narrowed down,
-# bugpoint is invoked to further refine the problem to its origin. If a
-# release version of bugpoint is available it will be used, otherwise
-# debug.
-#
-# Usage:
-# findmisopt bcfile outdir progargs [match]
-#
-# Where:
-# bcfile
-# is the bytecode file input (the unoptimized working case)
-# outdir
-# is a directory into which intermediate results are placed
-# progargs
-# is a single argument containing all the arguments the program needs
-# proginput
-# is a file name from which stdin should be directed
-# match
-# if specified to any value causes the result code of the program to
-# be used to determine success/fail. If not specified success/fail is
-# determined by diffing the program's output with the non-optimized
-# output.
-#
-if [ "$#" -lt 3 ] ; then
- echo "usage: findmisopt bcfile outdir progargs [match]"
- exit 1
-fi
-
-dir="${0%%/utils/findmisopt}"
-if [ -x "$dir/Release/bin/bugpoint" ] ; then
- bugpoint="$dir/Release/bin/bugpoint"
-elif [ -x "$dir/Debug/bin/bugpoint" ] ; then
- bugpoint="$dir/Debug/bin/bugpoint"
-else
- echo "findmisopt: bugpoint not found"
- exit 1
-fi
-
-bcfile="$1"
-outdir="$2"
-args="$3"
-input="$4"
-if [ ! -f "$input" ] ; then
- input="/dev/null"
-fi
-match="$5"
-name=`basename $bcfile .bc`
-ll="$outdir/${name}.ll"
-s="$outdir/${name}.s"
-prog="$outdir/${name}"
-out="$outdir/${name}.out"
-optbc="$outdir/${name}.opt.bc"
-optll="$outdir/${name}.opt.ll"
-opts="$outdir/${name}.opt.s"
-optprog="$outdir/${name}.opt"
-optout="$outdir/${name}.opt.out"
-ldflags="-lstdc++ -lm -ldl -lc"
-
-echo "Test Name: $name"
-echo "Unoptimized program: $prog"
-echo " Optimized program: $optprog"
-
-# Define the list of optimizations to run. This comprises the same set of
-# optimizations that opt -std-compile-opts and gccld run, in the same order.
-opt_switches=`llvm-as < /dev/null -o - | opt -std-compile-opts -disable-output -debug-pass=Arguments 2>&1 | sed 's/Pass Arguments: //'`
-ld_switches=`llvm-as < /dev/null -o - | llvm-ld - -debug-pass=Arguments 2>&1 | sed 's/Pass Arguments: //'`
-all_switches="$opt_switches $ld_switches"
-echo "Passes : $all_switches"
-
-# Create output directory if it doesn't exist
-if [ -f "$outdir" ] ; then
- echo "$outdir is not a directory"
- exit 1
-fi
-
-if [ ! -d "$outdir" ] ; then
- mkdir "$outdir" || exit 1
-fi
-
-# Generate the disassembly
-llvm-dis "$bcfile" -o "$ll" -f || exit 1
-
-# Generate the non-optimized program and its output
-llc "$bcfile" -o "$s" -f || exit 1
-gcc "$s" -o "$prog" $ldflags || exit 1
-"$prog" $args > "$out" 2>&1 <$input
-ex1=$?
-
-# Current set of switches is empty
-function tryit {
- switches_to_use="$1"
- opt $switches_to_use "$bcfile" -o "$optbc" -f || exit
- llvm-dis "$optbc" -o "$optll" -f || exit
- llc "$optbc" -o "$opts" -f || exit
- gcc "$opts" -o "$optprog" $ldflags || exit
- "$optprog" $args > "$optout" 2>&1 <"$input"
- ex2=$?
-
- if [ -n "$match" ] ; then
- if [ "$ex1" -ne "$ex2" ] ; then
- echo "Return code not the same with these switches:"
- echo $switches
- echo "Unoptimized returned: $ex1"
- echo "Optimized returned: $ex2"
- return 0
- fi
- else
- diff "$out" "$optout" > /dev/null
- if [ $? -ne 0 ] ; then
- echo "Diff fails with these switches:"
- echo $switches
- echo "Differences:"
- diff "$out" "$optout" | head
- return 0;
- fi
- fi
- return 1
-}
-
-echo "Trying to find optimization that breaks program:"
-for sw in $all_switches ; do
- echo -n " $sw"
- switches="$switches $sw"
- if tryit "$switches" ; then
- break;
- fi
-done
-
-# Terminate the previous output with a newline
-echo ""
-
-# Determine if we're done because none of the optimizations broke the program
-if [ "$switches" == " $all_switches" ] ; then
- echo "The program did not miscompile"
- exit 0
-fi
-
-final=""
-while [ ! -z "$switches" ] ; do
- trimmed=`echo "$switches" | sed -e 's/^ *\(-[^ ]*\).*/\1/'`
- switches=`echo "$switches" | sed -e 's/^ *-[^ ]* *//'`
- echo "Trimmed $trimmed from left"
- tryit "$final $switches"
- if [ "$?" -eq "0" ] ; then
- echo "Still Failing .. continuing ..."
- continue
- else
- echo "Found required early pass: $trimmed"
- final="$final $trimmed"
- continue
- fi
- echo "Next Loop"
-done
-
-if [ "$final" == " $all_switches" ] ; then
- echo "findmisopt: All optimizations pass. Perhaps this isn't a misopt?"
- exit 0
-fi
-echo "Smallest Optimization list=$final"
-
-bpcmd="$bugpoint -run-llc -disable-loop-extraction --output "$out" --input /dev/null $bcfile $final --args $args"
-
-echo "Running: $bpcmd"
-$bpcmd
-echo "findmisopt finished."
diff --git a/contrib/llvm/utils/findoptdiff b/contrib/llvm/utils/findoptdiff
deleted file mode 100755
index 4f8d08d..0000000
--- a/contrib/llvm/utils/findoptdiff
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/bin/bash
-#
-# findoptdiff
-#
-# This script helps find the optimization difference between two llvm
-# builds. It is useful when you have a build that is known to work and
-# one that exhibits an optimization problem. Identifying the difference
-# between the two builds can lead to discovery of the source of a
-# mis-optimization.
-#
-# The script takes two llvm build paths as arguments. These specify the
-# the two llvm builds to compare. It is generally expected that they
-# are "close cousins". That is, they are the same except that the
-# second build contains some experimental optimization features that
-# are suspected of producing a misoptimization.
-#
-# The script takes two bytecode files, one from each build. They are
-# presumed to be a compilation of the same program or program fragment
-# with the only difference being the builds.
-#
-# The script operates by iteratively applying the optimizations that gccas
-# and gccld run until there is a difference in the assembly resulting
-# from the optimization. The difference is then reported with the set of
-# optimization passes that produce the difference. The processing
-# continues until all optimization passes have been tried. The differences
-# for each pass, if they do differ, are placed in a diffs.# file.
-#
-# To work around differences in the assembly language format, the script
-# can also take two filter arguments that post-process the assembly
-# so they can be differenced without making false positives for known
-# differences in the two builds. These filters are optional.
-#
-# Usage:
-# findoptdiff llvm1 llvm2 bc1 bc2 filter1 filter2
-#
-# Where:
-# llvm1
-# is the path to the first llvm build dir
-# llvm2
-# is the path to the second llvm build dir
-# bc1
-# is the bytecode file for the first llvm environment
-# bc2
-# is the bytecode file for the second llvm environment
-# filter1
-# is an optional filter for filtering the llvm1 generated assembly
-# filter2
-# is an optional filter for filtering the llvm2 generated assembly
-#
-llvm1=$1
-llvm2=$2
-bc1=$3
-bc2=$4
-filt1=$5
-filt2=$6
-if [ -z "$filt1" ] ; then
- filt1="cat"
-fi
-if [ -z "$filt2" ] ; then
- filt2="cat"
-fi
-opt1="${bc1}.opt"
-opt2="${bc2}.opt"
-ll1="${bc1}.ll"
-ll2="${bc2}.ll"
-opt1ll="${bc1}.opt.ll"
-opt2ll="${bc2}.opt.ll"
-dis1="$llvm1/Debug/bin/llvm-dis"
-dis2="$llvm2/Debug/bin/llvm-dis"
-opt1="$llvm1/Debug/bin/opt"
-opt2="$llvm2/Debug/bin/opt"
-
-all_switches="-verify -lowersetjmp -simplifycfg -mem2reg -globalopt -globaldce -ipconstprop -deadargelim -instcombine -simplifycfg -prune-eh -inline -simplify-libcalls -argpromotion -tailduplicate -simplifycfg -scalarrepl -instcombine -predsimplify -condprop -tailcallelim -simplifycfg -reassociate -licm -loop-unswitch -instcombine -indvars -loop-unroll -instcombine -load-vn -gcse -sccp -instcombine -condprop -dse -dce -simplifycfg -deadtypeelim -constmerge -internalize -ipsccp -globalopt -constmerge -deadargelim -inline -prune-eh -globalopt -globaldce -argpromotion -instcombine -predsimplify -scalarrepl -globalsmodref-aa -licm -load-vn -gcse -dse -instcombine -simplifycfg -verify"
-
-#counter=0
-function tryit {
- switches_to_use="$1"
- $opt1 $switches_to_use "$bc1" -o - | $dis1 | $filt1 > "$opt1ll"
- $opt2 $switches_to_use "$bc2" -o - | $dis2 | $filt2 > "$opt2ll"
- diffs="diffs."$((counter++))
- diff "$opt1ll" "$opt2ll" > $diffs
- if [ $? -ne 0 ] ; then
- echo
- echo "Diff fails with these switches:"
- echo $switches
- echo "Differences:"
- head $diffs
- echo 'Switches:' $switches_to_use >> $diffs
- else
- rm $diffs
- fi
- return 1
-}
-
-for sw in $all_switches ; do
- echo -n " $sw"
- switches="$switches $sw"
- if tryit "$switches" ; then
- break;
- fi
-done
diff --git a/contrib/llvm/utils/findsym.pl b/contrib/llvm/utils/findsym.pl
deleted file mode 100755
index 9234657..0000000
--- a/contrib/llvm/utils/findsym.pl
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/perl -w
-#
-# Program: findsym.pl
-#
-# Synopsis: Generate a list of the libraries in which a symbol is defined or
-# referenced.
-#
-# Syntax: findsym.pl <directory_with_libraries_in_it> <symbol>
-#
-
-# Give first option a name.
-my $Directory = $ARGV[0];
-my $Symbol = $ARGV[1];
-
-# Open the directory and read its contents, sorting by name and differentiating
-# by whether its a library (.a) or an object file (.o)
-opendir DIR,$Directory;
-my @files = readdir DIR;
-closedir DIR;
-@objects = grep(/l?i?b?LLVM.*\.[oa]$/,sort(@files));
-
-# Gather definitions from the libraries
-foreach $lib (@objects) {
- my $head = 0;
- open SYMS,
- "nm $Directory/$lib | grep '$Symbol' | sort --key=3 | uniq |";
- while (<SYMS>) {
- if (!$head) { print "$lib:\n"; $head = 1; }
- chomp($_);
- print " $_\n";
- }
- close SYMS;
-}
diff --git a/contrib/llvm/utils/fpcmp/Makefile b/contrib/llvm/utils/fpcmp/Makefile
deleted file mode 100644
index fd2f747..0000000
--- a/contrib/llvm/utils/fpcmp/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-##===- utils/fpcmp/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 = fpcmp
-USEDLIBS = LLVMSupport.a LLVMSystem.a
-NO_INSTALL = 1
-
-include $(LEVEL)/Makefile.common
-
diff --git a/contrib/llvm/utils/fpcmp/fpcmp.cpp b/contrib/llvm/utils/fpcmp/fpcmp.cpp
deleted file mode 100644
index 5f6b5e8..0000000
--- a/contrib/llvm/utils/fpcmp/fpcmp.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-//===- fpcmp.cpp - A fuzzy "cmp" that permits floating point noise --------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// fpcmp is a tool that basically works like the 'cmp' tool, except that it can
-// tolerate errors due to floating point noise, with the -r and -a options.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/FileUtilities.h"
-#include "llvm/Support/raw_ostream.h"
-using namespace llvm;
-
-namespace {
- cl::opt<std::string>
- File1(cl::Positional, cl::desc("<input file #1>"), cl::Required);
- cl::opt<std::string>
- File2(cl::Positional, cl::desc("<input file #2>"), cl::Required);
-
- cl::opt<double>
- RelTolerance("r", cl::desc("Relative error tolerated"), cl::init(0));
- cl::opt<double>
- AbsTolerance("a", cl::desc("Absolute error tolerated"), cl::init(0));
-}
-
-int main(int argc, char **argv) {
- cl::ParseCommandLineOptions(argc, argv);
-
- std::string ErrorMsg;
- int DF = DiffFilesWithTolerance(sys::PathWithStatus(File1),
- sys::PathWithStatus(File2),
- AbsTolerance, RelTolerance, &ErrorMsg);
- if (!ErrorMsg.empty())
- errs() << argv[0] << ": " << ErrorMsg << "\n";
- return DF;
-}
-
diff --git a/contrib/llvm/utils/getsrcs.sh b/contrib/llvm/utils/getsrcs.sh
deleted file mode 100755
index c8bff8c..0000000
--- a/contrib/llvm/utils/getsrcs.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh
-##===- utils/getsrcs.sh - Counts Lines Of Code ---------------*- Script -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-# details.
-#
-##===----------------------------------------------------------------------===##
-#
-# This script just prints out the path names for all the source files in LLVM.
-# The optional -topdir option can be used to specify the top LLVM source
-# directory. Without it, the llvm-config command is consulted to find the
-# top source directory.
-#
-# Note that the implementation is based on llvmdo. See that script for more
-# details.
-##===----------------------------------------------------------------------===##
-
-if test "$1" = "-topdir" ; then
- TOPDIR="$2"
- shift; shift;
-else
- TOPDIR=`llvm-config --src-root`
-fi
-
-if test -d "$TOPDIR" ; then
- cd $TOPDIR
- ./utils/llvmdo -topdir "$TOPDIR" \
- -dirs "include lib tools utils examples projects" echo
-else
- echo "Can't find LLVM top directory"
-fi
diff --git a/contrib/llvm/utils/git/find-rev b/contrib/llvm/utils/git/find-rev
deleted file mode 100755
index a6161db..0000000
--- a/contrib/llvm/utils/git/find-rev
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/python
-
-import os, sys, subprocess
-
-def main():
- from optparse import OptionParser, OptionGroup
- parser = OptionParser("usage: %prog [options] <repo> <revision>")
- parser.add_option("", "--dump-section-data", dest="dumpSectionData",
- help="Dump the contents of sections",
- action="store_true", default=False)
- (opts, args) = parser.parse_args()
-
- if len(args) != 2:
- parser.error("invalid number of arguments")
-
- repo,rev = args
-
- try:
- rev = int(rev)
- except:
- parser.error("invalid revision argument (not an integer)")
-
- os.chdir(repo)
- p = subprocess.Popen(['git', 'rev-list', 'git-svn', '--pretty'],
- stdout=subprocess.PIPE)
-
- bestRev = bestCommit = None
- lastCommit = None
- for ln in p.stdout:
- if ln.startswith('commit '):
- lastCommit = ln.split(' ',2)[1]
- elif ln.startswith(' git-svn-id: '):
- _,repo,_ = ln.strip().split(' ')
- _,lrev = repo.rsplit('@',1)
- lrev = int(lrev)
- if lrev<=rev:
- if bestRev is None or lrev>bestRev:
- assert lastCommit
- bestCommit = lastCommit
- bestRev = lrev
- if lrev == rev:
- break
-
- if bestCommit is not None:
- print bestCommit
- sys.exit(0)
- sys.exit(1)
-
-if __name__=='__main__':
- main()
diff --git a/contrib/llvm/utils/importNLT.pl b/contrib/llvm/utils/importNLT.pl
deleted file mode 100644
index c1b950d..0000000
--- a/contrib/llvm/utils/importNLT.pl
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/usr/bin/perl
-#take the output of parseNLT.pl and load it into a database
-# use like: cat file |perl parseNLT.pl |perl importNLT.pl password
-
-use DBI;
-
-# database information
-$db="llvmalpha";
-$host="localhost";
-$userid="llvmdbuser";
-$passwd=shift @ARGV;
-$connectionInfo="dbi:mysql:$db;$host";
-
-# make connection to database
-$dbh = DBI->connect($connectionInfo,$userid,$passwd) or die DBI->errstr;
-my $sth = $dbh->prepare( q{
- INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES (?, STR_TO_DATE(?, '\%d \%M \%Y'), ?, ?)
- }) || die "Can't prepare statement: $DBI::errstr";;
-
-while($d = <>)
-{
- chomp $d;
- if (18 == scalar split " ", $d)
- {
- ($day, $mon, $year, $prog, $gccas, $bc, $llccompile, $llcbetacompile, $jitcompile,
- $mc, $gcc, $cbe, $llc, $llcbeta, $jit, $foo1, $foo2, $foo3) = split " ", $d;
- if ($gccas =~ /\d+/)
- {
- $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
- ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'gccas', $gccas)") || die DBI->errstr;
- }
- if ($bc =~ /\d/)
- {
- $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
- ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'bytecode', $bc)") || die DBI->errstr;
- }
- if ($llccompile =~ /\d/)
- {
- $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
- ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'llc-compile', $llccompile)") || die DBI->errstr;
- }
- if ($llcbetacompile =~ /\d/)
- {
- $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
- ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'llc-beta-compile', $llcbetacompile)") || die DBI->errstr;
- }
- if ($jitcompile =~ /\d/)
- {
- $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
- ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'jit-compile', $jitcompile)") || die DBI->errstr;
- }
- if ($mc =~ /\d/)
- {
- $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
- ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'machine-code', $mc)") || die DBI->errstr;
- }
- if ($gcc =~ /\d/)
- {
- $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
- ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'gcc', $gcc)") || die DBI->errstr;
- }
- if ($llc =~ /\d/)
- {
- $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
- ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'llc', $llc)") || die DBI->errstr;
- }
- if ($llcbeta =~ /\d/)
- {
- $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
- ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'llc-beta', $llcbeta)") || die DBI->errstr;
- }
- if ($jit =~ /\d/)
- {
- $dbh->do("INSERT INTO Tests (NAME, RUN, TEST, VALUE) VALUES
- ('$prog', STR_TO_DATE('$day $mon $year', '\%d \%M \%Y'), 'jit', $jit)") || die DBI->errstr;
- }
- print ".";
- }
- else
- {
- print "\nNO: $d\n";
- }
-}
-print "\n";
-# disconnect from database
-$dbh->disconnect;
diff --git a/contrib/llvm/utils/jedit/README b/contrib/llvm/utils/jedit/README
deleted file mode 100644
index 6a6c8c7..0000000
--- a/contrib/llvm/utils/jedit/README
+++ /dev/null
@@ -1,14 +0,0 @@
--*- llvm/utils/jedit/README -*-
-
-These are syntax highlighting files for the jEdit editor. Included are:
-
-* tablegen.xml
-
- Syntax highlighting mode for TableGen description files. To use, copy this
- file to ~/.jedit/modes/ and add this code to your ~/.jedit/modes/catalog:
-
- <MODE NAME="tablegen" FILE="tablegen.xml" FILE_NAME_GLOB="*.td" />
-
-Note: If you notice missing or incorrect syntax highlighting, please contact
-<llvmbugs [at] cs.uiuc.edu>; if you wish to provide a patch to improve the
-functionality, it will be most appreciated. Thank you.
diff --git a/contrib/llvm/utils/jedit/tablegen.xml b/contrib/llvm/utils/jedit/tablegen.xml
deleted file mode 100644
index 2d80a3f..0000000
--- a/contrib/llvm/utils/jedit/tablegen.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE MODE SYSTEM "xmode.dtd">
-<MODE>
- <PROPS>
- <PROPERTY NAME="lineComment" VALUE="//" />
- <PROPERTY NAME="commentStart" VALUE="/*" />
- <PROPERTY NAME="commentEnd" VALUE="*/" />
- <PROPERTY NAME="indentOpenBrackets" VALUE="{" />
- <PROPERTY NAME="indentCloseBrackets" VALUE="}" />
- <PROPERTY NAME="wordBreakChars" VALUE=",+-=&lt;&gt;/?^&amp;*" />
- <PROPERTY NAME="unalignedOpenBrackets" VALUE="(&lt;" />
- <PROPERTY NAME="unalignedCloseBrackets" VALUE=")&gt;" />
- </PROPS>
- <RULES IGNORE_CASE="FALSE" HIGHLIGHT_DIGITS="TRUE">
- <EOL_SPAN TYPE="COMMENT1">//</EOL_SPAN>
- <SPAN TYPE="COMMENT1">
- <BEGIN>/*</BEGIN>
- <END>*/</END>
- </SPAN>
- <SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE" ESCAPE="\">
- <BEGIN>"</BEGIN>
- <END>"</END>
- </SPAN>
- <KEYWORDS>
- <KEYWORD1>let</KEYWORD1>
- <KEYWORD1>def</KEYWORD1>
- <KEYWORD1>class</KEYWORD1>
- <KEYWORD1>include</KEYWORD1>
-
- <KEYWORD3>bit</KEYWORD3>
- <KEYWORD3>int</KEYWORD3>
- <KEYWORD3>string</KEYWORD3>
- <KEYWORD3>bits</KEYWORD3>
- <KEYWORD3>list</KEYWORD3>
- <KEYWORD3>dag</KEYWORD3>
- <KEYWORD3>code</KEYWORD3>
- </KEYWORDS>
- </RULES>
-</MODE>
diff --git a/contrib/llvm/utils/lint/common_lint.py b/contrib/llvm/utils/lint/common_lint.py
deleted file mode 100644
index e982680..0000000
--- a/contrib/llvm/utils/lint/common_lint.py
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/usr/bin/python
-#
-# Common lint functions applicable to multiple types of files.
-
-import re
-
-def VerifyLineLength(filename, lines, max_length):
- """Checks to make sure the file has no lines with lines exceeding the length
- limit.
-
- Args:
- filename: the file under consideration as string
- lines: contents of the file as string array
- max_length: maximum acceptable line length as number
-
- Returns:
- A list of tuples with format [(filename, line number, msg), ...] with any
- violations found.
- """
- lint = []
- line_num = 1
- for line in lines:
- length = len(line.rstrip('\n'))
- if length > max_length:
- lint.append((filename, line_num,
- 'Line exceeds %d chars (%d)' % (max_length, length)))
- line_num += 1
- return lint
-
-def VerifyTabs(filename, lines):
- """Checks to make sure the file has no tab characters.
-
- Args:
- filename: the file under consideration as string
- lines: contents of the file as string array
-
- Returns:
- A list of tuples with format [(line_number, msg), ...] with any violations
- found.
- """
- lint = []
- tab_re = re.compile(r'\t')
- line_num = 1
- for line in lines:
- if tab_re.match(line.rstrip('\n')):
- lint.append((filename, line_num, 'Tab found instead of whitespace'))
- line_num += 1
- return lint
-
-
-def VerifyTrailingWhitespace(filename, lines):
- """Checks to make sure the file has no lines with trailing whitespace.
-
- Args:
- filename: the file under consideration as string
- lines: contents of the file as string array
-
- Returns:
- A list of tuples with format [(filename, line number, msg), ...] with any
- violations found.
- """
- lint = []
- trailing_whitespace_re = re.compile(r'\s+$')
- line_num = 1
- for line in lines:
- if trailing_whitespace_re.match(line.rstrip('\n')):
- lint.append((filename, line_num, 'Trailing whitespace'))
- line_num += 1
- return lint
-
-
-class BaseLint:
- def RunOnFile(filename, lines):
- raise Exception('RunOnFile() unimplemented')
-
-
-def RunLintOverAllFiles(linter, filenames):
- """Runs linter over the contents of all files.
-
- Args:
- lint: subclass of BaseLint, implementing RunOnFile()
- filenames: list of all files whose contents will be linted
-
- Returns:
- A list of tuples with format [(filename, line number, msg), ...] with any
- violations found.
- """
- lint = []
- for filename in filenames:
- file = open(filename, 'r')
- if not file:
- print 'Cound not open %s' % filename
- continue
- lines = file.readlines()
- lint.extend(linter.RunOnFile(filename, lines))
-
- return lint
diff --git a/contrib/llvm/utils/lint/cpp_lint.py b/contrib/llvm/utils/lint/cpp_lint.py
deleted file mode 100755
index 07fad58..0000000
--- a/contrib/llvm/utils/lint/cpp_lint.py
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/usr/bin/python
-#
-# Checks C++ files to make sure they conform to LLVM standards, as specified in
-# http://llvm.org/docs/CodingStandards.html .
-#
-# TODO: add unittests for the verifier functions:
-# http://docs.python.org/library/unittest.html .
-
-import common_lint
-import re
-import sys
-
-def VerifyIncludes(filename, lines):
- """Makes sure the #includes are in proper order and no disallows files are
- #included.
-
- Args:
- filename: the file under consideration as string
- lines: contents of the file as string array
- """
- lint = []
-
- include_gtest_re = re.compile(r'^#include "gtest/(.*)"')
- include_llvm_re = re.compile(r'^#include "llvm/(.*)"')
- include_support_re = re.compile(r'^#include "(Support/.*)"')
- include_config_re = re.compile(r'^#include "(Config/.*)"')
- include_system_re = re.compile(r'^#include <(.*)>')
-
- DISALLOWED_SYSTEM_HEADERS = ['iostream']
-
- line_num = 1
- prev_config_header = None
- prev_system_header = None
- for line in lines:
- # TODO: implement private headers
- # TODO: implement gtest headers
- # TODO: implement top-level llvm/* headers
- # TODO: implement llvm/Support/* headers
-
- # Process Config/* headers
- config_header = include_config_re.match(line)
- if config_header:
- curr_config_header = config_header.group(1)
- if prev_config_header:
- if prev_config_header > curr_config_header:
- lint.append((filename, line_num,
- 'Config headers not in order: "%s" before "%s"' % (
- prev_config_header, curr_config_header)))
-
- # Process system headers
- system_header = include_system_re.match(line)
- if system_header:
- curr_system_header = system_header.group(1)
-
- # Is it blacklisted?
- if curr_system_header in DISALLOWED_SYSTEM_HEADERS:
- lint.append((filename, line_num,
- 'Disallowed system header: <%s>' % curr_system_header))
- elif prev_system_header:
- # Make sure system headers are alphabetized amongst themselves
- if prev_system_header > curr_system_header:
- lint.append((filename, line_num,
- 'System headers not in order: <%s> before <%s>' % (
- prev_system_header, curr_system_header)))
-
- prev_system_header = curr_system_header
-
- line_num += 1
-
- return lint
-
-
-class CppLint(common_lint.BaseLint):
- MAX_LINE_LENGTH = 80
-
- def RunOnFile(self, filename, lines):
- lint = []
- lint.extend(VerifyIncludes(filename, lines))
- lint.extend(common_lint.VerifyLineLength(filename, lines,
- CppLint.MAX_LINE_LENGTH))
- lint.extend(common_lint.VerifyTabs(filename, lines))
- lint.extend(common_lint.VerifyTrailingWhitespace(filename, lines))
- return lint
-
-
-def CppLintMain(filenames):
- all_lint = common_lint.RunLintOverAllFiles(CppLint(), filenames)
- for lint in all_lint:
- print '%s:%d:%s' % (lint[0], lint[1], lint[2])
- return 0
-
-
-if __name__ == '__main__':
- sys.exit(CppLintMain(sys.argv[1:]))
diff --git a/contrib/llvm/utils/lint/generic_lint.py b/contrib/llvm/utils/lint/generic_lint.py
deleted file mode 100755
index c8f4835..0000000
--- a/contrib/llvm/utils/lint/generic_lint.py
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/python
-#
-# Checks files to make sure they conform to LLVM standards which can be applied
-# to any programming language: at present, line length and trailing whitespace.
-
-import common_lint
-import sys
-
-class GenericCodeLint(common_lint.BaseLint):
- MAX_LINE_LENGTH = 80
-
- def RunOnFile(self, filename, lines):
- common_lint.VerifyLineLength(filename, lines,
- GenericCodeLint.MAX_LINE_LENGTH)
- common_lint.VerifyTrailingWhitespace(filename, lines)
-
-
-def GenericCodeLintMain(filenames):
- common_lint.RunLintOverAllFiles(GenericCodeLint(), filenames)
- return 0
-
-
-if __name__ == '__main__':
- sys.exit(GenericCodeLintMain(sys.argv[1:]))
diff --git a/contrib/llvm/utils/lint/remove_trailing_whitespace.sh b/contrib/llvm/utils/lint/remove_trailing_whitespace.sh
deleted file mode 100755
index 6e0c9be..0000000
--- a/contrib/llvm/utils/lint/remove_trailing_whitespace.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-# Deletes trailing whitespace in-place in the passed-in files.
-# Sample syntax:
-# $0 *.cpp
-
-perl -pi -e 's/\s+$/\n/' $*
diff --git a/contrib/llvm/utils/lit/TODO b/contrib/llvm/utils/lit/TODO
deleted file mode 100644
index 4d00d2c..0000000
--- a/contrib/llvm/utils/lit/TODO
+++ /dev/null
@@ -1,19 +0,0 @@
- - Move temp directory name into local test config.
-
- - Add --show-unsupported, don't show by default?
-
- - Finish documentation.
-
- - Optionally use multiprocessing.
-
- - Support llvmc and ocaml tests.
-
- - Support valgrind in all configs, and LLVM style valgrind.
-
- - Provide test suite config for running unit tests.
-
- - Support a timeout / ulimit.
-
- - Support "disabling" tests? The advantage of making this distinct from XFAIL
- is it makes it more obvious that it is a temporary measure (and lit can put
- in a separate category).
diff --git a/contrib/llvm/utils/lit/lit.py b/contrib/llvm/utils/lit/lit.py
deleted file mode 100755
index 851063b..0000000
--- a/contrib/llvm/utils/lit/lit.py
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env python
-
-if __name__=='__main__':
- import lit
- lit.main()
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests.ObjDir/lit.site.cfg b/contrib/llvm/utils/lit/lit/ExampleTests.ObjDir/lit.site.cfg
deleted file mode 100644
index 14b6e01..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests.ObjDir/lit.site.cfg
+++ /dev/null
@@ -1,15 +0,0 @@
-# -*- Python -*-
-
-# Site specific configuration file.
-#
-# Typically this will be generated by the build system to automatically set
-# certain configuration variables which cannot be autodetected, so that 'lit'
-# can easily be used on the command line.
-
-import os
-
-# Preserve the obj_root, for use by the main lit.cfg.
-config.example_obj_root = os.path.dirname(__file__)
-
-lit.load_config(config, os.path.join(config.test_source_root,
- 'lit.cfg'))
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/Clang/fsyntax-only.c b/contrib/llvm/utils/lit/lit/ExampleTests/Clang/fsyntax-only.c
deleted file mode 100644
index a4a064b..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/Clang/fsyntax-only.c
+++ /dev/null
@@ -1,4 +0,0 @@
-// RUN: clang -fsyntax-only -Xclang -verify %s
-
-int f0(void) {} // expected-warning {{control reaches end of non-void function}}
-
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/Clang/lit.cfg b/contrib/llvm/utils/lit/lit/ExampleTests/Clang/lit.cfg
deleted file mode 100644
index 1e1e807..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/Clang/lit.cfg
+++ /dev/null
@@ -1,47 +0,0 @@
-# -*- Python -*-
-
-# Configuration file for the 'lit' test runner.
-
-# name: The name of this test suite.
-config.name = 'Clang'
-
-# testFormat: The test format to use to interpret tests.
-#
-# For now we require '&&' between commands, until they get globally killed and
-# the test runner updated.
-config.test_format = lit.formats.ShTest(execute_external = True)
-
-# suffixes: A list of file extensions to treat as test files.
-config.suffixes = ['.c', '.cpp', '.m', '.mm']
-
-# target_triple: Used by ShTest and TclTest formats for XFAIL checks.
-config.target_triple = 'foo'
-
-###
-
-# Discover the 'clang' and 'clangcc' to use.
-
-import os
-
-def inferClang(PATH):
- # Determine which clang to use.
- clang = os.getenv('CLANG')
-
- # If the user set clang in the environment, definitely use that and don't
- # try to validate.
- if clang:
- return clang
-
- # Otherwise look in the path.
- clang = lit.util.which('clang', PATH)
-
- if not clang:
- lit.fatal("couldn't find 'clang' program, try setting "
- "CLANG in your environment")
-
- return clang
-
-clang = inferClang(config.environment['PATH'])
-if not lit.quiet:
- lit.note('using clang: %r' % clang)
-config.substitutions.append( (' clang ', ' ' + clang + ' ') )
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.InTree/test/Bar/bar-test.ll b/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.InTree/test/Bar/bar-test.ll
deleted file mode 100644
index 3017b13..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.InTree/test/Bar/bar-test.ll
+++ /dev/null
@@ -1,3 +0,0 @@
-; RUN: true
-; XFAIL: *
-; XTARGET: darwin
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.InTree/test/Bar/dg.exp b/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.InTree/test/Bar/dg.exp
deleted file mode 100644
index 2bda07a..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.InTree/test/Bar/dg.exp
+++ /dev/null
@@ -1,6 +0,0 @@
-load_lib llvm.exp
-
-if { [llvm_supports_target X86] } {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll}]]
-}
-
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.InTree/test/lit.cfg b/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.InTree/test/lit.cfg
deleted file mode 100644
index e7ef037..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.InTree/test/lit.cfg
+++ /dev/null
@@ -1,151 +0,0 @@
-# -*- Python -*-
-
-# Configuration file for the 'lit' test runner.
-
-import os
-
-# name: The name of this test suite.
-config.name = 'LLVM'
-
-# testFormat: The test format to use to interpret tests.
-config.test_format = lit.formats.TclTest()
-
-# suffixes: A list of file extensions to treat as test files, this is actually
-# set by on_clone().
-config.suffixes = []
-
-# 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.
-llvm_obj_root = getattr(config, 'llvm_obj_root', None)
-if llvm_obj_root is not None:
- config.test_exec_root = os.path.join(llvm_obj_root, 'test')
-
-###
-
-import os
-
-# Check that the object root is known.
-if config.test_exec_root is None:
- # Otherwise, we haven't loaded the site specific configuration (the user is
- # probably trying to run on a test file directly, and either the site
- # configuration hasn't been created by the build system, or we are in an
- # out-of-tree build situation).
-
- # Try to detect the situation where we are using an out-of-tree build by
- # looking for 'llvm-config'.
- #
- # FIXME: I debated (i.e., wrote and threw away) adding logic to
- # automagically generate the lit.site.cfg if we are in some kind of fresh
- # build situation. This means knowing how to invoke the build system
- # though, and I decided it was too much magic.
-
- llvm_config = lit.util.which('llvm-config', config.environment['PATH'])
- if not llvm_config:
- lit.fatal('No site specific configuration available!')
-
- # Get the source and object roots.
- llvm_src_root = lit.util.capture(['llvm-config', '--src-root']).strip()
- llvm_obj_root = lit.util.capture(['llvm-config', '--obj-root']).strip()
-
- # Validate that we got a tree which points to here.
- this_src_root = os.path.dirname(config.test_source_root)
- if os.path.realpath(llvm_src_root) != os.path.realpath(this_src_root):
- lit.fatal('No site specific configuration available!')
-
- # Check that the site specific configuration exists.
- site_cfg = os.path.join(llvm_obj_root, 'test', 'lit.site.cfg')
- if not os.path.exists(site_cfg):
- lit.fatal('No site specific configuration available!')
-
- # Okay, that worked. Notify the user of the automagic, and reconfigure.
- lit.note('using out-of-tree build at %r' % llvm_obj_root)
- lit.load_config(config, site_cfg)
- raise SystemExit
-
-###
-
-# Load site data from DejaGNU's site.exp.
-import re
-site_exp = {}
-# FIXME: Implement lit.site.cfg.
-for line in open(os.path.join(config.llvm_obj_root, 'test', 'site.exp')):
- m = re.match('set ([^ ]+) "([^"]*)"', line)
- if m:
- site_exp[m.group(1)] = m.group(2)
-
-# Add substitutions.
-for sub in ['prcontext', 'llvmgcc', 'llvmgxx', 'compile_cxx', 'compile_c',
- 'link', 'shlibext', 'ocamlopt', 'llvmdsymutil', 'llvmlibsdir',
- 'bugpoint_topts']:
- if sub in ('llvmgcc', 'llvmgxx'):
- config.substitutions.append(('%' + sub,
- site_exp[sub] + ' -emit-llvm -w'))
- else:
- config.substitutions.append(('%' + sub, site_exp[sub]))
-
-excludes = []
-
-# Provide target_triple for use in XFAIL and XTARGET.
-config.target_triple = site_exp['target_triplet']
-
-# Provide llvm_supports_target for use in local configs.
-targets = set(site_exp["TARGETS_TO_BUILD"].split())
-def llvm_supports_target(name):
- return name in targets
-
-langs = set(site_exp['llvmgcc_langs'].split(','))
-def llvm_gcc_supports(name):
- return name in langs
-
-# Provide on_clone hook for reading 'dg.exp'.
-import os
-simpleLibData = re.compile(r"""load_lib llvm.exp
-
-RunLLVMTests \[lsort \[glob -nocomplain \$srcdir/\$subdir/\*\.(.*)\]\]""",
- re.MULTILINE)
-conditionalLibData = re.compile(r"""load_lib llvm.exp
-
-if.*\[ ?(llvm[^ ]*) ([^ ]*) ?\].*{
- *RunLLVMTests \[lsort \[glob -nocomplain \$srcdir/\$subdir/\*\.(.*)\]\]
-\}""", re.MULTILINE)
-def on_clone(parent, cfg, for_path):
- def addSuffixes(match):
- if match[0] == '{' and match[-1] == '}':
- cfg.suffixes = ['.' + s for s in match[1:-1].split(',')]
- else:
- cfg.suffixes = ['.' + match]
-
- libPath = os.path.join(os.path.dirname(for_path),
- 'dg.exp')
- if not os.path.exists(libPath):
- cfg.unsupported = True
- return
-
- # Reset unsupported, in case we inherited it.
- cfg.unsupported = False
- lib = open(libPath).read().strip()
-
- # Check for a simple library.
- m = simpleLibData.match(lib)
- if m:
- addSuffixes(m.group(1))
- return
-
- # Check for a conditional test set.
- m = conditionalLibData.match(lib)
- if m:
- funcname,arg,match = m.groups()
- addSuffixes(match)
-
- func = globals().get(funcname)
- if not func:
- lit.error('unsupported predicate %r' % funcname)
- elif not func(arg):
- cfg.unsupported = True
- return
- # Otherwise, give up.
- lit.error('unable to understand %r:\n%s' % (libPath, lib))
-
-config.on_clone = on_clone
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.InTree/test/lit.site.cfg b/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.InTree/test/lit.site.cfg
deleted file mode 100644
index 3bfee54..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.InTree/test/lit.site.cfg
+++ /dev/null
@@ -1,10 +0,0 @@
-# -*- Python -*-
-
-## Autogenerated by Makefile ##
-# Do not edit!
-
-# Preserve some key paths for use by main LLVM test suite config.
-config.llvm_obj_root = os.path.dirname(os.path.dirname(__file__))
-
-# Let the main config do the real work.
-lit.load_config(config, os.path.join(config.llvm_obj_root, 'test/lit.cfg'))
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.InTree/test/site.exp b/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.InTree/test/site.exp
deleted file mode 100644
index efa839e..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.InTree/test/site.exp
+++ /dev/null
@@ -1,28 +0,0 @@
-## these variables are automatically generated by make ##
-# Do not edit here. If you wish to override these values
-# edit the last section
-set target_triplet "x86_64-apple-darwin10"
-set TARGETS_TO_BUILD "X86 Sparc PowerPC Alpha ARM Mips CellSPU PIC16 XCore MSP430 SystemZ Blackfin CBackend MSIL CppBackend"
-set llvmgcc_langs "c,c++,objc,obj-c++"
-set prcontext "/usr/bin/tclsh8.4 /Volumes/Data/ddunbar/llvm/test/Scripts/prcontext.tcl"
-set llvmtoolsdir "/Users/ddunbar/llvm.obj.64/Debug/bin"
-set llvmlibsdir "/Users/ddunbar/llvm.obj.64/Debug/lib"
-set srcroot "/Volumes/Data/ddunbar/llvm"
-set objroot "/Volumes/Data/ddunbar/llvm.obj.64"
-set srcdir "/Volumes/Data/ddunbar/llvm/test"
-set objdir "/Volumes/Data/ddunbar/llvm.obj.64/test"
-set gccpath "/usr/bin/gcc -arch x86_64"
-set gxxpath "/usr/bin/g++ -arch x86_64"
-set compile_c " /usr/bin/gcc -arch x86_64 -I/Users/ddunbar/llvm.obj.64/include -I/Users/ddunbar/llvm.obj.64/test -I/Volumes/Data/ddunbar/llvm.obj.64/include -I/Volumes/Data/ddunbar/llvm/include -I/Volumes/Data/ddunbar/llvm/test -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -m64 -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -c "
-set compile_cxx " /usr/bin/g++ -arch x86_64 -I/Users/ddunbar/llvm.obj.64/include -I/Users/ddunbar/llvm.obj.64/test -I/Volumes/Data/ddunbar/llvm.obj.64/include -I/Volumes/Data/ddunbar/llvm/include -I/Volumes/Data/ddunbar/llvm/test -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -g -fno-exceptions -fno-common -Woverloaded-virtual -m64 -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -c "
-set link " /usr/bin/g++ -arch x86_64 -I/Users/ddunbar/llvm.obj.64/include -I/Users/ddunbar/llvm.obj.64/test -I/Volumes/Data/ddunbar/llvm.obj.64/include -I/Volumes/Data/ddunbar/llvm/include -I/Volumes/Data/ddunbar/llvm/test -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -g -fno-exceptions -fno-common -Woverloaded-virtual -m64 -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -g -L/Users/ddunbar/llvm.obj.64/Debug/lib -L/Volumes/Data/ddunbar/llvm.obj.64/Debug/lib "
-set llvmgcc "/Users/ddunbar/llvm-gcc/install/bin/llvm-gcc -m64 "
-set llvmgxx "/Users/ddunbar/llvm-gcc/install/bin/llvm-gcc -m64 "
-set bugpoint_topts "-gcc-tool-args -m64"
-set shlibext ".dylib"
-set ocamlopt "/sw/bin/ocamlopt -cc \"g++ -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT\" -I /Users/ddunbar/llvm.obj.64/Debug/lib/ocaml"
-set valgrind ""
-set grep "/usr/bin/grep"
-set gas "/usr/bin/as"
-set llvmdsymutil "dsymutil"
-## All variables above are generated by configure. Do Not Edit ##
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/lit.local.cfg b/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/lit.local.cfg
deleted file mode 100644
index 80d0c7e..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/lit.local.cfg
+++ /dev/null
@@ -1 +0,0 @@
-config.excludes = ['src']
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/obj/test/Foo/lit.local.cfg b/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/obj/test/Foo/lit.local.cfg
deleted file mode 100644
index e69de29..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/obj/test/Foo/lit.local.cfg
+++ /dev/null
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/obj/test/lit.site.cfg b/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/obj/test/lit.site.cfg
deleted file mode 100644
index bdcc35e..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/obj/test/lit.site.cfg
+++ /dev/null
@@ -1,11 +0,0 @@
-# -*- Python -*-
-
-## Autogenerated by Makefile ##
-# Do not edit!
-
-# Preserve some key paths for use by main LLVM test suite config.
-config.llvm_obj_root = os.path.dirname(os.path.dirname(__file__))
-
-# Let the main config do the real work.
-lit.load_config(config, os.path.join(config.llvm_obj_root,
- '../src/test/lit.cfg'))
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/obj/test/site.exp b/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/obj/test/site.exp
deleted file mode 100644
index efa839e..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/obj/test/site.exp
+++ /dev/null
@@ -1,28 +0,0 @@
-## these variables are automatically generated by make ##
-# Do not edit here. If you wish to override these values
-# edit the last section
-set target_triplet "x86_64-apple-darwin10"
-set TARGETS_TO_BUILD "X86 Sparc PowerPC Alpha ARM Mips CellSPU PIC16 XCore MSP430 SystemZ Blackfin CBackend MSIL CppBackend"
-set llvmgcc_langs "c,c++,objc,obj-c++"
-set prcontext "/usr/bin/tclsh8.4 /Volumes/Data/ddunbar/llvm/test/Scripts/prcontext.tcl"
-set llvmtoolsdir "/Users/ddunbar/llvm.obj.64/Debug/bin"
-set llvmlibsdir "/Users/ddunbar/llvm.obj.64/Debug/lib"
-set srcroot "/Volumes/Data/ddunbar/llvm"
-set objroot "/Volumes/Data/ddunbar/llvm.obj.64"
-set srcdir "/Volumes/Data/ddunbar/llvm/test"
-set objdir "/Volumes/Data/ddunbar/llvm.obj.64/test"
-set gccpath "/usr/bin/gcc -arch x86_64"
-set gxxpath "/usr/bin/g++ -arch x86_64"
-set compile_c " /usr/bin/gcc -arch x86_64 -I/Users/ddunbar/llvm.obj.64/include -I/Users/ddunbar/llvm.obj.64/test -I/Volumes/Data/ddunbar/llvm.obj.64/include -I/Volumes/Data/ddunbar/llvm/include -I/Volumes/Data/ddunbar/llvm/test -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -m64 -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -c "
-set compile_cxx " /usr/bin/g++ -arch x86_64 -I/Users/ddunbar/llvm.obj.64/include -I/Users/ddunbar/llvm.obj.64/test -I/Volumes/Data/ddunbar/llvm.obj.64/include -I/Volumes/Data/ddunbar/llvm/include -I/Volumes/Data/ddunbar/llvm/test -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -g -fno-exceptions -fno-common -Woverloaded-virtual -m64 -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -c "
-set link " /usr/bin/g++ -arch x86_64 -I/Users/ddunbar/llvm.obj.64/include -I/Users/ddunbar/llvm.obj.64/test -I/Volumes/Data/ddunbar/llvm.obj.64/include -I/Volumes/Data/ddunbar/llvm/include -I/Volumes/Data/ddunbar/llvm/test -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -g -fno-exceptions -fno-common -Woverloaded-virtual -m64 -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -g -L/Users/ddunbar/llvm.obj.64/Debug/lib -L/Volumes/Data/ddunbar/llvm.obj.64/Debug/lib "
-set llvmgcc "/Users/ddunbar/llvm-gcc/install/bin/llvm-gcc -m64 "
-set llvmgxx "/Users/ddunbar/llvm-gcc/install/bin/llvm-gcc -m64 "
-set bugpoint_topts "-gcc-tool-args -m64"
-set shlibext ".dylib"
-set ocamlopt "/sw/bin/ocamlopt -cc \"g++ -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT\" -I /Users/ddunbar/llvm.obj.64/Debug/lib/ocaml"
-set valgrind ""
-set grep "/usr/bin/grep"
-set gas "/usr/bin/as"
-set llvmdsymutil "dsymutil"
-## All variables above are generated by configure. Do Not Edit ##
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/src/test/Foo/data.txt b/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/src/test/Foo/data.txt
deleted file mode 100644
index 45b983b..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/src/test/Foo/data.txt
+++ /dev/null
@@ -1 +0,0 @@
-hi
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/src/test/Foo/dg.exp b/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/src/test/Foo/dg.exp
deleted file mode 100644
index 2bda07a..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/src/test/Foo/dg.exp
+++ /dev/null
@@ -1,6 +0,0 @@
-load_lib llvm.exp
-
-if { [llvm_supports_target X86] } {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll}]]
-}
-
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/src/test/Foo/pct-S.ll b/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/src/test/Foo/pct-S.ll
deleted file mode 100644
index 3ff3633..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/src/test/Foo/pct-S.ll
+++ /dev/null
@@ -1 +0,0 @@
-; RUN: grep "hi" %S/data.txt
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/src/test/lit.cfg b/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/src/test/lit.cfg
deleted file mode 100644
index e7ef037..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/LLVM.OutOfTree/src/test/lit.cfg
+++ /dev/null
@@ -1,151 +0,0 @@
-# -*- Python -*-
-
-# Configuration file for the 'lit' test runner.
-
-import os
-
-# name: The name of this test suite.
-config.name = 'LLVM'
-
-# testFormat: The test format to use to interpret tests.
-config.test_format = lit.formats.TclTest()
-
-# suffixes: A list of file extensions to treat as test files, this is actually
-# set by on_clone().
-config.suffixes = []
-
-# 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.
-llvm_obj_root = getattr(config, 'llvm_obj_root', None)
-if llvm_obj_root is not None:
- config.test_exec_root = os.path.join(llvm_obj_root, 'test')
-
-###
-
-import os
-
-# Check that the object root is known.
-if config.test_exec_root is None:
- # Otherwise, we haven't loaded the site specific configuration (the user is
- # probably trying to run on a test file directly, and either the site
- # configuration hasn't been created by the build system, or we are in an
- # out-of-tree build situation).
-
- # Try to detect the situation where we are using an out-of-tree build by
- # looking for 'llvm-config'.
- #
- # FIXME: I debated (i.e., wrote and threw away) adding logic to
- # automagically generate the lit.site.cfg if we are in some kind of fresh
- # build situation. This means knowing how to invoke the build system
- # though, and I decided it was too much magic.
-
- llvm_config = lit.util.which('llvm-config', config.environment['PATH'])
- if not llvm_config:
- lit.fatal('No site specific configuration available!')
-
- # Get the source and object roots.
- llvm_src_root = lit.util.capture(['llvm-config', '--src-root']).strip()
- llvm_obj_root = lit.util.capture(['llvm-config', '--obj-root']).strip()
-
- # Validate that we got a tree which points to here.
- this_src_root = os.path.dirname(config.test_source_root)
- if os.path.realpath(llvm_src_root) != os.path.realpath(this_src_root):
- lit.fatal('No site specific configuration available!')
-
- # Check that the site specific configuration exists.
- site_cfg = os.path.join(llvm_obj_root, 'test', 'lit.site.cfg')
- if not os.path.exists(site_cfg):
- lit.fatal('No site specific configuration available!')
-
- # Okay, that worked. Notify the user of the automagic, and reconfigure.
- lit.note('using out-of-tree build at %r' % llvm_obj_root)
- lit.load_config(config, site_cfg)
- raise SystemExit
-
-###
-
-# Load site data from DejaGNU's site.exp.
-import re
-site_exp = {}
-# FIXME: Implement lit.site.cfg.
-for line in open(os.path.join(config.llvm_obj_root, 'test', 'site.exp')):
- m = re.match('set ([^ ]+) "([^"]*)"', line)
- if m:
- site_exp[m.group(1)] = m.group(2)
-
-# Add substitutions.
-for sub in ['prcontext', 'llvmgcc', 'llvmgxx', 'compile_cxx', 'compile_c',
- 'link', 'shlibext', 'ocamlopt', 'llvmdsymutil', 'llvmlibsdir',
- 'bugpoint_topts']:
- if sub in ('llvmgcc', 'llvmgxx'):
- config.substitutions.append(('%' + sub,
- site_exp[sub] + ' -emit-llvm -w'))
- else:
- config.substitutions.append(('%' + sub, site_exp[sub]))
-
-excludes = []
-
-# Provide target_triple for use in XFAIL and XTARGET.
-config.target_triple = site_exp['target_triplet']
-
-# Provide llvm_supports_target for use in local configs.
-targets = set(site_exp["TARGETS_TO_BUILD"].split())
-def llvm_supports_target(name):
- return name in targets
-
-langs = set(site_exp['llvmgcc_langs'].split(','))
-def llvm_gcc_supports(name):
- return name in langs
-
-# Provide on_clone hook for reading 'dg.exp'.
-import os
-simpleLibData = re.compile(r"""load_lib llvm.exp
-
-RunLLVMTests \[lsort \[glob -nocomplain \$srcdir/\$subdir/\*\.(.*)\]\]""",
- re.MULTILINE)
-conditionalLibData = re.compile(r"""load_lib llvm.exp
-
-if.*\[ ?(llvm[^ ]*) ([^ ]*) ?\].*{
- *RunLLVMTests \[lsort \[glob -nocomplain \$srcdir/\$subdir/\*\.(.*)\]\]
-\}""", re.MULTILINE)
-def on_clone(parent, cfg, for_path):
- def addSuffixes(match):
- if match[0] == '{' and match[-1] == '}':
- cfg.suffixes = ['.' + s for s in match[1:-1].split(',')]
- else:
- cfg.suffixes = ['.' + match]
-
- libPath = os.path.join(os.path.dirname(for_path),
- 'dg.exp')
- if not os.path.exists(libPath):
- cfg.unsupported = True
- return
-
- # Reset unsupported, in case we inherited it.
- cfg.unsupported = False
- lib = open(libPath).read().strip()
-
- # Check for a simple library.
- m = simpleLibData.match(lib)
- if m:
- addSuffixes(m.group(1))
- return
-
- # Check for a conditional test set.
- m = conditionalLibData.match(lib)
- if m:
- funcname,arg,match = m.groups()
- addSuffixes(match)
-
- func = globals().get(funcname)
- if not func:
- lit.error('unsupported predicate %r' % funcname)
- elif not func(arg):
- cfg.unsupported = True
- return
- # Otherwise, give up.
- lit.error('unable to understand %r:\n%s' % (libPath, lib))
-
-config.on_clone = on_clone
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/ShExternal/lit.local.cfg b/contrib/llvm/utils/lit/lit/ExampleTests/ShExternal/lit.local.cfg
deleted file mode 100644
index 1061da6..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/ShExternal/lit.local.cfg
+++ /dev/null
@@ -1,6 +0,0 @@
-# -*- Python -*-
-
-config.test_format = lit.formats.ShTest(execute_external = True)
-
-config.suffixes = ['.c']
-
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/ShInternal/lit.local.cfg b/contrib/llvm/utils/lit/lit/ExampleTests/ShInternal/lit.local.cfg
deleted file mode 100644
index 448eaa4..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/ShInternal/lit.local.cfg
+++ /dev/null
@@ -1,6 +0,0 @@
-# -*- Python -*-
-
-config.test_format = lit.formats.ShTest(execute_external = False)
-
-config.suffixes = ['.c']
-
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/TclTest/lit.local.cfg b/contrib/llvm/utils/lit/lit/ExampleTests/TclTest/lit.local.cfg
deleted file mode 100644
index 6a37129..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/TclTest/lit.local.cfg
+++ /dev/null
@@ -1,5 +0,0 @@
-# -*- Python -*-
-
-config.test_format = lit.formats.TclTest()
-
-config.suffixes = ['.ll']
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/TclTest/stderr-pipe.ll b/contrib/llvm/utils/lit/lit/ExampleTests/TclTest/stderr-pipe.ll
deleted file mode 100644
index 6c55fe8..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/TclTest/stderr-pipe.ll
+++ /dev/null
@@ -1 +0,0 @@
-; RUN: gcc -### > /dev/null |& grep {gcc version}
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/TclTest/tcl-redir-1.ll b/contrib/llvm/utils/lit/lit/ExampleTests/TclTest/tcl-redir-1.ll
deleted file mode 100644
index 61240ba..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/TclTest/tcl-redir-1.ll
+++ /dev/null
@@ -1,7 +0,0 @@
-; RUN: echo 'hi' > %t.1 | echo 'hello' > %t.2
-; RUN: not grep 'hi' %t.1
-; RUN: grep 'hello' %t.2
-
-
-
-
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/fail.c b/contrib/llvm/utils/lit/lit/ExampleTests/fail.c
deleted file mode 100644
index 84db41a..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/fail.c
+++ /dev/null
@@ -1,2 +0,0 @@
-// RUN: echo 'I am some stdout'
-// RUN: false
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/lit.cfg b/contrib/llvm/utils/lit/lit/ExampleTests/lit.cfg
deleted file mode 100644
index 20ee37d..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/lit.cfg
+++ /dev/null
@@ -1,26 +0,0 @@
-# -*- Python -*-
-
-# Configuration file for the 'lit' test runner.
-
-# name: The name of this test suite.
-config.name = 'Examples'
-
-# suffixes: A list of file extensions to treat as test files.
-config.suffixes = ['.c', '.cpp', '.m', '.mm', '.ll']
-
-# testFormat: The test format to use to interpret tests.
-config.test_format = lit.formats.ShTest()
-
-# test_source_root: The path where tests are located (default is the test suite
-# root).
-config.test_source_root = None
-
-# test_exec_root: The path where tests are located (default is the test suite
-# root).
-config.test_exec_root = None
-
-# target_triple: Used by ShTest and TclTest formats for XFAIL checks.
-config.target_triple = 'foo'
-
-# available_features: Used by ShTest and TclTest formats for REQUIRES checks.
-config.available_features = ['some-feature-name']
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/pass.c b/contrib/llvm/utils/lit/lit/ExampleTests/pass.c
deleted file mode 100644
index 5c1031c..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/pass.c
+++ /dev/null
@@ -1 +0,0 @@
-// RUN: true
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/required-and-missing.c b/contrib/llvm/utils/lit/lit/ExampleTests/required-and-missing.c
deleted file mode 100644
index 47ba72e..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/required-and-missing.c
+++ /dev/null
@@ -1,4 +0,0 @@
-// This test shouldn't be run, the required feature is missing.
-//
-// RUN: false
-// REQUIRES: some-missing-feature-name
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/required-and-present.c b/contrib/llvm/utils/lit/lit/ExampleTests/required-and-present.c
deleted file mode 100644
index 2a09e08..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/required-and-present.c
+++ /dev/null
@@ -1,2 +0,0 @@
-// RUN: true
-// REQUIRES: some-feature-name
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/xfail.c b/contrib/llvm/utils/lit/lit/ExampleTests/xfail.c
deleted file mode 100644
index b36cd99..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/xfail.c
+++ /dev/null
@@ -1,2 +0,0 @@
-// RUN: false
-// XFAIL: *
diff --git a/contrib/llvm/utils/lit/lit/ExampleTests/xpass.c b/contrib/llvm/utils/lit/lit/ExampleTests/xpass.c
deleted file mode 100644
index ad84990..0000000
--- a/contrib/llvm/utils/lit/lit/ExampleTests/xpass.c
+++ /dev/null
@@ -1,2 +0,0 @@
-// RUN: true
-// XFAIL
diff --git a/contrib/llvm/utils/lit/lit/LitConfig.py b/contrib/llvm/utils/lit/lit/LitConfig.py
deleted file mode 100644
index ac48591..0000000
--- a/contrib/llvm/utils/lit/lit/LitConfig.py
+++ /dev/null
@@ -1,112 +0,0 @@
-class LitConfig:
- """LitConfig - Configuration data for a 'lit' test runner instance, shared
- across all tests.
-
- The LitConfig object is also used to communicate with client configuration
- files, it is always passed in as the global variable 'lit' so that
- configuration files can access common functionality and internal components
- easily.
- """
-
- # Provide access to built-in formats.
- import LitFormats as formats
-
- # Provide access to built-in utility functions.
- import Util as util
-
- def __init__(self, progname, path, quiet,
- useValgrind, valgrindLeakCheck, valgrindArgs,
- useTclAsSh,
- noExecute, debug, isWindows,
- params):
- # The name of the test runner.
- self.progname = progname
- # The items to add to the PATH environment variable.
- self.path = list(map(str, path))
- self.quiet = bool(quiet)
- self.useValgrind = bool(useValgrind)
- self.valgrindLeakCheck = bool(valgrindLeakCheck)
- self.valgrindUserArgs = list(valgrindArgs)
- self.useTclAsSh = bool(useTclAsSh)
- self.noExecute = noExecute
- self.debug = debug
- self.isWindows = bool(isWindows)
- self.params = dict(params)
- self.bashPath = None
-
- self.numErrors = 0
- self.numWarnings = 0
-
- self.valgrindArgs = []
- self.valgrindTriple = ""
- if self.useValgrind:
- self.valgrindTriple = "-vg"
- self.valgrindArgs = ['valgrind', '-q', '--run-libc-freeres=no',
- '--tool=memcheck', '--trace-children=yes',
- '--error-exitcode=123']
- if self.valgrindLeakCheck:
- self.valgrindTriple += "_leak"
- self.valgrindArgs.append('--leak-check=full')
- else:
- # The default is 'summary'.
- self.valgrindArgs.append('--leak-check=no')
- self.valgrindArgs.extend(self.valgrindUserArgs)
-
-
- def load_config(self, config, path):
- """load_config(config, path) - Load a config object from an alternate
- path."""
- from TestingConfig import TestingConfig
- return TestingConfig.frompath(path, config.parent, self,
- mustExist = True,
- config = config)
-
- def getBashPath(self):
- """getBashPath - Get the path to 'bash'"""
- import os, Util
-
- if self.bashPath is not None:
- return self.bashPath
-
- self.bashPath = Util.which('bash', os.pathsep.join(self.path))
- if self.bashPath is None:
- # Check some known paths.
- for path in ('/bin/bash', '/usr/bin/bash', '/usr/local/bin/bash'):
- if os.path.exists(path):
- self.bashPath = path
- break
-
- if self.bashPath is None:
- self.warning("Unable to find 'bash', running Tcl tests internally.")
- self.bashPath = ''
-
- return self.bashPath
-
- def _write_message(self, kind, message):
- import inspect, os, sys
-
- # Get the file/line where this message was generated.
- f = inspect.currentframe()
- # Step out of _write_message, and then out of wrapper.
- f = f.f_back.f_back
- file,line,_,_,_ = inspect.getframeinfo(f)
- location = '%s:%d' % (os.path.basename(file), line)
-
- print >>sys.stderr, '%s: %s: %s: %s' % (self.progname, location,
- kind, message)
-
- def note(self, message):
- self._write_message('note', message)
-
- def warning(self, message):
- self._write_message('warning', message)
- self.numWarnings += 1
-
- def error(self, message):
- self._write_message('error', message)
- self.numErrors += 1
-
- def fatal(self, message):
- import sys
- self._write_message('fatal', message)
- sys.exit(2)
diff --git a/contrib/llvm/utils/lit/lit/LitFormats.py b/contrib/llvm/utils/lit/lit/LitFormats.py
deleted file mode 100644
index e86f103..0000000
--- a/contrib/llvm/utils/lit/lit/LitFormats.py
+++ /dev/null
@@ -1,2 +0,0 @@
-from TestFormats import GoogleTest, ShTest, TclTest
-from TestFormats import SyntaxCheckTest, OneCommandPerFileTest
diff --git a/contrib/llvm/utils/lit/lit/LitTestCase.py b/contrib/llvm/utils/lit/lit/LitTestCase.py
deleted file mode 100644
index 8951185..0000000
--- a/contrib/llvm/utils/lit/lit/LitTestCase.py
+++ /dev/null
@@ -1,30 +0,0 @@
-import unittest
-import Test
-
-"""
-TestCase adaptor for providing a 'unittest' compatible interface to 'lit' tests.
-"""
-
-class UnresolvedError(RuntimeError):
- pass
-
-class LitTestCase(unittest.TestCase):
- def __init__(self, test, lit_config):
- unittest.TestCase.__init__(self)
- self._test = test
- self._lit_config = lit_config
-
- def id(self):
- return self._test.getFullName()
-
- def shortDescription(self):
- return self._test.getFullName()
-
- def runTest(self):
- tr, output = self._test.config.test_format.execute(
- self._test, self._lit_config)
-
- if tr is Test.UNRESOLVED:
- raise UnresolvedError(output)
- elif tr.isFailure:
- self.fail(output)
diff --git a/contrib/llvm/utils/lit/lit/ProgressBar.py b/contrib/llvm/utils/lit/lit/ProgressBar.py
deleted file mode 100644
index 85c95f5..0000000
--- a/contrib/llvm/utils/lit/lit/ProgressBar.py
+++ /dev/null
@@ -1,267 +0,0 @@
-#!/usr/bin/env python
-
-# Source: http://code.activestate.com/recipes/475116/, with
-# modifications by Daniel Dunbar.
-
-import sys, re, time
-
-class TerminalController:
- """
- A class that can be used to portably generate formatted output to
- a terminal.
-
- `TerminalController` defines a set of instance variables whose
- values are initialized to the control sequence necessary to
- perform a given action. These can be simply included in normal
- output to the terminal:
-
- >>> term = TerminalController()
- >>> print 'This is '+term.GREEN+'green'+term.NORMAL
-
- Alternatively, the `render()` method can used, which replaces
- '${action}' with the string required to perform 'action':
-
- >>> term = TerminalController()
- >>> print term.render('This is ${GREEN}green${NORMAL}')
-
- If the terminal doesn't support a given action, then the value of
- the corresponding instance variable will be set to ''. As a
- result, the above code will still work on terminals that do not
- support color, except that their output will not be colored.
- Also, this means that you can test whether the terminal supports a
- given action by simply testing the truth value of the
- corresponding instance variable:
-
- >>> term = TerminalController()
- >>> if term.CLEAR_SCREEN:
- ... print 'This terminal supports clearning the screen.'
-
- Finally, if the width and height of the terminal are known, then
- they will be stored in the `COLS` and `LINES` attributes.
- """
- # Cursor movement:
- BOL = '' #: Move the cursor to the beginning of the line
- UP = '' #: Move the cursor up one line
- DOWN = '' #: Move the cursor down one line
- LEFT = '' #: Move the cursor left one char
- RIGHT = '' #: Move the cursor right one char
-
- # Deletion:
- CLEAR_SCREEN = '' #: Clear the screen and move to home position
- CLEAR_EOL = '' #: Clear to the end of the line.
- CLEAR_BOL = '' #: Clear to the beginning of the line.
- CLEAR_EOS = '' #: Clear to the end of the screen
-
- # Output modes:
- BOLD = '' #: Turn on bold mode
- BLINK = '' #: Turn on blink mode
- DIM = '' #: Turn on half-bright mode
- REVERSE = '' #: Turn on reverse-video mode
- NORMAL = '' #: Turn off all modes
-
- # Cursor display:
- HIDE_CURSOR = '' #: Make the cursor invisible
- SHOW_CURSOR = '' #: Make the cursor visible
-
- # Terminal size:
- COLS = None #: Width of the terminal (None for unknown)
- LINES = None #: Height of the terminal (None for unknown)
-
- # Foreground colors:
- BLACK = BLUE = GREEN = CYAN = RED = MAGENTA = YELLOW = WHITE = ''
-
- # Background colors:
- BG_BLACK = BG_BLUE = BG_GREEN = BG_CYAN = ''
- BG_RED = BG_MAGENTA = BG_YELLOW = BG_WHITE = ''
-
- _STRING_CAPABILITIES = """
- BOL=cr UP=cuu1 DOWN=cud1 LEFT=cub1 RIGHT=cuf1
- CLEAR_SCREEN=clear CLEAR_EOL=el CLEAR_BOL=el1 CLEAR_EOS=ed BOLD=bold
- BLINK=blink DIM=dim REVERSE=rev UNDERLINE=smul NORMAL=sgr0
- HIDE_CURSOR=cinvis SHOW_CURSOR=cnorm""".split()
- _COLORS = """BLACK BLUE GREEN CYAN RED MAGENTA YELLOW WHITE""".split()
- _ANSICOLORS = "BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE".split()
-
- def __init__(self, term_stream=sys.stdout):
- """
- Create a `TerminalController` and initialize its attributes
- with appropriate values for the current terminal.
- `term_stream` is the stream that will be used for terminal
- output; if this stream is not a tty, then the terminal is
- assumed to be a dumb terminal (i.e., have no capabilities).
- """
- # Curses isn't available on all platforms
- try: import curses
- except: return
-
- # If the stream isn't a tty, then assume it has no capabilities.
- if not term_stream.isatty(): return
-
- # Check the terminal type. If we fail, then assume that the
- # terminal has no capabilities.
- try: curses.setupterm()
- except: return
-
- # Look up numeric capabilities.
- self.COLS = curses.tigetnum('cols')
- self.LINES = curses.tigetnum('lines')
-
- # Look up string capabilities.
- for capability in self._STRING_CAPABILITIES:
- (attrib, cap_name) = capability.split('=')
- setattr(self, attrib, self._tigetstr(cap_name) or '')
-
- # Colors
- set_fg = self._tigetstr('setf')
- if set_fg:
- for i,color in zip(range(len(self._COLORS)), self._COLORS):
- setattr(self, color, curses.tparm(set_fg, i) or '')
- set_fg_ansi = self._tigetstr('setaf')
- if set_fg_ansi:
- for i,color in zip(range(len(self._ANSICOLORS)), self._ANSICOLORS):
- setattr(self, color, curses.tparm(set_fg_ansi, i) or '')
- set_bg = self._tigetstr('setb')
- if set_bg:
- for i,color in zip(range(len(self._COLORS)), self._COLORS):
- setattr(self, 'BG_'+color, curses.tparm(set_bg, i) or '')
- set_bg_ansi = self._tigetstr('setab')
- if set_bg_ansi:
- for i,color in zip(range(len(self._ANSICOLORS)), self._ANSICOLORS):
- setattr(self, 'BG_'+color, curses.tparm(set_bg_ansi, i) or '')
-
- def _tigetstr(self, cap_name):
- # String capabilities can include "delays" of the form "$<2>".
- # For any modern terminal, we should be able to just ignore
- # these, so strip them out.
- import curses
- cap = curses.tigetstr(cap_name) or ''
- return re.sub(r'\$<\d+>[/*]?', '', cap)
-
- def render(self, template):
- """
- Replace each $-substitutions in the given template string with
- the corresponding terminal control string (if it's defined) or
- '' (if it's not).
- """
- return re.sub(r'\$\$|\${\w+}', self._render_sub, template)
-
- def _render_sub(self, match):
- s = match.group()
- if s == '$$': return s
- else: return getattr(self, s[2:-1])
-
-#######################################################################
-# Example use case: progress bar
-#######################################################################
-
-class SimpleProgressBar:
- """
- A simple progress bar which doesn't need any terminal support.
-
- This prints out a progress bar like:
- 'Header: 0 .. 10.. 20.. ...'
- """
-
- def __init__(self, header):
- self.header = header
- self.atIndex = None
-
- def update(self, percent, message):
- if self.atIndex is None:
- sys.stdout.write(self.header)
- self.atIndex = 0
-
- next = int(percent*50)
- if next == self.atIndex:
- return
-
- for i in range(self.atIndex, next):
- idx = i % 5
- if idx == 0:
- sys.stdout.write('%-2d' % (i*2))
- elif idx == 1:
- pass # Skip second char
- elif idx < 4:
- sys.stdout.write('.')
- else:
- sys.stdout.write(' ')
- sys.stdout.flush()
- self.atIndex = next
-
- def clear(self):
- if self.atIndex is not None:
- sys.stdout.write('\n')
- sys.stdout.flush()
- self.atIndex = None
-
-class ProgressBar:
- """
- A 3-line progress bar, which looks like::
-
- Header
- 20% [===========----------------------------------]
- progress message
-
- The progress bar is colored, if the terminal supports color
- output; and adjusts to the width of the terminal.
- """
- BAR = '%s${GREEN}[${BOLD}%s%s${NORMAL}${GREEN}]${NORMAL}%s\n'
- HEADER = '${BOLD}${CYAN}%s${NORMAL}\n\n'
-
- def __init__(self, term, header, useETA=True):
- self.term = term
- if not (self.term.CLEAR_EOL and self.term.UP and self.term.BOL):
- raise ValueError("Terminal isn't capable enough -- you "
- "should use a simpler progress dispaly.")
- self.width = self.term.COLS or 75
- self.bar = term.render(self.BAR)
- self.header = self.term.render(self.HEADER % header.center(self.width))
- self.cleared = 1 #: true if we haven't drawn the bar yet.
- self.useETA = useETA
- if self.useETA:
- self.startTime = time.time()
- self.update(0, '')
-
- def update(self, percent, message):
- if self.cleared:
- sys.stdout.write(self.header)
- self.cleared = 0
- prefix = '%3d%% ' % (percent*100,)
- suffix = ''
- if self.useETA:
- elapsed = time.time() - self.startTime
- if percent > .0001 and elapsed > 1:
- total = elapsed / percent
- eta = int(total - elapsed)
- h = eta//3600.
- m = (eta//60) % 60
- s = eta % 60
- suffix = ' ETA: %02d:%02d:%02d'%(h,m,s)
- barWidth = self.width - len(prefix) - len(suffix) - 2
- n = int(barWidth*percent)
- if len(message) < self.width:
- message = message + ' '*(self.width - len(message))
- else:
- message = '... ' + message[-(self.width-4):]
- sys.stdout.write(
- self.term.BOL + self.term.UP + self.term.CLEAR_EOL +
- (self.bar % (prefix, '='*n, '-'*(barWidth-n), suffix)) +
- self.term.CLEAR_EOL + message)
-
- def clear(self):
- if not self.cleared:
- sys.stdout.write(self.term.BOL + self.term.CLEAR_EOL +
- self.term.UP + self.term.CLEAR_EOL +
- self.term.UP + self.term.CLEAR_EOL)
- self.cleared = 1
-
-def test():
- import time
- tc = TerminalController()
- p = ProgressBar(tc, 'Tests')
- for i in range(101):
- p.update(i/100., str(i))
- time.sleep(.3)
-
-if __name__=='__main__':
- test()
diff --git a/contrib/llvm/utils/lit/lit/ShCommands.py b/contrib/llvm/utils/lit/lit/ShCommands.py
deleted file mode 100644
index 4550437..0000000
--- a/contrib/llvm/utils/lit/lit/ShCommands.py
+++ /dev/null
@@ -1,85 +0,0 @@
-class Command:
- def __init__(self, args, redirects):
- self.args = list(args)
- self.redirects = list(redirects)
-
- def __repr__(self):
- return 'Command(%r, %r)' % (self.args, self.redirects)
-
- def __cmp__(self, other):
- if not isinstance(other, Command):
- return -1
-
- return cmp((self.args, self.redirects),
- (other.args, other.redirects))
-
- def toShell(self, file):
- for arg in self.args:
- if "'" not in arg:
- quoted = "'%s'" % arg
- elif '"' not in arg and '$' not in arg:
- quoted = '"%s"' % arg
- else:
- raise NotImplementedError,'Unable to quote %r' % arg
- print >>file, quoted,
-
- # For debugging / validation.
- import ShUtil
- dequoted = list(ShUtil.ShLexer(quoted).lex())
- if dequoted != [arg]:
- raise NotImplementedError,'Unable to quote %r' % arg
-
- for r in self.redirects:
- if len(r[0]) == 1:
- print >>file, "%s '%s'" % (r[0][0], r[1]),
- else:
- print >>file, "%s%s '%s'" % (r[0][1], r[0][0], r[1]),
-
-class Pipeline:
- def __init__(self, commands, negate=False, pipe_err=False):
- self.commands = commands
- self.negate = negate
- self.pipe_err = pipe_err
-
- def __repr__(self):
- return 'Pipeline(%r, %r, %r)' % (self.commands, self.negate,
- self.pipe_err)
-
- def __cmp__(self, other):
- if not isinstance(other, Pipeline):
- return -1
-
- return cmp((self.commands, self.negate, self.pipe_err),
- (other.commands, other.negate, self.pipe_err))
-
- def toShell(self, file, pipefail=False):
- if pipefail != self.pipe_err:
- raise ValueError,'Inconsistent "pipefail" attribute!'
- if self.negate:
- print >>file, '!',
- for cmd in self.commands:
- cmd.toShell(file)
- if cmd is not self.commands[-1]:
- print >>file, '|\n ',
-
-class Seq:
- def __init__(self, lhs, op, rhs):
- assert op in (';', '&', '||', '&&')
- self.op = op
- self.lhs = lhs
- self.rhs = rhs
-
- def __repr__(self):
- return 'Seq(%r, %r, %r)' % (self.lhs, self.op, self.rhs)
-
- def __cmp__(self, other):
- if not isinstance(other, Seq):
- return -1
-
- return cmp((self.lhs, self.op, self.rhs),
- (other.lhs, other.op, other.rhs))
-
- def toShell(self, file, pipefail=False):
- self.lhs.toShell(file, pipefail)
- print >>file, ' %s\n' % self.op
- self.rhs.toShell(file, pipefail)
diff --git a/contrib/llvm/utils/lit/lit/ShUtil.py b/contrib/llvm/utils/lit/lit/ShUtil.py
deleted file mode 100644
index dda622a..0000000
--- a/contrib/llvm/utils/lit/lit/ShUtil.py
+++ /dev/null
@@ -1,353 +0,0 @@
-import itertools
-
-import Util
-from ShCommands import Command, Pipeline, Seq
-
-class ShLexer:
- def __init__(self, data, win32Escapes = False):
- self.data = data
- self.pos = 0
- self.end = len(data)
- self.win32Escapes = win32Escapes
-
- def eat(self):
- c = self.data[self.pos]
- self.pos += 1
- return c
-
- def look(self):
- return self.data[self.pos]
-
- def maybe_eat(self, c):
- """
- maybe_eat(c) - Consume the character c if it is the next character,
- returning True if a character was consumed. """
- if self.data[self.pos] == c:
- self.pos += 1
- return True
- return False
-
- def lex_arg_fast(self, c):
- # Get the leading whitespace free section.
- chunk = self.data[self.pos - 1:].split(None, 1)[0]
-
- # If it has special characters, the fast path failed.
- if ('|' in chunk or '&' in chunk or
- '<' in chunk or '>' in chunk or
- "'" in chunk or '"' in chunk or
- '\\' in chunk):
- return None
-
- self.pos = self.pos - 1 + len(chunk)
- return chunk
-
- def lex_arg_slow(self, c):
- if c in "'\"":
- str = self.lex_arg_quoted(c)
- else:
- str = c
- while self.pos != self.end:
- c = self.look()
- if c.isspace() or c in "|&":
- break
- elif c in '><':
- # This is an annoying case; we treat '2>' as a single token so
- # we don't have to track whitespace tokens.
-
- # If the parse string isn't an integer, do the usual thing.
- if not str.isdigit():
- break
-
- # Otherwise, lex the operator and convert to a redirection
- # token.
- num = int(str)
- tok = self.lex_one_token()
- assert isinstance(tok, tuple) and len(tok) == 1
- return (tok[0], num)
- elif c == '"':
- self.eat()
- str += self.lex_arg_quoted('"')
- elif c == "'":
- self.eat()
- str += self.lex_arg_quoted("'")
- elif not self.win32Escapes and c == '\\':
- # Outside of a string, '\\' escapes everything.
- self.eat()
- if self.pos == self.end:
- Util.warning("escape at end of quoted argument in: %r" %
- self.data)
- return str
- str += self.eat()
- else:
- str += self.eat()
- return str
-
- def lex_arg_quoted(self, delim):
- str = ''
- while self.pos != self.end:
- c = self.eat()
- if c == delim:
- return str
- elif c == '\\' and delim == '"':
- # Inside a '"' quoted string, '\\' only escapes the quote
- # character and backslash, otherwise it is preserved.
- if self.pos == self.end:
- Util.warning("escape at end of quoted argument in: %r" %
- self.data)
- return str
- c = self.eat()
- if c == '"': #
- str += '"'
- elif c == '\\':
- str += '\\'
- else:
- str += '\\' + c
- else:
- str += c
- Util.warning("missing quote character in %r" % self.data)
- return str
-
- def lex_arg_checked(self, c):
- pos = self.pos
- res = self.lex_arg_fast(c)
- end = self.pos
-
- self.pos = pos
- reference = self.lex_arg_slow(c)
- if res is not None:
- if res != reference:
- raise ValueError,"Fast path failure: %r != %r" % (res, reference)
- if self.pos != end:
- raise ValueError,"Fast path failure: %r != %r" % (self.pos, end)
- return reference
-
- def lex_arg(self, c):
- return self.lex_arg_fast(c) or self.lex_arg_slow(c)
-
- def lex_one_token(self):
- """
- lex_one_token - Lex a single 'sh' token. """
-
- c = self.eat()
- if c in ';!':
- return (c,)
- if c == '|':
- if self.maybe_eat('|'):
- return ('||',)
- return (c,)
- if c == '&':
- if self.maybe_eat('&'):
- return ('&&',)
- if self.maybe_eat('>'):
- return ('&>',)
- return (c,)
- if c == '>':
- if self.maybe_eat('&'):
- return ('>&',)
- if self.maybe_eat('>'):
- return ('>>',)
- return (c,)
- if c == '<':
- if self.maybe_eat('&'):
- return ('<&',)
- if self.maybe_eat('>'):
- return ('<<',)
- return (c,)
-
- return self.lex_arg(c)
-
- def lex(self):
- while self.pos != self.end:
- if self.look().isspace():
- self.eat()
- else:
- yield self.lex_one_token()
-
-###
-
-class ShParser:
- def __init__(self, data, win32Escapes = False):
- self.data = data
- self.tokens = ShLexer(data, win32Escapes = win32Escapes).lex()
-
- def lex(self):
- try:
- return self.tokens.next()
- except StopIteration:
- return None
-
- def look(self):
- next = self.lex()
- if next is not None:
- self.tokens = itertools.chain([next], self.tokens)
- return next
-
- def parse_command(self):
- tok = self.lex()
- if not tok:
- raise ValueError,"empty command!"
- if isinstance(tok, tuple):
- raise ValueError,"syntax error near unexpected token %r" % tok[0]
-
- args = [tok]
- redirects = []
- while 1:
- tok = self.look()
-
- # EOF?
- if tok is None:
- break
-
- # If this is an argument, just add it to the current command.
- if isinstance(tok, str):
- args.append(self.lex())
- continue
-
- # Otherwise see if it is a terminator.
- assert isinstance(tok, tuple)
- if tok[0] in ('|',';','&','||','&&'):
- break
-
- # Otherwise it must be a redirection.
- op = self.lex()
- arg = self.lex()
- if not arg:
- raise ValueError,"syntax error near token %r" % op[0]
- redirects.append((op, arg))
-
- return Command(args, redirects)
-
- def parse_pipeline(self):
- negate = False
- if self.look() == ('!',):
- self.lex()
- negate = True
-
- commands = [self.parse_command()]
- while self.look() == ('|',):
- self.lex()
- commands.append(self.parse_command())
- return Pipeline(commands, negate)
-
- def parse(self):
- lhs = self.parse_pipeline()
-
- while self.look():
- operator = self.lex()
- assert isinstance(operator, tuple) and len(operator) == 1
-
- if not self.look():
- raise ValueError, "missing argument to operator %r" % operator[0]
-
- # FIXME: Operator precedence!!
- lhs = Seq(lhs, operator[0], self.parse_pipeline())
-
- return lhs
-
-###
-
-import unittest
-
-class TestShLexer(unittest.TestCase):
- def lex(self, str, *args, **kwargs):
- return list(ShLexer(str, *args, **kwargs).lex())
-
- def test_basic(self):
- self.assertEqual(self.lex('a|b>c&d<e'),
- ['a', ('|',), 'b', ('>',), 'c', ('&',), 'd',
- ('<',), 'e'])
-
- def test_redirection_tokens(self):
- self.assertEqual(self.lex('a2>c'),
- ['a2', ('>',), 'c'])
- self.assertEqual(self.lex('a 2>c'),
- ['a', ('>',2), 'c'])
-
- def test_quoting(self):
- self.assertEqual(self.lex(""" 'a' """),
- ['a'])
- self.assertEqual(self.lex(""" "hello\\"world" """),
- ['hello"world'])
- self.assertEqual(self.lex(""" "hello\\'world" """),
- ["hello\\'world"])
- self.assertEqual(self.lex(""" "hello\\\\world" """),
- ["hello\\world"])
- self.assertEqual(self.lex(""" he"llo wo"rld """),
- ["hello world"])
- self.assertEqual(self.lex(""" a\\ b a\\\\b """),
- ["a b", "a\\b"])
- self.assertEqual(self.lex(""" "" "" """),
- ["", ""])
- self.assertEqual(self.lex(""" a\\ b """, win32Escapes = True),
- ['a\\', 'b'])
-
-class TestShParse(unittest.TestCase):
- def parse(self, str):
- return ShParser(str).parse()
-
- def test_basic(self):
- self.assertEqual(self.parse('echo hello'),
- Pipeline([Command(['echo', 'hello'], [])], False))
- self.assertEqual(self.parse('echo ""'),
- Pipeline([Command(['echo', ''], [])], False))
- self.assertEqual(self.parse("""echo -DFOO='a'"""),
- Pipeline([Command(['echo', '-DFOO=a'], [])], False))
- self.assertEqual(self.parse('echo -DFOO="a"'),
- Pipeline([Command(['echo', '-DFOO=a'], [])], False))
-
- def test_redirection(self):
- self.assertEqual(self.parse('echo hello > c'),
- Pipeline([Command(['echo', 'hello'],
- [((('>'),), 'c')])], False))
- self.assertEqual(self.parse('echo hello > c >> d'),
- Pipeline([Command(['echo', 'hello'], [(('>',), 'c'),
- (('>>',), 'd')])], False))
- self.assertEqual(self.parse('a 2>&1'),
- Pipeline([Command(['a'], [(('>&',2), '1')])], False))
-
- def test_pipeline(self):
- self.assertEqual(self.parse('a | b'),
- Pipeline([Command(['a'], []),
- Command(['b'], [])],
- False))
-
- self.assertEqual(self.parse('a | b | c'),
- Pipeline([Command(['a'], []),
- Command(['b'], []),
- Command(['c'], [])],
- False))
-
- self.assertEqual(self.parse('! a'),
- Pipeline([Command(['a'], [])],
- True))
-
- def test_list(self):
- self.assertEqual(self.parse('a ; b'),
- Seq(Pipeline([Command(['a'], [])], False),
- ';',
- Pipeline([Command(['b'], [])], False)))
-
- self.assertEqual(self.parse('a & b'),
- Seq(Pipeline([Command(['a'], [])], False),
- '&',
- Pipeline([Command(['b'], [])], False)))
-
- self.assertEqual(self.parse('a && b'),
- Seq(Pipeline([Command(['a'], [])], False),
- '&&',
- Pipeline([Command(['b'], [])], False)))
-
- self.assertEqual(self.parse('a || b'),
- Seq(Pipeline([Command(['a'], [])], False),
- '||',
- Pipeline([Command(['b'], [])], False)))
-
- self.assertEqual(self.parse('a && b || c'),
- Seq(Seq(Pipeline([Command(['a'], [])], False),
- '&&',
- Pipeline([Command(['b'], [])], False)),
- '||',
- Pipeline([Command(['c'], [])], False)))
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/contrib/llvm/utils/lit/lit/TclUtil.py b/contrib/llvm/utils/lit/lit/TclUtil.py
deleted file mode 100644
index 4a3f345..0000000
--- a/contrib/llvm/utils/lit/lit/TclUtil.py
+++ /dev/null
@@ -1,322 +0,0 @@
-import itertools
-
-from ShCommands import Command, Pipeline
-
-def tcl_preprocess(data):
- # Tcl has a preprocessing step to replace escaped newlines.
- i = data.find('\\\n')
- if i == -1:
- return data
-
- # Replace '\\\n' and subsequent whitespace by a single space.
- n = len(data)
- str = data[:i]
- i += 2
- while i < n and data[i] in ' \t':
- i += 1
- return str + ' ' + data[i:]
-
-class TclLexer:
- """TclLexer - Lex a string into "words", following the Tcl syntax."""
-
- def __init__(self, data):
- self.data = tcl_preprocess(data)
- self.pos = 0
- self.end = len(self.data)
-
- def at_end(self):
- return self.pos == self.end
-
- def eat(self):
- c = self.data[self.pos]
- self.pos += 1
- return c
-
- def look(self):
- return self.data[self.pos]
-
- def maybe_eat(self, c):
- """
- maybe_eat(c) - Consume the character c if it is the next character,
- returning True if a character was consumed. """
- if self.data[self.pos] == c:
- self.pos += 1
- return True
- return False
-
- def escape(self, c):
- if c == 'a':
- return '\x07'
- elif c == 'b':
- return '\x08'
- elif c == 'f':
- return '\x0c'
- elif c == 'n':
- return '\n'
- elif c == 'r':
- return '\r'
- elif c == 't':
- return '\t'
- elif c == 'v':
- return '\x0b'
- elif c in 'uxo':
- raise ValueError,'Invalid quoted character %r' % c
- else:
- return c
-
- def lex_braced(self):
- # Lex until whitespace or end of string, the opening brace has already
- # been consumed.
-
- str = ''
- while 1:
- if self.at_end():
- raise ValueError,"Unterminated '{' quoted word"
-
- c = self.eat()
- if c == '}':
- break
- elif c == '{':
- str += '{' + self.lex_braced() + '}'
- elif c == '\\' and self.look() in '{}':
- str += self.eat()
- else:
- str += c
-
- return str
-
- def lex_quoted(self):
- str = ''
-
- while 1:
- if self.at_end():
- raise ValueError,"Unterminated '\"' quoted word"
-
- c = self.eat()
- if c == '"':
- break
- elif c == '\\':
- if self.at_end():
- raise ValueError,'Missing quoted character'
-
- str += self.escape(self.eat())
- else:
- str += c
-
- return str
-
- def lex_unquoted(self, process_all=False):
- # Lex until whitespace or end of string.
- str = ''
- while not self.at_end():
- if not process_all:
- if self.look().isspace() or self.look() == ';':
- break
-
- c = self.eat()
- if c == '\\':
- if self.at_end():
- raise ValueError,'Missing quoted character'
-
- str += self.escape(self.eat())
- elif c == '[':
- raise NotImplementedError, ('Command substitution is '
- 'not supported')
- elif c == '$' and not self.at_end() and (self.look().isalpha() or
- self.look() == '{'):
- raise NotImplementedError, ('Variable substitution is '
- 'not supported')
- else:
- str += c
-
- return str
-
- def lex_one_token(self):
- if self.maybe_eat('"'):
- return self.lex_quoted()
- elif self.maybe_eat('{'):
- # Check for argument substitution.
- if not self.maybe_eat('*'):
- return self.lex_braced()
-
- if not self.maybe_eat('}'):
- return '*' + self.lex_braced()
-
- if self.at_end() or self.look().isspace():
- return '*'
-
- raise NotImplementedError, "Argument substitution is unsupported"
- else:
- return self.lex_unquoted()
-
- def lex(self):
- while not self.at_end():
- c = self.look()
- if c in ' \t':
- self.eat()
- elif c in ';\n':
- self.eat()
- yield (';',)
- else:
- yield self.lex_one_token()
-
-class TclExecCommand:
- kRedirectPrefixes1 = ('<', '>')
- kRedirectPrefixes2 = ('<@', '<<', '2>', '>&', '>>', '>@')
- kRedirectPrefixes3 = ('2>@', '2>>', '>>&', '>&@')
- kRedirectPrefixes4 = ('2>@1',)
-
- def __init__(self, args):
- self.args = iter(args)
-
- def lex(self):
- try:
- return self.args.next()
- except StopIteration:
- return None
-
- def look(self):
- next = self.lex()
- if next is not None:
- self.args = itertools.chain([next], self.args)
- return next
-
- def parse_redirect(self, tok, length):
- if len(tok) == length:
- arg = self.lex()
- if arg is None:
- raise ValueError,'Missing argument to %r redirection' % tok
- else:
- tok,arg = tok[:length],tok[length:]
-
- if tok[0] == '2':
- op = (tok[1:],2)
- else:
- op = (tok,)
- return (op, arg)
-
- def parse_pipeline(self):
- if self.look() is None:
- raise ValueError,"Expected at least one argument to exec"
-
- commands = [Command([],[])]
- while 1:
- arg = self.lex()
- if arg is None:
- break
- elif arg == '|':
- commands.append(Command([],[]))
- elif arg == '|&':
- # Write this as a redirect of stderr; it must come first because
- # stdout may have already been redirected.
- commands[-1].redirects.insert(0, (('>&',2),'1'))
- commands.append(Command([],[]))
- elif arg[:4] in TclExecCommand.kRedirectPrefixes4:
- commands[-1].redirects.append(self.parse_redirect(arg, 4))
- elif arg[:3] in TclExecCommand.kRedirectPrefixes3:
- commands[-1].redirects.append(self.parse_redirect(arg, 3))
- elif arg[:2] in TclExecCommand.kRedirectPrefixes2:
- commands[-1].redirects.append(self.parse_redirect(arg, 2))
- elif arg[:1] in TclExecCommand.kRedirectPrefixes1:
- commands[-1].redirects.append(self.parse_redirect(arg, 1))
- else:
- commands[-1].args.append(arg)
-
- return Pipeline(commands, False, pipe_err=True)
-
- def parse(self):
- ignoreStderr = False
- keepNewline = False
-
- # Parse arguments.
- while 1:
- next = self.look()
- if not isinstance(next, str) or next[0] != '-':
- break
-
- if next == '--':
- self.lex()
- break
- elif next == '-ignorestderr':
- ignoreStderr = True
- elif next == '-keepnewline':
- keepNewline = True
- else:
- raise ValueError,"Invalid exec argument %r" % next
-
- return (ignoreStderr, keepNewline, self.parse_pipeline())
-
-###
-
-import unittest
-
-class TestTclLexer(unittest.TestCase):
- def lex(self, str, *args, **kwargs):
- return list(TclLexer(str, *args, **kwargs).lex())
-
- def test_preprocess(self):
- self.assertEqual(tcl_preprocess('a b'), 'a b')
- self.assertEqual(tcl_preprocess('a\\\nb c'), 'a b c')
-
- def test_unquoted(self):
- self.assertEqual(self.lex('a b c'),
- ['a', 'b', 'c'])
- self.assertEqual(self.lex(r'a\nb\tc\ '),
- ['a\nb\tc '])
- self.assertEqual(self.lex(r'a \\\$b c $\\'),
- ['a', r'\$b', 'c', '$\\'])
-
- def test_braced(self):
- self.assertEqual(self.lex('a {b c} {}'),
- ['a', 'b c', ''])
- self.assertEqual(self.lex(r'a {b {c\n}}'),
- ['a', 'b {c\\n}'])
- self.assertEqual(self.lex(r'a {b\{}'),
- ['a', 'b{'])
- self.assertEqual(self.lex(r'{*}'), ['*'])
- self.assertEqual(self.lex(r'{*} a'), ['*', 'a'])
- self.assertEqual(self.lex(r'{*} a'), ['*', 'a'])
- self.assertEqual(self.lex('{a\\\n b}'),
- ['a b'])
-
- def test_quoted(self):
- self.assertEqual(self.lex('a "b c"'),
- ['a', 'b c'])
-
- def test_terminators(self):
- self.assertEqual(self.lex('a\nb'),
- ['a', (';',), 'b'])
- self.assertEqual(self.lex('a;b'),
- ['a', (';',), 'b'])
- self.assertEqual(self.lex('a ; b'),
- ['a', (';',), 'b'])
-
-class TestTclExecCommand(unittest.TestCase):
- def parse(self, str):
- return TclExecCommand(list(TclLexer(str).lex())).parse()
-
- def test_basic(self):
- self.assertEqual(self.parse('echo hello'),
- (False, False,
- Pipeline([Command(['echo', 'hello'], [])],
- False, True)))
- self.assertEqual(self.parse('echo hello | grep hello'),
- (False, False,
- Pipeline([Command(['echo', 'hello'], []),
- Command(['grep', 'hello'], [])],
- False, True)))
-
- def test_redirect(self):
- self.assertEqual(self.parse('echo hello > a >b >>c 2> d |& e'),
- (False, False,
- Pipeline([Command(['echo', 'hello'],
- [(('>&',2),'1'),
- (('>',),'a'),
- (('>',),'b'),
- (('>>',),'c'),
- (('>',2),'d')]),
- Command(['e'], [])],
- False, True)))
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/contrib/llvm/utils/lit/lit/Test.py b/contrib/llvm/utils/lit/lit/Test.py
deleted file mode 100644
index db2e032..0000000
--- a/contrib/llvm/utils/lit/lit/Test.py
+++ /dev/null
@@ -1,79 +0,0 @@
-import os
-
-# Test results.
-
-class TestResult:
- def __init__(self, name, isFailure):
- self.name = name
- self.isFailure = isFailure
-
-PASS = TestResult('PASS', False)
-XFAIL = TestResult('XFAIL', False)
-FAIL = TestResult('FAIL', True)
-XPASS = TestResult('XPASS', True)
-UNRESOLVED = TestResult('UNRESOLVED', True)
-UNSUPPORTED = TestResult('UNSUPPORTED', False)
-
-# Test classes.
-
-class TestFormat:
- """TestFormat - Test information provider."""
-
- def __init__(self, name):
- self.name = name
-
-class TestSuite:
- """TestSuite - Information on a group of tests.
-
- A test suite groups together a set of logically related tests.
- """
-
- def __init__(self, name, source_root, exec_root, config):
- self.name = name
- self.source_root = source_root
- self.exec_root = exec_root
- # The test suite configuration.
- self.config = config
-
- def getSourcePath(self, components):
- return os.path.join(self.source_root, *components)
-
- def getExecPath(self, components):
- return os.path.join(self.exec_root, *components)
-
-class Test:
- """Test - Information on a single test instance."""
-
- def __init__(self, suite, path_in_suite, config):
- self.suite = suite
- self.path_in_suite = path_in_suite
- self.config = config
- # The test result code, once complete.
- self.result = None
- # Any additional output from the test, once complete.
- self.output = None
- # The wall time to execute this test, if timing and once complete.
- self.elapsed = None
- # The repeat index of this test, or None.
- self.index = None
-
- def copyWithIndex(self, index):
- import copy
- res = copy.copy(self)
- res.index = index
- return res
-
- def setResult(self, result, output, elapsed):
- assert self.result is None, "Test result already set!"
- self.result = result
- self.output = output
- self.elapsed = elapsed
-
- def getFullName(self):
- return self.suite.config.name + ' :: ' + '/'.join(self.path_in_suite)
-
- def getSourcePath(self):
- return self.suite.getSourcePath(self.path_in_suite)
-
- def getExecPath(self):
- return self.suite.getExecPath(self.path_in_suite)
diff --git a/contrib/llvm/utils/lit/lit/TestFormats.py b/contrib/llvm/utils/lit/lit/TestFormats.py
deleted file mode 100644
index 7ffbd2b..0000000
--- a/contrib/llvm/utils/lit/lit/TestFormats.py
+++ /dev/null
@@ -1,221 +0,0 @@
-import os
-import platform
-
-import Test
-import TestRunner
-import Util
-
-kIsWindows = platform.system() == 'Windows'
-
-class GoogleTest(object):
- def __init__(self, test_sub_dir, test_suffix):
- self.test_sub_dir = str(test_sub_dir)
- self.test_suffix = str(test_suffix)
-
- # On Windows, assume tests will also end in '.exe'.
- if kIsWindows:
- self.test_suffix += '.exe'
-
- def getGTestTests(self, path, litConfig, localConfig):
- """getGTestTests(path) - [name]
-
- Return the tests available in gtest executable.
-
- Args:
- path: String path to a gtest executable
- litConfig: LitConfig instance
- localConfig: TestingConfig instance"""
-
- try:
- lines = Util.capture([path, '--gtest_list_tests'],
- env=localConfig.environment).split('\n')
- except:
- litConfig.error("unable to discover google-tests in %r" % path)
- raise StopIteration
-
- nested_tests = []
- for ln in lines:
- if not ln.strip():
- continue
-
- prefix = ''
- index = 0
- while ln[index*2:index*2+2] == ' ':
- index += 1
- while len(nested_tests) > index:
- nested_tests.pop()
-
- ln = ln[index*2:]
- if ln.endswith('.'):
- nested_tests.append(ln)
- else:
- yield ''.join(nested_tests) + ln
-
- def getTestsInDirectory(self, testSuite, path_in_suite,
- litConfig, localConfig):
- source_path = testSuite.getSourcePath(path_in_suite)
- for filename in os.listdir(source_path):
- # Check for the one subdirectory (build directory) tests will be in.
- if filename != self.test_sub_dir:
- continue
-
- filepath = os.path.join(source_path, filename)
- for subfilename in os.listdir(filepath):
- if subfilename.endswith(self.test_suffix):
- execpath = os.path.join(filepath, subfilename)
-
- # Discover the tests in this executable.
- for name in self.getGTestTests(execpath, litConfig,
- localConfig):
- testPath = path_in_suite + (filename, subfilename, name)
- yield Test.Test(testSuite, testPath, localConfig)
-
- def execute(self, test, litConfig):
- testPath,testName = os.path.split(test.getSourcePath())
- while not os.path.exists(testPath):
- # Handle GTest parametrized and typed tests, whose name includes
- # some '/'s.
- testPath, namePrefix = os.path.split(testPath)
- testName = os.path.join(namePrefix, testName)
-
- cmd = [testPath, '--gtest_filter=' + testName]
- if litConfig.useValgrind:
- cmd = litConfig.valgrindArgs + cmd
-
- out, err, exitCode = TestRunner.executeCommand(
- cmd, env=test.config.environment)
-
- if not exitCode:
- return Test.PASS,''
-
- return Test.FAIL, out + err
-
-###
-
-class FileBasedTest(object):
- def getTestsInDirectory(self, testSuite, path_in_suite,
- litConfig, localConfig):
- source_path = testSuite.getSourcePath(path_in_suite)
- for filename in os.listdir(source_path):
- # Ignore dot files and excluded tests.
- if (filename.startswith('.') or
- filename in localConfig.excludes):
- continue
-
- filepath = os.path.join(source_path, filename)
- if not os.path.isdir(filepath):
- base,ext = os.path.splitext(filename)
- if ext in localConfig.suffixes:
- yield Test.Test(testSuite, path_in_suite + (filename,),
- localConfig)
-
-class ShTest(FileBasedTest):
- def __init__(self, execute_external = False):
- self.execute_external = execute_external
-
- def execute(self, test, litConfig):
- return TestRunner.executeShTest(test, litConfig,
- self.execute_external)
-
-class TclTest(FileBasedTest):
- def execute(self, test, litConfig):
- return TestRunner.executeTclTest(test, litConfig)
-
-###
-
-import re
-import tempfile
-
-class OneCommandPerFileTest:
- # FIXME: Refactor into generic test for running some command on a directory
- # of inputs.
-
- def __init__(self, command, dir, recursive=False,
- pattern=".*", useTempInput=False):
- if isinstance(command, str):
- self.command = [command]
- else:
- self.command = list(command)
- if dir is not None:
- dir = str(dir)
- self.dir = dir
- self.recursive = bool(recursive)
- self.pattern = re.compile(pattern)
- self.useTempInput = useTempInput
-
- def getTestsInDirectory(self, testSuite, path_in_suite,
- litConfig, localConfig):
- dir = self.dir
- if dir is None:
- dir = testSuite.getSourcePath(path_in_suite)
-
- for dirname,subdirs,filenames in os.walk(dir):
- if not self.recursive:
- subdirs[:] = []
-
- subdirs[:] = [d for d in subdirs
- if (d != '.svn' and
- d not in localConfig.excludes)]
-
- for filename in filenames:
- if (filename.startswith('.') or
- not self.pattern.match(filename) or
- filename in localConfig.excludes):
- continue
-
- path = os.path.join(dirname,filename)
- suffix = path[len(dir):]
- if suffix.startswith(os.sep):
- suffix = suffix[1:]
- test = Test.Test(testSuite,
- path_in_suite + tuple(suffix.split(os.sep)),
- localConfig)
- # FIXME: Hack?
- test.source_path = path
- yield test
-
- def createTempInput(self, tmp, test):
- abstract
-
- def execute(self, test, litConfig):
- if test.config.unsupported:
- return (Test.UNSUPPORTED, 'Test is unsupported')
-
- cmd = list(self.command)
-
- # If using temp input, create a temporary file and hand it to the
- # subclass.
- if self.useTempInput:
- tmp = tempfile.NamedTemporaryFile(suffix='.cpp')
- self.createTempInput(tmp, test)
- tmp.flush()
- cmd.append(tmp.name)
- elif hasattr(test, 'source_path'):
- cmd.append(test.source_path)
- else:
- cmd.append(test.getSourcePath())
-
- out, err, exitCode = TestRunner.executeCommand(cmd)
-
- diags = out + err
- if not exitCode and not diags.strip():
- return Test.PASS,''
-
- # Try to include some useful information.
- report = """Command: %s\n""" % ' '.join(["'%s'" % a
- for a in cmd])
- if self.useTempInput:
- report += """Temporary File: %s\n""" % tmp.name
- report += "--\n%s--\n""" % open(tmp.name).read()
- report += """Output:\n--\n%s--""" % diags
-
- return Test.FAIL, report
-
-class SyntaxCheckTest(OneCommandPerFileTest):
- def __init__(self, compiler, dir, extra_cxx_args=[], *args, **kwargs):
- cmd = [compiler, '-x', 'c++', '-fsyntax-only'] + extra_cxx_args
- OneCommandPerFileTest.__init__(self, cmd, dir,
- useTempInput=1, *args, **kwargs)
-
- def createTempInput(self, tmp, test):
- print >>tmp, '#include "%s"' % test.source_path
diff --git a/contrib/llvm/utils/lit/lit/TestRunner.py b/contrib/llvm/utils/lit/lit/TestRunner.py
deleted file mode 100644
index 0eb51a8..0000000
--- a/contrib/llvm/utils/lit/lit/TestRunner.py
+++ /dev/null
@@ -1,586 +0,0 @@
-import os, signal, subprocess, sys
-import StringIO
-
-import ShUtil
-import Test
-import Util
-
-import platform
-import tempfile
-
-class InternalShellError(Exception):
- def __init__(self, command, message):
- self.command = command
- self.message = message
-
-kIsWindows = platform.system() == 'Windows'
-
-# Don't use close_fds on Windows.
-kUseCloseFDs = not kIsWindows
-
-# Use temporary files to replace /dev/null on Windows.
-kAvoidDevNull = kIsWindows
-
-def executeCommand(command, cwd=None, env=None):
- p = subprocess.Popen(command, cwd=cwd,
- stdin=subprocess.PIPE,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- env=env)
- out,err = p.communicate()
- exitCode = p.wait()
-
- # Detect Ctrl-C in subprocess.
- if exitCode == -signal.SIGINT:
- raise KeyboardInterrupt
-
- return out, err, exitCode
-
-def executeShCmd(cmd, cfg, cwd, results):
- if isinstance(cmd, ShUtil.Seq):
- if cmd.op == ';':
- res = executeShCmd(cmd.lhs, cfg, cwd, results)
- return executeShCmd(cmd.rhs, cfg, cwd, results)
-
- if cmd.op == '&':
- raise NotImplementedError,"unsupported test command: '&'"
-
- if cmd.op == '||':
- res = executeShCmd(cmd.lhs, cfg, cwd, results)
- if res != 0:
- res = executeShCmd(cmd.rhs, cfg, cwd, results)
- return res
- if cmd.op == '&&':
- res = executeShCmd(cmd.lhs, cfg, cwd, results)
- if res is None:
- return res
-
- if res == 0:
- res = executeShCmd(cmd.rhs, cfg, cwd, results)
- return res
-
- raise ValueError,'Unknown shell command: %r' % cmd.op
-
- assert isinstance(cmd, ShUtil.Pipeline)
- procs = []
- input = subprocess.PIPE
- stderrTempFiles = []
- opened_files = []
- named_temp_files = []
- # To avoid deadlock, we use a single stderr stream for piped
- # output. This is null until we have seen some output using
- # stderr.
- for i,j in enumerate(cmd.commands):
- # Apply the redirections, we use (N,) as a sentinal to indicate stdin,
- # stdout, stderr for N equal to 0, 1, or 2 respectively. Redirects to or
- # from a file are represented with a list [file, mode, file-object]
- # where file-object is initially None.
- redirects = [(0,), (1,), (2,)]
- for r in j.redirects:
- if r[0] == ('>',2):
- redirects[2] = [r[1], 'w', None]
- elif r[0] == ('>>',2):
- redirects[2] = [r[1], 'a', None]
- elif r[0] == ('>&',2) and r[1] in '012':
- redirects[2] = redirects[int(r[1])]
- elif r[0] == ('>&',) or r[0] == ('&>',):
- redirects[1] = redirects[2] = [r[1], 'w', None]
- elif r[0] == ('>',):
- redirects[1] = [r[1], 'w', None]
- elif r[0] == ('>>',):
- redirects[1] = [r[1], 'a', None]
- elif r[0] == ('<',):
- redirects[0] = [r[1], 'r', None]
- else:
- raise NotImplementedError,"Unsupported redirect: %r" % (r,)
-
- # Map from the final redirections to something subprocess can handle.
- final_redirects = []
- for index,r in enumerate(redirects):
- if r == (0,):
- result = input
- elif r == (1,):
- if index == 0:
- raise NotImplementedError,"Unsupported redirect for stdin"
- elif index == 1:
- result = subprocess.PIPE
- else:
- result = subprocess.STDOUT
- elif r == (2,):
- if index != 2:
- raise NotImplementedError,"Unsupported redirect on stdout"
- result = subprocess.PIPE
- else:
- if r[2] is None:
- if kAvoidDevNull and r[0] == '/dev/null':
- r[2] = tempfile.TemporaryFile(mode=r[1])
- else:
- r[2] = open(r[0], r[1])
- # Workaround a Win32 and/or subprocess bug when appending.
- #
- # FIXME: Actually, this is probably an instance of PR6753.
- if r[1] == 'a':
- r[2].seek(0, 2)
- opened_files.append(r[2])
- result = r[2]
- final_redirects.append(result)
-
- stdin, stdout, stderr = final_redirects
-
- # If stderr wants to come from stdout, but stdout isn't a pipe, then put
- # stderr on a pipe and treat it as stdout.
- if (stderr == subprocess.STDOUT and stdout != subprocess.PIPE):
- stderr = subprocess.PIPE
- stderrIsStdout = True
- else:
- stderrIsStdout = False
-
- # Don't allow stderr on a PIPE except for the last
- # process, this could deadlock.
- #
- # FIXME: This is slow, but so is deadlock.
- if stderr == subprocess.PIPE and j != cmd.commands[-1]:
- stderr = tempfile.TemporaryFile(mode='w+b')
- stderrTempFiles.append((i, stderr))
-
- # Resolve the executable path ourselves.
- args = list(j.args)
- args[0] = Util.which(args[0], cfg.environment['PATH'])
- if not args[0]:
- raise InternalShellError(j, '%r: command not found' % j.args[0])
-
- # Replace uses of /dev/null with temporary files.
- if kAvoidDevNull:
- for i,arg in enumerate(args):
- if arg == "/dev/null":
- f = tempfile.NamedTemporaryFile(delete=False)
- f.close()
- named_temp_files.append(f.name)
- args[i] = f.name
-
- procs.append(subprocess.Popen(args, cwd=cwd,
- stdin = stdin,
- stdout = stdout,
- stderr = stderr,
- env = cfg.environment,
- close_fds = kUseCloseFDs))
-
- # Immediately close stdin for any process taking stdin from us.
- if stdin == subprocess.PIPE:
- procs[-1].stdin.close()
- procs[-1].stdin = None
-
- # Update the current stdin source.
- if stdout == subprocess.PIPE:
- input = procs[-1].stdout
- elif stderrIsStdout:
- input = procs[-1].stderr
- else:
- input = subprocess.PIPE
-
- # FIXME: There is probably still deadlock potential here. Yawn.
- procData = [None] * len(procs)
- procData[-1] = procs[-1].communicate()
-
- for i in range(len(procs) - 1):
- if procs[i].stdout is not None:
- out = procs[i].stdout.read()
- else:
- out = ''
- if procs[i].stderr is not None:
- err = procs[i].stderr.read()
- else:
- err = ''
- procData[i] = (out,err)
-
- # Read stderr out of the temp files.
- for i,f in stderrTempFiles:
- f.seek(0, 0)
- procData[i] = (procData[i][0], f.read())
-
- exitCode = None
- for i,(out,err) in enumerate(procData):
- res = procs[i].wait()
- # Detect Ctrl-C in subprocess.
- if res == -signal.SIGINT:
- raise KeyboardInterrupt
-
- results.append((cmd.commands[i], out, err, res))
- if cmd.pipe_err:
- # Python treats the exit code as a signed char.
- if res < 0:
- exitCode = min(exitCode, res)
- else:
- exitCode = max(exitCode, res)
- else:
- exitCode = res
-
- # Explicitly close any redirected files.
- for f in opened_files:
- f.close()
-
- # Remove any named temporary files we created.
- for f in named_temp_files:
- try:
- os.remove(f)
- except OSError:
- pass
-
- if cmd.negate:
- exitCode = not exitCode
-
- return exitCode
-
-def executeScriptInternal(test, litConfig, tmpBase, commands, cwd):
- ln = ' &&\n'.join(commands)
- try:
- cmd = ShUtil.ShParser(ln, litConfig.isWindows).parse()
- except:
- return (Test.FAIL, "shell parser error on: %r" % ln)
-
- results = []
- try:
- exitCode = executeShCmd(cmd, test.config, cwd, results)
- except InternalShellError,e:
- out = ''
- err = e.message
- exitCode = 255
-
- out = err = ''
- for i,(cmd, cmd_out,cmd_err,res) in enumerate(results):
- out += 'Command %d: %s\n' % (i, ' '.join('"%s"' % s for s in cmd.args))
- out += 'Command %d Result: %r\n' % (i, res)
- out += 'Command %d Output:\n%s\n\n' % (i, cmd_out)
- out += 'Command %d Stderr:\n%s\n\n' % (i, cmd_err)
-
- return out, err, exitCode
-
-def executeTclScriptInternal(test, litConfig, tmpBase, commands, cwd):
- import TclUtil
- cmds = []
- for ln in commands:
- # Given the unfortunate way LLVM's test are written, the line gets
- # backslash substitution done twice.
- ln = TclUtil.TclLexer(ln).lex_unquoted(process_all = True)
-
- try:
- tokens = list(TclUtil.TclLexer(ln).lex())
- except:
- return (Test.FAIL, "Tcl lexer error on: %r" % ln)
-
- # Validate there are no control tokens.
- for t in tokens:
- if not isinstance(t, str):
- return (Test.FAIL,
- "Invalid test line: %r containing %r" % (ln, t))
-
- try:
- cmds.append(TclUtil.TclExecCommand(tokens).parse_pipeline())
- except:
- return (Test.FAIL, "Tcl 'exec' parse error on: %r" % ln)
-
- if litConfig.useValgrind:
- for pipeline in cmds:
- if pipeline.commands:
- # Only valgrind the first command in each pipeline, to avoid
- # valgrinding things like grep, not, and FileCheck.
- cmd = pipeline.commands[0]
- cmd.args = litConfig.valgrindArgs + cmd.args
-
- cmd = cmds[0]
- for c in cmds[1:]:
- cmd = ShUtil.Seq(cmd, '&&', c)
-
- # FIXME: This is lame, we shouldn't need bash. See PR5240.
- bashPath = litConfig.getBashPath()
- if litConfig.useTclAsSh and bashPath:
- script = tmpBase + '.script'
-
- # Write script file
- f = open(script,'w')
- print >>f, 'set -o pipefail'
- cmd.toShell(f, pipefail = True)
- f.close()
-
- if 0:
- print >>sys.stdout, cmd
- print >>sys.stdout, open(script).read()
- print >>sys.stdout
- return '', '', 0
-
- command = [litConfig.getBashPath(), script]
- out,err,exitCode = executeCommand(command, cwd=cwd,
- env=test.config.environment)
-
- return out,err,exitCode
- else:
- results = []
- try:
- exitCode = executeShCmd(cmd, test.config, cwd, results)
- except InternalShellError,e:
- results.append((e.command, '', e.message + '\n', 255))
- exitCode = 255
-
- out = err = ''
-
- for i,(cmd, cmd_out, cmd_err, res) in enumerate(results):
- out += 'Command %d: %s\n' % (i, ' '.join('"%s"' % s for s in cmd.args))
- out += 'Command %d Result: %r\n' % (i, res)
- out += 'Command %d Output:\n%s\n\n' % (i, cmd_out)
- out += 'Command %d Stderr:\n%s\n\n' % (i, cmd_err)
-
- return out, err, exitCode
-
-def executeScript(test, litConfig, tmpBase, commands, cwd):
- script = tmpBase + '.script'
- if litConfig.isWindows:
- script += '.bat'
-
- # Write script file
- f = open(script,'w')
- if litConfig.isWindows:
- f.write('\nif %ERRORLEVEL% NEQ 0 EXIT\n'.join(commands))
- else:
- f.write(' &&\n'.join(commands))
- f.write('\n')
- f.close()
-
- if litConfig.isWindows:
- command = ['cmd','/c', script]
- else:
- command = ['/bin/sh', script]
- if litConfig.useValgrind:
- # FIXME: Running valgrind on sh is overkill. We probably could just
- # run on clang with no real loss.
- command = litConfig.valgrindArgs + command
-
- return executeCommand(command, cwd=cwd, env=test.config.environment)
-
-def isExpectedFail(xfails, xtargets, target_triple):
- # Check if any xfail matches this target.
- for item in xfails:
- if item == '*' or item in target_triple:
- break
- else:
- return False
-
- # If so, see if it is expected to pass on this target.
- #
- # FIXME: Rename XTARGET to something that makes sense, like XPASS.
- for item in xtargets:
- if item == '*' or item in target_triple:
- return False
-
- return True
-
-def parseIntegratedTestScript(test, normalize_slashes=False):
- """parseIntegratedTestScript - Scan an LLVM/Clang style integrated test
- script and extract the lines to 'RUN' as well as 'XFAIL' and 'XTARGET'
- information. The RUN lines also will have variable substitution performed.
- """
-
- # Get the temporary location, this is always relative to the test suite
- # root, not test source root.
- #
- # FIXME: This should not be here?
- sourcepath = test.getSourcePath()
- sourcedir = os.path.dirname(sourcepath)
- execpath = test.getExecPath()
- execdir,execbase = os.path.split(execpath)
- tmpBase = os.path.join(execdir, 'Output', execbase)
- if test.index is not None:
- tmpBase += '_%d' % test.index
-
- # Normalize slashes, if requested.
- if normalize_slashes:
- sourcepath = sourcepath.replace('\\', '/')
- sourcedir = sourcedir.replace('\\', '/')
- tmpBase = tmpBase.replace('\\', '/')
-
- # We use #_MARKER_# to hide %% while we do the other substitutions.
- substitutions = [('%%', '#_MARKER_#')]
- substitutions.extend(test.config.substitutions)
- substitutions.extend([('%s', sourcepath),
- ('%S', sourcedir),
- ('%p', sourcedir),
- ('%t', tmpBase + '.tmp'),
- # FIXME: Remove this once we kill DejaGNU.
- ('%abs_tmp', tmpBase + '.tmp'),
- ('#_MARKER_#', '%')])
-
- # Collect the test lines from the script.
- script = []
- xfails = []
- xtargets = []
- requires = []
- for ln in open(sourcepath):
- if 'RUN:' in ln:
- # Isolate the command to run.
- index = ln.index('RUN:')
- ln = ln[index+4:]
-
- # Trim trailing whitespace.
- ln = ln.rstrip()
-
- # Collapse lines with trailing '\\'.
- if script and script[-1][-1] == '\\':
- script[-1] = script[-1][:-1] + ln
- else:
- script.append(ln)
- elif 'XFAIL:' in ln:
- items = ln[ln.index('XFAIL:') + 6:].split(',')
- xfails.extend([s.strip() for s in items])
- elif 'XTARGET:' in ln:
- items = ln[ln.index('XTARGET:') + 8:].split(',')
- xtargets.extend([s.strip() for s in items])
- elif 'REQUIRES:' in ln:
- items = ln[ln.index('REQUIRES:') + 9:].split(',')
- requires.extend([s.strip() for s in items])
- elif 'END.' in ln:
- # Check for END. lines.
- if ln[ln.index('END.'):].strip() == 'END.':
- break
-
- # Apply substitutions to the script.
- def processLine(ln):
- # Apply substitutions
- for a,b in substitutions:
- ln = ln.replace(a,b)
-
- # Strip the trailing newline and any extra whitespace.
- return ln.strip()
- script = map(processLine, script)
-
- # Verify the script contains a run line.
- if not script:
- return (Test.UNRESOLVED, "Test has no run line!")
-
- # Check for unterminated run lines.
- if script[-1][-1] == '\\':
- return (Test.UNRESOLVED, "Test has unterminated run lines (with '\\')")
-
- # Check that we have the required features:
- missing_required_features = [f for f in requires
- if f not in test.config.available_features]
- if missing_required_features:
- msg = ', '.join(missing_required_features)
- return (Test.UNSUPPORTED,
- "Test requires the following features: %s" % msg)
-
- isXFail = isExpectedFail(xfails, xtargets, test.suite.config.target_triple)
- return script,isXFail,tmpBase,execdir
-
-def formatTestOutput(status, out, err, exitCode, failDueToStderr, script):
- output = StringIO.StringIO()
- print >>output, "Script:"
- print >>output, "--"
- print >>output, '\n'.join(script)
- print >>output, "--"
- print >>output, "Exit Code: %r" % exitCode,
- if failDueToStderr:
- print >>output, "(but there was output on stderr)"
- else:
- print >>output
- if out:
- print >>output, "Command Output (stdout):"
- print >>output, "--"
- output.write(out)
- print >>output, "--"
- if err:
- print >>output, "Command Output (stderr):"
- print >>output, "--"
- output.write(err)
- print >>output, "--"
- return (status, output.getvalue())
-
-def executeTclTest(test, litConfig):
- if test.config.unsupported:
- return (Test.UNSUPPORTED, 'Test is unsupported')
-
- # Parse the test script, normalizing slashes in substitutions on Windows
- # (since otherwise Tcl style lexing will treat them as escapes).
- res = parseIntegratedTestScript(test, normalize_slashes=kIsWindows)
- if len(res) == 2:
- return res
-
- script, isXFail, tmpBase, execdir = res
-
- if litConfig.noExecute:
- return (Test.PASS, '')
-
- # Create the output directory if it does not already exist.
- Util.mkdir_p(os.path.dirname(tmpBase))
-
- res = executeTclScriptInternal(test, litConfig, tmpBase, script, execdir)
- if len(res) == 2:
- return res
-
- # Test for failure. In addition to the exit code, Tcl commands are
- # considered to fail if there is any standard error output.
- out,err,exitCode = res
- if isXFail:
- ok = exitCode != 0 or err
- if ok:
- status = Test.XFAIL
- else:
- status = Test.XPASS
- else:
- ok = exitCode == 0 and not err
- if ok:
- status = Test.PASS
- else:
- status = Test.FAIL
-
- if ok:
- return (status,'')
-
- # Set a flag for formatTestOutput so it can explain why the test was
- # considered to have failed, despite having an exit code of 0.
- failDueToStderr = exitCode == 0 and err
-
- return formatTestOutput(status, out, err, exitCode, failDueToStderr, script)
-
-def executeShTest(test, litConfig, useExternalSh):
- if test.config.unsupported:
- return (Test.UNSUPPORTED, 'Test is unsupported')
-
- res = parseIntegratedTestScript(test)
- if len(res) == 2:
- return res
-
- script, isXFail, tmpBase, execdir = res
-
- if litConfig.noExecute:
- return (Test.PASS, '')
-
- # Create the output directory if it does not already exist.
- Util.mkdir_p(os.path.dirname(tmpBase))
-
- if useExternalSh:
- res = executeScript(test, litConfig, tmpBase, script, execdir)
- else:
- res = executeScriptInternal(test, litConfig, tmpBase, script, execdir)
- if len(res) == 2:
- return res
-
- out,err,exitCode = res
- if isXFail:
- ok = exitCode != 0
- if ok:
- status = Test.XFAIL
- else:
- status = Test.XPASS
- else:
- ok = exitCode == 0
- if ok:
- status = Test.PASS
- else:
- status = Test.FAIL
-
- if ok:
- return (status,'')
-
- # Sh tests are not considered to fail just from stderr output.
- failDueToStderr = False
-
- return formatTestOutput(status, out, err, exitCode, failDueToStderr, script)
diff --git a/contrib/llvm/utils/lit/lit/TestingConfig.py b/contrib/llvm/utils/lit/lit/TestingConfig.py
deleted file mode 100644
index 5c1b273..0000000
--- a/contrib/llvm/utils/lit/lit/TestingConfig.py
+++ /dev/null
@@ -1,101 +0,0 @@
-import os
-
-class TestingConfig:
- """"
- TestingConfig - Information on the tests inside a suite.
- """
-
- @staticmethod
- def frompath(path, parent, litConfig, mustExist, config = None):
- if config is None:
- # Set the environment based on the command line arguments.
- environment = {
- 'LD_LIBRARY_PATH' : os.environ.get('LD_LIBRARY_PATH',''),
- 'PATH' : os.pathsep.join(litConfig.path +
- [os.environ.get('PATH','')]),
- 'PATHEXT' : os.environ.get('PATHEXT',''),
- 'SYSTEMROOT' : os.environ.get('SYSTEMROOT',''),
- 'LLVM_DISABLE_CRT_DEBUG' : '1',
- }
-
- config = TestingConfig(parent,
- name = '<unnamed>',
- suffixes = set(),
- test_format = None,
- environment = environment,
- substitutions = [],
- unsupported = False,
- on_clone = None,
- test_exec_root = None,
- test_source_root = None,
- excludes = [],
- available_features = [])
-
- if os.path.exists(path):
- # FIXME: Improve detection and error reporting of errors in the
- # config file.
- f = open(path)
- cfg_globals = dict(globals())
- cfg_globals['config'] = config
- cfg_globals['lit'] = litConfig
- cfg_globals['__file__'] = path
- try:
- exec f in cfg_globals
- except SystemExit,status:
- # We allow normal system exit inside a config file to just
- # return control without error.
- if status.args:
- raise
- f.close()
- elif mustExist:
- litConfig.fatal('unable to load config from %r ' % path)
-
- config.finish(litConfig)
- return config
-
- def __init__(self, parent, name, suffixes, test_format,
- environment, substitutions, unsupported, on_clone,
- test_exec_root, test_source_root, excludes,
- available_features):
- self.parent = parent
- self.name = str(name)
- self.suffixes = set(suffixes)
- self.test_format = test_format
- self.environment = dict(environment)
- self.substitutions = list(substitutions)
- self.unsupported = unsupported
- self.on_clone = on_clone
- self.test_exec_root = test_exec_root
- self.test_source_root = test_source_root
- self.excludes = set(excludes)
- self.available_features = set(available_features)
-
- def clone(self, path):
- # FIXME: Chain implementations?
- #
- # FIXME: Allow extra parameters?
- cfg = TestingConfig(self, self.name, self.suffixes, self.test_format,
- self.environment, self.substitutions,
- self.unsupported, self.on_clone,
- self.test_exec_root, self.test_source_root,
- self.excludes, self.available_features)
- if cfg.on_clone:
- cfg.on_clone(self, cfg, path)
- return cfg
-
- def finish(self, litConfig):
- """finish() - Finish this config object, after loading is complete."""
-
- self.name = str(self.name)
- self.suffixes = set(self.suffixes)
- self.environment = dict(self.environment)
- self.substitutions = list(self.substitutions)
- if self.test_exec_root is not None:
- # FIXME: This should really only be suite in test suite config
- # files. Should we distinguish them?
- self.test_exec_root = str(self.test_exec_root)
- if self.test_source_root is not None:
- # FIXME: This should really only be suite in test suite config
- # files. Should we distinguish them?
- self.test_source_root = str(self.test_source_root)
- self.excludes = set(self.excludes)
diff --git a/contrib/llvm/utils/lit/lit/Util.py b/contrib/llvm/utils/lit/lit/Util.py
deleted file mode 100644
index 414b714..0000000
--- a/contrib/llvm/utils/lit/lit/Util.py
+++ /dev/null
@@ -1,125 +0,0 @@
-import os, sys
-
-def detectCPUs():
- """
- Detects the number of CPUs on a system. Cribbed from pp.
- """
- # Linux, Unix and MacOS:
- if hasattr(os, "sysconf"):
- if os.sysconf_names.has_key("SC_NPROCESSORS_ONLN"):
- # Linux & Unix:
- ncpus = os.sysconf("SC_NPROCESSORS_ONLN")
- if isinstance(ncpus, int) and ncpus > 0:
- return ncpus
- else: # OSX:
- return int(os.popen2("sysctl -n hw.ncpu")[1].read())
- # Windows:
- if os.environ.has_key("NUMBER_OF_PROCESSORS"):
- ncpus = int(os.environ["NUMBER_OF_PROCESSORS"])
- if ncpus > 0:
- return ncpus
- return 1 # Default
-
-def mkdir_p(path):
- """mkdir_p(path) - Make the "path" directory, if it does not exist; this
- will also make directories for any missing parent directories."""
- import errno
-
- if not path or os.path.exists(path):
- return
-
- parent = os.path.dirname(path)
- if parent != path:
- mkdir_p(parent)
-
- try:
- os.mkdir(path)
- except OSError,e:
- # Ignore EEXIST, which may occur during a race condition.
- if e.errno != errno.EEXIST:
- raise
-
-def capture(args, env=None):
- import subprocess
- """capture(command) - Run the given command (or argv list) in a shell and
- return the standard output."""
- p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
- env=env)
- out,_ = p.communicate()
- return out
-
-def which(command, paths = None):
- """which(command, [paths]) - Look up the given command in the paths string
- (or the PATH environment variable, if unspecified)."""
-
- if paths is None:
- paths = os.environ.get('PATH','')
-
- # Check for absolute match first.
- if os.path.exists(command):
- return command
-
- # Would be nice if Python had a lib function for this.
- if not paths:
- paths = os.defpath
-
- # Get suffixes to search.
- pathext = os.environ.get('PATHEXT', '').split(os.pathsep)
-
- # Search the paths...
- for path in paths.split(os.pathsep):
- for ext in pathext:
- p = os.path.join(path, command + ext)
- if os.path.exists(p):
- return p
-
- return None
-
-def printHistogram(items, title = 'Items'):
- import itertools, math
-
- items.sort(key = lambda (_,v): v)
-
- maxValue = max([v for _,v in items])
-
- # Select first "nice" bar height that produces more than 10 bars.
- power = int(math.ceil(math.log(maxValue, 10)))
- for inc in itertools.cycle((5, 2, 2.5, 1)):
- barH = inc * 10**power
- N = int(math.ceil(maxValue / barH))
- if N > 10:
- break
- elif inc == 1:
- power -= 1
-
- histo = [set() for i in range(N)]
- for name,v in items:
- bin = min(int(N * v/maxValue), N-1)
- histo[bin].add(name)
-
- barW = 40
- hr = '-' * (barW + 34)
- print '\nSlowest %s:' % title
- print hr
- for name,value in items[-20:]:
- print '%.2fs: %s' % (value, name)
- print '\n%s Times:' % title
- print hr
- pDigits = int(math.ceil(math.log(maxValue, 10)))
- pfDigits = max(0, 3-pDigits)
- if pfDigits:
- pDigits += pfDigits + 1
- cDigits = int(math.ceil(math.log(len(items), 10)))
- print "[%s] :: [%s] :: [%s]" % ('Range'.center((pDigits+1)*2 + 3),
- 'Percentage'.center(barW),
- 'Count'.center(cDigits*2 + 1))
- print hr
- for i,row in enumerate(histo):
- pct = float(len(row)) / len(items)
- w = int(barW * pct)
- print "[%*.*fs,%*.*fs)" % (pDigits, pfDigits, i*barH,
- pDigits, pfDigits, (i+1)*barH),
- print ":: [%s%s] :: [%*d/%*d]" % ('*'*w, ' '*(barW-w),
- cDigits, len(row),
- cDigits, len(items))
-
diff --git a/contrib/llvm/utils/lit/lit/__init__.py b/contrib/llvm/utils/lit/lit/__init__.py
deleted file mode 100644
index 0102602..0000000
--- a/contrib/llvm/utils/lit/lit/__init__.py
+++ /dev/null
@@ -1,10 +0,0 @@
-"""'lit' Testing Tool"""
-
-from lit import main
-
-__author__ = 'Daniel Dunbar'
-__email__ = 'daniel@zuster.org'
-__versioninfo__ = (0, 1, 0)
-__version__ = '.'.join(map(str, __versioninfo__))
-
-__all__ = []
diff --git a/contrib/llvm/utils/lit/lit/lit.py b/contrib/llvm/utils/lit/lit/lit.py
deleted file mode 100755
index 13d2630..0000000
--- a/contrib/llvm/utils/lit/lit/lit.py
+++ /dev/null
@@ -1,648 +0,0 @@
-#!/usr/bin/env python
-
-"""
-lit - LLVM Integrated Tester.
-
-See lit.pod for more information.
-"""
-
-import math, os, platform, random, re, sys, time, threading, traceback
-
-import ProgressBar
-import TestRunner
-import Util
-
-from TestingConfig import TestingConfig
-import LitConfig
-import Test
-
-# Configuration files to look for when discovering test suites. These can be
-# overridden with --config-prefix.
-#
-# FIXME: Rename to 'config.lit', 'site.lit', and 'local.lit' ?
-gConfigName = 'lit.cfg'
-gSiteConfigName = 'lit.site.cfg'
-
-kLocalConfigName = 'lit.local.cfg'
-
-class TestingProgressDisplay:
- def __init__(self, opts, numTests, progressBar=None):
- self.opts = opts
- self.numTests = numTests
- self.current = None
- self.lock = threading.Lock()
- self.progressBar = progressBar
- self.completed = 0
-
- def update(self, test):
- # Avoid locking overhead in quiet mode
- if self.opts.quiet and not test.result.isFailure:
- self.completed += 1
- return
-
- # Output lock.
- self.lock.acquire()
- try:
- self.handleUpdate(test)
- finally:
- self.lock.release()
-
- def finish(self):
- if self.progressBar:
- self.progressBar.clear()
- elif self.opts.quiet:
- pass
- elif self.opts.succinct:
- sys.stdout.write('\n')
-
- def handleUpdate(self, test):
- self.completed += 1
- if self.progressBar:
- self.progressBar.update(float(self.completed)/self.numTests,
- test.getFullName())
-
- if self.opts.succinct and not test.result.isFailure:
- return
-
- if self.progressBar:
- self.progressBar.clear()
-
- print '%s: %s (%d of %d)' % (test.result.name, test.getFullName(),
- self.completed, self.numTests)
-
- if test.result.isFailure and self.opts.showOutput:
- print "%s TEST '%s' FAILED %s" % ('*'*20, test.getFullName(),
- '*'*20)
- print test.output
- print "*" * 20
-
- sys.stdout.flush()
-
-class TestProvider:
- def __init__(self, tests, maxTime):
- self.maxTime = maxTime
- self.iter = iter(tests)
- self.lock = threading.Lock()
- self.startTime = time.time()
-
- def get(self):
- # Check if we have run out of time.
- if self.maxTime is not None:
- if time.time() - self.startTime > self.maxTime:
- return None
-
- # Otherwise take the next test.
- self.lock.acquire()
- try:
- item = self.iter.next()
- except StopIteration:
- item = None
- self.lock.release()
- return item
-
-class Tester(threading.Thread):
- def __init__(self, litConfig, provider, display):
- threading.Thread.__init__(self)
- self.litConfig = litConfig
- self.provider = provider
- self.display = display
-
- def run(self):
- while 1:
- item = self.provider.get()
- if item is None:
- break
- self.runTest(item)
-
- def runTest(self, test):
- result = None
- startTime = time.time()
- try:
- result, output = test.config.test_format.execute(test,
- self.litConfig)
- except KeyboardInterrupt:
- # This is a sad hack. Unfortunately subprocess goes
- # bonkers with ctrl-c and we start forking merrily.
- print '\nCtrl-C detected, goodbye.'
- os.kill(0,9)
- except:
- if self.litConfig.debug:
- raise
- result = Test.UNRESOLVED
- output = 'Exception during script execution:\n'
- output += traceback.format_exc()
- output += '\n'
- elapsed = time.time() - startTime
-
- test.setResult(result, output, elapsed)
- self.display.update(test)
-
-def dirContainsTestSuite(path):
- cfgpath = os.path.join(path, gSiteConfigName)
- if os.path.exists(cfgpath):
- return cfgpath
- cfgpath = os.path.join(path, gConfigName)
- if os.path.exists(cfgpath):
- return cfgpath
-
-def getTestSuite(item, litConfig, cache):
- """getTestSuite(item, litConfig, cache) -> (suite, relative_path)
-
- Find the test suite containing @arg item.
-
- @retval (None, ...) - Indicates no test suite contains @arg item.
- @retval (suite, relative_path) - The suite that @arg item is in, and its
- relative path inside that suite.
- """
- def search1(path):
- # Check for a site config or a lit config.
- cfgpath = dirContainsTestSuite(path)
-
- # If we didn't find a config file, keep looking.
- if not cfgpath:
- parent,base = os.path.split(path)
- if parent == path:
- return (None, ())
-
- ts, relative = search(parent)
- return (ts, relative + (base,))
-
- # We found a config file, load it.
- if litConfig.debug:
- litConfig.note('loading suite config %r' % cfgpath)
-
- cfg = TestingConfig.frompath(cfgpath, None, litConfig, mustExist = True)
- source_root = os.path.realpath(cfg.test_source_root or path)
- exec_root = os.path.realpath(cfg.test_exec_root or path)
- return Test.TestSuite(cfg.name, source_root, exec_root, cfg), ()
-
- def search(path):
- # Check for an already instantiated test suite.
- res = cache.get(path)
- if res is None:
- cache[path] = res = search1(path)
- return res
-
- # Canonicalize the path.
- item = os.path.realpath(item)
-
- # Skip files and virtual components.
- components = []
- while not os.path.isdir(item):
- parent,base = os.path.split(item)
- if parent == item:
- return (None, ())
- components.append(base)
- item = parent
- components.reverse()
-
- ts, relative = search(item)
- return ts, tuple(relative + tuple(components))
-
-def getLocalConfig(ts, path_in_suite, litConfig, cache):
- def search1(path_in_suite):
- # Get the parent config.
- if not path_in_suite:
- parent = ts.config
- else:
- parent = search(path_in_suite[:-1])
-
- # Load the local configuration.
- source_path = ts.getSourcePath(path_in_suite)
- cfgpath = os.path.join(source_path, kLocalConfigName)
- if litConfig.debug:
- litConfig.note('loading local config %r' % cfgpath)
- return TestingConfig.frompath(cfgpath, parent, litConfig,
- mustExist = False,
- config = parent.clone(cfgpath))
-
- def search(path_in_suite):
- key = (ts, path_in_suite)
- res = cache.get(key)
- if res is None:
- cache[key] = res = search1(path_in_suite)
- return res
-
- return search(path_in_suite)
-
-def getTests(path, litConfig, testSuiteCache, localConfigCache):
- # Find the test suite for this input and its relative path.
- ts,path_in_suite = getTestSuite(path, litConfig, testSuiteCache)
- if ts is None:
- litConfig.warning('unable to find test suite for %r' % path)
- return (),()
-
- if litConfig.debug:
- litConfig.note('resolved input %r to %r::%r' % (path, ts.name,
- path_in_suite))
-
- return ts, getTestsInSuite(ts, path_in_suite, litConfig,
- testSuiteCache, localConfigCache)
-
-def getTestsInSuite(ts, path_in_suite, litConfig,
- testSuiteCache, localConfigCache):
- # Check that the source path exists (errors here are reported by the
- # caller).
- source_path = ts.getSourcePath(path_in_suite)
- if not os.path.exists(source_path):
- return
-
- # Check if the user named a test directly.
- if not os.path.isdir(source_path):
- lc = getLocalConfig(ts, path_in_suite[:-1], litConfig, localConfigCache)
- yield Test.Test(ts, path_in_suite, lc)
- return
-
- # Otherwise we have a directory to search for tests, start by getting the
- # local configuration.
- lc = getLocalConfig(ts, path_in_suite, litConfig, localConfigCache)
-
- # Search for tests.
- if lc.test_format is not None:
- for res in lc.test_format.getTestsInDirectory(ts, path_in_suite,
- litConfig, lc):
- yield res
-
- # Search subdirectories.
- for filename in os.listdir(source_path):
- # FIXME: This doesn't belong here?
- if filename in ('Output', '.svn') or filename in lc.excludes:
- continue
-
- # Ignore non-directories.
- file_sourcepath = os.path.join(source_path, filename)
- if not os.path.isdir(file_sourcepath):
- continue
-
- # Check for nested test suites, first in the execpath in case there is a
- # site configuration and then in the source path.
- file_execpath = ts.getExecPath(path_in_suite + (filename,))
- if dirContainsTestSuite(file_execpath):
- sub_ts, subiter = getTests(file_execpath, litConfig,
- testSuiteCache, localConfigCache)
- elif dirContainsTestSuite(file_sourcepath):
- sub_ts, subiter = getTests(file_sourcepath, litConfig,
- testSuiteCache, localConfigCache)
- else:
- # Otherwise, continue loading from inside this test suite.
- subiter = getTestsInSuite(ts, path_in_suite + (filename,),
- litConfig, testSuiteCache,
- localConfigCache)
- sub_ts = None
-
- N = 0
- for res in subiter:
- N += 1
- yield res
- if sub_ts and not N:
- litConfig.warning('test suite %r contained no tests' % sub_ts.name)
-
-def runTests(numThreads, litConfig, provider, display):
- # If only using one testing thread, don't use threads at all; this lets us
- # profile, among other things.
- if numThreads == 1:
- t = Tester(litConfig, provider, display)
- t.run()
- return
-
- # Otherwise spin up the testing threads and wait for them to finish.
- testers = [Tester(litConfig, provider, display)
- for i in range(numThreads)]
- for t in testers:
- t.start()
- try:
- for t in testers:
- t.join()
- except KeyboardInterrupt:
- sys.exit(2)
-
-def load_test_suite(inputs):
- import unittest
-
- # Create the global config object.
- litConfig = LitConfig.LitConfig(progname = 'lit',
- path = [],
- quiet = False,
- useValgrind = False,
- valgrindLeakCheck = False,
- valgrindArgs = [],
- useTclAsSh = False,
- noExecute = False,
- debug = False,
- isWindows = (platform.system()=='Windows'),
- params = {})
-
- # Load the tests from the inputs.
- tests = []
- testSuiteCache = {}
- localConfigCache = {}
- for input in inputs:
- prev = len(tests)
- tests.extend(getTests(input, litConfig,
- testSuiteCache, localConfigCache)[1])
- if prev == len(tests):
- litConfig.warning('input %r contained no tests' % input)
-
- # If there were any errors during test discovery, exit now.
- if litConfig.numErrors:
- print >>sys.stderr, '%d errors, exiting.' % litConfig.numErrors
- sys.exit(2)
-
- # Return a unittest test suite which just runs the tests in order.
- def get_test_fn(test):
- return unittest.FunctionTestCase(
- lambda: test.config.test_format.execute(
- test, litConfig),
- description = test.getFullName())
-
- from LitTestCase import LitTestCase
- return unittest.TestSuite([LitTestCase(test, litConfig) for test in tests])
-
-def main(builtinParameters = {}): # Bump the GIL check interval, its more important to get any one thread to a
- # blocking operation (hopefully exec) than to try and unblock other threads.
- #
- # FIXME: This is a hack.
- import sys
- sys.setcheckinterval(1000)
-
- global options
- from optparse import OptionParser, OptionGroup
- parser = OptionParser("usage: %prog [options] {file-or-path}")
-
- parser.add_option("-j", "--threads", dest="numThreads", metavar="N",
- help="Number of testing threads",
- type=int, action="store", default=None)
- parser.add_option("", "--config-prefix", dest="configPrefix",
- metavar="NAME", help="Prefix for 'lit' config files",
- action="store", default=None)
- parser.add_option("", "--param", dest="userParameters",
- metavar="NAME=VAL",
- help="Add 'NAME' = 'VAL' to the user defined parameters",
- type=str, action="append", default=[])
-
- group = OptionGroup(parser, "Output Format")
- # FIXME: I find these names very confusing, although I like the
- # functionality.
- group.add_option("-q", "--quiet", dest="quiet",
- help="Suppress no error output",
- action="store_true", default=False)
- group.add_option("-s", "--succinct", dest="succinct",
- help="Reduce amount of output",
- action="store_true", default=False)
- group.add_option("-v", "--verbose", dest="showOutput",
- help="Show all test output",
- action="store_true", default=False)
- group.add_option("", "--no-progress-bar", dest="useProgressBar",
- help="Do not use curses based progress bar",
- action="store_false", default=True)
- parser.add_option_group(group)
-
- group = OptionGroup(parser, "Test Execution")
- group.add_option("", "--path", dest="path",
- help="Additional paths to add to testing environment",
- action="append", type=str, default=[])
- group.add_option("", "--vg", dest="useValgrind",
- help="Run tests under valgrind",
- action="store_true", default=False)
- group.add_option("", "--vg-leak", dest="valgrindLeakCheck",
- help="Check for memory leaks under valgrind",
- action="store_true", default=False)
- group.add_option("", "--vg-arg", dest="valgrindArgs", metavar="ARG",
- help="Specify an extra argument for valgrind",
- type=str, action="append", default=[])
- group.add_option("", "--time-tests", dest="timeTests",
- help="Track elapsed wall time for each test",
- action="store_true", default=False)
- group.add_option("", "--no-execute", dest="noExecute",
- help="Don't execute any tests (assume PASS)",
- action="store_true", default=False)
- parser.add_option_group(group)
-
- group = OptionGroup(parser, "Test Selection")
- group.add_option("", "--max-tests", dest="maxTests", metavar="N",
- help="Maximum number of tests to run",
- action="store", type=int, default=None)
- group.add_option("", "--max-time", dest="maxTime", metavar="N",
- help="Maximum time to spend testing (in seconds)",
- action="store", type=float, default=None)
- group.add_option("", "--shuffle", dest="shuffle",
- help="Run tests in random order",
- action="store_true", default=False)
- parser.add_option_group(group)
-
- group = OptionGroup(parser, "Debug and Experimental Options")
- group.add_option("", "--debug", dest="debug",
- help="Enable debugging (for 'lit' development)",
- action="store_true", default=False)
- group.add_option("", "--show-suites", dest="showSuites",
- help="Show discovered test suites",
- action="store_true", default=False)
- group.add_option("", "--no-tcl-as-sh", dest="useTclAsSh",
- help="Don't run Tcl scripts using 'sh'",
- action="store_false", default=True)
- group.add_option("", "--repeat", dest="repeatTests", metavar="N",
- help="Repeat tests N times (for timing)",
- action="store", default=None, type=int)
- parser.add_option_group(group)
-
- (opts, args) = parser.parse_args()
-
- if not args:
- parser.error('No inputs specified')
-
- if opts.configPrefix is not None:
- global gConfigName, gSiteConfigName
- gConfigName = '%s.cfg' % opts.configPrefix
- gSiteConfigName = '%s.site.cfg' % opts.configPrefix
-
- if opts.numThreads is None:
-# Python <2.5 has a race condition causing lit to always fail with numThreads>1
-# http://bugs.python.org/issue1731717
-# I haven't seen this bug occur with 2.5.2 and later, so only enable multiple
-# threads by default there.
- if sys.hexversion >= 0x2050200:
- opts.numThreads = Util.detectCPUs()
- else:
- opts.numThreads = 1
-
- inputs = args
-
- # Create the user defined parameters.
- userParams = dict(builtinParameters)
- for entry in opts.userParameters:
- if '=' not in entry:
- name,val = entry,''
- else:
- name,val = entry.split('=', 1)
- userParams[name] = val
-
- # Create the global config object.
- litConfig = LitConfig.LitConfig(progname = os.path.basename(sys.argv[0]),
- path = opts.path,
- quiet = opts.quiet,
- useValgrind = opts.useValgrind,
- valgrindLeakCheck = opts.valgrindLeakCheck,
- valgrindArgs = opts.valgrindArgs,
- useTclAsSh = opts.useTclAsSh,
- noExecute = opts.noExecute,
- debug = opts.debug,
- isWindows = (platform.system()=='Windows'),
- params = userParams)
-
- # Expand '@...' form in inputs.
- actual_inputs = []
- for input in inputs:
- if os.path.exists(input) or not input.startswith('@'):
- actual_inputs.append(input)
- else:
- f = open(input[1:])
- try:
- for ln in f:
- ln = ln.strip()
- if ln:
- actual_inputs.append(ln)
- finally:
- f.close()
-
-
- # Load the tests from the inputs.
- tests = []
- testSuiteCache = {}
- localConfigCache = {}
- for input in actual_inputs:
- prev = len(tests)
- tests.extend(getTests(input, litConfig,
- testSuiteCache, localConfigCache)[1])
- if prev == len(tests):
- litConfig.warning('input %r contained no tests' % input)
-
- # If there were any errors during test discovery, exit now.
- if litConfig.numErrors:
- print >>sys.stderr, '%d errors, exiting.' % litConfig.numErrors
- sys.exit(2)
-
- if opts.showSuites:
- suitesAndTests = dict([(ts,[])
- for ts,_ in testSuiteCache.values()
- if ts])
- for t in tests:
- suitesAndTests[t.suite].append(t)
-
- print '-- Test Suites --'
- suitesAndTests = suitesAndTests.items()
- suitesAndTests.sort(key = lambda (ts,_): ts.name)
- for ts,ts_tests in suitesAndTests:
- print ' %s - %d tests' %(ts.name, len(ts_tests))
- print ' Source Root: %s' % ts.source_root
- print ' Exec Root : %s' % ts.exec_root
-
- # Select and order the tests.
- numTotalTests = len(tests)
- if opts.shuffle:
- random.shuffle(tests)
- else:
- tests.sort(key = lambda t: t.getFullName())
- if opts.maxTests is not None:
- tests = tests[:opts.maxTests]
-
- extra = ''
- if len(tests) != numTotalTests:
- extra = ' of %d' % numTotalTests
- header = '-- Testing: %d%s tests, %d threads --'%(len(tests),extra,
- opts.numThreads)
-
- if opts.repeatTests:
- tests = [t.copyWithIndex(i)
- for t in tests
- for i in range(opts.repeatTests)]
-
- progressBar = None
- if not opts.quiet:
- if opts.succinct and opts.useProgressBar:
- try:
- tc = ProgressBar.TerminalController()
- progressBar = ProgressBar.ProgressBar(tc, header)
- except ValueError:
- print header
- progressBar = ProgressBar.SimpleProgressBar('Testing: ')
- else:
- print header
-
- # Don't create more threads than tests.
- opts.numThreads = min(len(tests), opts.numThreads)
-
- startTime = time.time()
- display = TestingProgressDisplay(opts, len(tests), progressBar)
- provider = TestProvider(tests, opts.maxTime)
- runTests(opts.numThreads, litConfig, provider, display)
- display.finish()
-
- if not opts.quiet:
- print 'Testing Time: %.2fs'%(time.time() - startTime)
-
- # Update results for any tests which weren't run.
- for t in tests:
- if t.result is None:
- t.setResult(Test.UNRESOLVED, '', 0.0)
-
- # List test results organized by kind.
- hasFailures = False
- byCode = {}
- for t in tests:
- if t.result not in byCode:
- byCode[t.result] = []
- byCode[t.result].append(t)
- if t.result.isFailure:
- hasFailures = True
-
- # FIXME: Show unresolved and (optionally) unsupported tests.
- for title,code in (('Unexpected Passing Tests', Test.XPASS),
- ('Failing Tests', Test.FAIL)):
- elts = byCode.get(code)
- if not elts:
- continue
- print '*'*20
- print '%s (%d):' % (title, len(elts))
- for t in elts:
- print ' %s' % t.getFullName()
- print
-
- if opts.timeTests:
- # Collate, in case we repeated tests.
- times = {}
- for t in tests:
- key = t.getFullName()
- times[key] = times.get(key, 0.) + t.elapsed
-
- byTime = list(times.items())
- byTime.sort(key = lambda (name,elapsed): elapsed)
- if byTime:
- Util.printHistogram(byTime, title='Tests')
-
- for name,code in (('Expected Passes ', Test.PASS),
- ('Expected Failures ', Test.XFAIL),
- ('Unsupported Tests ', Test.UNSUPPORTED),
- ('Unresolved Tests ', Test.UNRESOLVED),
- ('Unexpected Passes ', Test.XPASS),
- ('Unexpected Failures', Test.FAIL),):
- if opts.quiet and not code.isFailure:
- continue
- N = len(byCode.get(code,[]))
- if N:
- print ' %s: %d' % (name,N)
-
- # If we encountered any additional errors, exit abnormally.
- if litConfig.numErrors:
- print >>sys.stderr, '\n%d error(s), exiting.' % litConfig.numErrors
- sys.exit(2)
-
- # Warn about warnings.
- if litConfig.numWarnings:
- print >>sys.stderr, '\n%d warning(s) in tests.' % litConfig.numWarnings
-
- if hasFailures:
- sys.exit(1)
- sys.exit(0)
-
-if __name__=='__main__':
- main()
diff --git a/contrib/llvm/utils/lit/setup.py b/contrib/llvm/utils/lit/setup.py
deleted file mode 100644
index e6ae3d8..0000000
--- a/contrib/llvm/utils/lit/setup.py
+++ /dev/null
@@ -1,69 +0,0 @@
-import lit
-
-# FIXME: Support distutils?
-from setuptools import setup, find_packages
-setup(
- name = "Lit",
- version = lit.__version__,
-
- author = lit.__author__,
- author_email = lit.__email__,
- url = 'http://llvm.org',
- license = 'BSD',
-
- description = "A Software Testing Tool",
- keywords = 'test C++ automatic discovery',
- long_description = """\
-Lit
-+++
-
-About
-=====
-
-Lit is a portable tool for executing LLVM and Clang style test suites,
-summarizing their results, and providing indication of failures. Lit is designed
-to be a lightweight testing tool with as simple a user interface as possible.
-
-
-Features
-========
-
- * Portable!
- * Flexible test discovery.
- * Parallel test execution.
- * Support for multiple test formats and test suite designs.
-
-
-Documentation
-=============
-
-The offical Lit documentation is in the man page, available online in the `LLVM
-Command Guide http://llvm.org/cmds/lit.html`_.
-
-
-Source
-======
-
-The Lit source is available as part of LLVM, in the `LLVM SVN repository
-<http://llvm.org/svn/llvm-project/llvm/trunk/utils/lit`_.
-""",
-
- classifiers=[
- 'Development Status :: 3 - Alpha',
- 'Environment :: Console',
- 'Intended Audience :: Developers',
- 'License :: OSI Approved :: University of Illinois/NCSA Open Source License',
- 'Natural Language :: English',
- 'Operating System :: OS Independent',
- 'Progamming Language :: Python',
- 'Topic :: Software Development :: Testing',
- ],
-
- zip_safe = False,
- packages = find_packages(),
- entry_points = {
- 'console_scripts': [
- 'lit = lit:main',
- ],
- }
-)
diff --git a/contrib/llvm/utils/llvm-lit/Makefile b/contrib/llvm/utils/llvm-lit/Makefile
deleted file mode 100644
index 702591f..0000000
--- a/contrib/llvm/utils/llvm-lit/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-##===- utils/llvm-lit/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.common
-
-all:: $(ToolDir)/llvm-lit
-
-$(ToolDir)/llvm-lit: llvm-lit.in $(ToolDir)/.dir
- $(Echo) "Creating 'llvm-lit' script..."
- $(Verb)sed -e "s#@LLVM_SOURCE_DIR@#$(LLVM_SRC_ROOT)#g" \
- -e "s#@LLVM_BINARY_DIR@#$(LLVM_OBJ_ROOT)#g" \
- $< > $@
- $(Verb)chmod +x $@
diff --git a/contrib/llvm/utils/llvm-lit/llvm-lit.in b/contrib/llvm/utils/llvm-lit/llvm-lit.in
deleted file mode 100644
index 3ff2c24..0000000
--- a/contrib/llvm/utils/llvm-lit/llvm-lit.in
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env python
-
-import os
-import sys
-
-# Variables configured at build time.
-llvm_source_root = "@LLVM_SOURCE_DIR@"
-llvm_obj_root = "@LLVM_BINARY_DIR@"
-
-# Make sure we can find the lit package.
-sys.path.append(os.path.join(llvm_source_root, 'utils', 'lit'))
-
-# Set up some builtin parameters, so that by default the LLVM test suite
-# configuration file knows how to find the object tree.
-builtin_parameters = {
- 'llvm_site_config' : os.path.join(llvm_obj_root, 'test', 'lit.site.cfg')
- }
-
-if __name__=='__main__':
- import lit
- lit.main(builtin_parameters)
diff --git a/contrib/llvm/utils/llvm-native-gcc b/contrib/llvm/utils/llvm-native-gcc
deleted file mode 100755
index b3cecb1..0000000
--- a/contrib/llvm/utils/llvm-native-gcc
+++ /dev/null
@@ -1,249 +0,0 @@
-#!/usr/bin/perl
-# Wrapper around LLVM tools to generate a native .o from llvm-gcc using an
-# LLVM back-end (CBE by default).
-
-# set up defaults.
-$Verbose = 0;
-$SaveTemps = 1;
-$PreprocessOnly = 0;
-$CompileDontLink = 0;
-$Backend = 'cbe';
-chomp ($ProgramName = `basename $0`);
-
-sub boldprint {
- print "", @_, "";
-}
-
-# process command-line options.
-# most of these are passed on to llvm-gcc.
-$GCCOptions = "";
-for ($i = 0; $i <= $#ARGV; ++$i) {
- if ($ARGV[$i] =~ /-mllvm-backend=([a-z0-9]*)/) {
- $Backend = $1;
- if ($ProgramName =~ /llvm-native-gcc/) {
- splice (@ARGV, $i, 1);
- --$i;
- }
- } elsif ($ARGV[$i] eq "-E") {
- $PreprocessOnly = 1;
- } elsif ($ARGV[$i] eq "-c") {
- $GCCOptions .= " " . $ARGV[$i];
- $CompileDontLink = 1;
- } elsif ($ARGV[$i] eq "-v") {
- $GCCOptions .= " " . $ARGV[$i];
- $Verbose = 1;
- } elsif ($ARGV[$i] eq "-o") {
- $OutputFile = $ARGV[$i + 1];
- } elsif ($ARGV[$i] eq "-save-temps") {
- $GCCOptions .= " " . $ARGV[$i];
- $SaveTemps = 1;
- } elsif ($ARGV[$i] =~ /\.bc$/) {
- push (@BytecodeFiles, $ARGV[$i]);
- } elsif ($ARGV[$i] =~ /^-L/) {
- $GCCOptions .= " " . $ARGV[$i];
- push (@LibDirs, $ARGV[$i]);
- } elsif ($ARGV[$i] =~ /^-l/) {
- $GCCOptions .= " " . $ARGV[$i];
- push (@Libs, $ARGV[$i]);
- } elsif ($ARGV[$i] =~ /\.(c|cpp|cc|i|ii|C)$/) {
- $LastCFile = $ARGV[$i];
- }
-}
-
-sub GetDefaultOutputFileName {
- my $DefaultOutputFileBase;
-
- if ($ProgramName =~ /llvm-native-gcc/) {
- $DefaultOutputFileBase = $LastCFile;
- } elsif ($ProgramName =~ /native-build/) {
- $DefaultOutputFileBase = $BytecodeFiles[0];
- }
-
- my $def = $DefaultOutputFileBase;
-
- die "Can't figure out name of output file.\n"
- unless $DefaultOutputFileBase
- && (($ProgramName !~ /native-build/)
- || $#BytecodeFiles == 0);
-
- print "Warning: defaulting output file name ",
- "based on '$DefaultOutputFileBase'\n" if $Verbose;
-
- if ($ProgramName =~ /llvm-native-gcc/) {
- $def =~ s/\.(c|cpp|cc|i|ii|C)$/.o/;
- } elsif ($ProgramName =~ /native-build/) {
- $def =~ s/\.bc$/.$Backend/;
- if ($CompileDontLink) {
- $def .= ".o";
- }
- }
-
- return $def;
-}
-
-# run a command, optionally echoing, and quitting if it fails:
-sub run {
- my $command = join(" ", @_);
- print "$command\n" if $Verbose;
- $command =~ s/\"/\\\"/g;
- system $command and die "$0: $command failed";
-}
-
-sub LinkBytecodeFilesIntoTemporary {
- my $FinalOutputFileName = shift @_;
- my @BytecodeFiles = @_;
-
- my $BCFiles = join (" ", @BytecodeFiles);
- my $LinkedBCFile;
- if ($SaveTemps) {
- $LinkedBCFile = "${FinalOutputFileName}.llvm.bc";
- } else {
- $LinkedBCFile = "/tmp/nativebuild-$$.llvm.bc";
- }
- run "llvm-link -o $LinkedBCFile $BCFiles";
- return $LinkedBCFile;
-}
-
-sub CompileBytecodeToNative {
- my ($BCFile, $Backend, $OutputFile) = @_;
-
- my $GeneratedCode;
- if ($Backend eq 'cbe') {
- if ($SaveTemps) {
- $GeneratedCode = "${OutputFile}.c";
- } else {
- $GeneratedCode = "/tmp/nativebuild-$$.c";
- }
- run "llc -enable-correct-eh-support -march=c -f -o $GeneratedCode $BCFile";
- } elsif ($Backend eq 'llc') {
- if ($SaveTemps) {
- $GeneratedCode = "${OutputFile}.s";
- } else {
- $GeneratedCode = "/tmp/nativebuild-$$.s";
- }
- run "llc -enable-correct-eh-support -f -o $GeneratedCode $BCFile";
- }
- my $LibDirs = join (" ", @LibDirs);
- my $Libs = join (" ", @Libs);
- run "gcc $GCCOptions $GeneratedCode -o $OutputFile $LibDirs $Libs";
- run "rm $BCFile $GeneratedCode"
- unless $SaveTemps;
-}
-
-sub CompileCToNative {
- my ($LLVMGCCCommand, $Backend, $OutputFile) = @_;
- run $LLVMGCCCommand;
- if ($PreprocessOnly) {
- return;
- }
- my $BCFile = "${OutputFile}.llvm.bc";
- if ($CompileDontLink) {
- run "mv ${OutputFile} $BCFile";
- } else { # gccld messes with the output file name
- run "mv ${OutputFile}.bc $BCFile";
- }
- my $GeneratedCode;
- if ($Backend eq 'cbe') {
- $GeneratedCode = "${OutputFile}.cbe.c";
- run "llc -enable-correct-eh-support -march=c -f -o $GeneratedCode $BCFile";
- } elsif ($Backend eq 'llc') {
- $GeneratedCode = "${OutputFile}.llc.s";
- run "llc -enable-correct-eh-support -f -o $GeneratedCode $BCFile";
- }
- my $NativeGCCOptions = "";
- if ($CompileDontLink) {
- $NativeGCCOptions = "-c";
- }
- run "gcc $NativeGCCOptions $GeneratedCode -o $OutputFile";
- run "rm ${OutputFile}.llvm.bc $GeneratedCode"
- unless $SaveTemps;
-}
-
-# guess the name of the output file, if -o was not specified.
-$OutputFile = GetDefaultOutputFileName () unless $OutputFile;
-print "Output file is $OutputFile\n" if $Verbose;
-# do all the dirty work:
-if ($ProgramName eq /native-build/) {
- my $LinkedBCFile = LinkBytecodeFilesIntoTemporary (@BytecodeFiles);
- CompileBytecodeToNative ($LinkedBCFile, $Backend, $OutputFile);
-} elsif ($ProgramName =~ /llvm-native-gcc/) {
- # build the llvm-gcc command line.
- $LLVMGCCCommand = join (" ", ("llvm-gcc", @ARGV));
- CompileCToNative ($LLVMGCCCommand, $Backend, $OutputFile);
-}
-
-# we're done.
-exit 0;
-
-__END__
-
-=pod
-
-=head1 NAME
-
-llvm-native-gcc
-
-=head1 SYNOPSIS
-
-llvm-native-gcc [OPTIONS...] FILE
-
-native-build [OPTIONS...] FILE
-
-=head1 DESCRIPTION
-
-llvm-native-gcc is a wrapper around the LLVM command-line tools which generates
-a native object (.o) file by compiling FILE with llvm-gcc, and then running
-an LLVM back-end (CBE by default) over the resulting bytecode, and then
-compiling the resulting code to a native object file.
-
-If called as "native-build", it compiles bytecode to native code, and takes
-different options.
-
-=head1 OPTIONS
-
-llvm-native-gcc takes the same options as llvm-gcc. All options
-except -mllvm-backend=... are passed on to llvm-gcc.
-
-=over 4
-
-=item -mllvm-backend=BACKEND
-
-Use BACKEND for native code generation.
-
-=item -v
-
-Print command lines that llvm-native-gcc runs.
-
-=item -o FILE
-
-llvm-native-gcc tries to guess the name of the llvm-gcc output file by looking
-for this option in the command line. If it can't find it, it finds the last C
-or C++ source file named on the command line, and turns its suffix into .o. See
-BUGS.
-
-=item -save-temps
-
-Save temporary files used by llvm-native-gcc (and llvm-gcc, and gcc).
-
-=back
-
-=head1 BUGS
-
-llvm-native-gcc only handles the case where llvm-gcc compiles a single
-file per invocation. llvm-native-gcc has weak command-line argument
-parsing and is a poor substitute for making gcc/gcc.c do this stuff.
-
-This manual page does not adequately document native-build mode.
-
-llvm-native-gcc is pretty gross because it represents the blind merging of two
-other scripts that predated it. It could use some code clean-up.
-
-=head1 SEE ALSO
-
-gcc(1)
-
-=head1 AUTHOR
-
-Brian R. Gaeke
-
-=cut
diff --git a/contrib/llvm/utils/llvm-native-gxx b/contrib/llvm/utils/llvm-native-gxx
deleted file mode 100755
index 75164af..0000000
--- a/contrib/llvm/utils/llvm-native-gxx
+++ /dev/null
@@ -1,249 +0,0 @@
-#!/usr/bin/perl
-# Wrapper around LLVM tools to generate a native .o from llvm-gxx using an
-# LLVM back-end (CBE by default).
-
-# set up defaults.
-$Verbose = 0;
-$SaveTemps = 1;
-$PreprocessOnly = 0;
-$CompileDontLink = 0;
-$Backend = 'cbe';
-chomp ($ProgramName = `basename $0`);
-
-sub boldprint {
- print "", @_, "";
-}
-
-# process command-line options.
-# most of these are passed on to llvm-gxx.
-$GCCOptions = "";
-for ($i = 0; $i <= $#ARGV; ++$i) {
- if ($ARGV[$i] =~ /-mllvm-backend=([a-z0-9]*)/) {
- $Backend = $1;
- if ($ProgramName =~ /llvm-native-gxx/) {
- splice (@ARGV, $i, 1);
- --$i;
- }
- } elsif ($ARGV[$i] eq "-E") {
- $PreprocessOnly = 1;
- } elsif ($ARGV[$i] eq "-c") {
- $GCCOptions .= " " . $ARGV[$i];
- $CompileDontLink = 1;
- } elsif ($ARGV[$i] eq "-v") {
- $GCCOptions .= " " . $ARGV[$i];
- $Verbose = 1;
- } elsif ($ARGV[$i] eq "-o") {
- $OutputFile = $ARGV[$i + 1];
- } elsif ($ARGV[$i] eq "-save-temps") {
- $GCCOptions .= " " . $ARGV[$i];
- $SaveTemps = 1;
- } elsif ($ARGV[$i] =~ /\.bc$/) {
- push (@BytecodeFiles, $ARGV[$i]);
- } elsif ($ARGV[$i] =~ /^-L/) {
- $GCCOptions .= " " . $ARGV[$i];
- push (@LibDirs, $ARGV[$i]);
- } elsif ($ARGV[$i] =~ /^-l/) {
- $GCCOptions .= " " . $ARGV[$i];
- push (@Libs, $ARGV[$i]);
- } elsif ($ARGV[$i] =~ /\.(c|cpp|cc|i|ii|C)$/) {
- $LastCFile = $ARGV[$i];
- }
-}
-
-sub GetDefaultOutputFileName {
- my $DefaultOutputFileBase;
-
- if ($ProgramName =~ /llvm-native-gxx/) {
- $DefaultOutputFileBase = $LastCFile;
- } elsif ($ProgramName =~ /native-build/) {
- $DefaultOutputFileBase = $BytecodeFiles[0];
- }
-
- my $def = $DefaultOutputFileBase;
-
- die "Can't figure out name of output file.\n"
- unless $DefaultOutputFileBase
- && (($ProgramName !~ /native-build/)
- || $#BytecodeFiles == 0);
-
- print "Warning: defaulting output file name ",
- "based on '$DefaultOutputFileBase'\n" if $Verbose;
-
- if ($ProgramName =~ /llvm-native-gxx/) {
- $def =~ s/\.(c|cpp|cc|i|ii|C)$/.o/;
- } elsif ($ProgramName =~ /native-build/) {
- $def =~ s/\.bc$/.$Backend/;
- if ($CompileDontLink) {
- $def .= ".o";
- }
- }
-
- return $def;
-}
-
-# run a command, optionally echoing, and quitting if it fails:
-sub run {
- my $command = join(" ", @_);
- print "$command\n" if $Verbose;
- $command =~ s/\"/\\\"/g;
- system $command and die "$0: $command failed";
-}
-
-sub LinkBytecodeFilesIntoTemporary {
- my $FinalOutputFileName = shift @_;
- my @BytecodeFiles = @_;
-
- my $BCFiles = join (" ", @BytecodeFiles);
- my $LinkedBCFile;
- if ($SaveTemps) {
- $LinkedBCFile = "${FinalOutputFileName}.llvm.bc";
- } else {
- $LinkedBCFile = "/tmp/nativebuild-$$.llvm.bc";
- }
- run "llvm-link -o $LinkedBCFile $BCFiles";
- return $LinkedBCFile;
-}
-
-sub CompileBytecodeToNative {
- my ($BCFile, $Backend, $OutputFile) = @_;
-
- my $GeneratedCode;
- if ($Backend eq 'cbe') {
- if ($SaveTemps) {
- $GeneratedCode = "${OutputFile}.c";
- } else {
- $GeneratedCode = "/tmp/nativebuild-$$.c";
- }
- run "llc -march=c -f -o $GeneratedCode $BCFile";
- } elsif ($Backend eq 'llc') {
- if ($SaveTemps) {
- $GeneratedCode = "${OutputFile}.s";
- } else {
- $GeneratedCode = "/tmp/nativebuild-$$.s";
- }
- run "llc -f -o $GeneratedCode $BCFile";
- }
- my $LibDirs = join (" ", @LibDirs);
- my $Libs = join (" ", @Libs);
- run "gcc $GCCOptions $GeneratedCode -o $OutputFile $LibDirs $Libs";
- run "rm $BCFile $GeneratedCode"
- unless $SaveTemps;
-}
-
-sub CompileCToNative {
- my ($LLVMGCCCommand, $Backend, $OutputFile) = @_;
- run $LLVMGCCCommand;
- if ($PreprocessOnly) {
- return;
- }
- my $BCFile = "${OutputFile}.llvm.bc";
- if ($CompileDontLink) {
- run "mv ${OutputFile} $BCFile";
- } else { # gccld messes with the output file name
- run "mv ${OutputFile}.bc $BCFile";
- }
- my $GeneratedCode;
- if ($Backend eq 'cbe') {
- $GeneratedCode = "${OutputFile}.cbe.c";
- run "llc -march=c -f -o $GeneratedCode $BCFile";
- } elsif ($Backend eq 'llc') {
- $GeneratedCode = "${OutputFile}.llc.s";
- run "llc -f -o $GeneratedCode $BCFile";
- }
- my $NativeGCCOptions = "";
- if ($CompileDontLink) {
- $NativeGCCOptions = "-c";
- }
- run "gcc $NativeGCCOptions $GeneratedCode -o $OutputFile";
- run "rm ${OutputFile}.llvm.bc $GeneratedCode"
- unless $SaveTemps;
-}
-
-# guess the name of the output file, if -o was not specified.
-$OutputFile = GetDefaultOutputFileName () unless $OutputFile;
-print "Output file is $OutputFile\n" if $Verbose;
-# do all the dirty work:
-if ($ProgramName eq /native-build/) {
- my $LinkedBCFile = LinkBytecodeFilesIntoTemporary (@BytecodeFiles);
- CompileBytecodeToNative ($LinkedBCFile, $Backend, $OutputFile);
-} elsif ($ProgramName =~ /llvm-native-gxx/) {
- # build the llvm-gxx command line.
- $LLVMGCCCommand = join (" ", ("llvm-g++", @ARGV));
- CompileCToNative ($LLVMGCCCommand, $Backend, $OutputFile);
-}
-
-# we're done.
-exit 0;
-
-__END__
-
-=pod
-
-=head1 NAME
-
-llvm-native-gxx
-
-=head1 SYNOPSIS
-
-llvm-native-g++ [OPTIONS...] FILE
-
-native-build [OPTIONS...] FILE
-
-=head1 DESCRIPTION
-
-llvm-native-g++ is a wrapper around the LLVM command-line tools which generates
-a native object (.o) file by compiling FILE with llvm-g++, and then running
-an LLVM back-end (CBE by default) over the resulting bytecode, and then
-compiling the resulting code to a native object file.
-
-If called as "native-build", it compiles bytecode to native code, and takes
-different options.
-
-=head1 OPTIONS
-
-llvm-native-g++ takes the same options as llvm-gcc. All options
-except -mllvm-backend=... are passed on to llvm-g++.
-
-=over 4
-
-=item -mllvm-backend=BACKEND
-
-Use BACKEND for native code generation.
-
-=item -v
-
-Print command lines that llvm-native-g++ runs.
-
-=item -o FILE
-
-llvm-native-g++ tries to guess the name of the llvm-g++ output file by looking
-for this option in the command line. If it can't find it, it finds the last C
-or C++ source file named on the command line, and turns its suffix into .o. See
-BUGS.
-
-=item -save-temps
-
-Save temporary files used by llvm-native-g++ (and llvm-g++, and g++).
-
-=back
-
-=head1 BUGS
-
-llvm-native-g++ only handles the case where llvm-g++ compiles a single
-file per invocation. llvm-native-g++ has weak command-line argument
-parsing and is a poor substitute for making g++/g++.c do this stuff.
-
-This manual page does not adequately document native-build mode.
-
-llvm-native-g++ is pretty gross because it represents the blind merging of two
-other scripts that predated it. It could use some code clean-up.
-
-=head1 SEE ALSO
-
-g++(1)
-
-=head1 AUTHOR
-
-Brian R. Gaeke
-
-=cut
diff --git a/contrib/llvm/utils/llvm.grm b/contrib/llvm/utils/llvm.grm
deleted file mode 100644
index 9d6bdf7..0000000
--- a/contrib/llvm/utils/llvm.grm
+++ /dev/null
@@ -1,418 +0,0 @@
-(*
-
-polygen grammar for LLVM assembly language.
-
-This file defines an LLVM assembly language grammar for polygen,
-which is a tool for generating random text based on a grammar.
-It is strictly syntax-based, and makes no attempt to generate
-IR that is semantically valid. Most of the IR produced doesn't
-pass the Verifier.
-
-TODO: Metadata, in all its forms
-
-*)
-
-I ::= "title: LLVM assembly language\n"
- ^ "status: experimental\n"
- ^ "audience: LLVM developers\n"
-;
-
-S ::= Module ;
-
-(*
-Define rules for non-keyword tokens. This is currently just a bunch
-of hacks. They don't cover many valid forms of tokens, and they also
-generate some invalid forms of tokens. The LLVM parser has custom
-C++ code to lex these; custom C++ code for emitting them would be
-convenient, but polygen doesn't support that.
-*)
-NonZeroDecimalDigit ::= 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 ;
-DecimalDigit ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 ;
-DecimalDigitSeq ::= DecimalDigit [^ DecimalDigitSeq ];
-HexDigit ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
- | a | b | c | d | e | f ;
-HexDigitSeq ::= HexDigit [^ HexDigitSeq ];
-StringChar ::= 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 ;
-StringConstantSeq ::= StringChar [^ StringConstantSeq ];
-StringConstant ::= StringChar [^ StringConstantSeq ];
-EUINT64VAL ::= NonZeroDecimalDigit [^ DecimalDigitSeq ];
-ESINT64VAL ::= [ "-" ] ^ EUINT64VAL ;
-EUAPINTVAL ::= EUINT64VAL ;
-ESAPINTVAL ::= ESINT64VAL ;
-LOCALVALID ::= "%" ^ DecimalDigitSeq ;
-GLOBALVALID ::= "@" ^ DecimalDigitSeq ;
-INTTYPE ::= "i" ^ EUINT64VAL ;
-GLOBALVAR ::= "@" ^ StringConstant ;
-LOCALVAR ::= "%" ^ StringConstant ;
-STRINGCONSTANT ::= "\"" ^ StringConstant ^ "\"" ;
-ATSTRINGCONSTANT ::= "@" ^ STRINGCONSTANT ;
-PCTSTRINGCONSTANT ::= "%" ^ STRINGCONSTANT ;
-LABELSTR ::= StringConstant ;
-FPVAL ::= ESAPINTVAL ^ "." ^ EUAPINTVAL | "0x" ^ HexDigitSeq ;
-
-(*
-The rest of this file is derived directly from llvmAsmParser.y.
-*)
-
-ArithmeticOps ::= + OptNW add | fadd | OptNW sub | fsub | OptNW mul | fmul |
- udiv | OptExact sdiv | fdiv | urem | srem | frem ;
-LogicalOps ::= shl | lshr | ashr | and | or | xor;
-CastOps ::= trunc | zext | sext | fptrunc | fpext | bitcast |
- uitofp | sitofp | fptoui | fptosi | inttoptr | ptrtoint ;
-
-IPredicates ::= eq | ne | slt | sgt | sle | sge | ult | ugt | ule | uge ;
-
-FPredicates ::= oeq | one | olt | ogt | ole | oge | ord | uno | ueq | une
- | ult | ugt | ule | uge | true | false ;
-
-IntType ::= INTTYPE;
-FPType ::= float | double | "ppc_fp128" | fp128 | "x86_fp80";
-
-LocalName ::= LOCALVAR | STRINGCONSTANT | PCTSTRINGCONSTANT ;
-OptLocalName ::= LocalName | _ ;
-
-OptAddrSpace ::= - addrspace ^ "(" ^ EUINT64VAL ^ ")" | _ ;
-
-OptLocalAssign ::= LocalName "=" | _ ;
-
-GlobalName ::= GLOBALVAR | ATSTRINGCONSTANT ;
-
-OptGlobalAssign ::= GlobalAssign | _ ;
-
-GlobalAssign ::= GlobalName "=" ;
-
-GVInternalLinkage
- ::= + internal
- | weak
- | "weak_odr"
- | linkonce
- | "linkonce_odr"
- | appending
- | dllexport
- | common
- | private
- | "linker_private"
- | "linker_private_weak"
- ;
-
-GVExternalLinkage
- ::= dllimport
- | "extern_weak"
- | + external
- ;
-
-GVVisibilityStyle
- ::= + _
- | default
- | hidden
- | protected
- ;
-
-FunctionDeclareLinkage
- ::= + _
- | dllimport
- | "extern_weak"
- ;
-
-FunctionDefineLinkage
- ::= + _
- | internal
- | linkonce
- | "linkonce_odr"
- | weak
- | "weak_odr"
- | dllexport
- ;
-
-AliasLinkage ::= + _ | weak | "weak_odr" | internal ;
-
-OptCallingConv ::= + _ |
- ccc |
- fastcc |
- coldcc |
- "x86_stdcallcc" |
- "x86_fastcallcc" |
- cc EUINT64VAL ;
-
-ParamAttr ::= zeroext
- | signext
- | inreg
- | sret
- | noalias
- | nocapture
- | byval
- | nest
- | align EUINT64VAL
- ;
-
-OptParamAttrs ::= + _ | OptParamAttrs ParamAttr ;
-
-RetAttr ::= inreg
- | zeroext
- | signext
- | noalias
- ;
-
-OptRetAttrs ::= _
- | OptRetAttrs RetAttr
- ;
-
-FuncAttr ::= noreturn
- | nounwind
- | inreg
- | zeroext
- | signext
- | readnone
- | readonly
- | inlinehint
- | alignstack
- | noinline
- | alwaysinline
- | optsize
- | ssp
- | sspreq
- ;
-
-OptFuncAttrs ::= + _ | OptFuncAttrs FuncAttr ;
-
-OptGC ::= + _ | gc STRINGCONSTANT ;
-
-OptAlign ::= + _ | align EUINT64VAL ;
-OptCAlign ::= + _ | ^ "," align EUINT64VAL ;
-
-SectionString ::= section STRINGCONSTANT ;
-
-OptSection ::= + _ | SectionString ;
-
-GlobalVarAttributes ::= + _ | ^ "," GlobalVarAttribute GlobalVarAttributes ;
-GlobalVarAttribute ::= SectionString | align EUINT64VAL ;
-
-PrimType ::= INTTYPE | float | double | "ppc_fp128" | fp128 | "x86_fp80"
- | - label ;
-
-Types
- ::= opaque
- | PrimType
- | Types OptAddrSpace ^ "*"
- | SymbolicValueRef
- | "\\" ^ EUINT64VAL
- | Types "(" ^ ArgTypeListI ^ ")" OptFuncAttrs
- | void "(" ^ ArgTypeListI ^ ")" OptFuncAttrs
- | "[" ^ EUINT64VAL "x" Types ^ "]"
- | "<" ^ EUINT64VAL "x" Types ^ ">"
- | "{" TypeListI "}"
- | "{" ^ "}"
- | "<" ^ "{" TypeListI "}" ^ ">"
- | "<" ^ "{" ^ "}" ^ ">"
- ;
-
-ArgType ::= Types OptParamAttrs ;
-
-ResultTypes ::= Types | void ;
-
-ArgTypeList ::= ArgType | ArgTypeList ^ "," ArgType ;
-
-ArgTypeListI ::= ArgTypeList | ArgTypeList ^ "," "..." | "..." | _ ;
-
-TypeListI ::= Types | TypeListI ^ "," Types ;
-
-ConstVal::= Types "[" ^ ConstVector ^ "]"
- | Types "[" ^ "]"
- | Types "c" ^ STRINGCONSTANT
- | Types "<" ^ ConstVector ^ ">"
- | Types "{" ConstVector "}"
- | Types "{" ^ "}"
- | Types "<" ^ "{" ConstVector "}" ^ ">"
- | Types "<" ^ "{" ^ "}" ^ ">"
- | Types null
- | Types undef
- | Types SymbolicValueRef
- | Types ConstExpr
- | Types zeroinitializer
- | Types ESINT64VAL
- | Types ESAPINTVAL
- | Types EUINT64VAL
- | Types EUAPINTVAL
- | Types true
- | Types false
- | Types FPVAL ;
-
-ConstExpr::= CastOps "(" ^ ConstVal to Types ^ ")"
- | getelementptr OptInBounds "(" ^ ConstVal IndexList ^ ")"
- | select "(" ^ ConstVal ^ "," ConstVal ^ "," ConstVal ^ ")"
- | ArithmeticOps "(" ^ ConstVal ^ "," ConstVal ^ ")"
- | LogicalOps "(" ^ ConstVal ^ "," ConstVal ^ ")"
- | icmp IPredicates "(" ^ ConstVal ^ "," ConstVal ^ ")"
- | fcmp FPredicates "(" ^ ConstVal ^ "," ConstVal ^ ")"
- | extractelement "(" ^ ConstVal ^ "," ConstVal ^ ")"
- | insertelement "(" ^ ConstVal ^ "," ConstVal ^ "," ConstVal ^ ")"
- | shufflevector "(" ^ ConstVal ^ "," ConstVal ^ "," ConstVal ^ ")"
- | extractvalue "(" ^ ConstVal ^ ConstantIndexList ^ ")"
- | insertvalue "(" ^ ConstVal ^ "," ConstVal ^ ConstantIndexList ^ ")" ;
-
-ConstVector ::= ConstVector ^ "," ConstVal | ConstVal ;
-
-GlobalType ::= global | constant ;
-
-ThreadLocal ::= - "thread_local" | _ ;
-
-AliaseeRef ::= ResultTypes SymbolicValueRef
- | bitcast "(" ^ AliaseeRef to Types ^ ")" ;
-
-Module ::= +++ DefinitionList | --- _ ;
-
-DefinitionList ::= - Definition | + DefinitionList Definition ;
-
-Definition
- ::= ^ ( +++++ define Function
- | declare FunctionProto
- | - module asm AsmBlock
- | OptLocalAssign type Types
- | OptGlobalAssign GVVisibilityStyle ThreadLocal OptAddrSpace GlobalType
- ConstVal GlobalVarAttributes
- | OptGlobalAssign GVInternalLinkage GVVisibilityStyle ThreadLocal OptAddrSpace
- GlobalType ConstVal GlobalVarAttributes
- | OptGlobalAssign GVExternalLinkage GVVisibilityStyle ThreadLocal OptAddrSpace
- GlobalType Types GlobalVarAttributes
- | OptGlobalAssign GVVisibilityStyle alias AliasLinkage AliaseeRef
- | target TargetDefinition
- | deplibs "=" LibrariesDefinition
- ) ^ "\n";
-
-AsmBlock ::= STRINGCONSTANT ;
-
-TargetDefinition ::= triple "=" STRINGCONSTANT
- | datalayout "=" STRINGCONSTANT ;
-
-LibrariesDefinition ::= "[" ( LibList | _ ) "]";
-
-LibList ::= LibList ^ "," STRINGCONSTANT | STRINGCONSTANT ;
-
-ArgListH ::= ArgListH ^ "," Types OptParamAttrs OptLocalName
- | Types OptParamAttrs OptLocalName ;
-
-ArgList ::= ArgListH | ArgListH ^ "," "..." | "..." | _ ;
-
-FunctionHeaderH ::= OptCallingConv OptRetAttrs ResultTypes
- GlobalName ^ "(" ^ ArgList ^ ")"
- OptFuncAttrs OptSection OptAlign OptGC ;
-
-BEGIN ::= ( begin | "{" ) ^ "\n";
-
-FunctionHeader ::=
- FunctionDefineLinkage GVVisibilityStyle FunctionHeaderH BEGIN ;
-
-END ::= ^ ( end | "}" ) ^ "\n";
-
-Function ::= BasicBlockList END ;
-
-FunctionProto ::= FunctionDeclareLinkage GVVisibilityStyle FunctionHeaderH ;
-
-OptSideEffect ::= _ | sideeffect ;
-
-ConstValueRef ::= ESINT64VAL
- | EUINT64VAL
- | FPVAL
- | true
- | false
- | null
- | undef
- | zeroinitializer
- | "<" ConstVector ">"
- | "[" ConstVector "]"
- | "[" ^ "]"
- | "c" ^ STRINGCONSTANT
- | "{" ConstVector "}"
- | "{" ^ "}"
- | "<" ^ "{" ConstVector "}" ^ ">"
- | "<" ^ "{" ^ "}" ^ ">"
- | ConstExpr
- | asm OptSideEffect STRINGCONSTANT ^ "," STRINGCONSTANT ;
-
-SymbolicValueRef ::= LOCALVALID
- | GLOBALVALID
- | LocalName
- | GlobalName ;
-
-ValueRef ::= SymbolicValueRef | ConstValueRef;
-
-ResolvedVal ::= Types ValueRef ;
-
-ReturnedVal ::= ResolvedVal | ReturnedVal ^ "," ResolvedVal ;
-
-BasicBlockList ::= BasicBlockList BasicBlock | FunctionHeader BasicBlock ;
-
-BasicBlock ::= InstructionList OptLocalAssign BBTerminatorInst ;
-
-InstructionList ::= +++ InstructionList Inst
- | - _
- | ^ LABELSTR ^ ":\n" ;
-
-BBTerminatorInst ::= ^ " " ^
- ( ret ReturnedVal
- | ret void
- | br label ValueRef
- | br INTTYPE ValueRef ^ "," label ValueRef ^ "," label ValueRef
- | switch IntType ValueRef ^ "," label ValueRef "[" JumpTable "]"
- | switch IntType ValueRef ^ "," label ValueRef "[" ^ "]"
- | invoke OptCallingConv ResultTypes ValueRef ^ "(" ^ ParamList ^ ")"
- OptFuncAttrs
- to label ValueRef unwind label ValueRef
- | unwind
- | unreachable ) ^ "\n";
-
-JumpTable ::= JumpTable IntType ConstValueRef ^ "," label ValueRef
- | IntType ConstValueRef ^ "," label ValueRef ;
-
-Inst ::= ^ " " ^ OptLocalAssign InstVal ^ "\n";
-
-PHIList ::= Types "[" ValueRef ^ "," ValueRef "]"
- | PHIList ^ "," "[" ValueRef ^ "," ValueRef "]" ;
-
-ParamList ::= Types OptParamAttrs ValueRef OptParamAttrs
- | label OptParamAttrs ValueRef OptParamAttrs
- | ParamList ^ "," Types OptParamAttrs ValueRef OptParamAttrs
- | ParamList ^ "," label OptParamAttrs ValueRef OptParamAttrs
- | - _ ;
-
-IndexList ::= _ | IndexList ^ "," ResolvedVal ;
-
-ConstantIndexList ::= "," EUINT64VAL | ConstantIndexList ^ "," EUINT64VAL ;
-
-OptTailCall ::= tail call | call ;
-
-InstVal ::=
- ArithmeticOps Types ValueRef ^ "," ValueRef
- | LogicalOps Types ValueRef ^ "," ValueRef
- | icmp IPredicates Types ValueRef ^ "," ValueRef
- | fcmp FPredicates Types ValueRef ^ "," ValueRef
- | CastOps ResolvedVal to Types
- | select ResolvedVal ^ "," ResolvedVal ^ "," ResolvedVal
- | "va_arg" ResolvedVal ^ "," Types
- | extractelement ResolvedVal ^ "," ResolvedVal
- | insertelement ResolvedVal ^ "," ResolvedVal ^ "," ResolvedVal
- | shufflevector ResolvedVal ^ "," ResolvedVal ^ "," ResolvedVal
- | phi PHIList
- | OptTailCall OptCallingConv ResultTypes ValueRef ^ "(" ^ ParamList ^ ")"
- OptFuncAttrs
- | MemoryInst ;
-
-OptVolatile ::= - volatile | _ ;
-OptExact ::= - exact | _ ;
-OptNSW ::= - nsw | _ ;
-OptNUW ::= - nuw | _ ;
-OptNW ::= OptNUW OptNSW | OptNSW OptNUW ;
-OptInBounds ::= - inbounds | _ ;
-
-MemoryInst ::= malloc Types OptCAlign
- | malloc Types ^ "," INTTYPE ValueRef OptCAlign
- | alloca Types OptCAlign
- | alloca Types ^ "," INTTYPE ValueRef OptCAlign
- | free ResolvedVal
- | OptVolatile load Types ValueRef OptCAlign
- | OptVolatile store ResolvedVal ^ "," Types ValueRef OptCAlign
- | getresult Types ValueRef ^ "," EUINT64VAL
- | getelementptr OptInBounds Types ValueRef IndexList
- | extractvalue Types ValueRef ^ ConstantIndexList
- | insertvalue Types ValueRef ^ "," Types ValueRef ^ ConstantIndexList ;
diff --git a/contrib/llvm/utils/llvmdo b/contrib/llvm/utils/llvmdo
deleted file mode 100755
index bcfc221..0000000
--- a/contrib/llvm/utils/llvmdo
+++ /dev/null
@@ -1,184 +0,0 @@
-#!/bin/sh
-##===- utils/llvmdo - Counts Lines Of Code -------------------*- Script -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-#
-# This script is a general purpose "apply" function for the source files in LLVM
-# It uses "find" to locate all the source files and then applies the user's
-# command to them. As such, this command is often not used by itself much but
-# the other find related tools (countloc.sh,llvmgrep,getsrcs.sh,userloc.sh) are
-# all based on this script. This script defines "what is a source file" in
-# LLVM and so should be maintained if new directories, new file extensions,
-# etc. are used in LLVM as it progresses.
-#
-# Usage:
-# llvmdo [-topdir DIR] [-dirs "DIRNAMES..."] [-code-only] PROGRAM ARGS...
-#
-# The -topdir option allows you to specify the llvm source root directly. If it
-# is not specified then it will be obtained with llvm-config which must be built
-# and in your path.
-#
-# The -dirs argument allows you to specify the set of directories that are
-# searched. The default list of directories searched is:
-# include lib tools utils runtime autoconf docs test examples projects
-# Note that you must use quotes around the list of directory names.
-#
-# The -code-only option specifies that only those files that are considered
-# "code" should be visited. HTML documentation is considered code, but things
-# like README files, etc. are not.
-#
-# Finally, you simply specify whatever program you want to run against each
-# file and the arguments to give it. The PROGRAM will be given the file name
-# as its last argument.
-##===----------------------------------------------------------------------===##
-
-if test $# -lt 1 ; then
- echo "Usage: llvmdo [-topdir DIR] [-dirs "DIRNAMES..."] [-code-only] PROGRAM ARGS..."
- exit 1
-fi
-
-if test "$1" = "-topdir" ; then
- TOPDIR="$2"
- shift; shift;
-else
- TOPDIR=`llvm-config --src-root`
-fi
-
-if test "$1" = "-dirs" ; then
- LLVMDO_DIRS="$2"
- shift ; shift
-elif test -z "$LLVMDO_DIRS" ; then
- LLVMDO_DIRS="include lib tools utils runtime autoconf docs test examples projects cmake"
-fi
-
-if test "$1" = "-code-only" ; then
- CODE_ONLY="set"
- shift
-else
- CODE_ONLY=""
-fi
-
-if test "$1" = "" ; then
- echo "Missing program name to run"
- exit 1
-fi
-
-PROGRAM=`which $1`
-if test ! -x "$PROGRAM" ; then
- echo "Can't execute $1"
- exit 1
-fi
-shift;
-
-paths_to_ignore="\
- -path */.svn/ -o \
- -path */.svn/* -o \
- -path docs/doxygen/* -o \
- -path docs/CommandGuide/html/* -o \
- -path docs/CommandGuide/man/* -o \
- -path docs/CommandGuide/ps/* -o \
- -path docs/CommandGuide/man/* -o \
- -path docs/HistoricalNotes/* -o \
- -path docs/img/* -o \
- -path */.libs/* -o \
- -path lib/Support/bzip2/* -o \
- -path projects/llvm-test/* \
-"
-files_to_match="\
- -name *.ac \
- -o -name *.b \
- -o -name *.c \
- -o -name *.cc \
- -o -name *.cfg \
- -o -name *.cpp \
- -o -name *.css \
- -o -name *.def \
- -o -name *.el \
- -o -name *.exp \
- -o -name *.footer \
- -o -name *.gnuplot' \
- -o -name *.h \
- -o -name *.header \
- -o -name *.html \
- -o -name *.in \
- -o -name *.inc \
- -o -name *.intro \
- -o -name *.l \
- -o -name *.ll \
- -o -name *.lst \
- -o -name *.m4 \
- -o -name *.pod \
- -o -name *.pl \
- -o -name *.py \
- -o -name *.sh \
- -o -name *.schema \
- -o -name *.st \
- -o -name *.tcl \
- -o -name *.td \
- -o -name *.tr \
- -o -name *.y \
- -o -name Make* \
- -o -name *.cmake \
- -o -name llvmdo \
- -o -name llvmgrep \
- -o -name check-each-file \
- -o -name codgen-diff \
- -o -name llvm-native-gcc \
- -o -name llvm-native-gxx \
- -o -name makellvm \
- -o -path include/llvm/ADT/ilist \
- -o -path test/\*.ll \
- -o -path test/Scripts/not \
- -o -path runtime/\*.ll \
-"
-if test -z "$CODE_ONLY" ; then
- files_to_match="$files_to_match \
- -o -name *.txt \
- -o -name *.TXT \
- -o -name *.vim \
- -o -name vimrc \
- -o -name README \
- -o -name COPYING.LIB \
- -o -name LICENSE* "
-fi
-files_to_ignore="\
- -name \.* \
- -o -name *~ \
- -o -name #* \
- -o -name configure \
- -o -name slow.ll \
- -o -name *libtool* \
- -o -name ltdl* \
- -o -name ltdl.m4 \
- -o -name ltmain.m4 \
- -o -name ltmain.sh \
- -o -name aclocal.m4 \
- -o -name acinclude.m4 \
- -o -name *LoopSimplifyCrash.ll \
- -o -name *AST-Remove.ll \
- -o -name PPCPerfectShuffle.h \
-"
-
-if test -d "$TOPDIR" ; then
- cd $TOPDIR
- # Have to use the right "find" on a per-platform basis. Most platforms have
- # Gnu find as "find", but Solaris does not.
- case `uname -s` in
- SunOS) find_prog=gfind ;;
- *) find_prog=find ;;
- esac
- # Turn off file name generation (globbing) so that substitution of the
- # variables doesn't cause the shell to create lists of file names
- set -f
- $find_prog $LLVMDO_DIRS -type f \
- \( $paths_to_ignore \) -prune \
- -o \( \( $files_to_match \) \! \( $files_to_ignore \) \
- -exec $PROGRAM "$@" {} \; \)
-else
- echo "Can't find LLVM top directory in $TOPDIR"
-fi
diff --git a/contrib/llvm/utils/llvmgrep b/contrib/llvm/utils/llvmgrep
deleted file mode 100755
index 540f059..0000000
--- a/contrib/llvm/utils/llvmgrep
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-##===- utils/llvmgrep - Counts Lines Of Code -----------------*- Script -*-===##
-#
-# The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-#
-# This script searches your srcdir for an egrep style pattern. This can quickly
-# help you build a list of the places you need to modify when changing a header
-# or other "global" name. The only argument is the pattern you want to search
-# for. It should be quoted to escape shell interpretation of the pattern's
-# special characters.
-#
-# Note that the implementation is based on llvmdo. See that script for more
-# details.
-##===----------------------------------------------------------------------===##
-
-if test "$1" = "-topdir" ; then
- TOPDIR="$2"
- shift; shift;
-else
- TOPDIR=`llvm-config --src-root`
-fi
-
-if test -d "$TOPDIR" ; then
- cd $TOPDIR
- case `uname -s` in
- SunOS) grep_cmd="ggrep -H -n" ;;
- Linux) grep_cmd="egrep -H -n" ;;
- *) grep_cmd="egrep -l -n" ;;
- esac
- ./utils/llvmdo -topdir "$TOPDIR" \
- -dirs "include lib tools utils docs examples test unittests projects cmake" $grep_cmd "$*"
-else
- echo "Can't find LLVM top directory"
-fi
diff --git a/contrib/llvm/utils/makellvm b/contrib/llvm/utils/makellvm
deleted file mode 100755
index ae77712..0000000
--- a/contrib/llvm/utils/makellvm
+++ /dev/null
@@ -1,145 +0,0 @@
-#!/bin/csh -f
-
-set pstatus = 0
-onintr cleanup
-alias usage 'echo "USAGE: $0:t [-h] [-n] [-obj obj-root] [gmake-flags] [VAR=...] [toolname (default: opt)]"; set pstatus = 1; goto cleanup'
-
-set EXEC = opt
-set GMAKE_OPTS = ""
-set DEBUG = 0
-
-## Search path for automatically finding the obj-root to use.
-## Note: The src root directory ${LLVMDIR} will be prepended to this path later.
-##
-set OBJROOTDIRLIST = ( )
-
-set doit = 1
-unset options_done
-while ( !( $?options_done ) && ($#argv > 0))
- switch ($argv[1])
- case -h :
- usage
- case -f :
- if ($#argv < 2) usage
- shift argv; set MFILE = $argv[1]; shift argv; breaksw
- case -n :
- set doit = 0; shift argv; breaksw
- case -obj :
- set OBJROOT = $argv[2]; shift argv; shift argv
- if (! -d "$OBJROOT") then
- echo "FATAL: Illegal obj-root directory ${OBJROOT}"
- exit 1
- endif
- breaksw
- case -d :
- set doit = 0; set DEBUG = 1; shift argv; breaksw
- case -* :
- set GMAKE_OPTS = ( $GMAKE_OPTS $argv[1] ); shift argv; breaksw
- default :
- set optarg = `echo -n $argv[1] | sed 's/^[^=]*$//'`
- if ($#optarg) then
- set GMAKE_OPTS = ( $GMAKE_OPTS $optarg )
- shift argv
- else
- set options_done
- endif
- breaksw
- endsw
-end
-
-if ($#argv > 1) then
- echo 'ERROR: More than one tool is not supported by "makellvm"'
- usage
-endif
-if ($#argv > 0) then
- set EXEC = $argv[1]
-endif
-if ($DEBUG) then
- echo "DEBUG: EXEC = $EXEC"
-endif
-
-## Compute LLVMDIR: the root of the current LLVM tree.
-## It is recorded in the variable LEVEL in Makefile, to compute it
-##
-if (! $?MFILE) then
- if (-f GNUmakefile) then
- set MFILE = GNUmakefile
- else if (-f makefile) then
- set MFILE = makefile
- else
- set MFILE = Makefile
- endif
-endif
-if ($DEBUG) then
- echo "DEBUG: MFILE = $MFILE"
-endif
-if (! -f $MFILE) then
- echo "Missing or invalid makefile: $MFILE"
- exit 1
-endif
-
-set LLVMDIR = `awk '/LEVEL[ ]*=/ {print $NF}' $MFILE`
-if ($DEBUG) then
- echo "DEBUG: LLVMDIR = $LLVMDIR"
-endif
-
-if ($#LLVMDIR == 0 || ! -d "$LLVMDIR") then
- echo "Unable to find LLVM src-root directory or directory is invalid."
- echo "Are you within a valid LLVM directory for running gmake?"
- exit 1
-endif
-
-## Try to determine the obj-root directory automatically if not specified
-##
-set OBJROOTDIRLIST = ( ${LLVMDIR} $OBJROOTDIRLIST ) ## add src dir
-if ($?OBJROOT == 0) then
- ## Try to determine object root directory by looking for Makefile.config
- foreach objdir ( $OBJROOTDIRLIST )
- if (-f "${objdir}/Makefile.config") then
- set OBJROOT = ${objdir}
- break
- endif
- end
- if ($?OBJROOT == 0) then
- echo "FATAL: Could not choose an obj-root directory from these choices:"
- echo " ${OBJROOTDIRLIST}."
- echo " You can specify it explicitly using '-obj obj-root'."
- exit 1
- endif
- echo "Using OBJ-ROOT = ${OBJROOT} (specify '-obj obj-root' to override)."
-endif
-if (${OBJROOT} == ${LLVMDIR}) then
- # run make in the source directory itself
- set BUILDROOT = .
-else
- # run make in the in the obj-root tree, in the directory for $cwd
- set SRCROOT = `sh -c "cd $LLVMDIR; pwd | sed 's/\//\\\//g'"`
- set CURSRCDIR = `echo $cwd | sed -e "s/${SRCROOT}//"`
- set BUILDROOT = ${OBJROOT}/${CURSRCDIR}
- unset SRCROOT CURSRCDIR
-endif
-if ($DEBUG) then
- echo "DEBUG: BUILDROOT = $BUILDROOT"
-endif
-if (! -d $BUILDROOT) then
- echo "FATAL: Invalid build directory: ${BUILDROOT}"
- exit 1
-endif
-cd $BUILDROOT
-
-set CMD = "make $GMAKE_OPTS && (cd $LLVMDIR/tools/$EXEC && make $GMAKE_OPTS)"
-
-if ($doit == 1) then
- csh -f -c "$CMD"
- set pstatus = $?
-else
- echo '(NOT EXECUTING) COMMAND:'
- echo " $CMD"
-endif
-
-
-#=========================================================
-# CODE TO BE EXECUTED IF INTERRUPT IS RECEIVED
-#=========================================================
-cleanup:
- exit($pstatus)
diff --git a/contrib/llvm/utils/not/CMakeLists.txt b/contrib/llvm/utils/not/CMakeLists.txt
deleted file mode 100644
index 407c82e..0000000
--- a/contrib/llvm/utils/not/CMakeLists.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-add_executable(not
- not.cpp
- )
-
-target_link_libraries(not LLVMSystem)
-if( MINGW )
- target_link_libraries(not imagehlp psapi)
-endif( MINGW )
-if( LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD )
- target_link_libraries(not pthread)
-endif()
diff --git a/contrib/llvm/utils/not/Makefile b/contrib/llvm/utils/not/Makefile
deleted file mode 100644
index fef4802..0000000
--- a/contrib/llvm/utils/not/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-##===- utils/not/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 = not
-USEDLIBS = LLVMSupport.a LLVMSystem.a
-
-# This tool has no plugins, optimize startup time.
-TOOL_NO_EXPORTS = 1
-
-# Don't install this utility
-NO_INSTALL = 1
-
-include $(LEVEL)/Makefile.common
-
diff --git a/contrib/llvm/utils/not/not.cpp b/contrib/llvm/utils/not/not.cpp
deleted file mode 100644
index dd89b8f..0000000
--- a/contrib/llvm/utils/not/not.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-//===- not.cpp - The 'not' testing tool -----------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/System/Path.h"
-#include "llvm/System/Program.h"
-using namespace llvm;
-
-int main(int argc, const char **argv) {
- sys::Path Program = sys::Program::FindProgramByName(argv[1]);
- return !sys::Program::ExecuteAndWait(Program, argv + 1);
-}
diff --git a/contrib/llvm/utils/parseNLT.pl b/contrib/llvm/utils/parseNLT.pl
deleted file mode 100644
index 95afca7..0000000
--- a/contrib/llvm/utils/parseNLT.pl
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/perl
-# a first attempt to parse the nightly tester pages into something
-# one can reason about, namely import into a database
-# USE: perl parseNLT.pl <2005-03-31.html
-# for example
-
-while(<>)
- {
- if (/LLVM Test Results for (\w+) (\d+), (\d+)</)
- {
- $mon = $1;
- $day = $2;
- $year = $3;
- }
- if (/<td>([^<]+)<\/td>/)
- {
- if ($prefix)
- { $output .= "$1 "; $count++; }
- }
- if (/<tr/)
- {
- if ($output and $count > 3)
- { print "\n$day $mon $year $prefix/$output"; }
- $output = "";
- $count = 0;
- }
- if (/<h2>(Programs.+)<\/h2>/)
- {
- $prefix = $1;
- }
- }
-
-if ($output)
- { print "\n$day $mon $year $prefix/$output"; $output = ""; }
diff --git a/contrib/llvm/utils/plotNLT.pl b/contrib/llvm/utils/plotNLT.pl
deleted file mode 100644
index 55d503d..0000000
--- a/contrib/llvm/utils/plotNLT.pl
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/perl
-#takes a test and a program from a dp and produces a gnuplot script
-#use like perl plotNLT.pl password Programs/MultiSource/Benchmarks/ASCI_Purple/SMG2000/smg2000 llc
-
-use DBI;
-
-# database information
-$db="llvmalpha";
-$host="localhost";
-$userid="llvmdbuser";
-$passwd=shift @ARGV;
-$connectionInfo="dbi:mysql:$db;$host";
-
-# make connection to database
-$dbh = DBI->connect($connectionInfo,$userid,$passwd) or die DBI->errstr;
-
-
-$count = @ARGV / 2;
-
-print "set xdata time\n";
-print 'set timefmt "%Y-%m-%d"';
-print "\nplot";
-for ($iter = 0; $iter < $count; $iter++) {
- if ($iter)
- { print ","; }
- print " '-' using 1:2 with lines";
-}
-
-print "\n";
-
-for ($iter = 0; $iter < $count; $iter++) {
-
- $prog = shift @ARGV;
- $test = shift @ARGV;
-
- $query = "Select RUN, VALUE from Tests where TEST = '$test' AND NAME = '$prog' ORDER BY RUN";
- #print "\n$query\n";
-
- my $sth = $dbh->prepare( $query) || die "Can't prepare statement: $DBI::errstr";;
-
- my $rc = $sth->execute or die DBI->errstr;
-
- while(($da,$v) = $sth->fetchrow_array)
- {
- print "$da $v\n";
- }
-
- print "e\n";
-}
-
-
-# disconnect from database
-$dbh->disconnect;
diff --git a/contrib/llvm/utils/profile.pl b/contrib/llvm/utils/profile.pl
deleted file mode 100755
index f9950f9..0000000
--- a/contrib/llvm/utils/profile.pl
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/usr/bin/perl -w
-#
-# Program: profile.pl
-#
-# Synopsis: Insert instrumentation code into a program, run it with the JIT,
-# then print out a profile report.
-#
-# Syntax: profile.pl [OPTIONS] bytecodefile <arguments>
-#
-# OPTIONS may include one or more of the following:
-# -block - Enable basicblock profiling
-# -edge - Enable edge profiling
-# -function - Enable function profiling
-# -o <filename> - Emit profiling information to the specified file, instead
-# of llvmprof.out
-#
-# Any unrecognized options are passed into the invocation of llvm-prof
-#
-
-my $ProfilePass = "-insert-edge-profiling";
-
-my $LLVMProfOpts = "";
-my $ProgramOpts = "";
-my $ProfileFile = "";
-
-# Parse arguments...
-while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
- shift;
- last if /^--$/; # Stop processing arguments on --
-
- # List command line options here...
- if (/^-?-block$/) { $ProfilePass = "-insert-block-profiling"; next; }
- if (/^-?-edge$/) { $ProfilePass = "-insert-edge-profiling"; next; }
- if (/^-?-function$/) { $ProfilePass = "-insert-function-profiling"; next; }
- if (/^-?-o$/) { # Read -o filename...
- die "-o option requires a filename argument!" if (!scalar(@ARGV));
- $ProgramOpts .= " -llvmprof-output $ARGV[0]";
- $ProfileFile = $ARGV[0];
- shift;
- next;
- }
- if (/^-?-help$/) {
- print "OVERVIEW: profile.pl - Instrumentation and profile printer.\n\n";
- print "USAGE: profile.pl [options] program.bc <program args>\n\n";
- print "OPTIONS:\n";
- print " -block - Enable basicblock profiling\n";
- print " -edge - Enable edge profiling\n";
- print " -function - Enable function profiling\n";
- print " -o <file> - Specify an output file other than llvm-prof.out.\n";
- print " -help - Print this usage information\n";
- print "\nAll other options are passed into llvm-prof.\n";
- exit 1;
- }
-
- # Otherwise, pass the option on to llvm-prof
- $LLVMProfOpts .= " " . $_;
-}
-
-die "Must specify LLVM bytecode file as first argument!" if (@ARGV == 0);
-
-my $BytecodeFile = $ARGV[0];
-
-shift @ARGV;
-
-my $libdir = `llvm-config --libdir`;
-chomp $libdir;
-
-my $LibProfPath = $libdir . "/profile_rt.so";
-
-system "opt -q -f $ProfilePass $BytecodeFile -o $BytecodeFile.inst";
-system "lli -fake-argv0 '$BytecodeFile' -load $LibProfPath " .
- "$BytecodeFile.inst $ProgramOpts " . (join ' ', @ARGV);
-system "rm $BytecodeFile.inst";
-system "llvm-prof $LLVMProfOpts $BytecodeFile $ProfileFile";
diff --git a/contrib/llvm/utils/unittest/Makefile b/contrib/llvm/utils/unittest/Makefile
deleted file mode 100644
index 6a09341..0000000
--- a/contrib/llvm/utils/unittest/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-##===- utils/unittest/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 = googletest UnitTestMain
-
-include $(LEVEL)/Makefile.common
diff --git a/contrib/llvm/utils/unittest/UnitTestMain/Makefile b/contrib/llvm/utils/unittest/UnitTestMain/Makefile
deleted file mode 100644
index cec654f..0000000
--- a/contrib/llvm/utils/unittest/UnitTestMain/Makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-##===- utils/unittest/UnitTestMain/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
-
-LIBRARYNAME = UnitTestMain
-BUILD_ARCHIVE = 1
-REQUIRES_RTTI = 1
-
-CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest/include
-CPP.Flags += $(NO_MISSING_FIELD_INITIALIZERS) $(NO_VARIADIC_MACROS)
-CPP.Flags += -DGTEST_HAS_RTTI=0
-# libstdc++'s TR1 <tuple> header depends on RTTI and uses C++'0x features not
-# supported by Clang, so force googletest to use its own tuple implementation.
-CPP.Flags += -DGTEST_USE_OWN_TR1_TUPLE
-
-# Disable pthreads if LLVM was configured without them.
-ifneq ($(HAVE_PTHREAD), 1)
- CPP.Flags += -DGTEST_HAS_PTHREAD=0
-endif
-
-include $(LEVEL)/Makefile.common
diff --git a/contrib/llvm/utils/unittest/UnitTestMain/TestMain.cpp b/contrib/llvm/utils/unittest/UnitTestMain/TestMain.cpp
deleted file mode 100644
index d97dca8..0000000
--- a/contrib/llvm/utils/unittest/UnitTestMain/TestMain.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-//===--- utils/unittest/UnitTestMain/TestMain.cpp - unittest driver -------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "gtest/gtest.h"
-
-int main(int argc, char **argv) {
- testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
diff --git a/contrib/llvm/utils/unittest/googletest/LICENSE.TXT b/contrib/llvm/utils/unittest/googletest/LICENSE.TXT
deleted file mode 100644
index 1941a11..0000000
--- a/contrib/llvm/utils/unittest/googletest/LICENSE.TXT
+++ /dev/null
@@ -1,28 +0,0 @@
-Copyright 2008, Google Inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
- * 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.
- * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-OWNER 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.
diff --git a/contrib/llvm/utils/unittest/googletest/Makefile b/contrib/llvm/utils/unittest/googletest/Makefile
deleted file mode 100644
index 21b29ff..0000000
--- a/contrib/llvm/utils/unittest/googletest/Makefile
+++ /dev/null
@@ -1,39 +0,0 @@
-##===- utils/unittest/googletest/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
-
-LIBRARYNAME = GoogleTest
-BUILD_ARCHIVE = 1
-REQUIRES_RTTI = 1
-
-# Note that these flags are duplicated when building individual tests in
-# unittests/Makefile.unittest and ../UnitTestMain/Makefile; ensure that any
-# changes are made to both.
-CPP.Flags += -I$(LLVM_SRC_ROOT)/utils/unittest/googletest/include
-CPP.Flags += $(NO_MISSING_FIELD_INITIALIZERS) $(NO_VARIADIC_MACROS)
-CPP.Flags += -DGTEST_HAS_RTTI=0
-# libstdc++'s TR1 <tuple> header depends on RTTI and uses C++'0x features not
-# supported by Clang, so force googletest to use its own tuple implementation.
-CPP.Flags += -DGTEST_USE_OWN_TR1_TUPLE
-
-# Disable pthreads if LLVM was configured without them.
-ifneq ($(HAVE_PTHREAD), 1)
- CPP.Flags += -DGTEST_HAS_PTHREAD=0
-endif
-
-ifeq ($(HOST_OS),MingW)
- CPP.Flags += -DGTEST_OS_WINDOWS=1
-endif
-
-NO_INSTALL = 1
-
-include $(LEVEL)/Makefile.common
diff --git a/contrib/llvm/utils/unittest/googletest/README.LLVM b/contrib/llvm/utils/unittest/googletest/README.LLVM
deleted file mode 100644
index d6e6f98..0000000
--- a/contrib/llvm/utils/unittest/googletest/README.LLVM
+++ /dev/null
@@ -1,31 +0,0 @@
-LLVM notes
-----------
-
-This directory contains Google Test 1.5.0, with all elements removed except for
-the actual source code, to minimize the addition to the LLVM distribution.
-
-Cleaned up as follows:
-
-# Remove all the unnecessary files and directories
-$ rm -f aclocal* CMakeLists.txt configure* Makefile* CHANGES CONTRIBUTORS README
-$ rm -rf build-aux codegear fused-src m4 make msvc samples scripts test xcode
-$ rm -f `find . -name \*\.pump`
-
-# Move all the source files to the current directory
-$ mv src/* .
-$ rmdir src
-
-# Move extra headers into the already-existing internal headers dir
-$ mv *.h include/gtest/internal/
-
-# Update paths to the included files
-$ perl -pi -e 's|^#include "src/|#include "gtest/internal/|' *.cc
-
-$ mv COPYING LICENSE.TXT
-
-
-Modified as follows:
-* To GTestStreamToHelper in include/gtest/internal/gtest-internal.h,
- added the ability to stream with raw_os_ostream.
-* To refresh Haiku support in include/gtest/internal/gtest-port.h,
- see http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20100621/102898.html
diff --git a/contrib/llvm/utils/unittest/googletest/gtest-death-test.cc b/contrib/llvm/utils/unittest/googletest/gtest-death-test.cc
deleted file mode 100644
index e4199de..0000000
--- a/contrib/llvm/utils/unittest/googletest/gtest-death-test.cc
+++ /dev/null
@@ -1,1172 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-//
-// Author: wan@google.com (Zhanyong Wan), vladl@google.com (Vlad Losev)
-//
-// This file implements death tests.
-
-#include <gtest/gtest-death-test.h>
-#include <gtest/internal/gtest-port.h>
-
-#if GTEST_HAS_DEATH_TEST
-
-#if GTEST_OS_MAC
-#include <crt_externs.h>
-#endif // GTEST_OS_MAC
-
-#include <errno.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <stdarg.h>
-
-#if GTEST_OS_WINDOWS
-#include <windows.h>
-#else
-#include <sys/mman.h>
-#include <sys/wait.h>
-#endif // GTEST_OS_WINDOWS
-
-#endif // GTEST_HAS_DEATH_TEST
-
-#include <gtest/gtest-message.h>
-#include <gtest/internal/gtest-string.h>
-
-// Indicates that this translation unit is part of Google Test's
-// implementation. It must come before gtest-internal-inl.h is
-// included, or there will be a compiler error. This trick is to
-// prevent a user from accidentally including gtest-internal-inl.h in
-// his code.
-#define GTEST_IMPLEMENTATION_ 1
-#include "gtest/internal/gtest-internal-inl.h"
-#undef GTEST_IMPLEMENTATION_
-
-namespace testing {
-
-// Constants.
-
-// The default death test style.
-static const char kDefaultDeathTestStyle[] = "fast";
-
-GTEST_DEFINE_string_(
- death_test_style,
- internal::StringFromGTestEnv("death_test_style", kDefaultDeathTestStyle),
- "Indicates how to run a death test in a forked child process: "
- "\"threadsafe\" (child process re-executes the test binary "
- "from the beginning, running only the specific death test) or "
- "\"fast\" (child process runs the death test immediately "
- "after forking).");
-
-GTEST_DEFINE_bool_(
- death_test_use_fork,
- internal::BoolFromGTestEnv("death_test_use_fork", false),
- "Instructs to use fork()/_exit() instead of clone() in death tests. "
- "Ignored and always uses fork() on POSIX systems where clone() is not "
- "implemented. Useful when running under valgrind or similar tools if "
- "those do not support clone(). Valgrind 3.3.1 will just fail if "
- "it sees an unsupported combination of clone() flags. "
- "It is not recommended to use this flag w/o valgrind though it will "
- "work in 99% of the cases. Once valgrind is fixed, this flag will "
- "most likely be removed.");
-
-namespace internal {
-GTEST_DEFINE_string_(
- internal_run_death_test, "",
- "Indicates the file, line number, temporal index of "
- "the single death test to run, and a file descriptor to "
- "which a success code may be sent, all separated by "
- "colons. This flag is specified if and only if the current "
- "process is a sub-process launched for running a thread-safe "
- "death test. FOR INTERNAL USE ONLY.");
-} // namespace internal
-
-#if GTEST_HAS_DEATH_TEST
-
-// ExitedWithCode constructor.
-ExitedWithCode::ExitedWithCode(int exit_code) : exit_code_(exit_code) {
-}
-
-// ExitedWithCode function-call operator.
-bool ExitedWithCode::operator()(int exit_status) const {
-#if GTEST_OS_WINDOWS
- return exit_status == exit_code_;
-#else
- return WIFEXITED(exit_status) && WEXITSTATUS(exit_status) == exit_code_;
-#endif // GTEST_OS_WINDOWS
-}
-
-#if !GTEST_OS_WINDOWS
-// KilledBySignal constructor.
-KilledBySignal::KilledBySignal(int signum) : signum_(signum) {
-}
-
-// KilledBySignal function-call operator.
-bool KilledBySignal::operator()(int exit_status) const {
- return WIFSIGNALED(exit_status) && WTERMSIG(exit_status) == signum_;
-}
-#endif // !GTEST_OS_WINDOWS
-
-namespace internal {
-
-// Utilities needed for death tests.
-
-// Generates a textual description of a given exit code, in the format
-// specified by wait(2).
-static String ExitSummary(int exit_code) {
- Message m;
-#if GTEST_OS_WINDOWS
- m << "Exited with exit status " << exit_code;
-#else
- if (WIFEXITED(exit_code)) {
- m << "Exited with exit status " << WEXITSTATUS(exit_code);
- } else if (WIFSIGNALED(exit_code)) {
- m << "Terminated by signal " << WTERMSIG(exit_code);
- }
-#ifdef WCOREDUMP
- if (WCOREDUMP(exit_code)) {
- m << " (core dumped)";
- }
-#endif
-#endif // GTEST_OS_WINDOWS
- return m.GetString();
-}
-
-// Returns true if exit_status describes a process that was terminated
-// by a signal, or exited normally with a nonzero exit code.
-bool ExitedUnsuccessfully(int exit_status) {
- return !ExitedWithCode(0)(exit_status);
-}
-
-#if !GTEST_OS_WINDOWS
-// Generates a textual failure message when a death test finds more than
-// one thread running, or cannot determine the number of threads, prior
-// to executing the given statement. It is the responsibility of the
-// caller not to pass a thread_count of 1.
-static String DeathTestThreadWarning(size_t thread_count) {
- Message msg;
- msg << "Death tests use fork(), which is unsafe particularly"
- << " in a threaded context. For this test, " << GTEST_NAME_ << " ";
- if (thread_count == 0)
- msg << "couldn't detect the number of threads.";
- else
- msg << "detected " << thread_count << " threads.";
- return msg.GetString();
-}
-#endif // !GTEST_OS_WINDOWS
-
-// Flag characters for reporting a death test that did not die.
-static const char kDeathTestLived = 'L';
-static const char kDeathTestReturned = 'R';
-static const char kDeathTestInternalError = 'I';
-
-// An enumeration describing all of the possible ways that a death test
-// can conclude. DIED means that the process died while executing the
-// test code; LIVED means that process lived beyond the end of the test
-// code; and RETURNED means that the test statement attempted a "return,"
-// which is not allowed. IN_PROGRESS means the test has not yet
-// concluded.
-enum DeathTestOutcome { IN_PROGRESS, DIED, LIVED, RETURNED };
-
-// Routine for aborting the program which is safe to call from an
-// exec-style death test child process, in which case the error
-// message is propagated back to the parent process. Otherwise, the
-// message is simply printed to stderr. In either case, the program
-// then exits with status 1.
-void DeathTestAbort(const String& message) {
- // On a POSIX system, this function may be called from a threadsafe-style
- // death test child process, which operates on a very small stack. Use
- // the heap for any additional non-minuscule memory requirements.
- const InternalRunDeathTestFlag* const flag =
- GetUnitTestImpl()->internal_run_death_test_flag();
- if (flag != NULL) {
- FILE* parent = posix::FDOpen(flag->write_fd(), "w");
- fputc(kDeathTestInternalError, parent);
- fprintf(parent, "%s", message.c_str());
- fflush(parent);
- _exit(1);
- } else {
- fprintf(stderr, "%s", message.c_str());
- fflush(stderr);
- abort();
- }
-}
-
-// A replacement for CHECK that calls DeathTestAbort if the assertion
-// fails.
-#define GTEST_DEATH_TEST_CHECK_(expression) \
- do { \
- if (!::testing::internal::IsTrue(expression)) { \
- DeathTestAbort(::testing::internal::String::Format( \
- "CHECK failed: File %s, line %d: %s", \
- __FILE__, __LINE__, #expression)); \
- } \
- } while (::testing::internal::AlwaysFalse())
-
-// This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for
-// evaluating any system call that fulfills two conditions: it must return
-// -1 on failure, and set errno to EINTR when it is interrupted and
-// should be tried again. The macro expands to a loop that repeatedly
-// evaluates the expression as long as it evaluates to -1 and sets
-// errno to EINTR. If the expression evaluates to -1 but errno is
-// something other than EINTR, DeathTestAbort is called.
-#define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \
- do { \
- int gtest_retval; \
- do { \
- gtest_retval = (expression); \
- } while (gtest_retval == -1 && errno == EINTR); \
- if (gtest_retval == -1) { \
- DeathTestAbort(::testing::internal::String::Format( \
- "CHECK failed: File %s, line %d: %s != -1", \
- __FILE__, __LINE__, #expression)); \
- } \
- } while (::testing::internal::AlwaysFalse())
-
-// Returns the message describing the last system error in errno.
-String GetLastErrnoDescription() {
- return String(errno == 0 ? "" : posix::StrError(errno));
-}
-
-// This is called from a death test parent process to read a failure
-// message from the death test child process and log it with the FATAL
-// severity. On Windows, the message is read from a pipe handle. On other
-// platforms, it is read from a file descriptor.
-static void FailFromInternalError(int fd) {
- Message error;
- char buffer[256];
- int num_read;
-
- do {
- while ((num_read = posix::Read(fd, buffer, 255)) > 0) {
- buffer[num_read] = '\0';
- error << buffer;
- }
- } while (num_read == -1 && errno == EINTR);
-
- if (num_read == 0) {
- GTEST_LOG_(FATAL) << error.GetString();
- } else {
- const int last_error = errno;
- GTEST_LOG_(FATAL) << "Error while reading death test internal: "
- << GetLastErrnoDescription() << " [" << last_error << "]";
- }
-}
-
-// Death test constructor. Increments the running death test count
-// for the current test.
-DeathTest::DeathTest() {
- TestInfo* const info = GetUnitTestImpl()->current_test_info();
- if (info == NULL) {
- DeathTestAbort("Cannot run a death test outside of a TEST or "
- "TEST_F construct");
- }
-}
-
-// Creates and returns a death test by dispatching to the current
-// death test factory.
-bool DeathTest::Create(const char* statement, const RE* regex,
- const char* file, int line, DeathTest** test) {
- return GetUnitTestImpl()->death_test_factory()->Create(
- statement, regex, file, line, test);
-}
-
-const char* DeathTest::LastMessage() {
- return last_death_test_message_.c_str();
-}
-
-void DeathTest::set_last_death_test_message(const String& message) {
- last_death_test_message_ = message;
-}
-
-String DeathTest::last_death_test_message_;
-
-// Provides cross platform implementation for some death functionality.
-class DeathTestImpl : public DeathTest {
- protected:
- DeathTestImpl(const char* a_statement, const RE* a_regex)
- : statement_(a_statement),
- regex_(a_regex),
- spawned_(false),
- status_(-1),
- outcome_(IN_PROGRESS),
- read_fd_(-1),
- write_fd_(-1) {}
-
- // read_fd_ is expected to be closed and cleared by a derived class.
- ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); }
-
- void Abort(AbortReason reason);
- virtual bool Passed(bool status_ok);
-
- const char* statement() const { return statement_; }
- const RE* regex() const { return regex_; }
- bool spawned() const { return spawned_; }
- void set_spawned(bool is_spawned) { spawned_ = is_spawned; }
- int status() const { return status_; }
- void set_status(int a_status) { status_ = a_status; }
- DeathTestOutcome outcome() const { return outcome_; }
- void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; }
- int read_fd() const { return read_fd_; }
- void set_read_fd(int fd) { read_fd_ = fd; }
- int write_fd() const { return write_fd_; }
- void set_write_fd(int fd) { write_fd_ = fd; }
-
- // Called in the parent process only. Reads the result code of the death
- // test child process via a pipe, interprets it to set the outcome_
- // member, and closes read_fd_. Outputs diagnostics and terminates in
- // case of unexpected codes.
- void ReadAndInterpretStatusByte();
-
- private:
- // The textual content of the code this object is testing. This class
- // doesn't own this string and should not attempt to delete it.
- const char* const statement_;
- // The regular expression which test output must match. DeathTestImpl
- // doesn't own this object and should not attempt to delete it.
- const RE* const regex_;
- // True if the death test child process has been successfully spawned.
- bool spawned_;
- // The exit status of the child process.
- int status_;
- // How the death test concluded.
- DeathTestOutcome outcome_;
- // Descriptor to the read end of the pipe to the child process. It is
- // always -1 in the child process. The child keeps its write end of the
- // pipe in write_fd_.
- int read_fd_;
- // Descriptor to the child's write end of the pipe to the parent process.
- // It is always -1 in the parent process. The parent keeps its end of the
- // pipe in read_fd_.
- int write_fd_;
-};
-
-// Called in the parent process only. Reads the result code of the death
-// test child process via a pipe, interprets it to set the outcome_
-// member, and closes read_fd_. Outputs diagnostics and terminates in
-// case of unexpected codes.
-void DeathTestImpl::ReadAndInterpretStatusByte() {
- char flag;
- int bytes_read;
-
- // The read() here blocks until data is available (signifying the
- // failure of the death test) or until the pipe is closed (signifying
- // its success), so it's okay to call this in the parent before
- // the child process has exited.
- do {
- bytes_read = posix::Read(read_fd(), &flag, 1);
- } while (bytes_read == -1 && errno == EINTR);
-
- if (bytes_read == 0) {
- set_outcome(DIED);
- } else if (bytes_read == 1) {
- switch (flag) {
- case kDeathTestReturned:
- set_outcome(RETURNED);
- break;
- case kDeathTestLived:
- set_outcome(LIVED);
- break;
- case kDeathTestInternalError:
- FailFromInternalError(read_fd()); // Does not return.
- break;
- default:
- GTEST_LOG_(FATAL) << "Death test child process reported "
- << "unexpected status byte ("
- << static_cast<unsigned int>(flag) << ")";
- }
- } else {
- GTEST_LOG_(FATAL) << "Read from death test child process failed: "
- << GetLastErrnoDescription();
- }
- GTEST_DEATH_TEST_CHECK_SYSCALL_(posix::Close(read_fd()));
- set_read_fd(-1);
-}
-
-// Signals that the death test code which should have exited, didn't.
-// Should be called only in a death test child process.
-// Writes a status byte to the child's status file descriptor, then
-// calls _exit(1).
-void DeathTestImpl::Abort(AbortReason reason) {
- // The parent process considers the death test to be a failure if
- // it finds any data in our pipe. So, here we write a single flag byte
- // to the pipe, then exit.
- const char status_ch =
- reason == TEST_DID_NOT_DIE ? kDeathTestLived : kDeathTestReturned;
- GTEST_DEATH_TEST_CHECK_SYSCALL_(posix::Write(write_fd(), &status_ch, 1));
- GTEST_DEATH_TEST_CHECK_SYSCALL_(posix::Close(write_fd()));
- _exit(1); // Exits w/o any normal exit hooks (we were supposed to crash)
-}
-
-// Assesses the success or failure of a death test, using both private
-// members which have previously been set, and one argument:
-//
-// Private data members:
-// outcome: An enumeration describing how the death test
-// concluded: DIED, LIVED, or RETURNED. The death test fails
-// in the latter two cases.
-// status: The exit status of the child process. On *nix, it is in the
-// in the format specified by wait(2). On Windows, this is the
-// value supplied to the ExitProcess() API or a numeric code
-// of the exception that terminated the program.
-// regex: A regular expression object to be applied to
-// the test's captured standard error output; the death test
-// fails if it does not match.
-//
-// Argument:
-// status_ok: true if exit_status is acceptable in the context of
-// this particular death test, which fails if it is false
-//
-// Returns true iff all of the above conditions are met. Otherwise, the
-// first failing condition, in the order given above, is the one that is
-// reported. Also sets the last death test message string.
-bool DeathTestImpl::Passed(bool status_ok) {
- if (!spawned())
- return false;
-
- const String error_message = GetCapturedStderr();
-
- bool success = false;
- Message buffer;
-
- buffer << "Death test: " << statement() << "\n";
- switch (outcome()) {
- case LIVED:
- buffer << " Result: failed to die.\n"
- << " Error msg: " << error_message;
- break;
- case RETURNED:
- buffer << " Result: illegal return in test statement.\n"
- << " Error msg: " << error_message;
- break;
- case DIED:
- if (status_ok) {
- const bool matched = RE::PartialMatch(error_message.c_str(), *regex());
- if (matched) {
- success = true;
- } else {
- buffer << " Result: died but not with expected error.\n"
- << " Expected: " << regex()->pattern() << "\n"
- << "Actual msg: " << error_message;
- }
- } else {
- buffer << " Result: died but not with expected exit code:\n"
- << " " << ExitSummary(status()) << "\n";
- }
- break;
- case IN_PROGRESS:
- default:
- GTEST_LOG_(FATAL)
- << "DeathTest::Passed somehow called before conclusion of test";
- }
-
- DeathTest::set_last_death_test_message(buffer.GetString());
- return success;
-}
-
-#if GTEST_OS_WINDOWS
-// WindowsDeathTest implements death tests on Windows. Due to the
-// specifics of starting new processes on Windows, death tests there are
-// always threadsafe, and Google Test considers the
-// --gtest_death_test_style=fast setting to be equivalent to
-// --gtest_death_test_style=threadsafe there.
-//
-// A few implementation notes: Like the Linux version, the Windows
-// implementation uses pipes for child-to-parent communication. But due to
-// the specifics of pipes on Windows, some extra steps are required:
-//
-// 1. The parent creates a communication pipe and stores handles to both
-// ends of it.
-// 2. The parent starts the child and provides it with the information
-// necessary to acquire the handle to the write end of the pipe.
-// 3. The child acquires the write end of the pipe and signals the parent
-// using a Windows event.
-// 4. Now the parent can release the write end of the pipe on its side. If
-// this is done before step 3, the object's reference count goes down to
-// 0 and it is destroyed, preventing the child from acquiring it. The
-// parent now has to release it, or read operations on the read end of
-// the pipe will not return when the child terminates.
-// 5. The parent reads child's output through the pipe (outcome code and
-// any possible error messages) from the pipe, and its stderr and then
-// determines whether to fail the test.
-//
-// Note: to distinguish Win32 API calls from the local method and function
-// calls, the former are explicitly resolved in the global namespace.
-//
-class WindowsDeathTest : public DeathTestImpl {
- public:
- WindowsDeathTest(const char* statement,
- const RE* regex,
- const char* file,
- int line)
- : DeathTestImpl(statement, regex), file_(file), line_(line) {}
-
- // All of these virtual functions are inherited from DeathTest.
- virtual int Wait();
- virtual TestRole AssumeRole();
-
- private:
- // The name of the file in which the death test is located.
- const char* const file_;
- // The line number on which the death test is located.
- const int line_;
- // Handle to the write end of the pipe to the child process.
- AutoHandle write_handle_;
- // Child process handle.
- AutoHandle child_handle_;
- // Event the child process uses to signal the parent that it has
- // acquired the handle to the write end of the pipe. After seeing this
- // event the parent can release its own handles to make sure its
- // ReadFile() calls return when the child terminates.
- AutoHandle event_handle_;
-};
-
-// Waits for the child in a death test to exit, returning its exit
-// status, or 0 if no child process exists. As a side effect, sets the
-// outcome data member.
-int WindowsDeathTest::Wait() {
- if (!spawned())
- return 0;
-
- // Wait until the child either signals that it has acquired the write end
- // of the pipe or it dies.
- const HANDLE wait_handles[2] = { child_handle_.Get(), event_handle_.Get() };
- switch (::WaitForMultipleObjects(2,
- wait_handles,
- FALSE, // Waits for any of the handles.
- INFINITE)) {
- case WAIT_OBJECT_0:
- case WAIT_OBJECT_0 + 1:
- break;
- default:
- GTEST_DEATH_TEST_CHECK_(false); // Should not get here.
- }
-
- // The child has acquired the write end of the pipe or exited.
- // We release the handle on our side and continue.
- write_handle_.Reset();
- event_handle_.Reset();
-
- ReadAndInterpretStatusByte();
-
- // Waits for the child process to exit if it haven't already. This
- // returns immediately if the child has already exited, regardless of
- // whether previous calls to WaitForMultipleObjects synchronized on this
- // handle or not.
- GTEST_DEATH_TEST_CHECK_(
- WAIT_OBJECT_0 == ::WaitForSingleObject(child_handle_.Get(),
- INFINITE));
- DWORD status;
- GTEST_DEATH_TEST_CHECK_(::GetExitCodeProcess(child_handle_.Get(), &status)
- != FALSE);
- child_handle_.Reset();
- set_status(static_cast<int>(status));
- return this->status();
-}
-
-// The AssumeRole process for a Windows death test. It creates a child
-// process with the same executable as the current process to run the
-// death test. The child process is given the --gtest_filter and
-// --gtest_internal_run_death_test flags such that it knows to run the
-// current death test only.
-DeathTest::TestRole WindowsDeathTest::AssumeRole() {
- const UnitTestImpl* const impl = GetUnitTestImpl();
- const InternalRunDeathTestFlag* const flag =
- impl->internal_run_death_test_flag();
- const TestInfo* const info = impl->current_test_info();
- const int death_test_index = info->result()->death_test_count();
-
- if (flag != NULL) {
- // ParseInternalRunDeathTestFlag() has performed all the necessary
- // processing.
- set_write_fd(flag->write_fd());
- return EXECUTE_TEST;
- }
-
- // WindowsDeathTest uses an anonymous pipe to communicate results of
- // a death test.
- SECURITY_ATTRIBUTES handles_are_inheritable = {
- sizeof(SECURITY_ATTRIBUTES), NULL, TRUE };
- HANDLE read_handle, write_handle;
- GTEST_DEATH_TEST_CHECK_(
- ::CreatePipe(&read_handle, &write_handle, &handles_are_inheritable,
- 0) // Default buffer size.
- != FALSE);
- set_read_fd(::_open_osfhandle(reinterpret_cast<intptr_t>(read_handle),
- O_RDONLY));
- write_handle_.Reset(write_handle);
- event_handle_.Reset(::CreateEvent(
- &handles_are_inheritable,
- TRUE, // The event will automatically reset to non-signaled state.
- FALSE, // The initial state is non-signalled.
- NULL)); // The even is unnamed.
- GTEST_DEATH_TEST_CHECK_(event_handle_.Get() != NULL);
- const String filter_flag = String::Format("--%s%s=%s.%s",
- GTEST_FLAG_PREFIX_, kFilterFlag,
- info->test_case_name(),
- info->name());
- const String internal_flag = String::Format(
- "--%s%s=%s|%d|%d|%u|%Iu|%Iu",
- GTEST_FLAG_PREFIX_,
- kInternalRunDeathTestFlag,
- file_, line_,
- death_test_index,
- static_cast<unsigned int>(::GetCurrentProcessId()),
- // size_t has the same with as pointers on both 32-bit and 64-bit
- // Windows platforms.
- // See http://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx.
- reinterpret_cast<size_t>(write_handle),
- reinterpret_cast<size_t>(event_handle_.Get()));
-
- char executable_path[_MAX_PATH + 1]; // NOLINT
- GTEST_DEATH_TEST_CHECK_(
- _MAX_PATH + 1 != ::GetModuleFileNameA(NULL,
- executable_path,
- _MAX_PATH));
-
- String command_line = String::Format("%s %s \"%s\"",
- ::GetCommandLineA(),
- filter_flag.c_str(),
- internal_flag.c_str());
-
- DeathTest::set_last_death_test_message("");
-
- CaptureStderr();
- // Flush the log buffers since the log streams are shared with the child.
- FlushInfoLog();
-
- // The child process will share the standard handles with the parent.
- STARTUPINFOA startup_info;
- memset(&startup_info, 0, sizeof(STARTUPINFO));
- startup_info.dwFlags = STARTF_USESTDHANDLES;
- startup_info.hStdInput = ::GetStdHandle(STD_INPUT_HANDLE);
- startup_info.hStdOutput = ::GetStdHandle(STD_OUTPUT_HANDLE);
- startup_info.hStdError = ::GetStdHandle(STD_ERROR_HANDLE);
-
- PROCESS_INFORMATION process_info;
- GTEST_DEATH_TEST_CHECK_(::CreateProcessA(
- executable_path,
- const_cast<char*>(command_line.c_str()),
- NULL, // Retuned process handle is not inheritable.
- NULL, // Retuned thread handle is not inheritable.
- TRUE, // Child inherits all inheritable handles (for write_handle_).
- 0x0, // Default creation flags.
- NULL, // Inherit the parent's environment.
- UnitTest::GetInstance()->original_working_dir(),
- &startup_info,
- &process_info) != FALSE);
- child_handle_.Reset(process_info.hProcess);
- ::CloseHandle(process_info.hThread);
- set_spawned(true);
- return OVERSEE_TEST;
-}
-#else // We are not on Windows.
-
-// ForkingDeathTest provides implementations for most of the abstract
-// methods of the DeathTest interface. Only the AssumeRole method is
-// left undefined.
-class ForkingDeathTest : public DeathTestImpl {
- public:
- ForkingDeathTest(const char* statement, const RE* regex);
-
- // All of these virtual functions are inherited from DeathTest.
- virtual int Wait();
-
- protected:
- void set_child_pid(pid_t child_pid) { child_pid_ = child_pid; }
-
- private:
- // PID of child process during death test; 0 in the child process itself.
- pid_t child_pid_;
-};
-
-// Constructs a ForkingDeathTest.
-ForkingDeathTest::ForkingDeathTest(const char* a_statement, const RE* a_regex)
- : DeathTestImpl(a_statement, a_regex),
- child_pid_(-1) {}
-
-// Waits for the child in a death test to exit, returning its exit
-// status, or 0 if no child process exists. As a side effect, sets the
-// outcome data member.
-int ForkingDeathTest::Wait() {
- if (!spawned())
- return 0;
-
- ReadAndInterpretStatusByte();
-
- int status_value;
- GTEST_DEATH_TEST_CHECK_SYSCALL_(waitpid(child_pid_, &status_value, 0));
- set_status(status_value);
- return status_value;
-}
-
-// A concrete death test class that forks, then immediately runs the test
-// in the child process.
-class NoExecDeathTest : public ForkingDeathTest {
- public:
- NoExecDeathTest(const char* a_statement, const RE* a_regex) :
- ForkingDeathTest(a_statement, a_regex) { }
- virtual TestRole AssumeRole();
-};
-
-// The AssumeRole process for a fork-and-run death test. It implements a
-// straightforward fork, with a simple pipe to transmit the status byte.
-DeathTest::TestRole NoExecDeathTest::AssumeRole() {
- const size_t thread_count = GetThreadCount();
- if (thread_count != 1) {
- GTEST_LOG_(WARNING) << DeathTestThreadWarning(thread_count);
- }
-
- int pipe_fd[2];
- GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1);
-
- DeathTest::set_last_death_test_message("");
- CaptureStderr();
- // When we fork the process below, the log file buffers are copied, but the
- // file descriptors are shared. We flush all log files here so that closing
- // the file descriptors in the child process doesn't throw off the
- // synchronization between descriptors and buffers in the parent process.
- // This is as close to the fork as possible to avoid a race condition in case
- // there are multiple threads running before the death test, and another
- // thread writes to the log file.
- FlushInfoLog();
-
- const pid_t child_pid = fork();
- GTEST_DEATH_TEST_CHECK_(child_pid != -1);
- set_child_pid(child_pid);
- if (child_pid == 0) {
- GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[0]));
- set_write_fd(pipe_fd[1]);
- // Redirects all logging to stderr in the child process to prevent
- // concurrent writes to the log files. We capture stderr in the parent
- // process and append the child process' output to a log.
- LogToStderr();
- // Event forwarding to the listeners of event listener API mush be shut
- // down in death test subprocesses.
- GetUnitTestImpl()->listeners()->SuppressEventForwarding();
- return EXECUTE_TEST;
- } else {
- GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[1]));
- set_read_fd(pipe_fd[0]);
- set_spawned(true);
- return OVERSEE_TEST;
- }
-}
-
-// A concrete death test class that forks and re-executes the main
-// program from the beginning, with command-line flags set that cause
-// only this specific death test to be run.
-class ExecDeathTest : public ForkingDeathTest {
- public:
- ExecDeathTest(const char* a_statement, const RE* a_regex,
- const char* file, int line) :
- ForkingDeathTest(a_statement, a_regex), file_(file), line_(line) { }
- virtual TestRole AssumeRole();
- private:
- // The name of the file in which the death test is located.
- const char* const file_;
- // The line number on which the death test is located.
- const int line_;
-};
-
-// Utility class for accumulating command-line arguments.
-class Arguments {
- public:
- Arguments() {
- args_.push_back(NULL);
- }
-
- ~Arguments() {
- for (std::vector<char*>::iterator i = args_.begin(); i != args_.end();
- ++i) {
- free(*i);
- }
- }
- void AddArgument(const char* argument) {
- args_.insert(args_.end() - 1, posix::StrDup(argument));
- }
-
- template <typename Str>
- void AddArguments(const ::std::vector<Str>& arguments) {
- for (typename ::std::vector<Str>::const_iterator i = arguments.begin();
- i != arguments.end();
- ++i) {
- args_.insert(args_.end() - 1, posix::StrDup(i->c_str()));
- }
- }
- char* const* Argv() {
- return &args_[0];
- }
- private:
- std::vector<char*> args_;
-};
-
-// A struct that encompasses the arguments to the child process of a
-// threadsafe-style death test process.
-struct ExecDeathTestArgs {
- char* const* argv; // Command-line arguments for the child's call to exec
- int close_fd; // File descriptor to close; the read end of a pipe
-};
-
-#if GTEST_OS_MAC
-inline char** GetEnviron() {
- // When Google Test is built as a framework on MacOS X, the environ variable
- // is unavailable. Apple's documentation (man environ) recommends using
- // _NSGetEnviron() instead.
- return *_NSGetEnviron();
-}
-#else
-// Some POSIX platforms expect you to declare environ. extern "C" makes
-// it reside in the global namespace.
-extern "C" char** environ;
-inline char** GetEnviron() { return environ; }
-#endif // GTEST_OS_MAC
-
-// The main function for a threadsafe-style death test child process.
-// This function is called in a clone()-ed process and thus must avoid
-// any potentially unsafe operations like malloc or libc functions.
-static int ExecDeathTestChildMain(void* child_arg) {
- ExecDeathTestArgs* const args = static_cast<ExecDeathTestArgs*>(child_arg);
- GTEST_DEATH_TEST_CHECK_SYSCALL_(close(args->close_fd));
-
- // We need to execute the test program in the same environment where
- // it was originally invoked. Therefore we change to the original
- // working directory first.
- const char* const original_dir =
- UnitTest::GetInstance()->original_working_dir();
- // We can safely call chdir() as it's a direct system call.
- if (chdir(original_dir) != 0) {
- DeathTestAbort(String::Format("chdir(\"%s\") failed: %s",
- original_dir,
- GetLastErrnoDescription().c_str()));
- return EXIT_FAILURE;
- }
-
- // We can safely call execve() as it's a direct system call. We
- // cannot use execvp() as it's a libc function and thus potentially
- // unsafe. Since execve() doesn't search the PATH, the user must
- // invoke the test program via a valid path that contains at least
- // one path separator.
- execve(args->argv[0], args->argv, GetEnviron());
- DeathTestAbort(String::Format("execve(%s, ...) in %s failed: %s",
- args->argv[0],
- original_dir,
- GetLastErrnoDescription().c_str()));
- return EXIT_FAILURE;
-}
-
-// Two utility routines that together determine the direction the stack
-// grows.
-// This could be accomplished more elegantly by a single recursive
-// function, but we want to guard against the unlikely possibility of
-// a smart compiler optimizing the recursion away.
-bool StackLowerThanAddress(const void* ptr) {
- int dummy;
- return &dummy < ptr;
-}
-
-bool StackGrowsDown() {
- int dummy;
- return StackLowerThanAddress(&dummy);
-}
-
-// A threadsafe implementation of fork(2) for threadsafe-style death tests
-// that uses clone(2). It dies with an error message if anything goes
-// wrong.
-static pid_t ExecDeathTestFork(char* const* argv, int close_fd) {
- ExecDeathTestArgs args = { argv, close_fd };
- pid_t child_pid = -1;
-
-#if GTEST_HAS_CLONE
- const bool use_fork = GTEST_FLAG(death_test_use_fork);
-
- if (!use_fork) {
- static const bool stack_grows_down = StackGrowsDown();
- const size_t stack_size = getpagesize();
- // MMAP_ANONYMOUS is not defined on Mac, so we use MAP_ANON instead.
- void* const stack = mmap(NULL, stack_size, PROT_READ | PROT_WRITE,
- MAP_ANON | MAP_PRIVATE, -1, 0);
- GTEST_DEATH_TEST_CHECK_(stack != MAP_FAILED);
- void* const stack_top =
- static_cast<char*>(stack) + (stack_grows_down ? stack_size : 0);
-
- child_pid = clone(&ExecDeathTestChildMain, stack_top, SIGCHLD, &args);
-
- GTEST_DEATH_TEST_CHECK_(munmap(stack, stack_size) != -1);
- }
-#else
- const bool use_fork = true;
-#endif // GTEST_HAS_CLONE
-
- if (use_fork && (child_pid = fork()) == 0) {
- ExecDeathTestChildMain(&args);
- _exit(0);
- }
-
- GTEST_DEATH_TEST_CHECK_(child_pid != -1);
- return child_pid;
-}
-
-// The AssumeRole process for a fork-and-exec death test. It re-executes the
-// main program from the beginning, setting the --gtest_filter
-// and --gtest_internal_run_death_test flags to cause only the current
-// death test to be re-run.
-DeathTest::TestRole ExecDeathTest::AssumeRole() {
- const UnitTestImpl* const impl = GetUnitTestImpl();
- const InternalRunDeathTestFlag* const flag =
- impl->internal_run_death_test_flag();
- const TestInfo* const info = impl->current_test_info();
- const int death_test_index = info->result()->death_test_count();
-
- if (flag != NULL) {
- set_write_fd(flag->write_fd());
- return EXECUTE_TEST;
- }
-
- int pipe_fd[2];
- GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1);
- // Clear the close-on-exec flag on the write end of the pipe, lest
- // it be closed when the child process does an exec:
- GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1);
-
- const String filter_flag =
- String::Format("--%s%s=%s.%s",
- GTEST_FLAG_PREFIX_, kFilterFlag,
- info->test_case_name(), info->name());
- const String internal_flag =
- String::Format("--%s%s=%s|%d|%d|%d",
- GTEST_FLAG_PREFIX_, kInternalRunDeathTestFlag,
- file_, line_, death_test_index, pipe_fd[1]);
- Arguments args;
- args.AddArguments(GetArgvs());
- args.AddArgument(filter_flag.c_str());
- args.AddArgument(internal_flag.c_str());
-
- DeathTest::set_last_death_test_message("");
-
- CaptureStderr();
- // See the comment in NoExecDeathTest::AssumeRole for why the next line
- // is necessary.
- FlushInfoLog();
-
- const pid_t child_pid = ExecDeathTestFork(args.Argv(), pipe_fd[0]);
- GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[1]));
- set_child_pid(child_pid);
- set_read_fd(pipe_fd[0]);
- set_spawned(true);
- return OVERSEE_TEST;
-}
-
-#endif // !GTEST_OS_WINDOWS
-
-// Creates a concrete DeathTest-derived class that depends on the
-// --gtest_death_test_style flag, and sets the pointer pointed to
-// by the "test" argument to its address. If the test should be
-// skipped, sets that pointer to NULL. Returns true, unless the
-// flag is set to an invalid value.
-bool DefaultDeathTestFactory::Create(const char* statement, const RE* regex,
- const char* file, int line,
- DeathTest** test) {
- UnitTestImpl* const impl = GetUnitTestImpl();
- const InternalRunDeathTestFlag* const flag =
- impl->internal_run_death_test_flag();
- const int death_test_index = impl->current_test_info()
- ->increment_death_test_count();
-
- if (flag != NULL) {
- if (death_test_index > flag->index()) {
- DeathTest::set_last_death_test_message(String::Format(
- "Death test count (%d) somehow exceeded expected maximum (%d)",
- death_test_index, flag->index()));
- return false;
- }
-
- if (!(flag->file() == file && flag->line() == line &&
- flag->index() == death_test_index)) {
- *test = NULL;
- return true;
- }
- }
-
-#if GTEST_OS_WINDOWS
- if (GTEST_FLAG(death_test_style) == "threadsafe" ||
- GTEST_FLAG(death_test_style) == "fast") {
- *test = new WindowsDeathTest(statement, regex, file, line);
- }
-#else
- if (GTEST_FLAG(death_test_style) == "threadsafe") {
- *test = new ExecDeathTest(statement, regex, file, line);
- } else if (GTEST_FLAG(death_test_style) == "fast") {
- *test = new NoExecDeathTest(statement, regex);
- }
-#endif // GTEST_OS_WINDOWS
- else { // NOLINT - this is more readable than unbalanced brackets inside #if.
- DeathTest::set_last_death_test_message(String::Format(
- "Unknown death test style \"%s\" encountered",
- GTEST_FLAG(death_test_style).c_str()));
- return false;
- }
-
- return true;
-}
-
-// Splits a given string on a given delimiter, populating a given
-// vector with the fields. GTEST_HAS_DEATH_TEST implies that we have
-// ::std::string, so we can use it here.
-static void SplitString(const ::std::string& str, char delimiter,
- ::std::vector< ::std::string>* dest) {
- ::std::vector< ::std::string> parsed;
- ::std::string::size_type pos = 0;
- while (::testing::internal::AlwaysTrue()) {
- const ::std::string::size_type colon = str.find(delimiter, pos);
- if (colon == ::std::string::npos) {
- parsed.push_back(str.substr(pos));
- break;
- } else {
- parsed.push_back(str.substr(pos, colon - pos));
- pos = colon + 1;
- }
- }
- dest->swap(parsed);
-}
-
-#if GTEST_OS_WINDOWS
-// Recreates the pipe and event handles from the provided parameters,
-// signals the event, and returns a file descriptor wrapped around the pipe
-// handle. This function is called in the child process only.
-int GetStatusFileDescriptor(unsigned int parent_process_id,
- size_t write_handle_as_size_t,
- size_t event_handle_as_size_t) {
- AutoHandle parent_process_handle(::OpenProcess(PROCESS_DUP_HANDLE,
- FALSE, // Non-inheritable.
- parent_process_id));
- if (parent_process_handle.Get() == INVALID_HANDLE_VALUE) {
- DeathTestAbort(String::Format("Unable to open parent process %u",
- parent_process_id));
- }
-
- // TODO(vladl@google.com): Replace the following check with a
- // compile-time assertion when available.
- GTEST_CHECK_(sizeof(HANDLE) <= sizeof(size_t));
-
- const HANDLE write_handle =
- reinterpret_cast<HANDLE>(write_handle_as_size_t);
- HANDLE dup_write_handle;
-
- // The newly initialized handle is accessible only in in the parent
- // process. To obtain one accessible within the child, we need to use
- // DuplicateHandle.
- if (!::DuplicateHandle(parent_process_handle.Get(), write_handle,
- ::GetCurrentProcess(), &dup_write_handle,
- 0x0, // Requested privileges ignored since
- // DUPLICATE_SAME_ACCESS is used.
- FALSE, // Request non-inheritable handler.
- DUPLICATE_SAME_ACCESS)) {
- DeathTestAbort(String::Format(
- "Unable to duplicate the pipe handle %Iu from the parent process %u",
- write_handle_as_size_t, parent_process_id));
- }
-
- const HANDLE event_handle = reinterpret_cast<HANDLE>(event_handle_as_size_t);
- HANDLE dup_event_handle;
-
- if (!::DuplicateHandle(parent_process_handle.Get(), event_handle,
- ::GetCurrentProcess(), &dup_event_handle,
- 0x0,
- FALSE,
- DUPLICATE_SAME_ACCESS)) {
- DeathTestAbort(String::Format(
- "Unable to duplicate the event handle %Iu from the parent process %u",
- event_handle_as_size_t, parent_process_id));
- }
-
- const int write_fd =
- ::_open_osfhandle(reinterpret_cast<intptr_t>(dup_write_handle), O_APPEND);
- if (write_fd == -1) {
- DeathTestAbort(String::Format(
- "Unable to convert pipe handle %Iu to a file descriptor",
- write_handle_as_size_t));
- }
-
- // Signals the parent that the write end of the pipe has been acquired
- // so the parent can release its own write end.
- ::SetEvent(dup_event_handle);
-
- return write_fd;
-}
-#endif // GTEST_OS_WINDOWS
-
-// Returns a newly created InternalRunDeathTestFlag object with fields
-// initialized from the GTEST_FLAG(internal_run_death_test) flag if
-// the flag is specified; otherwise returns NULL.
-InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag() {
- if (GTEST_FLAG(internal_run_death_test) == "") return NULL;
-
- // GTEST_HAS_DEATH_TEST implies that we have ::std::string, so we
- // can use it here.
- int line = -1;
- int index = -1;
- ::std::vector< ::std::string> fields;
- SplitString(GTEST_FLAG(internal_run_death_test).c_str(), '|', &fields);
- int write_fd = -1;
-
-#if GTEST_OS_WINDOWS
- unsigned int parent_process_id = 0;
- size_t write_handle_as_size_t = 0;
- size_t event_handle_as_size_t = 0;
-
- if (fields.size() != 6
- || !ParseNaturalNumber(fields[1], &line)
- || !ParseNaturalNumber(fields[2], &index)
- || !ParseNaturalNumber(fields[3], &parent_process_id)
- || !ParseNaturalNumber(fields[4], &write_handle_as_size_t)
- || !ParseNaturalNumber(fields[5], &event_handle_as_size_t)) {
- DeathTestAbort(String::Format(
- "Bad --gtest_internal_run_death_test flag: %s",
- GTEST_FLAG(internal_run_death_test).c_str()));
- }
- write_fd = GetStatusFileDescriptor(parent_process_id,
- write_handle_as_size_t,
- event_handle_as_size_t);
-#else
- if (fields.size() != 4
- || !ParseNaturalNumber(fields[1], &line)
- || !ParseNaturalNumber(fields[2], &index)
- || !ParseNaturalNumber(fields[3], &write_fd)) {
- DeathTestAbort(String::Format(
- "Bad --gtest_internal_run_death_test flag: %s",
- GTEST_FLAG(internal_run_death_test).c_str()));
- }
-#endif // GTEST_OS_WINDOWS
- return new InternalRunDeathTestFlag(fields[0], line, index, write_fd);
-}
-
-} // namespace internal
-
-#endif // GTEST_HAS_DEATH_TEST
-
-} // namespace testing
diff --git a/contrib/llvm/utils/unittest/googletest/gtest-filepath.cc b/contrib/llvm/utils/unittest/googletest/gtest-filepath.cc
deleted file mode 100644
index c1ef918..0000000
--- a/contrib/llvm/utils/unittest/googletest/gtest-filepath.cc
+++ /dev/null
@@ -1,380 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-//
-// Authors: keith.ray@gmail.com (Keith Ray)
-
-#include <gtest/internal/gtest-filepath.h>
-#include <gtest/internal/gtest-port.h>
-
-#include <stdlib.h>
-
-#if GTEST_OS_WINDOWS_MOBILE
-#include <windows.h>
-#elif GTEST_OS_WINDOWS
-#include <direct.h>
-#include <io.h>
-#elif GTEST_OS_SYMBIAN
-// Symbian OpenC has PATH_MAX in sys/syslimits.h
-#include <sys/syslimits.h>
-#else
-#include <limits.h>
-#include <climits> // Some Linux distributions define PATH_MAX here.
-#endif // GTEST_OS_WINDOWS_MOBILE
-
-#if GTEST_OS_WINDOWS
-#define GTEST_PATH_MAX_ _MAX_PATH
-#elif defined(PATH_MAX)
-#define GTEST_PATH_MAX_ PATH_MAX
-#elif defined(_XOPEN_PATH_MAX)
-#define GTEST_PATH_MAX_ _XOPEN_PATH_MAX
-#else
-#define GTEST_PATH_MAX_ _POSIX_PATH_MAX
-#endif // GTEST_OS_WINDOWS
-
-#include <gtest/internal/gtest-string.h>
-
-namespace testing {
-namespace internal {
-
-#if GTEST_OS_WINDOWS
-// On Windows, '\\' is the standard path separator, but many tools and the
-// Windows API also accept '/' as an alternate path separator. Unless otherwise
-// noted, a file path can contain either kind of path separators, or a mixture
-// of them.
-const char kPathSeparator = '\\';
-const char kAlternatePathSeparator = '/';
-const char kPathSeparatorString[] = "\\";
-const char kAlternatePathSeparatorString[] = "/";
-#if GTEST_OS_WINDOWS_MOBILE
-// Windows CE doesn't have a current directory. You should not use
-// the current directory in tests on Windows CE, but this at least
-// provides a reasonable fallback.
-const char kCurrentDirectoryString[] = "\\";
-// Windows CE doesn't define INVALID_FILE_ATTRIBUTES
-const DWORD kInvalidFileAttributes = 0xffffffff;
-#else
-const char kCurrentDirectoryString[] = ".\\";
-#endif // GTEST_OS_WINDOWS_MOBILE
-#else
-const char kPathSeparator = '/';
-const char kPathSeparatorString[] = "/";
-const char kCurrentDirectoryString[] = "./";
-#endif // GTEST_OS_WINDOWS
-
-// Returns whether the given character is a valid path separator.
-static bool IsPathSeparator(char c) {
-#if GTEST_HAS_ALT_PATH_SEP_
- return (c == kPathSeparator) || (c == kAlternatePathSeparator);
-#else
- return c == kPathSeparator;
-#endif
-}
-
-// Returns the current working directory, or "" if unsuccessful.
-FilePath FilePath::GetCurrentDir() {
-#if GTEST_OS_WINDOWS_MOBILE
- // Windows CE doesn't have a current directory, so we just return
- // something reasonable.
- return FilePath(kCurrentDirectoryString);
-#elif GTEST_OS_WINDOWS
- char cwd[GTEST_PATH_MAX_ + 1] = { '\0' };
- return FilePath(_getcwd(cwd, sizeof(cwd)) == NULL ? "" : cwd);
-#else
- char cwd[GTEST_PATH_MAX_ + 1] = { '\0' };
- return FilePath(getcwd(cwd, sizeof(cwd)) == NULL ? "" : cwd);
-#endif // GTEST_OS_WINDOWS_MOBILE
-}
-
-// Returns a copy of the FilePath with the case-insensitive extension removed.
-// Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
-// FilePath("dir/file"). If a case-insensitive extension is not
-// found, returns a copy of the original FilePath.
-FilePath FilePath::RemoveExtension(const char* extension) const {
- String dot_extension(String::Format(".%s", extension));
- if (pathname_.EndsWithCaseInsensitive(dot_extension.c_str())) {
- return FilePath(String(pathname_.c_str(), pathname_.length() - 4));
- }
- return *this;
-}
-
-// Returns a pointer to the last occurence of a valid path separator in
-// the FilePath. On Windows, for example, both '/' and '\' are valid path
-// separators. Returns NULL if no path separator was found.
-const char* FilePath::FindLastPathSeparator() const {
- const char* const last_sep = strrchr(c_str(), kPathSeparator);
-#if GTEST_HAS_ALT_PATH_SEP_
- const char* const last_alt_sep = strrchr(c_str(), kAlternatePathSeparator);
- // Comparing two pointers of which only one is NULL is undefined.
- if (last_alt_sep != NULL &&
- (last_sep == NULL || last_alt_sep > last_sep)) {
- return last_alt_sep;
- }
-#endif
- return last_sep;
-}
-
-// Returns a copy of the FilePath with the directory part removed.
-// Example: FilePath("path/to/file").RemoveDirectoryName() returns
-// FilePath("file"). If there is no directory part ("just_a_file"), it returns
-// the FilePath unmodified. If there is no file part ("just_a_dir/") it
-// returns an empty FilePath ("").
-// On Windows platform, '\' is the path separator, otherwise it is '/'.
-FilePath FilePath::RemoveDirectoryName() const {
- const char* const last_sep = FindLastPathSeparator();
- return last_sep ? FilePath(String(last_sep + 1)) : *this;
-}
-
-// RemoveFileName returns the directory path with the filename removed.
-// Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
-// If the FilePath is "a_file" or "/a_file", RemoveFileName returns
-// FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
-// not have a file, like "just/a/dir/", it returns the FilePath unmodified.
-// On Windows platform, '\' is the path separator, otherwise it is '/'.
-FilePath FilePath::RemoveFileName() const {
- const char* const last_sep = FindLastPathSeparator();
- String dir;
- if (last_sep) {
- dir = String(c_str(), last_sep + 1 - c_str());
- } else {
- dir = kCurrentDirectoryString;
- }
- return FilePath(dir);
-}
-
-// Helper functions for naming files in a directory for xml output.
-
-// Given directory = "dir", base_name = "test", number = 0,
-// extension = "xml", returns "dir/test.xml". If number is greater
-// than zero (e.g., 12), returns "dir/test_12.xml".
-// On Windows platform, uses \ as the separator rather than /.
-FilePath FilePath::MakeFileName(const FilePath& directory,
- const FilePath& base_name,
- int number,
- const char* extension) {
- String file;
- if (number == 0) {
- file = String::Format("%s.%s", base_name.c_str(), extension);
- } else {
- file = String::Format("%s_%d.%s", base_name.c_str(), number, extension);
- }
- return ConcatPaths(directory, FilePath(file));
-}
-
-// Given directory = "dir", relative_path = "test.xml", returns "dir/test.xml".
-// On Windows, uses \ as the separator rather than /.
-FilePath FilePath::ConcatPaths(const FilePath& directory,
- const FilePath& relative_path) {
- if (directory.IsEmpty())
- return relative_path;
- const FilePath dir(directory.RemoveTrailingPathSeparator());
- return FilePath(String::Format("%s%c%s", dir.c_str(), kPathSeparator,
- relative_path.c_str()));
-}
-
-// Returns true if pathname describes something findable in the file-system,
-// either a file, directory, or whatever.
-bool FilePath::FileOrDirectoryExists() const {
-#if GTEST_OS_WINDOWS_MOBILE
- LPCWSTR unicode = String::AnsiToUtf16(pathname_.c_str());
- const DWORD attributes = GetFileAttributes(unicode);
- delete [] unicode;
- return attributes != kInvalidFileAttributes;
-#else
- posix::StatStruct file_stat;
- return posix::Stat(pathname_.c_str(), &file_stat) == 0;
-#endif // GTEST_OS_WINDOWS_MOBILE
-}
-
-// Returns true if pathname describes a directory in the file-system
-// that exists.
-bool FilePath::DirectoryExists() const {
- bool result = false;
-#if GTEST_OS_WINDOWS
- // Don't strip off trailing separator if path is a root directory on
- // Windows (like "C:\\").
- const FilePath& path(IsRootDirectory() ? *this :
- RemoveTrailingPathSeparator());
-#else
- const FilePath& path(*this);
-#endif
-
-#if GTEST_OS_WINDOWS_MOBILE
- LPCWSTR unicode = String::AnsiToUtf16(path.c_str());
- const DWORD attributes = GetFileAttributes(unicode);
- delete [] unicode;
- if ((attributes != kInvalidFileAttributes) &&
- (attributes & FILE_ATTRIBUTE_DIRECTORY)) {
- result = true;
- }
-#else
- posix::StatStruct file_stat;
- result = posix::Stat(path.c_str(), &file_stat) == 0 &&
- posix::IsDir(file_stat);
-#endif // GTEST_OS_WINDOWS_MOBILE
-
- return result;
-}
-
-// Returns true if pathname describes a root directory. (Windows has one
-// root directory per disk drive.)
-bool FilePath::IsRootDirectory() const {
-#if GTEST_OS_WINDOWS
- // TODO(wan@google.com): on Windows a network share like
- // \\server\share can be a root directory, although it cannot be the
- // current directory. Handle this properly.
- return pathname_.length() == 3 && IsAbsolutePath();
-#else
- return pathname_.length() == 1 && IsPathSeparator(pathname_.c_str()[0]);
-#endif
-}
-
-// Returns true if pathname describes an absolute path.
-bool FilePath::IsAbsolutePath() const {
- const char* const name = pathname_.c_str();
-#if GTEST_OS_WINDOWS
- return pathname_.length() >= 3 &&
- ((name[0] >= 'a' && name[0] <= 'z') ||
- (name[0] >= 'A' && name[0] <= 'Z')) &&
- name[1] == ':' &&
- IsPathSeparator(name[2]);
-#else
- return IsPathSeparator(name[0]);
-#endif
-}
-
-// Returns a pathname for a file that does not currently exist. The pathname
-// will be directory/base_name.extension or
-// directory/base_name_<number>.extension if directory/base_name.extension
-// already exists. The number will be incremented until a pathname is found
-// that does not already exist.
-// Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
-// There could be a race condition if two or more processes are calling this
-// function at the same time -- they could both pick the same filename.
-FilePath FilePath::GenerateUniqueFileName(const FilePath& directory,
- const FilePath& base_name,
- const char* extension) {
- FilePath full_pathname;
- int number = 0;
- do {
- full_pathname.Set(MakeFileName(directory, base_name, number++, extension));
- } while (full_pathname.FileOrDirectoryExists());
- return full_pathname;
-}
-
-// Returns true if FilePath ends with a path separator, which indicates that
-// it is intended to represent a directory. Returns false otherwise.
-// This does NOT check that a directory (or file) actually exists.
-bool FilePath::IsDirectory() const {
- return !pathname_.empty() &&
- IsPathSeparator(pathname_.c_str()[pathname_.length() - 1]);
-}
-
-// Create directories so that path exists. Returns true if successful or if
-// the directories already exist; returns false if unable to create directories
-// for any reason.
-bool FilePath::CreateDirectoriesRecursively() const {
- if (!this->IsDirectory()) {
- return false;
- }
-
- if (pathname_.length() == 0 || this->DirectoryExists()) {
- return true;
- }
-
- const FilePath parent(this->RemoveTrailingPathSeparator().RemoveFileName());
- return parent.CreateDirectoriesRecursively() && this->CreateFolder();
-}
-
-// Create the directory so that path exists. Returns true if successful or
-// if the directory already exists; returns false if unable to create the
-// directory for any reason, including if the parent directory does not
-// exist. Not named "CreateDirectory" because that's a macro on Windows.
-bool FilePath::CreateFolder() const {
-#if GTEST_OS_WINDOWS_MOBILE
- FilePath removed_sep(this->RemoveTrailingPathSeparator());
- LPCWSTR unicode = String::AnsiToUtf16(removed_sep.c_str());
- int result = CreateDirectory(unicode, NULL) ? 0 : -1;
- delete [] unicode;
-#elif GTEST_OS_WINDOWS
- int result = _mkdir(pathname_.c_str());
-#else
- int result = mkdir(pathname_.c_str(), 0777);
-#endif // GTEST_OS_WINDOWS_MOBILE
-
- if (result == -1) {
- return this->DirectoryExists(); // An error is OK if the directory exists.
- }
- return true; // No error.
-}
-
-// If input name has a trailing separator character, remove it and return the
-// name, otherwise return the name string unmodified.
-// On Windows platform, uses \ as the separator, other platforms use /.
-FilePath FilePath::RemoveTrailingPathSeparator() const {
- return IsDirectory()
- ? FilePath(String(pathname_.c_str(), pathname_.length() - 1))
- : *this;
-}
-
-// Removes any redundant separators that might be in the pathname.
-// For example, "bar///foo" becomes "bar/foo". Does not eliminate other
-// redundancies that might be in a pathname involving "." or "..".
-// TODO(wan@google.com): handle Windows network shares (e.g. \\server\share).
-void FilePath::Normalize() {
- if (pathname_.c_str() == NULL) {
- pathname_ = "";
- return;
- }
- const char* src = pathname_.c_str();
- char* const dest = new char[pathname_.length() + 1];
- char* dest_ptr = dest;
- memset(dest_ptr, 0, pathname_.length() + 1);
-
- while (*src != '\0') {
- *dest_ptr = *src;
- if (!IsPathSeparator(*src)) {
- src++;
- } else {
-#if GTEST_HAS_ALT_PATH_SEP_
- if (*dest_ptr == kAlternatePathSeparator) {
- *dest_ptr = kPathSeparator;
- }
-#endif
- while (IsPathSeparator(*src))
- src++;
- }
- dest_ptr++;
- }
- *dest_ptr = '\0';
- pathname_ = dest;
- delete[] dest;
-}
-
-} // namespace internal
-} // namespace testing
diff --git a/contrib/llvm/utils/unittest/googletest/gtest-port.cc b/contrib/llvm/utils/unittest/googletest/gtest-port.cc
deleted file mode 100644
index 5609599..0000000
--- a/contrib/llvm/utils/unittest/googletest/gtest-port.cc
+++ /dev/null
@@ -1,711 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-#include <gtest/internal/gtest-port.h>
-
-#include <limits.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-#if GTEST_OS_WINDOWS_MOBILE
-#include <windows.h> // For TerminateProcess()
-#elif GTEST_OS_WINDOWS
-#include <io.h>
-#include <sys/stat.h>
-#else
-#include <unistd.h>
-#endif // GTEST_OS_WINDOWS_MOBILE
-
-#if GTEST_OS_MAC
-#include <mach/mach_init.h>
-#include <mach/task.h>
-#include <mach/vm_map.h>
-#endif // GTEST_OS_MAC
-
-#include <gtest/gtest-spi.h>
-#include <gtest/gtest-message.h>
-#include <gtest/internal/gtest-string.h>
-
-// Indicates that this translation unit is part of Google Test's
-// implementation. It must come before gtest-internal-inl.h is
-// included, or there will be a compiler error. This trick is to
-// prevent a user from accidentally including gtest-internal-inl.h in
-// his code.
-#define GTEST_IMPLEMENTATION_ 1
-#include "gtest/internal/gtest-internal-inl.h"
-#undef GTEST_IMPLEMENTATION_
-
-namespace testing {
-namespace internal {
-
-#if defined(_MSC_VER) || defined(__BORLANDC__)
-// MSVC and C++Builder do not provide a definition of STDERR_FILENO.
-const int kStdOutFileno = 1;
-const int kStdErrFileno = 2;
-#else
-const int kStdOutFileno = STDOUT_FILENO;
-const int kStdErrFileno = STDERR_FILENO;
-#endif // _MSC_VER
-
-#if GTEST_OS_MAC
-
-// Returns the number of threads running in the process, or 0 to indicate that
-// we cannot detect it.
-size_t GetThreadCount() {
- const task_t task = mach_task_self();
- mach_msg_type_number_t thread_count;
- thread_act_array_t thread_list;
- const kern_return_t status = task_threads(task, &thread_list, &thread_count);
- if (status == KERN_SUCCESS) {
- // task_threads allocates resources in thread_list and we need to free them
- // to avoid leaks.
- vm_deallocate(task,
- reinterpret_cast<vm_address_t>(thread_list),
- sizeof(thread_t) * thread_count);
- return static_cast<size_t>(thread_count);
- } else {
- return 0;
- }
-}
-
-#else
-
-size_t GetThreadCount() {
- // There's no portable way to detect the number of threads, so we just
- // return 0 to indicate that we cannot detect it.
- return 0;
-}
-
-#endif // GTEST_OS_MAC
-
-#if GTEST_USES_POSIX_RE
-
-// Implements RE. Currently only needed for death tests.
-
-RE::~RE() {
- if (is_valid_) {
- // regfree'ing an invalid regex might crash because the content
- // of the regex is undefined. Since the regex's are essentially
- // the same, one cannot be valid (or invalid) without the other
- // being so too.
- regfree(&partial_regex_);
- regfree(&full_regex_);
- }
- free(const_cast<char*>(pattern_));
-}
-
-// Returns true iff regular expression re matches the entire str.
-bool RE::FullMatch(const char* str, const RE& re) {
- if (!re.is_valid_) return false;
-
- regmatch_t match;
- return regexec(&re.full_regex_, str, 1, &match, 0) == 0;
-}
-
-// Returns true iff regular expression re matches a substring of str
-// (including str itself).
-bool RE::PartialMatch(const char* str, const RE& re) {
- if (!re.is_valid_) return false;
-
- regmatch_t match;
- return regexec(&re.partial_regex_, str, 1, &match, 0) == 0;
-}
-
-// Initializes an RE from its string representation.
-void RE::Init(const char* regex) {
- pattern_ = posix::StrDup(regex);
-
- // Reserves enough bytes to hold the regular expression used for a
- // full match.
- const size_t full_regex_len = strlen(regex) + 10;
- char* const full_pattern = new char[full_regex_len];
-
- snprintf(full_pattern, full_regex_len, "^(%s)$", regex);
- is_valid_ = regcomp(&full_regex_, full_pattern, REG_EXTENDED) == 0;
- // We want to call regcomp(&partial_regex_, ...) even if the
- // previous expression returns false. Otherwise partial_regex_ may
- // not be properly initialized can may cause trouble when it's
- // freed.
- //
- // Some implementation of POSIX regex (e.g. on at least some
- // versions of Cygwin) doesn't accept the empty string as a valid
- // regex. We change it to an equivalent form "()" to be safe.
- if (is_valid_) {
- const char* const partial_regex = (*regex == '\0') ? "()" : regex;
- is_valid_ = regcomp(&partial_regex_, partial_regex, REG_EXTENDED) == 0;
- }
- EXPECT_TRUE(is_valid_)
- << "Regular expression \"" << regex
- << "\" is not a valid POSIX Extended regular expression.";
-
- delete[] full_pattern;
-}
-
-#elif GTEST_USES_SIMPLE_RE
-
-// Returns true iff ch appears anywhere in str (excluding the
-// terminating '\0' character).
-bool IsInSet(char ch, const char* str) {
- return ch != '\0' && strchr(str, ch) != NULL;
-}
-
-// Returns true iff ch belongs to the given classification. Unlike
-// similar functions in <ctype.h>, these aren't affected by the
-// current locale.
-bool IsDigit(char ch) { return '0' <= ch && ch <= '9'; }
-bool IsPunct(char ch) {
- return IsInSet(ch, "^-!\"#$%&'()*+,./:;<=>?@[\\]_`{|}~");
-}
-bool IsRepeat(char ch) { return IsInSet(ch, "?*+"); }
-bool IsWhiteSpace(char ch) { return IsInSet(ch, " \f\n\r\t\v"); }
-bool IsWordChar(char ch) {
- return ('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z') ||
- ('0' <= ch && ch <= '9') || ch == '_';
-}
-
-// Returns true iff "\\c" is a supported escape sequence.
-bool IsValidEscape(char c) {
- return (IsPunct(c) || IsInSet(c, "dDfnrsStvwW"));
-}
-
-// Returns true iff the given atom (specified by escaped and pattern)
-// matches ch. The result is undefined if the atom is invalid.
-bool AtomMatchesChar(bool escaped, char pattern_char, char ch) {
- if (escaped) { // "\\p" where p is pattern_char.
- switch (pattern_char) {
- case 'd': return IsDigit(ch);
- case 'D': return !IsDigit(ch);
- case 'f': return ch == '\f';
- case 'n': return ch == '\n';
- case 'r': return ch == '\r';
- case 's': return IsWhiteSpace(ch);
- case 'S': return !IsWhiteSpace(ch);
- case 't': return ch == '\t';
- case 'v': return ch == '\v';
- case 'w': return IsWordChar(ch);
- case 'W': return !IsWordChar(ch);
- }
- return IsPunct(pattern_char) && pattern_char == ch;
- }
-
- return (pattern_char == '.' && ch != '\n') || pattern_char == ch;
-}
-
-// Helper function used by ValidateRegex() to format error messages.
-String FormatRegexSyntaxError(const char* regex, int index) {
- return (Message() << "Syntax error at index " << index
- << " in simple regular expression \"" << regex << "\": ").GetString();
-}
-
-// Generates non-fatal failures and returns false if regex is invalid;
-// otherwise returns true.
-bool ValidateRegex(const char* regex) {
- if (regex == NULL) {
- // TODO(wan@google.com): fix the source file location in the
- // assertion failures to match where the regex is used in user
- // code.
- ADD_FAILURE() << "NULL is not a valid simple regular expression.";
- return false;
- }
-
- bool is_valid = true;
-
- // True iff ?, *, or + can follow the previous atom.
- bool prev_repeatable = false;
- for (int i = 0; regex[i]; i++) {
- if (regex[i] == '\\') { // An escape sequence
- i++;
- if (regex[i] == '\0') {
- ADD_FAILURE() << FormatRegexSyntaxError(regex, i - 1)
- << "'\\' cannot appear at the end.";
- return false;
- }
-
- if (!IsValidEscape(regex[i])) {
- ADD_FAILURE() << FormatRegexSyntaxError(regex, i - 1)
- << "invalid escape sequence \"\\" << regex[i] << "\".";
- is_valid = false;
- }
- prev_repeatable = true;
- } else { // Not an escape sequence.
- const char ch = regex[i];
-
- if (ch == '^' && i > 0) {
- ADD_FAILURE() << FormatRegexSyntaxError(regex, i)
- << "'^' can only appear at the beginning.";
- is_valid = false;
- } else if (ch == '$' && regex[i + 1] != '\0') {
- ADD_FAILURE() << FormatRegexSyntaxError(regex, i)
- << "'$' can only appear at the end.";
- is_valid = false;
- } else if (IsInSet(ch, "()[]{}|")) {
- ADD_FAILURE() << FormatRegexSyntaxError(regex, i)
- << "'" << ch << "' is unsupported.";
- is_valid = false;
- } else if (IsRepeat(ch) && !prev_repeatable) {
- ADD_FAILURE() << FormatRegexSyntaxError(regex, i)
- << "'" << ch << "' can only follow a repeatable token.";
- is_valid = false;
- }
-
- prev_repeatable = !IsInSet(ch, "^$?*+");
- }
- }
-
- return is_valid;
-}
-
-// Matches a repeated regex atom followed by a valid simple regular
-// expression. The regex atom is defined as c if escaped is false,
-// or \c otherwise. repeat is the repetition meta character (?, *,
-// or +). The behavior is undefined if str contains too many
-// characters to be indexable by size_t, in which case the test will
-// probably time out anyway. We are fine with this limitation as
-// std::string has it too.
-bool MatchRepetitionAndRegexAtHead(
- bool escaped, char c, char repeat, const char* regex,
- const char* str) {
- const size_t min_count = (repeat == '+') ? 1 : 0;
- const size_t max_count = (repeat == '?') ? 1 :
- static_cast<size_t>(-1) - 1;
- // We cannot call numeric_limits::max() as it conflicts with the
- // max() macro on Windows.
-
- for (size_t i = 0; i <= max_count; ++i) {
- // We know that the atom matches each of the first i characters in str.
- if (i >= min_count && MatchRegexAtHead(regex, str + i)) {
- // We have enough matches at the head, and the tail matches too.
- // Since we only care about *whether* the pattern matches str
- // (as opposed to *how* it matches), there is no need to find a
- // greedy match.
- return true;
- }
- if (str[i] == '\0' || !AtomMatchesChar(escaped, c, str[i]))
- return false;
- }
- return false;
-}
-
-// Returns true iff regex matches a prefix of str. regex must be a
-// valid simple regular expression and not start with "^", or the
-// result is undefined.
-bool MatchRegexAtHead(const char* regex, const char* str) {
- if (*regex == '\0') // An empty regex matches a prefix of anything.
- return true;
-
- // "$" only matches the end of a string. Note that regex being
- // valid guarantees that there's nothing after "$" in it.
- if (*regex == '$')
- return *str == '\0';
-
- // Is the first thing in regex an escape sequence?
- const bool escaped = *regex == '\\';
- if (escaped)
- ++regex;
- if (IsRepeat(regex[1])) {
- // MatchRepetitionAndRegexAtHead() calls MatchRegexAtHead(), so
- // here's an indirect recursion. It terminates as the regex gets
- // shorter in each recursion.
- return MatchRepetitionAndRegexAtHead(
- escaped, regex[0], regex[1], regex + 2, str);
- } else {
- // regex isn't empty, isn't "$", and doesn't start with a
- // repetition. We match the first atom of regex with the first
- // character of str and recurse.
- return (*str != '\0') && AtomMatchesChar(escaped, *regex, *str) &&
- MatchRegexAtHead(regex + 1, str + 1);
- }
-}
-
-// Returns true iff regex matches any substring of str. regex must be
-// a valid simple regular expression, or the result is undefined.
-//
-// The algorithm is recursive, but the recursion depth doesn't exceed
-// the regex length, so we won't need to worry about running out of
-// stack space normally. In rare cases the time complexity can be
-// exponential with respect to the regex length + the string length,
-// but usually it's must faster (often close to linear).
-bool MatchRegexAnywhere(const char* regex, const char* str) {
- if (regex == NULL || str == NULL)
- return false;
-
- if (*regex == '^')
- return MatchRegexAtHead(regex + 1, str);
-
- // A successful match can be anywhere in str.
- do {
- if (MatchRegexAtHead(regex, str))
- return true;
- } while (*str++ != '\0');
- return false;
-}
-
-// Implements the RE class.
-
-RE::~RE() {
- free(const_cast<char*>(pattern_));
- free(const_cast<char*>(full_pattern_));
-}
-
-// Returns true iff regular expression re matches the entire str.
-bool RE::FullMatch(const char* str, const RE& re) {
- return re.is_valid_ && MatchRegexAnywhere(re.full_pattern_, str);
-}
-
-// Returns true iff regular expression re matches a substring of str
-// (including str itself).
-bool RE::PartialMatch(const char* str, const RE& re) {
- return re.is_valid_ && MatchRegexAnywhere(re.pattern_, str);
-}
-
-// Initializes an RE from its string representation.
-void RE::Init(const char* regex) {
- pattern_ = full_pattern_ = NULL;
- if (regex != NULL) {
- pattern_ = posix::StrDup(regex);
- }
-
- is_valid_ = ValidateRegex(regex);
- if (!is_valid_) {
- // No need to calculate the full pattern when the regex is invalid.
- return;
- }
-
- const size_t len = strlen(regex);
- // Reserves enough bytes to hold the regular expression used for a
- // full match: we need space to prepend a '^', append a '$', and
- // terminate the string with '\0'.
- char* buffer = static_cast<char*>(malloc(len + 3));
- full_pattern_ = buffer;
-
- if (*regex != '^')
- *buffer++ = '^'; // Makes sure full_pattern_ starts with '^'.
-
- // We don't use snprintf or strncpy, as they trigger a warning when
- // compiled with VC++ 8.0.
- memcpy(buffer, regex, len);
- buffer += len;
-
- if (len == 0 || regex[len - 1] != '$')
- *buffer++ = '$'; // Makes sure full_pattern_ ends with '$'.
-
- *buffer = '\0';
-}
-
-#endif // GTEST_USES_POSIX_RE
-
-
-GTestLog::GTestLog(GTestLogSeverity severity, const char* file, int line)
- : severity_(severity) {
- const char* const marker =
- severity == GTEST_INFO ? "[ INFO ]" :
- severity == GTEST_WARNING ? "[WARNING]" :
- severity == GTEST_ERROR ? "[ ERROR ]" : "[ FATAL ]";
- GetStream() << ::std::endl << marker << " "
- << FormatFileLocation(file, line).c_str() << ": ";
-}
-
-// Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
-GTestLog::~GTestLog() {
- GetStream() << ::std::endl;
- if (severity_ == GTEST_FATAL) {
- fflush(stderr);
- posix::Abort();
- }
-}
-// Disable Microsoft deprecation warnings for POSIX functions called from
-// this class (creat, dup, dup2, and close)
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable: 4996)
-#endif // _MSC_VER
-
-#if GTEST_HAS_STREAM_REDIRECTION_
-
-// Object that captures an output stream (stdout/stderr).
-class CapturedStream {
- public:
- // The ctor redirects the stream to a temporary file.
- CapturedStream(int fd) : fd_(fd), uncaptured_fd_(dup(fd)) {
-#if GTEST_OS_WINDOWS
- char temp_dir_path[MAX_PATH + 1] = { '\0' }; // NOLINT
- char temp_file_path[MAX_PATH + 1] = { '\0' }; // NOLINT
-
- ::GetTempPathA(sizeof(temp_dir_path), temp_dir_path);
- const UINT success = ::GetTempFileNameA(temp_dir_path,
- "gtest_redir",
- 0, // Generate unique file name.
- temp_file_path);
- GTEST_CHECK_(success != 0)
- << "Unable to create a temporary file in " << temp_dir_path;
- const int captured_fd = creat(temp_file_path, _S_IREAD | _S_IWRITE);
- GTEST_CHECK_(captured_fd != -1) << "Unable to open temporary file "
- << temp_file_path;
- filename_ = temp_file_path;
-#else
- // There's no guarantee that a test has write access to the
- // current directory, so we create the temporary file in the /tmp
- // directory instead.
- char name_template[] = "/tmp/captured_stream.XXXXXX";
- const int captured_fd = mkstemp(name_template);
- filename_ = name_template;
-#endif // GTEST_OS_WINDOWS
- fflush(NULL);
- dup2(captured_fd, fd_);
- close(captured_fd);
- }
-
- ~CapturedStream() {
- remove(filename_.c_str());
- }
-
- String GetCapturedString() {
- if (uncaptured_fd_ != -1) {
- // Restores the original stream.
- fflush(NULL);
- dup2(uncaptured_fd_, fd_);
- close(uncaptured_fd_);
- uncaptured_fd_ = -1;
- }
-
- FILE* const file = posix::FOpen(filename_.c_str(), "r");
- const String content = ReadEntireFile(file);
- posix::FClose(file);
- return content;
- }
-
- private:
- // Reads the entire content of a file as a String.
- static String ReadEntireFile(FILE* file);
-
- // Returns the size (in bytes) of a file.
- static size_t GetFileSize(FILE* file);
-
- const int fd_; // A stream to capture.
- int uncaptured_fd_;
- // Name of the temporary file holding the stderr output.
- ::std::string filename_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(CapturedStream);
-};
-
-// Returns the size (in bytes) of a file.
-size_t CapturedStream::GetFileSize(FILE* file) {
- fseek(file, 0, SEEK_END);
- return static_cast<size_t>(ftell(file));
-}
-
-// Reads the entire content of a file as a string.
-String CapturedStream::ReadEntireFile(FILE* file) {
- const size_t file_size = GetFileSize(file);
- char* const buffer = new char[file_size];
-
- size_t bytes_last_read = 0; // # of bytes read in the last fread()
- size_t bytes_read = 0; // # of bytes read so far
-
- fseek(file, 0, SEEK_SET);
-
- // Keeps reading the file until we cannot read further or the
- // pre-determined file size is reached.
- do {
- bytes_last_read = fread(buffer+bytes_read, 1, file_size-bytes_read, file);
- bytes_read += bytes_last_read;
- } while (bytes_last_read > 0 && bytes_read < file_size);
-
- const String content(buffer, bytes_read);
- delete[] buffer;
-
- return content;
-}
-
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif // _MSC_VER
-
-static CapturedStream* g_captured_stderr = NULL;
-static CapturedStream* g_captured_stdout = NULL;
-
-// Starts capturing an output stream (stdout/stderr).
-void CaptureStream(int fd, const char* stream_name, CapturedStream** stream) {
- if (*stream != NULL) {
- GTEST_LOG_(FATAL) << "Only one " << stream_name
- << " capturer can exist at a time.";
- }
- *stream = new CapturedStream(fd);
-}
-
-// Stops capturing the output stream and returns the captured string.
-String GetCapturedStream(CapturedStream** captured_stream) {
- const String content = (*captured_stream)->GetCapturedString();
-
- delete *captured_stream;
- *captured_stream = NULL;
-
- return content;
-}
-
-// Starts capturing stdout.
-void CaptureStdout() {
- CaptureStream(kStdOutFileno, "stdout", &g_captured_stdout);
-}
-
-// Starts capturing stderr.
-void CaptureStderr() {
- CaptureStream(kStdErrFileno, "stderr", &g_captured_stderr);
-}
-
-// Stops capturing stdout and returns the captured string.
-String GetCapturedStdout() { return GetCapturedStream(&g_captured_stdout); }
-
-// Stops capturing stderr and returns the captured string.
-String GetCapturedStderr() { return GetCapturedStream(&g_captured_stderr); }
-
-#endif // GTEST_HAS_STREAM_REDIRECTION_
-
-#if GTEST_HAS_DEATH_TEST
-
-// A copy of all command line arguments. Set by InitGoogleTest().
-::std::vector<String> g_argvs;
-
-// Returns the command line as a vector of strings.
-const ::std::vector<String>& GetArgvs() { return g_argvs; }
-
-#endif // GTEST_HAS_DEATH_TEST
-
-#if GTEST_OS_WINDOWS_MOBILE
-namespace posix {
-void Abort() {
- DebugBreak();
- TerminateProcess(GetCurrentProcess(), 1);
-}
-} // namespace posix
-#endif // GTEST_OS_WINDOWS_MOBILE
-
-// Returns the name of the environment variable corresponding to the
-// given flag. For example, FlagToEnvVar("foo") will return
-// "GTEST_FOO" in the open-source version.
-static String FlagToEnvVar(const char* flag) {
- const String full_flag =
- (Message() << GTEST_FLAG_PREFIX_ << flag).GetString();
-
- Message env_var;
- for (size_t i = 0; i != full_flag.length(); i++) {
- env_var << static_cast<char>(toupper(full_flag.c_str()[i]));
- }
-
- return env_var.GetString();
-}
-
-// Parses 'str' for a 32-bit signed integer. If successful, writes
-// the result to *value and returns true; otherwise leaves *value
-// unchanged and returns false.
-bool ParseInt32(const Message& src_text, const char* str, Int32* value) {
- // Parses the environment variable as a decimal integer.
- char* end = NULL;
- const long long_value = strtol(str, &end, 10); // NOLINT
-
- // Has strtol() consumed all characters in the string?
- if (*end != '\0') {
- // No - an invalid character was encountered.
- Message msg;
- msg << "WARNING: " << src_text
- << " is expected to be a 32-bit integer, but actually"
- << " has value \"" << str << "\".\n";
- printf("%s", msg.GetString().c_str());
- fflush(stdout);
- return false;
- }
-
- // Is the parsed value in the range of an Int32?
- const Int32 result = static_cast<Int32>(long_value);
- if (long_value == LONG_MAX || long_value == LONG_MIN ||
- // The parsed value overflows as a long. (strtol() returns
- // LONG_MAX or LONG_MIN when the input overflows.)
- result != long_value
- // The parsed value overflows as an Int32.
- ) {
- Message msg;
- msg << "WARNING: " << src_text
- << " is expected to be a 32-bit integer, but actually"
- << " has value " << str << ", which overflows.\n";
- printf("%s", msg.GetString().c_str());
- fflush(stdout);
- return false;
- }
-
- *value = result;
- return true;
-}
-
-// Reads and returns the Boolean environment variable corresponding to
-// the given flag; if it's not set, returns default_value.
-//
-// The value is considered true iff it's not "0".
-bool BoolFromGTestEnv(const char* flag, bool default_value) {
- const String env_var = FlagToEnvVar(flag);
- const char* const string_value = posix::GetEnv(env_var.c_str());
- return string_value == NULL ?
- default_value : strcmp(string_value, "0") != 0;
-}
-
-// Reads and returns a 32-bit integer stored in the environment
-// variable corresponding to the given flag; if it isn't set or
-// doesn't represent a valid 32-bit integer, returns default_value.
-Int32 Int32FromGTestEnv(const char* flag, Int32 default_value) {
- const String env_var = FlagToEnvVar(flag);
- const char* const string_value = posix::GetEnv(env_var.c_str());
- if (string_value == NULL) {
- // The environment variable is not set.
- return default_value;
- }
-
- Int32 result = default_value;
- if (!ParseInt32(Message() << "Environment variable " << env_var,
- string_value, &result)) {
- printf("The default value %s is used.\n",
- (Message() << default_value).GetString().c_str());
- fflush(stdout);
- return default_value;
- }
-
- return result;
-}
-
-// Reads and returns the string environment variable corresponding to
-// the given flag; if it's not set, returns default_value.
-const char* StringFromGTestEnv(const char* flag, const char* default_value) {
- const String env_var = FlagToEnvVar(flag);
- const char* const value = posix::GetEnv(env_var.c_str());
- return value == NULL ? default_value : value;
-}
-
-} // namespace internal
-} // namespace testing
diff --git a/contrib/llvm/utils/unittest/googletest/gtest-test-part.cc b/contrib/llvm/utils/unittest/googletest/gtest-test-part.cc
deleted file mode 100644
index 8249afe..0000000
--- a/contrib/llvm/utils/unittest/googletest/gtest-test-part.cc
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-//
-// Author: mheule@google.com (Markus Heule)
-//
-// The Google C++ Testing Framework (Google Test)
-
-#include <gtest/gtest-test-part.h>
-
-// Indicates that this translation unit is part of Google Test's
-// implementation. It must come before gtest-internal-inl.h is
-// included, or there will be a compiler error. This trick is to
-// prevent a user from accidentally including gtest-internal-inl.h in
-// his code.
-#define GTEST_IMPLEMENTATION_ 1
-#include "gtest/internal/gtest-internal-inl.h"
-#undef GTEST_IMPLEMENTATION_
-
-namespace testing {
-
-using internal::GetUnitTestImpl;
-
-// Gets the summary of the failure message by omitting the stack trace
-// in it.
-internal::String TestPartResult::ExtractSummary(const char* message) {
- const char* const stack_trace = strstr(message, internal::kStackTraceMarker);
- return stack_trace == NULL ? internal::String(message) :
- internal::String(message, stack_trace - message);
-}
-
-// Prints a TestPartResult object.
-std::ostream& operator<<(std::ostream& os, const TestPartResult& result) {
- return os
- << result.file_name() << ":" << result.line_number() << ": "
- << (result.type() == TestPartResult::kSuccess ? "Success" :
- result.type() == TestPartResult::kFatalFailure ? "Fatal failure" :
- "Non-fatal failure") << ":\n"
- << result.message() << std::endl;
-}
-
-// Appends a TestPartResult to the array.
-void TestPartResultArray::Append(const TestPartResult& result) {
- array_.push_back(result);
-}
-
-// Returns the TestPartResult at the given index (0-based).
-const TestPartResult& TestPartResultArray::GetTestPartResult(int index) const {
- if (index < 0 || index >= size()) {
- printf("\nInvalid index (%d) into TestPartResultArray.\n", index);
- internal::posix::Abort();
- }
-
- return array_[index];
-}
-
-// Returns the number of TestPartResult objects in the array.
-int TestPartResultArray::size() const {
- return static_cast<int>(array_.size());
-}
-
-namespace internal {
-
-HasNewFatalFailureHelper::HasNewFatalFailureHelper()
- : has_new_fatal_failure_(false),
- original_reporter_(GetUnitTestImpl()->
- GetTestPartResultReporterForCurrentThread()) {
- GetUnitTestImpl()->SetTestPartResultReporterForCurrentThread(this);
-}
-
-HasNewFatalFailureHelper::~HasNewFatalFailureHelper() {
- GetUnitTestImpl()->SetTestPartResultReporterForCurrentThread(
- original_reporter_);
-}
-
-void HasNewFatalFailureHelper::ReportTestPartResult(
- const TestPartResult& result) {
- if (result.fatally_failed())
- has_new_fatal_failure_ = true;
- original_reporter_->ReportTestPartResult(result);
-}
-
-} // namespace internal
-
-} // namespace testing
diff --git a/contrib/llvm/utils/unittest/googletest/gtest-typed-test.cc b/contrib/llvm/utils/unittest/googletest/gtest-typed-test.cc
deleted file mode 100644
index 3cc4b5d..0000000
--- a/contrib/llvm/utils/unittest/googletest/gtest-typed-test.cc
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-#include <gtest/gtest-typed-test.h>
-#include <gtest/gtest.h>
-
-namespace testing {
-namespace internal {
-
-#if GTEST_HAS_TYPED_TEST_P
-
-// Skips to the first non-space char in str. Returns an empty string if str
-// contains only whitespace characters.
-static const char* SkipSpaces(const char* str) {
- while (isspace(*str))
- str++;
- return str;
-}
-
-// Verifies that registered_tests match the test names in
-// defined_test_names_; returns registered_tests if successful, or
-// aborts the program otherwise.
-const char* TypedTestCasePState::VerifyRegisteredTestNames(
- const char* file, int line, const char* registered_tests) {
- typedef ::std::set<const char*>::const_iterator DefinedTestIter;
- registered_ = true;
-
- // Skip initial whitespace in registered_tests since some
- // preprocessors prefix stringizied literals with whitespace.
- registered_tests = SkipSpaces(registered_tests);
-
- Message errors;
- ::std::set<String> tests;
- for (const char* names = registered_tests; names != NULL;
- names = SkipComma(names)) {
- const String name = GetPrefixUntilComma(names);
- if (tests.count(name) != 0) {
- errors << "Test " << name << " is listed more than once.\n";
- continue;
- }
-
- bool found = false;
- for (DefinedTestIter it = defined_test_names_.begin();
- it != defined_test_names_.end();
- ++it) {
- if (name == *it) {
- found = true;
- break;
- }
- }
-
- if (found) {
- tests.insert(name);
- } else {
- errors << "No test named " << name
- << " can be found in this test case.\n";
- }
- }
-
- for (DefinedTestIter it = defined_test_names_.begin();
- it != defined_test_names_.end();
- ++it) {
- if (tests.count(*it) == 0) {
- errors << "You forgot to list test " << *it << ".\n";
- }
- }
-
- const String& errors_str = errors.GetString();
- if (errors_str != "") {
- fprintf(stderr, "%s %s", FormatFileLocation(file, line).c_str(),
- errors_str.c_str());
- fflush(stderr);
- posix::Abort();
- }
-
- return registered_tests;
-}
-
-#endif // GTEST_HAS_TYPED_TEST_P
-
-} // namespace internal
-} // namespace testing
diff --git a/contrib/llvm/utils/unittest/googletest/gtest.cc b/contrib/llvm/utils/unittest/googletest/gtest.cc
deleted file mode 100644
index aa2d5bb..0000000
--- a/contrib/llvm/utils/unittest/googletest/gtest.cc
+++ /dev/null
@@ -1,4704 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// The Google C++ Testing Framework (Google Test)
-
-#include <gtest/gtest.h>
-#include <gtest/gtest-spi.h>
-
-#include <ctype.h>
-#include <math.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <wchar.h>
-#include <wctype.h>
-
-#include <algorithm>
-#include <ostream>
-#include <sstream>
-#include <vector>
-
-#if GTEST_OS_LINUX
-
-// TODO(kenton@google.com): Use autoconf to detect availability of
-// gettimeofday().
-#define GTEST_HAS_GETTIMEOFDAY_ 1
-
-#include <fcntl.h>
-#include <limits.h>
-#include <sched.h>
-// Declares vsnprintf(). This header is not available on Windows.
-#include <strings.h>
-#include <sys/mman.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <string>
-#include <vector>
-
-#elif GTEST_OS_SYMBIAN
-#define GTEST_HAS_GETTIMEOFDAY_ 1
-#include <sys/time.h> // NOLINT
-
-#elif GTEST_OS_ZOS
-#define GTEST_HAS_GETTIMEOFDAY_ 1
-#include <sys/time.h> // NOLINT
-
-// On z/OS we additionally need strings.h for strcasecmp.
-#include <strings.h> // NOLINT
-
-#elif GTEST_OS_WINDOWS_MOBILE // We are on Windows CE.
-
-#include <windows.h> // NOLINT
-
-#elif GTEST_OS_WINDOWS // We are on Windows proper.
-
-#include <io.h> // NOLINT
-#include <sys/timeb.h> // NOLINT
-#include <sys/types.h> // NOLINT
-#include <sys/stat.h> // NOLINT
-
-#if GTEST_OS_WINDOWS_MINGW
-// MinGW has gettimeofday() but not _ftime64().
-// TODO(kenton@google.com): Use autoconf to detect availability of
-// gettimeofday().
-// TODO(kenton@google.com): There are other ways to get the time on
-// Windows, like GetTickCount() or GetSystemTimeAsFileTime(). MinGW
-// supports these. consider using them instead.
-#define GTEST_HAS_GETTIMEOFDAY_ 1
-#include <sys/time.h> // NOLINT
-#endif // GTEST_OS_WINDOWS_MINGW
-
-// cpplint thinks that the header is already included, so we want to
-// silence it.
-#include <windows.h> // NOLINT
-
-#else
-
-// Assume other platforms have gettimeofday().
-// TODO(kenton@google.com): Use autoconf to detect availability of
-// gettimeofday().
-#define GTEST_HAS_GETTIMEOFDAY_ 1
-
-// cpplint thinks that the header is already included, so we want to
-// silence it.
-#include <sys/time.h> // NOLINT
-#include <unistd.h> // NOLINT
-
-#endif // GTEST_OS_LINUX
-
-#if GTEST_HAS_EXCEPTIONS
-#include <stdexcept>
-#endif
-
-// Indicates that this translation unit is part of Google Test's
-// implementation. It must come before gtest-internal-inl.h is
-// included, or there will be a compiler error. This trick is to
-// prevent a user from accidentally including gtest-internal-inl.h in
-// his code.
-#define GTEST_IMPLEMENTATION_ 1
-#include "gtest/internal/gtest-internal-inl.h"
-#undef GTEST_IMPLEMENTATION_
-
-#if GTEST_OS_WINDOWS
-#define vsnprintf _vsnprintf
-#endif // GTEST_OS_WINDOWS
-
-namespace testing {
-
-using internal::CountIf;
-using internal::ForEach;
-using internal::GetElementOr;
-using internal::Shuffle;
-
-// Constants.
-
-// A test whose test case name or test name matches this filter is
-// disabled and not run.
-static const char kDisableTestFilter[] = "DISABLED_*:*/DISABLED_*";
-
-// A test case whose name matches this filter is considered a death
-// test case and will be run before test cases whose name doesn't
-// match this filter.
-static const char kDeathTestCaseFilter[] = "*DeathTest:*DeathTest/*";
-
-// A test filter that matches everything.
-static const char kUniversalFilter[] = "*";
-
-// The default output file for XML output.
-static const char kDefaultOutputFile[] = "test_detail.xml";
-
-// The environment variable name for the test shard index.
-static const char kTestShardIndex[] = "GTEST_SHARD_INDEX";
-// The environment variable name for the total number of test shards.
-static const char kTestTotalShards[] = "GTEST_TOTAL_SHARDS";
-// The environment variable name for the test shard status file.
-static const char kTestShardStatusFile[] = "GTEST_SHARD_STATUS_FILE";
-
-namespace internal {
-
-// The text used in failure messages to indicate the start of the
-// stack trace.
-const char kStackTraceMarker[] = "\nStack trace:\n";
-
-// g_help_flag is true iff the --help flag or an equivalent form is
-// specified on the command line.
-bool g_help_flag = false;
-
-} // namespace internal
-
-GTEST_DEFINE_bool_(
- also_run_disabled_tests,
- internal::BoolFromGTestEnv("also_run_disabled_tests", false),
- "Run disabled tests too, in addition to the tests normally being run.");
-
-GTEST_DEFINE_bool_(
- break_on_failure,
- internal::BoolFromGTestEnv("break_on_failure", false),
- "True iff a failed assertion should be a debugger break-point.");
-
-GTEST_DEFINE_bool_(
- catch_exceptions,
- internal::BoolFromGTestEnv("catch_exceptions", false),
- "True iff " GTEST_NAME_
- " should catch exceptions and treat them as test failures.");
-
-GTEST_DEFINE_string_(
- color,
- internal::StringFromGTestEnv("color", "auto"),
- "Whether to use colors in the output. Valid values: yes, no, "
- "and auto. 'auto' means to use colors if the output is "
- "being sent to a terminal and the TERM environment variable "
- "is set to xterm, xterm-color, xterm-256color, linux or cygwin.");
-
-GTEST_DEFINE_string_(
- filter,
- internal::StringFromGTestEnv("filter", kUniversalFilter),
- "A colon-separated list of glob (not regex) patterns "
- "for filtering the tests to run, optionally followed by a "
- "'-' and a : separated list of negative patterns (tests to "
- "exclude). A test is run if it matches one of the positive "
- "patterns and does not match any of the negative patterns.");
-
-GTEST_DEFINE_bool_(list_tests, false,
- "List all tests without running them.");
-
-GTEST_DEFINE_string_(
- output,
- internal::StringFromGTestEnv("output", ""),
- "A format (currently must be \"xml\"), optionally followed "
- "by a colon and an output file name or directory. A directory "
- "is indicated by a trailing pathname separator. "
- "Examples: \"xml:filename.xml\", \"xml::directoryname/\". "
- "If a directory is specified, output files will be created "
- "within that directory, with file-names based on the test "
- "executable's name and, if necessary, made unique by adding "
- "digits.");
-
-GTEST_DEFINE_bool_(
- print_time,
- internal::BoolFromGTestEnv("print_time", true),
- "True iff " GTEST_NAME_
- " should display elapsed time in text output.");
-
-GTEST_DEFINE_int32_(
- random_seed,
- internal::Int32FromGTestEnv("random_seed", 0),
- "Random number seed to use when shuffling test orders. Must be in range "
- "[1, 99999], or 0 to use a seed based on the current time.");
-
-GTEST_DEFINE_int32_(
- repeat,
- internal::Int32FromGTestEnv("repeat", 1),
- "How many times to repeat each test. Specify a negative number "
- "for repeating forever. Useful for shaking out flaky tests.");
-
-GTEST_DEFINE_bool_(
- show_internal_stack_frames, false,
- "True iff " GTEST_NAME_ " should include internal stack frames when "
- "printing test failure stack traces.");
-
-GTEST_DEFINE_bool_(
- shuffle,
- internal::BoolFromGTestEnv("shuffle", false),
- "True iff " GTEST_NAME_
- " should randomize tests' order on every run.");
-
-GTEST_DEFINE_int32_(
- stack_trace_depth,
- internal::Int32FromGTestEnv("stack_trace_depth", kMaxStackTraceDepth),
- "The maximum number of stack frames to print when an "
- "assertion fails. The valid range is 0 through 100, inclusive.");
-
-GTEST_DEFINE_bool_(
- throw_on_failure,
- internal::BoolFromGTestEnv("throw_on_failure", false),
- "When this flag is specified, a failed assertion will throw an exception "
- "if exceptions are enabled or exit the program with a non-zero code "
- "otherwise.");
-
-namespace internal {
-
-// Generates a random number from [0, range), using a Linear
-// Congruential Generator (LCG). Crashes if 'range' is 0 or greater
-// than kMaxRange.
-UInt32 Random::Generate(UInt32 range) {
- // These constants are the same as are used in glibc's rand(3).
- state_ = (1103515245U*state_ + 12345U) % kMaxRange;
-
- GTEST_CHECK_(range > 0)
- << "Cannot generate a number in the range [0, 0).";
- GTEST_CHECK_(range <= kMaxRange)
- << "Generation of a number in [0, " << range << ") was requested, "
- << "but this can only generate numbers in [0, " << kMaxRange << ").";
-
- // Converting via modulus introduces a bit of downward bias, but
- // it's simple, and a linear congruential generator isn't too good
- // to begin with.
- return state_ % range;
-}
-
-// GTestIsInitialized() returns true iff the user has initialized
-// Google Test. Useful for catching the user mistake of not initializing
-// Google Test before calling RUN_ALL_TESTS().
-//
-// A user must call testing::InitGoogleTest() to initialize Google
-// Test. g_init_gtest_count is set to the number of times
-// InitGoogleTest() has been called. We don't protect this variable
-// under a mutex as it is only accessed in the main thread.
-int g_init_gtest_count = 0;
-static bool GTestIsInitialized() { return g_init_gtest_count != 0; }
-
-// Iterates over a vector of TestCases, keeping a running sum of the
-// results of calling a given int-returning method on each.
-// Returns the sum.
-static int SumOverTestCaseList(const std::vector<TestCase*>& case_list,
- int (TestCase::*method)() const) {
- int sum = 0;
- for (size_t i = 0; i < case_list.size(); i++) {
- sum += (case_list[i]->*method)();
- }
- return sum;
-}
-
-// Returns true iff the test case passed.
-static bool TestCasePassed(const TestCase* test_case) {
- return test_case->should_run() && test_case->Passed();
-}
-
-// Returns true iff the test case failed.
-static bool TestCaseFailed(const TestCase* test_case) {
- return test_case->should_run() && test_case->Failed();
-}
-
-// Returns true iff test_case contains at least one test that should
-// run.
-static bool ShouldRunTestCase(const TestCase* test_case) {
- return test_case->should_run();
-}
-
-// AssertHelper constructor.
-AssertHelper::AssertHelper(TestPartResult::Type type,
- const char* file,
- int line,
- const char* message)
- : data_(new AssertHelperData(type, file, line, message)) {
-}
-
-AssertHelper::~AssertHelper() {
- delete data_;
-}
-
-// Message assignment, for assertion streaming support.
-void AssertHelper::operator=(const Message& message) const {
- UnitTest::GetInstance()->
- AddTestPartResult(data_->type, data_->file, data_->line,
- AppendUserMessage(data_->message, message),
- UnitTest::GetInstance()->impl()
- ->CurrentOsStackTraceExceptTop(1)
- // Skips the stack frame for this function itself.
- ); // NOLINT
-}
-
-// Mutex for linked pointers.
-GTEST_DEFINE_STATIC_MUTEX_(g_linked_ptr_mutex);
-
-// Application pathname gotten in InitGoogleTest.
-String g_executable_path;
-
-// Returns the current application's name, removing directory path if that
-// is present.
-FilePath GetCurrentExecutableName() {
- FilePath result;
-
-#if GTEST_OS_WINDOWS
- result.Set(FilePath(g_executable_path).RemoveExtension("exe"));
-#else
- result.Set(FilePath(g_executable_path));
-#endif // GTEST_OS_WINDOWS
-
- return result.RemoveDirectoryName();
-}
-
-// Functions for processing the gtest_output flag.
-
-// Returns the output format, or "" for normal printed output.
-String UnitTestOptions::GetOutputFormat() {
- const char* const gtest_output_flag = GTEST_FLAG(output).c_str();
- if (gtest_output_flag == NULL) return String("");
-
- const char* const colon = strchr(gtest_output_flag, ':');
- return (colon == NULL) ?
- String(gtest_output_flag) :
- String(gtest_output_flag, colon - gtest_output_flag);
-}
-
-// Returns the name of the requested output file, or the default if none
-// was explicitly specified.
-String UnitTestOptions::GetAbsolutePathToOutputFile() {
- const char* const gtest_output_flag = GTEST_FLAG(output).c_str();
- if (gtest_output_flag == NULL)
- return String("");
-
- const char* const colon = strchr(gtest_output_flag, ':');
- if (colon == NULL)
- return String(internal::FilePath::ConcatPaths(
- internal::FilePath(
- UnitTest::GetInstance()->original_working_dir()),
- internal::FilePath(kDefaultOutputFile)).ToString() );
-
- internal::FilePath output_name(colon + 1);
- if (!output_name.IsAbsolutePath())
- // TODO(wan@google.com): on Windows \some\path is not an absolute
- // path (as its meaning depends on the current drive), yet the
- // following logic for turning it into an absolute path is wrong.
- // Fix it.
- output_name = internal::FilePath::ConcatPaths(
- internal::FilePath(UnitTest::GetInstance()->original_working_dir()),
- internal::FilePath(colon + 1));
-
- if (!output_name.IsDirectory())
- return output_name.ToString();
-
- internal::FilePath result(internal::FilePath::GenerateUniqueFileName(
- output_name, internal::GetCurrentExecutableName(),
- GetOutputFormat().c_str()));
- return result.ToString();
-}
-
-// Returns true iff the wildcard pattern matches the string. The
-// first ':' or '\0' character in pattern marks the end of it.
-//
-// This recursive algorithm isn't very efficient, but is clear and
-// works well enough for matching test names, which are short.
-bool UnitTestOptions::PatternMatchesString(const char *pattern,
- const char *str) {
- switch (*pattern) {
- case '\0':
- case ':': // Either ':' or '\0' marks the end of the pattern.
- return *str == '\0';
- case '?': // Matches any single character.
- return *str != '\0' && PatternMatchesString(pattern + 1, str + 1);
- case '*': // Matches any string (possibly empty) of characters.
- return (*str != '\0' && PatternMatchesString(pattern, str + 1)) ||
- PatternMatchesString(pattern + 1, str);
- default: // Non-special character. Matches itself.
- return *pattern == *str &&
- PatternMatchesString(pattern + 1, str + 1);
- }
-}
-
-bool UnitTestOptions::MatchesFilter(const String& name, const char* filter) {
- const char *cur_pattern = filter;
- for (;;) {
- if (PatternMatchesString(cur_pattern, name.c_str())) {
- return true;
- }
-
- // Finds the next pattern in the filter.
- cur_pattern = strchr(cur_pattern, ':');
-
- // Returns if no more pattern can be found.
- if (cur_pattern == NULL) {
- return false;
- }
-
- // Skips the pattern separater (the ':' character).
- cur_pattern++;
- }
-}
-
-// TODO(keithray): move String function implementations to gtest-string.cc.
-
-// Returns true iff the user-specified filter matches the test case
-// name and the test name.
-bool UnitTestOptions::FilterMatchesTest(const String &test_case_name,
- const String &test_name) {
- const String& full_name = String::Format("%s.%s",
- test_case_name.c_str(),
- test_name.c_str());
-
- // Split --gtest_filter at '-', if there is one, to separate into
- // positive filter and negative filter portions
- const char* const p = GTEST_FLAG(filter).c_str();
- const char* const dash = strchr(p, '-');
- String positive;
- String negative;
- if (dash == NULL) {
- positive = GTEST_FLAG(filter).c_str(); // Whole string is a positive filter
- negative = String("");
- } else {
- positive = String(p, dash - p); // Everything up to the dash
- negative = String(dash+1); // Everything after the dash
- if (positive.empty()) {
- // Treat '-test1' as the same as '*-test1'
- positive = kUniversalFilter;
- }
- }
-
- // A filter is a colon-separated list of patterns. It matches a
- // test if any pattern in it matches the test.
- return (MatchesFilter(full_name, positive.c_str()) &&
- !MatchesFilter(full_name, negative.c_str()));
-}
-
-#if GTEST_OS_WINDOWS
-// Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the
-// given SEH exception, or EXCEPTION_CONTINUE_SEARCH otherwise.
-// This function is useful as an __except condition.
-int UnitTestOptions::GTestShouldProcessSEH(DWORD exception_code) {
- // Google Test should handle an exception if:
- // 1. the user wants it to, AND
- // 2. this is not a breakpoint exception.
- return (GTEST_FLAG(catch_exceptions) &&
- exception_code != EXCEPTION_BREAKPOINT) ?
- EXCEPTION_EXECUTE_HANDLER :
- EXCEPTION_CONTINUE_SEARCH;
-}
-#endif // GTEST_OS_WINDOWS
-
-} // namespace internal
-
-// The c'tor sets this object as the test part result reporter used by
-// Google Test. The 'result' parameter specifies where to report the
-// results. Intercepts only failures from the current thread.
-ScopedFakeTestPartResultReporter::ScopedFakeTestPartResultReporter(
- TestPartResultArray* result)
- : intercept_mode_(INTERCEPT_ONLY_CURRENT_THREAD),
- result_(result) {
- Init();
-}
-
-// The c'tor sets this object as the test part result reporter used by
-// Google Test. The 'result' parameter specifies where to report the
-// results.
-ScopedFakeTestPartResultReporter::ScopedFakeTestPartResultReporter(
- InterceptMode intercept_mode, TestPartResultArray* result)
- : intercept_mode_(intercept_mode),
- result_(result) {
- Init();
-}
-
-void ScopedFakeTestPartResultReporter::Init() {
- internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
- if (intercept_mode_ == INTERCEPT_ALL_THREADS) {
- old_reporter_ = impl->GetGlobalTestPartResultReporter();
- impl->SetGlobalTestPartResultReporter(this);
- } else {
- old_reporter_ = impl->GetTestPartResultReporterForCurrentThread();
- impl->SetTestPartResultReporterForCurrentThread(this);
- }
-}
-
-// The d'tor restores the test part result reporter used by Google Test
-// before.
-ScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter() {
- internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
- if (intercept_mode_ == INTERCEPT_ALL_THREADS) {
- impl->SetGlobalTestPartResultReporter(old_reporter_);
- } else {
- impl->SetTestPartResultReporterForCurrentThread(old_reporter_);
- }
-}
-
-// Increments the test part result count and remembers the result.
-// This method is from the TestPartResultReporterInterface interface.
-void ScopedFakeTestPartResultReporter::ReportTestPartResult(
- const TestPartResult& result) {
- result_->Append(result);
-}
-
-namespace internal {
-
-// Returns the type ID of ::testing::Test. We should always call this
-// instead of GetTypeId< ::testing::Test>() to get the type ID of
-// testing::Test. This is to work around a suspected linker bug when
-// using Google Test as a framework on Mac OS X. The bug causes
-// GetTypeId< ::testing::Test>() to return different values depending
-// on whether the call is from the Google Test framework itself or
-// from user test code. GetTestTypeId() is guaranteed to always
-// return the same value, as it always calls GetTypeId<>() from the
-// gtest.cc, which is within the Google Test framework.
-TypeId GetTestTypeId() {
- return GetTypeId<Test>();
-}
-
-// The value of GetTestTypeId() as seen from within the Google Test
-// library. This is solely for testing GetTestTypeId().
-const TypeId kTestTypeIdInGoogleTest = GetTestTypeId();
-
-// This predicate-formatter checks that 'results' contains a test part
-// failure of the given type and that the failure message contains the
-// given substring.
-AssertionResult HasOneFailure(const char* /* results_expr */,
- const char* /* type_expr */,
- const char* /* substr_expr */,
- const TestPartResultArray& results,
- TestPartResult::Type type,
- const char* substr) {
- const String expected(type == TestPartResult::kFatalFailure ?
- "1 fatal failure" :
- "1 non-fatal failure");
- Message msg;
- if (results.size() != 1) {
- msg << "Expected: " << expected << "\n"
- << " Actual: " << results.size() << " failures";
- for (int i = 0; i < results.size(); i++) {
- msg << "\n" << results.GetTestPartResult(i);
- }
- return AssertionFailure(msg);
- }
-
- const TestPartResult& r = results.GetTestPartResult(0);
- if (r.type() != type) {
- msg << "Expected: " << expected << "\n"
- << " Actual:\n"
- << r;
- return AssertionFailure(msg);
- }
-
- if (strstr(r.message(), substr) == NULL) {
- msg << "Expected: " << expected << " containing \""
- << substr << "\"\n"
- << " Actual:\n"
- << r;
- return AssertionFailure(msg);
- }
-
- return AssertionSuccess();
-}
-
-// The constructor of SingleFailureChecker remembers where to look up
-// test part results, what type of failure we expect, and what
-// substring the failure message should contain.
-SingleFailureChecker:: SingleFailureChecker(
- const TestPartResultArray* results,
- TestPartResult::Type type,
- const char* substr)
- : results_(results),
- type_(type),
- substr_(substr) {}
-
-// The destructor of SingleFailureChecker verifies that the given
-// TestPartResultArray contains exactly one failure that has the given
-// type and contains the given substring. If that's not the case, a
-// non-fatal failure will be generated.
-SingleFailureChecker::~SingleFailureChecker() {
- EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_.c_str());
-}
-
-DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(
- UnitTestImpl* unit_test) : unit_test_(unit_test) {}
-
-void DefaultGlobalTestPartResultReporter::ReportTestPartResult(
- const TestPartResult& result) {
- unit_test_->current_test_result()->AddTestPartResult(result);
- unit_test_->listeners()->repeater()->OnTestPartResult(result);
-}
-
-DefaultPerThreadTestPartResultReporter::DefaultPerThreadTestPartResultReporter(
- UnitTestImpl* unit_test) : unit_test_(unit_test) {}
-
-void DefaultPerThreadTestPartResultReporter::ReportTestPartResult(
- const TestPartResult& result) {
- unit_test_->GetGlobalTestPartResultReporter()->ReportTestPartResult(result);
-}
-
-// Returns the global test part result reporter.
-TestPartResultReporterInterface*
-UnitTestImpl::GetGlobalTestPartResultReporter() {
- internal::MutexLock lock(&global_test_part_result_reporter_mutex_);
- return global_test_part_result_repoter_;
-}
-
-// Sets the global test part result reporter.
-void UnitTestImpl::SetGlobalTestPartResultReporter(
- TestPartResultReporterInterface* reporter) {
- internal::MutexLock lock(&global_test_part_result_reporter_mutex_);
- global_test_part_result_repoter_ = reporter;
-}
-
-// Returns the test part result reporter for the current thread.
-TestPartResultReporterInterface*
-UnitTestImpl::GetTestPartResultReporterForCurrentThread() {
- return per_thread_test_part_result_reporter_.get();
-}
-
-// Sets the test part result reporter for the current thread.
-void UnitTestImpl::SetTestPartResultReporterForCurrentThread(
- TestPartResultReporterInterface* reporter) {
- per_thread_test_part_result_reporter_.set(reporter);
-}
-
-// Gets the number of successful test cases.
-int UnitTestImpl::successful_test_case_count() const {
- return CountIf(test_cases_, TestCasePassed);
-}
-
-// Gets the number of failed test cases.
-int UnitTestImpl::failed_test_case_count() const {
- return CountIf(test_cases_, TestCaseFailed);
-}
-
-// Gets the number of all test cases.
-int UnitTestImpl::total_test_case_count() const {
- return static_cast<int>(test_cases_.size());
-}
-
-// Gets the number of all test cases that contain at least one test
-// that should run.
-int UnitTestImpl::test_case_to_run_count() const {
- return CountIf(test_cases_, ShouldRunTestCase);
-}
-
-// Gets the number of successful tests.
-int UnitTestImpl::successful_test_count() const {
- return SumOverTestCaseList(test_cases_, &TestCase::successful_test_count);
-}
-
-// Gets the number of failed tests.
-int UnitTestImpl::failed_test_count() const {
- return SumOverTestCaseList(test_cases_, &TestCase::failed_test_count);
-}
-
-// Gets the number of disabled tests.
-int UnitTestImpl::disabled_test_count() const {
- return SumOverTestCaseList(test_cases_, &TestCase::disabled_test_count);
-}
-
-// Gets the number of all tests.
-int UnitTestImpl::total_test_count() const {
- return SumOverTestCaseList(test_cases_, &TestCase::total_test_count);
-}
-
-// Gets the number of tests that should run.
-int UnitTestImpl::test_to_run_count() const {
- return SumOverTestCaseList(test_cases_, &TestCase::test_to_run_count);
-}
-
-// Returns the current OS stack trace as a String.
-//
-// The maximum number of stack frames to be included is specified by
-// the gtest_stack_trace_depth flag. The skip_count parameter
-// specifies the number of top frames to be skipped, which doesn't
-// count against the number of frames to be included.
-//
-// For example, if Foo() calls Bar(), which in turn calls
-// CurrentOsStackTraceExceptTop(1), Foo() will be included in the
-// trace but Bar() and CurrentOsStackTraceExceptTop() won't.
-String UnitTestImpl::CurrentOsStackTraceExceptTop(int skip_count) {
- (void)skip_count;
- return String("");
-}
-
-// Returns the current time in milliseconds.
-TimeInMillis GetTimeInMillis() {
-#if GTEST_OS_WINDOWS_MOBILE || defined(__BORLANDC__)
- // Difference between 1970-01-01 and 1601-01-01 in milliseconds.
- // http://analogous.blogspot.com/2005/04/epoch.html
- const TimeInMillis kJavaEpochToWinFileTimeDelta =
- static_cast<TimeInMillis>(116444736UL) * 100000UL;
- const DWORD kTenthMicrosInMilliSecond = 10000;
-
- SYSTEMTIME now_systime;
- FILETIME now_filetime;
- ULARGE_INTEGER now_int64;
- // TODO(kenton@google.com): Shouldn't this just use
- // GetSystemTimeAsFileTime()?
- GetSystemTime(&now_systime);
- if (SystemTimeToFileTime(&now_systime, &now_filetime)) {
- now_int64.LowPart = now_filetime.dwLowDateTime;
- now_int64.HighPart = now_filetime.dwHighDateTime;
- now_int64.QuadPart = (now_int64.QuadPart / kTenthMicrosInMilliSecond) -
- kJavaEpochToWinFileTimeDelta;
- return now_int64.QuadPart;
- }
- return 0;
-#elif GTEST_OS_WINDOWS && !GTEST_HAS_GETTIMEOFDAY_
- __timeb64 now;
-#ifdef _MSC_VER
- // MSVC 8 deprecates _ftime64(), so we want to suppress warning 4996
- // (deprecated function) there.
- // TODO(kenton@google.com): Use GetTickCount()? Or use
- // SystemTimeToFileTime()
-#pragma warning(push) // Saves the current warning state.
-#pragma warning(disable:4996) // Temporarily disables warning 4996.
- _ftime64(&now);
-#pragma warning(pop) // Restores the warning state.
-#else
- _ftime64(&now);
-#endif // _MSC_VER
- return static_cast<TimeInMillis>(now.time) * 1000 + now.millitm;
-#elif GTEST_HAS_GETTIMEOFDAY_
- struct timeval now;
- gettimeofday(&now, NULL);
- return static_cast<TimeInMillis>(now.tv_sec) * 1000 + now.tv_usec / 1000;
-#else
-#error "Don't know how to get the current time on your system."
-#endif
-}
-
-// Utilities
-
-// class String
-
-// Returns the input enclosed in double quotes if it's not NULL;
-// otherwise returns "(null)". For example, "\"Hello\"" is returned
-// for input "Hello".
-//
-// This is useful for printing a C string in the syntax of a literal.
-//
-// Known issue: escape sequences are not handled yet.
-String String::ShowCStringQuoted(const char* c_str) {
- return c_str ? String::Format("\"%s\"", c_str) : String("(null)");
-}
-
-// Copies at most length characters from str into a newly-allocated
-// piece of memory of size length+1. The memory is allocated with new[].
-// A terminating null byte is written to the memory, and a pointer to it
-// is returned. If str is NULL, NULL is returned.
-static char* CloneString(const char* str, size_t length) {
- if (str == NULL) {
- return NULL;
- } else {
- char* const clone = new char[length + 1];
- posix::StrNCpy(clone, str, length);
- clone[length] = '\0';
- return clone;
- }
-}
-
-// Clones a 0-terminated C string, allocating memory using new. The
-// caller is responsible for deleting[] the return value. Returns the
-// cloned string, or NULL if the input is NULL.
-const char * String::CloneCString(const char* c_str) {
- return (c_str == NULL) ?
- NULL : CloneString(c_str, strlen(c_str));
-}
-
-#if GTEST_OS_WINDOWS_MOBILE
-// Creates a UTF-16 wide string from the given ANSI string, allocating
-// memory using new. The caller is responsible for deleting the return
-// value using delete[]. Returns the wide string, or NULL if the
-// input is NULL.
-LPCWSTR String::AnsiToUtf16(const char* ansi) {
- if (!ansi) return NULL;
- const int length = strlen(ansi);
- const int unicode_length =
- MultiByteToWideChar(CP_ACP, 0, ansi, length,
- NULL, 0);
- WCHAR* unicode = new WCHAR[unicode_length + 1];
- MultiByteToWideChar(CP_ACP, 0, ansi, length,
- unicode, unicode_length);
- unicode[unicode_length] = 0;
- return unicode;
-}
-
-// Creates an ANSI string from the given wide string, allocating
-// memory using new. The caller is responsible for deleting the return
-// value using delete[]. Returns the ANSI string, or NULL if the
-// input is NULL.
-const char* String::Utf16ToAnsi(LPCWSTR utf16_str) {
- if (!utf16_str) return NULL;
- const int ansi_length =
- WideCharToMultiByte(CP_ACP, 0, utf16_str, -1,
- NULL, 0, NULL, NULL);
- char* ansi = new char[ansi_length + 1];
- WideCharToMultiByte(CP_ACP, 0, utf16_str, -1,
- ansi, ansi_length, NULL, NULL);
- ansi[ansi_length] = 0;
- return ansi;
-}
-
-#endif // GTEST_OS_WINDOWS_MOBILE
-
-// Compares two C strings. Returns true iff they have the same content.
-//
-// Unlike strcmp(), this function can handle NULL argument(s). A NULL
-// C string is considered different to any non-NULL C string,
-// including the empty string.
-bool String::CStringEquals(const char * lhs, const char * rhs) {
- if ( lhs == NULL ) return rhs == NULL;
-
- if ( rhs == NULL ) return false;
-
- return strcmp(lhs, rhs) == 0;
-}
-
-#if GTEST_HAS_STD_WSTRING || GTEST_HAS_GLOBAL_WSTRING
-
-// Converts an array of wide chars to a narrow string using the UTF-8
-// encoding, and streams the result to the given Message object.
-static void StreamWideCharsToMessage(const wchar_t* wstr, size_t length,
- Message* msg) {
- // TODO(wan): consider allowing a testing::String object to
- // contain '\0'. This will make it behave more like std::string,
- // and will allow ToUtf8String() to return the correct encoding
- // for '\0' s.t. we can get rid of the conditional here (and in
- // several other places).
- for (size_t i = 0; i != length; ) { // NOLINT
- if (wstr[i] != L'\0') {
- *msg << WideStringToUtf8(wstr + i, static_cast<int>(length - i));
- while (i != length && wstr[i] != L'\0')
- i++;
- } else {
- *msg << '\0';
- i++;
- }
- }
-}
-
-#endif // GTEST_HAS_STD_WSTRING || GTEST_HAS_GLOBAL_WSTRING
-
-} // namespace internal
-
-#if GTEST_HAS_STD_WSTRING
-// Converts the given wide string to a narrow string using the UTF-8
-// encoding, and streams the result to this Message object.
-Message& Message::operator <<(const ::std::wstring& wstr) {
- internal::StreamWideCharsToMessage(wstr.c_str(), wstr.length(), this);
- return *this;
-}
-#endif // GTEST_HAS_STD_WSTRING
-
-#if GTEST_HAS_GLOBAL_WSTRING
-// Converts the given wide string to a narrow string using the UTF-8
-// encoding, and streams the result to this Message object.
-Message& Message::operator <<(const ::wstring& wstr) {
- internal::StreamWideCharsToMessage(wstr.c_str(), wstr.length(), this);
- return *this;
-}
-#endif // GTEST_HAS_GLOBAL_WSTRING
-
-namespace internal {
-
-// Formats a value to be used in a failure message.
-
-// For a char value, we print it as a C++ char literal and as an
-// unsigned integer (both in decimal and in hexadecimal).
-String FormatForFailureMessage(char ch) {
- const unsigned int ch_as_uint = ch;
- // A String object cannot contain '\0', so we print "\\0" when ch is
- // '\0'.
- return String::Format("'%s' (%u, 0x%X)",
- ch ? String::Format("%c", ch).c_str() : "\\0",
- ch_as_uint, ch_as_uint);
-}
-
-// For a wchar_t value, we print it as a C++ wchar_t literal and as an
-// unsigned integer (both in decimal and in hexidecimal).
-String FormatForFailureMessage(wchar_t wchar) {
- // The C++ standard doesn't specify the exact size of the wchar_t
- // type. It just says that it shall have the same size as another
- // integral type, called its underlying type.
- //
- // Therefore, in order to print a wchar_t value in the numeric form,
- // we first convert it to the largest integral type (UInt64) and
- // then print the converted value.
- //
- // We use streaming to print the value as "%llu" doesn't work
- // correctly with MSVC 7.1.
- const UInt64 wchar_as_uint64 = wchar;
- Message msg;
- // A String object cannot contain '\0', so we print "\\0" when wchar is
- // L'\0'.
- char buffer[32]; // CodePointToUtf8 requires a buffer that big.
- msg << "L'"
- << (wchar ? CodePointToUtf8(static_cast<UInt32>(wchar), buffer) : "\\0")
- << "' (" << wchar_as_uint64 << ", 0x" << ::std::setbase(16)
- << wchar_as_uint64 << ")";
- return msg.GetString();
-}
-
-} // namespace internal
-
-// AssertionResult constructors.
-// Used in EXPECT_TRUE/FALSE(assertion_result).
-AssertionResult::AssertionResult(const AssertionResult& other)
- : success_(other.success_),
- message_(other.message_.get() != NULL ?
- new internal::String(*other.message_) :
- static_cast<internal::String*>(NULL)) {
-}
-
-// Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
-AssertionResult AssertionResult::operator!() const {
- AssertionResult negation(!success_);
- if (message_.get() != NULL)
- negation << *message_;
- return negation;
-}
-
-// Makes a successful assertion result.
-AssertionResult AssertionSuccess() {
- return AssertionResult(true);
-}
-
-// Makes a failed assertion result.
-AssertionResult AssertionFailure() {
- return AssertionResult(false);
-}
-
-// Makes a failed assertion result with the given failure message.
-// Deprecated; use AssertionFailure() << message.
-AssertionResult AssertionFailure(const Message& message) {
- return AssertionFailure() << message;
-}
-
-namespace internal {
-
-// Constructs and returns the message for an equality assertion
-// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
-//
-// The first four parameters are the expressions used in the assertion
-// and their values, as strings. For example, for ASSERT_EQ(foo, bar)
-// where foo is 5 and bar is 6, we have:
-//
-// expected_expression: "foo"
-// actual_expression: "bar"
-// expected_value: "5"
-// actual_value: "6"
-//
-// The ignoring_case parameter is true iff the assertion is a
-// *_STRCASEEQ*. When it's true, the string " (ignoring case)" will
-// be inserted into the message.
-AssertionResult EqFailure(const char* expected_expression,
- const char* actual_expression,
- const String& expected_value,
- const String& actual_value,
- bool ignoring_case) {
- Message msg;
- msg << "Value of: " << actual_expression;
- if (actual_value != actual_expression) {
- msg << "\n Actual: " << actual_value;
- }
-
- msg << "\nExpected: " << expected_expression;
- if (ignoring_case) {
- msg << " (ignoring case)";
- }
- if (expected_value != expected_expression) {
- msg << "\nWhich is: " << expected_value;
- }
-
- return AssertionFailure(msg);
-}
-
-// Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
-String GetBoolAssertionFailureMessage(const AssertionResult& assertion_result,
- const char* expression_text,
- const char* actual_predicate_value,
- const char* expected_predicate_value) {
- const char* actual_message = assertion_result.message();
- Message msg;
- msg << "Value of: " << expression_text
- << "\n Actual: " << actual_predicate_value;
- if (actual_message[0] != '\0')
- msg << " (" << actual_message << ")";
- msg << "\nExpected: " << expected_predicate_value;
- return msg.GetString();
-}
-
-// Helper function for implementing ASSERT_NEAR.
-AssertionResult DoubleNearPredFormat(const char* expr1,
- const char* expr2,
- const char* abs_error_expr,
- double val1,
- double val2,
- double abs_error) {
- const double diff = fabs(val1 - val2);
- if (diff <= abs_error) return AssertionSuccess();
-
- // TODO(wan): do not print the value of an expression if it's
- // already a literal.
- Message msg;
- msg << "The difference between " << expr1 << " and " << expr2
- << " is " << diff << ", which exceeds " << abs_error_expr << ", where\n"
- << expr1 << " evaluates to " << val1 << ",\n"
- << expr2 << " evaluates to " << val2 << ", and\n"
- << abs_error_expr << " evaluates to " << abs_error << ".";
- return AssertionFailure(msg);
-}
-
-
-// Helper template for implementing FloatLE() and DoubleLE().
-template <typename RawType>
-AssertionResult FloatingPointLE(const char* expr1,
- const char* expr2,
- RawType val1,
- RawType val2) {
- // Returns success if val1 is less than val2,
- if (val1 < val2) {
- return AssertionSuccess();
- }
-
- // or if val1 is almost equal to val2.
- const FloatingPoint<RawType> lhs(val1), rhs(val2);
- if (lhs.AlmostEquals(rhs)) {
- return AssertionSuccess();
- }
-
- // Note that the above two checks will both fail if either val1 or
- // val2 is NaN, as the IEEE floating-point standard requires that
- // any predicate involving a NaN must return false.
-
- StrStream val1_ss;
- val1_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
- << val1;
-
- StrStream val2_ss;
- val2_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
- << val2;
-
- Message msg;
- msg << "Expected: (" << expr1 << ") <= (" << expr2 << ")\n"
- << " Actual: " << StrStreamToString(&val1_ss) << " vs "
- << StrStreamToString(&val2_ss);
-
- return AssertionFailure(msg);
-}
-
-} // namespace internal
-
-// Asserts that val1 is less than, or almost equal to, val2. Fails
-// otherwise. In particular, it fails if either val1 or val2 is NaN.
-AssertionResult FloatLE(const char* expr1, const char* expr2,
- float val1, float val2) {
- return internal::FloatingPointLE<float>(expr1, expr2, val1, val2);
-}
-
-// Asserts that val1 is less than, or almost equal to, val2. Fails
-// otherwise. In particular, it fails if either val1 or val2 is NaN.
-AssertionResult DoubleLE(const char* expr1, const char* expr2,
- double val1, double val2) {
- return internal::FloatingPointLE<double>(expr1, expr2, val1, val2);
-}
-
-namespace internal {
-
-// The helper function for {ASSERT|EXPECT}_EQ with int or enum
-// arguments.
-AssertionResult CmpHelperEQ(const char* expected_expression,
- const char* actual_expression,
- BiggestInt expected,
- BiggestInt actual) {
- if (expected == actual) {
- return AssertionSuccess();
- }
-
- return EqFailure(expected_expression,
- actual_expression,
- FormatForComparisonFailureMessage(expected, actual),
- FormatForComparisonFailureMessage(actual, expected),
- false);
-}
-
-// A macro for implementing the helper functions needed to implement
-// ASSERT_?? and EXPECT_?? with integer or enum arguments. It is here
-// just to avoid copy-and-paste of similar code.
-#define GTEST_IMPL_CMP_HELPER_(op_name, op)\
-AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
- BiggestInt val1, BiggestInt val2) {\
- if (val1 op val2) {\
- return AssertionSuccess();\
- } else {\
- Message msg;\
- msg << "Expected: (" << expr1 << ") " #op " (" << expr2\
- << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
- << " vs " << FormatForComparisonFailureMessage(val2, val1);\
- return AssertionFailure(msg);\
- }\
-}
-
-// Implements the helper function for {ASSERT|EXPECT}_NE with int or
-// enum arguments.
-GTEST_IMPL_CMP_HELPER_(NE, !=)
-// Implements the helper function for {ASSERT|EXPECT}_LE with int or
-// enum arguments.
-GTEST_IMPL_CMP_HELPER_(LE, <=)
-// Implements the helper function for {ASSERT|EXPECT}_LT with int or
-// enum arguments.
-GTEST_IMPL_CMP_HELPER_(LT, < )
-// Implements the helper function for {ASSERT|EXPECT}_GE with int or
-// enum arguments.
-GTEST_IMPL_CMP_HELPER_(GE, >=)
-// Implements the helper function for {ASSERT|EXPECT}_GT with int or
-// enum arguments.
-GTEST_IMPL_CMP_HELPER_(GT, > )
-
-#undef GTEST_IMPL_CMP_HELPER_
-
-// The helper function for {ASSERT|EXPECT}_STREQ.
-AssertionResult CmpHelperSTREQ(const char* expected_expression,
- const char* actual_expression,
- const char* expected,
- const char* actual) {
- if (String::CStringEquals(expected, actual)) {
- return AssertionSuccess();
- }
-
- return EqFailure(expected_expression,
- actual_expression,
- String::ShowCStringQuoted(expected),
- String::ShowCStringQuoted(actual),
- false);
-}
-
-// The helper function for {ASSERT|EXPECT}_STRCASEEQ.
-AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression,
- const char* actual_expression,
- const char* expected,
- const char* actual) {
- if (String::CaseInsensitiveCStringEquals(expected, actual)) {
- return AssertionSuccess();
- }
-
- return EqFailure(expected_expression,
- actual_expression,
- String::ShowCStringQuoted(expected),
- String::ShowCStringQuoted(actual),
- true);
-}
-
-// The helper function for {ASSERT|EXPECT}_STRNE.
-AssertionResult CmpHelperSTRNE(const char* s1_expression,
- const char* s2_expression,
- const char* s1,
- const char* s2) {
- if (!String::CStringEquals(s1, s2)) {
- return AssertionSuccess();
- } else {
- Message msg;
- msg << "Expected: (" << s1_expression << ") != ("
- << s2_expression << "), actual: \""
- << s1 << "\" vs \"" << s2 << "\"";
- return AssertionFailure(msg);
- }
-}
-
-// The helper function for {ASSERT|EXPECT}_STRCASENE.
-AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
- const char* s2_expression,
- const char* s1,
- const char* s2) {
- if (!String::CaseInsensitiveCStringEquals(s1, s2)) {
- return AssertionSuccess();
- } else {
- Message msg;
- msg << "Expected: (" << s1_expression << ") != ("
- << s2_expression << ") (ignoring case), actual: \""
- << s1 << "\" vs \"" << s2 << "\"";
- return AssertionFailure(msg);
- }
-}
-
-} // namespace internal
-
-namespace {
-
-// Helper functions for implementing IsSubString() and IsNotSubstring().
-
-// This group of overloaded functions return true iff needle is a
-// substring of haystack. NULL is considered a substring of itself
-// only.
-
-bool IsSubstringPred(const char* needle, const char* haystack) {
- if (needle == NULL || haystack == NULL)
- return needle == haystack;
-
- return strstr(haystack, needle) != NULL;
-}
-
-bool IsSubstringPred(const wchar_t* needle, const wchar_t* haystack) {
- if (needle == NULL || haystack == NULL)
- return needle == haystack;
-
- return wcsstr(haystack, needle) != NULL;
-}
-
-// StringType here can be either ::std::string or ::std::wstring.
-template <typename StringType>
-bool IsSubstringPred(const StringType& needle,
- const StringType& haystack) {
- return haystack.find(needle) != StringType::npos;
-}
-
-// This function implements either IsSubstring() or IsNotSubstring(),
-// depending on the value of the expected_to_be_substring parameter.
-// StringType here can be const char*, const wchar_t*, ::std::string,
-// or ::std::wstring.
-template <typename StringType>
-AssertionResult IsSubstringImpl(
- bool expected_to_be_substring,
- const char* needle_expr, const char* haystack_expr,
- const StringType& needle, const StringType& haystack) {
- if (IsSubstringPred(needle, haystack) == expected_to_be_substring)
- return AssertionSuccess();
-
- const bool is_wide_string = sizeof(needle[0]) > 1;
- const char* const begin_string_quote = is_wide_string ? "L\"" : "\"";
- return AssertionFailure(
- Message()
- << "Value of: " << needle_expr << "\n"
- << " Actual: " << begin_string_quote << needle << "\"\n"
- << "Expected: " << (expected_to_be_substring ? "" : "not ")
- << "a substring of " << haystack_expr << "\n"
- << "Which is: " << begin_string_quote << haystack << "\"");
-}
-
-} // namespace
-
-// IsSubstring() and IsNotSubstring() check whether needle is a
-// substring of haystack (NULL is considered a substring of itself
-// only), and return an appropriate error message when they fail.
-
-AssertionResult IsSubstring(
- const char* needle_expr, const char* haystack_expr,
- const char* needle, const char* haystack) {
- return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);
-}
-
-AssertionResult IsSubstring(
- const char* needle_expr, const char* haystack_expr,
- const wchar_t* needle, const wchar_t* haystack) {
- return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);
-}
-
-AssertionResult IsNotSubstring(
- const char* needle_expr, const char* haystack_expr,
- const char* needle, const char* haystack) {
- return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);
-}
-
-AssertionResult IsNotSubstring(
- const char* needle_expr, const char* haystack_expr,
- const wchar_t* needle, const wchar_t* haystack) {
- return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);
-}
-
-AssertionResult IsSubstring(
- const char* needle_expr, const char* haystack_expr,
- const ::std::string& needle, const ::std::string& haystack) {
- return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);
-}
-
-AssertionResult IsNotSubstring(
- const char* needle_expr, const char* haystack_expr,
- const ::std::string& needle, const ::std::string& haystack) {
- return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);
-}
-
-#if GTEST_HAS_STD_WSTRING
-AssertionResult IsSubstring(
- const char* needle_expr, const char* haystack_expr,
- const ::std::wstring& needle, const ::std::wstring& haystack) {
- return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);
-}
-
-AssertionResult IsNotSubstring(
- const char* needle_expr, const char* haystack_expr,
- const ::std::wstring& needle, const ::std::wstring& haystack) {
- return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);
-}
-#endif // GTEST_HAS_STD_WSTRING
-
-namespace internal {
-
-#if GTEST_OS_WINDOWS
-
-namespace {
-
-// Helper function for IsHRESULT{SuccessFailure} predicates
-AssertionResult HRESULTFailureHelper(const char* expr,
- const char* expected,
- long hr) { // NOLINT
-#if GTEST_OS_WINDOWS_MOBILE
- // Windows CE doesn't support FormatMessage.
- const char error_text[] = "";
-#else
- // Looks up the human-readable system message for the HRESULT code
- // and since we're not passing any params to FormatMessage, we don't
- // want inserts expanded.
- const DWORD kFlags = FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS;
- const DWORD kBufSize = 4096; // String::Format can't exceed this length.
- // Gets the system's human readable message string for this HRESULT.
- char error_text[kBufSize] = { '\0' };
- DWORD message_length = ::FormatMessageA(kFlags,
- 0, // no source, we're asking system
- hr, // the error
- 0, // no line width restrictions
- error_text, // output buffer
- kBufSize, // buf size
- NULL); // no arguments for inserts
- // Trims tailing white space (FormatMessage leaves a trailing cr-lf)
- for (; message_length && isspace(error_text[message_length - 1]);
- --message_length) {
- error_text[message_length - 1] = '\0';
- }
-#endif // GTEST_OS_WINDOWS_MOBILE
-
- const String error_hex(String::Format("0x%08X ", hr));
- Message msg;
- msg << "Expected: " << expr << " " << expected << ".\n"
- << " Actual: " << error_hex << error_text << "\n";
-
- return ::testing::AssertionFailure(msg);
-}
-
-} // namespace
-
-AssertionResult IsHRESULTSuccess(const char* expr, long hr) { // NOLINT
- if (SUCCEEDED(hr)) {
- return AssertionSuccess();
- }
- return HRESULTFailureHelper(expr, "succeeds", hr);
-}
-
-AssertionResult IsHRESULTFailure(const char* expr, long hr) { // NOLINT
- if (FAILED(hr)) {
- return AssertionSuccess();
- }
- return HRESULTFailureHelper(expr, "fails", hr);
-}
-
-#endif // GTEST_OS_WINDOWS
-
-// Utility functions for encoding Unicode text (wide strings) in
-// UTF-8.
-
-// A Unicode code-point can have upto 21 bits, and is encoded in UTF-8
-// like this:
-//
-// Code-point length Encoding
-// 0 - 7 bits 0xxxxxxx
-// 8 - 11 bits 110xxxxx 10xxxxxx
-// 12 - 16 bits 1110xxxx 10xxxxxx 10xxxxxx
-// 17 - 21 bits 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
-
-// The maximum code-point a one-byte UTF-8 sequence can represent.
-const UInt32 kMaxCodePoint1 = (static_cast<UInt32>(1) << 7) - 1;
-
-// The maximum code-point a two-byte UTF-8 sequence can represent.
-const UInt32 kMaxCodePoint2 = (static_cast<UInt32>(1) << (5 + 6)) - 1;
-
-// The maximum code-point a three-byte UTF-8 sequence can represent.
-const UInt32 kMaxCodePoint3 = (static_cast<UInt32>(1) << (4 + 2*6)) - 1;
-
-// The maximum code-point a four-byte UTF-8 sequence can represent.
-const UInt32 kMaxCodePoint4 = (static_cast<UInt32>(1) << (3 + 3*6)) - 1;
-
-// Chops off the n lowest bits from a bit pattern. Returns the n
-// lowest bits. As a side effect, the original bit pattern will be
-// shifted to the right by n bits.
-inline UInt32 ChopLowBits(UInt32* bits, int n) {
- const UInt32 low_bits = *bits & ((static_cast<UInt32>(1) << n) - 1);
- *bits >>= n;
- return low_bits;
-}
-
-// Converts a Unicode code point to a narrow string in UTF-8 encoding.
-// code_point parameter is of type UInt32 because wchar_t may not be
-// wide enough to contain a code point.
-// The output buffer str must containt at least 32 characters.
-// The function returns the address of the output buffer.
-// If the code_point is not a valid Unicode code point
-// (i.e. outside of Unicode range U+0 to U+10FFFF) it will be output
-// as '(Invalid Unicode 0xXXXXXXXX)'.
-char* CodePointToUtf8(UInt32 code_point, char* str) {
- if (code_point <= kMaxCodePoint1) {
- str[1] = '\0';
- str[0] = static_cast<char>(code_point); // 0xxxxxxx
- } else if (code_point <= kMaxCodePoint2) {
- str[2] = '\0';
- str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
- str[0] = static_cast<char>(0xC0 | code_point); // 110xxxxx
- } else if (code_point <= kMaxCodePoint3) {
- str[3] = '\0';
- str[2] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
- str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
- str[0] = static_cast<char>(0xE0 | code_point); // 1110xxxx
- } else if (code_point <= kMaxCodePoint4) {
- str[4] = '\0';
- str[3] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
- str[2] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
- str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
- str[0] = static_cast<char>(0xF0 | code_point); // 11110xxx
- } else {
- // The longest string String::Format can produce when invoked
- // with these parameters is 28 character long (not including
- // the terminating nul character). We are asking for 32 character
- // buffer just in case. This is also enough for strncpy to
- // null-terminate the destination string.
- posix::StrNCpy(
- str, String::Format("(Invalid Unicode 0x%X)", code_point).c_str(), 32);
- str[31] = '\0'; // Makes sure no change in the format to strncpy leaves
- // the result unterminated.
- }
- return str;
-}
-
-// The following two functions only make sense if the the system
-// uses UTF-16 for wide string encoding. All supported systems
-// with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16.
-
-// Determines if the arguments constitute UTF-16 surrogate pair
-// and thus should be combined into a single Unicode code point
-// using CreateCodePointFromUtf16SurrogatePair.
-inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
- return sizeof(wchar_t) == 2 &&
- (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00;
-}
-
-// Creates a Unicode code point from UTF16 surrogate pair.
-inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first,
- wchar_t second) {
- const UInt32 mask = (1 << 10) - 1;
- return (sizeof(wchar_t) == 2) ?
- (((first & mask) << 10) | (second & mask)) + 0x10000 :
- // This function should not be called when the condition is
- // false, but we provide a sensible default in case it is.
- static_cast<UInt32>(first);
-}
-
-// Converts a wide string to a narrow string in UTF-8 encoding.
-// The wide string is assumed to have the following encoding:
-// UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS)
-// UTF-32 if sizeof(wchar_t) == 4 (on Linux)
-// Parameter str points to a null-terminated wide string.
-// Parameter num_chars may additionally limit the number
-// of wchar_t characters processed. -1 is used when the entire string
-// should be processed.
-// If the string contains code points that are not valid Unicode code points
-// (i.e. outside of Unicode range U+0 to U+10FFFF) they will be output
-// as '(Invalid Unicode 0xXXXXXXXX)'. If the string is in UTF16 encoding
-// and contains invalid UTF-16 surrogate pairs, values in those pairs
-// will be encoded as individual Unicode characters from Basic Normal Plane.
-String WideStringToUtf8(const wchar_t* str, int num_chars) {
- if (num_chars == -1)
- num_chars = static_cast<int>(wcslen(str));
-
- StrStream stream;
- for (int i = 0; i < num_chars; ++i) {
- UInt32 unicode_code_point;
-
- if (str[i] == L'\0') {
- break;
- } else if (i + 1 < num_chars && IsUtf16SurrogatePair(str[i], str[i + 1])) {
- unicode_code_point = CreateCodePointFromUtf16SurrogatePair(str[i],
- str[i + 1]);
- i++;
- } else {
- unicode_code_point = static_cast<UInt32>(str[i]);
- }
-
- char buffer[32]; // CodePointToUtf8 requires a buffer this big.
- stream << CodePointToUtf8(unicode_code_point, buffer);
- }
- return StrStreamToString(&stream);
-}
-
-// Converts a wide C string to a String using the UTF-8 encoding.
-// NULL will be converted to "(null)".
-String String::ShowWideCString(const wchar_t * wide_c_str) {
- if (wide_c_str == NULL) return String("(null)");
-
- return String(internal::WideStringToUtf8(wide_c_str, -1).c_str());
-}
-
-// Similar to ShowWideCString(), except that this function encloses
-// the converted string in double quotes.
-String String::ShowWideCStringQuoted(const wchar_t* wide_c_str) {
- if (wide_c_str == NULL) return String("(null)");
-
- return String::Format("L\"%s\"",
- String::ShowWideCString(wide_c_str).c_str());
-}
-
-// Compares two wide C strings. Returns true iff they have the same
-// content.
-//
-// Unlike wcscmp(), this function can handle NULL argument(s). A NULL
-// C string is considered different to any non-NULL C string,
-// including the empty string.
-bool String::WideCStringEquals(const wchar_t * lhs, const wchar_t * rhs) {
- if (lhs == NULL) return rhs == NULL;
-
- if (rhs == NULL) return false;
-
- return wcscmp(lhs, rhs) == 0;
-}
-
-// Helper function for *_STREQ on wide strings.
-AssertionResult CmpHelperSTREQ(const char* expected_expression,
- const char* actual_expression,
- const wchar_t* expected,
- const wchar_t* actual) {
- if (String::WideCStringEquals(expected, actual)) {
- return AssertionSuccess();
- }
-
- return EqFailure(expected_expression,
- actual_expression,
- String::ShowWideCStringQuoted(expected),
- String::ShowWideCStringQuoted(actual),
- false);
-}
-
-// Helper function for *_STRNE on wide strings.
-AssertionResult CmpHelperSTRNE(const char* s1_expression,
- const char* s2_expression,
- const wchar_t* s1,
- const wchar_t* s2) {
- if (!String::WideCStringEquals(s1, s2)) {
- return AssertionSuccess();
- }
-
- Message msg;
- msg << "Expected: (" << s1_expression << ") != ("
- << s2_expression << "), actual: "
- << String::ShowWideCStringQuoted(s1)
- << " vs " << String::ShowWideCStringQuoted(s2);
- return AssertionFailure(msg);
-}
-
-// Compares two C strings, ignoring case. Returns true iff they have
-// the same content.
-//
-// Unlike strcasecmp(), this function can handle NULL argument(s). A
-// NULL C string is considered different to any non-NULL C string,
-// including the empty string.
-bool String::CaseInsensitiveCStringEquals(const char * lhs, const char * rhs) {
- if (lhs == NULL)
- return rhs == NULL;
- if (rhs == NULL)
- return false;
- return posix::StrCaseCmp(lhs, rhs) == 0;
-}
-
- // Compares two wide C strings, ignoring case. Returns true iff they
- // have the same content.
- //
- // Unlike wcscasecmp(), this function can handle NULL argument(s).
- // A NULL C string is considered different to any non-NULL wide C string,
- // including the empty string.
- // NB: The implementations on different platforms slightly differ.
- // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
- // environment variable. On GNU platform this method uses wcscasecmp
- // which compares according to LC_CTYPE category of the current locale.
- // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
- // current locale.
-bool String::CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
- const wchar_t* rhs) {
- if ( lhs == NULL ) return rhs == NULL;
-
- if ( rhs == NULL ) return false;
-
-#if GTEST_OS_WINDOWS
- return _wcsicmp(lhs, rhs) == 0;
-#elif GTEST_OS_LINUX
- return wcscasecmp(lhs, rhs) == 0;
-#else
- // Mac OS X and Cygwin don't define wcscasecmp. Other unknown OSes
- // may not define it either.
- wint_t left, right;
- do {
- left = towlower(*lhs++);
- right = towlower(*rhs++);
- } while (left && left == right);
- return left == right;
-#endif // OS selector
-}
-
-// Compares this with another String.
-// Returns < 0 if this is less than rhs, 0 if this is equal to rhs, or > 0
-// if this is greater than rhs.
-int String::Compare(const String & rhs) const {
- const char* const lhs_c_str = c_str();
- const char* const rhs_c_str = rhs.c_str();
-
- if (lhs_c_str == NULL) {
- return rhs_c_str == NULL ? 0 : -1; // NULL < anything except NULL
- } else if (rhs_c_str == NULL) {
- return 1;
- }
-
- const size_t shorter_str_len =
- length() <= rhs.length() ? length() : rhs.length();
- for (size_t i = 0; i != shorter_str_len; i++) {
- if (lhs_c_str[i] < rhs_c_str[i]) {
- return -1;
- } else if (lhs_c_str[i] > rhs_c_str[i]) {
- return 1;
- }
- }
- return (length() < rhs.length()) ? -1 :
- (length() > rhs.length()) ? 1 : 0;
-}
-
-// Returns true iff this String ends with the given suffix. *Any*
-// String is considered to end with a NULL or empty suffix.
-bool String::EndsWith(const char* suffix) const {
- if (suffix == NULL || CStringEquals(suffix, "")) return true;
-
- if (c_str() == NULL) return false;
-
- const size_t this_len = strlen(c_str());
- const size_t suffix_len = strlen(suffix);
- return (this_len >= suffix_len) &&
- CStringEquals(c_str() + this_len - suffix_len, suffix);
-}
-
-// Returns true iff this String ends with the given suffix, ignoring case.
-// Any String is considered to end with a NULL or empty suffix.
-bool String::EndsWithCaseInsensitive(const char* suffix) const {
- if (suffix == NULL || CStringEquals(suffix, "")) return true;
-
- if (c_str() == NULL) return false;
-
- const size_t this_len = strlen(c_str());
- const size_t suffix_len = strlen(suffix);
- return (this_len >= suffix_len) &&
- CaseInsensitiveCStringEquals(c_str() + this_len - suffix_len, suffix);
-}
-
-// Formats a list of arguments to a String, using the same format
-// spec string as for printf.
-//
-// We do not use the StringPrintf class as it is not universally
-// available.
-//
-// The result is limited to 4096 characters (including the tailing 0).
-// If 4096 characters are not enough to format the input, or if
-// there's an error, "<formatting error or buffer exceeded>" is
-// returned.
-String String::Format(const char * format, ...) {
- va_list args;
- va_start(args, format);
-
- char buffer[4096];
- const int kBufferSize = sizeof(buffer)/sizeof(buffer[0]);
-
- // MSVC 8 deprecates vsnprintf(), so we want to suppress warning
- // 4996 (deprecated function) there.
-#ifdef _MSC_VER // We are using MSVC.
-#pragma warning(push) // Saves the current warning state.
-#pragma warning(disable:4996) // Temporarily disables warning 4996.
- const int size = vsnprintf(buffer, kBufferSize, format, args);
-#pragma warning(pop) // Restores the warning state.
-#else // We are not using MSVC.
- const int size = vsnprintf(buffer, kBufferSize, format, args);
-#endif // _MSC_VER
- va_end(args);
-
- // vsnprintf()'s behavior is not portable. When the buffer is not
- // big enough, it returns a negative value in MSVC, and returns the
- // needed buffer size on Linux. When there is an output error, it
- // always returns a negative value. For simplicity, we lump the two
- // error cases together.
- if (size < 0 || size >= kBufferSize) {
- return String("<formatting error or buffer exceeded>");
- } else {
- return String(buffer, size);
- }
-}
-
-// Converts the buffer in a StrStream to a String, converting NUL
-// bytes to "\\0" along the way.
-String StrStreamToString(StrStream* ss) {
- const ::std::string& str = ss->str();
- const char* const start = str.c_str();
- const char* const end = start + str.length();
-
- // We need to use a helper StrStream to do this transformation
- // because String doesn't support push_back().
- StrStream helper;
- for (const char* ch = start; ch != end; ++ch) {
- if (*ch == '\0') {
- helper << "\\0"; // Replaces NUL with "\\0";
- } else {
- helper.put(*ch);
- }
- }
-
- return String(helper.str().c_str());
-}
-
-// Appends the user-supplied message to the Google-Test-generated message.
-String AppendUserMessage(const String& gtest_msg,
- const Message& user_msg) {
- // Appends the user message if it's non-empty.
- const String user_msg_string = user_msg.GetString();
- if (user_msg_string.empty()) {
- return gtest_msg;
- }
-
- Message msg;
- msg << gtest_msg << "\n" << user_msg_string;
-
- return msg.GetString();
-}
-
-} // namespace internal
-
-// class TestResult
-
-// Creates an empty TestResult.
-TestResult::TestResult()
- : death_test_count_(0),
- elapsed_time_(0) {
-}
-
-// D'tor.
-TestResult::~TestResult() {
-}
-
-// Returns the i-th test part result among all the results. i can
-// range from 0 to total_part_count() - 1. If i is not in that range,
-// aborts the program.
-const TestPartResult& TestResult::GetTestPartResult(int i) const {
- if (i < 0 || i >= total_part_count())
- internal::posix::Abort();
- return test_part_results_.at(i);
-}
-
-// Returns the i-th test property. i can range from 0 to
-// test_property_count() - 1. If i is not in that range, aborts the
-// program.
-const TestProperty& TestResult::GetTestProperty(int i) const {
- if (i < 0 || i >= test_property_count())
- internal::posix::Abort();
- return test_properties_.at(i);
-}
-
-// Clears the test part results.
-void TestResult::ClearTestPartResults() {
- test_part_results_.clear();
-}
-
-// Adds a test part result to the list.
-void TestResult::AddTestPartResult(const TestPartResult& test_part_result) {
- test_part_results_.push_back(test_part_result);
-}
-
-// Adds a test property to the list. If a property with the same key as the
-// supplied property is already represented, the value of this test_property
-// replaces the old value for that key.
-void TestResult::RecordProperty(const TestProperty& test_property) {
- if (!ValidateTestProperty(test_property)) {
- return;
- }
- internal::MutexLock lock(&test_properites_mutex_);
- const std::vector<TestProperty>::iterator property_with_matching_key =
- std::find_if(test_properties_.begin(), test_properties_.end(),
- internal::TestPropertyKeyIs(test_property.key()));
- if (property_with_matching_key == test_properties_.end()) {
- test_properties_.push_back(test_property);
- return;
- }
- property_with_matching_key->SetValue(test_property.value());
-}
-
-// Adds a failure if the key is a reserved attribute of Google Test
-// testcase tags. Returns true if the property is valid.
-bool TestResult::ValidateTestProperty(const TestProperty& test_property) {
- internal::String key(test_property.key());
- if (key == "name" || key == "status" || key == "time" || key == "classname") {
- ADD_FAILURE()
- << "Reserved key used in RecordProperty(): "
- << key
- << " ('name', 'status', 'time', and 'classname' are reserved by "
- << GTEST_NAME_ << ")";
- return false;
- }
- return true;
-}
-
-// Clears the object.
-void TestResult::Clear() {
- test_part_results_.clear();
- test_properties_.clear();
- death_test_count_ = 0;
- elapsed_time_ = 0;
-}
-
-// Returns true iff the test failed.
-bool TestResult::Failed() const {
- for (int i = 0; i < total_part_count(); ++i) {
- if (GetTestPartResult(i).failed())
- return true;
- }
- return false;
-}
-
-// Returns true iff the test part fatally failed.
-static bool TestPartFatallyFailed(const TestPartResult& result) {
- return result.fatally_failed();
-}
-
-// Returns true iff the test fatally failed.
-bool TestResult::HasFatalFailure() const {
- return CountIf(test_part_results_, TestPartFatallyFailed) > 0;
-}
-
-// Returns true iff the test part non-fatally failed.
-static bool TestPartNonfatallyFailed(const TestPartResult& result) {
- return result.nonfatally_failed();
-}
-
-// Returns true iff the test has a non-fatal failure.
-bool TestResult::HasNonfatalFailure() const {
- return CountIf(test_part_results_, TestPartNonfatallyFailed) > 0;
-}
-
-// Gets the number of all test parts. This is the sum of the number
-// of successful test parts and the number of failed test parts.
-int TestResult::total_part_count() const {
- return static_cast<int>(test_part_results_.size());
-}
-
-// Returns the number of the test properties.
-int TestResult::test_property_count() const {
- return static_cast<int>(test_properties_.size());
-}
-
-// class Test
-
-// Creates a Test object.
-
-// The c'tor saves the values of all Google Test flags.
-Test::Test()
- : gtest_flag_saver_(new internal::GTestFlagSaver) {
-}
-
-// The d'tor restores the values of all Google Test flags.
-Test::~Test() {
- delete gtest_flag_saver_;
-}
-
-// Sets up the test fixture.
-//
-// A sub-class may override this.
-void Test::SetUp() {
-}
-
-// Tears down the test fixture.
-//
-// A sub-class may override this.
-void Test::TearDown() {
-}
-
-// Allows user supplied key value pairs to be recorded for later output.
-void Test::RecordProperty(const char* key, const char* value) {
- UnitTest::GetInstance()->RecordPropertyForCurrentTest(key, value);
-}
-
-// Allows user supplied key value pairs to be recorded for later output.
-void Test::RecordProperty(const char* key, int value) {
- Message value_message;
- value_message << value;
- RecordProperty(key, value_message.GetString().c_str());
-}
-
-namespace internal {
-
-void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
- const String& message) {
- // This function is a friend of UnitTest and as such has access to
- // AddTestPartResult.
- UnitTest::GetInstance()->AddTestPartResult(
- result_type,
- NULL, // No info about the source file where the exception occurred.
- -1, // We have no info on which line caused the exception.
- message,
- String()); // No stack trace, either.
-}
-
-} // namespace internal
-
-#if GTEST_OS_WINDOWS
-// We are on Windows.
-
-// Adds an "exception thrown" fatal failure to the current test.
-static void AddExceptionThrownFailure(DWORD exception_code,
- const char* location) {
- Message message;
- message << "Exception thrown with code 0x" << std::setbase(16) <<
- exception_code << std::setbase(10) << " in " << location << ".";
-
- internal::ReportFailureInUnknownLocation(TestPartResult::kFatalFailure,
- message.GetString());
-}
-
-#endif // GTEST_OS_WINDOWS
-
-// Google Test requires all tests in the same test case to use the same test
-// fixture class. This function checks if the current test has the
-// same fixture class as the first test in the current test case. If
-// yes, it returns true; otherwise it generates a Google Test failure and
-// returns false.
-bool Test::HasSameFixtureClass() {
- internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
- const TestCase* const test_case = impl->current_test_case();
-
- // Info about the first test in the current test case.
- const internal::TestInfoImpl* const first_test_info =
- test_case->test_info_list()[0]->impl();
- const internal::TypeId first_fixture_id = first_test_info->fixture_class_id();
- const char* const first_test_name = first_test_info->name();
-
- // Info about the current test.
- const internal::TestInfoImpl* const this_test_info =
- impl->current_test_info()->impl();
- const internal::TypeId this_fixture_id = this_test_info->fixture_class_id();
- const char* const this_test_name = this_test_info->name();
-
- if (this_fixture_id != first_fixture_id) {
- // Is the first test defined using TEST?
- const bool first_is_TEST = first_fixture_id == internal::GetTestTypeId();
- // Is this test defined using TEST?
- const bool this_is_TEST = this_fixture_id == internal::GetTestTypeId();
-
- if (first_is_TEST || this_is_TEST) {
- // The user mixed TEST and TEST_F in this test case - we'll tell
- // him/her how to fix it.
-
- // Gets the name of the TEST and the name of the TEST_F. Note
- // that first_is_TEST and this_is_TEST cannot both be true, as
- // the fixture IDs are different for the two tests.
- const char* const TEST_name =
- first_is_TEST ? first_test_name : this_test_name;
- const char* const TEST_F_name =
- first_is_TEST ? this_test_name : first_test_name;
-
- ADD_FAILURE()
- << "All tests in the same test case must use the same test fixture\n"
- << "class, so mixing TEST_F and TEST in the same test case is\n"
- << "illegal. In test case " << this_test_info->test_case_name()
- << ",\n"
- << "test " << TEST_F_name << " is defined using TEST_F but\n"
- << "test " << TEST_name << " is defined using TEST. You probably\n"
- << "want to change the TEST to TEST_F or move it to another test\n"
- << "case.";
- } else {
- // The user defined two fixture classes with the same name in
- // two namespaces - we'll tell him/her how to fix it.
- ADD_FAILURE()
- << "All tests in the same test case must use the same test fixture\n"
- << "class. However, in test case "
- << this_test_info->test_case_name() << ",\n"
- << "you defined test " << first_test_name
- << " and test " << this_test_name << "\n"
- << "using two different test fixture classes. This can happen if\n"
- << "the two classes are from different namespaces or translation\n"
- << "units and have the same name. You should probably rename one\n"
- << "of the classes to put the tests into different test cases.";
- }
- return false;
- }
-
- return true;
-}
-
-// Runs the test and updates the test result.
-void Test::Run() {
- if (!HasSameFixtureClass()) return;
-
- internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
-#if GTEST_HAS_SEH
- // Catch SEH-style exceptions.
- impl->os_stack_trace_getter()->UponLeavingGTest();
- __try {
- SetUp();
- } __except(internal::UnitTestOptions::GTestShouldProcessSEH(
- GetExceptionCode())) {
- AddExceptionThrownFailure(GetExceptionCode(), "SetUp()");
- }
-
- // We will run the test only if SetUp() had no fatal failure.
- if (!HasFatalFailure()) {
- impl->os_stack_trace_getter()->UponLeavingGTest();
- __try {
- TestBody();
- } __except(internal::UnitTestOptions::GTestShouldProcessSEH(
- GetExceptionCode())) {
- AddExceptionThrownFailure(GetExceptionCode(), "the test body");
- }
- }
-
- // However, we want to clean up as much as possible. Hence we will
- // always call TearDown(), even if SetUp() or the test body has
- // failed.
- impl->os_stack_trace_getter()->UponLeavingGTest();
- __try {
- TearDown();
- } __except(internal::UnitTestOptions::GTestShouldProcessSEH(
- GetExceptionCode())) {
- AddExceptionThrownFailure(GetExceptionCode(), "TearDown()");
- }
-
-#else // We are on a compiler or platform that doesn't support SEH.
- impl->os_stack_trace_getter()->UponLeavingGTest();
- SetUp();
-
- // We will run the test only if SetUp() was successful.
- if (!HasFatalFailure()) {
- impl->os_stack_trace_getter()->UponLeavingGTest();
- TestBody();
- }
-
- // However, we want to clean up as much as possible. Hence we will
- // always call TearDown(), even if SetUp() or the test body has
- // failed.
- impl->os_stack_trace_getter()->UponLeavingGTest();
- TearDown();
-#endif // GTEST_HAS_SEH
-}
-
-
-// Returns true iff the current test has a fatal failure.
-bool Test::HasFatalFailure() {
- return internal::GetUnitTestImpl()->current_test_result()->HasFatalFailure();
-}
-
-// Returns true iff the current test has a non-fatal failure.
-bool Test::HasNonfatalFailure() {
- return internal::GetUnitTestImpl()->current_test_result()->
- HasNonfatalFailure();
-}
-
-// class TestInfo
-
-// Constructs a TestInfo object. It assumes ownership of the test factory
-// object via impl_.
-TestInfo::TestInfo(const char* a_test_case_name,
- const char* a_name,
- const char* a_test_case_comment,
- const char* a_comment,
- internal::TypeId fixture_class_id,
- internal::TestFactoryBase* factory) {
- impl_ = new internal::TestInfoImpl(this, a_test_case_name, a_name,
- a_test_case_comment, a_comment,
- fixture_class_id, factory);
-}
-
-// Destructs a TestInfo object.
-TestInfo::~TestInfo() {
- delete impl_;
-}
-
-namespace internal {
-
-// Creates a new TestInfo object and registers it with Google Test;
-// returns the created object.
-//
-// Arguments:
-//
-// test_case_name: name of the test case
-// name: name of the test
-// test_case_comment: a comment on the test case that will be included in
-// the test output
-// comment: a comment on the test that will be included in the
-// test output
-// fixture_class_id: ID of the test fixture class
-// set_up_tc: pointer to the function that sets up the test case
-// tear_down_tc: pointer to the function that tears down the test case
-// factory: pointer to the factory that creates a test object.
-// The newly created TestInfo instance will assume
-// ownership of the factory object.
-TestInfo* MakeAndRegisterTestInfo(
- const char* test_case_name, const char* name,
- const char* test_case_comment, const char* comment,
- TypeId fixture_class_id,
- SetUpTestCaseFunc set_up_tc,
- TearDownTestCaseFunc tear_down_tc,
- TestFactoryBase* factory) {
- TestInfo* const test_info =
- new TestInfo(test_case_name, name, test_case_comment, comment,
- fixture_class_id, factory);
- GetUnitTestImpl()->AddTestInfo(set_up_tc, tear_down_tc, test_info);
- return test_info;
-}
-
-#if GTEST_HAS_PARAM_TEST
-void ReportInvalidTestCaseType(const char* test_case_name,
- const char* file, int line) {
- Message errors;
- errors
- << "Attempted redefinition of test case " << test_case_name << ".\n"
- << "All tests in the same test case must use the same test fixture\n"
- << "class. However, in test case " << test_case_name << ", you tried\n"
- << "to define a test using a fixture class different from the one\n"
- << "used earlier. This can happen if the two fixture classes are\n"
- << "from different namespaces and have the same name. You should\n"
- << "probably rename one of the classes to put the tests into different\n"
- << "test cases.";
-
- fprintf(stderr, "%s %s", FormatFileLocation(file, line).c_str(),
- errors.GetString().c_str());
-}
-#endif // GTEST_HAS_PARAM_TEST
-
-} // namespace internal
-
-// Returns the test case name.
-const char* TestInfo::test_case_name() const {
- return impl_->test_case_name();
-}
-
-// Returns the test name.
-const char* TestInfo::name() const {
- return impl_->name();
-}
-
-// Returns the test case comment.
-const char* TestInfo::test_case_comment() const {
- return impl_->test_case_comment();
-}
-
-// Returns the test comment.
-const char* TestInfo::comment() const {
- return impl_->comment();
-}
-
-// Returns true if this test should run.
-bool TestInfo::should_run() const { return impl_->should_run(); }
-
-// Returns true if this test matches the user-specified filter.
-bool TestInfo::matches_filter() const { return impl_->matches_filter(); }
-
-// Returns the result of the test.
-const TestResult* TestInfo::result() const { return impl_->result(); }
-
-// Increments the number of death tests encountered in this test so
-// far.
-int TestInfo::increment_death_test_count() {
- return impl_->result()->increment_death_test_count();
-}
-
-namespace {
-
-// A predicate that checks the test name of a TestInfo against a known
-// value.
-//
-// This is used for implementation of the TestCase class only. We put
-// it in the anonymous namespace to prevent polluting the outer
-// namespace.
-//
-// TestNameIs is copyable.
-class TestNameIs {
- public:
- // Constructor.
- //
- // TestNameIs has NO default constructor.
- explicit TestNameIs(const char* name)
- : name_(name) {}
-
- // Returns true iff the test name of test_info matches name_.
- bool operator()(const TestInfo * test_info) const {
- return test_info && internal::String(test_info->name()).Compare(name_) == 0;
- }
-
- private:
- internal::String name_;
-};
-
-} // namespace
-
-namespace internal {
-
-// This method expands all parameterized tests registered with macros TEST_P
-// and INSTANTIATE_TEST_CASE_P into regular tests and registers those.
-// This will be done just once during the program runtime.
-void UnitTestImpl::RegisterParameterizedTests() {
-#if GTEST_HAS_PARAM_TEST
- if (!parameterized_tests_registered_) {
- parameterized_test_registry_.RegisterTests();
- parameterized_tests_registered_ = true;
- }
-#endif
-}
-
-// Creates the test object, runs it, records its result, and then
-// deletes it.
-void TestInfoImpl::Run() {
- if (!should_run_) return;
-
- // Tells UnitTest where to store test result.
- UnitTestImpl* const impl = internal::GetUnitTestImpl();
- impl->set_current_test_info(parent_);
-
- TestEventListener* repeater = UnitTest::GetInstance()->listeners().repeater();
-
- // Notifies the unit test event listeners that a test is about to start.
- repeater->OnTestStart(*parent_);
-
- const TimeInMillis start = GetTimeInMillis();
-
- impl->os_stack_trace_getter()->UponLeavingGTest();
-#if GTEST_HAS_SEH
- // Catch SEH-style exceptions.
- Test* test = NULL;
-
- __try {
- // Creates the test object.
- test = factory_->CreateTest();
- } __except(internal::UnitTestOptions::GTestShouldProcessSEH(
- GetExceptionCode())) {
- AddExceptionThrownFailure(GetExceptionCode(),
- "the test fixture's constructor");
- return;
- }
-#else // We are on a compiler or platform that doesn't support SEH.
-
- // TODO(wan): If test->Run() throws, test won't be deleted. This is
- // not a problem now as we don't use exceptions. If we were to
- // enable exceptions, we should revise the following to be
- // exception-safe.
-
- // Creates the test object.
- Test* test = factory_->CreateTest();
-#endif // GTEST_HAS_SEH
-
- // Runs the test only if the constructor of the test fixture didn't
- // generate a fatal failure.
- if (!Test::HasFatalFailure()) {
- test->Run();
- }
-
- // Deletes the test object.
- impl->os_stack_trace_getter()->UponLeavingGTest();
- delete test;
- test = NULL;
-
- result_.set_elapsed_time(GetTimeInMillis() - start);
-
- // Notifies the unit test event listener that a test has just finished.
- repeater->OnTestEnd(*parent_);
-
- // Tells UnitTest to stop associating assertion results to this
- // test.
- impl->set_current_test_info(NULL);
-}
-
-} // namespace internal
-
-// class TestCase
-
-// Gets the number of successful tests in this test case.
-int TestCase::successful_test_count() const {
- return CountIf(test_info_list_, TestPassed);
-}
-
-// Gets the number of failed tests in this test case.
-int TestCase::failed_test_count() const {
- return CountIf(test_info_list_, TestFailed);
-}
-
-int TestCase::disabled_test_count() const {
- return CountIf(test_info_list_, TestDisabled);
-}
-
-// Get the number of tests in this test case that should run.
-int TestCase::test_to_run_count() const {
- return CountIf(test_info_list_, ShouldRunTest);
-}
-
-// Gets the number of all tests.
-int TestCase::total_test_count() const {
- return static_cast<int>(test_info_list_.size());
-}
-
-// Creates a TestCase with the given name.
-//
-// Arguments:
-//
-// name: name of the test case
-// set_up_tc: pointer to the function that sets up the test case
-// tear_down_tc: pointer to the function that tears down the test case
-TestCase::TestCase(const char* a_name, const char* a_comment,
- Test::SetUpTestCaseFunc set_up_tc,
- Test::TearDownTestCaseFunc tear_down_tc)
- : name_(a_name),
- comment_(a_comment),
- set_up_tc_(set_up_tc),
- tear_down_tc_(tear_down_tc),
- should_run_(false),
- elapsed_time_(0) {
-}
-
-// Destructor of TestCase.
-TestCase::~TestCase() {
- // Deletes every Test in the collection.
- ForEach(test_info_list_, internal::Delete<TestInfo>);
-}
-
-// Returns the i-th test among all the tests. i can range from 0 to
-// total_test_count() - 1. If i is not in that range, returns NULL.
-const TestInfo* TestCase::GetTestInfo(int i) const {
- const int index = GetElementOr(test_indices_, i, -1);
- return index < 0 ? NULL : test_info_list_[index];
-}
-
-// Returns the i-th test among all the tests. i can range from 0 to
-// total_test_count() - 1. If i is not in that range, returns NULL.
-TestInfo* TestCase::GetMutableTestInfo(int i) {
- const int index = GetElementOr(test_indices_, i, -1);
- return index < 0 ? NULL : test_info_list_[index];
-}
-
-// Adds a test to this test case. Will delete the test upon
-// destruction of the TestCase object.
-void TestCase::AddTestInfo(TestInfo * test_info) {
- test_info_list_.push_back(test_info);
- test_indices_.push_back(static_cast<int>(test_indices_.size()));
-}
-
-// Runs every test in this TestCase.
-void TestCase::Run() {
- if (!should_run_) return;
-
- internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
- impl->set_current_test_case(this);
-
- TestEventListener* repeater = UnitTest::GetInstance()->listeners().repeater();
-
- repeater->OnTestCaseStart(*this);
- impl->os_stack_trace_getter()->UponLeavingGTest();
- set_up_tc_();
-
- const internal::TimeInMillis start = internal::GetTimeInMillis();
- for (int i = 0; i < total_test_count(); i++) {
- GetMutableTestInfo(i)->impl()->Run();
- }
- elapsed_time_ = internal::GetTimeInMillis() - start;
-
- impl->os_stack_trace_getter()->UponLeavingGTest();
- tear_down_tc_();
- repeater->OnTestCaseEnd(*this);
- impl->set_current_test_case(NULL);
-}
-
-// Clears the results of all tests in this test case.
-void TestCase::ClearResult() {
- ForEach(test_info_list_, internal::TestInfoImpl::ClearTestResult);
-}
-
-// Returns true iff test passed.
-bool TestCase::TestPassed(const TestInfo * test_info) {
- const internal::TestInfoImpl* const impl = test_info->impl();
- return impl->should_run() && impl->result()->Passed();
-}
-
-// Returns true iff test failed.
-bool TestCase::TestFailed(const TestInfo * test_info) {
- const internal::TestInfoImpl* const impl = test_info->impl();
- return impl->should_run() && impl->result()->Failed();
-}
-
-// Returns true iff test is disabled.
-bool TestCase::TestDisabled(const TestInfo * test_info) {
- return test_info->impl()->is_disabled();
-}
-
-// Returns true if the given test should run.
-bool TestCase::ShouldRunTest(const TestInfo *test_info) {
- return test_info->impl()->should_run();
-}
-
-// Shuffles the tests in this test case.
-void TestCase::ShuffleTests(internal::Random* random) {
- Shuffle(random, &test_indices_);
-}
-
-// Restores the test order to before the first shuffle.
-void TestCase::UnshuffleTests() {
- for (size_t i = 0; i < test_indices_.size(); i++) {
- test_indices_[i] = static_cast<int>(i);
- }
-}
-
-// Formats a countable noun. Depending on its quantity, either the
-// singular form or the plural form is used. e.g.
-//
-// FormatCountableNoun(1, "formula", "formuli") returns "1 formula".
-// FormatCountableNoun(5, "book", "books") returns "5 books".
-static internal::String FormatCountableNoun(int count,
- const char * singular_form,
- const char * plural_form) {
- return internal::String::Format("%d %s", count,
- count == 1 ? singular_form : plural_form);
-}
-
-// Formats the count of tests.
-static internal::String FormatTestCount(int test_count) {
- return FormatCountableNoun(test_count, "test", "tests");
-}
-
-// Formats the count of test cases.
-static internal::String FormatTestCaseCount(int test_case_count) {
- return FormatCountableNoun(test_case_count, "test case", "test cases");
-}
-
-// Converts a TestPartResult::Type enum to human-friendly string
-// representation. Both kNonFatalFailure and kFatalFailure are translated
-// to "Failure", as the user usually doesn't care about the difference
-// between the two when viewing the test result.
-static const char * TestPartResultTypeToString(TestPartResult::Type type) {
- switch (type) {
- case TestPartResult::kSuccess:
- return "Success";
-
- case TestPartResult::kNonFatalFailure:
- case TestPartResult::kFatalFailure:
-#ifdef _MSC_VER
- return "error: ";
-#else
- return "Failure\n";
-#endif
- }
-
- return "Unknown result type";
-}
-
-// Prints a TestPartResult to a String.
-static internal::String PrintTestPartResultToString(
- const TestPartResult& test_part_result) {
- return (Message()
- << internal::FormatFileLocation(test_part_result.file_name(),
- test_part_result.line_number())
- << " " << TestPartResultTypeToString(test_part_result.type())
- << test_part_result.message()).GetString();
-}
-
-// Prints a TestPartResult.
-static void PrintTestPartResult(const TestPartResult& test_part_result) {
- const internal::String& result =
- PrintTestPartResultToString(test_part_result);
- printf("%s\n", result.c_str());
- fflush(stdout);
- // If the test program runs in Visual Studio or a debugger, the
- // following statements add the test part result message to the Output
- // window such that the user can double-click on it to jump to the
- // corresponding source code location; otherwise they do nothing.
-#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
- // We don't call OutputDebugString*() on Windows Mobile, as printing
- // to stdout is done by OutputDebugString() there already - we don't
- // want the same message printed twice.
- ::OutputDebugStringA(result.c_str());
- ::OutputDebugStringA("\n");
-#endif
-}
-
-// class PrettyUnitTestResultPrinter
-
-namespace internal {
-
-enum GTestColor {
- COLOR_DEFAULT,
- COLOR_RED,
- COLOR_GREEN,
- COLOR_YELLOW
-};
-
-#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
-
-// Returns the character attribute for the given color.
-WORD GetColorAttribute(GTestColor color) {
- switch (color) {
- case COLOR_RED: return FOREGROUND_RED;
- case COLOR_GREEN: return FOREGROUND_GREEN;
- case COLOR_YELLOW: return FOREGROUND_RED | FOREGROUND_GREEN;
- default: return 0;
- }
-}
-
-#else
-
-// Returns the ANSI color code for the given color. COLOR_DEFAULT is
-// an invalid input.
-const char* GetAnsiColorCode(GTestColor color) {
- switch (color) {
- case COLOR_RED: return "1";
- case COLOR_GREEN: return "2";
- case COLOR_YELLOW: return "3";
- default: return NULL;
- };
-}
-
-#endif // GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
-
-// Returns true iff Google Test should use colors in the output.
-bool ShouldUseColor(bool stdout_is_tty) {
- const char* const gtest_color = GTEST_FLAG(color).c_str();
-
- if (String::CaseInsensitiveCStringEquals(gtest_color, "auto")) {
-#if GTEST_OS_WINDOWS
- // On Windows the TERM variable is usually not set, but the
- // console there does support colors.
- return stdout_is_tty;
-#else
- // On non-Windows platforms, we rely on the TERM variable.
- const char* const term = posix::GetEnv("TERM");
- const bool term_supports_color =
- String::CStringEquals(term, "xterm") ||
- String::CStringEquals(term, "xterm-color") ||
- String::CStringEquals(term, "xterm-256color") ||
- String::CStringEquals(term, "linux") ||
- String::CStringEquals(term, "cygwin");
- return stdout_is_tty && term_supports_color;
-#endif // GTEST_OS_WINDOWS
- }
-
- return String::CaseInsensitiveCStringEquals(gtest_color, "yes") ||
- String::CaseInsensitiveCStringEquals(gtest_color, "true") ||
- String::CaseInsensitiveCStringEquals(gtest_color, "t") ||
- String::CStringEquals(gtest_color, "1");
- // We take "yes", "true", "t", and "1" as meaning "yes". If the
- // value is neither one of these nor "auto", we treat it as "no" to
- // be conservative.
-}
-
-// Helpers for printing colored strings to stdout. Note that on Windows, we
-// cannot simply emit special characters and have the terminal change colors.
-// This routine must actually emit the characters rather than return a string
-// that would be colored when printed, as can be done on Linux.
-void ColoredPrintf(GTestColor color, const char* fmt, ...) {
- va_list args;
- va_start(args, fmt);
-
-#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS
- const bool use_color = false;
-#else
- static const bool in_color_mode =
- ShouldUseColor(posix::IsATTY(posix::FileNo(stdout)) != 0);
- const bool use_color = in_color_mode && (color != COLOR_DEFAULT);
-#endif // GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS
- // The '!= 0' comparison is necessary to satisfy MSVC 7.1.
-
- if (!use_color) {
- vprintf(fmt, args);
- va_end(args);
- return;
- }
-
-#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
- const HANDLE stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE);
-
- // Gets the current text color.
- CONSOLE_SCREEN_BUFFER_INFO buffer_info;
- GetConsoleScreenBufferInfo(stdout_handle, &buffer_info);
- const WORD old_color_attrs = buffer_info.wAttributes;
-
- // We need to flush the stream buffers into the console before each
- // SetConsoleTextAttribute call lest it affect the text that is already
- // printed but has not yet reached the console.
- fflush(stdout);
- SetConsoleTextAttribute(stdout_handle,
- GetColorAttribute(color) | FOREGROUND_INTENSITY);
- vprintf(fmt, args);
-
- fflush(stdout);
- // Restores the text color.
- SetConsoleTextAttribute(stdout_handle, old_color_attrs);
-#else
- printf("\033[0;3%sm", GetAnsiColorCode(color));
- vprintf(fmt, args);
- printf("\033[m"); // Resets the terminal to default.
-#endif // GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
- va_end(args);
-}
-
-// This class implements the TestEventListener interface.
-//
-// Class PrettyUnitTestResultPrinter is copyable.
-class PrettyUnitTestResultPrinter : public TestEventListener {
- public:
- PrettyUnitTestResultPrinter() {}
- static void PrintTestName(const char * test_case, const char * test) {
- printf("%s.%s", test_case, test);
- }
-
- // The following methods override what's in the TestEventListener class.
- virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
- virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration);
- virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test);
- virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
- virtual void OnTestCaseStart(const TestCase& test_case);
- virtual void OnTestStart(const TestInfo& test_info);
- virtual void OnTestPartResult(const TestPartResult& result);
- virtual void OnTestEnd(const TestInfo& test_info);
- virtual void OnTestCaseEnd(const TestCase& test_case);
- virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test);
- virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
- virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
- virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
-
- private:
- static void PrintFailedTests(const UnitTest& unit_test);
-
- internal::String test_case_name_;
-};
-
- // Fired before each iteration of tests starts.
-void PrettyUnitTestResultPrinter::OnTestIterationStart(
- const UnitTest& unit_test, int iteration) {
- if (GTEST_FLAG(repeat) != 1)
- printf("\nRepeating all tests (iteration %d) . . .\n\n", iteration + 1);
-
- const char* const filter = GTEST_FLAG(filter).c_str();
-
- // Prints the filter if it's not *. This reminds the user that some
- // tests may be skipped.
- if (!internal::String::CStringEquals(filter, kUniversalFilter)) {
- ColoredPrintf(COLOR_YELLOW,
- "Note: %s filter = %s\n", GTEST_NAME_, filter);
- }
-
- if (internal::ShouldShard(kTestTotalShards, kTestShardIndex, false)) {
- ColoredPrintf(COLOR_YELLOW,
- "Note: This is test shard %s of %s.\n",
- internal::posix::GetEnv(kTestShardIndex),
- internal::posix::GetEnv(kTestTotalShards));
- }
-
- if (GTEST_FLAG(shuffle)) {
- ColoredPrintf(COLOR_YELLOW,
- "Note: Randomizing tests' orders with a seed of %d .\n",
- unit_test.random_seed());
- }
-
- ColoredPrintf(COLOR_GREEN, "[==========] ");
- printf("Running %s from %s.\n",
- FormatTestCount(unit_test.test_to_run_count()).c_str(),
- FormatTestCaseCount(unit_test.test_case_to_run_count()).c_str());
- fflush(stdout);
-}
-
-void PrettyUnitTestResultPrinter::OnEnvironmentsSetUpStart(
- const UnitTest& /*unit_test*/) {
- ColoredPrintf(COLOR_GREEN, "[----------] ");
- printf("Global test environment set-up.\n");
- fflush(stdout);
-}
-
-void PrettyUnitTestResultPrinter::OnTestCaseStart(const TestCase& test_case) {
- test_case_name_ = test_case.name();
- const internal::String counts =
- FormatCountableNoun(test_case.test_to_run_count(), "test", "tests");
- ColoredPrintf(COLOR_GREEN, "[----------] ");
- printf("%s from %s", counts.c_str(), test_case_name_.c_str());
- if (test_case.comment()[0] == '\0') {
- printf("\n");
- } else {
- printf(", where %s\n", test_case.comment());
- }
- fflush(stdout);
-}
-
-void PrettyUnitTestResultPrinter::OnTestStart(const TestInfo& test_info) {
- ColoredPrintf(COLOR_GREEN, "[ RUN ] ");
- PrintTestName(test_case_name_.c_str(), test_info.name());
- if (test_info.comment()[0] == '\0') {
- printf("\n");
- } else {
- printf(", where %s\n", test_info.comment());
- }
- fflush(stdout);
-}
-
-// Called after an assertion failure.
-void PrettyUnitTestResultPrinter::OnTestPartResult(
- const TestPartResult& result) {
- // If the test part succeeded, we don't need to do anything.
- if (result.type() == TestPartResult::kSuccess)
- return;
-
- // Print failure message from the assertion (e.g. expected this and got that).
- PrintTestPartResult(result);
- fflush(stdout);
-}
-
-void PrettyUnitTestResultPrinter::OnTestEnd(const TestInfo& test_info) {
- if (test_info.result()->Passed()) {
- ColoredPrintf(COLOR_GREEN, "[ OK ] ");
- } else {
- ColoredPrintf(COLOR_RED, "[ FAILED ] ");
- }
- PrintTestName(test_case_name_.c_str(), test_info.name());
- if (GTEST_FLAG(print_time)) {
- printf(" (%s ms)\n", internal::StreamableToString(
- test_info.result()->elapsed_time()).c_str());
- } else {
- printf("\n");
- }
- fflush(stdout);
-}
-
-void PrettyUnitTestResultPrinter::OnTestCaseEnd(const TestCase& test_case) {
- if (!GTEST_FLAG(print_time)) return;
-
- test_case_name_ = test_case.name();
- const internal::String counts =
- FormatCountableNoun(test_case.test_to_run_count(), "test", "tests");
- ColoredPrintf(COLOR_GREEN, "[----------] ");
- printf("%s from %s (%s ms total)\n\n",
- counts.c_str(), test_case_name_.c_str(),
- internal::StreamableToString(test_case.elapsed_time()).c_str());
- fflush(stdout);
-}
-
-void PrettyUnitTestResultPrinter::OnEnvironmentsTearDownStart(
- const UnitTest& /*unit_test*/) {
- ColoredPrintf(COLOR_GREEN, "[----------] ");
- printf("Global test environment tear-down\n");
- fflush(stdout);
-}
-
-// Internal helper for printing the list of failed tests.
-void PrettyUnitTestResultPrinter::PrintFailedTests(const UnitTest& unit_test) {
- const int failed_test_count = unit_test.failed_test_count();
- if (failed_test_count == 0) {
- return;
- }
-
- for (int i = 0; i < unit_test.total_test_case_count(); ++i) {
- const TestCase& test_case = *unit_test.GetTestCase(i);
- if (!test_case.should_run() || (test_case.failed_test_count() == 0)) {
- continue;
- }
- for (int j = 0; j < test_case.total_test_count(); ++j) {
- const TestInfo& test_info = *test_case.GetTestInfo(j);
- if (!test_info.should_run() || test_info.result()->Passed()) {
- continue;
- }
- ColoredPrintf(COLOR_RED, "[ FAILED ] ");
- printf("%s.%s", test_case.name(), test_info.name());
- if (test_case.comment()[0] != '\0' ||
- test_info.comment()[0] != '\0') {
- printf(", where %s", test_case.comment());
- if (test_case.comment()[0] != '\0' &&
- test_info.comment()[0] != '\0') {
- printf(" and ");
- }
- }
- printf("%s\n", test_info.comment());
- }
- }
-}
-
- void PrettyUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
- int /*iteration*/) {
- ColoredPrintf(COLOR_GREEN, "[==========] ");
- printf("%s from %s ran.",
- FormatTestCount(unit_test.test_to_run_count()).c_str(),
- FormatTestCaseCount(unit_test.test_case_to_run_count()).c_str());
- if (GTEST_FLAG(print_time)) {
- printf(" (%s ms total)",
- internal::StreamableToString(unit_test.elapsed_time()).c_str());
- }
- printf("\n");
- ColoredPrintf(COLOR_GREEN, "[ PASSED ] ");
- printf("%s.\n", FormatTestCount(unit_test.successful_test_count()).c_str());
-
- int num_failures = unit_test.failed_test_count();
- if (!unit_test.Passed()) {
- const int failed_test_count = unit_test.failed_test_count();
- ColoredPrintf(COLOR_RED, "[ FAILED ] ");
- printf("%s, listed below:\n", FormatTestCount(failed_test_count).c_str());
- PrintFailedTests(unit_test);
- printf("\n%2d FAILED %s\n", num_failures,
- num_failures == 1 ? "TEST" : "TESTS");
- }
-
- int num_disabled = unit_test.disabled_test_count();
- if (num_disabled && !GTEST_FLAG(also_run_disabled_tests)) {
- if (!num_failures) {
- printf("\n"); // Add a spacer if no FAILURE banner is displayed.
- }
- ColoredPrintf(COLOR_YELLOW,
- " YOU HAVE %d DISABLED %s\n\n",
- num_disabled,
- num_disabled == 1 ? "TEST" : "TESTS");
- }
- // Ensure that Google Test output is printed before, e.g., heapchecker output.
- fflush(stdout);
-}
-
-// End PrettyUnitTestResultPrinter
-
-// class TestEventRepeater
-//
-// This class forwards events to other event listeners.
-class TestEventRepeater : public TestEventListener {
- public:
- TestEventRepeater() : forwarding_enabled_(true) {}
- virtual ~TestEventRepeater();
- void Append(TestEventListener *listener);
- TestEventListener* Release(TestEventListener* listener);
-
- // Controls whether events will be forwarded to listeners_. Set to false
- // in death test child processes.
- bool forwarding_enabled() const { return forwarding_enabled_; }
- void set_forwarding_enabled(bool enable) { forwarding_enabled_ = enable; }
-
- virtual void OnTestProgramStart(const UnitTest& unit_test);
- virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration);
- virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test);
- virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test);
- virtual void OnTestCaseStart(const TestCase& test_case);
- virtual void OnTestStart(const TestInfo& test_info);
- virtual void OnTestPartResult(const TestPartResult& result);
- virtual void OnTestEnd(const TestInfo& test_info);
- virtual void OnTestCaseEnd(const TestCase& test_case);
- virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test);
- virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test);
- virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
- virtual void OnTestProgramEnd(const UnitTest& unit_test);
-
- private:
- // Controls whether events will be forwarded to listeners_. Set to false
- // in death test child processes.
- bool forwarding_enabled_;
- // The list of listeners that receive events.
- std::vector<TestEventListener*> listeners_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventRepeater);
-};
-
-TestEventRepeater::~TestEventRepeater() {
- ForEach(listeners_, Delete<TestEventListener>);
-}
-
-void TestEventRepeater::Append(TestEventListener *listener) {
- listeners_.push_back(listener);
-}
-
-// TODO(vladl@google.com): Factor the search functionality into Vector::Find.
-TestEventListener* TestEventRepeater::Release(TestEventListener *listener) {
- for (size_t i = 0; i < listeners_.size(); ++i) {
- if (listeners_[i] == listener) {
- listeners_.erase(listeners_.begin() + i);
- return listener;
- }
- }
-
- return NULL;
-}
-
-// Since most methods are very similar, use macros to reduce boilerplate.
-// This defines a member that forwards the call to all listeners.
-#define GTEST_REPEATER_METHOD_(Name, Type) \
-void TestEventRepeater::Name(const Type& parameter) { \
- if (forwarding_enabled_) { \
- for (size_t i = 0; i < listeners_.size(); i++) { \
- listeners_[i]->Name(parameter); \
- } \
- } \
-}
-// This defines a member that forwards the call to all listeners in reverse
-// order.
-#define GTEST_REVERSE_REPEATER_METHOD_(Name, Type) \
-void TestEventRepeater::Name(const Type& parameter) { \
- if (forwarding_enabled_) { \
- for (int i = static_cast<int>(listeners_.size()) - 1; i >= 0; i--) { \
- listeners_[i]->Name(parameter); \
- } \
- } \
-}
-
-GTEST_REPEATER_METHOD_(OnTestProgramStart, UnitTest)
-GTEST_REPEATER_METHOD_(OnEnvironmentsSetUpStart, UnitTest)
-GTEST_REPEATER_METHOD_(OnTestCaseStart, TestCase)
-GTEST_REPEATER_METHOD_(OnTestStart, TestInfo)
-GTEST_REPEATER_METHOD_(OnTestPartResult, TestPartResult)
-GTEST_REPEATER_METHOD_(OnEnvironmentsTearDownStart, UnitTest)
-GTEST_REVERSE_REPEATER_METHOD_(OnEnvironmentsSetUpEnd, UnitTest)
-GTEST_REVERSE_REPEATER_METHOD_(OnEnvironmentsTearDownEnd, UnitTest)
-GTEST_REVERSE_REPEATER_METHOD_(OnTestEnd, TestInfo)
-GTEST_REVERSE_REPEATER_METHOD_(OnTestCaseEnd, TestCase)
-GTEST_REVERSE_REPEATER_METHOD_(OnTestProgramEnd, UnitTest)
-
-#undef GTEST_REPEATER_METHOD_
-#undef GTEST_REVERSE_REPEATER_METHOD_
-
-void TestEventRepeater::OnTestIterationStart(const UnitTest& unit_test,
- int iteration) {
- if (forwarding_enabled_) {
- for (size_t i = 0; i < listeners_.size(); i++) {
- listeners_[i]->OnTestIterationStart(unit_test, iteration);
- }
- }
-}
-
-void TestEventRepeater::OnTestIterationEnd(const UnitTest& unit_test,
- int iteration) {
- if (forwarding_enabled_) {
- for (int i = static_cast<int>(listeners_.size()) - 1; i >= 0; i--) {
- listeners_[i]->OnTestIterationEnd(unit_test, iteration);
- }
- }
-}
-
-// End TestEventRepeater
-
-// This class generates an XML output file.
-class XmlUnitTestResultPrinter : public EmptyTestEventListener {
- public:
- explicit XmlUnitTestResultPrinter(const char* output_file);
-
- virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
-
- private:
- // Is c a whitespace character that is normalized to a space character
- // when it appears in an XML attribute value?
- static bool IsNormalizableWhitespace(char c) {
- return c == 0x9 || c == 0xA || c == 0xD;
- }
-
- // May c appear in a well-formed XML document?
- static bool IsValidXmlCharacter(char c) {
- return IsNormalizableWhitespace(c) || c >= 0x20;
- }
-
- // Returns an XML-escaped copy of the input string str. If
- // is_attribute is true, the text is meant to appear as an attribute
- // value, and normalizable whitespace is preserved by replacing it
- // with character references.
- static String EscapeXml(const char* str, bool is_attribute);
-
- // Returns the given string with all characters invalid in XML removed.
- static String RemoveInvalidXmlCharacters(const char* str);
-
- // Convenience wrapper around EscapeXml when str is an attribute value.
- static String EscapeXmlAttribute(const char* str) {
- return EscapeXml(str, true);
- }
-
- // Convenience wrapper around EscapeXml when str is not an attribute value.
- static String EscapeXmlText(const char* str) { return EscapeXml(str, false); }
-
- // Streams an XML CDATA section, escaping invalid CDATA sequences as needed.
- static void OutputXmlCDataSection(::std::ostream* stream, const char* data);
-
- // Streams an XML representation of a TestInfo object.
- static void OutputXmlTestInfo(::std::ostream* stream,
- const char* test_case_name,
- const TestInfo& test_info);
-
- // Prints an XML representation of a TestCase object
- static void PrintXmlTestCase(FILE* out, const TestCase& test_case);
-
- // Prints an XML summary of unit_test to output stream out.
- static void PrintXmlUnitTest(FILE* out, const UnitTest& unit_test);
-
- // Produces a string representing the test properties in a result as space
- // delimited XML attributes based on the property key="value" pairs.
- // When the String is not empty, it includes a space at the beginning,
- // to delimit this attribute from prior attributes.
- static String TestPropertiesAsXmlAttributes(const TestResult& result);
-
- // The output file.
- const String output_file_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(XmlUnitTestResultPrinter);
-};
-
-// Creates a new XmlUnitTestResultPrinter.
-XmlUnitTestResultPrinter::XmlUnitTestResultPrinter(const char* output_file)
- : output_file_(output_file) {
- if (output_file_.c_str() == NULL || output_file_.empty()) {
- fprintf(stderr, "XML output file may not be null\n");
- fflush(stderr);
- exit(EXIT_FAILURE);
- }
-}
-
-// Called after the unit test ends.
-void XmlUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
- int /*iteration*/) {
- FILE* xmlout = NULL;
- FilePath output_file(output_file_);
- FilePath output_dir(output_file.RemoveFileName());
-
- if (output_dir.CreateDirectoriesRecursively()) {
- xmlout = posix::FOpen(output_file_.c_str(), "w");
- }
- if (xmlout == NULL) {
- // TODO(wan): report the reason of the failure.
- //
- // We don't do it for now as:
- //
- // 1. There is no urgent need for it.
- // 2. It's a bit involved to make the errno variable thread-safe on
- // all three operating systems (Linux, Windows, and Mac OS).
- // 3. To interpret the meaning of errno in a thread-safe way,
- // we need the strerror_r() function, which is not available on
- // Windows.
- fprintf(stderr,
- "Unable to open file \"%s\"\n",
- output_file_.c_str());
- fflush(stderr);
- exit(EXIT_FAILURE);
- }
- PrintXmlUnitTest(xmlout, unit_test);
- fclose(xmlout);
-}
-
-// Returns an XML-escaped copy of the input string str. If is_attribute
-// is true, the text is meant to appear as an attribute value, and
-// normalizable whitespace is preserved by replacing it with character
-// references.
-//
-// Invalid XML characters in str, if any, are stripped from the output.
-// It is expected that most, if not all, of the text processed by this
-// module will consist of ordinary English text.
-// If this module is ever modified to produce version 1.1 XML output,
-// most invalid characters can be retained using character references.
-// TODO(wan): It might be nice to have a minimally invasive, human-readable
-// escaping scheme for invalid characters, rather than dropping them.
-String XmlUnitTestResultPrinter::EscapeXml(const char* str, bool is_attribute) {
- Message m;
-
- if (str != NULL) {
- for (const char* src = str; *src; ++src) {
- switch (*src) {
- case '<':
- m << "&lt;";
- break;
- case '>':
- m << "&gt;";
- break;
- case '&':
- m << "&amp;";
- break;
- case '\'':
- if (is_attribute)
- m << "&apos;";
- else
- m << '\'';
- break;
- case '"':
- if (is_attribute)
- m << "&quot;";
- else
- m << '"';
- break;
- default:
- if (IsValidXmlCharacter(*src)) {
- if (is_attribute && IsNormalizableWhitespace(*src))
- m << String::Format("&#x%02X;", unsigned(*src));
- else
- m << *src;
- }
- break;
- }
- }
- }
-
- return m.GetString();
-}
-
-// Returns the given string with all characters invalid in XML removed.
-// Currently invalid characters are dropped from the string. An
-// alternative is to replace them with certain characters such as . or ?.
-String XmlUnitTestResultPrinter::RemoveInvalidXmlCharacters(const char* str) {
- char* const output = new char[strlen(str) + 1];
- char* appender = output;
- for (char ch = *str; ch != '\0'; ch = *++str)
- if (IsValidXmlCharacter(ch))
- *appender++ = ch;
- *appender = '\0';
-
- String ret_value(output);
- delete[] output;
- return ret_value;
-}
-
-// The following routines generate an XML representation of a UnitTest
-// object.
-//
-// This is how Google Test concepts map to the DTD:
-//
-// <testsuites name="AllTests"> <-- corresponds to a UnitTest object
-// <testsuite name="testcase-name"> <-- corresponds to a TestCase object
-// <testcase name="test-name"> <-- corresponds to a TestInfo object
-// <failure message="...">...</failure>
-// <failure message="...">...</failure>
-// <failure message="...">...</failure>
-// <-- individual assertion failures
-// </testcase>
-// </testsuite>
-// </testsuites>
-
-// Formats the given time in milliseconds as seconds.
-std::string FormatTimeInMillisAsSeconds(TimeInMillis ms) {
- ::std::stringstream ss;
- ss << ms/1000.0;
- return ss.str();
-}
-
-// Streams an XML CDATA section, escaping invalid CDATA sequences as needed.
-void XmlUnitTestResultPrinter::OutputXmlCDataSection(::std::ostream* stream,
- const char* data) {
- const char* segment = data;
- *stream << "<![CDATA[";
- for (;;) {
- const char* const next_segment = strstr(segment, "]]>");
- if (next_segment != NULL) {
- stream->write(
- segment, static_cast<std::streamsize>(next_segment - segment));
- *stream << "]]>]]&gt;<![CDATA[";
- segment = next_segment + strlen("]]>");
- } else {
- *stream << segment;
- break;
- }
- }
- *stream << "]]>";
-}
-
-// Prints an XML representation of a TestInfo object.
-// TODO(wan): There is also value in printing properties with the plain printer.
-void XmlUnitTestResultPrinter::OutputXmlTestInfo(::std::ostream* stream,
- const char* test_case_name,
- const TestInfo& test_info) {
- const TestResult& result = *test_info.result();
- *stream << " <testcase name=\""
- << EscapeXmlAttribute(test_info.name()).c_str()
- << "\" status=\""
- << (test_info.should_run() ? "run" : "notrun")
- << "\" time=\""
- << FormatTimeInMillisAsSeconds(result.elapsed_time())
- << "\" classname=\"" << EscapeXmlAttribute(test_case_name).c_str()
- << "\"" << TestPropertiesAsXmlAttributes(result).c_str();
-
- int failures = 0;
- for (int i = 0; i < result.total_part_count(); ++i) {
- const TestPartResult& part = result.GetTestPartResult(i);
- if (part.failed()) {
- if (++failures == 1)
- *stream << ">\n";
- *stream << " <failure message=\""
- << EscapeXmlAttribute(part.summary()).c_str()
- << "\" type=\"\">";
- const String message = RemoveInvalidXmlCharacters(String::Format(
- "%s:%d\n%s",
- part.file_name(), part.line_number(),
- part.message()).c_str());
- OutputXmlCDataSection(stream, message.c_str());
- *stream << "</failure>\n";
- }
- }
-
- if (failures == 0)
- *stream << " />\n";
- else
- *stream << " </testcase>\n";
-}
-
-// Prints an XML representation of a TestCase object
-void XmlUnitTestResultPrinter::PrintXmlTestCase(FILE* out,
- const TestCase& test_case) {
- fprintf(out,
- " <testsuite name=\"%s\" tests=\"%d\" failures=\"%d\" "
- "disabled=\"%d\" ",
- EscapeXmlAttribute(test_case.name()).c_str(),
- test_case.total_test_count(),
- test_case.failed_test_count(),
- test_case.disabled_test_count());
- fprintf(out,
- "errors=\"0\" time=\"%s\">\n",
- FormatTimeInMillisAsSeconds(test_case.elapsed_time()).c_str());
- for (int i = 0; i < test_case.total_test_count(); ++i) {
- StrStream stream;
- OutputXmlTestInfo(&stream, test_case.name(), *test_case.GetTestInfo(i));
- fprintf(out, "%s", StrStreamToString(&stream).c_str());
- }
- fprintf(out, " </testsuite>\n");
-}
-
-// Prints an XML summary of unit_test to output stream out.
-void XmlUnitTestResultPrinter::PrintXmlUnitTest(FILE* out,
- const UnitTest& unit_test) {
- fprintf(out, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
- fprintf(out,
- "<testsuites tests=\"%d\" failures=\"%d\" disabled=\"%d\" "
- "errors=\"0\" time=\"%s\" ",
- unit_test.total_test_count(),
- unit_test.failed_test_count(),
- unit_test.disabled_test_count(),
- FormatTimeInMillisAsSeconds(unit_test.elapsed_time()).c_str());
- if (GTEST_FLAG(shuffle)) {
- fprintf(out, "random_seed=\"%d\" ", unit_test.random_seed());
- }
- fprintf(out, "name=\"AllTests\">\n");
- for (int i = 0; i < unit_test.total_test_case_count(); ++i)
- PrintXmlTestCase(out, *unit_test.GetTestCase(i));
- fprintf(out, "</testsuites>\n");
-}
-
-// Produces a string representing the test properties in a result as space
-// delimited XML attributes based on the property key="value" pairs.
-String XmlUnitTestResultPrinter::TestPropertiesAsXmlAttributes(
- const TestResult& result) {
- Message attributes;
- for (int i = 0; i < result.test_property_count(); ++i) {
- const TestProperty& property = result.GetTestProperty(i);
- attributes << " " << property.key() << "="
- << "\"" << EscapeXmlAttribute(property.value()) << "\"";
- }
- return attributes.GetString();
-}
-
-// End XmlUnitTestResultPrinter
-
-// Class ScopedTrace
-
-// Pushes the given source file location and message onto a per-thread
-// trace stack maintained by Google Test.
-// L < UnitTest::mutex_
-ScopedTrace::ScopedTrace(const char* file, int line, const Message& message) {
- TraceInfo trace;
- trace.file = file;
- trace.line = line;
- trace.message = message.GetString();
-
- UnitTest::GetInstance()->PushGTestTrace(trace);
-}
-
-// Pops the info pushed by the c'tor.
-// L < UnitTest::mutex_
-ScopedTrace::~ScopedTrace() {
- UnitTest::GetInstance()->PopGTestTrace();
-}
-
-
-// class OsStackTraceGetter
-
-// Returns the current OS stack trace as a String. Parameters:
-//
-// max_depth - the maximum number of stack frames to be included
-// in the trace.
-// skip_count - the number of top frames to be skipped; doesn't count
-// against max_depth.
-//
-// L < mutex_
-// We use "L < mutex_" to denote that the function may acquire mutex_.
-String OsStackTraceGetter::CurrentStackTrace(int, int) {
- return String("");
-}
-
-// L < mutex_
-void OsStackTraceGetter::UponLeavingGTest() {
-}
-
-const char* const
-OsStackTraceGetter::kElidedFramesMarker =
- "... " GTEST_NAME_ " internal frames ...";
-
-} // namespace internal
-
-// class TestEventListeners
-
-TestEventListeners::TestEventListeners()
- : repeater_(new internal::TestEventRepeater()),
- default_result_printer_(NULL),
- default_xml_generator_(NULL) {
-}
-
-TestEventListeners::~TestEventListeners() { delete repeater_; }
-
-// Returns the standard listener responsible for the default console
-// output. Can be removed from the listeners list to shut down default
-// console output. Note that removing this object from the listener list
-// with Release transfers its ownership to the user.
-void TestEventListeners::Append(TestEventListener* listener) {
- repeater_->Append(listener);
-}
-
-// Removes the given event listener from the list and returns it. It then
-// becomes the caller's responsibility to delete the listener. Returns
-// NULL if the listener is not found in the list.
-TestEventListener* TestEventListeners::Release(TestEventListener* listener) {
- if (listener == default_result_printer_)
- default_result_printer_ = NULL;
- else if (listener == default_xml_generator_)
- default_xml_generator_ = NULL;
- return repeater_->Release(listener);
-}
-
-// Returns repeater that broadcasts the TestEventListener events to all
-// subscribers.
-TestEventListener* TestEventListeners::repeater() { return repeater_; }
-
-// Sets the default_result_printer attribute to the provided listener.
-// The listener is also added to the listener list and previous
-// default_result_printer is removed from it and deleted. The listener can
-// also be NULL in which case it will not be added to the list. Does
-// nothing if the previous and the current listener objects are the same.
-void TestEventListeners::SetDefaultResultPrinter(TestEventListener* listener) {
- if (default_result_printer_ != listener) {
- // It is an error to pass this method a listener that is already in the
- // list.
- delete Release(default_result_printer_);
- default_result_printer_ = listener;
- if (listener != NULL)
- Append(listener);
- }
-}
-
-// Sets the default_xml_generator attribute to the provided listener. The
-// listener is also added to the listener list and previous
-// default_xml_generator is removed from it and deleted. The listener can
-// also be NULL in which case it will not be added to the list. Does
-// nothing if the previous and the current listener objects are the same.
-void TestEventListeners::SetDefaultXmlGenerator(TestEventListener* listener) {
- if (default_xml_generator_ != listener) {
- // It is an error to pass this method a listener that is already in the
- // list.
- delete Release(default_xml_generator_);
- default_xml_generator_ = listener;
- if (listener != NULL)
- Append(listener);
- }
-}
-
-// Controls whether events will be forwarded by the repeater to the
-// listeners in the list.
-bool TestEventListeners::EventForwardingEnabled() const {
- return repeater_->forwarding_enabled();
-}
-
-void TestEventListeners::SuppressEventForwarding() {
- repeater_->set_forwarding_enabled(false);
-}
-
-// class UnitTest
-
-// Gets the singleton UnitTest object. The first time this method is
-// called, a UnitTest object is constructed and returned. Consecutive
-// calls will return the same object.
-//
-// We don't protect this under mutex_ as a user is not supposed to
-// call this before main() starts, from which point on the return
-// value will never change.
-UnitTest * UnitTest::GetInstance() {
- // When compiled with MSVC 7.1 in optimized mode, destroying the
- // UnitTest object upon exiting the program messes up the exit code,
- // causing successful tests to appear failed. We have to use a
- // different implementation in this case to bypass the compiler bug.
- // This implementation makes the compiler happy, at the cost of
- // leaking the UnitTest object.
-
- // CodeGear C++Builder insists on a public destructor for the
- // default implementation. Use this implementation to keep good OO
- // design with private destructor.
-
-#if (_MSC_VER == 1310 && !defined(_DEBUG)) || defined(__BORLANDC__)
- static UnitTest* const instance = new UnitTest;
- return instance;
-#else
- static UnitTest instance;
- return &instance;
-#endif // (_MSC_VER == 1310 && !defined(_DEBUG)) || defined(__BORLANDC__)
-}
-
-// Gets the number of successful test cases.
-int UnitTest::successful_test_case_count() const {
- return impl()->successful_test_case_count();
-}
-
-// Gets the number of failed test cases.
-int UnitTest::failed_test_case_count() const {
- return impl()->failed_test_case_count();
-}
-
-// Gets the number of all test cases.
-int UnitTest::total_test_case_count() const {
- return impl()->total_test_case_count();
-}
-
-// Gets the number of all test cases that contain at least one test
-// that should run.
-int UnitTest::test_case_to_run_count() const {
- return impl()->test_case_to_run_count();
-}
-
-// Gets the number of successful tests.
-int UnitTest::successful_test_count() const {
- return impl()->successful_test_count();
-}
-
-// Gets the number of failed tests.
-int UnitTest::failed_test_count() const { return impl()->failed_test_count(); }
-
-// Gets the number of disabled tests.
-int UnitTest::disabled_test_count() const {
- return impl()->disabled_test_count();
-}
-
-// Gets the number of all tests.
-int UnitTest::total_test_count() const { return impl()->total_test_count(); }
-
-// Gets the number of tests that should run.
-int UnitTest::test_to_run_count() const { return impl()->test_to_run_count(); }
-
-// Gets the elapsed time, in milliseconds.
-internal::TimeInMillis UnitTest::elapsed_time() const {
- return impl()->elapsed_time();
-}
-
-// Returns true iff the unit test passed (i.e. all test cases passed).
-bool UnitTest::Passed() const { return impl()->Passed(); }
-
-// Returns true iff the unit test failed (i.e. some test case failed
-// or something outside of all tests failed).
-bool UnitTest::Failed() const { return impl()->Failed(); }
-
-// Gets the i-th test case among all the test cases. i can range from 0 to
-// total_test_case_count() - 1. If i is not in that range, returns NULL.
-const TestCase* UnitTest::GetTestCase(int i) const {
- return impl()->GetTestCase(i);
-}
-
-// Gets the i-th test case among all the test cases. i can range from 0 to
-// total_test_case_count() - 1. If i is not in that range, returns NULL.
-TestCase* UnitTest::GetMutableTestCase(int i) {
- return impl()->GetMutableTestCase(i);
-}
-
-// Returns the list of event listeners that can be used to track events
-// inside Google Test.
-TestEventListeners& UnitTest::listeners() {
- return *impl()->listeners();
-}
-
-// Registers and returns a global test environment. When a test
-// program is run, all global test environments will be set-up in the
-// order they were registered. After all tests in the program have
-// finished, all global test environments will be torn-down in the
-// *reverse* order they were registered.
-//
-// The UnitTest object takes ownership of the given environment.
-//
-// We don't protect this under mutex_, as we only support calling it
-// from the main thread.
-Environment* UnitTest::AddEnvironment(Environment* env) {
- if (env == NULL) {
- return NULL;
- }
-
- impl_->environments().push_back(env);
- return env;
-}
-
-#if GTEST_HAS_EXCEPTIONS
-// A failed Google Test assertion will throw an exception of this type
-// when exceptions are enabled. We derive it from std::runtime_error,
-// which is for errors presumably detectable only at run time. Since
-// std::runtime_error inherits from std::exception, many testing
-// frameworks know how to extract and print the message inside it.
-class GoogleTestFailureException : public ::std::runtime_error {
- public:
- explicit GoogleTestFailureException(const TestPartResult& failure)
- : ::std::runtime_error(PrintTestPartResultToString(failure).c_str()) {}
-};
-#endif
-
-// Adds a TestPartResult to the current TestResult object. All Google Test
-// assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call
-// this to report their results. The user code should use the
-// assertion macros instead of calling this directly.
-// L < mutex_
-void UnitTest::AddTestPartResult(TestPartResult::Type result_type,
- const char* file_name,
- int line_number,
- const internal::String& message,
- const internal::String& os_stack_trace) {
- Message msg;
- msg << message;
-
- internal::MutexLock lock(&mutex_);
- if (impl_->gtest_trace_stack().size() > 0) {
- msg << "\n" << GTEST_NAME_ << " trace:";
-
- for (int i = static_cast<int>(impl_->gtest_trace_stack().size());
- i > 0; --i) {
- const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];
- msg << "\n" << internal::FormatFileLocation(trace.file, trace.line)
- << " " << trace.message;
- }
- }
-
- if (os_stack_trace.c_str() != NULL && !os_stack_trace.empty()) {
- msg << internal::kStackTraceMarker << os_stack_trace;
- }
-
- const TestPartResult result =
- TestPartResult(result_type, file_name, line_number,
- msg.GetString().c_str());
- impl_->GetTestPartResultReporterForCurrentThread()->
- ReportTestPartResult(result);
-
- if (result_type != TestPartResult::kSuccess) {
- // gtest_break_on_failure takes precedence over
- // gtest_throw_on_failure. This allows a user to set the latter
- // in the code (perhaps in order to use Google Test assertions
- // with another testing framework) and specify the former on the
- // command line for debugging.
- if (GTEST_FLAG(break_on_failure)) {
-#if GTEST_OS_WINDOWS
- // Using DebugBreak on Windows allows gtest to still break into a debugger
- // when a failure happens and both the --gtest_break_on_failure and
- // the --gtest_catch_exceptions flags are specified.
- DebugBreak();
-#else
- abort();
-#endif // GTEST_OS_WINDOWS
- } else if (GTEST_FLAG(throw_on_failure)) {
-#if GTEST_HAS_EXCEPTIONS
- throw GoogleTestFailureException(result);
-#else
- // We cannot call abort() as it generates a pop-up in debug mode
- // that cannot be suppressed in VC 7.1 or below.
- exit(1);
-#endif
- }
- }
-}
-
-// Creates and adds a property to the current TestResult. If a property matching
-// the supplied value already exists, updates its value instead.
-void UnitTest::RecordPropertyForCurrentTest(const char* key,
- const char* value) {
- const TestProperty test_property(key, value);
- impl_->current_test_result()->RecordProperty(test_property);
-}
-
-// Runs all tests in this UnitTest object and prints the result.
-// Returns 0 if successful, or 1 otherwise.
-//
-// We don't protect this under mutex_, as we only support calling it
-// from the main thread.
-int UnitTest::Run() {
-#if GTEST_HAS_SEH
- // Catch SEH-style exceptions.
-
- const bool in_death_test_child_process =
- internal::GTEST_FLAG(internal_run_death_test).length() > 0;
-
- // Either the user wants Google Test to catch exceptions thrown by the
- // tests or this is executing in the context of death test child
- // process. In either case the user does not want to see pop-up dialogs
- // about crashes - they are expected..
- if (GTEST_FLAG(catch_exceptions) || in_death_test_child_process) {
-#if !GTEST_OS_WINDOWS_MOBILE
- // SetErrorMode doesn't exist on CE.
- SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOALIGNMENTFAULTEXCEPT |
- SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX);
-#endif // !GTEST_OS_WINDOWS_MOBILE
-
-#if (defined(_MSC_VER) || GTEST_OS_WINDOWS_MINGW) && !GTEST_OS_WINDOWS_MOBILE
- // Death test children can be terminated with _abort(). On Windows,
- // _abort() can show a dialog with a warning message. This forces the
- // abort message to go to stderr instead.
- _set_error_mode(_OUT_TO_STDERR);
-#endif
-
-#if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE
- // In the debug version, Visual Studio pops up a separate dialog
- // offering a choice to debug the aborted program. We need to suppress
- // this dialog or it will pop up for every EXPECT/ASSERT_DEATH statement
- // executed. Google Test will notify the user of any unexpected
- // failure via stderr.
- //
- // VC++ doesn't define _set_abort_behavior() prior to the version 8.0.
- // Users of prior VC versions shall suffer the agony and pain of
- // clicking through the countless debug dialogs.
- // TODO(vladl@google.com): find a way to suppress the abort dialog() in the
- // debug mode when compiled with VC 7.1 or lower.
- if (!GTEST_FLAG(break_on_failure))
- _set_abort_behavior(
- 0x0, // Clear the following flags:
- _WRITE_ABORT_MSG | _CALL_REPORTFAULT); // pop-up window, core dump.
-#endif
- }
-
- __try {
- return impl_->RunAllTests();
- } __except(internal::UnitTestOptions::GTestShouldProcessSEH(
- GetExceptionCode())) {
- printf("Exception thrown with code 0x%x.\nFAIL\n", GetExceptionCode());
- fflush(stdout);
- return 1;
- }
-
-#else // We are on a compiler or platform that doesn't support SEH.
-
- return impl_->RunAllTests();
-#endif // GTEST_HAS_SEH
-}
-
-// Returns the working directory when the first TEST() or TEST_F() was
-// executed.
-const char* UnitTest::original_working_dir() const {
- return impl_->original_working_dir_.c_str();
-}
-
-// Returns the TestCase object for the test that's currently running,
-// or NULL if no test is running.
-// L < mutex_
-const TestCase* UnitTest::current_test_case() const {
- internal::MutexLock lock(&mutex_);
- return impl_->current_test_case();
-}
-
-// Returns the TestInfo object for the test that's currently running,
-// or NULL if no test is running.
-// L < mutex_
-const TestInfo* UnitTest::current_test_info() const {
- internal::MutexLock lock(&mutex_);
- return impl_->current_test_info();
-}
-
-// Returns the random seed used at the start of the current test run.
-int UnitTest::random_seed() const { return impl_->random_seed(); }
-
-#if GTEST_HAS_PARAM_TEST
-// Returns ParameterizedTestCaseRegistry object used to keep track of
-// value-parameterized tests and instantiate and register them.
-// L < mutex_
-internal::ParameterizedTestCaseRegistry&
- UnitTest::parameterized_test_registry() {
- return impl_->parameterized_test_registry();
-}
-#endif // GTEST_HAS_PARAM_TEST
-
-// Creates an empty UnitTest.
-UnitTest::UnitTest() {
- impl_ = new internal::UnitTestImpl(this);
-}
-
-// Destructor of UnitTest.
-UnitTest::~UnitTest() {
- delete impl_;
-}
-
-// Pushes a trace defined by SCOPED_TRACE() on to the per-thread
-// Google Test trace stack.
-// L < mutex_
-void UnitTest::PushGTestTrace(const internal::TraceInfo& trace) {
- internal::MutexLock lock(&mutex_);
- impl_->gtest_trace_stack().push_back(trace);
-}
-
-// Pops a trace from the per-thread Google Test trace stack.
-// L < mutex_
-void UnitTest::PopGTestTrace() {
- internal::MutexLock lock(&mutex_);
- impl_->gtest_trace_stack().pop_back();
-}
-
-namespace internal {
-
-UnitTestImpl::UnitTestImpl(UnitTest* parent)
- : parent_(parent),
-#ifdef _MSC_VER
-#pragma warning(push) // Saves the current warning state.
-#pragma warning(disable:4355) // Temporarily disables warning 4355
- // (using this in initializer).
- default_global_test_part_result_reporter_(this),
- default_per_thread_test_part_result_reporter_(this),
-#pragma warning(pop) // Restores the warning state again.
-#else
- default_global_test_part_result_reporter_(this),
- default_per_thread_test_part_result_reporter_(this),
-#endif // _MSC_VER
- global_test_part_result_repoter_(
- &default_global_test_part_result_reporter_),
- per_thread_test_part_result_reporter_(
- &default_per_thread_test_part_result_reporter_),
-#if GTEST_HAS_PARAM_TEST
- parameterized_test_registry_(),
- parameterized_tests_registered_(false),
-#endif // GTEST_HAS_PARAM_TEST
- last_death_test_case_(-1),
- current_test_case_(NULL),
- current_test_info_(NULL),
- ad_hoc_test_result_(),
- os_stack_trace_getter_(NULL),
- post_flag_parse_init_performed_(false),
- random_seed_(0), // Will be overridden by the flag before first use.
- random_(0), // Will be reseeded before first use.
-#if GTEST_HAS_DEATH_TEST
- elapsed_time_(0),
- internal_run_death_test_flag_(NULL),
- death_test_factory_(new DefaultDeathTestFactory) {
-#else
- elapsed_time_(0) {
-#endif // GTEST_HAS_DEATH_TEST
- listeners()->SetDefaultResultPrinter(new PrettyUnitTestResultPrinter);
-}
-
-UnitTestImpl::~UnitTestImpl() {
- // Deletes every TestCase.
- ForEach(test_cases_, internal::Delete<TestCase>);
-
- // Deletes every Environment.
- ForEach(environments_, internal::Delete<Environment>);
-
- delete os_stack_trace_getter_;
-}
-
-#if GTEST_HAS_DEATH_TEST
-// Disables event forwarding if the control is currently in a death test
-// subprocess. Must not be called before InitGoogleTest.
-void UnitTestImpl::SuppressTestEventsIfInSubprocess() {
- if (internal_run_death_test_flag_.get() != NULL)
- listeners()->SuppressEventForwarding();
-}
-#endif // GTEST_HAS_DEATH_TEST
-
-// Initializes event listeners performing XML output as specified by
-// UnitTestOptions. Must not be called before InitGoogleTest.
-void UnitTestImpl::ConfigureXmlOutput() {
- const String& output_format = UnitTestOptions::GetOutputFormat();
- if (output_format == "xml") {
- listeners()->SetDefaultXmlGenerator(new XmlUnitTestResultPrinter(
- UnitTestOptions::GetAbsolutePathToOutputFile().c_str()));
- } else if (output_format != "") {
- printf("WARNING: unrecognized output format \"%s\" ignored.\n",
- output_format.c_str());
- fflush(stdout);
- }
-}
-
-// Performs initialization dependent upon flag values obtained in
-// ParseGoogleTestFlagsOnly. Is called from InitGoogleTest after the call to
-// ParseGoogleTestFlagsOnly. In case a user neglects to call InitGoogleTest
-// this function is also called from RunAllTests. Since this function can be
-// called more than once, it has to be idempotent.
-void UnitTestImpl::PostFlagParsingInit() {
- // Ensures that this function does not execute more than once.
- if (!post_flag_parse_init_performed_) {
- post_flag_parse_init_performed_ = true;
-
-#if GTEST_HAS_DEATH_TEST
- InitDeathTestSubprocessControlInfo();
- SuppressTestEventsIfInSubprocess();
-#endif // GTEST_HAS_DEATH_TEST
-
- // Registers parameterized tests. This makes parameterized tests
- // available to the UnitTest reflection API without running
- // RUN_ALL_TESTS.
- RegisterParameterizedTests();
-
- // Configures listeners for XML output. This makes it possible for users
- // to shut down the default XML output before invoking RUN_ALL_TESTS.
- ConfigureXmlOutput();
- }
-}
-
-// A predicate that checks the name of a TestCase against a known
-// value.
-//
-// This is used for implementation of the UnitTest class only. We put
-// it in the anonymous namespace to prevent polluting the outer
-// namespace.
-//
-// TestCaseNameIs is copyable.
-class TestCaseNameIs {
- public:
- // Constructor.
- explicit TestCaseNameIs(const String& name)
- : name_(name) {}
-
- // Returns true iff the name of test_case matches name_.
- bool operator()(const TestCase* test_case) const {
- return test_case != NULL && strcmp(test_case->name(), name_.c_str()) == 0;
- }
-
- private:
- String name_;
-};
-
-// Finds and returns a TestCase with the given name. If one doesn't
-// exist, creates one and returns it. It's the CALLER'S
-// RESPONSIBILITY to ensure that this function is only called WHEN THE
-// TESTS ARE NOT SHUFFLED.
-//
-// Arguments:
-//
-// test_case_name: name of the test case
-// set_up_tc: pointer to the function that sets up the test case
-// tear_down_tc: pointer to the function that tears down the test case
-TestCase* UnitTestImpl::GetTestCase(const char* test_case_name,
- const char* comment,
- Test::SetUpTestCaseFunc set_up_tc,
- Test::TearDownTestCaseFunc tear_down_tc) {
- // Can we find a TestCase with the given name?
- const std::vector<TestCase*>::const_iterator test_case =
- std::find_if(test_cases_.begin(), test_cases_.end(),
- TestCaseNameIs(test_case_name));
-
- if (test_case != test_cases_.end())
- return *test_case;
-
- // No. Let's create one.
- TestCase* const new_test_case =
- new TestCase(test_case_name, comment, set_up_tc, tear_down_tc);
-
- // Is this a death test case?
- if (internal::UnitTestOptions::MatchesFilter(String(test_case_name),
- kDeathTestCaseFilter)) {
- // Yes. Inserts the test case after the last death test case
- // defined so far. This only works when the test cases haven't
- // been shuffled. Otherwise we may end up running a death test
- // after a non-death test.
- ++last_death_test_case_;
- test_cases_.insert(test_cases_.begin() + last_death_test_case_,
- new_test_case);
- } else {
- // No. Appends to the end of the list.
- test_cases_.push_back(new_test_case);
- }
-
- test_case_indices_.push_back(static_cast<int>(test_case_indices_.size()));
- return new_test_case;
-}
-
-// Helpers for setting up / tearing down the given environment. They
-// are for use in the ForEach() function.
-static void SetUpEnvironment(Environment* env) { env->SetUp(); }
-static void TearDownEnvironment(Environment* env) { env->TearDown(); }
-
-// Runs all tests in this UnitTest object, prints the result, and
-// returns 0 if all tests are successful, or 1 otherwise. If any
-// exception is thrown during a test on Windows, this test is
-// considered to be failed, but the rest of the tests will still be
-// run. (We disable exceptions on Linux and Mac OS X, so the issue
-// doesn't apply there.)
-// When parameterized tests are enabled, it expands and registers
-// parameterized tests first in RegisterParameterizedTests().
-// All other functions called from RunAllTests() may safely assume that
-// parameterized tests are ready to be counted and run.
-int UnitTestImpl::RunAllTests() {
- // Makes sure InitGoogleTest() was called.
- if (!GTestIsInitialized()) {
- printf("%s",
- "\nThis test program did NOT call ::testing::InitGoogleTest "
- "before calling RUN_ALL_TESTS(). Please fix it.\n");
- return 1;
- }
-
- // Do not run any test if the --help flag was specified.
- if (g_help_flag)
- return 0;
-
- // Repeats the call to the post-flag parsing initialization in case the
- // user didn't call InitGoogleTest.
- PostFlagParsingInit();
-
- // Even if sharding is not on, test runners may want to use the
- // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding
- // protocol.
- internal::WriteToShardStatusFileIfNeeded();
-
- // True iff we are in a subprocess for running a thread-safe-style
- // death test.
- bool in_subprocess_for_death_test = false;
-
-#if GTEST_HAS_DEATH_TEST
- in_subprocess_for_death_test = (internal_run_death_test_flag_.get() != NULL);
-#endif // GTEST_HAS_DEATH_TEST
-
- const bool should_shard = ShouldShard(kTestTotalShards, kTestShardIndex,
- in_subprocess_for_death_test);
-
- // Compares the full test names with the filter to decide which
- // tests to run.
- const bool has_tests_to_run = FilterTests(should_shard
- ? HONOR_SHARDING_PROTOCOL
- : IGNORE_SHARDING_PROTOCOL) > 0;
-
- // Lists the tests and exits if the --gtest_list_tests flag was specified.
- if (GTEST_FLAG(list_tests)) {
- // This must be called *after* FilterTests() has been called.
- ListTestsMatchingFilter();
- return 0;
- }
-
- random_seed_ = GTEST_FLAG(shuffle) ?
- GetRandomSeedFromFlag(GTEST_FLAG(random_seed)) : 0;
-
- // True iff at least one test has failed.
- bool failed = false;
-
- TestEventListener* repeater = listeners()->repeater();
-
- repeater->OnTestProgramStart(*parent_);
-
- // How many times to repeat the tests? We don't want to repeat them
- // when we are inside the subprocess of a death test.
- const int repeat = in_subprocess_for_death_test ? 1 : GTEST_FLAG(repeat);
- // Repeats forever if the repeat count is negative.
- const bool forever = repeat < 0;
- for (int i = 0; forever || i != repeat; i++) {
- ClearResult();
-
- const TimeInMillis start = GetTimeInMillis();
-
- // Shuffles test cases and tests if requested.
- if (has_tests_to_run && GTEST_FLAG(shuffle)) {
- random()->Reseed(random_seed_);
- // This should be done before calling OnTestIterationStart(),
- // such that a test event listener can see the actual test order
- // in the event.
- ShuffleTests();
- }
-
- // Tells the unit test event listeners that the tests are about to start.
- repeater->OnTestIterationStart(*parent_, i);
-
- // Runs each test case if there is at least one test to run.
- if (has_tests_to_run) {
- // Sets up all environments beforehand.
- repeater->OnEnvironmentsSetUpStart(*parent_);
- ForEach(environments_, SetUpEnvironment);
- repeater->OnEnvironmentsSetUpEnd(*parent_);
-
- // Runs the tests only if there was no fatal failure during global
- // set-up.
- if (!Test::HasFatalFailure()) {
- for (int test_index = 0; test_index < total_test_case_count();
- test_index++) {
- GetMutableTestCase(test_index)->Run();
- }
- }
-
- // Tears down all environments in reverse order afterwards.
- repeater->OnEnvironmentsTearDownStart(*parent_);
- std::for_each(environments_.rbegin(), environments_.rend(),
- TearDownEnvironment);
- repeater->OnEnvironmentsTearDownEnd(*parent_);
- }
-
- elapsed_time_ = GetTimeInMillis() - start;
-
- // Tells the unit test event listener that the tests have just finished.
- repeater->OnTestIterationEnd(*parent_, i);
-
- // Gets the result and clears it.
- if (!Passed()) {
- failed = true;
- }
-
- // Restores the original test order after the iteration. This
- // allows the user to quickly repro a failure that happens in the
- // N-th iteration without repeating the first (N - 1) iterations.
- // This is not enclosed in "if (GTEST_FLAG(shuffle)) { ... }", in
- // case the user somehow changes the value of the flag somewhere
- // (it's always safe to unshuffle the tests).
- UnshuffleTests();
-
- if (GTEST_FLAG(shuffle)) {
- // Picks a new random seed for each iteration.
- random_seed_ = GetNextRandomSeed(random_seed_);
- }
- }
-
- repeater->OnTestProgramEnd(*parent_);
-
- // Returns 0 if all tests passed, or 1 other wise.
- return failed ? 1 : 0;
-}
-
-// Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file
-// if the variable is present. If a file already exists at this location, this
-// function will write over it. If the variable is present, but the file cannot
-// be created, prints an error and exits.
-void WriteToShardStatusFileIfNeeded() {
- const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile);
- if (test_shard_file != NULL) {
- FILE* const file = posix::FOpen(test_shard_file, "w");
- if (file == NULL) {
- ColoredPrintf(COLOR_RED,
- "Could not write to the test shard status file \"%s\" "
- "specified by the %s environment variable.\n",
- test_shard_file, kTestShardStatusFile);
- fflush(stdout);
- exit(EXIT_FAILURE);
- }
- fclose(file);
- }
-}
-
-// Checks whether sharding is enabled by examining the relevant
-// environment variable values. If the variables are present,
-// but inconsistent (i.e., shard_index >= total_shards), prints
-// an error and exits. If in_subprocess_for_death_test, sharding is
-// disabled because it must only be applied to the original test
-// process. Otherwise, we could filter out death tests we intended to execute.
-bool ShouldShard(const char* total_shards_env,
- const char* shard_index_env,
- bool in_subprocess_for_death_test) {
- if (in_subprocess_for_death_test) {
- return false;
- }
-
- const Int32 total_shards = Int32FromEnvOrDie(total_shards_env, -1);
- const Int32 shard_index = Int32FromEnvOrDie(shard_index_env, -1);
-
- if (total_shards == -1 && shard_index == -1) {
- return false;
- } else if (total_shards == -1 && shard_index != -1) {
- const Message msg = Message()
- << "Invalid environment variables: you have "
- << kTestShardIndex << " = " << shard_index
- << ", but have left " << kTestTotalShards << " unset.\n";
- ColoredPrintf(COLOR_RED, msg.GetString().c_str());
- fflush(stdout);
- exit(EXIT_FAILURE);
- } else if (total_shards != -1 && shard_index == -1) {
- const Message msg = Message()
- << "Invalid environment variables: you have "
- << kTestTotalShards << " = " << total_shards
- << ", but have left " << kTestShardIndex << " unset.\n";
- ColoredPrintf(COLOR_RED, msg.GetString().c_str());
- fflush(stdout);
- exit(EXIT_FAILURE);
- } else if (shard_index < 0 || shard_index >= total_shards) {
- const Message msg = Message()
- << "Invalid environment variables: we require 0 <= "
- << kTestShardIndex << " < " << kTestTotalShards
- << ", but you have " << kTestShardIndex << "=" << shard_index
- << ", " << kTestTotalShards << "=" << total_shards << ".\n";
- ColoredPrintf(COLOR_RED, msg.GetString().c_str());
- fflush(stdout);
- exit(EXIT_FAILURE);
- }
-
- return total_shards > 1;
-}
-
-// Parses the environment variable var as an Int32. If it is unset,
-// returns default_val. If it is not an Int32, prints an error
-// and aborts.
-Int32 Int32FromEnvOrDie(const char* const var, Int32 default_val) {
- const char* str_val = posix::GetEnv(var);
- if (str_val == NULL) {
- return default_val;
- }
-
- Int32 result;
- if (!ParseInt32(Message() << "The value of environment variable " << var,
- str_val, &result)) {
- exit(EXIT_FAILURE);
- }
- return result;
-}
-
-// Given the total number of shards, the shard index, and the test id,
-// returns true iff the test should be run on this shard. The test id is
-// some arbitrary but unique non-negative integer assigned to each test
-// method. Assumes that 0 <= shard_index < total_shards.
-bool ShouldRunTestOnShard(int total_shards, int shard_index, int test_id) {
- return (test_id % total_shards) == shard_index;
-}
-
-// Compares the name of each test with the user-specified filter to
-// decide whether the test should be run, then records the result in
-// each TestCase and TestInfo object.
-// If shard_tests == true, further filters tests based on sharding
-// variables in the environment - see
-// http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide.
-// Returns the number of tests that should run.
-int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
- const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ?
- Int32FromEnvOrDie(kTestTotalShards, -1) : -1;
- const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ?
- Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
-
- // num_runnable_tests are the number of tests that will
- // run across all shards (i.e., match filter and are not disabled).
- // num_selected_tests are the number of tests to be run on
- // this shard.
- int num_runnable_tests = 0;
- int num_selected_tests = 0;
- for (size_t i = 0; i < test_cases_.size(); i++) {
- TestCase* const test_case = test_cases_[i];
- const String &test_case_name = test_case->name();
- test_case->set_should_run(false);
-
- for (size_t j = 0; j < test_case->test_info_list().size(); j++) {
- TestInfo* const test_info = test_case->test_info_list()[j];
- const String test_name(test_info->name());
- // A test is disabled if test case name or test name matches
- // kDisableTestFilter.
- const bool is_disabled =
- internal::UnitTestOptions::MatchesFilter(test_case_name,
- kDisableTestFilter) ||
- internal::UnitTestOptions::MatchesFilter(test_name,
- kDisableTestFilter);
- test_info->impl()->set_is_disabled(is_disabled);
-
- const bool matches_filter =
- internal::UnitTestOptions::FilterMatchesTest(test_case_name,
- test_name);
- test_info->impl()->set_matches_filter(matches_filter);
-
- const bool is_runnable =
- (GTEST_FLAG(also_run_disabled_tests) || !is_disabled) &&
- matches_filter;
-
- const bool is_selected = is_runnable &&
- (shard_tests == IGNORE_SHARDING_PROTOCOL ||
- ShouldRunTestOnShard(total_shards, shard_index,
- num_runnable_tests));
-
- num_runnable_tests += is_runnable;
- num_selected_tests += is_selected;
-
- test_info->impl()->set_should_run(is_selected);
- test_case->set_should_run(test_case->should_run() || is_selected);
- }
- }
- return num_selected_tests;
-}
-
-// Prints the names of the tests matching the user-specified filter flag.
-void UnitTestImpl::ListTestsMatchingFilter() {
- for (size_t i = 0; i < test_cases_.size(); i++) {
- const TestCase* const test_case = test_cases_[i];
- bool printed_test_case_name = false;
-
- for (size_t j = 0; j < test_case->test_info_list().size(); j++) {
- const TestInfo* const test_info =
- test_case->test_info_list()[j];
- if (test_info->matches_filter()) {
- if (!printed_test_case_name) {
- printed_test_case_name = true;
- printf("%s.\n", test_case->name());
- }
- printf(" %s\n", test_info->name());
- }
- }
- }
- fflush(stdout);
-}
-
-// Sets the OS stack trace getter.
-//
-// Does nothing if the input and the current OS stack trace getter are
-// the same; otherwise, deletes the old getter and makes the input the
-// current getter.
-void UnitTestImpl::set_os_stack_trace_getter(
- OsStackTraceGetterInterface* getter) {
- if (os_stack_trace_getter_ != getter) {
- delete os_stack_trace_getter_;
- os_stack_trace_getter_ = getter;
- }
-}
-
-// Returns the current OS stack trace getter if it is not NULL;
-// otherwise, creates an OsStackTraceGetter, makes it the current
-// getter, and returns it.
-OsStackTraceGetterInterface* UnitTestImpl::os_stack_trace_getter() {
- if (os_stack_trace_getter_ == NULL) {
- os_stack_trace_getter_ = new OsStackTraceGetter;
- }
-
- return os_stack_trace_getter_;
-}
-
-// Returns the TestResult for the test that's currently running, or
-// the TestResult for the ad hoc test if no test is running.
-TestResult* UnitTestImpl::current_test_result() {
- return current_test_info_ ?
- current_test_info_->impl()->result() : &ad_hoc_test_result_;
-}
-
-// Shuffles all test cases, and the tests within each test case,
-// making sure that death tests are still run first.
-void UnitTestImpl::ShuffleTests() {
- // Shuffles the death test cases.
- ShuffleRange(random(), 0, last_death_test_case_ + 1, &test_case_indices_);
-
- // Shuffles the non-death test cases.
- ShuffleRange(random(), last_death_test_case_ + 1,
- static_cast<int>(test_cases_.size()), &test_case_indices_);
-
- // Shuffles the tests inside each test case.
- for (size_t i = 0; i < test_cases_.size(); i++) {
- test_cases_[i]->ShuffleTests(random());
- }
-}
-
-// Restores the test cases and tests to their order before the first shuffle.
-void UnitTestImpl::UnshuffleTests() {
- for (size_t i = 0; i < test_cases_.size(); i++) {
- // Unshuffles the tests in each test case.
- test_cases_[i]->UnshuffleTests();
- // Resets the index of each test case.
- test_case_indices_[i] = static_cast<int>(i);
- }
-}
-
-// TestInfoImpl constructor. The new instance assumes ownership of the test
-// factory object.
-TestInfoImpl::TestInfoImpl(TestInfo* parent,
- const char* a_test_case_name,
- const char* a_name,
- const char* a_test_case_comment,
- const char* a_comment,
- TypeId a_fixture_class_id,
- internal::TestFactoryBase* factory) :
- parent_(parent),
- test_case_name_(String(a_test_case_name)),
- name_(String(a_name)),
- test_case_comment_(String(a_test_case_comment)),
- comment_(String(a_comment)),
- fixture_class_id_(a_fixture_class_id),
- should_run_(false),
- is_disabled_(false),
- matches_filter_(false),
- factory_(factory) {
-}
-
-// TestInfoImpl destructor.
-TestInfoImpl::~TestInfoImpl() {
- delete factory_;
-}
-
-// Returns the current OS stack trace as a String.
-//
-// The maximum number of stack frames to be included is specified by
-// the gtest_stack_trace_depth flag. The skip_count parameter
-// specifies the number of top frames to be skipped, which doesn't
-// count against the number of frames to be included.
-//
-// For example, if Foo() calls Bar(), which in turn calls
-// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
-// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
-String GetCurrentOsStackTraceExceptTop(UnitTest* /*unit_test*/,
- int skip_count) {
- // We pass skip_count + 1 to skip this wrapper function in addition
- // to what the user really wants to skip.
- return GetUnitTestImpl()->CurrentOsStackTraceExceptTop(skip_count + 1);
-}
-
-// Used by the GTEST_HIDE_UNREACHABLE_CODE_ macro to suppress unreachable
-// code warnings.
-namespace {
-class ClassUniqueToAlwaysTrue {};
-}
-
-bool IsTrue(bool condition) { return condition; }
-
-bool AlwaysTrue() {
-#if GTEST_HAS_EXCEPTIONS
- // This condition is always false so AlwaysTrue() never actually throws,
- // but it makes the compiler think that it may throw.
- if (IsTrue(false))
- throw ClassUniqueToAlwaysTrue();
-#endif // GTEST_HAS_EXCEPTIONS
- return true;
-}
-
-// If *pstr starts with the given prefix, modifies *pstr to be right
-// past the prefix and returns true; otherwise leaves *pstr unchanged
-// and returns false. None of pstr, *pstr, and prefix can be NULL.
-bool SkipPrefix(const char* prefix, const char** pstr) {
- const size_t prefix_len = strlen(prefix);
- if (strncmp(*pstr, prefix, prefix_len) == 0) {
- *pstr += prefix_len;
- return true;
- }
- return false;
-}
-
-// Parses a string as a command line flag. The string should have
-// the format "--flag=value". When def_optional is true, the "=value"
-// part can be omitted.
-//
-// Returns the value of the flag, or NULL if the parsing failed.
-const char* ParseFlagValue(const char* str,
- const char* flag,
- bool def_optional) {
- // str and flag must not be NULL.
- if (str == NULL || flag == NULL) return NULL;
-
- // The flag must start with "--" followed by GTEST_FLAG_PREFIX_.
- const String flag_str = String::Format("--%s%s", GTEST_FLAG_PREFIX_, flag);
- const size_t flag_len = flag_str.length();
- if (strncmp(str, flag_str.c_str(), flag_len) != 0) return NULL;
-
- // Skips the flag name.
- const char* flag_end = str + flag_len;
-
- // When def_optional is true, it's OK to not have a "=value" part.
- if (def_optional && (flag_end[0] == '\0')) {
- return flag_end;
- }
-
- // If def_optional is true and there are more characters after the
- // flag name, or if def_optional is false, there must be a '=' after
- // the flag name.
- if (flag_end[0] != '=') return NULL;
-
- // Returns the string after "=".
- return flag_end + 1;
-}
-
-// Parses a string for a bool flag, in the form of either
-// "--flag=value" or "--flag".
-//
-// In the former case, the value is taken as true as long as it does
-// not start with '0', 'f', or 'F'.
-//
-// In the latter case, the value is taken as true.
-//
-// On success, stores the value of the flag in *value, and returns
-// true. On failure, returns false without changing *value.
-bool ParseBoolFlag(const char* str, const char* flag, bool* value) {
- // Gets the value of the flag as a string.
- const char* const value_str = ParseFlagValue(str, flag, true);
-
- // Aborts if the parsing failed.
- if (value_str == NULL) return false;
-
- // Converts the string value to a bool.
- *value = !(*value_str == '0' || *value_str == 'f' || *value_str == 'F');
- return true;
-}
-
-// Parses a string for an Int32 flag, in the form of
-// "--flag=value".
-//
-// On success, stores the value of the flag in *value, and returns
-// true. On failure, returns false without changing *value.
-bool ParseInt32Flag(const char* str, const char* flag, Int32* value) {
- // Gets the value of the flag as a string.
- const char* const value_str = ParseFlagValue(str, flag, false);
-
- // Aborts if the parsing failed.
- if (value_str == NULL) return false;
-
- // Sets *value to the value of the flag.
- return ParseInt32(Message() << "The value of flag --" << flag,
- value_str, value);
-}
-
-// Parses a string for a string flag, in the form of
-// "--flag=value".
-//
-// On success, stores the value of the flag in *value, and returns
-// true. On failure, returns false without changing *value.
-bool ParseStringFlag(const char* str, const char* flag, String* value) {
- // Gets the value of the flag as a string.
- const char* const value_str = ParseFlagValue(str, flag, false);
-
- // Aborts if the parsing failed.
- if (value_str == NULL) return false;
-
- // Sets *value to the value of the flag.
- *value = value_str;
- return true;
-}
-
-// Determines whether a string has a prefix that Google Test uses for its
-// flags, i.e., starts with GTEST_FLAG_PREFIX_ or GTEST_FLAG_PREFIX_DASH_.
-// If Google Test detects that a command line flag has its prefix but is not
-// recognized, it will print its help message. Flags starting with
-// GTEST_INTERNAL_PREFIX_ followed by "internal_" are considered Google Test
-// internal flags and do not trigger the help message.
-static bool HasGoogleTestFlagPrefix(const char* str) {
- return (SkipPrefix("--", &str) ||
- SkipPrefix("-", &str) ||
- SkipPrefix("/", &str)) &&
- !SkipPrefix(GTEST_FLAG_PREFIX_ "internal_", &str) &&
- (SkipPrefix(GTEST_FLAG_PREFIX_, &str) ||
- SkipPrefix(GTEST_FLAG_PREFIX_DASH_, &str));
-}
-
-// Prints a string containing code-encoded text. The following escape
-// sequences can be used in the string to control the text color:
-//
-// @@ prints a single '@' character.
-// @R changes the color to red.
-// @G changes the color to green.
-// @Y changes the color to yellow.
-// @D changes to the default terminal text color.
-//
-// TODO(wan@google.com): Write tests for this once we add stdout
-// capturing to Google Test.
-static void PrintColorEncoded(const char* str) {
- GTestColor color = COLOR_DEFAULT; // The current color.
-
- // Conceptually, we split the string into segments divided by escape
- // sequences. Then we print one segment at a time. At the end of
- // each iteration, the str pointer advances to the beginning of the
- // next segment.
- for (;;) {
- const char* p = strchr(str, '@');
- if (p == NULL) {
- ColoredPrintf(color, "%s", str);
- return;
- }
-
- ColoredPrintf(color, "%s", String(str, p - str).c_str());
-
- const char ch = p[1];
- str = p + 2;
- if (ch == '@') {
- ColoredPrintf(color, "@");
- } else if (ch == 'D') {
- color = COLOR_DEFAULT;
- } else if (ch == 'R') {
- color = COLOR_RED;
- } else if (ch == 'G') {
- color = COLOR_GREEN;
- } else if (ch == 'Y') {
- color = COLOR_YELLOW;
- } else {
- --str;
- }
- }
-}
-
-static const char kColorEncodedHelpMessage[] =
-"This program contains tests written using " GTEST_NAME_ ". You can use the\n"
-"following command line flags to control its behavior:\n"
-"\n"
-"Test Selection:\n"
-" @G--" GTEST_FLAG_PREFIX_ "list_tests@D\n"
-" List the names of all tests instead of running them. The name of\n"
-" TEST(Foo, Bar) is \"Foo.Bar\".\n"
-" @G--" GTEST_FLAG_PREFIX_ "filter=@YPOSTIVE_PATTERNS"
- "[@G-@YNEGATIVE_PATTERNS]@D\n"
-" Run only the tests whose name matches one of the positive patterns but\n"
-" none of the negative patterns. '?' matches any single character; '*'\n"
-" matches any substring; ':' separates two patterns.\n"
-" @G--" GTEST_FLAG_PREFIX_ "also_run_disabled_tests@D\n"
-" Run all disabled tests too.\n"
-"\n"
-"Test Execution:\n"
-" @G--" GTEST_FLAG_PREFIX_ "repeat=@Y[COUNT]@D\n"
-" Run the tests repeatedly; use a negative count to repeat forever.\n"
-" @G--" GTEST_FLAG_PREFIX_ "shuffle@D\n"
-" Randomize tests' orders on every iteration.\n"
-" @G--" GTEST_FLAG_PREFIX_ "random_seed=@Y[NUMBER]@D\n"
-" Random number seed to use for shuffling test orders (between 1 and\n"
-" 99999, or 0 to use a seed based on the current time).\n"
-"\n"
-"Test Output:\n"
-" @G--" GTEST_FLAG_PREFIX_ "color=@Y(@Gyes@Y|@Gno@Y|@Gauto@Y)@D\n"
-" Enable/disable colored output. The default is @Gauto@D.\n"
-" -@G-" GTEST_FLAG_PREFIX_ "print_time=0@D\n"
-" Don't print the elapsed time of each test.\n"
-" @G--" GTEST_FLAG_PREFIX_ "output=xml@Y[@G:@YDIRECTORY_PATH@G"
- GTEST_PATH_SEP_ "@Y|@G:@YFILE_PATH]@D\n"
-" Generate an XML report in the given directory or with the given file\n"
-" name. @YFILE_PATH@D defaults to @Gtest_details.xml@D.\n"
-"\n"
-"Assertion Behavior:\n"
-#if GTEST_HAS_DEATH_TEST && !GTEST_OS_WINDOWS
-" @G--" GTEST_FLAG_PREFIX_ "death_test_style=@Y(@Gfast@Y|@Gthreadsafe@Y)@D\n"
-" Set the default death test style.\n"
-#endif // GTEST_HAS_DEATH_TEST && !GTEST_OS_WINDOWS
-" @G--" GTEST_FLAG_PREFIX_ "break_on_failure@D\n"
-" Turn assertion failures into debugger break-points.\n"
-" @G--" GTEST_FLAG_PREFIX_ "throw_on_failure@D\n"
-" Turn assertion failures into C++ exceptions.\n"
-#if GTEST_OS_WINDOWS
-" @G--" GTEST_FLAG_PREFIX_ "catch_exceptions@D\n"
-" Suppress pop-ups caused by exceptions.\n"
-#endif // GTEST_OS_WINDOWS
-"\n"
-"Except for @G--" GTEST_FLAG_PREFIX_ "list_tests@D, you can alternatively set "
- "the corresponding\n"
-"environment variable of a flag (all letters in upper-case). For example, to\n"
-"disable colored text output, you can either specify @G--" GTEST_FLAG_PREFIX_
- "color=no@D or set\n"
-"the @G" GTEST_FLAG_PREFIX_UPPER_ "COLOR@D environment variable to @Gno@D.\n"
-"\n"
-"For more information, please read the " GTEST_NAME_ " documentation at\n"
-"@G" GTEST_PROJECT_URL_ "@D. If you find a bug in " GTEST_NAME_ "\n"
-"(not one in your own code or tests), please report it to\n"
-"@G<" GTEST_DEV_EMAIL_ ">@D.\n";
-
-// Parses the command line for Google Test flags, without initializing
-// other parts of Google Test. The type parameter CharType can be
-// instantiated to either char or wchar_t.
-template <typename CharType>
-void ParseGoogleTestFlagsOnlyImpl(int* argc, CharType** argv) {
- for (int i = 1; i < *argc; i++) {
- const String arg_string = StreamableToString(argv[i]);
- const char* const arg = arg_string.c_str();
-
- using internal::ParseBoolFlag;
- using internal::ParseInt32Flag;
- using internal::ParseStringFlag;
-
- // Do we see a Google Test flag?
- if (ParseBoolFlag(arg, kAlsoRunDisabledTestsFlag,
- &GTEST_FLAG(also_run_disabled_tests)) ||
- ParseBoolFlag(arg, kBreakOnFailureFlag,
- &GTEST_FLAG(break_on_failure)) ||
- ParseBoolFlag(arg, kCatchExceptionsFlag,
- &GTEST_FLAG(catch_exceptions)) ||
- ParseStringFlag(arg, kColorFlag, &GTEST_FLAG(color)) ||
- ParseStringFlag(arg, kDeathTestStyleFlag,
- &GTEST_FLAG(death_test_style)) ||
- ParseBoolFlag(arg, kDeathTestUseFork,
- &GTEST_FLAG(death_test_use_fork)) ||
- ParseStringFlag(arg, kFilterFlag, &GTEST_FLAG(filter)) ||
- ParseStringFlag(arg, kInternalRunDeathTestFlag,
- &GTEST_FLAG(internal_run_death_test)) ||
- ParseBoolFlag(arg, kListTestsFlag, &GTEST_FLAG(list_tests)) ||
- ParseStringFlag(arg, kOutputFlag, &GTEST_FLAG(output)) ||
- ParseBoolFlag(arg, kPrintTimeFlag, &GTEST_FLAG(print_time)) ||
- ParseInt32Flag(arg, kRandomSeedFlag, &GTEST_FLAG(random_seed)) ||
- ParseInt32Flag(arg, kRepeatFlag, &GTEST_FLAG(repeat)) ||
- ParseBoolFlag(arg, kShuffleFlag, &GTEST_FLAG(shuffle)) ||
- ParseInt32Flag(arg, kStackTraceDepthFlag,
- &GTEST_FLAG(stack_trace_depth)) ||
- ParseBoolFlag(arg, kThrowOnFailureFlag, &GTEST_FLAG(throw_on_failure))
- ) {
- // Yes. Shift the remainder of the argv list left by one. Note
- // that argv has (*argc + 1) elements, the last one always being
- // NULL. The following loop moves the trailing NULL element as
- // well.
- for (int j = i; j != *argc; j++) {
- argv[j] = argv[j + 1];
- }
-
- // Decrements the argument count.
- (*argc)--;
-
- // We also need to decrement the iterator as we just removed
- // an element.
- i--;
- } else if (arg_string == "--help" || arg_string == "-h" ||
- arg_string == "-?" || arg_string == "/?" ||
- HasGoogleTestFlagPrefix(arg)) {
- // Both help flag and unrecognized Google Test flags (excluding
- // internal ones) trigger help display.
- g_help_flag = true;
- }
- }
-
- if (g_help_flag) {
- // We print the help here instead of in RUN_ALL_TESTS(), as the
- // latter may not be called at all if the user is using Google
- // Test with another testing framework.
- PrintColorEncoded(kColorEncodedHelpMessage);
- }
-}
-
-// Parses the command line for Google Test flags, without initializing
-// other parts of Google Test.
-void ParseGoogleTestFlagsOnly(int* argc, char** argv) {
- ParseGoogleTestFlagsOnlyImpl(argc, argv);
-}
-void ParseGoogleTestFlagsOnly(int* argc, wchar_t** argv) {
- ParseGoogleTestFlagsOnlyImpl(argc, argv);
-}
-
-// The internal implementation of InitGoogleTest().
-//
-// The type parameter CharType can be instantiated to either char or
-// wchar_t.
-template <typename CharType>
-void InitGoogleTestImpl(int* argc, CharType** argv) {
- g_init_gtest_count++;
-
- // We don't want to run the initialization code twice.
- if (g_init_gtest_count != 1) return;
-
- if (*argc <= 0) return;
-
- internal::g_executable_path = internal::StreamableToString(argv[0]);
-
-#if GTEST_HAS_DEATH_TEST
- g_argvs.clear();
- for (int i = 0; i != *argc; i++) {
- g_argvs.push_back(StreamableToString(argv[i]));
- }
-#endif // GTEST_HAS_DEATH_TEST
-
- ParseGoogleTestFlagsOnly(argc, argv);
- GetUnitTestImpl()->PostFlagParsingInit();
-}
-
-} // namespace internal
-
-// Initializes Google Test. This must be called before calling
-// RUN_ALL_TESTS(). In particular, it parses a command line for the
-// flags that Google Test recognizes. Whenever a Google Test flag is
-// seen, it is removed from argv, and *argc is decremented.
-//
-// No value is returned. Instead, the Google Test flag variables are
-// updated.
-//
-// Calling the function for the second time has no user-visible effect.
-void InitGoogleTest(int* argc, char** argv) {
- internal::InitGoogleTestImpl(argc, argv);
-}
-
-// This overloaded version can be used in Windows programs compiled in
-// UNICODE mode.
-void InitGoogleTest(int* argc, wchar_t** argv) {
- internal::InitGoogleTestImpl(argc, argv);
-}
-
-} // namespace testing
diff --git a/contrib/llvm/utils/unittest/googletest/include/gtest/gtest-death-test.h b/contrib/llvm/utils/unittest/googletest/include/gtest/gtest-death-test.h
deleted file mode 100644
index 121dc1f..0000000
--- a/contrib/llvm/utils/unittest/googletest/include/gtest/gtest-death-test.h
+++ /dev/null
@@ -1,283 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// The Google C++ Testing Framework (Google Test)
-//
-// This header file defines the public API for death tests. It is
-// #included by gtest.h so a user doesn't need to include this
-// directly.
-
-#ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
-#define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
-
-#include <gtest/internal/gtest-death-test-internal.h>
-
-namespace testing {
-
-// This flag controls the style of death tests. Valid values are "threadsafe",
-// meaning that the death test child process will re-execute the test binary
-// from the start, running only a single death test, or "fast",
-// meaning that the child process will execute the test logic immediately
-// after forking.
-GTEST_DECLARE_string_(death_test_style);
-
-#if GTEST_HAS_DEATH_TEST
-
-// The following macros are useful for writing death tests.
-
-// Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
-// executed:
-//
-// 1. It generates a warning if there is more than one active
-// thread. This is because it's safe to fork() or clone() only
-// when there is a single thread.
-//
-// 2. The parent process clone()s a sub-process and runs the death
-// test in it; the sub-process exits with code 0 at the end of the
-// death test, if it hasn't exited already.
-//
-// 3. The parent process waits for the sub-process to terminate.
-//
-// 4. The parent process checks the exit code and error message of
-// the sub-process.
-//
-// Examples:
-//
-// ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
-// for (int i = 0; i < 5; i++) {
-// EXPECT_DEATH(server.ProcessRequest(i),
-// "Invalid request .* in ProcessRequest()")
-// << "Failed to die on request " << i);
-// }
-//
-// ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
-//
-// bool KilledBySIGHUP(int exit_code) {
-// return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
-// }
-//
-// ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
-//
-// On the regular expressions used in death tests:
-//
-// On POSIX-compliant systems (*nix), we use the <regex.h> library,
-// which uses the POSIX extended regex syntax.
-//
-// On other platforms (e.g. Windows), we only support a simple regex
-// syntax implemented as part of Google Test. This limited
-// implementation should be enough most of the time when writing
-// death tests; though it lacks many features you can find in PCRE
-// or POSIX extended regex syntax. For example, we don't support
-// union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
-// repetition count ("x{5,7}"), among others.
-//
-// Below is the syntax that we do support. We chose it to be a
-// subset of both PCRE and POSIX extended regex, so it's easy to
-// learn wherever you come from. In the following: 'A' denotes a
-// literal character, period (.), or a single \\ escape sequence;
-// 'x' and 'y' denote regular expressions; 'm' and 'n' are for
-// natural numbers.
-//
-// c matches any literal character c
-// \\d matches any decimal digit
-// \\D matches any character that's not a decimal digit
-// \\f matches \f
-// \\n matches \n
-// \\r matches \r
-// \\s matches any ASCII whitespace, including \n
-// \\S matches any character that's not a whitespace
-// \\t matches \t
-// \\v matches \v
-// \\w matches any letter, _, or decimal digit
-// \\W matches any character that \\w doesn't match
-// \\c matches any literal character c, which must be a punctuation
-// . matches any single character except \n
-// A? matches 0 or 1 occurrences of A
-// A* matches 0 or many occurrences of A
-// A+ matches 1 or many occurrences of A
-// ^ matches the beginning of a string (not that of each line)
-// $ matches the end of a string (not that of each line)
-// xy matches x followed by y
-//
-// If you accidentally use PCRE or POSIX extended regex features
-// not implemented by us, you will get a run-time failure. In that
-// case, please try to rewrite your regular expression within the
-// above syntax.
-//
-// This implementation is *not* meant to be as highly tuned or robust
-// as a compiled regex library, but should perform well enough for a
-// death test, which already incurs significant overhead by launching
-// a child process.
-//
-// Known caveats:
-//
-// A "threadsafe" style death test obtains the path to the test
-// program from argv[0] and re-executes it in the sub-process. For
-// simplicity, the current implementation doesn't search the PATH
-// when launching the sub-process. This means that the user must
-// invoke the test program via a path that contains at least one
-// path separator (e.g. path/to/foo_test and
-// /absolute/path/to/bar_test are fine, but foo_test is not). This
-// is rarely a problem as people usually don't put the test binary
-// directory in PATH.
-//
-// TODO(wan@google.com): make thread-safe death tests search the PATH.
-
-// Asserts that a given statement causes the program to exit, with an
-// integer exit status that satisfies predicate, and emitting error output
-// that matches regex.
-#define ASSERT_EXIT(statement, predicate, regex) \
- GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
-
-// Like ASSERT_EXIT, but continues on to successive tests in the
-// test case, if any:
-#define EXPECT_EXIT(statement, predicate, regex) \
- GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
-
-// Asserts that a given statement causes the program to exit, either by
-// explicitly exiting with a nonzero exit code or being killed by a
-// signal, and emitting error output that matches regex.
-#define ASSERT_DEATH(statement, regex) \
- ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
-
-// Like ASSERT_DEATH, but continues on to successive tests in the
-// test case, if any:
-#define EXPECT_DEATH(statement, regex) \
- EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
-
-// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:
-
-// Tests that an exit code describes a normal exit with a given exit code.
-class GTEST_API_ ExitedWithCode {
- public:
- explicit ExitedWithCode(int exit_code);
- bool operator()(int exit_status) const;
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ExitedWithCode& other);
-
- const int exit_code_;
-};
-
-#if !GTEST_OS_WINDOWS
-// Tests that an exit code describes an exit due to termination by a
-// given signal.
-class GTEST_API_ KilledBySignal {
- public:
- explicit KilledBySignal(int signum);
- bool operator()(int exit_status) const;
- private:
- const int signum_;
-};
-#endif // !GTEST_OS_WINDOWS
-
-// EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.
-// The death testing framework causes this to have interesting semantics,
-// since the sideeffects of the call are only visible in opt mode, and not
-// in debug mode.
-//
-// In practice, this can be used to test functions that utilize the
-// LOG(DFATAL) macro using the following style:
-//
-// int DieInDebugOr12(int* sideeffect) {
-// if (sideeffect) {
-// *sideeffect = 12;
-// }
-// LOG(DFATAL) << "death";
-// return 12;
-// }
-//
-// TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {
-// int sideeffect = 0;
-// // Only asserts in dbg.
-// EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
-//
-// #ifdef NDEBUG
-// // opt-mode has sideeffect visible.
-// EXPECT_EQ(12, sideeffect);
-// #else
-// // dbg-mode no visible sideeffect.
-// EXPECT_EQ(0, sideeffect);
-// #endif
-// }
-//
-// This will assert that DieInDebugReturn12InOpt() crashes in debug
-// mode, usually due to a DCHECK or LOG(DFATAL), but returns the
-// appropriate fallback value (12 in this case) in opt mode. If you
-// need to test that a function has appropriate side-effects in opt
-// mode, include assertions against the side-effects. A general
-// pattern for this is:
-//
-// EXPECT_DEBUG_DEATH({
-// // Side-effects here will have an effect after this statement in
-// // opt mode, but none in debug mode.
-// EXPECT_EQ(12, DieInDebugOr12(&sideeffect));
-// }, "death");
-//
-#ifdef NDEBUG
-
-#define EXPECT_DEBUG_DEATH(statement, regex) \
- do { statement; } while (::testing::internal::AlwaysFalse())
-
-#define ASSERT_DEBUG_DEATH(statement, regex) \
- do { statement; } while (::testing::internal::AlwaysFalse())
-
-#else
-
-#define EXPECT_DEBUG_DEATH(statement, regex) \
- EXPECT_DEATH(statement, regex)
-
-#define ASSERT_DEBUG_DEATH(statement, regex) \
- ASSERT_DEATH(statement, regex)
-
-#endif // NDEBUG for EXPECT_DEBUG_DEATH
-#endif // GTEST_HAS_DEATH_TEST
-
-// EXPECT_DEATH_IF_SUPPORTED(statement, regex) and
-// ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if
-// death tests are supported; otherwise they just issue a warning. This is
-// useful when you are combining death test assertions with normal test
-// assertions in one test.
-#if GTEST_HAS_DEATH_TEST
-#define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
- EXPECT_DEATH(statement, regex)
-#define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
- ASSERT_DEATH(statement, regex)
-#else
-#define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
- GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, )
-#define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
- GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return)
-#endif
-
-} // namespace testing
-
-#endif // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
diff --git a/contrib/llvm/utils/unittest/googletest/include/gtest/gtest-message.h b/contrib/llvm/utils/unittest/googletest/include/gtest/gtest-message.h
deleted file mode 100644
index f135b69..0000000
--- a/contrib/llvm/utils/unittest/googletest/include/gtest/gtest-message.h
+++ /dev/null
@@ -1,230 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// The Google C++ Testing Framework (Google Test)
-//
-// This header file defines the Message class.
-//
-// IMPORTANT NOTE: Due to limitation of the C++ language, we have to
-// leave some internal implementation details in this header file.
-// They are clearly marked by comments like this:
-//
-// // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-//
-// Such code is NOT meant to be used by a user directly, and is subject
-// to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user
-// program!
-
-#ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
-#define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
-
-#include <limits>
-
-#include <gtest/internal/gtest-string.h>
-#include <gtest/internal/gtest-internal.h>
-
-namespace testing {
-
-// The Message class works like an ostream repeater.
-//
-// Typical usage:
-//
-// 1. You stream a bunch of values to a Message object.
-// It will remember the text in a StrStream.
-// 2. Then you stream the Message object to an ostream.
-// This causes the text in the Message to be streamed
-// to the ostream.
-//
-// For example;
-//
-// testing::Message foo;
-// foo << 1 << " != " << 2;
-// std::cout << foo;
-//
-// will print "1 != 2".
-//
-// Message is not intended to be inherited from. In particular, its
-// destructor is not virtual.
-//
-// Note that StrStream behaves differently in gcc and in MSVC. You
-// can stream a NULL char pointer to it in the former, but not in the
-// latter (it causes an access violation if you do). The Message
-// class hides this difference by treating a NULL char pointer as
-// "(null)".
-class GTEST_API_ Message {
- private:
- // The type of basic IO manipulators (endl, ends, and flush) for
- // narrow streams.
- typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
-
- public:
- // Constructs an empty Message.
- // We allocate the StrStream separately because it otherwise each use of
- // ASSERT/EXPECT in a procedure adds over 200 bytes to the procedure's
- // stack frame leading to huge stack frames in some cases; gcc does not reuse
- // the stack space.
- Message() : ss_(new internal::StrStream) {
- // By default, we want there to be enough precision when printing
- // a double to a Message.
- *ss_ << std::setprecision(std::numeric_limits<double>::digits10 + 2);
- }
-
- // Copy constructor.
- Message(const Message& msg) : ss_(new internal::StrStream) { // NOLINT
- *ss_ << msg.GetString();
- }
-
- // Constructs a Message from a C-string.
- explicit Message(const char* str) : ss_(new internal::StrStream) {
- *ss_ << str;
- }
-
- ~Message() { delete ss_; }
-#if GTEST_OS_SYMBIAN
- // Streams a value (either a pointer or not) to this object.
- template <typename T>
- inline Message& operator <<(const T& value) {
- StreamHelper(typename internal::is_pointer<T>::type(), value);
- return *this;
- }
-#else
- // Streams a non-pointer value to this object.
- template <typename T>
- inline Message& operator <<(const T& val) {
- ::GTestStreamToHelper(ss_, val);
- return *this;
- }
-
- // Streams a pointer value to this object.
- //
- // This function is an overload of the previous one. When you
- // stream a pointer to a Message, this definition will be used as it
- // is more specialized. (The C++ Standard, section
- // [temp.func.order].) If you stream a non-pointer, then the
- // previous definition will be used.
- //
- // The reason for this overload is that streaming a NULL pointer to
- // ostream is undefined behavior. Depending on the compiler, you
- // may get "0", "(nil)", "(null)", or an access violation. To
- // ensure consistent result across compilers, we always treat NULL
- // as "(null)".
- template <typename T>
- inline Message& operator <<(T* const& pointer) { // NOLINT
- if (pointer == NULL) {
- *ss_ << "(null)";
- } else {
- ::GTestStreamToHelper(ss_, pointer);
- }
- return *this;
- }
-#endif // GTEST_OS_SYMBIAN
-
- // Since the basic IO manipulators are overloaded for both narrow
- // and wide streams, we have to provide this specialized definition
- // of operator <<, even though its body is the same as the
- // templatized version above. Without this definition, streaming
- // endl or other basic IO manipulators to Message will confuse the
- // compiler.
- Message& operator <<(BasicNarrowIoManip val) {
- *ss_ << val;
- return *this;
- }
-
- // Instead of 1/0, we want to see true/false for bool values.
- Message& operator <<(bool b) {
- return *this << (b ? "true" : "false");
- }
-
- // These two overloads allow streaming a wide C string to a Message
- // using the UTF-8 encoding.
- Message& operator <<(const wchar_t* wide_c_str) {
- return *this << internal::String::ShowWideCString(wide_c_str);
- }
- Message& operator <<(wchar_t* wide_c_str) {
- return *this << internal::String::ShowWideCString(wide_c_str);
- }
-
-#if GTEST_HAS_STD_WSTRING
- // Converts the given wide string to a narrow string using the UTF-8
- // encoding, and streams the result to this Message object.
- Message& operator <<(const ::std::wstring& wstr);
-#endif // GTEST_HAS_STD_WSTRING
-
-#if GTEST_HAS_GLOBAL_WSTRING
- // Converts the given wide string to a narrow string using the UTF-8
- // encoding, and streams the result to this Message object.
- Message& operator <<(const ::wstring& wstr);
-#endif // GTEST_HAS_GLOBAL_WSTRING
-
- // Gets the text streamed to this object so far as a String.
- // Each '\0' character in the buffer is replaced with "\\0".
- //
- // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
- internal::String GetString() const {
- return internal::StrStreamToString(ss_);
- }
-
- private:
-#if GTEST_OS_SYMBIAN
- // These are needed as the Nokia Symbian Compiler cannot decide between
- // const T& and const T* in a function template. The Nokia compiler _can_
- // decide between class template specializations for T and T*, so a
- // tr1::type_traits-like is_pointer works, and we can overload on that.
- template <typename T>
- inline void StreamHelper(internal::true_type /*dummy*/, T* pointer) {
- if (pointer == NULL) {
- *ss_ << "(null)";
- } else {
- ::GTestStreamToHelper(ss_, pointer);
- }
- }
- template <typename T>
- inline void StreamHelper(internal::false_type /*dummy*/, const T& value) {
- ::GTestStreamToHelper(ss_, value);
- }
-#endif // GTEST_OS_SYMBIAN
-
- // We'll hold the text streamed to this object here.
- internal::StrStream* const ss_;
-
- // We declare (but don't implement) this to prevent the compiler
- // from implementing the assignment operator.
- void operator=(const Message&);
-};
-
-// Streams a Message to an ostream.
-inline std::ostream& operator <<(std::ostream& os, const Message& sb) {
- return os << sb.GetString();
-}
-
-} // namespace testing
-
-#endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
diff --git a/contrib/llvm/utils/unittest/googletest/include/gtest/gtest-param-test.h b/contrib/llvm/utils/unittest/googletest/include/gtest/gtest-param-test.h
deleted file mode 100644
index 3184d07..0000000
--- a/contrib/llvm/utils/unittest/googletest/include/gtest/gtest-param-test.h
+++ /dev/null
@@ -1,1397 +0,0 @@
-// This file was GENERATED by a script. DO NOT EDIT BY HAND!!!
-
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-//
-// Authors: vladl@google.com (Vlad Losev)
-//
-// Macros and functions for implementing parameterized tests
-// in Google C++ Testing Framework (Google Test)
-//
-// This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
-//
-#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
-#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
-
-
-// Value-parameterized tests allow you to test your code with different
-// parameters without writing multiple copies of the same test.
-//
-// Here is how you use value-parameterized tests:
-
-#if 0
-
-// To write value-parameterized tests, first you should define a fixture
-// class. It must be derived from testing::TestWithParam<T>, where T is
-// the type of your parameter values. TestWithParam<T> is itself derived
-// from testing::Test. T can be any copyable type. If it's a raw pointer,
-// you are responsible for managing the lifespan of the pointed values.
-
-class FooTest : public ::testing::TestWithParam<const char*> {
- // You can implement all the usual class fixture members here.
-};
-
-// Then, use the TEST_P macro to define as many parameterized tests
-// for this fixture as you want. The _P suffix is for "parameterized"
-// or "pattern", whichever you prefer to think.
-
-TEST_P(FooTest, DoesBlah) {
- // Inside a test, access the test parameter with the GetParam() method
- // of the TestWithParam<T> class:
- EXPECT_TRUE(foo.Blah(GetParam()));
- ...
-}
-
-TEST_P(FooTest, HasBlahBlah) {
- ...
-}
-
-// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
-// case with any set of parameters you want. Google Test defines a number
-// of functions for generating test parameters. They return what we call
-// (surprise!) parameter generators. Here is a summary of them, which
-// are all in the testing namespace:
-//
-//
-// Range(begin, end [, step]) - Yields values {begin, begin+step,
-// begin+step+step, ...}. The values do not
-// include end. step defaults to 1.
-// Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}.
-// ValuesIn(container) - Yields values from a C-style array, an STL
-// ValuesIn(begin,end) container, or an iterator range [begin, end).
-// Bool() - Yields sequence {false, true}.
-// Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product
-// for the math savvy) of the values generated
-// by the N generators.
-//
-// For more details, see comments at the definitions of these functions below
-// in this file.
-//
-// The following statement will instantiate tests from the FooTest test case
-// each with parameter values "meeny", "miny", and "moe".
-
-INSTANTIATE_TEST_CASE_P(InstantiationName,
- FooTest,
- Values("meeny", "miny", "moe"));
-
-// To distinguish different instances of the pattern, (yes, you
-// can instantiate it more then once) the first argument to the
-// INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
-// actual test case name. Remember to pick unique prefixes for different
-// instantiations. The tests from the instantiation above will have
-// these names:
-//
-// * InstantiationName/FooTest.DoesBlah/0 for "meeny"
-// * InstantiationName/FooTest.DoesBlah/1 for "miny"
-// * InstantiationName/FooTest.DoesBlah/2 for "moe"
-// * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
-// * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
-// * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
-//
-// You can use these names in --gtest_filter.
-//
-// This statement will instantiate all tests from FooTest again, each
-// with parameter values "cat" and "dog":
-
-const char* pets[] = {"cat", "dog"};
-INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
-
-// The tests from the instantiation above will have these names:
-//
-// * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
-// * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
-// * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
-// * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
-//
-// Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
-// in the given test case, whether their definitions come before or
-// AFTER the INSTANTIATE_TEST_CASE_P statement.
-//
-// Please also note that generator expressions (including parameters to the
-// generators) are evaluated in InitGoogleTest(), after main() has started.
-// This allows the user on one hand, to adjust generator parameters in order
-// to dynamically determine a set of tests to run and on the other hand,
-// give the user a chance to inspect the generated tests with Google Test
-// reflection API before RUN_ALL_TESTS() is executed.
-//
-// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
-// for more examples.
-//
-// In the future, we plan to publish the API for defining new parameter
-// generators. But for now this interface remains part of the internal
-// implementation and is subject to change.
-
-#endif // 0
-
-#include <gtest/internal/gtest-port.h>
-
-#if !GTEST_OS_SYMBIAN
-#include <utility>
-#endif
-
-// scripts/fuse_gtest.py depends on gtest's own header being #included
-// *unconditionally*. Therefore these #includes cannot be moved
-// inside #if GTEST_HAS_PARAM_TEST.
-#include <gtest/internal/gtest-internal.h>
-#include <gtest/internal/gtest-param-util.h>
-
-#if GTEST_HAS_PARAM_TEST
-
-namespace testing {
-
-// Functions producing parameter generators.
-//
-// Google Test uses these generators to produce parameters for value-
-// parameterized tests. When a parameterized test case is instantiated
-// with a particular generator, Google Test creates and runs tests
-// for each element in the sequence produced by the generator.
-//
-// In the following sample, tests from test case FooTest are instantiated
-// each three times with parameter values 3, 5, and 8:
-//
-// class FooTest : public TestWithParam<int> { ... };
-//
-// TEST_P(FooTest, TestThis) {
-// }
-// TEST_P(FooTest, TestThat) {
-// }
-// INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
-//
-
-// Range() returns generators providing sequences of values in a range.
-//
-// Synopsis:
-// Range(start, end)
-// - returns a generator producing a sequence of values {start, start+1,
-// start+2, ..., }.
-// Range(start, end, step)
-// - returns a generator producing a sequence of values {start, start+step,
-// start+step+step, ..., }.
-// Notes:
-// * The generated sequences never include end. For example, Range(1, 5)
-// returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
-// returns a generator producing {1, 3, 5, 7}.
-// * start and end must have the same type. That type may be any integral or
-// floating-point type or a user defined type satisfying these conditions:
-// * It must be assignable (have operator=() defined).
-// * It must have operator+() (operator+(int-compatible type) for
-// two-operand version).
-// * It must have operator<() defined.
-// Elements in the resulting sequences will also have that type.
-// * Condition start < end must be satisfied in order for resulting sequences
-// to contain any elements.
-//
-template <typename T, typename IncrementT>
-internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
- return internal::ParamGenerator<T>(
- new internal::RangeGenerator<T, IncrementT>(start, end, step));
-}
-
-template <typename T>
-internal::ParamGenerator<T> Range(T start, T end) {
- return Range(start, end, 1);
-}
-
-// ValuesIn() function allows generation of tests with parameters coming from
-// a container.
-//
-// Synopsis:
-// ValuesIn(const T (&array)[N])
-// - returns a generator producing sequences with elements from
-// a C-style array.
-// ValuesIn(const Container& container)
-// - returns a generator producing sequences with elements from
-// an STL-style container.
-// ValuesIn(Iterator begin, Iterator end)
-// - returns a generator producing sequences with elements from
-// a range [begin, end) defined by a pair of STL-style iterators. These
-// iterators can also be plain C pointers.
-//
-// Please note that ValuesIn copies the values from the containers
-// passed in and keeps them to generate tests in RUN_ALL_TESTS().
-//
-// Examples:
-//
-// This instantiates tests from test case StringTest
-// each with C-string values of "foo", "bar", and "baz":
-//
-// const char* strings[] = {"foo", "bar", "baz"};
-// INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));
-//
-// This instantiates tests from test case StlStringTest
-// each with STL strings with values "a" and "b":
-//
-// ::std::vector< ::std::string> GetParameterStrings() {
-// ::std::vector< ::std::string> v;
-// v.push_back("a");
-// v.push_back("b");
-// return v;
-// }
-//
-// INSTANTIATE_TEST_CASE_P(CharSequence,
-// StlStringTest,
-// ValuesIn(GetParameterStrings()));
-//
-//
-// This will also instantiate tests from CharTest
-// each with parameter values 'a' and 'b':
-//
-// ::std::list<char> GetParameterChars() {
-// ::std::list<char> list;
-// list.push_back('a');
-// list.push_back('b');
-// return list;
-// }
-// ::std::list<char> l = GetParameterChars();
-// INSTANTIATE_TEST_CASE_P(CharSequence2,
-// CharTest,
-// ValuesIn(l.begin(), l.end()));
-//
-template <typename ForwardIterator>
-internal::ParamGenerator<
- typename ::std::iterator_traits<ForwardIterator>::value_type> ValuesIn(
- ForwardIterator begin,
- ForwardIterator end) {
- typedef typename ::std::iterator_traits<ForwardIterator>::value_type
- ParamType;
- return internal::ParamGenerator<ParamType>(
- new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
-}
-
-template <typename T, size_t N>
-internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
- return ValuesIn(array, array + N);
-}
-
-template <class Container>
-internal::ParamGenerator<typename Container::value_type> ValuesIn(
- const Container& container) {
- return ValuesIn(container.begin(), container.end());
-}
-
-} // namespace testing
-
-#include <gtest/internal/gtest-param-util-generated.h>
-
-namespace testing {
-
-// Values() allows generating tests from explicitly specified list of
-// parameters.
-//
-// Synopsis:
-// Values(T v1, T v2, ..., T vN)
-// - returns a generator producing sequences with elements v1, v2, ..., vN.
-//
-// For example, this instantiates tests from test case BarTest each
-// with values "one", "two", and "three":
-//
-// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
-//
-// This instantiates tests from test case BazTest each with values 1, 2, 3.5.
-// The exact type of values will depend on the type of parameter in BazTest.
-//
-// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
-//
-// Currently, Values() supports from 1 to 50 parameters.
-//
-template <typename T1>
-internal::ValueArray1<T1> Values(T1 v1) {
- return internal::ValueArray1<T1>(v1);
-}
-
-template <typename T1, typename T2>
-internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {
- return internal::ValueArray2<T1, T2>(v1, v2);
-}
-
-template <typename T1, typename T2, typename T3>
-internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {
- return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);
-}
-
-template <typename T1, typename T2, typename T3, typename T4>
-internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {
- return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5>
-internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,
- T5 v5) {
- return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6>
-internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,
- T4 v4, T5 v5, T6 v6) {
- return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7>
-internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,
- T4 v4, T5 v5, T6 v6, T7 v7) {
- return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,
- v6, v7);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8>
-internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,
- T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {
- return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,
- v5, v6, v7, v8);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9>
-internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,
- T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {
- return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,
- v4, v5, v6, v7, v8, v9);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10>
-internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,
- T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {
- return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,
- v2, v3, v4, v5, v6, v7, v8, v9, v10);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11>
-internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
- T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11) {
- return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
- T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12>
-internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12) {
- return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13>
-internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13) {
- return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14>
-internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {
- return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
- v14);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15>
-internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
- T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {
- return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
- v13, v14, v15);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16>
-internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
- T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
- T16 v16) {
- return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
- v12, v13, v14, v15, v16);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17>
-internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
- T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
- T16 v16, T17 v17) {
- return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
- v11, v12, v13, v14, v15, v16, v17);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18>
-internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
- T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
- T16 v16, T17 v17, T18 v18) {
- return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
- v10, v11, v12, v13, v14, v15, v16, v17, v18);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19>
-internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
- T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
- T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {
- return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,
- v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20>
-internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,
- T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
- T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {
- return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,
- v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21>
-internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,
- T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
- T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {
- return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,
- v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22>
-internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,
- T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
- T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
- T21 v21, T22 v22) {
- return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,
- v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
- v20, v21, v22);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23>
-internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,
- T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
- T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
- T21 v21, T22 v22, T23 v23) {
- return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,
- v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
- v20, v21, v22, v23);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24>
-internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,
- T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
- T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
- T21 v21, T22 v22, T23 v23, T24 v24) {
- return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,
- v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
- v19, v20, v21, v22, v23, v24);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25>
-internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,
- T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
- T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
- T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {
- return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,
- v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
- v18, v19, v20, v21, v22, v23, v24, v25);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26>
-internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26) {
- return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
- v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27>
-internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27) {
- return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
- v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28>
-internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28) {
- return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
- v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
- v28);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29>
-internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29) {
- return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
- v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
- v27, v28, v29);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30>
-internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
- T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
- T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
- T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {
- return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
- v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
- v26, v27, v28, v29, v30);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31>
-internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
- T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
- T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
- T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {
- return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
- v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
- v25, v26, v27, v28, v29, v30, v31);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32>
-internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
- T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
- T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
- T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
- T32 v32) {
- return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
- v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
- v24, v25, v26, v27, v28, v29, v30, v31, v32);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33>
-internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
- T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
- T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
- T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
- T32 v32, T33 v33) {
- return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,
- v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
- v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34>
-internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
- T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
- T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
- T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
- T31 v31, T32 v32, T33 v33, T34 v34) {
- return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,
- v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
- v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35>
-internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,
- T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
- T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
- T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
- T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {
- return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,
- v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
- v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36>
-internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,
- T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
- T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
- T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
- T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {
- return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,
- v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
- v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
- v34, v35, v36);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37>
-internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,
- T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
- T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
- T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
- T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
- T37 v37) {
- return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,
- v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
- v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
- v34, v35, v36, v37);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38>
-internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,
- T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
- T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
- T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
- T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
- T37 v37, T38 v38) {
- return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,
- v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
- v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,
- v33, v34, v35, v36, v37, v38);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39>
-internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,
- T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
- T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
- T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
- T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
- T37 v37, T38 v38, T39 v39) {
- return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1,
- v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
- v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,
- v32, v33, v34, v35, v36, v37, v38, v39);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40>
-internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,
- T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
- T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
- T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,
- T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,
- T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {
- return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
- T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
- v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,
- v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41>
-internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {
- return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
- T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
- v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,
- v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42>
-internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
- T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
- T42 v42) {
- return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
- T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
- v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
- v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,
- v42);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43>
-internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
- T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
- T42 v42, T43 v43) {
- return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
- T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
- v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
- v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,
- v41, v42, v43);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44>
-internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
- T42 v42, T43 v43, T44 v44) {
- return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
- T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
- v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
- v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,
- v40, v41, v42, v43, v44);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45>
-internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
- T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
- T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
- T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
- T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
- T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {
- return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
- T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
- v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
- v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,
- v39, v40, v41, v42, v43, v44, v45);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46>
-internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
- T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
- T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
- T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
- T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
- T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {
- return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
- T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
- v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
- v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
- v38, v39, v40, v41, v42, v43, v44, v45, v46);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47>
-internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
- T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
- T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
- T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
- T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
- T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {
- return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
- T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,
- v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
- v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
- v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47, typename T48>
-internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
- T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
- T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
- T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
- T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
- T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,
- T48 v48) {
- return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
- T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,
- v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
- v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,
- v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47, typename T48, typename T49>
-internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
- T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
- T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
- T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
- T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,
- T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,
- T47 v47, T48 v48, T49 v49) {
- return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
- T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,
- v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
- v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,
- v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);
-}
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47, typename T48, typename T49, typename T50>
-internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,
- T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
- T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
- T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
- T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,
- T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,
- T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {
- return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
- T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,
- v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
- v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
- v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,
- v48, v49, v50);
-}
-
-// Bool() allows generating tests with parameters in a set of (false, true).
-//
-// Synopsis:
-// Bool()
-// - returns a generator producing sequences with elements {false, true}.
-//
-// It is useful when testing code that depends on Boolean flags. Combinations
-// of multiple flags can be tested when several Bool()'s are combined using
-// Combine() function.
-//
-// In the following example all tests in the test case FlagDependentTest
-// will be instantiated twice with parameters false and true.
-//
-// class FlagDependentTest : public testing::TestWithParam<bool> {
-// virtual void SetUp() {
-// external_flag = GetParam();
-// }
-// }
-// INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
-//
-inline internal::ParamGenerator<bool> Bool() {
- return Values(false, true);
-}
-
-#if GTEST_HAS_COMBINE
-// Combine() allows the user to combine two or more sequences to produce
-// values of a Cartesian product of those sequences' elements.
-//
-// Synopsis:
-// Combine(gen1, gen2, ..., genN)
-// - returns a generator producing sequences with elements coming from
-// the Cartesian product of elements from the sequences generated by
-// gen1, gen2, ..., genN. The sequence elements will have a type of
-// tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
-// of elements from sequences produces by gen1, gen2, ..., genN.
-//
-// Combine can have up to 10 arguments. This number is currently limited
-// by the maximum number of elements in the tuple implementation used by Google
-// Test.
-//
-// Example:
-//
-// This will instantiate tests in test case AnimalTest each one with
-// the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
-// tuple("dog", BLACK), and tuple("dog", WHITE):
-//
-// enum Color { BLACK, GRAY, WHITE };
-// class AnimalTest
-// : public testing::TestWithParam<tuple<const char*, Color> > {...};
-//
-// TEST_P(AnimalTest, AnimalLooksNice) {...}
-//
-// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
-// Combine(Values("cat", "dog"),
-// Values(BLACK, WHITE)));
-//
-// This will instantiate tests in FlagDependentTest with all variations of two
-// Boolean flags:
-//
-// class FlagDependentTest
-// : public testing::TestWithParam<tuple(bool, bool)> > {
-// virtual void SetUp() {
-// // Assigns external_flag_1 and external_flag_2 values from the tuple.
-// tie(external_flag_1, external_flag_2) = GetParam();
-// }
-// };
-//
-// TEST_P(FlagDependentTest, TestFeature1) {
-// // Test your code using external_flag_1 and external_flag_2 here.
-// }
-// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
-// Combine(Bool(), Bool()));
-//
-template <typename Generator1, typename Generator2>
-internal::CartesianProductHolder2<Generator1, Generator2> Combine(
- const Generator1& g1, const Generator2& g2) {
- return internal::CartesianProductHolder2<Generator1, Generator2>(
- g1, g2);
-}
-
-template <typename Generator1, typename Generator2, typename Generator3>
-internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(
- const Generator1& g1, const Generator2& g2, const Generator3& g3) {
- return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(
- g1, g2, g3);
-}
-
-template <typename Generator1, typename Generator2, typename Generator3,
- typename Generator4>
-internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
- Generator4> Combine(
- const Generator1& g1, const Generator2& g2, const Generator3& g3,
- const Generator4& g4) {
- return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
- Generator4>(
- g1, g2, g3, g4);
-}
-
-template <typename Generator1, typename Generator2, typename Generator3,
- typename Generator4, typename Generator5>
-internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
- Generator4, Generator5> Combine(
- const Generator1& g1, const Generator2& g2, const Generator3& g3,
- const Generator4& g4, const Generator5& g5) {
- return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
- Generator4, Generator5>(
- g1, g2, g3, g4, g5);
-}
-
-template <typename Generator1, typename Generator2, typename Generator3,
- typename Generator4, typename Generator5, typename Generator6>
-internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
- Generator4, Generator5, Generator6> Combine(
- const Generator1& g1, const Generator2& g2, const Generator3& g3,
- const Generator4& g4, const Generator5& g5, const Generator6& g6) {
- return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
- Generator4, Generator5, Generator6>(
- g1, g2, g3, g4, g5, g6);
-}
-
-template <typename Generator1, typename Generator2, typename Generator3,
- typename Generator4, typename Generator5, typename Generator6,
- typename Generator7>
-internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
- Generator4, Generator5, Generator6, Generator7> Combine(
- const Generator1& g1, const Generator2& g2, const Generator3& g3,
- const Generator4& g4, const Generator5& g5, const Generator6& g6,
- const Generator7& g7) {
- return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
- Generator4, Generator5, Generator6, Generator7>(
- g1, g2, g3, g4, g5, g6, g7);
-}
-
-template <typename Generator1, typename Generator2, typename Generator3,
- typename Generator4, typename Generator5, typename Generator6,
- typename Generator7, typename Generator8>
-internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
- Generator4, Generator5, Generator6, Generator7, Generator8> Combine(
- const Generator1& g1, const Generator2& g2, const Generator3& g3,
- const Generator4& g4, const Generator5& g5, const Generator6& g6,
- const Generator7& g7, const Generator8& g8) {
- return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
- Generator4, Generator5, Generator6, Generator7, Generator8>(
- g1, g2, g3, g4, g5, g6, g7, g8);
-}
-
-template <typename Generator1, typename Generator2, typename Generator3,
- typename Generator4, typename Generator5, typename Generator6,
- typename Generator7, typename Generator8, typename Generator9>
-internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
- Generator4, Generator5, Generator6, Generator7, Generator8,
- Generator9> Combine(
- const Generator1& g1, const Generator2& g2, const Generator3& g3,
- const Generator4& g4, const Generator5& g5, const Generator6& g6,
- const Generator7& g7, const Generator8& g8, const Generator9& g9) {
- return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
- Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(
- g1, g2, g3, g4, g5, g6, g7, g8, g9);
-}
-
-template <typename Generator1, typename Generator2, typename Generator3,
- typename Generator4, typename Generator5, typename Generator6,
- typename Generator7, typename Generator8, typename Generator9,
- typename Generator10>
-internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
- Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
- Generator10> Combine(
- const Generator1& g1, const Generator2& g2, const Generator3& g3,
- const Generator4& g4, const Generator5& g5, const Generator6& g6,
- const Generator7& g7, const Generator8& g8, const Generator9& g9,
- const Generator10& g10) {
- return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
- Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
- Generator10>(
- g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);
-}
-#endif // GTEST_HAS_COMBINE
-
-
-
-#define TEST_P(test_case_name, test_name) \
- class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
- : public test_case_name { \
- public: \
- GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
- virtual void TestBody(); \
- private: \
- static int AddToRegistry() { \
- ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
- GetTestCasePatternHolder<test_case_name>(\
- #test_case_name, __FILE__, __LINE__)->AddTestPattern(\
- #test_case_name, \
- #test_name, \
- new ::testing::internal::TestMetaFactory< \
- GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \
- return 0; \
- } \
- static int gtest_registering_dummy_; \
- GTEST_DISALLOW_COPY_AND_ASSIGN_(\
- GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
- }; \
- int GTEST_TEST_CLASS_NAME_(test_case_name, \
- test_name)::gtest_registering_dummy_ = \
- GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
- void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
-
-#define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \
- ::testing::internal::ParamGenerator<test_case_name::ParamType> \
- gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
- int gtest_##prefix##test_case_name##_dummy_ = \
- ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
- GetTestCasePatternHolder<test_case_name>(\
- #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\
- #prefix, \
- &gtest_##prefix##test_case_name##_EvalGenerator_, \
- __FILE__, __LINE__)
-
-} // namespace testing
-
-#endif // GTEST_HAS_PARAM_TEST
-
-#endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
diff --git a/contrib/llvm/utils/unittest/googletest/include/gtest/gtest-spi.h b/contrib/llvm/utils/unittest/googletest/include/gtest/gtest-spi.h
deleted file mode 100644
index c41da48..0000000
--- a/contrib/llvm/utils/unittest/googletest/include/gtest/gtest-spi.h
+++ /dev/null
@@ -1,232 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// Utilities for testing Google Test itself and code that uses Google Test
-// (e.g. frameworks built on top of Google Test).
-
-#ifndef GTEST_INCLUDE_GTEST_GTEST_SPI_H_
-#define GTEST_INCLUDE_GTEST_GTEST_SPI_H_
-
-#include <gtest/gtest.h>
-
-namespace testing {
-
-// This helper class can be used to mock out Google Test failure reporting
-// so that we can test Google Test or code that builds on Google Test.
-//
-// An object of this class appends a TestPartResult object to the
-// TestPartResultArray object given in the constructor whenever a Google Test
-// failure is reported. It can either intercept only failures that are
-// generated in the same thread that created this object or it can intercept
-// all generated failures. The scope of this mock object can be controlled with
-// the second argument to the two arguments constructor.
-class GTEST_API_ ScopedFakeTestPartResultReporter
- : public TestPartResultReporterInterface {
- public:
- // The two possible mocking modes of this object.
- enum InterceptMode {
- INTERCEPT_ONLY_CURRENT_THREAD, // Intercepts only thread local failures.
- INTERCEPT_ALL_THREADS // Intercepts all failures.
- };
-
- // The c'tor sets this object as the test part result reporter used
- // by Google Test. The 'result' parameter specifies where to report the
- // results. This reporter will only catch failures generated in the current
- // thread. DEPRECATED
- explicit ScopedFakeTestPartResultReporter(TestPartResultArray* result);
-
- // Same as above, but you can choose the interception scope of this object.
- ScopedFakeTestPartResultReporter(InterceptMode intercept_mode,
- TestPartResultArray* result);
-
- // The d'tor restores the previous test part result reporter.
- virtual ~ScopedFakeTestPartResultReporter();
-
- // Appends the TestPartResult object to the TestPartResultArray
- // received in the constructor.
- //
- // This method is from the TestPartResultReporterInterface
- // interface.
- virtual void ReportTestPartResult(const TestPartResult& result);
- private:
- void Init();
-
- const InterceptMode intercept_mode_;
- TestPartResultReporterInterface* old_reporter_;
- TestPartResultArray* const result_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedFakeTestPartResultReporter);
-};
-
-namespace internal {
-
-// A helper class for implementing EXPECT_FATAL_FAILURE() and
-// EXPECT_NONFATAL_FAILURE(). Its destructor verifies that the given
-// TestPartResultArray contains exactly one failure that has the given
-// type and contains the given substring. If that's not the case, a
-// non-fatal failure will be generated.
-class GTEST_API_ SingleFailureChecker {
- public:
- // The constructor remembers the arguments.
- SingleFailureChecker(const TestPartResultArray* results,
- TestPartResult::Type type,
- const char* substr);
- ~SingleFailureChecker();
- private:
- const TestPartResultArray* const results_;
- const TestPartResult::Type type_;
- const String substr_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(SingleFailureChecker);
-};
-
-} // namespace internal
-
-} // namespace testing
-
-// A set of macros for testing Google Test assertions or code that's expected
-// to generate Google Test fatal failures. It verifies that the given
-// statement will cause exactly one fatal Google Test failure with 'substr'
-// being part of the failure message.
-//
-// There are two different versions of this macro. EXPECT_FATAL_FAILURE only
-// affects and considers failures generated in the current thread and
-// EXPECT_FATAL_FAILURE_ON_ALL_THREADS does the same but for all threads.
-//
-// The verification of the assertion is done correctly even when the statement
-// throws an exception or aborts the current function.
-//
-// Known restrictions:
-// - 'statement' cannot reference local non-static variables or
-// non-static members of the current object.
-// - 'statement' cannot return a value.
-// - You cannot stream a failure message to this macro.
-//
-// Note that even though the implementations of the following two
-// macros are much alike, we cannot refactor them to use a common
-// helper macro, due to some peculiarity in how the preprocessor
-// works. The AcceptsMacroThatExpandsToUnprotectedComma test in
-// gtest_unittest.cc will fail to compile if we do that.
-#define EXPECT_FATAL_FAILURE(statement, substr) \
- do { \
- class GTestExpectFatalFailureHelper {\
- public:\
- static void Execute() { statement; }\
- };\
- ::testing::TestPartResultArray gtest_failures;\
- ::testing::internal::SingleFailureChecker gtest_checker(\
- &gtest_failures, ::testing::TestPartResult::kFatalFailure, (substr));\
- {\
- ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\
- ::testing::ScopedFakeTestPartResultReporter:: \
- INTERCEPT_ONLY_CURRENT_THREAD, &gtest_failures);\
- GTestExpectFatalFailureHelper::Execute();\
- }\
- } while (::testing::internal::AlwaysFalse())
-
-#define EXPECT_FATAL_FAILURE_ON_ALL_THREADS(statement, substr) \
- do { \
- class GTestExpectFatalFailureHelper {\
- public:\
- static void Execute() { statement; }\
- };\
- ::testing::TestPartResultArray gtest_failures;\
- ::testing::internal::SingleFailureChecker gtest_checker(\
- &gtest_failures, ::testing::TestPartResult::kFatalFailure, (substr));\
- {\
- ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\
- ::testing::ScopedFakeTestPartResultReporter:: \
- INTERCEPT_ALL_THREADS, &gtest_failures);\
- GTestExpectFatalFailureHelper::Execute();\
- }\
- } while (::testing::internal::AlwaysFalse())
-
-// A macro for testing Google Test assertions or code that's expected to
-// generate Google Test non-fatal failures. It asserts that the given
-// statement will cause exactly one non-fatal Google Test failure with 'substr'
-// being part of the failure message.
-//
-// There are two different versions of this macro. EXPECT_NONFATAL_FAILURE only
-// affects and considers failures generated in the current thread and
-// EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS does the same but for all threads.
-//
-// 'statement' is allowed to reference local variables and members of
-// the current object.
-//
-// The verification of the assertion is done correctly even when the statement
-// throws an exception or aborts the current function.
-//
-// Known restrictions:
-// - You cannot stream a failure message to this macro.
-//
-// Note that even though the implementations of the following two
-// macros are much alike, we cannot refactor them to use a common
-// helper macro, due to some peculiarity in how the preprocessor
-// works. If we do that, the code won't compile when the user gives
-// EXPECT_NONFATAL_FAILURE() a statement that contains a macro that
-// expands to code containing an unprotected comma. The
-// AcceptsMacroThatExpandsToUnprotectedComma test in gtest_unittest.cc
-// catches that.
-//
-// For the same reason, we have to write
-// if (::testing::internal::AlwaysTrue()) { statement; }
-// instead of
-// GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
-// to avoid an MSVC warning on unreachable code.
-#define EXPECT_NONFATAL_FAILURE(statement, substr) \
- do {\
- ::testing::TestPartResultArray gtest_failures;\
- ::testing::internal::SingleFailureChecker gtest_checker(\
- &gtest_failures, ::testing::TestPartResult::kNonFatalFailure, \
- (substr));\
- {\
- ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\
- ::testing::ScopedFakeTestPartResultReporter:: \
- INTERCEPT_ONLY_CURRENT_THREAD, &gtest_failures);\
- if (::testing::internal::AlwaysTrue()) { statement; }\
- }\
- } while (::testing::internal::AlwaysFalse())
-
-#define EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(statement, substr) \
- do {\
- ::testing::TestPartResultArray gtest_failures;\
- ::testing::internal::SingleFailureChecker gtest_checker(\
- &gtest_failures, ::testing::TestPartResult::kNonFatalFailure, \
- (substr));\
- {\
- ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\
- ::testing::ScopedFakeTestPartResultReporter::INTERCEPT_ALL_THREADS,\
- &gtest_failures);\
- if (::testing::internal::AlwaysTrue()) { statement; }\
- }\
- } while (::testing::internal::AlwaysFalse())
-
-#endif // GTEST_INCLUDE_GTEST_GTEST_SPI_H_
diff --git a/contrib/llvm/utils/unittest/googletest/include/gtest/gtest-test-part.h b/contrib/llvm/utils/unittest/googletest/include/gtest/gtest-test-part.h
deleted file mode 100644
index f714759..0000000
--- a/contrib/llvm/utils/unittest/googletest/include/gtest/gtest-test-part.h
+++ /dev/null
@@ -1,176 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-//
-// Author: mheule@google.com (Markus Heule)
-//
-
-#ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
-#define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
-
-#include <iosfwd>
-#include <vector>
-#include <gtest/internal/gtest-internal.h>
-#include <gtest/internal/gtest-string.h>
-
-namespace testing {
-
-// A copyable object representing the result of a test part (i.e. an
-// assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).
-//
-// Don't inherit from TestPartResult as its destructor is not virtual.
-class GTEST_API_ TestPartResult {
- public:
- // The possible outcomes of a test part (i.e. an assertion or an
- // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
- enum Type {
- kSuccess, // Succeeded.
- kNonFatalFailure, // Failed but the test can continue.
- kFatalFailure // Failed and the test should be terminated.
- };
-
- // C'tor. TestPartResult does NOT have a default constructor.
- // Always use this constructor (with parameters) to create a
- // TestPartResult object.
- TestPartResult(Type a_type,
- const char* a_file_name,
- int a_line_number,
- const char* a_message)
- : type_(a_type),
- file_name_(a_file_name),
- line_number_(a_line_number),
- summary_(ExtractSummary(a_message)),
- message_(a_message) {
- }
-
- // Gets the outcome of the test part.
- Type type() const { return type_; }
-
- // Gets the name of the source file where the test part took place, or
- // NULL if it's unknown.
- const char* file_name() const { return file_name_.c_str(); }
-
- // Gets the line in the source file where the test part took place,
- // or -1 if it's unknown.
- int line_number() const { return line_number_; }
-
- // Gets the summary of the failure message.
- const char* summary() const { return summary_.c_str(); }
-
- // Gets the message associated with the test part.
- const char* message() const { return message_.c_str(); }
-
- // Returns true iff the test part passed.
- bool passed() const { return type_ == kSuccess; }
-
- // Returns true iff the test part failed.
- bool failed() const { return type_ != kSuccess; }
-
- // Returns true iff the test part non-fatally failed.
- bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
-
- // Returns true iff the test part fatally failed.
- bool fatally_failed() const { return type_ == kFatalFailure; }
- private:
- Type type_;
-
- // Gets the summary of the failure message by omitting the stack
- // trace in it.
- static internal::String ExtractSummary(const char* message);
-
- // The name of the source file where the test part took place, or
- // NULL if the source file is unknown.
- internal::String file_name_;
- // The line in the source file where the test part took place, or -1
- // if the line number is unknown.
- int line_number_;
- internal::String summary_; // The test failure summary.
- internal::String message_; // The test failure message.
-};
-
-// Prints a TestPartResult object.
-std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
-
-// An array of TestPartResult objects.
-//
-// Don't inherit from TestPartResultArray as its destructor is not
-// virtual.
-class GTEST_API_ TestPartResultArray {
- public:
- TestPartResultArray() {}
-
- // Appends the given TestPartResult to the array.
- void Append(const TestPartResult& result);
-
- // Returns the TestPartResult at the given index (0-based).
- const TestPartResult& GetTestPartResult(int index) const;
-
- // Returns the number of TestPartResult objects in the array.
- int size() const;
-
- private:
- std::vector<TestPartResult> array_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);
-};
-
-// This interface knows how to report a test part result.
-class TestPartResultReporterInterface {
- public:
- virtual ~TestPartResultReporterInterface() {}
-
- virtual void ReportTestPartResult(const TestPartResult& result) = 0;
-};
-
-namespace internal {
-
-// This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a
-// statement generates new fatal failures. To do so it registers itself as the
-// current test part result reporter. Besides checking if fatal failures were
-// reported, it only delegates the reporting to the former result reporter.
-// The original result reporter is restored in the destructor.
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-class GTEST_API_ HasNewFatalFailureHelper
- : public TestPartResultReporterInterface {
- public:
- HasNewFatalFailureHelper();
- virtual ~HasNewFatalFailureHelper();
- virtual void ReportTestPartResult(const TestPartResult& result);
- bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
- private:
- bool has_new_fatal_failure_;
- TestPartResultReporterInterface* original_reporter_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);
-};
-
-} // namespace internal
-
-} // namespace testing
-
-#endif // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
diff --git a/contrib/llvm/utils/unittest/googletest/include/gtest/gtest-typed-test.h b/contrib/llvm/utils/unittest/googletest/include/gtest/gtest-typed-test.h
deleted file mode 100644
index 1ec8eb8..0000000
--- a/contrib/llvm/utils/unittest/googletest/include/gtest/gtest-typed-test.h
+++ /dev/null
@@ -1,259 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-#ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
-#define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
-
-// This header implements typed tests and type-parameterized tests.
-
-// Typed (aka type-driven) tests repeat the same test for types in a
-// list. You must know which types you want to test with when writing
-// typed tests. Here's how you do it:
-
-#if 0
-
-// First, define a fixture class template. It should be parameterized
-// by a type. Remember to derive it from testing::Test.
-template <typename T>
-class FooTest : public testing::Test {
- public:
- ...
- typedef std::list<T> List;
- static T shared_;
- T value_;
-};
-
-// Next, associate a list of types with the test case, which will be
-// repeated for each type in the list. The typedef is necessary for
-// the macro to parse correctly.
-typedef testing::Types<char, int, unsigned int> MyTypes;
-TYPED_TEST_CASE(FooTest, MyTypes);
-
-// If the type list contains only one type, you can write that type
-// directly without Types<...>:
-// TYPED_TEST_CASE(FooTest, int);
-
-// Then, use TYPED_TEST() instead of TEST_F() to define as many typed
-// tests for this test case as you want.
-TYPED_TEST(FooTest, DoesBlah) {
- // Inside a test, refer to TypeParam to get the type parameter.
- // Since we are inside a derived class template, C++ requires use to
- // visit the members of FooTest via 'this'.
- TypeParam n = this->value_;
-
- // To visit static members of the fixture, add the TestFixture::
- // prefix.
- n += TestFixture::shared_;
-
- // To refer to typedefs in the fixture, add the "typename
- // TestFixture::" prefix.
- typename TestFixture::List values;
- values.push_back(n);
- ...
-}
-
-TYPED_TEST(FooTest, HasPropertyA) { ... }
-
-#endif // 0
-
-// Type-parameterized tests are abstract test patterns parameterized
-// by a type. Compared with typed tests, type-parameterized tests
-// allow you to define the test pattern without knowing what the type
-// parameters are. The defined pattern can be instantiated with
-// different types any number of times, in any number of translation
-// units.
-//
-// If you are designing an interface or concept, you can define a
-// suite of type-parameterized tests to verify properties that any
-// valid implementation of the interface/concept should have. Then,
-// each implementation can easily instantiate the test suite to verify
-// that it conforms to the requirements, without having to write
-// similar tests repeatedly. Here's an example:
-
-#if 0
-
-// First, define a fixture class template. It should be parameterized
-// by a type. Remember to derive it from testing::Test.
-template <typename T>
-class FooTest : public testing::Test {
- ...
-};
-
-// Next, declare that you will define a type-parameterized test case
-// (the _P suffix is for "parameterized" or "pattern", whichever you
-// prefer):
-TYPED_TEST_CASE_P(FooTest);
-
-// Then, use TYPED_TEST_P() to define as many type-parameterized tests
-// for this type-parameterized test case as you want.
-TYPED_TEST_P(FooTest, DoesBlah) {
- // Inside a test, refer to TypeParam to get the type parameter.
- TypeParam n = 0;
- ...
-}
-
-TYPED_TEST_P(FooTest, HasPropertyA) { ... }
-
-// Now the tricky part: you need to register all test patterns before
-// you can instantiate them. The first argument of the macro is the
-// test case name; the rest are the names of the tests in this test
-// case.
-REGISTER_TYPED_TEST_CASE_P(FooTest,
- DoesBlah, HasPropertyA);
-
-// Finally, you are free to instantiate the pattern with the types you
-// want. If you put the above code in a header file, you can #include
-// it in multiple C++ source files and instantiate it multiple times.
-//
-// To distinguish different instances of the pattern, the first
-// argument to the INSTANTIATE_* macro is a prefix that will be added
-// to the actual test case name. Remember to pick unique prefixes for
-// different instances.
-typedef testing::Types<char, int, unsigned int> MyTypes;
-INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
-
-// If the type list contains only one type, you can write that type
-// directly without Types<...>:
-// INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
-
-#endif // 0
-
-#include <gtest/internal/gtest-port.h>
-#include <gtest/internal/gtest-type-util.h>
-
-// Implements typed tests.
-
-#if GTEST_HAS_TYPED_TEST
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Expands to the name of the typedef for the type parameters of the
-// given test case.
-#define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_
-
-// The 'Types' template argument below must have spaces around it
-// since some compilers may choke on '>>' when passing a template
-// instance (e.g. Types<int>)
-#define TYPED_TEST_CASE(CaseName, Types) \
- typedef ::testing::internal::TypeList< Types >::type \
- GTEST_TYPE_PARAMS_(CaseName)
-
-#define TYPED_TEST(CaseName, TestName) \
- template <typename gtest_TypeParam_> \
- class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \
- : public CaseName<gtest_TypeParam_> { \
- private: \
- typedef CaseName<gtest_TypeParam_> TestFixture; \
- typedef gtest_TypeParam_ TypeParam; \
- virtual void TestBody(); \
- }; \
- bool gtest_##CaseName##_##TestName##_registered_ = \
- ::testing::internal::TypeParameterizedTest< \
- CaseName, \
- ::testing::internal::TemplateSel< \
- GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \
- GTEST_TYPE_PARAMS_(CaseName)>::Register(\
- "", #CaseName, #TestName, 0); \
- template <typename gtest_TypeParam_> \
- void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
-
-#endif // GTEST_HAS_TYPED_TEST
-
-// Implements type-parameterized tests.
-
-#if GTEST_HAS_TYPED_TEST_P
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Expands to the namespace name that the type-parameterized tests for
-// the given type-parameterized test case are defined in. The exact
-// name of the namespace is subject to change without notice.
-#define GTEST_CASE_NAMESPACE_(TestCaseName) \
- gtest_case_##TestCaseName##_
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Expands to the name of the variable used to remember the names of
-// the defined tests in the given test case.
-#define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \
- gtest_typed_test_case_p_state_##TestCaseName##_
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.
-//
-// Expands to the name of the variable used to remember the names of
-// the registered tests in the given test case.
-#define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \
- gtest_registered_test_names_##TestCaseName##_
-
-// The variables defined in the type-parameterized test macros are
-// static as typically these macros are used in a .h file that can be
-// #included in multiple translation units linked together.
-#define TYPED_TEST_CASE_P(CaseName) \
- static ::testing::internal::TypedTestCasePState \
- GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)
-
-#define TYPED_TEST_P(CaseName, TestName) \
- namespace GTEST_CASE_NAMESPACE_(CaseName) { \
- template <typename gtest_TypeParam_> \
- class TestName : public CaseName<gtest_TypeParam_> { \
- private: \
- typedef CaseName<gtest_TypeParam_> TestFixture; \
- typedef gtest_TypeParam_ TypeParam; \
- virtual void TestBody(); \
- }; \
- static bool gtest_##TestName##_defined_ = \
- GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\
- __FILE__, __LINE__, #CaseName, #TestName); \
- } \
- template <typename gtest_TypeParam_> \
- void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()
-
-#define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \
- namespace GTEST_CASE_NAMESPACE_(CaseName) { \
- typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
- } \
- static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \
- GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\
- __FILE__, __LINE__, #__VA_ARGS__)
-
-// The 'Types' template argument below must have spaces around it
-// since some compilers may choke on '>>' when passing a template
-// instance (e.g. Types<int>)
-#define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \
- bool gtest_##Prefix##_##CaseName = \
- ::testing::internal::TypeParameterizedTestCase<CaseName, \
- GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
- ::testing::internal::TypeList< Types >::type>::Register(\
- #Prefix, #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
-
-#endif // GTEST_HAS_TYPED_TEST_P
-
-#endif // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
diff --git a/contrib/llvm/utils/unittest/googletest/include/gtest/gtest.h b/contrib/llvm/utils/unittest/googletest/include/gtest/gtest.h
deleted file mode 100644
index 921fad1..0000000
--- a/contrib/llvm/utils/unittest/googletest/include/gtest/gtest.h
+++ /dev/null
@@ -1,2052 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// The Google C++ Testing Framework (Google Test)
-//
-// This header file defines the public API for Google Test. It should be
-// included by any test program that uses Google Test.
-//
-// IMPORTANT NOTE: Due to limitation of the C++ language, we have to
-// leave some internal implementation details in this header file.
-// They are clearly marked by comments like this:
-//
-// // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-//
-// Such code is NOT meant to be used by a user directly, and is subject
-// to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user
-// program!
-//
-// Acknowledgment: Google Test borrowed the idea of automatic test
-// registration from Barthelemy Dagenais' (barthelemy@prologique.com)
-// easyUnit framework.
-
-#ifndef GTEST_INCLUDE_GTEST_GTEST_H_
-#define GTEST_INCLUDE_GTEST_GTEST_H_
-
-#include <limits>
-#include <vector>
-
-#include <gtest/internal/gtest-internal.h>
-#include <gtest/internal/gtest-string.h>
-#include <gtest/gtest-death-test.h>
-#include <gtest/gtest-message.h>
-#include <gtest/gtest-param-test.h>
-#include <gtest/gtest_prod.h>
-#include <gtest/gtest-test-part.h>
-#include <gtest/gtest-typed-test.h>
-
-// Depending on the platform, different string classes are available.
-// On Linux, in addition to ::std::string, Google also makes use of
-// class ::string, which has the same interface as ::std::string, but
-// has a different implementation.
-//
-// The user can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
-// ::string is available AND is a distinct type to ::std::string, or
-// define it to 0 to indicate otherwise.
-//
-// If the user's ::std::string and ::string are the same class due to
-// aliasing, he should define GTEST_HAS_GLOBAL_STRING to 0.
-//
-// If the user doesn't define GTEST_HAS_GLOBAL_STRING, it is defined
-// heuristically.
-
-namespace testing {
-
-// Declares the flags.
-
-// This flag temporary enables the disabled tests.
-GTEST_DECLARE_bool_(also_run_disabled_tests);
-
-// This flag brings the debugger on an assertion failure.
-GTEST_DECLARE_bool_(break_on_failure);
-
-// This flag controls whether Google Test catches all test-thrown exceptions
-// and logs them as failures.
-GTEST_DECLARE_bool_(catch_exceptions);
-
-// This flag enables using colors in terminal output. Available values are
-// "yes" to enable colors, "no" (disable colors), or "auto" (the default)
-// to let Google Test decide.
-GTEST_DECLARE_string_(color);
-
-// This flag sets up the filter to select by name using a glob pattern
-// the tests to run. If the filter is not given all tests are executed.
-GTEST_DECLARE_string_(filter);
-
-// This flag causes the Google Test to list tests. None of the tests listed
-// are actually run if the flag is provided.
-GTEST_DECLARE_bool_(list_tests);
-
-// This flag controls whether Google Test emits a detailed XML report to a file
-// in addition to its normal textual output.
-GTEST_DECLARE_string_(output);
-
-// This flags control whether Google Test prints the elapsed time for each
-// test.
-GTEST_DECLARE_bool_(print_time);
-
-// This flag specifies the random number seed.
-GTEST_DECLARE_int32_(random_seed);
-
-// This flag sets how many times the tests are repeated. The default value
-// is 1. If the value is -1 the tests are repeating forever.
-GTEST_DECLARE_int32_(repeat);
-
-// This flag controls whether Google Test includes Google Test internal
-// stack frames in failure stack traces.
-GTEST_DECLARE_bool_(show_internal_stack_frames);
-
-// When this flag is specified, tests' order is randomized on every iteration.
-GTEST_DECLARE_bool_(shuffle);
-
-// This flag specifies the maximum number of stack frames to be
-// printed in a failure message.
-GTEST_DECLARE_int32_(stack_trace_depth);
-
-// When this flag is specified, a failed assertion will throw an
-// exception if exceptions are enabled, or exit the program with a
-// non-zero code otherwise.
-GTEST_DECLARE_bool_(throw_on_failure);
-
-// The upper limit for valid stack trace depths.
-const int kMaxStackTraceDepth = 100;
-
-namespace internal {
-
-class AssertHelper;
-class DefaultGlobalTestPartResultReporter;
-class ExecDeathTest;
-class NoExecDeathTest;
-class FinalSuccessChecker;
-class GTestFlagSaver;
-class TestInfoImpl;
-class TestResultAccessor;
-class TestEventListenersAccessor;
-class TestEventRepeater;
-class WindowsDeathTest;
-class UnitTestImpl* GetUnitTestImpl();
-void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
- const String& message);
-class PrettyUnitTestResultPrinter;
-class XmlUnitTestResultPrinter;
-
-// Converts a streamable value to a String. A NULL pointer is
-// converted to "(null)". When the input value is a ::string,
-// ::std::string, ::wstring, or ::std::wstring object, each NUL
-// character in it is replaced with "\\0".
-// Declared in gtest-internal.h but defined here, so that it has access
-// to the definition of the Message class, required by the ARM
-// compiler.
-template <typename T>
-String StreamableToString(const T& streamable) {
- return (Message() << streamable).GetString();
-}
-
-} // namespace internal
-
-// A class for indicating whether an assertion was successful. When
-// the assertion wasn't successful, the AssertionResult object
-// remembers a non-empty message that describes how it failed.
-//
-// To create an instance of this class, use one of the factory functions
-// (AssertionSuccess() and AssertionFailure()).
-//
-// This class is useful for two purposes:
-// 1. Defining predicate functions to be used with Boolean test assertions
-// EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts
-// 2. Defining predicate-format functions to be
-// used with predicate assertions (ASSERT_PRED_FORMAT*, etc).
-//
-// For example, if you define IsEven predicate:
-//
-// testing::AssertionResult IsEven(int n) {
-// if ((n % 2) == 0)
-// return testing::AssertionSuccess();
-// else
-// return testing::AssertionFailure() << n << " is odd";
-// }
-//
-// Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))
-// will print the message
-//
-// Value of: IsEven(Fib(5))
-// Actual: false (5 is odd)
-// Expected: true
-//
-// instead of a more opaque
-//
-// Value of: IsEven(Fib(5))
-// Actual: false
-// Expected: true
-//
-// in case IsEven is a simple Boolean predicate.
-//
-// If you expect your predicate to be reused and want to support informative
-// messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up
-// about half as often as positive ones in our tests), supply messages for
-// both success and failure cases:
-//
-// testing::AssertionResult IsEven(int n) {
-// if ((n % 2) == 0)
-// return testing::AssertionSuccess() << n << " is even";
-// else
-// return testing::AssertionFailure() << n << " is odd";
-// }
-//
-// Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print
-//
-// Value of: IsEven(Fib(6))
-// Actual: true (8 is even)
-// Expected: false
-//
-// NB: Predicates that support negative Boolean assertions have reduced
-// performance in positive ones so be careful not to use them in tests
-// that have lots (tens of thousands) of positive Boolean assertions.
-//
-// To use this class with EXPECT_PRED_FORMAT assertions such as:
-//
-// // Verifies that Foo() returns an even number.
-// EXPECT_PRED_FORMAT1(IsEven, Foo());
-//
-// you need to define:
-//
-// testing::AssertionResult IsEven(const char* expr, int n) {
-// if ((n % 2) == 0)
-// return testing::AssertionSuccess();
-// else
-// return testing::AssertionFailure()
-// << "Expected: " << expr << " is even\n Actual: it's " << n;
-// }
-//
-// If Foo() returns 5, you will see the following message:
-//
-// Expected: Foo() is even
-// Actual: it's 5
-//
-class GTEST_API_ AssertionResult {
- public:
- // Copy constructor.
- // Used in EXPECT_TRUE/FALSE(assertion_result).
- AssertionResult(const AssertionResult& other);
- // Used in the EXPECT_TRUE/FALSE(bool_expression).
- explicit AssertionResult(bool success) : success_(success) {}
-
- // Returns true iff the assertion succeeded.
- operator bool() const { return success_; } // NOLINT
-
- // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
- AssertionResult operator!() const;
-
- // Returns the text streamed into this AssertionResult. Test assertions
- // use it when they fail (i.e., the predicate's outcome doesn't match the
- // assertion's expectation). When nothing has been streamed into the
- // object, returns an empty string.
- const char* message() const {
- return message_.get() != NULL && message_->c_str() != NULL ?
- message_->c_str() : "";
- }
- // TODO(vladl@google.com): Remove this after making sure no clients use it.
- // Deprecated; please use message() instead.
- const char* failure_message() const { return message(); }
-
- // Streams a custom failure message into this object.
- template <typename T> AssertionResult& operator<<(const T& value);
-
- private:
- // No implementation - we want AssertionResult to be
- // copy-constructible but not assignable.
- void operator=(const AssertionResult& other);
-
- // Stores result of the assertion predicate.
- bool success_;
- // Stores the message describing the condition in case the expectation
- // construct is not satisfied with the predicate's outcome.
- // Referenced via a pointer to avoid taking too much stack frame space
- // with test assertions.
- internal::scoped_ptr<internal::String> message_;
-}; // class AssertionResult
-
-// Streams a custom failure message into this object.
-template <typename T>
-AssertionResult& AssertionResult::operator<<(const T& value) {
- Message msg;
- if (message_.get() != NULL)
- msg << *message_;
- msg << value;
- message_.reset(new internal::String(msg.GetString()));
- return *this;
-}
-
-// Makes a successful assertion result.
-GTEST_API_ AssertionResult AssertionSuccess();
-
-// Makes a failed assertion result.
-GTEST_API_ AssertionResult AssertionFailure();
-
-// Makes a failed assertion result with the given failure message.
-// Deprecated; use AssertionFailure() << msg.
-GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
-
-// The abstract class that all tests inherit from.
-//
-// In Google Test, a unit test program contains one or many TestCases, and
-// each TestCase contains one or many Tests.
-//
-// When you define a test using the TEST macro, you don't need to
-// explicitly derive from Test - the TEST macro automatically does
-// this for you.
-//
-// The only time you derive from Test is when defining a test fixture
-// to be used a TEST_F. For example:
-//
-// class FooTest : public testing::Test {
-// protected:
-// virtual void SetUp() { ... }
-// virtual void TearDown() { ... }
-// ...
-// };
-//
-// TEST_F(FooTest, Bar) { ... }
-// TEST_F(FooTest, Baz) { ... }
-//
-// Test is not copyable.
-class GTEST_API_ Test {
- public:
- friend class internal::TestInfoImpl;
-
- // Defines types for pointers to functions that set up and tear down
- // a test case.
- typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;
- typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;
-
- // The d'tor is virtual as we intend to inherit from Test.
- virtual ~Test();
-
- // Sets up the stuff shared by all tests in this test case.
- //
- // Google Test will call Foo::SetUpTestCase() before running the first
- // test in test case Foo. Hence a sub-class can define its own
- // SetUpTestCase() method to shadow the one defined in the super
- // class.
- static void SetUpTestCase() {}
-
- // Tears down the stuff shared by all tests in this test case.
- //
- // Google Test will call Foo::TearDownTestCase() after running the last
- // test in test case Foo. Hence a sub-class can define its own
- // TearDownTestCase() method to shadow the one defined in the super
- // class.
- static void TearDownTestCase() {}
-
- // Returns true iff the current test has a fatal failure.
- static bool HasFatalFailure();
-
- // Returns true iff the current test has a non-fatal failure.
- static bool HasNonfatalFailure();
-
- // Returns true iff the current test has a (either fatal or
- // non-fatal) failure.
- static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
-
- // Logs a property for the current test. Only the last value for a given
- // key is remembered.
- // These are public static so they can be called from utility functions
- // that are not members of the test fixture.
- // The arguments are const char* instead strings, as Google Test is used
- // on platforms where string doesn't compile.
- //
- // Note that a driving consideration for these RecordProperty methods
- // was to produce xml output suited to the Greenspan charting utility,
- // which at present will only chart values that fit in a 32-bit int. It
- // is the user's responsibility to restrict their values to 32-bit ints
- // if they intend them to be used with Greenspan.
- static void RecordProperty(const char* key, const char* value);
- static void RecordProperty(const char* key, int value);
-
- protected:
- // Creates a Test object.
- Test();
-
- // Sets up the test fixture.
- virtual void SetUp();
-
- // Tears down the test fixture.
- virtual void TearDown();
-
- private:
- // Returns true iff the current test has the same fixture class as
- // the first test in the current test case.
- static bool HasSameFixtureClass();
-
- // Runs the test after the test fixture has been set up.
- //
- // A sub-class must implement this to define the test logic.
- //
- // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.
- // Instead, use the TEST or TEST_F macro.
- virtual void TestBody() = 0;
-
- // Sets up, executes, and tears down the test.
- void Run();
-
- // Uses a GTestFlagSaver to save and restore all Google Test flags.
- const internal::GTestFlagSaver* const gtest_flag_saver_;
-
- // Often a user mis-spells SetUp() as Setup() and spends a long time
- // wondering why it is never called by Google Test. The declaration of
- // the following method is solely for catching such an error at
- // compile time:
- //
- // - The return type is deliberately chosen to be not void, so it
- // will be a conflict if a user declares void Setup() in his test
- // fixture.
- //
- // - This method is private, so it will be another compiler error
- // if a user calls it from his test fixture.
- //
- // DO NOT OVERRIDE THIS FUNCTION.
- //
- // If you see an error about overriding the following function or
- // about it being private, you have mis-spelled SetUp() as Setup().
- struct Setup_should_be_spelled_SetUp {};
- virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
-
- // We disallow copying Tests.
- GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
-};
-
-typedef internal::TimeInMillis TimeInMillis;
-
-// A copyable object representing a user specified test property which can be
-// output as a key/value string pair.
-//
-// Don't inherit from TestProperty as its destructor is not virtual.
-class TestProperty {
- public:
- // C'tor. TestProperty does NOT have a default constructor.
- // Always use this constructor (with parameters) to create a
- // TestProperty object.
- TestProperty(const char* a_key, const char* a_value) :
- key_(a_key), value_(a_value) {
- }
-
- // Gets the user supplied key.
- const char* key() const {
- return key_.c_str();
- }
-
- // Gets the user supplied value.
- const char* value() const {
- return value_.c_str();
- }
-
- // Sets a new value, overriding the one supplied in the constructor.
- void SetValue(const char* new_value) {
- value_ = new_value;
- }
-
- private:
- // The key supplied by the user.
- internal::String key_;
- // The value supplied by the user.
- internal::String value_;
-};
-
-// The result of a single Test. This includes a list of
-// TestPartResults, a list of TestProperties, a count of how many
-// death tests there are in the Test, and how much time it took to run
-// the Test.
-//
-// TestResult is not copyable.
-class GTEST_API_ TestResult {
- public:
- // Creates an empty TestResult.
- TestResult();
-
- // D'tor. Do not inherit from TestResult.
- ~TestResult();
-
- // Gets the number of all test parts. This is the sum of the number
- // of successful test parts and the number of failed test parts.
- int total_part_count() const;
-
- // Returns the number of the test properties.
- int test_property_count() const;
-
- // Returns true iff the test passed (i.e. no test part failed).
- bool Passed() const { return !Failed(); }
-
- // Returns true iff the test failed.
- bool Failed() const;
-
- // Returns true iff the test fatally failed.
- bool HasFatalFailure() const;
-
- // Returns true iff the test has a non-fatal failure.
- bool HasNonfatalFailure() const;
-
- // Returns the elapsed time, in milliseconds.
- TimeInMillis elapsed_time() const { return elapsed_time_; }
-
- // Returns the i-th test part result among all the results. i can range
- // from 0 to test_property_count() - 1. If i is not in that range, aborts
- // the program.
- const TestPartResult& GetTestPartResult(int i) const;
-
- // Returns the i-th test property. i can range from 0 to
- // test_property_count() - 1. If i is not in that range, aborts the
- // program.
- const TestProperty& GetTestProperty(int i) const;
-
- private:
- friend class TestInfo;
- friend class UnitTest;
- friend class internal::DefaultGlobalTestPartResultReporter;
- friend class internal::ExecDeathTest;
- friend class internal::TestInfoImpl;
- friend class internal::TestResultAccessor;
- friend class internal::UnitTestImpl;
- friend class internal::WindowsDeathTest;
-
- // Gets the vector of TestPartResults.
- const std::vector<TestPartResult>& test_part_results() const {
- return test_part_results_;
- }
-
- // Gets the vector of TestProperties.
- const std::vector<TestProperty>& test_properties() const {
- return test_properties_;
- }
-
- // Sets the elapsed time.
- void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
-
- // Adds a test property to the list. The property is validated and may add
- // a non-fatal failure if invalid (e.g., if it conflicts with reserved
- // key names). If a property is already recorded for the same key, the
- // value will be updated, rather than storing multiple values for the same
- // key.
- void RecordProperty(const TestProperty& test_property);
-
- // Adds a failure if the key is a reserved attribute of Google Test
- // testcase tags. Returns true if the property is valid.
- // TODO(russr): Validate attribute names are legal and human readable.
- static bool ValidateTestProperty(const TestProperty& test_property);
-
- // Adds a test part result to the list.
- void AddTestPartResult(const TestPartResult& test_part_result);
-
- // Returns the death test count.
- int death_test_count() const { return death_test_count_; }
-
- // Increments the death test count, returning the new count.
- int increment_death_test_count() { return ++death_test_count_; }
-
- // Clears the test part results.
- void ClearTestPartResults();
-
- // Clears the object.
- void Clear();
-
- // Protects mutable state of the property vector and of owned
- // properties, whose values may be updated.
- internal::Mutex test_properites_mutex_;
-
- // The vector of TestPartResults
- std::vector<TestPartResult> test_part_results_;
- // The vector of TestProperties
- std::vector<TestProperty> test_properties_;
- // Running count of death tests.
- int death_test_count_;
- // The elapsed time, in milliseconds.
- TimeInMillis elapsed_time_;
-
- // We disallow copying TestResult.
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);
-}; // class TestResult
-
-// A TestInfo object stores the following information about a test:
-//
-// Test case name
-// Test name
-// Whether the test should be run
-// A function pointer that creates the test object when invoked
-// Test result
-//
-// The constructor of TestInfo registers itself with the UnitTest
-// singleton such that the RUN_ALL_TESTS() macro knows which tests to
-// run.
-class GTEST_API_ TestInfo {
- public:
- // Destructs a TestInfo object. This function is not virtual, so
- // don't inherit from TestInfo.
- ~TestInfo();
-
- // Returns the test case name.
- const char* test_case_name() const;
-
- // Returns the test name.
- const char* name() const;
-
- // Returns the test case comment.
- const char* test_case_comment() const;
-
- // Returns the test comment.
- const char* comment() const;
-
- // Returns true if this test should run, that is if the test is not disabled
- // (or it is disabled but the also_run_disabled_tests flag has been specified)
- // and its full name matches the user-specified filter.
- //
- // Google Test allows the user to filter the tests by their full names.
- // The full name of a test Bar in test case Foo is defined as
- // "Foo.Bar". Only the tests that match the filter will run.
- //
- // A filter is a colon-separated list of glob (not regex) patterns,
- // optionally followed by a '-' and a colon-separated list of
- // negative patterns (tests to exclude). A test is run if it
- // matches one of the positive patterns and does not match any of
- // the negative patterns.
- //
- // For example, *A*:Foo.* is a filter that matches any string that
- // contains the character 'A' or starts with "Foo.".
- bool should_run() const;
-
- // Returns the result of the test.
- const TestResult* result() const;
-
- private:
-#if GTEST_HAS_DEATH_TEST
- friend class internal::DefaultDeathTestFactory;
-#endif // GTEST_HAS_DEATH_TEST
- friend class Test;
- friend class TestCase;
- friend class internal::TestInfoImpl;
- friend class internal::UnitTestImpl;
- friend TestInfo* internal::MakeAndRegisterTestInfo(
- const char* test_case_name, const char* name,
- const char* test_case_comment, const char* comment,
- internal::TypeId fixture_class_id,
- Test::SetUpTestCaseFunc set_up_tc,
- Test::TearDownTestCaseFunc tear_down_tc,
- internal::TestFactoryBase* factory);
-
- // Returns true if this test matches the user-specified filter.
- bool matches_filter() const;
-
- // Increments the number of death tests encountered in this test so
- // far.
- int increment_death_test_count();
-
- // Accessors for the implementation object.
- internal::TestInfoImpl* impl() { return impl_; }
- const internal::TestInfoImpl* impl() const { return impl_; }
-
- // Constructs a TestInfo object. The newly constructed instance assumes
- // ownership of the factory object.
- TestInfo(const char* test_case_name, const char* name,
- const char* test_case_comment, const char* comment,
- internal::TypeId fixture_class_id,
- internal::TestFactoryBase* factory);
-
- // An opaque implementation object.
- internal::TestInfoImpl* impl_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);
-};
-
-// A test case, which consists of a vector of TestInfos.
-//
-// TestCase is not copyable.
-class GTEST_API_ TestCase {
- public:
- // Creates a TestCase with the given name.
- //
- // TestCase does NOT have a default constructor. Always use this
- // constructor to create a TestCase object.
- //
- // Arguments:
- //
- // name: name of the test case
- // set_up_tc: pointer to the function that sets up the test case
- // tear_down_tc: pointer to the function that tears down the test case
- TestCase(const char* name, const char* comment,
- Test::SetUpTestCaseFunc set_up_tc,
- Test::TearDownTestCaseFunc tear_down_tc);
-
- // Destructor of TestCase.
- virtual ~TestCase();
-
- // Gets the name of the TestCase.
- const char* name() const { return name_.c_str(); }
-
- // Returns the test case comment.
- const char* comment() const { return comment_.c_str(); }
-
- // Returns true if any test in this test case should run.
- bool should_run() const { return should_run_; }
-
- // Gets the number of successful tests in this test case.
- int successful_test_count() const;
-
- // Gets the number of failed tests in this test case.
- int failed_test_count() const;
-
- // Gets the number of disabled tests in this test case.
- int disabled_test_count() const;
-
- // Get the number of tests in this test case that should run.
- int test_to_run_count() const;
-
- // Gets the number of all tests in this test case.
- int total_test_count() const;
-
- // Returns true iff the test case passed.
- bool Passed() const { return !Failed(); }
-
- // Returns true iff the test case failed.
- bool Failed() const { return failed_test_count() > 0; }
-
- // Returns the elapsed time, in milliseconds.
- TimeInMillis elapsed_time() const { return elapsed_time_; }
-
- // Returns the i-th test among all the tests. i can range from 0 to
- // total_test_count() - 1. If i is not in that range, returns NULL.
- const TestInfo* GetTestInfo(int i) const;
-
- private:
- friend class Test;
- friend class internal::UnitTestImpl;
-
- // Gets the (mutable) vector of TestInfos in this TestCase.
- std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
-
- // Gets the (immutable) vector of TestInfos in this TestCase.
- const std::vector<TestInfo*>& test_info_list() const {
- return test_info_list_;
- }
-
- // Returns the i-th test among all the tests. i can range from 0 to
- // total_test_count() - 1. If i is not in that range, returns NULL.
- TestInfo* GetMutableTestInfo(int i);
-
- // Sets the should_run member.
- void set_should_run(bool should) { should_run_ = should; }
-
- // Adds a TestInfo to this test case. Will delete the TestInfo upon
- // destruction of the TestCase object.
- void AddTestInfo(TestInfo * test_info);
-
- // Clears the results of all tests in this test case.
- void ClearResult();
-
- // Clears the results of all tests in the given test case.
- static void ClearTestCaseResult(TestCase* test_case) {
- test_case->ClearResult();
- }
-
- // Runs every test in this TestCase.
- void Run();
-
- // Returns true iff test passed.
- static bool TestPassed(const TestInfo * test_info);
-
- // Returns true iff test failed.
- static bool TestFailed(const TestInfo * test_info);
-
- // Returns true iff test is disabled.
- static bool TestDisabled(const TestInfo * test_info);
-
- // Returns true if the given test should run.
- static bool ShouldRunTest(const TestInfo *test_info);
-
- // Shuffles the tests in this test case.
- void ShuffleTests(internal::Random* random);
-
- // Restores the test order to before the first shuffle.
- void UnshuffleTests();
-
- // Name of the test case.
- internal::String name_;
- // Comment on the test case.
- internal::String comment_;
- // The vector of TestInfos in their original order. It owns the
- // elements in the vector.
- std::vector<TestInfo*> test_info_list_;
- // Provides a level of indirection for the test list to allow easy
- // shuffling and restoring the test order. The i-th element in this
- // vector is the index of the i-th test in the shuffled test list.
- std::vector<int> test_indices_;
- // Pointer to the function that sets up the test case.
- Test::SetUpTestCaseFunc set_up_tc_;
- // Pointer to the function that tears down the test case.
- Test::TearDownTestCaseFunc tear_down_tc_;
- // True iff any test in this test case should run.
- bool should_run_;
- // Elapsed time, in milliseconds.
- TimeInMillis elapsed_time_;
-
- // We disallow copying TestCases.
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);
-};
-
-// An Environment object is capable of setting up and tearing down an
-// environment. The user should subclass this to define his own
-// environment(s).
-//
-// An Environment object does the set-up and tear-down in virtual
-// methods SetUp() and TearDown() instead of the constructor and the
-// destructor, as:
-//
-// 1. You cannot safely throw from a destructor. This is a problem
-// as in some cases Google Test is used where exceptions are enabled, and
-// we may want to implement ASSERT_* using exceptions where they are
-// available.
-// 2. You cannot use ASSERT_* directly in a constructor or
-// destructor.
-class Environment {
- public:
- // The d'tor is virtual as we need to subclass Environment.
- virtual ~Environment() {}
-
- // Override this to define how to set up the environment.
- virtual void SetUp() {}
-
- // Override this to define how to tear down the environment.
- virtual void TearDown() {}
- private:
- // If you see an error about overriding the following function or
- // about it being private, you have mis-spelled SetUp() as Setup().
- struct Setup_should_be_spelled_SetUp {};
- virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
-};
-
-// The interface for tracing execution of tests. The methods are organized in
-// the order the corresponding events are fired.
-class TestEventListener {
- public:
- virtual ~TestEventListener() {}
-
- // Fired before any test activity starts.
- virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
-
- // Fired before each iteration of tests starts. There may be more than
- // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration
- // index, starting from 0.
- virtual void OnTestIterationStart(const UnitTest& unit_test,
- int iteration) = 0;
-
- // Fired before environment set-up for each iteration of tests starts.
- virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;
-
- // Fired after environment set-up for each iteration of tests ends.
- virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;
-
- // Fired before the test case starts.
- virtual void OnTestCaseStart(const TestCase& test_case) = 0;
-
- // Fired before the test starts.
- virtual void OnTestStart(const TestInfo& test_info) = 0;
-
- // Fired after a failed assertion or a SUCCESS().
- virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;
-
- // Fired after the test ends.
- virtual void OnTestEnd(const TestInfo& test_info) = 0;
-
- // Fired after the test case ends.
- virtual void OnTestCaseEnd(const TestCase& test_case) = 0;
-
- // Fired before environment tear-down for each iteration of tests starts.
- virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;
-
- // Fired after environment tear-down for each iteration of tests ends.
- virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;
-
- // Fired after each iteration of tests finishes.
- virtual void OnTestIterationEnd(const UnitTest& unit_test,
- int iteration) = 0;
-
- // Fired after all test activities have ended.
- virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;
-};
-
-// The convenience class for users who need to override just one or two
-// methods and are not concerned that a possible change to a signature of
-// the methods they override will not be caught during the build. For
-// comments about each method please see the definition of TestEventListener
-// above.
-class EmptyTestEventListener : public TestEventListener {
- public:
- virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
- virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
- int /*iteration*/) {}
- virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
- virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
- virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
- virtual void OnTestStart(const TestInfo& /*test_info*/) {}
- virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
- virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
- virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
- virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
- virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
- virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
- int /*iteration*/) {}
- virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
-};
-
-// TestEventListeners lets users add listeners to track events in Google Test.
-class GTEST_API_ TestEventListeners {
- public:
- TestEventListeners();
- ~TestEventListeners();
-
- // Appends an event listener to the end of the list. Google Test assumes
- // the ownership of the listener (i.e. it will delete the listener when
- // the test program finishes).
- void Append(TestEventListener* listener);
-
- // Removes the given event listener from the list and returns it. It then
- // becomes the caller's responsibility to delete the listener. Returns
- // NULL if the listener is not found in the list.
- TestEventListener* Release(TestEventListener* listener);
-
- // Returns the standard listener responsible for the default console
- // output. Can be removed from the listeners list to shut down default
- // console output. Note that removing this object from the listener list
- // with Release transfers its ownership to the caller and makes this
- // function return NULL the next time.
- TestEventListener* default_result_printer() const {
- return default_result_printer_;
- }
-
- // Returns the standard listener responsible for the default XML output
- // controlled by the --gtest_output=xml flag. Can be removed from the
- // listeners list by users who want to shut down the default XML output
- // controlled by this flag and substitute it with custom one. Note that
- // removing this object from the listener list with Release transfers its
- // ownership to the caller and makes this function return NULL the next
- // time.
- TestEventListener* default_xml_generator() const {
- return default_xml_generator_;
- }
-
- private:
- friend class TestCase;
- friend class internal::DefaultGlobalTestPartResultReporter;
- friend class internal::NoExecDeathTest;
- friend class internal::TestEventListenersAccessor;
- friend class internal::TestInfoImpl;
- friend class internal::UnitTestImpl;
-
- // Returns repeater that broadcasts the TestEventListener events to all
- // subscribers.
- TestEventListener* repeater();
-
- // Sets the default_result_printer attribute to the provided listener.
- // The listener is also added to the listener list and previous
- // default_result_printer is removed from it and deleted. The listener can
- // also be NULL in which case it will not be added to the list. Does
- // nothing if the previous and the current listener objects are the same.
- void SetDefaultResultPrinter(TestEventListener* listener);
-
- // Sets the default_xml_generator attribute to the provided listener. The
- // listener is also added to the listener list and previous
- // default_xml_generator is removed from it and deleted. The listener can
- // also be NULL in which case it will not be added to the list. Does
- // nothing if the previous and the current listener objects are the same.
- void SetDefaultXmlGenerator(TestEventListener* listener);
-
- // Controls whether events will be forwarded by the repeater to the
- // listeners in the list.
- bool EventForwardingEnabled() const;
- void SuppressEventForwarding();
-
- // The actual list of listeners.
- internal::TestEventRepeater* repeater_;
- // Listener responsible for the standard result output.
- TestEventListener* default_result_printer_;
- // Listener responsible for the creation of the XML output file.
- TestEventListener* default_xml_generator_;
-
- // We disallow copying TestEventListeners.
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);
-};
-
-// A UnitTest consists of a vector of TestCases.
-//
-// This is a singleton class. The only instance of UnitTest is
-// created when UnitTest::GetInstance() is first called. This
-// instance is never deleted.
-//
-// UnitTest is not copyable.
-//
-// This class is thread-safe as long as the methods are called
-// according to their specification.
-class GTEST_API_ UnitTest {
- public:
- // Gets the singleton UnitTest object. The first time this method
- // is called, a UnitTest object is constructed and returned.
- // Consecutive calls will return the same object.
- static UnitTest* GetInstance();
-
- // Runs all tests in this UnitTest object and prints the result.
- // Returns 0 if successful, or 1 otherwise.
- //
- // This method can only be called from the main thread.
- //
- // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
- int Run() GTEST_MUST_USE_RESULT_;
-
- // Returns the working directory when the first TEST() or TEST_F()
- // was executed. The UnitTest object owns the string.
- const char* original_working_dir() const;
-
- // Returns the TestCase object for the test that's currently running,
- // or NULL if no test is running.
- const TestCase* current_test_case() const;
-
- // Returns the TestInfo object for the test that's currently running,
- // or NULL if no test is running.
- const TestInfo* current_test_info() const;
-
- // Returns the random seed used at the start of the current test run.
- int random_seed() const;
-
-#if GTEST_HAS_PARAM_TEST
- // Returns the ParameterizedTestCaseRegistry object used to keep track of
- // value-parameterized tests and instantiate and register them.
- //
- // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
- internal::ParameterizedTestCaseRegistry& parameterized_test_registry();
-#endif // GTEST_HAS_PARAM_TEST
-
- // Gets the number of successful test cases.
- int successful_test_case_count() const;
-
- // Gets the number of failed test cases.
- int failed_test_case_count() const;
-
- // Gets the number of all test cases.
- int total_test_case_count() const;
-
- // Gets the number of all test cases that contain at least one test
- // that should run.
- int test_case_to_run_count() const;
-
- // Gets the number of successful tests.
- int successful_test_count() const;
-
- // Gets the number of failed tests.
- int failed_test_count() const;
-
- // Gets the number of disabled tests.
- int disabled_test_count() const;
-
- // Gets the number of all tests.
- int total_test_count() const;
-
- // Gets the number of tests that should run.
- int test_to_run_count() const;
-
- // Gets the elapsed time, in milliseconds.
- TimeInMillis elapsed_time() const;
-
- // Returns true iff the unit test passed (i.e. all test cases passed).
- bool Passed() const;
-
- // Returns true iff the unit test failed (i.e. some test case failed
- // or something outside of all tests failed).
- bool Failed() const;
-
- // Gets the i-th test case among all the test cases. i can range from 0 to
- // total_test_case_count() - 1. If i is not in that range, returns NULL.
- const TestCase* GetTestCase(int i) const;
-
- // Returns the list of event listeners that can be used to track events
- // inside Google Test.
- TestEventListeners& listeners();
-
- private:
- // Registers and returns a global test environment. When a test
- // program is run, all global test environments will be set-up in
- // the order they were registered. After all tests in the program
- // have finished, all global test environments will be torn-down in
- // the *reverse* order they were registered.
- //
- // The UnitTest object takes ownership of the given environment.
- //
- // This method can only be called from the main thread.
- Environment* AddEnvironment(Environment* env);
-
- // Adds a TestPartResult to the current TestResult object. All
- // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
- // eventually call this to report their results. The user code
- // should use the assertion macros instead of calling this directly.
- void AddTestPartResult(TestPartResult::Type result_type,
- const char* file_name,
- int line_number,
- const internal::String& message,
- const internal::String& os_stack_trace);
-
- // Adds a TestProperty to the current TestResult object. If the result already
- // contains a property with the same key, the value will be updated.
- void RecordPropertyForCurrentTest(const char* key, const char* value);
-
- // Gets the i-th test case among all the test cases. i can range from 0 to
- // total_test_case_count() - 1. If i is not in that range, returns NULL.
- TestCase* GetMutableTestCase(int i);
-
- // Accessors for the implementation object.
- internal::UnitTestImpl* impl() { return impl_; }
- const internal::UnitTestImpl* impl() const { return impl_; }
-
- // These classes and funcions are friends as they need to access private
- // members of UnitTest.
- friend class Test;
- friend class internal::AssertHelper;
- friend class internal::ScopedTrace;
- friend Environment* AddGlobalTestEnvironment(Environment* env);
- friend internal::UnitTestImpl* internal::GetUnitTestImpl();
- friend void internal::ReportFailureInUnknownLocation(
- TestPartResult::Type result_type,
- const internal::String& message);
-
- // Creates an empty UnitTest.
- UnitTest();
-
- // D'tor
- virtual ~UnitTest();
-
- // Pushes a trace defined by SCOPED_TRACE() on to the per-thread
- // Google Test trace stack.
- void PushGTestTrace(const internal::TraceInfo& trace);
-
- // Pops a trace from the per-thread Google Test trace stack.
- void PopGTestTrace();
-
- // Protects mutable state in *impl_. This is mutable as some const
- // methods need to lock it too.
- mutable internal::Mutex mutex_;
-
- // Opaque implementation object. This field is never changed once
- // the object is constructed. We don't mark it as const here, as
- // doing so will cause a warning in the constructor of UnitTest.
- // Mutable state in *impl_ is protected by mutex_.
- internal::UnitTestImpl* impl_;
-
- // We disallow copying UnitTest.
- GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);
-};
-
-// A convenient wrapper for adding an environment for the test
-// program.
-//
-// You should call this before RUN_ALL_TESTS() is called, probably in
-// main(). If you use gtest_main, you need to call this before main()
-// starts for it to take effect. For example, you can define a global
-// variable like this:
-//
-// testing::Environment* const foo_env =
-// testing::AddGlobalTestEnvironment(new FooEnvironment);
-//
-// However, we strongly recommend you to write your own main() and
-// call AddGlobalTestEnvironment() there, as relying on initialization
-// of global variables makes the code harder to read and may cause
-// problems when you register multiple environments from different
-// translation units and the environments have dependencies among them
-// (remember that the compiler doesn't guarantee the order in which
-// global variables from different translation units are initialized).
-inline Environment* AddGlobalTestEnvironment(Environment* env) {
- return UnitTest::GetInstance()->AddEnvironment(env);
-}
-
-// Initializes Google Test. This must be called before calling
-// RUN_ALL_TESTS(). In particular, it parses a command line for the
-// flags that Google Test recognizes. Whenever a Google Test flag is
-// seen, it is removed from argv, and *argc is decremented.
-//
-// No value is returned. Instead, the Google Test flag variables are
-// updated.
-//
-// Calling the function for the second time has no user-visible effect.
-GTEST_API_ void InitGoogleTest(int* argc, char** argv);
-
-// This overloaded version can be used in Windows programs compiled in
-// UNICODE mode.
-GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
-
-namespace internal {
-
-// These overloaded versions handle ::std::string and ::std::wstring.
-GTEST_API_ inline String FormatForFailureMessage(const ::std::string& str) {
- return (Message() << '"' << str << '"').GetString();
-}
-
-#if GTEST_HAS_STD_WSTRING
-GTEST_API_ inline String FormatForFailureMessage(const ::std::wstring& wstr) {
- return (Message() << "L\"" << wstr << '"').GetString();
-}
-#endif // GTEST_HAS_STD_WSTRING
-
-// These overloaded versions handle ::string and ::wstring.
-#if GTEST_HAS_GLOBAL_STRING
-GTEST_API_ inline String FormatForFailureMessage(const ::string& str) {
- return (Message() << '"' << str << '"').GetString();
-}
-#endif // GTEST_HAS_GLOBAL_STRING
-
-#if GTEST_HAS_GLOBAL_WSTRING
-GTEST_API_ inline String FormatForFailureMessage(const ::wstring& wstr) {
- return (Message() << "L\"" << wstr << '"').GetString();
-}
-#endif // GTEST_HAS_GLOBAL_WSTRING
-
-// Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
-// operand to be used in a failure message. The type (but not value)
-// of the other operand may affect the format. This allows us to
-// print a char* as a raw pointer when it is compared against another
-// char*, and print it as a C string when it is compared against an
-// std::string object, for example.
-//
-// The default implementation ignores the type of the other operand.
-// Some specialized versions are used to handle formatting wide or
-// narrow C strings.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-template <typename T1, typename T2>
-String FormatForComparisonFailureMessage(const T1& value,
- const T2& /* other_operand */) {
- return FormatForFailureMessage(value);
-}
-
-// The helper function for {ASSERT|EXPECT}_EQ.
-template <typename T1, typename T2>
-AssertionResult CmpHelperEQ(const char* expected_expression,
- const char* actual_expression,
- const T1& expected,
- const T2& actual) {
-#ifdef _MSC_VER
-#pragma warning(push) // Saves the current warning state.
-#pragma warning(disable:4389) // Temporarily disables warning on
- // signed/unsigned mismatch.
-#endif
-
- if (expected == actual) {
- return AssertionSuccess();
- }
-
-#ifdef _MSC_VER
-#pragma warning(pop) // Restores the warning state.
-#endif
-
- return EqFailure(expected_expression,
- actual_expression,
- FormatForComparisonFailureMessage(expected, actual),
- FormatForComparisonFailureMessage(actual, expected),
- false);
-}
-
-// With this overloaded version, we allow anonymous enums to be used
-// in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
-// can be implicitly cast to BiggestInt.
-GTEST_API_ AssertionResult CmpHelperEQ(const char* expected_expression,
- const char* actual_expression,
- BiggestInt expected,
- BiggestInt actual);
-
-// The helper class for {ASSERT|EXPECT}_EQ. The template argument
-// lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
-// is a null pointer literal. The following default implementation is
-// for lhs_is_null_literal being false.
-template <bool lhs_is_null_literal>
-class EqHelper {
- public:
- // This templatized version is for the general case.
- template <typename T1, typename T2>
- static AssertionResult Compare(const char* expected_expression,
- const char* actual_expression,
- const T1& expected,
- const T2& actual) {
- return CmpHelperEQ(expected_expression, actual_expression, expected,
- actual);
- }
-
- // With this overloaded version, we allow anonymous enums to be used
- // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous
- // enums can be implicitly cast to BiggestInt.
- //
- // Even though its body looks the same as the above version, we
- // cannot merge the two, as it will make anonymous enums unhappy.
- static AssertionResult Compare(const char* expected_expression,
- const char* actual_expression,
- BiggestInt expected,
- BiggestInt actual) {
- return CmpHelperEQ(expected_expression, actual_expression, expected,
- actual);
- }
-};
-
-// This specialization is used when the first argument to ASSERT_EQ()
-// is a null pointer literal.
-template <>
-class EqHelper<true> {
- public:
- // We define two overloaded versions of Compare(). The first
- // version will be picked when the second argument to ASSERT_EQ() is
- // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or
- // EXPECT_EQ(false, a_bool).
- template <typename T1, typename T2>
- static AssertionResult Compare(const char* expected_expression,
- const char* actual_expression,
- const T1& expected,
- const T2& actual) {
- return CmpHelperEQ(expected_expression, actual_expression, expected,
- actual);
- }
-
- // This version will be picked when the second argument to
- // ASSERT_EQ() is a pointer, e.g. ASSERT_EQ(NULL, a_pointer).
- template <typename T1, typename T2>
- static AssertionResult Compare(const char* expected_expression,
- const char* actual_expression,
- const T1& /* expected */,
- T2* actual) {
- // We already know that 'expected' is a null pointer.
- return CmpHelperEQ(expected_expression, actual_expression,
- static_cast<T2*>(NULL), actual);
- }
-};
-
-// A macro for implementing the helper functions needed to implement
-// ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste
-// of similar code.
-//
-// For each templatized helper function, we also define an overloaded
-// version for BiggestInt in order to reduce code bloat and allow
-// anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled
-// with gcc 4.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-#define GTEST_IMPL_CMP_HELPER_(op_name, op)\
-template <typename T1, typename T2>\
-AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
- const T1& val1, const T2& val2) {\
- if (val1 op val2) {\
- return AssertionSuccess();\
- } else {\
- Message msg;\
- msg << "Expected: (" << expr1 << ") " #op " (" << expr2\
- << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
- << " vs " << FormatForComparisonFailureMessage(val2, val1);\
- return AssertionFailure(msg);\
- }\
-}\
-GTEST_API_ AssertionResult CmpHelper##op_name(\
- const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-
-// Implements the helper function for {ASSERT|EXPECT}_NE
-GTEST_IMPL_CMP_HELPER_(NE, !=);
-// Implements the helper function for {ASSERT|EXPECT}_LE
-GTEST_IMPL_CMP_HELPER_(LE, <=);
-// Implements the helper function for {ASSERT|EXPECT}_LT
-GTEST_IMPL_CMP_HELPER_(LT, < );
-// Implements the helper function for {ASSERT|EXPECT}_GE
-GTEST_IMPL_CMP_HELPER_(GE, >=);
-// Implements the helper function for {ASSERT|EXPECT}_GT
-GTEST_IMPL_CMP_HELPER_(GT, > );
-
-#undef GTEST_IMPL_CMP_HELPER_
-
-// The helper function for {ASSERT|EXPECT}_STREQ.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
- const char* actual_expression,
- const char* expected,
- const char* actual);
-
-// The helper function for {ASSERT|EXPECT}_STRCASEEQ.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression,
- const char* actual_expression,
- const char* expected,
- const char* actual);
-
-// The helper function for {ASSERT|EXPECT}_STRNE.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
- const char* s2_expression,
- const char* s1,
- const char* s2);
-
-// The helper function for {ASSERT|EXPECT}_STRCASENE.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
- const char* s2_expression,
- const char* s1,
- const char* s2);
-
-
-// Helper function for *_STREQ on wide strings.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
- const char* actual_expression,
- const wchar_t* expected,
- const wchar_t* actual);
-
-// Helper function for *_STRNE on wide strings.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
- const char* s2_expression,
- const wchar_t* s1,
- const wchar_t* s2);
-
-} // namespace internal
-
-// IsSubstring() and IsNotSubstring() are intended to be used as the
-// first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by
-// themselves. They check whether needle is a substring of haystack
-// (NULL is considered a substring of itself only), and return an
-// appropriate error message when they fail.
-//
-// The {needle,haystack}_expr arguments are the stringified
-// expressions that generated the two real arguments.
-GTEST_API_ AssertionResult IsSubstring(
- const char* needle_expr, const char* haystack_expr,
- const char* needle, const char* haystack);
-GTEST_API_ AssertionResult IsSubstring(
- const char* needle_expr, const char* haystack_expr,
- const wchar_t* needle, const wchar_t* haystack);
-GTEST_API_ AssertionResult IsNotSubstring(
- const char* needle_expr, const char* haystack_expr,
- const char* needle, const char* haystack);
-GTEST_API_ AssertionResult IsNotSubstring(
- const char* needle_expr, const char* haystack_expr,
- const wchar_t* needle, const wchar_t* haystack);
-GTEST_API_ AssertionResult IsSubstring(
- const char* needle_expr, const char* haystack_expr,
- const ::std::string& needle, const ::std::string& haystack);
-GTEST_API_ AssertionResult IsNotSubstring(
- const char* needle_expr, const char* haystack_expr,
- const ::std::string& needle, const ::std::string& haystack);
-
-#if GTEST_HAS_STD_WSTRING
-GTEST_API_ AssertionResult IsSubstring(
- const char* needle_expr, const char* haystack_expr,
- const ::std::wstring& needle, const ::std::wstring& haystack);
-GTEST_API_ AssertionResult IsNotSubstring(
- const char* needle_expr, const char* haystack_expr,
- const ::std::wstring& needle, const ::std::wstring& haystack);
-#endif // GTEST_HAS_STD_WSTRING
-
-namespace internal {
-
-// Helper template function for comparing floating-points.
-//
-// Template parameter:
-//
-// RawType: the raw floating-point type (either float or double)
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-template <typename RawType>
-AssertionResult CmpHelperFloatingPointEQ(const char* expected_expression,
- const char* actual_expression,
- RawType expected,
- RawType actual) {
- const FloatingPoint<RawType> lhs(expected), rhs(actual);
-
- if (lhs.AlmostEquals(rhs)) {
- return AssertionSuccess();
- }
-
- StrStream expected_ss;
- expected_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
- << expected;
-
- StrStream actual_ss;
- actual_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
- << actual;
-
- return EqFailure(expected_expression,
- actual_expression,
- StrStreamToString(&expected_ss),
- StrStreamToString(&actual_ss),
- false);
-}
-
-// Helper function for implementing ASSERT_NEAR.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
- const char* expr2,
- const char* abs_error_expr,
- double val1,
- double val2,
- double abs_error);
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-// A class that enables one to stream messages to assertion macros
-class GTEST_API_ AssertHelper {
- public:
- // Constructor.
- AssertHelper(TestPartResult::Type type,
- const char* file,
- int line,
- const char* message);
- ~AssertHelper();
-
- // Message assignment is a semantic trick to enable assertion
- // streaming; see the GTEST_MESSAGE_ macro below.
- void operator=(const Message& message) const;
-
- private:
- // We put our data in a struct so that the size of the AssertHelper class can
- // be as small as possible. This is important because gcc is incapable of
- // re-using stack space even for temporary variables, so every EXPECT_EQ
- // reserves stack space for another AssertHelper.
- struct AssertHelperData {
- AssertHelperData(TestPartResult::Type t,
- const char* srcfile,
- int line_num,
- const char* msg)
- : type(t), file(srcfile), line(line_num), message(msg) { }
-
- TestPartResult::Type const type;
- const char* const file;
- int const line;
- String const message;
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);
- };
-
- AssertHelperData* const data_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
-};
-
-} // namespace internal
-
-#if GTEST_HAS_PARAM_TEST
-// The abstract base class that all value-parameterized tests inherit from.
-//
-// This class adds support for accessing the test parameter value via
-// the GetParam() method.
-//
-// Use it with one of the parameter generator defining functions, like Range(),
-// Values(), ValuesIn(), Bool(), and Combine().
-//
-// class FooTest : public ::testing::TestWithParam<int> {
-// protected:
-// FooTest() {
-// // Can use GetParam() here.
-// }
-// virtual ~FooTest() {
-// // Can use GetParam() here.
-// }
-// virtual void SetUp() {
-// // Can use GetParam() here.
-// }
-// virtual void TearDown {
-// // Can use GetParam() here.
-// }
-// };
-// TEST_P(FooTest, DoesBar) {
-// // Can use GetParam() method here.
-// Foo foo;
-// ASSERT_TRUE(foo.DoesBar(GetParam()));
-// }
-// INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
-
-template <typename T>
-class TestWithParam : public Test {
- public:
- typedef T ParamType;
-
- // The current parameter value. Is also available in the test fixture's
- // constructor.
- const ParamType& GetParam() const { return *parameter_; }
-
- private:
- // Sets parameter value. The caller is responsible for making sure the value
- // remains alive and unchanged throughout the current test.
- static void SetParam(const ParamType* parameter) {
- parameter_ = parameter;
- }
-
- // Static value used for accessing parameter during a test lifetime.
- static const ParamType* parameter_;
-
- // TestClass must be a subclass of TestWithParam<T>.
- template <class TestClass> friend class internal::ParameterizedTestFactory;
-};
-
-template <typename T>
-const T* TestWithParam<T>::parameter_ = NULL;
-
-#endif // GTEST_HAS_PARAM_TEST
-
-// Macros for indicating success/failure in test code.
-
-// ADD_FAILURE unconditionally adds a failure to the current test.
-// SUCCEED generates a success - it doesn't automatically make the
-// current test successful, as a test is only successful when it has
-// no failure.
-//
-// EXPECT_* verifies that a certain condition is satisfied. If not,
-// it behaves like ADD_FAILURE. In particular:
-//
-// EXPECT_TRUE verifies that a Boolean condition is true.
-// EXPECT_FALSE verifies that a Boolean condition is false.
-//
-// FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except
-// that they will also abort the current function on failure. People
-// usually want the fail-fast behavior of FAIL and ASSERT_*, but those
-// writing data-driven tests often find themselves using ADD_FAILURE
-// and EXPECT_* more.
-//
-// Examples:
-//
-// EXPECT_TRUE(server.StatusIsOK());
-// ASSERT_FALSE(server.HasPendingRequest(port))
-// << "There are still pending requests " << "on port " << port;
-
-// Generates a nonfatal failure with a generic message.
-#define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
-
-// Generates a fatal failure with a generic message.
-#define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
-
-// Define this macro to 1 to omit the definition of FAIL(), which is a
-// generic name and clashes with some other libraries.
-#if !GTEST_DONT_DEFINE_FAIL
-#define FAIL() GTEST_FAIL()
-#endif
-
-// Generates a success with a generic message.
-#define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
-
-// Define this macro to 1 to omit the definition of SUCCEED(), which
-// is a generic name and clashes with some other libraries.
-#if !GTEST_DONT_DEFINE_SUCCEED
-#define SUCCEED() GTEST_SUCCEED()
-#endif
-
-// Macros for testing exceptions.
-//
-// * {ASSERT|EXPECT}_THROW(statement, expected_exception):
-// Tests that the statement throws the expected exception.
-// * {ASSERT|EXPECT}_NO_THROW(statement):
-// Tests that the statement doesn't throw any exception.
-// * {ASSERT|EXPECT}_ANY_THROW(statement):
-// Tests that the statement throws an exception.
-
-#define EXPECT_THROW(statement, expected_exception) \
- GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
-#define EXPECT_NO_THROW(statement) \
- GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
-#define EXPECT_ANY_THROW(statement) \
- GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
-#define ASSERT_THROW(statement, expected_exception) \
- GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
-#define ASSERT_NO_THROW(statement) \
- GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
-#define ASSERT_ANY_THROW(statement) \
- GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
-
-// Boolean assertions. Condition can be either a Boolean expression or an
-// AssertionResult. For more information on how to use AssertionResult with
-// these macros see comments on that class.
-#define EXPECT_TRUE(condition) \
- GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
- GTEST_NONFATAL_FAILURE_)
-#define EXPECT_FALSE(condition) \
- GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
- GTEST_NONFATAL_FAILURE_)
-#define ASSERT_TRUE(condition) \
- GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
- GTEST_FATAL_FAILURE_)
-#define ASSERT_FALSE(condition) \
- GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
- GTEST_FATAL_FAILURE_)
-
-// Includes the auto-generated header that implements a family of
-// generic predicate assertion macros.
-#include <gtest/gtest_pred_impl.h>
-
-// Macros for testing equalities and inequalities.
-//
-// * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual
-// * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2
-// * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2
-// * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2
-// * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2
-// * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2
-//
-// When they are not, Google Test prints both the tested expressions and
-// their actual values. The values must be compatible built-in types,
-// or you will get a compiler error. By "compatible" we mean that the
-// values can be compared by the respective operator.
-//
-// Note:
-//
-// 1. It is possible to make a user-defined type work with
-// {ASSERT|EXPECT}_??(), but that requires overloading the
-// comparison operators and is thus discouraged by the Google C++
-// Usage Guide. Therefore, you are advised to use the
-// {ASSERT|EXPECT}_TRUE() macro to assert that two objects are
-// equal.
-//
-// 2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on
-// pointers (in particular, C strings). Therefore, if you use it
-// with two C strings, you are testing how their locations in memory
-// are related, not how their content is related. To compare two C
-// strings by content, use {ASSERT|EXPECT}_STR*().
-//
-// 3. {ASSERT|EXPECT}_EQ(expected, actual) is preferred to
-// {ASSERT|EXPECT}_TRUE(expected == actual), as the former tells you
-// what the actual value is when it fails, and similarly for the
-// other comparisons.
-//
-// 4. Do not depend on the order in which {ASSERT|EXPECT}_??()
-// evaluate their arguments, which is undefined.
-//
-// 5. These macros evaluate their arguments exactly once.
-//
-// Examples:
-//
-// EXPECT_NE(5, Foo());
-// EXPECT_EQ(NULL, a_pointer);
-// ASSERT_LT(i, array_size);
-// ASSERT_GT(records.size(), 0) << "There is no record left.";
-
-#define EXPECT_EQ(expected, actual) \
- EXPECT_PRED_FORMAT2(::testing::internal:: \
- EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
- expected, actual)
-#define EXPECT_NE(expected, actual) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual)
-#define EXPECT_LE(val1, val2) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
-#define EXPECT_LT(val1, val2) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
-#define EXPECT_GE(val1, val2) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
-#define EXPECT_GT(val1, val2) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
-
-#define ASSERT_EQ(expected, actual) \
- ASSERT_PRED_FORMAT2(::testing::internal:: \
- EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
- expected, actual)
-#define ASSERT_NE(val1, val2) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
-#define ASSERT_LE(val1, val2) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
-#define ASSERT_LT(val1, val2) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
-#define ASSERT_GE(val1, val2) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
-#define ASSERT_GT(val1, val2) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
-
-// C String Comparisons. All tests treat NULL and any non-NULL string
-// as different. Two NULLs are equal.
-//
-// * {ASSERT|EXPECT}_STREQ(s1, s2): Tests that s1 == s2
-// * {ASSERT|EXPECT}_STRNE(s1, s2): Tests that s1 != s2
-// * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case
-// * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case
-//
-// For wide or narrow string objects, you can use the
-// {ASSERT|EXPECT}_??() macros.
-//
-// Don't depend on the order in which the arguments are evaluated,
-// which is undefined.
-//
-// These macros evaluate their arguments exactly once.
-
-#define EXPECT_STREQ(expected, actual) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
-#define EXPECT_STRNE(s1, s2) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
-#define EXPECT_STRCASEEQ(expected, actual) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
-#define EXPECT_STRCASENE(s1, s2)\
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
-
-#define ASSERT_STREQ(expected, actual) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
-#define ASSERT_STRNE(s1, s2) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
-#define ASSERT_STRCASEEQ(expected, actual) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
-#define ASSERT_STRCASENE(s1, s2)\
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
-
-// Macros for comparing floating-point numbers.
-//
-// * {ASSERT|EXPECT}_FLOAT_EQ(expected, actual):
-// Tests that two float values are almost equal.
-// * {ASSERT|EXPECT}_DOUBLE_EQ(expected, actual):
-// Tests that two double values are almost equal.
-// * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
-// Tests that v1 and v2 are within the given distance to each other.
-//
-// Google Test uses ULP-based comparison to automatically pick a default
-// error bound that is appropriate for the operands. See the
-// FloatingPoint template class in gtest-internal.h if you are
-// interested in the implementation details.
-
-#define EXPECT_FLOAT_EQ(expected, actual)\
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
- expected, actual)
-
-#define EXPECT_DOUBLE_EQ(expected, actual)\
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
- expected, actual)
-
-#define ASSERT_FLOAT_EQ(expected, actual)\
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
- expected, actual)
-
-#define ASSERT_DOUBLE_EQ(expected, actual)\
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
- expected, actual)
-
-#define EXPECT_NEAR(val1, val2, abs_error)\
- EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
- val1, val2, abs_error)
-
-#define ASSERT_NEAR(val1, val2, abs_error)\
- ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
- val1, val2, abs_error)
-
-// These predicate format functions work on floating-point values, and
-// can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.
-//
-// EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);
-
-// Asserts that val1 is less than, or almost equal to, val2. Fails
-// otherwise. In particular, it fails if either val1 or val2 is NaN.
-GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,
- float val1, float val2);
-GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,
- double val1, double val2);
-
-
-#if GTEST_OS_WINDOWS
-
-// Macros that test for HRESULT failure and success, these are only useful
-// on Windows, and rely on Windows SDK macros and APIs to compile.
-//
-// * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)
-//
-// When expr unexpectedly fails or succeeds, Google Test prints the
-// expected result and the actual result with both a human-readable
-// string representation of the error, if available, as well as the
-// hex result code.
-#define EXPECT_HRESULT_SUCCEEDED(expr) \
- EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
-
-#define ASSERT_HRESULT_SUCCEEDED(expr) \
- ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
-
-#define EXPECT_HRESULT_FAILED(expr) \
- EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
-
-#define ASSERT_HRESULT_FAILED(expr) \
- ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
-
-#endif // GTEST_OS_WINDOWS
-
-// Macros that execute statement and check that it doesn't generate new fatal
-// failures in the current thread.
-//
-// * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);
-//
-// Examples:
-//
-// EXPECT_NO_FATAL_FAILURE(Process());
-// ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed";
-//
-#define ASSERT_NO_FATAL_FAILURE(statement) \
- GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
-#define EXPECT_NO_FATAL_FAILURE(statement) \
- GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
-
-// Causes a trace (including the source file path, the current line
-// number, and the given message) to be included in every test failure
-// message generated by code in the current scope. The effect is
-// undone when the control leaves the current scope.
-//
-// The message argument can be anything streamable to std::ostream.
-//
-// In the implementation, we include the current line number as part
-// of the dummy variable name, thus allowing multiple SCOPED_TRACE()s
-// to appear in the same block - as long as they are on different
-// lines.
-#define SCOPED_TRACE(message) \
- ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
- __FILE__, __LINE__, ::testing::Message() << (message))
-
-namespace internal {
-
-// This template is declared, but intentionally undefined.
-template <typename T1, typename T2>
-struct StaticAssertTypeEqHelper;
-
-template <typename T>
-struct StaticAssertTypeEqHelper<T, T> {};
-
-} // namespace internal
-
-// Compile-time assertion for type equality.
-// StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are
-// the same type. The value it returns is not interesting.
-//
-// Instead of making StaticAssertTypeEq a class template, we make it a
-// function template that invokes a helper class template. This
-// prevents a user from misusing StaticAssertTypeEq<T1, T2> by
-// defining objects of that type.
-//
-// CAVEAT:
-//
-// When used inside a method of a class template,
-// StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is
-// instantiated. For example, given:
-//
-// template <typename T> class Foo {
-// public:
-// void Bar() { testing::StaticAssertTypeEq<int, T>(); }
-// };
-//
-// the code:
-//
-// void Test1() { Foo<bool> foo; }
-//
-// will NOT generate a compiler error, as Foo<bool>::Bar() is never
-// actually instantiated. Instead, you need:
-//
-// void Test2() { Foo<bool> foo; foo.Bar(); }
-//
-// to cause a compiler error.
-template <typename T1, typename T2>
-bool StaticAssertTypeEq() {
- internal::StaticAssertTypeEqHelper<T1, T2>();
- return true;
-}
-
-// Defines a test.
-//
-// The first parameter is the name of the test case, and the second
-// parameter is the name of the test within the test case.
-//
-// The convention is to end the test case name with "Test". For
-// example, a test case for the Foo class can be named FooTest.
-//
-// The user should put his test code between braces after using this
-// macro. Example:
-//
-// TEST(FooTest, InitializesCorrectly) {
-// Foo foo;
-// EXPECT_TRUE(foo.StatusIsOK());
-// }
-
-// Note that we call GetTestTypeId() instead of GetTypeId<
-// ::testing::Test>() here to get the type ID of testing::Test. This
-// is to work around a suspected linker bug when using Google Test as
-// a framework on Mac OS X. The bug causes GetTypeId<
-// ::testing::Test>() to return different values depending on whether
-// the call is from the Google Test framework itself or from user test
-// code. GetTestTypeId() is guaranteed to always return the same
-// value, as it always calls GetTypeId<>() from the Google Test
-// framework.
-#define GTEST_TEST(test_case_name, test_name)\
- GTEST_TEST_(test_case_name, test_name, \
- ::testing::Test, ::testing::internal::GetTestTypeId())
-
-// Define this macro to 1 to omit the definition of TEST(), which
-// is a generic name and clashes with some other libraries.
-#if !GTEST_DONT_DEFINE_TEST
-#define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
-#endif
-
-// Defines a test that uses a test fixture.
-//
-// The first parameter is the name of the test fixture class, which
-// also doubles as the test case name. The second parameter is the
-// name of the test within the test case.
-//
-// A test fixture class must be declared earlier. The user should put
-// his test code between braces after using this macro. Example:
-//
-// class FooTest : public testing::Test {
-// protected:
-// virtual void SetUp() { b_.AddElement(3); }
-//
-// Foo a_;
-// Foo b_;
-// };
-//
-// TEST_F(FooTest, InitializesCorrectly) {
-// EXPECT_TRUE(a_.StatusIsOK());
-// }
-//
-// TEST_F(FooTest, ReturnsElementCountCorrectly) {
-// EXPECT_EQ(0, a_.size());
-// EXPECT_EQ(1, b_.size());
-// }
-
-#define TEST_F(test_fixture, test_name)\
- GTEST_TEST_(test_fixture, test_name, test_fixture, \
- ::testing::internal::GetTypeId<test_fixture>())
-
-// Use this macro in main() to run all tests. It returns 0 if all
-// tests are successful, or 1 otherwise.
-//
-// RUN_ALL_TESTS() should be invoked after the command line has been
-// parsed by InitGoogleTest().
-
-#define RUN_ALL_TESTS()\
- (::testing::UnitTest::GetInstance()->Run())
-
-} // namespace testing
-
-#endif // GTEST_INCLUDE_GTEST_GTEST_H_
diff --git a/contrib/llvm/utils/unittest/googletest/include/gtest/gtest_pred_impl.h b/contrib/llvm/utils/unittest/googletest/include/gtest/gtest_pred_impl.h
deleted file mode 100644
index e1e2f8c..0000000
--- a/contrib/llvm/utils/unittest/googletest/include/gtest/gtest_pred_impl.h
+++ /dev/null
@@ -1,368 +0,0 @@
-// Copyright 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-
-// This file is AUTOMATICALLY GENERATED on 10/02/2008 by command
-// 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
-//
-// Implements a family of generic predicate assertion macros.
-
-#ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
-#define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
-
-// Makes sure this header is not included before gtest.h.
-#ifndef GTEST_INCLUDE_GTEST_GTEST_H_
-#error Do not include gtest_pred_impl.h directly. Include gtest.h instead.
-#endif // GTEST_INCLUDE_GTEST_GTEST_H_
-
-// This header implements a family of generic predicate assertion
-// macros:
-//
-// ASSERT_PRED_FORMAT1(pred_format, v1)
-// ASSERT_PRED_FORMAT2(pred_format, v1, v2)
-// ...
-//
-// where pred_format is a function or functor that takes n (in the
-// case of ASSERT_PRED_FORMATn) values and their source expression
-// text, and returns a testing::AssertionResult. See the definition
-// of ASSERT_EQ in gtest.h for an example.
-//
-// If you don't care about formatting, you can use the more
-// restrictive version:
-//
-// ASSERT_PRED1(pred, v1)
-// ASSERT_PRED2(pred, v1, v2)
-// ...
-//
-// where pred is an n-ary function or functor that returns bool,
-// and the values v1, v2, ..., must support the << operator for
-// streaming to std::ostream.
-//
-// We also define the EXPECT_* variations.
-//
-// For now we only support predicates whose arity is at most 5.
-// Please email googletestframework@googlegroups.com if you need
-// support for higher arities.
-
-// GTEST_ASSERT_ is the basic statement to which all of the assertions
-// in this file reduce. Don't use this in your code.
-
-#define GTEST_ASSERT_(expression, on_failure) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (const ::testing::AssertionResult gtest_ar = (expression)) \
- ; \
- else \
- on_failure(gtest_ar.failure_message())
-
-
-// Helper function for implementing {EXPECT|ASSERT}_PRED1. Don't use
-// this in your code.
-template <typename Pred,
- typename T1>
-AssertionResult AssertPred1Helper(const char* pred_text,
- const char* e1,
- Pred pred,
- const T1& v1) {
- if (pred(v1)) return AssertionSuccess();
-
- Message msg;
- msg << pred_text << "("
- << e1 << ") evaluates to false, where"
- << "\n" << e1 << " evaluates to " << v1;
- return AssertionFailure(msg);
-}
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
-// Don't use this in your code.
-#define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\
- GTEST_ASSERT_(pred_format(#v1, v1),\
- on_failure)
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED1. Don't use
-// this in your code.
-#define GTEST_PRED1_(pred, v1, on_failure)\
- GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \
- #v1, \
- pred, \
- v1), on_failure)
-
-// Unary predicate assertion macros.
-#define EXPECT_PRED_FORMAT1(pred_format, v1) \
- GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
-#define EXPECT_PRED1(pred, v1) \
- GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)
-#define ASSERT_PRED_FORMAT1(pred_format, v1) \
- GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)
-#define ASSERT_PRED1(pred, v1) \
- GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)
-
-
-
-// Helper function for implementing {EXPECT|ASSERT}_PRED2. Don't use
-// this in your code.
-template <typename Pred,
- typename T1,
- typename T2>
-AssertionResult AssertPred2Helper(const char* pred_text,
- const char* e1,
- const char* e2,
- Pred pred,
- const T1& v1,
- const T2& v2) {
- if (pred(v1, v2)) return AssertionSuccess();
-
- Message msg;
- msg << pred_text << "("
- << e1 << ", "
- << e2 << ") evaluates to false, where"
- << "\n" << e1 << " evaluates to " << v1
- << "\n" << e2 << " evaluates to " << v2;
- return AssertionFailure(msg);
-}
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
-// Don't use this in your code.
-#define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\
- GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2),\
- on_failure)
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED2. Don't use
-// this in your code.
-#define GTEST_PRED2_(pred, v1, v2, on_failure)\
- GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \
- #v1, \
- #v2, \
- pred, \
- v1, \
- v2), on_failure)
-
-// Binary predicate assertion macros.
-#define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \
- GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
-#define EXPECT_PRED2(pred, v1, v2) \
- GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)
-#define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \
- GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
-#define ASSERT_PRED2(pred, v1, v2) \
- GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)
-
-
-
-// Helper function for implementing {EXPECT|ASSERT}_PRED3. Don't use
-// this in your code.
-template <typename Pred,
- typename T1,
- typename T2,
- typename T3>
-AssertionResult AssertPred3Helper(const char* pred_text,
- const char* e1,
- const char* e2,
- const char* e3,
- Pred pred,
- const T1& v1,
- const T2& v2,
- const T3& v3) {
- if (pred(v1, v2, v3)) return AssertionSuccess();
-
- Message msg;
- msg << pred_text << "("
- << e1 << ", "
- << e2 << ", "
- << e3 << ") evaluates to false, where"
- << "\n" << e1 << " evaluates to " << v1
- << "\n" << e2 << " evaluates to " << v2
- << "\n" << e3 << " evaluates to " << v3;
- return AssertionFailure(msg);
-}
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
-// Don't use this in your code.
-#define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\
- GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3),\
- on_failure)
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED3. Don't use
-// this in your code.
-#define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\
- GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \
- #v1, \
- #v2, \
- #v3, \
- pred, \
- v1, \
- v2, \
- v3), on_failure)
-
-// Ternary predicate assertion macros.
-#define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \
- GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
-#define EXPECT_PRED3(pred, v1, v2, v3) \
- GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
-#define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \
- GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)
-#define ASSERT_PRED3(pred, v1, v2, v3) \
- GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)
-
-
-
-// Helper function for implementing {EXPECT|ASSERT}_PRED4. Don't use
-// this in your code.
-template <typename Pred,
- typename T1,
- typename T2,
- typename T3,
- typename T4>
-AssertionResult AssertPred4Helper(const char* pred_text,
- const char* e1,
- const char* e2,
- const char* e3,
- const char* e4,
- Pred pred,
- const T1& v1,
- const T2& v2,
- const T3& v3,
- const T4& v4) {
- if (pred(v1, v2, v3, v4)) return AssertionSuccess();
-
- Message msg;
- msg << pred_text << "("
- << e1 << ", "
- << e2 << ", "
- << e3 << ", "
- << e4 << ") evaluates to false, where"
- << "\n" << e1 << " evaluates to " << v1
- << "\n" << e2 << " evaluates to " << v2
- << "\n" << e3 << " evaluates to " << v3
- << "\n" << e4 << " evaluates to " << v4;
- return AssertionFailure(msg);
-}
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
-// Don't use this in your code.
-#define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\
- GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4),\
- on_failure)
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED4. Don't use
-// this in your code.
-#define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\
- GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \
- #v1, \
- #v2, \
- #v3, \
- #v4, \
- pred, \
- v1, \
- v2, \
- v3, \
- v4), on_failure)
-
-// 4-ary predicate assertion macros.
-#define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
- GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
-#define EXPECT_PRED4(pred, v1, v2, v3, v4) \
- GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
-#define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
- GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
-#define ASSERT_PRED4(pred, v1, v2, v3, v4) \
- GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
-
-
-
-// Helper function for implementing {EXPECT|ASSERT}_PRED5. Don't use
-// this in your code.
-template <typename Pred,
- typename T1,
- typename T2,
- typename T3,
- typename T4,
- typename T5>
-AssertionResult AssertPred5Helper(const char* pred_text,
- const char* e1,
- const char* e2,
- const char* e3,
- const char* e4,
- const char* e5,
- Pred pred,
- const T1& v1,
- const T2& v2,
- const T3& v3,
- const T4& v4,
- const T5& v5) {
- if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();
-
- Message msg;
- msg << pred_text << "("
- << e1 << ", "
- << e2 << ", "
- << e3 << ", "
- << e4 << ", "
- << e5 << ") evaluates to false, where"
- << "\n" << e1 << " evaluates to " << v1
- << "\n" << e2 << " evaluates to " << v2
- << "\n" << e3 << " evaluates to " << v3
- << "\n" << e4 << " evaluates to " << v4
- << "\n" << e5 << " evaluates to " << v5;
- return AssertionFailure(msg);
-}
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
-// Don't use this in your code.
-#define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\
- GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5),\
- on_failure)
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED5. Don't use
-// this in your code.
-#define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\
- GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \
- #v1, \
- #v2, \
- #v3, \
- #v4, \
- #v5, \
- pred, \
- v1, \
- v2, \
- v3, \
- v4, \
- v5), on_failure)
-
-// 5-ary predicate assertion macros.
-#define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
- GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
-#define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \
- GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
-#define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
- GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
-#define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \
- GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
-
-
-
-#endif // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
diff --git a/contrib/llvm/utils/unittest/googletest/include/gtest/gtest_prod.h b/contrib/llvm/utils/unittest/googletest/include/gtest/gtest_prod.h
deleted file mode 100644
index da80ddc..0000000
--- a/contrib/llvm/utils/unittest/googletest/include/gtest/gtest_prod.h
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// Google C++ Testing Framework definitions useful in production code.
-
-#ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_
-#define GTEST_INCLUDE_GTEST_GTEST_PROD_H_
-
-// When you need to test the private or protected members of a class,
-// use the FRIEND_TEST macro to declare your tests as friends of the
-// class. For example:
-//
-// class MyClass {
-// private:
-// void MyMethod();
-// FRIEND_TEST(MyClassTest, MyMethod);
-// };
-//
-// class MyClassTest : public testing::Test {
-// // ...
-// };
-//
-// TEST_F(MyClassTest, MyMethod) {
-// // Can call MyClass::MyMethod() here.
-// }
-
-#define FRIEND_TEST(test_case_name, test_name)\
-friend class test_case_name##_##test_name##_Test
-
-#endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_
diff --git a/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h b/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h
deleted file mode 100644
index e433084..0000000
--- a/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h
+++ /dev/null
@@ -1,275 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-//
-// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
-//
-// The Google C++ Testing Framework (Google Test)
-//
-// This header file defines internal utilities needed for implementing
-// death tests. They are subject to change without notice.
-
-#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
-#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
-
-#include <gtest/internal/gtest-internal.h>
-
-namespace testing {
-namespace internal {
-
-GTEST_DECLARE_string_(internal_run_death_test);
-
-// Names of the flags (needed for parsing Google Test flags).
-const char kDeathTestStyleFlag[] = "death_test_style";
-const char kDeathTestUseFork[] = "death_test_use_fork";
-const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
-
-#if GTEST_HAS_DEATH_TEST
-
-// DeathTest is a class that hides much of the complexity of the
-// GTEST_DEATH_TEST_ macro. It is abstract; its static Create method
-// returns a concrete class that depends on the prevailing death test
-// style, as defined by the --gtest_death_test_style and/or
-// --gtest_internal_run_death_test flags.
-
-// In describing the results of death tests, these terms are used with
-// the corresponding definitions:
-//
-// exit status: The integer exit information in the format specified
-// by wait(2)
-// exit code: The integer code passed to exit(3), _exit(2), or
-// returned from main()
-class GTEST_API_ DeathTest {
- public:
- // Create returns false if there was an error determining the
- // appropriate action to take for the current death test; for example,
- // if the gtest_death_test_style flag is set to an invalid value.
- // The LastMessage method will return a more detailed message in that
- // case. Otherwise, the DeathTest pointer pointed to by the "test"
- // argument is set. If the death test should be skipped, the pointer
- // is set to NULL; otherwise, it is set to the address of a new concrete
- // DeathTest object that controls the execution of the current test.
- static bool Create(const char* statement, const RE* regex,
- const char* file, int line, DeathTest** test);
- DeathTest();
- virtual ~DeathTest() { }
-
- // A helper class that aborts a death test when it's deleted.
- class ReturnSentinel {
- public:
- explicit ReturnSentinel(DeathTest* test) : test_(test) { }
- ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }
- private:
- DeathTest* const test_;
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);
- } GTEST_ATTRIBUTE_UNUSED_;
-
- // An enumeration of possible roles that may be taken when a death
- // test is encountered. EXECUTE means that the death test logic should
- // be executed immediately. OVERSEE means that the program should prepare
- // the appropriate environment for a child process to execute the death
- // test, then wait for it to complete.
- enum TestRole { OVERSEE_TEST, EXECUTE_TEST };
-
- // An enumeration of the two reasons that a test might be aborted.
- enum AbortReason { TEST_ENCOUNTERED_RETURN_STATEMENT, TEST_DID_NOT_DIE };
-
- // Assumes one of the above roles.
- virtual TestRole AssumeRole() = 0;
-
- // Waits for the death test to finish and returns its status.
- virtual int Wait() = 0;
-
- // Returns true if the death test passed; that is, the test process
- // exited during the test, its exit status matches a user-supplied
- // predicate, and its stderr output matches a user-supplied regular
- // expression.
- // The user-supplied predicate may be a macro expression rather
- // than a function pointer or functor, or else Wait and Passed could
- // be combined.
- virtual bool Passed(bool exit_status_ok) = 0;
-
- // Signals that the death test did not die as expected.
- virtual void Abort(AbortReason reason) = 0;
-
- // Returns a human-readable outcome message regarding the outcome of
- // the last death test.
- static const char* LastMessage();
-
- static void set_last_death_test_message(const String& message);
-
- private:
- // A string containing a description of the outcome of the last death test.
- static String last_death_test_message_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);
-};
-
-// Factory interface for death tests. May be mocked out for testing.
-class DeathTestFactory {
- public:
- virtual ~DeathTestFactory() { }
- virtual bool Create(const char* statement, const RE* regex,
- const char* file, int line, DeathTest** test) = 0;
-};
-
-// A concrete DeathTestFactory implementation for normal use.
-class DefaultDeathTestFactory : public DeathTestFactory {
- public:
- virtual bool Create(const char* statement, const RE* regex,
- const char* file, int line, DeathTest** test);
-};
-
-// Returns true if exit_status describes a process that was terminated
-// by a signal, or exited normally with a nonzero exit code.
-GTEST_API_ bool ExitedUnsuccessfully(int exit_status);
-
-// This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,
-// ASSERT_EXIT*, and EXPECT_EXIT*.
-#define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (::testing::internal::AlwaysTrue()) { \
- const ::testing::internal::RE& gtest_regex = (regex); \
- ::testing::internal::DeathTest* gtest_dt; \
- if (!::testing::internal::DeathTest::Create(#statement, &gtest_regex, \
- __FILE__, __LINE__, &gtest_dt)) { \
- goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
- } \
- if (gtest_dt != NULL) { \
- ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \
- gtest_dt_ptr(gtest_dt); \
- switch (gtest_dt->AssumeRole()) { \
- case ::testing::internal::DeathTest::OVERSEE_TEST: \
- if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
- goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
- } \
- break; \
- case ::testing::internal::DeathTest::EXECUTE_TEST: { \
- ::testing::internal::DeathTest::ReturnSentinel \
- gtest_sentinel(gtest_dt); \
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
- gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
- break; \
- } \
- } \
- } \
- } else \
- GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \
- fail(::testing::internal::DeathTest::LastMessage())
-// The symbol "fail" here expands to something into which a message
-// can be streamed.
-
-// A class representing the parsed contents of the
-// --gtest_internal_run_death_test flag, as it existed when
-// RUN_ALL_TESTS was called.
-class InternalRunDeathTestFlag {
- public:
- InternalRunDeathTestFlag(const String& a_file,
- int a_line,
- int an_index,
- int a_write_fd)
- : file_(a_file), line_(a_line), index_(an_index),
- write_fd_(a_write_fd) {}
-
- ~InternalRunDeathTestFlag() {
- if (write_fd_ >= 0)
- posix::Close(write_fd_);
- }
-
- String file() const { return file_; }
- int line() const { return line_; }
- int index() const { return index_; }
- int write_fd() const { return write_fd_; }
-
- private:
- String file_;
- int line_;
- int index_;
- int write_fd_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);
-};
-
-// Returns a newly created InternalRunDeathTestFlag object with fields
-// initialized from the GTEST_FLAG(internal_run_death_test) flag if
-// the flag is specified; otherwise returns NULL.
-InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
-
-#else // GTEST_HAS_DEATH_TEST
-
-// This macro is used for implementing macros such as
-// EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
-// death tests are not supported. Those macros must compile on such systems
-// iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
-// systems that support death tests. This allows one to write such a macro
-// on a system that does not support death tests and be sure that it will
-// compile on a death-test supporting system.
-//
-// Parameters:
-// statement - A statement that a macro such as EXPECT_DEATH would test
-// for program termination. This macro has to make sure this
-// statement is compiled but not executed, to ensure that
-// EXPECT_DEATH_IF_SUPPORTED compiles with a certain
-// parameter iff EXPECT_DEATH compiles with it.
-// regex - A regex that a macro such as EXPECT_DEATH would use to test
-// the output of statement. This parameter has to be
-// compiled but not evaluated by this macro, to ensure that
-// this macro only accepts expressions that a macro such as
-// EXPECT_DEATH would accept.
-// terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED
-// and a return statement for ASSERT_DEATH_IF_SUPPORTED.
-// This ensures that ASSERT_DEATH_IF_SUPPORTED will not
-// compile inside functions where ASSERT_DEATH doesn't
-// compile.
-//
-// The branch that has an always false condition is used to ensure that
-// statement and regex are compiled (and thus syntactically correct) but
-// never executed. The unreachable code macro protects the terminator
-// statement from generating an 'unreachable code' warning in case
-// statement unconditionally returns or throws. The Message constructor at
-// the end allows the syntax of streaming additional messages into the
-// macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.
-#define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (::testing::internal::AlwaysTrue()) { \
- GTEST_LOG_(WARNING) \
- << "Death tests are not supported on this platform.\n" \
- << "Statement '" #statement "' cannot be verified."; \
- } else if (::testing::internal::AlwaysFalse()) { \
- ::testing::internal::RE::PartialMatch(".*", (regex)); \
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
- terminator; \
- } else \
- ::testing::Message()
-
-#endif // GTEST_HAS_DEATH_TEST
-
-} // namespace internal
-} // namespace testing
-
-#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
diff --git a/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-filepath.h b/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-filepath.h
deleted file mode 100644
index 4b76d79..0000000
--- a/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-filepath.h
+++ /dev/null
@@ -1,210 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-//
-// Author: keith.ray@gmail.com (Keith Ray)
-//
-// Google Test filepath utilities
-//
-// This header file declares classes and functions used internally by
-// Google Test. They are subject to change without notice.
-//
-// This file is #included in <gtest/internal/gtest-internal.h>.
-// Do not include this header file separately!
-
-#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
-#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
-
-#include <gtest/internal/gtest-string.h>
-
-namespace testing {
-namespace internal {
-
-// FilePath - a class for file and directory pathname manipulation which
-// handles platform-specific conventions (like the pathname separator).
-// Used for helper functions for naming files in a directory for xml output.
-// Except for Set methods, all methods are const or static, which provides an
-// "immutable value object" -- useful for peace of mind.
-// A FilePath with a value ending in a path separator ("like/this/") represents
-// a directory, otherwise it is assumed to represent a file. In either case,
-// it may or may not represent an actual file or directory in the file system.
-// Names are NOT checked for syntax correctness -- no checking for illegal
-// characters, malformed paths, etc.
-
-class GTEST_API_ FilePath {
- public:
- FilePath() : pathname_("") { }
- FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }
-
- explicit FilePath(const char* pathname) : pathname_(pathname) {
- Normalize();
- }
-
- explicit FilePath(const String& pathname) : pathname_(pathname) {
- Normalize();
- }
-
- FilePath& operator=(const FilePath& rhs) {
- Set(rhs);
- return *this;
- }
-
- void Set(const FilePath& rhs) {
- pathname_ = rhs.pathname_;
- }
-
- String ToString() const { return pathname_; }
- const char* c_str() const { return pathname_.c_str(); }
-
- // Returns the current working directory, or "" if unsuccessful.
- static FilePath GetCurrentDir();
-
- // Given directory = "dir", base_name = "test", number = 0,
- // extension = "xml", returns "dir/test.xml". If number is greater
- // than zero (e.g., 12), returns "dir/test_12.xml".
- // On Windows platform, uses \ as the separator rather than /.
- static FilePath MakeFileName(const FilePath& directory,
- const FilePath& base_name,
- int number,
- const char* extension);
-
- // Given directory = "dir", relative_path = "test.xml",
- // returns "dir/test.xml".
- // On Windows, uses \ as the separator rather than /.
- static FilePath ConcatPaths(const FilePath& directory,
- const FilePath& relative_path);
-
- // Returns a pathname for a file that does not currently exist. The pathname
- // will be directory/base_name.extension or
- // directory/base_name_<number>.extension if directory/base_name.extension
- // already exists. The number will be incremented until a pathname is found
- // that does not already exist.
- // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
- // There could be a race condition if two or more processes are calling this
- // function at the same time -- they could both pick the same filename.
- static FilePath GenerateUniqueFileName(const FilePath& directory,
- const FilePath& base_name,
- const char* extension);
-
- // Returns true iff the path is NULL or "".
- bool IsEmpty() const { return c_str() == NULL || *c_str() == '\0'; }
-
- // If input name has a trailing separator character, removes it and returns
- // the name, otherwise return the name string unmodified.
- // On Windows platform, uses \ as the separator, other platforms use /.
- FilePath RemoveTrailingPathSeparator() const;
-
- // Returns a copy of the FilePath with the directory part removed.
- // Example: FilePath("path/to/file").RemoveDirectoryName() returns
- // FilePath("file"). If there is no directory part ("just_a_file"), it returns
- // the FilePath unmodified. If there is no file part ("just_a_dir/") it
- // returns an empty FilePath ("").
- // On Windows platform, '\' is the path separator, otherwise it is '/'.
- FilePath RemoveDirectoryName() const;
-
- // RemoveFileName returns the directory path with the filename removed.
- // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
- // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
- // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
- // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
- // On Windows platform, '\' is the path separator, otherwise it is '/'.
- FilePath RemoveFileName() const;
-
- // Returns a copy of the FilePath with the case-insensitive extension removed.
- // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
- // FilePath("dir/file"). If a case-insensitive extension is not
- // found, returns a copy of the original FilePath.
- FilePath RemoveExtension(const char* extension) const;
-
- // Creates directories so that path exists. Returns true if successful or if
- // the directories already exist; returns false if unable to create
- // directories for any reason. Will also return false if the FilePath does
- // not represent a directory (that is, it doesn't end with a path separator).
- bool CreateDirectoriesRecursively() const;
-
- // Create the directory so that path exists. Returns true if successful or
- // if the directory already exists; returns false if unable to create the
- // directory for any reason, including if the parent directory does not
- // exist. Not named "CreateDirectory" because that's a macro on Windows.
- bool CreateFolder() const;
-
- // Returns true if FilePath describes something in the file-system,
- // either a file, directory, or whatever, and that something exists.
- bool FileOrDirectoryExists() const;
-
- // Returns true if pathname describes a directory in the file-system
- // that exists.
- bool DirectoryExists() const;
-
- // Returns true if FilePath ends with a path separator, which indicates that
- // it is intended to represent a directory. Returns false otherwise.
- // This does NOT check that a directory (or file) actually exists.
- bool IsDirectory() const;
-
- // Returns true if pathname describes a root directory. (Windows has one
- // root directory per disk drive.)
- bool IsRootDirectory() const;
-
- // Returns true if pathname describes an absolute path.
- bool IsAbsolutePath() const;
-
- private:
- // Replaces multiple consecutive separators with a single separator.
- // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
- // redundancies that might be in a pathname involving "." or "..".
- //
- // A pathname with multiple consecutive separators may occur either through
- // user error or as a result of some scripts or APIs that generate a pathname
- // with a trailing separator. On other platforms the same API or script
- // may NOT generate a pathname with a trailing "/". Then elsewhere that
- // pathname may have another "/" and pathname components added to it,
- // without checking for the separator already being there.
- // The script language and operating system may allow paths like "foo//bar"
- // but some of the functions in FilePath will not handle that correctly. In
- // particular, RemoveTrailingPathSeparator() only removes one separator, and
- // it is called in CreateDirectoriesRecursively() assuming that it will change
- // a pathname from directory syntax (trailing separator) to filename syntax.
- //
- // On Windows this method also replaces the alternate path separator '/' with
- // the primary path separator '\\', so that for example "bar\\/\\foo" becomes
- // "bar\\foo".
-
- void Normalize();
-
- // Returns a pointer to the last occurence of a valid path separator in
- // the FilePath. On Windows, for example, both '/' and '\' are valid path
- // separators. Returns NULL if no path separator was found.
- const char* FindLastPathSeparator() const;
-
- String pathname_;
-}; // class FilePath
-
-} // namespace internal
-} // namespace testing
-
-#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
diff --git a/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-internal-inl.h b/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-internal-inl.h
deleted file mode 100644
index 855b215..0000000
--- a/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-internal-inl.h
+++ /dev/null
@@ -1,1074 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-
-// Utility functions and classes used by the Google C++ testing framework.
-//
-// Author: wan@google.com (Zhanyong Wan)
-//
-// This file contains purely Google Test's internal implementation. Please
-// DO NOT #INCLUDE IT IN A USER PROGRAM.
-
-#ifndef GTEST_SRC_GTEST_INTERNAL_INL_H_
-#define GTEST_SRC_GTEST_INTERNAL_INL_H_
-
-// GTEST_IMPLEMENTATION_ is defined to 1 iff the current translation unit is
-// part of Google Test's implementation; otherwise it's undefined.
-#if !GTEST_IMPLEMENTATION_
-// A user is trying to include this from his code - just say no.
-#error "gtest-internal-inl.h is part of Google Test's internal implementation."
-#error "It must not be included except by Google Test itself."
-#endif // GTEST_IMPLEMENTATION_
-
-#ifndef _WIN32_WCE
-#include <errno.h>
-#endif // !_WIN32_WCE
-#include <stddef.h>
-#include <stdlib.h> // For strtoll/_strtoul64/malloc/free.
-#include <string.h> // For memmove.
-
-#include <algorithm>
-#include <string>
-#include <vector>
-
-#include <gtest/internal/gtest-port.h>
-
-#if GTEST_OS_WINDOWS
-#include <windows.h> // For DWORD.
-#endif // GTEST_OS_WINDOWS
-
-#include <gtest/gtest.h> // NOLINT
-#include <gtest/gtest-spi.h>
-
-namespace testing {
-
-// Declares the flags.
-//
-// We don't want the users to modify this flag in the code, but want
-// Google Test's own unit tests to be able to access it. Therefore we
-// declare it here as opposed to in gtest.h.
-GTEST_DECLARE_bool_(death_test_use_fork);
-
-namespace internal {
-
-// The value of GetTestTypeId() as seen from within the Google Test
-// library. This is solely for testing GetTestTypeId().
-GTEST_API_ extern const TypeId kTestTypeIdInGoogleTest;
-
-// Names of the flags (needed for parsing Google Test flags).
-const char kAlsoRunDisabledTestsFlag[] = "also_run_disabled_tests";
-const char kBreakOnFailureFlag[] = "break_on_failure";
-const char kCatchExceptionsFlag[] = "catch_exceptions";
-const char kColorFlag[] = "color";
-const char kFilterFlag[] = "filter";
-const char kListTestsFlag[] = "list_tests";
-const char kOutputFlag[] = "output";
-const char kPrintTimeFlag[] = "print_time";
-const char kRandomSeedFlag[] = "random_seed";
-const char kRepeatFlag[] = "repeat";
-const char kShuffleFlag[] = "shuffle";
-const char kStackTraceDepthFlag[] = "stack_trace_depth";
-const char kThrowOnFailureFlag[] = "throw_on_failure";
-
-// A valid random seed must be in [1, kMaxRandomSeed].
-const int kMaxRandomSeed = 99999;
-
-// g_help_flag is true iff the --help flag or an equivalent form is
-// specified on the command line.
-GTEST_API_ extern bool g_help_flag;
-
-// Returns the current time in milliseconds.
-GTEST_API_ TimeInMillis GetTimeInMillis();
-
-// Returns true iff Google Test should use colors in the output.
-GTEST_API_ bool ShouldUseColor(bool stdout_is_tty);
-
-// Formats the given time in milliseconds as seconds.
-GTEST_API_ std::string FormatTimeInMillisAsSeconds(TimeInMillis ms);
-
-// Parses a string for an Int32 flag, in the form of "--flag=value".
-//
-// On success, stores the value of the flag in *value, and returns
-// true. On failure, returns false without changing *value.
-GTEST_API_ bool ParseInt32Flag(
- const char* str, const char* flag, Int32* value);
-
-// Returns a random seed in range [1, kMaxRandomSeed] based on the
-// given --gtest_random_seed flag value.
-inline int GetRandomSeedFromFlag(Int32 random_seed_flag) {
- const unsigned int raw_seed = (random_seed_flag == 0) ?
- static_cast<unsigned int>(GetTimeInMillis()) :
- static_cast<unsigned int>(random_seed_flag);
-
- // Normalizes the actual seed to range [1, kMaxRandomSeed] such that
- // it's easy to type.
- const int normalized_seed =
- static_cast<int>((raw_seed - 1U) %
- static_cast<unsigned int>(kMaxRandomSeed)) + 1;
- return normalized_seed;
-}
-
-// Returns the first valid random seed after 'seed'. The behavior is
-// undefined if 'seed' is invalid. The seed after kMaxRandomSeed is
-// considered to be 1.
-inline int GetNextRandomSeed(int seed) {
- GTEST_CHECK_(1 <= seed && seed <= kMaxRandomSeed)
- << "Invalid random seed " << seed << " - must be in [1, "
- << kMaxRandomSeed << "].";
- const int next_seed = seed + 1;
- return (next_seed > kMaxRandomSeed) ? 1 : next_seed;
-}
-
-// This class saves the values of all Google Test flags in its c'tor, and
-// restores them in its d'tor.
-class GTestFlagSaver {
- public:
- // The c'tor.
- GTestFlagSaver() {
- also_run_disabled_tests_ = GTEST_FLAG(also_run_disabled_tests);
- break_on_failure_ = GTEST_FLAG(break_on_failure);
- catch_exceptions_ = GTEST_FLAG(catch_exceptions);
- color_ = GTEST_FLAG(color);
- death_test_style_ = GTEST_FLAG(death_test_style);
- death_test_use_fork_ = GTEST_FLAG(death_test_use_fork);
- filter_ = GTEST_FLAG(filter);
- internal_run_death_test_ = GTEST_FLAG(internal_run_death_test);
- list_tests_ = GTEST_FLAG(list_tests);
- output_ = GTEST_FLAG(output);
- print_time_ = GTEST_FLAG(print_time);
- random_seed_ = GTEST_FLAG(random_seed);
- repeat_ = GTEST_FLAG(repeat);
- shuffle_ = GTEST_FLAG(shuffle);
- stack_trace_depth_ = GTEST_FLAG(stack_trace_depth);
- throw_on_failure_ = GTEST_FLAG(throw_on_failure);
- }
-
- // The d'tor is not virtual. DO NOT INHERIT FROM THIS CLASS.
- ~GTestFlagSaver() {
- GTEST_FLAG(also_run_disabled_tests) = also_run_disabled_tests_;
- GTEST_FLAG(break_on_failure) = break_on_failure_;
- GTEST_FLAG(catch_exceptions) = catch_exceptions_;
- GTEST_FLAG(color) = color_;
- GTEST_FLAG(death_test_style) = death_test_style_;
- GTEST_FLAG(death_test_use_fork) = death_test_use_fork_;
- GTEST_FLAG(filter) = filter_;
- GTEST_FLAG(internal_run_death_test) = internal_run_death_test_;
- GTEST_FLAG(list_tests) = list_tests_;
- GTEST_FLAG(output) = output_;
- GTEST_FLAG(print_time) = print_time_;
- GTEST_FLAG(random_seed) = random_seed_;
- GTEST_FLAG(repeat) = repeat_;
- GTEST_FLAG(shuffle) = shuffle_;
- GTEST_FLAG(stack_trace_depth) = stack_trace_depth_;
- GTEST_FLAG(throw_on_failure) = throw_on_failure_;
- }
- private:
- // Fields for saving the original values of flags.
- bool also_run_disabled_tests_;
- bool break_on_failure_;
- bool catch_exceptions_;
- String color_;
- String death_test_style_;
- bool death_test_use_fork_;
- String filter_;
- String internal_run_death_test_;
- bool list_tests_;
- String output_;
- bool print_time_;
- bool pretty_;
- internal::Int32 random_seed_;
- internal::Int32 repeat_;
- bool shuffle_;
- internal::Int32 stack_trace_depth_;
- bool throw_on_failure_;
-} GTEST_ATTRIBUTE_UNUSED_;
-
-// Converts a Unicode code point to a narrow string in UTF-8 encoding.
-// code_point parameter is of type UInt32 because wchar_t may not be
-// wide enough to contain a code point.
-// The output buffer str must containt at least 32 characters.
-// The function returns the address of the output buffer.
-// If the code_point is not a valid Unicode code point
-// (i.e. outside of Unicode range U+0 to U+10FFFF) it will be output
-// as '(Invalid Unicode 0xXXXXXXXX)'.
-GTEST_API_ char* CodePointToUtf8(UInt32 code_point, char* str);
-
-// Converts a wide string to a narrow string in UTF-8 encoding.
-// The wide string is assumed to have the following encoding:
-// UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS)
-// UTF-32 if sizeof(wchar_t) == 4 (on Linux)
-// Parameter str points to a null-terminated wide string.
-// Parameter num_chars may additionally limit the number
-// of wchar_t characters processed. -1 is used when the entire string
-// should be processed.
-// If the string contains code points that are not valid Unicode code points
-// (i.e. outside of Unicode range U+0 to U+10FFFF) they will be output
-// as '(Invalid Unicode 0xXXXXXXXX)'. If the string is in UTF16 encoding
-// and contains invalid UTF-16 surrogate pairs, values in those pairs
-// will be encoded as individual Unicode characters from Basic Normal Plane.
-GTEST_API_ String WideStringToUtf8(const wchar_t* str, int num_chars);
-
-// Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file
-// if the variable is present. If a file already exists at this location, this
-// function will write over it. If the variable is present, but the file cannot
-// be created, prints an error and exits.
-void WriteToShardStatusFileIfNeeded();
-
-// Checks whether sharding is enabled by examining the relevant
-// environment variable values. If the variables are present,
-// but inconsistent (e.g., shard_index >= total_shards), prints
-// an error and exits. If in_subprocess_for_death_test, sharding is
-// disabled because it must only be applied to the original test
-// process. Otherwise, we could filter out death tests we intended to execute.
-GTEST_API_ bool ShouldShard(const char* total_shards_str,
- const char* shard_index_str,
- bool in_subprocess_for_death_test);
-
-// Parses the environment variable var as an Int32. If it is unset,
-// returns default_val. If it is not an Int32, prints an error and
-// and aborts.
-GTEST_API_ Int32 Int32FromEnvOrDie(const char* env_var, Int32 default_val);
-
-// Given the total number of shards, the shard index, and the test id,
-// returns true iff the test should be run on this shard. The test id is
-// some arbitrary but unique non-negative integer assigned to each test
-// method. Assumes that 0 <= shard_index < total_shards.
-GTEST_API_ bool ShouldRunTestOnShard(
- int total_shards, int shard_index, int test_id);
-
-// STL container utilities.
-
-// Returns the number of elements in the given container that satisfy
-// the given predicate.
-template <class Container, typename Predicate>
-inline int CountIf(const Container& c, Predicate predicate) {
- return static_cast<int>(std::count_if(c.begin(), c.end(), predicate));
-}
-
-// Applies a function/functor to each element in the container.
-template <class Container, typename Functor>
-void ForEach(const Container& c, Functor functor) {
- std::for_each(c.begin(), c.end(), functor);
-}
-
-// Returns the i-th element of the vector, or default_value if i is not
-// in range [0, v.size()).
-template <typename E>
-inline E GetElementOr(const std::vector<E>& v, int i, E default_value) {
- return (i < 0 || i >= static_cast<int>(v.size())) ? default_value : v[i];
-}
-
-// Performs an in-place shuffle of a range of the vector's elements.
-// 'begin' and 'end' are element indices as an STL-style range;
-// i.e. [begin, end) are shuffled, where 'end' == size() means to
-// shuffle to the end of the vector.
-template <typename E>
-void ShuffleRange(internal::Random* random, int begin, int end,
- std::vector<E>* v) {
- const int size = static_cast<int>(v->size());
- GTEST_CHECK_(0 <= begin && begin <= size)
- << "Invalid shuffle range start " << begin << ": must be in range [0, "
- << size << "].";
- GTEST_CHECK_(begin <= end && end <= size)
- << "Invalid shuffle range finish " << end << ": must be in range ["
- << begin << ", " << size << "].";
-
- // Fisher-Yates shuffle, from
- // http://en.wikipedia.org/wiki/Fisher-Yates_shuffle
- for (int range_width = end - begin; range_width >= 2; range_width--) {
- const int last_in_range = begin + range_width - 1;
- const int selected = begin + random->Generate(range_width);
- std::swap((*v)[selected], (*v)[last_in_range]);
- }
-}
-
-// Performs an in-place shuffle of the vector's elements.
-template <typename E>
-inline void Shuffle(internal::Random* random, std::vector<E>* v) {
- ShuffleRange(random, 0, static_cast<int>(v->size()), v);
-}
-
-// A function for deleting an object. Handy for being used as a
-// functor.
-template <typename T>
-static void Delete(T* x) {
- delete x;
-}
-
-// A predicate that checks the key of a TestProperty against a known key.
-//
-// TestPropertyKeyIs is copyable.
-class TestPropertyKeyIs {
- public:
- // Constructor.
- //
- // TestPropertyKeyIs has NO default constructor.
- explicit TestPropertyKeyIs(const char* key)
- : key_(key) {}
-
- // Returns true iff the test name of test property matches on key_.
- bool operator()(const TestProperty& test_property) const {
- return String(test_property.key()).Compare(key_) == 0;
- }
-
- private:
- String key_;
-};
-
-class TestInfoImpl {
- public:
- TestInfoImpl(TestInfo* parent, const char* test_case_name,
- const char* name, const char* test_case_comment,
- const char* comment, TypeId fixture_class_id,
- internal::TestFactoryBase* factory);
- ~TestInfoImpl();
-
- // Returns true if this test should run.
- bool should_run() const { return should_run_; }
-
- // Sets the should_run member.
- void set_should_run(bool should) { should_run_ = should; }
-
- // Returns true if this test is disabled. Disabled tests are not run.
- bool is_disabled() const { return is_disabled_; }
-
- // Sets the is_disabled member.
- void set_is_disabled(bool is) { is_disabled_ = is; }
-
- // Returns true if this test matches the filter specified by the user.
- bool matches_filter() const { return matches_filter_; }
-
- // Sets the matches_filter member.
- void set_matches_filter(bool matches) { matches_filter_ = matches; }
-
- // Returns the test case name.
- const char* test_case_name() const { return test_case_name_.c_str(); }
-
- // Returns the test name.
- const char* name() const { return name_.c_str(); }
-
- // Returns the test case comment.
- const char* test_case_comment() const { return test_case_comment_.c_str(); }
-
- // Returns the test comment.
- const char* comment() const { return comment_.c_str(); }
-
- // Returns the ID of the test fixture class.
- TypeId fixture_class_id() const { return fixture_class_id_; }
-
- // Returns the test result.
- TestResult* result() { return &result_; }
- const TestResult* result() const { return &result_; }
-
- // Creates the test object, runs it, records its result, and then
- // deletes it.
- void Run();
-
- // Clears the test result.
- void ClearResult() { result_.Clear(); }
-
- // Clears the test result in the given TestInfo object.
- static void ClearTestResult(TestInfo * test_info) {
- test_info->impl()->ClearResult();
- }
-
- private:
- // These fields are immutable properties of the test.
- TestInfo* const parent_; // The owner of this object
- const String test_case_name_; // Test case name
- const String name_; // Test name
- const String test_case_comment_; // Test case comment
- const String comment_; // Test comment
- const TypeId fixture_class_id_; // ID of the test fixture class
- bool should_run_; // True iff this test should run
- bool is_disabled_; // True iff this test is disabled
- bool matches_filter_; // True if this test matches the
- // user-specified filter.
- internal::TestFactoryBase* const factory_; // The factory that creates
- // the test object
-
- // This field is mutable and needs to be reset before running the
- // test for the second time.
- TestResult result_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfoImpl);
-};
-
-// Class UnitTestOptions.
-//
-// This class contains functions for processing options the user
-// specifies when running the tests. It has only static members.
-//
-// In most cases, the user can specify an option using either an
-// environment variable or a command line flag. E.g. you can set the
-// test filter using either GTEST_FILTER or --gtest_filter. If both
-// the variable and the flag are present, the latter overrides the
-// former.
-class GTEST_API_ UnitTestOptions {
- public:
- // Functions for processing the gtest_output flag.
-
- // Returns the output format, or "" for normal printed output.
- static String GetOutputFormat();
-
- // Returns the absolute path of the requested output file, or the
- // default (test_detail.xml in the original working directory) if
- // none was explicitly specified.
- static String GetAbsolutePathToOutputFile();
-
- // Functions for processing the gtest_filter flag.
-
- // Returns true iff the wildcard pattern matches the string. The
- // first ':' or '\0' character in pattern marks the end of it.
- //
- // This recursive algorithm isn't very efficient, but is clear and
- // works well enough for matching test names, which are short.
- static bool PatternMatchesString(const char *pattern, const char *str);
-
- // Returns true iff the user-specified filter matches the test case
- // name and the test name.
- static bool FilterMatchesTest(const String &test_case_name,
- const String &test_name);
-
-#if GTEST_OS_WINDOWS
- // Function for supporting the gtest_catch_exception flag.
-
- // Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the
- // given SEH exception, or EXCEPTION_CONTINUE_SEARCH otherwise.
- // This function is useful as an __except condition.
- static int GTestShouldProcessSEH(DWORD exception_code);
-#endif // GTEST_OS_WINDOWS
-
- // Returns true if "name" matches the ':' separated list of glob-style
- // filters in "filter".
- static bool MatchesFilter(const String& name, const char* filter);
-};
-
-// Returns the current application's name, removing directory path if that
-// is present. Used by UnitTestOptions::GetOutputFile.
-GTEST_API_ FilePath GetCurrentExecutableName();
-
-// The role interface for getting the OS stack trace as a string.
-class OsStackTraceGetterInterface {
- public:
- OsStackTraceGetterInterface() {}
- virtual ~OsStackTraceGetterInterface() {}
-
- // Returns the current OS stack trace as a String. Parameters:
- //
- // max_depth - the maximum number of stack frames to be included
- // in the trace.
- // skip_count - the number of top frames to be skipped; doesn't count
- // against max_depth.
- virtual String CurrentStackTrace(int max_depth, int skip_count) = 0;
-
- // UponLeavingGTest() should be called immediately before Google Test calls
- // user code. It saves some information about the current stack that
- // CurrentStackTrace() will use to find and hide Google Test stack frames.
- virtual void UponLeavingGTest() = 0;
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetterInterface);
-};
-
-// A working implementation of the OsStackTraceGetterInterface interface.
-class OsStackTraceGetter : public OsStackTraceGetterInterface {
- public:
- OsStackTraceGetter() : caller_frame_(NULL) {}
- virtual String CurrentStackTrace(int max_depth, int skip_count);
- virtual void UponLeavingGTest();
-
- // This string is inserted in place of stack frames that are part of
- // Google Test's implementation.
- static const char* const kElidedFramesMarker;
-
- private:
- Mutex mutex_; // protects all internal state
-
- // We save the stack frame below the frame that calls user code.
- // We do this because the address of the frame immediately below
- // the user code changes between the call to UponLeavingGTest()
- // and any calls to CurrentStackTrace() from within the user code.
- void* caller_frame_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetter);
-};
-
-// Information about a Google Test trace point.
-struct TraceInfo {
- const char* file;
- int line;
- String message;
-};
-
-// This is the default global test part result reporter used in UnitTestImpl.
-// This class should only be used by UnitTestImpl.
-class DefaultGlobalTestPartResultReporter
- : public TestPartResultReporterInterface {
- public:
- explicit DefaultGlobalTestPartResultReporter(UnitTestImpl* unit_test);
- // Implements the TestPartResultReporterInterface. Reports the test part
- // result in the current test.
- virtual void ReportTestPartResult(const TestPartResult& result);
-
- private:
- UnitTestImpl* const unit_test_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultGlobalTestPartResultReporter);
-};
-
-// This is the default per thread test part result reporter used in
-// UnitTestImpl. This class should only be used by UnitTestImpl.
-class DefaultPerThreadTestPartResultReporter
- : public TestPartResultReporterInterface {
- public:
- explicit DefaultPerThreadTestPartResultReporter(UnitTestImpl* unit_test);
- // Implements the TestPartResultReporterInterface. The implementation just
- // delegates to the current global test part result reporter of *unit_test_.
- virtual void ReportTestPartResult(const TestPartResult& result);
-
- private:
- UnitTestImpl* const unit_test_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultPerThreadTestPartResultReporter);
-};
-
-// The private implementation of the UnitTest class. We don't protect
-// the methods under a mutex, as this class is not accessible by a
-// user and the UnitTest class that delegates work to this class does
-// proper locking.
-class GTEST_API_ UnitTestImpl {
- public:
- explicit UnitTestImpl(UnitTest* parent);
- virtual ~UnitTestImpl();
-
- // There are two different ways to register your own TestPartResultReporter.
- // You can register your own repoter to listen either only for test results
- // from the current thread or for results from all threads.
- // By default, each per-thread test result repoter just passes a new
- // TestPartResult to the global test result reporter, which registers the
- // test part result for the currently running test.
-
- // Returns the global test part result reporter.
- TestPartResultReporterInterface* GetGlobalTestPartResultReporter();
-
- // Sets the global test part result reporter.
- void SetGlobalTestPartResultReporter(
- TestPartResultReporterInterface* reporter);
-
- // Returns the test part result reporter for the current thread.
- TestPartResultReporterInterface* GetTestPartResultReporterForCurrentThread();
-
- // Sets the test part result reporter for the current thread.
- void SetTestPartResultReporterForCurrentThread(
- TestPartResultReporterInterface* reporter);
-
- // Gets the number of successful test cases.
- int successful_test_case_count() const;
-
- // Gets the number of failed test cases.
- int failed_test_case_count() const;
-
- // Gets the number of all test cases.
- int total_test_case_count() const;
-
- // Gets the number of all test cases that contain at least one test
- // that should run.
- int test_case_to_run_count() const;
-
- // Gets the number of successful tests.
- int successful_test_count() const;
-
- // Gets the number of failed tests.
- int failed_test_count() const;
-
- // Gets the number of disabled tests.
- int disabled_test_count() const;
-
- // Gets the number of all tests.
- int total_test_count() const;
-
- // Gets the number of tests that should run.
- int test_to_run_count() const;
-
- // Gets the elapsed time, in milliseconds.
- TimeInMillis elapsed_time() const { return elapsed_time_; }
-
- // Returns true iff the unit test passed (i.e. all test cases passed).
- bool Passed() const { return !Failed(); }
-
- // Returns true iff the unit test failed (i.e. some test case failed
- // or something outside of all tests failed).
- bool Failed() const {
- return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed();
- }
-
- // Gets the i-th test case among all the test cases. i can range from 0 to
- // total_test_case_count() - 1. If i is not in that range, returns NULL.
- const TestCase* GetTestCase(int i) const {
- const int index = GetElementOr(test_case_indices_, i, -1);
- return index < 0 ? NULL : test_cases_[i];
- }
-
- // Gets the i-th test case among all the test cases. i can range from 0 to
- // total_test_case_count() - 1. If i is not in that range, returns NULL.
- TestCase* GetMutableTestCase(int i) {
- const int index = GetElementOr(test_case_indices_, i, -1);
- return index < 0 ? NULL : test_cases_[index];
- }
-
- // Provides access to the event listener list.
- TestEventListeners* listeners() { return &listeners_; }
-
- // Returns the TestResult for the test that's currently running, or
- // the TestResult for the ad hoc test if no test is running.
- TestResult* current_test_result();
-
- // Returns the TestResult for the ad hoc test.
- const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; }
-
- // Sets the OS stack trace getter.
- //
- // Does nothing if the input and the current OS stack trace getter
- // are the same; otherwise, deletes the old getter and makes the
- // input the current getter.
- void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter);
-
- // Returns the current OS stack trace getter if it is not NULL;
- // otherwise, creates an OsStackTraceGetter, makes it the current
- // getter, and returns it.
- OsStackTraceGetterInterface* os_stack_trace_getter();
-
- // Returns the current OS stack trace as a String.
- //
- // The maximum number of stack frames to be included is specified by
- // the gtest_stack_trace_depth flag. The skip_count parameter
- // specifies the number of top frames to be skipped, which doesn't
- // count against the number of frames to be included.
- //
- // For example, if Foo() calls Bar(), which in turn calls
- // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
- // trace but Bar() and CurrentOsStackTraceExceptTop() won't.
- String CurrentOsStackTraceExceptTop(int skip_count);
-
- // Finds and returns a TestCase with the given name. If one doesn't
- // exist, creates one and returns it.
- //
- // Arguments:
- //
- // test_case_name: name of the test case
- // set_up_tc: pointer to the function that sets up the test case
- // tear_down_tc: pointer to the function that tears down the test case
- TestCase* GetTestCase(const char* test_case_name,
- const char* comment,
- Test::SetUpTestCaseFunc set_up_tc,
- Test::TearDownTestCaseFunc tear_down_tc);
-
- // Adds a TestInfo to the unit test.
- //
- // Arguments:
- //
- // set_up_tc: pointer to the function that sets up the test case
- // tear_down_tc: pointer to the function that tears down the test case
- // test_info: the TestInfo object
- void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc,
- Test::TearDownTestCaseFunc tear_down_tc,
- TestInfo * test_info) {
- // In order to support thread-safe death tests, we need to
- // remember the original working directory when the test program
- // was first invoked. We cannot do this in RUN_ALL_TESTS(), as
- // the user may have changed the current directory before calling
- // RUN_ALL_TESTS(). Therefore we capture the current directory in
- // AddTestInfo(), which is called to register a TEST or TEST_F
- // before main() is reached.
- if (original_working_dir_.IsEmpty()) {
- original_working_dir_.Set(FilePath::GetCurrentDir());
- GTEST_CHECK_(!original_working_dir_.IsEmpty())
- << "Failed to get the current working directory.";
- }
-
- GetTestCase(test_info->test_case_name(),
- test_info->test_case_comment(),
- set_up_tc,
- tear_down_tc)->AddTestInfo(test_info);
- }
-
-#if GTEST_HAS_PARAM_TEST
- // Returns ParameterizedTestCaseRegistry object used to keep track of
- // value-parameterized tests and instantiate and register them.
- internal::ParameterizedTestCaseRegistry& parameterized_test_registry() {
- return parameterized_test_registry_;
- }
-#endif // GTEST_HAS_PARAM_TEST
-
- // Sets the TestCase object for the test that's currently running.
- void set_current_test_case(TestCase* a_current_test_case) {
- current_test_case_ = a_current_test_case;
- }
-
- // Sets the TestInfo object for the test that's currently running. If
- // current_test_info is NULL, the assertion results will be stored in
- // ad_hoc_test_result_.
- void set_current_test_info(TestInfo* a_current_test_info) {
- current_test_info_ = a_current_test_info;
- }
-
- // Registers all parameterized tests defined using TEST_P and
- // INSTANTIATE_TEST_P, creating regular tests for each test/parameter
- // combination. This method can be called more then once; it has
- // guards protecting from registering the tests more then once.
- // If value-parameterized tests are disabled, RegisterParameterizedTests
- // is present but does nothing.
- void RegisterParameterizedTests();
-
- // Runs all tests in this UnitTest object, prints the result, and
- // returns 0 if all tests are successful, or 1 otherwise. If any
- // exception is thrown during a test on Windows, this test is
- // considered to be failed, but the rest of the tests will still be
- // run. (We disable exceptions on Linux and Mac OS X, so the issue
- // doesn't apply there.)
- int RunAllTests();
-
- // Clears the results of all tests, including the ad hoc test.
- void ClearResult() {
- ForEach(test_cases_, TestCase::ClearTestCaseResult);
- ad_hoc_test_result_.Clear();
- }
-
- enum ReactionToSharding {
- HONOR_SHARDING_PROTOCOL,
- IGNORE_SHARDING_PROTOCOL
- };
-
- // Matches the full name of each test against the user-specified
- // filter to decide whether the test should run, then records the
- // result in each TestCase and TestInfo object.
- // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests
- // based on sharding variables in the environment.
- // Returns the number of tests that should run.
- int FilterTests(ReactionToSharding shard_tests);
-
- // Prints the names of the tests matching the user-specified filter flag.
- void ListTestsMatchingFilter();
-
- const TestCase* current_test_case() const { return current_test_case_; }
- TestInfo* current_test_info() { return current_test_info_; }
- const TestInfo* current_test_info() const { return current_test_info_; }
-
- // Returns the vector of environments that need to be set-up/torn-down
- // before/after the tests are run.
- std::vector<Environment*>& environments() { return environments_; }
-
- // Getters for the per-thread Google Test trace stack.
- std::vector<TraceInfo>& gtest_trace_stack() {
- return *(gtest_trace_stack_.pointer());
- }
- const std::vector<TraceInfo>& gtest_trace_stack() const {
- return gtest_trace_stack_.get();
- }
-
-#if GTEST_HAS_DEATH_TEST
- void InitDeathTestSubprocessControlInfo() {
- internal_run_death_test_flag_.reset(ParseInternalRunDeathTestFlag());
- }
- // Returns a pointer to the parsed --gtest_internal_run_death_test
- // flag, or NULL if that flag was not specified.
- // This information is useful only in a death test child process.
- // Must not be called before a call to InitGoogleTest.
- const InternalRunDeathTestFlag* internal_run_death_test_flag() const {
- return internal_run_death_test_flag_.get();
- }
-
- // Returns a pointer to the current death test factory.
- internal::DeathTestFactory* death_test_factory() {
- return death_test_factory_.get();
- }
-
- void SuppressTestEventsIfInSubprocess();
-
- friend class ReplaceDeathTestFactory;
-#endif // GTEST_HAS_DEATH_TEST
-
- // Initializes the event listener performing XML output as specified by
- // UnitTestOptions. Must not be called before InitGoogleTest.
- void ConfigureXmlOutput();
-
- // Performs initialization dependent upon flag values obtained in
- // ParseGoogleTestFlagsOnly. Is called from InitGoogleTest after the call to
- // ParseGoogleTestFlagsOnly. In case a user neglects to call InitGoogleTest
- // this function is also called from RunAllTests. Since this function can be
- // called more than once, it has to be idempotent.
- void PostFlagParsingInit();
-
- // Gets the random seed used at the start of the current test iteration.
- int random_seed() const { return random_seed_; }
-
- // Gets the random number generator.
- internal::Random* random() { return &random_; }
-
- // Shuffles all test cases, and the tests within each test case,
- // making sure that death tests are still run first.
- void ShuffleTests();
-
- // Restores the test cases and tests to their order before the first shuffle.
- void UnshuffleTests();
-
- private:
- friend class ::testing::UnitTest;
-
- // The UnitTest object that owns this implementation object.
- UnitTest* const parent_;
-
- // The working directory when the first TEST() or TEST_F() was
- // executed.
- internal::FilePath original_working_dir_;
-
- // The default test part result reporters.
- DefaultGlobalTestPartResultReporter default_global_test_part_result_reporter_;
- DefaultPerThreadTestPartResultReporter
- default_per_thread_test_part_result_reporter_;
-
- // Points to (but doesn't own) the global test part result reporter.
- TestPartResultReporterInterface* global_test_part_result_repoter_;
-
- // Protects read and write access to global_test_part_result_reporter_.
- internal::Mutex global_test_part_result_reporter_mutex_;
-
- // Points to (but doesn't own) the per-thread test part result reporter.
- internal::ThreadLocal<TestPartResultReporterInterface*>
- per_thread_test_part_result_reporter_;
-
- // The vector of environments that need to be set-up/torn-down
- // before/after the tests are run.
- std::vector<Environment*> environments_;
-
- // The vector of TestCases in their original order. It owns the
- // elements in the vector.
- std::vector<TestCase*> test_cases_;
-
- // Provides a level of indirection for the test case list to allow
- // easy shuffling and restoring the test case order. The i-th
- // element of this vector is the index of the i-th test case in the
- // shuffled order.
- std::vector<int> test_case_indices_;
-
-#if GTEST_HAS_PARAM_TEST
- // ParameterizedTestRegistry object used to register value-parameterized
- // tests.
- internal::ParameterizedTestCaseRegistry parameterized_test_registry_;
-
- // Indicates whether RegisterParameterizedTests() has been called already.
- bool parameterized_tests_registered_;
-#endif // GTEST_HAS_PARAM_TEST
-
- // Index of the last death test case registered. Initially -1.
- int last_death_test_case_;
-
- // This points to the TestCase for the currently running test. It
- // changes as Google Test goes through one test case after another.
- // When no test is running, this is set to NULL and Google Test
- // stores assertion results in ad_hoc_test_result_. Initially NULL.
- TestCase* current_test_case_;
-
- // This points to the TestInfo for the currently running test. It
- // changes as Google Test goes through one test after another. When
- // no test is running, this is set to NULL and Google Test stores
- // assertion results in ad_hoc_test_result_. Initially NULL.
- TestInfo* current_test_info_;
-
- // Normally, a user only writes assertions inside a TEST or TEST_F,
- // or inside a function called by a TEST or TEST_F. Since Google
- // Test keeps track of which test is current running, it can
- // associate such an assertion with the test it belongs to.
- //
- // If an assertion is encountered when no TEST or TEST_F is running,
- // Google Test attributes the assertion result to an imaginary "ad hoc"
- // test, and records the result in ad_hoc_test_result_.
- TestResult ad_hoc_test_result_;
-
- // The list of event listeners that can be used to track events inside
- // Google Test.
- TestEventListeners listeners_;
-
- // The OS stack trace getter. Will be deleted when the UnitTest
- // object is destructed. By default, an OsStackTraceGetter is used,
- // but the user can set this field to use a custom getter if that is
- // desired.
- OsStackTraceGetterInterface* os_stack_trace_getter_;
-
- // True iff PostFlagParsingInit() has been called.
- bool post_flag_parse_init_performed_;
-
- // The random number seed used at the beginning of the test run.
- int random_seed_;
-
- // Our random number generator.
- internal::Random random_;
-
- // How long the test took to run, in milliseconds.
- TimeInMillis elapsed_time_;
-
-#if GTEST_HAS_DEATH_TEST
- // The decomposed components of the gtest_internal_run_death_test flag,
- // parsed when RUN_ALL_TESTS is called.
- internal::scoped_ptr<InternalRunDeathTestFlag> internal_run_death_test_flag_;
- internal::scoped_ptr<internal::DeathTestFactory> death_test_factory_;
-#endif // GTEST_HAS_DEATH_TEST
-
- // A per-thread stack of traces created by the SCOPED_TRACE() macro.
- internal::ThreadLocal<std::vector<TraceInfo> > gtest_trace_stack_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTestImpl);
-}; // class UnitTestImpl
-
-// Convenience function for accessing the global UnitTest
-// implementation object.
-inline UnitTestImpl* GetUnitTestImpl() {
- return UnitTest::GetInstance()->impl();
-}
-
-// Internal helper functions for implementing the simple regular
-// expression matcher.
-GTEST_API_ bool IsInSet(char ch, const char* str);
-GTEST_API_ bool IsDigit(char ch);
-GTEST_API_ bool IsPunct(char ch);
-GTEST_API_ bool IsRepeat(char ch);
-GTEST_API_ bool IsWhiteSpace(char ch);
-GTEST_API_ bool IsWordChar(char ch);
-GTEST_API_ bool IsValidEscape(char ch);
-GTEST_API_ bool AtomMatchesChar(bool escaped, char pattern, char ch);
-GTEST_API_ bool ValidateRegex(const char* regex);
-GTEST_API_ bool MatchRegexAtHead(const char* regex, const char* str);
-GTEST_API_ bool MatchRepetitionAndRegexAtHead(
- bool escaped, char ch, char repeat, const char* regex, const char* str);
-GTEST_API_ bool MatchRegexAnywhere(const char* regex, const char* str);
-
-// Parses the command line for Google Test flags, without initializing
-// other parts of Google Test.
-GTEST_API_ void ParseGoogleTestFlagsOnly(int* argc, char** argv);
-GTEST_API_ void ParseGoogleTestFlagsOnly(int* argc, wchar_t** argv);
-
-#if GTEST_HAS_DEATH_TEST
-
-// Returns the message describing the last system error, regardless of the
-// platform.
-String GetLastErrnoDescription();
-
-#if GTEST_OS_WINDOWS
-// Provides leak-safe Windows kernel handle ownership.
-class AutoHandle {
- public:
- AutoHandle() : handle_(INVALID_HANDLE_VALUE) {}
- explicit AutoHandle(HANDLE handle) : handle_(handle) {}
-
- ~AutoHandle() { Reset(); }
-
- HANDLE Get() const { return handle_; }
- void Reset() { Reset(INVALID_HANDLE_VALUE); }
- void Reset(HANDLE handle) {
- if (handle != handle_) {
- if (handle_ != INVALID_HANDLE_VALUE)
- ::CloseHandle(handle_);
- handle_ = handle;
- }
- }
-
- private:
- HANDLE handle_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(AutoHandle);
-};
-#endif // GTEST_OS_WINDOWS
-
-// Attempts to parse a string into a positive integer pointed to by the
-// number parameter. Returns true if that is possible.
-// GTEST_HAS_DEATH_TEST implies that we have ::std::string, so we can use
-// it here.
-template <typename Integer>
-bool ParseNaturalNumber(const ::std::string& str, Integer* number) {
- // Fail fast if the given string does not begin with a digit;
- // this bypasses strtoXXX's "optional leading whitespace and plus
- // or minus sign" semantics, which are undesirable here.
- if (str.empty() || !isdigit(str[0])) {
- return false;
- }
- errno = 0;
-
- char* end;
- // BiggestConvertible is the largest integer type that system-provided
- // string-to-number conversion routines can return.
-#if GTEST_OS_WINDOWS && !defined(__GNUC__)
- // MSVC and C++ Builder define __int64 instead of the standard long long.
- typedef unsigned __int64 BiggestConvertible;
- const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10);
-#else
- typedef unsigned long long BiggestConvertible; // NOLINT
- const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10);
-#endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
- const bool parse_success = *end == '\0' && errno == 0;
-
- // TODO(vladl@google.com): Convert this to compile time assertion when it is
- // available.
- GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed));
-
- const Integer result = static_cast<Integer>(parsed);
- if (parse_success && static_cast<BiggestConvertible>(result) == parsed) {
- *number = result;
- return true;
- }
- return false;
-}
-#endif // GTEST_HAS_DEATH_TEST
-
-// TestResult contains some private methods that should be hidden from
-// Google Test user but are required for testing. This class allow our tests
-// to access them.
-//
-// This class is supplied only for the purpose of testing Google Test's own
-// constructs. Do not use it in user tests, either directly or indirectly.
-class TestResultAccessor {
- public:
- static void RecordProperty(TestResult* test_result,
- const TestProperty& property) {
- test_result->RecordProperty(property);
- }
-
- static void ClearTestPartResults(TestResult* test_result) {
- test_result->ClearTestPartResults();
- }
-
- static const std::vector<testing::TestPartResult>& test_part_results(
- const TestResult& test_result) {
- return test_result.test_part_results();
- }
-};
-
-} // namespace internal
-} // namespace testing
-
-#endif // GTEST_SRC_GTEST_INTERNAL_INL_H_
diff --git a/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-internal.h b/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-internal.h
deleted file mode 100644
index 0b90132..0000000
--- a/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-internal.h
+++ /dev/null
@@ -1,943 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-//
-// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
-//
-// The Google C++ Testing Framework (Google Test)
-//
-// This header file declares functions and macros used internally by
-// Google Test. They are subject to change without notice.
-
-#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
-#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
-
-#include <gtest/internal/gtest-port.h>
-
-#if GTEST_OS_LINUX
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#endif // GTEST_OS_LINUX
-
-#include <ctype.h>
-#include <string.h>
-#include <iomanip>
-#include <limits>
-#include <set>
-
-#include <gtest/internal/gtest-string.h>
-#include <gtest/internal/gtest-filepath.h>
-#include <gtest/internal/gtest-type-util.h>
-
-#include "llvm/Support/raw_os_ostream.h"
-
-// Due to C++ preprocessor weirdness, we need double indirection to
-// concatenate two tokens when one of them is __LINE__. Writing
-//
-// foo ## __LINE__
-//
-// will result in the token foo__LINE__, instead of foo followed by
-// the current line number. For more details, see
-// http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
-#define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
-#define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar
-
-// Google Test defines the testing::Message class to allow construction of
-// test messages via the << operator. The idea is that anything
-// streamable to std::ostream can be streamed to a testing::Message.
-// This allows a user to use his own types in Google Test assertions by
-// overloading the << operator.
-//
-// util/gtl/stl_logging-inl.h overloads << for STL containers. These
-// overloads cannot be defined in the std namespace, as that will be
-// undefined behavior. Therefore, they are defined in the global
-// namespace instead.
-//
-// C++'s symbol lookup rule (i.e. Koenig lookup) says that these
-// overloads are visible in either the std namespace or the global
-// namespace, but not other namespaces, including the testing
-// namespace which Google Test's Message class is in.
-//
-// To allow STL containers (and other types that has a << operator
-// defined in the global namespace) to be used in Google Test assertions,
-// testing::Message must access the custom << operator from the global
-// namespace. Hence this helper function.
-//
-// Note: Jeffrey Yasskin suggested an alternative fix by "using
-// ::operator<<;" in the definition of Message's operator<<. That fix
-// doesn't require a helper function, but unfortunately doesn't
-// compile with MSVC.
-
-// LLVM INTERNAL CHANGE: To allow operator<< to work with both
-// std::ostreams and LLVM's raw_ostreams, we define a special
-// std::ostream with an implicit conversion to raw_ostream& and stream
-// to that. This causes the compiler to prefer std::ostream overloads
-// but still find raw_ostream& overloads.
-namespace llvm {
-class convertible_fwd_ostream : public std::ostream {
- std::ostream& os_;
- raw_os_ostream ros_;
-
-public:
- convertible_fwd_ostream(std::ostream& os)
- : std::ostream(os.rdbuf()), os_(os), ros_(*this) {}
- operator raw_ostream&() { return ros_; }
-};
-}
-template <typename T>
-inline void GTestStreamToHelper(std::ostream* os, const T& val) {
- llvm::convertible_fwd_ostream cos(*os);
- cos << val;
-}
-
-namespace testing {
-
-// Forward declaration of classes.
-
-class AssertionResult; // Result of an assertion.
-class Message; // Represents a failure message.
-class Test; // Represents a test.
-class TestInfo; // Information about a test.
-class TestPartResult; // Result of a test part.
-class UnitTest; // A collection of test cases.
-
-namespace internal {
-
-struct TraceInfo; // Information about a trace point.
-class ScopedTrace; // Implements scoped trace.
-class TestInfoImpl; // Opaque implementation of TestInfo
-class UnitTestImpl; // Opaque implementation of UnitTest
-
-// How many times InitGoogleTest() has been called.
-extern int g_init_gtest_count;
-
-// The text used in failure messages to indicate the start of the
-// stack trace.
-GTEST_API_ extern const char kStackTraceMarker[];
-
-// A secret type that Google Test users don't know about. It has no
-// definition on purpose. Therefore it's impossible to create a
-// Secret object, which is what we want.
-class Secret;
-
-// Two overloaded helpers for checking at compile time whether an
-// expression is a null pointer literal (i.e. NULL or any 0-valued
-// compile-time integral constant). Their return values have
-// different sizes, so we can use sizeof() to test which version is
-// picked by the compiler. These helpers have no implementations, as
-// we only need their signatures.
-//
-// Given IsNullLiteralHelper(x), the compiler will pick the first
-// version if x can be implicitly converted to Secret*, and pick the
-// second version otherwise. Since Secret is a secret and incomplete
-// type, the only expression a user can write that has type Secret* is
-// a null pointer literal. Therefore, we know that x is a null
-// pointer literal if and only if the first version is picked by the
-// compiler.
-char IsNullLiteralHelper(Secret* p);
-char (&IsNullLiteralHelper(...))[2]; // NOLINT
-
-// A compile-time bool constant that is true if and only if x is a
-// null pointer literal (i.e. NULL or any 0-valued compile-time
-// integral constant).
-#ifdef GTEST_ELLIPSIS_NEEDS_POD_
-// We lose support for NULL detection where the compiler doesn't like
-// passing non-POD classes through ellipsis (...).
-#define GTEST_IS_NULL_LITERAL_(x) false
-#else
-#define GTEST_IS_NULL_LITERAL_(x) \
- (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
-#endif // GTEST_ELLIPSIS_NEEDS_POD_
-
-// Appends the user-supplied message to the Google-Test-generated message.
-GTEST_API_ String AppendUserMessage(const String& gtest_msg,
- const Message& user_msg);
-
-// A helper class for creating scoped traces in user programs.
-class GTEST_API_ ScopedTrace {
- public:
- // The c'tor pushes the given source file location and message onto
- // a trace stack maintained by Google Test.
- ScopedTrace(const char* file, int line, const Message& message);
-
- // The d'tor pops the info pushed by the c'tor.
- //
- // Note that the d'tor is not virtual in order to be efficient.
- // Don't inherit from ScopedTrace!
- ~ScopedTrace();
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);
-} GTEST_ATTRIBUTE_UNUSED_; // A ScopedTrace object does its job in its
- // c'tor and d'tor. Therefore it doesn't
- // need to be used otherwise.
-
-// Converts a streamable value to a String. A NULL pointer is
-// converted to "(null)". When the input value is a ::string,
-// ::std::string, ::wstring, or ::std::wstring object, each NUL
-// character in it is replaced with "\\0".
-// Declared here but defined in gtest.h, so that it has access
-// to the definition of the Message class, required by the ARM
-// compiler.
-template <typename T>
-String StreamableToString(const T& streamable);
-
-// Formats a value to be used in a failure message.
-
-#ifdef GTEST_NEEDS_IS_POINTER_
-
-// These are needed as the Nokia Symbian and IBM XL C/C++ compilers
-// cannot decide between const T& and const T* in a function template.
-// These compilers _can_ decide between class template specializations
-// for T and T*, so a tr1::type_traits-like is_pointer works, and we
-// can overload on that.
-
-// This overload makes sure that all pointers (including
-// those to char or wchar_t) are printed as raw pointers.
-template <typename T>
-inline String FormatValueForFailureMessage(internal::true_type /*dummy*/,
- T* pointer) {
- return StreamableToString(static_cast<const void*>(pointer));
-}
-
-template <typename T>
-inline String FormatValueForFailureMessage(internal::false_type /*dummy*/,
- const T& value) {
- return StreamableToString(value);
-}
-
-template <typename T>
-inline String FormatForFailureMessage(const T& value) {
- return FormatValueForFailureMessage(
- typename internal::is_pointer<T>::type(), value);
-}
-
-#else
-
-// These are needed as the above solution using is_pointer has the
-// limitation that T cannot be a type without external linkage, when
-// compiled using MSVC.
-
-template <typename T>
-inline String FormatForFailureMessage(const T& value) {
- return StreamableToString(value);
-}
-
-// This overload makes sure that all pointers (including
-// those to char or wchar_t) are printed as raw pointers.
-template <typename T>
-inline String FormatForFailureMessage(T* pointer) {
- return StreamableToString(static_cast<const void*>(pointer));
-}
-
-#endif // GTEST_NEEDS_IS_POINTER_
-
-// These overloaded versions handle narrow and wide characters.
-GTEST_API_ String FormatForFailureMessage(char ch);
-GTEST_API_ String FormatForFailureMessage(wchar_t wchar);
-
-// When this operand is a const char* or char*, and the other operand
-// is a ::std::string or ::string, we print this operand as a C string
-// rather than a pointer. We do the same for wide strings.
-
-// This internal macro is used to avoid duplicated code.
-#define GTEST_FORMAT_IMPL_(operand2_type, operand1_printer)\
-inline String FormatForComparisonFailureMessage(\
- operand2_type::value_type* str, const operand2_type& /*operand2*/) {\
- return operand1_printer(str);\
-}\
-inline String FormatForComparisonFailureMessage(\
- const operand2_type::value_type* str, const operand2_type& /*operand2*/) {\
- return operand1_printer(str);\
-}
-
-GTEST_FORMAT_IMPL_(::std::string, String::ShowCStringQuoted)
-#if GTEST_HAS_STD_WSTRING
-GTEST_FORMAT_IMPL_(::std::wstring, String::ShowWideCStringQuoted)
-#endif // GTEST_HAS_STD_WSTRING
-
-#if GTEST_HAS_GLOBAL_STRING
-GTEST_FORMAT_IMPL_(::string, String::ShowCStringQuoted)
-#endif // GTEST_HAS_GLOBAL_STRING
-#if GTEST_HAS_GLOBAL_WSTRING
-GTEST_FORMAT_IMPL_(::wstring, String::ShowWideCStringQuoted)
-#endif // GTEST_HAS_GLOBAL_WSTRING
-
-#undef GTEST_FORMAT_IMPL_
-
-// Constructs and returns the message for an equality assertion
-// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
-//
-// The first four parameters are the expressions used in the assertion
-// and their values, as strings. For example, for ASSERT_EQ(foo, bar)
-// where foo is 5 and bar is 6, we have:
-//
-// expected_expression: "foo"
-// actual_expression: "bar"
-// expected_value: "5"
-// actual_value: "6"
-//
-// The ignoring_case parameter is true iff the assertion is a
-// *_STRCASEEQ*. When it's true, the string " (ignoring case)" will
-// be inserted into the message.
-GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
- const char* actual_expression,
- const String& expected_value,
- const String& actual_value,
- bool ignoring_case);
-
-// Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
-GTEST_API_ String GetBoolAssertionFailureMessage(
- const AssertionResult& assertion_result,
- const char* expression_text,
- const char* actual_predicate_value,
- const char* expected_predicate_value);
-
-// This template class represents an IEEE floating-point number
-// (either single-precision or double-precision, depending on the
-// template parameters).
-//
-// The purpose of this class is to do more sophisticated number
-// comparison. (Due to round-off error, etc, it's very unlikely that
-// two floating-points will be equal exactly. Hence a naive
-// comparison by the == operation often doesn't work.)
-//
-// Format of IEEE floating-point:
-//
-// The most-significant bit being the leftmost, an IEEE
-// floating-point looks like
-//
-// sign_bit exponent_bits fraction_bits
-//
-// Here, sign_bit is a single bit that designates the sign of the
-// number.
-//
-// For float, there are 8 exponent bits and 23 fraction bits.
-//
-// For double, there are 11 exponent bits and 52 fraction bits.
-//
-// More details can be found at
-// http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
-//
-// Template parameter:
-//
-// RawType: the raw floating-point type (either float or double)
-template <typename RawType>
-class FloatingPoint {
- public:
- // Defines the unsigned integer type that has the same size as the
- // floating point number.
- typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
-
- // Constants.
-
- // # of bits in a number.
- static const size_t kBitCount = 8*sizeof(RawType);
-
- // # of fraction bits in a number.
- static const size_t kFractionBitCount =
- std::numeric_limits<RawType>::digits - 1;
-
- // # of exponent bits in a number.
- static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;
-
- // The mask for the sign bit.
- static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
-
- // The mask for the fraction bits.
- static const Bits kFractionBitMask =
- ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
-
- // The mask for the exponent bits.
- static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
-
- // How many ULP's (Units in the Last Place) we want to tolerate when
- // comparing two numbers. The larger the value, the more error we
- // allow. A 0 value means that two numbers must be exactly the same
- // to be considered equal.
- //
- // The maximum error of a single floating-point operation is 0.5
- // units in the last place. On Intel CPU's, all floating-point
- // calculations are done with 80-bit precision, while double has 64
- // bits. Therefore, 4 should be enough for ordinary use.
- //
- // See the following article for more details on ULP:
- // http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm.
- static const size_t kMaxUlps = 4;
-
- // Constructs a FloatingPoint from a raw floating-point number.
- //
- // On an Intel CPU, passing a non-normalized NAN (Not a Number)
- // around may change its bits, although the new value is guaranteed
- // to be also a NAN. Therefore, don't expect this constructor to
- // preserve the bits in x when x is a NAN.
- explicit FloatingPoint(const RawType& x) { u_.value_ = x; }
-
- // Static methods
-
- // Reinterprets a bit pattern as a floating-point number.
- //
- // This function is needed to test the AlmostEquals() method.
- static RawType ReinterpretBits(const Bits bits) {
- FloatingPoint fp(0);
- fp.u_.bits_ = bits;
- return fp.u_.value_;
- }
-
- // Returns the floating-point number that represent positive infinity.
- static RawType Infinity() {
- return ReinterpretBits(kExponentBitMask);
- }
-
- // Non-static methods
-
- // Returns the bits that represents this number.
- const Bits &bits() const { return u_.bits_; }
-
- // Returns the exponent bits of this number.
- Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
-
- // Returns the fraction bits of this number.
- Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
-
- // Returns the sign bit of this number.
- Bits sign_bit() const { return kSignBitMask & u_.bits_; }
-
- // Returns true iff this is NAN (not a number).
- bool is_nan() const {
- // It's a NAN if the exponent bits are all ones and the fraction
- // bits are not entirely zeros.
- return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
- }
-
- // Returns true iff this number is at most kMaxUlps ULP's away from
- // rhs. In particular, this function:
- //
- // - returns false if either number is (or both are) NAN.
- // - treats really large numbers as almost equal to infinity.
- // - thinks +0.0 and -0.0 are 0 DLP's apart.
- bool AlmostEquals(const FloatingPoint& rhs) const {
- // The IEEE standard says that any comparison operation involving
- // a NAN must return false.
- if (is_nan() || rhs.is_nan()) return false;
-
- return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
- <= kMaxUlps;
- }
-
- private:
- // The data type used to store the actual floating-point number.
- union FloatingPointUnion {
- RawType value_; // The raw floating-point number.
- Bits bits_; // The bits that represent the number.
- };
-
- // Converts an integer from the sign-and-magnitude representation to
- // the biased representation. More precisely, let N be 2 to the
- // power of (kBitCount - 1), an integer x is represented by the
- // unsigned number x + N.
- //
- // For instance,
- //
- // -N + 1 (the most negative number representable using
- // sign-and-magnitude) is represented by 1;
- // 0 is represented by N; and
- // N - 1 (the biggest number representable using
- // sign-and-magnitude) is represented by 2N - 1.
- //
- // Read http://en.wikipedia.org/wiki/Signed_number_representations
- // for more details on signed number representations.
- static Bits SignAndMagnitudeToBiased(const Bits &sam) {
- if (kSignBitMask & sam) {
- // sam represents a negative number.
- return ~sam + 1;
- } else {
- // sam represents a positive number.
- return kSignBitMask | sam;
- }
- }
-
- // Given two numbers in the sign-and-magnitude representation,
- // returns the distance between them as an unsigned number.
- static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
- const Bits &sam2) {
- const Bits biased1 = SignAndMagnitudeToBiased(sam1);
- const Bits biased2 = SignAndMagnitudeToBiased(sam2);
- return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
- }
-
- FloatingPointUnion u_;
-};
-
-// Typedefs the instances of the FloatingPoint template class that we
-// care to use.
-typedef FloatingPoint<float> Float;
-typedef FloatingPoint<double> Double;
-
-// In order to catch the mistake of putting tests that use different
-// test fixture classes in the same test case, we need to assign
-// unique IDs to fixture classes and compare them. The TypeId type is
-// used to hold such IDs. The user should treat TypeId as an opaque
-// type: the only operation allowed on TypeId values is to compare
-// them for equality using the == operator.
-typedef const void* TypeId;
-
-template <typename T>
-class TypeIdHelper {
- public:
- // dummy_ must not have a const type. Otherwise an overly eager
- // compiler (e.g. MSVC 7.1 & 8.0) may try to merge
- // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".
- static bool dummy_;
-};
-
-template <typename T>
-bool TypeIdHelper<T>::dummy_ = false;
-
-// GetTypeId<T>() returns the ID of type T. Different values will be
-// returned for different types. Calling the function twice with the
-// same type argument is guaranteed to return the same ID.
-template <typename T>
-TypeId GetTypeId() {
- // The compiler is required to allocate a different
- // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
- // the template. Therefore, the address of dummy_ is guaranteed to
- // be unique.
- return &(TypeIdHelper<T>::dummy_);
-}
-
-// Returns the type ID of ::testing::Test. Always call this instead
-// of GetTypeId< ::testing::Test>() to get the type ID of
-// ::testing::Test, as the latter may give the wrong result due to a
-// suspected linker bug when compiling Google Test as a Mac OS X
-// framework.
-GTEST_API_ TypeId GetTestTypeId();
-
-// Defines the abstract factory interface that creates instances
-// of a Test object.
-class TestFactoryBase {
- public:
- virtual ~TestFactoryBase() {}
-
- // Creates a test instance to run. The instance is both created and destroyed
- // within TestInfoImpl::Run()
- virtual Test* CreateTest() = 0;
-
- protected:
- TestFactoryBase() {}
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);
-};
-
-// This class provides implementation of TeastFactoryBase interface.
-// It is used in TEST and TEST_F macros.
-template <class TestClass>
-class TestFactoryImpl : public TestFactoryBase {
- public:
- virtual Test* CreateTest() { return new TestClass; }
-};
-
-#if GTEST_OS_WINDOWS
-
-// Predicate-formatters for implementing the HRESULT checking macros
-// {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}
-// We pass a long instead of HRESULT to avoid causing an
-// include dependency for the HRESULT type.
-GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,
- long hr); // NOLINT
-GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
- long hr); // NOLINT
-
-#endif // GTEST_OS_WINDOWS
-
-// Formats a source file path and a line number as they would appear
-// in a compiler error message.
-inline String FormatFileLocation(const char* file, int line) {
- const char* const file_name = file == NULL ? "unknown file" : file;
- if (line < 0) {
- return String::Format("%s:", file_name);
- }
-#ifdef _MSC_VER
- return String::Format("%s(%d):", file_name, line);
-#else
- return String::Format("%s:%d:", file_name, line);
-#endif // _MSC_VER
-}
-
-// Types of SetUpTestCase() and TearDownTestCase() functions.
-typedef void (*SetUpTestCaseFunc)();
-typedef void (*TearDownTestCaseFunc)();
-
-// Creates a new TestInfo object and registers it with Google Test;
-// returns the created object.
-//
-// Arguments:
-//
-// test_case_name: name of the test case
-// name: name of the test
-// test_case_comment: a comment on the test case that will be included in
-// the test output
-// comment: a comment on the test that will be included in the
-// test output
-// fixture_class_id: ID of the test fixture class
-// set_up_tc: pointer to the function that sets up the test case
-// tear_down_tc: pointer to the function that tears down the test case
-// factory: pointer to the factory that creates a test object.
-// The newly created TestInfo instance will assume
-// ownership of the factory object.
-GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
- const char* test_case_name, const char* name,
- const char* test_case_comment, const char* comment,
- TypeId fixture_class_id,
- SetUpTestCaseFunc set_up_tc,
- TearDownTestCaseFunc tear_down_tc,
- TestFactoryBase* factory);
-
-// If *pstr starts with the given prefix, modifies *pstr to be right
-// past the prefix and returns true; otherwise leaves *pstr unchanged
-// and returns false. None of pstr, *pstr, and prefix can be NULL.
-bool SkipPrefix(const char* prefix, const char** pstr);
-
-#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
-
-// State of the definition of a type-parameterized test case.
-class GTEST_API_ TypedTestCasePState {
- public:
- TypedTestCasePState() : registered_(false) {}
-
- // Adds the given test name to defined_test_names_ and return true
- // if the test case hasn't been registered; otherwise aborts the
- // program.
- bool AddTestName(const char* file, int line, const char* case_name,
- const char* test_name) {
- if (registered_) {
- fprintf(stderr, "%s Test %s must be defined before "
- "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
- FormatFileLocation(file, line).c_str(), test_name, case_name);
- fflush(stderr);
- posix::Abort();
- }
- defined_test_names_.insert(test_name);
- return true;
- }
-
- // Verifies that registered_tests match the test names in
- // defined_test_names_; returns registered_tests if successful, or
- // aborts the program otherwise.
- const char* VerifyRegisteredTestNames(
- const char* file, int line, const char* registered_tests);
-
- private:
- bool registered_;
- ::std::set<const char*> defined_test_names_;
-};
-
-// Skips to the first non-space char after the first comma in 'str';
-// returns NULL if no comma is found in 'str'.
-inline const char* SkipComma(const char* str) {
- const char* comma = strchr(str, ',');
- if (comma == NULL) {
- return NULL;
- }
- while (isspace(*(++comma))) {}
- return comma;
-}
-
-// Returns the prefix of 'str' before the first comma in it; returns
-// the entire string if it contains no comma.
-inline String GetPrefixUntilComma(const char* str) {
- const char* comma = strchr(str, ',');
- return comma == NULL ? String(str) : String(str, comma - str);
-}
-
-// TypeParameterizedTest<Fixture, TestSel, Types>::Register()
-// registers a list of type-parameterized tests with Google Test. The
-// return value is insignificant - we just need to return something
-// such that we can call this function in a namespace scope.
-//
-// Implementation note: The GTEST_TEMPLATE_ macro declares a template
-// template parameter. It's defined in gtest-type-util.h.
-template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
-class TypeParameterizedTest {
- public:
- // 'index' is the index of the test in the type list 'Types'
- // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
- // Types). Valid values for 'index' are [0, N - 1] where N is the
- // length of Types.
- static bool Register(const char* prefix, const char* case_name,
- const char* test_names, int index) {
- typedef typename Types::Head Type;
- typedef Fixture<Type> FixtureClass;
- typedef typename GTEST_BIND_(TestSel, Type) TestClass;
-
- // First, registers the first type-parameterized test in the type
- // list.
- MakeAndRegisterTestInfo(
- String::Format("%s%s%s/%d", prefix, prefix[0] == '\0' ? "" : "/",
- case_name, index).c_str(),
- GetPrefixUntilComma(test_names).c_str(),
- String::Format("TypeParam = %s", GetTypeName<Type>().c_str()).c_str(),
- "",
- GetTypeId<FixtureClass>(),
- TestClass::SetUpTestCase,
- TestClass::TearDownTestCase,
- new TestFactoryImpl<TestClass>);
-
- // Next, recurses (at compile time) with the tail of the type list.
- return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>
- ::Register(prefix, case_name, test_names, index + 1);
- }
-};
-
-// The base case for the compile time recursion.
-template <GTEST_TEMPLATE_ Fixture, class TestSel>
-class TypeParameterizedTest<Fixture, TestSel, Types0> {
- public:
- static bool Register(const char* /*prefix*/, const char* /*case_name*/,
- const char* /*test_names*/, int /*index*/) {
- return true;
- }
-};
-
-// TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
-// registers *all combinations* of 'Tests' and 'Types' with Google
-// Test. The return value is insignificant - we just need to return
-// something such that we can call this function in a namespace scope.
-template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
-class TypeParameterizedTestCase {
- public:
- static bool Register(const char* prefix, const char* case_name,
- const char* test_names) {
- typedef typename Tests::Head Head;
-
- // First, register the first test in 'Test' for each type in 'Types'.
- TypeParameterizedTest<Fixture, Head, Types>::Register(
- prefix, case_name, test_names, 0);
-
- // Next, recurses (at compile time) with the tail of the test list.
- return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>
- ::Register(prefix, case_name, SkipComma(test_names));
- }
-};
-
-// The base case for the compile time recursion.
-template <GTEST_TEMPLATE_ Fixture, typename Types>
-class TypeParameterizedTestCase<Fixture, Templates0, Types> {
- public:
- static bool Register(const char* /*prefix*/, const char* /*case_name*/,
- const char* /*test_names*/) {
- return true;
- }
-};
-
-#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
-
-// Returns the current OS stack trace as a String.
-//
-// The maximum number of stack frames to be included is specified by
-// the gtest_stack_trace_depth flag. The skip_count parameter
-// specifies the number of top frames to be skipped, which doesn't
-// count against the number of frames to be included.
-//
-// For example, if Foo() calls Bar(), which in turn calls
-// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
-// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
-GTEST_API_ String GetCurrentOsStackTraceExceptTop(UnitTest* unit_test,
- int skip_count);
-
-// Helpers for suppressing warnings on unreachable code or constant
-// condition.
-
-// Always returns true.
-GTEST_API_ bool AlwaysTrue();
-
-// Always returns false.
-inline bool AlwaysFalse() { return !AlwaysTrue(); }
-
-// A simple Linear Congruential Generator for generating random
-// numbers with a uniform distribution. Unlike rand() and srand(), it
-// doesn't use global state (and therefore can't interfere with user
-// code). Unlike rand_r(), it's portable. An LCG isn't very random,
-// but it's good enough for our purposes.
-class GTEST_API_ Random {
- public:
- static const UInt32 kMaxRange = 1u << 31;
-
- explicit Random(UInt32 seed) : state_(seed) {}
-
- void Reseed(UInt32 seed) { state_ = seed; }
-
- // Generates a random number from [0, range). Crashes if 'range' is
- // 0 or greater than kMaxRange.
- UInt32 Generate(UInt32 range);
-
- private:
- UInt32 state_;
- GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
-};
-
-} // namespace internal
-} // namespace testing
-
-#define GTEST_MESSAGE_(message, result_type) \
- ::testing::internal::AssertHelper(result_type, __FILE__, __LINE__, message) \
- = ::testing::Message()
-
-#define GTEST_FATAL_FAILURE_(message) \
- return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
-
-#define GTEST_NONFATAL_FAILURE_(message) \
- GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
-
-#define GTEST_SUCCESS_(message) \
- GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
-
-// Suppresses MSVC warnings 4072 (unreachable code) for the code following
-// statement if it returns or throws (or doesn't return or throw in some
-// situations).
-#define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
- if (::testing::internal::AlwaysTrue()) { statement; }
-
-#define GTEST_TEST_THROW_(statement, expected_exception, fail) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (const char* gtest_msg = "") { \
- bool gtest_caught_expected = false; \
- try { \
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
- } \
- catch (expected_exception const&) { \
- gtest_caught_expected = true; \
- } \
- catch (...) { \
- gtest_msg = "Expected: " #statement " throws an exception of type " \
- #expected_exception ".\n Actual: it throws a different " \
- "type."; \
- goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
- } \
- if (!gtest_caught_expected) { \
- gtest_msg = "Expected: " #statement " throws an exception of type " \
- #expected_exception ".\n Actual: it throws nothing."; \
- goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
- } \
- } else \
- GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
- fail(gtest_msg)
-
-#define GTEST_TEST_NO_THROW_(statement, fail) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (const char* gtest_msg = "") { \
- try { \
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
- } \
- catch (...) { \
- gtest_msg = "Expected: " #statement " doesn't throw an exception.\n" \
- " Actual: it throws."; \
- goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
- } \
- } else \
- GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
- fail(gtest_msg)
-
-#define GTEST_TEST_ANY_THROW_(statement, fail) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (const char* gtest_msg = "") { \
- bool gtest_caught_any = false; \
- try { \
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
- } \
- catch (...) { \
- gtest_caught_any = true; \
- } \
- if (!gtest_caught_any) { \
- gtest_msg = "Expected: " #statement " throws an exception.\n" \
- " Actual: it doesn't."; \
- goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
- } \
- } else \
- GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
- fail(gtest_msg)
-
-
-// Implements Boolean test assertions such as EXPECT_TRUE. expression can be
-// either a boolean expression or an AssertionResult. text is a textual
-// represenation of expression as it was passed into the EXPECT_TRUE.
-#define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (const ::testing::AssertionResult gtest_ar_ = \
- ::testing::AssertionResult(expression)) \
- ; \
- else \
- fail(::testing::internal::GetBoolAssertionFailureMessage(\
- gtest_ar_, text, #actual, #expected).c_str())
-
-#define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (const char* gtest_msg = "") { \
- ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
- if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
- gtest_msg = "Expected: " #statement " doesn't generate new fatal " \
- "failures in the current thread.\n" \
- " Actual: it does."; \
- goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
- } \
- } else \
- GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
- fail(gtest_msg)
-
-// Expands to the name of the class that implements the given test.
-#define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
- test_case_name##_##test_name##_Test
-
-// Helper macro for defining tests.
-#define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\
-class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
- public:\
- GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
- private:\
- virtual void TestBody();\
- static ::testing::TestInfo* const test_info_;\
- GTEST_DISALLOW_COPY_AND_ASSIGN_(\
- GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
-};\
-\
-::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
- ::test_info_ =\
- ::testing::internal::MakeAndRegisterTestInfo(\
- #test_case_name, #test_name, "", "", \
- (parent_id), \
- parent_class::SetUpTestCase, \
- parent_class::TearDownTestCase, \
- new ::testing::internal::TestFactoryImpl<\
- GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
-void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
-
-#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
diff --git a/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-linked_ptr.h b/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-linked_ptr.h
deleted file mode 100644
index 2404ea8..0000000
--- a/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-linked_ptr.h
+++ /dev/null
@@ -1,243 +0,0 @@
-// Copyright 2003 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-//
-// Authors: Dan Egnor (egnor@google.com)
-//
-// A "smart" pointer type with reference tracking. Every pointer to a
-// particular object is kept on a circular linked list. When the last pointer
-// to an object is destroyed or reassigned, the object is deleted.
-//
-// Used properly, this deletes the object when the last reference goes away.
-// There are several caveats:
-// - Like all reference counting schemes, cycles lead to leaks.
-// - Each smart pointer is actually two pointers (8 bytes instead of 4).
-// - Every time a pointer is assigned, the entire list of pointers to that
-// object is traversed. This class is therefore NOT SUITABLE when there
-// will often be more than two or three pointers to a particular object.
-// - References are only tracked as long as linked_ptr<> objects are copied.
-// If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS
-// will happen (double deletion).
-//
-// A good use of this class is storing object references in STL containers.
-// You can safely put linked_ptr<> in a vector<>.
-// Other uses may not be as good.
-//
-// Note: If you use an incomplete type with linked_ptr<>, the class
-// *containing* linked_ptr<> must have a constructor and destructor (even
-// if they do nothing!).
-//
-// Bill Gibbons suggested we use something like this.
-//
-// Thread Safety:
-// Unlike other linked_ptr implementations, in this implementation
-// a linked_ptr object is thread-safe in the sense that:
-// - it's safe to copy linked_ptr objects concurrently,
-// - it's safe to copy *from* a linked_ptr and read its underlying
-// raw pointer (e.g. via get()) concurrently, and
-// - it's safe to write to two linked_ptrs that point to the same
-// shared object concurrently.
-// TODO(wan@google.com): rename this to safe_linked_ptr to avoid
-// confusion with normal linked_ptr.
-
-#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
-#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
-
-#include <stdlib.h>
-#include <assert.h>
-
-#include <gtest/internal/gtest-port.h>
-
-namespace testing {
-namespace internal {
-
-// Protects copying of all linked_ptr objects.
-GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex);
-
-// This is used internally by all instances of linked_ptr<>. It needs to be
-// a non-template class because different types of linked_ptr<> can refer to
-// the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).
-// So, it needs to be possible for different types of linked_ptr to participate
-// in the same circular linked list, so we need a single class type here.
-//
-// DO NOT USE THIS CLASS DIRECTLY YOURSELF. Use linked_ptr<T>.
-class linked_ptr_internal {
- public:
- // Create a new circle that includes only this instance.
- void join_new() {
- next_ = this;
- }
-
- // Many linked_ptr operations may change p.link_ for some linked_ptr
- // variable p in the same circle as this object. Therefore we need
- // to prevent two such operations from occurring concurrently.
- //
- // Note that different types of linked_ptr objects can coexist in a
- // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and
- // linked_ptr<Derived2>). Therefore we must use a single mutex to
- // protect all linked_ptr objects. This can create serious
- // contention in production code, but is acceptable in a testing
- // framework.
-
- // Join an existing circle.
- // L < g_linked_ptr_mutex
- void join(linked_ptr_internal const* ptr) {
- MutexLock lock(&g_linked_ptr_mutex);
-
- linked_ptr_internal const* p = ptr;
- while (p->next_ != ptr) p = p->next_;
- p->next_ = this;
- next_ = ptr;
- }
-
- // Leave whatever circle we're part of. Returns true if we were the
- // last member of the circle. Once this is done, you can join() another.
- // L < g_linked_ptr_mutex
- bool depart() {
- MutexLock lock(&g_linked_ptr_mutex);
-
- if (next_ == this) return true;
- linked_ptr_internal const* p = next_;
- while (p->next_ != this) p = p->next_;
- p->next_ = next_;
- return false;
- }
-
- private:
- mutable linked_ptr_internal const* next_;
-};
-
-template <typename T>
-class linked_ptr {
- public:
- typedef T element_type;
-
- // Take over ownership of a raw pointer. This should happen as soon as
- // possible after the object is created.
- explicit linked_ptr(T* ptr = NULL) { capture(ptr); }
- ~linked_ptr() { depart(); }
-
- // Copy an existing linked_ptr<>, adding ourselves to the list of references.
- template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }
- linked_ptr(linked_ptr const& ptr) { // NOLINT
- assert(&ptr != this);
- copy(&ptr);
- }
-
- // Assignment releases the old value and acquires the new.
- template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {
- depart();
- copy(&ptr);
- return *this;
- }
-
- linked_ptr& operator=(linked_ptr const& ptr) {
- if (&ptr != this) {
- depart();
- copy(&ptr);
- }
- return *this;
- }
-
- // Smart pointer members.
- void reset(T* ptr = NULL) {
- depart();
- capture(ptr);
- }
- T* get() const { return value_; }
- T* operator->() const { return value_; }
- T& operator*() const { return *value_; }
- // Release ownership of the pointed object and returns it.
- // Sole ownership by this linked_ptr object is required.
- T* release() {
- bool last = link_.depart();
- (void) last;
- assert(last);
- T* v = value_;
- value_ = NULL;
- return v;
- }
-
- bool operator==(T* p) const { return value_ == p; }
- bool operator!=(T* p) const { return value_ != p; }
- template <typename U>
- bool operator==(linked_ptr<U> const& ptr) const {
- return value_ == ptr.get();
- }
- template <typename U>
- bool operator!=(linked_ptr<U> const& ptr) const {
- return value_ != ptr.get();
- }
-
- private:
- template <typename U>
- friend class linked_ptr;
-
- T* value_;
- linked_ptr_internal link_;
-
- void depart() {
- if (link_.depart()) delete value_;
- }
-
- void capture(T* ptr) {
- value_ = ptr;
- link_.join_new();
- }
-
- template <typename U> void copy(linked_ptr<U> const* ptr) {
- value_ = ptr->get();
- if (value_)
- link_.join(&ptr->link_);
- else
- link_.join_new();
- }
-};
-
-template<typename T> inline
-bool operator==(T* ptr, const linked_ptr<T>& x) {
- return ptr == x.get();
-}
-
-template<typename T> inline
-bool operator!=(T* ptr, const linked_ptr<T>& x) {
- return ptr != x.get();
-}
-
-// A function to convert T* into linked_ptr<T>
-// Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation
-// for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
-template <typename T>
-linked_ptr<T> make_linked_ptr(T* ptr) {
- return linked_ptr<T>(ptr);
-}
-
-} // namespace internal
-} // namespace testing
-
-#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
diff --git a/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-param-util-generated.h b/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-param-util-generated.h
deleted file mode 100644
index ab4ab56..0000000
--- a/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-param-util-generated.h
+++ /dev/null
@@ -1,4820 +0,0 @@
-// This file was GENERATED by a script. DO NOT EDIT BY HAND!!!
-
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-//
-// Author: vladl@google.com (Vlad Losev)
-
-// Type and function utilities for implementing parameterized tests.
-// This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
-//
-// Currently Google Test supports at most 50 arguments in Values,
-// and at most 10 arguments in Combine. Please contact
-// googletestframework@googlegroups.com if you need more.
-// Please note that the number of arguments to Combine is limited
-// by the maximum arity of the implementation of tr1::tuple which is
-// currently set at 10.
-
-#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
-#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
-
-// scripts/fuse_gtest.py depends on gtest's own header being #included
-// *unconditionally*. Therefore these #includes cannot be moved
-// inside #if GTEST_HAS_PARAM_TEST.
-#include <gtest/internal/gtest-param-util.h>
-#include <gtest/internal/gtest-port.h>
-
-#if GTEST_HAS_PARAM_TEST
-
-namespace testing {
-
-// Forward declarations of ValuesIn(), which is implemented in
-// include/gtest/gtest-param-test.h.
-template <typename ForwardIterator>
-internal::ParamGenerator<
- typename ::std::iterator_traits<ForwardIterator>::value_type> ValuesIn(
- ForwardIterator begin, ForwardIterator end);
-
-template <typename T, size_t N>
-internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
-
-template <class Container>
-internal::ParamGenerator<typename Container::value_type> ValuesIn(
- const Container& container);
-
-namespace internal {
-
-// Used in the Values() function to provide polymorphic capabilities.
-template <typename T1>
-class ValueArray1 {
- public:
- explicit ValueArray1(T1 v1) : v1_(v1) {}
-
- template <typename T>
- operator ParamGenerator<T>() const { return ValuesIn(&v1_, &v1_ + 1); }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray1& other);
-
- const T1 v1_;
-};
-
-template <typename T1, typename T2>
-class ValueArray2 {
- public:
- ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray2& other);
-
- const T1 v1_;
- const T2 v2_;
-};
-
-template <typename T1, typename T2, typename T3>
-class ValueArray3 {
- public:
- ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray3& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4>
-class ValueArray4 {
- public:
- ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3),
- v4_(v4) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray4& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5>
-class ValueArray5 {
- public:
- ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3),
- v4_(v4), v5_(v5) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray5& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6>
-class ValueArray6 {
- public:
- ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2),
- v3_(v3), v4_(v4), v5_(v5), v6_(v6) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray6& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7>
-class ValueArray7 {
- public:
- ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1),
- v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray7& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8>
-class ValueArray8 {
- public:
- ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
- T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray8& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9>
-class ValueArray9 {
- public:
- ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
- T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8), v9_(v9) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray9& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10>
-class ValueArray10 {
- public:
- ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8), v9_(v9), v10_(v10) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray10& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11>
-class ValueArray11 {
- public:
- ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
- v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray11& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12>
-class ValueArray12 {
- public:
- ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
- v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray12& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13>
-class ValueArray13 {
- public:
- ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
- v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
- v12_(v12), v13_(v13) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray13& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14>
-class ValueArray14 {
- public:
- ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3),
- v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
- v11_(v11), v12_(v12), v13_(v13), v14_(v14) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray14& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15>
-class ValueArray15 {
- public:
- ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2),
- v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
- v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray15& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16>
-class ValueArray16 {
- public:
- ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1),
- v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
- v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
- v16_(v16) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray16& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17>
-class ValueArray17 {
- public:
- ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
- T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
- v15_(v15), v16_(v16), v17_(v17) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray17& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18>
-class ValueArray18 {
- public:
- ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
- v15_(v15), v16_(v16), v17_(v17), v18_(v18) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray18& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19>
-class ValueArray19 {
- public:
- ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
- v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
- v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray19& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20>
-class ValueArray20 {
- public:
- ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
- v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
- v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
- v19_(v19), v20_(v20) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray20& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21>
-class ValueArray21 {
- public:
- ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
- v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
- v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
- v18_(v18), v19_(v19), v20_(v20), v21_(v21) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray21& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22>
-class ValueArray22 {
- public:
- ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3),
- v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
- v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
- v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray22& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23>
-class ValueArray23 {
- public:
- ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2),
- v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
- v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
- v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
- v23_(v23) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_,
- v23_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray23& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24>
-class ValueArray24 {
- public:
- ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1),
- v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
- v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
- v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
- v22_(v22), v23_(v23), v24_(v24) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray24& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25>
-class ValueArray25 {
- public:
- ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
- T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
- v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
- v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray25& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26>
-class ValueArray26 {
- public:
- ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
- v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
- v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_, v26_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray26& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27>
-class ValueArray27 {
- public:
- ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
- v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
- v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
- v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
- v26_(v26), v27_(v27) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_, v26_, v27_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray27& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28>
-class ValueArray28 {
- public:
- ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
- v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
- v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
- v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
- v25_(v25), v26_(v26), v27_(v27), v28_(v28) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_, v26_, v27_, v28_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray28& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29>
-class ValueArray29 {
- public:
- ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
- v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
- v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
- v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
- v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_, v26_, v27_, v28_, v29_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray29& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30>
-class ValueArray30 {
- public:
- ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3),
- v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
- v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
- v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
- v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
- v29_(v29), v30_(v30) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_, v26_, v27_, v28_, v29_, v30_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray30& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31>
-class ValueArray31 {
- public:
- ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2),
- v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
- v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
- v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
- v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
- v29_(v29), v30_(v30), v31_(v31) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray31& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32>
-class ValueArray32 {
- public:
- ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1),
- v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
- v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
- v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
- v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
- v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray32& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33>
-class ValueArray33 {
- public:
- ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
- T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
- v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
- v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
- v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
- v33_(v33) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray33& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34>
-class ValueArray34 {
- public:
- ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
- v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
- v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
- v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
- v33_(v33), v34_(v34) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray34& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35>
-class ValueArray35 {
- public:
- ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
- v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
- v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
- v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
- v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
- v32_(v32), v33_(v33), v34_(v34), v35_(v35) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_,
- v35_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray35& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36>
-class ValueArray36 {
- public:
- ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
- v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
- v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
- v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
- v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
- v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
- v36_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray36& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37>
-class ValueArray37 {
- public:
- ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
- v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
- v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
- v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
- v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
- v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
- v36_(v36), v37_(v37) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
- v36_, v37_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray37& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38>
-class ValueArray38 {
- public:
- ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3),
- v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
- v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
- v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
- v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
- v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
- v35_(v35), v36_(v36), v37_(v37), v38_(v38) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
- v36_, v37_, v38_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray38& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39>
-class ValueArray39 {
- public:
- ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2),
- v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
- v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
- v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
- v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
- v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
- v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
- v36_, v37_, v38_, v39_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray39& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
- const T39 v39_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40>
-class ValueArray40 {
- public:
- ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1),
- v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
- v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
- v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
- v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
- v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
- v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
- v40_(v40) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
- v36_, v37_, v38_, v39_, v40_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray40& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
- const T39 v39_;
- const T40 v40_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41>
-class ValueArray41 {
- public:
- ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
- T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
- v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
- v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
- v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
- v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
- v39_(v39), v40_(v40), v41_(v41) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
- v36_, v37_, v38_, v39_, v40_, v41_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray41& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
- const T39 v39_;
- const T40 v40_;
- const T41 v41_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42>
-class ValueArray42 {
- public:
- ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
- T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
- v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
- v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
- v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
- v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
- v39_(v39), v40_(v40), v41_(v41), v42_(v42) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
- v36_, v37_, v38_, v39_, v40_, v41_, v42_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray42& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
- const T39 v39_;
- const T40 v40_;
- const T41 v41_;
- const T42 v42_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43>
-class ValueArray43 {
- public:
- ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
- T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
- v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
- v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
- v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
- v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
- v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37),
- v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
- v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray43& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
- const T39 v39_;
- const T40 v40_;
- const T41 v41_;
- const T42 v42_;
- const T43 v43_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44>
-class ValueArray44 {
- public:
- ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
- T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
- v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
- v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
- v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
- v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
- v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36),
- v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42),
- v43_(v43), v44_(v44) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
- v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray44& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
- const T39 v39_;
- const T40 v40_;
- const T41 v41_;
- const T42 v42_;
- const T43 v43_;
- const T44 v44_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45>
-class ValueArray45 {
- public:
- ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
- T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
- v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
- v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
- v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
- v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
- v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
- v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41),
- v42_(v42), v43_(v43), v44_(v44), v45_(v45) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
- v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray45& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
- const T39 v39_;
- const T40 v40_;
- const T41 v41_;
- const T42 v42_;
- const T43 v43_;
- const T44 v44_;
- const T45 v45_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46>
-class ValueArray46 {
- public:
- ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
- T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3),
- v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
- v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
- v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
- v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
- v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
- v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
- v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
- v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray46& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
- const T39 v39_;
- const T40 v40_;
- const T41 v41_;
- const T42 v42_;
- const T43 v43_;
- const T44 v44_;
- const T45 v45_;
- const T46 v46_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47>
-class ValueArray47 {
- public:
- ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
- T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2),
- v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
- v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
- v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
- v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
- v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
- v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
- v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46),
- v47_(v47) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
- v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_,
- v47_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray47& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
- const T39 v39_;
- const T40 v40_;
- const T41 v41_;
- const T42 v42_;
- const T43 v43_;
- const T44 v44_;
- const T45 v45_;
- const T46 v46_;
- const T47 v47_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47, typename T48>
-class ValueArray48 {
- public:
- ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
- T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1),
- v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
- v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
- v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
- v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
- v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
- v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
- v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45),
- v46_(v46), v47_(v47), v48_(v48) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
- v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v47_,
- v48_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray48& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
- const T39 v39_;
- const T40 v40_;
- const T41 v41_;
- const T42 v42_;
- const T43 v43_;
- const T44 v44_;
- const T45 v45_;
- const T46 v46_;
- const T47 v47_;
- const T48 v48_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47, typename T48, typename T49>
-class ValueArray49 {
- public:
- ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
- T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48,
- T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
- v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
- v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
- v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
- v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
- v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
- v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
- v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v47_,
- v48_, v49_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray49& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
- const T39 v39_;
- const T40 v40_;
- const T41 v41_;
- const T42 v42_;
- const T43 v43_;
- const T44 v44_;
- const T45 v45_;
- const T46 v46_;
- const T47 v47_;
- const T48 v48_;
- const T49 v49_;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47, typename T48, typename T49, typename T50>
-class ValueArray50 {
- public:
- ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
- T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
- T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
- T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
- T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
- T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49,
- T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
- v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
- v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
- v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
- v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
- v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
- v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
- v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {}
-
- template <typename T>
- operator ParamGenerator<T>() const {
- const T array[] = {v1_, v2_, v3_, v4_, v5_, v6_, v7_, v8_, v9_, v10_, v11_,
- v12_, v13_, v14_, v15_, v16_, v17_, v18_, v19_, v20_, v21_, v22_, v23_,
- v24_, v25_, v26_, v27_, v28_, v29_, v30_, v31_, v32_, v33_, v34_, v35_,
- v36_, v37_, v38_, v39_, v40_, v41_, v42_, v43_, v44_, v45_, v46_, v47_,
- v48_, v49_, v50_};
- return ValuesIn(array);
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const ValueArray50& other);
-
- const T1 v1_;
- const T2 v2_;
- const T3 v3_;
- const T4 v4_;
- const T5 v5_;
- const T6 v6_;
- const T7 v7_;
- const T8 v8_;
- const T9 v9_;
- const T10 v10_;
- const T11 v11_;
- const T12 v12_;
- const T13 v13_;
- const T14 v14_;
- const T15 v15_;
- const T16 v16_;
- const T17 v17_;
- const T18 v18_;
- const T19 v19_;
- const T20 v20_;
- const T21 v21_;
- const T22 v22_;
- const T23 v23_;
- const T24 v24_;
- const T25 v25_;
- const T26 v26_;
- const T27 v27_;
- const T28 v28_;
- const T29 v29_;
- const T30 v30_;
- const T31 v31_;
- const T32 v32_;
- const T33 v33_;
- const T34 v34_;
- const T35 v35_;
- const T36 v36_;
- const T37 v37_;
- const T38 v38_;
- const T39 v39_;
- const T40 v40_;
- const T41 v41_;
- const T42 v42_;
- const T43 v43_;
- const T44 v44_;
- const T45 v45_;
- const T46 v46_;
- const T47 v47_;
- const T48 v48_;
- const T49 v49_;
- const T50 v50_;
-};
-
-#if GTEST_HAS_COMBINE
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Generates values from the Cartesian product of values produced
-// by the argument generators.
-//
-template <typename T1, typename T2>
-class CartesianProductGenerator2
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2> > {
- public:
- typedef ::std::tr1::tuple<T1, T2> ParamType;
-
- CartesianProductGenerator2(const ParamGenerator<T1>& g1,
- const ParamGenerator<T2>& g2)
- : g1_(g1), g2_(g2) {}
- virtual ~CartesianProductGenerator2() {}
-
- virtual ParamIteratorInterface<ParamType>* Begin() const {
- return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());
- }
- virtual ParamIteratorInterface<ParamType>* End() const {
- return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());
- }
-
- private:
- class Iterator : public ParamIteratorInterface<ParamType> {
- public:
- Iterator(const ParamGeneratorInterface<ParamType>* base,
- const ParamGenerator<T1>& g1,
- const typename ParamGenerator<T1>::iterator& current1,
- const ParamGenerator<T2>& g2,
- const typename ParamGenerator<T2>::iterator& current2)
- : base_(base),
- begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
- begin2_(g2.begin()), end2_(g2.end()), current2_(current2) {
- ComputeCurrentValue();
- }
- virtual ~Iterator() {}
-
- virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
- return base_;
- }
- // Advance should not be called on beyond-of-range iterators
- // so no component iterators must be beyond end of range, either.
- virtual void Advance() {
- assert(!AtEnd());
- ++current2_;
- if (current2_ == end2_) {
- current2_ = begin2_;
- ++current1_;
- }
- ComputeCurrentValue();
- }
- virtual ParamIteratorInterface<ParamType>* Clone() const {
- return new Iterator(*this);
- }
- virtual const ParamType* Current() const { return &current_value_; }
- virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- const Iterator* typed_other =
- CheckedDowncastToActualType<const Iterator>(&other);
- // We must report iterators equal if they both point beyond their
- // respective ranges. That can happen in a variety of fashions,
- // so we have to consult AtEnd().
- return (AtEnd() && typed_other->AtEnd()) ||
- (
- current1_ == typed_other->current1_ &&
- current2_ == typed_other->current2_);
- }
-
- private:
- Iterator(const Iterator& other)
- : base_(other.base_),
- begin1_(other.begin1_),
- end1_(other.end1_),
- current1_(other.current1_),
- begin2_(other.begin2_),
- end2_(other.end2_),
- current2_(other.current2_) {
- ComputeCurrentValue();
- }
-
- void ComputeCurrentValue() {
- if (!AtEnd())
- current_value_ = ParamType(*current1_, *current2_);
- }
- bool AtEnd() const {
- // We must report iterator past the end of the range when either of the
- // component iterators has reached the end of its range.
- return
- current1_ == end1_ ||
- current2_ == end2_;
- }
-
- // No implementation - assignment is unsupported.
- void operator=(const Iterator& other);
-
- const ParamGeneratorInterface<ParamType>* const base_;
- // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
- // current[i]_ is the actual traversing iterator.
- const typename ParamGenerator<T1>::iterator begin1_;
- const typename ParamGenerator<T1>::iterator end1_;
- typename ParamGenerator<T1>::iterator current1_;
- const typename ParamGenerator<T2>::iterator begin2_;
- const typename ParamGenerator<T2>::iterator end2_;
- typename ParamGenerator<T2>::iterator current2_;
- ParamType current_value_;
- }; // class CartesianProductGenerator2::Iterator
-
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductGenerator2& other);
-
- const ParamGenerator<T1> g1_;
- const ParamGenerator<T2> g2_;
-}; // class CartesianProductGenerator2
-
-
-template <typename T1, typename T2, typename T3>
-class CartesianProductGenerator3
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3> > {
- public:
- typedef ::std::tr1::tuple<T1, T2, T3> ParamType;
-
- CartesianProductGenerator3(const ParamGenerator<T1>& g1,
- const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
- : g1_(g1), g2_(g2), g3_(g3) {}
- virtual ~CartesianProductGenerator3() {}
-
- virtual ParamIteratorInterface<ParamType>* Begin() const {
- return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
- g3_.begin());
- }
- virtual ParamIteratorInterface<ParamType>* End() const {
- return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end());
- }
-
- private:
- class Iterator : public ParamIteratorInterface<ParamType> {
- public:
- Iterator(const ParamGeneratorInterface<ParamType>* base,
- const ParamGenerator<T1>& g1,
- const typename ParamGenerator<T1>::iterator& current1,
- const ParamGenerator<T2>& g2,
- const typename ParamGenerator<T2>::iterator& current2,
- const ParamGenerator<T3>& g3,
- const typename ParamGenerator<T3>::iterator& current3)
- : base_(base),
- begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
- begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
- begin3_(g3.begin()), end3_(g3.end()), current3_(current3) {
- ComputeCurrentValue();
- }
- virtual ~Iterator() {}
-
- virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
- return base_;
- }
- // Advance should not be called on beyond-of-range iterators
- // so no component iterators must be beyond end of range, either.
- virtual void Advance() {
- assert(!AtEnd());
- ++current3_;
- if (current3_ == end3_) {
- current3_ = begin3_;
- ++current2_;
- }
- if (current2_ == end2_) {
- current2_ = begin2_;
- ++current1_;
- }
- ComputeCurrentValue();
- }
- virtual ParamIteratorInterface<ParamType>* Clone() const {
- return new Iterator(*this);
- }
- virtual const ParamType* Current() const { return &current_value_; }
- virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- const Iterator* typed_other =
- CheckedDowncastToActualType<const Iterator>(&other);
- // We must report iterators equal if they both point beyond their
- // respective ranges. That can happen in a variety of fashions,
- // so we have to consult AtEnd().
- return (AtEnd() && typed_other->AtEnd()) ||
- (
- current1_ == typed_other->current1_ &&
- current2_ == typed_other->current2_ &&
- current3_ == typed_other->current3_);
- }
-
- private:
- Iterator(const Iterator& other)
- : base_(other.base_),
- begin1_(other.begin1_),
- end1_(other.end1_),
- current1_(other.current1_),
- begin2_(other.begin2_),
- end2_(other.end2_),
- current2_(other.current2_),
- begin3_(other.begin3_),
- end3_(other.end3_),
- current3_(other.current3_) {
- ComputeCurrentValue();
- }
-
- void ComputeCurrentValue() {
- if (!AtEnd())
- current_value_ = ParamType(*current1_, *current2_, *current3_);
- }
- bool AtEnd() const {
- // We must report iterator past the end of the range when either of the
- // component iterators has reached the end of its range.
- return
- current1_ == end1_ ||
- current2_ == end2_ ||
- current3_ == end3_;
- }
-
- // No implementation - assignment is unsupported.
- void operator=(const Iterator& other);
-
- const ParamGeneratorInterface<ParamType>* const base_;
- // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
- // current[i]_ is the actual traversing iterator.
- const typename ParamGenerator<T1>::iterator begin1_;
- const typename ParamGenerator<T1>::iterator end1_;
- typename ParamGenerator<T1>::iterator current1_;
- const typename ParamGenerator<T2>::iterator begin2_;
- const typename ParamGenerator<T2>::iterator end2_;
- typename ParamGenerator<T2>::iterator current2_;
- const typename ParamGenerator<T3>::iterator begin3_;
- const typename ParamGenerator<T3>::iterator end3_;
- typename ParamGenerator<T3>::iterator current3_;
- ParamType current_value_;
- }; // class CartesianProductGenerator3::Iterator
-
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductGenerator3& other);
-
- const ParamGenerator<T1> g1_;
- const ParamGenerator<T2> g2_;
- const ParamGenerator<T3> g3_;
-}; // class CartesianProductGenerator3
-
-
-template <typename T1, typename T2, typename T3, typename T4>
-class CartesianProductGenerator4
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4> > {
- public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4> ParamType;
-
- CartesianProductGenerator4(const ParamGenerator<T1>& g1,
- const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
- const ParamGenerator<T4>& g4)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
- virtual ~CartesianProductGenerator4() {}
-
- virtual ParamIteratorInterface<ParamType>* Begin() const {
- return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
- g3_.begin(), g4_, g4_.begin());
- }
- virtual ParamIteratorInterface<ParamType>* End() const {
- return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
- g4_, g4_.end());
- }
-
- private:
- class Iterator : public ParamIteratorInterface<ParamType> {
- public:
- Iterator(const ParamGeneratorInterface<ParamType>* base,
- const ParamGenerator<T1>& g1,
- const typename ParamGenerator<T1>::iterator& current1,
- const ParamGenerator<T2>& g2,
- const typename ParamGenerator<T2>::iterator& current2,
- const ParamGenerator<T3>& g3,
- const typename ParamGenerator<T3>::iterator& current3,
- const ParamGenerator<T4>& g4,
- const typename ParamGenerator<T4>::iterator& current4)
- : base_(base),
- begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
- begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
- begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
- begin4_(g4.begin()), end4_(g4.end()), current4_(current4) {
- ComputeCurrentValue();
- }
- virtual ~Iterator() {}
-
- virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
- return base_;
- }
- // Advance should not be called on beyond-of-range iterators
- // so no component iterators must be beyond end of range, either.
- virtual void Advance() {
- assert(!AtEnd());
- ++current4_;
- if (current4_ == end4_) {
- current4_ = begin4_;
- ++current3_;
- }
- if (current3_ == end3_) {
- current3_ = begin3_;
- ++current2_;
- }
- if (current2_ == end2_) {
- current2_ = begin2_;
- ++current1_;
- }
- ComputeCurrentValue();
- }
- virtual ParamIteratorInterface<ParamType>* Clone() const {
- return new Iterator(*this);
- }
- virtual const ParamType* Current() const { return &current_value_; }
- virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- const Iterator* typed_other =
- CheckedDowncastToActualType<const Iterator>(&other);
- // We must report iterators equal if they both point beyond their
- // respective ranges. That can happen in a variety of fashions,
- // so we have to consult AtEnd().
- return (AtEnd() && typed_other->AtEnd()) ||
- (
- current1_ == typed_other->current1_ &&
- current2_ == typed_other->current2_ &&
- current3_ == typed_other->current3_ &&
- current4_ == typed_other->current4_);
- }
-
- private:
- Iterator(const Iterator& other)
- : base_(other.base_),
- begin1_(other.begin1_),
- end1_(other.end1_),
- current1_(other.current1_),
- begin2_(other.begin2_),
- end2_(other.end2_),
- current2_(other.current2_),
- begin3_(other.begin3_),
- end3_(other.end3_),
- current3_(other.current3_),
- begin4_(other.begin4_),
- end4_(other.end4_),
- current4_(other.current4_) {
- ComputeCurrentValue();
- }
-
- void ComputeCurrentValue() {
- if (!AtEnd())
- current_value_ = ParamType(*current1_, *current2_, *current3_,
- *current4_);
- }
- bool AtEnd() const {
- // We must report iterator past the end of the range when either of the
- // component iterators has reached the end of its range.
- return
- current1_ == end1_ ||
- current2_ == end2_ ||
- current3_ == end3_ ||
- current4_ == end4_;
- }
-
- // No implementation - assignment is unsupported.
- void operator=(const Iterator& other);
-
- const ParamGeneratorInterface<ParamType>* const base_;
- // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
- // current[i]_ is the actual traversing iterator.
- const typename ParamGenerator<T1>::iterator begin1_;
- const typename ParamGenerator<T1>::iterator end1_;
- typename ParamGenerator<T1>::iterator current1_;
- const typename ParamGenerator<T2>::iterator begin2_;
- const typename ParamGenerator<T2>::iterator end2_;
- typename ParamGenerator<T2>::iterator current2_;
- const typename ParamGenerator<T3>::iterator begin3_;
- const typename ParamGenerator<T3>::iterator end3_;
- typename ParamGenerator<T3>::iterator current3_;
- const typename ParamGenerator<T4>::iterator begin4_;
- const typename ParamGenerator<T4>::iterator end4_;
- typename ParamGenerator<T4>::iterator current4_;
- ParamType current_value_;
- }; // class CartesianProductGenerator4::Iterator
-
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductGenerator4& other);
-
- const ParamGenerator<T1> g1_;
- const ParamGenerator<T2> g2_;
- const ParamGenerator<T3> g3_;
- const ParamGenerator<T4> g4_;
-}; // class CartesianProductGenerator4
-
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5>
-class CartesianProductGenerator5
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5> > {
- public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5> ParamType;
-
- CartesianProductGenerator5(const ParamGenerator<T1>& g1,
- const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
- const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
- virtual ~CartesianProductGenerator5() {}
-
- virtual ParamIteratorInterface<ParamType>* Begin() const {
- return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
- g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());
- }
- virtual ParamIteratorInterface<ParamType>* End() const {
- return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
- g4_, g4_.end(), g5_, g5_.end());
- }
-
- private:
- class Iterator : public ParamIteratorInterface<ParamType> {
- public:
- Iterator(const ParamGeneratorInterface<ParamType>* base,
- const ParamGenerator<T1>& g1,
- const typename ParamGenerator<T1>::iterator& current1,
- const ParamGenerator<T2>& g2,
- const typename ParamGenerator<T2>::iterator& current2,
- const ParamGenerator<T3>& g3,
- const typename ParamGenerator<T3>::iterator& current3,
- const ParamGenerator<T4>& g4,
- const typename ParamGenerator<T4>::iterator& current4,
- const ParamGenerator<T5>& g5,
- const typename ParamGenerator<T5>::iterator& current5)
- : base_(base),
- begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
- begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
- begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
- begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
- begin5_(g5.begin()), end5_(g5.end()), current5_(current5) {
- ComputeCurrentValue();
- }
- virtual ~Iterator() {}
-
- virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
- return base_;
- }
- // Advance should not be called on beyond-of-range iterators
- // so no component iterators must be beyond end of range, either.
- virtual void Advance() {
- assert(!AtEnd());
- ++current5_;
- if (current5_ == end5_) {
- current5_ = begin5_;
- ++current4_;
- }
- if (current4_ == end4_) {
- current4_ = begin4_;
- ++current3_;
- }
- if (current3_ == end3_) {
- current3_ = begin3_;
- ++current2_;
- }
- if (current2_ == end2_) {
- current2_ = begin2_;
- ++current1_;
- }
- ComputeCurrentValue();
- }
- virtual ParamIteratorInterface<ParamType>* Clone() const {
- return new Iterator(*this);
- }
- virtual const ParamType* Current() const { return &current_value_; }
- virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- const Iterator* typed_other =
- CheckedDowncastToActualType<const Iterator>(&other);
- // We must report iterators equal if they both point beyond their
- // respective ranges. That can happen in a variety of fashions,
- // so we have to consult AtEnd().
- return (AtEnd() && typed_other->AtEnd()) ||
- (
- current1_ == typed_other->current1_ &&
- current2_ == typed_other->current2_ &&
- current3_ == typed_other->current3_ &&
- current4_ == typed_other->current4_ &&
- current5_ == typed_other->current5_);
- }
-
- private:
- Iterator(const Iterator& other)
- : base_(other.base_),
- begin1_(other.begin1_),
- end1_(other.end1_),
- current1_(other.current1_),
- begin2_(other.begin2_),
- end2_(other.end2_),
- current2_(other.current2_),
- begin3_(other.begin3_),
- end3_(other.end3_),
- current3_(other.current3_),
- begin4_(other.begin4_),
- end4_(other.end4_),
- current4_(other.current4_),
- begin5_(other.begin5_),
- end5_(other.end5_),
- current5_(other.current5_) {
- ComputeCurrentValue();
- }
-
- void ComputeCurrentValue() {
- if (!AtEnd())
- current_value_ = ParamType(*current1_, *current2_, *current3_,
- *current4_, *current5_);
- }
- bool AtEnd() const {
- // We must report iterator past the end of the range when either of the
- // component iterators has reached the end of its range.
- return
- current1_ == end1_ ||
- current2_ == end2_ ||
- current3_ == end3_ ||
- current4_ == end4_ ||
- current5_ == end5_;
- }
-
- // No implementation - assignment is unsupported.
- void operator=(const Iterator& other);
-
- const ParamGeneratorInterface<ParamType>* const base_;
- // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
- // current[i]_ is the actual traversing iterator.
- const typename ParamGenerator<T1>::iterator begin1_;
- const typename ParamGenerator<T1>::iterator end1_;
- typename ParamGenerator<T1>::iterator current1_;
- const typename ParamGenerator<T2>::iterator begin2_;
- const typename ParamGenerator<T2>::iterator end2_;
- typename ParamGenerator<T2>::iterator current2_;
- const typename ParamGenerator<T3>::iterator begin3_;
- const typename ParamGenerator<T3>::iterator end3_;
- typename ParamGenerator<T3>::iterator current3_;
- const typename ParamGenerator<T4>::iterator begin4_;
- const typename ParamGenerator<T4>::iterator end4_;
- typename ParamGenerator<T4>::iterator current4_;
- const typename ParamGenerator<T5>::iterator begin5_;
- const typename ParamGenerator<T5>::iterator end5_;
- typename ParamGenerator<T5>::iterator current5_;
- ParamType current_value_;
- }; // class CartesianProductGenerator5::Iterator
-
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductGenerator5& other);
-
- const ParamGenerator<T1> g1_;
- const ParamGenerator<T2> g2_;
- const ParamGenerator<T3> g3_;
- const ParamGenerator<T4> g4_;
- const ParamGenerator<T5> g5_;
-}; // class CartesianProductGenerator5
-
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6>
-class CartesianProductGenerator6
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5,
- T6> > {
- public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> ParamType;
-
- CartesianProductGenerator6(const ParamGenerator<T1>& g1,
- const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
- const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
- const ParamGenerator<T6>& g6)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
- virtual ~CartesianProductGenerator6() {}
-
- virtual ParamIteratorInterface<ParamType>* Begin() const {
- return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
- g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());
- }
- virtual ParamIteratorInterface<ParamType>* End() const {
- return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
- g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());
- }
-
- private:
- class Iterator : public ParamIteratorInterface<ParamType> {
- public:
- Iterator(const ParamGeneratorInterface<ParamType>* base,
- const ParamGenerator<T1>& g1,
- const typename ParamGenerator<T1>::iterator& current1,
- const ParamGenerator<T2>& g2,
- const typename ParamGenerator<T2>::iterator& current2,
- const ParamGenerator<T3>& g3,
- const typename ParamGenerator<T3>::iterator& current3,
- const ParamGenerator<T4>& g4,
- const typename ParamGenerator<T4>::iterator& current4,
- const ParamGenerator<T5>& g5,
- const typename ParamGenerator<T5>::iterator& current5,
- const ParamGenerator<T6>& g6,
- const typename ParamGenerator<T6>::iterator& current6)
- : base_(base),
- begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
- begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
- begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
- begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
- begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
- begin6_(g6.begin()), end6_(g6.end()), current6_(current6) {
- ComputeCurrentValue();
- }
- virtual ~Iterator() {}
-
- virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
- return base_;
- }
- // Advance should not be called on beyond-of-range iterators
- // so no component iterators must be beyond end of range, either.
- virtual void Advance() {
- assert(!AtEnd());
- ++current6_;
- if (current6_ == end6_) {
- current6_ = begin6_;
- ++current5_;
- }
- if (current5_ == end5_) {
- current5_ = begin5_;
- ++current4_;
- }
- if (current4_ == end4_) {
- current4_ = begin4_;
- ++current3_;
- }
- if (current3_ == end3_) {
- current3_ = begin3_;
- ++current2_;
- }
- if (current2_ == end2_) {
- current2_ = begin2_;
- ++current1_;
- }
- ComputeCurrentValue();
- }
- virtual ParamIteratorInterface<ParamType>* Clone() const {
- return new Iterator(*this);
- }
- virtual const ParamType* Current() const { return &current_value_; }
- virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- const Iterator* typed_other =
- CheckedDowncastToActualType<const Iterator>(&other);
- // We must report iterators equal if they both point beyond their
- // respective ranges. That can happen in a variety of fashions,
- // so we have to consult AtEnd().
- return (AtEnd() && typed_other->AtEnd()) ||
- (
- current1_ == typed_other->current1_ &&
- current2_ == typed_other->current2_ &&
- current3_ == typed_other->current3_ &&
- current4_ == typed_other->current4_ &&
- current5_ == typed_other->current5_ &&
- current6_ == typed_other->current6_);
- }
-
- private:
- Iterator(const Iterator& other)
- : base_(other.base_),
- begin1_(other.begin1_),
- end1_(other.end1_),
- current1_(other.current1_),
- begin2_(other.begin2_),
- end2_(other.end2_),
- current2_(other.current2_),
- begin3_(other.begin3_),
- end3_(other.end3_),
- current3_(other.current3_),
- begin4_(other.begin4_),
- end4_(other.end4_),
- current4_(other.current4_),
- begin5_(other.begin5_),
- end5_(other.end5_),
- current5_(other.current5_),
- begin6_(other.begin6_),
- end6_(other.end6_),
- current6_(other.current6_) {
- ComputeCurrentValue();
- }
-
- void ComputeCurrentValue() {
- if (!AtEnd())
- current_value_ = ParamType(*current1_, *current2_, *current3_,
- *current4_, *current5_, *current6_);
- }
- bool AtEnd() const {
- // We must report iterator past the end of the range when either of the
- // component iterators has reached the end of its range.
- return
- current1_ == end1_ ||
- current2_ == end2_ ||
- current3_ == end3_ ||
- current4_ == end4_ ||
- current5_ == end5_ ||
- current6_ == end6_;
- }
-
- // No implementation - assignment is unsupported.
- void operator=(const Iterator& other);
-
- const ParamGeneratorInterface<ParamType>* const base_;
- // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
- // current[i]_ is the actual traversing iterator.
- const typename ParamGenerator<T1>::iterator begin1_;
- const typename ParamGenerator<T1>::iterator end1_;
- typename ParamGenerator<T1>::iterator current1_;
- const typename ParamGenerator<T2>::iterator begin2_;
- const typename ParamGenerator<T2>::iterator end2_;
- typename ParamGenerator<T2>::iterator current2_;
- const typename ParamGenerator<T3>::iterator begin3_;
- const typename ParamGenerator<T3>::iterator end3_;
- typename ParamGenerator<T3>::iterator current3_;
- const typename ParamGenerator<T4>::iterator begin4_;
- const typename ParamGenerator<T4>::iterator end4_;
- typename ParamGenerator<T4>::iterator current4_;
- const typename ParamGenerator<T5>::iterator begin5_;
- const typename ParamGenerator<T5>::iterator end5_;
- typename ParamGenerator<T5>::iterator current5_;
- const typename ParamGenerator<T6>::iterator begin6_;
- const typename ParamGenerator<T6>::iterator end6_;
- typename ParamGenerator<T6>::iterator current6_;
- ParamType current_value_;
- }; // class CartesianProductGenerator6::Iterator
-
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductGenerator6& other);
-
- const ParamGenerator<T1> g1_;
- const ParamGenerator<T2> g2_;
- const ParamGenerator<T3> g3_;
- const ParamGenerator<T4> g4_;
- const ParamGenerator<T5> g5_;
- const ParamGenerator<T6> g6_;
-}; // class CartesianProductGenerator6
-
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7>
-class CartesianProductGenerator7
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
- T7> > {
- public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
-
- CartesianProductGenerator7(const ParamGenerator<T1>& g1,
- const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
- const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
- const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
- virtual ~CartesianProductGenerator7() {}
-
- virtual ParamIteratorInterface<ParamType>* Begin() const {
- return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
- g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
- g7_.begin());
- }
- virtual ParamIteratorInterface<ParamType>* End() const {
- return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
- g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());
- }
-
- private:
- class Iterator : public ParamIteratorInterface<ParamType> {
- public:
- Iterator(const ParamGeneratorInterface<ParamType>* base,
- const ParamGenerator<T1>& g1,
- const typename ParamGenerator<T1>::iterator& current1,
- const ParamGenerator<T2>& g2,
- const typename ParamGenerator<T2>::iterator& current2,
- const ParamGenerator<T3>& g3,
- const typename ParamGenerator<T3>::iterator& current3,
- const ParamGenerator<T4>& g4,
- const typename ParamGenerator<T4>::iterator& current4,
- const ParamGenerator<T5>& g5,
- const typename ParamGenerator<T5>::iterator& current5,
- const ParamGenerator<T6>& g6,
- const typename ParamGenerator<T6>::iterator& current6,
- const ParamGenerator<T7>& g7,
- const typename ParamGenerator<T7>::iterator& current7)
- : base_(base),
- begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
- begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
- begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
- begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
- begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
- begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
- begin7_(g7.begin()), end7_(g7.end()), current7_(current7) {
- ComputeCurrentValue();
- }
- virtual ~Iterator() {}
-
- virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
- return base_;
- }
- // Advance should not be called on beyond-of-range iterators
- // so no component iterators must be beyond end of range, either.
- virtual void Advance() {
- assert(!AtEnd());
- ++current7_;
- if (current7_ == end7_) {
- current7_ = begin7_;
- ++current6_;
- }
- if (current6_ == end6_) {
- current6_ = begin6_;
- ++current5_;
- }
- if (current5_ == end5_) {
- current5_ = begin5_;
- ++current4_;
- }
- if (current4_ == end4_) {
- current4_ = begin4_;
- ++current3_;
- }
- if (current3_ == end3_) {
- current3_ = begin3_;
- ++current2_;
- }
- if (current2_ == end2_) {
- current2_ = begin2_;
- ++current1_;
- }
- ComputeCurrentValue();
- }
- virtual ParamIteratorInterface<ParamType>* Clone() const {
- return new Iterator(*this);
- }
- virtual const ParamType* Current() const { return &current_value_; }
- virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- const Iterator* typed_other =
- CheckedDowncastToActualType<const Iterator>(&other);
- // We must report iterators equal if they both point beyond their
- // respective ranges. That can happen in a variety of fashions,
- // so we have to consult AtEnd().
- return (AtEnd() && typed_other->AtEnd()) ||
- (
- current1_ == typed_other->current1_ &&
- current2_ == typed_other->current2_ &&
- current3_ == typed_other->current3_ &&
- current4_ == typed_other->current4_ &&
- current5_ == typed_other->current5_ &&
- current6_ == typed_other->current6_ &&
- current7_ == typed_other->current7_);
- }
-
- private:
- Iterator(const Iterator& other)
- : base_(other.base_),
- begin1_(other.begin1_),
- end1_(other.end1_),
- current1_(other.current1_),
- begin2_(other.begin2_),
- end2_(other.end2_),
- current2_(other.current2_),
- begin3_(other.begin3_),
- end3_(other.end3_),
- current3_(other.current3_),
- begin4_(other.begin4_),
- end4_(other.end4_),
- current4_(other.current4_),
- begin5_(other.begin5_),
- end5_(other.end5_),
- current5_(other.current5_),
- begin6_(other.begin6_),
- end6_(other.end6_),
- current6_(other.current6_),
- begin7_(other.begin7_),
- end7_(other.end7_),
- current7_(other.current7_) {
- ComputeCurrentValue();
- }
-
- void ComputeCurrentValue() {
- if (!AtEnd())
- current_value_ = ParamType(*current1_, *current2_, *current3_,
- *current4_, *current5_, *current6_, *current7_);
- }
- bool AtEnd() const {
- // We must report iterator past the end of the range when either of the
- // component iterators has reached the end of its range.
- return
- current1_ == end1_ ||
- current2_ == end2_ ||
- current3_ == end3_ ||
- current4_ == end4_ ||
- current5_ == end5_ ||
- current6_ == end6_ ||
- current7_ == end7_;
- }
-
- // No implementation - assignment is unsupported.
- void operator=(const Iterator& other);
-
- const ParamGeneratorInterface<ParamType>* const base_;
- // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
- // current[i]_ is the actual traversing iterator.
- const typename ParamGenerator<T1>::iterator begin1_;
- const typename ParamGenerator<T1>::iterator end1_;
- typename ParamGenerator<T1>::iterator current1_;
- const typename ParamGenerator<T2>::iterator begin2_;
- const typename ParamGenerator<T2>::iterator end2_;
- typename ParamGenerator<T2>::iterator current2_;
- const typename ParamGenerator<T3>::iterator begin3_;
- const typename ParamGenerator<T3>::iterator end3_;
- typename ParamGenerator<T3>::iterator current3_;
- const typename ParamGenerator<T4>::iterator begin4_;
- const typename ParamGenerator<T4>::iterator end4_;
- typename ParamGenerator<T4>::iterator current4_;
- const typename ParamGenerator<T5>::iterator begin5_;
- const typename ParamGenerator<T5>::iterator end5_;
- typename ParamGenerator<T5>::iterator current5_;
- const typename ParamGenerator<T6>::iterator begin6_;
- const typename ParamGenerator<T6>::iterator end6_;
- typename ParamGenerator<T6>::iterator current6_;
- const typename ParamGenerator<T7>::iterator begin7_;
- const typename ParamGenerator<T7>::iterator end7_;
- typename ParamGenerator<T7>::iterator current7_;
- ParamType current_value_;
- }; // class CartesianProductGenerator7::Iterator
-
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductGenerator7& other);
-
- const ParamGenerator<T1> g1_;
- const ParamGenerator<T2> g2_;
- const ParamGenerator<T3> g3_;
- const ParamGenerator<T4> g4_;
- const ParamGenerator<T5> g5_;
- const ParamGenerator<T6> g6_;
- const ParamGenerator<T7> g7_;
-}; // class CartesianProductGenerator7
-
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8>
-class CartesianProductGenerator8
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
- T7, T8> > {
- public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
-
- CartesianProductGenerator8(const ParamGenerator<T1>& g1,
- const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
- const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
- const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
- const ParamGenerator<T8>& g8)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
- g8_(g8) {}
- virtual ~CartesianProductGenerator8() {}
-
- virtual ParamIteratorInterface<ParamType>* Begin() const {
- return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
- g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
- g7_.begin(), g8_, g8_.begin());
- }
- virtual ParamIteratorInterface<ParamType>* End() const {
- return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
- g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
- g8_.end());
- }
-
- private:
- class Iterator : public ParamIteratorInterface<ParamType> {
- public:
- Iterator(const ParamGeneratorInterface<ParamType>* base,
- const ParamGenerator<T1>& g1,
- const typename ParamGenerator<T1>::iterator& current1,
- const ParamGenerator<T2>& g2,
- const typename ParamGenerator<T2>::iterator& current2,
- const ParamGenerator<T3>& g3,
- const typename ParamGenerator<T3>::iterator& current3,
- const ParamGenerator<T4>& g4,
- const typename ParamGenerator<T4>::iterator& current4,
- const ParamGenerator<T5>& g5,
- const typename ParamGenerator<T5>::iterator& current5,
- const ParamGenerator<T6>& g6,
- const typename ParamGenerator<T6>::iterator& current6,
- const ParamGenerator<T7>& g7,
- const typename ParamGenerator<T7>::iterator& current7,
- const ParamGenerator<T8>& g8,
- const typename ParamGenerator<T8>::iterator& current8)
- : base_(base),
- begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
- begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
- begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
- begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
- begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
- begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
- begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
- begin8_(g8.begin()), end8_(g8.end()), current8_(current8) {
- ComputeCurrentValue();
- }
- virtual ~Iterator() {}
-
- virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
- return base_;
- }
- // Advance should not be called on beyond-of-range iterators
- // so no component iterators must be beyond end of range, either.
- virtual void Advance() {
- assert(!AtEnd());
- ++current8_;
- if (current8_ == end8_) {
- current8_ = begin8_;
- ++current7_;
- }
- if (current7_ == end7_) {
- current7_ = begin7_;
- ++current6_;
- }
- if (current6_ == end6_) {
- current6_ = begin6_;
- ++current5_;
- }
- if (current5_ == end5_) {
- current5_ = begin5_;
- ++current4_;
- }
- if (current4_ == end4_) {
- current4_ = begin4_;
- ++current3_;
- }
- if (current3_ == end3_) {
- current3_ = begin3_;
- ++current2_;
- }
- if (current2_ == end2_) {
- current2_ = begin2_;
- ++current1_;
- }
- ComputeCurrentValue();
- }
- virtual ParamIteratorInterface<ParamType>* Clone() const {
- return new Iterator(*this);
- }
- virtual const ParamType* Current() const { return &current_value_; }
- virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- const Iterator* typed_other =
- CheckedDowncastToActualType<const Iterator>(&other);
- // We must report iterators equal if they both point beyond their
- // respective ranges. That can happen in a variety of fashions,
- // so we have to consult AtEnd().
- return (AtEnd() && typed_other->AtEnd()) ||
- (
- current1_ == typed_other->current1_ &&
- current2_ == typed_other->current2_ &&
- current3_ == typed_other->current3_ &&
- current4_ == typed_other->current4_ &&
- current5_ == typed_other->current5_ &&
- current6_ == typed_other->current6_ &&
- current7_ == typed_other->current7_ &&
- current8_ == typed_other->current8_);
- }
-
- private:
- Iterator(const Iterator& other)
- : base_(other.base_),
- begin1_(other.begin1_),
- end1_(other.end1_),
- current1_(other.current1_),
- begin2_(other.begin2_),
- end2_(other.end2_),
- current2_(other.current2_),
- begin3_(other.begin3_),
- end3_(other.end3_),
- current3_(other.current3_),
- begin4_(other.begin4_),
- end4_(other.end4_),
- current4_(other.current4_),
- begin5_(other.begin5_),
- end5_(other.end5_),
- current5_(other.current5_),
- begin6_(other.begin6_),
- end6_(other.end6_),
- current6_(other.current6_),
- begin7_(other.begin7_),
- end7_(other.end7_),
- current7_(other.current7_),
- begin8_(other.begin8_),
- end8_(other.end8_),
- current8_(other.current8_) {
- ComputeCurrentValue();
- }
-
- void ComputeCurrentValue() {
- if (!AtEnd())
- current_value_ = ParamType(*current1_, *current2_, *current3_,
- *current4_, *current5_, *current6_, *current7_, *current8_);
- }
- bool AtEnd() const {
- // We must report iterator past the end of the range when either of the
- // component iterators has reached the end of its range.
- return
- current1_ == end1_ ||
- current2_ == end2_ ||
- current3_ == end3_ ||
- current4_ == end4_ ||
- current5_ == end5_ ||
- current6_ == end6_ ||
- current7_ == end7_ ||
- current8_ == end8_;
- }
-
- // No implementation - assignment is unsupported.
- void operator=(const Iterator& other);
-
- const ParamGeneratorInterface<ParamType>* const base_;
- // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
- // current[i]_ is the actual traversing iterator.
- const typename ParamGenerator<T1>::iterator begin1_;
- const typename ParamGenerator<T1>::iterator end1_;
- typename ParamGenerator<T1>::iterator current1_;
- const typename ParamGenerator<T2>::iterator begin2_;
- const typename ParamGenerator<T2>::iterator end2_;
- typename ParamGenerator<T2>::iterator current2_;
- const typename ParamGenerator<T3>::iterator begin3_;
- const typename ParamGenerator<T3>::iterator end3_;
- typename ParamGenerator<T3>::iterator current3_;
- const typename ParamGenerator<T4>::iterator begin4_;
- const typename ParamGenerator<T4>::iterator end4_;
- typename ParamGenerator<T4>::iterator current4_;
- const typename ParamGenerator<T5>::iterator begin5_;
- const typename ParamGenerator<T5>::iterator end5_;
- typename ParamGenerator<T5>::iterator current5_;
- const typename ParamGenerator<T6>::iterator begin6_;
- const typename ParamGenerator<T6>::iterator end6_;
- typename ParamGenerator<T6>::iterator current6_;
- const typename ParamGenerator<T7>::iterator begin7_;
- const typename ParamGenerator<T7>::iterator end7_;
- typename ParamGenerator<T7>::iterator current7_;
- const typename ParamGenerator<T8>::iterator begin8_;
- const typename ParamGenerator<T8>::iterator end8_;
- typename ParamGenerator<T8>::iterator current8_;
- ParamType current_value_;
- }; // class CartesianProductGenerator8::Iterator
-
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductGenerator8& other);
-
- const ParamGenerator<T1> g1_;
- const ParamGenerator<T2> g2_;
- const ParamGenerator<T3> g3_;
- const ParamGenerator<T4> g4_;
- const ParamGenerator<T5> g5_;
- const ParamGenerator<T6> g6_;
- const ParamGenerator<T7> g7_;
- const ParamGenerator<T8> g8_;
-}; // class CartesianProductGenerator8
-
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9>
-class CartesianProductGenerator9
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
- T7, T8, T9> > {
- public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
-
- CartesianProductGenerator9(const ParamGenerator<T1>& g1,
- const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
- const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
- const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
- const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
- g9_(g9) {}
- virtual ~CartesianProductGenerator9() {}
-
- virtual ParamIteratorInterface<ParamType>* Begin() const {
- return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
- g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
- g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());
- }
- virtual ParamIteratorInterface<ParamType>* End() const {
- return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
- g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
- g8_.end(), g9_, g9_.end());
- }
-
- private:
- class Iterator : public ParamIteratorInterface<ParamType> {
- public:
- Iterator(const ParamGeneratorInterface<ParamType>* base,
- const ParamGenerator<T1>& g1,
- const typename ParamGenerator<T1>::iterator& current1,
- const ParamGenerator<T2>& g2,
- const typename ParamGenerator<T2>::iterator& current2,
- const ParamGenerator<T3>& g3,
- const typename ParamGenerator<T3>::iterator& current3,
- const ParamGenerator<T4>& g4,
- const typename ParamGenerator<T4>::iterator& current4,
- const ParamGenerator<T5>& g5,
- const typename ParamGenerator<T5>::iterator& current5,
- const ParamGenerator<T6>& g6,
- const typename ParamGenerator<T6>::iterator& current6,
- const ParamGenerator<T7>& g7,
- const typename ParamGenerator<T7>::iterator& current7,
- const ParamGenerator<T8>& g8,
- const typename ParamGenerator<T8>::iterator& current8,
- const ParamGenerator<T9>& g9,
- const typename ParamGenerator<T9>::iterator& current9)
- : base_(base),
- begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
- begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
- begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
- begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
- begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
- begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
- begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
- begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
- begin9_(g9.begin()), end9_(g9.end()), current9_(current9) {
- ComputeCurrentValue();
- }
- virtual ~Iterator() {}
-
- virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
- return base_;
- }
- // Advance should not be called on beyond-of-range iterators
- // so no component iterators must be beyond end of range, either.
- virtual void Advance() {
- assert(!AtEnd());
- ++current9_;
- if (current9_ == end9_) {
- current9_ = begin9_;
- ++current8_;
- }
- if (current8_ == end8_) {
- current8_ = begin8_;
- ++current7_;
- }
- if (current7_ == end7_) {
- current7_ = begin7_;
- ++current6_;
- }
- if (current6_ == end6_) {
- current6_ = begin6_;
- ++current5_;
- }
- if (current5_ == end5_) {
- current5_ = begin5_;
- ++current4_;
- }
- if (current4_ == end4_) {
- current4_ = begin4_;
- ++current3_;
- }
- if (current3_ == end3_) {
- current3_ = begin3_;
- ++current2_;
- }
- if (current2_ == end2_) {
- current2_ = begin2_;
- ++current1_;
- }
- ComputeCurrentValue();
- }
- virtual ParamIteratorInterface<ParamType>* Clone() const {
- return new Iterator(*this);
- }
- virtual const ParamType* Current() const { return &current_value_; }
- virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- const Iterator* typed_other =
- CheckedDowncastToActualType<const Iterator>(&other);
- // We must report iterators equal if they both point beyond their
- // respective ranges. That can happen in a variety of fashions,
- // so we have to consult AtEnd().
- return (AtEnd() && typed_other->AtEnd()) ||
- (
- current1_ == typed_other->current1_ &&
- current2_ == typed_other->current2_ &&
- current3_ == typed_other->current3_ &&
- current4_ == typed_other->current4_ &&
- current5_ == typed_other->current5_ &&
- current6_ == typed_other->current6_ &&
- current7_ == typed_other->current7_ &&
- current8_ == typed_other->current8_ &&
- current9_ == typed_other->current9_);
- }
-
- private:
- Iterator(const Iterator& other)
- : base_(other.base_),
- begin1_(other.begin1_),
- end1_(other.end1_),
- current1_(other.current1_),
- begin2_(other.begin2_),
- end2_(other.end2_),
- current2_(other.current2_),
- begin3_(other.begin3_),
- end3_(other.end3_),
- current3_(other.current3_),
- begin4_(other.begin4_),
- end4_(other.end4_),
- current4_(other.current4_),
- begin5_(other.begin5_),
- end5_(other.end5_),
- current5_(other.current5_),
- begin6_(other.begin6_),
- end6_(other.end6_),
- current6_(other.current6_),
- begin7_(other.begin7_),
- end7_(other.end7_),
- current7_(other.current7_),
- begin8_(other.begin8_),
- end8_(other.end8_),
- current8_(other.current8_),
- begin9_(other.begin9_),
- end9_(other.end9_),
- current9_(other.current9_) {
- ComputeCurrentValue();
- }
-
- void ComputeCurrentValue() {
- if (!AtEnd())
- current_value_ = ParamType(*current1_, *current2_, *current3_,
- *current4_, *current5_, *current6_, *current7_, *current8_,
- *current9_);
- }
- bool AtEnd() const {
- // We must report iterator past the end of the range when either of the
- // component iterators has reached the end of its range.
- return
- current1_ == end1_ ||
- current2_ == end2_ ||
- current3_ == end3_ ||
- current4_ == end4_ ||
- current5_ == end5_ ||
- current6_ == end6_ ||
- current7_ == end7_ ||
- current8_ == end8_ ||
- current9_ == end9_;
- }
-
- // No implementation - assignment is unsupported.
- void operator=(const Iterator& other);
-
- const ParamGeneratorInterface<ParamType>* const base_;
- // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
- // current[i]_ is the actual traversing iterator.
- const typename ParamGenerator<T1>::iterator begin1_;
- const typename ParamGenerator<T1>::iterator end1_;
- typename ParamGenerator<T1>::iterator current1_;
- const typename ParamGenerator<T2>::iterator begin2_;
- const typename ParamGenerator<T2>::iterator end2_;
- typename ParamGenerator<T2>::iterator current2_;
- const typename ParamGenerator<T3>::iterator begin3_;
- const typename ParamGenerator<T3>::iterator end3_;
- typename ParamGenerator<T3>::iterator current3_;
- const typename ParamGenerator<T4>::iterator begin4_;
- const typename ParamGenerator<T4>::iterator end4_;
- typename ParamGenerator<T4>::iterator current4_;
- const typename ParamGenerator<T5>::iterator begin5_;
- const typename ParamGenerator<T5>::iterator end5_;
- typename ParamGenerator<T5>::iterator current5_;
- const typename ParamGenerator<T6>::iterator begin6_;
- const typename ParamGenerator<T6>::iterator end6_;
- typename ParamGenerator<T6>::iterator current6_;
- const typename ParamGenerator<T7>::iterator begin7_;
- const typename ParamGenerator<T7>::iterator end7_;
- typename ParamGenerator<T7>::iterator current7_;
- const typename ParamGenerator<T8>::iterator begin8_;
- const typename ParamGenerator<T8>::iterator end8_;
- typename ParamGenerator<T8>::iterator current8_;
- const typename ParamGenerator<T9>::iterator begin9_;
- const typename ParamGenerator<T9>::iterator end9_;
- typename ParamGenerator<T9>::iterator current9_;
- ParamType current_value_;
- }; // class CartesianProductGenerator9::Iterator
-
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductGenerator9& other);
-
- const ParamGenerator<T1> g1_;
- const ParamGenerator<T2> g2_;
- const ParamGenerator<T3> g3_;
- const ParamGenerator<T4> g4_;
- const ParamGenerator<T5> g5_;
- const ParamGenerator<T6> g6_;
- const ParamGenerator<T7> g7_;
- const ParamGenerator<T8> g8_;
- const ParamGenerator<T9> g9_;
-}; // class CartesianProductGenerator9
-
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10>
-class CartesianProductGenerator10
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
- T7, T8, T9, T10> > {
- public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
-
- CartesianProductGenerator10(const ParamGenerator<T1>& g1,
- const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
- const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
- const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
- const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9,
- const ParamGenerator<T10>& g10)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
- g9_(g9), g10_(g10) {}
- virtual ~CartesianProductGenerator10() {}
-
- virtual ParamIteratorInterface<ParamType>* Begin() const {
- return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
- g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
- g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());
- }
- virtual ParamIteratorInterface<ParamType>* End() const {
- return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
- g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
- g8_.end(), g9_, g9_.end(), g10_, g10_.end());
- }
-
- private:
- class Iterator : public ParamIteratorInterface<ParamType> {
- public:
- Iterator(const ParamGeneratorInterface<ParamType>* base,
- const ParamGenerator<T1>& g1,
- const typename ParamGenerator<T1>::iterator& current1,
- const ParamGenerator<T2>& g2,
- const typename ParamGenerator<T2>::iterator& current2,
- const ParamGenerator<T3>& g3,
- const typename ParamGenerator<T3>::iterator& current3,
- const ParamGenerator<T4>& g4,
- const typename ParamGenerator<T4>::iterator& current4,
- const ParamGenerator<T5>& g5,
- const typename ParamGenerator<T5>::iterator& current5,
- const ParamGenerator<T6>& g6,
- const typename ParamGenerator<T6>::iterator& current6,
- const ParamGenerator<T7>& g7,
- const typename ParamGenerator<T7>::iterator& current7,
- const ParamGenerator<T8>& g8,
- const typename ParamGenerator<T8>::iterator& current8,
- const ParamGenerator<T9>& g9,
- const typename ParamGenerator<T9>::iterator& current9,
- const ParamGenerator<T10>& g10,
- const typename ParamGenerator<T10>::iterator& current10)
- : base_(base),
- begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
- begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
- begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
- begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
- begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
- begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
- begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
- begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
- begin9_(g9.begin()), end9_(g9.end()), current9_(current9),
- begin10_(g10.begin()), end10_(g10.end()), current10_(current10) {
- ComputeCurrentValue();
- }
- virtual ~Iterator() {}
-
- virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
- return base_;
- }
- // Advance should not be called on beyond-of-range iterators
- // so no component iterators must be beyond end of range, either.
- virtual void Advance() {
- assert(!AtEnd());
- ++current10_;
- if (current10_ == end10_) {
- current10_ = begin10_;
- ++current9_;
- }
- if (current9_ == end9_) {
- current9_ = begin9_;
- ++current8_;
- }
- if (current8_ == end8_) {
- current8_ = begin8_;
- ++current7_;
- }
- if (current7_ == end7_) {
- current7_ = begin7_;
- ++current6_;
- }
- if (current6_ == end6_) {
- current6_ = begin6_;
- ++current5_;
- }
- if (current5_ == end5_) {
- current5_ = begin5_;
- ++current4_;
- }
- if (current4_ == end4_) {
- current4_ = begin4_;
- ++current3_;
- }
- if (current3_ == end3_) {
- current3_ = begin3_;
- ++current2_;
- }
- if (current2_ == end2_) {
- current2_ = begin2_;
- ++current1_;
- }
- ComputeCurrentValue();
- }
- virtual ParamIteratorInterface<ParamType>* Clone() const {
- return new Iterator(*this);
- }
- virtual const ParamType* Current() const { return &current_value_; }
- virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- const Iterator* typed_other =
- CheckedDowncastToActualType<const Iterator>(&other);
- // We must report iterators equal if they both point beyond their
- // respective ranges. That can happen in a variety of fashions,
- // so we have to consult AtEnd().
- return (AtEnd() && typed_other->AtEnd()) ||
- (
- current1_ == typed_other->current1_ &&
- current2_ == typed_other->current2_ &&
- current3_ == typed_other->current3_ &&
- current4_ == typed_other->current4_ &&
- current5_ == typed_other->current5_ &&
- current6_ == typed_other->current6_ &&
- current7_ == typed_other->current7_ &&
- current8_ == typed_other->current8_ &&
- current9_ == typed_other->current9_ &&
- current10_ == typed_other->current10_);
- }
-
- private:
- Iterator(const Iterator& other)
- : base_(other.base_),
- begin1_(other.begin1_),
- end1_(other.end1_),
- current1_(other.current1_),
- begin2_(other.begin2_),
- end2_(other.end2_),
- current2_(other.current2_),
- begin3_(other.begin3_),
- end3_(other.end3_),
- current3_(other.current3_),
- begin4_(other.begin4_),
- end4_(other.end4_),
- current4_(other.current4_),
- begin5_(other.begin5_),
- end5_(other.end5_),
- current5_(other.current5_),
- begin6_(other.begin6_),
- end6_(other.end6_),
- current6_(other.current6_),
- begin7_(other.begin7_),
- end7_(other.end7_),
- current7_(other.current7_),
- begin8_(other.begin8_),
- end8_(other.end8_),
- current8_(other.current8_),
- begin9_(other.begin9_),
- end9_(other.end9_),
- current9_(other.current9_),
- begin10_(other.begin10_),
- end10_(other.end10_),
- current10_(other.current10_) {
- ComputeCurrentValue();
- }
-
- void ComputeCurrentValue() {
- if (!AtEnd())
- current_value_ = ParamType(*current1_, *current2_, *current3_,
- *current4_, *current5_, *current6_, *current7_, *current8_,
- *current9_, *current10_);
- }
- bool AtEnd() const {
- // We must report iterator past the end of the range when either of the
- // component iterators has reached the end of its range.
- return
- current1_ == end1_ ||
- current2_ == end2_ ||
- current3_ == end3_ ||
- current4_ == end4_ ||
- current5_ == end5_ ||
- current6_ == end6_ ||
- current7_ == end7_ ||
- current8_ == end8_ ||
- current9_ == end9_ ||
- current10_ == end10_;
- }
-
- // No implementation - assignment is unsupported.
- void operator=(const Iterator& other);
-
- const ParamGeneratorInterface<ParamType>* const base_;
- // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
- // current[i]_ is the actual traversing iterator.
- const typename ParamGenerator<T1>::iterator begin1_;
- const typename ParamGenerator<T1>::iterator end1_;
- typename ParamGenerator<T1>::iterator current1_;
- const typename ParamGenerator<T2>::iterator begin2_;
- const typename ParamGenerator<T2>::iterator end2_;
- typename ParamGenerator<T2>::iterator current2_;
- const typename ParamGenerator<T3>::iterator begin3_;
- const typename ParamGenerator<T3>::iterator end3_;
- typename ParamGenerator<T3>::iterator current3_;
- const typename ParamGenerator<T4>::iterator begin4_;
- const typename ParamGenerator<T4>::iterator end4_;
- typename ParamGenerator<T4>::iterator current4_;
- const typename ParamGenerator<T5>::iterator begin5_;
- const typename ParamGenerator<T5>::iterator end5_;
- typename ParamGenerator<T5>::iterator current5_;
- const typename ParamGenerator<T6>::iterator begin6_;
- const typename ParamGenerator<T6>::iterator end6_;
- typename ParamGenerator<T6>::iterator current6_;
- const typename ParamGenerator<T7>::iterator begin7_;
- const typename ParamGenerator<T7>::iterator end7_;
- typename ParamGenerator<T7>::iterator current7_;
- const typename ParamGenerator<T8>::iterator begin8_;
- const typename ParamGenerator<T8>::iterator end8_;
- typename ParamGenerator<T8>::iterator current8_;
- const typename ParamGenerator<T9>::iterator begin9_;
- const typename ParamGenerator<T9>::iterator end9_;
- typename ParamGenerator<T9>::iterator current9_;
- const typename ParamGenerator<T10>::iterator begin10_;
- const typename ParamGenerator<T10>::iterator end10_;
- typename ParamGenerator<T10>::iterator current10_;
- ParamType current_value_;
- }; // class CartesianProductGenerator10::Iterator
-
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductGenerator10& other);
-
- const ParamGenerator<T1> g1_;
- const ParamGenerator<T2> g2_;
- const ParamGenerator<T3> g3_;
- const ParamGenerator<T4> g4_;
- const ParamGenerator<T5> g5_;
- const ParamGenerator<T6> g6_;
- const ParamGenerator<T7> g7_;
- const ParamGenerator<T8> g8_;
- const ParamGenerator<T9> g9_;
- const ParamGenerator<T10> g10_;
-}; // class CartesianProductGenerator10
-
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Helper classes providing Combine() with polymorphic features. They allow
-// casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
-// convertible to U.
-//
-template <class Generator1, class Generator2>
-class CartesianProductHolder2 {
- public:
-CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
- : g1_(g1), g2_(g2) {}
- template <typename T1, typename T2>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2> >(
- new CartesianProductGenerator2<T1, T2>(
- static_cast<ParamGenerator<T1> >(g1_),
- static_cast<ParamGenerator<T2> >(g2_)));
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductHolder2& other);
-
- const Generator1 g1_;
- const Generator2 g2_;
-}; // class CartesianProductHolder2
-
-template <class Generator1, class Generator2, class Generator3>
-class CartesianProductHolder3 {
- public:
-CartesianProductHolder3(const Generator1& g1, const Generator2& g2,
- const Generator3& g3)
- : g1_(g1), g2_(g2), g3_(g3) {}
- template <typename T1, typename T2, typename T3>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >(
- new CartesianProductGenerator3<T1, T2, T3>(
- static_cast<ParamGenerator<T1> >(g1_),
- static_cast<ParamGenerator<T2> >(g2_),
- static_cast<ParamGenerator<T3> >(g3_)));
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductHolder3& other);
-
- const Generator1 g1_;
- const Generator2 g2_;
- const Generator3 g3_;
-}; // class CartesianProductHolder3
-
-template <class Generator1, class Generator2, class Generator3,
- class Generator4>
-class CartesianProductHolder4 {
- public:
-CartesianProductHolder4(const Generator1& g1, const Generator2& g2,
- const Generator3& g3, const Generator4& g4)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
- template <typename T1, typename T2, typename T3, typename T4>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >(
- new CartesianProductGenerator4<T1, T2, T3, T4>(
- static_cast<ParamGenerator<T1> >(g1_),
- static_cast<ParamGenerator<T2> >(g2_),
- static_cast<ParamGenerator<T3> >(g3_),
- static_cast<ParamGenerator<T4> >(g4_)));
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductHolder4& other);
-
- const Generator1 g1_;
- const Generator2 g2_;
- const Generator3 g3_;
- const Generator4 g4_;
-}; // class CartesianProductHolder4
-
-template <class Generator1, class Generator2, class Generator3,
- class Generator4, class Generator5>
-class CartesianProductHolder5 {
- public:
-CartesianProductHolder5(const Generator1& g1, const Generator2& g2,
- const Generator3& g3, const Generator4& g4, const Generator5& g5)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
- template <typename T1, typename T2, typename T3, typename T4, typename T5>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >(
- new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
- static_cast<ParamGenerator<T1> >(g1_),
- static_cast<ParamGenerator<T2> >(g2_),
- static_cast<ParamGenerator<T3> >(g3_),
- static_cast<ParamGenerator<T4> >(g4_),
- static_cast<ParamGenerator<T5> >(g5_)));
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductHolder5& other);
-
- const Generator1 g1_;
- const Generator2 g2_;
- const Generator3 g3_;
- const Generator4 g4_;
- const Generator5 g5_;
-}; // class CartesianProductHolder5
-
-template <class Generator1, class Generator2, class Generator3,
- class Generator4, class Generator5, class Generator6>
-class CartesianProductHolder6 {
- public:
-CartesianProductHolder6(const Generator1& g1, const Generator2& g2,
- const Generator3& g3, const Generator4& g4, const Generator5& g5,
- const Generator6& g6)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >(
- new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
- static_cast<ParamGenerator<T1> >(g1_),
- static_cast<ParamGenerator<T2> >(g2_),
- static_cast<ParamGenerator<T3> >(g3_),
- static_cast<ParamGenerator<T4> >(g4_),
- static_cast<ParamGenerator<T5> >(g5_),
- static_cast<ParamGenerator<T6> >(g6_)));
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductHolder6& other);
-
- const Generator1 g1_;
- const Generator2 g2_;
- const Generator3 g3_;
- const Generator4 g4_;
- const Generator5 g5_;
- const Generator6 g6_;
-}; // class CartesianProductHolder6
-
-template <class Generator1, class Generator2, class Generator3,
- class Generator4, class Generator5, class Generator6, class Generator7>
-class CartesianProductHolder7 {
- public:
-CartesianProductHolder7(const Generator1& g1, const Generator2& g2,
- const Generator3& g3, const Generator4& g4, const Generator5& g5,
- const Generator6& g6, const Generator7& g7)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
- T7> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> >(
- new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
- static_cast<ParamGenerator<T1> >(g1_),
- static_cast<ParamGenerator<T2> >(g2_),
- static_cast<ParamGenerator<T3> >(g3_),
- static_cast<ParamGenerator<T4> >(g4_),
- static_cast<ParamGenerator<T5> >(g5_),
- static_cast<ParamGenerator<T6> >(g6_),
- static_cast<ParamGenerator<T7> >(g7_)));
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductHolder7& other);
-
- const Generator1 g1_;
- const Generator2 g2_;
- const Generator3 g3_;
- const Generator4 g4_;
- const Generator5 g5_;
- const Generator6 g6_;
- const Generator7 g7_;
-}; // class CartesianProductHolder7
-
-template <class Generator1, class Generator2, class Generator3,
- class Generator4, class Generator5, class Generator6, class Generator7,
- class Generator8>
-class CartesianProductHolder8 {
- public:
-CartesianProductHolder8(const Generator1& g1, const Generator2& g2,
- const Generator3& g3, const Generator4& g4, const Generator5& g5,
- const Generator6& g6, const Generator7& g7, const Generator8& g8)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
- g8_(g8) {}
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7,
- T8> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
- new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
- static_cast<ParamGenerator<T1> >(g1_),
- static_cast<ParamGenerator<T2> >(g2_),
- static_cast<ParamGenerator<T3> >(g3_),
- static_cast<ParamGenerator<T4> >(g4_),
- static_cast<ParamGenerator<T5> >(g5_),
- static_cast<ParamGenerator<T6> >(g6_),
- static_cast<ParamGenerator<T7> >(g7_),
- static_cast<ParamGenerator<T8> >(g8_)));
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductHolder8& other);
-
- const Generator1 g1_;
- const Generator2 g2_;
- const Generator3 g3_;
- const Generator4 g4_;
- const Generator5 g5_;
- const Generator6 g6_;
- const Generator7 g7_;
- const Generator8 g8_;
-}; // class CartesianProductHolder8
-
-template <class Generator1, class Generator2, class Generator3,
- class Generator4, class Generator5, class Generator6, class Generator7,
- class Generator8, class Generator9>
-class CartesianProductHolder9 {
- public:
-CartesianProductHolder9(const Generator1& g1, const Generator2& g2,
- const Generator3& g3, const Generator4& g4, const Generator5& g5,
- const Generator6& g6, const Generator7& g7, const Generator8& g8,
- const Generator9& g9)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
- g9_(g9) {}
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
- T9> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
- T9> >(
- new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
- static_cast<ParamGenerator<T1> >(g1_),
- static_cast<ParamGenerator<T2> >(g2_),
- static_cast<ParamGenerator<T3> >(g3_),
- static_cast<ParamGenerator<T4> >(g4_),
- static_cast<ParamGenerator<T5> >(g5_),
- static_cast<ParamGenerator<T6> >(g6_),
- static_cast<ParamGenerator<T7> >(g7_),
- static_cast<ParamGenerator<T8> >(g8_),
- static_cast<ParamGenerator<T9> >(g9_)));
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductHolder9& other);
-
- const Generator1 g1_;
- const Generator2 g2_;
- const Generator3 g3_;
- const Generator4 g4_;
- const Generator5 g5_;
- const Generator6 g6_;
- const Generator7 g7_;
- const Generator8 g8_;
- const Generator9 g9_;
-}; // class CartesianProductHolder9
-
-template <class Generator1, class Generator2, class Generator3,
- class Generator4, class Generator5, class Generator6, class Generator7,
- class Generator8, class Generator9, class Generator10>
-class CartesianProductHolder10 {
- public:
-CartesianProductHolder10(const Generator1& g1, const Generator2& g2,
- const Generator3& g3, const Generator4& g4, const Generator5& g5,
- const Generator6& g6, const Generator7& g7, const Generator8& g8,
- const Generator9& g9, const Generator10& g10)
- : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
- g9_(g9), g10_(g10) {}
- template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
- T9, T10> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
- T9, T10> >(
- new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
- T10>(
- static_cast<ParamGenerator<T1> >(g1_),
- static_cast<ParamGenerator<T2> >(g2_),
- static_cast<ParamGenerator<T3> >(g3_),
- static_cast<ParamGenerator<T4> >(g4_),
- static_cast<ParamGenerator<T5> >(g5_),
- static_cast<ParamGenerator<T6> >(g6_),
- static_cast<ParamGenerator<T7> >(g7_),
- static_cast<ParamGenerator<T8> >(g8_),
- static_cast<ParamGenerator<T9> >(g9_),
- static_cast<ParamGenerator<T10> >(g10_)));
- }
-
- private:
- // No implementation - assignment is unsupported.
- void operator=(const CartesianProductHolder10& other);
-
- const Generator1 g1_;
- const Generator2 g2_;
- const Generator3 g3_;
- const Generator4 g4_;
- const Generator5 g5_;
- const Generator6 g6_;
- const Generator7 g7_;
- const Generator8 g8_;
- const Generator9 g9_;
- const Generator10 g10_;
-}; // class CartesianProductHolder10
-
-#endif // GTEST_HAS_COMBINE
-
-} // namespace internal
-} // namespace testing
-
-#endif // GTEST_HAS_PARAM_TEST
-
-#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
diff --git a/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-param-util.h b/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-param-util.h
deleted file mode 100644
index 0cbb58c..0000000
--- a/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-param-util.h
+++ /dev/null
@@ -1,619 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-//
-// Author: vladl@google.com (Vlad Losev)
-
-// Type and function utilities for implementing parameterized tests.
-
-#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
-#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
-
-#include <iterator>
-#include <utility>
-#include <vector>
-
-// scripts/fuse_gtest.py depends on gtest's own header being #included
-// *unconditionally*. Therefore these #includes cannot be moved
-// inside #if GTEST_HAS_PARAM_TEST.
-#include <gtest/internal/gtest-internal.h>
-#include <gtest/internal/gtest-linked_ptr.h>
-#include <gtest/internal/gtest-port.h>
-
-#if GTEST_HAS_PARAM_TEST
-
-namespace testing {
-namespace internal {
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Outputs a message explaining invalid registration of different
-// fixture class for the same test case. This may happen when
-// TEST_P macro is used to define two tests with the same name
-// but in different namespaces.
-GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
- const char* file, int line);
-
-template <typename> class ParamGeneratorInterface;
-template <typename> class ParamGenerator;
-
-// Interface for iterating over elements provided by an implementation
-// of ParamGeneratorInterface<T>.
-template <typename T>
-class ParamIteratorInterface {
- public:
- virtual ~ParamIteratorInterface() {}
- // A pointer to the base generator instance.
- // Used only for the purposes of iterator comparison
- // to make sure that two iterators belong to the same generator.
- virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
- // Advances iterator to point to the next element
- // provided by the generator. The caller is responsible
- // for not calling Advance() on an iterator equal to
- // BaseGenerator()->End().
- virtual void Advance() = 0;
- // Clones the iterator object. Used for implementing copy semantics
- // of ParamIterator<T>.
- virtual ParamIteratorInterface* Clone() const = 0;
- // Dereferences the current iterator and provides (read-only) access
- // to the pointed value. It is the caller's responsibility not to call
- // Current() on an iterator equal to BaseGenerator()->End().
- // Used for implementing ParamGenerator<T>::operator*().
- virtual const T* Current() const = 0;
- // Determines whether the given iterator and other point to the same
- // element in the sequence generated by the generator.
- // Used for implementing ParamGenerator<T>::operator==().
- virtual bool Equals(const ParamIteratorInterface& other) const = 0;
-};
-
-// Class iterating over elements provided by an implementation of
-// ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
-// and implements the const forward iterator concept.
-template <typename T>
-class ParamIterator {
- public:
- typedef T value_type;
- typedef const T& reference;
- typedef ptrdiff_t difference_type;
-
- // ParamIterator assumes ownership of the impl_ pointer.
- ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
- ParamIterator& operator=(const ParamIterator& other) {
- if (this != &other)
- impl_.reset(other.impl_->Clone());
- return *this;
- }
-
- const T& operator*() const { return *impl_->Current(); }
- const T* operator->() const { return impl_->Current(); }
- // Prefix version of operator++.
- ParamIterator& operator++() {
- impl_->Advance();
- return *this;
- }
- // Postfix version of operator++.
- ParamIterator operator++(int /*unused*/) {
- ParamIteratorInterface<T>* clone = impl_->Clone();
- impl_->Advance();
- return ParamIterator(clone);
- }
- bool operator==(const ParamIterator& other) const {
- return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
- }
- bool operator!=(const ParamIterator& other) const {
- return !(*this == other);
- }
-
- private:
- friend class ParamGenerator<T>;
- explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
- scoped_ptr<ParamIteratorInterface<T> > impl_;
-};
-
-// ParamGeneratorInterface<T> is the binary interface to access generators
-// defined in other translation units.
-template <typename T>
-class ParamGeneratorInterface {
- public:
- typedef T ParamType;
-
- virtual ~ParamGeneratorInterface() {}
-
- // Generator interface definition
- virtual ParamIteratorInterface<T>* Begin() const = 0;
- virtual ParamIteratorInterface<T>* End() const = 0;
-};
-
-// Wraps ParamGeneratorInterface<T> and provides general generator syntax
-// compatible with the STL Container concept.
-// This class implements copy initialization semantics and the contained
-// ParamGeneratorInterface<T> instance is shared among all copies
-// of the original object. This is possible because that instance is immutable.
-template<typename T>
-class ParamGenerator {
- public:
- typedef ParamIterator<T> iterator;
-
- explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}
- ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
-
- ParamGenerator& operator=(const ParamGenerator& other) {
- impl_ = other.impl_;
- return *this;
- }
-
- iterator begin() const { return iterator(impl_->Begin()); }
- iterator end() const { return iterator(impl_->End()); }
-
- private:
- ::testing::internal::linked_ptr<const ParamGeneratorInterface<T> > impl_;
-};
-
-// Generates values from a range of two comparable values. Can be used to
-// generate sequences of user-defined types that implement operator+() and
-// operator<().
-// This class is used in the Range() function.
-template <typename T, typename IncrementT>
-class RangeGenerator : public ParamGeneratorInterface<T> {
- public:
- RangeGenerator(T begin, T end, IncrementT step)
- : begin_(begin), end_(end),
- step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
- virtual ~RangeGenerator() {}
-
- virtual ParamIteratorInterface<T>* Begin() const {
- return new Iterator(this, begin_, 0, step_);
- }
- virtual ParamIteratorInterface<T>* End() const {
- return new Iterator(this, end_, end_index_, step_);
- }
-
- private:
- class Iterator : public ParamIteratorInterface<T> {
- public:
- Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
- IncrementT step)
- : base_(base), value_(value), index_(index), step_(step) {}
- virtual ~Iterator() {}
-
- virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
- return base_;
- }
- virtual void Advance() {
- value_ = value_ + step_;
- index_++;
- }
- virtual ParamIteratorInterface<T>* Clone() const {
- return new Iterator(*this);
- }
- virtual const T* Current() const { return &value_; }
- virtual bool Equals(const ParamIteratorInterface<T>& other) const {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- const int other_index =
- CheckedDowncastToActualType<const Iterator>(&other)->index_;
- return index_ == other_index;
- }
-
- private:
- Iterator(const Iterator& other)
- : ParamIteratorInterface<T>(),
- base_(other.base_), value_(other.value_), index_(other.index_),
- step_(other.step_) {}
-
- // No implementation - assignment is unsupported.
- void operator=(const Iterator& other);
-
- const ParamGeneratorInterface<T>* const base_;
- T value_;
- int index_;
- const IncrementT step_;
- }; // class RangeGenerator::Iterator
-
- static int CalculateEndIndex(const T& begin,
- const T& end,
- const IncrementT& step) {
- int end_index = 0;
- for (T i = begin; i < end; i = i + step)
- end_index++;
- return end_index;
- }
-
- // No implementation - assignment is unsupported.
- void operator=(const RangeGenerator& other);
-
- const T begin_;
- const T end_;
- const IncrementT step_;
- // The index for the end() iterator. All the elements in the generated
- // sequence are indexed (0-based) to aid iterator comparison.
- const int end_index_;
-}; // class RangeGenerator
-
-
-// Generates values from a pair of STL-style iterators. Used in the
-// ValuesIn() function. The elements are copied from the source range
-// since the source can be located on the stack, and the generator
-// is likely to persist beyond that stack frame.
-template <typename T>
-class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
- public:
- template <typename ForwardIterator>
- ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
- : container_(begin, end) {}
- virtual ~ValuesInIteratorRangeGenerator() {}
-
- virtual ParamIteratorInterface<T>* Begin() const {
- return new Iterator(this, container_.begin());
- }
- virtual ParamIteratorInterface<T>* End() const {
- return new Iterator(this, container_.end());
- }
-
- private:
- typedef typename ::std::vector<T> ContainerType;
-
- class Iterator : public ParamIteratorInterface<T> {
- public:
- Iterator(const ParamGeneratorInterface<T>* base,
- typename ContainerType::const_iterator iterator)
- : base_(base), iterator_(iterator) {}
- virtual ~Iterator() {}
-
- virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
- return base_;
- }
- virtual void Advance() {
- ++iterator_;
- value_.reset();
- }
- virtual ParamIteratorInterface<T>* Clone() const {
- return new Iterator(*this);
- }
- // We need to use cached value referenced by iterator_ because *iterator_
- // can return a temporary object (and of type other then T), so just
- // having "return &*iterator_;" doesn't work.
- // value_ is updated here and not in Advance() because Advance()
- // can advance iterator_ beyond the end of the range, and we cannot
- // detect that fact. The client code, on the other hand, is
- // responsible for not calling Current() on an out-of-range iterator.
- virtual const T* Current() const {
- if (value_.get() == NULL)
- value_.reset(new T(*iterator_));
- return value_.get();
- }
- virtual bool Equals(const ParamIteratorInterface<T>& other) const {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- return iterator_ ==
- CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
- }
-
- private:
- Iterator(const Iterator& other)
- // The explicit constructor call suppresses a false warning
- // emitted by gcc when supplied with the -Wextra option.
- : ParamIteratorInterface<T>(),
- base_(other.base_),
- iterator_(other.iterator_) {}
-
- const ParamGeneratorInterface<T>* const base_;
- typename ContainerType::const_iterator iterator_;
- // A cached value of *iterator_. We keep it here to allow access by
- // pointer in the wrapping iterator's operator->().
- // value_ needs to be mutable to be accessed in Current().
- // Use of scoped_ptr helps manage cached value's lifetime,
- // which is bound by the lifespan of the iterator itself.
- mutable scoped_ptr<const T> value_;
- }; // class ValuesInIteratorRangeGenerator::Iterator
-
- // No implementation - assignment is unsupported.
- void operator=(const ValuesInIteratorRangeGenerator& other);
-
- const ContainerType container_;
-}; // class ValuesInIteratorRangeGenerator
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Stores a parameter value and later creates tests parameterized with that
-// value.
-template <class TestClass>
-class ParameterizedTestFactory : public TestFactoryBase {
- public:
- typedef typename TestClass::ParamType ParamType;
- explicit ParameterizedTestFactory(ParamType parameter) :
- parameter_(parameter) {}
- virtual Test* CreateTest() {
- TestClass::SetParam(&parameter_);
- return new TestClass();
- }
-
- private:
- const ParamType parameter_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);
-};
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// TestMetaFactoryBase is a base class for meta-factories that create
-// test factories for passing into MakeAndRegisterTestInfo function.
-template <class ParamType>
-class TestMetaFactoryBase {
- public:
- virtual ~TestMetaFactoryBase() {}
-
- virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
-};
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// TestMetaFactory creates test factories for passing into
-// MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
-// ownership of test factory pointer, same factory object cannot be passed
-// into that method twice. But ParameterizedTestCaseInfo is going to call
-// it for each Test/Parameter value combination. Thus it needs meta factory
-// creator class.
-template <class TestCase>
-class TestMetaFactory
- : public TestMetaFactoryBase<typename TestCase::ParamType> {
- public:
- typedef typename TestCase::ParamType ParamType;
-
- TestMetaFactory() {}
-
- virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
- return new ParameterizedTestFactory<TestCase>(parameter);
- }
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);
-};
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// ParameterizedTestCaseInfoBase is a generic interface
-// to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase
-// accumulates test information provided by TEST_P macro invocations
-// and generators provided by INSTANTIATE_TEST_CASE_P macro invocations
-// and uses that information to register all resulting test instances
-// in RegisterTests method. The ParameterizeTestCaseRegistry class holds
-// a collection of pointers to the ParameterizedTestCaseInfo objects
-// and calls RegisterTests() on each of them when asked.
-class ParameterizedTestCaseInfoBase {
- public:
- virtual ~ParameterizedTestCaseInfoBase() {}
-
- // Base part of test case name for display purposes.
- virtual const String& GetTestCaseName() const = 0;
- // Test case id to verify identity.
- virtual TypeId GetTestCaseTypeId() const = 0;
- // UnitTest class invokes this method to register tests in this
- // test case right before running them in RUN_ALL_TESTS macro.
- // This method should not be called more then once on any single
- // instance of a ParameterizedTestCaseInfoBase derived class.
- virtual void RegisterTests() = 0;
-
- protected:
- ParameterizedTestCaseInfoBase() {}
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);
-};
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// ParameterizedTestCaseInfo accumulates tests obtained from TEST_P
-// macro invocations for a particular test case and generators
-// obtained from INSTANTIATE_TEST_CASE_P macro invocations for that
-// test case. It registers tests with all values generated by all
-// generators when asked.
-template <class TestCase>
-class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
- public:
- // ParamType and GeneratorCreationFunc are private types but are required
- // for declarations of public methods AddTestPattern() and
- // AddTestCaseInstantiation().
- typedef typename TestCase::ParamType ParamType;
- // A function that returns an instance of appropriate generator type.
- typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
-
- explicit ParameterizedTestCaseInfo(const char* name)
- : test_case_name_(name) {}
-
- // Test case base name for display purposes.
- virtual const String& GetTestCaseName() const { return test_case_name_; }
- // Test case id to verify identity.
- virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
- // TEST_P macro uses AddTestPattern() to record information
- // about a single test in a LocalTestInfo structure.
- // test_case_name is the base name of the test case (without invocation
- // prefix). test_base_name is the name of an individual test without
- // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
- // test case base name and DoBar is test base name.
- void AddTestPattern(const char* test_case_name,
- const char* test_base_name,
- TestMetaFactoryBase<ParamType>* meta_factory) {
- tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
- test_base_name,
- meta_factory)));
- }
- // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information
- // about a generator.
- int AddTestCaseInstantiation(const char* instantiation_name,
- GeneratorCreationFunc* func,
- const char* /* file */,
- int /* line */) {
- instantiations_.push_back(::std::make_pair(instantiation_name, func));
- return 0; // Return value used only to run this method in namespace scope.
- }
- // UnitTest class invokes this method to register tests in this test case
- // test cases right before running tests in RUN_ALL_TESTS macro.
- // This method should not be called more then once on any single
- // instance of a ParameterizedTestCaseInfoBase derived class.
- // UnitTest has a guard to prevent from calling this method more then once.
- virtual void RegisterTests() {
- for (typename TestInfoContainer::iterator test_it = tests_.begin();
- test_it != tests_.end(); ++test_it) {
- linked_ptr<TestInfo> test_info = *test_it;
- for (typename InstantiationContainer::iterator gen_it =
- instantiations_.begin(); gen_it != instantiations_.end();
- ++gen_it) {
- const String& instantiation_name = gen_it->first;
- ParamGenerator<ParamType> generator((*gen_it->second)());
-
- Message test_case_name_stream;
- if ( !instantiation_name.empty() )
- test_case_name_stream << instantiation_name.c_str() << "/";
- test_case_name_stream << test_info->test_case_base_name.c_str();
-
- int i = 0;
- for (typename ParamGenerator<ParamType>::iterator param_it =
- generator.begin();
- param_it != generator.end(); ++param_it, ++i) {
- Message test_name_stream;
- test_name_stream << test_info->test_base_name.c_str() << "/" << i;
- ::testing::internal::MakeAndRegisterTestInfo(
- test_case_name_stream.GetString().c_str(),
- test_name_stream.GetString().c_str(),
- "", // test_case_comment
- "", // comment; TODO(vladl@google.com): provide parameter value
- // representation.
- GetTestCaseTypeId(),
- TestCase::SetUpTestCase,
- TestCase::TearDownTestCase,
- test_info->test_meta_factory->CreateTestFactory(*param_it));
- } // for param_it
- } // for gen_it
- } // for test_it
- } // RegisterTests
-
- private:
- // LocalTestInfo structure keeps information about a single test registered
- // with TEST_P macro.
- struct TestInfo {
- TestInfo(const char* a_test_case_base_name,
- const char* a_test_base_name,
- TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
- test_case_base_name(a_test_case_base_name),
- test_base_name(a_test_base_name),
- test_meta_factory(a_test_meta_factory) {}
-
- const String test_case_base_name;
- const String test_base_name;
- const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
- };
- typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
- // Keeps pairs of <Instantiation name, Sequence generator creation function>
- // received from INSTANTIATE_TEST_CASE_P macros.
- typedef ::std::vector<std::pair<String, GeneratorCreationFunc*> >
- InstantiationContainer;
-
- const String test_case_name_;
- TestInfoContainer tests_;
- InstantiationContainer instantiations_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);
-}; // class ParameterizedTestCaseInfo
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase
-// classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P
-// macros use it to locate their corresponding ParameterizedTestCaseInfo
-// descriptors.
-class ParameterizedTestCaseRegistry {
- public:
- ParameterizedTestCaseRegistry() {}
- ~ParameterizedTestCaseRegistry() {
- for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
- it != test_case_infos_.end(); ++it) {
- delete *it;
- }
- }
-
- // Looks up or creates and returns a structure containing information about
- // tests and instantiations of a particular test case.
- template <class TestCase>
- ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
- const char* test_case_name,
- const char* file,
- int line) {
- ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
- for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
- it != test_case_infos_.end(); ++it) {
- if ((*it)->GetTestCaseName() == test_case_name) {
- if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
- // Complain about incorrect usage of Google Test facilities
- // and terminate the program since we cannot guaranty correct
- // test case setup and tear-down in this case.
- ReportInvalidTestCaseType(test_case_name, file, line);
- abort();
- } else {
- // At this point we are sure that the object we found is of the same
- // type we are looking for, so we downcast it to that type
- // without further checks.
- typed_test_info = CheckedDowncastToActualType<
- ParameterizedTestCaseInfo<TestCase> >(*it);
- }
- break;
- }
- }
- if (typed_test_info == NULL) {
- typed_test_info = new ParameterizedTestCaseInfo<TestCase>(test_case_name);
- test_case_infos_.push_back(typed_test_info);
- }
- return typed_test_info;
- }
- void RegisterTests() {
- for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
- it != test_case_infos_.end(); ++it) {
- (*it)->RegisterTests();
- }
- }
-
- private:
- typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;
-
- TestCaseInfoContainer test_case_infos_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);
-};
-
-} // namespace internal
-} // namespace testing
-
-#endif // GTEST_HAS_PARAM_TEST
-
-#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
diff --git a/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h b/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h
deleted file mode 100644
index 9683271..0000000
--- a/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h
+++ /dev/null
@@ -1,1501 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-//
-// Authors: wan@google.com (Zhanyong Wan)
-//
-// Low-level types and utilities for porting Google Test to various
-// platforms. They are subject to change without notice. DO NOT USE
-// THEM IN USER CODE.
-
-#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
-#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
-
-// The user can define the following macros in the build script to
-// control Google Test's behavior. If the user doesn't define a macro
-// in this list, Google Test will define it.
-//
-// GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2)
-// is/isn't available.
-// GTEST_HAS_EXCEPTIONS - Define it to 1/0 to indicate that exceptions
-// are enabled.
-// GTEST_HAS_GLOBAL_STRING - Define it to 1/0 to indicate that ::string
-// is/isn't available (some systems define
-// ::string, which is different to std::string).
-// GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string
-// is/isn't available (some systems define
-// ::wstring, which is different to std::wstring).
-// GTEST_HAS_PTHREAD - Define it to 1/0 to indicate that <pthread.h>
-// is/isn't available.
-// GTEST_HAS_RTTI - Define it to 1/0 to indicate that RTTI is/isn't
-// enabled.
-// GTEST_HAS_STD_WSTRING - Define it to 1/0 to indicate that
-// std::wstring does/doesn't work (Google Test can
-// be used where std::wstring is unavailable).
-// GTEST_HAS_TR1_TUPLE - Define it to 1/0 to indicate tr1::tuple
-// is/isn't available.
-// GTEST_HAS_SEH - Define it to 1/0 to indicate whether the
-// compiler supports Microsoft's "Structured
-// Exception Handling".
-// GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google
-// Test's own tr1 tuple implementation should be
-// used. Unused when the user sets
-// GTEST_HAS_TR1_TUPLE to 0.
-// GTEST_LINKED_AS_SHARED_LIBRARY
-// - Define to 1 when compiling tests that use
-// Google Test as a shared library (known as
-// DLL on Windows).
-// GTEST_CREATE_SHARED_LIBRARY
-// - Define to 1 when compiling Google Test itself
-// as a shared library.
-
-// This header defines the following utilities:
-//
-// Macros indicating the current platform (defined to 1 if compiled on
-// the given platform; otherwise undefined):
-// GTEST_OS_AIX - IBM AIX
-// GTEST_OS_CYGWIN - Cygwin
-// GTEST_OS_HAIKU - Haiku
-// GTEST_OS_LINUX - Linux
-// GTEST_OS_MAC - Mac OS X
-// GTEST_OS_SOLARIS - Sun Solaris
-// GTEST_OS_SYMBIAN - Symbian
-// GTEST_OS_WINDOWS - Windows (Desktop, MinGW, or Mobile)
-// GTEST_OS_WINDOWS_DESKTOP - Windows Desktop
-// GTEST_OS_WINDOWS_MINGW - MinGW
-// GTEST_OS_WINDOWS_MOBILE - Windows Mobile
-// GTEST_OS_ZOS - z/OS
-//
-// Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
-// most stable support. Since core members of the Google Test project
-// don't have access to other platforms, support for them may be less
-// stable. If you notice any problems on your platform, please notify
-// googletestframework@googlegroups.com (patches for fixing them are
-// even more welcome!).
-//
-// Note that it is possible that none of the GTEST_OS_* macros are defined.
-//
-// Macros indicating available Google Test features (defined to 1 if
-// the corresponding feature is supported; otherwise undefined):
-// GTEST_HAS_COMBINE - the Combine() function (for value-parameterized
-// tests)
-// GTEST_HAS_DEATH_TEST - death tests
-// GTEST_HAS_PARAM_TEST - value-parameterized tests
-// GTEST_HAS_TYPED_TEST - typed tests
-// GTEST_HAS_TYPED_TEST_P - type-parameterized tests
-// GTEST_USES_POSIX_RE - enhanced POSIX regex is used.
-// GTEST_USES_SIMPLE_RE - our own simple regex is used;
-// the above two are mutually exclusive.
-// GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
-//
-// Macros for basic C++ coding:
-// GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
-// GTEST_ATTRIBUTE_UNUSED_ - declares that a class' instances or a
-// variable don't have to be used.
-// GTEST_DISALLOW_ASSIGN_ - disables operator=.
-// GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
-// GTEST_MUST_USE_RESULT_ - declares that a function's result must be used.
-//
-// Synchronization:
-// Mutex, MutexLock, ThreadLocal, GetThreadCount()
-// - synchronization primitives.
-// GTEST_IS_THREADSAFE - defined to 1 to indicate that the above
-// synchronization primitives have real implementations
-// and Google Test is thread-safe; or 0 otherwise.
-//
-// Template meta programming:
-// is_pointer - as in TR1; needed on Symbian and IBM XL C/C++ only.
-//
-// Smart pointers:
-// scoped_ptr - as in TR2.
-//
-// Regular expressions:
-// RE - a simple regular expression class using the POSIX
-// Extended Regular Expression syntax. Not available on
-// Windows.
-//
-// Logging:
-// GTEST_LOG_() - logs messages at the specified severity level.
-// LogToStderr() - directs all log messages to stderr.
-// FlushInfoLog() - flushes informational log messages.
-//
-// Stdout and stderr capturing:
-// CaptureStdout() - starts capturing stdout.
-// GetCapturedStdout() - stops capturing stdout and returns the captured
-// string.
-// CaptureStderr() - starts capturing stderr.
-// GetCapturedStderr() - stops capturing stderr and returns the captured
-// string.
-//
-// Integer types:
-// TypeWithSize - maps an integer to a int type.
-// Int32, UInt32, Int64, UInt64, TimeInMillis
-// - integers of known sizes.
-// BiggestInt - the biggest signed integer type.
-//
-// Command-line utilities:
-// GTEST_FLAG() - references a flag.
-// GTEST_DECLARE_*() - declares a flag.
-// GTEST_DEFINE_*() - defines a flag.
-// GetArgvs() - returns the command line as a vector of strings.
-//
-// Environment variable utilities:
-// GetEnv() - gets the value of an environment variable.
-// BoolFromGTestEnv() - parses a bool environment variable.
-// Int32FromGTestEnv() - parses an Int32 environment variable.
-// StringFromGTestEnv() - parses a string environment variable.
-
-#include <stddef.h> // For ptrdiff_t
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#ifndef _WIN32_WCE
-#include <sys/stat.h>
-#endif // !_WIN32_WCE
-
-#include <iostream> // NOLINT
-#include <sstream> // NOLINT
-#include <string> // NOLINT
-
-#define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
-#define GTEST_FLAG_PREFIX_ "gtest_"
-#define GTEST_FLAG_PREFIX_DASH_ "gtest-"
-#define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
-#define GTEST_NAME_ "Google Test"
-#define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/"
-
-// Determines the version of gcc that is used to compile this.
-#ifdef __GNUC__
-// 40302 means version 4.3.2.
-#define GTEST_GCC_VER_ \
- (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
-#endif // __GNUC__
-
-// Determines the platform on which Google Test is compiled.
-#ifdef __CYGWIN__
-#define GTEST_OS_CYGWIN 1
-#elif defined __SYMBIAN32__
-#define GTEST_OS_SYMBIAN 1
-#elif defined _WIN32
-#define GTEST_OS_WINDOWS 1
-#ifdef _WIN32_WCE
-#define GTEST_OS_WINDOWS_MOBILE 1
-#elif defined(__MINGW__) || defined(__MINGW32__)
-#define GTEST_OS_WINDOWS_MINGW 1
-#else
-#define GTEST_OS_WINDOWS_DESKTOP 1
-#endif // _WIN32_WCE
-#elif defined __APPLE__
-#define GTEST_OS_MAC 1
-#elif defined __linux__
-#define GTEST_OS_LINUX 1
-#elif defined __MVS__
-#define GTEST_OS_ZOS 1
-#elif defined(__sun) && defined(__SVR4)
-#define GTEST_OS_SOLARIS 1
-#elif defined(_AIX)
-#define GTEST_OS_AIX 1
-#elif defined(__HAIKU__)
-#define GTEST_OS_HAIKU 1
-#endif // __CYGWIN__
-
-#if GTEST_OS_CYGWIN || GTEST_OS_HAIKU || GTEST_OS_LINUX || GTEST_OS_MAC || \
- GTEST_OS_SYMBIAN || GTEST_OS_SOLARIS || GTEST_OS_AIX
-
-// On some platforms, <regex.h> needs someone to define size_t, and
-// won't compile otherwise. We can #include it here as we already
-// included <stdlib.h>, which is guaranteed to define size_t through
-// <stddef.h>.
-#include <regex.h> // NOLINT
-#include <strings.h> // NOLINT
-#include <sys/types.h> // NOLINT
-#include <time.h> // NOLINT
-#include <unistd.h> // NOLINT
-
-#define GTEST_USES_POSIX_RE 1
-
-#elif GTEST_OS_WINDOWS
-
-#if !GTEST_OS_WINDOWS_MOBILE
-#include <direct.h> // NOLINT
-#include <io.h> // NOLINT
-#endif
-
-// <regex.h> is not available on Windows. Use our own simple regex
-// implementation instead.
-#define GTEST_USES_SIMPLE_RE 1
-
-#else
-
-// <regex.h> may not be available on this platform. Use our own
-// simple regex implementation instead.
-#define GTEST_USES_SIMPLE_RE 1
-
-#endif // GTEST_OS_CYGWIN || GTEST_OS_LINUX || GTEST_OS_MAC ||
- // GTEST_OS_SYMBIAN || GTEST_OS_SOLARIS || GTEST_OS_AIX
-
-#ifndef GTEST_HAS_EXCEPTIONS
-// The user didn't tell us whether exceptions are enabled, so we need
-// to figure it out.
-#if defined(_MSC_VER) || defined(__BORLANDC__)
-// MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS
-// macro to enable exceptions, so we'll do the same.
-// Assumes that exceptions are enabled by default.
-#ifndef _HAS_EXCEPTIONS
-#define _HAS_EXCEPTIONS 1
-#endif // _HAS_EXCEPTIONS
-#define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
-#elif defined(__GNUC__) && __EXCEPTIONS
-// gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
-#define GTEST_HAS_EXCEPTIONS 1
-#elif defined(__SUNPRO_CC)
-// Sun Pro CC supports exceptions. However, there is no compile-time way of
-// detecting whether they are enabled or not. Therefore, we assume that
-// they are enabled unless the user tells us otherwise.
-#define GTEST_HAS_EXCEPTIONS 1
-#elif defined(__IBMCPP__) && __EXCEPTIONS
-// xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
-#define GTEST_HAS_EXCEPTIONS 1
-#else
-// For other compilers, we assume exceptions are disabled to be
-// conservative.
-#define GTEST_HAS_EXCEPTIONS 0
-#endif // defined(_MSC_VER) || defined(__BORLANDC__)
-#endif // GTEST_HAS_EXCEPTIONS
-
-#if !defined(GTEST_HAS_STD_STRING)
-// Even though we don't use this macro any longer, we keep it in case
-// some clients still depend on it.
-#define GTEST_HAS_STD_STRING 1
-#elif !GTEST_HAS_STD_STRING
-// The user told us that ::std::string isn't available.
-#error "Google Test cannot be used where ::std::string isn't available."
-#endif // !defined(GTEST_HAS_STD_STRING)
-
-#ifndef GTEST_HAS_GLOBAL_STRING
-// The user didn't tell us whether ::string is available, so we need
-// to figure it out.
-
-#define GTEST_HAS_GLOBAL_STRING 0
-
-#endif // GTEST_HAS_GLOBAL_STRING
-
-#ifndef GTEST_HAS_STD_WSTRING
-// The user didn't tell us whether ::std::wstring is available, so we need
-// to figure it out.
-// TODO(wan@google.com): uses autoconf to detect whether ::std::wstring
-// is available.
-
-// Cygwin 1.5 and below doesn't support ::std::wstring.
-// Cygwin 1.7 might add wstring support; this should be updated when clear.
-// Solaris' libc++ doesn't support it either.
-// Minix currently doesn't support it either.
-#define GTEST_HAS_STD_WSTRING (!(GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || GTEST_OS_HAIKU || defined(_MINIX)))
-
-#endif // GTEST_HAS_STD_WSTRING
-
-#ifndef GTEST_HAS_GLOBAL_WSTRING
-// The user didn't tell us whether ::wstring is available, so we need
-// to figure it out.
-#define GTEST_HAS_GLOBAL_WSTRING \
- (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)
-#endif // GTEST_HAS_GLOBAL_WSTRING
-
-// Determines whether RTTI is available.
-#ifndef GTEST_HAS_RTTI
-// The user didn't tell us whether RTTI is enabled, so we need to
-// figure it out.
-
-#ifdef _MSC_VER
-
-#ifdef _CPPRTTI // MSVC defines this macro iff RTTI is enabled.
-#define GTEST_HAS_RTTI 1
-#else
-#define GTEST_HAS_RTTI 0
-#endif
-
-// Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
-#elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)
-
-#ifdef __GXX_RTTI
-#define GTEST_HAS_RTTI 1
-#else
-#define GTEST_HAS_RTTI 0
-#endif // __GXX_RTTI
-
-// Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
-// both the typeid and dynamic_cast features are present.
-#elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)
-
-#ifdef __RTTI_ALL__
-#define GTEST_HAS_RTTI 1
-#else
-#define GTEST_HAS_RTTI 0
-#endif
-
-#else
-
-// For all other compilers, we assume RTTI is enabled.
-#define GTEST_HAS_RTTI 1
-
-#endif // _MSC_VER
-
-#endif // GTEST_HAS_RTTI
-
-// It's this header's responsibility to #include <typeinfo> when RTTI
-// is enabled.
-#if GTEST_HAS_RTTI
-#include <typeinfo>
-#endif
-
-// Determines whether Google Test can use the pthreads library.
-#ifndef GTEST_HAS_PTHREAD
-// The user didn't tell us explicitly, so we assume pthreads support is
-// available on Linux and Mac.
-//
-// To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
-// to your compiler flags.
-#define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC)
-#endif // GTEST_HAS_PTHREAD
-
-// Determines whether Google Test can use tr1/tuple. You can define
-// this macro to 0 to prevent Google Test from using tuple (any
-// feature depending on tuple with be disabled in this mode).
-#ifndef GTEST_HAS_TR1_TUPLE
-// The user didn't tell us not to do it, so we assume it's OK.
-#define GTEST_HAS_TR1_TUPLE 1
-#endif // GTEST_HAS_TR1_TUPLE
-
-// Determines whether Google Test's own tr1 tuple implementation
-// should be used.
-#ifndef GTEST_USE_OWN_TR1_TUPLE
-// The user didn't tell us, so we need to figure it out.
-
-// We use our own TR1 tuple if we aren't sure the user has an
-// implementation of it already. At this time, GCC 4.0.0+ and MSVC
-// 2010 are the only mainstream compilers that come with a TR1 tuple
-// implementation. NVIDIA's CUDA NVCC compiler pretends to be GCC by
-// defining __GNUC__ and friends, but cannot compile GCC's tuple
-// implementation. MSVC 2008 (9.0) provides TR1 tuple in a 323 MB
-// Feature Pack download, which we cannot assume the user has.
-#if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000)) \
- || _MSC_VER >= 1600
-#define GTEST_USE_OWN_TR1_TUPLE 0
-#else
-#define GTEST_USE_OWN_TR1_TUPLE 1
-#endif
-
-#endif // GTEST_USE_OWN_TR1_TUPLE
-
-// To avoid conditional compilation everywhere, we make it
-// gtest-port.h's responsibility to #include the header implementing
-// tr1/tuple.
-#if GTEST_HAS_TR1_TUPLE
-
-#if GTEST_USE_OWN_TR1_TUPLE
-#include <gtest/internal/gtest-tuple.h>
-#elif GTEST_OS_SYMBIAN
-
-// On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
-// use STLport's tuple implementation, which unfortunately doesn't
-// work as the copy of STLport distributed with Symbian is incomplete.
-// By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
-// use its own tuple implementation.
-#ifdef BOOST_HAS_TR1_TUPLE
-#undef BOOST_HAS_TR1_TUPLE
-#endif // BOOST_HAS_TR1_TUPLE
-
-// This prevents <boost/tr1/detail/config.hpp>, which defines
-// BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
-#define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
-#include <tuple>
-
-#elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
-// GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header. This does
-// not conform to the TR1 spec, which requires the header to be <tuple>.
-
-#if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
-// Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
-// which is #included by <tr1/tuple>, to not compile when RTTI is
-// disabled. _TR1_FUNCTIONAL is the header guard for
-// <tr1/functional>. Hence the following #define is a hack to prevent
-// <tr1/functional> from being included.
-#define _TR1_FUNCTIONAL 1
-#include <tr1/tuple>
-#undef _TR1_FUNCTIONAL // Allows the user to #include
- // <tr1/functional> if he chooses to.
-#else
-#include <tr1/tuple> // NOLINT
-#endif // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
-
-#else
-// If the compiler is not GCC 4.0+, we assume the user is using a
-// spec-conforming TR1 implementation.
-#include <tuple> // NOLINT
-#endif // GTEST_USE_OWN_TR1_TUPLE
-
-#endif // GTEST_HAS_TR1_TUPLE
-
-// Determines whether clone(2) is supported.
-// Usually it will only be available on Linux, excluding
-// Linux on the Itanium architecture.
-// Also see http://linux.die.net/man/2/clone.
-#ifndef GTEST_HAS_CLONE
-// The user didn't tell us, so we need to figure it out.
-
-#if GTEST_OS_LINUX && !defined(__ia64__)
-#define GTEST_HAS_CLONE 1
-#else
-#define GTEST_HAS_CLONE 0
-#endif // GTEST_OS_LINUX && !defined(__ia64__)
-
-#endif // GTEST_HAS_CLONE
-
-// Determines whether to support stream redirection. This is used to test
-// output correctness and to implement death tests.
-#if !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
-#define GTEST_HAS_STREAM_REDIRECTION_ 1
-#endif // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
-
-// Determines whether to support death tests.
-// Google Test does not support death tests for VC 7.1 and earlier as
-// abort() in a VC 7.1 application compiled as GUI in debug config
-// pops up a dialog window that cannot be suppressed programmatically.
-#if (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
- (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
- GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX)
-#define GTEST_HAS_DEATH_TEST 1
-#include <vector> // NOLINT
-#endif
-
-// We don't support MSVC 7.1 with exceptions disabled now. Therefore
-// all the compilers we care about are adequate for supporting
-// value-parameterized tests.
-#define GTEST_HAS_PARAM_TEST 1
-
-// Determines whether to support type-driven tests.
-
-// Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
-// Sun Pro CC, and IBM Visual Age support.
-#if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
- defined(__IBMCPP__)
-#define GTEST_HAS_TYPED_TEST 1
-#define GTEST_HAS_TYPED_TEST_P 1
-#endif
-
-// Determines whether to support Combine(). This only makes sense when
-// value-parameterized tests are enabled. The implementation doesn't
-// work on Sun Studio since it doesn't understand templated conversion
-// operators.
-#if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC)
-#define GTEST_HAS_COMBINE 1
-#endif
-
-// Determines whether the system compiler uses UTF-16 for encoding wide strings.
-#define GTEST_WIDE_STRING_USES_UTF16_ \
- (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)
-
-// Defines some utility macros.
-
-// The GNU compiler emits a warning if nested "if" statements are followed by
-// an "else" statement and braces are not used to explicitly disambiguate the
-// "else" binding. This leads to problems with code like:
-//
-// if (gate)
-// ASSERT_*(condition) << "Some message";
-//
-// The "switch (0) case 0:" idiom is used to suppress this.
-#ifdef __INTEL_COMPILER
-#define GTEST_AMBIGUOUS_ELSE_BLOCKER_
-#else
-#define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: // NOLINT
-#endif
-
-// Use this annotation at the end of a struct/class definition to
-// prevent the compiler from optimizing away instances that are never
-// used. This is useful when all interesting logic happens inside the
-// c'tor and / or d'tor. Example:
-//
-// struct Foo {
-// Foo() { ... }
-// } GTEST_ATTRIBUTE_UNUSED_;
-//
-// Also use it after a variable or parameter declaration to tell the
-// compiler the variable/parameter does not have to be used.
-#if defined(__GNUC__) && !defined(COMPILER_ICC)
-#define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
-#else
-#define GTEST_ATTRIBUTE_UNUSED_
-#endif
-
-// A macro to disallow operator=
-// This should be used in the private: declarations for a class.
-#define GTEST_DISALLOW_ASSIGN_(type)\
- void operator=(type const &)
-
-// A macro to disallow copy constructor and operator=
-// This should be used in the private: declarations for a class.
-#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\
- type(type const &);\
- GTEST_DISALLOW_ASSIGN_(type)
-
-// Tell the compiler to warn about unused return values for functions declared
-// with this macro. The macro should be used on function declarations
-// following the argument list:
-//
-// Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
-#if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)
-#define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
-#else
-#define GTEST_MUST_USE_RESULT_
-#endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
-
-// Determine whether the compiler supports Microsoft's Structured Exception
-// Handling. This is supported by several Windows compilers but generally
-// does not exist on any other system.
-#ifndef GTEST_HAS_SEH
-// The user didn't tell us, so we need to figure it out.
-
-#if defined(_MSC_VER) || defined(__BORLANDC__)
-// These two compilers are known to support SEH.
-#define GTEST_HAS_SEH 1
-#else
-// Assume no SEH.
-#define GTEST_HAS_SEH 0
-#endif
-
-#endif // GTEST_HAS_SEH
-
-#ifdef _MSC_VER
-
-#if GTEST_LINKED_AS_SHARED_LIBRARY
-#define GTEST_API_ __declspec(dllimport)
-#elif GTEST_CREATE_SHARED_LIBRARY
-#define GTEST_API_ __declspec(dllexport)
-#endif
-
-#endif // _MSC_VER
-
-#ifndef GTEST_API_
-#define GTEST_API_
-#endif
-
-namespace testing {
-
-class Message;
-
-namespace internal {
-
-class String;
-
-typedef ::std::stringstream StrStream;
-
-// A helper for suppressing warnings on constant condition. It just
-// returns 'condition'.
-GTEST_API_ bool IsTrue(bool condition);
-
-// Defines scoped_ptr.
-
-// This implementation of scoped_ptr is PARTIAL - it only contains
-// enough stuff to satisfy Google Test's need.
-template <typename T>
-class scoped_ptr {
- public:
- typedef T element_type;
-
- explicit scoped_ptr(T* p = NULL) : ptr_(p) {}
- ~scoped_ptr() { reset(); }
-
- T& operator*() const { return *ptr_; }
- T* operator->() const { return ptr_; }
- T* get() const { return ptr_; }
-
- T* release() {
- T* const ptr = ptr_;
- ptr_ = NULL;
- return ptr;
- }
-
- void reset(T* p = NULL) {
- if (p != ptr_) {
- if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type.
- delete ptr_;
- }
- ptr_ = p;
- }
- }
- private:
- T* ptr_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);
-};
-
-// Defines RE.
-
-// A simple C++ wrapper for <regex.h>. It uses the POSIX Extended
-// Regular Expression syntax.
-class GTEST_API_ RE {
- public:
- // A copy constructor is required by the Standard to initialize object
- // references from r-values.
- RE(const RE& other) { Init(other.pattern()); }
-
- // Constructs an RE from a string.
- RE(const ::std::string& regex) { Init(regex.c_str()); } // NOLINT
-
-#if GTEST_HAS_GLOBAL_STRING
- RE(const ::string& regex) { Init(regex.c_str()); } // NOLINT
-#endif // GTEST_HAS_GLOBAL_STRING
-
- RE(const char* regex) { Init(regex); } // NOLINT
- ~RE();
-
- // Returns the string representation of the regex.
- const char* pattern() const { return pattern_; }
-
- // FullMatch(str, re) returns true iff regular expression re matches
- // the entire str.
- // PartialMatch(str, re) returns true iff regular expression re
- // matches a substring of str (including str itself).
- //
- // TODO(wan@google.com): make FullMatch() and PartialMatch() work
- // when str contains NUL characters.
- static bool FullMatch(const ::std::string& str, const RE& re) {
- return FullMatch(str.c_str(), re);
- }
- static bool PartialMatch(const ::std::string& str, const RE& re) {
- return PartialMatch(str.c_str(), re);
- }
-
-#if GTEST_HAS_GLOBAL_STRING
- static bool FullMatch(const ::string& str, const RE& re) {
- return FullMatch(str.c_str(), re);
- }
- static bool PartialMatch(const ::string& str, const RE& re) {
- return PartialMatch(str.c_str(), re);
- }
-#endif // GTEST_HAS_GLOBAL_STRING
-
- static bool FullMatch(const char* str, const RE& re);
- static bool PartialMatch(const char* str, const RE& re);
-
- private:
- void Init(const char* regex);
-
- // We use a const char* instead of a string, as Google Test may be used
- // where string is not available. We also do not use Google Test's own
- // String type here, in order to simplify dependencies between the
- // files.
- const char* pattern_;
- bool is_valid_;
-#if GTEST_USES_POSIX_RE
- regex_t full_regex_; // For FullMatch().
- regex_t partial_regex_; // For PartialMatch().
-#else // GTEST_USES_SIMPLE_RE
- const char* full_pattern_; // For FullMatch();
-#endif
-
- GTEST_DISALLOW_ASSIGN_(RE);
-};
-
-// Defines logging utilities:
-// GTEST_LOG_(severity) - logs messages at the specified severity level. The
-// message itself is streamed into the macro.
-// LogToStderr() - directs all log messages to stderr.
-// FlushInfoLog() - flushes informational log messages.
-
-enum GTestLogSeverity {
- GTEST_INFO,
- GTEST_WARNING,
- GTEST_ERROR,
- GTEST_FATAL
-};
-
-// Formats log entry severity, provides a stream object for streaming the
-// log message, and terminates the message with a newline when going out of
-// scope.
-class GTEST_API_ GTestLog {
- public:
- GTestLog(GTestLogSeverity severity, const char* file, int line);
-
- // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
- ~GTestLog();
-
- ::std::ostream& GetStream() { return ::std::cerr; }
-
- private:
- const GTestLogSeverity severity_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
-};
-
-#define GTEST_LOG_(severity) \
- ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
- __FILE__, __LINE__).GetStream()
-
-inline void LogToStderr() {}
-inline void FlushInfoLog() { fflush(NULL); }
-
-// INTERNAL IMPLEMENTATION - DO NOT USE.
-//
-// GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
-// is not satisfied.
-// Synopsys:
-// GTEST_CHECK_(boolean_condition);
-// or
-// GTEST_CHECK_(boolean_condition) << "Additional message";
-//
-// This checks the condition and if the condition is not satisfied
-// it prints message about the condition violation, including the
-// condition itself, plus additional message streamed into it, if any,
-// and then it aborts the program. It aborts the program irrespective of
-// whether it is built in the debug mode or not.
-#define GTEST_CHECK_(condition) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (::testing::internal::IsTrue(condition)) \
- ; \
- else \
- GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
-
-// An all-mode assert to verify that the given POSIX-style function
-// call returns 0 (indicating success). Known limitation: this
-// doesn't expand to a balanced 'if' statement, so enclose the macro
-// in {} if you need to use it as the only statement in an 'if'
-// branch.
-#define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \
- if (const int gtest_error = (posix_call)) \
- GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
- << gtest_error
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Downcasts the pointer of type Base to Derived.
-// Derived must be a subclass of Base. The parameter MUST
-// point to a class of type Derived, not any subclass of it.
-// When RTTI is available, the function performs a runtime
-// check to enforce this.
-template <class Derived, class Base>
-Derived* CheckedDowncastToActualType(Base* base) {
-#if GTEST_HAS_RTTI
- GTEST_CHECK_(typeid(*base) == typeid(Derived));
- return dynamic_cast<Derived*>(base); // NOLINT
-#else
- return static_cast<Derived*>(base); // Poor man's downcast.
-#endif
-}
-
-#if GTEST_HAS_STREAM_REDIRECTION_
-
-// Defines the stderr capturer:
-// CaptureStdout - starts capturing stdout.
-// GetCapturedStdout - stops capturing stdout and returns the captured string.
-// CaptureStderr - starts capturing stderr.
-// GetCapturedStderr - stops capturing stderr and returns the captured string.
-//
-GTEST_API_ void CaptureStdout();
-GTEST_API_ String GetCapturedStdout();
-GTEST_API_ void CaptureStderr();
-GTEST_API_ String GetCapturedStderr();
-
-#endif // GTEST_HAS_STREAM_REDIRECTION_
-
-
-#if GTEST_HAS_DEATH_TEST
-
-// A copy of all command line arguments. Set by InitGoogleTest().
-extern ::std::vector<String> g_argvs;
-
-// GTEST_HAS_DEATH_TEST implies we have ::std::string.
-const ::std::vector<String>& GetArgvs();
-
-#endif // GTEST_HAS_DEATH_TEST
-
-// Defines synchronization primitives.
-
-#if GTEST_HAS_PTHREAD
-
-// Sleeps for (roughly) n milli-seconds. This function is only for
-// testing Google Test's own constructs. Don't use it in user tests,
-// either directly or indirectly.
-inline void SleepMilliseconds(int n) {
- const timespec time = {
- 0, // 0 seconds.
- n * 1000L * 1000L, // And n ms.
- };
- nanosleep(&time, NULL);
-}
-
-// Allows a controller thread to pause execution of newly created
-// threads until notified. Instances of this class must be created
-// and destroyed in the controller thread.
-//
-// This class is only for testing Google Test's own constructs. Do not
-// use it in user tests, either directly or indirectly.
-class Notification {
- public:
- Notification() : notified_(false) {}
-
- // Notifies all threads created with this notification to start. Must
- // be called from the controller thread.
- void Notify() { notified_ = true; }
-
- // Blocks until the controller thread notifies. Must be called from a test
- // thread.
- void WaitForNotification() {
- while(!notified_) {
- SleepMilliseconds(10);
- }
- }
-
- private:
- volatile bool notified_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
-};
-
-// As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
-// Consequently, it cannot select a correct instantiation of ThreadWithParam
-// in order to call its Run(). Introducing ThreadWithParamBase as a
-// non-templated base class for ThreadWithParam allows us to bypass this
-// problem.
-class ThreadWithParamBase {
- public:
- virtual ~ThreadWithParamBase() {}
- virtual void Run() = 0;
-};
-
-// pthread_create() accepts a pointer to a function type with the C linkage.
-// According to the Standard (7.5/1), function types with different linkages
-// are different even if they are otherwise identical. Some compilers (for
-// example, SunStudio) treat them as different types. Since class methods
-// cannot be defined with C-linkage we need to define a free C-function to
-// pass into pthread_create().
-extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
- static_cast<ThreadWithParamBase*>(thread)->Run();
- return NULL;
-}
-
-// Helper class for testing Google Test's multi-threading constructs.
-// To use it, write:
-//
-// void ThreadFunc(int param) { /* Do things with param */ }
-// Notification thread_can_start;
-// ...
-// // The thread_can_start parameter is optional; you can supply NULL.
-// ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);
-// thread_can_start.Notify();
-//
-// These classes are only for testing Google Test's own constructs. Do
-// not use them in user tests, either directly or indirectly.
-template <typename T>
-class ThreadWithParam : public ThreadWithParamBase {
- public:
- typedef void (*UserThreadFunc)(T);
-
- ThreadWithParam(
- UserThreadFunc func, T param, Notification* thread_can_start)
- : func_(func),
- param_(param),
- thread_can_start_(thread_can_start),
- finished_(false) {
- ThreadWithParamBase* const base = this;
- // The thread can be created only after all fields except thread_
- // have been initialized.
- GTEST_CHECK_POSIX_SUCCESS_(
- pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));
- }
- ~ThreadWithParam() { Join(); }
-
- void Join() {
- if (!finished_) {
- GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));
- finished_ = true;
- }
- }
-
- virtual void Run() {
- if (thread_can_start_ != NULL)
- thread_can_start_->WaitForNotification();
- func_(param_);
- }
-
- private:
- const UserThreadFunc func_; // User-supplied thread function.
- const T param_; // User-supplied parameter to the thread function.
- // When non-NULL, used to block execution until the controller thread
- // notifies.
- Notification* const thread_can_start_;
- bool finished_; // true iff we know that the thread function has finished.
- pthread_t thread_; // The native thread object.
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
-};
-
-// gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
-// true.
-#include <pthread.h>
-
-// MutexBase and Mutex implement mutex on pthreads-based platforms. They
-// are used in conjunction with class MutexLock:
-//
-// Mutex mutex;
-// ...
-// MutexLock lock(&mutex); // Acquires the mutex and releases it at the end
-// // of the current scope.
-//
-// MutexBase implements behavior for both statically and dynamically
-// allocated mutexes. Do not use MutexBase directly. Instead, write
-// the following to define a static mutex:
-//
-// GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
-//
-// You can forward declare a static mutex like this:
-//
-// GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
-//
-// To create a dynamic mutex, just define an object of type Mutex.
-class MutexBase {
- public:
- // Acquires this mutex.
- void Lock() {
- GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
- owner_ = pthread_self();
- }
-
- // Releases this mutex.
- void Unlock() {
- // We don't protect writing to owner_ here, as it's the caller's
- // responsibility to ensure that the current thread holds the
- // mutex when this is called.
- owner_ = 0;
- GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
- }
-
- // Does nothing if the current thread holds the mutex. Otherwise, crashes
- // with high probability.
- void AssertHeld() const {
- GTEST_CHECK_(owner_ == pthread_self())
- << "The current thread is not holding the mutex @" << this;
- }
-
- // A static mutex may be used before main() is entered. It may even
- // be used before the dynamic initialization stage. Therefore we
- // must be able to initialize a static mutex object at link time.
- // This means MutexBase has to be a POD and its member variables
- // have to be public.
- public:
- pthread_mutex_t mutex_; // The underlying pthread mutex.
- pthread_t owner_; // The thread holding the mutex; 0 means no one holds it.
-};
-
-// Forward-declares a static mutex.
-#define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
- extern ::testing::internal::MutexBase mutex
-
-// Defines and statically (i.e. at link time) initializes a static mutex.
-#define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
- ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, 0 }
-
-// The Mutex class can only be used for mutexes created at runtime. It
-// shares its API with MutexBase otherwise.
-class Mutex : public MutexBase {
- public:
- Mutex() {
- GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
- owner_ = 0;
- }
- ~Mutex() {
- GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));
- }
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
-};
-
-// We cannot name this class MutexLock as the ctor declaration would
-// conflict with a macro named MutexLock, which is defined on some
-// platforms. Hence the typedef trick below.
-class GTestMutexLock {
- public:
- explicit GTestMutexLock(MutexBase* mutex)
- : mutex_(mutex) { mutex_->Lock(); }
-
- ~GTestMutexLock() { mutex_->Unlock(); }
-
- private:
- MutexBase* const mutex_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
-};
-
-typedef GTestMutexLock MutexLock;
-
-// Helpers for ThreadLocal.
-
-// pthread_key_create() requires DeleteThreadLocalValue() to have
-// C-linkage. Therefore it cannot be templatized to access
-// ThreadLocal<T>. Hence the need for class
-// ThreadLocalValueHolderBase.
-class ThreadLocalValueHolderBase {
- public:
- virtual ~ThreadLocalValueHolderBase() {}
-};
-
-// Called by pthread to delete thread-local data stored by
-// pthread_setspecific().
-extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
- delete static_cast<ThreadLocalValueHolderBase*>(value_holder);
-}
-
-// Implements thread-local storage on pthreads-based systems.
-//
-// // Thread 1
-// ThreadLocal<int> tl(100); // 100 is the default value for each thread.
-//
-// // Thread 2
-// tl.set(150); // Changes the value for thread 2 only.
-// EXPECT_EQ(150, tl.get());
-//
-// // Thread 1
-// EXPECT_EQ(100, tl.get()); // In thread 1, tl has the original value.
-// tl.set(200);
-// EXPECT_EQ(200, tl.get());
-//
-// The template type argument T must have a public copy constructor.
-// In addition, the default ThreadLocal constructor requires T to have
-// a public default constructor.
-//
-// An object managed for a thread by a ThreadLocal instance is deleted
-// when the thread exits. Or, if the ThreadLocal instance dies in
-// that thread, when the ThreadLocal dies. It's the user's
-// responsibility to ensure that all other threads using a ThreadLocal
-// have exited when it dies, or the per-thread objects for those
-// threads will not be deleted.
-//
-// Google Test only uses global ThreadLocal objects. That means they
-// will die after main() has returned. Therefore, no per-thread
-// object managed by Google Test will be leaked as long as all threads
-// using Google Test have exited when main() returns.
-template <typename T>
-class ThreadLocal {
- public:
- ThreadLocal() : key_(CreateKey()),
- default_() {}
- explicit ThreadLocal(const T& value) : key_(CreateKey()),
- default_(value) {}
-
- ~ThreadLocal() {
- // Destroys the managed object for the current thread, if any.
- DeleteThreadLocalValue(pthread_getspecific(key_));
-
- // Releases resources associated with the key. This will *not*
- // delete managed objects for other threads.
- GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));
- }
-
- T* pointer() { return GetOrCreateValue(); }
- const T* pointer() const { return GetOrCreateValue(); }
- const T& get() const { return *pointer(); }
- void set(const T& value) { *pointer() = value; }
-
- private:
- // Holds a value of type T.
- class ValueHolder : public ThreadLocalValueHolderBase {
- public:
- explicit ValueHolder(const T& value) : value_(value) {}
-
- T* pointer() { return &value_; }
-
- private:
- T value_;
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
- };
-
- static pthread_key_t CreateKey() {
- pthread_key_t key;
- // When a thread exits, DeleteThreadLocalValue() will be called on
- // the object managed for that thread.
- GTEST_CHECK_POSIX_SUCCESS_(
- pthread_key_create(&key, &DeleteThreadLocalValue));
- return key;
- }
-
- T* GetOrCreateValue() const {
- ThreadLocalValueHolderBase* const holder =
- static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
- if (holder != NULL) {
- return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
- }
-
- ValueHolder* const new_holder = new ValueHolder(default_);
- ThreadLocalValueHolderBase* const holder_base = new_holder;
- GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
- return new_holder->pointer();
- }
-
- // A key pthreads uses for looking up per-thread values.
- const pthread_key_t key_;
- const T default_; // The default value for each thread.
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
-};
-
-#define GTEST_IS_THREADSAFE 1
-
-#else // GTEST_HAS_PTHREAD
-
-// A dummy implementation of synchronization primitives (mutex, lock,
-// and thread-local variable). Necessary for compiling Google Test where
-// mutex is not supported - using Google Test in multiple threads is not
-// supported on such platforms.
-
-class Mutex {
- public:
- Mutex() {}
- void AssertHeld() const {}
-};
-
-#define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
- extern ::testing::internal::Mutex mutex
-
-#define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
-
-class GTestMutexLock {
- public:
- explicit GTestMutexLock(Mutex*) {} // NOLINT
-};
-
-typedef GTestMutexLock MutexLock;
-
-template <typename T>
-class ThreadLocal {
- public:
- ThreadLocal() : value_() {}
- explicit ThreadLocal(const T& value) : value_(value) {}
- T* pointer() { return &value_; }
- const T* pointer() const { return &value_; }
- const T& get() const { return value_; }
- void set(const T& value) { value_ = value; }
- private:
- T value_;
-};
-
-// The above synchronization primitives have dummy implementations.
-// Therefore Google Test is not thread-safe.
-#define GTEST_IS_THREADSAFE 0
-
-#endif // GTEST_HAS_PTHREAD
-
-// Returns the number of threads running in the process, or 0 to indicate that
-// we cannot detect it.
-GTEST_API_ size_t GetThreadCount();
-
-// Passing non-POD classes through ellipsis (...) crashes the ARM
-// compiler and generates a warning in Sun Studio. The Nokia Symbian
-// and the IBM XL C/C++ compiler try to instantiate a copy constructor
-// for objects passed through ellipsis (...), failing for uncopyable
-// objects. We define this to ensure that only POD is passed through
-// ellipsis on these systems.
-#if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
-// We lose support for NULL detection where the compiler doesn't like
-// passing non-POD classes through ellipsis (...).
-#define GTEST_ELLIPSIS_NEEDS_POD_ 1
-#else
-#define GTEST_CAN_COMPARE_NULL 1
-#endif
-
-// The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
-// const T& and const T* in a function template. These compilers
-// _can_ decide between class template specializations for T and T*,
-// so a tr1::type_traits-like is_pointer works.
-#if defined(__SYMBIAN32__) || defined(__IBMCPP__)
-#define GTEST_NEEDS_IS_POINTER_ 1
-#endif
-
-template <bool bool_value>
-struct bool_constant {
- typedef bool_constant<bool_value> type;
- static const bool value = bool_value;
-};
-template <bool bool_value> const bool bool_constant<bool_value>::value;
-
-typedef bool_constant<false> false_type;
-typedef bool_constant<true> true_type;
-
-template <typename T>
-struct is_pointer : public false_type {};
-
-template <typename T>
-struct is_pointer<T*> : public true_type {};
-
-#if GTEST_OS_WINDOWS
-#define GTEST_PATH_SEP_ "\\"
-#define GTEST_HAS_ALT_PATH_SEP_ 1
-// The biggest signed integer type the compiler supports.
-typedef __int64 BiggestInt;
-#else
-#define GTEST_PATH_SEP_ "/"
-#define GTEST_HAS_ALT_PATH_SEP_ 0
-typedef long long BiggestInt; // NOLINT
-#endif // GTEST_OS_WINDOWS
-
-// The testing::internal::posix namespace holds wrappers for common
-// POSIX functions. These wrappers hide the differences between
-// Windows/MSVC and POSIX systems. Since some compilers define these
-// standard functions as macros, the wrapper cannot have the same name
-// as the wrapped function.
-
-namespace posix {
-
-// Functions with a different name on Windows.
-
-#if GTEST_OS_WINDOWS
-
-typedef struct _stat StatStruct;
-
-#ifdef __BORLANDC__
-inline int IsATTY(int fd) { return isatty(fd); }
-inline int StrCaseCmp(const char* s1, const char* s2) {
- return stricmp(s1, s2);
-}
-inline char* StrDup(const char* src) { return strdup(src); }
-#else // !__BORLANDC__
-#if GTEST_OS_WINDOWS_MOBILE
-inline int IsATTY(int /* fd */) { return 0; }
-#else
-inline int IsATTY(int fd) { return _isatty(fd); }
-#endif // GTEST_OS_WINDOWS_MOBILE
-inline int StrCaseCmp(const char* s1, const char* s2) {
- return _stricmp(s1, s2);
-}
-inline char* StrDup(const char* src) { return _strdup(src); }
-#endif // __BORLANDC__
-
-#if GTEST_OS_WINDOWS_MOBILE
-inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }
-// Stat(), RmDir(), and IsDir() are not needed on Windows CE at this
-// time and thus not defined there.
-#else
-inline int FileNo(FILE* file) { return _fileno(file); }
-inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }
-inline int RmDir(const char* dir) { return _rmdir(dir); }
-inline bool IsDir(const StatStruct& st) {
- return (_S_IFDIR & st.st_mode) != 0;
-}
-#endif // GTEST_OS_WINDOWS_MOBILE
-
-#else
-
-typedef struct stat StatStruct;
-
-inline int FileNo(FILE* file) { return fileno(file); }
-inline int IsATTY(int fd) { return isatty(fd); }
-inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }
-inline int StrCaseCmp(const char* s1, const char* s2) {
- return strcasecmp(s1, s2);
-}
-inline char* StrDup(const char* src) { return strdup(src); }
-inline int RmDir(const char* dir) { return rmdir(dir); }
-inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
-
-#endif // GTEST_OS_WINDOWS
-
-// Functions deprecated by MSVC 8.0.
-
-#ifdef _MSC_VER
-// Temporarily disable warning 4996 (deprecated function).
-#pragma warning(push)
-#pragma warning(disable:4996)
-#endif
-
-inline const char* StrNCpy(char* dest, const char* src, size_t n) {
- return strncpy(dest, src, n);
-}
-
-// ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and
-// StrError() aren't needed on Windows CE at this time and thus not
-// defined there.
-
-#if !GTEST_OS_WINDOWS_MOBILE
-inline int ChDir(const char* dir) { return chdir(dir); }
-#endif
-inline FILE* FOpen(const char* path, const char* mode) {
- return fopen(path, mode);
-}
-#if !GTEST_OS_WINDOWS_MOBILE
-inline FILE *FReopen(const char* path, const char* mode, FILE* stream) {
- return freopen(path, mode, stream);
-}
-inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
-#endif
-inline int FClose(FILE* fp) { return fclose(fp); }
-#if !GTEST_OS_WINDOWS_MOBILE
-inline int Read(int fd, void* buf, unsigned int count) {
- return static_cast<int>(read(fd, buf, count));
-}
-inline int Write(int fd, const void* buf, unsigned int count) {
- return static_cast<int>(write(fd, buf, count));
-}
-inline int Close(int fd) { return close(fd); }
-inline const char* StrError(int errnum) { return strerror(errnum); }
-#endif
-inline const char* GetEnv(const char* name) {
-#if GTEST_OS_WINDOWS_MOBILE
- // We are on Windows CE, which has no environment variables.
- return NULL;
-#elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
- // Environment variables which we programmatically clear will be set to the
- // empty string rather than unset (NULL). Handle that case.
- const char* const env = getenv(name);
- return (env != NULL && env[0] != '\0') ? env : NULL;
-#else
- return getenv(name);
-#endif
-}
-
-#ifdef _MSC_VER
-#pragma warning(pop) // Restores the warning state.
-#endif
-
-#if GTEST_OS_WINDOWS_MOBILE
-// Windows CE has no C library. The abort() function is used in
-// several places in Google Test. This implementation provides a reasonable
-// imitation of standard behaviour.
-void Abort();
-#else
-inline void Abort() { abort(); }
-#endif // GTEST_OS_WINDOWS_MOBILE
-
-} // namespace posix
-
-// The maximum number a BiggestInt can represent. This definition
-// works no matter BiggestInt is represented in one's complement or
-// two's complement.
-//
-// We cannot rely on numeric_limits in STL, as __int64 and long long
-// are not part of standard C++ and numeric_limits doesn't need to be
-// defined for them.
-const BiggestInt kMaxBiggestInt =
- ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));
-
-// This template class serves as a compile-time function from size to
-// type. It maps a size in bytes to a primitive type with that
-// size. e.g.
-//
-// TypeWithSize<4>::UInt
-//
-// is typedef-ed to be unsigned int (unsigned integer made up of 4
-// bytes).
-//
-// Such functionality should belong to STL, but I cannot find it
-// there.
-//
-// Google Test uses this class in the implementation of floating-point
-// comparison.
-//
-// For now it only handles UInt (unsigned int) as that's all Google Test
-// needs. Other types can be easily added in the future if need
-// arises.
-template <size_t size>
-class TypeWithSize {
- public:
- // This prevents the user from using TypeWithSize<N> with incorrect
- // values of N.
- typedef void UInt;
-};
-
-// The specialization for size 4.
-template <>
-class TypeWithSize<4> {
- public:
- // unsigned int has size 4 in both gcc and MSVC.
- //
- // As base/basictypes.h doesn't compile on Windows, we cannot use
- // uint32, uint64, and etc here.
- typedef int Int;
- typedef unsigned int UInt;
-};
-
-// The specialization for size 8.
-template <>
-class TypeWithSize<8> {
- public:
-#if GTEST_OS_WINDOWS
- typedef __int64 Int;
- typedef unsigned __int64 UInt;
-#else
- typedef long long Int; // NOLINT
- typedef unsigned long long UInt; // NOLINT
-#endif // GTEST_OS_WINDOWS
-};
-
-// Integer types of known sizes.
-typedef TypeWithSize<4>::Int Int32;
-typedef TypeWithSize<4>::UInt UInt32;
-typedef TypeWithSize<8>::Int Int64;
-typedef TypeWithSize<8>::UInt UInt64;
-typedef TypeWithSize<8>::Int TimeInMillis; // Represents time in milliseconds.
-
-// Utilities for command line flags and environment variables.
-
-// Macro for referencing flags.
-#define GTEST_FLAG(name) FLAGS_gtest_##name
-
-// Macros for declaring flags.
-#define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
-#define GTEST_DECLARE_int32_(name) \
- GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)
-#define GTEST_DECLARE_string_(name) \
- GTEST_API_ extern ::testing::internal::String GTEST_FLAG(name)
-
-// Macros for defining flags.
-#define GTEST_DEFINE_bool_(name, default_val, doc) \
- GTEST_API_ bool GTEST_FLAG(name) = (default_val)
-#define GTEST_DEFINE_int32_(name, default_val, doc) \
- GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)
-#define GTEST_DEFINE_string_(name, default_val, doc) \
- GTEST_API_ ::testing::internal::String GTEST_FLAG(name) = (default_val)
-
-// Parses 'str' for a 32-bit signed integer. If successful, writes the result
-// to *value and returns true; otherwise leaves *value unchanged and returns
-// false.
-// TODO(chandlerc): Find a better way to refactor flag and environment parsing
-// out of both gtest-port.cc and gtest.cc to avoid exporting this utility
-// function.
-bool ParseInt32(const Message& src_text, const char* str, Int32* value);
-
-// Parses a bool/Int32/string from the environment variable
-// corresponding to the given Google Test flag.
-bool BoolFromGTestEnv(const char* flag, bool default_val);
-GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
-const char* StringFromGTestEnv(const char* flag, const char* default_val);
-
-} // namespace internal
-} // namespace testing
-
-#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
diff --git a/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-string.h b/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-string.h
deleted file mode 100644
index aff093d..0000000
--- a/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-string.h
+++ /dev/null
@@ -1,350 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-//
-// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
-//
-// The Google C++ Testing Framework (Google Test)
-//
-// This header file declares the String class and functions used internally by
-// Google Test. They are subject to change without notice. They should not used
-// by code external to Google Test.
-//
-// This header file is #included by <gtest/internal/gtest-internal.h>.
-// It should not be #included by other files.
-
-#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
-#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
-
-#ifdef __BORLANDC__
-// string.h is not guaranteed to provide strcpy on C++ Builder.
-#include <mem.h>
-#endif
-
-#include <string.h>
-#include <gtest/internal/gtest-port.h>
-
-#include <string>
-
-namespace testing {
-namespace internal {
-
-// String - a UTF-8 string class.
-//
-// For historic reasons, we don't use std::string.
-//
-// TODO(wan@google.com): replace this class with std::string or
-// implement it in terms of the latter.
-//
-// Note that String can represent both NULL and the empty string,
-// while std::string cannot represent NULL.
-//
-// NULL and the empty string are considered different. NULL is less
-// than anything (including the empty string) except itself.
-//
-// This class only provides minimum functionality necessary for
-// implementing Google Test. We do not intend to implement a full-fledged
-// string class here.
-//
-// Since the purpose of this class is to provide a substitute for
-// std::string on platforms where it cannot be used, we define a copy
-// constructor and assignment operators such that we don't need
-// conditional compilation in a lot of places.
-//
-// In order to make the representation efficient, the d'tor of String
-// is not virtual. Therefore DO NOT INHERIT FROM String.
-class GTEST_API_ String {
- public:
- // Static utility methods
-
- // Returns the input enclosed in double quotes if it's not NULL;
- // otherwise returns "(null)". For example, "\"Hello\"" is returned
- // for input "Hello".
- //
- // This is useful for printing a C string in the syntax of a literal.
- //
- // Known issue: escape sequences are not handled yet.
- static String ShowCStringQuoted(const char* c_str);
-
- // Clones a 0-terminated C string, allocating memory using new. The
- // caller is responsible for deleting the return value using
- // delete[]. Returns the cloned string, or NULL if the input is
- // NULL.
- //
- // This is different from strdup() in string.h, which allocates
- // memory using malloc().
- static const char* CloneCString(const char* c_str);
-
-#if GTEST_OS_WINDOWS_MOBILE
- // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be
- // able to pass strings to Win32 APIs on CE we need to convert them
- // to 'Unicode', UTF-16.
-
- // Creates a UTF-16 wide string from the given ANSI string, allocating
- // memory using new. The caller is responsible for deleting the return
- // value using delete[]. Returns the wide string, or NULL if the
- // input is NULL.
- //
- // The wide string is created using the ANSI codepage (CP_ACP) to
- // match the behaviour of the ANSI versions of Win32 calls and the
- // C runtime.
- static LPCWSTR AnsiToUtf16(const char* c_str);
-
- // Creates an ANSI string from the given wide string, allocating
- // memory using new. The caller is responsible for deleting the return
- // value using delete[]. Returns the ANSI string, or NULL if the
- // input is NULL.
- //
- // The returned string is created using the ANSI codepage (CP_ACP) to
- // match the behaviour of the ANSI versions of Win32 calls and the
- // C runtime.
- static const char* Utf16ToAnsi(LPCWSTR utf16_str);
-#endif
-
- // Compares two C strings. Returns true iff they have the same content.
- //
- // Unlike strcmp(), this function can handle NULL argument(s). A
- // NULL C string is considered different to any non-NULL C string,
- // including the empty string.
- static bool CStringEquals(const char* lhs, const char* rhs);
-
- // Converts a wide C string to a String using the UTF-8 encoding.
- // NULL will be converted to "(null)". If an error occurred during
- // the conversion, "(failed to convert from wide string)" is
- // returned.
- static String ShowWideCString(const wchar_t* wide_c_str);
-
- // Similar to ShowWideCString(), except that this function encloses
- // the converted string in double quotes.
- static String ShowWideCStringQuoted(const wchar_t* wide_c_str);
-
- // Compares two wide C strings. Returns true iff they have the same
- // content.
- //
- // Unlike wcscmp(), this function can handle NULL argument(s). A
- // NULL C string is considered different to any non-NULL C string,
- // including the empty string.
- static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);
-
- // Compares two C strings, ignoring case. Returns true iff they
- // have the same content.
- //
- // Unlike strcasecmp(), this function can handle NULL argument(s).
- // A NULL C string is considered different to any non-NULL C string,
- // including the empty string.
- static bool CaseInsensitiveCStringEquals(const char* lhs,
- const char* rhs);
-
- // Compares two wide C strings, ignoring case. Returns true iff they
- // have the same content.
- //
- // Unlike wcscasecmp(), this function can handle NULL argument(s).
- // A NULL C string is considered different to any non-NULL wide C string,
- // including the empty string.
- // NB: The implementations on different platforms slightly differ.
- // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
- // environment variable. On GNU platform this method uses wcscasecmp
- // which compares according to LC_CTYPE category of the current locale.
- // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
- // current locale.
- static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
- const wchar_t* rhs);
-
- // Formats a list of arguments to a String, using the same format
- // spec string as for printf.
- //
- // We do not use the StringPrintf class as it is not universally
- // available.
- //
- // The result is limited to 4096 characters (including the tailing
- // 0). If 4096 characters are not enough to format the input,
- // "<buffer exceeded>" is returned.
- static String Format(const char* format, ...);
-
- // C'tors
-
- // The default c'tor constructs a NULL string.
- String() : c_str_(NULL), length_(0) {}
-
- // Constructs a String by cloning a 0-terminated C string.
- String(const char* a_c_str) { // NOLINT
- if (a_c_str == NULL) {
- c_str_ = NULL;
- length_ = 0;
- } else {
- ConstructNonNull(a_c_str, strlen(a_c_str));
- }
- }
-
- // Constructs a String by copying a given number of chars from a
- // buffer. E.g. String("hello", 3) creates the string "hel",
- // String("a\0bcd", 4) creates "a\0bc", String(NULL, 0) creates "",
- // and String(NULL, 1) results in access violation.
- String(const char* buffer, size_t a_length) {
- ConstructNonNull(buffer, a_length);
- }
-
- // The copy c'tor creates a new copy of the string. The two
- // String objects do not share content.
- String(const String& str) : c_str_(NULL), length_(0) { *this = str; }
-
- // D'tor. String is intended to be a final class, so the d'tor
- // doesn't need to be virtual.
- ~String() { delete[] c_str_; }
-
- // Allows a String to be implicitly converted to an ::std::string or
- // ::string, and vice versa. Converting a String containing a NULL
- // pointer to ::std::string or ::string is undefined behavior.
- // Converting a ::std::string or ::string containing an embedded NUL
- // character to a String will result in the prefix up to the first
- // NUL character.
- String(const ::std::string& str) {
- ConstructNonNull(str.c_str(), str.length());
- }
-
- operator ::std::string() const { return ::std::string(c_str(), length()); }
-
-#if GTEST_HAS_GLOBAL_STRING
- String(const ::string& str) {
- ConstructNonNull(str.c_str(), str.length());
- }
-
- operator ::string() const { return ::string(c_str(), length()); }
-#endif // GTEST_HAS_GLOBAL_STRING
-
- // Returns true iff this is an empty string (i.e. "").
- bool empty() const { return (c_str() != NULL) && (length() == 0); }
-
- // Compares this with another String.
- // Returns < 0 if this is less than rhs, 0 if this is equal to rhs, or > 0
- // if this is greater than rhs.
- int Compare(const String& rhs) const;
-
- // Returns true iff this String equals the given C string. A NULL
- // string and a non-NULL string are considered not equal.
- bool operator==(const char* a_c_str) const { return Compare(a_c_str) == 0; }
-
- // Returns true iff this String is less than the given String. A
- // NULL string is considered less than "".
- bool operator<(const String& rhs) const { return Compare(rhs) < 0; }
-
- // Returns true iff this String doesn't equal the given C string. A NULL
- // string and a non-NULL string are considered not equal.
- bool operator!=(const char* a_c_str) const { return !(*this == a_c_str); }
-
- // Returns true iff this String ends with the given suffix. *Any*
- // String is considered to end with a NULL or empty suffix.
- bool EndsWith(const char* suffix) const;
-
- // Returns true iff this String ends with the given suffix, not considering
- // case. Any String is considered to end with a NULL or empty suffix.
- bool EndsWithCaseInsensitive(const char* suffix) const;
-
- // Returns the length of the encapsulated string, or 0 if the
- // string is NULL.
- size_t length() const { return length_; }
-
- // Gets the 0-terminated C string this String object represents.
- // The String object still owns the string. Therefore the caller
- // should NOT delete the return value.
- const char* c_str() const { return c_str_; }
-
- // Assigns a C string to this object. Self-assignment works.
- const String& operator=(const char* a_c_str) {
- return *this = String(a_c_str);
- }
-
- // Assigns a String object to this object. Self-assignment works.
- const String& operator=(const String& rhs) {
- if (this != &rhs) {
- delete[] c_str_;
- if (rhs.c_str() == NULL) {
- c_str_ = NULL;
- length_ = 0;
- } else {
- ConstructNonNull(rhs.c_str(), rhs.length());
- }
- }
-
- return *this;
- }
-
- private:
- // Constructs a non-NULL String from the given content. This
- // function can only be called when data_ has not been allocated.
- // ConstructNonNull(NULL, 0) results in an empty string ("").
- // ConstructNonNull(NULL, non_zero) is undefined behavior.
- void ConstructNonNull(const char* buffer, size_t a_length) {
- char* const str = new char[a_length + 1];
- memcpy(str, buffer, a_length);
- str[a_length] = '\0';
- c_str_ = str;
- length_ = a_length;
- }
-
- const char* c_str_;
- size_t length_;
-}; // class String
-
-// Streams a String to an ostream. Each '\0' character in the String
-// is replaced with "\\0".
-inline ::std::ostream& operator<<(::std::ostream& os, const String& str) {
- if (str.c_str() == NULL) {
- os << "(null)";
- } else {
- const char* const c_str = str.c_str();
- for (size_t i = 0; i != str.length(); i++) {
- if (c_str[i] == '\0') {
- os << "\\0";
- } else {
- os << c_str[i];
- }
- }
- }
- return os;
-}
-
-// Gets the content of the StrStream's buffer as a String. Each '\0'
-// character in the buffer is replaced with "\\0".
-GTEST_API_ String StrStreamToString(StrStream* stream);
-
-// Converts a streamable value to a String. A NULL pointer is
-// converted to "(null)". When the input value is a ::string,
-// ::std::string, ::wstring, or ::std::wstring object, each NUL
-// character in it is replaced with "\\0".
-
-// Declared here but defined in gtest.h, so that it has access
-// to the definition of the Message class, required by the ARM
-// compiler.
-template <typename T>
-String StreamableToString(const T& streamable);
-
-} // namespace internal
-} // namespace testing
-
-#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
diff --git a/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-tuple.h b/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-tuple.h
deleted file mode 100644
index 16178fc..0000000
--- a/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-tuple.h
+++ /dev/null
@@ -1,968 +0,0 @@
-// This file was GENERATED by a script. DO NOT EDIT BY HAND!!!
-
-// Copyright 2009 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Implements a subset of TR1 tuple needed by Google Test and Google Mock.
-
-#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
-#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
-
-#include <utility> // For ::std::pair.
-
-// The compiler used in Symbian has a bug that prevents us from declaring the
-// tuple template as a friend (it complains that tuple is redefined). This
-// hack bypasses the bug by declaring the members that should otherwise be
-// private as public.
-// Sun Studio versions < 12 also have the above bug.
-#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
-#define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
-#else
-#define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
- template <GTEST_10_TYPENAMES_(U)> friend class tuple; \
- private:
-#endif
-
-// GTEST_n_TUPLE_(T) is the type of an n-tuple.
-#define GTEST_0_TUPLE_(T) tuple<>
-#define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \
- void, void, void>
-#define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \
- void, void, void>
-#define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \
- void, void, void>
-#define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \
- void, void, void>
-#define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \
- void, void, void>
-#define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \
- void, void, void>
-#define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
- void, void, void>
-#define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
- T##7, void, void>
-#define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
- T##7, T##8, void>
-#define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
- T##7, T##8, T##9>
-
-// GTEST_n_TYPENAMES_(T) declares a list of n typenames.
-#define GTEST_0_TYPENAMES_(T)
-#define GTEST_1_TYPENAMES_(T) typename T##0
-#define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1
-#define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2
-#define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
- typename T##3
-#define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
- typename T##3, typename T##4
-#define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
- typename T##3, typename T##4, typename T##5
-#define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
- typename T##3, typename T##4, typename T##5, typename T##6
-#define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
- typename T##3, typename T##4, typename T##5, typename T##6, typename T##7
-#define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
- typename T##3, typename T##4, typename T##5, typename T##6, \
- typename T##7, typename T##8
-#define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
- typename T##3, typename T##4, typename T##5, typename T##6, \
- typename T##7, typename T##8, typename T##9
-
-// In theory, defining stuff in the ::std namespace is undefined
-// behavior. We can do this as we are playing the role of a standard
-// library vendor.
-namespace std {
-namespace tr1 {
-
-template <typename T0 = void, typename T1 = void, typename T2 = void,
- typename T3 = void, typename T4 = void, typename T5 = void,
- typename T6 = void, typename T7 = void, typename T8 = void,
- typename T9 = void>
-class tuple;
-
-// Anything in namespace gtest_internal is Google Test's INTERNAL
-// IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
-namespace gtest_internal {
-
-// ByRef<T>::type is T if T is a reference; otherwise it's const T&.
-template <typename T>
-struct ByRef { typedef const T& type; }; // NOLINT
-template <typename T>
-struct ByRef<T&> { typedef T& type; }; // NOLINT
-
-// A handy wrapper for ByRef.
-#define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
-
-// AddRef<T>::type is T if T is a reference; otherwise it's T&. This
-// is the same as tr1::add_reference<T>::type.
-template <typename T>
-struct AddRef { typedef T& type; }; // NOLINT
-template <typename T>
-struct AddRef<T&> { typedef T& type; }; // NOLINT
-
-// A handy wrapper for AddRef.
-#define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
-
-// A helper for implementing get<k>().
-template <int k> class Get;
-
-// A helper for implementing tuple_element<k, T>. kIndexValid is true
-// iff k < the number of fields in tuple type T.
-template <bool kIndexValid, int kIndex, class Tuple>
-struct TupleElement;
-
-template <GTEST_10_TYPENAMES_(T)>
-struct TupleElement<true, 0, GTEST_10_TUPLE_(T)> { typedef T0 type; };
-
-template <GTEST_10_TYPENAMES_(T)>
-struct TupleElement<true, 1, GTEST_10_TUPLE_(T)> { typedef T1 type; };
-
-template <GTEST_10_TYPENAMES_(T)>
-struct TupleElement<true, 2, GTEST_10_TUPLE_(T)> { typedef T2 type; };
-
-template <GTEST_10_TYPENAMES_(T)>
-struct TupleElement<true, 3, GTEST_10_TUPLE_(T)> { typedef T3 type; };
-
-template <GTEST_10_TYPENAMES_(T)>
-struct TupleElement<true, 4, GTEST_10_TUPLE_(T)> { typedef T4 type; };
-
-template <GTEST_10_TYPENAMES_(T)>
-struct TupleElement<true, 5, GTEST_10_TUPLE_(T)> { typedef T5 type; };
-
-template <GTEST_10_TYPENAMES_(T)>
-struct TupleElement<true, 6, GTEST_10_TUPLE_(T)> { typedef T6 type; };
-
-template <GTEST_10_TYPENAMES_(T)>
-struct TupleElement<true, 7, GTEST_10_TUPLE_(T)> { typedef T7 type; };
-
-template <GTEST_10_TYPENAMES_(T)>
-struct TupleElement<true, 8, GTEST_10_TUPLE_(T)> { typedef T8 type; };
-
-template <GTEST_10_TYPENAMES_(T)>
-struct TupleElement<true, 9, GTEST_10_TUPLE_(T)> { typedef T9 type; };
-
-} // namespace gtest_internal
-
-template <>
-class tuple<> {
- public:
- tuple() {}
- tuple(const tuple& /* t */) {}
- tuple& operator=(const tuple& /* t */) { return *this; }
-};
-
-template <GTEST_1_TYPENAMES_(T)>
-class GTEST_1_TUPLE_(T) {
- public:
- template <int k> friend class gtest_internal::Get;
-
- tuple() : f0_() {}
-
- explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}
-
- tuple(const tuple& t) : f0_(t.f0_) {}
-
- template <GTEST_1_TYPENAMES_(U)>
- tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}
-
- tuple& operator=(const tuple& t) { return CopyFrom(t); }
-
- template <GTEST_1_TYPENAMES_(U)>
- tuple& operator=(const GTEST_1_TUPLE_(U)& t) {
- return CopyFrom(t);
- }
-
- GTEST_DECLARE_TUPLE_AS_FRIEND_
-
- template <GTEST_1_TYPENAMES_(U)>
- tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {
- f0_ = t.f0_;
- return *this;
- }
-
- T0 f0_;
-};
-
-template <GTEST_2_TYPENAMES_(T)>
-class GTEST_2_TUPLE_(T) {
- public:
- template <int k> friend class gtest_internal::Get;
-
- tuple() : f0_(), f1_() {}
-
- explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),
- f1_(f1) {}
-
- tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}
-
- template <GTEST_2_TYPENAMES_(U)>
- tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}
- template <typename U0, typename U1>
- tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
-
- tuple& operator=(const tuple& t) { return CopyFrom(t); }
-
- template <GTEST_2_TYPENAMES_(U)>
- tuple& operator=(const GTEST_2_TUPLE_(U)& t) {
- return CopyFrom(t);
- }
- template <typename U0, typename U1>
- tuple& operator=(const ::std::pair<U0, U1>& p) {
- f0_ = p.first;
- f1_ = p.second;
- return *this;
- }
-
- GTEST_DECLARE_TUPLE_AS_FRIEND_
-
- template <GTEST_2_TYPENAMES_(U)>
- tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {
- f0_ = t.f0_;
- f1_ = t.f1_;
- return *this;
- }
-
- T0 f0_;
- T1 f1_;
-};
-
-template <GTEST_3_TYPENAMES_(T)>
-class GTEST_3_TUPLE_(T) {
- public:
- template <int k> friend class gtest_internal::Get;
-
- tuple() : f0_(), f1_(), f2_() {}
-
- explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
- GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}
-
- tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
-
- template <GTEST_3_TYPENAMES_(U)>
- tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
-
- tuple& operator=(const tuple& t) { return CopyFrom(t); }
-
- template <GTEST_3_TYPENAMES_(U)>
- tuple& operator=(const GTEST_3_TUPLE_(U)& t) {
- return CopyFrom(t);
- }
-
- GTEST_DECLARE_TUPLE_AS_FRIEND_
-
- template <GTEST_3_TYPENAMES_(U)>
- tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {
- f0_ = t.f0_;
- f1_ = t.f1_;
- f2_ = t.f2_;
- return *this;
- }
-
- T0 f0_;
- T1 f1_;
- T2 f2_;
-};
-
-template <GTEST_4_TYPENAMES_(T)>
-class GTEST_4_TUPLE_(T) {
- public:
- template <int k> friend class gtest_internal::Get;
-
- tuple() : f0_(), f1_(), f2_(), f3_() {}
-
- explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
- GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),
- f3_(f3) {}
-
- tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}
-
- template <GTEST_4_TYPENAMES_(U)>
- tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
- f3_(t.f3_) {}
-
- tuple& operator=(const tuple& t) { return CopyFrom(t); }
-
- template <GTEST_4_TYPENAMES_(U)>
- tuple& operator=(const GTEST_4_TUPLE_(U)& t) {
- return CopyFrom(t);
- }
-
- GTEST_DECLARE_TUPLE_AS_FRIEND_
-
- template <GTEST_4_TYPENAMES_(U)>
- tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {
- f0_ = t.f0_;
- f1_ = t.f1_;
- f2_ = t.f2_;
- f3_ = t.f3_;
- return *this;
- }
-
- T0 f0_;
- T1 f1_;
- T2 f2_;
- T3 f3_;
-};
-
-template <GTEST_5_TYPENAMES_(T)>
-class GTEST_5_TUPLE_(T) {
- public:
- template <int k> friend class gtest_internal::Get;
-
- tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}
-
- explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
- GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,
- GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}
-
- tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
- f4_(t.f4_) {}
-
- template <GTEST_5_TYPENAMES_(U)>
- tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
- f3_(t.f3_), f4_(t.f4_) {}
-
- tuple& operator=(const tuple& t) { return CopyFrom(t); }
-
- template <GTEST_5_TYPENAMES_(U)>
- tuple& operator=(const GTEST_5_TUPLE_(U)& t) {
- return CopyFrom(t);
- }
-
- GTEST_DECLARE_TUPLE_AS_FRIEND_
-
- template <GTEST_5_TYPENAMES_(U)>
- tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {
- f0_ = t.f0_;
- f1_ = t.f1_;
- f2_ = t.f2_;
- f3_ = t.f3_;
- f4_ = t.f4_;
- return *this;
- }
-
- T0 f0_;
- T1 f1_;
- T2 f2_;
- T3 f3_;
- T4 f4_;
-};
-
-template <GTEST_6_TYPENAMES_(T)>
-class GTEST_6_TUPLE_(T) {
- public:
- template <int k> friend class gtest_internal::Get;
-
- tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}
-
- explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
- GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
- GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
- f5_(f5) {}
-
- tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
- f4_(t.f4_), f5_(t.f5_) {}
-
- template <GTEST_6_TYPENAMES_(U)>
- tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
- f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}
-
- tuple& operator=(const tuple& t) { return CopyFrom(t); }
-
- template <GTEST_6_TYPENAMES_(U)>
- tuple& operator=(const GTEST_6_TUPLE_(U)& t) {
- return CopyFrom(t);
- }
-
- GTEST_DECLARE_TUPLE_AS_FRIEND_
-
- template <GTEST_6_TYPENAMES_(U)>
- tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {
- f0_ = t.f0_;
- f1_ = t.f1_;
- f2_ = t.f2_;
- f3_ = t.f3_;
- f4_ = t.f4_;
- f5_ = t.f5_;
- return *this;
- }
-
- T0 f0_;
- T1 f1_;
- T2 f2_;
- T3 f3_;
- T4 f4_;
- T5 f5_;
-};
-
-template <GTEST_7_TYPENAMES_(T)>
-class GTEST_7_TUPLE_(T) {
- public:
- template <int k> friend class gtest_internal::Get;
-
- tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}
-
- explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
- GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
- GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),
- f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}
-
- tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
- f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
-
- template <GTEST_7_TYPENAMES_(U)>
- tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
- f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
-
- tuple& operator=(const tuple& t) { return CopyFrom(t); }
-
- template <GTEST_7_TYPENAMES_(U)>
- tuple& operator=(const GTEST_7_TUPLE_(U)& t) {
- return CopyFrom(t);
- }
-
- GTEST_DECLARE_TUPLE_AS_FRIEND_
-
- template <GTEST_7_TYPENAMES_(U)>
- tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {
- f0_ = t.f0_;
- f1_ = t.f1_;
- f2_ = t.f2_;
- f3_ = t.f3_;
- f4_ = t.f4_;
- f5_ = t.f5_;
- f6_ = t.f6_;
- return *this;
- }
-
- T0 f0_;
- T1 f1_;
- T2 f2_;
- T3 f3_;
- T4 f4_;
- T5 f5_;
- T6 f6_;
-};
-
-template <GTEST_8_TYPENAMES_(T)>
-class GTEST_8_TUPLE_(T) {
- public:
- template <int k> friend class gtest_internal::Get;
-
- tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}
-
- explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
- GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
- GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,
- GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
- f5_(f5), f6_(f6), f7_(f7) {}
-
- tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
- f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
-
- template <GTEST_8_TYPENAMES_(U)>
- tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
- f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
-
- tuple& operator=(const tuple& t) { return CopyFrom(t); }
-
- template <GTEST_8_TYPENAMES_(U)>
- tuple& operator=(const GTEST_8_TUPLE_(U)& t) {
- return CopyFrom(t);
- }
-
- GTEST_DECLARE_TUPLE_AS_FRIEND_
-
- template <GTEST_8_TYPENAMES_(U)>
- tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {
- f0_ = t.f0_;
- f1_ = t.f1_;
- f2_ = t.f2_;
- f3_ = t.f3_;
- f4_ = t.f4_;
- f5_ = t.f5_;
- f6_ = t.f6_;
- f7_ = t.f7_;
- return *this;
- }
-
- T0 f0_;
- T1 f1_;
- T2 f2_;
- T3 f3_;
- T4 f4_;
- T5 f5_;
- T6 f6_;
- T7 f7_;
-};
-
-template <GTEST_9_TYPENAMES_(T)>
-class GTEST_9_TUPLE_(T) {
- public:
- template <int k> friend class gtest_internal::Get;
-
- tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}
-
- explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
- GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
- GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
- GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
- f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}
-
- tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
- f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
-
- template <GTEST_9_TYPENAMES_(U)>
- tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
- f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
-
- tuple& operator=(const tuple& t) { return CopyFrom(t); }
-
- template <GTEST_9_TYPENAMES_(U)>
- tuple& operator=(const GTEST_9_TUPLE_(U)& t) {
- return CopyFrom(t);
- }
-
- GTEST_DECLARE_TUPLE_AS_FRIEND_
-
- template <GTEST_9_TYPENAMES_(U)>
- tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {
- f0_ = t.f0_;
- f1_ = t.f1_;
- f2_ = t.f2_;
- f3_ = t.f3_;
- f4_ = t.f4_;
- f5_ = t.f5_;
- f6_ = t.f6_;
- f7_ = t.f7_;
- f8_ = t.f8_;
- return *this;
- }
-
- T0 f0_;
- T1 f1_;
- T2 f2_;
- T3 f3_;
- T4 f4_;
- T5 f5_;
- T6 f6_;
- T7 f7_;
- T8 f8_;
-};
-
-template <GTEST_10_TYPENAMES_(T)>
-class tuple {
- public:
- template <int k> friend class gtest_internal::Get;
-
- tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),
- f9_() {}
-
- explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
- GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
- GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
- GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),
- f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}
-
- tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
- f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}
-
- template <GTEST_10_TYPENAMES_(U)>
- tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
- f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),
- f9_(t.f9_) {}
-
- tuple& operator=(const tuple& t) { return CopyFrom(t); }
-
- template <GTEST_10_TYPENAMES_(U)>
- tuple& operator=(const GTEST_10_TUPLE_(U)& t) {
- return CopyFrom(t);
- }
-
- GTEST_DECLARE_TUPLE_AS_FRIEND_
-
- template <GTEST_10_TYPENAMES_(U)>
- tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {
- f0_ = t.f0_;
- f1_ = t.f1_;
- f2_ = t.f2_;
- f3_ = t.f3_;
- f4_ = t.f4_;
- f5_ = t.f5_;
- f6_ = t.f6_;
- f7_ = t.f7_;
- f8_ = t.f8_;
- f9_ = t.f9_;
- return *this;
- }
-
- T0 f0_;
- T1 f1_;
- T2 f2_;
- T3 f3_;
- T4 f4_;
- T5 f5_;
- T6 f6_;
- T7 f7_;
- T8 f8_;
- T9 f9_;
-};
-
-// 6.1.3.2 Tuple creation functions.
-
-// Known limitations: we don't support passing an
-// std::tr1::reference_wrapper<T> to make_tuple(). And we don't
-// implement tie().
-
-inline tuple<> make_tuple() { return tuple<>(); }
-
-template <GTEST_1_TYPENAMES_(T)>
-inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {
- return GTEST_1_TUPLE_(T)(f0);
-}
-
-template <GTEST_2_TYPENAMES_(T)>
-inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {
- return GTEST_2_TUPLE_(T)(f0, f1);
-}
-
-template <GTEST_3_TYPENAMES_(T)>
-inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {
- return GTEST_3_TUPLE_(T)(f0, f1, f2);
-}
-
-template <GTEST_4_TYPENAMES_(T)>
-inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
- const T3& f3) {
- return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);
-}
-
-template <GTEST_5_TYPENAMES_(T)>
-inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
- const T3& f3, const T4& f4) {
- return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);
-}
-
-template <GTEST_6_TYPENAMES_(T)>
-inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
- const T3& f3, const T4& f4, const T5& f5) {
- return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);
-}
-
-template <GTEST_7_TYPENAMES_(T)>
-inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
- const T3& f3, const T4& f4, const T5& f5, const T6& f6) {
- return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);
-}
-
-template <GTEST_8_TYPENAMES_(T)>
-inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
- const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {
- return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);
-}
-
-template <GTEST_9_TYPENAMES_(T)>
-inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
- const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
- const T8& f8) {
- return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);
-}
-
-template <GTEST_10_TYPENAMES_(T)>
-inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
- const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
- const T8& f8, const T9& f9) {
- return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);
-}
-
-// 6.1.3.3 Tuple helper classes.
-
-template <typename Tuple> struct tuple_size;
-
-template <GTEST_0_TYPENAMES_(T)>
-struct tuple_size<GTEST_0_TUPLE_(T)> { static const int value = 0; };
-
-template <GTEST_1_TYPENAMES_(T)>
-struct tuple_size<GTEST_1_TUPLE_(T)> { static const int value = 1; };
-
-template <GTEST_2_TYPENAMES_(T)>
-struct tuple_size<GTEST_2_TUPLE_(T)> { static const int value = 2; };
-
-template <GTEST_3_TYPENAMES_(T)>
-struct tuple_size<GTEST_3_TUPLE_(T)> { static const int value = 3; };
-
-template <GTEST_4_TYPENAMES_(T)>
-struct tuple_size<GTEST_4_TUPLE_(T)> { static const int value = 4; };
-
-template <GTEST_5_TYPENAMES_(T)>
-struct tuple_size<GTEST_5_TUPLE_(T)> { static const int value = 5; };
-
-template <GTEST_6_TYPENAMES_(T)>
-struct tuple_size<GTEST_6_TUPLE_(T)> { static const int value = 6; };
-
-template <GTEST_7_TYPENAMES_(T)>
-struct tuple_size<GTEST_7_TUPLE_(T)> { static const int value = 7; };
-
-template <GTEST_8_TYPENAMES_(T)>
-struct tuple_size<GTEST_8_TUPLE_(T)> { static const int value = 8; };
-
-template <GTEST_9_TYPENAMES_(T)>
-struct tuple_size<GTEST_9_TUPLE_(T)> { static const int value = 9; };
-
-template <GTEST_10_TYPENAMES_(T)>
-struct tuple_size<GTEST_10_TUPLE_(T)> { static const int value = 10; };
-
-template <int k, class Tuple>
-struct tuple_element {
- typedef typename gtest_internal::TupleElement<
- k < (tuple_size<Tuple>::value), k, Tuple>::type type;
-};
-
-#define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
-
-// 6.1.3.4 Element access.
-
-namespace gtest_internal {
-
-template <>
-class Get<0> {
- public:
- template <class Tuple>
- static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
- Field(Tuple& t) { return t.f0_; } // NOLINT
-
- template <class Tuple>
- static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
- ConstField(const Tuple& t) { return t.f0_; }
-};
-
-template <>
-class Get<1> {
- public:
- template <class Tuple>
- static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
- Field(Tuple& t) { return t.f1_; } // NOLINT
-
- template <class Tuple>
- static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
- ConstField(const Tuple& t) { return t.f1_; }
-};
-
-template <>
-class Get<2> {
- public:
- template <class Tuple>
- static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
- Field(Tuple& t) { return t.f2_; } // NOLINT
-
- template <class Tuple>
- static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
- ConstField(const Tuple& t) { return t.f2_; }
-};
-
-template <>
-class Get<3> {
- public:
- template <class Tuple>
- static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
- Field(Tuple& t) { return t.f3_; } // NOLINT
-
- template <class Tuple>
- static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
- ConstField(const Tuple& t) { return t.f3_; }
-};
-
-template <>
-class Get<4> {
- public:
- template <class Tuple>
- static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
- Field(Tuple& t) { return t.f4_; } // NOLINT
-
- template <class Tuple>
- static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
- ConstField(const Tuple& t) { return t.f4_; }
-};
-
-template <>
-class Get<5> {
- public:
- template <class Tuple>
- static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
- Field(Tuple& t) { return t.f5_; } // NOLINT
-
- template <class Tuple>
- static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
- ConstField(const Tuple& t) { return t.f5_; }
-};
-
-template <>
-class Get<6> {
- public:
- template <class Tuple>
- static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
- Field(Tuple& t) { return t.f6_; } // NOLINT
-
- template <class Tuple>
- static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
- ConstField(const Tuple& t) { return t.f6_; }
-};
-
-template <>
-class Get<7> {
- public:
- template <class Tuple>
- static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
- Field(Tuple& t) { return t.f7_; } // NOLINT
-
- template <class Tuple>
- static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
- ConstField(const Tuple& t) { return t.f7_; }
-};
-
-template <>
-class Get<8> {
- public:
- template <class Tuple>
- static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
- Field(Tuple& t) { return t.f8_; } // NOLINT
-
- template <class Tuple>
- static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
- ConstField(const Tuple& t) { return t.f8_; }
-};
-
-template <>
-class Get<9> {
- public:
- template <class Tuple>
- static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
- Field(Tuple& t) { return t.f9_; } // NOLINT
-
- template <class Tuple>
- static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
- ConstField(const Tuple& t) { return t.f9_; }
-};
-
-} // namespace gtest_internal
-
-template <int k, GTEST_10_TYPENAMES_(T)>
-GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
-get(GTEST_10_TUPLE_(T)& t) {
- return gtest_internal::Get<k>::Field(t);
-}
-
-template <int k, GTEST_10_TYPENAMES_(T)>
-GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
-get(const GTEST_10_TUPLE_(T)& t) {
- return gtest_internal::Get<k>::ConstField(t);
-}
-
-// 6.1.3.5 Relational operators
-
-// We only implement == and !=, as we don't have a need for the rest yet.
-
-namespace gtest_internal {
-
-// SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
-// first k fields of t1 equals the first k fields of t2.
-// SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
-// k1 != k2.
-template <int kSize1, int kSize2>
-struct SameSizeTuplePrefixComparator;
-
-template <>
-struct SameSizeTuplePrefixComparator<0, 0> {
- template <class Tuple1, class Tuple2>
- static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
- return true;
- }
-};
-
-template <int k>
-struct SameSizeTuplePrefixComparator<k, k> {
- template <class Tuple1, class Tuple2>
- static bool Eq(const Tuple1& t1, const Tuple2& t2) {
- return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
- ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
- }
-};
-
-} // namespace gtest_internal
-
-template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
-inline bool operator==(const GTEST_10_TUPLE_(T)& t,
- const GTEST_10_TUPLE_(U)& u) {
- return gtest_internal::SameSizeTuplePrefixComparator<
- tuple_size<GTEST_10_TUPLE_(T)>::value,
- tuple_size<GTEST_10_TUPLE_(U)>::value>::Eq(t, u);
-}
-
-template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
-inline bool operator!=(const GTEST_10_TUPLE_(T)& t,
- const GTEST_10_TUPLE_(U)& u) { return !(t == u); }
-
-// 6.1.4 Pairs.
-// Unimplemented.
-
-} // namespace tr1
-} // namespace std
-
-#undef GTEST_0_TUPLE_
-#undef GTEST_1_TUPLE_
-#undef GTEST_2_TUPLE_
-#undef GTEST_3_TUPLE_
-#undef GTEST_4_TUPLE_
-#undef GTEST_5_TUPLE_
-#undef GTEST_6_TUPLE_
-#undef GTEST_7_TUPLE_
-#undef GTEST_8_TUPLE_
-#undef GTEST_9_TUPLE_
-#undef GTEST_10_TUPLE_
-
-#undef GTEST_0_TYPENAMES_
-#undef GTEST_1_TYPENAMES_
-#undef GTEST_2_TYPENAMES_
-#undef GTEST_3_TYPENAMES_
-#undef GTEST_4_TYPENAMES_
-#undef GTEST_5_TYPENAMES_
-#undef GTEST_6_TYPENAMES_
-#undef GTEST_7_TYPENAMES_
-#undef GTEST_8_TYPENAMES_
-#undef GTEST_9_TYPENAMES_
-#undef GTEST_10_TYPENAMES_
-
-#undef GTEST_DECLARE_TUPLE_AS_FRIEND_
-#undef GTEST_BY_REF_
-#undef GTEST_ADD_REF_
-#undef GTEST_TUPLE_ELEMENT_
-
-#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
diff --git a/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-type-util.h b/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-type-util.h
deleted file mode 100644
index 093eee6..0000000
--- a/contrib/llvm/utils/unittest/googletest/include/gtest/internal/gtest-type-util.h
+++ /dev/null
@@ -1,3321 +0,0 @@
-// This file was GENERATED by command:
-// pump.py gtest-type-util.h.pump
-// DO NOT EDIT BY HAND!!!
-
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * 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.
-// * Neither the name of Google Inc. 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 COPYRIGHT HOLDERS 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 COPYRIGHT
-// OWNER 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.
-//
-// Author: wan@google.com (Zhanyong Wan)
-
-// Type utilities needed for implementing typed and type-parameterized
-// tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
-//
-// Currently we support at most 50 types in a list, and at most 50
-// type-parameterized tests in one type-parameterized test case.
-// Please contact googletestframework@googlegroups.com if you need
-// more.
-
-#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
-#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
-
-#include <gtest/internal/gtest-port.h>
-#include <gtest/internal/gtest-string.h>
-
-#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
-
-// #ifdef __GNUC__ is too general here. It is possible to use gcc without using
-// libstdc++ (which is where cxxabi.h comes from).
-#ifdef __GLIBCXX__
-#include <cxxabi.h>
-#endif // __GLIBCXX__
-
-namespace testing {
-namespace internal {
-
-// AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
-// type. This can be used as a compile-time assertion to ensure that
-// two types are equal.
-
-template <typename T1, typename T2>
-struct AssertTypeEq;
-
-template <typename T>
-struct AssertTypeEq<T, T> {
- typedef bool type;
-};
-
-// GetTypeName<T>() returns a human-readable name of type T.
-template <typename T>
-String GetTypeName() {
-#if GTEST_HAS_RTTI
-
- const char* const name = typeid(T).name();
-#ifdef __GLIBCXX__
- int status = 0;
- // gcc's implementation of typeid(T).name() mangles the type name,
- // so we have to demangle it.
- char* const readable_name = abi::__cxa_demangle(name, 0, 0, &status);
- const String name_str(status == 0 ? readable_name : name);
- free(readable_name);
- return name_str;
-#else
- return name;
-#endif // __GLIBCXX__
-
-#else
- return "<type>";
-#endif // GTEST_HAS_RTTI
-}
-
-// A unique type used as the default value for the arguments of class
-// template Types. This allows us to simulate variadic templates
-// (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
-// support directly.
-struct None {};
-
-// The following family of struct and struct templates are used to
-// represent type lists. In particular, TypesN<T1, T2, ..., TN>
-// represents a type list with N types (T1, T2, ..., and TN) in it.
-// Except for Types0, every struct in the family has two member types:
-// Head for the first type in the list, and Tail for the rest of the
-// list.
-
-// The empty type list.
-struct Types0 {};
-
-// Type lists of length 1, 2, 3, and so on.
-
-template <typename T1>
-struct Types1 {
- typedef T1 Head;
- typedef Types0 Tail;
-};
-template <typename T1, typename T2>
-struct Types2 {
- typedef T1 Head;
- typedef Types1<T2> Tail;
-};
-
-template <typename T1, typename T2, typename T3>
-struct Types3 {
- typedef T1 Head;
- typedef Types2<T2, T3> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4>
-struct Types4 {
- typedef T1 Head;
- typedef Types3<T2, T3, T4> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5>
-struct Types5 {
- typedef T1 Head;
- typedef Types4<T2, T3, T4, T5> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6>
-struct Types6 {
- typedef T1 Head;
- typedef Types5<T2, T3, T4, T5, T6> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7>
-struct Types7 {
- typedef T1 Head;
- typedef Types6<T2, T3, T4, T5, T6, T7> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8>
-struct Types8 {
- typedef T1 Head;
- typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9>
-struct Types9 {
- typedef T1 Head;
- typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10>
-struct Types10 {
- typedef T1 Head;
- typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11>
-struct Types11 {
- typedef T1 Head;
- typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12>
-struct Types12 {
- typedef T1 Head;
- typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13>
-struct Types13 {
- typedef T1 Head;
- typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14>
-struct Types14 {
- typedef T1 Head;
- typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15>
-struct Types15 {
- typedef T1 Head;
- typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16>
-struct Types16 {
- typedef T1 Head;
- typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17>
-struct Types17 {
- typedef T1 Head;
- typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18>
-struct Types18 {
- typedef T1 Head;
- typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19>
-struct Types19 {
- typedef T1 Head;
- typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20>
-struct Types20 {
- typedef T1 Head;
- typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21>
-struct Types21 {
- typedef T1 Head;
- typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22>
-struct Types22 {
- typedef T1 Head;
- typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23>
-struct Types23 {
- typedef T1 Head;
- typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24>
-struct Types24 {
- typedef T1 Head;
- typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25>
-struct Types25 {
- typedef T1 Head;
- typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26>
-struct Types26 {
- typedef T1 Head;
- typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27>
-struct Types27 {
- typedef T1 Head;
- typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28>
-struct Types28 {
- typedef T1 Head;
- typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29>
-struct Types29 {
- typedef T1 Head;
- typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30>
-struct Types30 {
- typedef T1 Head;
- typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31>
-struct Types31 {
- typedef T1 Head;
- typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32>
-struct Types32 {
- typedef T1 Head;
- typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33>
-struct Types33 {
- typedef T1 Head;
- typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34>
-struct Types34 {
- typedef T1 Head;
- typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35>
-struct Types35 {
- typedef T1 Head;
- typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36>
-struct Types36 {
- typedef T1 Head;
- typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37>
-struct Types37 {
- typedef T1 Head;
- typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38>
-struct Types38 {
- typedef T1 Head;
- typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39>
-struct Types39 {
- typedef T1 Head;
- typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40>
-struct Types40 {
- typedef T1 Head;
- typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41>
-struct Types41 {
- typedef T1 Head;
- typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42>
-struct Types42 {
- typedef T1 Head;
- typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43>
-struct Types43 {
- typedef T1 Head;
- typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
- T43> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44>
-struct Types44 {
- typedef T1 Head;
- typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45>
-struct Types45 {
- typedef T1 Head;
- typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46>
-struct Types46 {
- typedef T1 Head;
- typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45, T46> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47>
-struct Types47 {
- typedef T1 Head;
- typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45, T46, T47> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47, typename T48>
-struct Types48 {
- typedef T1 Head;
- typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45, T46, T47, T48> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47, typename T48, typename T49>
-struct Types49 {
- typedef T1 Head;
- typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45, T46, T47, T48, T49> Tail;
-};
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47, typename T48, typename T49, typename T50>
-struct Types50 {
- typedef T1 Head;
- typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45, T46, T47, T48, T49, T50> Tail;
-};
-
-
-} // namespace internal
-
-// We don't want to require the users to write TypesN<...> directly,
-// as that would require them to count the length. Types<...> is much
-// easier to write, but generates horrible messages when there is a
-// compiler error, as gcc insists on printing out each template
-// argument, even if it has the default value (this means Types<int>
-// will appear as Types<int, None, None, ..., None> in the compiler
-// errors).
-//
-// Our solution is to combine the best part of the two approaches: a
-// user would write Types<T1, ..., TN>, and Google Test will translate
-// that to TypesN<T1, ..., TN> internally to make error messages
-// readable. The translation is done by the 'type' member of the
-// Types template.
-template <typename T1 = internal::None, typename T2 = internal::None,
- typename T3 = internal::None, typename T4 = internal::None,
- typename T5 = internal::None, typename T6 = internal::None,
- typename T7 = internal::None, typename T8 = internal::None,
- typename T9 = internal::None, typename T10 = internal::None,
- typename T11 = internal::None, typename T12 = internal::None,
- typename T13 = internal::None, typename T14 = internal::None,
- typename T15 = internal::None, typename T16 = internal::None,
- typename T17 = internal::None, typename T18 = internal::None,
- typename T19 = internal::None, typename T20 = internal::None,
- typename T21 = internal::None, typename T22 = internal::None,
- typename T23 = internal::None, typename T24 = internal::None,
- typename T25 = internal::None, typename T26 = internal::None,
- typename T27 = internal::None, typename T28 = internal::None,
- typename T29 = internal::None, typename T30 = internal::None,
- typename T31 = internal::None, typename T32 = internal::None,
- typename T33 = internal::None, typename T34 = internal::None,
- typename T35 = internal::None, typename T36 = internal::None,
- typename T37 = internal::None, typename T38 = internal::None,
- typename T39 = internal::None, typename T40 = internal::None,
- typename T41 = internal::None, typename T42 = internal::None,
- typename T43 = internal::None, typename T44 = internal::None,
- typename T45 = internal::None, typename T46 = internal::None,
- typename T47 = internal::None, typename T48 = internal::None,
- typename T49 = internal::None, typename T50 = internal::None>
-struct Types {
- typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
-};
-
-template <>
-struct Types<internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types0 type;
-};
-template <typename T1>
-struct Types<T1, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types1<T1> type;
-};
-template <typename T1, typename T2>
-struct Types<T1, T2, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None> {
- typedef internal::Types2<T1, T2> type;
-};
-template <typename T1, typename T2, typename T3>
-struct Types<T1, T2, T3, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None> {
- typedef internal::Types3<T1, T2, T3> type;
-};
-template <typename T1, typename T2, typename T3, typename T4>
-struct Types<T1, T2, T3, T4, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None> {
- typedef internal::Types4<T1, T2, T3, T4> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5>
-struct Types<T1, T2, T3, T4, T5, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None> {
- typedef internal::Types5<T1, T2, T3, T4, T5> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6>
-struct Types<T1, T2, T3, T4, T5, T6, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7>
-struct Types<T1, T2, T3, T4, T5, T6, T7, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None> {
- typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None> {
- typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None> {
- typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None> {
- typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None> {
- typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
- T12> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None> {
- typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None> {
- typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None> {
- typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None> {
- typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None> {
- typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None> {
- typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None> {
- typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None> {
- typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None> {
- typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None> {
- typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None> {
- typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None> {
- typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
- T26> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None> {
- typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None> {
- typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None> {
- typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None> {
- typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None> {
- typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None> {
- typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None> {
- typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None> {
- typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
- T40> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None, internal::None> {
- typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None> {
- typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41, T42> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None, internal::None> {
- typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41, T42, T43> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
- internal::None, internal::None, internal::None, internal::None,
- internal::None, internal::None> {
- typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41, T42, T43, T44> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
- internal::None, internal::None, internal::None, internal::None,
- internal::None> {
- typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41, T42, T43, T44, T45> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
- T46, internal::None, internal::None, internal::None, internal::None> {
- typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41, T42, T43, T44, T45, T46> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
- T46, T47, internal::None, internal::None, internal::None> {
- typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41, T42, T43, T44, T45, T46, T47> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47, typename T48>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
- T46, T47, T48, internal::None, internal::None> {
- typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41, T42, T43, T44, T45, T46, T47, T48> type;
-};
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47, typename T48, typename T49>
-struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
- T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
- T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
- T46, T47, T48, T49, internal::None> {
- typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41, T42, T43, T44, T45, T46, T47, T48, T49> type;
-};
-
-namespace internal {
-
-#define GTEST_TEMPLATE_ template <typename T> class
-
-// The template "selector" struct TemplateSel<Tmpl> is used to
-// represent Tmpl, which must be a class template with one type
-// parameter, as a type. TemplateSel<Tmpl>::Bind<T>::type is defined
-// as the type Tmpl<T>. This allows us to actually instantiate the
-// template "selected" by TemplateSel<Tmpl>.
-//
-// This trick is necessary for simulating typedef for class templates,
-// which C++ doesn't support directly.
-template <GTEST_TEMPLATE_ Tmpl>
-struct TemplateSel {
- template <typename T>
- struct Bind {
- typedef Tmpl<T> type;
- };
-};
-
-#define GTEST_BIND_(TmplSel, T) \
- TmplSel::template Bind<T>::type
-
-// A unique struct template used as the default value for the
-// arguments of class template Templates. This allows us to simulate
-// variadic templates (e.g. Templates<int>, Templates<int, double>,
-// and etc), which C++ doesn't support directly.
-template <typename T>
-struct NoneT {};
-
-// The following family of struct and struct templates are used to
-// represent template lists. In particular, TemplatesN<T1, T2, ...,
-// TN> represents a list of N templates (T1, T2, ..., and TN). Except
-// for Templates0, every struct in the family has two member types:
-// Head for the selector of the first template in the list, and Tail
-// for the rest of the list.
-
-// The empty template list.
-struct Templates0 {};
-
-// Template lists of length 1, 2, 3, and so on.
-
-template <GTEST_TEMPLATE_ T1>
-struct Templates1 {
- typedef TemplateSel<T1> Head;
- typedef Templates0 Tail;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
-struct Templates2 {
- typedef TemplateSel<T1> Head;
- typedef Templates1<T2> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
-struct Templates3 {
- typedef TemplateSel<T1> Head;
- typedef Templates2<T2, T3> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4>
-struct Templates4 {
- typedef TemplateSel<T1> Head;
- typedef Templates3<T2, T3, T4> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
-struct Templates5 {
- typedef TemplateSel<T1> Head;
- typedef Templates4<T2, T3, T4, T5> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
-struct Templates6 {
- typedef TemplateSel<T1> Head;
- typedef Templates5<T2, T3, T4, T5, T6> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7>
-struct Templates7 {
- typedef TemplateSel<T1> Head;
- typedef Templates6<T2, T3, T4, T5, T6, T7> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
-struct Templates8 {
- typedef TemplateSel<T1> Head;
- typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
-struct Templates9 {
- typedef TemplateSel<T1> Head;
- typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10>
-struct Templates10 {
- typedef TemplateSel<T1> Head;
- typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
-struct Templates11 {
- typedef TemplateSel<T1> Head;
- typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
-struct Templates12 {
- typedef TemplateSel<T1> Head;
- typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13>
-struct Templates13 {
- typedef TemplateSel<T1> Head;
- typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
-struct Templates14 {
- typedef TemplateSel<T1> Head;
- typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
-struct Templates15 {
- typedef TemplateSel<T1> Head;
- typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16>
-struct Templates16 {
- typedef TemplateSel<T1> Head;
- typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
-struct Templates17 {
- typedef TemplateSel<T1> Head;
- typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
-struct Templates18 {
- typedef TemplateSel<T1> Head;
- typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19>
-struct Templates19 {
- typedef TemplateSel<T1> Head;
- typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
-struct Templates20 {
- typedef TemplateSel<T1> Head;
- typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
-struct Templates21 {
- typedef TemplateSel<T1> Head;
- typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22>
-struct Templates22 {
- typedef TemplateSel<T1> Head;
- typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
-struct Templates23 {
- typedef TemplateSel<T1> Head;
- typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
-struct Templates24 {
- typedef TemplateSel<T1> Head;
- typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25>
-struct Templates25 {
- typedef TemplateSel<T1> Head;
- typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
-struct Templates26 {
- typedef TemplateSel<T1> Head;
- typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
-struct Templates27 {
- typedef TemplateSel<T1> Head;
- typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28>
-struct Templates28 {
- typedef TemplateSel<T1> Head;
- typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
-struct Templates29 {
- typedef TemplateSel<T1> Head;
- typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
-struct Templates30 {
- typedef TemplateSel<T1> Head;
- typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31>
-struct Templates31 {
- typedef TemplateSel<T1> Head;
- typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
-struct Templates32 {
- typedef TemplateSel<T1> Head;
- typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
-struct Templates33 {
- typedef TemplateSel<T1> Head;
- typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34>
-struct Templates34 {
- typedef TemplateSel<T1> Head;
- typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
-struct Templates35 {
- typedef TemplateSel<T1> Head;
- typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
-struct Templates36 {
- typedef TemplateSel<T1> Head;
- typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37>
-struct Templates37 {
- typedef TemplateSel<T1> Head;
- typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
-struct Templates38 {
- typedef TemplateSel<T1> Head;
- typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
-struct Templates39 {
- typedef TemplateSel<T1> Head;
- typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40>
-struct Templates40 {
- typedef TemplateSel<T1> Head;
- typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
-struct Templates41 {
- typedef TemplateSel<T1> Head;
- typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
-struct Templates42 {
- typedef TemplateSel<T1> Head;
- typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
- T42> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43>
-struct Templates43 {
- typedef TemplateSel<T1> Head;
- typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
- T43> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
-struct Templates44 {
- typedef TemplateSel<T1> Head;
- typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
- T43, T44> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
-struct Templates45 {
- typedef TemplateSel<T1> Head;
- typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
- T43, T44, T45> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
- GTEST_TEMPLATE_ T46>
-struct Templates46 {
- typedef TemplateSel<T1> Head;
- typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
- T43, T44, T45, T46> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
- GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
-struct Templates47 {
- typedef TemplateSel<T1> Head;
- typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
- T43, T44, T45, T46, T47> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
- GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
-struct Templates48 {
- typedef TemplateSel<T1> Head;
- typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
- T43, T44, T45, T46, T47, T48> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
- GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
- GTEST_TEMPLATE_ T49>
-struct Templates49 {
- typedef TemplateSel<T1> Head;
- typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
- T43, T44, T45, T46, T47, T48, T49> Tail;
-};
-
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
- GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
- GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>
-struct Templates50 {
- typedef TemplateSel<T1> Head;
- typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
- T43, T44, T45, T46, T47, T48, T49, T50> Tail;
-};
-
-
-// We don't want to require the users to write TemplatesN<...> directly,
-// as that would require them to count the length. Templates<...> is much
-// easier to write, but generates horrible messages when there is a
-// compiler error, as gcc insists on printing out each template
-// argument, even if it has the default value (this means Templates<list>
-// will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
-// errors).
-//
-// Our solution is to combine the best part of the two approaches: a
-// user would write Templates<T1, ..., TN>, and Google Test will translate
-// that to TemplatesN<T1, ..., TN> internally to make error messages
-// readable. The translation is done by the 'type' member of the
-// Templates template.
-template <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,
- GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,
- GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,
- GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,
- GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,
- GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,
- GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,
- GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,
- GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,
- GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,
- GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,
- GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,
- GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,
- GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,
- GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,
- GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,
- GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,
- GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,
- GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,
- GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,
- GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,
- GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,
- GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,
- GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,
- GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>
-struct Templates {
- typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
- T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
-};
-
-template <>
-struct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT> {
- typedef Templates0 type;
-};
-template <GTEST_TEMPLATE_ T1>
-struct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT> {
- typedef Templates1<T1> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
-struct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT> {
- typedef Templates2<T1, T2> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
-struct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates3<T1, T2, T3> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4>
-struct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates4<T1, T2, T3, T4> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
-struct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates5<T1, T2, T3, T4, T5> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
-struct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates6<T1, T2, T3, T4, T5, T6> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT> {
- typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT> {
- typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT> {
- typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT> {
- typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT> {
- typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT> {
- typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT> {
- typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT> {
- typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT> {
- typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT> {
- typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT> {
- typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT> {
- typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
- T42> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
- T42, T43> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
- NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
- T42, T43, T44> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
- T45, NoneT, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
- T42, T43, T44, T45> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
- GTEST_TEMPLATE_ T46>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
- T45, T46, NoneT, NoneT, NoneT, NoneT> {
- typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
- T42, T43, T44, T45, T46> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
- GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
- T45, T46, T47, NoneT, NoneT, NoneT> {
- typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
- T42, T43, T44, T45, T46, T47> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
- GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
- T45, T46, T47, T48, NoneT, NoneT> {
- typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
- T42, T43, T44, T45, T46, T47, T48> type;
-};
-template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
- GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
- GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
- GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
- GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
- GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
- GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
- GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
- GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
- GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
- GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
- GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
- GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
- GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
- GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
- GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
- GTEST_TEMPLATE_ T49>
-struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
- T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
- T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
- T45, T46, T47, T48, T49, NoneT> {
- typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
- T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
- T42, T43, T44, T45, T46, T47, T48, T49> type;
-};
-
-// The TypeList template makes it possible to use either a single type
-// or a Types<...> list in TYPED_TEST_CASE() and
-// INSTANTIATE_TYPED_TEST_CASE_P().
-
-template <typename T>
-struct TypeList { typedef Types1<T> type; };
-
-template <typename T1, typename T2, typename T3, typename T4, typename T5,
- typename T6, typename T7, typename T8, typename T9, typename T10,
- typename T11, typename T12, typename T13, typename T14, typename T15,
- typename T16, typename T17, typename T18, typename T19, typename T20,
- typename T21, typename T22, typename T23, typename T24, typename T25,
- typename T26, typename T27, typename T28, typename T29, typename T30,
- typename T31, typename T32, typename T33, typename T34, typename T35,
- typename T36, typename T37, typename T38, typename T39, typename T40,
- typename T41, typename T42, typename T43, typename T44, typename T45,
- typename T46, typename T47, typename T48, typename T49, typename T50>
-struct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
- T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
- T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
- T44, T45, T46, T47, T48, T49, T50> > {
- typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
- T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
- T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
- T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;
-};
-
-} // namespace internal
-} // namespace testing
-
-#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
-
-#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
diff --git a/contrib/llvm/utils/valgrind/i386-pc-linux-gnu.supp b/contrib/llvm/utils/valgrind/i386-pc-linux-gnu.supp
deleted file mode 100644
index c9f68a0..0000000
--- a/contrib/llvm/utils/valgrind/i386-pc-linux-gnu.supp
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- False leak under RegisterPass
- Memcheck:Leak
- ...
- fun:_ZN83_GLOBAL_*PassRegistrar12RegisterPassERKN4llvm8PassInfoE
- fun:_ZN4llvm8PassInfo12registerPassEv
-}
-
-# Python false positives according to
-# http://svn.python.org/projects/python/trunk/Misc/README.valgrind
-
-{
- ADDRESS_IN_RANGE/Invalid read of size 4
- Memcheck:Addr4
- obj:/usr/bin/python2.5
-}
-
-{
- ADDRESS_IN_RANGE/Invalid read of size 4
- Memcheck:Value4
- obj:/usr/bin/python2.5
-}
-
-{
- ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
- Memcheck:Cond
- obj:/usr/bin/python2.5
-}
-
-{
- We don't care if as leaks
- Memcheck:Leak
- obj:/usr/bin/as
-}
-
-{
- We don't care if python leaks
- Memcheck:Leak
- fun:malloc
- obj:/usr/bin/python2.5
-}
diff --git a/contrib/llvm/utils/valgrind/x86_64-pc-linux-gnu.supp b/contrib/llvm/utils/valgrind/x86_64-pc-linux-gnu.supp
deleted file mode 100644
index f5aae99..0000000
--- a/contrib/llvm/utils/valgrind/x86_64-pc-linux-gnu.supp
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- False leak under RegisterPass
- Memcheck:Leak
- ...
- fun:_ZN4llvm12PassRegistry12registerPassERKNS_8PassInfoE
-}
-
-# Python false positives according to
-# http://svn.python.org/projects/python/trunk/Misc/README.valgrind
-
-{
- ADDRESS_IN_RANGE/Invalid read of size 4
- Memcheck:Addr4
- obj:/usr/bin/python2.5
-}
-
-{
- ADDRESS_IN_RANGE/Invalid read of size 4
- Memcheck:Value8
- obj:/usr/bin/python2.5
-}
-
-{
- ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
- Memcheck:Cond
- obj:/usr/bin/python2.5
-}
-
-{
- We don't care if as leaks
- Memcheck:Leak
- obj:/usr/bin/as
-}
-
-{
- We don't care if grep leaks
- Memcheck:Leak
- obj:/bin/grep
-}
-
-{
- We don't care if python leaks
- Memcheck:Leak
- fun:malloc
- obj:/usr/bin/python2.5
-}
diff --git a/contrib/llvm/utils/vim/README b/contrib/llvm/utils/vim/README
deleted file mode 100644
index bca25bf..0000000
--- a/contrib/llvm/utils/vim/README
+++ /dev/null
@@ -1,43 +0,0 @@
--*- llvm/utils/vim/README -*-
-
-These are syntax highlighting files for the VIM editor. Included are:
-
-* llvm.vim
-
- Syntax highlighting mode for LLVM assembly files. To use, copy `llvm.vim' to
- ~/.vim/syntax and add this code to your ~/.vimrc :
-
- augroup filetype
- au! BufRead,BufNewFile *.ll set filetype=llvm
- augroup END
-
-* tablegen.vim
-
- Syntax highlighting mode for TableGen description files. To use, copy
- `tablegen.vim' to ~/.vim/syntax and add this code to your ~/.vimrc :
-
- augroup filetype
- au! BufRead,BufNewFile *.td set filetype=tablegen
- augroup END
-
-
-If you prefer, instead of making copies you can make symlinks from
-~/.vim/syntax/... to the syntax files in your LLVM source tree. Apparently
-this did not work with older versions of vim however, so if this doesn't
-work you may need to make actual copies of the files.
-
-Another option, if you do not already have a ~/.vim/syntax directory, is
-to symlink ~/.vim/syntax itself to llvm/utils/vim .
-
-Note: If you notice missing or incorrect syntax highlighting, please contact
-<llvmbugs [at] cs.uiuc.edu>; if you wish to provide a patch to improve the
-functionality, it will be most appreciated. Thank you.
-
-If you find yourself working with LLVM Makefiles often, but you don't get syntax
-highlighting (because the files have names such as Makefile.rules or
-TEST.nightly.Makefile), add the following to your ~/.vimrc:
-
- " LLVM Makefile highlighting mode
- augroup filetype
- au! BufRead,BufNewFile *Makefile* set filetype=make
- augroup END
diff --git a/contrib/llvm/utils/vim/llvm.vim b/contrib/llvm/utils/vim/llvm.vim
deleted file mode 100644
index acebc20..0000000
--- a/contrib/llvm/utils/vim/llvm.vim
+++ /dev/null
@@ -1,109 +0,0 @@
-" Vim syntax file
-" Language: llvm
-" Maintainer: The LLVM team, http://llvm.org/
-" Version: $Revision: 112382 $
-
-if version < 600
- syntax clear
-elseif exists("b:current_syntax")
- finish
-endif
-
-syn case match
-
-" Types.
-" Types also include struct, array, vector, etc. but these don't
-" benefit as much from having dedicated highlighting rules.
-syn keyword llvmType void float double
-syn keyword llvmType x86_fp80 fp128 ppc_fp128
-syn keyword llvmType type label opaque
-syn match llvmType /\<i\d\+\>/
-
-" Instructions.
-" The true and false tokens can be used for comparison opcodes, but it's
-" much more common for these tokens to be used for boolean constants.
-syn keyword llvmStatement add fadd sub fsub mul fmul
-syn keyword llvmStatement sdiv udiv fdiv srem urem frem
-syn keyword llvmStatement and or xor
-syn keyword llvmStatement icmp fcmp
-syn keyword llvmStatement eq ne ugt uge ult ule sgt sge slt sle
-syn keyword llvmStatement oeq ogt oge olt ole one ord ueq ugt uge
-syn keyword llvmStatement ult ule une uno
-syn keyword llvmStatement nuw nsw exact inbounds
-syn keyword llvmStatement phi call select shl lshr ashr va_arg
-syn keyword llvmStatement trunc zext sext
-syn keyword llvmStatement fptrunc fpext fptoui fptosi uitofp sitofp
-syn keyword llvmStatement ptrtoint inttoptr bitcast
-syn keyword llvmStatement ret br indirectbr switch invoke unwind unreachable
-syn keyword llvmStatement malloc alloca free load store getelementptr
-syn keyword llvmStatement extractelement insertelement shufflevector
-syn keyword llvmStatement extractvalue insertvalue
-
-" Keywords.
-syn keyword llvmKeyword define declare global constant
-syn keyword llvmKeyword internal external private
-syn keyword llvmKeyword linkonce linkonce_odr weak weak_odr appending
-syn keyword llvmKeyword common extern_weak
-syn keyword llvmKeyword thread_local dllimport dllexport
-syn keyword llvmKeyword hidden protected default
-syn keyword llvmKeyword except deplibs
-syn keyword llvmKeyword volatile fastcc coldcc cc ccc
-syn keyword llvmKeyword x86_stdcallcc x86_fastcallcc
-syn keyword llvmKeyword signext zeroext inreg sret nounwind noreturn
-syn keyword llvmKeyword nocapture byval nest readnone readonly noalias
-syn keyword llvmKeyword inlinehint noinline alwaysinline optsize ssp sspreq
-syn keyword llvmKeyword noredzone noimplicitfloat naked alignstack
-syn keyword llvmKeyword module asm align tail to
-syn keyword llvmKeyword addrspace section alias sideeffect c gc
-syn keyword llvmKeyword target datalayout triple
-syn keyword llvmKeyword blockaddress
-
-" Obsolete keywords.
-syn keyword llvmError getresult begin end
-
-" Misc syntax.
-syn match llvmNoName /[%@]\d\+\>/
-syn match llvmNumber /-\?\<\d\+\>/
-syn match llvmFloat /-\?\<\d\+\.\d*\(e[+-]\d\+\)\?\>/
-syn match llvmFloat /\<0x\x\+\>/
-syn keyword llvmBoolean true false
-syn keyword llvmConstant zeroinitializer undef null
-syn match llvmComment /;.*$/
-syn region llvmString start=/"/ skip=/\\"/ end=/"/
-syn match llvmLabel /[-a-zA-Z$._][-a-zA-Z$._0-9]*:/
-syn match llvmIdentifier /[%@][-a-zA-Z$._][-a-zA-Z$._0-9]*/
-
-" Syntax-highlight dejagnu test commands.
-syn match llvmSpecialComment /;\s*RUN:.*$/
-syn match llvmSpecialComment /;\s*PR\d*\s*$/
-syn match llvmSpecialComment /;\s*END\.\s*$/
-syn match llvmSpecialComment /;\s*XFAIL:.*$/
-syn match llvmSpecialComment /;\s*XTARGET:.*$/
-
-if version >= 508 || !exists("did_c_syn_inits")
- if version < 508
- let did_c_syn_inits = 1
- command -nargs=+ HiLink hi link <args>
- else
- command -nargs=+ HiLink hi def link <args>
- endif
-
- HiLink llvmType Type
- HiLink llvmStatement Statement
- HiLink llvmNumber Number
- HiLink llvmComment Comment
- HiLink llvmString String
- HiLink llvmLabel Label
- HiLink llvmKeyword Keyword
- HiLink llvmBoolean Boolean
- HiLink llvmFloat Float
- HiLink llvmNoName Identifier
- HiLink llvmConstant Constant
- HiLink llvmSpecialComment SpecialComment
- HiLink llvmError Error
- HiLink llvmIdentifier Identifier
-
- delcommand HiLink
-endif
-
-let b:current_syntax = "llvm"
diff --git a/contrib/llvm/utils/vim/tablegen.vim b/contrib/llvm/utils/vim/tablegen.vim
deleted file mode 100644
index 11a4d80..0000000
--- a/contrib/llvm/utils/vim/tablegen.vim
+++ /dev/null
@@ -1,54 +0,0 @@
-" Vim syntax file
-" Language: TableGen
-" Maintainer: The LLVM team, http://llvm.org/
-" Version: $Revision: 97271 $
-
-if version < 600
- syntax clear
-elseif exists("b:current_syntax")
- finish
-endif
-
-" May be changed if you have a really slow machine
-syntax sync minlines=100
-
-syn case match
-
-syn keyword tgKeyword def let in code dag field include defm
-syn keyword tgType class int string list bit bits multiclass
-
-syn match tgNumber /\<\d\+\>/
-syn match tgNumber /\<\d\+\.\d*\>/
-syn match tgNumber /\<0b[01]\+\>/
-syn match tgNumber /\<0x[0-9a-fA-F]\+\>/
-syn region tgString start=/"/ skip=/\\"/ end=/"/ oneline
-
-syn region tgCode start=/\[{/ end=/}\]/
-
-syn keyword tgTodo contained TODO FIXME
-syn match tgComment /\/\/.*$/ contains=tgTodo
-" Handle correctly imbricated comment
-syn region tgComment2 matchgroup=tgComment2 start=+/\*+ end=+\*/+ contains=tgTodo,tgComment2
-
-if version >= 508 || !exists("did_c_syn_inits")
- if version < 508
- let did_c_syn_inits = 1
- command -nargs=+ HiLink hi link <args>
- else
- command -nargs=+ HiLink hi def link <args>
- endif
-
- HiLink tgKeyword Statement
- HiLink tgType Type
- HiLink tgNumber Number
- HiLink tgComment Comment
- HiLink tgComment2 Comment
- HiLink tgString String
- " May find a better Hilight group...
- HiLink tgCode Special
- HiLink tgTodo Todo
-
- delcommand HiLink
-endif
-
-let b:current_syntax = "tablegen"
diff --git a/contrib/llvm/utils/vim/vimrc b/contrib/llvm/utils/vim/vimrc
deleted file mode 100644
index 1f314c2..0000000
--- a/contrib/llvm/utils/vim/vimrc
+++ /dev/null
@@ -1,220 +0,0 @@
-" LLVM coding guidelines conformance for VIM
-" $Revision: 112982 $
-"
-" Maintainer: The LLVM Team, http://llvm.org
-" WARNING: Read before you source in all these commands and macros! Some
-" of them may change VIM behavior that you depend on.
-"
-" You can run VIM with these settings without changing your current setup with:
-" $ vim -u /path/to/llvm/utils/vim/vimrc
-
-" It's VIM, not VI
-set nocompatible
-
-" A tab produces a 2-space indentation
-set softtabstop=2
-set shiftwidth=2
-set expandtab
-
-" Highlight trailing whitespace and lines longer than 80 columns.
-highlight LongLine ctermbg=DarkYellow guibg=DarkYellow
-highlight WhitespaceEOL ctermbg=DarkYellow guibg=DarkYellow
-if v:version >= 702
- " Lines longer than 80 columns.
- au BufWinEnter * let w:m0=matchadd('LongLine', '\%>80v.\+', -1)
-
- " Whitespace at the end of a line. This little dance suppresses
- " whitespace that has just been typed.
- au BufWinEnter * let w:m1=matchadd('WhitespaceEOL', '\s\+$', -1)
- au InsertEnter * call matchdelete(w:m1)
- au InsertEnter * let w:m2=matchadd('WhitespaceEOL', '\s\+\%#\@<!$', -1)
- au InsertLeave * call matchdelete(w:m2)
- au InsertLeave * let w:m1=matchadd('WhitespaceEOL', '\s\+$', -1)
-else
- au BufRead,BufNewFile * syntax match LongLine /\%>80v.\+/
- au InsertEnter * syntax match WhitespaceEOL /\s\+\%#\@<!$/
- au InsertLeave * syntax match WhitespaceEOL /\s\+$/
-endif
-
-" Enable filetype detection
-filetype on
-
-" Optional
-" C/C++ programming helpers
-augroup csrc
- au!
- autocmd FileType * set nocindent smartindent
- autocmd FileType c,cpp set cindent
-augroup END
-" Set a few indentation parameters. See the VIM help for cinoptions-values for
-" details. These aren't absolute rules; they're just an approximation of
-" common style in LLVM source.
-set cinoptions=:0,g0,(0,Ws,l1
-" Add and delete spaces in increments of `shiftwidth' for tabs
-set smarttab
-
-" Highlight syntax in programming languages
-syntax on
-
-" LLVM Makefiles can have names such as Makefile.rules or TEST.nightly.Makefile,
-" so it's important to categorize them as such.
-augroup filetype
- au! BufRead,BufNewFile *Makefile* set filetype=make
-augroup END
-
-" In Makefiles, don't expand tabs to spaces, since we need the actual tabs
-autocmd FileType make set noexpandtab
-
-" Useful macros for cleaning up code to conform to LLVM coding guidelines
-
-" Delete trailing whitespace and tabs at the end of each line
-command! DeleteTrailingWs :%s/\s\+$//
-
-" Convert all tab characters to two spaces
-command! Untab :%s/\t/ /g
-
-" Enable syntax highlighting for LLVM files. To use, copy
-" utils/vim/llvm.vim to ~/.vim/syntax .
-augroup filetype
- au! BufRead,BufNewFile *.ll set filetype=llvm
-augroup END
-
-" Enable syntax highlighting for tablegen files. To use, copy
-" utils/vim/tablegen.vim to ~/.vim/syntax .
-augroup filetype
- au! BufRead,BufNewFile *.td set filetype=tablegen
-augroup END
-
-" Additional vim features to optionally uncomment.
-"set showcmd
-"set showmatch
-"set showmode
-"set incsearch
-"set ruler
-
-" Clang code-completion support. This is highly experimental!
-
-" A path to a clang executable.
-let g:clang_path = "clang++"
-
-" A list of options to add to the clang commandline, for example to add
-" include paths, predefined macros, and language options.
-let g:clang_opts = [
- \ "-x","c++",
- \ "-D__STDC_LIMIT_MACROS=1","-D__STDC_CONSTANT_MACROS=1",
- \ "-Iinclude" ]
-
-function! ClangComplete(findstart, base)
- if a:findstart == 1
- " In findstart mode, look for the beginning of the current identifier.
- let l:line = getline('.')
- let l:start = col('.') - 1
- while l:start > 0 && l:line[l:start - 1] =~ '\i'
- let l:start -= 1
- endwhile
- return l:start
- endif
-
- " Get the current line and column numbers.
- let l:l = line('.')
- let l:c = col('.')
-
- " Build a clang commandline to do code completion on stdin.
- let l:the_command = shellescape(g:clang_path) .
- \ " -cc1 -code-completion-at=-:" . l:l . ":" . l:c
- for l:opt in g:clang_opts
- let l:the_command .= " " . shellescape(l:opt)
- endfor
-
- " Copy the contents of the current buffer into a string for stdin.
- " TODO: The extra space at the end is for working around clang's
- " apparent inability to do code completion at the very end of the
- " input.
- " TODO: Is it better to feed clang the entire file instead of truncating
- " it at the current line?
- let l:process_input = join(getline(1, l:l), "\n") . " "
-
- " Run it!
- let l:input_lines = split(system(l:the_command, l:process_input), "\n")
-
- " Parse the output.
- for l:input_line in l:input_lines
- " Vim's substring operator is annoyingly inconsistent with python's.
- if l:input_line[:11] == 'COMPLETION: '
- let l:value = l:input_line[12:]
-
- " Chop off anything after " : ", if present, and move it to the menu.
- let l:menu = ""
- let l:spacecolonspace = stridx(l:value, " : ")
- if l:spacecolonspace != -1
- let l:menu = l:value[l:spacecolonspace+3:]
- let l:value = l:value[:l:spacecolonspace-1]
- endif
-
- " Chop off " (Hidden)", if present, and move it to the menu.
- let l:hidden = stridx(l:value, " (Hidden)")
- if l:hidden != -1
- let l:menu .= " (Hidden)"
- let l:value = l:value[:l:hidden-1]
- endif
-
- " Handle "Pattern". TODO: Make clang less weird.
- if l:value == "Pattern"
- let l:value = l:menu
- let l:pound = stridx(l:value, "#")
- " Truncate the at the first [#, <#, or {#.
- if l:pound != -1
- let l:value = l:value[:l:pound-2]
- endif
- endif
-
- " Filter out results which don't match the base string.
- if a:base != ""
- if l:value[:strlen(a:base)-1] != a:base
- continue
- end
- endif
-
- " TODO: Don't dump the raw input into info, though it's nice for now.
- " TODO: The kind string?
- let l:item = {
- \ "word": l:value,
- \ "menu": l:menu,
- \ "info": l:input_line,
- \ "dup": 1 }
-
- " Report a result.
- if complete_add(l:item) == 0
- return []
- endif
- if complete_check()
- return []
- endif
-
- elseif l:input_line[:9] == "OVERLOAD: "
- " An overload candidate. Use a crazy hack to get vim to
- " display the results. TODO: Make this better.
- let l:value = l:input_line[10:]
- let l:item = {
- \ "word": " ",
- \ "menu": l:value,
- \ "info": l:input_line,
- \ "dup": 1}
-
- " Report a result.
- if complete_add(l:item) == 0
- return []
- endif
- if complete_check()
- return []
- endif
-
- endif
- endfor
-
-
- return []
-endfunction ClangComplete
-
-" Uncomment this to enable the highly-broken autocompletion support.
-"set omnifunc=ClangComplete
diff --git a/contrib/llvm/utils/webNLT.pl b/contrib/llvm/utils/webNLT.pl
deleted file mode 100755
index fb29fd2..0000000
--- a/contrib/llvm/utils/webNLT.pl
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/usr/bin/perl
-
-use DBI;
-use CGI;
-
-$q = new CGI;
-print $q->header();
-print $q->start_html(-title=>"Nightly Tester DB");
-
-unless($q->param('pwd'))
- {
- print $q->startform();
- print $q->password_field(-name=>"pwd", -size=>20, -maxlength=>20);
- print $q->submit();
- print $q->endform();
- }
-else
- {
- # database information
- $db="llvmalpha";
- $host="localhost";
- $userid="llvmdbuser";
- $passwd=$q->param('pwd');
- $connectionInfo="dbi:mysql:$db;$host";
-
- # make connection to database
- $dbh = DBI->connect($connectionInfo,$userid,$passwd) or die DBI->errstr;
- $query = "Select DISTINCT(NAME) from Tests";
- my $sth = $dbh->prepare($query) || die "Can't prepare statement: $DBI::errstr";
- my $rc = $sth->execute or die DBI->errstr;
- while (($n) = $sth->fetchrow_array)
- {
- push @names, ($n);
-# print "$n<P>";
- }
- $query = "Select DISTINCT(TEST) from Tests";
- my $sth = $dbh->prepare($query) || die "Can't prepare statement: $DBI::errstr";
- my $rc = $sth->execute or die DBI->errstr;
- while (($n) = $sth->fetchrow_array)
- {
- push @tests, ($n);
-# print "$n\n";
- }
-
-# print join "<BR>", @names;
-
- print $q->startform();
- print $q->scrolling_list(-name=>"test", -values=>\@tests, -multiple=>'true');
- print "<P>";
- print $q->scrolling_list(-name=>"name", -values=>\@names, -multiple=>'true');
- print "<P>";
- print $q->submit();
- print $q->hidden("pwd", $q->param('pwd'));
- print $q->endform();
-
- # disconnect from database
- $dbh->disconnect;
-
- #now generate the urls to the chart
- if ($q->param('test') && $q->param('name'))
- {
- my @names = $q->param('name');
- my @tests = $q->param('test');
- print "<P>";
- print join "<BR>", @names;
- print "<P>";
- print join "<BR>", @tests;
- print "<P>";
- $str = "pwd=" . $q->param('pwd');
- $count = 0;
- foreach $n (@names)
- {
- foreach $t (@tests)
- {
- $str = "$str&t$count=$t&n$count=$n";
- $count++;
- }
- }
- print "<img src=\"cgiplotNLT.pl?$str\">";
- }
- }
-
-print $q->end_html();
OpenPOWER on IntegriCloud