From 18f153bdb9db52e7089a2d5293b96c45a3124a26 Mon Sep 17 00:00:00 2001
From: Ed Schouten
Date: Sat, 4 Jul 2009 13:58:26 +0000
Subject: Import LLVM 74788.
---
Makefile.config.in | 13 +-
Makefile.rules | 21 +-
autoconf/configure.ac | 38 +-
cmake/config-ix.cmake | 7 +-
configure | 112 +-
docs/CodingStandards.html | 65 +-
docs/CompilerDriver.html | 29 +-
docs/FAQ.html | 143 ++-
docs/ReleaseNotes-2.6.html | 11 +-
docs/TableGenFundamentals.html | 5 +-
docs/WritingAnLLVMPass.html | 15 +-
examples/BrainF/BrainF.cpp | 9 +-
examples/BrainF/BrainF.h | 6 +-
examples/BrainF/BrainFDriver.cpp | 4 +-
examples/Fibonacci/fibonacci.cpp | 5 +-
examples/HowToUseJIT/HowToUseJIT.cpp | 5 +-
examples/Kaleidoscope/toy.cpp | 4 +-
examples/ModuleMaker/ModuleMaker.cpp | 8 +-
examples/ParallelJIT/ParallelJIT.cpp | 4 +-
include/llvm-c/BitReader.h | 9 +
include/llvm-c/Core.h | 13 +
include/llvm-c/lto.h | 3 +-
include/llvm/ADT/APInt.h | 2 +
include/llvm/ADT/FoldingSet.h | 2 +-
include/llvm/ADT/PointerUnion.h | 2 +-
include/llvm/ADT/Statistic.h | 4 +-
include/llvm/ADT/Triple.h | 3 +-
include/llvm/Analysis/DebugInfo.h | 46 +
include/llvm/Analysis/Dominators.h | 5 +-
include/llvm/Analysis/IVUsers.h | 2 +-
include/llvm/Analysis/LoopDependenceAnalysis.h | 13 +-
include/llvm/Analysis/LoopInfo.h | 52 +-
include/llvm/Analysis/ScalarEvolution.h | 36 +-
include/llvm/Analysis/ScalarEvolutionExpander.h | 32 +-
include/llvm/Analysis/ScalarEvolutionExpressions.h | 12 +
include/llvm/Assembly/Parser.h | 60 +-
include/llvm/Bitcode/Archive.h | 9 +-
include/llvm/Bitcode/BitstreamReader.h | 4 +-
include/llvm/Bitcode/ReaderWriter.h | 5 +-
include/llvm/CodeGen/AsmPrinter.h | 10 +-
include/llvm/CodeGen/BinaryObject.h | 2 +
include/llvm/CodeGen/LiveIntervalAnalysis.h | 4 +
include/llvm/CodeGen/MachineFunction.h | 14 +
include/llvm/CodeGen/MachineInstrBuilder.h | 18 +-
include/llvm/CodeGen/MachineLoopInfo.h | 48 +-
include/llvm/CodeGen/MachineOperand.h | 41 +-
include/llvm/CodeGen/RegisterScavenging.h | 15 +-
include/llvm/CodeGen/SelectionDAG.h | 4 +-
include/llvm/CodeGen/SelectionDAGNodes.h | 11 +-
include/llvm/CodeGen/ValueTypes.h | 100 +-
include/llvm/CodeGen/ValueTypes.td | 38 +-
include/llvm/CompilerDriver/Main.inc | 149 +--
include/llvm/Config/config.h.cmake | 7 +-
include/llvm/Config/config.h.in | 3 +
include/llvm/Debugger/Debugger.h | 3 +-
include/llvm/DerivedTypes.h | 15 +
include/llvm/Function.h | 5 +
include/llvm/Intrinsics.td | 22 +-
include/llvm/LLVMContext.h | 225 ++++
include/llvm/LinkAllPasses.h | 1 +
include/llvm/LinkAllVMCore.h | 3 +-
include/llvm/Linker.h | 3 +
include/llvm/MC/MCContext.h | 2 +
include/llvm/MC/MCInst.h | 18 +-
include/llvm/MC/MCSection.h | 15 +-
include/llvm/MC/MCStreamer.h | 16 +-
include/llvm/MC/MCSymbol.h | 42 +-
include/llvm/MC/MCValue.h | 24 +-
include/llvm/Module.h | 9 +-
include/llvm/Pass.h | 16 +-
include/llvm/Support/SourceMgr.h | 59 +-
include/llvm/Support/TypeBuilder.h | 6 +-
include/llvm/System/Errno.h | 34 +
include/llvm/Target/TargetCallingConv.td | 4 +
include/llvm/Target/TargetELFWriterInfo.h | 4 -
include/llvm/Target/TargetLowering.h | 13 +-
include/llvm/Transforms/Scalar.h | 6 +
include/llvm/Transforms/Utils/Cloning.h | 1 +
include/llvm/Transforms/Utils/Local.h | 7 +
include/llvm/Transforms/Utils/SSI.h | 102 ++
lib/Analysis/DebugInfo.cpp | 329 +++--
lib/Analysis/IPA/Andersens.cpp | 4 +-
lib/Analysis/LoopDependenceAnalysis.cpp | 122 +-
lib/Analysis/LoopInfo.cpp | 2 +-
lib/Analysis/LoopPass.cpp | 3 +
lib/Analysis/ScalarEvolution.cpp | 384 +++---
lib/Analysis/ScalarEvolutionExpander.cpp | 156 ++-
lib/Analysis/ValueTracking.cpp | 5 +-
lib/Archive/Archive.cpp | 10 +-
lib/Archive/ArchiveInternals.h | 4 +
lib/Archive/ArchiveReader.cpp | 24 +-
lib/Archive/ArchiveWriter.cpp | 7 +-
lib/AsmParser/LLLexer.cpp | 23 +-
lib/AsmParser/LLLexer.h | 14 +-
lib/AsmParser/LLParser.cpp | 162 ++-
lib/AsmParser/LLParser.h | 12 +-
lib/AsmParser/Parser.cpp | 68 +-
lib/Bitcode/Reader/BitReader.cpp | 43 +-
lib/Bitcode/Reader/BitcodeReader.cpp | 11 +-
lib/Bitcode/Reader/BitcodeReader.h | 6 +-
lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 4 +-
lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 155 +--
lib/CodeGen/AsmPrinter/DwarfDebug.h | 5 +-
lib/CodeGen/CMakeLists.txt | 2 +-
lib/CodeGen/ELF.h | 38 +-
lib/CodeGen/ELFCodeEmitter.cpp | 116 +-
lib/CodeGen/ELFCodeEmitter.h | 34 +-
lib/CodeGen/ELFWriter.cpp | 77 +-
lib/CodeGen/ELFWriter.h | 56 +-
lib/CodeGen/LiveIntervalAnalysis.cpp | 122 +-
lib/CodeGen/MachineFunction.cpp | 10 +-
lib/CodeGen/MachineInstr.cpp | 16 +-
lib/CodeGen/MachineLoopInfo.cpp | 2 +-
lib/CodeGen/RegAllocLinearScan.cpp | 20 -
lib/CodeGen/RegisterScavenging.cpp | 45 +-
lib/CodeGen/SelectionDAG/CMakeLists.txt | 2 +
lib/CodeGen/SelectionDAG/FastISel.cpp | 125 +-
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 4 +-
lib/CodeGen/SelectionDAG/LegalizeTypes.cpp | 2 +-
.../SelectionDAG/ScheduleDAGSDNodesEmit.cpp | 2 +-
lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 11 +-
lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 210 ++-
lib/CodeGen/SimpleRegisterCoalescing.cpp | 19 +-
lib/CodeGen/TargetInstrInfoImpl.cpp | 46 +-
lib/CodeGen/VirtRegRewriter.cpp | 56 +-
lib/CompilerDriver/Action.cpp | 10 +-
lib/CompilerDriver/BuiltinOptions.cpp | 55 +
lib/CompilerDriver/CompilationGraph.cpp | 33 +-
lib/CompilerDriver/Main.cpp | 130 ++
lib/CompilerDriver/Makefile | 32 +-
lib/CompilerDriver/Tool.cpp | 6 +
lib/Debugger/Debugger.cpp | 17 +-
lib/Debugger/ProgramInfo.cpp | 6 +-
lib/ExecutionEngine/JIT/JIT.cpp | 2 +-
lib/Linker/LinkArchives.cpp | 2 +-
lib/Linker/LinkItems.cpp | 2 +-
lib/Linker/Linker.cpp | 35 +-
lib/MC/MCAsmStreamer.cpp | 49 +-
lib/Makefile | 6 +-
lib/Support/APInt.cpp | 6 +
lib/Support/Annotation.cpp | 2 +-
lib/Support/SourceMgr.cpp | 86 +-
lib/Support/SystemUtils.cpp | 16 +-
lib/Support/Triple.cpp | 3 +
lib/System/CMakeLists.txt | 1 +
lib/System/Errno.cpp | 71 +
lib/System/ThreadLocal.cpp | 2 +-
lib/System/Unix/Unix.h | 28 +-
lib/System/Win32/ThreadLocal.inc | 2 +-
lib/Target/ARM/ARM.h | 1 -
lib/Target/ARM/ARMAddressingModes.h | 38 +-
lib/Target/ARM/ARMCodeEmitter.cpp | 7 +-
lib/Target/ARM/ARMConstantIslandPass.cpp | 52 +-
lib/Target/ARM/ARMISelDAGToDAG.cpp | 388 ++++--
lib/Target/ARM/ARMISelLowering.cpp | 114 +-
lib/Target/ARM/ARMISelLowering.h | 5 +-
lib/Target/ARM/ARMInstrFormats.td | 100 +-
lib/Target/ARM/ARMInstrInfo.cpp | 881 +++++++------
lib/Target/ARM/ARMInstrInfo.h | 73 +-
lib/Target/ARM/ARMInstrInfo.td | 67 +-
lib/Target/ARM/ARMInstrThumb.td | 75 +-
lib/Target/ARM/ARMInstrThumb2.td | 410 +++++-
lib/Target/ARM/ARMMachineFunctionInfo.h | 10 +-
lib/Target/ARM/ARMRegisterInfo.cpp | 777 +++--------
lib/Target/ARM/ARMRegisterInfo.h | 81 +-
lib/Target/ARM/ARMSubtarget.h | 3 +-
lib/Target/ARM/ARMTargetMachine.cpp | 17 +-
lib/Target/ARM/ARMTargetMachine.h | 20 +-
lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp | 211 ++-
lib/Target/ARM/CMakeLists.txt | 7 +-
lib/Target/ARM/README.txt | 7 +
lib/Target/ARM/Thumb1InstrInfo.cpp | 304 +++++
lib/Target/ARM/Thumb1InstrInfo.h | 93 ++
lib/Target/ARM/Thumb1RegisterInfo.cpp | 755 +++++++++++
lib/Target/ARM/Thumb1RegisterInfo.h | 60 +
lib/Target/ARM/Thumb2InstrInfo.cpp | 312 +++++
lib/Target/ARM/Thumb2InstrInfo.h | 93 ++
lib/Target/ARM/Thumb2RegisterInfo.cpp | 755 +++++++++++
lib/Target/ARM/Thumb2RegisterInfo.h | 60 +
lib/Target/ARM/ThumbInstrInfo.cpp | 282 ----
lib/Target/ARM/ThumbInstrInfo.h | 85 --
lib/Target/Alpha/Alpha.h | 1 -
lib/Target/Alpha/AlphaISelLowering.cpp | 8 +-
lib/Target/Alpha/AlphaISelLowering.h | 9 +-
lib/Target/Alpha/AlphaInstrInfo.cpp | 9 +-
lib/Target/Alpha/AlphaTargetMachine.cpp | 6 +-
lib/Target/Alpha/AlphaTargetMachine.h | 1 -
lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp | 10 +-
lib/Target/Alpha/CMakeLists.txt | 2 +
lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp | 15 +-
lib/Target/CellSPU/CMakeLists.txt | 2 +
lib/Target/CellSPU/SPU.h | 1 -
lib/Target/CellSPU/SPUISelLowering.cpp | 7 +-
lib/Target/CellSPU/SPUISelLowering.h | 4 +-
lib/Target/CellSPU/SPUInstrInfo.cpp | 7 +-
lib/Target/CellSPU/SPUTargetMachine.cpp | 2 +-
lib/Target/CellSPU/SPUTargetMachine.h | 1 -
lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp | 10 +-
lib/Target/IA64/CMakeLists.txt | 2 +
lib/Target/IA64/IA64.h | 1 -
lib/Target/IA64/IA64ISelLowering.cpp | 8 +-
lib/Target/IA64/IA64ISelLowering.h | 4 +-
lib/Target/IA64/IA64TargetMachine.cpp | 4 +-
lib/Target/IA64/IA64TargetMachine.h | 1 -
lib/Target/MSP430/MSP430.h | 1 -
lib/Target/MSP430/MSP430AsmPrinter.cpp | 13 +-
lib/Target/MSP430/MSP430ISelLowering.cpp | 5 +
lib/Target/MSP430/MSP430ISelLowering.h | 3 +
lib/Target/MSP430/MSP430RegisterInfo.cpp | 1 +
lib/Target/MSP430/MSP430TargetMachine.cpp | 2 +-
lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp | 10 +-
lib/Target/Mips/CMakeLists.txt | 2 +
lib/Target/Mips/Mips.h | 1 -
lib/Target/Mips/MipsISelLowering.cpp | 5 +-
lib/Target/Mips/MipsISelLowering.h | 4 +-
lib/Target/Mips/MipsInstrInfo.cpp | 15 +-
lib/Target/Mips/MipsTargetMachine.cpp | 2 +-
lib/Target/Mips/MipsTargetMachine.h | 1 -
lib/Target/PIC16/PIC16.h | 2 +-
lib/Target/PIC16/PIC16AsmPrinter.cpp | 3 +-
lib/Target/PIC16/PIC16AsmPrinter.h | 5 +-
lib/Target/PIC16/PIC16ISelLowering.cpp | 11 +-
lib/Target/PIC16/PIC16ISelLowering.h | 5 +
lib/Target/PIC16/PIC16InstrInfo.td | 2 +-
lib/Target/PIC16/PIC16TargetMachine.cpp | 8 +-
lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp | 36 +-
lib/Target/PowerPC/CMakeLists.txt | 2 +
lib/Target/PowerPC/PPC.h | 5 +-
lib/Target/PowerPC/PPCCallingConv.td | 89 +-
lib/Target/PowerPC/PPCCodeEmitter.cpp | 10 +-
lib/Target/PowerPC/PPCFrameInfo.h | 128 +-
lib/Target/PowerPC/PPCHazardRecognizers.cpp | 2 +-
lib/Target/PowerPC/PPCISelLowering.cpp | 1351 +++++++++++++-------
lib/Target/PowerPC/PPCISelLowering.h | 34 +-
lib/Target/PowerPC/PPCInstr64Bit.td | 40 +-
lib/Target/PowerPC/PPCInstrInfo.cpp | 84 +-
lib/Target/PowerPC/PPCInstrInfo.td | 70 +-
lib/Target/PowerPC/PPCJITInfo.cpp | 2 +-
lib/Target/PowerPC/PPCRegisterInfo.cpp | 274 +++-
lib/Target/PowerPC/PPCRegisterInfo.h | 2 +
lib/Target/PowerPC/PPCRegisterInfo.td | 61 +-
lib/Target/PowerPC/PPCSubtarget.h | 4 +-
lib/Target/PowerPC/PPCTargetMachine.cpp | 10 +-
lib/Target/PowerPC/PPCTargetMachine.h | 1 -
lib/Target/PowerPC/README.txt | 10 +
lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp | 10 +-
lib/Target/Sparc/CMakeLists.txt | 2 +
lib/Target/Sparc/Sparc.h | 1 -
lib/Target/Sparc/SparcISelLowering.cpp | 5 +
lib/Target/Sparc/SparcISelLowering.h | 3 +
lib/Target/Sparc/SparcInstrInfo.cpp | 7 +-
lib/Target/Sparc/SparcTargetMachine.cpp | 2 +-
lib/Target/Sparc/SparcTargetMachine.h | 1 -
lib/Target/TargetELFWriterInfo.cpp | 10 -
lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp | 10 +-
lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h | 11 +-
lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp | 7 +-
lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp | 5 +-
lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h | 13 +-
lib/Target/X86/CMakeLists.txt | 2 +
lib/Target/X86/X86.h | 4 +-
lib/Target/X86/X86.td | 4 +
lib/Target/X86/X86ELFWriterInfo.cpp | 12 -
lib/Target/X86/X86ELFWriterInfo.h | 4 -
lib/Target/X86/X86FastISel.cpp | 29 +-
lib/Target/X86/X86FloatingPoint.cpp | 15 +-
lib/Target/X86/X86ISelLowering.cpp | 200 ++-
lib/Target/X86/X86ISelLowering.h | 7 +-
lib/Target/X86/X86InstrBuilder.h | 6 +-
lib/Target/X86/X86InstrInfo.cpp | 3 +-
lib/Target/X86/X86InstrInfo.td | 2 +
lib/Target/X86/X86RegisterInfo.td | 27 +
lib/Target/X86/X86Subtarget.h | 2 +-
lib/Target/X86/X86TargetMachine.cpp | 10 +-
lib/Target/X86/X86TargetMachine.h | 1 -
lib/Target/XCore/XCore.h | 1 -
lib/Target/XCore/XCoreAsmPrinter.cpp | 10 +-
lib/Target/XCore/XCoreISelLowering.cpp | 6 +
lib/Target/XCore/XCoreISelLowering.h | 3 +
lib/Target/XCore/XCoreTargetMachine.cpp | 2 +-
lib/Transforms/IPO/GlobalOpt.cpp | 3 +-
lib/Transforms/IPO/PartialInlining.cpp | 2 +-
lib/Transforms/IPO/RaiseAllocations.cpp | 9 +-
lib/Transforms/Scalar/CodeGenPrepare.cpp | 9 +-
lib/Transforms/Scalar/GVN.cpp | 11 +-
lib/Transforms/Scalar/IndVarSimplify.cpp | 11 +-
lib/Transforms/Scalar/InstructionCombining.cpp | 1323 ++++++++++---------
lib/Transforms/Scalar/JumpThreading.cpp | 37 +-
lib/Transforms/Scalar/LICM.cpp | 5 +-
lib/Transforms/Scalar/LoopIndexSplit.cpp | 28 +-
lib/Transforms/Scalar/LoopRotation.cpp | 23 +-
lib/Transforms/Scalar/LoopStrengthReduce.cpp | 17 +-
lib/Transforms/Scalar/LoopUnswitch.cpp | 17 +-
lib/Transforms/Scalar/MemCpyOptimizer.cpp | 19 +-
lib/Transforms/Scalar/Reassociate.cpp | 40 +-
lib/Transforms/Scalar/Reg2Mem.cpp | 3 +-
lib/Transforms/Scalar/SCCP.cpp | 60 +-
lib/Transforms/Scalar/ScalarReplAggregates.cpp | 111 +-
lib/Transforms/Scalar/SimplifyCFGPass.cpp | 14 +-
lib/Transforms/Scalar/SimplifyLibCalls.cpp | 164 +--
lib/Transforms/Scalar/TailDuplication.cpp | 14 +-
lib/Transforms/Utils/CMakeLists.txt | 1 +
lib/Transforms/Utils/CloneModule.cpp | 2 +-
lib/Transforms/Utils/LoopSimplify.cpp | 74 ++
lib/Transforms/Utils/LowerAllocations.cpp | 2 +-
lib/Transforms/Utils/SSI.cpp | 390 ++++++
lib/Transforms/Utils/SimplifyCFG.cpp | 2 +-
lib/VMCore/AsmWriter.cpp | 103 +-
lib/VMCore/CMakeLists.txt | 1 +
lib/VMCore/Core.cpp | 23 +-
lib/VMCore/Function.cpp | 6 +
lib/VMCore/LLVMContext.cpp | 489 +++++++
lib/VMCore/LLVMContextImpl.h | 25 +
lib/VMCore/Module.cpp | 5 +-
lib/VMCore/PassManager.cpp | 47 +-
lib/VMCore/Type.cpp | 98 +-
lib/VMCore/ValueTypes.cpp | 42 +-
test/Analysis/LoopDependenceAnalysis/dg.exp | 3 +
.../Analysis/LoopDependenceAnalysis/local-array.ll | 24 +
test/Analysis/LoopDependenceAnalysis/no-array.ll | 23 +
.../Analysis/LoopDependenceAnalysis/siv-strong1.ll | 30 +
.../Analysis/LoopDependenceAnalysis/siv-strong2.ll | 31 +
test/Analysis/LoopDependenceAnalysis/ziv1.ll | 23 +
test/Analysis/LoopDependenceAnalysis/ziv2.ll | 26 +
test/CodeGen/ARM/2009-06-30-RegScavengerAssert.ll | 122 ++
test/CodeGen/ARM/2009-06-30-RegScavengerAssert2.ll | 116 ++
test/CodeGen/ARM/2009-06-30-RegScavengerAssert3.ll | 128 ++
test/CodeGen/ARM/2009-06-30-RegScavengerAssert4.ll | 128 ++
test/CodeGen/ARM/2009-06-30-RegScavengerAssert5.ll | 99 ++
test/CodeGen/ARM/2009-07-01-CommuteBug.ll | 130 ++
test/CodeGen/ARM/ldr.ll | 50 +-
test/CodeGen/ARM/sxt_rot.ll | 9 +-
test/CodeGen/PowerPC/available-externally.ll | 69 +
test/CodeGen/Thumb2/load-global.ll | 14 +-
test/CodeGen/Thumb2/thumb2-adc.ll | 20 +-
test/CodeGen/Thumb2/thumb2-add2.ll | 5 -
test/CodeGen/Thumb2/thumb2-add5.ll | 32 +-
test/CodeGen/Thumb2/thumb2-and.ll | 32 +-
test/CodeGen/Thumb2/thumb2-bic.ll | 36 +-
test/CodeGen/Thumb2/thumb2-cmn.ll | 59 +
test/CodeGen/Thumb2/thumb2-cmp.ll | 2 +-
test/CodeGen/Thumb2/thumb2-cmp2.ll | 32 +-
test/CodeGen/Thumb2/thumb2-eor.ll | 37 +-
test/CodeGen/Thumb2/thumb2-jumptbl.ll | 26 +
test/CodeGen/Thumb2/thumb2-ldr.ll | 59 +
test/CodeGen/Thumb2/thumb2-ldr_ext.ll | 28 +
test/CodeGen/Thumb2/thumb2-ldr_post.ll | 12 +
test/CodeGen/Thumb2/thumb2-ldr_pre.ll | 28 +
test/CodeGen/Thumb2/thumb2-ldrb.ll | 60 +
test/CodeGen/Thumb2/thumb2-ldrh.ll | 59 +
test/CodeGen/Thumb2/thumb2-mvn2.ll | 32 +-
test/CodeGen/Thumb2/thumb2-orn.ll | 36 +-
test/CodeGen/Thumb2/thumb2-orr.ll | 32 +-
test/CodeGen/Thumb2/thumb2-rsb.ll | 33 +-
test/CodeGen/Thumb2/thumb2-sbc2.ll | 6 +
test/CodeGen/Thumb2/thumb2-str.ll | 63 +
test/CodeGen/Thumb2/thumb2-str_post.ll | 21 +
test/CodeGen/Thumb2/thumb2-str_pre.ll | 18 +
test/CodeGen/Thumb2/thumb2-strb.ll | 63 +
test/CodeGen/Thumb2/thumb2-strh.ll | 63 +
test/CodeGen/Thumb2/thumb2-sub.ll | 31 +
test/CodeGen/Thumb2/thumb2-sub2.ll | 6 +
test/CodeGen/Thumb2/thumb2-sub4.ll | 36 +
test/CodeGen/Thumb2/thumb2-sub5.ll | 6 +
test/CodeGen/Thumb2/thumb2-sxt_rot.ll | 29 +
test/CodeGen/Thumb2/thumb2-teq.ll | 71 +
test/CodeGen/Thumb2/thumb2-teq2.ll | 59 +
test/CodeGen/Thumb2/thumb2-tst.ll | 71 +
test/CodeGen/Thumb2/thumb2-tst2.ll | 59 +
test/CodeGen/Thumb2/thumb2-uxt_rot.ll | 24 +
test/CodeGen/Thumb2/thumb2-uxtb.ll | 74 ++
test/CodeGen/Thumb2/tls1.ll | 20 +
test/CodeGen/Thumb2/tls2.ll | 19 +
test/CodeGen/X86/fast-isel-constpool.ll | 17 +
test/CodeGen/X86/fast-isel-gv.ll | 24 +
test/CodeGen/X86/inline-asm-fpstack3.ll | 15 +
test/CodeGen/X86/inline-asm-fpstack4.ll | 15 +
test/CodeGen/X86/inline-asm-fpstack5.ll | 15 +
test/Feature/mdnode2.ll | 7 +
test/Feature/mdnode3.ll | 3 +
test/FrontendC++/2009-06-30-ByrefBlock.cpp | 8 +
test/MC/AsmParser/directive_align.s | 16 +
test/MC/AsmParser/directive_symbol_attrs.s | 7 +
test/MC/AsmParser/exprs.s | 62 +
test/MC/AsmParser/x86_operands.s | 36 +
test/TableGen/ListArgs.td | 11 +
test/TableGen/ListArgsSimple.td | 8 +
test/Transforms/IndVarSimplify/loop_evaluate9.ll | 78 ++
.../InstCombine/2009-07-02-MaskedIntVector.ll | 15 +
.../InstCombine/bitcast-scalar-to-vector.ll | 14 +
.../LoopIndexSplit/non-iv-cmp-operand.ll | 195 +++
test/Transforms/LoopSimplify/merge-exits.ll | 45 +
tools/Makefile | 4 +-
tools/bugpoint/BugDriver.cpp | 25 +-
tools/bugpoint/BugDriver.h | 9 +-
tools/bugpoint/CrashDebugger.cpp | 2 +-
tools/bugpoint/Miscompilation.cpp | 2 +-
tools/bugpoint/OptimizerDriver.cpp | 2 +-
tools/bugpoint/bugpoint.cpp | 6 +-
tools/gold/gold-plugin.cpp | 5 +-
tools/llc/llc.cpp | 4 +-
tools/lli/lli.cpp | 8 +-
tools/llvm-ar/llvm-ar.cpp | 6 +-
tools/llvm-as/llvm-as.cpp | 9 +-
tools/llvm-db/CLIDebugger.cpp | 5 +-
tools/llvm-db/CLIDebugger.h | 5 +-
tools/llvm-db/Commands.cpp | 4 +-
tools/llvm-db/llvm-db.cpp | 4 +-
tools/llvm-dis/llvm-dis.cpp | 4 +-
tools/llvm-extract/llvm-extract.cpp | 6 +-
tools/llvm-ld/llvm-ld.cpp | 6 +-
tools/llvm-link/llvm-link.cpp | 11 +-
tools/llvm-mc/AsmExpr.cpp | 162 +++
tools/llvm-mc/AsmExpr.h | 179 +++
tools/llvm-mc/AsmLexer.cpp | 60 +-
tools/llvm-mc/AsmLexer.h | 12 +-
tools/llvm-mc/AsmParser.cpp | 419 +++++-
tools/llvm-mc/AsmParser.h | 63 +-
tools/llvm-mc/CMakeLists.txt | 1 +
tools/llvm-mc/MC-X86Specific.cpp | 176 ++-
tools/llvm-mc/llvm-mc.cpp | 41 +-
tools/llvm-nm/llvm-nm.cpp | 7 +-
tools/llvm-prof/llvm-prof.cpp | 12 +-
tools/llvm-ranlib/llvm-ranlib.cpp | 6 +-
tools/llvmc/doc/LLVMC-Reference.rst | 27 +-
.../example/mcc16/plugins/PIC16Base/PIC16Base.td | 29 +-
.../example/mcc16/plugins/PIC16Base/PluginMain.cpp | 60 +
tools/lto/LTOCodeGenerator.cpp | 4 +-
tools/lto/LTOCodeGenerator.h | 2 +
tools/lto/LTOModule.cpp | 12 +-
tools/lto/LTOModule.h | 9 +-
tools/lto/Makefile | 4 +-
tools/lto/lto.cpp | 3 +-
tools/opt/opt.cpp | 4 +-
unittests/ADT/APIntTest.cpp | 13 -
.../ExecutionEngine/JIT/JITEventListenerTest.cpp | 3 +-
unittests/MC/AsmStreamerTest.cpp | 19 +-
unittests/VMCore/Makefile | 2 +-
unittests/VMCore/PassManagerTest.cpp | 527 ++++++++
utils/NewNightlyTest.pl | 4 +-
utils/TableGen/AsmWriterEmitter.cpp | 7 +-
utils/TableGen/AsmWriterEmitter.h | 2 +-
utils/TableGen/CallingConvEmitter.cpp | 6 +-
utils/TableGen/CallingConvEmitter.h | 6 +-
utils/TableGen/ClangDiagnosticsEmitter.cpp | 5 +-
utils/TableGen/ClangDiagnosticsEmitter.h | 4 +-
utils/TableGen/CodeEmitterGen.cpp | 2 +-
utils/TableGen/CodeEmitterGen.h | 6 +-
utils/TableGen/CodeGenDAGPatterns.cpp | 42 +-
utils/TableGen/CodeGenDAGPatterns.h | 4 +-
utils/TableGen/CodeGenTarget.cpp | 37 +-
utils/TableGen/CodeGenTarget.h | 2 +-
utils/TableGen/DAGISelEmitter.cpp | 32 +-
utils/TableGen/DAGISelEmitter.h | 10 +-
utils/TableGen/FastISelEmitter.cpp | 19 +-
utils/TableGen/FastISelEmitter.h | 2 +-
utils/TableGen/InstrEnumEmitter.cpp | 2 +-
utils/TableGen/InstrEnumEmitter.h | 2 +-
utils/TableGen/InstrInfoEmitter.cpp | 15 +-
utils/TableGen/InstrInfoEmitter.h | 8 +-
utils/TableGen/IntrinsicEmitter.cpp | 36 +-
utils/TableGen/IntrinsicEmitter.h | 22 +-
utils/TableGen/LLVMCConfigurationEmitter.cpp | 72 +-
utils/TableGen/LLVMCConfigurationEmitter.h | 2 +-
utils/TableGen/Record.cpp | 141 +-
utils/TableGen/Record.h | 33 +-
utils/TableGen/RegisterInfoEmitter.cpp | 47 +-
utils/TableGen/RegisterInfoEmitter.h | 6 +-
utils/TableGen/SubtargetEmitter.cpp | 20 +-
utils/TableGen/SubtargetEmitter.h | 20 +-
utils/TableGen/TGLexer.cpp | 5 +-
utils/TableGen/TGParser.cpp | 16 +-
utils/TableGen/TGValueTypes.cpp | 1 -
utils/TableGen/TableGen.cpp | 31 +-
utils/TableGen/TableGenBackend.cpp | 2 +-
utils/TableGen/TableGenBackend.h | 6 +-
utils/crosstool/ARM/README | 37 +
477 files changed, 17104 insertions(+), 5956 deletions(-)
create mode 100644 include/llvm/LLVMContext.h
create mode 100644 include/llvm/System/Errno.h
create mode 100644 include/llvm/Transforms/Utils/SSI.h
create mode 100644 lib/CompilerDriver/BuiltinOptions.cpp
create mode 100644 lib/CompilerDriver/Main.cpp
create mode 100644 lib/System/Errno.cpp
create mode 100644 lib/Target/ARM/Thumb1InstrInfo.cpp
create mode 100644 lib/Target/ARM/Thumb1InstrInfo.h
create mode 100644 lib/Target/ARM/Thumb1RegisterInfo.cpp
create mode 100644 lib/Target/ARM/Thumb1RegisterInfo.h
create mode 100644 lib/Target/ARM/Thumb2InstrInfo.cpp
create mode 100644 lib/Target/ARM/Thumb2InstrInfo.h
create mode 100644 lib/Target/ARM/Thumb2RegisterInfo.cpp
create mode 100644 lib/Target/ARM/Thumb2RegisterInfo.h
delete mode 100644 lib/Target/ARM/ThumbInstrInfo.cpp
delete mode 100644 lib/Target/ARM/ThumbInstrInfo.h
create mode 100644 lib/Transforms/Utils/SSI.cpp
create mode 100644 lib/VMCore/LLVMContext.cpp
create mode 100644 lib/VMCore/LLVMContextImpl.h
create mode 100644 test/Analysis/LoopDependenceAnalysis/dg.exp
create mode 100644 test/Analysis/LoopDependenceAnalysis/local-array.ll
create mode 100644 test/Analysis/LoopDependenceAnalysis/no-array.ll
create mode 100644 test/Analysis/LoopDependenceAnalysis/siv-strong1.ll
create mode 100644 test/Analysis/LoopDependenceAnalysis/siv-strong2.ll
create mode 100644 test/Analysis/LoopDependenceAnalysis/ziv1.ll
create mode 100644 test/Analysis/LoopDependenceAnalysis/ziv2.ll
create mode 100644 test/CodeGen/ARM/2009-06-30-RegScavengerAssert.ll
create mode 100644 test/CodeGen/ARM/2009-06-30-RegScavengerAssert2.ll
create mode 100644 test/CodeGen/ARM/2009-06-30-RegScavengerAssert3.ll
create mode 100644 test/CodeGen/ARM/2009-06-30-RegScavengerAssert4.ll
create mode 100644 test/CodeGen/ARM/2009-06-30-RegScavengerAssert5.ll
create mode 100644 test/CodeGen/ARM/2009-07-01-CommuteBug.ll
create mode 100644 test/CodeGen/PowerPC/available-externally.ll
create mode 100644 test/CodeGen/Thumb2/thumb2-cmn.ll
create mode 100644 test/CodeGen/Thumb2/thumb2-jumptbl.ll
create mode 100644 test/CodeGen/Thumb2/thumb2-ldr.ll
create mode 100644 test/CodeGen/Thumb2/thumb2-ldr_ext.ll
create mode 100644 test/CodeGen/Thumb2/thumb2-ldr_post.ll
create mode 100644 test/CodeGen/Thumb2/thumb2-ldr_pre.ll
create mode 100644 test/CodeGen/Thumb2/thumb2-ldrb.ll
create mode 100644 test/CodeGen/Thumb2/thumb2-ldrh.ll
create mode 100644 test/CodeGen/Thumb2/thumb2-sbc2.ll
create mode 100644 test/CodeGen/Thumb2/thumb2-str.ll
create mode 100644 test/CodeGen/Thumb2/thumb2-str_post.ll
create mode 100644 test/CodeGen/Thumb2/thumb2-str_pre.ll
create mode 100644 test/CodeGen/Thumb2/thumb2-strb.ll
create mode 100644 test/CodeGen/Thumb2/thumb2-strh.ll
create mode 100644 test/CodeGen/Thumb2/thumb2-sub.ll
create mode 100644 test/CodeGen/Thumb2/thumb2-sub2.ll
create mode 100644 test/CodeGen/Thumb2/thumb2-sub4.ll
create mode 100644 test/CodeGen/Thumb2/thumb2-sub5.ll
create mode 100644 test/CodeGen/Thumb2/thumb2-sxt_rot.ll
create mode 100644 test/CodeGen/Thumb2/thumb2-teq.ll
create mode 100644 test/CodeGen/Thumb2/thumb2-teq2.ll
create mode 100644 test/CodeGen/Thumb2/thumb2-tst.ll
create mode 100644 test/CodeGen/Thumb2/thumb2-tst2.ll
create mode 100644 test/CodeGen/Thumb2/thumb2-uxt_rot.ll
create mode 100644 test/CodeGen/Thumb2/thumb2-uxtb.ll
create mode 100644 test/CodeGen/Thumb2/tls1.ll
create mode 100644 test/CodeGen/Thumb2/tls2.ll
create mode 100644 test/CodeGen/X86/fast-isel-constpool.ll
create mode 100644 test/CodeGen/X86/fast-isel-gv.ll
create mode 100644 test/CodeGen/X86/inline-asm-fpstack3.ll
create mode 100644 test/CodeGen/X86/inline-asm-fpstack4.ll
create mode 100644 test/CodeGen/X86/inline-asm-fpstack5.ll
create mode 100644 test/Feature/mdnode2.ll
create mode 100644 test/Feature/mdnode3.ll
create mode 100644 test/FrontendC++/2009-06-30-ByrefBlock.cpp
create mode 100644 test/MC/AsmParser/directive_align.s
create mode 100644 test/MC/AsmParser/directive_symbol_attrs.s
create mode 100644 test/MC/AsmParser/exprs.s
create mode 100644 test/MC/AsmParser/x86_operands.s
create mode 100644 test/TableGen/ListArgs.td
create mode 100644 test/TableGen/ListArgsSimple.td
create mode 100644 test/Transforms/IndVarSimplify/loop_evaluate9.ll
create mode 100644 test/Transforms/InstCombine/2009-07-02-MaskedIntVector.ll
create mode 100644 test/Transforms/InstCombine/bitcast-scalar-to-vector.ll
create mode 100644 test/Transforms/LoopIndexSplit/non-iv-cmp-operand.ll
create mode 100644 test/Transforms/LoopSimplify/merge-exits.ll
create mode 100644 tools/llvm-mc/AsmExpr.cpp
create mode 100644 tools/llvm-mc/AsmExpr.h
create mode 100644 unittests/VMCore/PassManagerTest.cpp
create mode 100644 utils/crosstool/ARM/README
diff --git a/Makefile.config.in b/Makefile.config.in
index efa8a0b87466..e2d2c57b4d5f 100644
--- a/Makefile.config.in
+++ b/Makefile.config.in
@@ -223,7 +223,7 @@ RDYNAMIC := @RDYNAMIC@
#ENABLE_PROFILING = 1
@ENABLE_PROFILING@
-# When DISABLE_ASSERTIONS is enabled, builds of all of the LLVM code will
+# 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@
@@ -297,3 +297,14 @@ 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@
diff --git a/Makefile.rules b/Makefile.rules
index a1a1924a9903..3ae2db8916de 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -201,15 +201,19 @@ LIBRARYNAME := $(patsubst %,plugin_llvmc_%,$(LLVMC_PLUGIN))
CPP.Flags += -DLLVMC_PLUGIN_NAME=$(LLVMC_PLUGIN)
REQUIRES_EH := 1
+ifeq ($(ENABLE_LLVMC_DYNAMIC),1)
+ LD.Flags += -lCompilerDriver
+endif
+
# Build a dynamic library if the user runs `make` directly from the plugin
# directory.
ifndef LLVMC_BUILTIN_PLUGIN
-LOADABLE_MODULE = 1
+ LOADABLE_MODULE = 1
endif
# TableGen stuff...
ifneq ($(BUILT_SOURCES),)
-LLVMC_BUILD_AUTOGENERATED_INC=1
+ LLVMC_BUILD_AUTOGENERATED_INC=1
endif
endif # LLVMC_PLUGIN
@@ -217,10 +221,16 @@ endif # LLVMC_PLUGIN
ifdef LLVMC_BASED_DRIVER
TOOLNAME = $(LLVMC_BASED_DRIVER)
-LLVMLIBS = CompilerDriver.a
-LINK_COMPONENTS = support system
+
REQUIRES_EH := 1
+ifeq ($(ENABLE_LLVMC_DYNAMIC),1)
+ LD.Flags += -lCompilerDriver
+else
+ LLVMLIBS = CompilerDriver.a
+ LINK_COMPONENTS = support system
+endif
+
# Preprocessor magic that generates references to static variables in built-in
# plugins.
ifneq ($(LLVMC_BUILTIN_PLUGINS),)
@@ -502,8 +512,7 @@ ifeq ($(OS),Darwin)
else
ifeq ($(OS),Cygwin)
SharedLinkOptions=-shared -nostdlib -Wl,--export-all-symbols \
- -Wl,--enable-auto-import -Wl,--enable-auto-image-base \
- -Wl,--enable-runtime-pseudo-relocs
+ -Wl,--enable-auto-import -Wl,--enable-auto-image-base
else
SharedLinkOptions=-shared
endif
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index f71e648d5710..6b3c4caac0ca 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -240,7 +240,7 @@ case "$llvm_cv_target_arch" in
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)
@@ -453,7 +453,7 @@ for a_target in $TARGETS_TO_BUILD; do
fi
done
-# Build the LLVM_TARGET and LLVM_ASM_PRINTER macro uses for
+# Build the LLVM_TARGET and LLVM_ASM_PRINTER macro uses for
# Targets.def and AsmPrinters.def.
LLVM_ENUM_TARGETS=""
LLVM_ENUM_ASM_PRINTERS=""
@@ -593,6 +593,35 @@ case "$enableval" in
*) AC_MSG_ERROR([Invalid setting for --enable-libffi. Use "yes" or "no"]) ;;
esac
+dnl Only Windows needs dynamic libCompilerDriver to support plugins.
+if test "$llvm_cv_os_type" = "Win32" ; then
+ llvmc_dynamic="yes"
+else
+ llvmc_dynamic="no"
+fi
+
+dnl --enable-llvmc-dynamic : should LLVMC link libCompilerDriver dynamically?
+AC_ARG_ENABLE(llvmc-dynamic,AS_HELP_STRING(
+--enable-llvmc-dynamic,
+[Link LLVMC dynamically (default is NO, unless on Win32)]),,
+enableval=$llvmc_dynamic)
+if test ${enableval} = "yes" && test "$ENABLE_PIC" -eq 1 ; then
+ AC_SUBST(ENABLE_LLVMC_DYNAMIC,[[ENABLE_LLVMC_DYNAMIC=1]])
+else
+ AC_SUBST(ENABLE_LLVMC_DYNAMIC,[[]])
+fi
+
+dnl --enable-llvmc-dynamic-plugins : should LLVMC support dynamic plugins?
+AC_ARG_ENABLE(llvmc-dynamic-plugins,AS_HELP_STRING(
+--enable-llvmc-dynamic-plugins,
+[Enable dynamic LLVMC plugins (default is YES)]),,
+enableval=yes)
+if test ${enableval} = "yes" ; then
+ AC_SUBST(ENABLE_LLVMC_DYNAMIC_PLUGINS,[[ENABLE_LLVMC_DYNAMIC_PLUGINS=1]])
+else
+ AC_SUBST(ENABLE_LLVMC_DYNAMIC_PLUGINS,[[]])
+fi
+
dnl===-----------------------------------------------------------------------===
dnl===
dnl=== SECTION 4: Check for programs we need and that they are the right version
@@ -914,7 +943,8 @@ 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 realpath sbrk setrlimit strdup strerror strerror_r ])
+AC_CHECK_FUNCS([mktemp realpath sbrk setrlimit strdup ])
+AC_CHECK_FUNCS([strerror strerror_r strerror_s ])
AC_CHECK_FUNCS([strtoll strtoq sysconf malloc_zone_statistics ])
AC_CHECK_FUNCS([setjmp longjmp sigsetjmp siglongjmp])
AC_C_PRINTF_A
@@ -951,7 +981,7 @@ dnl atomic builtins are required for threading support.
AC_MSG_CHECKING(for GCC atomic builtins)
AC_LINK_IFELSE(
AC_LANG_SOURCE(
- [[int main() {
+ [[int main() {
volatile unsigned long val = 1;
__sync_synchronize();
__sync_val_compare_and_swap(&val, 1, 0);
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index 61161ed63bb5..731071ef85b2 100755
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -44,6 +44,8 @@ check_include_file(windows.h HAVE_WINDOWS_H)
# library checks
include(CheckLibraryExists)
check_library_exists(pthread pthread_create "" HAVE_LIBPTHREAD)
+check_library_exists(pthread pthread_getspecific "" HAVE_PTHREAD_GETSPECIFIC)
+check_library_exists(pthread pthread_rwlock_init "" HAVE_PTHREAD_RWLOCK_INIT)
check_library_exists(dl dlopen "" HAVE_LIBDL)
# function checks
@@ -64,9 +66,10 @@ check_symbol_exists(mallinfo malloc.h HAVE_MALLINFO)
check_symbol_exists(malloc_zone_statistics malloc/malloc.h
HAVE_MALLOC_ZONE_STATISTICS)
check_symbol_exists(pthread_mutex_lock pthread.h HAVE_PTHREAD_MUTEX_LOCK)
-check_symbol_exists(pthread_rwlock_init pthread.h HAVE_PTHREAD_RWLOCK_INIT)
-check_symbol_exists(pthread_getspecific pthread.h HAVE_PTHREAD_GETSPECIFIC)
check_symbol_exists(strtoll stdlib.h HAVE_STRTOLL)
+check_symbol_exists(strerror string.h HAVE_STRERROR)
+check_symbol_exists(strerror_r string.h HAVE_STRERROR_R)
+check_symbol_exists(strerror_s string.h HAVE_STRERROR_S)
check_symbol_exists(__GLIBC__ stdio.h LLVM_USING_GLIBC)
if( LLVM_USING_GLIBC )
diff --git a/configure b/configure
index a237d673ec08..a38067bc2d0e 100755
--- a/configure
+++ b/configure
@@ -31356,9 +31356,119 @@ done
+for ac_func in mktemp realpath sbrk setrlimit strdup
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case declares $ac_func.
+ For example, HP-UX 11i declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer to if __STDC__ is defined, since
+ exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include
+#else
+# include
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
-for ac_func in mktemp realpath sbrk setrlimit strdup strerror strerror_r
+for ac_func in strerror strerror_r strerror_s
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
diff --git a/docs/CodingStandards.html b/docs/CodingStandards.html
index 84ca8fa978ee..cf9111071f56 100644
--- a/docs/CodingStandards.html
+++ b/docs/CodingStandards.html
@@ -50,6 +50,8 @@
Do not use 'using namespace std'
Provide a virtual method anchor for
classes in headers
+ Don't evaluate end() every time through a
+ loop
Prefer Preincrement
Avoid std::endl
@@ -661,6 +663,67 @@ increasing link times.
+
+
+
+
+
+
Because C++ doesn't have a standard "foreach" loop (though it can be emulated
+with macros and may be coming in C++'0x) we end up writing a lot of loops that
+manually iterate from begin to end on a variety of containers or through other
+data structures. One common mistake is to write a loop in this style:
+
+
+
+ BasicBlock *BB = ...
+ for (BasicBlock::iterator I = BB->begin(); I != BB->end(); ++I)
+ ... use I ...
+
+
+
+
The problem with this construct is that it evaluates "BB->end()"
+every time through the loop. Instead of writing the loop like this, we strongly
+prefer loops to be written so that they evaluate it once before the loop starts.
+A convenient way to do this is like so:
+
+
+
+ BasicBlock *BB = ...
+ for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
+ ... use I ...
+
+
+
+
The observant may quickly point out that these two loops may have different
+semantics: if the container (a basic block in this case) is being mutated, then
+"BB->end()" may change its value every time through the loop and the
+second loop may not in fact be correct. If you actually do depend on this
+behavior, please write the loop in the first form and add a comment indicating
+that you did it intentionally.
+
+
Why do we prefer the second form (when correct)? Writing the loop in the
+first form has two problems: First it may be less efficient than evaluating it
+at the start of the loop. In this case, the cost is probably minor: a few extra
+loads every time through the loop. However, if the base expression is more
+complex, then the cost can rise quickly. I've seen loops where the end
+expression was actually something like: "SomeMap[x]->end()" and map
+lookups really aren't cheap. By writing it in the second form consistently, you
+eliminate the issue entirely and don't even have to think about it.
+
+
The second (even bigger) issue is that writing the loop in the first form
+hints to the reader that the loop is mutating the container (a fact that a
+comment would handily confirm!). If you write the loop in the second form, it
+is immediately obvious without even looking at the body of the loop that the
+container isn't being modified, which makes it easier to read the code and
+understand what it does.
+
+
While the second form of the loop is a few extra keystrokes, we do strongly
+prefer it.
+
+
+
@@ -744,7 +807,7 @@ something.
Chris Lattner
LLVM Compiler Infrastructure
- Last modified: $Date: 2009-03-23 05:53:34 +0100 (Mon, 23 Mar 2009) $
+ Last modified: $Date: 2009-06-30 08:27:54 +0200 (Tue, 30 Jun 2009) $