[llvm-commits] [llvm] r53163 [1/7] - in /llvm/branches/non-call-eh: ./ autoconf/ bindings/ocaml/llvm/ docs/ docs/CommandGuide/ docs/tutorial/ examples/BrainF/ examples/Fibonacci/ examples/HowToUseJIT/ examples/ModuleMaker/ examples/ParallelJIT/ include/llvm-c/ include/llvm/ include/llvm/ADT/ include/llvm/Analysis/ include/llvm/Bitcode/ include/llvm/CodeGen/ include/llvm/Debugger/ include/llvm/ExecutionEngine/ include/llvm/Support/ include/llvm/System/ include/llvm/Target/ include/llvm/Transforms/ include/llvm/Transform...

Nick Lewycky nicholas at mxc.ca
Sun Jul 6 13:45:51 PDT 2008


Author: nicholas
Date: Sun Jul  6 15:45:41 2008
New Revision: 53163

URL: http://llvm.org/viewvc/llvm-project?rev=53163&view=rev
Log:
Merge head into the non-call-eh branch.

Result doesn't build yet.

Added:
    llvm/branches/non-call-eh/include/llvm/ADT/ImmutableList.h
    llvm/branches/non-call-eh/include/llvm/ADT/PriorityQueue.h
    llvm/branches/non-call-eh/include/llvm/ADT/ScopedHashTable.h
    llvm/branches/non-call-eh/include/llvm/ADT/StringSet.h
    llvm/branches/non-call-eh/include/llvm/ADT/hash_map.h.in
    llvm/branches/non-call-eh/include/llvm/ADT/hash_set.h.in
    llvm/branches/non-call-eh/include/llvm/ADT/ilist.h
    llvm/branches/non-call-eh/include/llvm/ADT/iterator
    llvm/branches/non-call-eh/include/llvm/ADT/iterator.h.in
    llvm/branches/non-call-eh/include/llvm/Analysis/LibCallAliasAnalysis.h
    llvm/branches/non-call-eh/include/llvm/Analysis/LibCallSemantics.h
    llvm/branches/non-call-eh/include/llvm/Analysis/LoopVR.h
    llvm/branches/non-call-eh/include/llvm/Analysis/SparsePropagation.h
    llvm/branches/non-call-eh/include/llvm/Analysis/ValueTracking.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/DAGISelHeader.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/LiveStackAnalysis.h
    llvm/branches/non-call-eh/include/llvm/OperandTraits.h
    llvm/branches/non-call-eh/include/llvm/System/Solaris.h
    llvm/branches/non-call-eh/include/llvm/Transforms/Utils/UnrollLoop.h
    llvm/branches/non-call-eh/lib/Analysis/LibCallAliasAnalysis.cpp
    llvm/branches/non-call-eh/lib/Analysis/LibCallSemantics.cpp
    llvm/branches/non-call-eh/lib/Analysis/LoopVR.cpp
    llvm/branches/non-call-eh/lib/Analysis/SparsePropagation.cpp
    llvm/branches/non-call-eh/lib/Analysis/ValueTracking.cpp
    llvm/branches/non-call-eh/lib/CodeGen/LiveStackAnalysis.cpp
    llvm/branches/non-call-eh/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
    llvm/branches/non-call-eh/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
    llvm/branches/non-call-eh/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp
    llvm/branches/non-call-eh/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
    llvm/branches/non-call-eh/lib/CodeGen/StackSlotColoring.cpp
    llvm/branches/non-call-eh/lib/Target/CppBackend/   (with props)
    llvm/branches/non-call-eh/lib/Target/CppBackend/CPPBackend.cpp
    llvm/branches/non-call-eh/lib/Target/CppBackend/CPPTargetMachine.h
    llvm/branches/non-call-eh/lib/Target/CppBackend/Makefile
    llvm/branches/non-call-eh/lib/Target/Mips/MipsInstrFPU.td
    llvm/branches/non-call-eh/lib/Target/PIC16/   (with props)
    llvm/branches/non-call-eh/lib/Target/PIC16/Makefile
    llvm/branches/non-call-eh/lib/Target/PIC16/PIC16.h
    llvm/branches/non-call-eh/lib/Target/PIC16/PIC16.td
    llvm/branches/non-call-eh/lib/Target/PIC16/PIC16AsmPrinter.cpp
    llvm/branches/non-call-eh/lib/Target/PIC16/PIC16CallingConv.td
    llvm/branches/non-call-eh/lib/Target/PIC16/PIC16ConstantPoolValue.cpp
    llvm/branches/non-call-eh/lib/Target/PIC16/PIC16ConstantPoolValue.h
    llvm/branches/non-call-eh/lib/Target/PIC16/PIC16ISelDAGToDAG.cpp
    llvm/branches/non-call-eh/lib/Target/PIC16/PIC16ISelLowering.cpp
    llvm/branches/non-call-eh/lib/Target/PIC16/PIC16ISelLowering.h
    llvm/branches/non-call-eh/lib/Target/PIC16/PIC16InstrFormats.td
    llvm/branches/non-call-eh/lib/Target/PIC16/PIC16InstrInfo.cpp
    llvm/branches/non-call-eh/lib/Target/PIC16/PIC16InstrInfo.h
    llvm/branches/non-call-eh/lib/Target/PIC16/PIC16InstrInfo.td
    llvm/branches/non-call-eh/lib/Target/PIC16/PIC16RegisterInfo.cpp
    llvm/branches/non-call-eh/lib/Target/PIC16/PIC16RegisterInfo.h
    llvm/branches/non-call-eh/lib/Target/PIC16/PIC16RegisterInfo.td
    llvm/branches/non-call-eh/lib/Target/PIC16/PIC16Subtarget.cpp
    llvm/branches/non-call-eh/lib/Target/PIC16/PIC16Subtarget.h
    llvm/branches/non-call-eh/lib/Target/PIC16/PIC16TargetAsmInfo.cpp
    llvm/branches/non-call-eh/lib/Target/PIC16/PIC16TargetAsmInfo.h
    llvm/branches/non-call-eh/lib/Target/PIC16/PIC16TargetMachine.cpp
    llvm/branches/non-call-eh/lib/Target/PIC16/PIC16TargetMachine.h
    llvm/branches/non-call-eh/lib/Transforms/Scalar/LoopDeletion.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/SimplifyCFGPass.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/SimplifyLibCalls.cpp
    llvm/branches/non-call-eh/lib/Transforms/Utils/UnrollLoop.cpp
    llvm/branches/non-call-eh/lib/VMCore/Use.cpp
    llvm/branches/non-call-eh/test/Analysis/BasicAA/2008-06-02-GEPTailCrash.ll
    llvm/branches/non-call-eh/test/Analysis/BasicAA/no-escape-call.ll
    llvm/branches/non-call-eh/test/Analysis/PostDominators/   (with props)
    llvm/branches/non-call-eh/test/Analysis/PostDominators/2006-09-26-PostDominanceFrontier.ll
    llvm/branches/non-call-eh/test/Analysis/PostDominators/2007-04-17-PostDominanceFrontier.ll
    llvm/branches/non-call-eh/test/Analysis/PostDominators/2007-04-20-PostDom-Reset.ll
    llvm/branches/non-call-eh/test/Analysis/PostDominators/dg.exp
    llvm/branches/non-call-eh/test/Analysis/PostDominators/pr1098.ll
    llvm/branches/non-call-eh/test/Analysis/ScalarEvolution/2008-05-25-NegativeStepToZero.ll
    llvm/branches/non-call-eh/test/Analysis/ScalarEvolution/2008-06-12-BinomialInt64.ll
    llvm/branches/non-call-eh/test/Assembler/aggregate-constant-values.ll
    llvm/branches/non-call-eh/test/Assembler/aggregate-return-single-value.ll
    llvm/branches/non-call-eh/test/Assembler/huge-array.ll
    llvm/branches/non-call-eh/test/Assembler/insertextractvalue.ll
    llvm/branches/non-call-eh/test/Bitcode/sse2_loadl_pd.ll
    llvm/branches/non-call-eh/test/Bitcode/sse2_loadl_pd.ll.bc
    llvm/branches/non-call-eh/test/Bitcode/sse2_movs_d.ll
    llvm/branches/non-call-eh/test/Bitcode/sse2_movs_d.ll.bc
    llvm/branches/non-call-eh/test/Bitcode/sse2_punpck_qdq.ll
    llvm/branches/non-call-eh/test/Bitcode/sse2_punpck_qdq.ll.bc
    llvm/branches/non-call-eh/test/Bitcode/sse2_shuf_pd.ll
    llvm/branches/non-call-eh/test/Bitcode/sse2_shuf_pd.ll.bc
    llvm/branches/non-call-eh/test/Bitcode/sse2_unpck_pd.ll
    llvm/branches/non-call-eh/test/Bitcode/sse2_unpck_pd.ll.bc
    llvm/branches/non-call-eh/test/CodeGen/ARM/2008-05-19-LiveIntervalsBug.ll
    llvm/branches/non-call-eh/test/CodeGen/ARM/2008-05-19-ScavengerAssert.ll
    llvm/branches/non-call-eh/test/CodeGen/CBackend/2008-05-21-MRV-InlineAsm.ll
    llvm/branches/non-call-eh/test/CodeGen/CBackend/2008-05-31-BoolOverflow.ll
    llvm/branches/non-call-eh/test/CodeGen/CBackend/2008-06-04-IndirectMem.ll
    llvm/branches/non-call-eh/test/CodeGen/CellSPU/and_ops_more.ll
    llvm/branches/non-call-eh/test/CodeGen/Generic/getresult-undef.ll
    llvm/branches/non-call-eh/test/CodeGen/Generic/multiple-return-values-cross-block-with-invoke.ll
    llvm/branches/non-call-eh/test/CodeGen/Generic/select-cc.ll
    llvm/branches/non-call-eh/test/CodeGen/PowerPC/2008-04-23-CoalescerCrash.ll
    llvm/branches/non-call-eh/test/CodeGen/PowerPC/2008-05-01-ppc_fp128.ll
    llvm/branches/non-call-eh/test/CodeGen/PowerPC/2008-06-19-LegalizerCrash.ll
    llvm/branches/non-call-eh/test/CodeGen/PowerPC/2008-06-21-F128LoadStore.ll
    llvm/branches/non-call-eh/test/CodeGen/PowerPC/2008-06-23-LiveVariablesCrash.ll
    llvm/branches/non-call-eh/test/CodeGen/PowerPC/tailcall1-64.ll
    llvm/branches/non-call-eh/test/CodeGen/PowerPC/tailcall1.ll
    llvm/branches/non-call-eh/test/CodeGen/PowerPC/tailcallpic1.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2008-04-24-MemCpyBug.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2008-04-24-pblendw-fold-crash.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2008-04-26-Asm-Optimize-Imm.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2008-04-28-CoalescerBug.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2008-04-28-CyclicSchedUnit.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-01-InvalidOrdCompare.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-06-SpillerBug.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-09-PHIElimBug.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-09-ShuffleLoweringBug.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-12-tailmerge-5.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-21-CoalescerBug.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-22-FoldUnalignedLoad.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-28-CoalescerBug.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2008-05-28-LocalRegAllocBug.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-04-MemCpyLoweringBug.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-13-NotVolatileLoadStore.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-13-SpillerCommuting.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-13-VolatileLoadStore.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-16-SubregsBug.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-18-BadShuffle.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2008-06-25-VecISelBug.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/asm-indirect-mem.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/atomic_op.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/combine-lds.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/commute-intrinsic.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/extractelement-load.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/fold-call.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/inline-asm-mrv.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/isnan.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/isnan2.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/memcpy-2.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/memmove-4.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/memset.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/mmx-arg-passing.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/mmx-arg-passing2.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/pmul.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/pr2326.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/remat-mov0.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/subclass-coalesce.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/tailcallstack64.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/twoaddr-remat.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/uint_to_fp.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/variadic-node-pic.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_insert-5.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_insert-6.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_insert_4.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_loadhl.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-C.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-D.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-E.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-F.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-G.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-H.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-I.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_shift3.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-18.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vortex-bug.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-1.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-10.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-11.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-2.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-3.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-4.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-5.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-6.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-7.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-8.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-pic-9.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/x86-64-sret-return.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/2008-06-05-APInt-OverAShr.ll
    llvm/branches/non-call-eh/test/FrontendC/   (with props)
    llvm/branches/non-call-eh/test/FrontendC++/   (with props)
    llvm/branches/non-call-eh/test/FrontendC++/2003-08-20-ExceptionFail.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-08-21-EmptyClass.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-08-24-Cleanup.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-08-27-TypeNamespaces.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-08-28-ForwardType.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-08-28-SaveExprBug.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-08-29-ArgPassingBug.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-08-31-StructLayout.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-09-22-CompositeExprValue.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-09-29-ArgumentNumberMismatch.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-09-30-CommaExprBug.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-09-30-ForIncrementExprBug.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-09-30-ForIncrementExprBug2.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-09-30-NestedFunctionDecl.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-10-17-BoolBitfields.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-10-21-InnerClass.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-10-27-VirtualBaseClassCrash.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-11-02-WeakLinkage.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-11-04-ArrayConstructors.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-11-04-CatchLabelName.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-11-08-ArrayAddress.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-11-09-ConstructorTypeSafety.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-11-18-EnumArray.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-11-18-MemberInitializationCasting.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-11-18-PtrMemConstantInitializer.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-11-25-ReturningOpaqueByValue.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-11-27-MultipleInheritanceThunk.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-11-29-DuplicatedCleanupTest.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2003-12-08-ArrayOfPtrToMemberFunc.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2004-01-11-DynamicInitializedConstant.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2004-03-08-ReinterpretCastCopy.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2004-03-09-UnmangledBuiltinMethods.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2004-03-15-CleanupsAndGotos.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2004-06-08-LateTemplateInstantiation.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2004-09-27-CompilerCrash.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2004-09-27-DidntEmitTemplate.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2004-11-27-EmitsUnusedInlineFunctions.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2004-11-27-ExceptionCleanupAssertion.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2004-11-27-FriendDefaultArgCrash.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2004-11-27-InlineAsmFunctionRedefinition.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2005-01-03-StaticInitializers.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2005-02-11-AnonymousUnion.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2005-02-13-BadDynamicInit.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2005-02-14-BitFieldOffset.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2005-02-19-BitfieldStructCrash.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2005-02-19-UnnamedVirtualThunkArgument.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2005-02-20-BrokenReferenceTest.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2005-02-27-PlacementArrayNewCrash.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2005-07-21-VirtualBaseAccess.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2006-03-01-GimplifyCrash.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2006-03-06-C++RecurseCrash.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2006-09-08-powi.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2006-09-12-OpaqueStructCrash.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2006-09-27-Debug-Protection.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2006-10-30-ClassBitfield.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2006-11-06-StackTrace.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2006-11-20-GlobalSymbols.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2006-11-30-ConstantExprCrash.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2006-11-30-NoCompileUnit.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2006-11-30-Pubnames.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2007-01-02-UnboundedArray.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2007-01-06-ELF-Thunk-Sections.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2007-01-06-PtrMethodInit.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2007-03-27-FunctionVarRename.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2007-04-05-PackedBitFields-1.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2007-04-05-PackedBitFieldsOverlap-2.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2007-04-05-PackedBitFieldsOverlap.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2007-04-05-PackedBitFieldsSmall.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2007-04-05-StructPackedFieldUnpacked.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2007-04-10-PackedUnion.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2007-04-11-InlineStorageClassC++.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2007-04-14-FNoBuiltin.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2007-04-31-TryCatch.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2007-05-03-VectorInit.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2007-05-16-ReverseBitFieldCrash.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2007-05-23-TryFinally.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2007-07-04-NestedCatches.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2007-07-29-RestrictPtrArg.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2007-07-29-RestrictRefArg.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2007-08-01-RestrictMethod.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2007-09-10-RecursiveTypeResolution.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2007-10-01-StructResize.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2008-01-11-BadWarning.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2008-01-12-VecInit.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2008-02-13-sret.cpp
    llvm/branches/non-call-eh/test/FrontendC++/2008-05-07-CrazyOffsetOf.cpp
    llvm/branches/non-call-eh/test/FrontendC++/dg.exp
    llvm/branches/non-call-eh/test/FrontendC++/ptr-to-method-devirt.cpp
    llvm/branches/non-call-eh/test/FrontendC/2002-01-23-LoadQISIReloadFailure.c
    llvm/branches/non-call-eh/test/FrontendC/2002-01-24-ComplexSpaceInType.c
    llvm/branches/non-call-eh/test/FrontendC/2002-01-24-HandleCallInsnSEGV.c
    llvm/branches/non-call-eh/test/FrontendC/2002-02-13-ConditionalInCall.c
    llvm/branches/non-call-eh/test/FrontendC/2002-02-13-ReloadProblem.c
    llvm/branches/non-call-eh/test/FrontendC/2002-02-13-TypeVarNameCollision.c
    llvm/branches/non-call-eh/test/FrontendC/2002-02-13-UnnamedLocal.c
    llvm/branches/non-call-eh/test/FrontendC/2002-02-14-EntryNodePreds.c
    llvm/branches/non-call-eh/test/FrontendC/2002-02-16-RenamingTest.c
    llvm/branches/non-call-eh/test/FrontendC/2002-02-17-ArgumentAddress.c
    llvm/branches/non-call-eh/test/FrontendC/2002-02-18-64bitConstant.c
    llvm/branches/non-call-eh/test/FrontendC/2002-02-18-StaticData.c
    llvm/branches/non-call-eh/test/FrontendC/2002-03-11-LargeCharInString.c
    llvm/branches/non-call-eh/test/FrontendC/2002-03-12-ArrayInitialization.c
    llvm/branches/non-call-eh/test/FrontendC/2002-03-12-StructInitialize.c
    llvm/branches/non-call-eh/test/FrontendC/2002-03-12-StructInitializer.c
    llvm/branches/non-call-eh/test/FrontendC/2002-03-14-BrokenPHINode.c
    llvm/branches/non-call-eh/test/FrontendC/2002-03-14-BrokenSSA.c
    llvm/branches/non-call-eh/test/FrontendC/2002-03-14-QuotesInStrConst.c
    llvm/branches/non-call-eh/test/FrontendC/2002-04-07-SwitchStmt.c
    llvm/branches/non-call-eh/test/FrontendC/2002-04-08-LocalArray.c
    llvm/branches/non-call-eh/test/FrontendC/2002-04-09-StructRetVal.c
    llvm/branches/non-call-eh/test/FrontendC/2002-04-10-StructParameters.c
    llvm/branches/non-call-eh/test/FrontendC/2002-05-23-StaticValues.c
    llvm/branches/non-call-eh/test/FrontendC/2002-05-23-TypeNameCollision.c
    llvm/branches/non-call-eh/test/FrontendC/2002-05-24-Alloca.c
    llvm/branches/non-call-eh/test/FrontendC/2002-06-25-FWriteInterfaceFailure.c
    llvm/branches/non-call-eh/test/FrontendC/2002-07-14-MiscListTests.c
    llvm/branches/non-call-eh/test/FrontendC/2002-07-14-MiscTests.c
    llvm/branches/non-call-eh/test/FrontendC/2002-07-14-MiscTests2.c
    llvm/branches/non-call-eh/test/FrontendC/2002-07-14-MiscTests3.c
    llvm/branches/non-call-eh/test/FrontendC/2002-07-16-HardStringInit.c
    llvm/branches/non-call-eh/test/FrontendC/2002-07-17-StringConstant.c
    llvm/branches/non-call-eh/test/FrontendC/2002-07-29-Casts.c
    llvm/branches/non-call-eh/test/FrontendC/2002-07-30-SubregSetAssertion.c
    llvm/branches/non-call-eh/test/FrontendC/2002-07-30-UnionTest.c
    llvm/branches/non-call-eh/test/FrontendC/2002-07-30-VarArgsCallFailure.c
    llvm/branches/non-call-eh/test/FrontendC/2002-07-31-BadAssert.c
    llvm/branches/non-call-eh/test/FrontendC/2002-07-31-SubregFailure.c
    llvm/branches/non-call-eh/test/FrontendC/2002-08-02-UnionTest.c
    llvm/branches/non-call-eh/test/FrontendC/2002-08-19-RecursiveLocals.c
    llvm/branches/non-call-eh/test/FrontendC/2002-09-08-PointerShifts.c
    llvm/branches/non-call-eh/test/FrontendC/2002-09-18-UnionProblem.c
    llvm/branches/non-call-eh/test/FrontendC/2002-09-19-StarInLabel.c
    llvm/branches/non-call-eh/test/FrontendC/2002-10-12-TooManyArguments.c
    llvm/branches/non-call-eh/test/FrontendC/2002-12-15-GlobalBoolTest.c
    llvm/branches/non-call-eh/test/FrontendC/2002-12-15-GlobalConstantTest.c
    llvm/branches/non-call-eh/test/FrontendC/2002-12-15-GlobalRedefinition.c
    llvm/branches/non-call-eh/test/FrontendC/2002-12-15-StructParameters.c
    llvm/branches/non-call-eh/test/FrontendC/2003-01-30-UnionInit.c
    llvm/branches/non-call-eh/test/FrontendC/2003-03-03-DeferredType.c
    llvm/branches/non-call-eh/test/FrontendC/2003-06-22-UnionCrash.c
    llvm/branches/non-call-eh/test/FrontendC/2003-06-23-GCC-fold-infinite-recursion.c
    llvm/branches/non-call-eh/test/FrontendC/2003-06-26-CFECrash.c
    llvm/branches/non-call-eh/test/FrontendC/2003-06-29-MultipleFunctionDefinition.c
    llvm/branches/non-call-eh/test/FrontendC/2003-07-22-ArrayAccessTypeSafety.c
    llvm/branches/non-call-eh/test/FrontendC/2003-08-06-BuiltinSetjmpLongjmp.c
    llvm/branches/non-call-eh/test/FrontendC/2003-08-17-DeadCodeShortCircuit.c
    llvm/branches/non-call-eh/test/FrontendC/2003-08-18-SigSetJmp.c
    llvm/branches/non-call-eh/test/FrontendC/2003-08-18-StructAsValue.c
    llvm/branches/non-call-eh/test/FrontendC/2003-08-20-BadBitfieldRef.c
    llvm/branches/non-call-eh/test/FrontendC/2003-08-20-PrototypeMismatch.c
    llvm/branches/non-call-eh/test/FrontendC/2003-08-20-vfork-bug.c
    llvm/branches/non-call-eh/test/FrontendC/2003-08-21-BinOp-Type-Mismatch.c
    llvm/branches/non-call-eh/test/FrontendC/2003-08-21-StmtExpr.c
    llvm/branches/non-call-eh/test/FrontendC/2003-08-21-WideString.c
    llvm/branches/non-call-eh/test/FrontendC/2003-08-23-LocalUnionTest.c
    llvm/branches/non-call-eh/test/FrontendC/2003-08-29-BitFieldStruct.c
    llvm/branches/non-call-eh/test/FrontendC/2003-08-29-HugeCharConst.c
    llvm/branches/non-call-eh/test/FrontendC/2003-08-29-StructLayoutBug.c
    llvm/branches/non-call-eh/test/FrontendC/2003-08-30-AggregateInitializer.c
    llvm/branches/non-call-eh/test/FrontendC/2003-08-30-LargeIntegerBitfieldMember.c
    llvm/branches/non-call-eh/test/FrontendC/2003-09-18-BitfieldTests.c
    llvm/branches/non-call-eh/test/FrontendC/2003-09-30-StructLayout.c
    llvm/branches/non-call-eh/test/FrontendC/2003-10-02-UnionLValueError.c
    llvm/branches/non-call-eh/test/FrontendC/2003-10-06-NegateExprType.c
    llvm/branches/non-call-eh/test/FrontendC/2003-10-09-UnionInitializerBug.c
    llvm/branches/non-call-eh/test/FrontendC/2003-10-28-ident.c
    llvm/branches/non-call-eh/test/FrontendC/2003-10-29-AsmRename.c
    llvm/branches/non-call-eh/test/FrontendC/2003-11-01-C99-CompoundLiteral.c
    llvm/branches/non-call-eh/test/FrontendC/2003-11-01-EmptyStructCrash.c
    llvm/branches/non-call-eh/test/FrontendC/2003-11-01-GlobalUnionInit.c
    llvm/branches/non-call-eh/test/FrontendC/2003-11-03-AddrArrayElement.c
    llvm/branches/non-call-eh/test/FrontendC/2003-11-04-EmptyStruct.c
    llvm/branches/non-call-eh/test/FrontendC/2003-11-04-OutOfMemory.c
    llvm/branches/non-call-eh/test/FrontendC/2003-11-08-PointerSubNotGetelementptr.c
    llvm/branches/non-call-eh/test/FrontendC/2003-11-12-VoidString.c
    llvm/branches/non-call-eh/test/FrontendC/2003-11-13-TypeSafety.c
    llvm/branches/non-call-eh/test/FrontendC/2003-11-16-StaticArrayInit.c
    llvm/branches/non-call-eh/test/FrontendC/2003-11-18-CondExprLValue.c
    llvm/branches/non-call-eh/test/FrontendC/2003-11-19-AddressOfRegister.c
    llvm/branches/non-call-eh/test/FrontendC/2003-11-19-BitFieldArray.c
    llvm/branches/non-call-eh/test/FrontendC/2003-11-20-Bitfields.c
    llvm/branches/non-call-eh/test/FrontendC/2003-11-20-ComplexDivision.c
    llvm/branches/non-call-eh/test/FrontendC/2003-11-20-UnionBitfield.c
    llvm/branches/non-call-eh/test/FrontendC/2003-11-26-PointerShift.c
    llvm/branches/non-call-eh/test/FrontendC/2003-11-27-ConstructorCast.c
    llvm/branches/non-call-eh/test/FrontendC/2003-11-27-UnionCtorInitialization.c
    llvm/branches/non-call-eh/test/FrontendC/2003-12-14-ExternInlineSupport.c
    llvm/branches/non-call-eh/test/FrontendC/2004-01-01-UnknownInitSize.c
    llvm/branches/non-call-eh/test/FrontendC/2004-01-08-ExternInlineRedefine.c
    llvm/branches/non-call-eh/test/FrontendC/2004-02-12-LargeAggregateCopy.c
    llvm/branches/non-call-eh/test/FrontendC/2004-02-13-BuiltinFrameReturnAddress.c
    llvm/branches/non-call-eh/test/FrontendC/2004-02-13-IllegalVararg.c
    llvm/branches/non-call-eh/test/FrontendC/2004-02-13-Memset.c
    llvm/branches/non-call-eh/test/FrontendC/2004-02-14-ZeroInitializer.c
    llvm/branches/non-call-eh/test/FrontendC/2004-02-20-Builtins.c
    llvm/branches/non-call-eh/test/FrontendC/2004-03-07-ComplexDivEquals.c
    llvm/branches/non-call-eh/test/FrontendC/2004-03-07-ExternalConstant.c
    llvm/branches/non-call-eh/test/FrontendC/2004-03-09-LargeArrayInitializers.c
    llvm/branches/non-call-eh/test/FrontendC/2004-03-15-SimpleIndirectGoto.c
    llvm/branches/non-call-eh/test/FrontendC/2004-03-16-AsmRegisterCrash.c
    llvm/branches/non-call-eh/test/FrontendC/2004-05-07-VarArrays.c
    llvm/branches/non-call-eh/test/FrontendC/2004-05-21-IncompleteEnum.c
    llvm/branches/non-call-eh/test/FrontendC/2004-06-08-OpaqueStructArg.c
    llvm/branches/non-call-eh/test/FrontendC/2004-06-17-UnorderedBuiltins.c
    llvm/branches/non-call-eh/test/FrontendC/2004-06-17-UnorderedCompares.c
    llvm/branches/non-call-eh/test/FrontendC/2004-06-18-VariableLengthArrayOfStructures.c
    llvm/branches/non-call-eh/test/FrontendC/2004-07-06-FunctionCast.c
    llvm/branches/non-call-eh/test/FrontendC/2004-08-06-LargeStructTest.c
    llvm/branches/non-call-eh/test/FrontendC/2004-11-25-UnnamedBitfieldPadding.c
    llvm/branches/non-call-eh/test/FrontendC/2004-11-27-InvalidConstantExpr.c
    llvm/branches/non-call-eh/test/FrontendC/2004-11-27-StaticFunctionRedeclare.c
    llvm/branches/non-call-eh/test/FrontendC/2004-11-27-VariableSizeInStructure.c
    llvm/branches/non-call-eh/test/FrontendC/2005-01-02-ConstantInits.c
    llvm/branches/non-call-eh/test/FrontendC/2005-01-02-PointerDifference.c
    llvm/branches/non-call-eh/test/FrontendC/2005-01-02-VAArgError-ICE.c
    llvm/branches/non-call-eh/test/FrontendC/2005-02-20-AggregateSAVEEXPR.c
    llvm/branches/non-call-eh/test/FrontendC/2005-02-27-MarkGlobalConstant.c
    llvm/branches/non-call-eh/test/FrontendC/2005-03-05-OffsetOfHack.c
    llvm/branches/non-call-eh/test/FrontendC/2005-03-06-OffsetOfStructCrash.c
    llvm/branches/non-call-eh/test/FrontendC/2005-03-11-Prefetch.c
    llvm/branches/non-call-eh/test/FrontendC/2005-04-09-ComplexOps.c
    llvm/branches/non-call-eh/test/FrontendC/2005-05-06-CountBuiltins.c
    llvm/branches/non-call-eh/test/FrontendC/2005-05-10-GlobalUnionInit.c
    llvm/branches/non-call-eh/test/FrontendC/2005-06-15-ExpandGotoInternalProblem.c
    llvm/branches/non-call-eh/test/FrontendC/2005-07-20-SqrtNoErrno.c
    llvm/branches/non-call-eh/test/FrontendC/2005-07-26-UnionInitCrash.c
    llvm/branches/non-call-eh/test/FrontendC/2005-07-28-IncorrectWeakGlobal.c
    llvm/branches/non-call-eh/test/FrontendC/2005-09-20-ComplexConstants.c
    llvm/branches/non-call-eh/test/FrontendC/2005-09-24-AsmUserPrefix.c
    llvm/branches/non-call-eh/test/FrontendC/2005-09-24-BitFieldCrash.c
    llvm/branches/non-call-eh/test/FrontendC/2005-10-18-VariableSizedElementCrash.c
    llvm/branches/non-call-eh/test/FrontendC/2005-12-04-AttributeUsed.c
    llvm/branches/non-call-eh/test/FrontendC/2005-12-04-DeclarationLineNumbers.c
    llvm/branches/non-call-eh/test/FrontendC/2006-01-13-Includes.c
    llvm/branches/non-call-eh/test/FrontendC/2006-01-13-StackSave.c
    llvm/branches/non-call-eh/test/FrontendC/2006-01-16-BitCountIntrinsicsUnsigned.c
    llvm/branches/non-call-eh/test/FrontendC/2006-01-23-FileScopeAsm.c
    llvm/branches/non-call-eh/test/FrontendC/2006-03-03-MissingInitializer.c
    llvm/branches/non-call-eh/test/FrontendC/2006-03-16-VectorCtor.c
    llvm/branches/non-call-eh/test/FrontendC/2006-03-17-KnRMismatch.c
    llvm/branches/non-call-eh/test/FrontendC/2006-05-01-AppleAlignmentPragma.c
    llvm/branches/non-call-eh/test/FrontendC/2006-05-19-SingleEltReturn.c
    llvm/branches/non-call-eh/test/FrontendC/2006-07-31-PR854.c
    llvm/branches/non-call-eh/test/FrontendC/2006-09-11-BitfieldRefCrash.c
    llvm/branches/non-call-eh/test/FrontendC/2006-09-18-fwrite-cast-crash.c
    llvm/branches/non-call-eh/test/FrontendC/2006-09-21-IncompleteElementType.c
    llvm/branches/non-call-eh/test/FrontendC/2006-09-25-DebugFilename.c
    llvm/branches/non-call-eh/test/FrontendC/2006-09-25-DebugFilename.h
    llvm/branches/non-call-eh/test/FrontendC/2006-09-28-SimpleAsm.c
    llvm/branches/non-call-eh/test/FrontendC/2006-10-30-ArrayCrash.c
    llvm/branches/non-call-eh/test/FrontendC/2006-12-14-ordered_expr.c
    llvm/branches/non-call-eh/test/FrontendC/2007-01-06-KNR-Proto.c
    llvm/branches/non-call-eh/test/FrontendC/2007-01-20-VectorICE.c
    llvm/branches/non-call-eh/test/FrontendC/2007-01-24-InlineAsmCModifier.c
    llvm/branches/non-call-eh/test/FrontendC/2007-02-04-AddrLValue-2.c
    llvm/branches/non-call-eh/test/FrontendC/2007-02-04-AddrLValue.c
    llvm/branches/non-call-eh/test/FrontendC/2007-02-04-EmptyStruct.c
    llvm/branches/non-call-eh/test/FrontendC/2007-02-04-WITH_SIZE_EXPR.c
    llvm/branches/non-call-eh/test/FrontendC/2007-02-05-nested.c
    llvm/branches/non-call-eh/test/FrontendC/2007-02-07-AddrLabel.c
    llvm/branches/non-call-eh/test/FrontendC/2007-02-16-VariableSizeStructArg.c
    llvm/branches/non-call-eh/test/FrontendC/2007-02-16-VoidPtrDiff.c
    llvm/branches/non-call-eh/test/FrontendC/2007-02-16-WritableStrings.c
    llvm/branches/non-call-eh/test/FrontendC/2007-02-25-C-DotDotDot.c
    llvm/branches/non-call-eh/test/FrontendC/2007-03-01-VarSizeArrayIdx.c
    llvm/branches/non-call-eh/test/FrontendC/2007-03-05-DataLayout.c
    llvm/branches/non-call-eh/test/FrontendC/2007-03-06-VarSizeInStruct1.c
    llvm/branches/non-call-eh/test/FrontendC/2007-03-06-VarSizeInStruct2.c
    llvm/branches/non-call-eh/test/FrontendC/2007-03-26-BitfieldAfterZeroWidth.c
    llvm/branches/non-call-eh/test/FrontendC/2007-03-26-ZeroWidthBitfield.c
    llvm/branches/non-call-eh/test/FrontendC/2007-03-27-ArrayCompatible.c
    llvm/branches/non-call-eh/test/FrontendC/2007-03-27-VarLengthArray.c
    llvm/branches/non-call-eh/test/FrontendC/2007-04-05-PackedBitFields-2.c
    llvm/branches/non-call-eh/test/FrontendC/2007-04-05-PackedBitFields.c
    llvm/branches/non-call-eh/test/FrontendC/2007-04-05-PackedStruct.c
    llvm/branches/non-call-eh/test/FrontendC/2007-04-05-PadBeforeZeroLengthField.c
    llvm/branches/non-call-eh/test/FrontendC/2007-04-05-UnPackedStruct.c
    llvm/branches/non-call-eh/test/FrontendC/2007-04-11-InlineAsmStruct.c
    llvm/branches/non-call-eh/test/FrontendC/2007-04-11-InlineAsmUnion.c
    llvm/branches/non-call-eh/test/FrontendC/2007-04-11-InlineStorageClassC89.c
    llvm/branches/non-call-eh/test/FrontendC/2007-04-11-InlineStorageClassC99.c
    llvm/branches/non-call-eh/test/FrontendC/2007-04-11-PR1321.c
    llvm/branches/non-call-eh/test/FrontendC/2007-04-13-InlineAsmStruct2.c
    llvm/branches/non-call-eh/test/FrontendC/2007-04-13-InlineAsmUnion2.c
    llvm/branches/non-call-eh/test/FrontendC/2007-04-14-FNoBuiltin.c
    llvm/branches/non-call-eh/test/FrontendC/2007-04-17-ZeroSizeBitFields.c
    llvm/branches/non-call-eh/test/FrontendC/2007-04-24-VolatileStructCopy.c
    llvm/branches/non-call-eh/test/FrontendC/2007-04-24-bit-not-expr.c
    llvm/branches/non-call-eh/test/FrontendC/2007-04-24-str-const.c
    llvm/branches/non-call-eh/test/FrontendC/2007-05-07-NestedStructReturn.c
    llvm/branches/non-call-eh/test/FrontendC/2007-05-07-PaddingElements.c
    llvm/branches/non-call-eh/test/FrontendC/2007-05-08-PCH.c
    llvm/branches/non-call-eh/test/FrontendC/2007-05-11-str-const.c
    llvm/branches/non-call-eh/test/FrontendC/2007-05-15-PaddingElement.c
    llvm/branches/non-call-eh/test/FrontendC/2007-05-16-EmptyStruct.c
    llvm/branches/non-call-eh/test/FrontendC/2007-05-29-UnionCopy.c
    llvm/branches/non-call-eh/test/FrontendC/2007-06-05-NoInlineAttribute.c
    llvm/branches/non-call-eh/test/FrontendC/2007-06-15-AnnotateAttribute.c
    llvm/branches/non-call-eh/test/FrontendC/2007-06-18-SextAttrAggregate.c
    llvm/branches/non-call-eh/test/FrontendC/2007-07-29-RestrictPtrArg.c
    llvm/branches/non-call-eh/test/FrontendC/2007-08-01-LoadStoreAlign.c
    llvm/branches/non-call-eh/test/FrontendC/2007-08-21-ComplexCst.c
    llvm/branches/non-call-eh/test/FrontendC/2007-08-22-CTTZ.c
    llvm/branches/non-call-eh/test/FrontendC/2007-09-05-ConstCtor.c
    llvm/branches/non-call-eh/test/FrontendC/2007-09-12-PragmaPack.c
    llvm/branches/non-call-eh/test/FrontendC/2007-09-14-NegatePointer.c
    llvm/branches/non-call-eh/test/FrontendC/2007-09-17-WeakRef.c
    llvm/branches/non-call-eh/test/FrontendC/2007-09-20-GcrootAttribute.c
    llvm/branches/non-call-eh/test/FrontendC/2007-09-26-Alignment.c
    llvm/branches/non-call-eh/test/FrontendC/2007-09-27-ComplexIntCompare.c
    llvm/branches/non-call-eh/test/FrontendC/2007-09-28-PackedUnionMember.c
    llvm/branches/non-call-eh/test/FrontendC/2007-10-01-BuildArrayRef.c
    llvm/branches/non-call-eh/test/FrontendC/2007-10-02-VolatileArray.c
    llvm/branches/non-call-eh/test/FrontendC/2007-10-15-VoidPtr.c
    llvm/branches/non-call-eh/test/FrontendC/2007-10-30-Volatile.c
    llvm/branches/non-call-eh/test/FrontendC/2007-11-07-AlignedMemcpy.c
    llvm/branches/non-call-eh/test/FrontendC/2007-11-07-CopyAggregateAlign.c
    llvm/branches/non-call-eh/test/FrontendC/2007-11-07-ZeroAggregateAlign.c
    llvm/branches/non-call-eh/test/FrontendC/2007-11-27-SExtZExt.c
    llvm/branches/non-call-eh/test/FrontendC/2007-11-28-GlobalInitializer.c
    llvm/branches/non-call-eh/test/FrontendC/2007-12-16-AsmNoUnwind.c
    llvm/branches/non-call-eh/test/FrontendC/2007-12-VarArrayDebug.c
    llvm/branches/non-call-eh/test/FrontendC/2008-01-04-WideBitfield.c
    llvm/branches/non-call-eh/test/FrontendC/2008-01-07-UnusualIntSize.c
    llvm/branches/non-call-eh/test/FrontendC/2008-01-11-ChainConsistency.c
    llvm/branches/non-call-eh/test/FrontendC/2008-01-21-PackedBitFields.c
    llvm/branches/non-call-eh/test/FrontendC/2008-01-21-PackedStructField.c
    llvm/branches/non-call-eh/test/FrontendC/2008-01-24-StructAlignAndBitFields.c
    llvm/branches/non-call-eh/test/FrontendC/2008-01-25-ByValReadNone.c
    llvm/branches/non-call-eh/test/FrontendC/2008-01-25-ZeroSizedAggregate.c
    llvm/branches/non-call-eh/test/FrontendC/2008-01-28-PragmaMark.c
    llvm/branches/non-call-eh/test/FrontendC/2008-01-28-UnionSize.c
    llvm/branches/non-call-eh/test/FrontendC/2008-02-11-AnnotateBuiltin.c
    llvm/branches/non-call-eh/test/FrontendC/2008-03-03-CtorAttrType.c
    llvm/branches/non-call-eh/test/FrontendC/2008-03-05-syncPtr.c
    llvm/branches/non-call-eh/test/FrontendC/2008-03-24-BitField-And-Alloca.c
    llvm/branches/non-call-eh/test/FrontendC/2008-03-26-PackedBitFields.c
    llvm/branches/non-call-eh/test/FrontendC/2008-04-08-NoExceptions.c
    llvm/branches/non-call-eh/test/FrontendC/2008-05-06-CFECrash.c
    llvm/branches/non-call-eh/test/FrontendC/2008-05-12-TempUsedBeforeDef.c
    llvm/branches/non-call-eh/test/FrontendC/2008-05-19-AlwaysInline.c
    llvm/branches/non-call-eh/test/FrontendC/BasicInstrs.c
    llvm/branches/non-call-eh/test/FrontendC/attribute_constructor.c
    llvm/branches/non-call-eh/test/FrontendC/block-copy.c
    llvm/branches/non-call-eh/test/FrontendC/dg.exp
    llvm/branches/non-call-eh/test/FrontendC/exact-div-expr.c
    llvm/branches/non-call-eh/test/FrontendC/extern-weak.c
    llvm/branches/non-call-eh/test/FrontendC/funccall.c
    llvm/branches/non-call-eh/test/FrontendC/hidden-visibility.c
    llvm/branches/non-call-eh/test/FrontendC/inline-asm-mrv.c
    llvm/branches/non-call-eh/test/FrontendC/libcalls.c
    llvm/branches/non-call-eh/test/FrontendC/nested-functions.c
    llvm/branches/non-call-eh/test/FrontendC/sret.c
    llvm/branches/non-call-eh/test/FrontendC/sret2.c
    llvm/branches/non-call-eh/test/FrontendC/unaligned-memcpy.c
    llvm/branches/non-call-eh/test/FrontendFortran/
    llvm/branches/non-call-eh/test/FrontendFortran/cpow.f90
    llvm/branches/non-call-eh/test/FrontendFortran/dg.exp
    llvm/branches/non-call-eh/test/LLVMC/   (with props)
    llvm/branches/non-call-eh/test/LLVMC/dg.exp
    llvm/branches/non-call-eh/test/LLVMC/false.c
    llvm/branches/non-call-eh/test/LLVMC/hello.c
    llvm/branches/non-call-eh/test/LLVMC/hello.cpp
    llvm/branches/non-call-eh/test/LLVMC/opt-test.c
    llvm/branches/non-call-eh/test/LLVMC/sink.c
    llvm/branches/non-call-eh/test/LLVMC/test_data/
    llvm/branches/non-call-eh/test/LLVMC/test_data/false.cpp
    llvm/branches/non-call-eh/test/LLVMC/test_data/false2.cpp
    llvm/branches/non-call-eh/test/LLVMC/test_data/together.c
    llvm/branches/non-call-eh/test/LLVMC/together.cpp
    llvm/branches/non-call-eh/test/LLVMC/wall.c
    llvm/branches/non-call-eh/test/Linker/2008-06-13-LinkOnceRedefinition.ll
    llvm/branches/non-call-eh/test/Linker/2008-06-26-AddressSpace.ll
    llvm/branches/non-call-eh/test/Other/2008-06-04-FieldSizeInPacked.ll
    llvm/branches/non-call-eh/test/Transforms/DeadArgElim/2008-06-23-DeadAfterLive.ll
    llvm/branches/non-call-eh/test/Transforms/DeadArgElim/keepalive.ll
    llvm/branches/non-call-eh/test/Transforms/DeadArgElim/multdeadretval.ll
    llvm/branches/non-call-eh/test/Transforms/DeadStoreElimination/volatile-load.ll
    llvm/branches/non-call-eh/test/Transforms/GVN/2008-07-02-Unreachable.ll
    llvm/branches/non-call-eh/test/Transforms/GVN/local-pre.ll
    llvm/branches/non-call-eh/test/Transforms/GVN/nonlocal-cse.ll
    llvm/branches/non-call-eh/test/Transforms/GlobalOpt/2008-04-26-SROA-Global-Align.ll
    llvm/branches/non-call-eh/test/Transforms/IPConstantProp/2008-06-09-WeakProp.ll
    llvm/branches/non-call-eh/test/Transforms/IPConstantProp/return-argument.ll
    llvm/branches/non-call-eh/test/Transforms/IndVarsSimplify/2008-06-15-SCEVExpanderBug.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2008-04-22-ByValBitcast.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2008-04-28-VolatileStore.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2008-04-29-VolatileLoadDontMerge.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2008-04-29-VolatileLoadMerge.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2008-05-08-LiveStoreDelete.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2008-05-08-StrLenSink.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2008-05-09-SinkOfInvoke.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2008-05-17-InfLoop.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2008-05-18-FoldIntToPtr.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2008-05-22-IDivVector.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2008-05-22-NegValVector.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2008-05-23-CompareFold.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2008-05-31-AddBool.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2008-05-31-Bools.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2008-06-05-ashr-crash.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2008-06-08-ICmpPHI.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2008-06-13-InfiniteLoopStore.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2008-06-13-ReadOnlyCallStore.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2008-06-19-UncondLoad.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2008-06-21-CompareMiscomp.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2008-06-24-StackRestore.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/add-shrink.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/add-sitofp.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/cast-mul-select.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/extractvalue.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/fp-ret-bitcast.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/getelementptr-seteq.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/memset.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/mul-masked-bits.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/sext-misc.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/shl-icmp.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/sitofp.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/srem-simplify-bug.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/udiv-simplify-bug-0.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/udiv-simplify-bug-1.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/urem-simplify-bug.ll
    llvm/branches/non-call-eh/test/Transforms/Internalize/   (with props)
    llvm/branches/non-call-eh/test/Transforms/Internalize/2008-05-09-AllButMain.ll
    llvm/branches/non-call-eh/test/Transforms/Internalize/2008-05-09-AllButMain.ll.apifile
    llvm/branches/non-call-eh/test/Transforms/Internalize/dg.exp
    llvm/branches/non-call-eh/test/Transforms/JumpThreading/   (with props)
    llvm/branches/non-call-eh/test/Transforms/JumpThreading/2008-04-24-InfLoop.ll
    llvm/branches/non-call-eh/test/Transforms/JumpThreading/2008-05-05-MRV-Crash.ll
    llvm/branches/non-call-eh/test/Transforms/JumpThreading/and-and-cond.ll
    llvm/branches/non-call-eh/test/Transforms/JumpThreading/and-cond.ll
    llvm/branches/non-call-eh/test/Transforms/JumpThreading/basic.ll
    llvm/branches/non-call-eh/test/Transforms/JumpThreading/compare.ll
    llvm/branches/non-call-eh/test/Transforms/JumpThreading/dg.exp
    llvm/branches/non-call-eh/test/Transforms/LICM/2008-05-20-AliasSetVAArg.ll
    llvm/branches/non-call-eh/test/Transforms/LoopDeletion/   (with props)
    llvm/branches/non-call-eh/test/Transforms/LoopDeletion/2007-07-23-InfiniteLoop.ll
    llvm/branches/non-call-eh/test/Transforms/LoopDeletion/2008-05-06-Phi.ll
    llvm/branches/non-call-eh/test/Transforms/LoopDeletion/dcetest.ll
    llvm/branches/non-call-eh/test/Transforms/LoopDeletion/dg.exp
    llvm/branches/non-call-eh/test/Transforms/LoopIndexSplit/2008-05-19-IndVar.ll
    llvm/branches/non-call-eh/test/Transforms/LoopIndexSplit/2008-06-03-DomFrontier.ll
    llvm/branches/non-call-eh/test/Transforms/LoopRotate/LRCrash-5.ll
    llvm/branches/non-call-eh/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-0.ll
    llvm/branches/non-call-eh/test/Transforms/LoopStrengthReduce/change-compare-stride-trickiness-1.ll
    llvm/branches/non-call-eh/test/Transforms/LoopStrengthReduce/dead-phi.ll
    llvm/branches/non-call-eh/test/Transforms/LoopUnswitch/2008-06-02-DomInfo.ll
    llvm/branches/non-call-eh/test/Transforms/LoopUnswitch/2008-06-17-DomFrontier.ll
    llvm/branches/non-call-eh/test/Transforms/MemCpyOpt/2008-04-29-SRetRemoval.ll
    llvm/branches/non-call-eh/test/Transforms/MemCpyOpt/2008-06-01-MemCpy-MemMove.ll
    llvm/branches/non-call-eh/test/Transforms/PruneEH/2008-06-02-Weak.ll
    llvm/branches/non-call-eh/test/Transforms/SCCP/2008-04-22-multiple-ret-sccp.ll
    llvm/branches/non-call-eh/test/Transforms/SCCP/2008-05-23-UndefCallFold.ll
    llvm/branches/non-call-eh/test/Transforms/SRETPromotion/2008-06-04-function-pointer-passing.ll
    llvm/branches/non-call-eh/test/Transforms/SRETPromotion/2008-06-05-non-call-use.ll
    llvm/branches/non-call-eh/test/Transforms/ScalarRepl/2008-06-05-loadstore-agg.ll
    llvm/branches/non-call-eh/test/Transforms/ScalarRepl/2008-06-22-LargeArray.ll
    llvm/branches/non-call-eh/test/Transforms/SimplifyCFG/2008-04-23-MergeMultipleResultRet.ll
    llvm/branches/non-call-eh/test/Transforms/SimplifyCFG/2008-04-27-MultipleReturnCrash.ll
    llvm/branches/non-call-eh/test/Transforms/SimplifyCFG/2008-05-16-PHIBlockMerge.ll
    llvm/branches/non-call-eh/test/Transforms/SimplifyCFG/SpeculativeExec.ll
    llvm/branches/non-call-eh/test/Transforms/SimplifyLibCalls/2008-05-19-memcmp.ll
    llvm/branches/non-call-eh/test/Transforms/SimplifyLibCalls/abs.ll
    llvm/branches/non-call-eh/test/Transforms/SimplifyLibCalls/exp2.ll
    llvm/branches/non-call-eh/test/Transforms/TailDup/2008-05-13-InfiniteLoop.ll
    llvm/branches/non-call-eh/test/Transforms/TailDup/2008-06-11-AvoidDupLoopHeader.ll
    llvm/branches/non-call-eh/tools/llvmc2/Action.cpp
    llvm/branches/non-call-eh/tools/llvmc2/Action.h
    llvm/branches/non-call-eh/tools/llvmc2/AutoGenerated.cpp
    llvm/branches/non-call-eh/tools/llvmc2/AutoGenerated.h
    llvm/branches/non-call-eh/tools/llvmc2/CompilationGraph.cpp
    llvm/branches/non-call-eh/tools/llvmc2/CompilationGraph.h
    llvm/branches/non-call-eh/tools/llvmc2/Error.h
    llvm/branches/non-call-eh/tools/llvmc2/Graph.td
    llvm/branches/non-call-eh/tools/llvmc2/Tool.h
    llvm/branches/non-call-eh/tools/llvmc2/doc/LLVMC-Reference.rst
    llvm/branches/non-call-eh/tools/llvmc2/doc/LLVMC-Tutorial.rst
    llvm/branches/non-call-eh/tools/llvmc2/doc/Makefile
    llvm/branches/non-call-eh/tools/llvmc2/examples/
    llvm/branches/non-call-eh/tools/llvmc2/examples/Clang.td
    llvm/branches/non-call-eh/tools/llvmc2/examples/Simple.td
    llvm/branches/non-call-eh/tools/llvmc2/llvmc.cpp
    llvm/branches/non-call-eh/tools/lto/   (with props)
    llvm/branches/non-call-eh/tools/lto/LTOCodeGenerator.cpp
    llvm/branches/non-call-eh/tools/lto/LTOCodeGenerator.h
    llvm/branches/non-call-eh/tools/lto/LTOModule.cpp
    llvm/branches/non-call-eh/tools/lto/LTOModule.h
    llvm/branches/non-call-eh/tools/lto/Makefile
    llvm/branches/non-call-eh/tools/lto/lto.cpp
    llvm/branches/non-call-eh/tools/lto/lto.exports
    llvm/branches/non-call-eh/utils/TableGen/LLVMCConfigurationEmitter.cpp
    llvm/branches/non-call-eh/utils/TableGen/LLVMCConfigurationEmitter.h
    llvm/branches/non-call-eh/utils/llvm.grm
    llvm/branches/non-call-eh/win32/common.vsprops
Removed:
    llvm/branches/non-call-eh/docs/CommandGuide/llvm2cpp.pod
    llvm/branches/non-call-eh/docs/CommandGuide/llvmc.pod
    llvm/branches/non-call-eh/include/llvm/ADT/hash_map.in
    llvm/branches/non-call-eh/include/llvm/ADT/hash_set.in
    llvm/branches/non-call-eh/include/llvm/ADT/ilist
    llvm/branches/non-call-eh/include/llvm/ADT/iterator.in
    llvm/branches/non-call-eh/include/llvm/LinkTimeOptimizer.h
    llvm/branches/non-call-eh/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp
    llvm/branches/non-call-eh/lib/CodeGen/SelectionDAG/LegalizeTypesFloatToInt.cpp
    llvm/branches/non-call-eh/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp
    llvm/branches/non-call-eh/lib/CodeGen/SelectionDAG/LegalizeTypesScalarize.cpp
    llvm/branches/non-call-eh/lib/CodeGen/SelectionDAG/LegalizeTypesSplit.cpp
    llvm/branches/non-call-eh/lib/Transforms/IPO/SimplifyLibCalls.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/SimplifyCFG.cpp
    llvm/branches/non-call-eh/test/Analysis/Dominators/2006-09-26-PostDominanceFrontier.ll
    llvm/branches/non-call-eh/test/Analysis/Dominators/2007-04-17-PostDominanceFrontier.ll
    llvm/branches/non-call-eh/test/Analysis/Dominators/2007-04-20-PostDom-Reset.ll
    llvm/branches/non-call-eh/test/C++Frontend/
    llvm/branches/non-call-eh/test/CFrontend/
    llvm/branches/non-call-eh/test/CodeGen/X86/isnan.llx
    llvm/branches/non-call-eh/test/Feature/unwindto.ll
    llvm/branches/non-call-eh/test/Transforms/ADCE/2003-12-19-MergeReturn.ll
    llvm/branches/non-call-eh/test/Transforms/ADCE/2007-07-23-InfiniteLoop.ll
    llvm/branches/non-call-eh/test/Transforms/ADCE/adcetest.ll
    llvm/branches/non-call-eh/test/Transforms/ADCE/dead-phi-edge.ll
    llvm/branches/non-call-eh/test/Transforms/Inline/unwindto.ll
    llvm/branches/non-call-eh/test/Transforms/LoopRotate/pr1154.ll
    llvm/branches/non-call-eh/test/Transforms/PruneEH/unwindto.ll
    llvm/branches/non-call-eh/test/Transforms/SimplifyCFG/unwindto.ll
    llvm/branches/non-call-eh/test/Transforms/SimplifyLibCalls/MemMove.ll
    llvm/branches/non-call-eh/test/Transforms/SimplifyLibCalls/MemSet.ll
    llvm/branches/non-call-eh/tools/llvm2cpp/CppWriter.cpp
    llvm/branches/non-call-eh/tools/llvm2cpp/CppWriter.h
    llvm/branches/non-call-eh/tools/llvm2cpp/Makefile
    llvm/branches/non-call-eh/tools/llvm2cpp/llvm2cpp.cpp
    llvm/branches/non-call-eh/tools/llvmc/
    llvm/branches/non-call-eh/tools/llvmc2/Core.cpp
    llvm/branches/non-call-eh/tools/llvmc2/Core.h
    llvm/branches/non-call-eh/tools/llvmc2/Example.td
    llvm/branches/non-call-eh/tools/llvmc2/ExampleWithOpt.td
    llvm/branches/non-call-eh/tools/llvmc2/Tools.cpp
    llvm/branches/non-call-eh/tools/llvmc2/Tools.h
    llvm/branches/non-call-eh/tools/llvmc2/Utility.cpp
    llvm/branches/non-call-eh/tools/llvmc2/Utility.h
    llvm/branches/non-call-eh/tools/llvmc2/llvmcc.cpp
    llvm/branches/non-call-eh/tools/lto2/
    llvm/branches/non-call-eh/utils/TableGen/LLVMCCConfigurationEmitter.cpp
    llvm/branches/non-call-eh/utils/TableGen/LLVMCCConfigurationEmitter.h
Modified:
    llvm/branches/non-call-eh/CREDITS.TXT
    llvm/branches/non-call-eh/LICENSE.TXT
    llvm/branches/non-call-eh/Makefile
    llvm/branches/non-call-eh/Makefile.rules
    llvm/branches/non-call-eh/autoconf/configure.ac
    llvm/branches/non-call-eh/bindings/ocaml/llvm/llvm_ocaml.c
    llvm/branches/non-call-eh/configure
    llvm/branches/non-call-eh/docs/CodeGenerator.html
    llvm/branches/non-call-eh/docs/CodingStandards.html
    llvm/branches/non-call-eh/docs/CommandGuide/Makefile
    llvm/branches/non-call-eh/docs/CommandGuide/index.html
    llvm/branches/non-call-eh/docs/CommandGuide/llvm-ld.pod
    llvm/branches/non-call-eh/docs/CommandGuide/llvmgcc.pod
    llvm/branches/non-call-eh/docs/CommandLine.html
    llvm/branches/non-call-eh/docs/CompilerDriver.html
    llvm/branches/non-call-eh/docs/DeveloperPolicy.html
    llvm/branches/non-call-eh/docs/GCCFEBuildInstrs.html
    llvm/branches/non-call-eh/docs/GarbageCollection.html
    llvm/branches/non-call-eh/docs/GettingStarted.html
    llvm/branches/non-call-eh/docs/LangRef.html
    llvm/branches/non-call-eh/docs/Passes.html
    llvm/branches/non-call-eh/docs/ProgrammersManual.html
    llvm/branches/non-call-eh/docs/ReleaseNotes.html
    llvm/branches/non-call-eh/docs/SourceLevelDebugging.html
    llvm/branches/non-call-eh/docs/TestingGuide.html
    llvm/branches/non-call-eh/docs/index.html
    llvm/branches/non-call-eh/docs/tutorial/JITTutorial1.html
    llvm/branches/non-call-eh/docs/tutorial/JITTutorial2.html
    llvm/branches/non-call-eh/docs/tutorial/LangImpl3.html
    llvm/branches/non-call-eh/docs/tutorial/LangImpl4.html
    llvm/branches/non-call-eh/docs/tutorial/LangImpl5.html
    llvm/branches/non-call-eh/docs/tutorial/LangImpl6.html
    llvm/branches/non-call-eh/docs/tutorial/LangImpl7.html
    llvm/branches/non-call-eh/docs/tutorial/OCamlLangImpl3.html
    llvm/branches/non-call-eh/examples/BrainF/BrainF.cpp
    llvm/branches/non-call-eh/examples/Fibonacci/fibonacci.cpp
    llvm/branches/non-call-eh/examples/HowToUseJIT/HowToUseJIT.cpp
    llvm/branches/non-call-eh/examples/ModuleMaker/ModuleMaker.cpp
    llvm/branches/non-call-eh/examples/ParallelJIT/ParallelJIT.cpp
    llvm/branches/non-call-eh/include/llvm-c/BitWriter.h
    llvm/branches/non-call-eh/include/llvm-c/Core.h
    llvm/branches/non-call-eh/include/llvm-c/ExecutionEngine.h
    llvm/branches/non-call-eh/include/llvm-c/lto.h
    llvm/branches/non-call-eh/include/llvm/ADT/   (props changed)
    llvm/branches/non-call-eh/include/llvm/ADT/APFloat.h
    llvm/branches/non-call-eh/include/llvm/ADT/APInt.h
    llvm/branches/non-call-eh/include/llvm/ADT/BitVector.h
    llvm/branches/non-call-eh/include/llvm/ADT/DenseMap.h
    llvm/branches/non-call-eh/include/llvm/ADT/DenseSet.h
    llvm/branches/non-call-eh/include/llvm/ADT/DepthFirstIterator.h
    llvm/branches/non-call-eh/include/llvm/ADT/EquivalenceClasses.h
    llvm/branches/non-call-eh/include/llvm/ADT/FoldingSet.h
    llvm/branches/non-call-eh/include/llvm/ADT/HashExtras.h
    llvm/branches/non-call-eh/include/llvm/ADT/ImmutableMap.h
    llvm/branches/non-call-eh/include/llvm/ADT/PostOrderIterator.h
    llvm/branches/non-call-eh/include/llvm/ADT/SCCIterator.h
    llvm/branches/non-call-eh/include/llvm/ADT/STLExtras.h
    llvm/branches/non-call-eh/include/llvm/ADT/SmallPtrSet.h
    llvm/branches/non-call-eh/include/llvm/ADT/SmallVector.h
    llvm/branches/non-call-eh/include/llvm/ADT/SparseBitVector.h
    llvm/branches/non-call-eh/include/llvm/ADT/Statistic.h
    llvm/branches/non-call-eh/include/llvm/ADT/StringExtras.h
    llvm/branches/non-call-eh/include/llvm/ADT/StringMap.h
    llvm/branches/non-call-eh/include/llvm/ADT/UniqueVector.h
    llvm/branches/non-call-eh/include/llvm/Analysis/AliasAnalysis.h
    llvm/branches/non-call-eh/include/llvm/Analysis/AliasSetTracker.h
    llvm/branches/non-call-eh/include/llvm/Analysis/CallGraph.h
    llvm/branches/non-call-eh/include/llvm/Analysis/ConstantFolding.h
    llvm/branches/non-call-eh/include/llvm/Analysis/ConstantsScanner.h
    llvm/branches/non-call-eh/include/llvm/Analysis/DominatorInternals.h
    llvm/branches/non-call-eh/include/llvm/Analysis/Dominators.h
    llvm/branches/non-call-eh/include/llvm/Analysis/FindUsedTypes.h
    llvm/branches/non-call-eh/include/llvm/Analysis/LoopInfo.h
    llvm/branches/non-call-eh/include/llvm/Analysis/Passes.h
    llvm/branches/non-call-eh/include/llvm/Analysis/PostDominators.h
    llvm/branches/non-call-eh/include/llvm/Analysis/ScalarEvolution.h
    llvm/branches/non-call-eh/include/llvm/Analysis/ScalarEvolutionExpander.h
    llvm/branches/non-call-eh/include/llvm/Analysis/ScalarEvolutionExpressions.h
    llvm/branches/non-call-eh/include/llvm/Analysis/ValueNumbering.h
    llvm/branches/non-call-eh/include/llvm/Argument.h
    llvm/branches/non-call-eh/include/llvm/AutoUpgrade.h
    llvm/branches/non-call-eh/include/llvm/BasicBlock.h
    llvm/branches/non-call-eh/include/llvm/Bitcode/Archive.h
    llvm/branches/non-call-eh/include/llvm/Bitcode/BitCodes.h
    llvm/branches/non-call-eh/include/llvm/Bitcode/BitstreamReader.h
    llvm/branches/non-call-eh/include/llvm/Bitcode/BitstreamWriter.h
    llvm/branches/non-call-eh/include/llvm/Bitcode/Deserialize.h
    llvm/branches/non-call-eh/include/llvm/Bitcode/LLVMBitCodes.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/AsmPrinter.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/CallingConvLower.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/LinkAllCodegenComponents.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/LiveInterval.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/LiveIntervalAnalysis.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/LiveVariables.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/MachineBasicBlock.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/MachineCodeEmitter.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/MachineFrameInfo.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/MachineFunction.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/MachineInstr.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/MachineJumpTableInfo.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/MachineLoopInfo.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/MachineModuleInfo.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/MachineOperand.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/MachineRegisterInfo.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/Passes.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/RuntimeLibcalls.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/SchedGraphCommon.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/ScheduleDAG.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/SchedulerRegistry.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/SelectionDAG.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/SelectionDAGISel.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/SelectionDAGNodes.h
    llvm/branches/non-call-eh/include/llvm/CodeGen/ValueTypes.h
    llvm/branches/non-call-eh/include/llvm/Constant.h
    llvm/branches/non-call-eh/include/llvm/Constants.h
    llvm/branches/non-call-eh/include/llvm/Debugger/Debugger.h
    llvm/branches/non-call-eh/include/llvm/Debugger/SourceFile.h
    llvm/branches/non-call-eh/include/llvm/DerivedTypes.h
    llvm/branches/non-call-eh/include/llvm/ExecutionEngine/ExecutionEngine.h
    llvm/branches/non-call-eh/include/llvm/Function.h
    llvm/branches/non-call-eh/include/llvm/GlobalAlias.h
    llvm/branches/non-call-eh/include/llvm/GlobalValue.h
    llvm/branches/non-call-eh/include/llvm/GlobalVariable.h
    llvm/branches/non-call-eh/include/llvm/InstrTypes.h
    llvm/branches/non-call-eh/include/llvm/Instruction.def
    llvm/branches/non-call-eh/include/llvm/Instruction.h
    llvm/branches/non-call-eh/include/llvm/Instructions.h
    llvm/branches/non-call-eh/include/llvm/IntrinsicInst.h
    llvm/branches/non-call-eh/include/llvm/Intrinsics.h
    llvm/branches/non-call-eh/include/llvm/Intrinsics.td
    llvm/branches/non-call-eh/include/llvm/IntrinsicsX86.td
    llvm/branches/non-call-eh/include/llvm/LinkAllPasses.h
    llvm/branches/non-call-eh/include/llvm/Module.h
    llvm/branches/non-call-eh/include/llvm/ModuleProvider.h
    llvm/branches/non-call-eh/include/llvm/ParameterAttributes.h
    llvm/branches/non-call-eh/include/llvm/Pass.h
    llvm/branches/non-call-eh/include/llvm/PassManager.h
    llvm/branches/non-call-eh/include/llvm/PassManagers.h
    llvm/branches/non-call-eh/include/llvm/PassSupport.h
    llvm/branches/non-call-eh/include/llvm/Support/AlignOf.h
    llvm/branches/non-call-eh/include/llvm/Support/Allocator.h
    llvm/branches/non-call-eh/include/llvm/Support/CFG.h
    llvm/branches/non-call-eh/include/llvm/Support/CallSite.h
    llvm/branches/non-call-eh/include/llvm/Support/CommandLine.h
    llvm/branches/non-call-eh/include/llvm/Support/Dwarf.h
    llvm/branches/non-call-eh/include/llvm/Support/GraphWriter.h
    llvm/branches/non-call-eh/include/llvm/Support/IRBuilder.h
    llvm/branches/non-call-eh/include/llvm/Support/InstVisitor.h
    llvm/branches/non-call-eh/include/llvm/Support/Mangler.h
    llvm/branches/non-call-eh/include/llvm/Support/MathExtras.h
    llvm/branches/non-call-eh/include/llvm/Support/MemoryBuffer.h
    llvm/branches/non-call-eh/include/llvm/Support/OutputBuffer.h
    llvm/branches/non-call-eh/include/llvm/Support/PassNameParser.h
    llvm/branches/non-call-eh/include/llvm/Support/PatternMatch.h
    llvm/branches/non-call-eh/include/llvm/Support/Streams.h
    llvm/branches/non-call-eh/include/llvm/Support/Timer.h
    llvm/branches/non-call-eh/include/llvm/System/Alarm.h
    llvm/branches/non-call-eh/include/llvm/System/DynamicLibrary.h
    llvm/branches/non-call-eh/include/llvm/System/Memory.h
    llvm/branches/non-call-eh/include/llvm/System/Path.h
    llvm/branches/non-call-eh/include/llvm/System/Process.h
    llvm/branches/non-call-eh/include/llvm/System/Program.h
    llvm/branches/non-call-eh/include/llvm/System/Signals.h
    llvm/branches/non-call-eh/include/llvm/Target/TargetAsmInfo.h
    llvm/branches/non-call-eh/include/llvm/Target/TargetInstrDesc.h
    llvm/branches/non-call-eh/include/llvm/Target/TargetInstrInfo.h
    llvm/branches/non-call-eh/include/llvm/Target/TargetJITInfo.h
    llvm/branches/non-call-eh/include/llvm/Target/TargetLowering.h
    llvm/branches/non-call-eh/include/llvm/Target/TargetMachine.h
    llvm/branches/non-call-eh/include/llvm/Target/TargetOptions.h
    llvm/branches/non-call-eh/include/llvm/Target/TargetRegisterInfo.h
    llvm/branches/non-call-eh/include/llvm/Transforms/IPO.h
    llvm/branches/non-call-eh/include/llvm/Transforms/Scalar.h
    llvm/branches/non-call-eh/include/llvm/Transforms/Utils/BasicBlockUtils.h
    llvm/branches/non-call-eh/include/llvm/Transforms/Utils/FunctionUtils.h
    llvm/branches/non-call-eh/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h
    llvm/branches/non-call-eh/include/llvm/Type.h
    llvm/branches/non-call-eh/include/llvm/Use.h
    llvm/branches/non-call-eh/include/llvm/User.h
    llvm/branches/non-call-eh/include/llvm/Value.h
    llvm/branches/non-call-eh/include/llvm/ValueSymbolTable.h
    llvm/branches/non-call-eh/lib/Analysis/AliasAnalysis.cpp
    llvm/branches/non-call-eh/lib/Analysis/AliasAnalysisCounter.cpp
    llvm/branches/non-call-eh/lib/Analysis/AliasAnalysisEvaluator.cpp
    llvm/branches/non-call-eh/lib/Analysis/AliasDebugger.cpp
    llvm/branches/non-call-eh/lib/Analysis/AliasSetTracker.cpp
    llvm/branches/non-call-eh/lib/Analysis/BasicAliasAnalysis.cpp
    llvm/branches/non-call-eh/lib/Analysis/CFGPrinter.cpp
    llvm/branches/non-call-eh/lib/Analysis/ConstantFolding.cpp
    llvm/branches/non-call-eh/lib/Analysis/IPA/Andersens.cpp
    llvm/branches/non-call-eh/lib/Analysis/IPA/CallGraph.cpp
    llvm/branches/non-call-eh/lib/Analysis/IPA/CallGraphSCCPass.cpp
    llvm/branches/non-call-eh/lib/Analysis/IPA/FindUsedTypes.cpp
    llvm/branches/non-call-eh/lib/Analysis/IPA/GlobalsModRef.cpp
    llvm/branches/non-call-eh/lib/Analysis/InstCount.cpp
    llvm/branches/non-call-eh/lib/Analysis/IntervalPartition.cpp
    llvm/branches/non-call-eh/lib/Analysis/LoadValueNumbering.cpp
    llvm/branches/non-call-eh/lib/Analysis/LoopInfo.cpp
    llvm/branches/non-call-eh/lib/Analysis/LoopPass.cpp
    llvm/branches/non-call-eh/lib/Analysis/MemoryDependenceAnalysis.cpp
    llvm/branches/non-call-eh/lib/Analysis/PostDominators.cpp
    llvm/branches/non-call-eh/lib/Analysis/ProfileInfo.cpp
    llvm/branches/non-call-eh/lib/Analysis/ProfileInfoLoaderPass.cpp
    llvm/branches/non-call-eh/lib/Analysis/ScalarEvolution.cpp
    llvm/branches/non-call-eh/lib/Analysis/ScalarEvolutionExpander.cpp
    llvm/branches/non-call-eh/lib/Analysis/ValueNumbering.cpp
    llvm/branches/non-call-eh/lib/Archive/ArchiveReader.cpp
    llvm/branches/non-call-eh/lib/Archive/ArchiveWriter.cpp
    llvm/branches/non-call-eh/lib/AsmParser/LLLexer.cpp
    llvm/branches/non-call-eh/lib/AsmParser/llvmAsmParser.cpp.cvs
    llvm/branches/non-call-eh/lib/AsmParser/llvmAsmParser.h.cvs
    llvm/branches/non-call-eh/lib/AsmParser/llvmAsmParser.y
    llvm/branches/non-call-eh/lib/AsmParser/llvmAsmParser.y.cvs
    llvm/branches/non-call-eh/lib/Bitcode/Reader/BitcodeReader.cpp
    llvm/branches/non-call-eh/lib/Bitcode/Reader/BitcodeReader.h
    llvm/branches/non-call-eh/lib/Bitcode/Reader/Deserialize.cpp
    llvm/branches/non-call-eh/lib/Bitcode/Writer/BitWriter.cpp
    llvm/branches/non-call-eh/lib/Bitcode/Writer/BitcodeWriter.cpp
    llvm/branches/non-call-eh/lib/Bitcode/Writer/ValueEnumerator.cpp
    llvm/branches/non-call-eh/lib/CodeGen/AsmPrinter.cpp
    llvm/branches/non-call-eh/lib/CodeGen/BranchFolding.cpp
    llvm/branches/non-call-eh/lib/CodeGen/Collector.cpp
    llvm/branches/non-call-eh/lib/CodeGen/CollectorMetadata.cpp
    llvm/branches/non-call-eh/lib/CodeGen/DwarfWriter.cpp
    llvm/branches/non-call-eh/lib/CodeGen/ELFWriter.cpp
    llvm/branches/non-call-eh/lib/CodeGen/IfConversion.cpp
    llvm/branches/non-call-eh/lib/CodeGen/IntrinsicLowering.cpp
    llvm/branches/non-call-eh/lib/CodeGen/LLVMTargetMachine.cpp
    llvm/branches/non-call-eh/lib/CodeGen/LiveInterval.cpp
    llvm/branches/non-call-eh/lib/CodeGen/LiveIntervalAnalysis.cpp
    llvm/branches/non-call-eh/lib/CodeGen/LiveVariables.cpp
    llvm/branches/non-call-eh/lib/CodeGen/LowerSubregs.cpp
    llvm/branches/non-call-eh/lib/CodeGen/MachOWriter.cpp
    llvm/branches/non-call-eh/lib/CodeGen/MachineBasicBlock.cpp
    llvm/branches/non-call-eh/lib/CodeGen/MachineDominators.cpp
    llvm/branches/non-call-eh/lib/CodeGen/MachineInstr.cpp
    llvm/branches/non-call-eh/lib/CodeGen/MachineLICM.cpp
    llvm/branches/non-call-eh/lib/CodeGen/MachineLoopInfo.cpp
    llvm/branches/non-call-eh/lib/CodeGen/MachineModuleInfo.cpp
    llvm/branches/non-call-eh/lib/CodeGen/MachineSink.cpp
    llvm/branches/non-call-eh/lib/CodeGen/OcamlCollector.cpp
    llvm/branches/non-call-eh/lib/CodeGen/PHIElimination.cpp
    llvm/branches/non-call-eh/lib/CodeGen/Passes.cpp
    llvm/branches/non-call-eh/lib/CodeGen/PrologEpilogInserter.cpp
    llvm/branches/non-call-eh/lib/CodeGen/README.txt
    llvm/branches/non-call-eh/lib/CodeGen/RegAllocBigBlock.cpp
    llvm/branches/non-call-eh/lib/CodeGen/RegAllocLinearScan.cpp
    llvm/branches/non-call-eh/lib/CodeGen/RegAllocLocal.cpp
    llvm/branches/non-call-eh/lib/CodeGen/RegisterCoalescer.cpp
    llvm/branches/non-call-eh/lib/CodeGen/RegisterScavenging.cpp
    llvm/branches/non-call-eh/lib/CodeGen/SelectionDAG/CallingConvLower.cpp
    llvm/branches/non-call-eh/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    llvm/branches/non-call-eh/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
    llvm/branches/non-call-eh/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
    llvm/branches/non-call-eh/lib/CodeGen/SelectionDAG/LegalizeTypes.h
    llvm/branches/non-call-eh/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
    llvm/branches/non-call-eh/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
    llvm/branches/non-call-eh/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
    llvm/branches/non-call-eh/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    llvm/branches/non-call-eh/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
    llvm/branches/non-call-eh/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
    llvm/branches/non-call-eh/lib/CodeGen/SelectionDAG/TargetLowering.cpp
    llvm/branches/non-call-eh/lib/CodeGen/ShadowStackCollector.cpp
    llvm/branches/non-call-eh/lib/CodeGen/SimpleRegisterCoalescing.cpp
    llvm/branches/non-call-eh/lib/CodeGen/SimpleRegisterCoalescing.h
    llvm/branches/non-call-eh/lib/CodeGen/StrongPHIElimination.cpp
    llvm/branches/non-call-eh/lib/CodeGen/TargetInstrInfoImpl.cpp
    llvm/branches/non-call-eh/lib/CodeGen/TwoAddressInstructionPass.cpp
    llvm/branches/non-call-eh/lib/CodeGen/UnreachableBlockElim.cpp
    llvm/branches/non-call-eh/lib/CodeGen/VirtRegMap.cpp
    llvm/branches/non-call-eh/lib/CodeGen/VirtRegMap.h
    llvm/branches/non-call-eh/lib/Debugger/ProgramInfo.cpp
    llvm/branches/non-call-eh/lib/Debugger/SourceLanguage-Unknown.cpp
    llvm/branches/non-call-eh/lib/ExecutionEngine/ExecutionEngine.cpp
    llvm/branches/non-call-eh/lib/ExecutionEngine/ExecutionEngineBindings.cpp
    llvm/branches/non-call-eh/lib/ExecutionEngine/Interpreter/Interpreter.cpp
    llvm/branches/non-call-eh/lib/ExecutionEngine/JIT/Intercept.cpp
    llvm/branches/non-call-eh/lib/ExecutionEngine/JIT/JIT.cpp
    llvm/branches/non-call-eh/lib/ExecutionEngine/JIT/JIT.h
    llvm/branches/non-call-eh/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp
    llvm/branches/non-call-eh/lib/ExecutionEngine/JIT/JITEmitter.cpp
    llvm/branches/non-call-eh/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
    llvm/branches/non-call-eh/lib/ExecutionEngine/JIT/TargetSelect.cpp
    llvm/branches/non-call-eh/lib/Linker/LinkModules.cpp
    llvm/branches/non-call-eh/lib/Support/APFloat.cpp
    llvm/branches/non-call-eh/lib/Support/APInt.cpp
    llvm/branches/non-call-eh/lib/Support/Allocator.cpp
    llvm/branches/non-call-eh/lib/Support/CommandLine.cpp
    llvm/branches/non-call-eh/lib/Support/ConstantRange.cpp
    llvm/branches/non-call-eh/lib/Support/Debug.cpp
    llvm/branches/non-call-eh/lib/Support/Dwarf.cpp
    llvm/branches/non-call-eh/lib/Support/FileUtilities.cpp
    llvm/branches/non-call-eh/lib/Support/FoldingSet.cpp
    llvm/branches/non-call-eh/lib/Support/MemoryBuffer.cpp
    llvm/branches/non-call-eh/lib/Support/Statistic.cpp
    llvm/branches/non-call-eh/lib/Support/Streams.cpp
    llvm/branches/non-call-eh/lib/Support/StringExtras.cpp
    llvm/branches/non-call-eh/lib/Support/Timer.cpp
    llvm/branches/non-call-eh/lib/System/Alarm.cpp
    llvm/branches/non-call-eh/lib/System/DynamicLibrary.cpp
    llvm/branches/non-call-eh/lib/System/Memory.cpp
    llvm/branches/non-call-eh/lib/System/Mutex.cpp
    llvm/branches/non-call-eh/lib/System/Path.cpp
    llvm/branches/non-call-eh/lib/System/Process.cpp
    llvm/branches/non-call-eh/lib/System/Program.cpp
    llvm/branches/non-call-eh/lib/System/Signals.cpp
    llvm/branches/non-call-eh/lib/System/Unix/Memory.inc
    llvm/branches/non-call-eh/lib/System/Unix/Path.inc
    llvm/branches/non-call-eh/lib/System/Unix/Program.inc
    llvm/branches/non-call-eh/lib/System/Unix/Signals.inc
    llvm/branches/non-call-eh/lib/System/Unix/Unix.h
    llvm/branches/non-call-eh/lib/System/Win32/DynamicLibrary.inc
    llvm/branches/non-call-eh/lib/System/Win32/Path.inc
    llvm/branches/non-call-eh/lib/System/Win32/Program.inc
    llvm/branches/non-call-eh/lib/Target/ARM/ARMAsmPrinter.cpp
    llvm/branches/non-call-eh/lib/Target/ARM/ARMISelDAGToDAG.cpp
    llvm/branches/non-call-eh/lib/Target/ARM/ARMISelLowering.cpp
    llvm/branches/non-call-eh/lib/Target/ARM/ARMISelLowering.h
    llvm/branches/non-call-eh/lib/Target/ARM/ARMInstrInfo.cpp
    llvm/branches/non-call-eh/lib/Target/ARM/ARMInstrInfo.h
    llvm/branches/non-call-eh/lib/Target/ARM/ARMTargetAsmInfo.cpp
    llvm/branches/non-call-eh/lib/Target/ARM/ARMTargetMachine.cpp
    llvm/branches/non-call-eh/lib/Target/ARM/ARMTargetMachine.h
    llvm/branches/non-call-eh/lib/Target/Alpha/Alpha.h
    llvm/branches/non-call-eh/lib/Target/Alpha/AlphaAsmPrinter.cpp
    llvm/branches/non-call-eh/lib/Target/Alpha/AlphaISelDAGToDAG.cpp
    llvm/branches/non-call-eh/lib/Target/Alpha/AlphaISelLowering.cpp
    llvm/branches/non-call-eh/lib/Target/Alpha/AlphaISelLowering.h
    llvm/branches/non-call-eh/lib/Target/Alpha/AlphaInstrInfo.cpp
    llvm/branches/non-call-eh/lib/Target/Alpha/AlphaInstrInfo.h
    llvm/branches/non-call-eh/lib/Target/Alpha/AlphaInstrInfo.td
    llvm/branches/non-call-eh/lib/Target/Alpha/AlphaTargetMachine.cpp
    llvm/branches/non-call-eh/lib/Target/Alpha/AlphaTargetMachine.h
    llvm/branches/non-call-eh/lib/Target/CBackend/CBackend.cpp
    llvm/branches/non-call-eh/lib/Target/CellSPU/SPUAsmPrinter.cpp
    llvm/branches/non-call-eh/lib/Target/CellSPU/SPUFrameInfo.h
    llvm/branches/non-call-eh/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
    llvm/branches/non-call-eh/lib/Target/CellSPU/SPUISelLowering.cpp
    llvm/branches/non-call-eh/lib/Target/CellSPU/SPUISelLowering.h
    llvm/branches/non-call-eh/lib/Target/CellSPU/SPUInstrInfo.cpp
    llvm/branches/non-call-eh/lib/Target/CellSPU/SPUInstrInfo.h
    llvm/branches/non-call-eh/lib/Target/CellSPU/SPUInstrInfo.td
    llvm/branches/non-call-eh/lib/Target/CellSPU/SPUNodes.td
    llvm/branches/non-call-eh/lib/Target/CellSPU/SPUOperands.td
    llvm/branches/non-call-eh/lib/Target/CellSPU/SPURegisterInfo.cpp
    llvm/branches/non-call-eh/lib/Target/CellSPU/SPUTargetMachine.h
    llvm/branches/non-call-eh/lib/Target/IA64/IA64AsmPrinter.cpp
    llvm/branches/non-call-eh/lib/Target/IA64/IA64ISelDAGToDAG.cpp
    llvm/branches/non-call-eh/lib/Target/IA64/IA64ISelLowering.cpp
    llvm/branches/non-call-eh/lib/Target/IA64/IA64ISelLowering.h
    llvm/branches/non-call-eh/lib/Target/IA64/IA64InstrInfo.h
    llvm/branches/non-call-eh/lib/Target/IA64/IA64TargetMachine.cpp
    llvm/branches/non-call-eh/lib/Target/IA64/IA64TargetMachine.h
    llvm/branches/non-call-eh/lib/Target/MSIL/MSILWriter.cpp
    llvm/branches/non-call-eh/lib/Target/Mips/Mips.td
    llvm/branches/non-call-eh/lib/Target/Mips/MipsAsmPrinter.cpp
    llvm/branches/non-call-eh/lib/Target/Mips/MipsCallingConv.td
    llvm/branches/non-call-eh/lib/Target/Mips/MipsISelDAGToDAG.cpp
    llvm/branches/non-call-eh/lib/Target/Mips/MipsISelLowering.cpp
    llvm/branches/non-call-eh/lib/Target/Mips/MipsISelLowering.h
    llvm/branches/non-call-eh/lib/Target/Mips/MipsInstrFormats.td
    llvm/branches/non-call-eh/lib/Target/Mips/MipsInstrInfo.cpp
    llvm/branches/non-call-eh/lib/Target/Mips/MipsInstrInfo.h
    llvm/branches/non-call-eh/lib/Target/Mips/MipsInstrInfo.td
    llvm/branches/non-call-eh/lib/Target/Mips/MipsMachineFunction.h
    llvm/branches/non-call-eh/lib/Target/Mips/MipsRegisterInfo.cpp
    llvm/branches/non-call-eh/lib/Target/Mips/MipsRegisterInfo.td
    llvm/branches/non-call-eh/lib/Target/Mips/MipsSubtarget.cpp
    llvm/branches/non-call-eh/lib/Target/Mips/MipsSubtarget.h
    llvm/branches/non-call-eh/lib/Target/Mips/MipsTargetMachine.cpp
    llvm/branches/non-call-eh/lib/Target/Mips/MipsTargetMachine.h
    llvm/branches/non-call-eh/lib/Target/PowerPC/PPCAsmPrinter.cpp
    llvm/branches/non-call-eh/lib/Target/PowerPC/PPCCodeEmitter.cpp
    llvm/branches/non-call-eh/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
    llvm/branches/non-call-eh/lib/Target/PowerPC/PPCISelLowering.cpp
    llvm/branches/non-call-eh/lib/Target/PowerPC/PPCISelLowering.h
    llvm/branches/non-call-eh/lib/Target/PowerPC/PPCInstr64Bit.td
    llvm/branches/non-call-eh/lib/Target/PowerPC/PPCInstrInfo.cpp
    llvm/branches/non-call-eh/lib/Target/PowerPC/PPCInstrInfo.h
    llvm/branches/non-call-eh/lib/Target/PowerPC/PPCInstrInfo.td
    llvm/branches/non-call-eh/lib/Target/PowerPC/PPCJITInfo.cpp
    llvm/branches/non-call-eh/lib/Target/PowerPC/PPCMachineFunctionInfo.h
    llvm/branches/non-call-eh/lib/Target/PowerPC/PPCRegisterInfo.cpp
    llvm/branches/non-call-eh/lib/Target/PowerPC/PPCRegisterInfo.td
    llvm/branches/non-call-eh/lib/Target/PowerPC/PPCSubtarget.cpp
    llvm/branches/non-call-eh/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
    llvm/branches/non-call-eh/lib/Target/PowerPC/PPCTargetMachine.cpp
    llvm/branches/non-call-eh/lib/Target/PowerPC/PPCTargetMachine.h
    llvm/branches/non-call-eh/lib/Target/PowerPC/README_ALTIVEC.txt
    llvm/branches/non-call-eh/lib/Target/README.txt
    llvm/branches/non-call-eh/lib/Target/Sparc/SparcAsmPrinter.cpp
    llvm/branches/non-call-eh/lib/Target/Sparc/SparcISelDAGToDAG.cpp
    llvm/branches/non-call-eh/lib/Target/Sparc/SparcISelLowering.cpp
    llvm/branches/non-call-eh/lib/Target/Sparc/SparcISelLowering.h
    llvm/branches/non-call-eh/lib/Target/Sparc/SparcInstrInfo.cpp
    llvm/branches/non-call-eh/lib/Target/Sparc/SparcInstrInfo.h
    llvm/branches/non-call-eh/lib/Target/Sparc/SparcTargetMachine.cpp
    llvm/branches/non-call-eh/lib/Target/Sparc/SparcTargetMachine.h
    llvm/branches/non-call-eh/lib/Target/Target.td
    llvm/branches/non-call-eh/lib/Target/TargetAsmInfo.cpp
    llvm/branches/non-call-eh/lib/Target/TargetData.cpp
    llvm/branches/non-call-eh/lib/Target/TargetMachine.cpp
    llvm/branches/non-call-eh/lib/Target/TargetRegisterInfo.cpp
    llvm/branches/non-call-eh/lib/Target/TargetSelectionDAG.td
    llvm/branches/non-call-eh/lib/Target/X86/README-SSE.txt
    llvm/branches/non-call-eh/lib/Target/X86/README-X86-64.txt
    llvm/branches/non-call-eh/lib/Target/X86/README.txt
    llvm/branches/non-call-eh/lib/Target/X86/X86.h
    llvm/branches/non-call-eh/lib/Target/X86/X86ATTAsmPrinter.cpp
    llvm/branches/non-call-eh/lib/Target/X86/X86ATTAsmPrinter.h
    llvm/branches/non-call-eh/lib/Target/X86/X86AsmPrinter.cpp
    llvm/branches/non-call-eh/lib/Target/X86/X86AsmPrinter.h
    llvm/branches/non-call-eh/lib/Target/X86/X86CallingConv.td
    llvm/branches/non-call-eh/lib/Target/X86/X86CodeEmitter.cpp
    llvm/branches/non-call-eh/lib/Target/X86/X86ISelDAGToDAG.cpp
    llvm/branches/non-call-eh/lib/Target/X86/X86ISelLowering.cpp
    llvm/branches/non-call-eh/lib/Target/X86/X86ISelLowering.h
    llvm/branches/non-call-eh/lib/Target/X86/X86Instr64bit.td
    llvm/branches/non-call-eh/lib/Target/X86/X86InstrBuilder.h
    llvm/branches/non-call-eh/lib/Target/X86/X86InstrInfo.cpp
    llvm/branches/non-call-eh/lib/Target/X86/X86InstrInfo.h
    llvm/branches/non-call-eh/lib/Target/X86/X86InstrInfo.td
    llvm/branches/non-call-eh/lib/Target/X86/X86InstrMMX.td
    llvm/branches/non-call-eh/lib/Target/X86/X86InstrSSE.td
    llvm/branches/non-call-eh/lib/Target/X86/X86IntelAsmPrinter.cpp
    llvm/branches/non-call-eh/lib/Target/X86/X86IntelAsmPrinter.h
    llvm/branches/non-call-eh/lib/Target/X86/X86JITInfo.cpp
    llvm/branches/non-call-eh/lib/Target/X86/X86MachineFunctionInfo.h
    llvm/branches/non-call-eh/lib/Target/X86/X86RegisterInfo.cpp
    llvm/branches/non-call-eh/lib/Target/X86/X86RegisterInfo.h
    llvm/branches/non-call-eh/lib/Target/X86/X86RegisterInfo.td
    llvm/branches/non-call-eh/lib/Target/X86/X86Subtarget.cpp
    llvm/branches/non-call-eh/lib/Target/X86/X86Subtarget.h
    llvm/branches/non-call-eh/lib/Target/X86/X86TargetAsmInfo.cpp
    llvm/branches/non-call-eh/lib/Target/X86/X86TargetMachine.cpp
    llvm/branches/non-call-eh/lib/Target/X86/X86TargetMachine.h
    llvm/branches/non-call-eh/lib/Transforms/Hello/Hello.cpp
    llvm/branches/non-call-eh/lib/Transforms/IPO/ArgumentPromotion.cpp
    llvm/branches/non-call-eh/lib/Transforms/IPO/ConstantMerge.cpp
    llvm/branches/non-call-eh/lib/Transforms/IPO/DeadArgumentElimination.cpp
    llvm/branches/non-call-eh/lib/Transforms/IPO/DeadTypeElimination.cpp
    llvm/branches/non-call-eh/lib/Transforms/IPO/ExtractGV.cpp
    llvm/branches/non-call-eh/lib/Transforms/IPO/GlobalDCE.cpp
    llvm/branches/non-call-eh/lib/Transforms/IPO/GlobalOpt.cpp
    llvm/branches/non-call-eh/lib/Transforms/IPO/IPConstantPropagation.cpp
    llvm/branches/non-call-eh/lib/Transforms/IPO/IndMemRemoval.cpp
    llvm/branches/non-call-eh/lib/Transforms/IPO/InlineSimple.cpp
    llvm/branches/non-call-eh/lib/Transforms/IPO/Inliner.cpp
    llvm/branches/non-call-eh/lib/Transforms/IPO/Internalize.cpp
    llvm/branches/non-call-eh/lib/Transforms/IPO/LoopExtractor.cpp
    llvm/branches/non-call-eh/lib/Transforms/IPO/LowerSetJmp.cpp
    llvm/branches/non-call-eh/lib/Transforms/IPO/PruneEH.cpp
    llvm/branches/non-call-eh/lib/Transforms/IPO/RaiseAllocations.cpp
    llvm/branches/non-call-eh/lib/Transforms/IPO/StripDeadPrototypes.cpp
    llvm/branches/non-call-eh/lib/Transforms/IPO/StripSymbols.cpp
    llvm/branches/non-call-eh/lib/Transforms/IPO/StructRetPromotion.cpp
    llvm/branches/non-call-eh/lib/Transforms/Instrumentation/BlockProfiling.cpp
    llvm/branches/non-call-eh/lib/Transforms/Instrumentation/EdgeProfiling.cpp
    llvm/branches/non-call-eh/lib/Transforms/Instrumentation/ProfilingUtils.cpp
    llvm/branches/non-call-eh/lib/Transforms/Instrumentation/RSProfiling.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/ADCE.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/BasicBlockPlacement.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/CodeGenPrepare.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/CondPropagate.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/ConstantProp.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/DCE.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/DeadStoreElimination.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/GCSE.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/GVN.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/GVNPRE.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/IndVarSimplify.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/InstructionCombining.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/JumpThreading.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/LICM.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/LoopIndexSplit.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/LoopRotation.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/LoopStrengthReduce.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/LoopUnroll.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/LoopUnswitch.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/MemCpyOptimizer.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/PredicateSimplifier.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/Reassociate.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/Reg2Mem.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/SCCP.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/ScalarReplAggregates.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/TailDuplication.cpp
    llvm/branches/non-call-eh/lib/Transforms/Scalar/TailRecursionElimination.cpp
    llvm/branches/non-call-eh/lib/Transforms/Utils/BasicBlockUtils.cpp
    llvm/branches/non-call-eh/lib/Transforms/Utils/BasicInliner.cpp
    llvm/branches/non-call-eh/lib/Transforms/Utils/BreakCriticalEdges.cpp
    llvm/branches/non-call-eh/lib/Transforms/Utils/CloneFunction.cpp
    llvm/branches/non-call-eh/lib/Transforms/Utils/CloneLoop.cpp
    llvm/branches/non-call-eh/lib/Transforms/Utils/CloneModule.cpp
    llvm/branches/non-call-eh/lib/Transforms/Utils/CloneTrace.cpp
    llvm/branches/non-call-eh/lib/Transforms/Utils/CodeExtractor.cpp
    llvm/branches/non-call-eh/lib/Transforms/Utils/DemoteRegToStack.cpp
    llvm/branches/non-call-eh/lib/Transforms/Utils/InlineCost.cpp
    llvm/branches/non-call-eh/lib/Transforms/Utils/InlineFunction.cpp
    llvm/branches/non-call-eh/lib/Transforms/Utils/LCSSA.cpp
    llvm/branches/non-call-eh/lib/Transforms/Utils/Local.cpp
    llvm/branches/non-call-eh/lib/Transforms/Utils/LoopSimplify.cpp
    llvm/branches/non-call-eh/lib/Transforms/Utils/LowerAllocations.cpp
    llvm/branches/non-call-eh/lib/Transforms/Utils/LowerInvoke.cpp
    llvm/branches/non-call-eh/lib/Transforms/Utils/LowerSwitch.cpp
    llvm/branches/non-call-eh/lib/Transforms/Utils/Mem2Reg.cpp
    llvm/branches/non-call-eh/lib/Transforms/Utils/SimplifyCFG.cpp
    llvm/branches/non-call-eh/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
    llvm/branches/non-call-eh/lib/Transforms/Utils/ValueMapper.cpp
    llvm/branches/non-call-eh/lib/VMCore/AsmWriter.cpp
    llvm/branches/non-call-eh/lib/VMCore/AutoUpgrade.cpp
    llvm/branches/non-call-eh/lib/VMCore/BasicBlock.cpp
    llvm/branches/non-call-eh/lib/VMCore/ConstantFold.cpp
    llvm/branches/non-call-eh/lib/VMCore/ConstantFold.h
    llvm/branches/non-call-eh/lib/VMCore/Constants.cpp
    llvm/branches/non-call-eh/lib/VMCore/Core.cpp
    llvm/branches/non-call-eh/lib/VMCore/Dominators.cpp
    llvm/branches/non-call-eh/lib/VMCore/Function.cpp
    llvm/branches/non-call-eh/lib/VMCore/Globals.cpp
    llvm/branches/non-call-eh/lib/VMCore/InlineAsm.cpp
    llvm/branches/non-call-eh/lib/VMCore/Instruction.cpp
    llvm/branches/non-call-eh/lib/VMCore/Instructions.cpp
    llvm/branches/non-call-eh/lib/VMCore/IntrinsicInst.cpp
    llvm/branches/non-call-eh/lib/VMCore/Mangler.cpp
    llvm/branches/non-call-eh/lib/VMCore/Module.cpp
    llvm/branches/non-call-eh/lib/VMCore/Pass.cpp
    llvm/branches/non-call-eh/lib/VMCore/PassManager.cpp
    llvm/branches/non-call-eh/lib/VMCore/Type.cpp
    llvm/branches/non-call-eh/lib/VMCore/TypeSymbolTable.cpp
    llvm/branches/non-call-eh/lib/VMCore/Value.cpp
    llvm/branches/non-call-eh/lib/VMCore/ValueSymbolTable.cpp
    llvm/branches/non-call-eh/lib/VMCore/ValueTypes.cpp
    llvm/branches/non-call-eh/lib/VMCore/Verifier.cpp
    llvm/branches/non-call-eh/projects/Makefile
    llvm/branches/non-call-eh/test/Analysis/Andersens/basictest.ll
    llvm/branches/non-call-eh/test/Analysis/Andersens/dg.exp
    llvm/branches/non-call-eh/test/Analysis/Andersens/external.ll
    llvm/branches/non-call-eh/test/Analysis/Andersens/modreftest.ll
    llvm/branches/non-call-eh/test/Analysis/Andersens/modreftest2.ll
    llvm/branches/non-call-eh/test/Analysis/BasicAA/2003-03-04-GEPCrash.ll
    llvm/branches/non-call-eh/test/Analysis/BasicAA/2003-04-25-GEPCrash.ll
    llvm/branches/non-call-eh/test/Analysis/BasicAA/2003-06-01-AliasCrash.ll
    llvm/branches/non-call-eh/test/Analysis/BasicAA/2003-07-03-BasicAACrash.ll
    llvm/branches/non-call-eh/test/Analysis/BasicAA/dg.exp
    llvm/branches/non-call-eh/test/Analysis/BasicAA/licmtest.ll
    llvm/branches/non-call-eh/test/Analysis/Dominators/dg.exp
    llvm/branches/non-call-eh/test/Analysis/GlobalsModRef/dg.exp
    llvm/branches/non-call-eh/test/Analysis/LoadVN/dg.exp
    llvm/branches/non-call-eh/test/Analysis/LoopInfo/dg.exp
    llvm/branches/non-call-eh/test/Analysis/ScalarEvolution/smax.ll
    llvm/branches/non-call-eh/test/Archive/dg.exp
    llvm/branches/non-call-eh/test/Archive/toc_MacOSX.ll   (props changed)
    llvm/branches/non-call-eh/test/Assembler/2002-01-24-BadSymbolTableAssert.ll
    llvm/branches/non-call-eh/test/Assembler/2002-01-24-ValueRefineAbsType.ll
    llvm/branches/non-call-eh/test/Assembler/2002-02-19-TypeParsing.ll
    llvm/branches/non-call-eh/test/Assembler/2002-03-08-NameCollision.ll
    llvm/branches/non-call-eh/test/Assembler/2002-03-08-NameCollision2.ll
    llvm/branches/non-call-eh/test/Assembler/2002-04-04-PureVirtMethCall.ll
    llvm/branches/non-call-eh/test/Assembler/2002-04-04-PureVirtMethCall2.ll
    llvm/branches/non-call-eh/test/Assembler/2002-04-05-TypeParsing.ll
    llvm/branches/non-call-eh/test/Assembler/2002-05-02-InvalidForwardRef.ll
    llvm/branches/non-call-eh/test/Assembler/2002-07-08-HugePerformanceProblem.ll
    llvm/branches/non-call-eh/test/Assembler/2002-07-25-ParserAssertionFailure.ll
    llvm/branches/non-call-eh/test/Assembler/2002-08-15-CastAmbiguity.ll
    llvm/branches/non-call-eh/test/Assembler/2002-08-15-ConstantExprProblem.ll
    llvm/branches/non-call-eh/test/Assembler/2002-08-15-UnresolvedGlobalReference.ll
    llvm/branches/non-call-eh/test/Assembler/2002-08-22-DominanceProblem.ll
    llvm/branches/non-call-eh/test/Assembler/2002-10-08-LargeArrayPerformance.ll
    llvm/branches/non-call-eh/test/Assembler/2002-10-15-NameClash.ll
    llvm/branches/non-call-eh/test/Assembler/2002-12-15-GlobalResolve.ll
    llvm/branches/non-call-eh/test/Assembler/2003-01-30-UnsignedString.ll
    llvm/branches/non-call-eh/test/Assembler/2003-04-25-UnresolvedGlobalReference.ll
    llvm/branches/non-call-eh/test/Assembler/2003-05-15-AssemblerProblem.ll
    llvm/branches/non-call-eh/test/Assembler/2003-05-15-SwitchBug.ll
    llvm/branches/non-call-eh/test/Assembler/2003-05-21-ConstantShiftExpr.ll
    llvm/branches/non-call-eh/test/Assembler/2003-05-21-EmptyStructTest.ll
    llvm/branches/non-call-eh/test/Assembler/2003-06-30-RecursiveTypeProblem.ll
    llvm/branches/non-call-eh/test/Assembler/2003-10-04-NotMergingGlobalConstants.ll
    llvm/branches/non-call-eh/test/Assembler/2003-11-11-ImplicitRename.ll
    llvm/branches/non-call-eh/test/Assembler/2003-12-30-TypeMapInvalidMemory.ll
    llvm/branches/non-call-eh/test/Assembler/2004-02-27-SelfUseAssertError.ll
    llvm/branches/non-call-eh/test/Assembler/2004-04-04-GetElementPtrIndexTypes.ll
    llvm/branches/non-call-eh/test/Assembler/2004-09-29-VerifierIsReallySlow.ll
    llvm/branches/non-call-eh/test/Assembler/2004-10-22-BCWriterUndefBug.ll
    llvm/branches/non-call-eh/test/Assembler/2004-11-28-InvalidTypeCrash.ll
    llvm/branches/non-call-eh/test/Assembler/2005-01-31-CallingAggregateFunction.ll
    llvm/branches/non-call-eh/test/Assembler/2007-01-02-Undefined-Arg-Type.ll
    llvm/branches/non-call-eh/test/Assembler/2007-01-05-Cmp-ConstExpr.ll
    llvm/branches/non-call-eh/test/Assembler/2007-01-16-CrashOnBadCast.ll
    llvm/branches/non-call-eh/test/Assembler/2007-01-16-CrashOnBadCast2.ll
    llvm/branches/non-call-eh/test/Assembler/2007-04-15-BadIntrinsic.ll
    llvm/branches/non-call-eh/test/Assembler/2007-11-26-AttributeOverload.ll
    llvm/branches/non-call-eh/test/Assembler/AutoUpgradeIntrinsics.ll
    llvm/branches/non-call-eh/test/Assembler/dg.exp
    llvm/branches/non-call-eh/test/Assembler/select.ll
    llvm/branches/non-call-eh/test/Bindings/Ocaml/ocaml.exp
    llvm/branches/non-call-eh/test/Bindings/Ocaml/vmcore.ml
    llvm/branches/non-call-eh/test/Bitcode/dg.exp
    llvm/branches/non-call-eh/test/Bitcode/memcpy.ll
    llvm/branches/non-call-eh/test/BugPoint/crash-narrowfunctiontest.ll
    llvm/branches/non-call-eh/test/BugPoint/misopt-basictest.ll
    llvm/branches/non-call-eh/test/BugPoint/remove_arguments_test.ll
    llvm/branches/non-call-eh/test/CodeGen/ARM/dg.exp
    llvm/branches/non-call-eh/test/CodeGen/Alpha/ctlz.ll
    llvm/branches/non-call-eh/test/CodeGen/Alpha/ctpop.ll
    llvm/branches/non-call-eh/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll
    llvm/branches/non-call-eh/test/CodeGen/CBackend/2007-01-15-NamedArrayType.ll
    llvm/branches/non-call-eh/test/CodeGen/CBackend/dg.exp
    llvm/branches/non-call-eh/test/CodeGen/CellSPU/and_ops.ll
    llvm/branches/non-call-eh/test/CodeGen/CellSPU/dg.exp
    llvm/branches/non-call-eh/test/CodeGen/CellSPU/immed64.ll
    llvm/branches/non-call-eh/test/CodeGen/Generic/2002-04-14-UnexpectedUnsignedType.ll
    llvm/branches/non-call-eh/test/CodeGen/Generic/GC/badreadproto.ll
    llvm/branches/non-call-eh/test/CodeGen/Generic/GC/badrootproto.ll
    llvm/branches/non-call-eh/test/CodeGen/Generic/GC/badwriteproto.ll
    llvm/branches/non-call-eh/test/CodeGen/Generic/GC/dg.exp
    llvm/branches/non-call-eh/test/CodeGen/Generic/GC/outside.ll
    llvm/branches/non-call-eh/test/CodeGen/Generic/dg.exp
    llvm/branches/non-call-eh/test/CodeGen/Generic/spillccr.ll
    llvm/branches/non-call-eh/test/CodeGen/Generic/switch-lower-feature.ll
    llvm/branches/non-call-eh/test/CodeGen/IA64/dg.exp
    llvm/branches/non-call-eh/test/CodeGen/PowerPC/2007-04-24-InlineAsm-I-Modifier.ll
    llvm/branches/non-call-eh/test/CodeGen/PowerPC/atomic-1.ll
    llvm/branches/non-call-eh/test/CodeGen/PowerPC/atomic-2.ll
    llvm/branches/non-call-eh/test/CodeGen/PowerPC/dg.exp
    llvm/branches/non-call-eh/test/CodeGen/SPARC/dg.exp
    llvm/branches/non-call-eh/test/CodeGen/X86/2006-04-27-ISelFoldingBug.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2006-05-11-InstrSched.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2006-05-17-VectorArg.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2006-07-31-SingleRegClass.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2006-11-17-IllegalMove.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2006-11-28-Memcpy.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2007-01-13-StackPtrIndex.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2007-06-28-X86-64-isel.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2007-06-29-DAGCombinerBug.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2007-06-29-VecFPConstantCSEBug.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2007-07-03-GR64ToVR64.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2007-10-04-AvoidEFLAGSCopy.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2007-11-14-Coalescer-Bug.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2007-11-30-LoadFolding-Bug.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/2008-02-18-TailMergingBug.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/aligned-comm.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/dagcombine-cse.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/dg.exp
    llvm/branches/non-call-eh/test/CodeGen/X86/dollar-name.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/extractelement-from-arg.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/loop-strength-reduce2.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/mingw-alloca.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/mmx-insert-element.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/mmx-shift.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/nancvt.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/packed_struct.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/prefetch.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/scalar_sse_minmax.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/split-select.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-0.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-1.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-10.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-11.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-12.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-2.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-3.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-4.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-5.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-6.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-7.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-8.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/sse-align-9.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_add.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_align.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_clear.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_ctbits.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_extract-sse4.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_fneg.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_insert-2.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_insert-3.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_logical.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_return.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-2.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-4.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-5.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-6.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-7.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-9.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-A.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_set-B.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_set.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-11.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-12.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-13.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-16.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_shuffle-2.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/vec_ss_load_fold.ll
    llvm/branches/non-call-eh/test/CodeGen/X86/xor_not.ll
    llvm/branches/non-call-eh/test/DebugInfo/dg.exp
    llvm/branches/non-call-eh/test/ExecutionEngine/2002-12-16-ArgTest.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-04-ArgumentBug.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-04-LoopTest.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-04-PhiTest.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-09-SARTest.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-10-FUCOM.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/2003-01-15-AlignmentTest.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/2003-05-11-PHIRegAllocBug.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/2003-06-04-bzip2-bug.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/2003-06-05-PHIBug.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/2003-08-15-AllocaAssertion.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/2003-08-21-EnvironmentTest.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/2003-08-23-RegisterAllocatePhysReg.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/2004-12-04-LazyCompileFuncs.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/2007-12-10-APIntLoadStore.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/2007-12-14-BigEndian.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/2007-12-14-LittleEndian.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/dg.exp
    llvm/branches/non-call-eh/test/ExecutionEngine/hello.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/hello2.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/simplesttest.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/simpletest.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/test-branch.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/test-call.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/test-cast.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/test-constantexpr.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/test-fp.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/test-loadstore.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/test-logical.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/test-loop.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/test-malloc.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/test-phi.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/test-ret.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/test-setcond-fp.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/test-setcond-int.ll
    llvm/branches/non-call-eh/test/ExecutionEngine/test-shift.ll
    llvm/branches/non-call-eh/test/Feature/dg.exp
    llvm/branches/non-call-eh/test/Feature/globalredefinition3.ll
    llvm/branches/non-call-eh/test/Feature/llvm2cpp.exp
    llvm/branches/non-call-eh/test/Feature/llvm2cpp.ll
    llvm/branches/non-call-eh/test/Feature/packed_struct.ll
    llvm/branches/non-call-eh/test/FrontendObjC/2007-10-03-MetadataPointers.mm
    llvm/branches/non-call-eh/test/Integer/dg.exp
    llvm/branches/non-call-eh/test/Integer/packed_struct_bt.ll
    llvm/branches/non-call-eh/test/Linker/2003-01-30-LinkerRename.ll
    llvm/branches/non-call-eh/test/Linker/2003-04-21-Linkage.ll
    llvm/branches/non-call-eh/test/Linker/2003-04-23-LinkOnceLost.ll
    llvm/branches/non-call-eh/test/Linker/2003-04-26-NullPtrLinkProblem.ll
    llvm/branches/non-call-eh/test/Linker/2003-05-31-LinkerRename.ll
    llvm/branches/non-call-eh/test/Linker/2003-10-21-ConflictingTypesTolerance.ll
    llvm/branches/non-call-eh/test/Linker/2004-05-07-TypeResolution1.ll
    llvm/branches/non-call-eh/test/Linker/2004-12-03-DisagreeingType.ll
    llvm/branches/non-call-eh/test/Linker/2006-01-19-ConstantPacked.ll
    llvm/branches/non-call-eh/test/Linker/dg.exp
    llvm/branches/non-call-eh/test/Linker/link-archive.ll
    llvm/branches/non-call-eh/test/Linker/redefinition.ll
    llvm/branches/non-call-eh/test/Makefile
    llvm/branches/non-call-eh/test/Other/2007-06-05-PassID.ll
    llvm/branches/non-call-eh/test/Other/2007-06-16-Funcname.ll
    llvm/branches/non-call-eh/test/Other/dg.exp
    llvm/branches/non-call-eh/test/Other/invalid-commandline-option.ll
    llvm/branches/non-call-eh/test/Scripts/count
    llvm/branches/non-call-eh/test/TableGen/BitsInitOverflow.td
    llvm/branches/non-call-eh/test/TableGen/UnterminatedComment.td
    llvm/branches/non-call-eh/test/Transforms/ADCE/dg.exp
    llvm/branches/non-call-eh/test/Transforms/ArgumentPromotion/aggregate-promote.ll
    llvm/branches/non-call-eh/test/Transforms/ArgumentPromotion/control-flow.ll
    llvm/branches/non-call-eh/test/Transforms/ArgumentPromotion/dg.exp
    llvm/branches/non-call-eh/test/Transforms/BlockPlacement/basictest.ll
    llvm/branches/non-call-eh/test/Transforms/BlockPlacement/dg.exp
    llvm/branches/non-call-eh/test/Transforms/CodeExtractor/dg.exp
    llvm/branches/non-call-eh/test/Transforms/ConstProp/dg.exp
    llvm/branches/non-call-eh/test/Transforms/ConstantMerge/dg.exp
    llvm/branches/non-call-eh/test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll
    llvm/branches/non-call-eh/test/Transforms/DeadArgElim/deadretval2.ll
    llvm/branches/non-call-eh/test/Transforms/DeadArgElim/dg.exp
    llvm/branches/non-call-eh/test/Transforms/DeadStoreElimination/2004-11-28-LiveStoreDeleted.ll
    llvm/branches/non-call-eh/test/Transforms/DeadStoreElimination/dg.exp
    llvm/branches/non-call-eh/test/Transforms/GCSE/dg.exp
    llvm/branches/non-call-eh/test/Transforms/GVN/dg.exp
    llvm/branches/non-call-eh/test/Transforms/GVNPRE/dg.exp
    llvm/branches/non-call-eh/test/Transforms/GlobalDCE/dg.exp
    llvm/branches/non-call-eh/test/Transforms/GlobalOpt/dg.exp
    llvm/branches/non-call-eh/test/Transforms/IPConstantProp/dg.exp
    llvm/branches/non-call-eh/test/Transforms/IPConstantProp/return-constant.ll
    llvm/branches/non-call-eh/test/Transforms/IPConstantProp/return-constants.ll
    llvm/branches/non-call-eh/test/Transforms/IndVarsSimplify/2003-12-21-IndVarSize.ll
    llvm/branches/non-call-eh/test/Transforms/IndVarsSimplify/2004-04-05-InvokeCastCrash.ll
    llvm/branches/non-call-eh/test/Transforms/IndVarsSimplify/dg.exp
    llvm/branches/non-call-eh/test/Transforms/IndVarsSimplify/exit_value_tests.ll
    llvm/branches/non-call-eh/test/Transforms/IndVarsSimplify/loop_evaluate_1.ll
    llvm/branches/non-call-eh/test/Transforms/IndVarsSimplify/loop_evaluate_2.ll
    llvm/branches/non-call-eh/test/Transforms/IndVarsSimplify/tripcount_compute.ll
    llvm/branches/non-call-eh/test/Transforms/Inline/2007-12-19-InlineNoUnwind.ll
    llvm/branches/non-call-eh/test/Transforms/Inline/basictest.ll
    llvm/branches/non-call-eh/test/Transforms/Inline/dg.exp
    llvm/branches/non-call-eh/test/Transforms/Inline/inline_dce.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2003-11-13-ConstExprCastCall.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2004-09-20-BadLoadCombine2.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2006-10-19-SignedToUnsignedCastAndConst-2.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2008-01-06-BitCastAttributes.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/2008-01-21-MismatchedCastAndCompare.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/add2.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/apint-call-cast-target.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/bittest.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/bswap-fold.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/call.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/dg.exp
    llvm/branches/non-call-eh/test/Transforms/InstCombine/div.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/memmove.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/not.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/setcc-cast-cast.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/sub.ll
    llvm/branches/non-call-eh/test/Transforms/InstCombine/zext-fold.ll
    llvm/branches/non-call-eh/test/Transforms/LCSSA/dg.exp
    llvm/branches/non-call-eh/test/Transforms/LICM/2003-02-27-PreheaderProblem.ll
    llvm/branches/non-call-eh/test/Transforms/LICM/dg.exp
    llvm/branches/non-call-eh/test/Transforms/LoopIndexSplit/dg.exp
    llvm/branches/non-call-eh/test/Transforms/LoopRotate/dg.exp
    llvm/branches/non-call-eh/test/Transforms/LoopSimplify/dg.exp
    llvm/branches/non-call-eh/test/Transforms/LoopStrengthReduce/dg.exp
    llvm/branches/non-call-eh/test/Transforms/LoopStrengthReduce/dont-hoist-simple-loop-constants.ll
    llvm/branches/non-call-eh/test/Transforms/LoopUnroll/dg.exp
    llvm/branches/non-call-eh/test/Transforms/LoopUnswitch/dg.exp
    llvm/branches/non-call-eh/test/Transforms/LowerInvoke/dg.exp
    llvm/branches/non-call-eh/test/Transforms/LowerSetJmp/dg.exp
    llvm/branches/non-call-eh/test/Transforms/LowerSwitch/dg.exp
    llvm/branches/non-call-eh/test/Transforms/Mem2Reg/dg.exp
    llvm/branches/non-call-eh/test/Transforms/MemCpyOpt/dg.exp
    llvm/branches/non-call-eh/test/Transforms/MemCpyOpt/form-memset.ll
    llvm/branches/non-call-eh/test/Transforms/MemCpyOpt/form-memset2.ll
    llvm/branches/non-call-eh/test/Transforms/PredicateSimplifier/dg.exp
    llvm/branches/non-call-eh/test/Transforms/PruneEH/dg.exp
    llvm/branches/non-call-eh/test/Transforms/RaiseAllocations/dg.exp
    llvm/branches/non-call-eh/test/Transforms/Reassociate/dg.exp
    llvm/branches/non-call-eh/test/Transforms/Reassociate/mulfactor2.ll
    llvm/branches/non-call-eh/test/Transforms/SCCP/2008-03-10-sret.ll
    llvm/branches/non-call-eh/test/Transforms/SCCP/calltest.ll
    llvm/branches/non-call-eh/test/Transforms/SCCP/dg.exp
    llvm/branches/non-call-eh/test/Transforms/SRETPromotion/dg.exp
    llvm/branches/non-call-eh/test/Transforms/ScalarRepl/2003-09-12-IncorrectPromote.ll
    llvm/branches/non-call-eh/test/Transforms/ScalarRepl/2003-10-29-ArrayProblem.ll
    llvm/branches/non-call-eh/test/Transforms/ScalarRepl/dg.exp
    llvm/branches/non-call-eh/test/Transforms/SimplifyCFG/2003-08-17-BranchFold.ll
    llvm/branches/non-call-eh/test/Transforms/SimplifyCFG/2003-08-17-BranchFoldOrdering.ll
    llvm/branches/non-call-eh/test/Transforms/SimplifyCFG/branch-fold-test.ll
    llvm/branches/non-call-eh/test/Transforms/SimplifyCFG/branch-phi-thread.ll
    llvm/branches/non-call-eh/test/Transforms/SimplifyCFG/dg.exp
    llvm/branches/non-call-eh/test/Transforms/SimplifyCFG/switch_thread.ll
    llvm/branches/non-call-eh/test/Transforms/SimplifyLibCalls/FFS.ll
    llvm/branches/non-call-eh/test/Transforms/SimplifyLibCalls/MemCpy.ll
    llvm/branches/non-call-eh/test/Transforms/SimplifyLibCalls/StrChr.ll
    llvm/branches/non-call-eh/test/Transforms/SimplifyLibCalls/dg.exp
    llvm/branches/non-call-eh/test/Transforms/SimplifyLibCalls/floor.ll
    llvm/branches/non-call-eh/test/Transforms/SimplifyLibCalls/memcmp.ll
    llvm/branches/non-call-eh/test/Transforms/StripSymbols/dg.exp
    llvm/branches/non-call-eh/test/Transforms/TailCallElim/dg.exp
    llvm/branches/non-call-eh/test/Transforms/TailDup/MergeTest.ll
    llvm/branches/non-call-eh/test/Transforms/TailDup/dg.exp
    llvm/branches/non-call-eh/test/Verifier/2004-05-21-SwitchConstantMismatch.ll
    llvm/branches/non-call-eh/test/Verifier/2006-07-11-StoreStruct.ll
    llvm/branches/non-call-eh/test/Verifier/2007-12-21-InvokeParamAttrs.ll
    llvm/branches/non-call-eh/test/Verifier/2008-01-11-VarargAttrs.ll
    llvm/branches/non-call-eh/test/Verifier/byval-1.ll
    llvm/branches/non-call-eh/test/Verifier/byval-2.ll
    llvm/branches/non-call-eh/test/Verifier/byval-4.ll
    llvm/branches/non-call-eh/test/Verifier/dg.exp
    llvm/branches/non-call-eh/test/Verifier/gcread-ptrptr.ll
    llvm/branches/non-call-eh/test/Verifier/gcroot-alloca.ll
    llvm/branches/non-call-eh/test/Verifier/gcroot-meta.ll
    llvm/branches/non-call-eh/test/Verifier/gcroot-ptrptr.ll
    llvm/branches/non-call-eh/test/Verifier/gcwrite-ptrptr.ll
    llvm/branches/non-call-eh/test/Verifier/invoke-2.ll
    llvm/branches/non-call-eh/test/lib/llvm.exp
    llvm/branches/non-call-eh/test/lib/llvm2cpp.exp
    llvm/branches/non-call-eh/tools/Makefile
    llvm/branches/non-call-eh/tools/bugpoint/CrashDebugger.cpp
    llvm/branches/non-call-eh/tools/bugpoint/ExecutionDriver.cpp
    llvm/branches/non-call-eh/tools/bugpoint/ExtractFunction.cpp
    llvm/branches/non-call-eh/tools/bugpoint/Miscompilation.cpp
    llvm/branches/non-call-eh/tools/bugpoint/OptimizerDriver.cpp
    llvm/branches/non-call-eh/tools/bugpoint/ToolRunner.cpp
    llvm/branches/non-call-eh/tools/bugpoint/ToolRunner.h
    llvm/branches/non-call-eh/tools/llc/llc.cpp
    llvm/branches/non-call-eh/tools/lli/lli.cpp
    llvm/branches/non-call-eh/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
    llvm/branches/non-call-eh/tools/llvm-ld/Optimize.cpp
    llvm/branches/non-call-eh/tools/llvm-ld/llvm-ld.cpp
    llvm/branches/non-call-eh/tools/llvm-link/llvm-link.cpp
    llvm/branches/non-call-eh/tools/llvm-nm/llvm-nm.cpp
    llvm/branches/non-call-eh/tools/llvm-stub/llvm-stub.c
    llvm/branches/non-call-eh/tools/llvmc2/   (props changed)
    llvm/branches/non-call-eh/tools/llvmc2/Common.td
    llvm/branches/non-call-eh/tools/llvmc2/Makefile
    llvm/branches/non-call-eh/tools/llvmc2/Tools.td
    llvm/branches/non-call-eh/tools/llvmc2/doc/LLVMC-Enhancements.rst
    llvm/branches/non-call-eh/tools/opt/GraphPrinters.cpp
    llvm/branches/non-call-eh/tools/opt/opt.cpp
    llvm/branches/non-call-eh/utils/GenLibDeps.pl
    llvm/branches/non-call-eh/utils/NewNightlyTest.pl
    llvm/branches/non-call-eh/utils/TableGen/AsmWriterEmitter.cpp
    llvm/branches/non-call-eh/utils/TableGen/CallingConvEmitter.cpp
    llvm/branches/non-call-eh/utils/TableGen/CodeEmitterGen.cpp
    llvm/branches/non-call-eh/utils/TableGen/CodeGenDAGPatterns.cpp
    llvm/branches/non-call-eh/utils/TableGen/CodeGenDAGPatterns.h
    llvm/branches/non-call-eh/utils/TableGen/CodeGenInstruction.cpp
    llvm/branches/non-call-eh/utils/TableGen/CodeGenInstruction.h
    llvm/branches/non-call-eh/utils/TableGen/CodeGenIntrinsics.h
    llvm/branches/non-call-eh/utils/TableGen/CodeGenRegisters.h
    llvm/branches/non-call-eh/utils/TableGen/CodeGenTarget.cpp
    llvm/branches/non-call-eh/utils/TableGen/CodeGenTarget.h
    llvm/branches/non-call-eh/utils/TableGen/DAGISelEmitter.cpp
    llvm/branches/non-call-eh/utils/TableGen/DAGISelEmitter.h
    llvm/branches/non-call-eh/utils/TableGen/InstrInfoEmitter.cpp
    llvm/branches/non-call-eh/utils/TableGen/IntrinsicEmitter.cpp
    llvm/branches/non-call-eh/utils/TableGen/Record.cpp
    llvm/branches/non-call-eh/utils/TableGen/RegisterInfoEmitter.cpp
    llvm/branches/non-call-eh/utils/TableGen/TableGen.cpp
    llvm/branches/non-call-eh/utils/buildit/build_llvm
    llvm/branches/non-call-eh/utils/vim/tablegen.vim
    llvm/branches/non-call-eh/win32/Analysis/Analysis.vcproj
    llvm/branches/non-call-eh/win32/Archive/Archive.vcproj
    llvm/branches/non-call-eh/win32/AsmParser/AsmParser.vcproj
    llvm/branches/non-call-eh/win32/Bitcode/Bitcode.vcproj
    llvm/branches/non-call-eh/win32/CBackend/CBackend.vcproj
    llvm/branches/non-call-eh/win32/CodeGen/CodeGen.vcproj
    llvm/branches/non-call-eh/win32/Configure/Configure.vcproj
    llvm/branches/non-call-eh/win32/ExecutionEngine/ExecutionEngine.vcproj
    llvm/branches/non-call-eh/win32/Fibonacci/Fibonacci.vcproj
    llvm/branches/non-call-eh/win32/Linker/Linker.vcproj
    llvm/branches/non-call-eh/win32/Support/Support.vcproj
    llvm/branches/non-call-eh/win32/System/System.vcproj
    llvm/branches/non-call-eh/win32/TableGen/TableGen.vcproj
    llvm/branches/non-call-eh/win32/Target/Target.vcproj
    llvm/branches/non-call-eh/win32/Transforms/Transforms.vcproj
    llvm/branches/non-call-eh/win32/VMCore/VMCore.vcproj
    llvm/branches/non-call-eh/win32/bugpoint/bugpoint.vcproj
    llvm/branches/non-call-eh/win32/clang.sln
    llvm/branches/non-call-eh/win32/dobison.cmd
    llvm/branches/non-call-eh/win32/llc/llc.vcproj
    llvm/branches/non-call-eh/win32/lli/lli.vcproj
    llvm/branches/non-call-eh/win32/llvm-ar/llvm-ar.vcproj
    llvm/branches/non-call-eh/win32/llvm-as/llvm-as.vcproj
    llvm/branches/non-call-eh/win32/llvm-bcanalyzer/llvm-bcanalyzer.vcproj
    llvm/branches/non-call-eh/win32/llvm-dis/llvm-dis.vcproj
    llvm/branches/non-call-eh/win32/llvm-ld/llvm-ld.vcproj
    llvm/branches/non-call-eh/win32/llvm-link/llvm-link.vcproj
    llvm/branches/non-call-eh/win32/llvm-nm/llvm-nm.vcproj
    llvm/branches/non-call-eh/win32/llvm-prof/llvm-prof.vcproj
    llvm/branches/non-call-eh/win32/llvm-ranlib/llvm-ranlib.vcproj
    llvm/branches/non-call-eh/win32/opt/opt.vcproj
    llvm/branches/non-call-eh/win32/x86/x86.vcproj

Modified: llvm/branches/non-call-eh/CREDITS.TXT
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/CREDITS.TXT?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/CREDITS.TXT (original)
+++ llvm/branches/non-call-eh/CREDITS.TXT Sun Jul  6 15:45:41 2008
@@ -110,6 +110,10 @@
 D: Miscellaneous bug fixes
 D: Register allocation refactoring
 
+N: Gabor Greif
+E: ggreif at gmail.com
+D: Improvements for space efficiency
+
 N: Gordon Henriksen
 E: gordonhenriksen at mac.com
 D: Pluggable GC support

Modified: llvm/branches/non-call-eh/LICENSE.TXT
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/LICENSE.TXT?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/LICENSE.TXT (original)
+++ llvm/branches/non-call-eh/LICENSE.TXT Sun Jul  6 15:45:41 2008
@@ -62,7 +62,6 @@
 Program             Directory
 -------             ---------
 System Library      llvm/lib/System
-Compiler Driver     llvm/tools/llvmc
 Autoconf            llvm/autoconf
                     llvm/projects/ModuleMaker/autoconf
                     llvm/projects/sample/autoconf

Modified: llvm/branches/non-call-eh/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/Makefile?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/Makefile (original)
+++ llvm/branches/non-call-eh/Makefile Sun Jul  6 15:45:41 2008
@@ -77,9 +77,9 @@
 dist-hook::
 	$(Echo) Eliminating files constructed by configure
 	$(Verb) $(RM) -f \
-	  $(TopDistDir)/include/llvm/ADT/hash_map  \
-	  $(TopDistDir)/include/llvm/ADT/hash_set  \
-	  $(TopDistDir)/include/llvm/ADT/iterator  \
+	  $(TopDistDir)/include/llvm/ADT/hash_map.h  \
+	  $(TopDistDir)/include/llvm/ADT/hash_set.h  \
+	  $(TopDistDir)/include/llvm/ADT/iterator.h  \
 	  $(TopDistDir)/include/llvm/Config/config.h  \
 	  $(TopDistDir)/include/llvm/Support/DataTypes.h  \
 	  $(TopDistDir)/include/llvm/Support/ThreadSupport.h
@@ -95,9 +95,9 @@
 FilesToConfig := \
   include/llvm/Config/config.h \
   include/llvm/Support/DataTypes.h \
-  include/llvm/ADT/hash_map \
-  include/llvm/ADT/hash_set \
-  include/llvm/ADT/iterator
+  include/llvm/ADT/hash_map.h \
+  include/llvm/ADT/hash_set.h \
+  include/llvm/ADT/iterator.h
 FilesToConfigPATH  := $(addprefix $(LLVM_OBJ_ROOT)/,$(FilesToConfig))
 
 all-local:: $(FilesToConfigPATH)

Modified: llvm/branches/non-call-eh/Makefile.rules
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/Makefile.rules?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/Makefile.rules (original)
+++ llvm/branches/non-call-eh/Makefile.rules Sun Jul  6 15:45:41 2008
@@ -226,7 +226,7 @@
 
     # Darwin requires -fstrict-aliasing to be explicitly enabled.
     ifeq ($(OS),Darwin)
-      EXTRA_OPTIONS += -fstrict-aliasing
+      EXTRA_OPTIONS += -fstrict-aliasing -Wstrict-aliasing
     endif
 
     CXX.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
@@ -451,6 +451,10 @@
   DISABLE_AUTO_DEPENDENCIES=1
 endif
 
+ifeq ($(OS),SunOS)
+CPP.BaseFlags += -include llvm/System/Solaris.h
+endif
+
 LD.Flags      += -L$(LibDir) -L$(LLVMLibDir) 
 CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_LIMIT_MACROS
 # All -I flags should go here, so that they don't confuse llvm-config.
@@ -1738,10 +1742,17 @@
 endif
 
 check-line-length:
-	@egrep -n '.{81}' $(Sources)
+	@echo searching for overlength lines in files: $(Sources)
+	@echo
+	@echo
+	@egrep -n '.{81}' $(Sources) /dev/null
 
 check-for-tabs:
-	@egrep -n '	' $(Sources)
+	@echo searching for tabs in files: $(Sources)
+	@echo
+	@echo
+	@egrep -n '	' $(Sources) /dev/null
+
 check-footprint:
 	@ls -l $(LibDir) | awk '\
 	  BEGIN { sum = 0; } \

Modified: llvm/branches/non-call-eh/autoconf/configure.ac
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/autoconf/configure.ac?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/autoconf/configure.ac (original)
+++ llvm/branches/non-call-eh/autoconf/configure.ac Sun Jul  6 15:45:41 2008
@@ -31,7 +31,7 @@
 dnl===-----------------------------------------------------------------------===
 dnl Initialize autoconf and define the package name, version number and
 dnl email address for reporting bugs.
-AC_INIT([[llvm]],[[2.3svn]],[llvmbugs at cs.uiuc.edu])
+AC_INIT([[llvm]],[[2.4svn]],[llvmbugs at 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.
@@ -70,7 +70,10 @@
       sample)       AC_CONFIG_SUBDIRS([projects/sample])    ;;
       privbracket)  AC_CONFIG_SUBDIRS([projects/privbracket]) ;;
       llvm-stacker) AC_CONFIG_SUBDIRS([projects/llvm-stacker]) ;;
+      # llvm-test is the old name of the test-suite, kept here for backwards
+      # compatibility
       llvm-test)    AC_CONFIG_SUBDIRS([projects/llvm-test]) ;;
+      test-suite)   AC_CONFIG_SUBDIRS([projects/test-suite]) ;;
       llvm-reopt)   AC_CONFIG_SUBDIRS([projects/llvm-reopt]);;
       llvm-gcc)     AC_CONFIG_SUBDIRS([projects/llvm-gcc])  ;;
       llvm-java)    AC_CONFIG_SUBDIRS([projects/llvm-java]) ;;
@@ -137,6 +140,11 @@
     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"
@@ -216,6 +224,7 @@
   ia64-*)                 llvm_cv_target_arch="IA64" ;;
   arm-*)                  llvm_cv_target_arch="ARM" ;;
   mips-*)                 llvm_cv_target_arch="Mips" ;;
+  pic16-*)                llvm_cv_target_arch="PIC16" ;;
   *)                      llvm_cv_target_arch="Unknown" ;;
 esac])
 
@@ -314,6 +323,7 @@
     IA64)    AC_SUBST(TARGET_HAS_JIT,0) ;;
     ARM)     AC_SUBST(TARGET_HAS_JIT,0) ;;
     Mips)    AC_SUBST(TARGET_HAS_JIT,0) ;;
+    PIC16)   AC_SUBST(TARGET_HAS_JIT,0) ;;
     *)       AC_SUBST(TARGET_HAS_JIT,0) ;;
   esac
 fi
@@ -363,7 +373,7 @@
     [Build specific host targets: all,host-only,{target-name} (default=all)]),,
     enableval=all)
 case "$enableval" in
-  all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha IA64 ARM Mips CellSPU CBackend MSIL" ;;
+  all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha IA64 ARM Mips CellSPU PIC16 CBackend MSIL CppBackend" ;;
   host-only)
     case "$llvm_cv_target_arch" in
       x86)     TARGETS_TO_BUILD="X86" ;;
@@ -375,6 +385,7 @@
       ARM)     TARGETS_TO_BUILD="ARM" ;;
       Mips)    TARGETS_TO_BUILD="Mips" ;;
       CellSPU|SPU) TARGETS_TO_BUILD="CellSPU" ;;
+      PIC16)   TARGETS_TO_BUILD="PIC16" ;;
       *)       AC_MSG_ERROR([Can not set target to build]) ;;
     esac
     ;;
@@ -389,8 +400,10 @@
         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" ;;
         cbe)     TARGETS_TO_BUILD="CBackend $TARGETS_TO_BUILD" ;;
         msil)    TARGETS_TO_BUILD="MSIL $TARGETS_TO_BUILD" ;;
+        cpp)     TARGETS_TO_BUILD="CppBackend $TARGETS_TO_BUILD" ;;
         *) AC_MSG_ERROR([Unrecognized target $a_target]) ;;
       esac
   done
@@ -976,9 +989,9 @@
 dnl files can be updated automatically when their *.in sources change.
 AC_CONFIG_HEADERS([include/llvm/Config/config.h])
 AC_CONFIG_HEADERS([include/llvm/Support/DataTypes.h])
-AC_CONFIG_HEADERS([include/llvm/ADT/hash_map])
-AC_CONFIG_HEADERS([include/llvm/ADT/hash_set])
-AC_CONFIG_HEADERS([include/llvm/ADT/iterator])
+AC_CONFIG_HEADERS([include/llvm/ADT/hash_map.h])
+AC_CONFIG_HEADERS([include/llvm/ADT/hash_set.h])
+AC_CONFIG_HEADERS([include/llvm/ADT/iterator.h])
 
 dnl Configure the makefile's configuration data
 AC_CONFIG_FILES([Makefile.config])

Modified: llvm/branches/non-call-eh/bindings/ocaml/llvm/llvm_ocaml.c
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/bindings/ocaml/llvm/llvm_ocaml.c?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/bindings/ocaml/llvm/llvm_ocaml.c (original)
+++ llvm/branches/non-call-eh/bindings/ocaml/llvm/llvm_ocaml.c Sun Jul  6 15:45:41 2008
@@ -329,7 +329,7 @@
 }
 
 CAMLprim value llvm_refine_type(LLVMTypeRef AbstractTy, LLVMTypeRef ConcreteTy){
-  LLVMRefineAbstractType(AbstractTy, ConcreteTy);
+  LLVMRefineType(AbstractTy, ConcreteTy);
   return Val_unit;
 }
 

Modified: llvm/branches/non-call-eh/configure
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/configure?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/configure (original)
+++ llvm/branches/non-call-eh/configure Sun Jul  6 15:45:41 2008
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.60 for llvm 2.3svn.
+# Generated by GNU Autoconf 2.60 for llvm 2.4svn.
 #
 # Report bugs to <llvmbugs at cs.uiuc.edu>.
 #
@@ -715,8 +715,8 @@
 # Identity of this package.
 PACKAGE_NAME='llvm'
 PACKAGE_TARNAME='-llvm-'
-PACKAGE_VERSION='2.3svn'
-PACKAGE_STRING='llvm 2.3svn'
+PACKAGE_VERSION='2.4svn'
+PACKAGE_STRING='llvm 2.4svn'
 PACKAGE_BUGREPORT='llvmbugs at cs.uiuc.edu'
 
 ac_unique_file="lib/VMCore/Module.cpp"
@@ -951,6 +951,7 @@
 projects/privbracket
 projects/llvm-stacker
 projects/llvm-test
+projects/test-suite
 projects/llvm-reopt
 projects/llvm-gcc
 projects/llvm-java
@@ -1459,7 +1460,7 @@
   # 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.3svn to adapt to many kinds of systems.
+\`configure' configures llvm 2.4svn to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1525,7 +1526,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of llvm 2.3svn:";;
+     short | recursive ) echo "Configuration of llvm 2.4svn:";;
    esac
   cat <<\_ACEOF
 
@@ -1660,7 +1661,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-llvm configure 2.3svn
+llvm configure 2.4svn
 generated by GNU Autoconf 2.60
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1676,7 +1677,7 @@
 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.3svn, which was
+It was created by llvm $as_me 2.4svn, which was
 generated by GNU Autoconf 2.60.  Invocation command line was
 
   $ $0 $@
@@ -2089,8 +2090,12 @@
  ;;
       llvm-stacker) subdirs="$subdirs projects/llvm-stacker"
  ;;
+      # llvm-test is the old name of the test-suite, kept here for backwards
+      # compatibility
       llvm-test)    subdirs="$subdirs projects/llvm-test"
  ;;
+      test-suite)   subdirs="$subdirs projects/test-suite"
+ ;;
       llvm-reopt)   subdirs="$subdirs projects/llvm-reopt"
 ;;
       llvm-gcc)     subdirs="$subdirs projects/llvm-gcc"
@@ -2282,6 +2287,11 @@
     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"
@@ -2375,6 +2385,7 @@
   ia64-*)                 llvm_cv_target_arch="IA64" ;;
   arm-*)                  llvm_cv_target_arch="ARM" ;;
   mips-*)                 llvm_cv_target_arch="Mips" ;;
+  pic16-*)                llvm_cv_target_arch="PIC16" ;;
   *)                      llvm_cv_target_arch="Unknown" ;;
 esac
 fi
@@ -4662,6 +4673,8 @@
  ;;
     Mips)    TARGET_HAS_JIT=0
  ;;
+    PIC16)   TARGET_HAS_JIT=0
+ ;;
     *)       TARGET_HAS_JIT=0
  ;;
   esac
@@ -4743,7 +4756,7 @@
 fi
 
 case "$enableval" in
-  all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha IA64 ARM Mips CellSPU CBackend MSIL" ;;
+  all) TARGETS_TO_BUILD="X86 Sparc PowerPC Alpha IA64 ARM Mips CellSPU PIC16 CBackend MSIL CppBackend" ;;
   host-only)
     case "$llvm_cv_target_arch" in
       x86)     TARGETS_TO_BUILD="X86" ;;
@@ -4755,6 +4768,7 @@
       ARM)     TARGETS_TO_BUILD="ARM" ;;
       Mips)    TARGETS_TO_BUILD="Mips" ;;
       CellSPU|SPU) TARGETS_TO_BUILD="CellSPU" ;;
+      PIC16)   TARGETS_TO_BUILD="PIC16" ;;
       *)       { { 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; }; } ;;
@@ -4771,8 +4785,10 @@
         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" ;;
         cbe)     TARGETS_TO_BUILD="CBackend $TARGETS_TO_BUILD" ;;
         msil)    TARGETS_TO_BUILD="MSIL $TARGETS_TO_BUILD" ;;
+        cpp)     TARGETS_TO_BUILD="CppBackend $TARGETS_TO_BUILD" ;;
         *) { { echo "$as_me:$LINENO: error: Unrecognized target $a_target" >&5
 echo "$as_me: error: Unrecognized target $a_target" >&2;}
    { (exit 1); exit 1; }; } ;;
@@ -10630,7 +10646,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 10633 "configure"
+#line 10649 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12774,7 +12790,7 @@
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 12777 "configure"' > conftest.$ac_ext
+  echo '#line 12793 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -14492,11 +14508,11 @@
    -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:14495: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14511: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:14499: \$? = $ac_status" >&5
+   echo "$as_me:14515: \$? = $ac_status" >&5
    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.
@@ -14760,11 +14776,11 @@
    -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:14763: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14779: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:14767: \$? = $ac_status" >&5
+   echo "$as_me:14783: \$? = $ac_status" >&5
    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.
@@ -14864,11 +14880,11 @@
    -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:14867: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14883: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:14871: \$? = $ac_status" >&5
+   echo "$as_me:14887: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -17316,7 +17332,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 17319 "configure"
+#line 17335 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -17416,7 +17432,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 17419 "configure"
+#line 17435 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19784,11 +19800,11 @@
    -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:19787: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:19803: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:19791: \$? = $ac_status" >&5
+   echo "$as_me:19807: \$? = $ac_status" >&5
    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.
@@ -19888,11 +19904,11 @@
    -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:19891: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:19907: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:19895: \$? = $ac_status" >&5
+   echo "$as_me:19911: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -21458,11 +21474,11 @@
    -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:21461: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:21477: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:21465: \$? = $ac_status" >&5
+   echo "$as_me:21481: \$? = $ac_status" >&5
    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.
@@ -21562,11 +21578,11 @@
    -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:21565: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:21581: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:21569: \$? = $ac_status" >&5
+   echo "$as_me:21585: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -23797,11 +23813,11 @@
    -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:23800: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:23816: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:23804: \$? = $ac_status" >&5
+   echo "$as_me:23820: \$? = $ac_status" >&5
    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.
@@ -24065,11 +24081,11 @@
    -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:24068: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:24084: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:24072: \$? = $ac_status" >&5
+   echo "$as_me:24088: \$? = $ac_status" >&5
    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.
@@ -24169,11 +24185,11 @@
    -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:24172: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:24188: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:24176: \$? = $ac_status" >&5
+   echo "$as_me:24192: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -34255,11 +34271,11 @@
 
 ac_config_headers="$ac_config_headers include/llvm/Support/DataTypes.h"
 
-ac_config_headers="$ac_config_headers include/llvm/ADT/hash_map"
+ac_config_headers="$ac_config_headers include/llvm/ADT/hash_map.h"
 
-ac_config_headers="$ac_config_headers include/llvm/ADT/hash_set"
+ac_config_headers="$ac_config_headers include/llvm/ADT/hash_set.h"
 
-ac_config_headers="$ac_config_headers include/llvm/ADT/iterator"
+ac_config_headers="$ac_config_headers include/llvm/ADT/iterator.h"
 
 
 ac_config_files="$ac_config_files Makefile.config"
@@ -34710,7 +34726,7 @@
 # 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.3svn, which was
+This file was extended by llvm $as_me 2.4svn, which was
 generated by GNU Autoconf 2.60.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -34763,7 +34779,7 @@
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-llvm config.status 2.3svn
+llvm config.status 2.4svn
 configured by $0, generated by GNU Autoconf 2.60,
   with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
@@ -34878,9 +34894,9 @@
   case $ac_config_target in
     "include/llvm/Config/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/Config/config.h" ;;
     "include/llvm/Support/DataTypes.h") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/Support/DataTypes.h" ;;
-    "include/llvm/ADT/hash_map") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/ADT/hash_map" ;;
-    "include/llvm/ADT/hash_set") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/ADT/hash_set" ;;
-    "include/llvm/ADT/iterator") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/ADT/iterator" ;;
+    "include/llvm/ADT/hash_map.h") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/ADT/hash_map.h" ;;
+    "include/llvm/ADT/hash_set.h") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/ADT/hash_set.h" ;;
+    "include/llvm/ADT/iterator.h") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/ADT/iterator.h" ;;
     "Makefile.config") CONFIG_FILES="$CONFIG_FILES Makefile.config" ;;
     "llvm.spec") CONFIG_FILES="$CONFIG_FILES llvm.spec" ;;
     "docs/doxygen.cfg") CONFIG_FILES="$CONFIG_FILES docs/doxygen.cfg" ;;

Modified: llvm/branches/non-call-eh/docs/CodeGenerator.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/CodeGenerator.html?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/CodeGenerator.html (original)
+++ llvm/branches/non-call-eh/docs/CodeGenerator.html Sun Jul  6 15:45:41 2008
@@ -84,6 +84,7 @@
   </li>
   <li><a href="#targetimpls">Target-specific Implementation Notes</a>
     <ul>
+    <li><a href="#tailcallopt">Tail call optimization</a></li>
     <li><a href="#x86">The X86 backend</a></li>
     <li><a href="#ppc">The PowerPC backend</a>
       <ul>
@@ -620,9 +621,9 @@
 
 <div class="doc_code">
 <pre>
-int %test(int %X, int %Y) {
-  %Z = div int %X, %Y
-  ret int %Z
+define i32 @test(i32 %X, i32 %Y) {
+  %Z = udiv i32 %X, %Y
+  ret i32 %Z
 }
 </pre>
 </div>
@@ -789,7 +790,8 @@
 edges are represented by instances of the <tt>SDOperand</tt> class, which is 
 a <tt><SDNode, unsigned></tt> pair, indicating the node and result
 value being used, respectively.  Each value produced by an <tt>SDNode</tt> has
-an associated <tt>MVT::ValueType</tt> indicating what type the value is.</p>
+an associated <tt>MVT</tt> (Machine Value Type) indicating what the type of the
+value is.</p>
 
 <p>SelectionDAGs contain two different kinds of values: those that represent
 data flow and those that represent control flow dependencies.  Data values are
@@ -1466,12 +1468,12 @@
 <div class="doc_code">
 <pre>
 %a = MOVE %b
-%a = ADD %a %b
+%a = ADD %a %c
 </pre>
 </div>
 
 <p>Notice that, internally, the second instruction is represented as
-<tt>ADD %a[def/use] %b</tt>. I.e., the register operand <tt>%a</tt> is
+<tt>ADD %a[def/use] %c</tt>. I.e., the register operand <tt>%a</tt> is
 both used and defined by the instruction.</p>
 
 </div>
@@ -1620,7 +1622,51 @@
 
 </div>
 
+<!-- ======================================================================= -->
+<div class="doc_subsection">
+  <a name="tailcallopt">Tail call optimization</a>
+</div>
+
+<div class="doc_text">
+  <p>Tail call optimization, callee reusing the stack of the caller, is currently supported on x86/x86-64 and PowerPC. It is performed if:
+    <ul>
+      <li>Caller and callee have the calling convention <tt>fastcc</tt>.</li>
+      <li>The call is a tail call - in tail position (ret immediately follows call and ret uses value of call or is void).</li>
+      <li>Option <tt>-tailcallopt</tt> is enabled.</li>
+      <li>Platform specific constraints are met.</li>
+    </ul>
+  </p>
 
+  <p>x86/x86-64 constraints:
+    <ul>
+      <li>No variable argument lists are used.</li>
+      <li>On x86-64 when generating GOT/PIC code only module-local calls (visibility = hidden or protected) are supported.</li>
+    </ul>
+  </p>
+  <p>PowerPC constraints:
+    <ul>
+      <li>No variable argument lists are used.</li>
+      <li>No byval parameters are used.</li>
+      <li>On ppc32/64 GOT/PIC only module-local calls (visibility = hidden or protected) are supported.</li>
+    </ul>
+  </p>
+  <p>Example:</p>
+  <p>Call as <tt>llc -tailcallopt test.ll</tt>.
+    <div class="doc_code">
+      <pre>
+declare fastcc i32 @tailcallee(i32 inreg %a1, i32 inreg %a2, i32 %a3, i32 %a4)
+
+define fastcc i32 @tailcaller(i32 %in1, i32 %in2) {
+  %l1 = add i32 %in1, %in2
+  %tmp = tail call fastcc i32 @tailcallee(i32 %in1 inreg, i32 %in2 inreg, i32 %in1, i32 %l1)
+  ret i32 %tmp
+}</pre>
+    </div>
+  </p>
+  <p>Implications of <tt>-tailcallopt</tt>:</p>
+  <p>To support tail call optimization in situations where the callee has more arguments than the caller a 'callee pops arguments' convention is used. This currently causes each <tt>fastcc</tt> call that is not tail call optimized (because one or more of above constraints are not met) to be followed by a readjustment of the stack. So performance might be worse in such cases.</p>
+  <p>On x86 and x86-64 one register is reserved for indirect tail calls (e.g via a function pointer). So there is one less register for integer argument passing. For x86 this means 2 registers (if <tt>inreg</tt> parameter attribute is used) and for x86-64 this means 5 register are used.</p>
+</div>
 <!-- ======================================================================= -->
 <div class="doc_subsection">
   <a name="x86">The X86 backend</a>

Modified: llvm/branches/non-call-eh/docs/CodingStandards.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/CodingStandards.html?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/CodingStandards.html (original)
+++ llvm/branches/non-call-eh/docs/CodingStandards.html Sun Jul  6 15:45:41 2008
@@ -623,6 +623,29 @@
 
 <p>You get the idea...</p>
 
+<p>Please be aware when adding assert statements that not all compilers are aware of
+the semantics of the assert.  In some places, asserts are used to indicate a piece of
+code that should not be reached.  These are typically of the form:</p>
+
+<div class="doc_code">
+<pre>
+assert(0 && "Some helpful error message");
+</pre>
+</div>
+
+<p>When used in a function that returns a value, they should be followed with a return
+statement and a comment indicating that this line is never reached.  This will prevent
+a compiler which is unable to deduce that the assert statement never returns from
+generating a warning.</p>
+
+<div class="doc_code">
+<pre>
+assert(0 && "Some helpful error message");
+// Not reached
+return 0;
+</pre>
+</div>
+
 </div>
 
 <!-- _______________________________________________________________________ -->

Modified: llvm/branches/non-call-eh/docs/CommandGuide/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/CommandGuide/Makefile?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/CommandGuide/Makefile (original)
+++ llvm/branches/non-call-eh/docs/CommandGuide/Makefile Sun Jul  6 15:45:41 2008
@@ -23,6 +23,12 @@
 
 clean:
 	rm -f pod2htm*.*~~ $(HTML) $(MAN) $(PS)
+
+# To create other directories, as needed, and timestamp their creation
+%/.dir:
+	-mkdir $* > /dev/null
+	date > $@
+
 else
 
 # Otherwise, if not in BUILD_FOR_WEBSITE mode, use the project info.

Modified: llvm/branches/non-call-eh/docs/CommandGuide/index.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/CommandGuide/index.html?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/CommandGuide/index.html (original)
+++ llvm/branches/non-call-eh/docs/CommandGuide/index.html Sun Jul  6 15:45:41 2008
@@ -63,17 +63,12 @@
 <li><a href="/cmds/llvm-prof.html"><b>llvm-prof</b></a> -
     format raw `<tt>llvmprof.out</tt>' data into a human-readable report</li>
 
-<li><a href="/cmds/llvmc.html"><b>llvmc</b></a> -
-  generic and configurable compiler driver</li>
-
 <li><a href="/cmds/llvm-ld.html"><b>llvm-ld</b></a> -
   general purpose linker with loadable runtime optimization support</li>
 
 <li><a href="/cmds/llvm-config.html"><b>llvm-config</b></a> - 
   print out LLVM compilation options, libraries, etc. as configured.</li>
 
-  <li><a href="/cmds/llvm2cpp.html"><b>llvm2cpp</b></a> - convert LLVM assembly
-  into the corresponding LLVM C++ API calls to produce it</li>
 </ul>
 
 </div>

Modified: llvm/branches/non-call-eh/docs/CommandGuide/llvm-ld.pod
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/CommandGuide/llvm-ld.pod?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/CommandGuide/llvm-ld.pod (original)
+++ llvm/branches/non-call-eh/docs/CommandGuide/llvm-ld.pod Sun Jul  6 15:45:41 2008
@@ -159,34 +159,6 @@
 
 =over 
 
-=item B<-O0>
-
-An alias for the -O1 option.
-
-=item B<-O1>
-
-Optimize for linking speed, not execution speed. The optimizer will attempt to
-reduce the size of the linked program to reduce I/O but will not otherwise
-perform any link-time optimizations.
-
-=item B<-O2>
-
-Perform only the minimal or required set of scalar optimizations.
-
-=item B<-03>
-
-An alias for the -O2 option.
-
-=item B<-04>
-
-Perform the standard link time inter-procedural optimizations. This will 
-attempt to optimize the program taking the entire program into consideration.
-
-=item B<-O5>
-
-Perform aggressive link time optimizations. This is the same as -O4 but works
-more aggressively to optimize the program.
-
 =item B<-disable-inlining>
 
 Do not run the inlining pass. Functions will not be inlined into other

Removed: llvm/branches/non-call-eh/docs/CommandGuide/llvm2cpp.pod
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/CommandGuide/llvm2cpp.pod?rev=53162&view=auto

==============================================================================
--- llvm/branches/non-call-eh/docs/CommandGuide/llvm2cpp.pod (original)
+++ llvm/branches/non-call-eh/docs/CommandGuide/llvm2cpp.pod (removed)
@@ -1,217 +0,0 @@
-=pod
-
-=head1 NAME
-
-llvm2xpp - LLVM bitcode to LLVM C++ IR translator
-
-=head1 SYNOPSIS
-
-B<llvm2cpp> [I<options>] [I<filename>]
-
-=head1 DESCRIPTION
-
-B<llvm2cpp> translates from LLVM bitcode (.bc files) to a 
-corresponding C++ source file that will make calls against the LLVM C++ API to
-build the same module as the input. By default, the C++ output is a complete
-program that builds the module, verifies it and then emits the module as
-LLVM assembly. This technique assists with testing because the input to
-B<llvm2cpp> and the output of the generated C++ program should be identical.
-
-If F<filename> is omitted or is C<->, then B<llvm2cpp> reads its input from
-standard input.
-
-If an output file is not specified with the B<-o> option, then
-B<llvm2cpp> sends its output to a file or standard output by following
-these rules:
-
-=over 
-
-=item *
-
-If the input is standard input, then the output is standard output.
-
-=item *
-
-If the input is a file that ends with C<.bc>, then the output file is of
-the same name, except that the suffix is changed to C<.cpp>.
-
-=item *
-
-If the input is a file that does not end with the C<.bc> suffix, then the
-output file has the same name as the input file, except that the C<.cpp>
-suffix is appended.
-
-=back
-
-=head1 OPTIONS
-
-=over
-
-=item B<-f>
-
-Force overwrite.  Normally, B<llvm2cpp> will refuse to overwrite an
-output file that already exists.  With this option, B<llvm2cpp>
-will overwrite the output file and replace it with new C++ source code.
-
-=item B<--help>
-
-Print a summary of command line options.
-
-=item B<-f> 
-
-Normally, B<llvm2cpp> will not overwrite an existing output file. With this
-option, that default behavior is changed and the program will overwrite existing
-output files.
-
-=item B<-o> F<filename>
-
-Specify the output file name.  If F<filename> is C<->, then B<llvm2cpp>
-sends its output to standard output.
-
-=item B<-funcname> F<functionName>
-
-Specify the name of the function to be generated. The generated code contains a
-single function that produces the input module. By default its name is
-I<makeLLVMModule>. The B<-funcname> option overrides this default and allows
-you to control the name of the generated function. This is handy in conjunction
-with the B<-fragment> option when you only want B<llvm2cpp> to generate a
-single function that produces the module. With both options, such generated code
-could be I<#included> into another program.
-
-=item B<-for>
-
-Specify the name of the thing for which C++ code should be generated. By default
-the entire input module is re-generated. However, use of the various B<-gen-*>
-options can restrict what is produced. This option indicates what that
-restriction is.
-
-=item B<-gen-program>
-
-Specify that the output should be a complete program. Such program will recreate
-B<llvm2cpp>'s input as an LLVM module, verify that module, and then write out
-the module in LLVM assembly format. This is useful for doing identity tests
-where the output of the generated program is identical to the input to
-B<llvm2cpp>. The LLVM DejaGnu test suite can make use of this fact. This is the
-default form of generated output.
-
-If the B<-for> option is given with this option, it specifies the module
-identifier to use for the module created.
-
-=item B<-gen-module>
-
-Specify that the output should be a function that regenerates the module. It is
-assumed that this output will be #included into another program that has already
-arranged for the correct header files to be #included. The function generated
-takes no arguments and returns a I<Module*>. 
-
-If the B<-for> option is given with this option, it specifies the module
-identifier to use in creating the module returned by the generated function.
-
-=item B<-gen-contents>
-
-Specify that the output should be a function that adds the contents of the input
-module to another module. It is assumed that the output will be #included into
-another program that has already arranged for the correct header files to be
-#included. The function generated takes a single argument of type I<Module*> and
-returns that argument. Note that Module level attributes such as endianess,
-pointer size, target triple and inline asm are not passed on from the input
-module to the destination module. Only the sub-elements of the module (types,
-constants, functions, global variables) will be added to the input module.
-
-If the B<-for> option is given with this option, it specifies the module
-identifier to set in the input module by the generated function.
-
-=item B<-gen-function>
-
-Specify that the output should be a function that produces the definitions
-necessary for a specific function to be added to a module.  It is assumed that 
-the output will be #included into another program that has already arranged 
-for the correct header files to be #included. The function generated takes a 
-single argument of type I<Module*> and returns the I<Function*> that it added to
-the module.  Note that only those things (types, constants, etc.) directly 
-needed in the definition of the function will be placed in the generated
-function. 
-
-The B<-for> option must be given with this option or an error will be produced.
-The value of the option must be the name of a function in the input module for
-which code should be generated. If the named function does not exist an error
-will be produced.
-
-=item B<-gen-inline>
-
-This option is very analagous to B<-gen-function> except that the generated
-function will not re-produce the target function's definition. Instead, the body
-of the target function is inserted into some other function passed as an
-argument to the generated function. Similarly any arguments to the function must
-be passed to the generated function. The result of the generated function is the
-first basic block of the target function.
-
-The B<-for> option works the same way as it does for B<-gen-function>.
-
-=item B<-gen-variable>
-
-Specify that the output should be a function that produces the definitions
-necessary for a specific global variable to be added to a module. It is assumed
-that the output will be #included into another program that has already arranged
-for the correct header files to be #included. The function generated takes a
-single argument of type I<Module*> and returns the I<GlobalVariable*> that it 
-added to the module. Note that only those things (types, constants, etc.)
-directly needed in the definition of the global variable will be placed in the
-generated function.
-
-The B<-for> option must be given with this option or an error will be produced.
-THe value of the option must be the name of a global variable in the input
-module for which code should be generated. If the named global variable does not
-exist an error will be produced.
-
-=item B<-gen-type>
-
-Specify that the output should be a function that produces the definitions
-necessary for specific type to be added to a module. It is assumed that the
-otuput will be #included into another program that has already arranged for the
-correct header files to be #included. The function generated take a single
-argument of type I<Module*> and returns the I<Type*> that it added to the
-module. Note that the generated function will only add the necessary type
-definitions to (possibly recursively) define the requested type.
-
-The B<-for> option must be given with this option or an error will be produced.
-The value of the option must be the name of a global type in the input module
-for which code should be generated. If the named type does not exist an error
-will be produced.
-
-=item B<-stats>
-
-Show pass statistics (not interesting in this program).
-
-=item B<-time-passes>
-
-Show pass timing statistics (not interesting in this program).
-
-=item B<-version>
-
-Show the version number of this program.
-
-=back
-
-
-=head1 EXIT STATUS
-
-If B<llvm2cpp> succeeds, it will exit with 0.  Otherwise, if an error
-occurs, it will exit with a non-zero value.
-
-=head1 SEE ALSO
-
-L<llvm-as|llvm-as> L<tblgen|tblgen>
-
-=head1 NOTES
-
-This tool may be removed from a future version of LLVM. Instead, its
-functionality may be incorporated into the llc tool. It would then act similarly
-to other targets except its output would be C++ source that could be compiled to
-construct the input program.
-
-=head1 AUTHORS
-
-Written by Reid Spencer (L<http://hlvm.org>).
-
-=cut

Removed: llvm/branches/non-call-eh/docs/CommandGuide/llvmc.pod
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/CommandGuide/llvmc.pod?rev=53162&view=auto

==============================================================================
--- llvm/branches/non-call-eh/docs/CommandGuide/llvmc.pod (original)
+++ llvm/branches/non-call-eh/docs/CommandGuide/llvmc.pod (removed)
@@ -1,431 +0,0 @@
-=pod
-
-=head1 NAME
-
-llvmc - The LLVM Compiler Driver (experimental)
-
-=head1 SYNOPSIS
-
-B<llvmc> [I<options>] [I<filenames>...]
-
-=head1 DESCRIPTION
-
-B<llvmc> is a configurable driver for invoking other LLVM (and non-LLVM) tools
-in order to compile, optimize and link software for multiple languages. For
-those familiar with FSF's B<gcc> tool, it is very similar.  Please note that
-B<llvmc> is considered an experimental tool.  B<llvmc> has the following goals:
-
-=over
-
-=item * provide a single point of access to the LLVM tool set,
-
-=item * hide the complexities of the LLVM tools through a single interface,
-
-=item * make integration of existing non-LLVM tools simple,
-
-=item * extend the capabilities of minimal front ends, and
-
-=item * make the interface for compiling consistent for all languages.
-
-=back
-
-The tool itself does nothing with a user's program. It merely invokes other
-tools to get the compilation tasks done.
-
-The options supported by B<llvmc> generalize the compilation process and
-provide a consistent and simple interface for multiple programming languages.
-This makes it easier for developers to get their software compiled with LLVM.
-Without B<llvmc>, developers would need to understand how to invoke the 
-front-end compiler, optimizer, assembler, and linker in order to compile their 
-programs. B<llvmc>'s sole mission is to trivialize that process.
-
-=head2 Basic Operation
-
-B<llvmc> always takes the following basic actions:
-
-=over
-
-=item * Command line options and filenames are collected.
-
-The command line options provide the marching orders to B<llvmc> on what actions
-it should perform. This is the I<request> the user is making of B<llvmc> and it
-is interpreted first.
-
-=item * Configuration files are read.
-
-Based on the options and the suffixes of the filenames presented, a set of 
-configuration files are read to configure the actions B<llvmc> will take. 
-Configuration files are provided by either LLVM or the front end compiler tools
-that B<llvmc> invokes. Users generally don't need to be concerned with the
-contents of the configuration files. 
-
-=item * Determine actions to take.
-
-The tool chain needed to complete the task is determined. This is the primary 
-work of B<llvmc>. It breaks the request specified by the command line options 
-into a set of basic actions to be done: 
-
-=over
-
-=item * Pre-processing: gathering/filtering compiler input (optional).
-
-=item * Translation: source language to bitcode conversion.
-
-=item * Assembly: bitcode to native code conversion.
-
-=item * Optimization: conversion of bitcode to something that runs faster.
-
-=item * Linking: combining multiple bitcode files to produce executable program.
-
-=back
-
-=item * Execute actions.
-
-The actions determined previously are executed sequentially and then
-B<llvmc> terminates.
-
-=back
-
-=head1 OPTIONS
-
-=head2 Control Options
-
-Control options tell B<llvmc> what to do at a high level. The 
-following control options are defined:
-
-=over
-
-=item B<-c> or B<--compile>
-
-This option specifies that the linking phase is not to be run. All
-previous phases, if applicable will run. This is generally how a given
-bitcode file is compiled and optimized for a source language module.
-
-=item B<-k> or B<--link> or default
-
-This option (or the lack of any control option) specifies that all stages
-of compilation, optimization, and linking should be attempted.  Source files
-specified on the command line will be compiled and linked with objects and
-libraries also specified. 
-
-=item B<-S>
-
-This option specifies that compilation should end in the creation of
-an LLVM assembly file that can be later converted to an LLVM object
-file.
-
-=item B<-E>
-
-This option specifies that no compilation or linking should be 
-performed. Only pre-processing, if applicable to the language being
-compiled, is performed. For languages that support it, this will
-result in the output containing the raw input to the compiler.
-
-=back
-
-=head2 Optimization Options
-
-Optimization with B<llvmc> is based on goals and specified with
-the following -O options. The specific details of which
-optimizations run is controlled by the configuration files because
-each source language will have different needs. 
-
-=over
-
-=item B<-O1> or B<-O0> (default, fast compilation)
-
-Only those optimizations that will hasten the compilation (mostly by reducing
-the output) are applied. In general these are extremely fast and simple 
-optimizations that reduce emitted code size. The goal here is not to make the 
-resulting program fast but to make the compilation fast.  If not specified, 
-this is the default level of optimization.
-
-=item B<-O2> (basic optimization)
-
-This level of optimization specifies a balance between generating good code 
-that will execute reasonably quickly and not spending too much time optimizing
-the code to get there. For example, this level of optimization may include 
-things like global common sub-expression elimination, aggressive dead code 
-elimination, and scalar replication.
-
-=item B<-O3> (aggressive optimization)
-
-This level of optimization aggressively optimizes each set of files compiled 
-together. However, no link-time inter-procedural optimization is performed.
-This level implies all the optimizations of the B<-O1> and B<-O2> optimization
-levels, and should also provide loop optimizations and compile time 
-inter-procedural optimizations. Essentially, this level tries to do as much
-as it can with the input it is given but doesn't do any link time IPO.
-
-=item B<-O4> (link time optimization)
-
-In addition to the previous three levels of optimization, this level of 
-optimization aggressively optimizes each program at link time. It employs
-basic analysis and basic link-time inter-procedural optimizations, 
-considering the program as a whole.
-
-=item B<-O5> (aggressive link time optimization)
-
-This is the same as B<-O4> except it employs aggressive analyses and
-aggressive inter-procedural optimization. 
-
-=item B<-O6> (profile guided optimization: not implemented)
-
-This is the same as B<-O5> except that it employs profile-guided
-re-optimization of the program after it has executed. Note that this implies
-a single level of re-optimization based on run time profile analysis. Once
-the re-optimization has completed, the profiling instrumentation is
-removed and final optimizations are employed.
-
-=item B<-O7> (lifelong optimization: not implemented)
-
-This is the same as B<-O5> and similar to B<-O6> except that re-optimization
-is performed through the life of the program. That is, each run will update
-the profile by which future re-optimizations are directed.
-
-=back
-
-=head2 Input Options
-
-=over
-
-=item B<-l> I<LIBRARY>
-
-This option instructs B<llvmc> to locate a library named I<LIBRARY> and search
-it for unresolved symbols when linking the program.
-
-=item B<-L> F<path>
-
-This option instructs B<llvmc> to add F<path> to the list of places in which
-the linker will
-
-=item B<-x> I<LANGUAGE>
-
-This option instructs B<llvmc> to regard the following input files as 
-containing programs in the language I<LANGUAGE>. Normally, input file languages
-are identified by their suffix but this option will override that default
-behavior. The B<-x> option stays in effect until the end of the options or
-a new B<-x> option is encountered.
-
-=back
-
-=head2 Output Options
-
-=over
-
-=item B<-m>I<arch>
-
-This option selects the back end code generator to use. The I<arch> portion
-of the option names the back end to use.
-
-=item B<--native>
-
-Normally, B<llvmc> produces bitcode files at most stages of compilation.
-With this option, B<llvmc> will arrange for native object files to be
-generated with the B<-c> option, native assembly files to be generated
-with the B<-S> option, and native executables to be generated with the
-B<--link> option. In the case of the B<-E> option, the output will not
-differ as there is no I<native> version of pre-processed output.
-
-=item B<-o> F<filename>
-
-Specify the output file name.  The contents of the file  depend on other 
-options. 
-
-=back
-
-=head2 Information Options
-
-=over
-
-=item B<-n> or B<--no-op>
-
-This option tells B<llvmc> to do everything but actually execute the
-resulting tools. In combination with the B<-v> option, this causes B<llvmc>
-to merely print out what it would have done.
-
-=item B<-v> or B<--verbose>
-
-This option will cause B<llvmc> to print out (on standard output) each of the 
-actions it takes to accomplish the objective. The output will immediately
-precede the invocation of other tools.
-
-=item B<--stats>
-
-Print all statistics gathered during the compilation to the standard error. 
-Note that this option is merely passed through to the sub-tools to do with 
-as they please.
-
-=item B<--time-passes>
-
-Record the amount of time needed for each optimization pass and print it 
-to standard error. Like B<--stats> this option is just passed through to
-the sub-tools to do with as they please.
-
-=item B<--time-programs>
-
-Record the amount of time each program (compilation tool) takes and print
-it to the standard error. 
-
-=back
-
-=head2 Language Specific Options
-
-=over
-
-=item B<-T,pre>=I<options>
-
-Pass an arbitrary option to the pre-processor.
-
-=item B<-T,opt>=I<options>
-
-Pass an arbitrary option to the optimizer.
-
-=item B<-T,lnk>=I<options>
-
-Pass an arbitrary option to the linker.
-
-=item B<-T,asm>=I<options>
-
-Pass an arbitrary option to the code generator.
-
-=back
-
-=head2 C/C++ Specific Options
-
-=over
-
-=item B<-I>F<path>
-
-This option is just passed through to a C or C++ front end compiler to tell it
-where include files can be found.
-
-=item B<-D>F<symbol>
-
-This option is just passed through to a C or C++ front end compiler to tell it
-to define a symbol.
-
-=back
-
-=head2 Miscellaneous Options
-
-=over
-
-=item B<--help>
-
-Print a summary of command line options.
-
-=item B<--version>
-
-This option will cause B<llvmc> to print out its version number and terminate.
-
-=back
-
-=head2 Advanced Options
-
-You better know what you're doing if you use these options. Improper use
-of these options can produce drastically wrong results.
-
-=over 
-
-=item B<--config-dir> F<dirname>
-
-This option tells B<llvmc> to read configuration data from the I<directory>
-named F<dirname>. Data from such directories will be read in the order
-specified on the command line after all other standard configuration files have
-been read. This allows users or groups of users to conveniently create 
-their own configuration directories in addition to the standard ones to which 
-they may not have write access.
-
-=back
-
-
-=head2 Unimplemented Options
-
-The options below are not currently implemented in B<llvmc> but will be
-eventually. They are documented here as "future design".
-
-=over
-
-=item B<--show-config> I<[suffixes...]>
-
-When this option is given, the only action taken by B<llvmc> is to show its
-final configuration state in the form of a configuration file. No compilation
-tasks will be conducted when this option is given; processing will stop once
-the configuration has been printed. The optional (comma separated) list of 
-suffixes controls what is printed. Without any suffixes, the configuration
-for all languages is printed. With suffixes, only the languages pertaining
-to those file suffixes will be printed. The configuration information is
-printed after all command line options and configuration files have been
-read and processed. This allows the user to verify that the correct
-configuration data has been read by B<llvmc>.
-
-=item B<--config> :I<section>:I<name>=I<value>
-
-This option instructs B<llvmc> to accept I<value> as the value for configuration
-item I<name> in the section named I<section>. This is a quick way to override
-a configuration item on the command line without resorting to changing the
-configuration files. 
-
-=item B<--config-only-from> F<dirname>
-
-This option tells B<llvmc> to skip the normal processing of configuration
-files and only configure from the contents of the F<dirname> directory. Multiple
-B<--config-only-from> options may be given in which case the directories are
-read in the order given on the command line.
-
-=item B<--emit-raw-code>
-
-No optimization is done whatsoever. The compilers invoked by B<llvmc> with 
-this option given will be instructed to produce raw, unoptimized code.  This 
-option is useful only to front end language developers and therefore does not 
-participate in the list of B<-O> options. This is distinctly different from
-the B<-O0> option (a synonym for B<-O1>) because those optimizations will
-reduce code size to make compilation faster. With B<--emit-raw-code>, only
-the full raw code produced by the compiler will be generated.
-
-=back
-
-
-=head1 EXIT STATUS
-
-If B<llvmc> succeeds, it will exit with 0.  Otherwise, if an error
-occurs, it will exit with a non-zero value and no compilation actions
-will be taken. If one of the compilation tools returns a non-zero 
-status, pending actions will be discarded and B<llvmc> will return the
-same result code as the failing compilation tool.
-
-=head1 DEFICIENCIES
-
-B<llvmc> is considered an experimental LLVM tool because it has these
-deficiencies: 
-
-=over
-
-=item Insufficient support for native linking
-
-Because B<llvm-ld> doesn't handle native linking, neither can B<llvmc>
-
-=item Poor configuration support
-
-The support for configuring new languages, etc. is weak. There are many
-command line configurations that cannot be achieved with the current
-support. Furthermore the grammar is cumbersome for configuration files.
-Please see L<http://llvm.org/PR686> for further details.
-
-=item Does not handle target specific configurations
-
-This is one of the major deficiencies, also addressed in 
-L<http://llvm.org/PR686>
-
-=back
-
-=head1 SEE ALSO
-
-L<llvm-as|llvm-as>, L<llvm-dis|llvm-dis>, L<llc|llc>, L<llvm-link|llvm-link>
-
-=head1 AUTHORS
-
-Maintained by the LLVM Team (L<http://llvm.org>).
-
-=cut

Modified: llvm/branches/non-call-eh/docs/CommandGuide/llvmgcc.pod
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/CommandGuide/llvmgcc.pod?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/CommandGuide/llvmgcc.pod (original)
+++ llvm/branches/non-call-eh/docs/CommandGuide/llvmgcc.pod Sun Jul  6 15:45:41 2008
@@ -15,12 +15,14 @@
 bitcode or LLVM assembly language, depending upon the options.
 
 By default, B<llvm-gcc> compiles to native objects just like GCC does. If the
-B<-emit-llvm> option is given then it will generate LLVM bitcode files instead.
-If B<-S> (assembly) is also given, then it will generate LLVM assembly. 
+B<-emit-llvm> and B<-c> options are given then it will generate LLVM bitcode files
+instead. If B<-emit-llvm> and B<-S> are given, then it will generate LLVM
+assembly.
 
 Being derived from the GNU Compiler Collection, B<llvm-gcc> has many
 of gcc's features and accepts most of gcc's options.  It handles a
-number of gcc's extensions to the C programming language.
+number of gcc's extensions to the C programming language.  See the gcc
+documentation for details.
 
 =head1 OPTIONS
 
@@ -30,18 +32,6 @@
 
 Print a summary of command line options.
 
-=item B<-S>
-
-Do not generate an LLVM bitcode file.  Rather, compile the source
-file into an LLVM assembly language file.
-
-=item B<-c>
-
-Do not generate a linked executable.  Rather, compile the source
-file into an LLVM bitcode file.  This bitcode file can then be
-linked with other bitcode files later on to generate a full LLVM
-executable.
-
 =item B<-o> I<filename>
 
 Specify the output file to be I<filename>.
@@ -63,8 +53,9 @@
 
 =item B<-emit-llvm>
 
-Make the output be LLVM bitcode (or assembly) instead of native object (or
-assembly).
+Make the output be LLVM bitcode (with B<-c>) or assembly (with B<-s>) instead
+of native object (or assembly).  If B<-emit-llvm> is given without either B<-c>
+or B<-S> it has no effect.
 
 =back
 

Modified: llvm/branches/non-call-eh/docs/CommandLine.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/CommandLine.html?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/CommandLine.html (original)
+++ llvm/branches/non-call-eh/docs/CommandLine.html Sun Jul  6 15:45:41 2008
@@ -52,6 +52,7 @@
                                    specified</a></li>
         <li><a href="#formatting">Controlling other formatting options</a></li>
         <li><a href="#misc">Miscellaneous option modifiers</a></li>
+        <li><a href="#response">Response files</a></li>
         </ul></li>
 
       <li><a href="#toplevel">Top-Level Classes and Functions</a>
@@ -1442,6 +1443,29 @@
 
 </div>
 
+<!-- _______________________________________________________________________ -->
+<div class="doc_subsubsection">
+  <a name="response">Response files</a>
+</div>
+
+<div class="doc_text">
+
+<p>Some systems, such as certain variants of Microsoft Windows and
+some older Unices have a relatively low limit on command-line
+length. It is therefore customary to use the so-called 'response
+files' to circumvent this restriction. These files are mentioned on
+the command-line (using the "@file") syntax. The program reads these
+files and inserts the contents into argv, thereby working around the
+command-line length limits. Response files are enabled by an optional
+fourth argument to
+<a href="#cl::ParseEnvironmentOptions"><tt>cl::ParseEnvironmentOptions</tt></a>
+and
+<a href="#cl::ParseCommandLineOptions"><tt>cl::ParseCommandLineOptions</tt></a>.
+</p>
+
+</div>
+
+
 <!-- ======================================================================= -->
 <div class="doc_subsection">
   <a name="toplevel">Top-Level Classes and Functions</a>
@@ -1475,7 +1499,8 @@
 <p>The <tt>cl::ParseCommandLineOptions</tt> function requires two parameters
 (<tt>argc</tt> and <tt>argv</tt>), but may also take an optional third parameter
 which holds <a href="#description">additional extra text</a> to emit when the
-<tt>--help</tt> option is invoked.</p>
+<tt>--help</tt> option is invoked, and a fourth boolean parameter that enables
+<a href="#response">response files</a>.</p>
 
 </div>
 
@@ -1497,11 +1522,13 @@
 href="#cl::ParseCommandLineOptions"><tt>cl::ParseCommandLineOptions</tt></a>
 does.</p>
 
-<p>It takes three parameters: the name of the program (since <tt>argv</tt> may
+<p>It takes four parameters: the name of the program (since <tt>argv</tt> may
 not be available, it can't just look in <tt>argv[0]</tt>), the name of the
-environment variable to examine, and the optional
+environment variable to examine, the optional
 <a href="#description">additional extra text</a> to emit when the
-<tt>--help</tt> option is invoked.</p>
+<tt>--help</tt> option is invoked, and the boolean
+switch that controls whether <a href="#response">reponse files</a>
+should be read.</p>
 
 <p><tt>cl::ParseEnvironmentOptions</tt> will break the environment
 variable's value up into words and then process them using

Modified: llvm/branches/non-call-eh/docs/CompilerDriver.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/CompilerDriver.html?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/CompilerDriver.html (original)
+++ llvm/branches/non-call-eh/docs/CompilerDriver.html Sun Jul  6 15:45:41 2008
@@ -1,823 +1,420 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-  <title>The LLVM Compiler Driver (llvmc)</title>
-  <link rel="stylesheet" href="llvm.css" type="text/css">
-  <meta name="author" content="Reid Spencer">
-  <meta name="description" 
-  content="A description of the use and design of the LLVM Compiler Driver.">
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
+<title>Customizing LLVMC: Reference Manual</title>
+<link rel="stylesheet" href="llvm.css" type="text/css" />
 </head>
 <body>
-<div class="doc_title">The LLVM Compiler Driver (llvmc)</div>
-<p class="doc_warning">NOTE: This document is a work in progress!</p>
-<ol>
-  <li><a href="#abstract">Abstract</a></li>
-  <li><a href="#introduction">Introduction</a>
-    <ol>
-      <li><a href="#purpose">Purpose</a></li>
-      <li><a href="#operation">Operation</a></li>
-      <li><a href="#phases">Phases</a></li>
-      <li><a href="#actions">Actions</a></li>
-    </ol>
-  </li>
-  <li><a href="#configuration">Configuration</a>
-    <ol>
-      <li><a href="#overview">Overview</a></li>
-      <li><a href="#filetypes">Configuration Files</a></li>
-      <li><a href="#syntax">Syntax</a></li>
-      <li><a href="#substitutions">Substitutions</a></li>
-      <li><a href="#sample">Sample Config File</a></li>
-    </ol>
-  <li><a href="#glossary">Glossary</a>
-</ol>
-<div class="doc_author">
-<p>Written by <a href="mailto:rspencer at x10sys.com">Reid Spencer</a>
-</p>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"> <a name="abstract">Abstract</a></div>
-<!-- *********************************************************************** -->
-<div class="doc_text">
-  <p>This document describes the requirements, design, and configuration of the
-  LLVM compiler driver, <tt>llvmc</tt>.  The compiler driver knows about LLVM's 
-  tool set and can be configured to know about a variety of compilers for 
-  source languages.  It uses this knowledge to execute the tools necessary 
-  to accomplish general compilation, optimization, and linking tasks. The main 
-  purpose of <tt>llvmc</tt> is to provide a simple and consistent interface to 
-  all compilation tasks. This reduces the burden on the end user who can just 
-  learn to use <tt>llvmc</tt> instead of the entire LLVM tool set and all the
-  source language compilers compatible with LLVM.</p>
-</div>
-<!-- *********************************************************************** -->
-<div class="doc_section"> <a name="introduction">Introduction</a></div>
-<!-- *********************************************************************** -->
-<div class="doc_text">
-  <p>The <tt>llvmc</tt> <a href="#def_tool">tool</a> is a configurable compiler 
-  <a href="#def_driver">driver</a>. As such, it isn't a compiler, optimizer, 
-  or a linker itself but it drives (invokes) other software that perform those 
-  tasks. If you are familiar with the GNU Compiler Collection's <tt>gcc</tt> 
-  tool, <tt>llvmc</tt> is very similar.</p>
-  <p>The following introductory sections will help you understand why this tool
-  is necessary and what it does.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="purpose">Purpose</a></div>
-<div class="doc_text">
-  <p><tt>llvmc</tt> was invented to make compilation of user programs with 
-  LLVM-based tools easier. To accomplish this, <tt>llvmc</tt> strives to:</p>
-  <ul>
-    <li>Be the single point of access to most of the LLVM tool set.</li>
-    <li>Hide the complexities of the LLVM tools through a single interface.</li>
-    <li>Provide a consistent interface for compiling all languages.</li>
-  </ul>
-  <p>Additionally, <tt>llvmc</tt> makes it easier to write a compiler for use
-  with LLVM, because it:</p>
-  <ul>
-    <li>Makes integration of existing non-LLVM tools simple.</li>
-    <li>Extends the capabilities of minimal compiler tools by optimizing their
-    output.</li>
-    <li>Reduces the number of interfaces a compiler writer must know about
-    before a working compiler can be completed (essentially only the VMCore
-    interfaces need to be understood).</li>
-    <li>Supports source language translator invocation via both dynamically
-    loadable shared objects and invocation of an executable.</li>
-  </ul>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="operation">Operation</a></div>
-<div class="doc_text">
-  <p>At a high level, <tt>llvmc</tt> operation is very simple.  The basic action
-  taken by <tt>llvmc</tt> is to simply invoke some tool or set of tools to fill 
-  the user's request for compilation. Every execution of <tt>llvmc</tt>takes the 
-  following sequence of steps:</p>
-  <dl>
-    <dt><b>Collect Command Line Options</b></dt>
-    <dd>The command line options provide the marching orders to <tt>llvmc</tt> 
-    on what actions it should perform. This is the request the user is making 
-    of <tt>llvmc</tt> and it is interpreted first. See the <tt>llvmc</tt>
-    <a href="CommandGuide/html/llvmc.html">manual page</a> for details on the
-    options.</dd>
-    <dt><b>Read Configuration Files</b></dt>
-    <dd>Based on the options and the suffixes of the filenames presented, a set 
-    of configuration files are read to configure the actions <tt>llvmc</tt> will 
-    take.  Configuration files are provided by either LLVM or the 
-    compiler tools that <tt>llvmc</tt> invokes. These files determine what 
-    actions <tt>llvmc</tt> will take in response to the user's request. See 
-    the section on <a href="#configuration">configuration</a> for more details.
-    </dd>
-    <dt><b>Determine Phases To Execute</b></dt>
-    <dd>Based on the command line options and configuration files,
-    <tt>llvmc</tt> determines the compilation <a href="#phases">phases</a> that
-    must be executed by the user's request. This is the primary work of
-    <tt>llvmc</tt>.</dd>
-    <dt><b>Determine Actions To Execute</b></dt>
-    <dd>Each <a href="#phases">phase</a> to be executed can result in the
-    invocation of one or more <a href="#actions">actions</a>. An action is
-    either a whole program or a function in a dynamically linked shared library. 
-    In this step, <tt>llvmc</tt> determines the sequence of actions that must be 
-    executed. Actions will always be executed in a deterministic order.</dd>
-    <dt><b>Execute Actions</b></dt>
-    <dd>The <a href="#actions">actions</a> necessary to support the user's
-    original request are executed sequentially and deterministically. All 
-    actions result in either the invocation of a whole program to perform the 
-    action or the loading of a dynamically linkable shared library and invocation 
-    of a standard interface function within that library.</dd> 
-    <dt><b>Termination</b></dt>
-    <dd>If any action fails (returns a non-zero result code), <tt>llvmc</tt>
-    also fails and returns the result code from the failing action. If
-    everything succeeds, <tt>llvmc</tt> will return a zero result code.</dd>
-  </dl>
-  <p><tt>llvmc</tt>'s operation must be simple, regular and predictable. 
-  Developers need to be able to rely on it to take a consistent approach to
-  compilation. For example, the invocation:</p>
-  <code>
-    llvmc -O2 x.c y.c z.c -o xyz</code>
-  <p>must produce <i>exactly</i> the same results as:</p>
-  <pre><tt>
-    llvmc -O2 x.c -o x.o
-    llvmc -O2 y.c -o y.o
-    llvmc -O2 z.c -o z.o
-    llvmc -O2 x.o y.o z.o -o xyz</tt></pre>
-  <p>To accomplish this, <tt>llvmc</tt> uses a very simple goal oriented
-  procedure to do its work. The overall goal is to produce a functioning
-  executable. To accomplish this, <tt>llvmc</tt> always attempts to execute a 
-  series of compilation <a href="#def_phase">phases</a> in the same sequence. 
-  However, the user's options to <tt>llvmc</tt> can cause the sequence of phases 
-  to start in the middle or finish early.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="phases"></a>Phases </div>
-<div class="doc_text">
-  <p><tt>llvmc</tt> breaks every compilation task into the following five 
-  distinct phases:</p>
-  <dl><dt><b>Preprocessing</b></dt><dd>Not all languages support preprocessing; 
-    but for those that do, this phase can be invoked. This phase is for 
-    languages that provide combining, filtering, or otherwise altering with the 
-    source language input before the translator parses it. Although C and C++ 
-    are the most common users of this phase, other languages may provide their 
-    own preprocessor (whether its the C pre-processor or not).</dd>
-  </dl>
-  <dl><dt><b>Translation</b></dt><dd>The translation phase converts the source 
-    language input into something that LLVM can interpret and use for 
-    downstream phases. The translation is essentially from "non-LLVM form" to
-    "LLVM form".</dd>
-  </dl>
-  <dl><dt><b>Optimization</b></dt><dd>Once an LLVM Module has been obtained from 
-    the translation phase, the program enters the optimization phase. This phase 
-    attempts to optimize all of the input provided on the command line according 
-    to the options provided.</dd>
-  </dl>
-  <dl><dt><b>Linking</b></dt><dd>The inputs are combined to form a complete
-    program.</dd>
-  </dl>
-  <p>The following table shows the inputs, outputs, and command line options
-  applicable to each phase.</p>
-  <table>
-    <tr>
-      <th style="width: 10%">Phase</th>
-      <th style="width: 25%">Inputs</th>
-      <th style="width: 25%">Outputs</th>
-      <th style="width: 40%">Options</th>
-    </tr>
-    <tr><td><b>Preprocessing</b></td>
-      <td class="td_left"><ul><li>Source Language File</li></ul></td>
-      <td class="td_left"><ul><li>Source Language File</li></ul></td>
-      <td class="td_left"><dl>
-          <dt><tt>-E</tt></dt>
-          <dd>Stops the compilation after preprocessing</dd>
-      </dl></td>
-    </tr>
-    <tr>
-      <td><b>Translation</b></td>
-      <td class="td_left"><ul>
-          <li>Source Language File</li>
-      </ul></td>
-      <td class="td_left"><ul>
-          <li>LLVM Assembly</li>
-          <li>LLVM Bitcode</li>
-          <li>LLVM C++ IR</li>
-      </ul></td>
-      <td class="td_left"><dl>
-          <dt><tt>-c</tt></dt>
-          <dd>Stops the compilation after translation so that optimization and 
-          linking are not done.</dd>
-          <dt><tt>-S</tt></dt>
-          <dd>Stops the compilation before object code is written so that only
-          assembly code remains.</dd>
-      </dl></td>
-    </tr>
-    <tr>
-      <td><b>Optimization</b></td>
-      <td class="td_left"><ul>
-          <li>LLVM Assembly</li>
-          <li>LLVM Bitcode</li>
-      </ul></td>
-      <td class="td_left"><ul>
-          <li>LLVM Bitcode</li>
-      </ul></td>
-      <td class="td_left"><dl>
-          <dt><tt>-Ox</tt>
-          <dd>This group of options controls the amount of optimization 
-          performed.</dd>
-      </dl></td>
-    </tr>
-    <tr>
-      <td><b>Linking</b></td>
-      <td class="td_left"><ul>
-          <li>LLVM Bitcode</li>
-          <li>Native Object Code</li>
-          <li>LLVM Library</li>
-          <li>Native Library</li>
-      </ul></td>
-      <td class="td_left"><ul>
-          <li>LLVM Bitcode Executable</li>
-          <li>Native Executable</li>
-      </ul></td>
-      <td class="td_left"><dl>
-          <dt><tt>-L</tt></dt><dd>Specifies a path for library search.</dd>
-          <dt><tt>-l</tt></dt><dd>Specifies a library to link in.</dd>
-      </dl></td>
-    </tr>
-  </table>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="actions"></a>Actions</div>
-<div class="doc_text">
-  <p>An action, with regard to <tt>llvmc</tt> is a basic operation that it takes
-  in order to fulfill the user's request. Each phase of compilation will invoke
-  zero or more actions in order to accomplish that phase.</p>
-  <p>Actions come in two forms:</p>
-  <ul>
-    <li>Invokable Executables</li>
-    <li>Functions in a shared library</li>
-  </ul>
-</div>
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="configuration">Configuration</a></div>
-<!-- *********************************************************************** -->
-<div class="doc_text">
-  <p>This section of the document describes the configuration files used by
-  <tt>llvmc</tt>.  Configuration information is relatively static for a 
-  given release of LLVM and a compiler tool. However, the details may 
-  change from release to release of either.  Users are encouraged to simply use 
-  the various options of the <tt>llvmc</tt> command and ignore the configuration 
-  of the tool. These configuration files are for compiler writers and LLVM 
-  developers. Those wishing to simply use <tt>llvmc</tt> don't need to understand 
-  this section but it may be instructive on how the tool works.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="overview"></a>Overview</div>
-<div class="doc_text">
-<p><tt>llvmc</tt> is highly configurable both on the command line and in 
-configuration files. The options it understands are generic, consistent and 
-simple by design.  Furthermore, the <tt>llvmc</tt> options apply to the 
-compilation of any LLVM enabled programming language. To be enabled as a 
-supported source language compiler, a compiler writer must provide a 
-configuration file that tells <tt>llvmc</tt> how to invoke the compiler 
-and what its capabilities are. The purpose of the configuration files then 
-is to allow compiler writers to specify to <tt>llvmc</tt> how the compiler 
-should be invoked. Users may but are not advised to alter the compiler's 
-<tt>llvmc</tt> configuration.</p>
-
-<p>Because <tt>llvmc</tt> just invokes other programs, it must deal with the
-available command line options for those programs regardless of whether they
-were written for LLVM or not. Furthermore, not all compiler tools will
-have the same capabilities. Some compiler tools will simply generate LLVM assembly
-code, others will be able to generate fully optimized bitcode. In general,
-<tt>llvmc</tt> doesn't make any assumptions about the capabilities or command 
-line options of a sub-tool. It simply uses the details found in the 
-configuration files and leaves it to the compiler writer to specify the 
-configuration correctly.</p>
-
-<p>This approach means that new compiler tools can be up and working very
-quickly. As a first cut, a tool can simply compile its source to raw
-(unoptimized) bitcode or LLVM assembly and <tt>llvmc</tt> can be configured 
-to pick up the slack (translate LLVM assembly to bitcode, optimize the 
-bitcode, generate native assembly, link, etc.).   In fact, the compiler tools 
-need not use any LLVM libraries, and it could be written in any language 
-(instead of C++).  The configuration data will allow the full range of 
-optimization, assembly, and linking capabilities that LLVM provides to be added 
-to these kinds of tools.  Enabling the rapid development of front-ends is one 
-of the primary goals of <tt>llvmc</tt>.</p>
-
-<p>As a compiler tool matures, it may utilize the LLVM libraries and tools 
-to more efficiently produce optimized bitcode directly in a single compilation 
-and optimization program. In these cases, multiple tools would not be needed 
-and the configuration data for the compiler would change.</p>
-
-<p>Configuring <tt>llvmc</tt> to the needs and capabilities of a source language 
-compiler is relatively straight-forward.  A compiler writer must provide a 
-definition of what to do for each of the five compilation phases for each of 
-the optimization levels. The specification consists simply of prototypical 
-command lines into which <tt>llvmc</tt> can substitute command line
-arguments and file names. Note that any given phase can be completely blank if
-the source language's compiler combines multiple phases into a single program.
-For example, quite often pre-processing, translation, and optimization are
-combined into a single program. The specification for such a compiler would have
-blank entries for pre-processing and translation but a full command line for
-optimization.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="filetypes">Configuration Files</a></div>
-<div class="doc_subsubsection"><a name="filecontents">File Contents</a></div>
-<div class="doc_text">
-  <p>Each configuration file provides the details for a single source language
-  that is to be compiled.  This configuration information tells <tt>llvmc</tt> 
-  how to invoke the language's pre-processor, translator, optimizer, assembler
-  and linker. Note that a given source language needn't provide all these tools
-  as many of them exist in llvm currently.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"><a name="dirsearch">Directory Search</a></div>
-<div class="doc_text">
-  <p><tt>llvmc</tt> always looks for files of a specific name. It uses the
-  first file with the name its looking for by searching directories in the
-  following order:<br/>
-  <ol>
-    <li>Any directory specified by the <tt>-config-dir</tt> option will be
-    checked first.</li>
-    <li>If the environment variable LLVM_CONFIG_DIR is set, and it contains
-    the name of a valid directory, that directory will be searched next.</li>
-    <li>If the user's home directory (typically <tt>/home/user</tt> contains 
-    a sub-directory named <tt>.llvm</tt> and that directory contains a 
-    sub-directory named <tt>etc</tt> then that directory will be tried 
-    next.</li>
-    <li>If the LLVM installation directory (typically <tt>/usr/local/llvm</tt>
-    contains a sub-directory named <tt>etc</tt> then that directory will be
-    tried last.</li>
-    <li>A standard "system" directory will be searched next. This is typically
-    <tt>/etc/llvm</tt> on UNIX™ and <tt>C:\WINNT</tt> on Microsoft
-    Windows™.</li>
-    <li>If the configuration file sought still can't be found, <tt>llvmc</tt>
-    will print an error message and exit.</li>
-  </ol>
-  <p>The first file found in this search will be used. Other files with the 
-  same name will be ignored even if they exist in one of the subsequent search
-  locations.</p>
-</div>
-
-<div class="doc_subsubsection"><a name="filenames">File Names</a></div>
-<div class="doc_text">
-  <p>In the directories searched, each configuration file is given a specific
-  name to foster faster lookup (so llvmc doesn't have to do directory searches).
-  The name of a given language specific configuration file is simply the same 
-  as the suffix used to identify files containing source in that language. 
-  For example, a configuration file for C++ source might be named 
-  <tt>cpp</tt>, <tt>C</tt>, or <tt>cxx</tt>. For languages that support multiple
-  file suffixes, multiple (probably identical) files (or symbolic links) will
-  need to be provided.</p>
-</div>
-
-<div class="doc_subsubsection"><a name="whatgetsread">What Gets Read</a></div>
-<div class="doc_text">
-  <p>Which configuration files are read depends on the command line options and 
-  the suffixes of the file names provided on <tt>llvmc</tt>'s command line. Note
-  that the <tt>-x LANGUAGE</tt> option alters the language that <tt>llvmc</tt>
-  uses for the subsequent files on the command line.  Only the configuration 
-  files actually needed to complete <tt>llvmc</tt>'s task are read. Other 
-  language specific files will be ignored.</p>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="syntax"></a>Syntax</div>
-<div class="doc_text">
-  <p>The syntax of the configuration files is very simple and somewhat
-  compatible with Java's property files. Here are the syntax rules:</p>
-  <ul>
-    <li>The file encoding is ASCII.</li>
-    <li>The file is line oriented. There should be one configuration definition 
-    per line. Lines are terminated by the newline (0x0A) and/or carriage return
-    characters (0x0D)</li>
-    <li>A backslash (<tt>\</tt>) before a newline causes the newline to be
-    ignored. This is useful for line continuation of long definitions. A
-    backslash anywhere else is recognized as a backslash.</li>
-    <li>A configuration item consists of a name, an <tt>=</tt> and a value.</li>
-    <li>A name consists of a sequence of identifiers separated by period.</li>
-    <li>An identifier consists of specific keywords made up of only lower case
-    and upper case letters (e.g. <tt>lang.name</tt>).</li>
-    <li>Values come in four flavors: booleans, integers, commands and 
-    strings.</li>
-    <li>Valid "false" boolean values are <tt>false False FALSE no No NO
-      off Off</tt> and <tt>OFF</tt>.</li>
-    <li>Valid "true" boolean values are <tt>true True TRUE yes Yes YES
-      on On</tt> and <tt>ON</tt>.</li>
-    <li>Integers are simply sequences of digits.</li>
-    <li>Commands start with a program name and are followed by a sequence of
-    words that are passed to that program as command line arguments. Program
-    arguments that begin and end with the <tt>%</tt> sign will have their value
-    substituted. Program names beginning with <tt>/</tt> are considered to be
-    absolute. Otherwise the <tt>PATH</tt> will be applied to find the program to
-    execute.</li>
-    <li>Strings are composed of multiple sequences of characters from the
-    character class <tt>[-A-Za-z0-9_:%+/\\|,]</tt> separated by white
-    space.</li>
-    <li>White space on a line is folded. Multiple blanks or tabs will be
-    reduced to a single blank.</li>
-    <li>White space before the configuration item's name is ignored.</li>
-    <li>White space on either side of the <tt>=</tt> is ignored.</li>
-    <li>White space in a string value is used to separate the individual
-    components of the string value but otherwise ignored.</li>
-    <li>Comments are introduced by the <tt>#</tt> character. Everything after a
-    <tt>#</tt> and before the end of line is ignored.</li>
-  </ul>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="items">Configuration Items</a></div>
-<div class="doc_text">
-  <p>The table below provides definitions of the allowed configuration items
-  that may appear in a configuration file. Every item has a default value and
-  does not need to appear in the configuration file. Missing items will have the 
-  default value. Each identifier may appear as all lower case, first letter
-  capitalized or all upper case.</p>
-  <table>
-    <tbody>
-      <tr>
-        <th>Name</th>
-        <th>Value Type</th>
-        <th>Description</th>
-        <th>Default</th>
-      </tr>
-      <tr><td colspan="4"><h4>LLVMC ITEMS</h4></td></tr>
-      <tr>
-        <td><b>version</b></td>
-        <td>string</td>
-        <td class="td_left">Provides the version string for the contents of this
-          configuration file. What is accepted as a legal configuration file
-          will change over time and this item tells <tt>llvmc</tt> which version
-          should be expected.</td>
-        <td><i>b</i></td>
-      </tr>
-      <tr><td colspan="4"><h4>LANG ITEMS</h4></td></tr>
-      <tr>
-        <td><b>lang.name</b></td>
-        <td>string</td>
-        <td class="td_left">Provides the common name for a language definition. 
-          For example "C++", "Pascal", "FORTRAN", etc.</td>
-        <td><i>blank</i></td>
-      </tr>
-      <tr>
-        <td><b>lang.opt1</b></td>
-        <td>string</td>
-        <td class="td_left">Specifies the parameters to give the optimizer when
-          <tt>-O1</tt> is specified on the <tt>llvmc</tt> command line.</td>
-        <td><tt>-simplifycfg -instcombine -mem2reg</tt></td>
-      </tr>
-      <tr>
-        <td><b>lang.opt2</b></td>
-        <td>string</td>
-        <td class="td_left">Specifies the parameters to give the optimizer when
-          <tt>-O2</tt> is specified on the <tt>llvmc</tt> command line.</td>
-        <td><i>TBD</i></td>
-      </tr>
-      <tr>
-        <td><b>lang.opt3</b></td>
-        <td>string</td>
-        <td class="td_left">Specifies the parameters to give the optimizer when
-          <tt>-O3</tt> is specified on the <tt>llvmc</tt> command line.</td>
-        <td><i>TBD</i></td>
-      </tr>
-      <tr>
-        <td><b>lang.opt4</b></td>
-        <td>string</td>
-        <td class="td_left">Specifies the parameters to give the optimizer when
-          <tt>-O4</tt> is specified on the <tt>llvmc</tt> command line.</td>
-        <td><i>TBD</i></td>
-      </tr>
-      <tr>
-        <td><b>lang.opt5</b></td>
-        <td>string</td>
-        <td class="td_left">Specifies the parameters to give the optimizer when 
-          <tt>-O5</tt> is specified on the <tt>llvmc</tt> command line.</td>
-        <td><i>TBD</i></td>
-      </tr>
-      <tr><td colspan="4"><h4>PREPROCESSOR ITEMS</h4></td></tr>
-      <tr>
-        <td><b>preprocessor.command</b></td>
-        <td>command</td>
-        <td class="td_left">This provides the command prototype that will be used
-          to run the preprocessor.  This is generally only used with the 
-          <tt>-E</tt> option.</td>
-        <td><blank></td>
-      </tr>
-      <tr>
-        <td><b>preprocessor.required</b></td>
-        <td>boolean</td>
-        <td class="td_left">This item specifies whether the pre-processing phase
-          is required by the language. If the value is true, then the
-          <tt>preprocessor.command</tt> value must not be blank. With this option,
-          <tt>llvmc</tt> will always run the preprocessor as it assumes that the
-          translation and optimization phases don't know how to pre-process their
-          input.</td>
-        <td>false</td>
-      </tr>
-      <tr><td colspan="4"><h4>TRANSLATOR ITEMS</h4></td></tr>
-      <tr>
-        <td><b>translator.command</b></td>
-        <td>command</td>
-        <td class="td_left">This provides the command prototype that will be used 
-          to run the translator. Valid substitutions are <tt>%in%</tt> for the 
-          input file and <tt>%out%</tt> for the output file.</td>
-        <td><blank></td>
-      </tr>
-      <tr>
-        <td><b>translator.output</b></td>
-        <td><tt>bitcode</tt> or <tt>assembly</tt></td>
-        <td class="td_left">This item specifies the kind of output the language's 
-          translator generates.</td>
-        <td><tt>bitcode</tt></td>
-      </tr>
-      <tr>
-        <td><b>translator.preprocesses</b></td>
-        <td>boolean</td>
-        <td class="td_left">Indicates that the translator also preprocesses. If
-          this is true, then <tt>llvmc</tt> will skip the pre-processing phase
-          whenever the final phase is not pre-processing.</td>
-        <td><tt>false</tt></td>
-      </tr>
-      <tr><td colspan="4"><h4>OPTIMIZER ITEMS</h4></td></tr>
-      <tr>
-        <td><b>optimizer.command</b></td>
-        <td>command</td>
-        <td class="td_left">This provides the command prototype that will be used 
-          to run the optimizer. Valid substitutions are <tt>%in%</tt> for the 
-          input file and <tt>%out%</tt> for the output file.</td>
-        <td><blank></td>
-      </tr>
-      <tr>
-        <td><b>optimizer.output</b></td>
-        <td><tt>bitcode</tt> or <tt>assembly</tt></td>
-        <td class="td_left">This item specifies the kind of output the language's 
-          optimizer generates. Valid values are "assembly" and "bitcode"</td>
-        <td><tt>bitcode</tt></td>
-      </tr>
-      <tr>
-        <td><b>optimizer.preprocesses</b></td>
-        <td>boolean</td>
-        <td class="td_left">Indicates that the optimizer also preprocesses. If
-          this is true, then <tt>llvmc</tt> will skip the pre-processing phase
-          whenever the final phase is optimization or later.</td>
-        <td><tt>false</tt></td>
-      </tr>
-      <tr>
-        <td><b>optimizer.translates</b></td>
-        <td>boolean</td>
-        <td class="td_left">Indicates that the optimizer also translates. If
-          this is true, then <tt>llvmc</tt> will skip the translation phase
-          whenever the final phase is optimization or later.</td>
-        <td><tt>false</tt></td>
-      </tr>
-      <tr><td colspan="4"><h4>ASSEMBLER ITEMS</h4></td></tr>
-      <tr>
-        <td><b>assembler.command</b></td>
-        <td>command</td>
-        <td class="td_left">This provides the command prototype that will be used 
-          to run the assembler. Valid substitutions are <tt>%in%</tt> for the 
-          input file and <tt>%out%</tt> for the output file.</td>
-        <td><blank></td>
-      </tr>
-    </tbody>
-  </table>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="substitutions">Substitutions</a></div>
-<div class="doc_text">
-  <p>On any configuration item that ends in <tt>command</tt>, you must
-  specify substitution tokens.  Substitution tokens begin and end with a percent
-  sign (<tt>%</tt>) and are replaced by the corresponding text. Any substitution
-  token may be given on any <tt>command</tt> line but some are more useful than
-  others. In particular each command <em>should</em> have both an <tt>%in%</tt>
-  and an <tt>%out%</tt> substitution. The table below provides definitions of
-  each of the allowed substitution tokens.</p>
-  <table>
-    <tbody>
-      <tr>
-        <th>Substitution Token</th>
-        <th>Replacement Description</th>
-      </tr>
-      <tr>
-        <td><tt>%args%</tt></td>
-        <td class="td_left">Replaced with all the tool-specific arguments given
-          to <tt>llvmc</tt> via the <tt>-T</tt> set of options. This just allows
-          you to place these arguments in the correct place on the command line.
-          If the <tt>%args%</tt> option does not appear on your command line, 
-          then you are explicitly disallowing the <tt>-T</tt> option for your 
-          tool.
-        </td>
-      <tr>
-        <td><tt>%force%</tt></td>
-        <td class="td_left">Replaced with the <tt>-f</tt> option if it was
-          specified on the <tt>llvmc</tt> command line. This is intended to tell
-          the compiler tool to force the overwrite of output files. 
-        </td>
-      </tr>
-      <tr>
-        <td><tt>%in%</tt></td>
-        <td class="td_left">Replaced with the full path of the input file. You
-          needn't worry about the cascading of file names. <tt>llvmc</tt> will
-          create temporary files and ensure that the output of one phase is the
-          input to the next phase.</td>
-      </tr>
-      <tr>
-        <td><tt>%opt%</tt></td>
-        <td class="td_left">Replaced with the optimization options for the
-          tool. If the tool understands the <tt>-O</tt> options then that will
-          be passed. Otherwise, the <tt>lang.optN</tt> series of configuration
-          items will specify which arguments are to be given.</td>
-      </tr>
-      <tr>
-        <td><tt>%out%</tt></td>
-        <td class="td_left">Replaced with the full path of the output file.
-          Note that this is not necessarily the output file specified with the
-          <tt>-o</tt> option on <tt>llvmc</tt>'s command line. It might be a
-          temporary file that will be passed to a subsequent phase's input.
-        </td>
-      </tr>
-      <tr>
-        <td><tt>%stats%</tt></td>
-        <td class="td_left">If your command accepts the <tt>-stats</tt> option,
-          use this substitution token. If the user requested <tt>-stats</tt> 
-          from the <tt>llvmc</tt> command line then this token will be replaced
-          with <tt>-stats</tt>, otherwise it will be ignored.
-        </td>
-      </tr>
-      <tr>
-        <td><tt>%target%</tt></td>
-        <td class="td_left">Replaced with the name of the target "machine" for 
-          which code should be generated. The value used here is taken from the
-          <tt>llvmc</tt> option <tt>-march</tt>.
-        </td>
-      </tr>
-      <tr>
-        <td><tt>%time%</tt></td>
-        <td class="td_left">If your command accepts the <tt>-time-passes</tt> 
-          option, use this substitution token. If the user requested 
-          <tt>-time-passes</tt> from the <tt>llvmc</tt> command line then this 
-          token will be replaced with <tt>-time-passes</tt>, otherwise it will 
-          be ignored.
-        </td>
-      </tr>
-    </tbody>
-  </table>
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="sample">Sample Config File</a></div>
-<div class="doc_text">
-  <p>Since an example is always instructive, here's how the Stacker language
-  configuration file looks.</p>
-  <pre><tt>
-# Stacker Configuration File For llvmc
-
-##########################################################
-# Language definitions
-##########################################################
-  lang.name=Stacker 
-  lang.opt1=-simplifycfg -instcombine -mem2reg
-  lang.opt2=-simplifycfg -instcombine -mem2reg -load-vn \
-    -gcse -dse -scalarrepl -sccp 
-  lang.opt3=-simplifycfg -instcombine -mem2reg -load-vn \
-    -gcse -dse -scalarrepl -sccp -branch-combine -adce \
-    -globaldce -inline -licm 
-  lang.opt4=-simplifycfg -instcombine -mem2reg -load-vn \
-    -gcse -dse -scalarrepl -sccp -ipconstprop \
-    -branch-combine -adce -globaldce -inline -licm 
-  lang.opt5=-simplifycfg -instcombine -mem2reg --load-vn \
-    -gcse -dse scalarrepl -sccp -ipconstprop \
-    -branch-combine -adce -globaldce -inline -licm \
-    -block-placement
-
-##########################################################
-# Pre-processor definitions
-##########################################################
-
-  # Stacker doesn't have a preprocessor but the following
-  # allows the -E option to be supported
-  preprocessor.command=cp %in% %out%
-  preprocessor.required=false
-
-##########################################################
-# Translator definitions
-##########################################################
-
-  # To compile stacker source, we just run the stacker
-  # compiler with a default stack size of 2048 entries.
-  translator.command=stkrc -s 2048 %in% -o %out% %time% \
-    %stats% %force% %args%
-
-  # stkrc doesn't preprocess but we set this to true so
-  # that we don't run the cp command by default.
-  translator.preprocesses=true
-
-  # The translator is required to run.
-  translator.required=true
-
-  # stkrc doesn't handle the -On options
-  translator.output=bitcode
-
-##########################################################
-# Optimizer definitions
-##########################################################
-  
-  # For optimization, we use the LLVM "opt" program
-  optimizer.command=opt %in% -o %out% %opt% %time% %stats% \
-    %force% %args%
-
-  optimizer.required = true
-
-  # opt doesn't translate
-  optimizer.translates = no
-
-  # opt doesn't preprocess
-  optimizer.preprocesses=no
-
-  # opt produces bitcode
-  optimizer.output = bc
-
-##########################################################
-# Assembler definitions
-##########################################################
-  assembler.command=llc %in% -o %out% %target% %time% %stats%
-</tt></pre>
-</div> 
-
-<!-- *********************************************************************** -->
-<div class="doc_section"><a name="glossary">Glossary</a></div>
-<!-- *********************************************************************** -->
-<div class="doc_text">
-  <p>This document uses precise terms in reference to the various artifacts and
-  concepts related to compilation. The terms used throughout this document are
-  defined below.</p>
-  <dl>
-    <dt><a name="def_assembly"><b>assembly</b></a></dt> 
-    <dd>A compilation <a href="#def_phase">phase</a> in which LLVM bitcode or 
-    LLVM assembly code is assembled to a native code format (either target 
-    specific aseembly language or the platform's native object file format).
-    </dd>
-
-    <dt><a name="def_compiler"><b>compiler</b></a></dt>
-    <dd>Refers to any program that can be invoked by <tt>llvmc</tt> to accomplish 
-    the work of one or more compilation <a href="#def_phase">phases</a>.</dd>
-
-    <dt><a name="def_driver"><b>driver</b></a></dt>
-    <dd>Refers to <tt>llvmc</tt> itself.</dd>
-
-    <dt><a name="def_linking"><b>linking</b></a></dt>
-    <dd>A compilation <a href="#def_phase">phase</a> in which LLVM bitcode files 
-    and (optionally) native system libraries are combined to form a complete 
-    executable program.</dd>
-
-    <dt><a name="def_optimization"><b>optimization</b></a></dt>
-    <dd>A compilation <a href="#def_phase">phase</a> in which LLVM bitcode is 
-    optimized.</dd>
-
-    <dt><a name="def_phase"><b>phase</b></a></dt>
-    <dd>Refers to any one of the five compilation phases that that 
-    <tt>llvmc</tt> supports. The five phases are:
-    <a href="#def_preprocessing">preprocessing</a>, 
-    <a href="#def_translation">translation</a>,
-    <a href="#def_optimization">optimization</a>,
-    <a href="#def_assembly">assembly</a>,
-    <a href="#def_linking">linking</a>.</dd>
-
-    <dt><a name="def_sourcelanguage"><b>source language</b></a></dt>
-    <dd>Any common programming language (e.g. C, C++, Java, Stacker, ML,
-    FORTRAN).  These languages are distinguished from any of the lower level
-    languages (such as LLVM or native assembly), by the fact that a 
-    <a href="#def_translation">translation</a> <a href="#def_phase">phase</a> 
-    is required before LLVM can be applied.</dd> 
+<div class="document" id="customizing-llvmc-reference-manual">
 
-    <dt><a name="def_tool"><b>tool</b></a></dt>
-    <dd>Refers to any program in the LLVM tool set.</dd>
+<div class="doc_title">Customizing LLVMC: Reference Manual</div>
 
-    <dt><a name="def_translation"><b>translation</b></a></dt>
-    <dd>A compilation <a href="#def_phase">phase</a> in which 
-    <a href="#def_sourcelanguage">source language</a> code is translated into 
-    either LLVM assembly language or LLVM bitcode.</dd>
-  </dl>
-</div>
-<!-- *********************************************************************** -->
-<hr>
-<address> <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
- src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a><a
- href="http://validator.w3.org/check/referer"><img
- src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a><a
- href="mailto:rspencer at x10sys.com">Reid Spencer</a><br>
-<a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
-Last modified: $Date$
+<div class="doc_warning">
+  <p>Note: This document is a work-in-progress.  Additions and clarifications
+  are welcome.</p>
+</div>
+
+<p>LLVMC is a generic compiler driver, designed to be customizable and
+extensible. It plays the same role for LLVM as the <tt class="docutils literal"><span class="pre">gcc</span></tt> 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. This makes it possible to adapt LLVMC for other
+purposes - for example, as a build tool for game resources.</p>
+<p>Because LLVMC employs TableGen <a class="footnote-reference" href="#id2" id="id1" name="id1">[1]</a> as its configuration language, you
+need to be familiar with it to customize LLVMC.</p>
+<div class="contents topic">
+<ul class="simple">
+<li><a class="reference" href="#compiling-with-llvmc" id="id3" name="id3">Compiling with LLVMC</a></li>
+<li><a class="reference" href="#predefined-options" id="id4" name="id4">Predefined options</a></li>
+<li><a class="reference" href="#customizing-llvmc-the-compilation-graph" id="id5" name="id5">Customizing LLVMC: the compilation graph</a></li>
+<li><a class="reference" href="#writing-a-tool-description" id="id6" name="id6">Writing a tool description</a></li>
+<li><a class="reference" href="#option-list-specifying-all-options-in-a-single-place" id="id7" name="id7">Option list - specifying all options in a single place</a></li>
+<li><a class="reference" href="#using-hooks-and-environment-variables-in-the-cmd-line-property" id="id8" name="id8">Using hooks and environment variables in the <tt class="docutils literal"><span class="pre">cmd_line</span></tt> property</a></li>
+<li><a class="reference" href="#conditional-evaluation-the-case-expression" id="id9" name="id9">Conditional evaluation: the <tt class="docutils literal"><span class="pre">case</span></tt> expression</a></li>
+<li><a class="reference" href="#language-map" id="id10" name="id10">Language map</a></li>
+<li><a class="reference" href="#references" id="id11" name="id11">References</a></li>
+</ul>
+</div>
+
+<div class="doc_author">Written by Mikhail Glushenkov</div>
+
+<div class="doc_text">
+<div class="doc_section"><a class="toc-backref" href="#id3" id="compiling-with-llvmc" name="compiling-with-llvmc">Compiling with LLVMC</a></div>
+<p>LLVMC tries hard to be as compatible with <tt class="docutils literal"><span class="pre">gcc</span></tt> as possible,
+although there are some small differences. Most of the time, however,
+you shouldn't be able to notice them:</p>
+<pre class="literal-block">
+$ # This works as expected:
+$ llvmc2 -O3 -Wall hello.cpp
+$ ./a.out
+hello
+</pre>
+<p>One nice feature of LLVMC is that one doesn't have to distinguish
+between different compilers for different languages (think <tt class="docutils literal"><span class="pre">g++</span></tt> and
+<tt class="docutils literal"><span class="pre">gcc</span></tt>) - 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 <tt class="docutils literal"><span class="pre">-x</span></tt> option, just like you would do it with <tt class="docutils literal"><span class="pre">gcc</span></tt>:</p>
+<pre class="literal-block">
+$ llvmc2 -x c hello.cpp
+$ # hello.cpp is really a C file
+$ ./a.out
+hello
+</pre>
+<p>On the other hand, when using LLVMC as a linker to combine several C++
+object files you should provide the <tt class="docutils literal"><span class="pre">--linker</span></tt> option since it's
+impossible for LLVMC to choose the right linker in that case:</p>
+<pre class="literal-block">
+$ llvmc2 -c hello.cpp
+$ llvmc2 hello.o
+[A lot of link-time errors skipped]
+$ llvmc2 --linker=c++ hello.o
+$ ./a.out
+hello
+</pre>
+</div>
+<div class="doc_text">
+<div class="doc_section"><a class="toc-backref" href="#id4" id="predefined-options" name="predefined-options">Predefined options</a></div>
+<p>LLVMC has some built-in options that can't be overridden in the
+configuration files:</p>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">-o</span> <span class="pre">FILE</span></tt> - Output file name.</li>
+<li><tt class="docutils literal"><span class="pre">-x</span> <span class="pre">LANGUAGE</span></tt> - Specify the language of the following input files
+until the next -x option.</li>
+<li><tt class="docutils literal"><span class="pre">-v</span></tt> - Enable verbose mode, i.e. print out all executed commands.</li>
+<li><tt class="docutils literal"><span class="pre">--view-graph</span></tt> - Show a graphical representation of the compilation
+graph. Requires that you have <tt class="docutils literal"><span class="pre">dot</span></tt> and <tt class="docutils literal"><span class="pre">gv</span></tt> commands
+installed. Hidden option, useful for debugging.</li>
+<li><tt class="docutils literal"><span class="pre">--write-graph</span></tt> - Write a <tt class="docutils literal"><span class="pre">compilation-graph.dot</span></tt> file in the
+current directory with the compilation graph description in the
+Graphviz format. Hidden option, useful for debugging.</li>
+<li><tt class="docutils literal"><span class="pre">--save-temps</span></tt> - Write temporary files to the current directory
+and do not delete them on exit. Hidden option, useful for debugging.</li>
+<li><tt class="docutils literal"><span class="pre">--help</span></tt>, <tt class="docutils literal"><span class="pre">--help-hidden</span></tt>, <tt class="docutils literal"><span class="pre">--version</span></tt> - These options have
+their standard meaning.</li>
+</ul>
+</div>
+<div class="doc_text">
+<div class="doc_section"><a class="toc-backref" href="#id5" id="customizing-llvmc-the-compilation-graph" name="customizing-llvmc-the-compilation-graph">Customizing LLVMC: the compilation graph</a></div>
+<p>At the time of writing LLVMC does not support on-the-fly reloading of
+configuration, so to customize LLVMC you'll have to recompile the
+source code (which lives under <tt class="docutils literal"><span class="pre">$LLVM_DIR/tools/llvmc2</span></tt>). The
+default configuration files are <tt class="docutils literal"><span class="pre">Common.td</span></tt> (contains common
+definitions, don't forget to <tt class="docutils literal"><span class="pre">include</span></tt> it in your configuration
+files), <tt class="docutils literal"><span class="pre">Tools.td</span></tt> (tool descriptions) and <tt class="docutils literal"><span class="pre">Graph.td</span></tt> (compilation
+graph definition).</p>
+<p>To compile LLVMC with your own configuration file (say,``MyGraph.td``),
+run <tt class="docutils literal"><span class="pre">make</span></tt> like this:</p>
+<pre class="literal-block">
+$ cd $LLVM_DIR/tools/llvmc2
+$ make GRAPH=MyGraph.td TOOLNAME=my_llvmc
+</pre>
+<p>This will build an executable named <tt class="docutils literal"><span class="pre">my_llvmc</span></tt>. There are also
+several sample configuration files in the <tt class="docutils literal"><span class="pre">llvmc2/examples</span></tt>
+subdirectory that should help to get you started.</p>
+<p>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.</p>
+<p>The definition of the compilation graph (see file <tt class="docutils literal"><span class="pre">Graph.td</span></tt>) is
+just a list of edges:</p>
+<pre class="literal-block">
+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, [(switch_on "opt")]>,
+    OptionalEdge<llvm_gcc_cpp, opt, [(switch_on "opt")]>,
+    ...
+
+    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))>,
+    ...
+
+    ]>;
+</pre>
+<p>As you can see, the edges can be either default or optional, where
+optional edges are differentiated by sporting a <tt class="docutils literal"><span class="pre">case</span></tt> expression
+used to calculate the edge's weight.</p>
+<p>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 <tt class="docutils literal"><span class="pre">case</span></tt> expression. It is also possible to provide an
+integer parameter to <tt class="docutils literal"><span class="pre">inc_weight</span></tt> and <tt class="docutils literal"><span class="pre">dec_weight</span></tt> - in this case,
+the weight is increased (or decreased) by the provided value instead
+of the default 2.</p>
+<p>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 <em>per language</em>).</p>
+<p>To get a visual representation of the compilation graph (useful for
+debugging), run <tt class="docutils literal"><span class="pre">llvmc2</span> <span class="pre">--view-graph</span></tt>. You will need <tt class="docutils literal"><span class="pre">dot</span></tt> and
+<tt class="docutils literal"><span class="pre">gsview</span></tt> installed for this to work properly.</p>
+</div>
+<div class="doc_text">
+<div class="doc_section"><a class="toc-backref" href="#id6" id="writing-a-tool-description" name="writing-a-tool-description">Writing a tool description</a></div>
+<p>As was said earlier, nodes in the compilation graph represent tools,
+which are described separately. A tool definition looks like this
+(taken from the <tt class="docutils literal"><span class="pre">Tools.td</span></tt> file):</p>
+<pre class="literal-block">
+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)
+    ]>;
+</pre>
+<p>This defines a new tool called <tt class="docutils literal"><span class="pre">llvm_gcc_cpp</span></tt>, which is an alias for
+<tt class="docutils literal"><span class="pre">llvm-g++</span></tt>. As you can see, a tool definition is just a list of
+properties; most of them should be self-explanatory. The <tt class="docutils literal"><span class="pre">sink</span></tt>
+property means that this tool should be passed all command-line
+options that lack explicit descriptions.</p>
+<p>The complete list of the currently implemented tool properties follows:</p>
+<ul class="simple">
+<li>Possible tool properties:<ul>
+<li><tt class="docutils literal"><span class="pre">in_language</span></tt> - input language name.</li>
+<li><tt class="docutils literal"><span class="pre">out_language</span></tt> - output language name.</li>
+<li><tt class="docutils literal"><span class="pre">output_suffix</span></tt> - output file suffix.</li>
+<li><tt class="docutils literal"><span class="pre">cmd_line</span></tt> - the actual command used to run the tool. You can
+use <tt class="docutils literal"><span class="pre">$INFILE</span></tt> and <tt class="docutils literal"><span class="pre">$OUTFILE</span></tt> variables, output redirection
+with <tt class="docutils literal"><span class="pre">></span></tt>, hook invocations (<tt class="docutils literal"><span class="pre">$CALL</span></tt>), environment variables
+(via <tt class="docutils literal"><span class="pre">$ENV</span></tt>) and the <tt class="docutils literal"><span class="pre">case</span></tt> construct (more on this below).</li>
+<li><tt class="docutils literal"><span class="pre">join</span></tt> - 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.</li>
+<li><tt class="docutils literal"><span class="pre">sink</span></tt> - all command-line options that are not handled by other
+tools are passed to this tool.</li>
+</ul>
+</li>
+</ul>
+<p>The next tool definition is slightly more complex:</p>
+<pre class="literal-block">
+def llvm_gcc_linker : Tool<[
+    (in_language "object-code"),
+    (out_language "executable"),
+    (output_suffix "out"),
+    (cmd_line "llvm-gcc $INFILE -o $OUTFILE"),
+    (join),
+    (prefix_list_option "L", (forward),
+                        (help "add a directory to link path")),
+    (prefix_list_option "l", (forward),
+                        (help "search a library when linking")),
+    (prefix_list_option "Wl", (unpack_values),
+                        (help "pass options to linker"))
+    ]>;
+</pre>
+<p>This tool has a "join" property, which means that it behaves like a
+linker. This tool also defines several command-line options: <tt class="docutils literal"><span class="pre">-l</span></tt>,
+<tt class="docutils literal"><span class="pre">-L</span></tt> and <tt class="docutils literal"><span class="pre">-Wl</span></tt> which have their usual meaning. An option has two
+attributes: a name and a (possibly empty) list of properties. All
+currently implemented option types and properties are described below:</p>
+<ul>
+<li><p class="first">Possible option types:</p>
+<blockquote>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">switch_option</span></tt> - a simple boolean switch, for example <tt class="docutils literal"><span class="pre">-time</span></tt>.</li>
+<li><tt class="docutils literal"><span class="pre">parameter_option</span></tt> - option that takes an argument, for example
+<tt class="docutils literal"><span class="pre">-std=c99</span></tt>;</li>
+<li><tt class="docutils literal"><span class="pre">parameter_list_option</span></tt> - same as the above, but more than one
+occurence of the option is allowed.</li>
+<li><tt class="docutils literal"><span class="pre">prefix_option</span></tt> - same as the parameter_option, but the option name
+and parameter value are not separated.</li>
+<li><tt class="docutils literal"><span class="pre">prefix_list_option</span></tt> - same as the above, but more than one
+occurence of the option is allowed; example: <tt class="docutils literal"><span class="pre">-lm</span> <span class="pre">-lpthread</span></tt>.</li>
+<li><tt class="docutils literal"><span class="pre">alias_option</span></tt> - 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: <tt class="docutils literal"><span class="pre">(alias_option</span> <span class="pre">"preprocess",</span> <span class="pre">"E")</span></tt></li>
+</ul>
+</blockquote>
+</li>
+<li><p class="first">Possible option properties:</p>
+<blockquote>
+<ul class="simple">
+<li><tt class="docutils literal"><span class="pre">append_cmd</span></tt> - append a string to the tool invocation command.</li>
+<li><tt class="docutils literal"><span class="pre">forward</span></tt> - forward this option unchanged.</li>
+<li><tt class="docutils literal"><span class="pre">output_suffix</span></tt> - modify the output suffix of this
+tool. Example : <tt class="docutils literal"><span class="pre">(switch</span> <span class="pre">"E",</span> <span class="pre">(output_suffix</span> <span class="pre">"i")</span></tt>.</li>
+<li><tt class="docutils literal"><span class="pre">stop_compilation</span></tt> - stop compilation after this phase.</li>
+<li><tt class="docutils literal"><span class="pre">unpack_values</span></tt> - used for for splitting and forwarding
+comma-separated lists of options, e.g. <tt class="docutils literal"><span class="pre">-Wa,-foo=bar,-baz</span></tt> is
+converted to <tt class="docutils literal"><span class="pre">-foo=bar</span> <span class="pre">-baz</span></tt> and appended to the tool invocation
+command.</li>
+<li><tt class="docutils literal"><span class="pre">help</span></tt> - help string associated with this option. Used for
+<tt class="docutils literal"><span class="pre">--help</span></tt> output.</li>
+<li><tt class="docutils literal"><span class="pre">required</span></tt> - this option is obligatory.</li>
+</ul>
+</blockquote>
+</li>
+</ul>
+</div>
+<div class="doc_text">
+<div class="doc_section"><a class="toc-backref" href="#id7" id="option-list-specifying-all-options-in-a-single-place" name="option-list-specifying-all-options-in-a-single-place">Option list - specifying all options in a single place</a></div>
+<p>It can be handy to have all information about options gathered in a
+single place to provide an overview. This can be achieved by using a
+so-called <tt class="docutils literal"><span class="pre">OptionList</span></tt>:</p>
+<pre class="literal-block">
+def Options : OptionList<[
+(switch_option "E", (help "Help string")),
+(alias_option "quiet", "q")
+...
+]>;
+</pre>
+<p><tt class="docutils literal"><span class="pre">OptionList</span></tt> is also a good place to specify option aliases.</p>
+<p>Tool-specific option properties like <tt class="docutils literal"><span class="pre">append_cmd</span></tt> have (obviously)
+no meaning in the context of <tt class="docutils literal"><span class="pre">OptionList</span></tt>, so the only properties
+allowed there are <tt class="docutils literal"><span class="pre">help</span></tt> and <tt class="docutils literal"><span class="pre">required</span></tt>.</p>
+<p>Option lists are used at the file scope. See file
+<tt class="docutils literal"><span class="pre">examples/Clang.td</span></tt> for an example of <tt class="docutils literal"><span class="pre">OptionList</span></tt> usage.</p>
+</div>
+<div class="doc_text">
+<div class="doc_section"><a class="toc-backref" href="#id8" id="using-hooks-and-environment-variables-in-the-cmd-line-property" name="using-hooks-and-environment-variables-in-the-cmd-line-property">Using hooks and environment variables in the <tt class="docutils literal"><span class="pre">cmd_line</span></tt> property</a></div>
+<p>Normally, LLVMC executes programs from the system <tt class="docutils literal"><span class="pre">PATH</span></tt>. Sometimes,
+this is not sufficient: for example, we may want to specify tool names
+in the configuration file. This can be achieved via the mechanism of
+hooks - to compile LLVMC with your hooks, just drop a .cpp file into
+<tt class="docutils literal"><span class="pre">tools/llvmc2</span></tt> directory. Hooks should live in the <tt class="docutils literal"><span class="pre">hooks</span></tt>
+namespace and have the signature <tt class="docutils literal"><span class="pre">std::string</span> <span class="pre">hooks::MyHookName</span>
+<span class="pre">(void)</span></tt>. They can be used from the <tt class="docutils literal"><span class="pre">cmd_line</span></tt> tool property:</p>
+<pre class="literal-block">
+(cmd_line "$CALL(MyHook)/path/to/file -o $CALL(AnotherHook)")
+</pre>
+<p>It is also possible to use environment variables in the same manner:</p>
+<pre class="literal-block">
+(cmd_line "$ENV(VAR1)/path/to/file -o $ENV(VAR2)")
+</pre>
+<p>To change the command line string based on user-provided options use
+the <tt class="docutils literal"><span class="pre">case</span></tt> expression (documented below):</p>
+<pre class="literal-block">
+(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"))
+</pre>
+</div>
+<div class="doc_text">
+<div class="doc_section"><a class="toc-backref" href="#id9" id="conditional-evaluation-the-case-expression" name="conditional-evaluation-the-case-expression">Conditional evaluation: the <tt class="docutils literal"><span class="pre">case</span></tt> expression</a></div>
+<p>The 'case' construct can be used to calculate weights of the optional
+edges and to choose between several alternative command line strings
+in the <tt class="docutils literal"><span class="pre">cmd_line</span></tt> tool property. It is designed after the
+similarly-named construct in functional languages and takes the form
+<tt class="docutils literal"><span class="pre">(case</span> <span class="pre">(test_1),</span> <span class="pre">statement_1,</span> <span class="pre">(test_2),</span> <span class="pre">statement_2,</span> <span class="pre">...</span> <span class="pre">(test_N),</span>
+<span class="pre">statement_N)</span></tt>. The statements are evaluated only if the corresponding
+tests evaluate to true.</p>
+<p>Examples:</p>
+<pre class="literal-block">
+// 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))
+
+// Evaluates to "cmdline1" if option "-A" is provided on the
+// command line, otherwise to "cmdline2"
+(case
+    (switch_on "A"), "cmdline1",
+    (switch_on "B"), "cmdline2",
+    (default), "cmdline3")
+</pre>
+<p>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 <tt class="docutils literal"><span class="pre">"B"</span></tt> switch is never checked when switch <tt class="docutils literal"><span class="pre">"A"</span></tt> is
+enabled, and the whole expression always evaluates to <tt class="docutils literal"><span class="pre">"cmdline1"</span></tt> in
+that case.</p>
+<p>Case expressions can also be nested, i.e. the following is legal:</p>
+<pre class="literal-block">
+(case (switch_on "E"), (case (switch_on "o"), ..., (default), ...)
+      (default), ...)
+</pre>
+<p>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.</p>
+<ul class="simple">
+<li>Possible tests are:<ul>
+<li><tt class="docutils literal"><span class="pre">switch_on</span></tt> - Returns true if a given command-line option is
+provided by the user. Example: <tt class="docutils literal"><span class="pre">(switch_on</span> <span class="pre">"opt")</span></tt>. Note that
+you have to define all possible command-line options separately in
+the tool descriptions. See the next doc_text for the discussion of
+different kinds of command-line options.</li>
+<li><tt class="docutils literal"><span class="pre">parameter_equals</span></tt> - Returns true if a command-line parameter equals
+a given value. Example: <tt class="docutils literal"><span class="pre">(parameter_equals</span> <span class="pre">"W",</span> <span class="pre">"all")</span></tt>.</li>
+<li><tt class="docutils literal"><span class="pre">element_in_list</span></tt> - Returns true if a command-line parameter list
+includes a given value. Example: <tt class="docutils literal"><span class="pre">(parameter_in_list</span> <span class="pre">"l",</span> <span class="pre">"pthread")</span></tt>.</li>
+<li><tt class="docutils literal"><span class="pre">input_languages_contain</span></tt> - Returns true if a given language
+belongs to the current input language set. Example:
+<tt class="docutils literal"><span class="pre">`(input_languages_contain</span> <span class="pre">"c++")</span></tt>.</li>
+<li><tt class="docutils literal"><span class="pre">in_language</span></tt> - Evaluates to true if the language of the input
+file equals to the argument. Valid only when using <tt class="docutils literal"><span class="pre">case</span></tt>
+expression in a <tt class="docutils literal"><span class="pre">cmd_line</span></tt> tool property. Example:
+<tt class="docutils literal"><span class="pre">`(in_language</span> <span class="pre">"c++")</span></tt>.</li>
+<li><tt class="docutils literal"><span class="pre">not_empty</span></tt> - Returns true if a given option (which should be
+either a parameter or a parameter list) is set by the
+user. Example: <tt class="docutils literal"><span class="pre">`(not_empty</span> <span class="pre">"o")</span></tt>.</li>
+<li><tt class="docutils literal"><span class="pre">default</span></tt> - Always evaluates to true. Should always be the last
+test in the <tt class="docutils literal"><span class="pre">case</span></tt> expression.</li>
+<li><tt class="docutils literal"><span class="pre">and</span></tt> - A standard logical combinator that returns true iff all
+of its arguments return true. Used like this: <tt class="docutils literal"><span class="pre">(and</span> <span class="pre">(test1),</span>
+<span class="pre">(test2),</span> <span class="pre">...</span> <span class="pre">(testN))</span></tt>. Nesting of <tt class="docutils literal"><span class="pre">and</span></tt> and <tt class="docutils literal"><span class="pre">or</span></tt> is allowed,
+but not encouraged.</li>
+<li><tt class="docutils literal"><span class="pre">or</span></tt> - Another logical combinator that returns true only if any
+one of its arguments returns true. Example: <tt class="docutils literal"><span class="pre">(or</span> <span class="pre">(test1),</span>
+<span class="pre">(test2),</span> <span class="pre">...</span> <span class="pre">(testN))</span></tt>.</li>
+</ul>
+</li>
+</ul>
+</div>
+<div class="doc_text">
+<div class="doc_section"><a class="toc-backref" href="#id10" id="language-map" name="language-map">Language map</a></div>
+<p>One last thing that you will need to modify when adding support for a
+new language to LLVMC is 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 is
+located in the file <tt class="docutils literal"><span class="pre">Tools.td</span></tt> and looks like this:</p>
+<pre class="literal-block">
+def LanguageMap : LanguageMap<
+    [LangToSuffixes<"c++", ["cc", "cp", "cxx", "cpp", "CPP", "c++", "C"]>,
+     LangToSuffixes<"c", ["c"]>,
+     ...
+    ]>;
+</pre>
+</div>
+<div class="doc_text">
+<div class="doc_section"><a class="toc-backref" href="#id11" id="references" name="references">References</a></div>
+<table class="docutils footnote" frame="void" id="id2" rules="none">
+<colgroup><col class="label" /><col /></colgroup>
+<tbody valign="top">
+<tr><td class="label"><a class="fn-backref" href="#id1" name="id2">[1]</a></td><td>TableGen Fundamentals
+<a class="reference" href="http://llvm.cs.uiuc.edu/docs/TableGenFundamentals.html">http://llvm.cs.uiuc.edu/docs/TableGenFundamentals.html</a></td></tr>
+</tbody>
+</table>
+</div>
+</div>
+<hr />
+<address>
+  <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
+  src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /></a>
+  <a href="http://validator.w3.org/check/referer"><img
+  src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" /></a>
+  <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br/>
+  Last modified: $Date$
 </address>
-<!-- vim: sw=2
--->
 </body>
 </html>

Modified: llvm/branches/non-call-eh/docs/DeveloperPolicy.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/DeveloperPolicy.html?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/DeveloperPolicy.html (original)
+++ llvm/branches/non-call-eh/docs/DeveloperPolicy.html Sun Jul  6 15:45:41 2008
@@ -116,6 +116,15 @@
   <em>attachment</em> to the message, not embedded into the text of the
   message.  This ensures that your mailer will not mangle the patch when it 
   sends it (e.g. by making whitespace changes or by wrapping lines).</p>
+  
+  <p><em>For Thunderbird users:</em> Before submitting a patch, please open 
+  <em>Preferences → Advanced → General → Config Editor</em>,
+  find the key <tt>mail.content_disposition_type</tt>, and set its value to
+  <tt>1</tt>. Without this setting, Thunderbird sends your attachment using
+  <tt>Content-Disposition: inline</tt> rather than <tt>Content-Disposition:
+  attachment</tt>. Apple Mail gamely displays such a file inline, making it
+  difficult to work with for reviewers using that program.</p>
+</p>
 </div>
 
 <!-- _______________________________________________________________________ -->
@@ -458,7 +467,7 @@
   
   <p>
   Although UIUC may eventually reassign the copyright of the software to another
-  entity (e.g. a dedicated non-profit "LLVM Organization", or something)
+  entity (e.g. a dedicated non-profit "LLVM Organization")
   the intent for the project is to always have a single entity hold the
   copyrights to LLVM at any given time.</p>
   
@@ -467,6 +476,7 @@
   reduces the managerial burden for any kind of administrative or technical 
   decisions about LLVM.  The goal of the LLVM project is to always keep the code
   open and <a href="#license">licensed under a very liberal license</a>.</p>
+
 </div>
 
 <!-- _______________________________________________________________________ -->
@@ -480,7 +490,8 @@
   <ul>
     <li>You can freely distribute LLVM.</li>
     <li>You must retain the copyright notice if you redistribute LLVM.</li>
-    <li>Binaries derived from LLVM must reproduce the copyright notice.</li>
+    <li>Binaries derived from LLVM must reproduce the copyright notice (e.g. 
+        in an included readme file).</li>
     <li>You can't use our names to promote your LLVM derived products.</li>
     <li>There's no warranty on LLVM at all.</li>
   </ul>
@@ -520,9 +531,11 @@
    arbitrary purposes (including commercial use).</p>
    
 <p>When contributing code, we expect contributors to notify us of any potential
-   for patent-related trouble with their changes.  If you own the rights to a
+   for patent-related trouble with their changes.  If you or your employer
+   own the rights to a
    patent and would like to contribute code to LLVM that relies on it, we
-   require that you sign an agreement that allows any other user of LLVM to
+   require that
+   the copyright owner sign an agreement that allows any other user of LLVM to
    freely use your patent.  Please contact the <a 
    href="mailto:llvm-oversight at cs.uiuc.edu">oversight group</a> for more
    details.</p>
@@ -537,6 +550,11 @@
   the entire software base can be managed by a single copyright holder.  This
   implies that any contributions can be licensed under the license that the
   project uses.</p>
+
+  <p>When contributing code, you also affirm that you are legally entitled to 
+  grant this copyright, personally or on behalf of your employer.  If the code
+  belongs to some other entity, please raise this issue with the oversight
+  group before the code is committed.</p>
 </div>
 
 <!-- *********************************************************************** -->

Modified: llvm/branches/non-call-eh/docs/GCCFEBuildInstrs.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/GCCFEBuildInstrs.html?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/GCCFEBuildInstrs.html (original)
+++ llvm/branches/non-call-eh/docs/GCCFEBuildInstrs.html Sun Jul  6 15:45:41 2008
@@ -29,31 +29,22 @@
 
 <div class="doc_text">
 
-<p>This section describes how to acquire and build llvm-gcc 4.0 and 4.2, which are
-based on the GCC 4.0.1/4.2.1 front-ends respectively.  Both front-ends support C,
-C++, Objective-C and Objective-C++.  The 4.2 front-end also supports Ada and
-Fortran to some extent.  Note that the instructions for building these front-ends
-are completely different (and much easier!) than those for building llvm-gcc3 in
-the past.</p>
+<p>This section describes how to acquire and build llvm-gcc 4.2, which is based
+on the GCC 4.2.1 front-end.  Supported languages are Ada, C, C++, Fortran,
+Objective-C and Objective-C++.  Note that the instructions for building these
+front-ends are completely different (and much easier!) than those for building
+llvm-gcc3 in the past.</p>
 
 <ol>
-  <li><p>Retrieve the appropriate llvm-gcc4.x-y.z.source.tar.gz archive from the
+  <li><p>Retrieve the appropriate llvm-gcc-4.2-x.y.source.tar.gz archive from the
          <a href="http://llvm.org/releases/">llvm web site</a>.</p>
 
       <p>It is also possible to download the sources of the llvm-gcc front end
-         from a read-only mirror using subversion.  To check out the 4.0 code
+         from a read-only mirror using subversion.  To check out the 4.2 code
          for first time use:</p>
 
 <div class="doc_code">
 <pre>
-svn co http://llvm.org/svn/llvm-project/llvm-gcc-4.0/trunk <i>dst-directory</i>
-</pre>
-</div>
-
-<p>To check out the 4.2 code use:</p>
-
-<div class="doc_code">
-<pre>
 svn co http://llvm.org/svn/llvm-project/llvm-gcc-4.2/trunk <i>dst-directory</i>
 </pre>
 </div>
@@ -93,19 +84,17 @@
   <li><p>The build requires having a compiler that supports Ada, C and C++.
       The Ada front-end is written in Ada so an Ada compiler is needed to
       build it.  Compilers known to work with the
-      <a href="http://llvm.org/releases/download.html">LLVM 2.2 release</a>
+      <a href="http://llvm.org/releases/download.html">LLVM 2.3 release</a>
       are <a href="http://gcc.gnu.org/releases.html">gcc-4.2</a> and the
-      <a href="http://libre.adacore.com/">2005 GNAT GPL Edition</a>.
-      <a href="GettingStarted.html#checkout">LLVM from subversion</a>
-      also works with the
-      <a href="http://libre.adacore.com/">2006 and 2007 GNAT GPL Editions</a>.
+      2005, 2006 and 2007 versions of the
+      <a href="http://libre.adacore.com/">GNAT GPL Edition</a>.
       The LLVM parts of llvm-gcc are written in C++ so a C++ compiler is
       needed to build them.  The rest of gcc is written in C.
       Some linux distributions provide a version of gcc that supports all
       three languages (the Ada part often comes as an add-on package to
       the rest of gcc).  Otherwise it is possible to combine two versions
       of gcc, one that supports Ada and C (such as the
-      <a href="http://libre.adacore.com/">2005 GNAT GPL Edition</a>)
+      <a href="http://libre.adacore.com/">2007 GNAT GPL Edition</a>)
       and another which supports C++, see below.</p></li>
   <li><p>Because the Ada front-end is experimental, it is wise to build the
       compiler with checking enabled.  This causes it to run much slower, but
@@ -121,9 +110,9 @@
       and unpack it:</p>
 
 <div class="doc_code">
-<pre>wget http://llvm.org/releases/2.2/llvm-2.2.tar.gz
-tar xzf llvm-2.2.tar.gz
-mv llvm-2.2 llvm</pre>
+<pre>wget http://llvm.org/releases/2.3/llvm-2.3.tar.gz
+tar xzf llvm-2.3.tar.gz
+mv llvm-2.3 llvm</pre>
 </div>
 
       <p>or <a href="GettingStarted.html#checkout">check out the
@@ -139,9 +128,9 @@
       and unpack it:</p>
 
 <div class="doc_code">
-<pre>wget http://llvm.org/releases/2.2/llvm-gcc4.2-2.2.source.tar.gz
-tar xzf llvm-gcc4.2-2.2.source.tar.gz
-mv llvm-gcc4.2-2.2.source llvm-gcc-4.2</pre>
+<pre>wget http://llvm.org/releases/2.3/llvm-gcc-4.2-2.3.source.tar.gz
+tar xzf llvm-gcc-4.2-2.3.source.tar.gz
+mv llvm-gcc4.2-2.3.source llvm-gcc-4.2</pre>
 </div>
 
       <p>or <a href="GettingStarted.html#checkout">check out the
@@ -186,7 +175,7 @@
   <li><p>Install LLVM (optional):</p>
 
 <div class="doc_code">
-<pre>make install</pre>
+<pre>make ENABLE_OPTIMIZED=0 install</pre>
 </div>
       </li>
 
@@ -203,12 +192,12 @@
 
   <li><p>Configure llvm-gcc (here it is configured to install into <tt>/usr/local</tt>).
       The <tt>--enable-checking</tt> flag turns on sanity checks inside the compiler.
-      If you omit it then LLVM must be built with <tt>make ENABLE_OPTIMIZED=1</tt>.
+      If you omit it then LLVM should be built with <tt>make ENABLE_OPTIMIZED=1</tt>.
       Additional languages can be appended to the --enable-languages switch,
       for example <tt>--enable-languages=ada,c,c++</tt>.</p>
 
 <div class="doc_code">
-<pre>../llvm-gcc-4.2/configure --prefix=<b>/usr/local</b> --enable-languages=ada,c --enable-checking --enable-llvm=$PWD/../llvm-objects --disable-shared --disable-bootstrap --disable-multilib</pre>
+<pre>../llvm-gcc-4.2/configure --prefix=<b>/usr/local</b> --enable-languages=ada,c --enable-checking --enable-llvm=$PWD/../llvm-objects --disable-bootstrap --disable-multilib</pre>
 </div>
 
       <p>If you have a multi-compiler setup, then you can configure like this:</p>
@@ -217,7 +206,7 @@
 <pre>
 export CC=<b>PATH_TO_C_AND_ADA_COMPILER</b>
 export CXX=<b>PATH_TO_C++_COMPILER</b>
-../llvm-gcc-4.2/configure --prefix=<b>/usr/local</b> --enable-languages=ada,c --enable-checking --enable-llvm=$PWD/../llvm-objects --disable-shared --disable-bootstrap --disable-multilib</pre>
+../llvm-gcc-4.2/configure --prefix=<b>/usr/local</b> --enable-languages=ada,c --enable-checking --enable-llvm=$PWD/../llvm-objects --disable-bootstrap --disable-multilib</pre>
 </div>
       </li>
 

Modified: llvm/branches/non-call-eh/docs/GarbageCollection.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/GarbageCollection.html?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/GarbageCollection.html (original)
+++ llvm/branches/non-call-eh/docs/GarbageCollection.html Sun Jul  6 15:45:41 2008
@@ -151,7 +151,7 @@
 <div class="doc_text">
 
 <p>LLVM's intermediate representation provides <a href="#intrinsics">garbage
-collection intrinsics</a> which offer support for a broad class of
+collection intrinsics</a> that offer support for a broad class of
 collector models. For instance, the intrinsics permit:</p>
 
 <ul>
@@ -280,8 +280,8 @@
 
 <div class="doc_text">
 
-<p>The SemiSpace runtime implements with the <a href="runtime">suggested
-runtime interface</a> and is compatible the ShadowStack backend.</p>
+<p>The SemiSpace runtime implements the <a href="runtime">suggested
+runtime interface</a> and is compatible with the ShadowStack backend.</p>
 
 <p>SemiSpace is a very simple copying collector. When it starts up, it
 allocates two blocks of memory for the heap. It uses a simple bump-pointer
@@ -321,7 +321,7 @@
 
 <!-- *********************************************************************** -->
 <div class="doc_section">
-  <a name="core">Core support</a>
+  <a name="core">Core support</a><a name="intrinsics"></a>
 </div>
 <!-- *********************************************************************** -->
 
@@ -351,12 +351,12 @@
 <div class="doc_text">
 
 <p>The <tt>gc</tt> function attribute is used to specify the desired collector
-algorithm to the compiler. It is equivalent to specify the collector name
+algorithm to the compiler. It is equivalent to specifying the collector name
 programmatically using the <tt>setCollector</tt> method of
 <tt>Function</tt>.</p>
 
 <p>Specifying the collector on a per-function basis allows LLVM to link together
-programs which use different garbage collection algorithms.</p>
+programs that use different garbage collection algorithms.</p>
 
 </div>
 
@@ -366,13 +366,13 @@
 </div>
 
 <div class="doc_code"><tt>
-  void %llvm.gcroot(i8** %ptrloc, i8* %metadata)
+  void @llvm.gcroot(i8** %ptrloc, i8* %metadata)
 </tt></div>
 
 <div class="doc_text">
 
 <p>The <tt>llvm.gcroot</tt> intrinsic is used to inform LLVM of a pointer
-variable on the stack. The first argument <b>must</b> be an alloca instruction
+variable on the stack. The first argument <b>must</b> be a value referring to an alloca instruction
 or a bitcast of an alloca. The second contains a pointer to metadata that
 should be associated with the pointer, and <b>must</b> be a constant or global
 value address. If your target collector uses tags, use a null pointer for
@@ -399,7 +399,7 @@
    ;; Tell LLVM that the stack space is a stack root.
    ;; Java has type-tags on objects, so we pass null as metadata.
    %tmp = bitcast %Object** %X to i8**
-   call void %llvm.gcroot(%i8** %X, i8* null)
+   call void @llvm.gcroot(i8** %X, i8* null)
    ...
 
    ;; "CodeBlock" is the block corresponding to the start
@@ -439,16 +439,16 @@
 for completeness. In this snippet, <tt>%object</tt> is the object pointer, and 
 <tt>%derived</tt> is the derived pointer:</p>
 
-<blockquote><pre
->    ;; An array type.
+<blockquote><pre>
+    ;; An array type.
     %class.Array = type { %class.Object, i32, [0 x %class.Object*] }
-...
+    ...
 
     ;; Load the object pointer from a gcroot.
     %object = load %class.Array** %object_addr
 
     ;; Compute the derived pointer.
-    %derived = getelementptr %obj, i32 0, i32 2, i32 %n</pre></blockquote>
+    %derived = getelementptr %object, i32 0, i32 2, i32 %n</pre></blockquote>
 
 </div>
 
@@ -594,7 +594,7 @@
 generator that iterates through all of the GC roots on the stack, calling the
 specified function pointer with each record. For each GC root, the address of
 the pointer and the meta-data (from the <a
-href="#roots"><tt>llvm.gcroot</tt></a> intrinsic) are provided.
+href="#gcroot"><tt>llvm.gcroot</tt></a> intrinsic) are provided.
 </p>
 </div>
 
@@ -1329,7 +1329,7 @@
 <a href="#explicit"><tt>llvm_gc_collect</tt></a> functions. To do this, it will
 probably have to <a href="#traceroots">trace through the roots
 from the stack</a> and understand the <a href="#gcdescriptors">GC descriptors
-for heap objects</a>. Luckily, there are some <a href="#gcimpls">example
+for heap objects</a>. Luckily, there are some <a href="#usage">example
 implementations</a> available.
 </p>
 </div>
@@ -1366,7 +1366,7 @@
 <p>The LLVM garbage collectors are capable of supporting all of these styles of
 language, including ones that mix various implementations. To do this, it
 allows the source-language to associate meta-data with the <a
-href="#roots">stack roots</a>, and the heap tracing routines can propagate the
+href="#gcroot">stack roots</a>, and the heap tracing routines can propagate the
 information. In addition, LLVM allows the front-end to extract GC information
 in any form from a specific object pointer (this supports situations #1 and #3).
 </p>

Modified: llvm/branches/non-call-eh/docs/GettingStarted.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/GettingStarted.html?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/GettingStarted.html (original)
+++ llvm/branches/non-call-eh/docs/GettingStarted.html Sun Jul  6 15:45:41 2008
@@ -716,6 +716,7 @@
   subdirectories of the '<tt>tags</tt>' directory:</p>
 
 <ul>
+<li>Release 2.3: <b>RELEASE_23</b></li>
 <li>Release 2.2: <b>RELEASE_22</b></li>
 <li>Release 2.1: <b>RELEASE_21</b></li>
 <li>Release 2.0: <b>RELEASE_20</b></li>

Modified: llvm/branches/non-call-eh/docs/LangRef.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/LangRef.html?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/LangRef.html (original)
+++ llvm/branches/non-call-eh/docs/LangRef.html Sun Jul  6 15:45:41 2008
@@ -111,6 +111,12 @@
           <li><a href="#i_shufflevector">'<tt>shufflevector</tt>' Instruction</a></li>
         </ol>
       </li>
+      <li><a href="#aggregateops">Aggregate Operations</a>
+        <ol>
+          <li><a href="#i_extractvalue">'<tt>extractvalue</tt>' Instruction</a></li>
+          <li><a href="#i_insertvalue">'<tt>insertvalue</tt>' Instruction</a></li>
+        </ol>
+      </li>
       <li><a href="#memoryops">Memory Access and Addressing Operations</a>
         <ol>
           <li><a href="#i_malloc">'<tt>malloc</tt>'   Instruction</a></li>
@@ -140,6 +146,8 @@
         <ol>
           <li><a href="#i_icmp">'<tt>icmp</tt>' Instruction</a></li>
           <li><a href="#i_fcmp">'<tt>fcmp</tt>' Instruction</a></li>
+          <li><a href="#i_vicmp">'<tt>vicmp</tt>' Instruction</a></li>
+          <li><a href="#i_vfcmp">'<tt>vfcmp</tt>' Instruction</a></li>
           <li><a href="#i_phi">'<tt>phi</tt>'   Instruction</a></li>
           <li><a href="#i_select">'<tt>select</tt>' Instruction</a></li>
           <li><a href="#i_call">'<tt>call</tt>'  Instruction</a></li>
@@ -208,9 +216,18 @@
           <li><a href="#int_atomics">Atomic intrinsics</a>
             <ol>
               <li><a href="#int_memory_barrier"><tt>llvm.memory_barrier</tt></a></li>
-              <li><a href="#int_atomic_lcs"><tt>llvm.atomic.lcs</tt></a></li>
-              <li><a href="#int_atomic_las"><tt>llvm.atomic.las</tt></a></li>
+              <li><a href="#int_atomic_cmp_swap"><tt>llvm.atomic.cmp.swap</tt></a></li>
               <li><a href="#int_atomic_swap"><tt>llvm.atomic.swap</tt></a></li>
+              <li><a href="#int_atomic_load_add"><tt>llvm.atomic.load.add</tt></a></li>
+              <li><a href="#int_atomic_load_sub"><tt>llvm.atomic.load.sub</tt></a></li>
+              <li><a href="#int_atomic_load_and"><tt>llvm.atomic.load.and</tt></a></li>
+              <li><a href="#int_atomic_load_nand"><tt>llvm.atomic.load.nand</tt></a></li>
+              <li><a href="#int_atomic_load_or"><tt>llvm.atomic.load.or</tt></a></li>
+              <li><a href="#int_atomic_load_xor"><tt>llvm.atomic.load.xor</tt></a></li>
+              <li><a href="#int_atomic_load_max"><tt>llvm.atomic.load.max</tt></a></li>
+              <li><a href="#int_atomic_load_min"><tt>llvm.atomic.load.min</tt></a></li>
+              <li><a href="#int_atomic_load_umax"><tt>llvm.atomic.load.umax</tt></a></li>
+              <li><a href="#int_atomic_load_umin"><tt>llvm.atomic.load.umin</tt></a></li>
             </ol>
           </li>
       <li><a href="#int_general">General intrinsics</a>
@@ -458,7 +475,7 @@
 
 <dl>
 
-  <dt><tt><b><a name="linkage_internal">internal</a></b></tt> </dt>
+  <dt><tt><b><a name="linkage_internal">internal</a></b></tt>: </dt>
 
   <dd>Global values with internal linkage are only directly accessible by
   objects in the current module.  In particular, linking code into a module with
@@ -477,14 +494,22 @@
   allowed to be discarded.
   </dd>
 
+  <dt><tt><b><a name="linkage_common">common</a></b></tt>: </dt>
+
+  <dd>"<tt>common</tt>" linkage is exactly the same as <tt>linkonce</tt> 
+  linkage, except that unreferenced <tt>common</tt> globals may not be
+  discarded.  This is used for globals that may be emitted in multiple 
+  translation units, but that are not guaranteed to be emitted into every 
+  translation unit that uses them.  One example of this is tentative
+  definitions in C, such as "<tt>int X;</tt>" at global scope.
+  </dd>
+
   <dt><tt><b><a name="linkage_weak">weak</a></b></tt>: </dt>
 
-  <dd>"<tt>weak</tt>" linkage is exactly the same as <tt>linkonce</tt> linkage,
-  except that unreferenced <tt>weak</tt> globals may not be discarded.  This is
-  used for globals that may be emitted in multiple translation units, but that
-  are not guaranteed to be emitted into every translation unit that uses them.
-  One example of this are common globals in C, such as "<tt>int X;</tt>" at 
-  global scope.
+  <dd>"<tt>weak</tt>" linkage is the same as <tt>common</tt> linkage, except
+  that some targets may choose to emit different assembly sequences for them 
+  for target-dependent reasons.  This is used for globals that are declared 
+  "weak" in C source code.
   </dd>
 
   <dt><tt><b><a name="linkage_appending">appending</a></b></tt>: </dt>
@@ -578,9 +603,11 @@
   (e.g. by passing things in registers).  This calling convention allows the
   target to use whatever tricks it wants to produce fast code for the target,
   without having to conform to an externally specified ABI.  Implementations of
-  this convention should allow arbitrary tail call optimization to be supported.
-  This calling convention does not support varargs and requires the prototype of
-  all callees to exactly match the prototype of the function definition.
+  this convention should allow arbitrary
+  <a href="CodeGenerator.html#tailcallopt">tail call optimization</a> to be
+  supported.  This calling convention does not support varargs and requires the
+  prototype of all callees to exactly match the prototype of the function
+  definition.
   </dd>
 
   <dt><b>"<tt>coldcc</tt>" - The cold calling convention</b>:</dt>
@@ -1027,14 +1054,16 @@
       <td><a href="#t_integer">integer</a>,
           <a href="#t_floating">floating point</a>,
           <a href="#t_pointer">pointer</a>,
-          <a href="#t_vector">vector</a>
+          <a href="#t_vector">vector</a>,
+          <a href="#t_struct">structure</a>,
+          <a href="#t_array">array</a>,
+          <a href="#t_label">label</a>.
       </td>
     </tr>
     <tr>
       <td><a href="#t_primitive">primitive</a></td>
       <td><a href="#t_label">label</a>,
           <a href="#t_void">void</a>,
-          <a href="#t_integer">integer</a>,
           <a href="#t_floating">floating point</a>.</td>
     </tr>
     <tr>
@@ -1054,8 +1083,7 @@
 <p>The <a href="#t_firstclass">first class</a> types are perhaps the
 most important.  Values of these types are the only ones which can be
 produced by instructions, passed as arguments, or used as operands to
-instructions.  This means that all structures and arrays must be
-manipulated either by pointer or by component.</p>
+instructions.</p>
 </div>
 
 <!-- ======================================================================= -->
@@ -1223,17 +1251,21 @@
 <!-- _______________________________________________________________________ -->
 <div class="doc_subsubsection"> <a name="t_function">Function Type</a> </div>
 <div class="doc_text">
+
 <h5>Overview:</h5>
+
 <p>The function type can be thought of as a function signature.  It
 consists of a return type and a list of formal parameter types. The
-return type of a function type is a scalar type or a void type or a struct type. 
+return type of a function type is a scalar type, a void type, or a struct type. 
 If the return type is a struct type then all struct elements must be of first 
-class types. Function types are usually used to build virtual function tables
-(which are structures of pointers to functions), for indirect function
-calls, and when defining a function.</p>
+class types, and the struct must have at least one element.</p>
 
 <h5>Syntax:</h5>
-<pre>  <returntype list> (<parameter list>)<br></pre>
+
+<pre>
+  <returntype list> (<parameter list>)
+</pre>
+
 <p>...where '<tt><parameter list></tt>' is a comma-separated list of type
 specifiers.  Optionally, the parameter list may include a type <tt>...</tt>,
 which indicates that the function takes a variable number of arguments.
@@ -1241,6 +1273,7 @@
  href="#int_varargs">variable argument handling intrinsic</a> functions.
 '<tt><returntype list></tt>' is a comma-separated list of
 <a href="#t_firstclass">first class</a> type specifiers.</p>
+
 <h5>Examples:</h5>
 <table class="layout">
   <tr class="layout">
@@ -1675,6 +1708,12 @@
   <dt><b><tt>fcmp COND ( VAL1, VAL2 )</tt></b></dt>
   <dd>Performs the <a href="#i_fcmp">fcmp operation</a> on constants.</dd>
 
+  <dt><b><tt>vicmp COND ( VAL1, VAL2 )</tt></b></dt>
+  <dd>Performs the <a href="#i_vicmp">vicmp operation</a> on constants.</dd>
+
+  <dt><b><tt>vfcmp COND ( VAL1, VAL2 )</tt></b></dt>
+  <dd>Performs the <a href="#i_vfcmp">vfcmp operation</a> on constants.</dd>
+
   <dt><b><tt>extractelement ( VAL, IDX )</tt></b></dt>
 
   <dd>Perform the <a href="#i_extractelement">extractelement
@@ -1802,19 +1841,26 @@
   ret void                 <i>; Return from void function</i>
   ret <type> <value>, <type> <value>  <i>; Return two values from a non-void function </i>
 </pre>
+
 <h5>Overview:</h5>
+
 <p>The '<tt>ret</tt>' instruction is used to return control flow (and a
 value) from a function back to the caller.</p>
 <p>There are two forms of the '<tt>ret</tt>' instruction: one that
-returns a value and then causes control flow, and one that just causes
+returns value(s) and then causes control flow, and one that just causes
 control flow to occur.</p>
+
 <h5>Arguments:</h5>
-<p>The '<tt>ret</tt>' instruction may return one or multiple values. The
-type of each return value must be a '<a href="#t_firstclass">first class</a>'
- type.  Note that a function is not <a href="#wellformed">well formed</a> 
-if there exists a '<tt>ret</tt>' instruction inside of the function that 
-returns values that do not match the return type of the function.</p>
+
+<p>The '<tt>ret</tt>' instruction may return zero, one or multiple values. 
+The type of each return value must be a '<a href="#t_firstclass">first 
+class</a>' type.  Note that a function is not <a href="#wellformed">well 
+formed</a> if there exists a '<tt>ret</tt>' instruction inside of the 
+function that returns values that do not match the return type of the 
+function.</p>
+
 <h5>Semantics:</h5>
+
 <p>When the '<tt>ret</tt>' instruction is executed, control flow
 returns back to the calling function's context.  If the caller is a "<a
  href="#i_call"><tt>call</tt></a>" instruction, execution continues at
@@ -1825,8 +1871,11 @@
 return value. If the instruction returns multiple values then these 
 values can only be accessed through a '<a href="#i_getresult"><tt>getresult</tt>
 </a>' instruction.</p>
+
 <h5>Example:</h5>
-<pre>  ret i32 5                       <i>; Return an integer value of 5</i>
+
+<pre>
+  ret i32 5                       <i>; Return an integer value of 5</i>
   ret void                        <i>; Return from a void function</i>
   ret i32 4, i8 2                 <i>; Return two values 4 and 2 </i> 
 </pre>
@@ -2062,82 +2111,121 @@
 <p>There are several different binary operators:</p>
 </div>
 <!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_add">'<tt>add</tt>'
-Instruction</a> </div>
+<div class="doc_subsubsection">
+  <a name="i_add">'<tt>add</tt>' Instruction</a>
+</div>
+
 <div class="doc_text">
+
 <h5>Syntax:</h5>
-<pre>  <result> = add <ty> <var1>, <var2>   <i>; yields {ty}:result</i>
+
+<pre>
+  <result> = add <ty> <var1>, <var2>   <i>; yields {ty}:result</i>
 </pre>
+
 <h5>Overview:</h5>
+
 <p>The '<tt>add</tt>' instruction returns the sum of its two operands.</p>
+
 <h5>Arguments:</h5>
-<p>The two arguments to the '<tt>add</tt>' instruction must be either <a
- href="#t_integer">integer</a> or <a href="#t_floating">floating point</a> values.
- This instruction can also take <a href="#t_vector">vector</a> versions of the values.
-Both arguments must have identical types.</p>
+
+<p>The two arguments to the '<tt>add</tt>' instruction must be <a
+ href="#t_integer">integer</a>, <a href="#t_floating">floating point</a>, or
+ <a href="#t_vector">vector</a> values. Both arguments must have identical
+ types.</p>
+
 <h5>Semantics:</h5>
+
 <p>The value produced is the integer or floating point sum of the two
 operands.</p>
+
 <p>If an integer sum has unsigned overflow, the result returned is the
 mathematical result modulo 2<sup>n</sup>, where n is the bit width of
 the result.</p>
+
 <p>Because LLVM integers use a two's complement representation, this
 instruction is appropriate for both signed and unsigned integers.</p>
+
 <h5>Example:</h5>
-<pre>  <result> = add i32 4, %var          <i>; yields {i32}:result = 4 + %var</i>
+
+<pre>
+  <result> = add i32 4, %var          <i>; yields {i32}:result = 4 + %var</i>
 </pre>
 </div>
 <!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_sub">'<tt>sub</tt>'
-Instruction</a> </div>
+<div class="doc_subsubsection">
+   <a name="i_sub">'<tt>sub</tt>' Instruction</a>
+</div>
+
 <div class="doc_text">
+
 <h5>Syntax:</h5>
-<pre>  <result> = sub <ty> <var1>, <var2>   <i>; yields {ty}:result</i>
+
+<pre>
+  <result> = sub <ty> <var1>, <var2>   <i>; yields {ty}:result</i>
 </pre>
+
 <h5>Overview:</h5>
+
 <p>The '<tt>sub</tt>' instruction returns the difference of its two
 operands.</p>
-<p>Note that the '<tt>sub</tt>' instruction is used to represent the '<tt>neg</tt>'
-instruction present in most other intermediate representations.</p>
+
+<p>Note that the '<tt>sub</tt>' instruction is used to represent the
+'<tt>neg</tt>' instruction present in most other intermediate 
+representations.</p>
+
 <h5>Arguments:</h5>
-<p>The two arguments to the '<tt>sub</tt>' instruction must be either <a
- href="#t_integer">integer</a> or <a href="#t_floating">floating point</a>
-values. 
-This instruction can also take <a href="#t_vector">vector</a> versions of the values.
-Both arguments must have identical types.</p>
+
+<p>The two arguments to the '<tt>sub</tt>' instruction must be <a
+ href="#t_integer">integer</a>, <a href="#t_floating">floating point</a>,
+ or <a href="#t_vector">vector</a> values.  Both arguments must have identical
+ types.</p>
+
 <h5>Semantics:</h5>
+
 <p>The value produced is the integer or floating point difference of
 the two operands.</p>
+
 <p>If an integer difference has unsigned overflow, the result returned is the
 mathematical result modulo 2<sup>n</sup>, where n is the bit width of
 the result.</p>
+
 <p>Because LLVM integers use a two's complement representation, this
 instruction is appropriate for both signed and unsigned integers.</p>
+
 <h5>Example:</h5>
 <pre>
   <result> = sub i32 4, %var          <i>; yields {i32}:result = 4 - %var</i>
   <result> = sub i32 0, %val          <i>; yields {i32}:result = -%var</i>
 </pre>
 </div>
+
 <!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_mul">'<tt>mul</tt>'
-Instruction</a> </div>
+<div class="doc_subsubsection">
+  <a name="i_mul">'<tt>mul</tt>' Instruction</a>
+</div>
+
 <div class="doc_text">
+
 <h5>Syntax:</h5>
 <pre>  <result> = mul <ty> <var1>, <var2>   <i>; yields {ty}:result</i>
 </pre>
 <h5>Overview:</h5>
 <p>The  '<tt>mul</tt>' instruction returns the product of its two
 operands.</p>
+
 <h5>Arguments:</h5>
-<p>The two arguments to the '<tt>mul</tt>' instruction must be either <a
- href="#t_integer">integer</a> or <a href="#t_floating">floating point</a>
-values. 
-This instruction can also take <a href="#t_vector">vector</a> versions of the values.
-Both arguments must have identical types.</p>
+
+<p>The two arguments to the '<tt>mul</tt>' instruction must be <a
+href="#t_integer">integer</a>, <a href="#t_floating">floating point</a>,
+or <a href="#t_vector">vector</a> values.  Both arguments must have identical
+types.</p>
+ 
 <h5>Semantics:</h5>
+
 <p>The value produced is the integer or floating point product of the
 two operands.</p>
+
 <p>If the result of an integer multiplication has unsigned overflow,
 the result returned is the mathematical result modulo 
 2<sup>n</sup>, where n is the bit width of the result.</p>
@@ -2151,6 +2239,7 @@
 <pre>  <result> = mul i32 4, %var          <i>; yields {i32}:result = 4 * %var</i>
 </pre>
 </div>
+
 <!-- _______________________________________________________________________ -->
 <div class="doc_subsubsection"> <a name="i_udiv">'<tt>udiv</tt>' Instruction
 </a></div>
@@ -2161,12 +2250,15 @@
 <h5>Overview:</h5>
 <p>The '<tt>udiv</tt>' instruction returns the quotient of its two
 operands.</p>
+
 <h5>Arguments:</h5>
+
 <p>The two arguments to the '<tt>udiv</tt>' instruction must be 
-<a href="#t_integer">integer</a> values. Both arguments must have identical 
-types. This instruction can also take <a href="#t_vector">vector</a> versions 
-of the values in which case the elements must be integers.</p>
+<a href="#t_integer">integer</a> or <a href="#t_vector">vector</a> of integer
+values.  Both arguments must have identical types.</p>
+
 <h5>Semantics:</h5>
+
 <p>The value produced is the unsigned integer quotient of the two operands.</p>
 <p>Note that unsigned integer division and signed integer division are distinct
 operations; for signed integer division, use '<tt>sdiv</tt>'.</p>
@@ -2180,16 +2272,21 @@
 </a> </div>
 <div class="doc_text">
 <h5>Syntax:</h5>
-<pre>  <result> = sdiv <ty> <var1>, <var2>   <i>; yields {ty}:result</i>
+<pre>
+  <result> = sdiv <ty> <var1>, <var2>   <i>; yields {ty}:result</i>
 </pre>
+
 <h5>Overview:</h5>
+
 <p>The '<tt>sdiv</tt>' instruction returns the quotient of its two
 operands.</p>
+
 <h5>Arguments:</h5>
-<p>The two arguments to the '<tt>sdiv</tt>' instruction must be
-<a href="#t_integer">integer</a> values.  Both arguments must have identical 
-types. This instruction can also take <a href="#t_vector">vector</a> versions 
-of the values in which case the elements must be integers.</p>
+
+<p>The two arguments to the '<tt>sdiv</tt>' instruction must be 
+<a href="#t_integer">integer</a> or <a href="#t_vector">vector</a> of integer
+values.  Both arguments must have identical types.</p>
+
 <h5>Semantics:</h5>
 <p>The value produced is the signed integer quotient of the two operands rounded towards zero.</p>
 <p>Note that signed integer division and unsigned integer division are distinct
@@ -2206,22 +2303,31 @@
 Instruction</a> </div>
 <div class="doc_text">
 <h5>Syntax:</h5>
-<pre>  <result> = fdiv <ty> <var1>, <var2>   <i>; yields {ty}:result</i>
+<pre>
+  <result> = fdiv <ty> <var1>, <var2>   <i>; yields {ty}:result</i>
 </pre>
 <h5>Overview:</h5>
+
 <p>The '<tt>fdiv</tt>' instruction returns the quotient of its two
 operands.</p>
+
 <h5>Arguments:</h5>
+
 <p>The two arguments to the '<tt>fdiv</tt>' instruction must be
-<a href="#t_floating">floating point</a> values.  Both arguments must have
-identical types.  This instruction can also take <a href="#t_vector">vector</a>
-versions of floating point values.</p>
+<a href="#t_floating">floating point</a> or <a href="#t_vector">vector</a>
+of floating point values.  Both arguments must have identical types.</p>
+
 <h5>Semantics:</h5>
+
 <p>The value produced is the floating point quotient of the two operands.</p>
+
 <h5>Example:</h5>
-<pre>  <result> = fdiv float 4.0, %var          <i>; yields {float}:result = 4.0 / %var</i>
+
+<pre>
+  <result> = fdiv float 4.0, %var          <i>; yields {float}:result = 4.0 / %var</i>
 </pre>
 </div>
+
 <!-- _______________________________________________________________________ -->
 <div class="doc_subsubsection"> <a name="i_urem">'<tt>urem</tt>' Instruction</a>
 </div>
@@ -2233,10 +2339,9 @@
 <p>The '<tt>urem</tt>' instruction returns the remainder from the
 unsigned division of its two arguments.</p>
 <h5>Arguments:</h5>
-<p>The two arguments to the '<tt>urem</tt>' instruction must be
-<a href="#t_integer">integer</a> values. Both arguments must have identical
-types. This instruction can also take <a href="#t_vector">vector</a> versions 
-of the values in which case the elements must be integers.</p>
+<p>The two arguments to the '<tt>urem</tt>' instruction must be 
+<a href="#t_integer">integer</a> or <a href="#t_vector">vector</a> of integer
+values.  Both arguments must have identical types.</p>
 <h5>Semantics:</h5>
 <p>This instruction returns the unsigned integer <i>remainder</i> of a division.
 This instruction always performs an unsigned division to get the remainder.</p>
@@ -2249,23 +2354,33 @@
 
 </div>
 <!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_srem">'<tt>srem</tt>'
-Instruction</a> </div>
+<div class="doc_subsubsection">
+  <a name="i_srem">'<tt>srem</tt>' Instruction</a>
+</div>
+
 <div class="doc_text">
+
 <h5>Syntax:</h5>
-<pre>  <result> = srem <ty> <var1>, <var2>   <i>; yields {ty}:result</i>
+
+<pre>
+  <result> = srem <ty> <var1>, <var2>   <i>; yields {ty}:result</i>
 </pre>
+
 <h5>Overview:</h5>
+
 <p>The '<tt>srem</tt>' instruction returns the remainder from the
 signed division of its two operands. This instruction can also take
 <a href="#t_vector">vector</a> versions of the values in which case
 the elements must be integers.</p>
 
 <h5>Arguments:</h5>
+
 <p>The two arguments to the '<tt>srem</tt>' instruction must be 
-<a href="#t_integer">integer</a> values.  Both arguments must have identical 
-types.</p>
+<a href="#t_integer">integer</a> or <a href="#t_vector">vector</a> of integer
+values.  Both arguments must have identical types.</p>
+
 <h5>Semantics:</h5>
+
 <p>This instruction returns the <i>remainder</i> of a division (where the result
 has the same sign as the dividend, <tt>var1</tt>), not the <i>modulo</i> 
 operator (where the result has the same sign as the divisor, <tt>var2</tt>) of 
@@ -2288,9 +2403,11 @@
 
 </div>
 <!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_frem">'<tt>frem</tt>'
-Instruction</a> </div>
+<div class="doc_subsubsection">
+  <a name="i_frem">'<tt>frem</tt>' Instruction</a> </div>
+
 <div class="doc_text">
+
 <h5>Syntax:</h5>
 <pre>  <result> = frem <ty> <var1>, <var2>   <i>; yields {ty}:result</i>
 </pre>
@@ -2299,14 +2416,18 @@
 division of its two operands.</p>
 <h5>Arguments:</h5>
 <p>The two arguments to the '<tt>frem</tt>' instruction must be
-<a href="#t_floating">floating point</a> values.  Both arguments must have 
-identical types.  This instruction can also take <a href="#t_vector">vector</a>
-versions of floating point values.</p>
+<a href="#t_floating">floating point</a> or <a href="#t_vector">vector</a>
+of floating point values.  Both arguments must have identical types.</p>
+
 <h5>Semantics:</h5>
+
 <p>This instruction returns the <i>remainder</i> of a division.
 The remainder has the same sign as the dividend.</p>
+
 <h5>Example:</h5>
-<pre>  <result> = frem float 4.0, %var          <i>; yields {float}:result = 4.0 % %var</i>
+
+<pre>
+  <result> = frem float 4.0, %var          <i>; yields {float}:result = 4.0 % %var</i>
 </pre>
 </div>
 
@@ -2338,7 +2459,8 @@
 
 <p>Both arguments to the '<tt>shl</tt>' instruction must be the same <a
  href="#t_integer">integer</a> type.  '<tt>var2</tt>' is treated as an
-unsigned value.</p>
+unsigned value.  This instruction does not support
+<a href="#t_vector">vector</a> operands.</p>
  
 <h5>Semantics:</h5>
 
@@ -2368,7 +2490,8 @@
 <h5>Arguments:</h5>
 <p>Both arguments to the '<tt>lshr</tt>' instruction must be the same 
 <a href="#t_integer">integer</a> type.  '<tt>var2</tt>' is treated as an
-unsigned value.</p>
+unsigned value.  This instruction does not support
+<a href="#t_vector">vector</a> operands.</p>
 
 <h5>Semantics:</h5>
 
@@ -2403,7 +2526,8 @@
 <h5>Arguments:</h5>
 <p>Both arguments to the '<tt>ashr</tt>' instruction must be the same 
 <a href="#t_integer">integer</a> type.  '<tt>var2</tt>' is treated as an
-unsigned value.</p>
+unsigned value.  This instruction does not support
+<a href="#t_vector">vector</a> operands.</p>
 
 <h5>Semantics:</h5>
 <p>This instruction always performs an arithmetic shift right operation, 
@@ -2425,17 +2549,26 @@
 <!-- _______________________________________________________________________ -->
 <div class="doc_subsubsection"> <a name="i_and">'<tt>and</tt>'
 Instruction</a> </div>
+
 <div class="doc_text">
+
 <h5>Syntax:</h5>
-<pre>  <result> = and <ty> <var1>, <var2>   <i>; yields {ty}:result</i>
+
+<pre>
+  <result> = and <ty> <var1>, <var2>   <i>; yields {ty}:result</i>
 </pre>
+
 <h5>Overview:</h5>
+
 <p>The '<tt>and</tt>' instruction returns the bitwise logical and of
 its two operands.</p>
+
 <h5>Arguments:</h5>
-<p>The two arguments to the '<tt>and</tt>' instruction must be <a
- href="#t_integer">integer</a> values.  Both arguments must have
-identical types.</p>
+
+<p>The two arguments to the '<tt>and</tt>' instruction must be 
+<a href="#t_integer">integer</a> or <a href="#t_vector">vector</a> of integer
+values.  Both arguments must have identical types.</p>
+
 <h5>Semantics:</h5>
 <p>The truth table used for the '<tt>and</tt>' instruction is:</p>
 <p> </p>
@@ -2471,7 +2604,8 @@
 </table>
 </div>
 <h5>Example:</h5>
-<pre>  <result> = and i32 4, %var         <i>; yields {i32}:result = 4 & %var</i>
+<pre>
+  <result> = and i32 4, %var         <i>; yields {i32}:result = 4 & %var</i>
   <result> = and i32 15, 40          <i>; yields {i32}:result = 8</i>
   <result> = and i32 4, 8            <i>; yields {i32}:result = 0</i>
 </pre>
@@ -2486,9 +2620,10 @@
 <p>The '<tt>or</tt>' instruction returns the bitwise logical inclusive
 or of its two operands.</p>
 <h5>Arguments:</h5>
-<p>The two arguments to the '<tt>or</tt>' instruction must be <a
- href="#t_integer">integer</a> values.  Both arguments must have
-identical types.</p>
+
+<p>The two arguments to the '<tt>or</tt>' instruction must be 
+<a href="#t_integer">integer</a> or <a href="#t_vector">vector</a> of integer
+values.  Both arguments must have identical types.</p>
 <h5>Semantics:</h5>
 <p>The truth table used for the '<tt>or</tt>' instruction is:</p>
 <p> </p>
@@ -2541,10 +2676,12 @@
 or of its two operands.  The <tt>xor</tt> is used to implement the
 "one's complement" operation, which is the "~" operator in C.</p>
 <h5>Arguments:</h5>
-<p>The two arguments to the '<tt>xor</tt>' instruction must be <a
- href="#t_integer">integer</a> values.  Both arguments must have
-identical types.</p>
+<p>The two arguments to the '<tt>xor</tt>' instruction must be 
+<a href="#t_integer">integer</a> or <a href="#t_vector">vector</a> of integer
+values.  Both arguments must have identical types.</p>
+
 <h5>Semantics:</h5>
+
 <p>The truth table used for the '<tt>xor</tt>' instruction is:</p>
 <p> </p>
 <div style="align: center">
@@ -2659,7 +2796,7 @@
 <h5>Syntax:</h5>
 
 <pre>
-  <result> = insertelement <n x <ty>> <val>, <ty> <elt&gt, i32 <idx>    <i>; yields <n x <ty>></i>
+  <result> = insertelement <n x <ty>> <val>, <ty> <elt>, i32 <idx>    <i>; yields <n x <ty>></i>
 </pre>
 
 <h5>Overview:</h5>
@@ -2752,6 +2889,114 @@
 
 <!-- ======================================================================= -->
 <div class="doc_subsection"> 
+  <a name="aggregateops">Aggregate Operations</a>
+</div>
+
+<div class="doc_text">
+
+<p>LLVM supports several instructions for working with aggregate values.
+</p>
+
+</div>
+
+<!-- _______________________________________________________________________ -->
+<div class="doc_subsubsection">
+   <a name="i_extractvalue">'<tt>extractvalue</tt>' Instruction</a>
+</div>
+
+<div class="doc_text">
+
+<h5>Syntax:</h5>
+
+<pre>
+  <result> = extractvalue <aggregate type> <val>, <idx>{, <idx>}*
+</pre>
+
+<h5>Overview:</h5>
+
+<p>
+The '<tt>extractvalue</tt>' instruction extracts the value of a struct field
+or array element from an aggregate value.
+</p>
+
+
+<h5>Arguments:</h5>
+
+<p>
+The first operand of an '<tt>extractvalue</tt>' instruction is a
+value of <a href="#t_struct">struct</a> or <a href="#t_array">array</a>
+type.  The operands are constant indices to specify which value to extract
+in a similar manner as indices in a
+'<tt><a href="#i_getelementptr">getelementptr</a></tt>' instruction.
+</p>
+
+<h5>Semantics:</h5>
+
+<p>
+The result is the value at the position in the aggregate specified by
+the index operands.
+</p>
+
+<h5>Example:</h5>
+
+<pre>
+  %result = extractvalue {i32, float} %agg, 0    <i>; yields i32</i>
+</pre>
+</div>
+
+
+<!-- _______________________________________________________________________ -->
+<div class="doc_subsubsection">
+   <a name="i_insertvalue">'<tt>insertvalue</tt>' Instruction</a>
+</div>
+
+<div class="doc_text">
+
+<h5>Syntax:</h5>
+
+<pre>
+  <result> = insertvalue <aggregate type> <val>, <ty> <val>, <idx>    <i>; yields <n x <ty>></i>
+</pre>
+
+<h5>Overview:</h5>
+
+<p>
+The '<tt>insertvalue</tt>' instruction inserts a value
+into a struct field or array element in an aggregate.
+</p>
+
+
+<h5>Arguments:</h5>
+
+<p>
+The first operand of an '<tt>insertvalue</tt>' instruction is a
+value of <a href="#t_struct">struct</a> or <a href="#t_array">array</a> type.
+The second operand is a first-class value to insert.
+The following operands are constant indices
+indicating the position at which to insert the value in a similar manner as
+indices in a
+'<tt><a href="#i_getelementptr">getelementptr</a></tt>' instruction.
+The value to insert must have the same type as the value identified
+by the indices.
+
+<h5>Semantics:</h5>
+
+<p>
+The result is an aggregate of the same type as <tt>val</tt>.  Its
+value is that of <tt>val</tt> except that the value at the position
+specified by the indices is that of <tt>elt</tt>.
+</p>
+
+<h5>Example:</h5>
+
+<pre>
+  %result = insertvalue {i32, float} %agg, i32 1, 0    <i>; yields {i32, float}</i>
+</pre>
+</div>
+
+
+<!-- ======================================================================= -->
+<div class="doc_subsection"> 
   <a name="memoryops">Memory Access and Addressing Operations</a>
 </div>
 
@@ -3005,8 +3250,8 @@
 '<tt>getelementptr</tt>' instruction is used to index down through the type
 levels of a structure or to a specific index in an array.  When indexing into a
 structure, only <tt>i32</tt> integer constants are allowed.  When indexing 
-into an array or pointer, only integers of 32 or 64 bits are allowed, and will 
-be sign extended to 64-bit values.</p>
+into an array or pointer, only integers of 32 or 64 bits are allowed; 32-bit 
+values will be sign extended to 64-bits if required.</p>
 
 <p>For example, let's consider a C code fragment and how it gets
 compiled to LLVM:</p>
@@ -3081,7 +3326,7 @@
 
 <p>Note that it is undefined to access an array out of bounds: array and 
 pointer indexes must always be within the defined bounds of the array type.
-The one exception for this rules is zero length arrays.  These arrays are
+The one exception for this rule is zero length arrays.  These arrays are
 defined to be accessible as variable length arrays, which requires access
 beyond the zero'th element.</p>
 
@@ -3517,15 +3762,19 @@
 </pre>
 
 <h5>Overview:</h5>
+
 <p>The '<tt>bitcast</tt>' instruction converts <tt>value</tt> to type
 <tt>ty2</tt> without changing any bits.</p>
 
 <h5>Arguments:</h5>
+
 <p>The '<tt>bitcast</tt>' instruction takes a value to cast, which must be 
 a first class value, and a type to cast it to, which must also be a <a
   href="#t_firstclass">first class</a> type. The bit sizes of <tt>value</tt>
 and the destination type, <tt>ty2</tt>, must be identical. If the source
-type is a pointer, the destination type must also be a pointer.</p>
+type is a pointer, the destination type must also be a pointer.  This
+instruction supports bitwise conversion of vectors to integers and to vectors
+of other types (as long as they have the same size).</p>
 
 <h5>Semantics:</h5>
 <p>The '<tt>bitcast</tt>' instruction converts <tt>value</tt> to type
@@ -3657,9 +3906,9 @@
 <a href="#t_floating">floating point</a> typed.  They must have identical 
 types.</p>
 <h5>Semantics:</h5>
-<p>The '<tt>fcmp</tt>' compares <tt>var1</tt> and <tt>var2</tt> according to 
-the condition code given as <tt>cond</tt>. The comparison performed always
-yields a <a href="#t_primitive">i1</a> result, as follows: 
+<p>The '<tt>fcmp</tt>' instruction compares <tt>var1</tt> and <tt>var2</tt>
+according to the condition code given as <tt>cond</tt>. The comparison performed 
+always yields a <a href="#t_primitive">i1</a> result, as follows: 
 <ol>
   <li><tt>false</tt>: always yields <tt>false</tt>, regardless of operands.</li>
   <li><tt>oeq</tt>: yields <tt>true</tt> if both operands are not a QNAN and 
@@ -3700,30 +3949,144 @@
 </div>
 
 <!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection"> <a name="i_phi">'<tt>phi</tt>'
-Instruction</a> </div>
+<div class="doc_subsubsection">
+  <a name="i_vicmp">'<tt>vicmp</tt>' Instruction</a>
+</div>
+<div class="doc_text">
+<h5>Syntax:</h5>
+<pre>  <result> = vicmp <cond> <ty> <var1>, <var2>   <i>; yields {ty}:result</i>
+</pre>
+<h5>Overview:</h5>
+<p>The '<tt>vicmp</tt>' instruction returns an integer vector value based on
+element-wise comparison of its two integer vector operands.</p>
+<h5>Arguments:</h5>
+<p>The '<tt>vicmp</tt>' instruction takes three operands. The first operand is
+the condition code indicating the kind of comparison to perform. It is not
+a value, just a keyword. The possible condition code are:
+<ol>
+  <li><tt>eq</tt>: equal</li>
+  <li><tt>ne</tt>: not equal </li>
+  <li><tt>ugt</tt>: unsigned greater than</li>
+  <li><tt>uge</tt>: unsigned greater or equal</li>
+  <li><tt>ult</tt>: unsigned less than</li>
+  <li><tt>ule</tt>: unsigned less or equal</li>
+  <li><tt>sgt</tt>: signed greater than</li>
+  <li><tt>sge</tt>: signed greater or equal</li>
+  <li><tt>slt</tt>: signed less than</li>
+  <li><tt>sle</tt>: signed less or equal</li>
+</ol>
+<p>The remaining two arguments must be <a href="#t_vector">vector</a> of 
+<a href="#t_integer">integer</a> typed. They must also be identical types.</p>
+<h5>Semantics:</h5>
+<p>The '<tt>vicmp</tt>' instruction compares <tt>var1</tt> and <tt>var2</tt>
+according to the condition code given as <tt>cond</tt>. The comparison yields a 
+<a href="#t_vector">vector</a> of <a href="#t_integer">integer</a> result, of
+identical type as the values being compared.  The most significant bit in each
+element is 1 if the element-wise comparison evaluates to true, and is 0
+otherwise.  All other bits of the result are undefined.  The condition codes
+are evaluated identically to the <a href="#i_icmp">'<tt>icmp</tt>'
+instruction</a>.
+
+<h5>Example:</h5>
+<pre>
+  <result> = vicmp eq <2 x i32> < i32 4, i32 0>, < i32 5, i32 0>   <i>; yields: result=<2 x i32> < i32 0, i32 -1 ></i>
+  <result> = vicmp ult <2 x i8 > < i8 1, i8 2>, < i8 2, i8 2 >        <i>; yields: result=<2 x i8> < i8 -1, i8 0 ></i>
+</pre>
+</div>
+
+<!-- _______________________________________________________________________ -->
+<div class="doc_subsubsection">
+  <a name="i_vfcmp">'<tt>vfcmp</tt>' Instruction</a>
+</div>
+<div class="doc_text">
+<h5>Syntax:</h5>
+<pre>  <result> = vfcmp <cond> <ty> <var1>, <var2></pre>
+<h5>Overview:</h5>
+<p>The '<tt>vfcmp</tt>' instruction returns an integer vector value based on
+element-wise comparison of its two floating point vector operands.  The output
+elements have the same width as the input elements.</p>
+<h5>Arguments:</h5>
+<p>The '<tt>vfcmp</tt>' instruction takes three operands. The first operand is
+the condition code indicating the kind of comparison to perform. It is not
+a value, just a keyword. The possible condition code are:
+<ol>
+  <li><tt>false</tt>: no comparison, always returns false</li>
+  <li><tt>oeq</tt>: ordered and equal</li>
+  <li><tt>ogt</tt>: ordered and greater than </li>
+  <li><tt>oge</tt>: ordered and greater than or equal</li>
+  <li><tt>olt</tt>: ordered and less than </li>
+  <li><tt>ole</tt>: ordered and less than or equal</li>
+  <li><tt>one</tt>: ordered and not equal</li>
+  <li><tt>ord</tt>: ordered (no nans)</li>
+  <li><tt>ueq</tt>: unordered or equal</li>
+  <li><tt>ugt</tt>: unordered or greater than </li>
+  <li><tt>uge</tt>: unordered or greater than or equal</li>
+  <li><tt>ult</tt>: unordered or less than </li>
+  <li><tt>ule</tt>: unordered or less than or equal</li>
+  <li><tt>une</tt>: unordered or not equal</li>
+  <li><tt>uno</tt>: unordered (either nans)</li>
+  <li><tt>true</tt>: no comparison, always returns true</li>
+</ol>
+<p>The remaining two arguments must be <a href="#t_vector">vector</a> of 
+<a href="#t_floating">floating point</a> typed. They must also be identical
+types.</p>
+<h5>Semantics:</h5>
+<p>The '<tt>vfcmp</tt>' instruction compares <tt>var1</tt> and <tt>var2</tt>
+according to  the condition code given as <tt>cond</tt>. The comparison yields a 
+<a href="#t_vector">vector</a> of <a href="#t_integer">integer</a> result, with
+an identical number of elements as the values being compared, and each element
+having identical with to the width of the floating point elements. The most 
+significant bit in each element is 1 if the element-wise comparison evaluates to
+true, and is 0 otherwise.  All other bits of the result are undefined.  The
+condition codes are evaluated identically to the 
+<a href="#i_fcmp">'<tt>fcmp</tt>' instruction</a>.
+
+<h5>Example:</h5>
+<pre>
+  <result> = vfcmp oeq <2 x float> < float 4, float 0 >, < float 5, float 0 >       <i>; yields: result=<2 x i32> < i32 0, i32 -1 ></i>
+  <result> = vfcmp ult <2 x double> < double 1, double 2 >, < double 2, double 2>   <i>; yields: result=<2 x i64> < i64 -1, i64 0 ></i>
+</pre>
+</div>
+
+<!-- _______________________________________________________________________ -->
+<div class="doc_subsubsection">
+  <a name="i_phi">'<tt>phi</tt>' Instruction</a>
+</div>
+
 <div class="doc_text">
+
 <h5>Syntax:</h5>
+
 <pre>  <result> = phi <ty> [ <val0>, <label0>], ...<br></pre>
 <h5>Overview:</h5>
 <p>The '<tt>phi</tt>' instruction is used to implement the φ node in
 the SSA graph representing the function.</p>
 <h5>Arguments:</h5>
+
 <p>The type of the incoming values is specified with the first type
 field. After this, the '<tt>phi</tt>' instruction takes a list of pairs
 as arguments, with one pair for each predecessor basic block of the
 current block.  Only values of <a href="#t_firstclass">first class</a>
 type may be used as the value arguments to the PHI node.  Only labels
 may be used as the label arguments.</p>
+
 <p>There must be no non-phi instructions between the start of a basic
 block and the PHI instructions: i.e. PHI instructions must be first in
 a basic block.</p>
+
 <h5>Semantics:</h5>
+
 <p>At runtime, the '<tt>phi</tt>' instruction logically takes on the value
 specified by the pair corresponding to the predecessor basic block that executed
 just prior to the current block.</p>
+
 <h5>Example:</h5>
-<pre>Loop:       ; Infinite loop that counts from 0 on up...<br>  %indvar = phi i32 [ 0, %LoopHeader ], [ %nextindvar, %Loop ]<br>  %nextindvar = add i32 %indvar, 1<br>  br label %Loop<br></pre>
+<pre>
+Loop:       ; Infinite loop that counts from 0 on up...
+  %indvar = phi i32 [ 0, %LoopHeader ], [ %nextindvar, %Loop ]
+  %nextindvar = add i32 %indvar, 1
+  br label %Loop
+</pre>
 </div>
 
 <!-- _______________________________________________________________________ -->
@@ -3750,13 +4113,16 @@
 <h5>Arguments:</h5>
 
 <p>
-The '<tt>select</tt>' instruction requires a boolean value indicating the condition, and two values of the same <a href="#t_firstclass">first class</a> type.
+The '<tt>select</tt>' instruction requires an 'i1' value indicating the
+condition, and two values of the same <a href="#t_firstclass">first class</a>
+type.  If the val1/val2 are vectors, the entire vectors are selected, not
+individual elements.
 </p>
 
 <h5>Semantics:</h5>
 
 <p>
-If the boolean condition evaluates to true, the instruction returns the first
+If the i1 condition evaluates is 1, the instruction returns the first
 value argument; otherwise, it returns the second value argument.
 </p>
 
@@ -3925,9 +4291,10 @@
 <h5>Arguments:</h5>
 
 <p>The '<tt>getresult</tt>' instruction takes a call or invoke value as its 
-first argument.  The value must have <a href="#t_struct">structure type</a>. 
-The second argument is a constant unsigned index value which must be in range for
-the number of values returned by the call.</p>
+first argument, or an undef value.  The value must have <a 
+href="#t_struct">structure type</a>.  The second argument is a constant 
+unsigned index value which must be in range for the number of values returned 
+by the call.</p>
 
 <h5>Semantics:</h5>
 
@@ -4191,7 +4558,7 @@
 
 <h5>Semantics:</h5>
 
-<p>At runtime, a call to this intrinsics stores a null pointer into the "ptrloc"
+<p>At runtime, a call to this intrinsic stores a null pointer into the "ptrloc"
 location.  At compile-time, the code generator generates information to allow
 the runtime to find the pointer at GC safe points. The '<tt>llvm.gcroot</tt>'
 intrinsic may only be used in a function which <a href="#gc">specifies a GC
@@ -5419,19 +5786,19 @@
 
 <!-- _______________________________________________________________________ -->
 <div class="doc_subsubsection">
-  <a name="int_atomic_lcs">'<tt>llvm.atomic.lcs.*</tt>' Intrinsic</a>
+  <a name="int_atomic_cmp_swap">'<tt>llvm.atomic.cmp.swap.*</tt>' Intrinsic</a>
 </div>
 <div class="doc_text">
 <h5>Syntax:</h5>
 <p>
-  This is an overloaded intrinsic. You can use <tt>llvm.atomic.lcs</tt> on any 
+  This is an overloaded intrinsic. You can use <tt>llvm.atomic.cmp.swap</tt> on any 
   integer bit width. Not all targets support all bit widths however.</p>
 
 <pre>
-declare i8 @llvm.atomic.lcs.i8( i8* <ptr>, i8 <cmp>, i8 <val> )
-declare i16 @llvm.atomic.lcs.i16( i16* <ptr>, i16 <cmp>, i16 <val> )
-declare i32 @llvm.atomic.lcs.i32( i32* <ptr>, i32 <cmp>, i32 <val> )
-declare i64 @llvm.atomic.lcs.i64( i64* <ptr>, i64 <cmp>, i64 <val> )
+declare i8 @llvm.atomic.cmp.swap.i8( i8* <ptr>, i8 <cmp>, i8 <val> )
+declare i16 @llvm.atomic.cmp.swap.i16( i16* <ptr>, i16 <cmp>, i16 <val> )
+declare i32 @llvm.atomic.cmp.swap.i32( i32* <ptr>, i32 <cmp>, i32 <val> )
+declare i64 @llvm.atomic.cmp.swap.i64( i64* <ptr>, i64 <cmp>, i64 <val> )
 
 </pre>
 <h5>Overview:</h5>
@@ -5441,7 +5808,7 @@
 </p>
 <h5>Arguments:</h5>
 <p>
-  The <tt>llvm.atomic.lcs</tt> intrinsic takes three arguments. The result as 
+  The <tt>llvm.atomic.cmp.swap</tt> intrinsic takes three arguments. The result as 
   well as both <tt>cmp</tt> and <tt>val</tt> must be integer values with the 
   same bit width. The <tt>ptr</tt> argument must be a pointer to a value of 
   this integer type. While any bit width integer may be used, targets may only 
@@ -5463,13 +5830,13 @@
             store i32 4, %ptr
 
 %val1     = add i32 4, 4
-%result1  = call i32 @llvm.atomic.lcs.i32( i32* %ptr, i32 4, %val1 )
+%result1  = call i32 @llvm.atomic.cmp.swap.i32( i32* %ptr, i32 4, %val1 )
                                           <i>; yields {i32}:result1 = 4</i>
 %stored1  = icmp eq i32 %result1, 4       <i>; yields {i1}:stored1 = true</i>
 %memval1  = load i32* %ptr                <i>; yields {i32}:memval1 = 8</i>
 
 %val2     = add i32 1, 1
-%result2  = call i32 @llvm.atomic.lcs.i32( i32* %ptr, i32 5, %val2 )
+%result2  = call i32 @llvm.atomic.cmp.swap.i32( i32* %ptr, i32 5, %val2 )
                                           <i>; yields {i32}:result2 = 8</i>
 %stored2  = icmp eq i32 %result2, 5       <i>; yields {i1}:stored2 = false</i>
 
@@ -5503,7 +5870,7 @@
 <h5>Arguments:</h5>
 
 <p>
-  The <tt>llvm.atomic.ls</tt> intrinsic takes two arguments. Both the 
+  The <tt>llvm.atomic.swap</tt> intrinsic takes two arguments. Both the 
   <tt>val</tt> argument and the result must be integers of the same bit width. 
   The first argument, <tt>ptr</tt>, must be a pointer to a value of this 
   integer type. The targets may only lower integer representations they 
@@ -5538,19 +5905,19 @@
 
 <!-- _______________________________________________________________________ -->
 <div class="doc_subsubsection">
-  <a name="int_atomic_las">'<tt>llvm.atomic.las.*</tt>' Intrinsic</a>
+  <a name="int_atomic_load_add">'<tt>llvm.atomic.load.add.*</tt>' Intrinsic</a>
 
 </div>
 <div class="doc_text">
 <h5>Syntax:</h5>
 <p>
-  This is an overloaded intrinsic. You can use <tt>llvm.atomic.las</tt> on any 
+  This is an overloaded intrinsic. You can use <tt>llvm.atomic.load.add</tt> on any 
   integer bit width. Not all targets support all bit widths however.</p>
 <pre>
-declare i8 @llvm.atomic.las.i8.( i8* <ptr>, i8 <delta> )
-declare i16 @llvm.atomic.las.i16.( i16* <ptr>, i16 <delta> )
-declare i32 @llvm.atomic.las.i32.( i32* <ptr>, i32 <delta> )
-declare i64 @llvm.atomic.las.i64.( i64* <ptr>, i64 <delta> )
+declare i8 @llvm.atomic.load.add.i8.( i8* <ptr>, i8 <delta> )
+declare i16 @llvm.atomic.load.add.i16.( i16* <ptr>, i16 <delta> )
+declare i32 @llvm.atomic.load.add.i32.( i32* <ptr>, i32 <delta> )
+declare i64 @llvm.atomic.load.add.i64.( i64* <ptr>, i64 <delta> )
 
 </pre>
 <h5>Overview:</h5>
@@ -5577,17 +5944,236 @@
 <pre>
 %ptr      = malloc i32
         store i32 4, %ptr
-%result1  = call i32 @llvm.atomic.las.i32( i32* %ptr, i32 4 )
+%result1  = call i32 @llvm.atomic.load.add.i32( i32* %ptr, i32 4 )
                                 <i>; yields {i32}:result1 = 4</i>
-%result2  = call i32 @llvm.atomic.las.i32( i32* %ptr, i32 2 )
+%result2  = call i32 @llvm.atomic.load.add.i32( i32* %ptr, i32 2 )
                                 <i>; yields {i32}:result2 = 8</i>
-%result3  = call i32 @llvm.atomic.las.i32( i32* %ptr, i32 5 )
+%result3  = call i32 @llvm.atomic.load.add.i32( i32* %ptr, i32 5 )
                                 <i>; yields {i32}:result3 = 10</i>
-%memval   = load i32* %ptr      <i>; yields {i32}:memval1 = 15</i>
+%memval1  = load i32* %ptr      <i>; yields {i32}:memval1 = 15</i>
+</pre>
+</div>
+
+<!-- _______________________________________________________________________ -->
+<div class="doc_subsubsection">
+  <a name="int_atomic_load_sub">'<tt>llvm.atomic.load.sub.*</tt>' Intrinsic</a>
+
+</div>
+<div class="doc_text">
+<h5>Syntax:</h5>
+<p>
+  This is an overloaded intrinsic. You can use <tt>llvm.atomic.load.sub</tt> on
+  any integer bit width. Not all targets support all bit widths however.</p>
+<pre>
+declare i8 @llvm.atomic.load.sub.i8.( i8* <ptr>, i8 <delta> )
+declare i16 @llvm.atomic.load.sub.i16.( i16* <ptr>, i16 <delta> )
+declare i32 @llvm.atomic.load.sub.i32.( i32* <ptr>, i32 <delta> )
+declare i64 @llvm.atomic.load.sub.i64.( i64* <ptr>, i64 <delta> )
+
+</pre>
+<h5>Overview:</h5>
+<p>
+  This intrinsic subtracts <tt>delta</tt> to the value stored in memory at 
+  <tt>ptr</tt>. It yields the original value at <tt>ptr</tt>.
+</p>
+<h5>Arguments:</h5>
+<p>
+
+  The intrinsic takes two arguments, the first a pointer to an integer value 
+  and the second an integer value. The result is also an integer value. These 
+  integer types can have any bit width, but they must all have the same bit 
+  width. The targets may only lower integer representations they support.
+</p>
+<h5>Semantics:</h5>
+<p>
+  This intrinsic does a series of operations atomically. It first loads the 
+  value stored at <tt>ptr</tt>. It then subtracts <tt>delta</tt>, stores the
+  result to <tt>ptr</tt>. It yields the original value stored at <tt>ptr</tt>.
+</p>
+
+<h5>Examples:</h5>
+<pre>
+%ptr      = malloc i32
+        store i32 8, %ptr
+%result1  = call i32 @llvm.atomic.load.sub.i32( i32* %ptr, i32 4 )
+                                <i>; yields {i32}:result1 = 8</i>
+%result2  = call i32 @llvm.atomic.load.sub.i32( i32* %ptr, i32 2 )
+                                <i>; yields {i32}:result2 = 4</i>
+%result3  = call i32 @llvm.atomic.load.sub.i32( i32* %ptr, i32 5 )
+                                <i>; yields {i32}:result3 = 2</i>
+%memval1  = load i32* %ptr      <i>; yields {i32}:memval1 = -3</i>
+</pre>
+</div>
+
+<!-- _______________________________________________________________________ -->
+<div class="doc_subsubsection">
+  <a name="int_atomic_load_and">'<tt>llvm.atomic.load.and.*</tt>' Intrinsic</a><br>
+  <a name="int_atomic_load_nand">'<tt>llvm.atomic.load.nand.*</tt>' Intrinsic</a><br>
+  <a name="int_atomic_load_or">'<tt>llvm.atomic.load.or.*</tt>' Intrinsic</a><br>
+  <a name="int_atomic_load_xor">'<tt>llvm.atomic.load.xor.*</tt>' Intrinsic</a><br>
+
+</div>
+<div class="doc_text">
+<h5>Syntax:</h5>
+<p>
+  These are overloaded intrinsics. You can use <tt>llvm.atomic.load_and</tt>,
+  <tt>llvm.atomic.load_nand</tt>, <tt>llvm.atomic.load_or</tt>, and
+  <tt>llvm.atomic.load_xor</tt> on any integer bit width. Not all targets
+  support all bit widths however.</p>
+<pre>
+declare i8 @llvm.atomic.load.and.i8.( i8* <ptr>, i8 <delta> )
+declare i16 @llvm.atomic.load.and.i16.( i16* <ptr>, i16 <delta> )
+declare i32 @llvm.atomic.load.and.i32.( i32* <ptr>, i32 <delta> )
+declare i64 @llvm.atomic.load.and.i64.( i64* <ptr>, i64 <delta> )
+
+</pre>
+
+<pre>
+declare i8 @llvm.atomic.load.or.i8.( i8* <ptr>, i8 <delta> )
+declare i16 @llvm.atomic.load.or.i16.( i16* <ptr>, i16 <delta> )
+declare i32 @llvm.atomic.load.or.i32.( i32* <ptr>, i32 <delta> )
+declare i64 @llvm.atomic.load.or.i64.( i64* <ptr>, i64 <delta> )
+
+</pre>
+
+<pre>
+declare i8 @llvm.atomic.load.nand.i8.( i8* <ptr>, i8 <delta> )
+declare i16 @llvm.atomic.load.nand.i16.( i16* <ptr>, i16 <delta> )
+declare i32 @llvm.atomic.load.nand.i32.( i32* <ptr>, i32 <delta> )
+declare i64 @llvm.atomic.load.nand.i64.( i64* <ptr>, i64 <delta> )
+
+</pre>
+
+<pre>
+declare i8 @llvm.atomic.load.xor.i8.( i8* <ptr>, i8 <delta> )
+declare i16 @llvm.atomic.load.xor.i16.( i16* <ptr>, i16 <delta> )
+declare i32 @llvm.atomic.load.xor.i32.( i32* <ptr>, i32 <delta> )
+declare i64 @llvm.atomic.load.xor.i64.( i64* <ptr>, i64 <delta> )
+
+</pre>
+<h5>Overview:</h5>
+<p>
+  These intrinsics bitwise the operation (and, nand, or, xor) <tt>delta</tt> to
+  the value stored in memory at <tt>ptr</tt>. It yields the original value
+  at <tt>ptr</tt>.
+</p>
+<h5>Arguments:</h5>
+<p>
+
+  These intrinsics take two arguments, the first a pointer to an integer value 
+  and the second an integer value. The result is also an integer value. These 
+  integer types can have any bit width, but they must all have the same bit 
+  width. The targets may only lower integer representations they support.
+</p>
+<h5>Semantics:</h5>
+<p>
+  These intrinsics does a series of operations atomically. They first load the 
+  value stored at <tt>ptr</tt>. They then do the bitwise operation
+  <tt>delta</tt>, store the result to <tt>ptr</tt>. They yield the original
+  value stored at <tt>ptr</tt>.
+</p>
+
+<h5>Examples:</h5>
+<pre>
+%ptr      = malloc i32
+        store i32 0x0F0F, %ptr
+%result0  = call i32 @llvm.atomic.load.nand.i32( i32* %ptr, i32 0xFF )
+                                <i>; yields {i32}:result0 = 0x0F0F</i>
+%result1  = call i32 @llvm.atomic.load.and.i32( i32* %ptr, i32 0xFF )
+                                <i>; yields {i32}:result1 = 0xFFFFFFF0</i>
+%result2  = call i32 @llvm.atomic.load.or.i32( i32* %ptr, i32 0F )
+                                <i>; yields {i32}:result2 = 0xF0</i>
+%result3  = call i32 @llvm.atomic.load.xor.i32( i32* %ptr, i32 0F )
+                                <i>; yields {i32}:result3 = FF</i>
+%memval1  = load i32* %ptr      <i>; yields {i32}:memval1 = F0</i>
 </pre>
 </div>
 
 
+<!-- _______________________________________________________________________ -->
+<div class="doc_subsubsection">
+  <a name="int_atomic_load_max">'<tt>llvm.atomic.load.max.*</tt>' Intrinsic</a><br>
+  <a name="int_atomic_load_min">'<tt>llvm.atomic.load.min.*</tt>' Intrinsic</a><br>
+  <a name="int_atomic_load_umax">'<tt>llvm.atomic.load.umax.*</tt>' Intrinsic</a><br>
+  <a name="int_atomic_load_umin">'<tt>llvm.atomic.load.umin.*</tt>' Intrinsic</a><br>
+
+</div>
+<div class="doc_text">
+<h5>Syntax:</h5>
+<p>
+  These are overloaded intrinsics. You can use <tt>llvm.atomic.load_max</tt>,
+  <tt>llvm.atomic.load_min</tt>, <tt>llvm.atomic.load_umax</tt>, and
+  <tt>llvm.atomic.load_umin</tt> on any integer bit width. Not all targets
+  support all bit widths however.</p>
+<pre>
+declare i8 @llvm.atomic.load.max.i8.( i8* <ptr>, i8 <delta> )
+declare i16 @llvm.atomic.load.max.i16.( i16* <ptr>, i16 <delta> )
+declare i32 @llvm.atomic.load.max.i32.( i32* <ptr>, i32 <delta> )
+declare i64 @llvm.atomic.load.max.i64.( i64* <ptr>, i64 <delta> )
+
+</pre>
+
+<pre>
+declare i8 @llvm.atomic.load.min.i8.( i8* <ptr>, i8 <delta> )
+declare i16 @llvm.atomic.load.min.i16.( i16* <ptr>, i16 <delta> )
+declare i32 @llvm.atomic.load.min.i32.( i32* <ptr>, i32 <delta> )
+declare i64 @llvm.atomic.load.min.i64.( i64* <ptr>, i64 <delta> )
+
+</pre>
+
+<pre>
+declare i8 @llvm.atomic.load.umax.i8.( i8* <ptr>, i8 <delta> )
+declare i16 @llvm.atomic.load.umax.i16.( i16* <ptr>, i16 <delta> )
+declare i32 @llvm.atomic.load.umax.i32.( i32* <ptr>, i32 <delta> )
+declare i64 @llvm.atomic.load.umax.i64.( i64* <ptr>, i64 <delta> )
+
+</pre>
+
+<pre>
+declare i8 @llvm.atomic.load.umin.i8.( i8* <ptr>, i8 <delta> )
+declare i16 @llvm.atomic.load.umin.i16.( i16* <ptr>, i16 <delta> )
+declare i32 @llvm.atomic.load.umin.i32.( i32* <ptr>, i32 <delta> )
+declare i64 @llvm.atomic.load.umin.i64.( i64* <ptr>, i64 <delta> )
+
+</pre>
+<h5>Overview:</h5>
+<p>
+  These intrinsics takes the signed or unsigned minimum or maximum of 
+  <tt>delta</tt> and the value stored in memory at <tt>ptr</tt>. It yields the
+  original value at <tt>ptr</tt>.
+</p>
+<h5>Arguments:</h5>
+<p>
+
+  These intrinsics take two arguments, the first a pointer to an integer value 
+  and the second an integer value. The result is also an integer value. These 
+  integer types can have any bit width, but they must all have the same bit 
+  width. The targets may only lower integer representations they support.
+</p>
+<h5>Semantics:</h5>
+<p>
+  These intrinsics does a series of operations atomically. They first load the 
+  value stored at <tt>ptr</tt>. They then do the signed or unsigned min or max
+  <tt>delta</tt> and the value, store the result to <tt>ptr</tt>. They yield
+  the original value stored at <tt>ptr</tt>.
+</p>
+
+<h5>Examples:</h5>
+<pre>
+%ptr      = malloc i32
+        store i32 7, %ptr
+%result0  = call i32 @llvm.atomic.load.min.i32( i32* %ptr, i32 -2 )
+                                <i>; yields {i32}:result0 = 7</i>
+%result1  = call i32 @llvm.atomic.load.max.i32( i32* %ptr, i32 8 )
+                                <i>; yields {i32}:result1 = -2</i>
+%result2  = call i32 @llvm.atomic.load.umin.i32( i32* %ptr, i32 10 )
+                                <i>; yields {i32}:result2 = 8</i>
+%result3  = call i32 @llvm.atomic.load.umax.i32( i32* %ptr, i32 30 )
+                                <i>; yields {i32}:result3 = 8</i>
+%memval1  = load i32* %ptr      <i>; yields {i32}:memval1 = 30</i>
+</pre>
+</div>
+
 <!-- ======================================================================= -->
 <div class="doc_subsection">
   <a name="int_general">General Intrinsics</a>

Modified: llvm/branches/non-call-eh/docs/Passes.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/Passes.html?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/Passes.html (original)
+++ llvm/branches/non-call-eh/docs/Passes.html Sun Jul  6 15:45:41 2008
@@ -116,7 +116,7 @@
 <tr><td><a href="#argpromotion">-argpromotion</a></td><td>Promote 'by reference' arguments to scalars</td></tr>
 <tr><td><a href="#block-placement">-block-placement</a></td><td>Profile Guided Basic Block Placement</td></tr>
 <tr><td><a href="#break-crit-edges">-break-crit-edges</a></td><td>Break critical edges in CFG</td></tr>
-<tr><td><a href="#cee">-cee</a></td><td>Correlated Expression Elimination</td></tr>
+<tr><td><a href="#codegenprepare">-codegenprepare</a></td><td>Prepare a function for code generation </td></tr>
 <tr><td><a href="#condprop">-condprop</a></td><td>Conditional Propagation</td></tr>
 <tr><td><a href="#constmerge">-constmerge</a></td><td>Merge Duplicate Global Constants</td></tr>
 <tr><td><a href="#constprop">-constprop</a></td><td>Simple constant propagation</td></tr>
@@ -142,8 +142,10 @@
 <tr><td><a href="#internalize">-internalize</a></td><td>Internalize Global Symbols</td></tr>
 <tr><td><a href="#ipconstprop">-ipconstprop</a></td><td>Interprocedural constant propagation</td></tr>
 <tr><td><a href="#ipsccp">-ipsccp</a></td><td>Interprocedural Sparse Conditional Constant Propagation</td></tr>
+<tr><td><a href="#jump-threading">-jump-threading</a></td><td>Thread control through conditional blocks </td></tr>
 <tr><td><a href="#lcssa">-lcssa</a></td><td>Loop-Closed SSA Form Pass</td></tr>
 <tr><td><a href="#licm">-licm</a></td><td>Loop Invariant Code Motion</td></tr>
+<tr><td><a href="#loop-deletion">-loop-deletion</a></td><td>Dead Loop Deletion Pass </td></tr>
 <tr><td><a href="#loop-extract">-loop-extract</a></td><td>Extract loops into new functions</td></tr>
 <tr><td><a href="#loop-extract-single">-loop-extract-single</a></td><td>Extract at most one loop into a new function</td></tr>
 <tr><td><a href="#loop-index-split">-loop-index-split</a></td><td>Index Split Loops</td></tr>
@@ -152,14 +154,12 @@
 <tr><td><a href="#loop-unroll">-loop-unroll</a></td><td>Unroll loops</td></tr>
 <tr><td><a href="#loop-unswitch">-loop-unswitch</a></td><td>Unswitch loops</td></tr>
 <tr><td><a href="#loopsimplify">-loopsimplify</a></td><td>Canonicalize natural loops</td></tr>
-<tr><td><a href="#lower-packed">-lower-packed</a></td><td>lowers packed operations to operations on smaller packed datatypes</td></tr>
 <tr><td><a href="#lowerallocs">-lowerallocs</a></td><td>Lower allocations from instructions to calls</td></tr>
-<tr><td><a href="#lowergc">-lowergc</a></td><td>Lower GC intrinsics, for GCless code generators</td></tr>
 <tr><td><a href="#lowerinvoke">-lowerinvoke</a></td><td>Lower invoke and unwind, for unwindless code generators</td></tr>
-<tr><td><a href="#lowerselect">-lowerselect</a></td><td>Lower select instructions to branches</td></tr>
 <tr><td><a href="#lowersetjmp">-lowersetjmp</a></td><td>Lower Set Jump</td></tr>
 <tr><td><a href="#lowerswitch">-lowerswitch</a></td><td>Lower SwitchInst's to branches</td></tr>
 <tr><td><a href="#mem2reg">-mem2reg</a></td><td>Promote Memory to Register</td></tr>
+<tr><td><a href="#memcpyopt">-memcpyopt</a></td><td>Optimize use of memcpy and friends</td></tr>
 <tr><td><a href="#mergereturn">-mergereturn</a></td><td>Unify function exit nodes</td></tr>
 <tr><td><a href="#predsimplify">-predsimplify</a></td><td>Predicate Simplifier</td></tr>
 <tr><td><a href="#prune-eh">-prune-eh</a></td><td>Remove unused exception handling info</td></tr>
@@ -171,6 +171,8 @@
 <tr><td><a href="#simplify-libcalls">-simplify-libcalls</a></td><td>Simplify well-known library calls</td></tr>
 <tr><td><a href="#simplifycfg">-simplifycfg</a></td><td>Simplify the CFG</td></tr>
 <tr><td><a href="#strip">-strip</a></td><td>Strip all symbols from a module</td></tr>
+<tr><td><a href="#strip-dead-prototypes">-strip-dead-prototypes</a></td><td>Remove unused function declarations</td></tr>
+<tr><td><a href="#sretpromotion">-sretpromotion</a></td><td>Promote sret arguments</td></tr>
 <tr><td><a href="#tailcallelim">-tailcallelim</a></td><td>Tail Call Elimination</td></tr>
 <tr><td><a href="#tailduplicate">-tailduplicate</a></td><td>Tail Duplication</td></tr>
 
@@ -296,7 +298,7 @@
 
 <!-------------------------------------------------------------------------- -->
 <div class="doc_subsection">
-  <a name="basicvn">Basic Value Numbering (default GVN impl)</a>
+  <a name="basicvn">Basic Value Numbering (default Value Numbering impl)</a>
 </div>
 <div class="doc_text">
   <p>
@@ -305,6 +307,12 @@
   lexically identical expressions.  This does not require any ahead of time
   analysis, so it is a very fast default implementation.
   </p>
+  <p>
+  The ValueNumbering analysis passes are mostly deprecated. They are only used
+  by the <a href="#gcse">Global Common Subexpression Elimination pass</a>, which
+  is deprecated by the <a href="#gvn">Global Value Numbering pass</a> (which
+  does its value numbering on its own).
+  </p>
 </div>
 
 <!-------------------------------------------------------------------------- -->
@@ -739,27 +747,12 @@
 
 <!-------------------------------------------------------------------------- -->
 <div class="doc_subsection">
-  <a name="cee">Correlated Expression Elimination</a>
+  <a name="codegenprepare">Prepare a function for code generation</a>
 </div>
 <div class="doc_text">
-  <p>Correlated Expression Elimination propagates information from conditional
-  branches to blocks dominated by destinations of the branch.  It propagates
-  information from the condition check itself into the body of the branch,
-  allowing transformations like these for example:</p>
-  
-<blockquote><pre>
-if (i == 7)
-  ... 4*i;  // constant propagation
-
-M = i+1; N = j+1;
-if (i == j)
-  X = M-N;  // = M-M == 0;
-</pre></blockquote>
-
-   <p>This is called Correlated Expression Elimination because we eliminate or
-   simplify expressions that are correlated with the direction of a branch. In
-   this way we use static information to give us some information about the
-   dynamic value of a variable.</p>
+  This pass munges the code in the input function to better prepare it for
+  SelectionDAG-based code generation. This works around limitations in it's
+  basic-block-at-a-time approach. It should eventually be removed.
 </div>
 
 <!-------------------------------------------------------------------------- -->
@@ -872,9 +865,13 @@
   <p>
   This pass is designed to be a very quick global transformation that
   eliminates global common subexpressions from a function.  It does this by
-  using an existing value numbering implementation to identify the common
+  using an existing value numbering analysis pass to identify the common
   subexpressions, eliminating them when possible.
   </p>
+  <p>
+  This pass is deprecated by the <a href="#gvn">Global Value Numbering pass</a>
+  (which does a better job with its own value numbering).
+  </p>
 </div>
 
 <!-------------------------------------------------------------------------- -->
@@ -912,6 +909,10 @@
   This pass performs global value numbering to eliminate fully redundant
   instructions.  It also performs simple dead load elimination.
   </p>
+  <p>
+  Note that this pass does the value numbering itself, it does not use the
+  ValueNumbering analysis passes.
+  </p>
 </div>
 
 <!-------------------------------------------------------------------------- -->
@@ -929,6 +930,10 @@
   live ranges, and should be used with caution on platforms that are very 
   sensitive to register pressure.
   </p>
+  <p>
+  Note that this pass does the value numbering itself, it does not use the
+  ValueNumbering analysis passes.
+  </p>
 </div>
 
 <!-------------------------------------------------------------------------- -->
@@ -1183,6 +1188,35 @@
 
 <!-------------------------------------------------------------------------- -->
 <div class="doc_subsection">
+  <a name="jump-threading">Thread control through conditional blocks</a>
+</div>
+<div class="doc_text">
+  <p>
+  Jump threading tries to find distinct threads of control flow running through
+  a basic block. This pass looks at blocks that have multiple predecessors and
+  multiple successors.  If one or more of the predecessors of the block can be
+  proven to always cause a jump to one of the successors, we forward the edge
+  from the predecessor to the successor by duplicating the contents of this
+  block.
+  </p>
+  <p>
+  An example of when this can occur is code like this:
+  </p>
+
+  <pre
+>if () { ...
+  X = 4;
+}
+if (X < 3) {</pre>
+
+  <p>
+  In this case, the unconditional branch at the end of the first if can be
+  revectored to the false side of the second if.
+  </p>
+</div>
+
+<!-------------------------------------------------------------------------- -->
+<div class="doc_subsection">
   <a name="lcssa">Loop-Closed SSA Form Pass</a>
 </div>
 <div class="doc_text">
@@ -1246,6 +1280,18 @@
         variable.</li>
   </ul>
 </div>
+<!-------------------------------------------------------------------------- -->
+<div class="doc_subsection">
+  <a name="loop-deletion">Dead Loop Deletion Pass</a>
+</div>
+<div class="doc_text">
+  <p>
+  This file implements the Dead Loop Deletion Pass.  This pass is responsible
+  for eliminating loops with non-infinite computable trip counts that have no
+  side effects or volatile instructions, and do not contribute to the
+  computation of the function's return value.
+  </p>
+</div>
 
 <!-------------------------------------------------------------------------- -->
 <div class="doc_subsection">
@@ -1390,17 +1436,6 @@
 
 <!-------------------------------------------------------------------------- -->
 <div class="doc_subsection">
-  <a name="lower-packed">lowers packed operations to operations on smaller packed datatypes</a>
-</div>
-<div class="doc_text">
-  <p>
-  Lowers operations on vector datatypes into operations on more primitive vector
-  datatypes, and finally to scalar operations.
-  </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
   <a name="lowerallocs">Lower allocations from instructions to calls</a>
 </div>
 <div class="doc_text">
@@ -1417,29 +1452,6 @@
 
 <!-------------------------------------------------------------------------- -->
 <div class="doc_subsection">
-  <a name="lowergc">Lower GC intrinsics, for GCless code generators</a>
-</div>
-<div class="doc_text">
-  <p>
-  This file implements lowering for the <tt>llvm.gc*</tt> intrinsics for targets 
-  that do not natively support them (which includes the C backend).  Note that
-  the code generated is not as efficient as it would be for targets that
-  natively support the GC intrinsics, but it is useful for getting new targets
-  up-and-running quickly.
-  </p>
-  
-  <p>
-  This pass implements the code transformation described in this paper:
-  </p>
-  
-  <blockquote><p>
-    "Accurate Garbage Collection in an Uncooperative Environment"
-    Fergus Henderson, ISMM, 2002
-  </p></blockquote>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
   <a name="lowerinvoke">Lower invoke and unwind, for unwindless code generators</a>
 </div>
 <div class="doc_text">
@@ -1481,25 +1493,6 @@
 
 <!-------------------------------------------------------------------------- -->
 <div class="doc_subsection">
-  <a name="lowerselect">Lower select instructions to branches</a>
-</div>
-<div class="doc_text">
-  <p>
-  Lowers select instructions into conditional branches for targets that do not 
-  have conditional moves or that have not implemented the select instruction
-  yet.
-  </p>
-  
-  <p>
-  Note that this pass could be improved.  In particular it turns every select
-  instruction into a new conditional branch, even though some common cases have
-  select instructions on the same predicate next to each other.  It would be
-  better to use the same branch for the whole group of selects.
-  </p>
-</div>
-
-<!-------------------------------------------------------------------------- -->
-<div class="doc_subsection">
   <a name="lowersetjmp">Lower Set Jump</a>
 </div>
 <div class="doc_text">
@@ -1557,6 +1550,17 @@
 
 <!-------------------------------------------------------------------------- -->
 <div class="doc_subsection">
+  <a name="memcpyopt">Optimize use of memcpy and friend</a>
+</div>
+<div class="doc_text">
+  <p>
+  This pass performs various transformations related to eliminating memcpy
+  calls, or transforming sets of stores into memset's.
+  </p>
+</div>
+
+<!-------------------------------------------------------------------------- -->
+<div class="doc_subsection">
   <a name="mergereturn">Unify function exit nodes</a>
 </div>
 <div class="doc_text">
@@ -1753,6 +1757,42 @@
 
 <!-------------------------------------------------------------------------- -->
 <div class="doc_subsection">
+  <a name="strip-dead-prototypes">Remove unused function declarations</a>
+</div>
+<div class="doc_text">
+  <p>
+  This pass loops over all of the functions in the input module, looking for
+  dead declarations and removes them. Dead declarations are declarations of
+  functions for which no implementation is available (i.e., declarations for
+  unused library functions).
+  </p>
+</div>
+
+<!-------------------------------------------------------------------------- -->
+<div class="doc_subsection">
+  <a name="sretpromotion">Promote sret arguments</a>
+</div>
+<div class="doc_text">
+  <p>
+  This pass finds functions that return a struct (using a pointer to the struct
+  as the first argument of the function, marked with the '<tt>sret</tt>' attribute) and
+  replaces them with a new function that simply returns each of the elements of
+  that struct (using multiple return values).
+  </p>
+
+  <p>
+  This pass works under a number of conditions:
+  </p>
+
+  <ul>
+  <li>The returned struct must not contain other structs</li>
+  <li>The returned struct must only be used to load values from</li>
+  <li>The placeholder struct passed in is the result of an <tt>alloca</tt></li>
+  </ul>
+</div>
+
+<!-------------------------------------------------------------------------- -->
+<div class="doc_subsection">
   <a name="tailcallelim">Tail Call Elimination</a>
 </div>
 <div class="doc_text">

Modified: llvm/branches/non-call-eh/docs/ProgrammersManual.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/ProgrammersManual.html?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/ProgrammersManual.html (original)
+++ llvm/branches/non-call-eh/docs/ProgrammersManual.html Sun Jul  6 15:45:41 2008
@@ -138,7 +138,8 @@
     <li><a href="#AbstractTypeUser">The AbstractTypeUser Class</a></li>
   </ul></li>
 
-  <li><a href="#SymbolTable">The <tt>ValueSymbolTable</tt> and <tt>TypeSymbolTable</tt> classes </a></li>
+  <li><a href="#SymbolTable">The <tt>ValueSymbolTable</tt> and <tt>TypeSymbolTable</tt> classes</a></li>
+  <li><a href="#UserLayout">The <tt>User</tt> and owned <tt>Use</tt> classes' memory layout</a></li>
   </ul></li>
 
   <li><a href="#coreclasses">The Core LLVM Class Hierarchy Reference</a>
@@ -173,7 +174,8 @@
 <div class="doc_author">    
   <p>Written by <a href="mailto:sabre at nondot.org">Chris Lattner</a>, 
                 <a href="mailto:dhurjati at cs.uiuc.edu">Dinakar Dhurjati</a>, 
-                <a href="mailto:jstanley at cs.uiuc.edu">Joel Stanley</a>, and
+                <a href="mailto:ggreif at gmail.com">Gabor Greif</a>, 
+                <a href="mailto:jstanley at cs.uiuc.edu">Joel Stanley</a> and
                 <a href="mailto:rspencer at x10sys.com">Reid Spencer</a></p>
 </div>
 
@@ -331,7 +333,7 @@
   <dt><tt>cast<></tt>: </dt>
 
   <dd><p>The <tt>cast<></tt> operator is a "checked cast" operation. It
-  converts a pointer or reference from a base class to a derived cast, causing
+  converts a pointer or reference from a base class to a derived class, causing
   an assertion failure if it is not really an instance of the right type.  This
   should be used in cases where you have some information that makes you believe
   that something is of the right type.  An example of the <tt>isa<></tt>
@@ -1484,8 +1486,8 @@
 #include "<a href="/doxygen/InstIterator_8h-source.html">llvm/Support/InstIterator.h</a>"
 
 // <i>F is a pointer to a Function instance</i>
-for (inst_iterator i = inst_begin(F), e = inst_end(F); i != e; ++i)
-  llvm::cerr << *i << "\n";
+for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I)
+  llvm::cerr << *I << "\n";
 </pre>
 </div>
 
@@ -1497,7 +1499,10 @@
 <div class="doc_code">
 <pre>
 std::set<Instruction*> worklist;
-worklist.insert(inst_begin(F), inst_end(F));
+// or better yet, SmallPtrSet<Instruction*, 64> worklist;
+
+for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I)
+   worklist.insert(&*I);
 </pre>
 </div>
 
@@ -2204,7 +2209,7 @@
 by most clients.  It should only be used when iteration over the symbol table 
 names themselves are required, which is very special purpose.  Note that not 
 all LLVM
-<a href="#Value">Value</a>s have names, and those without names (i.e. they have
+<tt><a href="#Value">Value</a></tt>s have names, and those without names (i.e. they have
 an empty name) do not exist in the symbol table.
 </p>
 
@@ -2220,7 +2225,230 @@
 
 
 
-<!-- *********************************************************************** -->
+<!-- ======================================================================= -->
+<div class="doc_subsection">
+  <a name="UserLayout">The <tt>User</tt> and owned <tt>Use</tt> classes' memory layout</a>
+</div>
+
+<div class="doc_text">
+<p>The <tt><a href="http://llvm.org/doxygen/classllvm_1_1User.html">
+User</a></tt> class provides a base for expressing the ownership of <tt>User</tt>
+towards other <tt><a href="http://llvm.org/doxygen/classllvm_1_1Value.html">
+Value</a></tt>s. The <tt><a href="http://llvm.org/doxygen/classllvm_1_1Use.html">
+Use</a></tt> helper class is employed to do the bookkeeping and to facilitate <i>O(1)</i>
+addition and removal.</p>
+
+<!-- ______________________________________________________________________ -->
+<div class="doc_subsubsection">
+  <a name="PATypeHolder">Interaction and relationship between <tt>User</tt> and <tt>Use</tt> objects</a>
+</div>
+
+<div class="doc_text">
+<p>
+A subclass of <tt>User</tt> can choose between incorporating its <tt>Use</tt> objects
+or refer to them out-of-line by means of a pointer. A mixed variant
+(some <tt>Use</tt>s inline others hung off) is impractical and breaks the invariant
+that the <tt>Use</tt> objects belonging to the same <tt>User</tt> form a contiguous array.
+</p>
+</div>
+
+<p>
+We have 2 different layouts in the <tt>User</tt> (sub)classes:
+<ul>
+<li><p>Layout a)
+The <tt>Use</tt> object(s) are inside (resp. at fixed offset) of the <tt>User</tt>
+object and there are a fixed number of them.</p>
+
+<li><p>Layout b)
+The <tt>Use</tt> object(s) are referenced by a pointer to an
+array from the <tt>User</tt> object and there may be a variable
+number of them.</p>
+</ul>
+<p>
+As of v2.4 each layout still possesses a direct pointer to the
+start of the array of <tt>Use</tt>s. Though not mandatory for layout a),
+we stick to this redundancy for the sake of simplicity.
+The <tt>User</tt> object also stores the number of <tt>Use</tt> objects it
+has. (Theoretically this information can also be calculated
+given the scheme presented below.)</p>
+<p>
+Special forms of allocation operators (<tt>operator new</tt>)
+enforce the following memory layouts:</p>
+
+<ul>
+<li><p>Layout a) is modelled by prepending the <tt>User</tt> object by the <tt>Use[]</tt> array.</p>
+
+<pre>
+...---.---.---.---.-------...
+  | P | P | P | P | User
+'''---'---'---'---'-------'''
+</pre>
+
+<li><p>Layout b) is modelled by pointing at the <tt>Use[]</tt> array.</p>
+<pre>
+.-------...
+| User
+'-------'''
+    |
+    v
+    .---.---.---.---...
+    | P | P | P | P |
+    '---'---'---'---'''
+</pre>
+</ul>
+<i>(In the above figures '<tt>P</tt>' stands for the <tt>Use**</tt> that
+    is stored in each <tt>Use</tt> object in the member <tt>Use::Prev</tt>)</i>
+
+<!-- ______________________________________________________________________ -->
+<div class="doc_subsubsection">
+  <a name="PATypeHolder">The waymarking algorithm</a>
+</div>
+
+<div class="doc_text">
+<p>
+Since the <tt>Use</tt> objects are deprived of the direct (back)pointer to
+their <tt>User</tt> objects, there must be a fast and exact method to
+recover it. This is accomplished by the following scheme:</p>
+</div>
+
+A bit-encoding in the 2 LSBits (least significant bits) of the <tt>Use::Prev</tt> allows to find the
+start of the <tt>User</tt> object:
+<ul>
+<li><tt>00</tt> —> binary digit 0</li>
+<li><tt>01</tt> —> binary digit 1</li>
+<li><tt>10</tt> —> stop and calculate (<tt>s</tt>)</li>
+<li><tt>11</tt> —> full stop (<tt>S</tt>)</li>
+</ul>
+<p>
+Given a <tt>Use*</tt>, all we have to do is to walk till we get
+a stop and we either have a <tt>User</tt> immediately behind or
+we have to walk to the next stop picking up digits
+and calculating the offset:</p>
+<pre>
+.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.----------------
+| 1 | s | 1 | 0 | 1 | 0 | s | 1 | 1 | 0 | s | 1 | 1 | s | 1 | S | User (or User*)
+'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'----------------
+    |+15                |+10            |+6         |+3     |+1
+    |                   |               |           |       |__>
+    |                   |               |           |__________>
+    |                   |               |______________________>
+    |                   |______________________________________>
+    |__________________________________________________________>
+</pre>
+<p>
+Only the significant number of bits need to be stored between the
+stops, so that the <i>worst case is 20 memory accesses</i> when there are
+1000 <tt>Use</tt> objects associated with a <tt>User</tt>.</p>
+
+<!-- ______________________________________________________________________ -->
+<div class="doc_subsubsection">
+  <a name="PATypeHolder">Reference implementation</a>
+</div>
+
+<div class="doc_text">
+<p>
+The following literate Haskell fragment demonstrates the concept:</p>
+</div>
+
+<div class="doc_code">
+<pre>
+> import Test.QuickCheck
+> 
+> digits :: Int -> [Char] -> [Char]
+> digits 0 acc = '0' : acc
+> digits 1 acc = '1' : acc
+> digits n acc = digits (n `div` 2) $ digits (n `mod` 2) acc
+> 
+> dist :: Int -> [Char] -> [Char]
+> dist 0 [] = ['S']
+> dist 0 acc = acc
+> dist 1 acc = let r = dist 0 acc in 's' : digits (length r) r
+> dist n acc = dist (n - 1) $ dist 1 acc
+> 
+> takeLast n ss = reverse $ take n $ reverse ss
+> 
+> test = takeLast 40 $ dist 20 []
+> 
+</pre>
+</div>
+<p>
+Printing <test> gives: <tt>"1s100000s11010s10100s1111s1010s110s11s1S"</tt></p>
+<p>
+The reverse algorithm computes the length of the string just by examining
+a certain prefix:</p>
+
+<div class="doc_code">
+<pre>
+> pref :: [Char] -> Int
+> pref "S" = 1
+> pref ('s':'1':rest) = decode 2 1 rest
+> pref (_:rest) = 1 + pref rest
+> 
+> decode walk acc ('0':rest) = decode (walk + 1) (acc * 2) rest
+> decode walk acc ('1':rest) = decode (walk + 1) (acc * 2 + 1) rest
+> decode walk acc _ = walk + acc
+> 
+</pre>
+</div>
+<p>
+Now, as expected, printing <pref test> gives <tt>40</tt>.</p>
+<p>
+We can <i>quickCheck</i> this with following property:</p>
+
+<div class="doc_code">
+<pre>
+> testcase = dist 2000 []
+> testcaseLength = length testcase
+> 
+> identityProp n = n > 0 && n <= testcaseLength ==> length arr == pref arr
+>     where arr = takeLast n testcase
+> 
+</pre>
+</div>
+<p>
+As expected <quickCheck identityProp> gives:</p>
+
+<pre>
+*Main> quickCheck identityProp
+OK, passed 100 tests.
+</pre>
+<p>
+Let's be a bit more exhaustive:</p>
+
+<div class="doc_code">
+<pre>
+> 
+> deepCheck p = check (defaultConfig { configMaxTest = 500 }) p
+> 
+</pre>
+</div>
+<p>
+And here is the result of <deepCheck identityProp>:</p>
+
+<pre>
+*Main> deepCheck identityProp
+OK, passed 500 tests.
+</pre>
+
+<!-- ______________________________________________________________________ -->
+<div class="doc_subsubsection">
+  <a name="PATypeHolder">Tagging considerations</a>
+</div>
+
+<p>
+To maintain the invariant that the 2 LSBits of each <tt>Use**</tt> in <tt>Use</tt>
+never change after being set up, setters of <tt>Use::Prev</tt> must re-tag the
+new <tt>Use**</tt> on every modification. Accordingly getters must strip the
+tag bits.</p>
+<p>
+For layout b) instead of the <tt>User</tt> we find a pointer (<tt>User*</tt> with LSBit set).
+Following this pointer brings us to the <tt>User</tt>. A portable trick ensures
+that the first bytes of <tt>User</tt> (if interpreted as a pointer) never has
+the LSBit set.</p>
+
+</div>
+
+  <!-- *********************************************************************** -->
 <div class="doc_section">
   <a name="coreclasses">The Core LLVM Class Hierarchy Reference </a>
 </div>
@@ -3183,7 +3411,7 @@
   <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
   src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
   <a href="http://validator.w3.org/check/referer"><img
-  src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
+  src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Strict"></a>
 
   <a href="mailto:dhurjati at cs.uiuc.edu">Dinakar Dhurjati</a> and
   <a href="mailto:sabre at nondot.org">Chris Lattner</a><br>

Modified: llvm/branches/non-call-eh/docs/ReleaseNotes.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/ReleaseNotes.html?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/ReleaseNotes.html (original)
+++ llvm/branches/non-call-eh/docs/ReleaseNotes.html Sun Jul  6 15:45:41 2008
@@ -1,3 +1,4 @@
+
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
                       "http://www.w3.org/TR/html4/strict.dtd">
 <html>
@@ -12,6 +13,7 @@
  
 <ol>
   <li><a href="#intro">Introduction</a></li>
+  <li><a href="#changes">Major Changes and Sub-project Status</a></li>
   <li><a href="#whatsnew">What's New?</a></li>
   <li><a href="GettingStarted.html">Installation Instructions</a></li>
   <li><a href="#portability">Portability and Supported Platforms</a></li>
@@ -23,8 +25,7 @@
   <p>Written by the <a href="http://llvm.org">LLVM Team</a><p>
 </div>
 
-<h1><font color="red">THIS IS A WORK IN PROGRESS FOR LLVM 2.3 (currently in
-progress on SVN HEAD)</font></h1>
+<!-- Done through Week-of-Mon-20080324.txt -->
 
 <!-- *********************************************************************** -->
 <div class="doc_section">
@@ -55,19 +56,18 @@
 
 <!-- *********************************************************************** -->
 <div class="doc_section">
-  <a name="whatsnew">What's New?</a>
+  <a name="changes">Major Changes and Sub-project Status</a>
 </div>
 <!-- *********************************************************************** -->
 
 <div class="doc_text">
 
 <p>This is the fourteenth public release of the LLVM Compiler Infrastructure. 
-It includes many features and refinements from LLVM 2.2.</p>
+It includes a large number of features and refinements from LLVM 2.2.</p>
 
 </div>
 
 <!-- Unfinished features in 2.3:
-  Index Set Splitting not enabled by default
   Machine LICM
   Machine Sinking
   LegalizeDAGTypes
@@ -75,39 +75,138 @@
 
 <!--=========================================================================-->
 <div class="doc_subsection">
-<a name="deprecation">Removed features in LLVM 2.3</a>
+<a name="changes">Major Changes in LLVM 2.3</a>
 </div>
 
 <div class="doc_text">
 
-<p>LLVM 2.2 was the last LLVM release to support llvm-gcc 4.0 and llvm-upgrade.
-llvm-gcc 4.0 has been replaced with llvm-gcc 4.2.  llvm-upgrade was useful for
-upgrading llvm 1.9 files to llvm 2.x syntax, but you can always use a previous
-llvm release to do this.</p>
+<p>LLVM 2.3 no longer supports llvm-gcc 4.0, it has been replaced with
+   llvm-gcc 4.2.</p>
 
+<p>LLVM 2.3 no longer includes the <tt>llvm-upgrade</tt> tool.  It was useful
+   for upgrading LLVM 1.9 files to LLVM 2.x syntax, but you can always use a
+   previous LLVM release to do this.  One nice impact of this is that the LLVM
+   regression test suite no longer depends on llvm-upgrade, which makes it run
+   faster.</p>
+
+<p>The <tt>llvm2cpp</tt> tool has been folded into llc, use
+    <tt>llc -march=cpp</tt> instead of <tt>llvm2cpp</tt>.</p>
+
+<p>LLVM API Changes:</p>
+
+<ul>
+<li>Several core LLVM IR classes have migrated to use the
+    '<tt>FOOCLASS::Create(...)</tt>' pattern instead of '<tt>new 
+    FOOCLASS(...)</tt>' (e.g. where FOOCLASS=<tt>BasicBlock</tt>).  We hope to
+    standardize on <tt>FOOCLASS::Create</tt> for all IR classes in the future,
+    but not all of them have been moved over yet.</li>
+<li>LLVM 2.3 renames the LLVMBuilder and LLVMFoldingBuilder classes to
+    <a href="http://llvm.org/doxygen/classllvm_1_1IRBuilder.html">IRBuilder</a>.
+    </li>
+<li>MRegisterInfo was renamed to
+    <a href="http://llvm.org/doxygen/classllvm_1_1TargetRegisterInfo.html">
+    TargetRegisterInfo</a>.</li>
+<li>The MappedFile class is gone, please use
+    <a href="http://llvm.org/doxygen/classllvm_1_1MemoryBuffer.html">
+    MemoryBuffer</a> instead.</li>
+<li>The '<tt>-enable-eh</tt>' flag to llc has been removed.  Now code should 
+    encode whether it is safe to omit unwind information for a function by
+    tagging the Function object with the '<tt>nounwind</tt>' attribute.</li>
+<li>The ConstantFP::get method that uses APFloat now takes one argument
+    instead of two. The type argument has been removed, and the type is
+    now inferred from the size of the given APFloat value.</li>
+
+</ul>
 </div>
 
 <!--=========================================================================-->
 <div class="doc_subsection">
-<a name="frontends">llvm-gcc 4.2 and clang</a>
+<a name="otherprojects">Other LLVM Sub-Projects</a>
 </div>
 
 <div class="doc_text">
+<p>
+The core LLVM 2.3 distribution currently consists of code from the core LLVM
+repository (which roughly contains the LLVM optimizer, code generators and
+supporting tools) and the llvm-gcc repository.  In addition to this code, the
+LLVM Project includes other sub-projects that are in development.  The two which
+are the most actively developed are the new <a href="#vmkit">vmkit Project</a>
+and the <a href="#clang">Clang Project</a>. 
+</p>
+</div>
+
+<!--=========================================================================-->
+<div class="doc_subsubsection">
+<a name="vmkit">vmkit</a>
+</div>
 
-<p>LLVM 2.3 fully supports llvm-gcc 4.2 front-end. </p>
+<div class="doc_text">
+<p>
+The "vmkit" project is a new addition to the LLVM family.  It is an
+implementation of a JVM and a CLI Virtual Machines (Microsoft .NET is an
+implementation of the CLI) using the Just-In-Time compiler of LLVM.</p>
+
+<p>The JVM, called JnJVM, executes real-world applications such as Apache
+projects (e.g. Felix and Tomcat) and the SpecJVM98 benchmark.  It uses the GNU
+Classpath project for the base classes.  The CLI implementation, called N3, is
+its in early stages but can execute simple applications and the "pnetmark"
+benchmark. It uses the pnetlib project as its core library.</p>
+
+<p>The 'vmkit' VMs compare in performance with industrial and top open-source
+VMs on scientific applications.  Besides the JIT, the VMs use many features of
+the LLVM framework, including the standard set of optimizations, atomic
+operations, custom function provider and memory manager for JITed methods, and
+specific virtual machine optimizations. vmkit is not an official part of LLVM
+2.3 release. It is publicly available under the LLVM license and can be
+downloaded from:
+</p>
 
-<p>The <a href="http://clang.llvm.org/">clang project</a> is an effort to build
-a set of new 'llvm native' front-end technologies for the LLVM optimizer
-and code generator.  Currently, its C and Objective-C support is maturing 
-nicely, and it has advanced source-to-source analysis and transformation
-capabilities.  If you are interested in building source-level tools for C and
-Objective-C (and eventually C++), you should take a look.  However, note that
-clang is not an official part of the LLVM 2.3 release.  If you are interested in
-this project, please see its <a href="http://clang.llvm.org/">web site</a>.</p>
+<div class="doc_code">
+<pre>svn co http://llvm.org/svn/llvm-project/vmkit/trunk vmkit</pre>
+</div>
 
 </div>
 
 <!--=========================================================================-->
+<div class="doc_subsubsection">
+<a name="clang">Clang</a>
+</div>
+
+<div class="doc_text">
+
+<p>The <a href="http://clang.llvm.org/">Clang project</a> is an effort to build
+a set of new 'LLVM native' front-end technologies for the LLVM optimizer
+and code generator.  Clang is continuing to make major strides forward in all
+areas.  Its C and Objective-C parsing support is very solid, and the code
+generation support is far enough along to build many C applications.  While not
+yet production quality, it is progressing very nicely.  In addition, C++
+front-end work has started to make significant progress.</p>
+
+<p>At this point, Clang is most useful if you are interested in source-to-source
+transformations (such as refactoring) and other source-level tools for C and
+Objective-C.  Clang now also includes tools for turning C code into pretty HTML,
+and includes a new <a href="http://clang.llvm.org/StaticAnalysis.html">static
+analysis tool</a> in development.  This tool focuses on automatically finding
+bugs in C and Objective-C code.</p>
+
+</div>
+
+
+<!-- *********************************************************************** -->
+<div class="doc_section">
+  <a name="whatsnew">What's New?</a>
+</div>
+<!-- *********************************************************************** -->
+
+<div class="doc_text">
+
+<p>LLVM 2.3 includes a huge number of bug fixes, performance tweaks and minor
+improvements.  Some of the major improvements and new features are listed in
+this section.
+</p>
+</div>
+
+<!--=========================================================================-->
 <div class="doc_subsection">
 <a name="majorfeatures">Major New Features</a>
 </div>
@@ -117,10 +216,81 @@
 <p>LLVM 2.3 includes several major new capabilities:</p>
 
 <ul>
+<li><p>The biggest change in LLVM 2.3 is Multiple Return Value (MRV) support.
+    MRVs allow LLVM IR to directly represent functions that return multiple
+    values without having to pass them "by reference" in the LLVM IR.  This
+    allows a front-end to generate more efficient code, as MRVs are generally
+    returned in registers if a target supports them.  See the <a
+    href="LangRef.html#i_getresult">LLVM IR Reference</a> for more details.</p>
+    
+ <p>MRVs are fully supported in the LLVM IR, but are not yet fully supported in
+    on all targets.  However, it is generally safe to return up to 2 values from
+    a function: most targets should be able to handle at least that.  MRV
+    support is a critical requirement for X86-64 ABI support, as X86-64 requires
+    the ability to return multiple registers from functions, and we use MRVs to
+    accomplish this in a direct way.</p></li>
+
+<li><p>LLVM 2.3 includes a complete reimplementation of the "<tt>llvmc</tt>"
+    tool.  It is designed to overcome several problems with the original 
+    <tt>llvmc</tt> and to provide a superset of the features of the
+    '<tt>gcc</tt>' driver.</p>
+
+    <p>The main features of <tt>llvmc2</tt> are:
+    <ul>
+    <li>Extended handling of command line options and smart rules for
+    dispatching them to different tools.</li>
+    <li>Flexible (and extensible) rules for defining different tools.</li>
+    <li>The different intermediate steps performed by tools are represented
+    as edges in the abstract graph.</li>
+    <li>The 'language' for driver behavior definition is tablegen and thus
+    it's relatively easy to add new features.</li>
+    <li>The definition of driver is transformed into set of C++ classes, thus
+    no runtime interpretation is needed.</li>
+    </ul>
+</li>
+
+<li><p>LLVM 2.3 includes a completely rewritten interface for <a
+    href="LinkTimeOptimization.html">Link Time Optimization</a>.  This interface
+    is written in C, which allows for easier integration with C code bases, and
+    incorporates improvements we learned about from the first incarnation of the
+    interface.</p></li>
+
+<li><p>The <a href="tutorial/LangImpl1.html">Kaleidoscope tutorial</a> now
+    includes a "port" of the tutorial that <a 
+    href="tutorial/OCamlLangImpl1.html">uses the Ocaml bindings</a> to implement
+    the Kaleidoscope language.</p></li>
+
+</ul>
+
+</div>
+
+
+<!--=========================================================================-->
+<div class="doc_subsection">
+<a name="llvm-gcc">llvm-gcc 4.2 Improvements</a>
+</div>
+
+<div class="doc_text">
+
+<p>LLVM 2.3 fully supports the llvm-gcc 4.2 front-end, and includes support
+for the C, C++, Objective-C, Ada, and Fortran front-ends.</p>
+
+<p>
+<ul>
+<li>llvm-gcc 4.2 includes numerous fixes to better support the Objective-C
+front-end.  Objective-C now works very well on Mac OS/X.</li>
+
+<li>Fortran <tt>EQUIVALENCE</tt>s are now supported by the gfortran
+front-end.</li>
+
+<li>llvm-gcc 4.2 includes many other fixes which improve conformance with the
+relevant parts of the GCC testsuite.</li>
+
 </ul>
 
 </div>
 
+
 <!--=========================================================================-->
 <div class="doc_subsection">
 <a name="coreimprovements">LLVM Core Improvements</a>
@@ -131,13 +301,94 @@
 </p>
 
 <ul>
+<li>LLVM IR now directly represents "common" linkage, instead of representing it
+as a form of weak linkage.</li>
 
+<li>LLVM IR now has support for atomic operations, and this functionality can be
+accessed through the llvm-gcc "<tt>__sync_synchronize</tt>",
+"<tt>__sync_val_compare_and_swap</tt>", and related builtins.  Support for
+atomics are available in the Alpha, X86, X86-64, and PowerPC backends.</li>
+
+<li>The C and Ocaml bindings have extended to cover pass managers, several
+transformation passes, iteration over the LLVM IR, target data, and parameter
+attribute lists.</li>
 </ul>
   
 </div>
 
 <!--=========================================================================-->
 <div class="doc_subsection">
+<a name="optimizer">Optimizer Improvements</a>
+</div>
+
+<div class="doc_text">
+
+<p>In addition to a huge array of bug fixes and minor performance tweaks, the 
+LLVM 2.3 optimizers support a few major enhancements:</p>
+
+<ul>
+
+<li><p>Loop index set splitting on by default.
+This transformation hoists conditions from loop bodies and reduces a loop's
+iteration space to improve performance. For example,</p>
+
+<div class="doc_code">
+<pre>
+for (i = LB; i < UB; ++i)
+  if (i <= NV)
+    LOOP_BODY
+</pre>
+</div>
+
+<p>is transformed into:</p>
+
+<p><div class="doc_code">
+<pre>
+NUB = min(NV+1, UB)
+for (i = LB; i < NUB; ++i)
+  LOOP_BODY
+</pre>
+</div>
+</p>
+</li>
+
+<li>LLVM now includes a new <tt>memcpy</tt> optimization pass which removes
+dead <tt>memcpy</tt> calls, unneeded copies of aggregates, and performs
+return slot optimization.  The LLVM optimizer now notices long sequences of
+consecutive stores and merges them into <tt>memcpy</tt>'s where profitable.</li>
+
+<li>Alignment detection for vector memory references and for <tt>memcpy</tt> and
+<tt>memset</tt> is now more aggressive.</li> 
+
+<li>The Aggressive Dead Code Elimination (ADCE) optimization has been rewritten
+to make it both faster and safer in the presence of code containing infinite
+loops.  Some of its prior functionality has been factored out into the loop
+deletion pass, which <em>is</em> safe for infinite loops.  The new ADCE pass is
+no longer based on control dependence, making it run faster.</li>
+
+<li>The 'SimplifyLibCalls' pass, which optimizes calls to libc and libm
+    functions for C-based languages, has been rewritten to be a FunctionPass
+    instead a ModulePass.  This allows it to be run more often and to be
+    included at -O1 in llvm-gcc.  It was also extended to include more
+    optimizations and several corner case bugs were fixed.</li>
+
+<li>LLVM now includes a simple 'Jump Threading' pass, which attempts to simplify
+    conditional branches using information about predecessor blocks, simplifying
+    the control flow graph.  This pass is pretty basic at this point, but
+    catches some important cases and provides a foundation to build on.</li>
+    
+<li>Several corner case bugs which could lead to deleting volatile memory
+    accesses have been fixed.</li>
+
+<li>Several optimizations have been sped up, leading to faster code generation
+    with the same code quality.</li>
+  
+</ul>
+
+</div>
+
+<!--=========================================================================-->
+<div class="doc_subsection">
 <a name="codegen">Code Generator Improvements</a>
 </div>
 
@@ -148,33 +399,110 @@
 faster:</p>
 
 <ul>
-<li>MemOperand in the code generator.</li>
+<li>The code generator now has support for carrying information about memory
+    references throughout the entire code generation process, via the
+    <a href="http://llvm.org/doxygen/classllvm_1_1MachineMemOperand.html">
+    MachineMemOperand</a> class. In the future this will be used to improve
+    both pre-pass and post-pass scheduling, and to improve compiler-debugging
+    output.</li>
+
+<li>The target-independent code generator infrastructure now uses LLVM's
+    <a href="http://llvm.org/doxygen/classllvm_1_1APInt.html">APInt</a>
+    class to handle integer values, which allows it to support integer types
+    larger than 64 bits (for example i128). Note that support for such types is
+    also dependent on target-specific support.  Use of APInt is also a step
+    toward support for non-power-of-2 integer sizes.</li>
+    
+<li>LLVM 2.3 includes several compile time speedups for code with large basic
+    blocks, particularly in the instruction selection phase, register
+    allocation, scheduling, and tail merging/jump threading.</li>
+
+<li>LLVM 2.3 includes several improvements which make llc's
+    <tt>--view-sunit-dags</tt> visualization of scheduling dependency graphs
+    easier to understand.</li>
+    
+<li>The code generator allows targets to write patterns that generate subreg
+    references directly in .td files now.</li>
+    
+<li><tt>memcpy</tt> lowering in the backend is more aggressive, particularly for
+    <tt>memcpy</tt> calls introduced by the code generator when handling
+    pass-by-value structure argument copies.</li>
+    
+<li>Inline assembly with multiple register results now returns those results
+    directly in the appropriate registers, rather than going through memory.
+    Inline assembly that uses constraints like "ir" with immediates now use the
+    'i' form when possible instead of always loading the value in a register.
+    This saves an instruction and reduces register use.</li>
+
+<li>Added support for PIC/GOT style <a 
+    href="CodeGenerator.html#tailcallopt">tail calls</a> on X86/32 and initial
+    support for tail calls on PowerPC 32 (it may also work on PowerPC 64 but is
+    not thoroughly tested).</li>
 </ul>
 
 </div>
 
+
 <!--=========================================================================-->
 <div class="doc_subsection">
-<a name="optimizer">Optimizer Improvements</a>
+<a name="x86specific">X86/X86-64 Specific Improvements</a>
 </div>
 
 <div class="doc_text">
-
-<p>In addition to a huge array of bug fixes and minor performance tweaks, the 
-LLVM 2.3 optimizers support a few major enhancements:</p>
+<p>New target-specific features include:
+</p>
 
 <ul>
+<li>llvm-gcc's X86-64 ABI conformance is far improved, particularly in the
+    area of passing and returning structures by value.  llvm-gcc compiled code
+    now interoperates very well on X86-64 systems with other compilers.</li>
+
+<li>Support for Win64 was added. This includes code generation itself, JIT
+    support, and necessary changes to llvm-gcc.</li>
+
+<li>The LLVM X86 backend now supports the support SSE 4.1 instruction set, and
+    the llvm-gcc 4.2 front-end supports the SSE 4.1 compiler builtins.  Various
+    generic vector operations (insert/extract/shuffle) are much more efficient
+    when SSE 4.1 is enabled.  The JIT automatically takes advantage of these
+    instructions, but llvm-gcc must be explicitly told to use them, e.g. with
+    <tt>-march=penryn</tt>.</li>
+
+<li>The X86 backend now does a number of optimizations that aim to avoid
+    converting numbers back and forth from SSE registers to the X87 floating
+    point stack.  This is important because most X86 ABIs require return values
+    to be on the X87 Floating Point stack, but most CPUs prefer computation in
+    the SSE units.</li>
+
+<li>The X86 backend supports stack realignment, which is particularly useful for
+    vector code on OS's without 16-byte aligned stacks, such as Linux and
+    Windows.</li>
+
+<li>The X86 backend now supports the "sseregparm" options in GCC, which allow
+    functions to be tagged as passing floating point values in SSE
+    registers.</li>
+
+<li>Trampolines (taking the address of a nested function) now work on
+    Linux/X86-64.</li>
+
+<li><tt>__builtin_prefetch</tt> is now compiled into the appropriate prefetch
+    instructions instead of being ignored.</li>
 
-<li>Index set splitting on by default.</li>
+<li>128-bit integers are now supported on X86-64 targets.  This can be used
+    through <tt>__attribute__((TImode))</tt> in llvm-gcc.</li>
 
-</ul>
+<li>The register allocator can now rematerialize PIC-base computations, which is
+    an important optimization for register use.</li>
 
-</div>
+<li>The "t" and "f" inline assembly constraints for the X87 floating point stack
+    now work.  However, the "u" constraint is still not fully supported.</li>
 
+</ul>
+  
+</div>
 
 <!--=========================================================================-->
 <div class="doc_subsection">
-<a name="targetspecific">Target Specific Improvements</a>
+<a name="targetspecific">Other Target Specific Improvements</a>
 </div>
 
 <div class="doc_text">
@@ -182,10 +510,15 @@
 </p>
 
 <ul>
+<li>The LLVM C backend now supports vector code.</li>
+<li>The Cell SPU backend includes a number of improvements. It generates better
+    code and its stability/completeness is improving.</li>
 </ul>
   
 </div>
 
+
+
 <!--=========================================================================-->
 <div class="doc_subsection">
 <a name="otherimprovements">Other Improvements</a>
@@ -196,6 +529,10 @@
 </p>
 
 <ul>
+<li>LLVM now builds with GCC 4.3.</li>
+<li>Bugpoint now supports running custom scripts (with the <tt>-run-custom</tt>
+    option) to determine how to execute the command and whether it is making
+    forward process.</li>
 </ul>
   
 </div>
@@ -211,20 +548,19 @@
 <p>LLVM is known to work on the following platforms:</p>
 
 <ul>
-<li>Intel and AMD machines running Red Hat Linux, Fedora Core and FreeBSD 
+<li>Intel and AMD machines (IA32) running Red Hat Linux, Fedora Core and FreeBSD 
       (and probably other unix-like systems).</li>
 <li>PowerPC and X86-based Mac OS X systems, running 10.3 and above in 32-bit and
     64-bit modes.</li>
 <li>Intel and AMD machines running on Win32 using MinGW libraries (native).</li>
 <li>Intel and AMD machines running on Win32 with the Cygwin libraries (limited
     support is available for native builds with Visual C++).</li>
-<li>Sun UltraSPARC workstations running Solaris 8.</li>
+<li>Sun UltraSPARC workstations running Solaris 10.</li>
 <li>Alpha-based machines running Debian GNU/Linux.</li>
-<li>Itanium-based machines running Linux and HP-UX.</li>
+<li>Itanium-based (IA64) machines running Linux and HP-UX.</li>
 </ul>
 
-<p>The core LLVM infrastructure uses
-<a href="http://www.gnu.org/software/autoconf/">GNU autoconf</a> to adapt itself
+<p>The core LLVM infrastructure uses GNU autoconf to adapt itself
 to the machine and operating system on which it is built.  However, minor
 porting may be required to get LLVM to work on new platforms.  We welcome your
 portability patches and reports of successful builds or error messages.</p>
@@ -263,9 +599,8 @@
 
 <ul>
 <li>The MSIL, IA64, Alpha, SPU, and MIPS backends are experimental.</li>
-<li>The LLC "<tt>-filetype=asm</tt>" (the default) is the only supported
+<li>The llc "<tt>-filetype=asm</tt>" (the default) is the only supported
     value for this option.</li>
-<li>The llvmc tool is not supported.</li>
 </ul>
 
 </div>
@@ -278,13 +613,23 @@
 <div class="doc_text">
 
 <ul>
-<li>The X86 backend does not yet support <a href="http://llvm.org/PR879">inline
-    assembly that uses the X86 floating point stack</a>.</li>
-<li>The X86 backend occasionally has <a href="http://llvm.org/PR1649">alignment
-    problems</a> on operating systems that don't require 16-byte stack alignment
-    (including most non-darwin OS's like linux).</li>
-<li>The X86 backend generates inefficient floating point code when configured to
-    generate code for systems that don't have SSE2.</li>
+  <li>The X86 backend does not yet support
+    all <a href="http://llvm.org/PR879">inline assembly that uses the X86
+    floating point stack</a>.  It supports the 'f' and 't' constraints, but not
+    'u'.</li>
+  <li>The X86 backend generates inefficient floating point code when configured
+    to generate code for systems that don't have SSE2.</li>
+  <li>Win64 code generation wasn't widely tested. Everything should work, but we
+    expect small issues to happen. Also, llvm-gcc cannot build mingw64 runtime
+    currently due
+    to <a href="http://llvm.org/PR2255">several</a>
+    <a href="http://llvm.org/PR2257">bugs</a> due to lack of support for the
+    'u' inline assembly constraint and X87 floating point inline assembly.</li>
+  <li>The X86-64 backend does not yet support position-independent code (PIC)
+      generation on Linux targets.</li>
+  <li>The X86-64 backend does not yet support the LLVM IR instruction
+      <tt>va_arg</tt>. Currently, the llvm-gcc front-end supports variadic
+      argument constructs on X86-64 by lowering them manually.</li>
 </ul>
 
 </div>
@@ -316,7 +661,8 @@
 results (<a href="http://llvm.org/PR1388">PR1388</a>).</li>
 <li>Compilation for ARM Linux OABI (old ABI) is supported, but not fully tested.
 </li>
-<li>There is a bug in QEMU-ARM (<= 0.9.0) which causes it to incorrectly execute
+<li>There is a bug in QEMU-ARM (<= 0.9.0) which causes it to incorrectly
+ execute
 programs compiled with LLVM.  Please use more recent versions of QEMU.</li>
 </ul>
 
@@ -359,25 +705,9 @@
 <div class="doc_text">
 
 <ul>
-
-<li>C++ programs are likely to fail on IA64, as calls to <tt>setjmp</tt> are
-made where the argument is not 16-byte aligned, as required on IA64. (Strictly
-speaking this is not a bug in the IA64 back-end; it will also be encountered
-when building C++ programs using the C back-end.)</li>
-
-<li>The C++ front-end does not use <a href="http://llvm.org/PR406">IA64
-ABI compliant layout of v-tables</a>.  In particular, it just stores function
-pointers instead of function descriptors in the vtable.  This bug prevents
-mixing C++ code compiled with LLVM with C++ objects compiled by other C++
-compilers.</li>
-
-<li>There are a few ABI violations which will lead to problems when mixing LLVM
-output with code built with other compilers, particularly for floating-point
-programs.</li>
-
-<li>Defining vararg functions is not supported (but calling them is ok).</li>
-
-<li>The Itanium backend has bitrotted somewhat.</li>
+<li>The Itanium backend is highly experimental, and has a number of known
+    issues.  We are looking for a maintainer for the Itanium backend.  If you
+    are interested, please contact the llvmdev mailing list.</li>
 </ul>
 
 </div>
@@ -390,13 +720,11 @@
 <div class="doc_text">
 
 <ul>
-<li><a href="http://llvm.org/PR802">The C backend does not support inline
-    assembly code</a>.</li>
-<li><a href="http://llvm.org/PR1126">The C backend does not support vectors
-    yet</a>.</li>
+<li><a href="http://llvm.org/PR802">The C backend has only basic support for
+    inline assembly code</a>.</li>
 <li><a href="http://llvm.org/PR1658">The C backend violates the ABI of common
     C++ programs</a>, preventing intermixing between C++ compiled by the CBE and
-    C++ code compiled with LLC or native compilers.</li>
+    C++ code compiled with llc or native compilers.</li>
 <li>The C backend does not support all exception handling constructs.</li>
 </ul>
 
@@ -405,69 +733,29 @@
 
 <!-- ======================================================================= -->
 <div class="doc_subsection">
-  <a name="c-fe">Known problems with the C front-end</a>
+  <a name="c-fe">Known problems with the llvm-gcc C front-end</a>
 </div>
 
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">Bugs</div>
-
 <div class="doc_text">
 
 <p>llvm-gcc does not currently support <a href="http://llvm.org/PR869">Link-Time
 Optimization</a> on most platforms "out-of-the-box".  Please inquire on the
 llvmdev mailing list if you are interested.</p>
 
-</div>
-
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsubsection">
-  Notes
-</div>
-
-<div class="doc_text">
-<ul>
-
-<li><p>llvm-gcc does <b>not</b> support <tt>__builtin_apply</tt> yet.
-  See <a href="http://gcc.gnu.org/onlinedocs/gcc/Constructing-Calls.html#Constructing%20Calls">Constructing Calls</a>: Dispatching a call to another function.</p>
-</li>
-
-<li><p>llvm-gcc <b>partially</b> supports these GCC extensions:</p>
-  <ol>
-  <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html#Nested%20Functions">Nested Functions</a>:
-
-      As in Algol and Pascal, lexical scoping of functions.
-      Nested functions are supported, but llvm-gcc does not support
-      taking the address of a nested function (except on X86 targets)
-      or non-local gotos.</li>
-
-  <li><a href="http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#Function%20Attributes">Function Attributes</a>:
-
-      Declaring that functions have no side effects or that they can never
-      return.<br>
-
-      <b>Supported:</b> <tt>alias</tt>, <tt>always_inline</tt>, <tt>cdecl</tt>, 
-      <tt>const</tt>, <tt>constructor</tt>, <tt>destructor</tt>, 
-      <tt>deprecated</tt>, <tt>fastcall</tt>, <tt>format</tt>, 
-      <tt>format_arg</tt>, <tt>non_null</tt>, <tt>noinline</tt>, 
-      <tt>noreturn</tt>, <tt>nothrow</tt>, <tt>pure</tt>, <tt>regparm</tt>
-      <tt>section</tt>, <tt>stdcall</tt>, <tt>unused</tt>, <tt>used</tt>, 
-      <tt>visibility</tt>, <tt>warn_unused_result</tt>, <tt>weak</tt><br>
-
-      <b>Ignored:</b> <tt>malloc</tt>,
-      <tt>no_instrument_function</tt></li>
-  </ol>
-</li>
-
-</ul>
+<p>The only major language feature of GCC not supported by llvm-gcc is
+    the <tt>__builtin_apply</tt> family of builtins.   However, some extensions
+    are only supported on some targets.  For example, trampolines are only
+    supported on some targets (these are used when you take the address of a
+    nested function).</p>
 
-<p>If you run into GCC extensions which have not been included in any of these
-lists, please let us know (also including whether or not they work).</p>
+<p>If you run into GCC extensions which are not supported, please let us know.
+</p>
 
 </div>
 
 <!-- ======================================================================= -->
 <div class="doc_subsection">
-  <a name="c++-fe">Known problems with the C++ front-end</a>
+  <a name="c++-fe">Known problems with the llvm-gcc C++ front-end</a>
 </div>
 
 <div class="doc_text">
@@ -477,8 +765,9 @@
 itself, Qt, Mozilla, etc.</p>
 
 <ul>
-<li>Exception handling only works well on the X86 and PowerPC targets.
-It works well for x86-64 darwin but not x86-64 linux.</li>
+<li>Exception handling works well on the X86 and PowerPC targets, including
+X86-64 darwin.  This works when linking to a libstdc++ compiled by GCC.  It is
+supported on X86-64 linux, but that is disabled by default in this release.</li>
 </ul>
 
 </div>
@@ -486,22 +775,24 @@
 
 <!-- ======================================================================= -->
 <div class="doc_subsection">
-  <a name="ada-fe">Known problems with the Ada front-end</a>
+  <a name="ada-fe">Known problems with the llvm-gcc Ada front-end</a>
 </div>
 
 <div class="doc_text">
 The llvm-gcc 4.2 Ada compiler works fairly well, however this is not a mature
 technology and problems should be expected.
 <ul>
-<li>The Ada front-end currently only builds on x86-32.  This is mainly due
+<li>The Ada front-end currently only builds on X86-32.  This is mainly due
 to lack of trampoline support (pointers to nested functions) on other platforms,
-however it <a href="http://llvm.org/PR2006">also fails to build on x86-64</a>
+however it <a href="http://llvm.org/PR2006">also fails to build on X86-64</a>
 which does support trampolines.</li>
 <li>The Ada front-end <a href="http://llvm.org/PR2007">fails to bootstrap</a>.
 Workaround: configure with --disable-bootstrap.</li>
 <li>The c380004 and <a href="http://llvm.org/PR2010">c393010</a> ACATS tests
-fail (c380004 also fails with gcc-4.2 mainline).</li>
-<li>Many gcc specific Ada tests continue to crash the compiler.</li>
+fail (c380004 also fails with gcc-4.2 mainline).  When built at -O3, the
+<a href="http://llvm.org/PR2421">cxg2021</a> ACATS test also fails.</li>
+<li>Some gcc specific Ada tests continue to crash the compiler.  The testsuite
+reports most tests as having failed even though they pass.</li>
 <li>The -E binder option (exception backtraces)
 <a href="http://llvm.org/PR1982">does not work</a> and will result in programs
 crashing if an exception is raised.  Workaround: do not use -E.</li>
@@ -509,29 +800,15 @@
 or finish at a non-byte offset</a> in a record.  Workaround: do not pack records
 or use representation clauses that result in a field of a non-discrete type
 starting or finishing in the middle of a byte.</li>
-<li>The lli interpreter <a href="http://llvm.org/PR2009">considers 'main'
-as generated by the Ada binder to be invalid</a>.
-Workaround: hand edit the file to use pointers for argv and envp rather than
-integers.</li>
-<li>The -fstack-check option <a href="http://llvm.org/PR2008">is ignored</a>.</li>
+<li>The <tt>lli</tt> interpreter <a href="http://llvm.org/PR2009">considers
+'main' as generated by the Ada binder to be invalid</a>.
+Workaround: hand edit the file to use pointers for <tt>argv</tt> and
+<tt>envp</tt> rather than integers.</li>
+<li>The <tt>-fstack-check</tt> option <a href="http://llvm.org/PR2008">is
+ignored</a>.</li>
 </ul>
 </div>
 
-<!-- ======================================================================= -->
-<div class="doc_subsection">
-  <a name="fortran-fe">Known problems with the Fortran front-end</a>
-</div>
-
-<div class="doc_text">
-
-<ul>
-<li>The llvm-gcc 4.2 gfortran front-end supports a broad range of Fortran code, but does
-<a href="http://llvm.org/PR1971">not support EQUIVALENCE yet</a>.</li>
-</ul>
-</div>
-
-
-
 <!-- *********************************************************************** -->
 <div class="doc_section">
   <a name="additionalinfo">Additional Information</a>

Modified: llvm/branches/non-call-eh/docs/SourceLevelDebugging.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/SourceLevelDebugging.html?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/SourceLevelDebugging.html (original)
+++ llvm/branches/non-call-eh/docs/SourceLevelDebugging.html Sun Jul  6 15:45:41 2008
@@ -130,7 +130,7 @@
 <p>When a program is being debugged, a debugger interacts with the user and
 turns the stored debug information into source-language specific information. 
 As such, a debugger must be aware of the source-language, and is thus tied to
-a specific language of family of languages.</p>
+a specific language or family of languages.</p>
 
 </div>
 
@@ -142,7 +142,7 @@
 <div class="doc_text">
 <p>The role of debug information is to provide meta information normally
 stripped away during the compilation process.  This meta information provides an
-llvm user a relationship between generated code and the original program source
+LLVM user a relationship between generated code and the original program source
 code.</p>
 
 <p>Currently, debug information is consumed by the DwarfWriter to produce dwarf
@@ -175,12 +175,12 @@
 have been run, and without any modification to the optimizations themselves.
 However, some optimizations may impact the ability to modify the current state
 of the program with a debugger, such as setting program variables, or calling
-function that have been deleted.</li>
+functions that have been deleted.</li>
 
 <li>LLVM optimizations gracefully interact with debugging information.  If they
 are not aware of debug information, they are automatically disabled as necessary
 in the cases that would invalidate the debug info.  This retains the LLVM
-features making it easy to write new transformations.</li>
+features, making it easy to write new transformations.</li>
 
 <li>As desired, LLVM optimizations can be upgraded to be aware of the LLVM
 debugging information, allowing them to update the debugging information as they

Modified: llvm/branches/non-call-eh/docs/TestingGuide.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/TestingGuide.html?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/TestingGuide.html (original)
+++ llvm/branches/non-call-eh/docs/TestingGuide.html Sun Jul  6 15:45:41 2008
@@ -2,32 +2,45 @@
                       "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head>
-  <title>LLVM Test Suite Guide</title>
+  <title>LLVM Testing Infrastructure Guide</title>
   <link rel="stylesheet" href="llvm.css" type="text/css">
 </head>
 <body>
       
 <div class="doc_title">
-  LLVM Test Suite Guide
+  LLVM Testing Infrastructure Guide
 </div>
 
 <ol>
   <li><a href="#overview">Overview</a></li>
-  <li><a href="#Requirements">Requirements</a></li>
-  <li><a href="#quick">Quick Start</a></li>
-  <li><a href="#org">LLVM Test Suite Organization</a>
+  <li><a href="#requirements">Requirements</a></li>
+  <li><a href="#org">LLVM testing infrastructure organization</a>
     <ul>
-      <li><a href="#codefragments">Code Fragments</a></li>
-      <li><a href="#wholeprograms">Whole Programs</a></li>
+      <li><a href="#dejagnu">DejaGNU tests</a></li>
+      <li><a href="#testsuite">Test suite</a></li>
     </ul>
   </li>
-  <li><a href="#tree">LLVM Test Suite Tree</a></li>
-  <li><a href="#dgstructure">DejaGNU Structure</a></li>
-  <li><a href="#progstructure"><tt>llvm-test</tt> Structure</a></li>
-  <li><a href="#run">Running the LLVM Tests</a>
+  <li><a href="#quick">Quick start</a>
     <ul>
-      <li><a href="#customtest">Writing custom tests for llvm-test</a></li>
-    </ul>
+      <li><a href="#quickdejagnu">DejaGNU tests</a></li>
+      <li><a href="#quicktestsuite">Test suite</a></li>
+   </ul>
+  </li>
+  <li><a href="#dgstructure">DejaGNU structure</a>
+    <ul>
+      <li><a href="#dgcustom">Writing new DejaGNU tests</a></li>
+      <li><a href="#dgvars">Variables and substitutions</a></li>
+      <li><a href="#dgfeatures">Other features</a></li>
+   </ul>
+  </li>
+  <li><a href="#testsuitestructure">Test suite structure</a></li>
+  <li><a href="#testsuiterun">Running the test suite</a>
+    <ul>
+      <li><a href="#testsuiteexternal">Configuring external tests</a></li>
+      <li><a href="#testsuitetests">Running different tests</a></li>
+      <li><a href="#testsuiteoutput">Generating test output</a></li>
+      <li><a href="#testsuitecustom">Writing custom tests for llvm-test</a></li>
+   </ul>
   </li>
   <li><a href="#nightly">Running the nightly tester</a></li>
 </ol>
@@ -43,19 +56,19 @@
 
 <div class="doc_text">
 
-<p>This document is the reference manual for the LLVM test suite.  It documents
-the structure of the LLVM test suite, the tools needed to use it, and how to add
-and run tests.</p>
+<p>This document is the reference manual for the LLVM testing infrastructure. It documents
+the structure of the LLVM testing infrastructure, the tools needed to use it,
+and how to add and run tests.</p>
 
 </div>
 
 <!--=========================================================================-->
-<div class="doc_section"><a name="Requirements">Requirements</a></div>
+<div class="doc_section"><a name="requirements">Requirements</a></div>
 <!--=========================================================================-->
 
 <div class="doc_text">
 
-<p>In order to use the LLVM test suite, you will need all of the software
+<p>In order to use the LLVM testing infrastructure, you will need all of the software
 required to build LLVM, plus the following:</p>
 
 <dl>
@@ -101,19 +114,92 @@
 </div>
 
 <!--=========================================================================-->
-<div class="doc_section"><a name="quick">Quick Start</a></div>
+<div class="doc_section"><a name="org">LLVM testing infrastructure organization</a></div>
+<!--=========================================================================-->
+
+<div class="doc_text">
+
+<p>The LLVM testing infrastructure contains two major categories of tests: code
+fragments and whole programs. Code fragments are referred to as the "DejaGNU
+tests" and are in the <tt>llvm</tt> module in subversion under the
+<tt>llvm/test</tt> directory. The whole programs tests are referred to as the
+"Test suite" and are in the <tt>test-suite</tt> module in subversion.
+</p>
+
+</div>
+
+<!-- _______________________________________________________________________ -->
+<div class="doc_subsection"><a name="dejagnu">DejaGNU tests</a></div>
+<!-- _______________________________________________________________________ -->
+
+<div class="doc_text">
+
+<p>Code fragments are small pieces of code that test a specific feature of LLVM
+or trigger a specific bug in LLVM.  They are usually written in LLVM assembly
+language, but can be written in other languages if the test targets a particular
+language front end. These tests are driven by the DejaGNU testing framework,
+which is hidden behind a few simple makefiles.</p>
+
+<p>These code fragments are not complete programs. The code generated from them is
+never executed to determine correct behavior.</p> 
+
+<p>These code fragment tests are located in the <tt>llvm/test</tt>
+directory.</p>
+
+<p>Typically when a bug is found in LLVM, a regression test containing 
+just enough code to reproduce the problem should be written and placed 
+somewhere underneath this directory.  In most cases, this will be a small 
+piece of LLVM assembly language code, often distilled from an actual 
+application or benchmark.</p>
+
+</div>
+
+<!-- _______________________________________________________________________ -->
+<div class="doc_subsection"><a name="testsuite">Test suite</a></div>
+<!-- _______________________________________________________________________ -->
+
+<div class="doc_text">
+
+<p>The test suite contains whole programs, which are pieces of
+code which can be compiled and linked into a stand-alone program that can be
+executed.  These programs are generally written in high level languages such as
+C or C++, but sometimes they are written straight in LLVM assembly.</p>
+
+<p>These programs are compiled and then executed using several different
+methods (native compiler, LLVM C backend, LLVM JIT, LLVM native code generation,
+etc).  The output of these programs is compared to ensure that LLVM is compiling
+the program correctly.</p>
+
+<p>In addition to compiling and executing programs, whole program tests serve as
+a way of benchmarking LLVM performance, both in terms of the efficiency of the
+programs generated as well as the speed with which LLVM compiles, optimizes, and
+generates code.</p>
+
+<p>The test-suite is located in the <tt>test-suite</tt> Subversion module.</p> 
+
+</div>
+
+<!--=========================================================================-->
+<div class="doc_section"><a name="quick">Quick start</a></div>
 <!--=========================================================================-->
 
 <div class="doc_text">
 
-  <p>The tests are located in two separate Subversion modules. The basic feature
-  and regression tests are in the main "llvm" module under the directory 
-  <tt>llvm/test</tt>. A more comprehensive test suite that includes whole 
-programs in C and C++ is in the <tt>test-suite</tt> module. This module should 
-be checked out to the <tt>llvm/projects</tt> directory as llvm-test (for
-historical purpose).  When you <tt>configure</tt> the <tt>llvm</tt> module, 
-the <tt>llvm-test</tt> directory will be automatically configured. 
+  <p>The tests are located in two separate Subversion modules. The
+  DejaGNU tests are in the main "llvm" module under the directory 
+  <tt>llvm/test</tt> (so you get these tests for free with the main llvm tree).
+  The more comprehensive test suite that includes whole 
+programs in C and C++ is in the <tt>test-suite</tt> module. This module should
+be checked out to the <tt>llvm/projects</tt> directory (don't use another name
+then the default "test-suite", for then the test suite will be run every time
+you run <tt>make</tt> in the main <tt>llvm</tt> directory).
+When you <tt>configure</tt> the <tt>llvm</tt> module, 
+the <tt>test-suite</tt> directory will be automatically configured. 
 Alternatively, you can configure the <tt>test-suite</tt> module manually.</p>
+
+<!-- _______________________________________________________________________ -->
+<div class="doc_subsection"><a name="quickdejagnu">DejaGNU tests</a></div>
+<!-- _______________________________________________________________________ -->
 <p>To run all of the simple tests in LLVM using DejaGNU, use the master Makefile
  in the <tt>llvm/test</tt> directory:</p>
 
@@ -131,13 +217,13 @@
 </pre>
 </div>
 
-<p>To run only a subdirectory of tests in llvm/test using DejaGNU (ie.
-Regression/Transforms), just set the TESTSUITE variable to the path of the
+<p>To run only a subdirectory of tests in <tt>llvm/test</tt> using DejaGNU (ie.
+Transforms), just set the TESTSUITE variable to the path of the
 subdirectory (relative to <tt>llvm/test</tt>):</p>
 
 <div class="doc_code">
 <pre>
-% gmake -C llvm/test TESTSUITE=Regression/Transforms
+% gmake TESTSUITE=Transforms check
 </pre>
 </div>
 
@@ -145,95 +231,71 @@
 must have run the complete testsuite before you can specify a
 subdirectory.</b></p>
 
-<p>To run the comprehensive test suite (tests that compile and execute whole 
-programs), run the <tt>llvm-test</tt> tests:</p>
+<p>To run only a single test, set <tt>TESTONE</tt> to its path (relative to
+<tt>llvm/test</tt>) and make the <tt>check-one</tt> target:</p>
 
 <div class="doc_code">
 <pre>
-% cd llvm/projects
-% svn co http://llvm.org/svn/llvm-project/test-suite/trunk llvm-test
-% cd ..
-% ./configure --with-llvmgccdir=$LLVM_GCC_DIR
-% cd projects/llvm-test
-% gmake
+% gmake TESTONE=Feature/basictest.ll check-one
 </pre>
 </div>
 
-</div>
-
-<!--=========================================================================-->
-<div class="doc_section"><a name="org">LLVM Test Suite Organization</a></div>
-<!--=========================================================================-->
-
-<div class="doc_text">
-
-<p>The LLVM test suite contains two major categories of tests: code
-fragments and whole programs. Code fragments are in the <tt>llvm</tt> module
-under the <tt>llvm/test</tt> directory. The whole programs
-test suite is in the <tt>llvm-test</tt> module under the main directory.</p>
-
-</div>
-
 <!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="codefragments">Code Fragments</a></div>
+<div class="doc_subsection"><a name="quicktestsuite">Test suite</a></div>
 <!-- _______________________________________________________________________ -->
 
-<div class="doc_text">
-
-<p>Code fragments are small pieces of code that test a specific feature of LLVM
-or trigger a specific bug in LLVM.  They are usually written in LLVM assembly
-language, but can be written in other languages if the test targets a particular
-language front end.</p>
-
-<p>Code fragments are not complete programs, and they are never executed to
-determine correct behavior.</p> 
-
-<p>These code fragment tests are located in the <tt>llvm/test/Features</tt> and 
-<tt>llvm/test/Regression</tt> directories.</p>
+<p>To run the comprehensive test suite (tests that compile and execute whole 
+programs), first checkout and setup the <tt>test-suite</tt> module:</p>
 
+<div class="doc_code">
+<pre>
+% cd llvm/projects
+% svn co http://llvm.org/svn/llvm-project/test-suite/trunk test-suite
+% cd ..
+% ./configure --with-llvmgccdir=$LLVM_GCC_DIR
+</pre>
+<p>where <tt>$LLVM_GCC_DIR</tt> is the directory where you <em>installed</em>
+llvm-gcc, not it's src or obj dir.</p>
 </div>
 
-<!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="wholeprograms">Whole Programs</a></div>
-<!-- _______________________________________________________________________ -->
+<p>Then, run the entire test suite by running make in the <tt>test-suite</tt>
+directory:</p>
 
-<div class="doc_text">
+<div class="doc_code">
+<pre>
+% cd projects/test-suite
+% gmake
+</pre>
+</div>
 
-<p>Whole Programs are pieces of code which can be compiled and linked into a
-stand-alone program that can be executed.  These programs are generally written
-in high level languages such as C or C++, but sometimes they are written
-straight in LLVM assembly.</p>
+<p>Usually, running the "nightly" set of tests is a good idea, and you can also
+let it generate a report by running:</p>
 
-<p>These programs are compiled and then executed using several different
-methods (native compiler, LLVM C backend, LLVM JIT, LLVM native code generation,
-etc).  The output of these programs is compared to ensure that LLVM is compiling
-the program correctly.</p>
-
-<p>In addition to compiling and executing programs, whole program tests serve as
-a way of benchmarking LLVM performance, both in terms of the efficiency of the
-programs generated as well as the speed with which LLVM compiles, optimizes, and
-generates code.</p>
+<div class="doc_code">
+<pre>
+% cd projects/test-suite
+% gmake TEST=nightly report report.html
+</pre>
+</div>
 
-<p>All "whole program" tests are located in the <tt>test-suite</tt> Subversion
-module.</p> 
+<p>Any of the above commands can also be run in a subdirectory of
+<tt>projects/test-suite</tt> to run the specified test only on the programs in
+that subdirectory.</p>
 
 </div>
 
 <!--=========================================================================-->
-<div class="doc_section"><a name="tree">LLVM Test Suite Tree</a></div>
+<div class="doc_section"><a name="dgstructure">DejaGNU structure</a></div>
 <!--=========================================================================-->
-
 <div class="doc_text">
+  <p>The LLVM DejaGNU tests are driven by DejaGNU together with GNU Make and are
+  located in the <tt>llvm/test</tt> directory.
 
-<p>Each type of test in the LLVM test suite has its own directory. The major
-subtrees of the test suite directory tree are as follows:</p>
-    
-<ul>
-  <li><tt>llvm/test</tt>
   <p>This directory contains a large array of small tests
   that exercise various features of LLVM and to ensure that regressions do not
   occur. The directory is broken into several sub-directories, each focused on
   a particular area of LLVM. A few of the important ones are:</p>
+
   <ul>
     <li><tt>Analysis</tt>: checks Analysis passes.</li>
     <li><tt>Archive</tt>: checks the Archive library.</li>
@@ -246,55 +308,13 @@
     transforms to ensure they make the right transformations.</li>
     <li><tt>Verifier</tt>: tests the IR verifier.</li>
   </ul>
-  <p>Typically when a bug is found in LLVM, a regression test containing 
-  just enough code to reproduce the problem should be written and placed 
-  somewhere underneath this directory.  In most cases, this will be a small 
-  piece of LLVM assembly language code, often distilled from an actual 
-  application or benchmark.</p></li>
-
-<li><tt>test-suite</tt>
-<p>The <tt>test-suite</tt> module contains programs that can be compiled 
-with LLVM and executed.  These programs are compiled using the native compiler
-and various LLVM backends.  The output from the program compiled with the 
-native compiler is assumed correct; the results from the other programs are
-compared to the native program output and pass if they match.</p>
-
-<p>In addition for testing correctness, the <tt>llvm-test</tt> directory also
-performs timing tests of various LLVM optimizations.  It also records
-compilation times for the compilers and the JIT.  This information can be
-used to compare the effectiveness of LLVM's optimizations and code
-generation.</p></li>
-
-<li><tt>llvm-test/SingleSource</tt>
-<p>The SingleSource directory contains test programs that are only a single 
-source file in size.  These are usually small benchmark programs or small 
-programs that calculate a particular value.  Several such programs are grouped 
-together in each directory.</p></li>
-
-<li><tt>llvm-test/MultiSource</tt>
-<p>The MultiSource directory contains subdirectories which contain entire 
-programs with multiple source files.  Large benchmarks and whole applications 
-go here.</p></li>
-
-<li><tt>llvm-test/External</tt>
-<p>The External directory contains Makefiles for building code that is external
-to (i.e., not distributed with) LLVM.  The most prominent members of this
-directory are the SPEC 95 and SPEC 2000 benchmark suites.  The presence and
-location of these external programs is configured by the llvm-test
-<tt>configure</tt> script.</p></li>
-      
-</ul>
 
 </div>
-<!--=========================================================================-->
-<div class="doc_section"><a name="dgstructure">DejaGNU Structure</a></div>
-<!--=========================================================================-->
-<div class="doc_text">
-  <p>The LLVM test suite is partially driven by DejaGNU and partially driven by 
-  GNU Make. Specifically, the Features and Regression tests are all driven by 
-  DejaGNU. The <tt>llvm-test</tt> module is currently driven by a set of 
-  Makefiles.</p>
 
+<!-- _______________________________________________________________________ -->
+<div class="doc_subsection"><a name="dgcustom">Writing new DejaGNU tests</a></div>
+<!-- _______________________________________________________________________ -->
+<div class="doc_text">
   <p>The DejaGNU structure is very simple, but does require some information to 
   be set. This information is gathered via <tt>configure</tt> and is written 
   to a file, <tt>site.exp</tt> in <tt>llvm/test</tt>. The <tt>llvm/test</tt> 
@@ -303,7 +323,9 @@
   <p>In order for DejaGNU to work, each directory of tests must have a 
   <tt>dg.exp</tt> file. DejaGNU looks for this file to determine how to run the
   tests. This file is just a Tcl script and it can do anything you want, but 
-  we've standardized it for the LLVM regression tests. It simply loads a Tcl 
+  we've standardized it for the LLVM regression tests. If you're adding a
+  directory of tests, just copy <tt>dg.exp</tt> from another directory to get
+  running. The standard <tt>dg.exp</tt> simply loads a Tcl 
   library (<tt>test/lib/llvm.exp</tt>) and calls the <tt>llvm_runtests</tt> 
   function defined in that library with a list of file names to run. The names 
   are obtained by using Tcl's glob command.  Any directory that contains only
@@ -332,7 +354,7 @@
   line to be concatenated with the next one. In this way you can build up long
   pipelines of commands without making huge line lengths. The lines ending in
   <tt>\</tt> are concatenated until a RUN line that doesn't end in <tt>\</tt> is
-  found. This concatenated set or RUN lines then constitutes one execution. 
+  found. This concatenated set of RUN lines then constitutes one execution. 
   Tcl will substitute variables and arrange for the pipeline to be executed. If
   any process in the pipeline fails, the entire line (and test case) fails too.
   </p>
@@ -432,7 +454,8 @@
 </div>
 
 <!-- _______________________________________________________________________ -->
-<div class="doc_subsection"><a name="dgvars">Vars And Substitutions</a></div>
+<div class="doc_subsection"><a name="dgvars">Variables and substitutions</a></div>
+<!-- _______________________________________________________________________ -->
 <div class="doc_text">
   <p>With a RUN line there are a number of substitutions that are permitted. In
   general, any Tcl variable that is available in the <tt>substitute</tt> 
@@ -541,9 +564,12 @@
   
 <!-- _______________________________________________________________________ -->
 <div class="doc_subsection"><a name="dgfeatures">Other Features</a></div>
+<!-- _______________________________________________________________________ -->
 <div class="doc_text">
   <p>To make RUN line writing easier, there are several shell scripts located
-  in the <tt>llvm/test/Scripts</tt> directory. For example:</p>
+  in the <tt>llvm/test/Scripts</tt> directory. This directory is in the PATH
+  when running tests, so you can just call these scripts using their name. For
+  example:</p>
   <dl>
     <dt><b>ignore</b></dt>
     <dd>This script runs its arguments and then always returns 0. This is useful
@@ -583,7 +609,7 @@
   <p>To make the output more useful, the <tt>llvm_runtest</tt> function wil
   scan the lines of the test case for ones that contain a pattern that matches
   PR[0-9]+. This is the syntax for specifying a PR (Problem Report) number that
-  is related to the test case. The numer after "PR" specifies the LLVM bugzilla
+  is related to the test case. The number after "PR" specifies the LLVM bugzilla
   number. When a PR number is specified, it will be used in the pass/fail
   reporting. This is useful to quickly get some context when a test fails.</p>
 
@@ -597,66 +623,75 @@
 </div>
 
 <!--=========================================================================-->
-<div class="doc_section"><a name="progstructure"><tt>llvm-test</tt> 
+<div class="doc_section"><a name="testsuitestructure">Test suite
 Structure</a></div>
 <!--=========================================================================-->
 
 <div class="doc_text">
 
-<p>As mentioned previously, the <tt>llvm-test</tt> module  provides three types
-of tests: MultiSource, SingleSource, and External.  Each tree is then subdivided
-into several categories, including applications, benchmarks, regression tests,
-code that is strange grammatically, etc.  These organizations should be
-relatively self explanatory.</p>
+<p>The <tt>test-suite</tt> module contains a number of programs that can be compiled 
+with LLVM and executed. These programs are compiled using the native compiler
+and various LLVM backends. The output from the program compiled with the 
+native compiler is assumed correct; the results from the other programs are
+compared to the native program output and pass if they match.</p>
 
-<p>In addition to the regular "whole program"  tests, the <tt>llvm-test</tt>
-module also provides a mechanism for compiling the programs in different ways.
-If the variable TEST is defined on the gmake command line, the test system will
-include a Makefile named <tt>TEST.<value of TEST variable>.Makefile</tt>.
-This Makefile can modify build rules to yield different results.</p>
+<p>When executing tests, it is usually a good idea to start out with a subset of
+the available tests or programs. This makes test run times smaller at first and
+later on this is useful to investigate individual test failures. To run some
+test only on a subset of programs, simply change directory to the programs you
+want tested and run <tt>gmake</tt> there. Alternatively, you can run a different
+test using the <tt>TEST</tt> variable to change what tests or run on the
+selected programs (see below for more info).</p>
 
-<p>For example, the LLVM nightly tester uses <tt>TEST.nightly.Makefile</tt> to
-create the nightly test reports.  To run the nightly tests, run <tt>gmake
-TEST=nightly</tt>.</p>
+<p>In addition for testing correctness, the <tt>llvm-test</tt> directory also
+performs timing tests of various LLVM optimizations.  It also records
+compilation times for the compilers and the JIT.  This information can be
+used to compare the effectiveness of LLVM's optimizations and code
+generation.</p>
 
-<p>There are several TEST Makefiles available in the tree.  Some of them are
-designed for internal LLVM research and will not work outside of the LLVM
-research group.  They may still be valuable, however, as a guide to writing your
-own TEST Makefile for any optimization or analysis passes that you develop with
-LLVM.</p>
+<p><tt>llvm-test</tt> tests are divided into three types of tests: MultiSource,
+SingleSource, and External.</p> 
 
-<p>Note, when configuring the <tt>llvm-test</tt> module, you might want to
-specify the following configuration options:</p>
-<dl>
-  <dt><i>--enable-spec2000</i>
-  <dt><i>--enable-spec2000=<<tt>directory</tt>></i>
-  <dd>
-    Enable the use of SPEC2000 when testing LLVM.  This is disabled by default
-    (unless <tt>configure</tt> finds SPEC2000 installed).  By specifying
-    <tt>directory</tt>, you can tell configure where to find the SPEC2000
-    benchmarks.  If <tt>directory</tt> is left unspecified, <tt>configure</tt>
-    uses the default value
-    <tt>/home/vadve/shared/benchmarks/speccpu2000/benchspec</tt>.
-    <p>
+<ul>
+<li><tt>llvm-test/SingleSource</tt>
+<p>The SingleSource directory contains test programs that are only a single 
+source file in size.  These are usually small benchmark programs or small 
+programs that calculate a particular value.  Several such programs are grouped 
+together in each directory.</p></li>
 
-  <dt><i>--enable-spec95</i>
-  <dt><i>--enable-spec95=<<tt>directory</tt>></i>
-  <dd>
-    Enable the use of SPEC95 when testing LLVM.  It is similar to the
-    <i>--enable-spec2000</i> option.
-    <p>
+<li><tt>llvm-test/MultiSource</tt>
+<p>The MultiSource directory contains subdirectories which contain entire 
+programs with multiple source files.  Large benchmarks and whole applications 
+go here.</p></li>
+
+<li><tt>llvm-test/External</tt>
+<p>The External directory contains Makefiles for building code that is external
+to (i.e., not distributed with) LLVM.  The most prominent members of this
+directory are the SPEC 95 and SPEC 2000 benchmark suites. The <tt>External</tt>
+directory does not contain these actual tests,but only the Makefiles that know
+how to properly compile these programs from somewhere else. The presence and
+location of these external programs is configured by the llvm-test
+<tt>configure</tt> script.</p></li>
+</ul>
+
+<p>Each tree is then subdivided into several categories, including applications,
+benchmarks, regression tests, code that is strange grammatically, etc.  These
+organizations should be relatively self explanatory.</p>
+
+<p>Some tests are known to fail.  Some are bugs that we have not fixed yet;
+others are features that we haven't added yet (or may never add).  In DejaGNU,
+the result for such tests will be XFAIL (eXpected FAILure).  In this way, you
+can tell the difference between an expected and unexpected failure.</p>
+
+<p>The tests in the test suite have no such feature at this time. If the
+test passes, only warnings and other miscellaneous output will be generated.  If
+a test fails, a large <program> FAILED message will be displayed.  This
+will help you separate benign warnings from actual test failures.</p>
 
-  <dt><i>--enable-povray</i>
-  <dt><i>--enable-povray=<<tt>directory</tt>></i>
-  <dd>
-    Enable the use of Povray as an external test.  Versions of Povray written
-    in C should work.  This option is similar to the <i>--enable-spec2000</i>
-    option.
-</dl>
 </div>
 
 <!--=========================================================================-->
-<div class="doc_section"><a name="run">Running the LLVM Tests</a></div>
+<div class="doc_section"><a name="testsuiterun">Running the test suite</a></div>
 <!--=========================================================================-->
 
 <div class="doc_text">
@@ -665,22 +700,7 @@
 <i>are not</i> executed inside of the LLVM source tree. This is because the
 test suite creates temporary files during execution.</p>
 
-<p>The master Makefile in <tt>llvm/test</tt> is capable of running only the
-DejaGNU driven tests. By default, it will run all of these tests.</p>
-
-<p>To run only the DejaGNU driven tests, run <tt>gmake</tt> at the
-command line in <tt>llvm/test</tt>.  To run a specific directory of tests, use
-the <tt>TESTSUITE</tt> variable.
-</p>
-
-<p>For example, to run the Regression tests, type 
-<tt>gmake TESTSUITE=Regression</tt> in <tt>llvm/tests</tt>.</p>
-
-<p>Note that there are no Makefiles in <tt>llvm/test/Features</tt> and
-<tt>llvm/test/Regression</tt>. You must use DejaGNU from the <tt>llvm/test</tt>
-directory to run them.</p>
-
-<p>To run the <tt>llvm-test</tt> suite, you need to use the following steps:</p>
+<p>To run the test suite, you need to use the following steps:</p>
 
 <ol>
   <li><tt>cd</tt> into the <tt>llvm/projects</tt> directory</li>
@@ -689,70 +709,130 @@
 
 <div class="doc_code">
 <pre>
-% svn co http://llvm.org/svn/llvm-project/test-suite/trunk llvm-test
+% svn co http://llvm.org/svn/llvm-project/test-suite/trunk test-suite
 </pre>
 </div>
 
       <p>This will get the test suite into <tt>llvm/projects/llvm-test</tt></p>
 
-  <li><p>Configure the test suite using llvm configure. This will automatically configure llvm-test. 
-         You must do it from the top level otherwise llvm-gcc will not be set which is required to 
-        run llvm-test:</p>
+  <li><p>Configure the test suite using llvm configure. This will automatically
+  configure test-suite.  You must do it from the top level otherwise llvm-gcc
+  will not be set which is required to run llvm-test:</p>
 <div class="doc_code">
 <pre>
 % cd $LLVM_OBJ_ROOT ; $LLVM_SRC_ROOT/configure --with-llvmgccdir=$LLVM_GCC_DIR
 </pre>
 </div>
-  <li><tt>gmake</tt></li>
+    <p>Note that that <tt>$LLVM_GCC_DIR</tt> is the directory where you
+    <em>installed</em> llvm-gcc, not its src or obj directory.</p>
+  </li>
+
+  <li><p>Change back to the <tt>llvm/projects/test-suite</tt> directory you created before
+  and run <tt>gmake</tt> (or just "<tt>make</tt>" on systems where GNU make is
+  the default, such as linux.</p></li>
 </ol>
 <p>Note that the second and third steps only need to be done once. After you
 have the suite checked out and configured, you don't need to do it again (unless
-the test code or configure script changes). $LLVM_GCC_DIR is the path to the LLVM 
-C/C++ FrontEnd</p>
+the test code or configure script changes).</p>
 
-<p>To make a specialized test (use one of the
-<tt>llvm-test/TEST.<type>.Makefile</tt>s), just run:</p>
+<!-- _______________________________________________________________________ -->
+<div class="doc_subsection">
+<a name="testsuiteexternal">Configuring external tests</a></div>
+<!-- _______________________________________________________________________ -->
 
-<div class="doc_code">
-<pre>
-% gmake TEST=<type> test
-</pre>
-</div>
+<div class="doc_text">
+<p>Note, when configuring the <tt>test-suite</tt> module, you might want to
+specify the following configuration options:</p>
+<dl>
+  <dt><i>--enable-spec2000</i>
+  <dt><i>--enable-spec2000=<<tt>directory</tt>></i>
+  <dd>
+    Enable the use of SPEC2000 when testing LLVM.  This is disabled by default
+    (unless <tt>configure</tt> finds SPEC2000 installed).  By specifying
+    <tt>directory</tt>, you can tell configure where to find the SPEC2000
+    benchmarks.  If <tt>directory</tt> is left unspecified, <tt>configure</tt>
+    uses the default value
+    <tt>/home/vadve/shared/benchmarks/speccpu2000/benchspec</tt>.
+    <p>
 
-<p>For example, you could run the nightly tester tests using the following
-commands:</p>
+  <dt><i>--enable-spec95</i>
+  <dt><i>--enable-spec95=<<tt>directory</tt>></i>
+  <dd>
+    Enable the use of SPEC95 when testing LLVM.  It is similar to the
+    <i>--enable-spec2000</i> option.
+    <p>
 
-<div class="doc_code">
-<pre>
-% cd llvm/projects/llvm-test
-% gmake TEST=nightly test
-</pre>
+  <dt><i>--enable-povray</i>
+  <dt><i>--enable-povray=<<tt>directory</tt>></i>
+  <dd>
+    Enable the use of Povray as an external test.  Versions of Povray written
+    in C should work.  This option is similar to the <i>--enable-spec2000</i>
+    option.
+</dl>
 </div>
 
-<p>Regardless of which test you're running, the results are printed on standard
-output and standard error.  You can redirect these results to a file if you
-choose.</p>
+<!-- _______________________________________________________________________ -->
+<div class="doc_subsection">
+<a name="testsuitetests">Running different tests</a></div>
+<!-- _______________________________________________________________________ -->
+<div class="doc_text">
+<p>In addition to the regular "whole program"  tests, the <tt>test-suite</tt>
+module also provides a mechanism for compiling the programs in different ways.
+If the variable TEST is defined on the <tt>gmake</tt> command line, the test system will
+include a Makefile named <tt>TEST.<value of TEST variable>.Makefile</tt>.
+This Makefile can modify build rules to yield different results.</p>
 
-<p>Some tests are known to fail.  Some are bugs that we have not fixed yet;
-others are features that we haven't added yet (or may never add).  In DejaGNU,
-the result for such tests will be XFAIL (eXpected FAILure).  In this way, you
-can tell the difference between an expected and unexpected failure.</p>
+<p>For example, the LLVM nightly tester uses <tt>TEST.nightly.Makefile</tt> to
+create the nightly test reports.  To run the nightly tests, run <tt>gmake
+TEST=nightly</tt>.</p>
 
-<p>The tests in <tt>llvm-test</tt> have no such feature at this time. If the
-test passes, only warnings and other miscellaneous output will be generated.  If
-a test fails, a large <program> FAILED message will be displayed.  This
-will help you separate benign warnings from actual test failures.</p>
+<p>There are several TEST Makefiles available in the tree.  Some of them are
+designed for internal LLVM research and will not work outside of the LLVM
+research group.  They may still be valuable, however, as a guide to writing your
+own TEST Makefile for any optimization or analysis passes that you develop with
+LLVM.</p>
+
+</div>
 
+<!-- _______________________________________________________________________ -->
+<div class="doc_subsection">
+<a name="testsuiteoutput">Generating test output</a></div>
+<!-- _______________________________________________________________________ -->
+<div class="doc_text">
+  <p>There are a number of ways to run the tests and generate output. The most
+  simple one is simply running <tt>gmake</tt> with no arguments. This will
+  compile and run all programs in the tree using a number of different methods
+  and compare results. Any failures are reported in the output, but are likely
+  drowned in the other output. Passes are not reported explicitely.</p>
+
+  <p>Somewhat better is running <tt>gmake TEST=sometest test</tt>, which runs
+  the specified test and usually adds per-program summaries to the output
+  (depending on which sometest you use). For example, the <tt>nightly</tt> test
+  explicitely outputs TEST-PASS or TEST-FAIL for every test after each program.
+  Though these lines are still drowned in the output, it's easy to grep the
+  output logs in the Output directories.</p>
+
+  <p>Even better are the <tt>report</tt> and <tt>report.format</tt> targets
+  (where <tt>format</tt> is one of <tt>html</tt>, <tt>csv</tt>, <tt>text</tt> or
+  <tt>graphs</tt>). The exact contents of the report are dependent on which
+  <tt>TEST</tt> you are running, but the text results are always shown at the
+  end of the run and the results are always stored in the
+  <tt>report.<type>.format</tt> file (when running with
+  <tt>TEST=<type></tt>).
+
+  The <tt>report</tt> also generate a file called
+  <tt>report.<type>.raw.out</tt> containing the output of the entire test
+  run.
 </div>
 
 <!-- _______________________________________________________________________ -->
 <div class="doc_subsection">
-<a name="customtest">Writing custom tests for llvm-test</a></div>
+<a name="testsuitecustom">Writing custom tests for the test suite</a></div>
 <!-- _______________________________________________________________________ -->
 
 <div class="doc_text">
 
-<p>Assuming you can run llvm-test, (e.g. "<tt>gmake TEST=nightly report</tt>"
+<p>Assuming you can run the test suite, (e.g. "<tt>gmake TEST=nightly report</tt>"
 should work), it is really easy to run optimizations or code generator
 components against every program in the tree, collecting statistics or running
 custom checks for correctness.  At base, this is how the nightly tester works,
@@ -765,10 +845,10 @@
 
 <p>Following this, you can set up a test and a report that collects these and
 formats them for easy viewing.  This consists of two files, an
-"<tt>llvm-test/TEST.XXX.Makefile</tt>" fragment (where XXX is the name of your
+"<tt>test-suite/TEST.XXX.Makefile</tt>" fragment (where XXX is the name of your
 test) and an "<tt>llvm-test/TEST.XXX.report</tt>" file that indicates how to
 format the output into a table.  There are many example reports of various
-levels of sophistication included with llvm-test, and the framework is very
+levels of sophistication included with the test suite, and the framework is very
 general.</p>
 
 <p>If you are interested in testing an optimization pass, check out the
@@ -776,7 +856,7 @@
 
 <div class="doc_code">
 <pre>
-% cd llvm/projects/llvm-test/MultiSource/Benchmarks  # or some other level
+% cd llvm/projects/test-suite/MultiSource/Benchmarks  # or some other level
 % make TEST=libcalls report
 </pre>
 </div>
@@ -807,7 +887,7 @@
 You can also use the "TEST=libcalls report.html" target to get the table in HTML
 form, similarly for report.csv and report.tex.</p>
 
-<p>The source for this is in llvm-test/TEST.libcalls.*.  The format is pretty
+<p>The source for this is in test-suite/TEST.libcalls.*.  The format is pretty
 simple: the Makefile indicates how to run the test (in this case, 
 "<tt>opt -simplify-libcalls -stats</tt>"), and the report contains one line for
 each column of the output.  The first value is the header for the column and the
@@ -826,7 +906,7 @@
 <p>
 The <a href="http://llvm.org/nightlytest/">LLVM Nightly Testers</a>
 automatically check out an LLVM tree, build it, run the "nightly" 
-program test (described above), run all of the feature and regression tests, 
+program test (described above), run all of the DejaGNU tests, 
 delete the checked out tree, and then submit the results to 
 <a href="http://llvm.org/nightlytest/">http://llvm.org/nightlytest/</a>. 
 After test results are submitted to 
@@ -884,10 +964,10 @@
   <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
   src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
   <a href="http://validator.w3.org/check/referer"><img
-  src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
+  src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
 
   John T. Criswell, Reid Spencer, and Tanya Lattner<br>
-  <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br/>
+  <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
   Last modified: $Date$
 </address>
 </body>

Modified: llvm/branches/non-call-eh/docs/index.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/index.html?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/index.html (original)
+++ llvm/branches/non-call-eh/docs/index.html Sun Jul  6 15:45:41 2008
@@ -105,8 +105,8 @@
 Instructions for properly submitting information about any bugs you run into in
 the LLVM system.</li>
 
-<li><a href="TestingGuide.html">LLVM Test Suite Guide</a> - A reference
-manual for using the LLVM test suite.</li>
+<li><a href="TestingGuide.html">LLVM Testing Infrastructure Guide</a> - A reference
+manual for using the LLVM testing infrastructure.</li>
 
 <li><a href="GCCFEBuildInstrs.html">How to build the C/C++ front-end</a> -
 Instructions for building the front-end from source.</li>

Modified: llvm/branches/non-call-eh/docs/tutorial/JITTutorial1.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/tutorial/JITTutorial1.html?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/tutorial/JITTutorial1.html (original)
+++ llvm/branches/non-call-eh/docs/tutorial/JITTutorial1.html Sun Jul  6 15:45:41 2008
@@ -48,7 +48,7 @@
 </pre>
 </div>
 
-<p>If you're unsure what the above code says, skim through the <a href="../LangRef.html">LLVM Language Reference Manual</a> and convince yourself that the above LLVM IR is actually equivalent to the original function.  Once you’re satisfied with that, let’s move on to actually generating it programmatically!</p>
+<p>If you're unsure what the above code says, skim through the <a href="../LangRef.html">LLVM Language Reference Manual</a> and convince yourself that the above LLVM IR is actually equivalent to the original function.  Once you’re satisfied with that, let's move on to actually generating it programmatically!</p>
 
 <p>Of course, before we can start, we need to <code>#include</code> the appropriate LLVM header files:</p>
 
@@ -64,7 +64,7 @@
 </pre>
 </div>
 
-<p>Now, let’s get started on our real program.  Here’s what our basic <code>main()</code> will look like:</p>
+<p>Now, let's get started on our real program.  Here's what our basic <code>main()</code> will look like:</p>
 
 <div class="doc_code">
 <pre>
@@ -81,6 +81,7 @@
   PM.add(new PrintModulePass(&llvm::cout));
   PM.run(*Mod);
 
+  delete Mod;
   return 0;
 }
 </pre>
@@ -88,11 +89,18 @@
 
 <p>The first segment is pretty simple: it creates an LLVM “module.”  In LLVM, a module represents a single unit of code that is to be processed together.  A module contains things like global variables, function declarations, and implementations.  Here we’ve declared a <code>makeLLVMModule()</code> function to do the real work of creating the module.  Don’t worry, we’ll be looking at that one next!</p>
 
-<p>The second segment runs the LLVM module verifier on our newly created module.  While this probably isn’t really necessary for a simple module like this one, it’s always a good idea, especially if you’re generating LLVM IR based on some input.  The verifier will print an error message if your LLVM module is malformed in any way.</p>
+<p>The second segment runs the LLVM module verifier on our newly created module.  While this probably isn’t really necessary for a simple module like this one, it's always a good idea, especially if you’re generating LLVM IR based on some input.  The verifier will print an error message if your LLVM module is malformed in any way.</p>
 
-<p>Finally, we instantiate an LLVM <code>PassManager</code> and run the <code>PrintModulePass</code> on our module.  LLVM uses an explicit pass infrastructure to manage optimizations and various other things.  A <code>PassManager</code>, as should be obvious from its name, manages passes: it is responsible for scheduling them, invoking them, and insuring the proper disposal after we’re done with them.  For this example, we’re just using a trivial pass that prints out our module in textual form.</p>
+<p>Finally, we instantiate an LLVM <code>PassManager</code> and run
+the <code>PrintModulePass</code> on our module.  LLVM uses an explicit pass
+infrastructure to manage optimizations and various other things.
+A <code>PassManager</code>, as should be obvious from its name, manages passes:
+it is responsible for scheduling them, invoking them, and ensuring the proper
+disposal after we’re done with them.  For this example, we’re just using a
+trivial pass that prints out our module in textual form.</p>
 
-<p>Now onto the interesting part: creating and populating a module.  Here’s the first chunk of our <code>makeLLVMModule()</code>:</p>
+<p>Now onto the interesting part: creating and populating a module.  Here's the
+first chunk of our <code>makeLLVMModule()</code>:</p>
 
 <div class="doc_code">
 <pre>
@@ -122,7 +130,9 @@
 
 <p>You'll notice that <code>getOrInsertFunction()</code> doesn't actually return a <code>Function*</code>.  This is because <code>getOrInsertFunction()</code> will return a cast of the existing function if the function already existed with a different prototype.  Since we know that there's not already a <code>mul_add</code> function, we can safely just cast <code>c</code> to a <code>Function*</code>.
   
-<p>In addition, we set the calling convention for our new function to be the C calling convention.  This isn’t strictly necessary, but it insures that our new function will interoperate properly with C code, which is a good thing.</p>
+<p>In addition, we set the calling convention for our new function to be the C
+calling convention.  This isn’t strictly necessary, but it ensures that our new
+function will interoperate properly with C code, which is a good thing.</p>
 
 <div class="doc_code">
 <pre>
@@ -136,7 +146,7 @@
 </pre>
 </div>
 
-<p>While we’re setting up our function, let’s also give names to the parameters.  This also isn’t strictly necessary (LLVM will generate names for them if you don’t specify them), but it’ll make looking at our output somewhat more pleasant.  To name the parameters, we iterate over the arguments of our function and call <code>setName()</code> on them.  We’ll also keep the pointer to <code>x</code>, <code>y</code>, and <code>z</code> around, since we’ll need them when we get around to creating instructions.</p>
+<p>While we’re setting up our function, let's also give names to the parameters.  This also isn’t strictly necessary (LLVM will generate names for them if you don’t specify them), but it’ll make looking at our output somewhat more pleasant.  To name the parameters, we iterate over the arguments of our function and call <code>setName()</code> on them.  We’ll also keep the pointer to <code>x</code>, <code>y</code>, and <code>z</code> around, since we’ll need them when we get around to creating instructions.</p>
 
 <p>Great!  We have a function now.  But what good is a function if it has no body?  Before we start working on a body for our new function, we need to recall some details of the LLVM IR.  The IR, being an abstract assembly language, represents control flow using jumps (we call them branches), both conditional and unconditional.  The straight-line sequences of code between branches are called basic blocks, or just blocks.  To create a body for our function, we fill it with blocks:</p>
 
@@ -152,7 +162,7 @@
 <div class="doc_code">
 <pre>
   Value* tmp = builder.CreateBinOp(Instruction::Mul,
-                                    x, y, "tmp");
+                                   x, y, "tmp");
   Value* tmp2 = builder.CreateBinOp(Instruction::Add,
                                     tmp, z, "tmp2");
 
@@ -163,9 +173,9 @@
 </pre>
 </div>
 
-<p>The final step in creating our function is to create the instructions that make it up.  Our <code>mul_add</code> function is composed of just three instructions: a multiply, an add, and a return.  <code>IRBuilder</code> gives us a simple interface for constructing these instructions and appending them to the “entry” block.  Each of the calls to <code>IRBuilder</code> returns a <code>Value*</code> that represents the value yielded by the instruction.  You’ll also notice that, above, <code>x</code>, <code>y</code>, and <code>z</code> are also <code>Value*</code>’s, so it’s clear that instructions operate on <code>Value*</code>’s.</p>
+<p>The final step in creating our function is to create the instructions that make it up.  Our <code>mul_add</code> function is composed of just three instructions: a multiply, an add, and a return.  <code>IRBuilder</code> gives us a simple interface for constructing these instructions and appending them to the “entry” block.  Each of the calls to <code>IRBuilder</code> returns a <code>Value*</code> that represents the value yielded by the instruction.  You’ll also notice that, above, <code>x</code>, <code>y</code>, and <code>z</code> are also <code>Value*</code>'s, so it's clear that instructions operate on <code>Value*</code>'s.</p>
 
-<p>And that’s it!  Now you can compile and run your code, and get a wonderful textual print out of the LLVM IR we saw at the beginning.  To compile, use the following command line as a guide:</p>
+<p>And that's it!  Now you can compile and run your code, and get a wonderful textual print out of the LLVM IR we saw at the beginning.  To compile, use the following command line as a guide:</p>
 
 <div class="doc_code">
 <pre>

Modified: llvm/branches/non-call-eh/docs/tutorial/JITTutorial2.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/tutorial/JITTutorial2.html?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/tutorial/JITTutorial2.html (original)
+++ llvm/branches/non-call-eh/docs/tutorial/JITTutorial2.html Sun Jul  6 15:45:41 2008
@@ -70,7 +70,8 @@
   PassManager PM;
   PM.add(new PrintModulePass(&llvm::cout));
   PM.run(*Mod);
-  
+
+  delete Mod;  
   return 0;
 }
 
@@ -125,7 +126,15 @@
 </pre>
 </div>
 
-<p><code>cond_false</code> is a more interesting block: we now know that <code>x != y</code>, so we must branch again to determine which of <code>x</code> and <code>y</code> is larger.  This is achieved using the <code>ICmpULT</code> instruction, which stands for <em>integer comparison for unsigned less-than</em>.  In LLVM, integer types do not carry sign; a 32-bit integer pseudo-register can interpreted as signed or unsigned without casting.  Whether a signed or unsigned interpretation is desired is specified in the instruction.  This is why several instructions in the LLVM IR, such as integer less-than, include a specifier for signed or unsigned.</p>
+<p><code>cond_false</code> is a more interesting block: we now know that <code>x
+!= y</code>, so we must branch again to determine which of <code>x</code>
+and <code>y</code> is larger.  This is achieved using the <code>ICmpULT</code>
+instruction, which stands for <em>integer comparison for unsigned
+less-than</em>.  In LLVM, integer types do not carry sign; a 32-bit integer
+pseudo-register can be interpreted as signed or unsigned without casting.
+Whether a signed or unsigned interpretation is desired is specified in the
+instruction.  This is why several instructions in the LLVM IR, such as integer
+less-than, include a specifier for signed or unsigned.</p>
 
 <p>Also note that we're again making use of LLVM's automatic name uniquing, this time at a register level.  We've deliberately chosen to name every instruction "tmp" to illustrate that LLVM will give them all unique names without getting confused.</p>
 

Modified: llvm/branches/non-call-eh/docs/tutorial/LangImpl3.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/tutorial/LangImpl3.html?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/tutorial/LangImpl3.html (original)
+++ llvm/branches/non-call-eh/docs/tutorial/LangImpl3.html Sun Jul  6 15:45:41 2008
@@ -48,7 +48,11 @@
 </p>
 
 <p><b>Please note</b>: the code in this chapter and later require LLVM 2.2 or
-LLVM SVN to work.  LLVM 2.1 and before will not work with it.</p>
+later.  LLVM 2.1 and before will not work with it.  Also note that you need
+to use a version of this tutorial that matches your LLVM release: If you are
+using an official LLVM release, use the version of the documentation included
+with your release or on the <a href="http://llvm.org/releases/">llvm.org 
+releases page</a>.</p>
 
 </div>
 
@@ -155,7 +159,7 @@
 <div class="doc_code">
 <pre>
 Value *NumberExprAST::Codegen() {
-  return ConstantFP::get(Type::DoubleTy, APFloat(Val));
+  return ConstantFP::get(APFloat(Val));
 }
 </pre>
 </div>
@@ -166,7 +170,7 @@
 constants of <em>A</em>rbitrary <em>P</em>recision).  This code basically just
 creates and returns a <tt>ConstantFP</tt>.  Note that in the LLVM IR
 that constants are all uniqued together and shared.  For this reason, the API
-uses "the foo::get(..)" idiom instead of "new foo(..)" or "foo::create(..)".</p>
+uses "the foo::get(..)" idiom instead of "new foo(..)" or "foo::Create(..)".</p>
 
 <div class="doc_code">
 <pre>
@@ -1029,7 +1033,7 @@
 Value *ErrorV(const char *Str) { Error(Str); return 0; }
 
 Value *NumberExprAST::Codegen() {
-  return ConstantFP::get(Type::DoubleTy, APFloat(Val));
+  return ConstantFP::get(APFloat(Val));
 }
 
 Value *VariableExprAST::Codegen() {

Modified: llvm/branches/non-call-eh/docs/tutorial/LangImpl4.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/tutorial/LangImpl4.html?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/tutorial/LangImpl4.html (original)
+++ llvm/branches/non-call-eh/docs/tutorial/LangImpl4.html Sun Jul  6 15:45:41 2008
@@ -863,7 +863,7 @@
 Value *ErrorV(const char *Str) { Error(Str); return 0; }
 
 Value *NumberExprAST::Codegen() {
-  return ConstantFP::get(Type::DoubleTy, APFloat(Val));
+  return ConstantFP::get(APFloat(Val));
 }
 
 Value *VariableExprAST::Codegen() {

Modified: llvm/branches/non-call-eh/docs/tutorial/LangImpl5.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/tutorial/LangImpl5.html?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/tutorial/LangImpl5.html (original)
+++ llvm/branches/non-call-eh/docs/tutorial/LangImpl5.html Sun Jul  6 15:45:41 2008
@@ -364,7 +364,7 @@
   
   // Convert condition to a bool by comparing equal to 0.0.
   CondV = Builder.CreateFCmpONE(CondV, 
-                                ConstantFP::get(Type::DoubleTy, APFloat(0.0)),
+                                ConstantFP::get(APFloat(0.0)),
                                 "ifcond");
 </pre>
 </div>
@@ -796,7 +796,7 @@
     if (StepVal == 0) return 0;
   } else {
     // If not specified, use 1.0.
-    StepVal = ConstantFP::get(Type::DoubleTy, APFloat(1.0));
+    StepVal = ConstantFP::get(APFloat(1.0));
   }
   
   Value *NextVar = Builder.CreateAdd(Variable, StepVal, "nextvar");
@@ -815,7 +815,7 @@
   
   // Convert condition to a bool by comparing equal to 0.0.
   EndCond = Builder.CreateFCmpONE(EndCond, 
-                                  ConstantFP::get(Type::DoubleTy, APFloat(0.0)),
+                                  ConstantFP::get(APFloat(0.0)),
                                   "loopcond");
 </pre>
 </div>
@@ -1359,7 +1359,7 @@
 Value *ErrorV(const char *Str) { Error(Str); return 0; }
 
 Value *NumberExprAST::Codegen() {
-  return ConstantFP::get(Type::DoubleTy, APFloat(Val));
+  return ConstantFP::get(APFloat(Val));
 }
 
 Value *VariableExprAST::Codegen() {
@@ -1410,7 +1410,7 @@
   
   // Convert condition to a bool by comparing equal to 0.0.
   CondV = Builder.CreateFCmpONE(CondV, 
-                                ConstantFP::get(Type::DoubleTy, APFloat(0.0)),
+                                ConstantFP::get(APFloat(0.0)),
                                 "ifcond");
   
   Function *TheFunction = Builder.GetInsertBlock()->getParent();
@@ -1509,7 +1509,7 @@
     if (StepVal == 0) return 0;
   } else {
     // If not specified, use 1.0.
-    StepVal = ConstantFP::get(Type::DoubleTy, APFloat(1.0));
+    StepVal = ConstantFP::get(APFloat(1.0));
   }
   
   Value *NextVar = Builder.CreateAdd(Variable, StepVal, "nextvar");
@@ -1520,7 +1520,7 @@
   
   // Convert condition to a bool by comparing equal to 0.0.
   EndCond = Builder.CreateFCmpONE(EndCond, 
-                                  ConstantFP::get(Type::DoubleTy, APFloat(0.0)),
+                                  ConstantFP::get(APFloat(0.0)),
                                   "loopcond");
   
   // Create the "after loop" block and insert it.

Modified: llvm/branches/non-call-eh/docs/tutorial/LangImpl6.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/tutorial/LangImpl6.html?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/tutorial/LangImpl6.html (original)
+++ llvm/branches/non-call-eh/docs/tutorial/LangImpl6.html Sun Jul  6 15:45:41 2008
@@ -1364,7 +1364,7 @@
 Value *ErrorV(const char *Str) { Error(Str); return 0; }
 
 Value *NumberExprAST::Codegen() {
-  return ConstantFP::get(Type::DoubleTy, APFloat(Val));
+  return ConstantFP::get(APFloat(Val));
 }
 
 Value *VariableExprAST::Codegen() {
@@ -1435,7 +1435,7 @@
   
   // Convert condition to a bool by comparing equal to 0.0.
   CondV = Builder.CreateFCmpONE(CondV, 
-                                ConstantFP::get(Type::DoubleTy, APFloat(0.0)),
+                                ConstantFP::get(APFloat(0.0)),
                                 "ifcond");
   
   Function *TheFunction = Builder.GetInsertBlock()->getParent();
@@ -1534,7 +1534,7 @@
     if (StepVal == 0) return 0;
   } else {
     // If not specified, use 1.0.
-    StepVal = ConstantFP::get(Type::DoubleTy, APFloat(1.0));
+    StepVal = ConstantFP::get(APFloat(1.0));
   }
   
   Value *NextVar = Builder.CreateAdd(Variable, StepVal, "nextvar");
@@ -1545,7 +1545,7 @@
   
   // Convert condition to a bool by comparing equal to 0.0.
   EndCond = Builder.CreateFCmpONE(EndCond, 
-                                  ConstantFP::get(Type::DoubleTy, APFloat(0.0)),
+                                  ConstantFP::get(APFloat(0.0)),
                                   "loopcond");
   
   // Create the "after loop" block and insert it.

Modified: llvm/branches/non-call-eh/docs/tutorial/LangImpl7.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/tutorial/LangImpl7.html?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/tutorial/LangImpl7.html (original)
+++ llvm/branches/non-call-eh/docs/tutorial/LangImpl7.html Sun Jul  6 15:45:41 2008
@@ -923,7 +923,7 @@
       InitVal = Init->Codegen();
       if (InitVal == 0) return 0;
     } else { // If not specified, use 0.0.
-      InitVal = ConstantFP::get(Type::DoubleTy, APFloat(0.0));
+      InitVal = ConstantFP::get(APFloat(0.0));
     }
     
     AllocaInst *Alloca = CreateEntryBlockAlloca(TheFunction, VarName);
@@ -1622,7 +1622,7 @@
 
 
 Value *NumberExprAST::Codegen() {
-  return ConstantFP::get(Type::DoubleTy, APFloat(Val));
+  return ConstantFP::get(APFloat(Val));
 }
 
 Value *VariableExprAST::Codegen() {
@@ -1715,7 +1715,7 @@
   
   // Convert condition to a bool by comparing equal to 0.0.
   CondV = Builder.CreateFCmpONE(CondV, 
-                                ConstantFP::get(Type::DoubleTy, APFloat(0.0)),
+                                ConstantFP::get(APFloat(0.0)),
                                 "ifcond");
   
   Function *TheFunction = Builder.GetInsertBlock()->getParent();
@@ -1821,7 +1821,7 @@
     if (StepVal == 0) return 0;
   } else {
     // If not specified, use 1.0.
-    StepVal = ConstantFP::get(Type::DoubleTy, APFloat(1.0));
+    StepVal = ConstantFP::get(APFloat(1.0));
   }
   
   // Compute the end condition.
@@ -1836,7 +1836,7 @@
   
   // Convert condition to a bool by comparing equal to 0.0.
   EndCond = Builder.CreateFCmpONE(EndCond, 
-                                  ConstantFP::get(Type::DoubleTy, APFloat(0.0)),
+                                  ConstantFP::get(APFloat(0.0)),
                                   "loopcond");
   
   // Create the "after loop" block and insert it.
@@ -1880,7 +1880,7 @@
       InitVal = Init->Codegen();
       if (InitVal == 0) return 0;
     } else { // If not specified, use 0.0.
-      InitVal = ConstantFP::get(Type::DoubleTy, APFloat(0.0));
+      InitVal = ConstantFP::get(APFloat(0.0));
     }
     
     AllocaInst *Alloca = CreateEntryBlockAlloca(TheFunction, VarName);

Modified: llvm/branches/non-call-eh/docs/tutorial/OCamlLangImpl3.html
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/docs/tutorial/OCamlLangImpl3.html?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/docs/tutorial/OCamlLangImpl3.html (original)
+++ llvm/branches/non-call-eh/docs/tutorial/OCamlLangImpl3.html Sun Jul  6 15:45:41 2008
@@ -148,7 +148,7 @@
 constants of <em>A</em>rbitrary <em>P</em>recision).  This code basically just
 creates and returns a <tt>ConstantFP</tt>.  Note that in the LLVM IR
 that constants are all uniqued together and shared.  For this reason, the API
-uses "the foo::get(..)" idiom instead of "new foo(..)" or "foo::create(..)".</p>
+uses "the foo::get(..)" idiom instead of "new foo(..)" or "foo::Create(..)".</p>
 
 <div class="doc_code">
 <pre>

Modified: llvm/branches/non-call-eh/examples/BrainF/BrainF.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/examples/BrainF/BrainF.cpp?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/examples/BrainF/BrainF.cpp (original)
+++ llvm/branches/non-call-eh/examples/BrainF/BrainF.cpp Sun Jul  6 15:45:41 2008
@@ -278,9 +278,10 @@
           BasicBlock *bb_1 = BasicBlock::Create(label, brainf_func);
           builder->SetInsertPoint(bb_1);
 
-          //Make part of PHI instruction now, wait until end of loop to finish
-          PHINode *phi_0 = PHINode::Create(PointerType::getUnqual(IntegerType::Int8Ty),
-                                       headreg, testbb);
+          // Make part of PHI instruction now, wait until end of loop to finish
+          PHINode *phi_0 =
+            PHINode::Create(PointerType::getUnqual(IntegerType::Int8Ty),
+                            headreg, testbb);
           phi_0->reserveOperandSpace(2);
           phi_0->addIncoming(curhead, bb_0);
           curhead = phi_0;

Modified: llvm/branches/non-call-eh/examples/Fibonacci/fibonacci.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/examples/Fibonacci/fibonacci.cpp?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/examples/Fibonacci/fibonacci.cpp (original)
+++ llvm/branches/non-call-eh/examples/Fibonacci/fibonacci.cpp Sun Jul  6 15:45:41 2008
@@ -66,18 +66,18 @@
   ReturnInst::Create(One, RetBB);
 
   // create fib(x-1)
-  Value *Sub = BinaryOperator::createSub(ArgX, One, "arg", RecurseBB);
+  Value *Sub = BinaryOperator::CreateSub(ArgX, One, "arg", RecurseBB);
   CallInst *CallFibX1 = CallInst::Create(FibF, Sub, "fibx1", RecurseBB);
   CallFibX1->setTailCall();
 
   // create fib(x-2)
-  Sub = BinaryOperator::createSub(ArgX, Two, "arg", RecurseBB);
+  Sub = BinaryOperator::CreateSub(ArgX, Two, "arg", RecurseBB);
   CallInst *CallFibX2 = CallInst::Create(FibF, Sub, "fibx2", RecurseBB);
   CallFibX2->setTailCall();
 
 
   // fib(x-1)+fib(x-2)
-  Value *Sum = BinaryOperator::createAdd(CallFibX1, CallFibX2,
+  Value *Sum = BinaryOperator::CreateAdd(CallFibX1, CallFibX2,
                                          "addresult", RecurseBB);
 
   // Create the return instruction and add it to the basic block

Modified: llvm/branches/non-call-eh/examples/HowToUseJIT/HowToUseJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/examples/HowToUseJIT/HowToUseJIT.cpp?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/examples/HowToUseJIT/HowToUseJIT.cpp (original)
+++ llvm/branches/non-call-eh/examples/HowToUseJIT/HowToUseJIT.cpp Sun Jul  6 15:45:41 2008
@@ -69,7 +69,7 @@
   ArgX->setName("AnArg");            // Give it a nice symbolic name for fun.
 
   // Create the add instruction, inserting it into the end of BB.
-  Instruction *Add = BinaryOperator::createAdd(One, ArgX, "addresult", BB);
+  Instruction *Add = BinaryOperator::CreateAdd(One, ArgX, "addresult", BB);
 
   // Create the return instruction and add it to the basic block
   ReturnInst::Create(Add, BB);

Modified: llvm/branches/non-call-eh/examples/ModuleMaker/ModuleMaker.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/examples/ModuleMaker/ModuleMaker.cpp?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/examples/ModuleMaker/ModuleMaker.cpp (original)
+++ llvm/branches/non-call-eh/examples/ModuleMaker/ModuleMaker.cpp Sun Jul  6 15:45:41 2008
@@ -43,7 +43,7 @@
   Value *Three = ConstantInt::get(Type::Int32Ty, 3);
 
   // Create the add instruction... does not insert...
-  Instruction *Add = BinaryOperator::create(Instruction::Add, Two, Three,
+  Instruction *Add = BinaryOperator::Create(Instruction::Add, Two, Three,
                                             "addresult");
 
   // explicitly insert it into the basic block...

Modified: llvm/branches/non-call-eh/examples/ParallelJIT/ParallelJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/examples/ParallelJIT/ParallelJIT.cpp?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/examples/ParallelJIT/ParallelJIT.cpp (original)
+++ llvm/branches/non-call-eh/examples/ParallelJIT/ParallelJIT.cpp Sun Jul  6 15:45:41 2008
@@ -50,7 +50,7 @@
   ArgX->setName("AnArg");            // Give it a nice symbolic name for fun.
 
   // Create the add instruction, inserting it into the end of BB.
-  Instruction *Add = BinaryOperator::createAdd(One, ArgX, "addresult", BB);
+  Instruction *Add = BinaryOperator::CreateAdd(One, ArgX, "addresult", BB);
 
   // Create the return instruction and add it to the basic block
   ReturnInst::Create(Add, BB);
@@ -90,16 +90,16 @@
   ReturnInst::Create(One, RetBB);
 
   // create fib(x-1)
-  Value *Sub = BinaryOperator::createSub(ArgX, One, "arg", RecurseBB);
+  Value *Sub = BinaryOperator::CreateSub(ArgX, One, "arg", RecurseBB);
   Value *CallFibX1 = CallInst::Create(FibF, Sub, "fibx1", RecurseBB);
 
   // create fib(x-2)
-  Sub = BinaryOperator::createSub(ArgX, Two, "arg", RecurseBB);
+  Sub = BinaryOperator::CreateSub(ArgX, Two, "arg", RecurseBB);
   Value *CallFibX2 = CallInst::Create(FibF, Sub, "fibx2", RecurseBB);
 
   // fib(x-1)+fib(x-2)
   Value *Sum =
-    BinaryOperator::createAdd(CallFibX1, CallFibX2, "addresult", RecurseBB);
+    BinaryOperator::CreateAdd(CallFibX1, CallFibX2, "addresult", RecurseBB);
 
   // Create the return instruction and add it to the basic block
   ReturnInst::Create(Sum, RecurseBB);

Modified: llvm/branches/non-call-eh/include/llvm-c/BitWriter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm-c/BitWriter.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm-c/BitWriter.h (original)
+++ llvm/branches/non-call-eh/include/llvm-c/BitWriter.h Sun Jul  6 15:45:41 2008
@@ -28,7 +28,8 @@
 
 /*===-- Operations on modules ---------------------------------------------===*/
 
-/* Writes a module to an open file descriptor. Returns 0 on success. */ 
+/* Writes a module to an open file descriptor. Returns 0 on success.
+   Closes the Handle. Use dup first if this is not what you want. */ 
 int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int Handle);
 
 /* Writes a module to the specified path. Returns 0 on success. */ 

Modified: llvm/branches/non-call-eh/include/llvm-c/Core.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm-c/Core.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm-c/Core.h (original)
+++ llvm/branches/non-call-eh/include/llvm-c/Core.h Sun Jul  6 15:45:41 2008
@@ -83,6 +83,20 @@
 typedef struct LLVMOpaquePassManager *LLVMPassManagerRef;
 
 typedef enum {
+    LLVMZExtParamAttr       = 1<<0,
+    LLVMSExtParamAttr       = 1<<1,
+    LLVMNoReturnParamAttr   = 1<<2,
+    LLVMInRegParamAttr      = 1<<3,
+    LLVMStructRetParamAttr  = 1<<4,
+    LLVMNoUnwindParamAttr   = 1<<5,
+    LLVMNoAliasParamAttr    = 1<<6,
+    LLVMByValParamAttr      = 1<<7,
+    LLVMNestParamAttr       = 1<<8,
+    LLVMReadNoneParamAttr   = 1<<9,
+    LLVMReadOnlyParamAttr   = 1<<10
+} LLVMParamAttr;
+
+typedef enum {
   LLVMVoidTypeKind,        /**< type with no size */
   LLVMFloatTypeKind,       /**< 32 bit floating point type */
   LLVMDoubleTypeKind,      /**< 64 bit floating point type */
@@ -210,24 +224,21 @@
 /** See llvm::LLVMTypeKind::getTypeID. */
 LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty);
 
-/** See llvm::DerivedType::refineAbstractTypeTo. */
-void LLVMRefineAbstractType(LLVMTypeRef AbstractType, LLVMTypeRef ConcreteType);
-
 /* Operations on integer types */
-LLVMTypeRef LLVMInt1Type();
-LLVMTypeRef LLVMInt8Type();
-LLVMTypeRef LLVMInt16Type();
-LLVMTypeRef LLVMInt32Type();
-LLVMTypeRef LLVMInt64Type();
+LLVMTypeRef LLVMInt1Type(void);
+LLVMTypeRef LLVMInt8Type(void);
+LLVMTypeRef LLVMInt16Type(void);
+LLVMTypeRef LLVMInt32Type(void);
+LLVMTypeRef LLVMInt64Type(void);
 LLVMTypeRef LLVMIntType(unsigned NumBits);
 unsigned LLVMGetIntTypeWidth(LLVMTypeRef IntegerTy);
 
 /* Operations on real types */
-LLVMTypeRef LLVMFloatType();
-LLVMTypeRef LLVMDoubleType();
-LLVMTypeRef LLVMX86FP80Type();
-LLVMTypeRef LLVMFP128Type();
-LLVMTypeRef LLVMPPCFP128Type();
+LLVMTypeRef LLVMFloatType(void);
+LLVMTypeRef LLVMDoubleType(void);
+LLVMTypeRef LLVMX86FP80Type(void);
+LLVMTypeRef LLVMFP128Type(void);
+LLVMTypeRef LLVMPPCFP128Type(void);
 
 /* Operations on function types */
 LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType,
@@ -256,9 +267,9 @@
 unsigned LLVMGetVectorSize(LLVMTypeRef VectorTy);
 
 /* Operations on other types */
-LLVMTypeRef LLVMVoidType();
-LLVMTypeRef LLVMLabelType();
-LLVMTypeRef LLVMOpaqueType();
+LLVMTypeRef LLVMVoidType(void);
+LLVMTypeRef LLVMLabelType(void);
+LLVMTypeRef LLVMOpaqueType(void);
 
 /* Operations on type handles */
 LLVMTypeHandleRef LLVMCreateTypeHandle(LLVMTypeRef PotentiallyAbstractTy);
@@ -306,7 +317,7 @@
 /* Operations on composite constants */
 LLVMValueRef LLVMConstString(const char *Str, unsigned Length,
                              int DontNullTerminate);
-LLVMValueRef LLVMConstArray(LLVMTypeRef ArrayTy,
+LLVMValueRef LLVMConstArray(LLVMTypeRef ElementTy,
                             LLVMValueRef *ConstantVals, unsigned Length);
 LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count,
                              int packed);
@@ -413,6 +424,9 @@
 LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn);
 LLVMValueRef LLVMGetNextParam(LLVMValueRef Arg);
 LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg);
+void LLVMAddParamAttr(LLVMValueRef Arg, LLVMParamAttr PA);
+void LLVMRemoveParamAttr(LLVMValueRef Arg, LLVMParamAttr PA);
+void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned align);
 
 /* Operations on basic blocks */
 LLVMValueRef LLVMBasicBlockAsValue(LLVMBasicBlockRef BB);
@@ -441,6 +455,11 @@
 /* Operations on call sites */
 void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC);
 unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr);
+void LLVMAddInstrParamAttr(LLVMValueRef Instr, unsigned index, LLVMParamAttr);
+void LLVMRemoveInstrParamAttr(LLVMValueRef Instr, unsigned index, 
+                              LLVMParamAttr);
+void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index, 
+                                unsigned align);
 
 /* Operations on phi nodes */
 void LLVMAddIncoming(LLVMValueRef PhiNode, LLVMValueRef *IncomingValues,
@@ -455,7 +474,7 @@
  * exclusive means of building instructions using the C interface.
  */
 
-LLVMBuilderRef LLVMCreateBuilder();
+LLVMBuilderRef LLVMCreateBuilder(void);
 void LLVMPositionBuilder(LLVMBuilderRef Builder, LLVMBasicBlockRef Block,
                          LLVMValueRef Instr);
 void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr);
@@ -615,7 +634,7 @@
 /** Constructs a new whole-module pass pipeline. This type of pipeline is
     suitable for link-time optimization and whole-module transformations.
     See llvm::PassManager::PassManager. */
-LLVMPassManagerRef LLVMCreatePassManager();
+LLVMPassManagerRef LLVMCreatePassManager(void);
 
 /** Constructs a new function-by-function pass pipeline over the module
     provider. It does not take ownership of the module provider. This type of

Modified: llvm/branches/non-call-eh/include/llvm-c/ExecutionEngine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm-c/ExecutionEngine.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm-c/ExecutionEngine.h (original)
+++ llvm/branches/non-call-eh/include/llvm-c/ExecutionEngine.h Sun Jul  6 15:45:41 2008
@@ -91,6 +91,9 @@
 
 LLVMTargetDataRef LLVMGetExecutionEngineTargetData(LLVMExecutionEngineRef EE);
 
+void LLVMAddGlobalMapping(LLVMExecutionEngineRef EE, LLVMValueRef Global,
+                          void* Addr);
+
 #ifdef __cplusplus
 }
 

Modified: llvm/branches/non-call-eh/include/llvm-c/lto.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm-c/lto.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm-c/lto.h (original)
+++ llvm/branches/non-call-eh/include/llvm-c/lto.h Sun Jul  6 15:45:41 2008
@@ -63,14 +63,14 @@
  * Returns a printable string.
  */
 extern const char*
-lto_get_version();
+lto_get_version(void);
 
 
 /**
  * Returns the last error string or NULL if last operation was sucessful.
  */
 extern const char*
-lto_get_error_message();
+lto_get_error_message(void);
 
 
 /**
@@ -160,7 +160,7 @@
  * Returns NULL on error (check lto_get_error_message() for details).
  */
 extern lto_code_gen_t
-lto_codegen_create();
+lto_codegen_create(void);
 
 
 /**
@@ -227,6 +227,11 @@
 lto_codegen_compile(lto_code_gen_t cg, size_t* length);
 
 
+/**
+ * Sets options to help debug codegen bugs.
+ */
+extern void
+lto_codegen_debug_options(lto_code_gen_t cg, const char *);
 #ifdef __cplusplus
 }
 #endif

Propchange: llvm/branches/non-call-eh/include/llvm/ADT/

------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sun Jul  6 15:45:41 2008
@@ -1,4 +1,3 @@
-.cvsignore
-hash_map
-hash_set
-iterator
+hash_map.h
+hash_set.h
+iterator.h

Modified: llvm/branches/non-call-eh/include/llvm/ADT/APFloat.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/APFloat.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/APFloat.h (original)
+++ llvm/branches/non-call-eh/include/llvm/ADT/APFloat.h Sun Jul  6 15:45:41 2008
@@ -152,8 +152,8 @@
       rmNearestTiesToAway
     };
 
-    /* Operation status.  opUnderflow or opOverflow are always returned
-       or-ed with opInexact.  */
+    // Operation status.  opUnderflow or opOverflow are always returned
+    // or-ed with opInexact.
     enum opStatus {
       opOK          = 0x00,
       opInvalidOp   = 0x01,
@@ -163,7 +163,7 @@
       opInexact     = 0x10
     };
 
-    /* Category of internally-represented number.  */
+    // Category of internally-represented number.
     enum fltCategory {
       fcInfinity,
       fcNaN,
@@ -171,7 +171,7 @@
       fcZero
     };
 
-    /* Constructors.  */
+    // Constructors.
     APFloat(const fltSemantics &, const char *);
     APFloat(const fltSemantics &, integerPart);
     APFloat(const fltSemantics &, fltCategory, bool negative);
@@ -180,6 +180,17 @@
     explicit APFloat(const APInt &, bool isIEEE = false);
     APFloat(const APFloat &);
     ~APFloat();
+
+    // Convenience "constructors"
+    static APFloat getZero(const fltSemantics &Sem, bool Negative = false) {
+      return APFloat(Sem, fcZero, Negative);
+    }
+    static APFloat getInf(const fltSemantics &Sem, bool Negative = false) {
+      return APFloat(Sem, fcInfinity, Negative);
+    }
+    static APFloat getNaN(const fltSemantics &Sem, bool Negative = false) {
+      return APFloat(Sem, fcNaN, Negative);
+    }
     
     /// Profile - Used to insert APFloat objects, or objects that contain
     ///  APFloat objects, into FoldingSets.
@@ -244,6 +255,7 @@
     bool isZero() const { return category == fcZero; }
     bool isNonZero() const { return category != fcZero; }
     bool isNaN() const { return category == fcNaN; }
+    bool isInfinity() const { return category == fcInfinity; }
     bool isNegative() const { return sign; }
     bool isPosZero() const { return isZero() && !isNegative(); }
     bool isNegZero() const { return isZero() && isNegative(); }

Modified: llvm/branches/non-call-eh/include/llvm/ADT/APInt.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/APInt.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/APInt.h (original)
+++ llvm/branches/non-call-eh/include/llvm/ADT/APInt.h Sun Jul  6 15:45:41 2008
@@ -31,7 +31,8 @@
   typedef uint64_t integerPart;
 
   const unsigned int host_char_bit = 8;
-  const unsigned int integerPartWidth = host_char_bit * sizeof(integerPart);
+  const unsigned int integerPartWidth = host_char_bit *
+    static_cast<unsigned int>(sizeof(integerPart));
 
 //===----------------------------------------------------------------------===//
 //                              APInt Class
@@ -76,8 +77,10 @@
 
   /// This enum is used to hold the constants we needed for APInt.
   enum {
-    APINT_BITS_PER_WORD = sizeof(uint64_t) * 8, ///< Bits in a word
-    APINT_WORD_SIZE = sizeof(uint64_t)          ///< Byte size of a word
+    /// Bits in a word
+    APINT_BITS_PER_WORD = static_cast<unsigned int>(sizeof(uint64_t)) * 8,
+    /// Byte size of a word
+    APINT_WORD_SIZE = static_cast<unsigned int>(sizeof(uint64_t))
   };
 
   /// This constructor is used only internally for speed of construction of
@@ -127,7 +130,7 @@
       // the word size (64).
       return *this;
 
-    // Mask out the hight bits.
+    // Mask out the high bits.
     uint64_t mask = ~uint64_t(0ULL) >> (APINT_BITS_PER_WORD - wordBits);
     if (isSingleWord())
       VAL &= mask;
@@ -665,9 +668,11 @@
     return this->urem(RHS);
   }
 
-  /// Sometimes it is convenient to divide two APInt values and obtain both
-  /// the quotient and remainder. This function does both operations in the
-  /// same computation making it a little more efficient.
+  /// Sometimes it is convenient to divide two APInt values and obtain both the
+  /// quotient and remainder. This function does both operations in the same
+  /// computation making it a little more efficient. The pair of input arguments
+  /// may overlap with the pair of output arguments. It is safe to call
+  /// udivrem(X, Y, X, Y), for example.
   /// @brief Dual division/remainder interface.
   static void udivrem(const APInt &LHS, const APInt &RHS, 
                       APInt &Quotient, APInt &Remainder);
@@ -895,7 +900,7 @@
 
   /// Computes the minimum bit width for this APInt while considering it to be
   /// a signed (and probably negative) value. If the value is not negative, 
-  /// this function returns the same value as getActiveBits(). Otherwise, it
+  /// this function returns the same value as getActiveBits()+1. Otherwise, it
   /// returns the smallest bit width that will retain the negative value. For
   /// example, -1 can be written as 0b1 or 0xFFFFFFFFFF. 0b1 is shorter and so
   /// for -1, this function will always return 1.
@@ -1104,7 +1109,8 @@
     return *this;
   }
 
-  /// @}
+  /// @returns the multiplicative inverse for a given modulo.
+  APInt multiplicativeInverse(const APInt& modulo) const;
 
   /// @}
   /// @name Building-block Operations for APInt and APFloat
@@ -1279,7 +1285,8 @@
 /// @returns true if the argument APInt value is a sequence of ones
 /// starting at the least significant bit with the remainder zero.
 inline bool isMask(uint32_t numBits, const APInt& APIVal) {
-  return APIVal.getBoolValue() && ((APIVal + APInt(numBits,1)) & APIVal) == 0;
+  return numBits <= APIVal.getBitWidth() &&
+    APIVal == APInt::getLowBitsSet(APIVal.getBitWidth(), numBits);
 }
 
 /// @returns true if the argument APInt value contains a sequence of ones
@@ -1299,7 +1306,7 @@
 }
 
 /// GreatestCommonDivisor - This function returns the greatest common
-/// divisor of the two APInt values using Enclid's algorithm.
+/// divisor of the two APInt values using Euclid's algorithm.
 /// @returns the greatest common divisor of Val1 and Val2
 /// @brief Compute GCD of two APInt values.
 APInt GreatestCommonDivisor(const APInt& Val1, const APInt& Val2);

Modified: llvm/branches/non-call-eh/include/llvm/ADT/BitVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/BitVector.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/BitVector.h (original)
+++ llvm/branches/non-call-eh/include/llvm/ADT/BitVector.h Sun Jul  6 15:45:41 2008
@@ -17,7 +17,6 @@
 #include "llvm/Support/MathExtras.h"
 #include <algorithm>
 #include <cassert>
-#include <cstdlib>
 #include <cstring>
 
 namespace llvm {
@@ -25,7 +24,7 @@
 class BitVector {
   typedef unsigned long BitWord;
 
-  enum { BITWORD_SIZE = sizeof(BitWord) * 8 };
+  enum { BITWORD_SIZE = (unsigned)sizeof(BitWord) * 8 };
 
   BitWord  *Bits;        // Actual bits. 
   unsigned Size;         // Size of bitvector in bits.
@@ -65,7 +64,7 @@
 
   /// BitVector default ctor - Creates an empty bitvector.
   BitVector() : Size(0), Capacity(0) {
-    Bits = NULL;
+    Bits = 0;
   }
 
   /// BitVector ctor - Creates a bitvector of specified number of bits. All
@@ -81,7 +80,7 @@
   /// BitVector copy ctor.
   BitVector(const BitVector &RHS) : Size(RHS.size()) {
     if (Size == 0) {
-      Bits = NULL;
+      Bits = 0;
       Capacity = 0;
       return;
     }
@@ -103,7 +102,7 @@
     unsigned NumBits = 0;
     for (unsigned i = 0; i < NumBitWords(size()); ++i)
       if (sizeof(BitWord) == 4)
-        NumBits += CountPopulation_32(Bits[i]);
+        NumBits += CountPopulation_32((uint32_t)Bits[i]);
       else if (sizeof(BitWord) == 8)
         NumBits += CountPopulation_64(Bits[i]);
       else
@@ -130,7 +129,7 @@
     for (unsigned i = 0; i < NumBitWords(size()); ++i)
       if (Bits[i] != 0) {
         if (sizeof(BitWord) == 4)
-          return i * BITWORD_SIZE + CountTrailingZeros_32(Bits[i]);
+          return i * BITWORD_SIZE + CountTrailingZeros_32((uint32_t)Bits[i]);
         else if (sizeof(BitWord) == 8)
           return i * BITWORD_SIZE + CountTrailingZeros_64(Bits[i]);
         else
@@ -154,7 +153,7 @@
 
     if (Copy != 0) {
       if (sizeof(BitWord) == 4)
-        return WordPos * BITWORD_SIZE + CountTrailingZeros_32(Copy);
+        return WordPos * BITWORD_SIZE + CountTrailingZeros_32((uint32_t)Copy);
       else if (sizeof(BitWord) == 8)
         return WordPos * BITWORD_SIZE + CountTrailingZeros_64(Copy);
       else
@@ -165,7 +164,7 @@
     for (unsigned i = WordPos+1; i < NumBitWords(size()); ++i)
       if (Bits[i] != 0) {
         if (sizeof(BitWord) == 4)
-          return i * BITWORD_SIZE + CountTrailingZeros_32(Bits[i]);
+          return i * BITWORD_SIZE + CountTrailingZeros_32((uint32_t)Bits[i]);
         else if (sizeof(BitWord) == 8)
           return i * BITWORD_SIZE + CountTrailingZeros_64(Bits[i]);
         else

Modified: llvm/branches/non-call-eh/include/llvm/ADT/DenseMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/DenseMap.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/DenseMap.h (original)
+++ llvm/branches/non-call-eh/include/llvm/ADT/DenseMap.h Sun Jul  6 15:45:41 2008
@@ -82,7 +82,7 @@
         P->second.~ValueT();
       P->first.~KeyT();
     }
-    delete[] reinterpret_cast<char*>(Buckets);
+    operator delete(Buckets);
   }
   
   typedef DenseMapIterator<KeyT, ValueT, KeyInfoT> iterator;
@@ -210,15 +210,15 @@
     NumTombstones = other.NumTombstones;
     
     if (NumBuckets)
-      delete[] reinterpret_cast<char*>(Buckets);
-    Buckets = reinterpret_cast<BucketT*>(new char[sizeof(BucketT) *
-                                                  other.NumBuckets]);
+      operator delete(Buckets);
+    Buckets = static_cast<BucketT*>(operator new(sizeof(BucketT) *
+                                                 other.NumBuckets));
     
     if (KeyInfoT::isPod() && ValueInfoT::isPod())
       memcpy(Buckets, other.Buckets, other.NumBuckets * sizeof(BucketT));
     else
       for (size_t i = 0; i < other.NumBuckets; ++i) {
-        new (Buckets[i].first) KeyT(other.Buckets[i].first);
+        new (&Buckets[i].first) KeyT(other.Buckets[i].first);
         if (!KeyInfoT::isEqual(Buckets[i].first, getEmptyKey()) &&
             !KeyInfoT::isEqual(Buckets[i].first, getTombstoneKey()))
           new (&Buckets[i].second) ValueT(other.Buckets[i].second);
@@ -315,7 +315,7 @@
     NumBuckets = InitBuckets;
     assert(InitBuckets && (InitBuckets & (InitBuckets-1)) == 0 &&
            "# initial buckets must be a power of two!");
-    Buckets = reinterpret_cast<BucketT*>(new char[sizeof(BucketT)*InitBuckets]);
+    Buckets = static_cast<BucketT*>(operator new(sizeof(BucketT)*InitBuckets));
     // Initialize all the keys to EmptyKey.
     const KeyT EmptyKey = getEmptyKey();
     for (unsigned i = 0; i != InitBuckets; ++i)
@@ -330,7 +330,7 @@
     while (NumBuckets <= AtLeast)
       NumBuckets <<= 1;
     NumTombstones = 0;
-    Buckets = reinterpret_cast<BucketT*>(new char[sizeof(BucketT)*NumBuckets]);
+    Buckets = static_cast<BucketT*>(operator new(sizeof(BucketT)*NumBuckets));
 
     // Initialize all the keys to EmptyKey.
     const KeyT EmptyKey = getEmptyKey();
@@ -357,7 +357,7 @@
     }
     
     // Free the old table.
-    delete[] reinterpret_cast<char*>(OldBuckets);
+    operator delete(OldBuckets);
   }
   
   void shrink_and_clear() {
@@ -368,7 +368,7 @@
     NumBuckets = NumEntries > 32 ? 1 << (Log2_32_Ceil(NumEntries) + 1)
                                  : 64;
     NumTombstones = 0;
-    Buckets = reinterpret_cast<BucketT*>(new char[sizeof(BucketT)*NumBuckets]);
+    Buckets = static_cast<BucketT*>(operator new(sizeof(BucketT)*NumBuckets));
 
     // Initialize all the keys to EmptyKey.
     const KeyT EmptyKey = getEmptyKey();
@@ -387,7 +387,7 @@
     }
     
     // Free the old table.
-    delete[] reinterpret_cast<char*>(OldBuckets);
+    operator delete(OldBuckets);
     
     NumEntries = 0;
   }

Modified: llvm/branches/non-call-eh/include/llvm/ADT/DenseSet.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/DenseSet.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/DenseSet.h (original)
+++ llvm/branches/non-call-eh/include/llvm/ADT/DenseSet.h Sun Jul  6 15:45:41 2008
@@ -24,15 +24,14 @@
 /// should be optimized later if there is a need.
 template<typename ValueT, typename ValueInfoT = DenseMapInfo<ValueT> >
 class DenseSet {
-  DenseMap<ValueT, char, ValueInfoT> TheMap;
+  typedef DenseMap<ValueT, char, ValueInfoT> MapTy;
+  MapTy TheMap;
 public:
   DenseSet(const DenseSet &Other) : TheMap(Other.TheMap) {}
   explicit DenseSet(unsigned NumInitBuckets = 64) : TheMap(NumInitBuckets) {}
   
   bool empty() const { return TheMap.empty(); }
-  unsigned size() const { return TheMap.size(); }
-  
-  // TODO add iterators.
+  unsigned size() const { return TheMap.size(); }  
   
   void clear() {
     TheMap.clear();
@@ -42,8 +41,8 @@
     return TheMap.count(V);
   }
   
-  void insert(const ValueT &V) {
-    TheMap[V] = 0;
+  bool insert(const ValueT &V) {
+    return TheMap.insert(std::make_pair(V, 0));
   }
   
   void erase(const ValueT &V) {
@@ -54,6 +53,43 @@
     TheMap = RHS.TheMap;
     return *this;
   }
+  
+  // Iterators.
+  
+  class Iterator {
+    typename MapTy::iterator I;
+  public:
+    Iterator(const typename MapTy::iterator &i) : I(i) {}
+    
+    ValueT& operator*() { return I->first; }
+    ValueT* operator->() { return &I->first; }
+    
+    Iterator& operator++() { ++I; return *this; };
+    bool operator==(const Iterator& X) const { return I == X.I; }
+    bool operator!=(const Iterator& X) const { return I != X.I; }
+  };
+  
+  class ConstIterator {
+    typename MapTy::const_iterator I;
+  public:
+    ConstIterator(const typename MapTy::const_iterator &i) : I(i) {}
+    
+    const ValueT& operator*() { return I->first; }
+    const ValueT* operator->() { return &I->first; }
+    
+    ConstIterator& operator++() { ++I; return *this; };
+    bool operator==(const ConstIterator& X) const { return I == X.I; }
+    bool operator!=(const ConstIterator& X) const { return I != X.I; }
+  };
+  
+  typedef Iterator      iterator;
+  typedef ConstIterator const_iterator;
+  
+  iterator begin() { return Iterator(TheMap.begin()); }
+  iterator end() { return Iterator(TheMap.end()); }
+  
+  const_iterator begin() const { return ConstIterator(TheMap.begin()); }
+  const_iterator end() const { return ConstIterator(TheMap.end()); }
 };
 
 } // end namespace llvm

Modified: llvm/branches/non-call-eh/include/llvm/ADT/DepthFirstIterator.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/DepthFirstIterator.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/DepthFirstIterator.h (original)
+++ llvm/branches/non-call-eh/include/llvm/ADT/DepthFirstIterator.h Sun Jul  6 15:45:41 2008
@@ -34,7 +34,7 @@
 #define LLVM_ADT_DEPTHFIRSTITERATOR_H
 
 #include "llvm/ADT/GraphTraits.h"
-#include "llvm/ADT/iterator"
+#include "llvm/ADT/iterator.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include <vector>
 #include <set>

Modified: llvm/branches/non-call-eh/include/llvm/ADT/EquivalenceClasses.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/EquivalenceClasses.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/EquivalenceClasses.h (original)
+++ llvm/branches/non-call-eh/include/llvm/ADT/EquivalenceClasses.h Sun Jul  6 15:45:41 2008
@@ -15,7 +15,7 @@
 #ifndef LLVM_ADT_EQUIVALENCECLASSES_H
 #define LLVM_ADT_EQUIVALENCECLASSES_H
 
-#include "llvm/ADT/iterator"
+#include "llvm/ADT/iterator.h"
 #include "llvm/Support/DataTypes.h"
 #include <set>
 

Modified: llvm/branches/non-call-eh/include/llvm/ADT/FoldingSet.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/FoldingSet.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/FoldingSet.h (original)
+++ llvm/branches/non-call-eh/include/llvm/ADT/FoldingSet.h Sun Jul  6 15:45:41 2008
@@ -220,6 +220,7 @@
   void AddFloat(float F);
   void AddDouble(double D);
   void AddString(const std::string &String);
+  void AddString(const char* String);
   
   template <typename T>
   inline void Add(const T& x) { FoldingSetTrait<T>::Profile(x, *this); }
@@ -426,6 +427,18 @@
 
   operator T&() { return data; }
   operator const T&() const { return data; }
+};  
+  
+//===----------------------------------------------------------------------===//
+// Partial specializations of FoldingSetTrait.
+
+template<typename T> struct FoldingSetTrait<T*> {
+  static inline void Profile(const T* X, FoldingSetNodeID& ID) {
+    ID.AddPointer(X);
+  }
+  static inline void Profile(T* X, FoldingSetNodeID& ID) {
+    ID.AddPointer(X);
+  }
 };
 
 } // End of namespace llvm.

Modified: llvm/branches/non-call-eh/include/llvm/ADT/HashExtras.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/HashExtras.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/HashExtras.h (original)
+++ llvm/branches/non-call-eh/include/llvm/ADT/HashExtras.h Sun Jul  6 15:45:41 2008
@@ -17,7 +17,7 @@
 #ifndef LLVM_ADT_HASHEXTRAS_H
 #define LLVM_ADT_HASHEXTRAS_H
 
-#include "llvm/ADT/hash_map"
+#include "llvm/ADT/hash_map.h"
 #include <string>
 
 // Cannot specialize hash template from outside of the std namespace.

Added: llvm/branches/non-call-eh/include/llvm/ADT/ImmutableList.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/ImmutableList.h?rev=53163&view=auto

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/ImmutableList.h (added)
+++ llvm/branches/non-call-eh/include/llvm/ADT/ImmutableList.h Sun Jul  6 15:45:41 2008
@@ -0,0 +1,191 @@
+//==--- ImmutableList.h - Immutable (functional) list interface --*- 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 ImmutableList class.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_IMLIST_H
+#define LLVM_ADT_IMLIST_H
+
+#include "llvm/Support/Allocator.h"
+#include "llvm/ADT/FoldingSet.h"
+#include "llvm/Support/DataTypes.h"
+#include <cassert>
+
+namespace llvm {
+
+template <typename T> class ImmutableListFactory;
+  
+template <typename T>
+class ImmutableListImpl : public FoldingSetNode {
+  T Head;
+  ImmutableListImpl* Tail;
+
+  ImmutableListImpl(const T& head, ImmutableListImpl* tail = 0)
+    : Head(head), Tail(tail) {}
+  
+  friend class ImmutableListFactory<T>;
+  
+  // Do not implement.
+  void operator=(const ImmutableListImpl&);
+  ImmutableListImpl(const ImmutableListImpl&);
+  
+public:
+  const T& getHead() const { return Head; }
+  ImmutableListImpl* getTail() const { return Tail; }
+  
+  static inline void Profile(FoldingSetNodeID& ID, const T& H,
+                             ImmutableListImpl* L){
+    ID.AddPointer(L);
+    ID.Add(H);
+  }
+  
+  void Profile(FoldingSetNodeID& ID) {
+    Profile(ID, Head, Tail);
+  }
+};
+  
+/// ImmutableList - This class represents an immutable (functional) list.
+///  It is implemented as a smart pointer (wraps ImmutableListImpl), so it
+///  it is intended to always be copied by value as if it were a pointer.
+///  This interface matches ImmutableSet and ImmutableMap.  ImmutableList
+///  objects should almost never be created directly, and instead should
+///  be created by ImmutableListFactory objects that manage the lifetime
+///  of a group of lists.  When the factory object is reclaimed, all lists
+///  created by that factory are released as well.
+template <typename T>
+class ImmutableList {
+public:
+  typedef T value_type;
+  typedef ImmutableListFactory<T> Factory;
+
+private:
+  ImmutableListImpl<T>* X;
+
+public:
+  // This constructor should normally only be called by ImmutableListFactory<T>.
+  // There may be cases, however, when one needs to extract the internal pointer
+  // and reconstruct a list object from that pointer.
+  ImmutableList(ImmutableListImpl<T>* x) : X(x) {}
+
+  ImmutableListImpl<T>* getInternalPointer() const {
+    return X;
+  }
+  
+  class iterator {
+    ImmutableListImpl<T>* L;
+  public:
+    iterator() : L(0) {}
+    iterator(ImmutableList l) : L(l.getInternalPointer()) {}
+    
+    iterator& operator++() { L = L->getTail(); return *this; }
+    bool operator==(const iterator& I) const { return L == I.L; }
+    bool operator!=(const iterator& I) const { return L != I.L; }
+    ImmutableList operator*() const { return L; }
+  };
+
+  /// begin - Returns an iterator referring to the head of the list, or
+  ///  an iterator denoting the end of the list if the list is empty.
+  iterator begin() const { return iterator(X); }
+    
+  /// end - Returns an iterator denoting the end of the list.  This iterator
+  ///  does not refer to a valid list element.
+  iterator end() const { return iterator(); }
+
+  /// isEmpty - Returns true if the list is empty.
+  bool isEmpty() const { return !X; }
+  
+  /// isEqual - Returns true if two lists are equal.  Because all lists created
+  ///  from the same ImmutableListFactory are uniqued, this has O(1) complexity
+  ///  because it the contents of the list do not need to be compared.  Note
+  ///  that you should only compare two lists created from the same
+  ///  ImmutableListFactory.
+  bool isEqual(const ImmutableList& L) const { return X == L.X; }  
+
+  bool operator==(const ImmutableList& L) const { return isEqual(L); }
+
+  /// getHead - Returns the head of the list.
+  const T& getHead() {
+    assert (!isEmpty() && "Cannot get the head of an empty list.");
+    return X->getHead();
+  }
+  
+  /// getTail - Returns the tail of the list, which is another (possibly empty)
+  ///  ImmutableList.
+  ImmutableList getTail() {
+    return X ? X->getTail() : 0;
+  }  
+};
+  
+template <typename T>
+class ImmutableListFactory {
+  typedef ImmutableListImpl<T> ListTy;  
+  typedef FoldingSet<ListTy>   CacheTy;
+  
+  CacheTy Cache;
+  uintptr_t Allocator;
+  
+  bool ownsAllocator() const {
+    return Allocator & 0x1 ? false : true;
+  }
+  
+  BumpPtrAllocator& getAllocator() const { 
+    return *reinterpret_cast<BumpPtrAllocator*>(Allocator & ~0x1);
+  }  
+
+public:
+  ImmutableListFactory()
+    : Allocator(reinterpret_cast<uintptr_t>(new BumpPtrAllocator())) {}
+  
+  ImmutableListFactory(BumpPtrAllocator& Alloc)
+  : Allocator(reinterpret_cast<uintptr_t>(&Alloc) | 0x1) {}
+  
+  ~ImmutableListFactory() {
+    if (ownsAllocator()) delete &getAllocator();
+  }
+  
+  ImmutableList<T> Concat(const T& Head, ImmutableList<T> Tail) {
+    // Profile the new list to see if it already exists in our cache.
+    FoldingSetNodeID ID;
+    void* InsertPos;
+    
+    ListTy* TailImpl = Tail.getInternalPointer();
+    ListTy::Profile(ID, Head, TailImpl);
+    ListTy* L = Cache.FindNodeOrInsertPos(ID, InsertPos);
+    
+    if (!L) {
+      // The list does not exist in our cache.  Create it.
+      BumpPtrAllocator& A = getAllocator();
+      L = (ListTy*) A.Allocate<ListTy>();
+      new (L) ListTy(Head, TailImpl);
+    
+      // Insert the new list into the cache.
+      Cache.InsertNode(L, InsertPos);
+    }
+    
+    return L;
+  }
+  
+  ImmutableList<T> Add(const T& D, ImmutableList<T> L) {
+    return Concat(D, L);
+  }
+  
+  ImmutableList<T> GetEmptyList() const {
+    return ImmutableList<T>(0);
+  }
+  
+  ImmutableList<T> Create(const T& X) {
+    return Concat(X, GetEmptyList());
+  }
+};
+  
+} // end llvm namespace
+
+#endif

Modified: llvm/branches/non-call-eh/include/llvm/ADT/ImmutableMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/ImmutableMap.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/ImmutableMap.h (original)
+++ llvm/branches/non-call-eh/include/llvm/ADT/ImmutableMap.h Sun Jul  6 15:45:41 2008
@@ -176,16 +176,19 @@
     friend class ImmutableMap;
 
   public:
-    inline value_type_ref operator*() const { return itr->getValue(); }
-    inline key_type_ref getKey() const { return itr->getValue().first; }
-    inline data_type_ref getData() const { return itr->getValue().second; }
+    value_type_ref operator*() const { return itr->getValue(); }
+    value_type*    operator->() const { return &itr->getValue(); }
     
-    inline iterator& operator++() { ++itr; return *this; }
-    inline iterator  operator++(int) { iterator tmp(*this); ++itr; return tmp; }
-    inline iterator& operator--() { --itr; return *this; }
-    inline iterator  operator--(int) { iterator tmp(*this); --itr; return tmp; }
-    inline bool operator==(const iterator& RHS) const { return RHS.itr == itr; }
-    inline bool operator!=(const iterator& RHS) const { return RHS.itr != itr; }        
+    key_type_ref getKey() const { return itr->getValue().first; }
+    data_type_ref getData() const { return itr->getValue().second; }
+    
+    
+    iterator& operator++() { ++itr; return *this; }
+    iterator  operator++(int) { iterator tmp(*this); ++itr; return tmp; }
+    iterator& operator--() { --itr; return *this; }
+    iterator  operator--(int) { iterator tmp(*this); --itr; return tmp; }
+    bool operator==(const iterator& RHS) const { return RHS.itr == itr; }
+    bool operator!=(const iterator& RHS) const { return RHS.itr != itr; }        
   };
   
   iterator begin() const { return iterator(Root); }

Modified: llvm/branches/non-call-eh/include/llvm/ADT/PostOrderIterator.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/PostOrderIterator.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/PostOrderIterator.h (original)
+++ llvm/branches/non-call-eh/include/llvm/ADT/PostOrderIterator.h Sun Jul  6 15:45:41 2008
@@ -17,7 +17,7 @@
 #define LLVM_ADT_POSTORDERITERATOR_H
 
 #include "llvm/ADT/GraphTraits.h"
-#include "llvm/ADT/iterator"
+#include "llvm/ADT/iterator.h"
 #include <stack>
 #include <set>
 #include <vector>

Added: llvm/branches/non-call-eh/include/llvm/ADT/PriorityQueue.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/PriorityQueue.h?rev=53163&view=auto

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/PriorityQueue.h (added)
+++ llvm/branches/non-call-eh/include/llvm/ADT/PriorityQueue.h Sun Jul  6 15:45:41 2008
@@ -0,0 +1,83 @@
+//===- llvm/ADT/PriorityQueue.h - Priority queues ---------------*- 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 PriorityQueue class.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_PRIORITY_QUEUE_H
+#define LLVM_ADT_PRIORITY_QUEUE_H
+
+#include <queue>
+
+namespace llvm {
+
+/// PriorityQueue - This class behaves like std::priority_queue and
+/// provides a few additional convenience functions.
+/// 
+template<class T,
+         class Sequence = std::vector<T>,
+         class Compare = std::less<typename Sequence::value_type> >
+class PriorityQueue : public std::priority_queue<T, Sequence, Compare> {
+public:
+  explicit PriorityQueue(const Compare &compare = Compare(),
+                         const Sequence &sequence = Sequence())
+    : std::priority_queue<T, Sequence, Compare>(compare, sequence)
+  {}
+
+  template<class Iterator>
+  PriorityQueue(Iterator begin, Iterator end,
+                const Compare &compare = Compare(),
+                const Sequence &sequence = Sequence())
+    : std::priority_queue<T, Sequence, Compare>(begin, end, compare, sequence)
+  {}
+
+  /// erase_one - Erase one element from the queue, regardless of its
+  /// position. This operation performs a linear search to find an element
+  /// equal to t, but then uses all logarithmic-time algorithms to do
+  /// the erase operation.
+  ///
+  void erase_one(const T &t) {
+    // Linear-search to find the element.
+    typename Sequence::size_type i =
+      std::find(this->c.begin(), this->c.end(), t) - this->c.begin();
+
+    // Logarithmic-time heap bubble-up.
+    while (i != 0) {
+      typename Sequence::size_type parent = (i - 1) / 2;
+      this->c[i] = this->c[parent];
+      i = parent;
+    }
+
+    // The element we want to remove is now at the root, so we can use
+    // priority_queue's plain pop to remove it.
+    this->pop();
+  }
+
+  /// reheapify - If an element in the queue has changed in a way that
+  /// affects its standing in the comparison function, the queue's
+  /// internal state becomes invalid. Calling reheapify() resets the
+  /// queue's state, making it valid again. This operation has time
+  /// complexity proportional to the number of elements in the queue,
+  /// so don't plan to use it a lot.
+  ///
+  void reheapify() {
+    std::make_heap(this->c.begin(), this->c.end(), this->comp);
+  }
+
+  /// clear - Erase all elements from the queue.
+  ///
+  void clear() {
+    this->c.clear();
+  }
+};
+
+} // End llvm namespace
+
+#endif

Modified: llvm/branches/non-call-eh/include/llvm/ADT/SCCIterator.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/SCCIterator.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/SCCIterator.h (original)
+++ llvm/branches/non-call-eh/include/llvm/ADT/SCCIterator.h Sun Jul  6 15:45:41 2008
@@ -22,7 +22,7 @@
 #define LLVM_ADT_SCCITERATOR_H
 
 #include "llvm/ADT/GraphTraits.h"
-#include "llvm/ADT/iterator"
+#include "llvm/ADT/iterator.h"
 #include <vector>
 #include <map>
 

Modified: llvm/branches/non-call-eh/include/llvm/ADT/STLExtras.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/STLExtras.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/STLExtras.h (original)
+++ llvm/branches/non-call-eh/include/llvm/ADT/STLExtras.h Sun Jul  6 15:45:41 2008
@@ -20,7 +20,7 @@
 #include <functional>
 #include <utility> // for std::pair
 #include <cstring> // for std::size_t
-#include "llvm/ADT/iterator"
+#include "llvm/ADT/iterator.h"
 
 namespace llvm {
 

Added: llvm/branches/non-call-eh/include/llvm/ADT/ScopedHashTable.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/ScopedHashTable.h?rev=53163&view=auto

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/ScopedHashTable.h (added)
+++ llvm/branches/non-call-eh/include/llvm/ADT/ScopedHashTable.h Sun Jul  6 15:45:41 2008
@@ -0,0 +1,193 @@
+//===- ScopedHashTable.h - A simple scoped hash table ---------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements an efficient scoped hash table, which is useful for
+// things like dominator-based optimizations.  This allows clients to do things
+// like this:
+//
+//  ScopedHashTable<int, int> HT;
+//  {
+//    ScopedHashTableScope<int, int> Scope1(HT);
+//    HT.insert(0, 0);
+//    HT.insert(1, 1);
+//    {
+//      ScopedHashTableScope<int, int> Scope2(HT);
+//      HT.insert(0, 42);
+//    }
+//  }
+//
+// Looking up the value for "0" in the Scope2 block will return 42.  Looking
+// up the value for 0 before 42 is inserted or after Scope2 is popped will
+// return 0.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_SCOPEDHASHTABLE_H
+#define LLVM_ADT_SCOPEDHASHTABLE_H
+
+#include <cassert>
+#include "llvm/ADT/DenseMap.h"
+
+namespace llvm {
+
+template <typename K, typename V>
+class ScopedHashTable;
+
+template <typename K, typename V>
+class ScopedHashTableVal {
+  ScopedHashTableVal *NextInScope;
+  ScopedHashTableVal *NextForKey;
+  K Key;
+  V Val;
+public:
+  ScopedHashTableVal(ScopedHashTableVal *nextInScope, 
+                     ScopedHashTableVal *nextForKey, const K &key, const V &val)
+    : NextInScope(nextInScope), NextForKey(nextForKey), Key(key), Val(val) {
+  }
+  
+  const K &getKey() const { return Key; }
+  const V &getValue() const { return Val; }
+  V &getValue() { return Val; }
+  
+  ScopedHashTableVal *getNextForKey() { return NextForKey; }
+  const ScopedHashTableVal *getNextForKey() const { return NextForKey; }
+public:
+  ScopedHashTableVal *getNextInScope() { return NextInScope; }
+};
+
+template <typename K, typename V>
+class ScopedHashTableScope {
+  /// HT - The hashtable that we are active for.
+  ScopedHashTable<K, V> &HT;
+  
+  /// PrevScope - This is the scope that we are shadowing in HT.
+  ScopedHashTableScope *PrevScope;
+
+  /// LastValInScope - This is the last value that was inserted for this scope
+  /// or null if none have been inserted yet.
+  ScopedHashTableVal<K,V> *LastValInScope;
+  void operator=(ScopedHashTableScope&);       // DO NOT IMPLEMENT
+  ScopedHashTableScope(ScopedHashTableScope&); // DO NOT IMPLEMENT
+public:
+  ScopedHashTableScope(ScopedHashTable<K, V> &HT);
+  ~ScopedHashTableScope();
+  
+private:
+  friend class ScopedHashTable<K, V>;
+  ScopedHashTableVal<K, V> *getLastValInScope() { return LastValInScope; }
+  void setLastValInScope(ScopedHashTableVal<K,V> *Val) { LastValInScope = Val; }
+};
+
+
+template <typename K, typename V>
+class ScopedHashTableIterator {
+  ScopedHashTableVal<K,V> *Node;
+public:
+  ScopedHashTableIterator(ScopedHashTableVal<K,V> *node) : Node(node){}
+  
+  V &operator*() const {
+    assert(Node && "Dereference end()");
+    return Node->getValue();
+  }
+  V *operator->() const {
+    return &Node->getValue();
+  }
+  
+  bool operator==(const ScopedHashTableIterator &RHS) const {
+    return Node == RHS.Node;
+  }
+  bool operator!=(const ScopedHashTableIterator &RHS) const {
+    return Node != RHS.Node;
+  }
+  
+  inline ScopedHashTableIterator& operator++() {          // Preincrement
+    assert(Node && "incrementing past end()");
+    Node = Node->getNextForKey();
+    return *this;
+  }
+  ScopedHashTableIterator operator++(int) {        // Postincrement
+    ScopedHashTableIterator tmp = *this; ++*this; return tmp;
+  }
+};
+
+
+template <typename K, typename V>
+class ScopedHashTable {
+  DenseMap<K, ScopedHashTableVal<K,V>*> TopLevelMap;
+  ScopedHashTableScope<K, V> *CurScope;
+  ScopedHashTable(const ScopedHashTable&); // NOT YET IMPLEMENTED
+  void operator=(const ScopedHashTable&);  // NOT YET IMPLEMENTED
+  friend class ScopedHashTableScope<K, V>;
+public:
+  ScopedHashTable() : CurScope(0) {}
+  ~ScopedHashTable() {
+    assert(CurScope == 0 && TopLevelMap.empty() && "Scope imbalance!");
+  }
+  
+  void insert(const K &Key, const V &Val) {
+    assert(CurScope && "No scope active!");
+    
+    ScopedHashTableVal<K,V> *&KeyEntry = TopLevelMap[Key];
+    
+    KeyEntry = new ScopedHashTableVal<K,V>(CurScope->getLastValInScope(),
+                                           KeyEntry, Key, Val);
+    CurScope->setLastValInScope(KeyEntry);
+  }
+  
+  typedef ScopedHashTableIterator<K, V> iterator;
+
+  iterator end() { return iterator(0); }
+
+  iterator begin(const K &Key) {
+    typename DenseMap<K, ScopedHashTableVal<K,V>*>::iterator I = 
+      TopLevelMap.find(Key);
+    if (I == TopLevelMap.end()) return end();
+    return iterator(I->second);
+  }
+};
+
+/// ScopedHashTableScope ctor - Install this as the current scope for the hash
+/// table.
+template <typename K, typename V>
+ScopedHashTableScope<K, V>::ScopedHashTableScope(ScopedHashTable<K, V> &ht)
+  : HT(ht) {
+  PrevScope = HT.CurScope;
+  HT.CurScope = this;
+  LastValInScope = 0;
+}
+
+template <typename K, typename V>
+ScopedHashTableScope<K, V>::~ScopedHashTableScope() {
+  assert(HT.CurScope == this && "Scope imbalance!");
+  HT.CurScope = PrevScope;
+  
+  // Pop and delete all values corresponding to this scope.
+  while (ScopedHashTableVal<K, V> *ThisEntry = LastValInScope) {
+    // Pop this value out of the TopLevelMap.
+    if (ThisEntry->getNextForKey() == 0) {
+      assert(HT.TopLevelMap[ThisEntry->getKey()] == ThisEntry &&
+             "Scope imbalance!");
+      HT.TopLevelMap.erase(ThisEntry->getKey());
+    } else {      
+      ScopedHashTableVal<K,V> *&KeyEntry = HT.TopLevelMap[ThisEntry->getKey()];
+      assert(KeyEntry == ThisEntry && "Scope imbalance!");
+      KeyEntry = ThisEntry->getNextForKey();
+    }
+    
+    // Pop this value out of the scope.
+    LastValInScope = ThisEntry->getNextInScope();
+    
+    // Delete this entry.
+    delete ThisEntry;
+  }
+}
+
+} // end namespace llvm
+
+#endif

Modified: llvm/branches/non-call-eh/include/llvm/ADT/SmallPtrSet.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/SmallPtrSet.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/SmallPtrSet.h (original)
+++ llvm/branches/non-call-eh/include/llvm/ADT/SmallPtrSet.h Sun Jul  6 15:45:41 2008
@@ -121,7 +121,7 @@
   bool isSmall() const { return CurArray == &SmallArray[0]; }
 
   unsigned Hash(const void *Ptr) const {
-    return ((uintptr_t)Ptr >> 4) & (CurArraySize-1);
+    return static_cast<unsigned>(((uintptr_t)Ptr >> 4) & (CurArraySize-1));
   }
   const void * const *FindBucketFor(const void *Ptr) const;
   void shrink_and_clear();

Modified: llvm/branches/non-call-eh/include/llvm/ADT/SmallVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/SmallVector.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/SmallVector.h (original)
+++ llvm/branches/non-call-eh/include/llvm/ADT/SmallVector.h Sun Jul  6 15:45:41 2008
@@ -14,8 +14,10 @@
 #ifndef LLVM_ADT_SMALLVECTOR_H
 #define LLVM_ADT_SMALLVECTOR_H
 
-#include "llvm/ADT/iterator"
+#include "llvm/ADT/iterator.h"
+#include "llvm/Support/type_traits.h"
 #include <algorithm>
+#include <cstring>
 #include <memory>
 
 #ifdef _MSC_VER
@@ -84,7 +86,7 @@
 
     // If this wasn't grown from the inline copy, deallocate the old space.
     if (!isSmall())
-      delete[] reinterpret_cast<char*>(Begin);
+      operator delete(static_cast<void*>(Begin));
   }
   
   typedef size_t size_type;
@@ -190,7 +192,7 @@
   ///
   template<typename in_iter>
   void append(in_iter in_start, in_iter in_end) {
-    unsigned NumInputs = std::distance(in_start, in_end);
+    size_type NumInputs = std::distance(in_start, in_end);
     // Grow allocated space if needed.
     if (End+NumInputs > Capacity)
       grow(size()+NumInputs);
@@ -242,7 +244,7 @@
       *I = Elt;
       return I;
     }
-    unsigned EltNo = I-Begin;
+    size_t EltNo = I-Begin;
     grow();
     I = Begin+EltNo;
     goto Retry;
@@ -255,12 +257,12 @@
       return end()-1;
     }
     
-    unsigned NumToInsert = std::distance(From, To);
+    size_t NumToInsert = std::distance(From, To);
     // Convert iterator to elt# to avoid invalidating iterator when we reserve()
-    unsigned InsertElt = I-begin();
+    size_t InsertElt = I-begin();
     
     // Ensure there is enough space.
-    reserve(size() + NumToInsert);
+    reserve(static_cast<unsigned>(size() + NumToInsert));
     
     // Uninvalidate the iterator.
     I = begin()+InsertElt;
@@ -285,7 +287,7 @@
     // Copy over the elements that we're about to overwrite.
     T *OldEnd = End;
     End += NumToInsert;
-    unsigned NumOverwritten = OldEnd-I;
+    size_t NumOverwritten = OldEnd-I;
     std::uninitialized_copy(I, OldEnd, End-NumOverwritten);
     
     // Replace the overwritten part.
@@ -300,25 +302,30 @@
   
   bool operator==(const SmallVectorImpl &RHS) const {
     if (size() != RHS.size()) return false;
-    for (T *This = Begin, *That = RHS.Begin, *End = Begin+size(); 
-         This != End; ++This, ++That)
+    for (T *This = Begin, *That = RHS.Begin, *E = Begin+size(); 
+         This != E; ++This, ++That)
       if (*This != *That)
         return false;
     return true;
   }
   bool operator!=(const SmallVectorImpl &RHS) const { return !(*this == RHS); }
+
+  bool operator<(const SmallVectorImpl &RHS) const {
+    return std::lexicographical_compare(begin(), end(),
+                                        RHS.begin(), RHS.end());
+  }
   
 private:
   /// isSmall - Return true if this is a smallvector which has not had dynamic
   /// memory allocated for it.
   bool isSmall() const {
-    return reinterpret_cast<const void*>(Begin) == 
-           reinterpret_cast<const void*>(&FirstEl);
+    return static_cast<const void*>(Begin) == 
+           static_cast<const void*>(&FirstEl);
   }
 
   /// grow - double the size of the allocated memory, guaranteeing space for at
   /// least one more element or MinSize if specified.
-  void grow(unsigned MinSize = 0);
+  void grow(size_type MinSize = 0);
 
   void construct_range(T *S, T *E, const T &Elt) {
     for (; S != E; ++S)
@@ -335,23 +342,27 @@
 
 // Define this out-of-line to dissuade the C++ compiler from inlining it.
 template <typename T>
-void SmallVectorImpl<T>::grow(unsigned MinSize) {
-  unsigned CurCapacity = unsigned(Capacity-Begin);
-  unsigned CurSize = unsigned(size());
-  unsigned NewCapacity = 2*CurCapacity;
+void SmallVectorImpl<T>::grow(size_t MinSize) {
+  size_t CurCapacity = Capacity-Begin;
+  size_t CurSize = size();
+  size_t NewCapacity = 2*CurCapacity;
   if (NewCapacity < MinSize)
     NewCapacity = MinSize;
-  T *NewElts = reinterpret_cast<T*>(new char[NewCapacity*sizeof(T)]);
+  T *NewElts = static_cast<T*>(operator new(NewCapacity*sizeof(T)));
   
   // Copy the elements over.
-  std::uninitialized_copy(Begin, End, NewElts);
+  if (is_class<T>::value)
+    std::uninitialized_copy(Begin, End, NewElts);
+  else
+    // Use memcpy for PODs (std::uninitialized_copy optimizes to memmove).
+    memcpy(NewElts, Begin, CurSize * sizeof(T));
   
   // Destroy the original elements.
   destroy_range(Begin, End);
   
   // If this wasn't grown from the inline copy, deallocate the old space.
   if (!isSmall())
-    delete[] reinterpret_cast<char*>(Begin);
+    operator delete(static_cast<void*>(Begin));
   
   Begin = NewElts;
   End = NewElts+CurSize;
@@ -375,20 +386,20 @@
     RHS.grow(size());
   
   // Swap the shared elements.
-  unsigned NumShared = size();
+  size_t NumShared = size();
   if (NumShared > RHS.size()) NumShared = RHS.size();
-  for (unsigned i = 0; i != NumShared; ++i)
+  for (unsigned i = 0; i != static_cast<unsigned>(NumShared); ++i)
     std::swap(Begin[i], RHS[i]);
   
   // Copy over the extra elts.
   if (size() > RHS.size()) {
-    unsigned EltDiff = size() - RHS.size();
+    size_t EltDiff = size() - RHS.size();
     std::uninitialized_copy(Begin+NumShared, End, RHS.End);
     RHS.End += EltDiff;
     destroy_range(Begin+NumShared, End);
     End = Begin+NumShared;
   } else if (RHS.size() > size()) {
-    unsigned EltDiff = RHS.size() - size();
+    size_t EltDiff = RHS.size() - size();
     std::uninitialized_copy(RHS.Begin+NumShared, RHS.End, End);
     End += EltDiff;
     destroy_range(RHS.Begin+NumShared, RHS.End);
@@ -458,7 +469,9 @@
   typedef typename SmallVectorImpl<T>::U U;
   enum {
     // MinUs - The number of U's require to cover N T's.
-    MinUs = (sizeof(T)*N+sizeof(U)-1)/sizeof(U),
+    MinUs = (static_cast<unsigned int>(sizeof(T))*N +
+             static_cast<unsigned int>(sizeof(U)) - 1) / 
+            static_cast<unsigned int>(sizeof(U)),
     
     // NumInlineEltsElts - The number of elements actually in this array.  There
     // is already one in the parent class, and we have to round up to avoid
@@ -467,7 +480,8 @@
     
     // NumTsAvailable - The number of T's we actually have space for, which may
     // be more than N due to rounding.
-    NumTsAvailable = (NumInlineEltsElts+1)*sizeof(U) / sizeof(T)
+    NumTsAvailable = (NumInlineEltsElts+1)*static_cast<unsigned int>(sizeof(U))/
+                     static_cast<unsigned int>(sizeof(T))
   };
   U InlineElts[NumInlineEltsElts];
 public:  
@@ -490,11 +504,12 @@
     if (!RHS.empty())
       operator=(RHS);
   }
-  
+
   const SmallVector &operator=(const SmallVector &RHS) {
     SmallVectorImpl<T>::operator=(RHS);
     return *this;
   }
+  
 };
 
 } // End llvm namespace

Modified: llvm/branches/non-call-eh/include/llvm/ADT/SparseBitVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/SparseBitVector.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/SparseBitVector.h (original)
+++ llvm/branches/non-call-eh/include/llvm/ADT/SparseBitVector.h Sun Jul  6 15:45:41 2008
@@ -21,7 +21,7 @@
 #include "llvm/Support/DataTypes.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Support/MathExtras.h"
-#include "llvm/ADT/ilist"
+#include "llvm/ADT/ilist.h"
 namespace llvm {
 
 /// SparseBitVector is an implementation of a bitvector that is sparse by only

Modified: llvm/branches/non-call-eh/include/llvm/ADT/Statistic.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/Statistic.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/Statistic.h (original)
+++ llvm/branches/non-call-eh/include/llvm/ADT/Statistic.h Sun Jul  6 15:45:41 2008
@@ -68,7 +68,7 @@
 // STATISTIC - A macro to make definition of statistics really simple.  This
 // automatically passes the DEBUG_TYPE of the file into the statistic.
 #define STATISTIC(VARNAME, DESC) \
-  static Statistic VARNAME = { DEBUG_TYPE, DESC, 0, 0 }
+  static llvm::Statistic VARNAME = { DEBUG_TYPE, DESC, 0, 0 }
 
 } // End llvm namespace
 

Modified: llvm/branches/non-call-eh/include/llvm/ADT/StringExtras.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/StringExtras.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/StringExtras.h (original)
+++ llvm/branches/non-call-eh/include/llvm/ADT/StringExtras.h Sun Jul  6 15:45:41 2008
@@ -126,7 +126,7 @@
 static inline bool StringsEqualNoCase(const std::string &LHS, 
                                       const std::string &RHS) {
   if (LHS.size() != RHS.size()) return false;
-  for (unsigned i = 0, e = LHS.size(); i != e; ++i)
+  for (unsigned i = 0, e = static_cast<unsigned>(LHS.size()); i != e; ++i)
     if (tolower(LHS[i]) != tolower(RHS[i])) return false;
   return true;
 }
@@ -135,12 +135,38 @@
 /// case.
 static inline bool StringsEqualNoCase(const std::string &LHS, 
                                       const char *RHS) {
-  for (unsigned i = 0, e = LHS.size(); i != e; ++i) {
+  for (unsigned i = 0, e = static_cast<unsigned>(LHS.size()); i != e; ++i) {
     if (RHS[i] == 0) return false;  // RHS too short.
     if (tolower(LHS[i]) != tolower(RHS[i])) return false;
   }
   return RHS[LHS.size()] == 0;  // Not too long?
 }
+  
+/// CStrInCStrNoCase - Portable version of strcasestr.  Locates the first
+///  occurance of c-string 's2' in string 's1', ignoring case.  Returns
+///  NULL if 's2' cannot be found.
+static inline const char* CStrInCStrNoCase(const char *s1, const char *s2) {
+
+  // Are either strings NULL or empty?
+  if (!s1 || !s2 || s1[0] == '\0' || s2[0] == '\0')
+    return 0;
+  
+  if (s1 == s2)
+    return s1;
+  
+  const char *I1=s1, *I2=s2;
+  
+  while (*I1 != '\0' || *I2 != '\0' )
+    if (tolower(*I1) != tolower(*I2)) { // No match.  Start over.
+      ++s1; I1 = s1; I2 = s2;
+    }
+    else { // Character match.  Advance to the next character.
+      ++I1; ++I2;
+    }
+
+  // If we exhausted all of the characters in 's2', then 's2' appears in 's1'.
+  return *I2 == '\0' ? s1 : 0;
+}
 
 /// getToken - This function extracts one token from source, ignoring any
 /// leading characters that appear in the Delimiters string, and ending the

Modified: llvm/branches/non-call-eh/include/llvm/ADT/StringMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/StringMap.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/StringMap.h (original)
+++ llvm/branches/non-call-eh/include/llvm/ADT/StringMap.h Sun Jul  6 15:45:41 2008
@@ -130,10 +130,10 @@
 public:
   ValueTy second;
 
-  explicit StringMapEntry(unsigned StrLen)
-    : StringMapEntryBase(StrLen), second() {}
-  StringMapEntry(unsigned StrLen, const ValueTy &V)
-    : StringMapEntryBase(StrLen), second(V) {}
+  explicit StringMapEntry(unsigned strLen)
+    : StringMapEntryBase(strLen), second() {}
+  StringMapEntry(unsigned strLen, const ValueTy &V)
+    : StringMapEntryBase(strLen), second(V) {}
 
   const ValueTy &getValue() const { return second; }
   ValueTy &getValue() { return second; }
@@ -153,13 +153,14 @@
   static StringMapEntry *Create(const char *KeyStart, const char *KeyEnd,
                                 AllocatorTy &Allocator,
                                 InitType InitVal) {
-    unsigned KeyLength = KeyEnd-KeyStart;
+    unsigned KeyLength = static_cast<unsigned>(KeyEnd-KeyStart);
 
     // Okay, the item doesn't already exist, and 'Bucket' is the bucket to fill
     // in.  Allocate a new item with space for the string at the end and a null
     // terminator.
 
-    unsigned AllocSize = sizeof(StringMapEntry)+KeyLength+1;
+    unsigned AllocSize = static_cast<unsigned>(sizeof(StringMapEntry))+
+      KeyLength+1;
     unsigned Alignment = alignof<StringMapEntry>();
 
     StringMapEntry *NewItem =
@@ -236,9 +237,9 @@
   AllocatorTy Allocator;
   typedef StringMapEntry<ValueTy> MapEntryTy;
 public:
-  StringMap() : StringMapImpl(sizeof(MapEntryTy)) {}
+  StringMap() : StringMapImpl(static_cast<unsigned>(sizeof(MapEntryTy))) {}
   explicit StringMap(unsigned InitialSize)
-    : StringMapImpl(InitialSize, sizeof(MapEntryTy)) {}
+    : StringMapImpl(InitialSize, static_cast<unsigned>(sizeof(MapEntryTy))) {}
 
   AllocatorTy &getAllocator() { return Allocator; }
   const AllocatorTy &getAllocator() const { return Allocator; }
@@ -332,6 +333,20 @@
     return true;
   }
 
+  // clear - Empties out the StringMap
+  void clear() {
+    if (empty()) return;
+    
+    // Zap all values, resetting the keys back to non-present (not tombstone),
+    // which is safe because we're removing all elements.
+    for (ItemBucket *I = TheTable, *E = TheTable+NumBuckets; I != E; ++I) {
+      if (I->Item && I->Item != getTombstoneVal()) {
+        static_cast<MapEntryTy*>(I->Item)->Destroy(Allocator);
+        I->Item = 0;
+      }
+    }
+  }
+
   /// GetOrCreateValue - Look up the specified key in the table.  If a value
   /// exists, return it.  Otherwise, default construct a value, insert it, and
   /// return.
@@ -376,11 +391,22 @@
     V.Destroy(Allocator);
   }
 
+  bool erase(const char *Key) {
+    iterator I = find(Key);
+    if (I == end()) return false;
+    erase(I);
+    return true;
+  }
+
+  bool erase(const std::string &Key) {
+    iterator I = find(Key);
+    if (I == end()) return false;
+    erase(I);
+    return true;
+  }
+
   ~StringMap() {
-    for (ItemBucket *I = TheTable, *E = TheTable+NumBuckets; I != E; ++I) {
-      if (I->Item && I->Item != getTombstoneVal())
-        static_cast<MapEntryTy*>(I->Item)->Destroy(Allocator);
-    }
+    clear();
     free(TheTable);
   }
 private:

Added: llvm/branches/non-call-eh/include/llvm/ADT/StringSet.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/StringSet.h?rev=53163&view=auto

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/StringSet.h (added)
+++ llvm/branches/non-call-eh/include/llvm/ADT/StringSet.h Sun Jul  6 15:45:41 2008
@@ -0,0 +1,40 @@
+//===--- StringSet.h - 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.
+//
+//===----------------------------------------------------------------------===//
+//
+//  StringSet - A set-like wrapper for the StringMap.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_STRINGSET_H
+#define LLVM_ADT_STRINGSET_H
+
+#include "llvm/ADT/StringMap.h"
+
+#include <cassert>
+
+namespace llvm {
+
+  /// StringSet - A wrapper for StringMap that provides set-like
+  /// functionality.  Only insert() and count() methods are used by my
+  /// code.
+  template <class AllocatorTy = llvm::MallocAllocator>
+  class StringSet : public llvm::StringMap<char, AllocatorTy> {
+    typedef llvm::StringMap<char, AllocatorTy> base;
+  public:
+    void insert (const std::string& InLang) {
+      assert(!InLang.empty());
+      const char* KeyStart = &InLang[0];
+      const char* KeyEnd = KeyStart + InLang.size();
+      base::insert(llvm::StringMapEntry<char>::
+                   Create(KeyStart, KeyEnd, base::getAllocator(), '+'));
+    }
+  };
+}
+
+#endif // LLVM_ADT_STRINGSET_H

Modified: llvm/branches/non-call-eh/include/llvm/ADT/UniqueVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/UniqueVector.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/UniqueVector.h (original)
+++ llvm/branches/non-call-eh/include/llvm/ADT/UniqueVector.h Sun Jul  6 15:45:41 2008
@@ -41,7 +41,7 @@
     if (Val) return Val;
 
     // Compute ID for entry.
-    Val = Vector.size() + 1;
+    Val = static_cast<unsigned>(Vector.size()) + 1;
     
     // Insert in vector.
     Vector.push_back(Entry);

Added: llvm/branches/non-call-eh/include/llvm/ADT/hash_map.h.in
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/hash_map.h.in?rev=53163&view=auto

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/hash_map.h.in (added)
+++ llvm/branches/non-call-eh/include/llvm/ADT/hash_map.h.in Sun Jul  6 15:45:41 2008
@@ -0,0 +1,150 @@
+//==-- llvm/ADT/hash_map.h - "Portable" wrapper around hash_map --*- C++ -*-==//
+// 
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+// 
+//===----------------------------------------------------------------------===//
+// 
+// This file provides a wrapper around the mysterious <hash_map> header file
+// that seems to move around between GCC releases into and out of namespaces at
+// will.  #including this header will cause hash_map to be available in the
+// global namespace.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_HASH_MAP_H
+#define LLVM_ADT_HASH_MAP_H
+
+// Compiler Support Matrix
+//
+// Version   Namespace   Header File
+//  2.95.x       ::        hash_map
+//  3.0.4       std      ext/hash_map
+//  3.1      __gnu_cxx   ext/hash_map
+//  HP aCC6     std      stdex/rw/hashm*ap.h
+//  MS VC++    stdext      hash_map
+
+#undef HAVE_GNU_EXT_HASH_MAP
+#undef HAVE_STD_EXT_HASH_MAP
+#undef HAVE_GLOBAL_HASH_MAP
+#undef HAVE_RW_STDEX_HASH_MAP_H
+
+#if HAVE_GNU_EXT_HASH_MAP
+// This is for GCC-3.1+ which puts hash in ext/hash_map
+# include <ext/hash_map>
+# ifndef HASH_NAMESPACE
+#  define HASH_NAMESPACE __gnu_cxx
+# endif
+
+// GCC 3.0.x puts hash_map in <ext/hash_map> and in the std namespace.
+#elif HAVE_STD_EXT_HASH_MAP
+# include <ext/hash_map>
+# ifndef HASH_NAMESPACE
+#  define HASH_NAMESPACE std
+# endif
+
+// Older compilers such as GCC before version 3.0 do not keep
+// extensions in the `ext' directory, and ignore the `std' namespace.
+#elif HAVE_GLOBAL_HASH_MAP
+# include <hash_map>
+# ifndef HASH_NAMESPACE
+#  define HASH_NAMESPACE std
+# endif
+
+// HP aCC doesn't include an SGI-like hash_map. For this platform (or
+// any others using Rogue Wave Software's Tools.h++ library), we wrap
+// around them in std::
+#elif HAVE_RW_STDEX_HASH_MAP_H
+# include <rw/stdex/hashmap.h>
+# include <rw/stdex/hashmmap.h>
+# ifndef HASH_NAMESPACE
+#  define HASH_NAMESPACE std
+# endif
+
+// Support Microsoft VC++.
+#elif defined(_MSC_VER)
+# include <hash_map>
+# ifndef HASH_NAMESPACE
+#  define HASH_NAMESPACE stdext
+   using std::_Distance;
+# endif
+
+// Give a warning if we couldn't find it, instead of (or in addition to)
+// randomly doing something dumb.
+#else
+# warning "Autoconfiguration failed to find the hash_map header file."
+#endif
+
+// we wrap Rogue Wave Tools.h++ rw_hashmap into something SGI-looking, here:
+#ifdef HAVE_RW_STDEX_HASH_MAP_H
+namespace HASH_NAMESPACE {
+
+template <class DataType> struct hash {
+  unsigned int operator()(const unsigned int& x) const {
+      return x;
+  }
+};
+
+template <typename KeyType,
+          typename ValueType,
+          class _HashFcn = hash<KeyType>,
+          class _EqualKey = equal_to<KeyType>,
+          class _A = allocator <ValueType> >
+class hash_map : public rw_hashmap<KeyType, ValueType, class _HashFcn, 
+                                   class _EqualKey, class _A> {
+};
+
+template <typename KeyType,
+          typename ValueType,
+          class _HashFcn = hash<KeyType>,
+          class _EqualKey = equal_to<KeyType>,
+          class _A = allocator <ValueType> >
+class hash_multimap : public rw_hashmultimap<KeyType, ValueType, class _HashFcn,
+                                             class _EqualKey, class _A> {
+};
+
+} // end HASH_NAMESPACE;
+#endif
+
+// Include vector because ext/hash_map includes stl_vector.h and leaves
+// out specializations like stl_bvector.h, causing link conflicts.
+#include <vector>
+
+#ifdef _MSC_VER
+
+// GCC and VC++ have differing ways of implementing hash_maps.  As it's not
+// standardized, that's to be expected.  This adapter class allows VC++
+// hash_map to use GCC's hash classes.
+namespace stdext {
+  template<class Key> struct hash;
+  
+  // Provide a hash function for unsigned ints...
+  template<> struct hash<unsigned int> {
+    inline size_t operator()(unsigned int Val) const {
+      return Val;
+    }
+  };
+
+  template<class Key> class hash_compare<Key, std::less<Key> > {
+    std::less<Key> comp;
+  public:
+    enum { bucket_size = 4 };
+    enum { min_buckets = 8 };
+    hash_compare() {}
+    hash_compare(std::less<Key> pred) : comp(pred) {}
+    size_t operator()(const Key& key) const { return hash<Key>()(key); }
+    bool operator()(const Key& k1, const Key& k2) const { return comp(k1, k2); }
+  };
+}
+
+#endif
+
+using HASH_NAMESPACE::hash_map;
+using HASH_NAMESPACE::hash_multimap;
+using HASH_NAMESPACE::hash;
+
+#include "llvm/ADT/HashExtras.h"
+
+#endif // LLVM_ADT_HASH_MAP_H

Removed: llvm/branches/non-call-eh/include/llvm/ADT/hash_map.in
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/hash_map.in?rev=53162&view=auto

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/hash_map.in (original)
+++ llvm/branches/non-call-eh/include/llvm/ADT/hash_map.in (removed)
@@ -1,150 +0,0 @@
-//===-- llvm/ADT/hash_map - "Portable" wrapper around hash_map --*- C++ -*-===//
-// 
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-// 
-//===----------------------------------------------------------------------===//
-// 
-// This file provides a wrapper around the mysterious <hash_map> header file
-// that seems to move around between GCC releases into and out of namespaces at
-// will.  #including this header will cause hash_map to be available in the
-// global namespace.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_HASH_MAP
-#define LLVM_ADT_HASH_MAP
-
-// Compiler Support Matrix
-//
-// Version   Namespace   Header File
-//  2.95.x       ::        hash_map
-//  3.0.4       std      ext/hash_map
-//  3.1      __gnu_cxx   ext/hash_map
-//  HP aCC6     std      stdex/rw/hashm*ap.h
-//  MS VC++    stdext      hash_map
-
-#undef HAVE_GNU_EXT_HASH_MAP
-#undef HAVE_STD_EXT_HASH_MAP
-#undef HAVE_GLOBAL_HASH_MAP
-#undef HAVE_RW_STDEX_HASH_MAP_H
-
-#if HAVE_GNU_EXT_HASH_MAP
-// This is for GCC-3.1+ which puts hash in ext/hash_map
-# include <ext/hash_map>
-# ifndef HASH_NAMESPACE
-#  define HASH_NAMESPACE __gnu_cxx
-# endif
-
-// GCC 3.0.x puts hash_map in <ext/hash_map> and in the std namespace.
-#elif HAVE_STD_EXT_HASH_MAP
-# include <ext/hash_map>
-# ifndef HASH_NAMESPACE
-#  define HASH_NAMESPACE std
-# endif
-
-// Older compilers such as GCC before version 3.0 do not keep
-// extensions in the `ext' directory, and ignore the `std' namespace.
-#elif HAVE_GLOBAL_HASH_MAP
-# include <hash_map>
-# ifndef HASH_NAMESPACE
-#  define HASH_NAMESPACE std
-# endif
-
-// HP aCC doesn't include an SGI-like hash_map. For this platform (or
-// any others using Rogue Wave Software's Tools.h++ library), we wrap
-// around them in std::
-#elif HAVE_RW_STDEX_HASH_MAP_H
-# include <rw/stdex/hashmap.h>
-# include <rw/stdex/hashmmap.h>
-# ifndef HASH_NAMESPACE
-#  define HASH_NAMESPACE std
-# endif
-
-// Support Microsoft VC++.
-#elif defined(_MSC_VER)
-# include <hash_map>
-# ifndef HASH_NAMESPACE
-#  define HASH_NAMESPACE stdext
-   using std::_Distance;
-# endif
-
-// Give a warning if we couldn't find it, instead of (or in addition to)
-// randomly doing something dumb.
-#else
-# warning "Autoconfiguration failed to find the hash_map header file."
-#endif
-
-// we wrap Rogue Wave Tools.h++ rw_hashmap into something SGI-looking, here:
-#ifdef HAVE_RW_STDEX_HASH_MAP_H
-namespace HASH_NAMESPACE {
-
-template <class DataType> struct hash {
-  unsigned int operator()(const unsigned int& x) const {
-      return x;
-  }
-};
-
-template <typename KeyType,
-          typename ValueType,
-          class _HashFcn = hash<KeyType>,
-          class _EqualKey = equal_to<KeyType>,
-          class _A = allocator <ValueType> >
-class hash_map : public rw_hashmap<KeyType, ValueType, class _HashFcn, 
-                                   class _EqualKey, class _A> {
-};
-
-template <typename KeyType,
-          typename ValueType,
-          class _HashFcn = hash<KeyType>,
-          class _EqualKey = equal_to<KeyType>,
-          class _A = allocator <ValueType> >
-class hash_multimap : public rw_hashmultimap<KeyType, ValueType, class _HashFcn,
-                                             class _EqualKey, class _A> {
-};
-
-} // end HASH_NAMESPACE;
-#endif
-
-// Include vector because ext/hash_map includes stl_vector.h and leaves
-// out specializations like stl_bvector.h, causing link conflicts.
-#include <vector>
-
-#ifdef _MSC_VER
-
-// GCC and VC++ have differing ways of implementing hash_maps.  As it's not
-// standardized, that's to be expected.  This adapter class allows VC++
-// hash_map to use GCC's hash classes.
-namespace stdext {
-  template<class Key> struct hash;
-  
-  // Provide a hash function for unsigned ints...
-  template<> struct hash<unsigned int> {
-    inline size_t operator()(unsigned int Val) const {
-      return Val;
-    }
-  };
-
-  template<class Key> class hash_compare<Key, std::less<Key> > {
-    std::less<Key> comp;
-  public:
-    enum { bucket_size = 4 };
-    enum { min_buckets = 8 };
-    hash_compare() {}
-    hash_compare(std::less<Key> pred) : comp(pred) {}
-    size_t operator()(const Key& key) const { return hash<Key>()(key); }
-    bool operator()(const Key& k1, const Key& k2) const { return comp(k1, k2); }
-  };
-}
-
-#endif
-
-using HASH_NAMESPACE::hash_map;
-using HASH_NAMESPACE::hash_multimap;
-using HASH_NAMESPACE::hash;
-
-#include "llvm/ADT/HashExtras.h"
-
-#endif

Added: llvm/branches/non-call-eh/include/llvm/ADT/hash_set.h.in
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/hash_set.h.in?rev=53163&view=auto

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/hash_set.h.in (added)
+++ llvm/branches/non-call-eh/include/llvm/ADT/hash_set.h.in Sun Jul  6 15:45:41 2008
@@ -0,0 +1,111 @@
+//==-- llvm/ADT/hash_set.h - "Portable" wrapper around hash_set --*- C++ -*-==//
+// 
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+// 
+//===----------------------------------------------------------------------===//
+// vim:ft=cpp
+//
+// This file provides a wrapper around the mysterious <hash_set> header file
+// that seems to move around between GCC releases into and out of namespaces at
+// will.  #including this header will cause hash_set to be available in the
+// global namespace.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_HASH_SET_H
+#define LLVM_ADT_HASH_SET_H
+
+// Compiler Support Matrix
+//
+// Version   Namespace   Header File
+//  2.95.x       ::        hash_set
+//  3.0.4       std      ext/hash_set
+//  3.1      __gnu_cxx   ext/hash_set
+//  HP aCC6     std      stdex/rw/hashset.h
+//  MS VC++    stdext      hash_set
+
+#undef HAVE_GNU_EXT_HASH_SET
+#undef HAVE_STD_EXT_HASH_SET
+#undef HAVE_GLOBAL_HASH_SET
+#undef HAVE_RW_STDEX_HASH_SET_H
+
+// GCC versions 3.1 and later put hash_set in <ext/hash_set> and in
+// the __gnu_cxx namespace.
+#if HAVE_GNU_EXT_HASH_SET
+# include <ext/hash_set>
+# ifndef HASH_NAMESPACE
+#  define HASH_NAMESPACE __gnu_cxx
+# endif
+
+// GCC 3.0.x puts hash_set in <ext/hash_set> and in the std namespace.
+#elif HAVE_STD_EXT_HASH_SET
+# include <ext/hash_set>
+# ifndef HASH_NAMESPACE
+#  define HASH_NAMESPACE std
+# endif
+
+// Older compilers such as GCC before version 3.0 do not keep
+// extensions in the `ext' directory, and ignore the `std' namespace.
+#elif HAVE_GLOBAL_HASH_SET
+# include <hash_set>
+# ifndef HASH_NAMESPACE
+#  define HASH_NAMESPACE std
+# endif
+
+// HP aCC doesn't include an SGI-like hash_set. For this platform (or
+// any others using Rogue Wave Software's Tools.h++ library), we wrap
+// around them in std::
+#elif HAVE_RW_STDEX_HASH_SET_H
+# include <rw/stdex/hashset.h>
+# ifndef HASH_NAMESPACE
+#  define HASH_NAMESPACE std
+# endif
+
+// Support Microsoft VC++.
+#elif defined(_MSC_VER)
+# include <hash_set>
+# ifndef HASH_NAMESPACE
+#  define HASH_NAMESPACE stdext
+# endif
+
+// Give a warning if we couldn't find it, instead of (or in addition to)
+// randomly doing something dumb.
+#else
+# warning "Autoconfiguration failed to find the hash_set header file."
+#endif
+
+// we wrap Rogue Wave Tools.h++ rw_hashset into something SGI-looking, here:
+#ifdef HAVE_RW_STDEX_HASH_SET_H
+namespace HASH_NAMESPACE {
+
+/*
+template <class DataType> struct hash {
+    unsigned int operator()(const unsigned int& x) const {
+      return x;
+    }
+};
+*/
+
+template <typename ValueType,
+  class _HashFcn = hash<ValueType>,
+  class _EqualKey = equal_to<ValueType>,
+  class _A = allocator <ValueType> >
+class hash_set : 
+  public rw_hashset<ValueType, class _HashFcn, class _EqualKey, class _A> {
+};
+
+} // end HASH_NAMESPACE;
+#endif
+
+using HASH_NAMESPACE::hash_set;
+
+// Include vector because ext/hash_set includes stl_vector.h and leaves
+// out specializations like stl_bvector.h, causing link conflicts.
+#include <vector>
+
+#include "llvm/ADT/HashExtras.h"
+
+#endif // LLVM_ADT_HASH_SET_H

Removed: llvm/branches/non-call-eh/include/llvm/ADT/hash_set.in
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/hash_set.in?rev=53162&view=auto

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/hash_set.in (original)
+++ llvm/branches/non-call-eh/include/llvm/ADT/hash_set.in (removed)
@@ -1,111 +0,0 @@
-//===-- llvm/ADT/hash_set - "Portable" wrapper around hash_set --*- C++ -*-===//
-// 
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-// 
-//===----------------------------------------------------------------------===//
-// vim:ft=cpp
-//
-// This file provides a wrapper around the mysterious <hash_set> header file
-// that seems to move around between GCC releases into and out of namespaces at
-// will.  #including this header will cause hash_set to be available in the
-// global namespace.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_HASH_SET
-#define LLVM_ADT_HASH_SET
-
-// Compiler Support Matrix
-//
-// Version   Namespace   Header File
-//  2.95.x       ::        hash_set
-//  3.0.4       std      ext/hash_set
-//  3.1      __gnu_cxx   ext/hash_set
-//  HP aCC6     std      stdex/rw/hashset.h
-//  MS VC++    stdext      hash_set
-
-#undef HAVE_GNU_EXT_HASH_SET
-#undef HAVE_STD_EXT_HASH_SET
-#undef HAVE_GLOBAL_HASH_SET
-#undef HAVE_RW_STDEX_HASH_SET_H
-
-// GCC versions 3.1 and later put hash_set in <ext/hash_set> and in
-// the __gnu_cxx namespace.
-#if HAVE_GNU_EXT_HASH_SET
-# include <ext/hash_set>
-# ifndef HASH_NAMESPACE
-#  define HASH_NAMESPACE __gnu_cxx
-# endif
-
-// GCC 3.0.x puts hash_set in <ext/hash_set> and in the std namespace.
-#elif HAVE_STD_EXT_HASH_SET
-# include <ext/hash_set>
-# ifndef HASH_NAMESPACE
-#  define HASH_NAMESPACE std
-# endif
-
-// Older compilers such as GCC before version 3.0 do not keep
-// extensions in the `ext' directory, and ignore the `std' namespace.
-#elif HAVE_GLOBAL_HASH_SET
-# include <hash_set>
-# ifndef HASH_NAMESPACE
-#  define HASH_NAMESPACE std
-# endif
-
-// HP aCC doesn't include an SGI-like hash_set. For this platform (or
-// any others using Rogue Wave Software's Tools.h++ library), we wrap
-// around them in std::
-#elif HAVE_RW_STDEX_HASH_SET_H
-# include <rw/stdex/hashset.h>
-# ifndef HASH_NAMESPACE
-#  define HASH_NAMESPACE std
-# endif
-
-// Support Microsoft VC++.
-#elif defined(_MSC_VER)
-# include <hash_set>
-# ifndef HASH_NAMESPACE
-#  define HASH_NAMESPACE stdext
-# endif
-
-// Give a warning if we couldn't find it, instead of (or in addition to)
-// randomly doing something dumb.
-#else
-# warning "Autoconfiguration failed to find the hash_set header file."
-#endif
-
-// we wrap Rogue Wave Tools.h++ rw_hashset into something SGI-looking, here:
-#ifdef HAVE_RW_STDEX_HASH_SET_H
-namespace HASH_NAMESPACE {
-
-/*
-template <class DataType> struct hash {
-    unsigned int operator()(const unsigned int& x) const {
-      return x;
-    }
-};
-*/
-
-template <typename ValueType,
-  class _HashFcn = hash<ValueType>,
-  class _EqualKey = equal_to<ValueType>,
-  class _A = allocator <ValueType> >
-class hash_set : 
-  public rw_hashset<ValueType, class _HashFcn, class _EqualKey, class _A> {
-};
-
-} // end HASH_NAMESPACE;
-#endif
-
-using HASH_NAMESPACE::hash_set;
-
-// Include vector because ext/hash_set includes stl_vector.h and leaves
-// out specializations like stl_bvector.h, causing link conflicts.
-#include <vector>
-
-#include "llvm/ADT/HashExtras.h"
-
-#endif

Removed: llvm/branches/non-call-eh/include/llvm/ADT/ilist
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/ilist?rev=53162&view=auto

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/ilist (original)
+++ llvm/branches/non-call-eh/include/llvm/ADT/ilist (removed)
@@ -1,634 +0,0 @@
-//===-- llvm/ADT/ilist - Intrusive Linked List Template ---------*- 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 classes to implement an intrusive doubly linked list class
-// (i.e. each node of the list must contain a next and previous field for the
-// list.
-//
-// The ilist_traits trait class is used to gain access to the next and previous
-// fields of the node type that the list is instantiated with.  If it is not
-// specialized, the list defaults to using the getPrev(), getNext() method calls
-// to get the next and previous pointers.
-//
-// The ilist class itself, should be a plug in replacement for list, assuming
-// that the nodes contain next/prev pointers.  This list replacement does not
-// provides a constant time size() method, so be careful to use empty() when you
-// really want to know if it's empty.
-//
-// The ilist class is implemented by allocating a 'tail' node when the list is
-// created (using ilist_traits<>::createSentinel()).  This tail node is
-// absolutely required because the user must be able to compute end()-1. Because
-// of this, users of the direct next/prev links will see an extra link on the
-// end of the list, which should be ignored.
-//
-// Requirements for a user of this list:
-//
-//   1. The user must provide {g|s}et{Next|Prev} methods, or specialize
-//      ilist_traits to provide an alternate way of getting and setting next and
-//      prev links.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_ILIST
-#define LLVM_ADT_ILIST
-
-#include "llvm/ADT/iterator"
-#include <cassert>
-#include <cstdlib>
-
-namespace llvm {
-
-template<typename NodeTy, typename Traits> class iplist;
-template<typename NodeTy> class ilist_iterator;
-
-// Template traits for intrusive list.  By specializing this template class, you
-// can change what next/prev fields are used to store the links...
-template<typename NodeTy>
-struct ilist_traits {
-  static NodeTy *getPrev(NodeTy *N) { return N->getPrev(); }
-  static NodeTy *getNext(NodeTy *N) { return N->getNext(); }
-  static const NodeTy *getPrev(const NodeTy *N) { return N->getPrev(); }
-  static const NodeTy *getNext(const NodeTy *N) { return N->getNext(); }
-
-  static void setPrev(NodeTy *N, NodeTy *Prev) { N->setPrev(Prev); }
-  static void setNext(NodeTy *N, NodeTy *Next) { N->setNext(Next); }
-
-  static NodeTy *createNode(const NodeTy &V) { return new NodeTy(V); }
-
-  static NodeTy *createSentinel() { return new NodeTy(); }
-  static void destroySentinel(NodeTy *N) { delete N; }
-
-  void addNodeToList(NodeTy *NTy) {}
-  void removeNodeFromList(NodeTy *NTy) {}
-  void transferNodesFromList(iplist<NodeTy, ilist_traits> &L2,
-                             ilist_iterator<NodeTy> first,
-                             ilist_iterator<NodeTy> last) {}
-};
-
-// Const traits are the same as nonconst traits...
-template<typename Ty>
-struct ilist_traits<const Ty> : public ilist_traits<Ty> {};
-
-
-//===----------------------------------------------------------------------===//
-// ilist_iterator<Node> - Iterator for intrusive list.
-//
-template<typename NodeTy>
-class ilist_iterator
-  : public bidirectional_iterator<NodeTy, ptrdiff_t> {
-  typedef ilist_traits<NodeTy> Traits;
-  typedef bidirectional_iterator<NodeTy, ptrdiff_t> super;
-
-public:
-  typedef size_t size_type;
-  typedef typename super::pointer pointer;
-  typedef typename super::reference reference;
-private:
-  pointer NodePtr;
-public:
-
-  ilist_iterator(pointer NP) : NodePtr(NP) {}
-  ilist_iterator(reference NR) : NodePtr(&NR) {}
-  ilist_iterator() : NodePtr(0) {}
-
-  // This is templated so that we can allow constructing a const iterator from
-  // a nonconst iterator...
-  template<class node_ty>
-  ilist_iterator(const ilist_iterator<node_ty> &RHS)
-    : NodePtr(RHS.getNodePtrUnchecked()) {}
-
-  // This is templated so that we can allow assigning to a const iterator from
-  // a nonconst iterator...
-  template<class node_ty>
-  const ilist_iterator &operator=(const ilist_iterator<node_ty> &RHS) {
-    NodePtr = RHS.getNodePtrUnchecked();
-    return *this;
-  }
-
-  // Accessors...
-  operator pointer() const {
-    assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!");
-    return NodePtr;
-  }
-
-  reference operator*() const {
-    assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!");
-    return *NodePtr;
-  }
-  pointer operator->() { return &operator*(); }
-  const pointer operator->() const { return &operator*(); }
-
-  // Comparison operators
-  bool operator==(const ilist_iterator &RHS) const {
-    return NodePtr == RHS.NodePtr;
-  }
-  bool operator!=(const ilist_iterator &RHS) const {
-    return NodePtr != RHS.NodePtr;
-  }
-
-  // Increment and decrement operators...
-  ilist_iterator &operator--() {      // predecrement - Back up
-    NodePtr = Traits::getPrev(NodePtr);
-    assert(Traits::getNext(NodePtr) && "--'d off the beginning of an ilist!");
-    return *this;
-  }
-  ilist_iterator &operator++() {      // preincrement - Advance
-    NodePtr = Traits::getNext(NodePtr);
-    assert(NodePtr && "++'d off the end of an ilist!");
-    return *this;
-  }
-  ilist_iterator operator--(int) {    // postdecrement operators...
-    ilist_iterator tmp = *this;
-    --*this;
-    return tmp;
-  }
-  ilist_iterator operator++(int) {    // postincrement operators...
-    ilist_iterator tmp = *this;
-    ++*this;
-    return tmp;
-  }
-
-  // Internal interface, do not use...
-  pointer getNodePtrUnchecked() const { return NodePtr; }
-};
-
-// do not implement. this is to catch errors when people try to use
-// them as random access iterators
-template<typename T>
-void operator-(int, ilist_iterator<T>);
-template<typename T>
-void operator-(ilist_iterator<T>,int);
-
-template<typename T>
-void operator+(int, ilist_iterator<T>);
-template<typename T>
-void operator+(ilist_iterator<T>,int);
-
-// operator!=/operator== - Allow mixed comparisons without dereferencing
-// the iterator, which could very likely be pointing to end().
-template<typename T>
-bool operator!=(const T* LHS, const ilist_iterator<const T> &RHS) {
-  return LHS != RHS.getNodePtrUnchecked();
-}
-template<typename T>
-bool operator==(const T* LHS, const ilist_iterator<const T> &RHS) {
-  return LHS == RHS.getNodePtrUnchecked();
-}
-template<typename T>
-bool operator!=(T* LHS, const ilist_iterator<T> &RHS) {
-  return LHS != RHS.getNodePtrUnchecked();
-}
-template<typename T>
-bool operator==(T* LHS, const ilist_iterator<T> &RHS) {
-  return LHS == RHS.getNodePtrUnchecked();
-}
-
-
-// Allow ilist_iterators to convert into pointers to a node automatically when
-// used by the dyn_cast, cast, isa mechanisms...
-
-template<typename From> struct simplify_type;
-
-template<typename NodeTy> struct simplify_type<ilist_iterator<NodeTy> > {
-  typedef NodeTy* SimpleType;
-  
-  static SimpleType getSimplifiedValue(const ilist_iterator<NodeTy> &Node) {
-    return &*Node;
-  }
-};
-template<typename NodeTy> struct simplify_type<const ilist_iterator<NodeTy> > {
-  typedef NodeTy* SimpleType;
-  
-  static SimpleType getSimplifiedValue(const ilist_iterator<NodeTy> &Node) {
-    return &*Node;
-  }
-};
-
-
-//===----------------------------------------------------------------------===//
-//
-/// iplist - The subset of list functionality that can safely be used on nodes
-/// of polymorphic types, i.e. a heterogenous list with a common base class that
-/// holds the next/prev pointers.  The only state of the list itself is a single
-/// pointer to the head of the list.
-///
-/// This list can be in one of three interesting states:
-/// 1. The list may be completely unconstructed.  In this case, the head
-///    pointer is null.  When in this form, any query for an iterator (e.g.
-///    begin() or end()) causes the list to transparently change to state #2.
-/// 2. The list may be empty, but contain a sentinal for the end iterator. This
-///    sentinal is created by the Traits::createSentinel method and is a link
-///    in the list.  When the list is empty, the pointer in the iplist points
-///    to the sentinal.  Once the sentinal is constructed, it
-///    is not destroyed until the list is.
-/// 3. The list may contain actual objects in it, which are stored as a doubly
-///    linked list of nodes.  One invariant of the list is that the predecessor
-///    of the first node in the list always points to the last node in the list,
-///    and the successor pointer for the sentinal (which always stays at the
-///    end of the list) is always null.  
-///
-template<typename NodeTy, typename Traits=ilist_traits<NodeTy> >
-class iplist : public Traits {
-  mutable NodeTy *Head;
-
-  // Use the prev node pointer of 'head' as the tail pointer.  This is really a
-  // circularly linked list where we snip the 'next' link from the sentinel node
-  // back to the first node in the list (to preserve assertions about going off
-  // the end of the list).
-  NodeTy *getTail() { return getPrev(Head); }
-  const NodeTy *getTail() const { return getPrev(Head); }
-  void setTail(NodeTy *N) const { setPrev(Head, N); }
-  
-  /// CreateLazySentinal - This method verifies whether the sentinal for the
-  /// list has been created and lazily makes it if not.
-  void CreateLazySentinal() const {
-    if (Head != 0) return;
-    Head = Traits::createSentinel();
-    setNext(Head, 0);
-    setTail(Head);
-  }
-
-  static bool op_less(NodeTy &L, NodeTy &R) { return L < R; }
-  static bool op_equal(NodeTy &L, NodeTy &R) { return L == R; }
-public:
-  typedef NodeTy *pointer;
-  typedef const NodeTy *const_pointer;
-  typedef NodeTy &reference;
-  typedef const NodeTy &const_reference;
-  typedef NodeTy value_type;
-  typedef ilist_iterator<NodeTy> iterator;
-  typedef ilist_iterator<const NodeTy> const_iterator;
-  typedef size_t size_type;
-  typedef ptrdiff_t difference_type;
-  typedef std::reverse_iterator<const_iterator>  const_reverse_iterator;
-  typedef std::reverse_iterator<iterator>  reverse_iterator;
-
-  iplist() : Head(0) {}
-  ~iplist() {
-    if (!Head) return;
-    clear();
-    Traits::destroySentinel(getTail());
-  }
-
-  // Iterator creation methods.
-  iterator begin() {
-    CreateLazySentinal(); 
-    return iterator(Head); 
-  }
-  const_iterator begin() const {
-    CreateLazySentinal();
-    return const_iterator(Head);
-  }
-  iterator end() {
-    CreateLazySentinal();
-    return iterator(getTail());
-  }
-  const_iterator end() const {
-    CreateLazySentinal();
-    return const_iterator(getTail());
-  }
-
-  // reverse iterator creation methods.
-  reverse_iterator rbegin()            { return reverse_iterator(end()); }
-  const_reverse_iterator rbegin() const{ return const_reverse_iterator(end()); }
-  reverse_iterator rend()              { return reverse_iterator(begin()); }
-  const_reverse_iterator rend() const { return const_reverse_iterator(begin());}
-
-
-  // Miscellaneous inspection routines.
-  size_type max_size() const { return size_type(-1); }
-  bool empty() const { return Head == 0 || Head == getTail(); }
-
-  // Front and back accessor functions...
-  reference front() {
-    assert(!empty() && "Called front() on empty list!");
-    return *Head;
-  }
-  const_reference front() const {
-    assert(!empty() && "Called front() on empty list!");
-    return *Head;
-  }
-  reference back() {
-    assert(!empty() && "Called back() on empty list!");
-    return *getPrev(getTail());
-  }
-  const_reference back() const {
-    assert(!empty() && "Called back() on empty list!");
-    return *getPrev(getTail());
-  }
-
-  void swap(iplist &RHS) {
-    abort();     // Swap does not use list traits callback correctly yet!
-    std::swap(Head, RHS.Head);
-  }
-
-  iterator insert(iterator where, NodeTy *New) {
-    NodeTy *CurNode = where.getNodePtrUnchecked(), *PrevNode = getPrev(CurNode);
-    setNext(New, CurNode);
-    setPrev(New, PrevNode);
-
-    if (CurNode != Head)  // Is PrevNode off the beginning of the list?
-      setNext(PrevNode, New);
-    else
-      Head = New;
-    setPrev(CurNode, New);
-
-    addNodeToList(New);  // Notify traits that we added a node...
-    return New;
-  }
-
-  NodeTy *remove(iterator &IT) {
-    assert(IT != end() && "Cannot remove end of list!");
-    NodeTy *Node = &*IT;
-    NodeTy *NextNode = getNext(Node);
-    NodeTy *PrevNode = getPrev(Node);
-
-    if (Node != Head)  // Is PrevNode off the beginning of the list?
-      setNext(PrevNode, NextNode);
-    else
-      Head = NextNode;
-    setPrev(NextNode, PrevNode);
-    IT = NextNode;
-    removeNodeFromList(Node);  // Notify traits that we removed a node...
-    
-    // Set the next/prev pointers of the current node to null.  This isn't
-    // strictly required, but this catches errors where a node is removed from
-    // an ilist (and potentially deleted) with iterators still pointing at it.
-    // When those iterators are incremented or decremented, they will assert on
-    // the null next/prev pointer instead of "usually working".
-    setNext(Node, 0);
-    setPrev(Node, 0);
-    return Node;
-  }
-
-  NodeTy *remove(const iterator &IT) {
-    iterator MutIt = IT;
-    return remove(MutIt);
-  }
-
-  // erase - remove a node from the controlled sequence... and delete it.
-  iterator erase(iterator where) {
-    delete remove(where);
-    return where;
-  }
-
-
-private:
-  // transfer - The heart of the splice function.  Move linked list nodes from
-  // [first, last) into position.
-  //
-  void transfer(iterator position, iplist &L2, iterator first, iterator last) {
-    assert(first != last && "Should be checked by callers");
-
-    if (position != last) {
-      // Note: we have to be careful about the case when we move the first node
-      // in the list.  This node is the list sentinel node and we can't move it.
-      NodeTy *ThisSentinel = getTail();
-      setTail(0);
-      NodeTy *L2Sentinel = L2.getTail();
-      L2.setTail(0);
-
-      // Remove [first, last) from its old position.
-      NodeTy *First = &*first, *Prev = getPrev(First);
-      NodeTy *Next = last.getNodePtrUnchecked(), *Last = getPrev(Next);
-      if (Prev)
-        setNext(Prev, Next);
-      else
-        L2.Head = Next;
-      setPrev(Next, Prev);
-
-      // Splice [first, last) into its new position.
-      NodeTy *PosNext = position.getNodePtrUnchecked();
-      NodeTy *PosPrev = getPrev(PosNext);
-
-      // Fix head of list...
-      if (PosPrev)
-        setNext(PosPrev, First);
-      else
-        Head = First;
-      setPrev(First, PosPrev);
-
-      // Fix end of list...
-      setNext(Last, PosNext);
-      setPrev(PosNext, Last);
-
-      transferNodesFromList(L2, First, PosNext);
-
-      // Now that everything is set, restore the pointers to the list sentinals.
-      L2.setTail(L2Sentinel);
-      setTail(ThisSentinel);
-    }
-  }
-
-public:
-
-  //===----------------------------------------------------------------------===
-  // Functionality derived from other functions defined above...
-  //
-
-  size_type size() const {
-    if (Head == 0) return 0; // Don't require construction of sentinal if empty.
-#if __GNUC__ == 2
-    // GCC 2.95 has a broken std::distance
-    size_type Result = 0;
-    std::distance(begin(), end(), Result);
-    return Result;
-#else
-    return std::distance(begin(), end());
-#endif
-  }
-
-  iterator erase(iterator first, iterator last) {
-    while (first != last)
-      first = erase(first);
-    return last;
-  }
-
-  void clear() { if (Head) erase(begin(), end()); }
-
-  // Front and back inserters...
-  void push_front(NodeTy *val) { insert(begin(), val); }
-  void push_back(NodeTy *val) { insert(end(), val); }
-  void pop_front() {
-    assert(!empty() && "pop_front() on empty list!");
-    erase(begin());
-  }
-  void pop_back() {
-    assert(!empty() && "pop_back() on empty list!");
-    iterator t = end(); erase(--t);
-  }
-
-  // Special forms of insert...
-  template<class InIt> void insert(iterator where, InIt first, InIt last) {
-    for (; first != last; ++first) insert(where, *first);
-  }
-
-  // Splice members - defined in terms of transfer...
-  void splice(iterator where, iplist &L2) {
-    if (!L2.empty())
-      transfer(where, L2, L2.begin(), L2.end());
-  }
-  void splice(iterator where, iplist &L2, iterator first) {
-    iterator last = first; ++last;
-    if (where == first || where == last) return; // No change
-    transfer(where, L2, first, last);
-  }
-  void splice(iterator where, iplist &L2, iterator first, iterator last) {
-    if (first != last) transfer(where, L2, first, last);
-  }
-
-
-
-  //===----------------------------------------------------------------------===
-  // High-Level Functionality that shouldn't really be here, but is part of list
-  //
-
-  // These two functions are actually called remove/remove_if in list<>, but
-  // they actually do the job of erase, rename them accordingly.
-  //
-  void erase(const NodeTy &val) {
-    for (iterator I = begin(), E = end(); I != E; ) {
-      iterator next = I; ++next;
-      if (*I == val) erase(I);
-      I = next;
-    }
-  }
-  template<class Pr1> void erase_if(Pr1 pred) {
-    for (iterator I = begin(), E = end(); I != E; ) {
-      iterator next = I; ++next;
-      if (pred(*I)) erase(I);
-      I = next;
-    }
-  }
-
-  template<class Pr2> void unique(Pr2 pred) {
-    if (empty()) return;
-    for (iterator I = begin(), E = end(), Next = begin(); ++Next != E;) {
-      if (pred(*I))
-        erase(Next);
-      else
-        I = Next;
-      Next = I;
-    }
-  }
-  void unique() { unique(op_equal); }
-
-  template<class Pr3> void merge(iplist &right, Pr3 pred) {
-    iterator first1 = begin(), last1 = end();
-    iterator first2 = right.begin(), last2 = right.end();
-    while (first1 != last1 && first2 != last2)
-      if (pred(*first2, *first1)) {
-        iterator next = first2;
-        transfer(first1, right, first2, ++next);
-        first2 = next;
-      } else {
-        ++first1;
-      }
-    if (first2 != last2) transfer(last1, right, first2, last2);
-  }
-  void merge(iplist &right) { return merge(right, op_less); }
-
-  template<class Pr3> void sort(Pr3 pred);
-  void sort() { sort(op_less); }
-  void reverse();
-};
-
-
-template<typename NodeTy>
-struct ilist : public iplist<NodeTy> {
-  typedef typename iplist<NodeTy>::size_type size_type;
-  typedef typename iplist<NodeTy>::iterator iterator;
-
-  ilist() {}
-  ilist(const ilist &right) {
-    insert(this->begin(), right.begin(), right.end());
-  }
-  explicit ilist(size_type count) {
-    insert(this->begin(), count, NodeTy());
-  } 
-  ilist(size_type count, const NodeTy &val) {
-    insert(this->begin(), count, val);
-  }
-  template<class InIt> ilist(InIt first, InIt last) {
-    insert(this->begin(), first, last);
-  }
-
-
-  // Forwarding functions: A workaround for GCC 2.95 which does not correctly
-  // support 'using' declarations to bring a hidden member into scope.
-  //
-  iterator insert(iterator a, NodeTy *b){ return iplist<NodeTy>::insert(a, b); }
-  void push_front(NodeTy *a) { iplist<NodeTy>::push_front(a); }
-  void push_back(NodeTy *a)  { iplist<NodeTy>::push_back(a); }
-  
-
-  // Main implementation here - Insert for a node passed by value...
-  iterator insert(iterator where, const NodeTy &val) {
-    return insert(where, createNode(val));
-  }
-
-
-  // Front and back inserters...
-  void push_front(const NodeTy &val) { insert(this->begin(), val); }
-  void push_back(const NodeTy &val) { insert(this->end(), val); }
-
-  // Special forms of insert...
-  template<class InIt> void insert(iterator where, InIt first, InIt last) {
-    for (; first != last; ++first) insert(where, *first);
-  }
-  void insert(iterator where, size_type count, const NodeTy &val) {
-    for (; count != 0; --count) insert(where, val);
-  }
-
-  // Assign special forms...
-  void assign(size_type count, const NodeTy &val) {
-    iterator I = this->begin();
-    for (; I != this->end() && count != 0; ++I, --count)
-      *I = val;
-    if (count != 0)
-      insert(this->end(), val, val);
-    else
-      erase(I, this->end());
-  }
-  template<class InIt> void assign(InIt first1, InIt last1) {
-    iterator first2 = this->begin(), last2 = this->end();
-    for ( ; first1 != last1 && first2 != last2; ++first1, ++first2)
-      *first1 = *first2;
-    if (first2 == last2)
-      erase(first1, last1);
-    else
-      insert(last1, first2, last2);
-  }
-
-
-  // Resize members...
-  void resize(size_type newsize, NodeTy val) {
-    iterator i = this->begin();
-    size_type len = 0;
-    for ( ; i != this->end() && len < newsize; ++i, ++len) /* empty*/ ;
-
-    if (len == newsize)
-      erase(i, this->end());
-    else                                          // i == end()
-      insert(this->end(), newsize - len, val);
-  }
-  void resize(size_type newsize) { resize(newsize, NodeTy()); }
-};
-
-} // End llvm namespace
-
-namespace std {
-  // Ensure that swap uses the fast list swap...
-  template<class Ty>
-  void swap(llvm::iplist<Ty> &Left, llvm::iplist<Ty> &Right) {
-    Left.swap(Right);
-  }
-}  // End 'std' extensions...
-
-#endif

Added: llvm/branches/non-call-eh/include/llvm/ADT/ilist.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/ilist.h?rev=53163&view=auto

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/ilist.h (added)
+++ llvm/branches/non-call-eh/include/llvm/ADT/ilist.h Sun Jul  6 15:45:41 2008
@@ -0,0 +1,634 @@
+//==-- llvm/ADT/ilist.h - Intrusive Linked List Template ---------*- 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 classes to implement an intrusive doubly linked list class
+// (i.e. each node of the list must contain a next and previous field for the
+// list.
+//
+// The ilist_traits trait class is used to gain access to the next and previous
+// fields of the node type that the list is instantiated with.  If it is not
+// specialized, the list defaults to using the getPrev(), getNext() method calls
+// to get the next and previous pointers.
+//
+// The ilist class itself, should be a plug in replacement for list, assuming
+// that the nodes contain next/prev pointers.  This list replacement does not
+// provide a constant time size() method, so be careful to use empty() when you
+// really want to know if it's empty.
+//
+// The ilist class is implemented by allocating a 'tail' node when the list is
+// created (using ilist_traits<>::createSentinel()).  This tail node is
+// absolutely required because the user must be able to compute end()-1. Because
+// of this, users of the direct next/prev links will see an extra link on the
+// end of the list, which should be ignored.
+//
+// Requirements for a user of this list:
+//
+//   1. The user must provide {g|s}et{Next|Prev} methods, or specialize
+//      ilist_traits to provide an alternate way of getting and setting next and
+//      prev links.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_ILIST_H
+#define LLVM_ADT_ILIST_H
+
+#include "llvm/ADT/iterator.h"
+#include <cassert>
+#include <cstdlib>
+
+namespace llvm {
+
+template<typename NodeTy, typename Traits> class iplist;
+template<typename NodeTy> class ilist_iterator;
+
+// Template traits for intrusive list.  By specializing this template class, you
+// can change what next/prev fields are used to store the links...
+template<typename NodeTy>
+struct ilist_traits {
+  static NodeTy *getPrev(NodeTy *N) { return N->getPrev(); }
+  static NodeTy *getNext(NodeTy *N) { return N->getNext(); }
+  static const NodeTy *getPrev(const NodeTy *N) { return N->getPrev(); }
+  static const NodeTy *getNext(const NodeTy *N) { return N->getNext(); }
+
+  static void setPrev(NodeTy *N, NodeTy *Prev) { N->setPrev(Prev); }
+  static void setNext(NodeTy *N, NodeTy *Next) { N->setNext(Next); }
+
+  static NodeTy *createNode(const NodeTy &V) { return new NodeTy(V); }
+
+  static NodeTy *createSentinel() { return new NodeTy(); }
+  static void destroySentinel(NodeTy *N) { delete N; }
+
+  void addNodeToList(NodeTy *NTy) {}
+  void removeNodeFromList(NodeTy *NTy) {}
+  void transferNodesFromList(iplist<NodeTy, ilist_traits> &L2,
+                             ilist_iterator<NodeTy> first,
+                             ilist_iterator<NodeTy> last) {}
+};
+
+// Const traits are the same as nonconst traits...
+template<typename Ty>
+struct ilist_traits<const Ty> : public ilist_traits<Ty> {};
+
+
+//===----------------------------------------------------------------------===//
+// ilist_iterator<Node> - Iterator for intrusive list.
+//
+template<typename NodeTy>
+class ilist_iterator
+  : public bidirectional_iterator<NodeTy, ptrdiff_t> {
+  typedef ilist_traits<NodeTy> Traits;
+  typedef bidirectional_iterator<NodeTy, ptrdiff_t> super;
+
+public:
+  typedef size_t size_type;
+  typedef typename super::pointer pointer;
+  typedef typename super::reference reference;
+private:
+  pointer NodePtr;
+public:
+
+  ilist_iterator(pointer NP) : NodePtr(NP) {}
+  ilist_iterator(reference NR) : NodePtr(&NR) {}
+  ilist_iterator() : NodePtr(0) {}
+
+  // This is templated so that we can allow constructing a const iterator from
+  // a nonconst iterator...
+  template<class node_ty>
+  ilist_iterator(const ilist_iterator<node_ty> &RHS)
+    : NodePtr(RHS.getNodePtrUnchecked()) {}
+
+  // This is templated so that we can allow assigning to a const iterator from
+  // a nonconst iterator...
+  template<class node_ty>
+  const ilist_iterator &operator=(const ilist_iterator<node_ty> &RHS) {
+    NodePtr = RHS.getNodePtrUnchecked();
+    return *this;
+  }
+
+  // Accessors...
+  operator pointer() const {
+    assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!");
+    return NodePtr;
+  }
+
+  reference operator*() const {
+    assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!");
+    return *NodePtr;
+  }
+  pointer operator->() { return &operator*(); }
+  const pointer operator->() const { return &operator*(); }
+
+  // Comparison operators
+  bool operator==(const ilist_iterator &RHS) const {
+    return NodePtr == RHS.NodePtr;
+  }
+  bool operator!=(const ilist_iterator &RHS) const {
+    return NodePtr != RHS.NodePtr;
+  }
+
+  // Increment and decrement operators...
+  ilist_iterator &operator--() {      // predecrement - Back up
+    NodePtr = Traits::getPrev(NodePtr);
+    assert(Traits::getNext(NodePtr) && "--'d off the beginning of an ilist!");
+    return *this;
+  }
+  ilist_iterator &operator++() {      // preincrement - Advance
+    NodePtr = Traits::getNext(NodePtr);
+    assert(NodePtr && "++'d off the end of an ilist!");
+    return *this;
+  }
+  ilist_iterator operator--(int) {    // postdecrement operators...
+    ilist_iterator tmp = *this;
+    --*this;
+    return tmp;
+  }
+  ilist_iterator operator++(int) {    // postincrement operators...
+    ilist_iterator tmp = *this;
+    ++*this;
+    return tmp;
+  }
+
+  // Internal interface, do not use...
+  pointer getNodePtrUnchecked() const { return NodePtr; }
+};
+
+// do not implement. this is to catch errors when people try to use
+// them as random access iterators
+template<typename T>
+void operator-(int, ilist_iterator<T>);
+template<typename T>
+void operator-(ilist_iterator<T>,int);
+
+template<typename T>
+void operator+(int, ilist_iterator<T>);
+template<typename T>
+void operator+(ilist_iterator<T>,int);
+
+// operator!=/operator== - Allow mixed comparisons without dereferencing
+// the iterator, which could very likely be pointing to end().
+template<typename T>
+bool operator!=(const T* LHS, const ilist_iterator<const T> &RHS) {
+  return LHS != RHS.getNodePtrUnchecked();
+}
+template<typename T>
+bool operator==(const T* LHS, const ilist_iterator<const T> &RHS) {
+  return LHS == RHS.getNodePtrUnchecked();
+}
+template<typename T>
+bool operator!=(T* LHS, const ilist_iterator<T> &RHS) {
+  return LHS != RHS.getNodePtrUnchecked();
+}
+template<typename T>
+bool operator==(T* LHS, const ilist_iterator<T> &RHS) {
+  return LHS == RHS.getNodePtrUnchecked();
+}
+
+
+// Allow ilist_iterators to convert into pointers to a node automatically when
+// used by the dyn_cast, cast, isa mechanisms...
+
+template<typename From> struct simplify_type;
+
+template<typename NodeTy> struct simplify_type<ilist_iterator<NodeTy> > {
+  typedef NodeTy* SimpleType;
+  
+  static SimpleType getSimplifiedValue(const ilist_iterator<NodeTy> &Node) {
+    return &*Node;
+  }
+};
+template<typename NodeTy> struct simplify_type<const ilist_iterator<NodeTy> > {
+  typedef NodeTy* SimpleType;
+  
+  static SimpleType getSimplifiedValue(const ilist_iterator<NodeTy> &Node) {
+    return &*Node;
+  }
+};
+
+
+//===----------------------------------------------------------------------===//
+//
+/// iplist - The subset of list functionality that can safely be used on nodes
+/// of polymorphic types, i.e. a heterogenous list with a common base class that
+/// holds the next/prev pointers.  The only state of the list itself is a single
+/// pointer to the head of the list.
+///
+/// This list can be in one of three interesting states:
+/// 1. The list may be completely unconstructed.  In this case, the head
+///    pointer is null.  When in this form, any query for an iterator (e.g.
+///    begin() or end()) causes the list to transparently change to state #2.
+/// 2. The list may be empty, but contain a sentinal for the end iterator. This
+///    sentinal is created by the Traits::createSentinel method and is a link
+///    in the list.  When the list is empty, the pointer in the iplist points
+///    to the sentinal.  Once the sentinal is constructed, it
+///    is not destroyed until the list is.
+/// 3. The list may contain actual objects in it, which are stored as a doubly
+///    linked list of nodes.  One invariant of the list is that the predecessor
+///    of the first node in the list always points to the last node in the list,
+///    and the successor pointer for the sentinal (which always stays at the
+///    end of the list) is always null.  
+///
+template<typename NodeTy, typename Traits=ilist_traits<NodeTy> >
+class iplist : public Traits {
+  mutable NodeTy *Head;
+
+  // Use the prev node pointer of 'head' as the tail pointer.  This is really a
+  // circularly linked list where we snip the 'next' link from the sentinel node
+  // back to the first node in the list (to preserve assertions about going off
+  // the end of the list).
+  NodeTy *getTail() { return getPrev(Head); }
+  const NodeTy *getTail() const { return getPrev(Head); }
+  void setTail(NodeTy *N) const { setPrev(Head, N); }
+  
+  /// CreateLazySentinal - This method verifies whether the sentinal for the
+  /// list has been created and lazily makes it if not.
+  void CreateLazySentinal() const {
+    if (Head != 0) return;
+    Head = Traits::createSentinel();
+    setNext(Head, 0);
+    setTail(Head);
+  }
+
+  static bool op_less(NodeTy &L, NodeTy &R) { return L < R; }
+  static bool op_equal(NodeTy &L, NodeTy &R) { return L == R; }
+public:
+  typedef NodeTy *pointer;
+  typedef const NodeTy *const_pointer;
+  typedef NodeTy &reference;
+  typedef const NodeTy &const_reference;
+  typedef NodeTy value_type;
+  typedef ilist_iterator<NodeTy> iterator;
+  typedef ilist_iterator<const NodeTy> const_iterator;
+  typedef size_t size_type;
+  typedef ptrdiff_t difference_type;
+  typedef std::reverse_iterator<const_iterator>  const_reverse_iterator;
+  typedef std::reverse_iterator<iterator>  reverse_iterator;
+
+  iplist() : Head(0) {}
+  ~iplist() {
+    if (!Head) return;
+    clear();
+    Traits::destroySentinel(getTail());
+  }
+
+  // Iterator creation methods.
+  iterator begin() {
+    CreateLazySentinal(); 
+    return iterator(Head); 
+  }
+  const_iterator begin() const {
+    CreateLazySentinal();
+    return const_iterator(Head);
+  }
+  iterator end() {
+    CreateLazySentinal();
+    return iterator(getTail());
+  }
+  const_iterator end() const {
+    CreateLazySentinal();
+    return const_iterator(getTail());
+  }
+
+  // reverse iterator creation methods.
+  reverse_iterator rbegin()            { return reverse_iterator(end()); }
+  const_reverse_iterator rbegin() const{ return const_reverse_iterator(end()); }
+  reverse_iterator rend()              { return reverse_iterator(begin()); }
+  const_reverse_iterator rend() const { return const_reverse_iterator(begin());}
+
+
+  // Miscellaneous inspection routines.
+  size_type max_size() const { return size_type(-1); }
+  bool empty() const { return Head == 0 || Head == getTail(); }
+
+  // Front and back accessor functions...
+  reference front() {
+    assert(!empty() && "Called front() on empty list!");
+    return *Head;
+  }
+  const_reference front() const {
+    assert(!empty() && "Called front() on empty list!");
+    return *Head;
+  }
+  reference back() {
+    assert(!empty() && "Called back() on empty list!");
+    return *getPrev(getTail());
+  }
+  const_reference back() const {
+    assert(!empty() && "Called back() on empty list!");
+    return *getPrev(getTail());
+  }
+
+  void swap(iplist &RHS) {
+    abort();     // Swap does not use list traits callback correctly yet!
+    std::swap(Head, RHS.Head);
+  }
+
+  iterator insert(iterator where, NodeTy *New) {
+    NodeTy *CurNode = where.getNodePtrUnchecked(), *PrevNode = getPrev(CurNode);
+    setNext(New, CurNode);
+    setPrev(New, PrevNode);
+
+    if (CurNode != Head)  // Is PrevNode off the beginning of the list?
+      setNext(PrevNode, New);
+    else
+      Head = New;
+    setPrev(CurNode, New);
+
+    addNodeToList(New);  // Notify traits that we added a node...
+    return New;
+  }
+
+  NodeTy *remove(iterator &IT) {
+    assert(IT != end() && "Cannot remove end of list!");
+    NodeTy *Node = &*IT;
+    NodeTy *NextNode = getNext(Node);
+    NodeTy *PrevNode = getPrev(Node);
+
+    if (Node != Head)  // Is PrevNode off the beginning of the list?
+      setNext(PrevNode, NextNode);
+    else
+      Head = NextNode;
+    setPrev(NextNode, PrevNode);
+    IT = NextNode;
+    removeNodeFromList(Node);  // Notify traits that we removed a node...
+    
+    // Set the next/prev pointers of the current node to null.  This isn't
+    // strictly required, but this catches errors where a node is removed from
+    // an ilist (and potentially deleted) with iterators still pointing at it.
+    // When those iterators are incremented or decremented, they will assert on
+    // the null next/prev pointer instead of "usually working".
+    setNext(Node, 0);
+    setPrev(Node, 0);
+    return Node;
+  }
+
+  NodeTy *remove(const iterator &IT) {
+    iterator MutIt = IT;
+    return remove(MutIt);
+  }
+
+  // erase - remove a node from the controlled sequence... and delete it.
+  iterator erase(iterator where) {
+    delete remove(where);
+    return where;
+  }
+
+
+private:
+  // transfer - The heart of the splice function.  Move linked list nodes from
+  // [first, last) into position.
+  //
+  void transfer(iterator position, iplist &L2, iterator first, iterator last) {
+    assert(first != last && "Should be checked by callers");
+
+    if (position != last) {
+      // Note: we have to be careful about the case when we move the first node
+      // in the list.  This node is the list sentinel node and we can't move it.
+      NodeTy *ThisSentinel = getTail();
+      setTail(0);
+      NodeTy *L2Sentinel = L2.getTail();
+      L2.setTail(0);
+
+      // Remove [first, last) from its old position.
+      NodeTy *First = &*first, *Prev = getPrev(First);
+      NodeTy *Next = last.getNodePtrUnchecked(), *Last = getPrev(Next);
+      if (Prev)
+        setNext(Prev, Next);
+      else
+        L2.Head = Next;
+      setPrev(Next, Prev);
+
+      // Splice [first, last) into its new position.
+      NodeTy *PosNext = position.getNodePtrUnchecked();
+      NodeTy *PosPrev = getPrev(PosNext);
+
+      // Fix head of list...
+      if (PosPrev)
+        setNext(PosPrev, First);
+      else
+        Head = First;
+      setPrev(First, PosPrev);
+
+      // Fix end of list...
+      setNext(Last, PosNext);
+      setPrev(PosNext, Last);
+
+      transferNodesFromList(L2, First, PosNext);
+
+      // Now that everything is set, restore the pointers to the list sentinals.
+      L2.setTail(L2Sentinel);
+      setTail(ThisSentinel);
+    }
+  }
+
+public:
+
+  //===----------------------------------------------------------------------===
+  // Functionality derived from other functions defined above...
+  //
+
+  size_type size() const {
+    if (Head == 0) return 0; // Don't require construction of sentinal if empty.
+#if __GNUC__ == 2
+    // GCC 2.95 has a broken std::distance
+    size_type Result = 0;
+    std::distance(begin(), end(), Result);
+    return Result;
+#else
+    return std::distance(begin(), end());
+#endif
+  }
+
+  iterator erase(iterator first, iterator last) {
+    while (first != last)
+      first = erase(first);
+    return last;
+  }
+
+  void clear() { if (Head) erase(begin(), end()); }
+
+  // Front and back inserters...
+  void push_front(NodeTy *val) { insert(begin(), val); }
+  void push_back(NodeTy *val) { insert(end(), val); }
+  void pop_front() {
+    assert(!empty() && "pop_front() on empty list!");
+    erase(begin());
+  }
+  void pop_back() {
+    assert(!empty() && "pop_back() on empty list!");
+    iterator t = end(); erase(--t);
+  }
+
+  // Special forms of insert...
+  template<class InIt> void insert(iterator where, InIt first, InIt last) {
+    for (; first != last; ++first) insert(where, *first);
+  }
+
+  // Splice members - defined in terms of transfer...
+  void splice(iterator where, iplist &L2) {
+    if (!L2.empty())
+      transfer(where, L2, L2.begin(), L2.end());
+  }
+  void splice(iterator where, iplist &L2, iterator first) {
+    iterator last = first; ++last;
+    if (where == first || where == last) return; // No change
+    transfer(where, L2, first, last);
+  }
+  void splice(iterator where, iplist &L2, iterator first, iterator last) {
+    if (first != last) transfer(where, L2, first, last);
+  }
+
+
+
+  //===----------------------------------------------------------------------===
+  // High-Level Functionality that shouldn't really be here, but is part of list
+  //
+
+  // These two functions are actually called remove/remove_if in list<>, but
+  // they actually do the job of erase, rename them accordingly.
+  //
+  void erase(const NodeTy &val) {
+    for (iterator I = begin(), E = end(); I != E; ) {
+      iterator next = I; ++next;
+      if (*I == val) erase(I);
+      I = next;
+    }
+  }
+  template<class Pr1> void erase_if(Pr1 pred) {
+    for (iterator I = begin(), E = end(); I != E; ) {
+      iterator next = I; ++next;
+      if (pred(*I)) erase(I);
+      I = next;
+    }
+  }
+
+  template<class Pr2> void unique(Pr2 pred) {
+    if (empty()) return;
+    for (iterator I = begin(), E = end(), Next = begin(); ++Next != E;) {
+      if (pred(*I))
+        erase(Next);
+      else
+        I = Next;
+      Next = I;
+    }
+  }
+  void unique() { unique(op_equal); }
+
+  template<class Pr3> void merge(iplist &right, Pr3 pred) {
+    iterator first1 = begin(), last1 = end();
+    iterator first2 = right.begin(), last2 = right.end();
+    while (first1 != last1 && first2 != last2)
+      if (pred(*first2, *first1)) {
+        iterator next = first2;
+        transfer(first1, right, first2, ++next);
+        first2 = next;
+      } else {
+        ++first1;
+      }
+    if (first2 != last2) transfer(last1, right, first2, last2);
+  }
+  void merge(iplist &right) { return merge(right, op_less); }
+
+  template<class Pr3> void sort(Pr3 pred);
+  void sort() { sort(op_less); }
+  void reverse();
+};
+
+
+template<typename NodeTy>
+struct ilist : public iplist<NodeTy> {
+  typedef typename iplist<NodeTy>::size_type size_type;
+  typedef typename iplist<NodeTy>::iterator iterator;
+
+  ilist() {}
+  ilist(const ilist &right) {
+    insert(this->begin(), right.begin(), right.end());
+  }
+  explicit ilist(size_type count) {
+    insert(this->begin(), count, NodeTy());
+  } 
+  ilist(size_type count, const NodeTy &val) {
+    insert(this->begin(), count, val);
+  }
+  template<class InIt> ilist(InIt first, InIt last) {
+    insert(this->begin(), first, last);
+  }
+
+
+  // Forwarding functions: A workaround for GCC 2.95 which does not correctly
+  // support 'using' declarations to bring a hidden member into scope.
+  //
+  iterator insert(iterator a, NodeTy *b){ return iplist<NodeTy>::insert(a, b); }
+  void push_front(NodeTy *a) { iplist<NodeTy>::push_front(a); }
+  void push_back(NodeTy *a)  { iplist<NodeTy>::push_back(a); }
+  
+
+  // Main implementation here - Insert for a node passed by value...
+  iterator insert(iterator where, const NodeTy &val) {
+    return insert(where, createNode(val));
+  }
+
+
+  // Front and back inserters...
+  void push_front(const NodeTy &val) { insert(this->begin(), val); }
+  void push_back(const NodeTy &val) { insert(this->end(), val); }
+
+  // Special forms of insert...
+  template<class InIt> void insert(iterator where, InIt first, InIt last) {
+    for (; first != last; ++first) insert(where, *first);
+  }
+  void insert(iterator where, size_type count, const NodeTy &val) {
+    for (; count != 0; --count) insert(where, val);
+  }
+
+  // Assign special forms...
+  void assign(size_type count, const NodeTy &val) {
+    iterator I = this->begin();
+    for (; I != this->end() && count != 0; ++I, --count)
+      *I = val;
+    if (count != 0)
+      insert(this->end(), val, val);
+    else
+      erase(I, this->end());
+  }
+  template<class InIt> void assign(InIt first1, InIt last1) {
+    iterator first2 = this->begin(), last2 = this->end();
+    for ( ; first1 != last1 && first2 != last2; ++first1, ++first2)
+      *first1 = *first2;
+    if (first2 == last2)
+      erase(first1, last1);
+    else
+      insert(last1, first2, last2);
+  }
+
+
+  // Resize members...
+  void resize(size_type newsize, NodeTy val) {
+    iterator i = this->begin();
+    size_type len = 0;
+    for ( ; i != this->end() && len < newsize; ++i, ++len) /* empty*/ ;
+
+    if (len == newsize)
+      erase(i, this->end());
+    else                                          // i == end()
+      insert(this->end(), newsize - len, val);
+  }
+  void resize(size_type newsize) { resize(newsize, NodeTy()); }
+};
+
+} // End llvm namespace
+
+namespace std {
+  // Ensure that swap uses the fast list swap...
+  template<class Ty>
+  void swap(llvm::iplist<Ty> &Left, llvm::iplist<Ty> &Right) {
+    Left.swap(Right);
+  }
+}  // End 'std' extensions...
+
+#endif // LLVM_ADT_ILIST_H

Added: llvm/branches/non-call-eh/include/llvm/ADT/iterator
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/iterator?rev=53163&view=auto

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/iterator (added)
+++ llvm/branches/non-call-eh/include/llvm/ADT/iterator Sun Jul  6 15:45:41 2008
@@ -0,0 +1,32 @@
+//===-- llvm/ADT/iterator - Portable wrapper around <iterator> --*- C++ -*-===//
+// 
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+// 
+//===----------------------------------------------------------------------===//
+//
+// This file provides a wrapper around the mysterious <iterator> header file.
+// In GCC 2.95.3, the file defines a bidirectional_iterator class (and other
+// friends), instead of the standard iterator class.  In GCC 3.1, the
+// bidirectional_iterator class got moved out and the new, standards compliant,
+// iterator<> class was added.  Because there is nothing that we can do to get
+// correct behavior on both compilers, we have this header with #ifdef's.  Gross
+// huh?
+//
+// By #includ'ing this file, you get the contents of <iterator> plus the
+// following classes in the global namespace:
+//
+//   1. bidirectional_iterator
+//   2. forward_iterator
+//
+// The #if directives' expressions are filled in by Autoconf.
+//
+//===----------------------------------------------------------------------===//
+
+#warning This files includes old 'llvm/ADT/iterator' file, which was replaced  \
+by 'llvm/ADT/iterator.h'. Please consider upgrading the source.
+
+#include "llvm/ADT/iterator.h"
+

Added: llvm/branches/non-call-eh/include/llvm/ADT/iterator.h.in
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/iterator.h.in?rev=53163&view=auto

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/iterator.h.in (added)
+++ llvm/branches/non-call-eh/include/llvm/ADT/iterator.h.in Sun Jul  6 15:45:41 2008
@@ -0,0 +1,76 @@
+//==-- llvm/ADT/iterator.h - Portable wrapper around <iterator> --*- C++ -*-==//
+// 
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+// 
+//===----------------------------------------------------------------------===//
+//
+// This file provides a wrapper around the mysterious <iterator> header file.
+// In GCC 2.95.3, the file defines a bidirectional_iterator class (and other
+// friends), instead of the standard iterator class.  In GCC 3.1, the
+// bidirectional_iterator class got moved out and the new, standards compliant,
+// iterator<> class was added.  Because there is nothing that we can do to get
+// correct behavior on both compilers, we have this header with #ifdef's.  Gross
+// huh?
+//
+// By #includ'ing this file, you get the contents of <iterator> plus the
+// following classes in the global namespace:
+//
+//   1. bidirectional_iterator
+//   2. forward_iterator
+//
+// The #if directives' expressions are filled in by Autoconf.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_ITERATOR_H
+#define LLVM_ADT_ITERATOR_H
+
+#include <iterator>
+
+#undef HAVE_BI_ITERATOR
+#undef HAVE_STD_ITERATOR
+#undef HAVE_FWD_ITERATOR
+
+#ifdef _MSC_VER
+#  define HAVE_BI_ITERATOR 0
+#  define HAVE_STD_ITERATOR 1
+#  define HAVE_FWD_ITERATOR 0
+#endif
+
+#if !HAVE_BI_ITERATOR
+# if HAVE_STD_ITERATOR
+/// If the bidirectional iterator is not defined, we attempt to define it in
+/// terms of the C++ standard iterator. Otherwise, we import it with a "using"
+/// statement.
+///
+template<class Ty, class PtrDiffTy>
+struct bidirectional_iterator
+  : public std::iterator<std::bidirectional_iterator_tag, Ty, PtrDiffTy> {
+};
+# else
+#  error "Need to have standard iterator to define bidirectional iterator!"
+# endif
+#else
+using std::bidirectional_iterator;
+#endif
+
+#if !HAVE_FWD_ITERATOR
+# if HAVE_STD_ITERATOR
+/// If the forward iterator is not defined, attempt to define it in terms of
+/// the C++ standard iterator. Otherwise, we import it with a "using" statement.
+///
+template<class Ty, class PtrDiffTy>
+struct forward_iterator
+  : public std::iterator<std::forward_iterator_tag, Ty, PtrDiffTy> {
+};
+# else
+#  error "Need to have standard iterator to define forward iterator!"
+# endif
+#else
+using std::forward_iterator;
+#endif
+
+#endif // LLVM_ADT_ITERATOR_H

Removed: llvm/branches/non-call-eh/include/llvm/ADT/iterator.in
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ADT/iterator.in?rev=53162&view=auto

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ADT/iterator.in (original)
+++ llvm/branches/non-call-eh/include/llvm/ADT/iterator.in (removed)
@@ -1,76 +0,0 @@
-//===-- llvm/ADT/iterator - Portable wrapper around <iterator> --*- C++ -*-===//
-// 
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-// 
-//===----------------------------------------------------------------------===//
-//
-// This file provides a wrapper around the mysterious <iterator> header file.
-// In GCC 2.95.3, the file defines a bidirectional_iterator class (and other
-// friends), instead of the standard iterator class.  In GCC 3.1, the
-// bidirectional_iterator class got moved out and the new, standards compliant,
-// iterator<> class was added.  Because there is nothing that we can do to get
-// correct behavior on both compilers, we have this header with #ifdef's.  Gross
-// huh?
-//
-// By #includ'ing this file, you get the contents of <iterator> plus the
-// following classes in the global namespace:
-//
-//   1. bidirectional_iterator
-//   2. forward_iterator
-//
-// The #if directives' expressions are filled in by Autoconf.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_ADT_ITERATOR
-#define LLVM_ADT_ITERATOR
-
-#include <iterator>
-
-#undef HAVE_BI_ITERATOR
-#undef HAVE_STD_ITERATOR
-#undef HAVE_FWD_ITERATOR
-
-#ifdef _MSC_VER
-#  define HAVE_BI_ITERATOR 0
-#  define HAVE_STD_ITERATOR 1
-#  define HAVE_FWD_ITERATOR 0
-#endif
-
-#if !HAVE_BI_ITERATOR
-# if HAVE_STD_ITERATOR
-/// If the bidirectional iterator is not defined, we attempt to define it in
-/// terms of the C++ standard iterator. Otherwise, we import it with a "using"
-/// statement.
-///
-template<class Ty, class PtrDiffTy>
-struct bidirectional_iterator
-  : public std::iterator<std::bidirectional_iterator_tag, Ty, PtrDiffTy> {
-};
-# else
-#  error "Need to have standard iterator to define bidirectional iterator!"
-# endif
-#else
-using std::bidirectional_iterator;
-#endif
-
-#if !HAVE_FWD_ITERATOR
-# if HAVE_STD_ITERATOR
-/// If the forward iterator is not defined, attempt to define it in terms of
-/// the C++ standard iterator. Otherwise, we import it with a "using" statement.
-///
-template<class Ty, class PtrDiffTy>
-struct forward_iterator
-  : public std::iterator<std::forward_iterator_tag, Ty, PtrDiffTy> {
-};
-# else
-#  error "Need to have standard iterator to define forward iterator!"
-# endif
-#else
-using std::forward_iterator;
-#endif
-
-#endif

Modified: llvm/branches/non-call-eh/include/llvm/Analysis/AliasAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Analysis/AliasAnalysis.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Analysis/AliasAnalysis.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Analysis/AliasAnalysis.h Sun Jul  6 15:45:41 2008
@@ -55,9 +55,9 @@
   ///
   void InitializeAliasAnalysis(Pass *P);
 
-  // getAnalysisUsage - All alias analysis implementations should invoke this
-  // directly (using AliasAnalysis::getAnalysisUsage(AU)) to make sure that
-  // TargetData is required by the pass.
+  /// getAnalysisUsage - All alias analysis implementations should invoke this
+  /// directly (using AliasAnalysis::getAnalysisUsage(AU)) to make sure that
+  /// TargetData is required by the pass.
   virtual void getAnalysisUsage(AnalysisUsage &AU) const;
 
 public:

Modified: llvm/branches/non-call-eh/include/llvm/Analysis/AliasSetTracker.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Analysis/AliasSetTracker.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Analysis/AliasSetTracker.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Analysis/AliasSetTracker.h Sun Jul  6 15:45:41 2008
@@ -19,9 +19,9 @@
 
 #include "llvm/Support/CallSite.h"
 #include "llvm/Support/Streams.h"
-#include "llvm/ADT/iterator"
-#include "llvm/ADT/hash_map"
-#include "llvm/ADT/ilist"
+#include "llvm/ADT/iterator.h"
+#include "llvm/ADT/hash_map.h"
+#include "llvm/ADT/ilist.h"
 
 namespace llvm {
 
@@ -232,7 +232,7 @@
                   bool KnownMustAlias = false);
   void addCallSite(CallSite CS, AliasAnalysis &AA);
   void removeCallSite(CallSite CS) {
-    for (unsigned i = 0, e = CallSites.size(); i != e; ++i)
+    for (size_t i = 0, e = CallSites.size(); i != e; ++i)
       if (CallSites[i].getInstruction() == CS.getInstruction()) {
         CallSites[i] = CallSites.back();
         CallSites.pop_back();

Modified: llvm/branches/non-call-eh/include/llvm/Analysis/CallGraph.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Analysis/CallGraph.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Analysis/CallGraph.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Analysis/CallGraph.h Sun Jul  6 15:45:41 2008
@@ -55,6 +55,7 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Pass.h"
 #include "llvm/Support/CallSite.h"
+#include "llvm/System/IncludeFile.h"
 #include <map>
 
 namespace llvm {
@@ -158,10 +159,7 @@
   void print(std::ostream *o, const Module *M) const { if (o) print(*o, M); }
   void dump() const;
   
-  // stub - dummy function, just ignore it
-  static int stub;
 protected:
-
   // destroy - Release memory for the call graph
   virtual void destroy();
 };
@@ -191,7 +189,7 @@
   inline const_iterator begin() const { return CalledFunctions.begin(); }
   inline const_iterator end()   const { return CalledFunctions.end();   }
   inline bool empty() const { return CalledFunctions.empty(); }
-  inline unsigned size() const { return CalledFunctions.size(); }
+  inline unsigned size() const { return (unsigned)CalledFunctions.size(); }
 
   // Subscripting operator - Return the i'th called function...
   //

Modified: llvm/branches/non-call-eh/include/llvm/Analysis/ConstantFolding.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Analysis/ConstantFolding.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Analysis/ConstantFolding.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Analysis/ConstantFolding.h Sun Jul  6 15:45:41 2008
@@ -30,6 +30,12 @@
 ///
 Constant *ConstantFoldInstruction(Instruction *I, const TargetData *TD = 0);
 
+/// ConstantFoldConstantExpression - Attempt to fold the constant expression
+/// using the specified TargetData.  If successful, the constant result is
+/// result is returned, if not, null is returned.
+Constant *ConstantFoldConstantExpression(ConstantExpr *CE,
+                                         const TargetData *TD);
+
 /// ConstantFoldInstOperands - Attempt to constant fold an instruction with the
 /// specified operands.  If successful, the constant result is returned, if not,
 /// null is returned.  Note that this function can fail when attempting to 

Modified: llvm/branches/non-call-eh/include/llvm/Analysis/ConstantsScanner.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Analysis/ConstantsScanner.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Analysis/ConstantsScanner.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Analysis/ConstantsScanner.h Sun Jul  6 15:45:41 2008
@@ -18,7 +18,7 @@
 
 #include "llvm/Support/InstIterator.h"
 #include "llvm/Instruction.h"
-#include "llvm/ADT/iterator"
+#include "llvm/ADT/iterator.h"
 
 namespace llvm {
 

Modified: llvm/branches/non-call-eh/include/llvm/Analysis/DominatorInternals.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Analysis/DominatorInternals.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Analysis/DominatorInternals.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Analysis/DominatorInternals.h Sun Jul  6 15:45:41 2008
@@ -233,14 +233,7 @@
   typedef GraphTraits<NodeT> GraphT;
 
   unsigned N = 0;
-
-  // Add a node for the root.  This node might be the actual root, if there is
-  // one exit block, or it may be the virtual exit (denoted by (BasicBlock *)0)
-  // which postdominates all real exits if there are multiple exit blocks.
-  typename GraphT::NodeType* Root = DT.Roots.size() == 1 ? DT.Roots[0]
-                   : 0;
   bool MultipleRoots = (DT.Roots.size() > 1);
-
   if (MultipleRoots) {
     typename DominatorTreeBase<typename GraphT::NodeType>::InfoRec &BBInfo =
         DT.Info[NULL];
@@ -255,9 +248,14 @@
 
   // Step #1: Number blocks in depth-first order and initialize variables used
   // in later stages of the algorithm.
-  for (unsigned i = 0, e = DT.Roots.size(); i != e; ++i)
+  for (unsigned i = 0, e = static_cast<unsigned>(DT.Roots.size());
+       i != e; ++i)
     N = DFSPass<GraphT>(DT, DT.Roots[i], N);
 
+  // it might be that some blocks did not get a DFS number (e.g., blocks of 
+  // infinite loops). In these cases an artificial exit node is required.
+  MultipleRoots |= (DT.isPostDominator() && N != F.size());
+
   for (unsigned i = N; i >= 2; --i) {
     typename GraphT::NodeType* W = DT.Vertex[i];
     typename DominatorTreeBase<typename GraphT::NodeType>::InfoRec &WInfo =
@@ -311,15 +309,18 @@
     if (WIDom != DT.Vertex[DT.Info[W].Semi])
       WIDom = DT.IDoms[WIDom];
   }
-  
+
   if (DT.Roots.empty()) return;
-  
+
   // Add a node for the root.  This node might be the actual root, if there is
   // one exit block, or it may be the virtual exit (denoted by (BasicBlock *)0)
-  // which postdominates all real exits if there are multiple exit blocks.
+  // which postdominates all real exits if there are multiple exit blocks, or
+  // an infinite loop.
+  typename GraphT::NodeType* Root = !MultipleRoots ? DT.Roots[0] : 0;
+
   DT.DomTreeNodes[Root] = DT.RootNode =
                         new DomTreeNodeBase<typename GraphT::NodeType>(Root, 0);
-  
+
   // Loop over all of the reachable blocks in the function...
   for (unsigned i = 2; i <= N; ++i) {
     typename GraphT::NodeType* W = DT.Vertex[i];
@@ -329,20 +330,12 @@
 
     typename GraphT::NodeType* ImmDom = DT.getIDom(W);
 
-    // skip all non root nodes that have no dominator - this occures with 
-    // infinite loops.
-    if (!ImmDom && std::count(DT.Roots.begin(), DT.Roots.end(), W) == 0)
-      continue;
+    assert(ImmDom || DT.DomTreeNodes[NULL]);
 
     // Get or calculate the node for the immediate dominator
     DomTreeNodeBase<typename GraphT::NodeType> *IDomNode =
                                                      DT.getNodeForBlock(ImmDom);
 
-    // skip all children that are dominated by a non root node that, by itself,
-    // has no dominator.
-    if (!IDomNode)
-      continue;
-
     // Add a new tree node for this BasicBlock, and link it as a child of
     // IDomNode
     DomTreeNodeBase<typename GraphT::NodeType> *C =

Modified: llvm/branches/non-call-eh/include/llvm/Analysis/Dominators.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Analysis/Dominators.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Analysis/Dominators.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Analysis/Dominators.h Sun Jul  6 15:45:41 2008
@@ -94,7 +94,7 @@
   const std::vector<DomTreeNodeBase<NodeT>*> &getChildren() const {
     return Children;
   }
-  
+
   DomTreeNodeBase(NodeT *BB, DomTreeNodeBase<NodeT> *iDom)
     : TheBB(BB), IDom(iDom), DFSNumIn(-1), DFSNumOut(-1) { }
   
@@ -102,11 +102,33 @@
     Children.push_back(C);
     return C;
   }
-  
+
   size_t getNumChildren() const {
     return Children.size();
   }
+
+  void clearAllChildren() {
+    Children.clear();
+  }
   
+  bool compare(DomTreeNodeBase<NodeT> *Other) {
+    if (getNumChildren() != Other->getNumChildren())
+      return true;
+
+    SmallPtrSet<NodeT *, 4> OtherChildren;
+    for(iterator I = Other->begin(), E = Other->end(); I != E; ++I) {
+      NodeT *Nd = (*I)->getBlock();
+      OtherChildren.insert(Nd);
+    }
+
+    for(iterator I = begin(), E = end(); I != E; ++I) {
+      NodeT *N = (*I)->getBlock();
+      if (OtherChildren.count(N) == 0)
+        return true;
+    }
+    return false;
+  }
+
   void setIDom(DomTreeNodeBase<NodeT> *NewIDom) {
     assert(IDom && "No immediate dominator?");
     if (IDom != NewIDom) {
@@ -237,7 +259,7 @@
       bool NewBBDominatesNewBBSucc = true;
       {
         typename GraphT::NodeType* OnePred = PredBlocks[0];
-        unsigned i = 1, e = PredBlocks.size();
+        size_t i = 1, e = PredBlocks.size();
         for (i = 1; !DT.isReachableFromEntry(OnePred); ++i) {
           assert(i != e && "Didn't find reachable pred?");
           OnePred = PredBlocks[i];
@@ -308,6 +330,33 @@
   // FIXME: Should remove this
   virtual bool runOnFunction(Function &F) { return false; }
 
+  /// compare - Return false if the other dominator tree base matches this
+  /// dominator tree base. Otherwise return true.
+  bool compare(DominatorTreeBase &Other) const {
+
+    const DomTreeNodeMapType &OtherDomTreeNodes = Other.DomTreeNodes;
+    if (DomTreeNodes.size() != OtherDomTreeNodes.size())
+      return true;
+
+    SmallPtrSet<const NodeT *,4> MyBBs;
+    for (typename DomTreeNodeMapType::const_iterator 
+           I = this->DomTreeNodes.begin(),
+           E = this->DomTreeNodes.end(); I != E; ++I) {
+      NodeT *BB = I->first;
+      typename DomTreeNodeMapType::const_iterator OI = OtherDomTreeNodes.find(BB);
+      if (OI == OtherDomTreeNodes.end())
+        return true;
+
+      DomTreeNodeBase<NodeT>* MyNd = I->second;
+      DomTreeNodeBase<NodeT>* OtherNd = OI->second;
+      
+      if (MyNd->compare(OtherNd))
+        return true;
+    }
+
+    return false;
+  }
+
   virtual void releaseMemory() { reset(); }
 
   /// getNode - return the (Post)DominatorTree node for the specified basic
@@ -567,7 +616,7 @@
     SmallVector<std::pair<DomTreeNodeBase<NodeT>*,
                 typename DomTreeNodeBase<NodeT>::iterator>, 32> WorkStack;
 
-    for (unsigned i = 0, e = this->Roots.size(); i != e; ++i) {
+    for (unsigned i = 0, e = (unsigned)this->Roots.size(); i != e; ++i) {
       DomTreeNodeBase<NodeT> *ThisRoot = getNode(this->Roots[i]);
       WorkStack.push_back(std::make_pair(ThisRoot, ThisRoot->begin()));
       ThisRoot->DFSNumIn = DFSNum++;
@@ -605,17 +654,9 @@
     // immediate dominator.
     NodeT *IDom = getIDom(BB);
 
-    // skip all non root nodes that have no dominator
-    if (!IDom && std::count(this->Roots.begin(), this->Roots.end(), BB) == 0)
-      return NULL;
-
+    assert(IDom || this->DomTreeNodes[NULL]);
     DomTreeNodeBase<NodeT> *IDomNode = getNodeForBlock(IDom);
 
-    // skip all nodes that are dominated by a non root node that, by itself,
-    // has no dominator.
-    if (!IDomNode)
-      return NULL;
-
     // Add a new tree node for this BasicBlock, and link it as a child of
     // IDomNode
     DomTreeNodeBase<NodeT> *C = new DomTreeNodeBase<NodeT>(BB, IDomNode);
@@ -705,7 +746,22 @@
   inline DomTreeNode *getRootNode() const {
     return DT->getRootNode();
   }
-  
+
+  /// compare - Return false if the other dominator tree matches this
+  /// dominator tree. Otherwise return true.
+  inline bool compare(DominatorTree &Other) const {
+    DomTreeNode *R = getRootNode();
+    DomTreeNode *OtherR = Other.getRootNode();
+    
+    if (!R || !OtherR || R->getBlock() != OtherR->getBlock())
+      return true;
+    
+    if (DT->compare(Other.getBase()))
+      return true;
+
+    return false;
+  }
+
   virtual bool runOnFunction(Function &F);
   
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
@@ -800,6 +856,10 @@
     DT->splitBlock(NewBB);
   }
   
+  bool isReachableFromEntry(BasicBlock* A) {
+    return DT->isReachableFromEntry(A);
+  }
+  
   
   virtual void releaseMemory() { 
     DT->releaseMemory();
@@ -847,8 +907,8 @@
   typedef std::map<BasicBlock*, DomSetType> DomSetMapType; // Dom set map
 protected:
   DomSetMapType Frontiers;
-    std::vector<BasicBlock*> Roots;
-    const bool IsPostDominators;
+  std::vector<BasicBlock*> Roots;
+  const bool IsPostDominators;
   
 public:
   DominanceFrontierBase(intptr_t ID, bool isPostDom) 
@@ -900,6 +960,58 @@
     I->second.erase(Node);
   }
 
+  /// compareDomSet - Return false if two domsets match. Otherwise
+  /// return true;
+  bool compareDomSet(DomSetType &DS1, const DomSetType &DS2) const {
+    std::set<BasicBlock *> tmpSet;
+    for (DomSetType::const_iterator I = DS2.begin(),
+           E = DS2.end(); I != E; ++I) 
+      tmpSet.insert(*I);
+
+    for (DomSetType::const_iterator I = DS1.begin(),
+           E = DS1.end(); I != E; ++I) {
+      BasicBlock *Node = *I;
+
+      if (tmpSet.erase(Node) == 0)
+        // Node is in DS1 but not in DS2.
+        return true;
+    }
+
+    if(!tmpSet.empty())
+      // There are nodes that are in DS2 but not in DS1.
+      return true;
+
+    // DS1 and DS2 matches.
+    return false;
+  }
+
+  /// compare - Return true if the other dominance frontier base matches
+  /// this dominance frontier base. Otherwise return false.
+  bool compare(DominanceFrontierBase &Other) const {
+    DomSetMapType tmpFrontiers;
+    for (DomSetMapType::const_iterator I = Other.begin(),
+           E = Other.end(); I != E; ++I) 
+      tmpFrontiers.insert(std::make_pair(I->first, I->second));
+
+    for (DomSetMapType::iterator I = tmpFrontiers.begin(),
+           E = tmpFrontiers.end(); I != E; ++I) {
+      BasicBlock *Node = I->first;
+      const_iterator DFI = find(Node);
+      if (DFI == end()) 
+        return true;
+
+      if (compareDomSet(I->second, DFI->second))
+        return true;
+
+      tmpFrontiers.erase(Node);
+    }
+
+    if (!tmpFrontiers.empty())
+      return true;
+
+    return false;
+  }
+
   /// print - Convert to human readable form
   ///
   virtual void print(std::ostream &OS, const Module* = 0) const;
@@ -952,6 +1064,9 @@
     // itself is not member of NewBB's dominance frontier.
     DominanceFrontier::iterator NewDFI = find(NewBB);
     DominanceFrontier::iterator DFI = find(BB);
+    // If BB was an entry block then its frontier is empty.
+    if (DFI == end())
+      return;
     DominanceFrontier::DomSetType BBSet = DFI->second;
     for (DominanceFrontier::DomSetType::iterator BBSetI = BBSet.begin(),
            BBSetE = BBSet.end(); BBSetI != BBSetE; ++BBSetI) {
@@ -963,7 +1078,6 @@
     NewDFI->second.erase(BB);
   }
 
-private:
   const DomSetType &calculate(const DominatorTree &DT,
                               const DomTreeNode *Node);
 };

Modified: llvm/branches/non-call-eh/include/llvm/Analysis/FindUsedTypes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Analysis/FindUsedTypes.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Analysis/FindUsedTypes.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Analysis/FindUsedTypes.h Sun Jul  6 15:45:41 2008
@@ -61,7 +61,4 @@
 
 } // End llvm namespace
 
-// Make sure that any clients of this file link in PostDominators.cpp
-FORCE_DEFINING_FILE_TO_BE_LINKED(FindUsedTypes)
-
 #endif

Added: llvm/branches/non-call-eh/include/llvm/Analysis/LibCallAliasAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Analysis/LibCallAliasAnalysis.h?rev=53163&view=auto

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Analysis/LibCallAliasAnalysis.h (added)
+++ llvm/branches/non-call-eh/include/llvm/Analysis/LibCallAliasAnalysis.h Sun Jul  6 15:45:41 2008
@@ -0,0 +1,61 @@
+//===- LibCallAliasAnalysis.h - Implement AliasAnalysis for libcalls ------===//
+//
+//                     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 LibCallAliasAnalysis class.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ANALYSIS_LIBCALL_AA_H
+#define LLVM_ANALYSIS_LIBCALL_AA_H
+
+#include "llvm/Analysis/AliasAnalysis.h"
+#include "llvm/Pass.h"
+
+namespace llvm {
+  class LibCallInfo;
+  class LibCallFunctionInfo;
+  
+  /// LibCallAliasAnalysis - Alias analysis driven from LibCallInfo.
+  struct LibCallAliasAnalysis : public FunctionPass, AliasAnalysis {
+    static char ID; // Class identification
+    
+    LibCallInfo *LCI;
+    
+    explicit LibCallAliasAnalysis(LibCallInfo *LC = 0)
+      : FunctionPass(&ID), LCI(LC) {
+    }
+    explicit LibCallAliasAnalysis(const void *ID, LibCallInfo *LC)
+      : FunctionPass(ID), LCI(LC) {
+    }
+    ~LibCallAliasAnalysis();
+    
+    ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size);
+    
+    ModRefResult getModRefInfo(CallSite CS1, CallSite CS2) {
+      // TODO: Could compare two direct calls against each other if we cared to.
+      return AliasAnalysis::getModRefInfo(CS1,CS2);
+    }
+    
+    virtual void getAnalysisUsage(AnalysisUsage &AU) const;
+    
+    virtual bool runOnFunction(Function &F) {
+      InitializeAliasAnalysis(this);                 // set up super class
+      return false;
+    }
+    
+    /// hasNoModRefInfoForCalls - We can provide mod/ref information against
+    /// non-escaping allocations.
+    virtual bool hasNoModRefInfoForCalls() const { return false; }
+  private:
+    ModRefResult AnalyzeLibCallDetails(const LibCallFunctionInfo *FI,
+                                       CallSite CS, Value *P, unsigned Size);
+  };
+}  // End of llvm namespace
+
+#endif

Added: llvm/branches/non-call-eh/include/llvm/Analysis/LibCallSemantics.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Analysis/LibCallSemantics.h?rev=53163&view=auto

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Analysis/LibCallSemantics.h (added)
+++ llvm/branches/non-call-eh/include/llvm/Analysis/LibCallSemantics.h Sun Jul  6 15:45:41 2008
@@ -0,0 +1,166 @@
+//===- LibCallSemantics.h - Describe library semantics --------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines interfaces that can be used to describe language specific
+// runtime library interfaces (e.g. libc, libm, etc) to LLVM optimizers.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ANALYSIS_LIBCALLSEMANTICS_H
+#define LLVM_ANALYSIS_LIBCALLSEMANTICS_H
+
+#include "llvm/Analysis/AliasAnalysis.h"
+
+namespace llvm {
+
+  /// LibCallLocationInfo - This struct describes a set of memory locations that
+  /// are accessed by libcalls.  Identification of a location is doing with a
+  /// simple callback function.
+  ///
+  /// For example, the LibCallInfo may be set up to model the behavior of
+  /// standard libm functions.  The location that they may be interested in is
+  /// an abstract location that represents errno for the current target.  In
+  /// this case, a location for errno is anything such that the predicate
+  /// returns true.  On Mac OS/X, this predicate would return true if the
+  /// pointer is the result of a call to "__error()".
+  ///
+  /// Locations can also be defined in a constant-sensitive way.  For example,
+  /// it is possible to define a location that returns true iff it is passed
+  /// into the call as a specific argument.  This is useful for modeling things
+  /// like "printf", which can store to memory, but only through pointers passed
+  /// with a '%n' constraint.
+  ///
+  struct LibCallLocationInfo {
+    // TODO: Flags: isContextSensitive etc.
+    
+    /// isLocation - Return a LocResult if the specified pointer refers to this
+    /// location for the specified call site.  This returns "Yes" if we can tell
+    /// that the pointer *does definitely* refer to the location, "No" if we can
+    /// tell that the location *definitely does not* refer to the location, and
+    /// returns "Unknown" if we cannot tell for certain.
+    enum LocResult {
+      Yes, No, Unknown
+    };
+    LocResult (*isLocation)(CallSite CS, const Value *Ptr, unsigned Size);
+  };
+  
+  /// LibCallFunctionInfo - Each record in the array of FunctionInfo structs
+  /// records the behavior of one libcall that is known by the optimizer.  This
+  /// captures things like the side effects of the call.  Side effects are
+  /// modeled both universally (in the readnone/readonly) sense, but also
+  /// potentially against a set of abstract locations defined by the optimizer.
+  /// This allows an optimizer to define that some libcall (e.g. sqrt) is
+  /// side-effect free except that it might modify errno (thus, the call is
+  /// *not* universally readonly).  Or it might say that the side effects
+  /// are unknown other than to say that errno is not modified.
+  ///
+  struct LibCallFunctionInfo {
+    /// Name - This is the name of the libcall this describes.
+    const char *Name;
+    
+    /// TODO: Constant folding function: Constant* vector -> Constant*.
+    
+    /// UniversalBehavior - This captures the absolute mod/ref behavior without
+    /// any specific context knowledge.  For example, if the function is known
+    /// to be readonly, this would be set to 'ref'.  If known to be readnone,
+    /// this is set to NoModRef.
+    AliasAnalysis::ModRefResult UniversalBehavior;
+    
+    /// LocationMRInfo - This pair captures info about whether a specific
+    /// location is modified or referenced by a libcall.
+    struct LocationMRInfo {
+      /// LocationID - ID # of the accessed location or ~0U for array end.
+      unsigned LocationID;
+      /// MRInfo - Mod/Ref info for this location.
+      AliasAnalysis::ModRefResult MRInfo;
+    };
+    
+    /// DetailsType - Indicate the sense of the LocationDetails array.  This
+    /// controls how the LocationDetails array is interpreted.
+    enum {
+      /// DoesOnly - If DetailsType is set to DoesOnly, then we know that the
+      /// *only* mod/ref behavior of this function is captured by the
+      /// LocationDetails array.  If we are trying to say that 'sqrt' can only
+      /// modify errno, we'd have the {errnoloc,mod} in the LocationDetails
+      /// array and have DetailsType set to DoesOnly.
+      DoesOnly,
+      
+      /// DoesNot - If DetailsType is set to DoesNot, then the sense of the
+      /// LocationDetails array is completely inverted.  This means that we *do
+      /// not* know everything about the side effects of this libcall, but we do
+      /// know things that the libcall cannot do.  This is useful for complex
+      /// functions like 'ctime' which have crazy mod/ref behavior, but are
+      /// known to never read or write errno.  In this case, we'd have
+      /// {errnoloc,modref} in the LocationDetails array and DetailsType would
+      /// be set to DoesNot, indicating that ctime does not read or write the
+      /// errno location.
+      DoesNot
+    } DetailsType;
+    
+    /// LocationDetails - This is a pointer to an array of LocationMRInfo
+    /// structs which indicates the behavior of the libcall w.r.t. specific
+    /// locations.  For example, if this libcall is known to only modify
+    /// 'errno', it would have a LocationDetails array with the errno ID and
+    /// 'mod' in it.  See the DetailsType field for how this is interpreted.
+    ///
+    /// In the "DoesOnly" case, this information is 'may' information for: there
+    /// is no guarantee that the specified side effect actually does happen,
+    /// just that it could.  In the "DoesNot" case, this is 'must not' info.
+    ///
+    /// If this pointer is null, no details are known.
+    ///
+    const LocationMRInfo *LocationDetails;
+  };
+  
+  
+  /// LibCallInfo - Abstract interface to query about library call information.
+  /// Instances of this class return known information about some set of
+  /// libcalls.
+  /// 
+  class LibCallInfo {
+    // Implementation details of this object, private.
+    mutable void *Impl;
+    mutable const LibCallLocationInfo *Locations;
+    mutable unsigned NumLocations;
+  public:
+    LibCallInfo() : Impl(0), Locations(0), NumLocations(0) {}
+    virtual ~LibCallInfo();
+    
+    //===------------------------------------------------------------------===//
+    //  Accessor Methods: Efficient access to contained data.
+    //===------------------------------------------------------------------===//
+    
+    /// getLocationInfo - Return information about the specified LocationID.
+    const LibCallLocationInfo &getLocationInfo(unsigned LocID) const;
+    
+    
+    /// getFunctionInfo - Return the LibCallFunctionInfo object corresponding to
+    /// the specified function if we have it.  If not, return null.
+    const LibCallFunctionInfo *getFunctionInfo(Function *F) const;
+    
+    
+    //===------------------------------------------------------------------===//
+    //  Implementation Methods: Subclasses should implement these.
+    //===------------------------------------------------------------------===//
+    
+    /// getLocationInfo - Return descriptors for the locations referenced by
+    /// this set of libcalls.
+    virtual unsigned getLocationInfo(const LibCallLocationInfo *&Array) const {
+      return 0;
+    }
+    
+    /// getFunctionInfoArray - Return an array of descriptors that describe the
+    /// set of libcalls represented by this LibCallInfo object.  This array is
+    /// terminated by an entry with a NULL name.
+    virtual const LibCallFunctionInfo *getFunctionInfoArray() const = 0;
+  };
+
+} // end namespace llvm
+
+#endif

Modified: llvm/branches/non-call-eh/include/llvm/Analysis/LoopInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Analysis/LoopInfo.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Analysis/LoopInfo.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Analysis/LoopInfo.h Sun Jul  6 15:45:41 2008
@@ -43,6 +43,8 @@
 #include <algorithm>
 #include <ostream>
 
+namespace llvm {
+
 template<typename T>
 static void RemoveFromVector(std::vector<T*> &V, T *N) {
   typename std::vector<T*>::iterator I = std::find(V.begin(), V.end(), N);
@@ -50,8 +52,6 @@
   V.erase(I);
 }
 
-namespace llvm {
-
 class DominatorTree;
 class LoopInfo;
 class PHINode;
@@ -80,7 +80,7 @@
   /// Loop ctor - This creates an empty loop.
   LoopBase() : ParentLoop(0) {}
   ~LoopBase() {
-    for (unsigned i = 0, e = SubLoops.size(); i != e; ++i)
+    for (size_t i = 0, e = SubLoops.size(); i != e; ++i)
       delete SubLoops[i];
   }
 
@@ -118,8 +118,8 @@
   block_iterator block_begin() const { return Blocks.begin(); }
   block_iterator block_end() const { return Blocks.end(); }
 
-  /// isLoopExit - True if this block can branch to another block that is
-  /// outside of the current loop.
+  /// isLoopExit - True if terminator in the block can branch to another block
+  /// that is outside of the current loop.
   ///
   bool isLoopExit(const BlockT *BB) const {
     typedef GraphTraits<BlockT*> BlockTraits;
@@ -418,6 +418,59 @@
     return 0;
   }
   
+  /// getSmallConstantTripCount - Returns the trip count of this loop as a
+  /// normal unsigned value, if possible. Returns 0 if the trip count is unknown
+  /// of not constant. Will also return 0 if the trip count is very large 
+  /// (>= 2^32)
+  inline unsigned getSmallConstantTripCount() const {
+    Value* TripCount = this->getTripCount();
+    if (TripCount) {
+      if (ConstantInt *TripCountC = dyn_cast<ConstantInt>(TripCount)) {
+        // Guard against huge trip counts.
+        if (TripCountC->getValue().getActiveBits() <= 32) {
+          return (unsigned)TripCountC->getZExtValue();
+        }
+      }
+    }
+    return 0;
+  }
+
+  /// getSmallConstantTripMultiple - Returns the largest constant divisor of the
+  /// trip count of this loop as a normal unsigned value, if possible. This
+  /// means that the actual trip count is always a multiple of the returned
+  /// value (don't forget the trip count could very well be zero as well!).
+  ///
+  /// Returns 1 if the trip count is unknown or not guaranteed to be the
+  /// multiple of a constant (which is also the case if the trip count is simply
+  /// constant, use getSmallConstantTripCount for that case), Will also return 1
+  /// if the trip count is very large (>= 2^32).
+  inline unsigned getSmallConstantTripMultiple() const {
+    Value* TripCount = this->getTripCount();
+    // This will hold the ConstantInt result, if any
+    ConstantInt *Result = NULL;
+    if (TripCount) {
+      // See if the trip count is constant itself
+      Result = dyn_cast<ConstantInt>(TripCount);
+      // if not, see if it is a multiplication
+      if (!Result)
+        if (BinaryOperator *BO = dyn_cast<BinaryOperator>(TripCount)) {
+          switch (BO->getOpcode()) {
+          case BinaryOperator::Mul:
+            Result = dyn_cast<ConstantInt>(BO->getOperand(1));
+            break;
+          default: 
+            break;
+          }
+        }
+    }
+    // Guard against huge trip counts.
+    if (Result && Result->getValue().getActiveBits() <= 32) {
+      return (unsigned)Result->getZExtValue();
+    } else {
+      return 1;
+    }
+  }
+  
   /// isLCSSAForm - Return true if the Loop is in LCSSA form
   inline bool isLCSSAForm() const {
     // Sort the blocks vector so that we can use binary search to do quick
@@ -847,7 +900,8 @@
            "This loop should not be inserted here!");
 
     // Check to see if it belongs in a child loop...
-    for (unsigned i = 0, e = Parent->SubLoops.size(); i != e; ++i)
+    for (unsigned i = 0, e = static_cast<unsigned>(Parent->SubLoops.size());
+         i != e; ++i)
       if (Parent->SubLoops[i]->contains(LHeader)) {
         InsertLoopInto(L, Parent->SubLoops[i]);
         return;
@@ -919,9 +973,6 @@
     return LI->isLoopHeader(BB);
   }
 
-  /// isAnalysis - Return true if this pass is  implementing an analysis pass.
-  bool isAnalysis() const { return true; }
-
   /// runOnFunction - Calculate the natural loop information.
   ///
   virtual bool runOnFunction(Function &F);
@@ -1015,7 +1066,4 @@
 
 } // End llvm namespace
 
-// Make sure that any clients of this file link in LoopInfo.cpp
-FORCE_DEFINING_FILE_TO_BE_LINKED(LoopInfo)
-
 #endif

Added: llvm/branches/non-call-eh/include/llvm/Analysis/LoopVR.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Analysis/LoopVR.h?rev=53163&view=auto

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Analysis/LoopVR.h (added)
+++ llvm/branches/non-call-eh/include/llvm/Analysis/LoopVR.h Sun Jul  6 15:45:41 2008
@@ -0,0 +1,90 @@
+//===- LoopVR.cpp - Value Range analysis driven by loop information -------===//
+//
+//                     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 interface for the loop-driven value range pass.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ANALYSIS_LOOPVR_H
+#define LLVM_ANALYSIS_LOOPVR_H
+
+#include "llvm/Pass.h"
+#include "llvm/Analysis/ScalarEvolution.h"
+#include "llvm/Support/ConstantRange.h"
+#include <iosfwd>
+#include <map>
+
+namespace llvm {
+
+/// LoopVR - This class maintains a mapping of Values to ConstantRanges.
+/// There are interfaces to look up and update ranges by value, and for
+/// accessing all values with range information.
+///
+class LoopVR : public FunctionPass {
+public:
+  static char ID; // Class identification, replacement for typeinfo
+
+  LoopVR() : FunctionPass(intptr_t(&ID)) {}
+
+  bool runOnFunction(Function &F);
+  virtual void print(std::ostream &os, const Module *) const;
+  void releaseMemory();
+
+  void getAnalysisUsage(AnalysisUsage &AU) const {
+    AU.addRequiredTransitive<LoopInfo>();
+    AU.addRequiredTransitive<ScalarEvolution>();
+    AU.setPreservesAll();
+  }
+
+  //===---------------------------------------------------------------------
+  // Methods that are used to look up and update particular values.
+
+  /// get - return the ConstantRange for a given Value of IntegerType.
+  ConstantRange get(Value *V);
+
+  /// remove - remove a value from this analysis.
+  void remove(Value *V);
+
+  /// narrow - improve our unterstanding of a Value by pointing out that it
+  /// must fall within ConstantRange. To replace a range, remove it first.
+  void narrow(Value *V, const ConstantRange &CR);
+
+  //===---------------------------------------------------------------------
+  // Methods that are used to iterate across all values with information.
+
+  /// size - returns the number of Values with information
+  unsigned size() const { return Map.size(); }
+
+  typedef std::map<Value *, ConstantRange *>::iterator iterator;
+
+  /// begin - return an iterator to the first Value, ConstantRange pair
+  iterator begin() { return Map.begin(); }
+
+  /// end - return an iterator one past the last Value, ConstantRange pair
+  iterator end() { return Map.end(); }
+
+  /// getValue - return the Value referenced by an iterator
+  Value *getValue(iterator I) { return I->first; }
+
+  /// getConstantRange - return the ConstantRange referenced by an iterator
+  ConstantRange getConstantRange(iterator I) { return *I->second; }
+
+private:
+  ConstantRange compute(Value *V);
+
+  ConstantRange getRange(SCEVHandle S, Loop *L, ScalarEvolution &SE);
+
+  ConstantRange getRange(SCEVHandle S, SCEVHandle T, ScalarEvolution &SE);
+
+  std::map<Value *, ConstantRange *> Map;
+};
+
+} // end llvm namespace
+
+#endif

Modified: llvm/branches/non-call-eh/include/llvm/Analysis/Passes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Analysis/Passes.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Analysis/Passes.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Analysis/Passes.h Sun Jul  6 15:45:41 2008
@@ -20,6 +20,7 @@
   class ImmutablePass;
   class ModulePass;
   class Pass;
+  class LibCallInfo;
 
   //===--------------------------------------------------------------------===//
   //
@@ -63,6 +64,14 @@
 
   //===--------------------------------------------------------------------===//
   //
+  /// createLibCallAliasAnalysisPass - Create an alias analysis pass that knows
+  /// about the semantics of a set of libcalls specified by LCI.  The newly
+  /// constructed pass takes ownership of the pointer that is provided.
+  ///
+  FunctionPass *createLibCallAliasAnalysisPass(LibCallInfo *LCI);
+
+  //===--------------------------------------------------------------------===//
+  //
   // createAndersensPass - This pass implements Andersen's interprocedural alias
   // analysis.
   //

Modified: llvm/branches/non-call-eh/include/llvm/Analysis/PostDominators.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Analysis/PostDominators.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Analysis/PostDominators.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Analysis/PostDominators.h Sun Jul  6 15:45:41 2008
@@ -29,6 +29,8 @@
     DT = new DominatorTreeBase<BasicBlock>(true);
   }
 
+  ~PostDominatorTree();
+
   virtual bool runOnFunction(Function &F);
 
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
@@ -60,6 +62,7 @@
   }
 };
 
+FunctionPass* createPostDomTree();
 
 /// PostDominanceFrontier Class - Concrete subclass of DominanceFrontier that is
 /// used to compute the a post-dominance frontier.
@@ -88,9 +91,8 @@
                               const DomTreeNode *Node);
 };
 
-} // End llvm namespace
+FunctionPass* createPostDomFrontier();
 
-// Make sure that any clients of this file link in PostDominators.cpp
-FORCE_DEFINING_FILE_TO_BE_LINKED(PostDominanceFrontier)
+} // End llvm namespace
 
 #endif

Modified: llvm/branches/non-call-eh/include/llvm/Analysis/ScalarEvolution.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Analysis/ScalarEvolution.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Analysis/ScalarEvolution.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Analysis/ScalarEvolution.h Sun Jul  6 15:45:41 2008
@@ -24,8 +24,7 @@
 #include "llvm/Pass.h"
 #include "llvm/Analysis/LoopInfo.h"
 #include "llvm/Support/DataTypes.h"
-#include "llvm/Support/Streams.h"
-#include <set>
+#include <iosfwd>
 
 namespace llvm {
   class APInt;
@@ -82,6 +81,10 @@
     /// 
     uint32_t getBitWidth() const;
 
+    /// isZero - Return true if the expression is a constant zero.
+    ///
+    bool isZero() const;
+
     /// replaceSymbolicValuesWithConcrete - If this SCEV internally references
     /// the symbolic value "Sym", construct and return a new SCEV that produces
     /// the same value, but which uses the concrete value Conc instead of the
@@ -254,6 +257,11 @@
     SCEVHandle getMinusSCEV(const SCEVHandle &LHS,
                             const SCEVHandle &RHS);
 
+    /// getTruncateOrZeroExtend - Return a SCEV corresponding to a conversion
+    /// of the input value to the specified type.  If the type must be
+    /// extended, it is zero extended.
+    SCEVHandle getTruncateOrZeroExtend(const SCEVHandle &V, const Type *Ty);
+
     /// getIntegerSCEV - Given an integer or FP type, create a constant for the
     /// specified signed integer value and return a SCEV for the constant.
     SCEVHandle getIntegerSCEV(int Val, const Type *Ty);

Modified: llvm/branches/non-call-eh/include/llvm/Analysis/ScalarEvolutionExpander.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Analysis/ScalarEvolutionExpander.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Analysis/ScalarEvolutionExpander.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Analysis/ScalarEvolutionExpander.h Sun Jul  6 15:45:41 2008
@@ -14,13 +14,10 @@
 #ifndef LLVM_ANALYSIS_SCALAREVOLUTION_EXPANDER_H
 #define LLVM_ANALYSIS_SCALAREVOLUTION_EXPANDER_H
 
-#include "llvm/BasicBlock.h"
-#include "llvm/Constants.h"
 #include "llvm/Instructions.h"
 #include "llvm/Type.h"
 #include "llvm/Analysis/ScalarEvolution.h"
 #include "llvm/Analysis/ScalarEvolutionExpressions.h"
-#include "llvm/Support/CFG.h"
 
 namespace llvm {
   /// SCEVExpander - This class uses information about analyze scalars to
@@ -78,11 +75,7 @@
     /// expandCodeFor - Insert code to directly compute the specified SCEV
     /// expression into the program.  The inserted code is inserted into the
     /// specified block.
-    Value *expandCodeFor(SCEVHandle SH, Instruction *IP) {
-      // Expand the code for this SCEV.
-      this->InsertPt = IP;
-      return expand(SH);
-    }
+    Value *expandCodeFor(SCEVHandle SH, Instruction *IP);
 
     /// InsertCastOfTo - Insert a cast of V to the specified type, doing what
     /// we can to share the casts.
@@ -91,7 +84,7 @@
     /// InsertBinop - Insert the specified binary operator, doing a small amount
     /// of work to avoid inserting an obviously redundant operation.
     static Value *InsertBinop(Instruction::BinaryOps Opcode, Value *LHS,
-                              Value *RHS, Instruction *&InsertPt);
+                              Value *RHS, Instruction *InsertPt);
   protected:
     Value *expand(SCEV *S);
     
@@ -99,30 +92,13 @@
       return S->getValue();
     }
 
-    Value *visitTruncateExpr(SCEVTruncateExpr *S) {
-      Value *V = expand(S->getOperand());
-      return CastInst::createTruncOrBitCast(V, S->getType(), "tmp.", InsertPt);
-    }
-
-    Value *visitZeroExtendExpr(SCEVZeroExtendExpr *S) {
-      Value *V = expand(S->getOperand());
-      return CastInst::createZExtOrBitCast(V, S->getType(), "tmp.", InsertPt);
-    }
+    Value *visitTruncateExpr(SCEVTruncateExpr *S);
 
-    Value *visitSignExtendExpr(SCEVSignExtendExpr *S) {
-      Value *V = expand(S->getOperand());
-      return CastInst::createSExtOrBitCast(V, S->getType(), "tmp.", InsertPt);
-    }
+    Value *visitZeroExtendExpr(SCEVZeroExtendExpr *S);
 
-    Value *visitAddExpr(SCEVAddExpr *S) {
-      Value *V = expand(S->getOperand(S->getNumOperands()-1));
+    Value *visitSignExtendExpr(SCEVSignExtendExpr *S);
 
-      // Emit a bunch of add instructions
-      for (int i = S->getNumOperands()-2; i >= 0; --i)
-        V = InsertBinop(Instruction::Add, V, expand(S->getOperand(i)),
-                        InsertPt);
-      return V;
-    }
+    Value *visitAddExpr(SCEVAddExpr *S);
 
     Value *visitMulExpr(SCEVMulExpr *S);
 

Modified: llvm/branches/non-call-eh/include/llvm/Analysis/ScalarEvolutionExpressions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Analysis/ScalarEvolutionExpressions.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Analysis/ScalarEvolutionExpressions.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Analysis/ScalarEvolutionExpressions.h Sun Jul  6 15:45:41 2008
@@ -229,7 +229,7 @@
     ~SCEVCommutativeExpr();
 
   public:
-    unsigned getNumOperands() const { return Operands.size(); }
+    unsigned getNumOperands() const { return (unsigned)Operands.size(); }
     const SCEVHandle &getOperand(unsigned i) const {
       assert(i < Operands.size() && "Operand index out of range!");
       return Operands[i];
@@ -387,7 +387,7 @@
 
     SCEVAddRecExpr(const std::vector<SCEVHandle> &ops, const Loop *l)
       : SCEV(scAddRecExpr), Operands(ops), L(l) {
-      for (unsigned i = 0, e = Operands.size(); i != e; ++i)
+      for (size_t i = 0, e = Operands.size(); i != e; ++i)
         assert(Operands[i]->isLoopInvariant(l) &&
                "Operands of AddRec must be loop-invariant!");
     }
@@ -397,7 +397,7 @@
     op_iterator op_begin() const { return Operands.begin(); }
     op_iterator op_end() const { return Operands.end(); }
 
-    unsigned getNumOperands() const { return Operands.size(); }
+    unsigned getNumOperands() const { return (unsigned)Operands.size(); }
     const SCEVHandle &getOperand(unsigned i) const { return Operands[i]; }
     const SCEVHandle &getStart() const { return Operands[0]; }
     const Loop *getLoop() const { return L; }
@@ -407,7 +407,7 @@
     /// indicating how much this expression steps by.  If this is a polynomial
     /// of degree N, it returns a chrec of degree N-1.
     SCEVHandle getStepRecurrence(ScalarEvolution &SE) const {
-      if (getNumOperands() == 2) return getOperand(1);
+      if (isAffine()) return getOperand(1);
       return SE.getAddRecExpr(std::vector<SCEVHandle>(op_begin()+1,op_end()),
                               getLoop());
     }

Added: llvm/branches/non-call-eh/include/llvm/Analysis/SparsePropagation.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Analysis/SparsePropagation.h?rev=53163&view=auto

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Analysis/SparsePropagation.h (added)
+++ llvm/branches/non-call-eh/include/llvm/Analysis/SparsePropagation.h Sun Jul  6 15:45:41 2008
@@ -0,0 +1,184 @@
+//===- SparsePropagation.h - Sparse Conditional Property Propagation ------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements an abstract sparse conditional propagation algorithm,
+// modeled after SCCP, but with a customizable lattice function.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ANALYSIS_SPARSE_PROPAGATION_H
+#define LLVM_ANALYSIS_SPARSE_PROPAGATION_H
+
+#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/ADT/SmallVector.h"
+#include <vector>
+#include <set>
+
+namespace llvm {
+  class Value;
+  class Constant;
+  class Instruction;
+  class PHINode;
+  class TerminatorInst;
+  class BasicBlock;
+  class Function;
+  class SparseSolver;
+  
+/// AbstractLatticeFunction - This class is implemented by the dataflow instance
+/// to specify what the lattice values are and how they handle merges etc.
+/// This gives the client the power to compute lattice values from instructions,
+/// constants, etc.  The requirement is that lattice values must all fit into
+/// a void*.  If a void* is not sufficient, the implementation should use this
+/// pointer to be a pointer into a uniquing set or something.
+///
+class AbstractLatticeFunction {
+public:
+  typedef void *LatticeVal;
+private:
+  LatticeVal UndefVal, OverdefinedVal, UntrackedVal;
+public:
+  AbstractLatticeFunction(LatticeVal undefVal, LatticeVal overdefinedVal,
+                          LatticeVal untrackedVal) {
+    UndefVal = undefVal;
+    OverdefinedVal = overdefinedVal;
+    UntrackedVal = untrackedVal;
+  }
+  virtual ~AbstractLatticeFunction();
+  
+  LatticeVal getUndefVal()       const { return UndefVal; }
+  LatticeVal getOverdefinedVal() const { return OverdefinedVal; }
+  LatticeVal getUntrackedVal()   const { return UntrackedVal; }
+  
+  /// IsUntrackedValue - If the specified Value is something that is obviously
+  /// uninteresting to the analysis (and would always return UntrackedVal),
+  /// this function can return true to avoid pointless work.
+  virtual bool IsUntrackedValue(Value *V) {
+    return false;
+  }
+  
+  /// ComputeConstant - Given a constant value, compute and return a lattice
+  /// value corresponding to the specified constant.
+  virtual LatticeVal ComputeConstant(Constant *C) {
+    return getOverdefinedVal(); // always safe
+  }
+  
+  /// GetConstant - If the specified lattice value is representable as an LLVM
+  /// constant value, return it.  Otherwise return null.  The returned value
+  /// must be in the same LLVM type as Val.
+  virtual Constant *GetConstant(LatticeVal LV, Value *Val, SparseSolver &SS) {
+    return 0;
+  }
+  
+  /// MergeValues - Compute and return the merge of the two specified lattice
+  /// values.  Merging should only move one direction down the lattice to
+  /// guarantee convergence (toward overdefined).
+  virtual LatticeVal MergeValues(LatticeVal X, LatticeVal Y) {
+    return getOverdefinedVal(); // always safe, never useful.
+  }
+  
+  /// ComputeInstructionState - Given an instruction and a vector of its operand
+  /// values, compute the result value of the instruction.
+  virtual LatticeVal ComputeInstructionState(Instruction &I, SparseSolver &SS) {
+    return getOverdefinedVal(); // always safe, never useful.
+  }
+  
+  /// PrintValue - Render the specified lattice value to the specified stream.
+  virtual void PrintValue(LatticeVal V, std::ostream &OS);
+};
+
+  
+/// SparseSolver - This class is a general purpose solver for Sparse Conditional
+/// Propagation with a programmable lattice function.
+///
+class SparseSolver {
+  typedef AbstractLatticeFunction::LatticeVal LatticeVal;
+  
+  /// LatticeFunc - This is the object that knows the lattice and how to do
+  /// compute transfer functions.
+  AbstractLatticeFunction *LatticeFunc;
+  
+  DenseMap<Value*, LatticeVal> ValueState;  // The state each value is in.
+  SmallPtrSet<BasicBlock*, 16> BBExecutable;   // The bbs that are executable.
+  
+  std::vector<Instruction*> InstWorkList;   // Worklist of insts to process.
+  
+  std::vector<BasicBlock*> BBWorkList;  // The BasicBlock work list
+  
+  /// KnownFeasibleEdges - Entries in this set are edges which have already had
+  /// PHI nodes retriggered.
+  typedef std::pair<BasicBlock*,BasicBlock*> Edge;
+  std::set<Edge> KnownFeasibleEdges;
+  
+  SparseSolver(const SparseSolver&);    // DO NOT IMPLEMENT
+  void operator=(const SparseSolver&);  // DO NOT IMPLEMENT
+public:
+  explicit SparseSolver(AbstractLatticeFunction *Lattice)
+    : LatticeFunc(Lattice) {}
+  ~SparseSolver() {
+    delete LatticeFunc;
+  }
+  
+  /// Solve - Solve for constants and executable blocks.
+  ///
+  void Solve(Function &F);
+  
+  void Print(Function &F, std::ostream &OS);
+
+  /// getLatticeState - Return the LatticeVal object that corresponds to the
+  /// value.  If an value is not in the map, it is returned as untracked,
+  /// unlike the getOrInitValueState method.
+  LatticeVal getLatticeState(Value *V) const {
+    DenseMap<Value*, LatticeVal>::iterator I = ValueState.find(V);
+    return I != ValueState.end() ? I->second : LatticeFunc->getUntrackedVal();
+  }
+  
+  /// getOrInitValueState - Return the LatticeVal object that corresponds to the
+  /// value, initializing the value's state if it hasn't been entered into the
+  /// map yet.   This function is necessary because not all values should start
+  /// out in the underdefined state... Arguments should be overdefined, and
+  /// constants should be marked as constants.
+  ///
+  LatticeVal getOrInitValueState(Value *V);
+  
+  /// isEdgeFeasible - Return true if the control flow edge from the 'From'
+  /// basic block to the 'To' basic block is currently feasible.  If
+  /// AggressiveUndef is true, then this treats values with unknown lattice
+  /// values as undefined.  This is generally only useful when solving the
+  /// lattice, not when querying it.
+  bool isEdgeFeasible(BasicBlock *From, BasicBlock *To,
+                      bool AggressiveUndef = false);
+  
+private:
+  /// UpdateState - When the state for some instruction is potentially updated,
+  /// this function notices and adds I to the worklist if needed.
+  void UpdateState(Instruction &Inst, LatticeVal V);
+  
+  /// MarkBlockExecutable - This method can be used by clients to mark all of
+  /// the blocks that are known to be intrinsically live in the processed unit.
+  void MarkBlockExecutable(BasicBlock *BB);
+  
+  /// markEdgeExecutable - Mark a basic block as executable, adding it to the BB
+  /// work list if it is not already executable.
+  void markEdgeExecutable(BasicBlock *Source, BasicBlock *Dest);
+  
+  /// getFeasibleSuccessors - Return a vector of booleans to indicate which
+  /// successors are reachable from a given terminator instruction.
+  void getFeasibleSuccessors(TerminatorInst &TI, SmallVectorImpl<bool> &Succs,
+                             bool AggressiveUndef);
+  
+  void visitInst(Instruction &I);
+  void visitPHINode(PHINode &I);
+  void visitTerminatorInst(TerminatorInst &TI);
+
+};
+
+} // end namespace llvm
+
+#endif // LLVM_ANALYSIS_SPARSE_PROPAGATION_H

Modified: llvm/branches/non-call-eh/include/llvm/Analysis/ValueNumbering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Analysis/ValueNumbering.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Analysis/ValueNumbering.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Analysis/ValueNumbering.h Sun Jul  6 15:45:41 2008
@@ -22,6 +22,7 @@
 
 #include <vector>
 #include "llvm/Pass.h"
+#include "llvm/System/IncludeFile.h"
 
 namespace llvm {
 

Added: llvm/branches/non-call-eh/include/llvm/Analysis/ValueTracking.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Analysis/ValueTracking.h?rev=53163&view=auto

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Analysis/ValueTracking.h (added)
+++ llvm/branches/non-call-eh/include/llvm/Analysis/ValueTracking.h Sun Jul  6 15:45:41 2008
@@ -0,0 +1,87 @@
+//===- llvm/Analysis/ValueTracking.h - Walk computations --------*- 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 routines that help analyze properties that chains of
+// computations have.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ANALYSIS_VALUETRACKING_H
+#define LLVM_ANALYSIS_VALUETRACKING_H
+
+#include <string>
+#include <llvm/Support/DataTypes.h>
+
+namespace llvm {
+  class Value;
+  class Instruction;
+  class APInt;
+  class TargetData;
+  
+  /// ComputeMaskedBits - Determine which of the bits specified in Mask are
+  /// known to be either zero or one and return them in the KnownZero/KnownOne
+  /// bit sets.  This code only analyzes bits in Mask, in order to short-circuit
+  /// processing.
+  void ComputeMaskedBits(Value *V, const APInt &Mask, APInt &KnownZero,
+                         APInt &KnownOne, TargetData *TD = 0,
+                         unsigned Depth = 0);
+  
+  /// MaskedValueIsZero - Return true if 'V & Mask' is known to be zero.  We use
+  /// this predicate to simplify operations downstream.  Mask is known to be
+  /// zero for bits that V cannot have.
+  bool MaskedValueIsZero(Value *V, const APInt &Mask, 
+                         TargetData *TD = 0, unsigned Depth = 0);
+
+  
+  /// ComputeNumSignBits - Return the number of times the sign bit of the
+  /// register is replicated into the other bits.  We know that at least 1 bit
+  /// is always equal to the sign bit (itself), but other cases can give us
+  /// information.  For example, immediately after an "ashr X, 2", we know that
+  /// the top 3 bits are all equal to each other, so we return 3.
+  ///
+  /// 'Op' must have a scalar integer type.
+  ///
+  unsigned ComputeNumSignBits(Value *Op, TargetData *TD = 0,
+                              unsigned Depth = 0);
+
+  /// CannotBeNegativeZero - Return true if we can prove that the specified FP 
+  /// value is never equal to -0.0.
+  ///
+  bool CannotBeNegativeZero(const Value *V, unsigned Depth = 0);
+
+  /// FindScalarValue - Given an aggregrate and an sequence of indices, see if
+  /// the scalar value indexed is already around as a register, for example if
+  /// it were inserted directly into the aggregrate.
+  ///
+  /// If InsertBefore is not null, this function will duplicate (modified)
+  /// insertvalues when a part of a nested struct is extracted.
+  Value *FindInsertedValue(Value *V,
+                         const unsigned *idx_begin,
+                         const unsigned *idx_end,
+                         Instruction *InsertBefore = 0);
+
+  /// This is a convenience wrapper for finding values indexed by a single index
+  /// only.
+  inline Value *FindInsertedValue(Value *V, const unsigned Idx,
+                                 Instruction *InsertBefore = 0) {
+    const unsigned Idxs[1] = { Idx };
+    return FindInsertedValue(V, &Idxs[0], &Idxs[1], InsertBefore);
+  }
+  
+  /// GetConstantStringInfo - This function computes the length of a
+  /// null-terminated C string pointed to by V.  If successful, it returns true
+  /// and returns the string in Str.  If unsuccessful, it returns false.  If
+  /// StopAtNul is set to true (the default), the returned string is truncated
+  /// by a nul character in the global.  If StopAtNul is false, the nul
+  /// character is included in the result string.
+  bool GetConstantStringInfo(Value *V, std::string &Str, uint64_t Offset = 0,
+                             bool StopAtNul = true);
+} // end namespace llvm
+
+#endif

Modified: llvm/branches/non-call-eh/include/llvm/Argument.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Argument.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Argument.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Argument.h Sun Jul  6 15:45:41 2008
@@ -15,6 +15,7 @@
 #define LLVM_ARGUMENT_H
 
 #include "llvm/Value.h"
+#include "llvm/ParameterAttributes.h"
 
 namespace llvm {
 
@@ -60,7 +61,13 @@
   /// hasSRetAttr - Return true if this argument has the sret attribute on it in
   /// its containing function.
   bool hasStructRetAttr() const;
+
+  /// addAttr - Add a ParamAttr to an argument
+  void addAttr(ParameterAttributes);
   
+  /// removeAttr - Remove a ParamAttr from an argument
+  void removeAttr(ParameterAttributes);
+
   virtual void print(std::ostream &OS) const;
   void print(std::ostream *OS) const {
     if (OS) print(*OS);

Modified: llvm/branches/non-call-eh/include/llvm/AutoUpgrade.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/AutoUpgrade.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/AutoUpgrade.h (original)
+++ llvm/branches/non-call-eh/include/llvm/AutoUpgrade.h Sun Jul  6 15:45:41 2008
@@ -35,6 +35,12 @@
   /// so that it can update all calls to the old function.
   void UpgradeCallsToIntrinsic(Function* F);
 
+  /// This is an auto-upgrade hook for mutiple-value return statements.
+  /// This function auto-upgrades all such return statements in the given
+  /// function to use aggregate return values built with insertvalue
+  /// instructions.
+  void UpgradeMultipleReturnValues(Function *F);
+
 } // End llvm namespace
 
 #endif

Modified: llvm/branches/non-call-eh/include/llvm/BasicBlock.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/BasicBlock.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/BasicBlock.h (original)
+++ llvm/branches/non-call-eh/include/llvm/BasicBlock.h Sun Jul  6 15:45:41 2008
@@ -7,16 +7,17 @@
 //
 //===----------------------------------------------------------------------===//
 //
-//
 // This file contains the declaration of the BasicBlock class.
+//
 //===----------------------------------------------------------------------===//
 
 #ifndef LLVM_BASICBLOCK_H
 #define LLVM_BASICBLOCK_H
 
 #include "llvm/Instruction.h"
+#include "llvm/OperandTraits.h"
 #include "llvm/SymbolTableListTraits.h"
-#include "llvm/ADT/ilist"
+#include "llvm/ADT/ilist.h"
 #include "llvm/Support/DataTypes.h"
 
 namespace llvm {
@@ -56,7 +57,6 @@
   InstListType InstList;
   BasicBlock *Prev, *Next; // Next and Prev links for our intrusive linked list
   Function *Parent;
-  Use unwindDest;
 
   void setParent(Function *parent);
   void setNext(BasicBlock *N) { Next = N; }
@@ -71,7 +71,7 @@
   /// InsertBefore is null), or before the specified basic block.
   ///
   explicit BasicBlock(const std::string &Name = "", Function *Parent = 0,
-                      BasicBlock *InsertBefore = 0, BasicBlock *UnwindDest = 0);
+                      BasicBlock *InsertBefore = 0);
 public:
   /// Instruction iterators...
   typedef InstListType::iterator                              iterator;
@@ -79,11 +79,14 @@
 
   // allocate space for exactly zero operands
   static BasicBlock *Create(const std::string &Name = "", Function *Parent = 0,
-                            BasicBlock *InsertBefore = 0, BasicBlock *UnwindDest = 0) {
-    return new(!!UnwindDest) BasicBlock(Name, Parent, InsertBefore, UnwindDest);
+                            BasicBlock *InsertBefore = 0) {
+    return new(1) BasicBlock(Name, Parent, InsertBefore);
   }
   ~BasicBlock();
 
+  /// Provide fast operand accessors
+  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(BasicBlock);
+
   /// getUnwindDest - Returns the BasicBlock that flow will enter if an unwind
   /// instruction occurs in this block. May be null, in which case unwinding
   /// exits the function.
@@ -111,6 +114,11 @@
   const Function *getParent() const { return Parent; }
         Function *getParent()       { return Parent; }
 
+  /// use_back - Specialize the methods defined in Value, as we know that an
+  /// BasicBlock can only be used by Instructions (specifically PHI and terms).
+  Instruction       *use_back()       { return cast<Instruction>(*use_begin());}
+  const Instruction *use_back() const { return cast<Instruction>(*use_begin());}
+  
   /// getTerminator() - If this is a well formed basic block, then this returns
   /// a pointer to the terminator instruction.  If it is not, then you get a
   /// null pointer back.
@@ -124,6 +132,9 @@
   /// the first instruction, which might be PHI.
   /// Returns 0 is there's no non-PHI instruction.
   Instruction* getFirstNonPHI();
+  const Instruction* getFirstNonPHI() const {
+    return const_cast<BasicBlock*>(this)->getFirstNonPHI();
+  }
   
   /// removeFromParent - This method unlinks 'this' from the containing
   /// function, but does not delete it.
@@ -198,14 +209,7 @@
   /// update the PHI nodes that reside in the block.  Note that this should be
   /// called while the predecessor still refers to this block.
   ///
-  /// DontDeleteUselessPHIs will keep PHIs that have one value or the same 
-  /// value for all entries.
-  ///
-  /// OnlyDeleteOne will only remove one entry from a PHI, in case there were
-  /// duplicate entries for the Pred.
-  ///
-  void removePredecessor(BasicBlock *Pred, bool DontDeleteUselessPHIs = false,
-                         bool OnlyDeleteOne = false);
+  void removePredecessor(BasicBlock *Pred, bool DontDeleteUselessPHIs = false);
 
   /// splitBasicBlock - This splits a basic block into two at the specified
   /// instruction.  Note that all instructions BEFORE the specified iterator
@@ -241,6 +245,12 @@
   return BasicBlock::getInstListOffset();
 }
 
+template <>
+struct OperandTraits<BasicBlock> : OptionalOperandTraits<> {
+};
+
+DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS(BasicBlock, BasicBlock)
+
 } // End llvm namespace
 
 #endif

Modified: llvm/branches/non-call-eh/include/llvm/Bitcode/Archive.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Bitcode/Archive.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Bitcode/Archive.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Bitcode/Archive.h Sun Jul  6 15:45:41 2008
@@ -17,7 +17,7 @@
 #ifndef LLVM_BITCODE_ARCHIVE_H
 #define LLVM_BITCODE_ARCHIVE_H
 
-#include "llvm/ADT/ilist"
+#include "llvm/ADT/ilist.h"
 #include "llvm/System/Path.h"
 #include <map>
 #include <set>
@@ -254,7 +254,7 @@
     inline reverse_iterator       rend  ()       { return members.rend();   }
     inline const_reverse_iterator rend  () const { return members.rend();   }
 
-    inline unsigned               size()   const { return members.size();   }
+    inline size_t                 size()   const { return members.size();   }
     inline bool                   empty()  const { return members.empty();  }
     inline const ArchiveMember&   front()  const { return members.front();  }
     inline       ArchiveMember&   front()        { return members.front();  }

Modified: llvm/branches/non-call-eh/include/llvm/Bitcode/BitCodes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Bitcode/BitCodes.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Bitcode/BitCodes.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Bitcode/BitCodes.h Sun Jul  6 15:45:41 2008
@@ -165,7 +165,9 @@
   void addRef() { ++RefCount; }
   void dropRef() { if (--RefCount == 0) delete this; }
 
-  unsigned getNumOperandInfos() const { return OperandList.size(); }
+  unsigned getNumOperandInfos() const {
+    return static_cast<unsigned>(OperandList.size());
+  }
   const BitCodeAbbrevOp &getOperandInfo(unsigned N) const {
     return OperandList[N];
   }

Modified: llvm/branches/non-call-eh/include/llvm/Bitcode/BitstreamReader.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Bitcode/BitstreamReader.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Bitcode/BitstreamReader.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Bitcode/BitstreamReader.h Sun Jul  6 15:45:41 2008
@@ -85,12 +85,15 @@
   ~BitstreamReader() {
     // Abbrevs could still exist if the stream was broken.  If so, don't leak
     // them.
-    for (unsigned i = 0, e = CurAbbrevs.size(); i != e; ++i)
+    for (unsigned i = 0, e = static_cast<unsigned>(CurAbbrevs.size());
+         i != e; ++i)
       CurAbbrevs[i]->dropRef();
 
-    for (unsigned S = 0, e = BlockScope.size(); S != e; ++S) {
+    for (unsigned S = 0, e = static_cast<unsigned>(BlockScope.size());
+         S != e; ++S) {
       std::vector<BitCodeAbbrev*> &Abbrevs = BlockScope[S].PrevAbbrevs;
-      for (unsigned i = 0, e = Abbrevs.size(); i != e; ++i)
+      for (unsigned i = 0, e = static_cast<unsigned>(Abbrevs.size());
+           i != e; ++i)
         Abbrevs[i]->dropRef();
     }
     
@@ -98,7 +101,8 @@
     while (!BlockInfoRecords.empty()) {
       BlockInfo &Info = BlockInfoRecords.back();
       // Free blockinfo abbrev info.
-      for (unsigned i = 0, e = Info.Abbrevs.size(); i != e; ++i)
+      for (unsigned i = 0, e = static_cast<unsigned>(Info.Abbrevs.size());
+           i != e; ++i)
         Info.Abbrevs[i]->dropRef();
       BlockInfoRecords.pop_back();
     }
@@ -127,7 +131,7 @@
     // Skip over any bits that are already consumed.
     if (WordBitNo) {
       NextChar -= 4;
-      Read(WordBitNo);
+      Read(static_cast<unsigned>(WordBitNo));
     }
   }
   
@@ -237,7 +241,8 @@
     if (!BlockInfoRecords.empty() && BlockInfoRecords.back().BlockID == BlockID)
       return &BlockInfoRecords.back();
     
-    for (unsigned i = 0, e = BlockInfoRecords.size(); i != e; ++i)
+    for (unsigned i = 0, e = static_cast<unsigned>(BlockInfoRecords.size());
+         i != e; ++i)
       if (BlockInfoRecords[i].BlockID == BlockID)
         return &BlockInfoRecords[i];
     return 0;
@@ -282,7 +287,8 @@
     
     // Add the abbrevs specific to this block to the CurAbbrevs list.
     if (BlockInfo *Info = getBlockInfo(BlockID)) {
-      for (unsigned i = 0, e = Info->Abbrevs.size(); i != e; ++i) {
+      for (unsigned i = 0, e = static_cast<unsigned>(Info->Abbrevs.size());
+           i != e; ++i) {
         CurAbbrevs.push_back(Info->Abbrevs[i]);
         CurAbbrevs.back()->addRef();
       }
@@ -317,7 +323,8 @@
     CurCodeSize = BlockScope.back().PrevCodeSize;
     
     // Delete abbrevs from popped scope.
-    for (unsigned i = 0, e = CurAbbrevs.size(); i != e; ++i)
+    for (unsigned i = 0, e = static_cast<unsigned>(CurAbbrevs.size());
+         i != e; ++i)
       CurAbbrevs[i]->dropRef();
     
     BlockScope.back().PrevAbbrevs.swap(CurAbbrevs);

Modified: llvm/branches/non-call-eh/include/llvm/Bitcode/BitstreamWriter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Bitcode/BitstreamWriter.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Bitcode/BitstreamWriter.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Bitcode/BitstreamWriter.h Sun Jul  6 15:45:41 2008
@@ -70,7 +70,8 @@
     while (!BlockInfoRecords.empty()) {
       BlockInfo &Info = BlockInfoRecords.back();
       // Free blockinfo abbrev info.
-      for (unsigned i = 0, e = Info.Abbrevs.size(); i != e; ++i)
+      for (unsigned i = 0, e = static_cast<unsigned>(Info.Abbrevs.size());
+           i != e; ++i)
         Info.Abbrevs[i]->dropRef();
       BlockInfoRecords.pop_back();
     }
@@ -167,7 +168,8 @@
     if (!BlockInfoRecords.empty() && BlockInfoRecords.back().BlockID == BlockID)
       return &BlockInfoRecords.back();
     
-    for (unsigned i = 0, e = BlockInfoRecords.size(); i != e; ++i)
+    for (unsigned i = 0, e = static_cast<unsigned>(BlockInfoRecords.size());
+         i != e; ++i)
       if (BlockInfoRecords[i].BlockID == BlockID)
         return &BlockInfoRecords[i];
     return 0;
@@ -181,7 +183,7 @@
     EmitVBR(CodeLen, bitc::CodeLenWidth);
     FlushToWord();
     
-    unsigned BlockSizeWordLoc = Out.size();
+    unsigned BlockSizeWordLoc = static_cast<unsigned>(Out.size());
     unsigned OldCodeSize = CurCodeSize;
     
     // Emit a placeholder, which will be replaced when the block is popped.
@@ -197,7 +199,8 @@
     // If there is a blockinfo for this BlockID, add all the predefined abbrevs
     // to the abbrev list.
     if (BlockInfo *Info = getBlockInfo(BlockID)) {
-      for (unsigned i = 0, e = Info->Abbrevs.size(); i != e; ++i) {
+      for (unsigned i = 0, e = static_cast<unsigned>(Info->Abbrevs.size());
+           i != e; ++i) {
         CurAbbrevs.push_back(Info->Abbrevs[i]);
         Info->Abbrevs[i]->addRef();
       }
@@ -208,7 +211,8 @@
     assert(!BlockScope.empty() && "Block scope imbalance!");
     
     // Delete all abbrevs.
-    for (unsigned i = 0, e = CurAbbrevs.size(); i != e; ++i)
+    for (unsigned i = 0, e = static_cast<unsigned>(CurAbbrevs.size());
+         i != e; ++i)
       CurAbbrevs[i]->dropRef();
     
     const Block &B = BlockScope.back();
@@ -219,7 +223,7 @@
     FlushToWord();
 
     // Compute the size of the block, in words, not counting the size field.
-    unsigned SizeInWords = Out.size()/4-B.StartSizeWord - 1;
+    unsigned SizeInWords= static_cast<unsigned>(Out.size())/4-B.StartSizeWord-1;
     unsigned ByteNo = B.StartSizeWord*4;
     
     // Update the block size field in the header of this sub-block.
@@ -283,7 +287,8 @@
       Vals.insert(Vals.begin(), Code);
       
       unsigned RecordIdx = 0;
-      for (unsigned i = 0, e = Abbv->getNumOperandInfos(); i != e; ++i) {
+      for (unsigned i = 0, e = static_cast<unsigned>(Abbv->getNumOperandInfos());
+           i != e; ++i) {
         const BitCodeAbbrevOp &Op = Abbv->getOperandInfo(i);
         if (Op.isLiteral() || Op.getEncoding() != BitCodeAbbrevOp::Array) {
           assert(RecordIdx < Vals.size() && "Invalid abbrev/record");
@@ -295,7 +300,7 @@
           const BitCodeAbbrevOp &EltEnc = Abbv->getOperandInfo(++i);
           
           // Emit a vbr6 to indicate the number of elements present.
-          EmitVBR(Vals.size()-RecordIdx, 6);
+          EmitVBR(static_cast<uint32_t>(Vals.size()-RecordIdx), 6);
           
           // Emit each field.
           for (; RecordIdx != Vals.size(); ++RecordIdx)
@@ -308,8 +313,8 @@
       // form.
       EmitCode(bitc::UNABBREV_RECORD);
       EmitVBR(Code, 6);
-      EmitVBR(Vals.size(), 6);
-      for (unsigned i = 0, e = Vals.size(); i != e; ++i)
+      EmitVBR(static_cast<uint32_t>(Vals.size()), 6);
+      for (unsigned i = 0, e = static_cast<unsigned>(Vals.size()); i != e; ++i)
         EmitVBR64(Vals[i], 6);
     }
   }
@@ -323,7 +328,8 @@
   void EncodeAbbrev(BitCodeAbbrev *Abbv) {
     EmitCode(bitc::DEFINE_ABBREV);
     EmitVBR(Abbv->getNumOperandInfos(), 5);
-    for (unsigned i = 0, e = Abbv->getNumOperandInfos(); i != e; ++i) {
+    for (unsigned i = 0, e = static_cast<unsigned>(Abbv->getNumOperandInfos());
+         i != e; ++i) {
       const BitCodeAbbrevOp &Op = Abbv->getOperandInfo(i);
       Emit(Op.isLiteral(), 1);
       if (Op.isLiteral()) {
@@ -343,7 +349,8 @@
     // Emit the abbreviation as a record.
     EncodeAbbrev(Abbv);
     CurAbbrevs.push_back(Abbv);
-    return CurAbbrevs.size()-1+bitc::FIRST_APPLICATION_ABBREV;
+    return static_cast<unsigned>(CurAbbrevs.size())-1 +
+      bitc::FIRST_APPLICATION_ABBREV;
   }
   
   //===--------------------------------------------------------------------===//

Modified: llvm/branches/non-call-eh/include/llvm/Bitcode/Deserialize.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Bitcode/Deserialize.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Bitcode/Deserialize.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Bitcode/Deserialize.h Sun Jul  6 15:45:41 2008
@@ -436,7 +436,7 @@
   }
   
   template <typename T>
-  T* ReadPtr() { T* x; ReadPtr<T>(x,false); return x; }
+  T* ReadPtr() { T* x = 0; ReadPtr<T>(x,false); return x; }
 
   void ReadUIntPtr(uintptr_t& PtrRef, const SerializedPtrID& PtrID, 
                    bool AllowBackpatch = true);

Modified: llvm/branches/non-call-eh/include/llvm/Bitcode/LLVMBitCodes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Bitcode/LLVMBitCodes.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Bitcode/LLVMBitCodes.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Bitcode/LLVMBitCodes.h Sun Jul  6 15:45:41 2008
@@ -125,7 +125,9 @@
     CST_CODE_CE_INSERTELT  = 15,  // CE_INSERTELT:  [opval, opval, opval]
     CST_CODE_CE_SHUFFLEVEC = 16,  // CE_SHUFFLEVEC: [opval, opval, opval]
     CST_CODE_CE_CMP        = 17,  // CE_CMP:        [opty, opval, opval, pred]
-    CST_CODE_INLINEASM     = 18   // INLINEASM:     [sideeffect,asmstr,conststr]
+    CST_CODE_INLINEASM     = 18,  // INLINEASM:     [sideeffect,asmstr,conststr]
+    CST_CODE_CE_EXTRACTVAL = 19,  // CE_EXTRACTVAL: [n x operands]
+    CST_CODE_CE_INSERTVAL  = 20   // CE_INSERTVAL:  [n x operands]
   };
   
   /// CastOpcodes - These are values used in the bitcode files to encode which
@@ -203,9 +205,11 @@
     // spaces) is retained.
     FUNC_CODE_INST_STORE2      = 24, // STORE:      [ptrty,ptr,val, align, vol]
     FUNC_CODE_INST_GETRESULT   = 25, // GETRESULT:  [ty, opval, n]
+    FUNC_CODE_INST_EXTRACTVAL  = 26, // EXTRACTVAL: [n x operands]
+    FUNC_CODE_INST_INSERTVAL   = 27, // INSERTVAL:  [n x operands]
 
-    FUNC_CODE_INST_BB_UNWINDDEST = 26, // BB_UNWINDDEST: [bb#]
-    FUNC_CODE_INST_BB_NOUNWIND = 27  // BB_NOUNWIND
+    FUNC_CODE_INST_BB_UNWINDDEST = 28, // BB_UNWINDDEST: [bb#]
+    FUNC_CODE_INST_BB_NOUNWIND = 29  // BB_NOUNWIND
   };
 } // End bitc namespace
 } // End llvm namespace

Modified: llvm/branches/non-call-eh/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/AsmPrinter.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/AsmPrinter.h Sun Jul  6 15:45:41 2008
@@ -236,6 +236,7 @@
     /// then it will be printed first.  Comments should not contain '\n'.
     void EOL() const;
     void EOL(const std::string &Comment) const;
+    void EOL(const char* Comment) const;
     
     /// EmitULEB128Bytes - Emit an assembler byte data directive to compose an
     /// unsigned leb128 value.
@@ -314,8 +315,7 @@
     void EmitConstantValueOnly(const Constant *CV);
 
     /// EmitGlobalConstant - Print a general LLVM constant to the .s file.
-    /// If Packed is false, pad to the ABI size.
-    void EmitGlobalConstant(const Constant* CV, bool Packed = false);
+    void EmitGlobalConstant(const Constant* CV);
 
     virtual void EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV);
     
@@ -348,6 +348,11 @@
     /// specified type.
     void printDataDirective(const Type *type);
 
+    /// printSuffixedName - This prints a name with preceding 
+    /// getPrivateGlobalPrefix and the specified suffix, handling quoted names
+    /// correctly.
+    void printSuffixedName(std::string &Name, const char* Suffix);
+
   private:
     void EmitLLVMUsedList(Constant *List);
     void EmitXXStructorList(Constant *List);

Modified: llvm/branches/non-call-eh/include/llvm/CodeGen/CallingConvLower.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/CallingConvLower.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/CallingConvLower.h (original)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/CallingConvLower.h Sun Jul  6 15:45:41 2008
@@ -49,14 +49,14 @@
   LocInfo HTP : 7;
   
   /// ValVT - The type of the value being assigned.
-  MVT::ValueType ValVT;
+  MVT ValVT;
 
   /// LocVT - The type of the location being assigned to.
-  MVT::ValueType LocVT;
+  MVT LocVT;
 public:
     
-  static CCValAssign getReg(unsigned ValNo, MVT::ValueType ValVT,
-                            unsigned RegNo, MVT::ValueType LocVT,
+  static CCValAssign getReg(unsigned ValNo, MVT ValVT,
+                            unsigned RegNo, MVT LocVT,
                             LocInfo HTP) {
     CCValAssign Ret;
     Ret.ValNo = ValNo;
@@ -67,8 +67,8 @@
     Ret.LocVT = LocVT;
     return Ret;
   }
-  static CCValAssign getMem(unsigned ValNo, MVT::ValueType ValVT,
-                            unsigned Offset, MVT::ValueType LocVT,
+  static CCValAssign getMem(unsigned ValNo, MVT ValVT,
+                            unsigned Offset, MVT LocVT,
                             LocInfo HTP) {
     CCValAssign Ret;
     Ret.ValNo = ValNo;
@@ -81,14 +81,14 @@
   }
   
   unsigned getValNo() const { return ValNo; }
-  MVT::ValueType getValVT() const { return ValVT; }
+  MVT getValVT() const { return ValVT; }
 
   bool isRegLoc() const { return !isMem; }
   bool isMemLoc() const { return isMem; }
   
   unsigned getLocReg() const { assert(isRegLoc()); return Loc; }
   unsigned getLocMemOffset() const { assert(isMemLoc()); return Loc; }
-  MVT::ValueType getLocVT() const { return LocVT; }
+  MVT getLocVT() const { return LocVT; }
   
   LocInfo getLocInfo() const { return HTP; }
 };
@@ -96,8 +96,8 @@
 
 /// CCAssignFn - This function assigns a location for Val, updating State to
 /// reflect the change.
-typedef bool CCAssignFn(unsigned ValNo, MVT::ValueType ValVT,
-                        MVT::ValueType LocVT, CCValAssign::LocInfo LocInfo,
+typedef bool CCAssignFn(unsigned ValNo, MVT ValVT,
+                        MVT LocVT, CCValAssign::LocInfo LocInfo,
                         ISD::ArgFlagsTy ArgFlags, CCState &State);
 
   
@@ -217,8 +217,8 @@
   // HandleByVal - Allocate a stack slot large enough to pass an argument by
   // value. The size and alignment information of the argument is encoded in its
   // parameter attribute.
-  void HandleByVal(unsigned ValNo, MVT::ValueType ValVT,
-                   MVT::ValueType LocVT, CCValAssign::LocInfo LocInfo,
+  void HandleByVal(unsigned ValNo, MVT ValVT,
+                   MVT LocVT, CCValAssign::LocInfo LocInfo,
                    int MinSize, int MinAlign, ISD::ArgFlagsTy ArgFlags);
 
 private:

Added: llvm/branches/non-call-eh/include/llvm/CodeGen/DAGISelHeader.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/DAGISelHeader.h?rev=53163&view=auto

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/DAGISelHeader.h (added)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/DAGISelHeader.h Sun Jul  6 15:45:41 2008
@@ -0,0 +1,192 @@
+//==-llvm/CodeGen/DAGISelHeader.h - Common DAG ISel definitions  -*- C++ -*-==//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file provides definitions of the common, target-independent methods and 
+// data, which is used by SelectionDAG-based instruction selectors.
+//
+// *** NOTE: This file is #included into the middle of the target
+// *** instruction selector class.  These functions are really methods.
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CODEGEN_DAGISEL_HEADER_H
+#define LLVM_CODEGEN_DAGISEL_HEADER_H
+
+/// ISelQueue - Instruction selector priority queue sorted 
+/// in the order of increasing NodeId() values.
+std::vector<SDNode*> ISelQueue;
+
+/// Keep track of nodes which have already been added to queue.
+unsigned char *ISelQueued;
+
+/// Keep track of nodes which have already been selected.
+unsigned char *ISelSelected;
+
+/// IsChainCompatible - Returns true if Chain is Op or Chain does
+/// not reach Op.
+static bool IsChainCompatible(SDNode *Chain, SDNode *Op) {
+  if (Chain->getOpcode() == ISD::EntryToken)
+    return true;
+  else if (Chain->getOpcode() == ISD::TokenFactor)
+    return false;
+  else if (Chain->getNumOperands() > 0) {
+    SDOperand C0 = Chain->getOperand(0);
+    if (C0.getValueType() == MVT::Other)
+      return C0.Val != Op && IsChainCompatible(C0.Val, Op);
+  }
+  return true;
+}
+
+/// isel_sort - Sorting functions for the selection queue in the
+/// increasing NodeId order.
+struct isel_sort : public std::binary_function<SDNode*, SDNode*, bool> {
+  bool operator()(const SDNode* left, const SDNode* right) const {
+    return (left->getNodeId() > right->getNodeId());
+  }
+};
+
+/// setQueued - marks the node with a given NodeId() as element of the 
+/// instruction selection queue.
+inline void setQueued(int Id) {
+  ISelQueued[Id / 8] |= 1 << (Id % 8);
+}
+
+/// isSelected - checks if the node with a given NodeId() is
+/// in the instruction selection queue already.
+inline bool isQueued(int Id) {
+  return ISelQueued[Id / 8] & (1 << (Id % 8));
+}
+
+/// setSelected - marks the node with a given NodeId() as selected.
+inline void setSelected(int Id) {
+  ISelSelected[Id / 8] |= 1 << (Id % 8);
+}
+
+/// isSelected - checks if the node with a given NodeId() is
+/// selected already.
+inline bool isSelected(int Id) {
+  return ISelSelected[Id / 8] & (1 << (Id % 8));
+}
+
+/// AddToISelQueue - adds a node to the instruction 
+/// selection queue.
+void AddToISelQueue(SDOperand N) DISABLE_INLINE {
+  int Id = N.Val->getNodeId();
+  if (Id != -1 && !isQueued(Id)) {
+    ISelQueue.push_back(N.Val);
+    std::push_heap(ISelQueue.begin(), ISelQueue.end(), isel_sort());
+    setQueued(Id);
+  }
+}
+
+/// ISelQueueUpdater - helper class to handle updates of the 
+/// instruciton selection queue.
+class VISIBILITY_HIDDEN ISelQueueUpdater :
+  public SelectionDAG::DAGUpdateListener {
+    std::vector<SDNode*> &ISelQueue;
+    bool HadDelete; // Indicate if any deletions were done.
+  public:
+    explicit ISelQueueUpdater(std::vector<SDNode*> &isq)
+      : ISelQueue(isq), HadDelete(false) {}
+    
+    bool hadDelete() const { return HadDelete; }
+
+    /// NodeDeleted - remove node from the selection queue.
+    virtual void NodeDeleted(SDNode *N, SDNode *E) {
+      ISelQueue.erase(std::remove(ISelQueue.begin(), ISelQueue.end(), N),
+                      ISelQueue.end());
+      HadDelete = true;
+    }
+
+    /// NodeUpdated - Ignore updates for now.
+    virtual void NodeUpdated(SDNode *N) {}
+  };
+
+/// UpdateQueue - update the instruction selction queue to maintain 
+/// the increasing NodeId() ordering property.
+inline void UpdateQueue(const ISelQueueUpdater &ISQU) {
+  if (ISQU.hadDelete())
+    std::make_heap(ISelQueue.begin(), ISelQueue.end(),isel_sort());
+}
+
+
+/// ReplaceUses - replace all uses of the old node F with the use
+/// of the new node T.
+void ReplaceUses(SDOperand F, SDOperand T) DISABLE_INLINE {
+  ISelQueueUpdater ISQU(ISelQueue);
+  CurDAG->ReplaceAllUsesOfValueWith(F, T, &ISQU);
+  setSelected(F.Val->getNodeId());
+  UpdateQueue(ISQU);
+}
+
+/// ReplaceUses - replace all uses of the old node F with the use
+/// of the new node T.
+void ReplaceUses(SDNode *F, SDNode *T) DISABLE_INLINE {
+  unsigned FNumVals = F->getNumValues();
+  unsigned TNumVals = T->getNumValues();
+  ISelQueueUpdater ISQU(ISelQueue);
+  if (FNumVals != TNumVals) {
+    for (unsigned i = 0, e = std::min(FNumVals, TNumVals); i < e; ++i)
+     CurDAG->ReplaceAllUsesOfValueWith(SDOperand(F, i), SDOperand(T, i), &ISQU);
+  } else {
+    CurDAG->ReplaceAllUsesWith(F, T, &ISQU);
+  }
+  setSelected(F->getNodeId());
+  UpdateQueue(ISQU);
+}
+
+/// SelectRoot - Top level entry to DAG instruction selector.
+/// Selects instructions starting at the root of the current DAG.
+SDOperand SelectRoot(SDOperand Root) {
+  SelectRootInit();
+  unsigned NumBytes = (DAGSize + 7) / 8;
+  ISelQueued   = new unsigned char[NumBytes];
+  ISelSelected = new unsigned char[NumBytes];
+  memset(ISelQueued,   0, NumBytes);
+  memset(ISelSelected, 0, NumBytes);
+
+  // Create a dummy node (which is not added to allnodes), that adds
+  // a reference to the root node, preventing it from being deleted,
+  // and tracking any changes of the root.
+  HandleSDNode Dummy(CurDAG->getRoot());
+  ISelQueue.push_back(CurDAG->getRoot().Val);
+
+  // Select pending nodes from the instruction selection queue
+  // until no more nodes are left for selection.
+  while (!ISelQueue.empty()) {
+    SDNode *Node = ISelQueue.front();
+    std::pop_heap(ISelQueue.begin(), ISelQueue.end(), isel_sort());
+    ISelQueue.pop_back();
+    // Skip already selected nodes.
+    if (isSelected(Node->getNodeId()))
+      continue;
+    SDNode *ResNode = Select(SDOperand(Node, 0));
+    // If node should not be replaced, 
+    // continue with the next one.
+    if (ResNode == Node)
+      continue;
+    // Replace node.
+    if (ResNode)
+      ReplaceUses(Node, ResNode);
+    // If after the replacement this node is not used any more,
+    // remove this dead node.
+    if (Node->use_empty()) { // Don't delete EntryToken, etc.
+          ISelQueueUpdater ISQU(ISelQueue);
+          CurDAG->RemoveDeadNode(Node, &ISQU);
+          UpdateQueue(ISQU);
+    }
+  }
+
+  delete[] ISelQueued;
+  ISelQueued = NULL;
+  delete[] ISelSelected;
+  ISelSelected = NULL;
+  return Dummy.getValue();
+}
+
+#endif /* LLVM_CODEGEN_DAGISEL_HEADER_H */

Modified: llvm/branches/non-call-eh/include/llvm/CodeGen/LinkAllCodegenComponents.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/LinkAllCodegenComponents.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/LinkAllCodegenComponents.h (original)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/LinkAllCodegenComponents.h Sun Jul  6 15:45:41 2008
@@ -39,10 +39,10 @@
       (void) llvm::createOcamlCollector();
       (void) llvm::createShadowStackCollector();
       
-      (void) llvm::createBURRListDAGScheduler(NULL, NULL, NULL);
-      (void) llvm::createTDRRListDAGScheduler(NULL, NULL, NULL);
-      (void) llvm::createTDListDAGScheduler(NULL, NULL, NULL);
-      (void) llvm::createDefaultScheduler(NULL, NULL, NULL);
+      (void) llvm::createBURRListDAGScheduler(NULL, NULL, NULL, false);
+      (void) llvm::createTDRRListDAGScheduler(NULL, NULL, NULL, false);
+      (void) llvm::createTDListDAGScheduler(NULL, NULL, NULL, false);
+      (void) llvm::createDefaultScheduler(NULL, NULL, NULL, false);
 
     }
   } ForceCodegenLinking; // Force link by creating a global definition.

Modified: llvm/branches/non-call-eh/include/llvm/CodeGen/LiveInterval.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/LiveInterval.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/LiveInterval.h (original)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/LiveInterval.h Sun Jul  6 15:45:41 2008
@@ -23,9 +23,7 @@
 
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/Allocator.h"
-#include "llvm/Support/Streams.h"
 #include <iosfwd>
-#include <vector>
 #include <cassert>
 
 namespace llvm {
@@ -37,6 +35,7 @@
   /// merge point), it contains ~0u,x. If the value number is not in use, it
   /// contains ~1u,x to indicate that the value # is not used. 
   ///   def   - Instruction # of the definition.
+  ///         - or reg # of the definition if it's a stack slot liveinterval.
   ///   copy  - Copy iff val# is defined by a copy; zero otherwise.
   ///   hasPHIKill - One or more of the kills are PHI nodes.
   ///   kills - Instruction # of the kills.
@@ -102,15 +101,18 @@
     typedef SmallVector<LiveRange,4> Ranges;
     typedef SmallVector<VNInfo*,4> VNInfoList;
 
-    unsigned reg;        // the register of this interval
+    unsigned reg;        // the register or stack slot of this interval
+                         // if the top bits is set, it represents a stack slot.
     unsigned preference; // preferred register to allocate for this interval
     float weight;        // weight of this interval
     Ranges ranges;       // the ranges in which this register is live
     VNInfoList valnos;   // value#'s
 
   public:
-    LiveInterval(unsigned Reg, float Weight)
+    LiveInterval(unsigned Reg, float Weight, bool IsSS = false)
       : reg(Reg), preference(0), weight(Weight) {
+      if (IsSS)
+        reg = reg | (1U << (sizeof(unsigned)*8-1));
     }
 
     typedef Ranges::iterator iterator;
@@ -141,9 +143,22 @@
       return I;
     }
 
+    /// isStackSlot - Return true if this is a stack slot interval.
+    ///
+    bool isStackSlot() const {
+      return reg & (1U << (sizeof(unsigned)*8-1));
+    }
+
+    /// getStackSlotIndex - Return stack slot index if this is a stack slot
+    /// interval.
+    int getStackSlotIndex() const {
+      assert(isStackSlot() && "Interval is not a stack slot interval!");
+      return reg & ~(1U << (sizeof(unsigned)*8-1));
+    }
+
     bool containsOneValue() const { return valnos.size() == 1; }
 
-    unsigned getNumValNums() const { return valnos.size(); }
+    unsigned getNumValNums() const { return (unsigned)valnos.size(); }
     
     /// getValNumInfo - Returns pointer to the specified val#.
     ///
@@ -168,14 +183,15 @@
     VNInfo *getNextValue(unsigned MIIdx, MachineInstr *CopyMI,
                          BumpPtrAllocator &VNInfoAllocator) {
 #ifdef __GNUC__
-      unsigned Alignment = __alignof__(VNInfo);
+      unsigned Alignment = (unsigned)__alignof__(VNInfo);
 #else
       // FIXME: ugly.
       unsigned Alignment = 8;
 #endif
-      VNInfo *VNI= static_cast<VNInfo*>(VNInfoAllocator.Allocate(sizeof(VNInfo),
-                                                                 Alignment));
-      new (VNI) VNInfo(valnos.size(), MIIdx, CopyMI);
+      VNInfo *VNI =
+        static_cast<VNInfo*>(VNInfoAllocator.Allocate((unsigned)sizeof(VNInfo),
+                                                      Alignment));
+      new (VNI) VNInfo((unsigned)valnos.size(), MIIdx, CopyMI);
       valnos.push_back(VNI);
       return VNI;
     }
@@ -196,7 +212,8 @@
     /// addKills - Add a number of kills into the VNInfo kill vector. If this
     /// interval is live at a kill point, then the kill is not added.
     void addKills(VNInfo *VNI, const SmallVector<unsigned, 4> &kills) {
-      for (unsigned i = 0, e = kills.size(); i != e; ++i) {
+      for (unsigned i = 0, e = static_cast<unsigned>(kills.size());
+           i != e; ++i) {
         unsigned KillIdx = kills[i];
         if (!liveBeforeAndAt(KillIdx)) {
           SmallVector<unsigned, 4>::iterator
@@ -313,6 +330,11 @@
     /// FindLiveRangeContaining - Return an iterator to the live range that
     /// contains the specified index, or end() if there is none.
     iterator FindLiveRangeContaining(unsigned Idx);
+
+    /// findDefinedVNInfo - Find the VNInfo that's defined at the specified
+    /// index (register interval) or defined by the specified register (stack
+    /// inteval).
+    VNInfo *findDefinedVNInfo(unsigned DefIdxOrReg) const;
     
     /// overlaps - Return true if the intersection of the two live intervals is
     /// not empty.

Modified: llvm/branches/non-call-eh/include/llvm/CodeGen/LiveIntervalAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/LiveIntervalAnalysis.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/LiveIntervalAnalysis.h (original)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/LiveIntervalAnalysis.h Sun Jul  6 15:45:41 2008
@@ -131,7 +131,7 @@
     const_iterator end() const { return r2iMap_.end(); }
     iterator begin() { return r2iMap_.begin(); }
     iterator end() { return r2iMap_.end(); }
-    unsigned getNumIntervals() const { return r2iMap_.size(); }
+    unsigned getNumIntervals() const { return (unsigned)r2iMap_.size(); }
 
     LiveInterval &getInterval(unsigned reg) {
       Reg2IntervalMap::iterator I = r2iMap_.find(reg);
@@ -169,6 +169,13 @@
       return MBB2IdxMap[MBBNo].second;
     }
 
+    /// getIntervalSize - get the size of an interval in "units,"
+    /// where every function is composed of one thousand units.  This
+    /// measure scales properly with empty index slots in the function.
+    unsigned getScaledIntervalSize(LiveInterval& I) const {
+      return (1000 / InstrSlots::NUM * I.getSize()) / i2miMap_.size();
+    }
+
     /// getMBBFromIndex - given an index in any instruction of an
     /// MBB return a pointer the MBB
     MachineBasicBlock* getMBBFromIndex(unsigned index) const {
@@ -220,6 +227,11 @@
         I = r2iMap_.insert(I, std::make_pair(reg, createInterval(reg)));
       return I->second;
     }
+    
+    /// addLiveRangeToEndOfBlock - Given a register and an instruction,
+    /// adds a live range from that instruction to the end of its MBB.
+    LiveRange addLiveRangeToEndOfBlock(unsigned reg,
+                                        MachineInstr* startInst);
 
     // Interval removal
 
@@ -278,10 +290,12 @@
     }
 
     /// addIntervalsForSpills - Create new intervals for spilled defs / uses of
-    /// the given interval.
+    /// the given interval. FIXME: It also returns the weight of the spill slot
+    /// (if any is created) by reference. This is temporary.
     std::vector<LiveInterval*>
     addIntervalsForSpills(const LiveInterval& i,
-                          const MachineLoopInfo *loopInfo, VirtRegMap& vrm);
+                          const MachineLoopInfo *loopInfo, VirtRegMap& vrm,
+                          float &SSWeight);
 
     /// spillPhysRegAroundRegDefsUses - Spill the specified physical register
     /// around all defs and uses of the specified interval.
@@ -302,6 +316,9 @@
     unsigned getNumConflictsWithPhysReg(const LiveInterval &li,
                                         unsigned PhysReg) const;
 
+    /// computeNumbering - Compute the index numbering.
+    void computeNumbering();
+
   private:      
     /// computeIntervals - Compute live intervals.
     void computeIntervals();
@@ -311,20 +328,20 @@
     /// handleVirtualRegisterDef)
     void handleRegisterDef(MachineBasicBlock *MBB,
                            MachineBasicBlock::iterator MI, unsigned MIIdx,
-                           unsigned reg);
+                           MachineOperand& MO);
 
     /// handleVirtualRegisterDef - update intervals for a virtual
     /// register def
     void handleVirtualRegisterDef(MachineBasicBlock *MBB,
                                   MachineBasicBlock::iterator MI,
-                                  unsigned MIIdx,
+                                  unsigned MIIdx, MachineOperand& MO,
                                   LiveInterval& interval);
 
     /// handlePhysicalRegisterDef - update intervals for a physical register
     /// def.
     void handlePhysicalRegisterDef(MachineBasicBlock* mbb,
                                    MachineBasicBlock::iterator mi,
-                                   unsigned MIIdx,
+                                   unsigned MIIdx, MachineOperand& MO,
                                    LiveInterval &interval,
                                    MachineInstr *CopyMI);
 
@@ -416,7 +433,7 @@
         SmallVector<int, 4> &ReMatIds, const MachineLoopInfo *loopInfo,
         unsigned &NewVReg, unsigned ImpUse, bool &HasDef, bool &HasUse,
         std::map<unsigned,unsigned> &MBBVRegsMap,
-        std::vector<LiveInterval*> &NewLIs);
+        std::vector<LiveInterval*> &NewLIs, float &SSWeight);
     void rewriteInstructionsForSpills(const LiveInterval &li, bool TrySplit,
         LiveInterval::Ranges::const_iterator &I,
         MachineInstr *OrigDefMI, MachineInstr *DefMI, unsigned Slot, int LdSlot,
@@ -428,7 +445,7 @@
         BitVector &RestoreMBBs,
         std::map<unsigned,std::vector<SRInfo> > &RestoreIdxes,
         std::map<unsigned,unsigned> &MBBVRegsMap,
-        std::vector<LiveInterval*> &NewLIs);
+        std::vector<LiveInterval*> &NewLIs, float &SSWeight);
 
     static LiveInterval createInterval(unsigned Reg);
 

Added: llvm/branches/non-call-eh/include/llvm/CodeGen/LiveStackAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/LiveStackAnalysis.h?rev=53163&view=auto

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/LiveStackAnalysis.h (added)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/LiveStackAnalysis.h Sun Jul  6 15:45:41 2008
@@ -0,0 +1,71 @@
+//===-- LiveStackAnalysis.h - Live Stack Slot Analysis ----------*- C++ -*-===//
+//
+//                     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 live stack slot analysis pass. It is analogous to
+// live interval analysis except it's analyzing liveness of stack slots rather
+// than registers.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CODEGEN_LIVESTACK_ANALYSIS_H
+#define LLVM_CODEGEN_LIVESTACK_ANALYSIS_H
+
+#include "llvm/CodeGen/MachineFunctionPass.h"
+#include "llvm/CodeGen/LiveInterval.h"
+#include "llvm/Support/Allocator.h"
+#include <map>
+
+namespace llvm {
+
+  class LiveStacks : public MachineFunctionPass {
+    /// Special pool allocator for VNInfo's (LiveInterval val#).
+    ///
+    BumpPtrAllocator VNInfoAllocator;
+
+    /// s2iMap - Stack slot indices to live interval mapping.
+    ///
+    typedef std::map<int, LiveInterval> SS2IntervalMap;
+    SS2IntervalMap s2iMap;
+
+  public:
+    static char ID; // Pass identification, replacement for typeid
+    LiveStacks() : MachineFunctionPass((intptr_t)&ID) {}
+
+    typedef SS2IntervalMap::iterator iterator;
+    typedef SS2IntervalMap::const_iterator const_iterator;
+    const_iterator begin() const { return s2iMap.begin(); }
+    const_iterator end() const { return s2iMap.end(); }
+    iterator begin() { return s2iMap.begin(); }
+    iterator end() { return s2iMap.end(); }
+    unsigned getNumIntervals() const { return (unsigned)s2iMap.size(); }
+
+    LiveInterval &getOrCreateInterval(int Slot) {
+      SS2IntervalMap::iterator I = s2iMap.find(Slot);
+      if (I == s2iMap.end())
+        I = s2iMap.insert(I,std::make_pair(Slot,LiveInterval(Slot,0.0F,true)));
+      return I->second;
+    }
+
+    BumpPtrAllocator& getVNInfoAllocator() { return VNInfoAllocator; }
+
+    virtual void getAnalysisUsage(AnalysisUsage &AU) const;
+    virtual void releaseMemory();
+
+    /// runOnMachineFunction - pass entry point
+    virtual bool runOnMachineFunction(MachineFunction&);
+
+    /// print - Implement the dump method.
+    virtual void print(std::ostream &O, const Module* = 0) const;
+    void print(std::ostream *O, const Module* M = 0) const {
+      if (O) print(*O, M);
+    }
+  };
+}
+
+#endif /* LLVM_CODEGEN_LIVESTACK_ANALYSIS_H */

Modified: llvm/branches/non-call-eh/include/llvm/CodeGen/LiveVariables.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/LiveVariables.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/LiveVariables.h (original)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/LiveVariables.h Sun Jul  6 15:45:41 2008
@@ -52,8 +52,7 @@
   /// non-phi instructions that are the last users of the value.
   ///
   /// In the common case where a value is defined and killed in the same block,
-  /// DefInst is the defining inst, there is one killing instruction, and 
-  /// AliveBlocks is empty.
+  /// There is one killing instruction, and  AliveBlocks is empty.
   ///
   /// Otherwise, the value is live out of the block.  If the value is live
   /// across any blocks, these blocks are listed in AliveBlocks.  Blocks where
@@ -68,16 +67,11 @@
   /// but does include the predecessor block in the AliveBlocks set (unless that
   /// block also defines the value).  This leads to the (perfectly sensical)
   /// situation where a value is defined in a block, and the last use is a phi
-  /// node in the successor.  In this case, DefInst will be the defining
-  /// instruction, AliveBlocks is empty (the value is not live across any 
-  /// blocks) and Kills is empty (phi nodes are not included).  This is sensical
-  /// because the value must be live to the end of the block, but is not live in
-  /// any successor blocks.
+  /// node in the successor.  In this case, AliveBlocks is empty (the value is
+  /// not live across any  blocks) and Kills is empty (phi nodes are not
+  /// included). This is sensical because the value must be live to the end of
+  /// the block, but is not live in any successor blocks.
   struct VarInfo {
-    /// DefInst - The machine instruction that defines this register.
-    ///
-    MachineInstr *DefInst;
-
     /// AliveBlocks - Set of blocks of which this value is alive completely
     /// through.  This is a bit set which uses the basic block number as an
     /// index.
@@ -97,7 +91,7 @@
     ///
     std::vector<MachineInstr*> Kills;
 
-    VarInfo() : DefInst(0), NumUses(0) {}
+    VarInfo() : NumUses(0) {}
 
     /// removeKill - Delete a kill corresponding to the specified
     /// machine instruction. Returns true if there was a kill
@@ -183,11 +177,10 @@
   //===--------------------------------------------------------------------===//
   //  API to update live variable information
 
-  /// instructionChanged - When the address of an instruction changes, this
-  /// method should be called so that live variables can update its internal
-  /// data structures.  This removes the records for OldMI, transfering them to
-  /// the records for NewMI.
-  void instructionChanged(MachineInstr *OldMI, MachineInstr *NewMI);
+  /// replaceKillInstruction - Update register kill info by replacing a kill
+  /// instruction with a new one.
+  void replaceKillInstruction(unsigned Reg, MachineInstr *OldMI,
+                              MachineInstr *NewMI);
 
   /// addVirtualRegisterKilled - Add information about the fact that the
   /// specified register is killed after being used by the specified
@@ -199,13 +192,11 @@
       getVarInfo(IncomingReg).Kills.push_back(MI); 
   }
 
-  /// removeVirtualRegisterKilled - Remove the specified virtual
+  /// removeVirtualRegisterKilled - Remove the specified kill of the virtual
   /// register from the live variable information. Returns true if the
   /// variable was marked as killed by the specified instruction,
   /// false otherwise.
-  bool removeVirtualRegisterKilled(unsigned reg,
-                                   MachineBasicBlock *MBB,
-                                   MachineInstr *MI) {
+  bool removeVirtualRegisterKilled(unsigned reg, MachineInstr *MI) {
     if (!getVarInfo(reg).removeKill(MI))
       return false;
 
@@ -233,16 +224,14 @@
   void addVirtualRegisterDead(unsigned IncomingReg, MachineInstr *MI,
                               bool AddIfNotFound = false) {
     if (MI->addRegisterDead(IncomingReg, TRI, AddIfNotFound))
-        getVarInfo(IncomingReg).Kills.push_back(MI);
+      getVarInfo(IncomingReg).Kills.push_back(MI);
   }
 
-  /// removeVirtualRegisterDead - Remove the specified virtual
+  /// removeVirtualRegisterDead - Remove the specified kill of the virtual
   /// register from the live variable information. Returns true if the
   /// variable was marked dead at the specified instruction, false
   /// otherwise.
-  bool removeVirtualRegisterDead(unsigned reg,
-                                 MachineBasicBlock *MBB,
-                                 MachineInstr *MI) {
+  bool removeVirtualRegisterDead(unsigned reg, MachineInstr *MI) {
     if (!getVarInfo(reg).removeKill(MI))
       return false;
 
@@ -259,10 +248,6 @@
     return true;
   }
 
-  /// removeVirtualRegistersDead - Remove all of the dead registers for the
-  /// specified instruction from the live variable information.
-  void removeVirtualRegistersDead(MachineInstr *MI);
-  
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.setPreservesAll();
   }

Modified: llvm/branches/non-call-eh/include/llvm/CodeGen/MachineBasicBlock.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/MachineBasicBlock.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/MachineBasicBlock.h (original)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/MachineBasicBlock.h Sun Jul  6 15:45:41 2008
@@ -16,7 +16,7 @@
 
 #include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/ADT/GraphTraits.h"
-#include "llvm/ADT/ilist"
+#include "llvm/ADT/ilist.h"
 #include "llvm/Support/Streams.h"
 
 namespace llvm {
@@ -108,7 +108,7 @@
   typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
   typedef std::reverse_iterator<iterator>             reverse_iterator;
 
-  unsigned size() const { return Insts.size(); }
+  unsigned size() const { return (unsigned)Insts.size(); }
   bool empty() const { return Insts.empty(); }
 
   MachineInstr& front() { return Insts.front(); }
@@ -149,7 +149,9 @@
                                           { return Predecessors.rend();  }
   const_pred_reverse_iterator  pred_rend()   const
                                           { return Predecessors.rend();  }
-  unsigned             pred_size()  const { return Predecessors.size();  }
+  unsigned             pred_size()  const {
+    return (unsigned)Predecessors.size();
+  }
   bool                 pred_empty() const { return Predecessors.empty(); }
   succ_iterator        succ_begin()       { return Successors.begin();   }
   const_succ_iterator  succ_begin() const { return Successors.begin();   }
@@ -163,7 +165,9 @@
                                           { return Successors.rend();    }
   const_succ_reverse_iterator  succ_rend()   const
                                           { return Successors.rend();    }
-  unsigned             succ_size()  const { return Successors.size();    }
+  unsigned             succ_size()  const {
+    return (unsigned)Successors.size();
+  }
   bool                 succ_empty() const { return Successors.empty();   }
 
   // LiveIn management methods.
@@ -176,6 +180,10 @@
   ///
   void removeLiveIn(unsigned Reg);
 
+  /// isLiveIn - Return true if the specified register is in the live in set.
+  ///
+  bool isLiveIn(unsigned Reg) const;
+
   // Iteration support for live in sets.  These sets are kept in sorted
   // order by their register number.
   typedef std::vector<unsigned>::iterator       livein_iterator;
@@ -228,6 +236,11 @@
   ///
   succ_iterator removeSuccessor(succ_iterator I);
   
+  /// transferSuccessors - Transfers all the successors from MBB to this
+  /// machine basic block (i.e., copies all the successors fromMBB and
+  /// remove all the successors fromBB).
+  void transferSuccessors(MachineBasicBlock *fromMBB);
+  
   /// isSuccessor - Return true if the specified MBB is a successor of this
   /// block.
   bool isSuccessor(MachineBasicBlock *MBB) const;

Modified: llvm/branches/non-call-eh/include/llvm/CodeGen/MachineCodeEmitter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/MachineCodeEmitter.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/MachineCodeEmitter.h (original)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/MachineCodeEmitter.h Sun Jul  6 15:45:41 2008
@@ -18,7 +18,6 @@
 #define LLVM_CODEGEN_MACHINECODEEMITTER_H
 
 #include "llvm/Support/DataTypes.h"
-#include <vector>
 
 namespace llvm {
 
@@ -168,7 +167,8 @@
   /// emitString - This callback is invoked when a String needs to be
   /// written to the output stream.
   void emitString(const std::string &String) {
-    for (unsigned i = 0, N = String.size(); i < N; ++i) {
+    for (unsigned i = 0, N = static_cast<unsigned>(String.size());
+         i < N; ++i) {
       unsigned char C = String[i];
       emitByte(C);
     }

Modified: llvm/branches/non-call-eh/include/llvm/CodeGen/MachineFrameInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/MachineFrameInfo.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/MachineFrameInfo.h (original)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/MachineFrameInfo.h Sun Jul  6 15:45:41 2008
@@ -193,7 +193,14 @@
 
   /// getObjectIndexEnd - Return one past the maximum frame object index...
   ///
-  int getObjectIndexEnd() const { return Objects.size()-NumFixedObjects; }
+  int getObjectIndexEnd() const { return (int)Objects.size()-NumFixedObjects; }
+
+  /// getNumFixedObjects() - Return the number of fixed objects.
+  unsigned getNumFixedObjects() const { return NumFixedObjects; }
+
+  /// getNumObjects() - Return the number of objects.
+  ///
+  unsigned getNumObjects() const { return Objects.size(); }
 
   /// getObjectSize - Return the size of the specified object
   ///
@@ -203,6 +210,13 @@
     return Objects[ObjectIdx+NumFixedObjects].Size;
   }
 
+  // setObjectSize - Change the size of the specified stack object...
+  void setObjectSize(int ObjectIdx, int64_t Size) {
+    assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
+           "Invalid Object Idx!");
+    Objects[ObjectIdx+NumFixedObjects].Size = Size;
+  }
+
   /// getObjectAlignment - Return the alignment of the specified stack object...
   unsigned getObjectAlignment(int ObjectIdx) const {
     assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
@@ -210,6 +224,13 @@
     return Objects[ObjectIdx+NumFixedObjects].Alignment;
   }
 
+  /// setObjectAlignment - Change the alignment of the specified stack object...
+  void setObjectAlignment(int ObjectIdx, unsigned Align) {
+    assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
+           "Invalid Object Idx!");
+    Objects[ObjectIdx+NumFixedObjects].Alignment = Align;
+  }
+
   /// getObjectOffset - Return the assigned stack offset of the specified object
   /// from the incoming stack pointer.
   ///
@@ -311,18 +332,14 @@
   int CreateStackObject(uint64_t Size, unsigned Alignment) {
     assert(Size != 0 && "Cannot allocate zero size stack objects!");
     Objects.push_back(StackObject(Size, Alignment, -1));
-    return Objects.size()-NumFixedObjects-1;
+    return (int)Objects.size()-NumFixedObjects-1;
   }
 
   /// RemoveStackObject - Remove or mark dead a statically sized stack object.
   ///
   void RemoveStackObject(int ObjectIdx) {
-    if (ObjectIdx == (int)(Objects.size()-NumFixedObjects-1))
-      // Last object, simply pop it off the list.
-      Objects.pop_back();
-    else
-      // Mark it dead.
-      Objects[ObjectIdx+NumFixedObjects].Size = ~0ULL;
+    // Mark it dead.
+    Objects[ObjectIdx+NumFixedObjects].Size = ~0ULL;
   }
 
   /// CreateVariableSizedObject - Notify the MachineFrameInfo object that a
@@ -333,7 +350,7 @@
   int CreateVariableSizedObject() {
     HasVarSizedObjects = true;
     Objects.push_back(StackObject(0, 1, -1));
-    return Objects.size()-NumFixedObjects-1;
+    return (int)Objects.size()-NumFixedObjects-1;
   }
   
   /// getCalleeSavedInfo - Returns a reference to call saved info vector for the

Modified: llvm/branches/non-call-eh/include/llvm/CodeGen/MachineFunction.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/MachineFunction.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/MachineFunction.h (original)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/MachineFunction.h Sun Jul  6 15:45:41 2008
@@ -32,7 +32,7 @@
 
 // ilist_traits
 template <>
-struct ilist_traits<MachineBasicBlock> {
+class ilist_traits<MachineBasicBlock> {
   // this is only set by the MachineFunction owning the ilist
   friend class MachineFunction;
   MachineFunction* Parent;
@@ -165,7 +165,7 @@
 
   /// getNumBlockIDs - Return the number of MBB ID's allocated.
   ///
-  unsigned getNumBlockIDs() const { return MBBNumbering.size(); }
+  unsigned getNumBlockIDs() const { return (unsigned)MBBNumbering.size(); }
   
   /// RenumberBlocks - This discards all of the MachineBasicBlock numbers and
   /// recomputes them.  This guarantees that the MBB numbers are sequential,
@@ -238,7 +238,7 @@
   reverse_iterator        rend  ()       { return BasicBlocks.rend();   }
   const_reverse_iterator  rend  () const { return BasicBlocks.rend();   }
 
-  unsigned                  size() const { return BasicBlocks.size(); }
+  unsigned                  size() const { return (unsigned)BasicBlocks.size();}
   bool                     empty() const { return BasicBlocks.empty(); }
   const MachineBasicBlock &front() const { return BasicBlocks.front(); }
         MachineBasicBlock &front()       { return BasicBlocks.front(); }
@@ -254,7 +254,7 @@
   ///
   unsigned addToMBBNumbering(MachineBasicBlock *MBB) {
     MBBNumbering.push_back(MBB);
-    return MBBNumbering.size()-1;
+    return (unsigned)MBBNumbering.size()-1;
   }
 
   /// removeFromMBBNumbering - Remove the specific machine basic block from our

Modified: llvm/branches/non-call-eh/include/llvm/CodeGen/MachineInstr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/MachineInstr.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/MachineInstr.h (original)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/MachineInstr.h Sun Jul  6 15:45:41 2008
@@ -18,6 +18,7 @@
 
 #include "llvm/CodeGen/MachineOperand.h"
 #include "llvm/CodeGen/MachineMemOperand.h"
+#include <vector>
 
 namespace llvm {
 
@@ -82,7 +83,7 @@
 
   /// Access to explicit operands of the instruction.
   ///
-  unsigned getNumOperands() const { return Operands.size(); }
+  unsigned getNumOperands() const { return (unsigned)Operands.size(); }
 
   const MachineOperand& getOperand(unsigned i) const {
     assert(i < getNumOperands() && "getOperand() out of range!");
@@ -98,7 +99,7 @@
   unsigned getNumExplicitOperands() const;
   
   /// Access to memory operands of the instruction
-  unsigned getNumMemOperands() const { return MemOperands.size(); }
+  unsigned getNumMemOperands() const { return (unsigned)MemOperands.size(); }
 
   const MachineMemOperand& getMemOperand(unsigned i) const {
     assert(i < getNumMemOperands() && "getMemOperand() out of range!");
@@ -135,6 +136,10 @@
     delete removeFromParent();
   }
 
+  /// isLabel - Returns true if the MachineInstr represents a label.
+  ///
+  bool isLabel() const;
+
   /// isDebugLabel - Returns true if the MachineInstr represents a debug label.
   ///
   bool isDebugLabel() const;
@@ -184,10 +189,9 @@
   }
   
   /// findRegisterDefOperandIdx() - Returns the operand index that is a def of
-  /// the specific register or -1 if it is not found. It further tightening
-  /// the search criteria to a def that is dead the register if isDead is true.
-  /// If TargetRegisterInfo is passed, then it also checks if there is a def of
-  /// a super-register.
+  /// the specified register or -1 if it is not found. If isDead is true, defs
+  /// that are not dead are skipped. If TargetRegisterInfo is non-null, then it
+  /// also checks if there is a def of a super-register.
   int findRegisterDefOperandIdx(unsigned Reg, bool isDead = false,
                                 const TargetRegisterInfo *TRI = NULL) const;
 
@@ -230,13 +234,9 @@
   bool addRegisterDead(unsigned IncomingReg, const TargetRegisterInfo *RegInfo,
                        bool AddIfNotFound = false);
 
-  /// copyKillDeadInfo - Copies killed/dead information from one instr to another
-  void copyKillDeadInfo(MachineInstr *OldMI,
-                        const TargetRegisterInfo *RegInfo);
-
-  /// isSafeToMove - Return true if it is safe to this instruction. If SawStore
-  /// true, it means there is a store (or call) between the instruction the
-  /// localtion and its intended destination.
+  /// isSafeToMove - Return true if it is safe to move this instruction. If
+  /// SawStore is set to true, it means that there is a store (or call) between
+  /// the instruction's location and its intended destination.
   bool isSafeToMove(const TargetInstrInfo *TII, bool &SawStore);
 
   //

Modified: llvm/branches/non-call-eh/include/llvm/CodeGen/MachineJumpTableInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/MachineJumpTableInfo.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/MachineJumpTableInfo.h (original)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/MachineJumpTableInfo.h Sun Jul  6 15:45:41 2008
@@ -70,9 +70,9 @@
   bool ReplaceMBBInJumpTables(MachineBasicBlock *Old, MachineBasicBlock *New) {
     assert(Old != New && "Not making a change?");
     bool MadeChange = false;
-    for (unsigned i = 0, e = JumpTables.size(); i != e; ++i) {
+    for (size_t i = 0, e = JumpTables.size(); i != e; ++i) {
       MachineJumpTableEntry &JTE = JumpTables[i];
-      for (unsigned j = 0, e = JTE.MBBs.size(); j != e; ++j)
+      for (size_t j = 0, e = JTE.MBBs.size(); j != e; ++j)
         if (JTE.MBBs[j] == Old) {
           JTE.MBBs[j] = New;
           MadeChange = true;

Modified: llvm/branches/non-call-eh/include/llvm/CodeGen/MachineLoopInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/MachineLoopInfo.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/MachineLoopInfo.h (original)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/MachineLoopInfo.h Sun Jul  6 15:45:41 2008
@@ -187,7 +187,4 @@
 
 } // End llvm namespace
 
-// Make sure that any clients of this file link in LoopInfo.cpp
-FORCE_DEFINING_FILE_TO_BE_LINKED(MachineLoopInfo)
-
 #endif

Modified: llvm/branches/non-call-eh/include/llvm/CodeGen/MachineModuleInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/MachineModuleInfo.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/MachineModuleInfo.h (original)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/MachineModuleInfo.h Sun Jul  6 15:45:41 2008
@@ -34,6 +34,7 @@
 #include "llvm/Support/Dwarf.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/UniqueVector.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/GlobalValue.h"
@@ -748,14 +749,9 @@
 /// DIDeserializer - This class is responsible for casting GlobalVariables
 /// into DebugInfoDesc objects.
 class DIDeserializer {
-private:
-  std::map<GlobalVariable *, DebugInfoDesc *> GlobalDescs;
-                                        // Previously defined gloabls.
-  
+  // Previously defined gloabls.
+  std::map<GlobalVariable*, DebugInfoDesc*> GlobalDescs;
 public:
-  DIDeserializer() {}
-  ~DIDeserializer() {}
-  
   const std::map<GlobalVariable *, DebugInfoDesc *> &getGlobalDescs() const {
     return GlobalDescs;
   }
@@ -770,27 +766,23 @@
 /// DISerializer - This class is responsible for casting DebugInfoDesc objects
 /// into GlobalVariables.
 class DISerializer {
-private:
   Module *M;                            // Definition space module.
   PointerType *StrPtrTy;                // A "i8*" type.  Created lazily.
   PointerType *EmptyStructPtrTy;        // A "{ }*" type.  Created lazily.
+
+  // Types per Tag. Created lazily.
   std::map<unsigned, StructType *> TagTypes;
-                                        // Types per Tag.  Created lazily.
-  std::map<DebugInfoDesc *, GlobalVariable *> DescGlobals;
-                                        // Previously defined descriptors.
-  std::map<const std::string, Constant *> StringCache;
-                                        // Previously defined strings.
-                                          
+
+  // Previously defined descriptors.
+  DenseMap<DebugInfoDesc *, GlobalVariable *> DescGlobals;
+
+  // Previously defined strings.
+  DenseMap<const char *, Constant*> StringCache;
 public:
   DISerializer()
-  : M(NULL)
-  , StrPtrTy(NULL)
-  , EmptyStructPtrTy(NULL)
-  , TagTypes()
-  , DescGlobals()
-  , StringCache()
+    : M(NULL), StrPtrTy(NULL), EmptyStructPtrTy(NULL), TagTypes(),
+      DescGlobals(), StringCache()
   {}
-  ~DISerializer() {}
   
   // Accessors
   Module *getModule()        const { return M; };
@@ -824,21 +816,17 @@
 /// DIVerifier - This class is responsible for verifying the given network of
 /// GlobalVariables are valid as DebugInfoDesc objects.
 class DIVerifier {
-private:
   enum {
     Unknown = 0,
     Invalid,
     Valid
   };
-  std::map<GlobalVariable *, unsigned> Validity;// Tracks prior results.
-  std::map<unsigned, unsigned> Counts;  // Count of fields per Tag type.
-  
+  DenseMap<GlobalVariable *, unsigned> Validity; // Tracks prior results.
+  std::map<unsigned, unsigned> Counts; // Count of fields per Tag type.
 public:
   DIVerifier()
-  : Validity()
-  , Counts()
+    : Validity(), Counts()
   {}
-  ~DIVerifier() {}
   
   /// Verify - Return true if the GlobalVariable appears to be a valid
   /// serialization of a DebugInfoDesc.
@@ -854,12 +842,10 @@
 /// SourceLineInfo - This class is used to record source line correspondence.
 ///
 class SourceLineInfo {
-private:
   unsigned Line;                        // Source line number.
   unsigned Column;                      // Source column.
   unsigned SourceID;                    // Source ID number.
   unsigned LabelID;                     // Label in code ID number.
-
 public:
   SourceLineInfo(unsigned L, unsigned C, unsigned S, unsigned I)
   : Line(L), Column(C), SourceID(S), LabelID(I) {}
@@ -875,10 +861,8 @@
 /// SourceFileInfo - This class is used to track source information.
 ///
 class SourceFileInfo {
-private:
   unsigned DirectoryID;                 // Directory ID number.
   std::string Name;                     // File name (not including directory.)
-  
 public:
   SourceFileInfo(unsigned D, const std::string &N) : DirectoryID(D), Name(N) {}
             
@@ -1100,7 +1084,7 @@
   /// NextLabelID - Return the next unique label id.
   ///
   unsigned NextLabelID() {
-    unsigned ID = LabelIDList.size() + 1;
+    unsigned ID = (unsigned)LabelIDList.size() + 1;
     LabelIDList.push_back(ID);
     return ID;
   }
@@ -1168,16 +1152,17 @@
   
   /// getGlobalVariablesUsing - Return all of the GlobalVariables that use the
   /// named GlobalVariable.
-  std::vector<GlobalVariable*>
-  getGlobalVariablesUsing(Module &M, const std::string &RootName);
+  void getGlobalVariablesUsing(Module &M, const std::string &RootName,
+                               std::vector<GlobalVariable*> &Result);
 
   /// getAnchoredDescriptors - Return a vector of anchored debug descriptors.
   ///
-  template <class T>std::vector<T *> getAnchoredDescriptors(Module &M) {
+  template <class T>
+  void getAnchoredDescriptors(Module &M, std::vector<T*> &AnchoredDescs) {
     T Desc;
-    std::vector<GlobalVariable *> Globals =
-                             getGlobalVariablesUsing(M, Desc.getAnchorString());
-    std::vector<T *> AnchoredDescs;
+    std::vector<GlobalVariable *> Globals;
+    getGlobalVariablesUsing(M, Desc.getAnchorString(), Globals);
+
     for (unsigned i = 0, N = Globals.size(); i < N; ++i) {
       GlobalVariable *GV = Globals[i];
 
@@ -1187,8 +1172,6 @@
         AnchoredDescs.push_back(cast<T>(DR.Deserialize(GV)));
       }
     }
-
-    return AnchoredDescs;
   }
   
   /// RecordRegionStart - Indicate the start of a region.

Modified: llvm/branches/non-call-eh/include/llvm/CodeGen/MachineOperand.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/MachineOperand.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/MachineOperand.h (original)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/MachineOperand.h Sun Jul  6 15:45:41 2008
@@ -15,7 +15,6 @@
 #define LLVM_CODEGEN_MACHINEOPERAND_H
 
 #include "llvm/Support/DataTypes.h"
-#include <vector>
 #include <cassert>
 #include <iosfwd>
 

Modified: llvm/branches/non-call-eh/include/llvm/CodeGen/MachineRegisterInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/MachineRegisterInfo.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/MachineRegisterInfo.h (original)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/MachineRegisterInfo.h Sun Jul  6 15:45:41 2008
@@ -16,7 +16,7 @@
 
 #include "llvm/Target/TargetRegisterInfo.h"
 #include "llvm/ADT/BitVector.h"
-#include "llvm/ADT/iterator"
+#include "llvm/ADT/iterator.h"
 #include <vector>
 
 namespace llvm {
@@ -90,6 +90,10 @@
   }
   static use_iterator use_end() { return use_iterator(0); }
   
+  /// use_empty - Return true if there are no instructions using the specified
+  /// register.
+  bool use_empty(unsigned RegNo) const { return use_begin(RegNo) == use_end(); }
+
   
   /// replaceRegWith - Replace all instances of FromReg with ToReg in the
   /// machine function.  This is like llvm-level X->replaceAllUsesWith(Y),
@@ -131,6 +135,13 @@
     assert(Reg < VRegInfo.size() && "Invalid vreg!");
     return VRegInfo[Reg].first;
   }
+
+  /// setRegClass - Set the register class of the specified virtual register.
+  void setRegClass(unsigned Reg, const TargetRegisterClass *RC) {
+    Reg -= TargetRegisterInfo::FirstVirtualRegister;
+    assert(Reg < VRegInfo.size() && "Invalid vreg!");
+    VRegInfo[Reg].first = RC;
+  }
   
   /// createVirtualRegister - Create and return a new virtual register in the
   /// function with the specified register class.
@@ -152,7 +163,7 @@
   /// getLastVirtReg - Return the highest currently assigned virtual register.
   ///
   unsigned getLastVirtReg() const {
-    return VRegInfo.size()+TargetRegisterInfo::FirstVirtualRegister-1;
+    return (unsigned)VRegInfo.size()+TargetRegisterInfo::FirstVirtualRegister-1;
   }
   
   

Modified: llvm/branches/non-call-eh/include/llvm/CodeGen/Passes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/Passes.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/Passes.h (original)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/Passes.h Sun Jul  6 15:45:41 2008
@@ -40,18 +40,18 @@
 
   /// MachineLoopInfo pass - This pass is a loop analysis pass.
   /// 
-  extern const PassInfo *MachineLoopInfoID;
+  extern const PassInfo *const MachineLoopInfoID;
 
   /// MachineDominators pass - This pass is a machine dominators analysis pass.
   /// 
-  extern const PassInfo *MachineDominatorsID;
+  extern const PassInfo *const MachineDominatorsID;
 
   /// PHIElimination pass - This pass eliminates machine instruction PHI nodes
   /// by inserting copy instructions.  This destroys SSA information, but is the
   /// desired input for some register allocators.  This pass is "required" by
   /// these register allocator like this: AU.addRequiredID(PHIEliminationID);
   ///
-  extern const PassInfo *PHIEliminationID;
+  extern const PassInfo *const PHIEliminationID;
   
   /// StrongPHIElimination pass - This pass eliminates machine instruction PHI
   /// nodes by inserting copy instructions.  This destroys SSA information, but
@@ -59,17 +59,17 @@
   /// "required" by these register allocator like this:
   ///    AU.addRequiredID(PHIEliminationID);
   ///  This pass is still in development
-  extern const PassInfo *StrongPHIEliminationID;
+  extern const PassInfo *const StrongPHIEliminationID;
 
   /// SimpleRegisterCoalescing pass.  Aggressively coalesces every register
   /// copy it can.
   ///
-  extern const PassInfo *SimpleRegisterCoalescingID;
+  extern const PassInfo *const SimpleRegisterCoalescingID;
 
   /// TwoAddressInstruction pass - This pass reduces two-address instructions to
   /// use two operands. This destroys SSA information but it is desired by
   /// register allocators.
-  extern const PassInfo *TwoAddressInstructionPassID;
+  extern const PassInfo *const TwoAddressInstructionPassID;
 
   /// Creates a register allocator as the user specified on the command line.
   ///
@@ -172,6 +172,9 @@
   /// createMachineSinkingPass - This pass performs sinking on machine
   /// instructions.
   FunctionPass *createMachineSinkingPass();
+
+  /// createStackSlotColoringPass - This pass performs stack slot coloring.
+  FunctionPass *createStackSlotColoringPass();
   
 } // End llvm namespace
 

Modified: llvm/branches/non-call-eh/include/llvm/CodeGen/RuntimeLibcalls.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/RuntimeLibcalls.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/RuntimeLibcalls.h (original)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/RuntimeLibcalls.h Sun Jul  6 15:45:41 2008
@@ -99,6 +99,7 @@
     FPTOSINT_F64_I128,
     FPTOSINT_F80_I64,
     FPTOSINT_F80_I128,
+    FPTOSINT_PPCF128_I32,
     FPTOSINT_PPCF128_I64,
     FPTOSINT_PPCF128_I128,
     FPTOUINT_F32_I32,
@@ -110,6 +111,7 @@
     FPTOUINT_F80_I32,
     FPTOUINT_F80_I64,
     FPTOUINT_F80_I128,
+    FPTOUINT_PPCF128_I32,
     FPTOUINT_PPCF128_I64,
     FPTOUINT_PPCF128_I128,
     SINTTOFP_I32_F32,

Modified: llvm/branches/non-call-eh/include/llvm/CodeGen/SchedGraphCommon.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/SchedGraphCommon.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/SchedGraphCommon.h (original)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/SchedGraphCommon.h Sun Jul  6 15:45:41 2008
@@ -16,7 +16,7 @@
 #define LLVM_CODEGEN_SCHEDGRAPHCOMMON_H
 
 #include "llvm/Value.h"
-#include "llvm/ADT/iterator"
+#include "llvm/ADT/iterator.h"
 #include "llvm/Support/Streams.h"
 #include <vector>
 

Modified: llvm/branches/non-call-eh/include/llvm/CodeGen/ScheduleDAG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/ScheduleDAG.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/ScheduleDAG.h (original)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/ScheduleDAG.h Sun Jul  6 15:45:41 2008
@@ -17,7 +17,6 @@
 
 #include "llvm/CodeGen/MachineBasicBlock.h"
 #include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/ADT/BitVector.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/GraphTraits.h"
 #include "llvm/ADT/SmallSet.h"
@@ -59,26 +58,23 @@
     ///     other instruction is available, issue it first.
     ///  * NoopHazard: issuing this instruction would break the program.  If
     ///     some other instruction can be issued, do so, otherwise issue a noop.
-    virtual HazardType getHazardType(SDNode *Node) {
+    virtual HazardType getHazardType(SDNode *) {
       return NoHazard;
     }
     
     /// EmitInstruction - This callback is invoked when an instruction is
     /// emitted, to advance the hazard state.
-    virtual void EmitInstruction(SDNode *Node) {
-    }
+    virtual void EmitInstruction(SDNode *) {}
     
     /// AdvanceCycle - This callback is invoked when no instructions can be
     /// issued on this cycle without a hazard.  This should increment the
     /// internal state of the hazard recognizer so that previously "Hazard"
     /// instructions will now not be hazards.
-    virtual void AdvanceCycle() {
-    }
+    virtual void AdvanceCycle() {}
     
     /// EmitNoop - This callback is invoked when a noop was added to the
     /// instruction stream.
-    virtual void EmitNoop() {
-    }
+    virtual void EmitNoop() {}
   };
 
   /// SDep - Scheduling dependency. It keeps track of dependent nodes,
@@ -98,8 +94,8 @@
   struct SUnit {
     SDNode *Node;                       // Representative node.
     SmallVector<SDNode*,4> FlaggedNodes;// All nodes flagged to Node.
-    unsigned InstanceNo;                // Instance#. One SDNode can be multiple
-                                        // SUnit due to cloning.
+    SUnit *OrigNode;                    // If not this, the node from which
+                                        // this node was cloned.
     
     // Preds/Succs - The SUnits before/after us in the graph.  The boolean value
     // is true if the edge is a token chain edge, false if it is a value edge. 
@@ -112,6 +108,7 @@
     typedef SmallVector<SDep, 4>::const_iterator const_succ_iterator;
     
     unsigned NodeNum;                   // Entry # of node in the node vector.
+    unsigned NodeQueueId;               // Queue id of node.
     unsigned short Latency;             // Node latency.
     short NumPreds;                     // # of preds.
     short NumSuccs;                     // # of sucss.
@@ -131,7 +128,7 @@
     const TargetRegisterClass *CopySrcRC;
     
     SUnit(SDNode *node, unsigned nodenum)
-      : Node(node), InstanceNo(0), NodeNum(nodenum), Latency(0),
+      : Node(node), OrigNode(0), NodeNum(nodenum), NodeQueueId(0), Latency(0),
         NumPreds(0), NumSuccs(0), NumPredsLeft(0), NumSuccsLeft(0),
         isTwoAddress(false), isCommutable(false), hasPhysRegDefs(false),
         isPending(false), isAvailable(false), isScheduled(false),
@@ -142,7 +139,7 @@
     /// not already.  This returns true if this is a new pred.
     bool addPred(SUnit *N, bool isCtrl, bool isSpecial,
                  unsigned PhyReg = 0, int Cost = 1) {
-      for (unsigned i = 0, e = Preds.size(); i != e; ++i)
+      for (unsigned i = 0, e = (unsigned)Preds.size(); i != e; ++i)
         if (Preds[i].Dep == N &&
             Preds[i].isCtrl == isCtrl && Preds[i].isSpecial == isSpecial)
           return false;
@@ -188,14 +185,14 @@
     }
 
     bool isPred(SUnit *N) {
-      for (unsigned i = 0, e = Preds.size(); i != e; ++i)
+      for (unsigned i = 0, e = (unsigned)Preds.size(); i != e; ++i)
         if (Preds[i].Dep == N)
           return true;
       return false;
     }
     
     bool isSucc(SUnit *N) {
-      for (unsigned i = 0, e = Succs.size(); i != e; ++i)
+      for (unsigned i = 0, e = (unsigned)Succs.size(); i != e; ++i)
         if (Succs[i].Dep == N)
           return true;
       return false;
@@ -217,8 +214,7 @@
   public:
     virtual ~SchedulingPriorityQueue() {}
   
-    virtual void initNodes(DenseMap<SDNode*, std::vector<SUnit*> > &SUMap,
-                           std::vector<SUnit> &SUnits) = 0;
+    virtual void initNodes(std::vector<SUnit> &SUnits) = 0;
     virtual void addNode(const SUnit *SU) = 0;
     virtual void updateNode(const SUnit *SU) = 0;
     virtual void releaseState() = 0;
@@ -233,11 +229,12 @@
     virtual void remove(SUnit *SU) = 0;
 
     /// ScheduledNode - As each node is scheduled, this method is invoked.  This
-    /// allows the priority function to adjust the priority of node that have
-    /// already been emitted.
-    virtual void ScheduledNode(SUnit *Node) {}
+    /// allows the priority function to adjust the priority of related
+    /// unscheduled nodes, for example.
+    ///
+    virtual void ScheduledNode(SUnit *) {}
 
-    virtual void UnscheduledNode(SUnit *Node) {}
+    virtual void UnscheduledNode(SUnit *) {}
   };
 
   class ScheduleDAG {
@@ -253,8 +250,6 @@
     MachineConstantPool *ConstPool;       // Target constant pool
     std::vector<SUnit*> Sequence;         // The schedule. Null SUnit*'s
                                           // represent noop instructions.
-    DenseMap<SDNode*, std::vector<SUnit*> > SUnitMap;
-                                          // SDNode to SUnit mapping (n -> n).
     std::vector<SUnit> SUnits;            // The scheduling units.
     SmallSet<SDNode*, 16> CommuteSet;     // Nodes that should be commuted.
 
@@ -292,7 +287,8 @@
     /// NewSUnit - Creates a new SUnit and return a ptr to it.
     ///
     SUnit *NewSUnit(SDNode *N) {
-      SUnits.push_back(SUnit(N, SUnits.size()));
+      SUnits.push_back(SUnit(N, (unsigned)SUnits.size()));
+      SUnits.back().OrigNode = &SUnits.back();
       return &SUnits.back();
     }
 
@@ -333,7 +329,7 @@
     /// VRBaseMap contains, for each already emitted node, the first virtual
     /// register number for the results of the node.
     ///
-    void EmitNode(SDNode *Node, unsigned InstNo,
+    void EmitNode(SDNode *Node, bool IsClone,
                   DenseMap<SDOperand, unsigned> &VRBaseMap);
     
     /// EmitNoop - Emit a noop instruction.
@@ -344,9 +340,10 @@
 
     void dumpSchedule() const;
 
-    /// Schedule - Order nodes according to selected style.
+    /// Schedule - Order nodes according to selected style, filling
+    /// in the Sequence member.
     ///
-    virtual void Schedule() {}
+    virtual void Schedule() = 0;
 
   private:
     /// EmitSubregNode - Generate machine code for subreg nodes.
@@ -372,7 +369,7 @@
 
     /// EmitCopyFromReg - Generate machine code for an CopyFromReg node or an
     /// implicit physical register output.
-    void EmitCopyFromReg(SDNode *Node, unsigned ResNo, unsigned InstNo,
+    void EmitCopyFromReg(SDNode *Node, unsigned ResNo, bool IsClone,
                          unsigned SrcReg,
                          DenseMap<SDOperand, unsigned> &VRBaseMap);
     
@@ -399,25 +396,29 @@
   /// reduction list scheduler.
   ScheduleDAG* createBURRListDAGScheduler(SelectionDAGISel *IS,
                                           SelectionDAG *DAG,
-                                          MachineBasicBlock *BB);
+                                          MachineBasicBlock *BB,
+                                          bool Fast);
   
   /// createTDRRListDAGScheduler - This creates a top down register usage
   /// reduction list scheduler.
   ScheduleDAG* createTDRRListDAGScheduler(SelectionDAGISel *IS,
                                           SelectionDAG *DAG,
-                                          MachineBasicBlock *BB);
+                                          MachineBasicBlock *BB,
+                                          bool Fast);
   
   /// createTDListDAGScheduler - This creates a top-down list scheduler with
   /// a hazard recognizer.
   ScheduleDAG* createTDListDAGScheduler(SelectionDAGISel *IS,
                                         SelectionDAG *DAG,
-                                        MachineBasicBlock *BB);
+                                        MachineBasicBlock *BB,
+                                        bool Fast);
                                         
   /// createDefaultScheduler - This creates an instruction scheduler appropriate
   /// for the target.
   ScheduleDAG* createDefaultScheduler(SelectionDAGISel *IS,
                                       SelectionDAG *DAG,
-                                      MachineBasicBlock *BB);
+                                      MachineBasicBlock *BB,
+                                      bool Fast);
 
   class SUnitIterator : public forward_iterator<SUnit, ptrdiff_t> {
     SUnit *Node;
@@ -451,7 +452,7 @@
 
     static SUnitIterator begin(SUnit *N) { return SUnitIterator(N, 0); }
     static SUnitIterator end  (SUnit *N) {
-      return SUnitIterator(N, N->Preds.size());
+      return SUnitIterator(N, (unsigned)N->Preds.size());
     }
 
     unsigned getOperand() const { return Operand; }

Modified: llvm/branches/non-call-eh/include/llvm/CodeGen/SchedulerRegistry.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/SchedulerRegistry.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/SchedulerRegistry.h (original)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/SchedulerRegistry.h Sun Jul  6 15:45:41 2008
@@ -35,7 +35,7 @@
 public:
 
   typedef ScheduleDAG *(*FunctionPassCtor)(SelectionDAGISel*, SelectionDAG*,
-                                           MachineBasicBlock*);
+                                        MachineBasicBlock*, bool);
 
   static MachinePassRegistry Registry;
 

Modified: llvm/branches/non-call-eh/include/llvm/CodeGen/SelectionDAG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/SelectionDAG.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/SelectionDAG.h (original)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/SelectionDAG.h Sun Jul  6 15:45:41 2008
@@ -16,13 +16,13 @@
 #define LLVM_CODEGEN_SELECTIONDAG_H
 
 #include "llvm/ADT/FoldingSet.h"
-#include "llvm/ADT/ilist"
+#include "llvm/ADT/StringMap.h"
+#include "llvm/ADT/ilist.h"
 #include "llvm/CodeGen/SelectionDAGNodes.h"
 
 #include <list>
 #include <vector>
 #include <map>
-#include <set>
 #include <string>
 
 namespace llvm {
@@ -32,6 +32,7 @@
   class MachineModuleInfo;
   class MachineFunction;
   class MachineConstantPoolValue;
+  class FunctionLoweringInfo;
 
 /// SelectionDAG class - This is used to represent a portion of an LLVM function
 /// in a low-level Data Dependence DAG representation suitable for instruction
@@ -47,6 +48,7 @@
 class SelectionDAG {
   TargetLowering &TLI;
   MachineFunction &MF;
+  FunctionLoweringInfo &FLI;
   MachineModuleInfo *MMI;
 
   /// Root - The root of the entire DAG.  EntryNode - The starting token.
@@ -60,8 +62,9 @@
   FoldingSet<SDNode> CSEMap;
 
 public:
-  SelectionDAG(TargetLowering &tli, MachineFunction &mf, MachineModuleInfo *mmi)
-  : TLI(tli), MF(mf), MMI(mmi) {
+  SelectionDAG(TargetLowering &tli, MachineFunction &mf, 
+               FunctionLoweringInfo &fli, MachineModuleInfo *mmi)
+  : TLI(tli), MF(mf), FLI(fli), MMI(mmi) {
     EntryNode = Root = getNode(ISD::EntryToken, MVT::Other);
   }
   ~SelectionDAG();
@@ -69,6 +72,7 @@
   MachineFunction &getMachineFunction() const { return MF; }
   const TargetMachine &getTarget() const;
   TargetLowering &getTargetLoweringInfo() const { return TLI; }
+  FunctionLoweringInfo &getFunctionLoweringInfo() const { return FLI; }
   MachineModuleInfo *getMachineModuleInfo() const { return MMI; }
 
   /// viewGraph - Pop up a GraphViz/gv window with the DAG rendered using 'dot'.
@@ -101,6 +105,7 @@
   typedef ilist<SDNode>::iterator allnodes_iterator;
   allnodes_iterator allnodes_begin() { return AllNodes.begin(); }
   allnodes_iterator allnodes_end() { return AllNodes.end(); }
+  ilist<SDNode>::size_type allnodes_size() const { return AllNodes.size(); }
   
   /// getRoot - Return the root tag of the SelectionDAG.
   ///
@@ -145,83 +150,82 @@
 
   /// getVTList - Return an SDVTList that represents the list of values
   /// specified.
-  SDVTList getVTList(MVT::ValueType VT);
-  SDVTList getVTList(MVT::ValueType VT1, MVT::ValueType VT2);
-  SDVTList getVTList(MVT::ValueType VT1, MVT::ValueType VT2,MVT::ValueType VT3);
-  SDVTList getVTList(const MVT::ValueType *VTs, unsigned NumVTs);
+  SDVTList getVTList(MVT VT);
+  SDVTList getVTList(MVT VT1, MVT VT2);
+  SDVTList getVTList(MVT VT1, MVT VT2, MVT VT3);
+  SDVTList getVTList(const MVT *VTs, unsigned NumVTs);
   
   /// getNodeValueTypes - These are obsolete, use getVTList instead.
-  const MVT::ValueType *getNodeValueTypes(MVT::ValueType VT) {
+  const MVT *getNodeValueTypes(MVT VT) {
     return getVTList(VT).VTs;
   }
-  const MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1, 
-                                          MVT::ValueType VT2) {
+  const MVT *getNodeValueTypes(MVT VT1, MVT VT2) {
     return getVTList(VT1, VT2).VTs;
   }
-  const MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1,MVT::ValueType VT2,
-                                          MVT::ValueType VT3) {
+  const MVT *getNodeValueTypes(MVT VT1, MVT VT2, MVT VT3) {
     return getVTList(VT1, VT2, VT3).VTs;
   }
-  const MVT::ValueType *getNodeValueTypes(std::vector<MVT::ValueType> &VTList) {
-    return getVTList(&VTList[0], VTList.size()).VTs;
+  const MVT *getNodeValueTypes(std::vector<MVT> &vtList) {
+    return getVTList(&vtList[0], (unsigned)vtList.size()).VTs;
   }
   
   
   //===--------------------------------------------------------------------===//
   // Node creation methods.
   //
-  SDOperand getString(const std::string &Val);
-  SDOperand getConstant(uint64_t Val, MVT::ValueType VT, bool isTarget = false);
-  SDOperand getConstant(const APInt &Val, MVT::ValueType VT, bool isTarget = false);
+  SDOperand getConstant(uint64_t Val, MVT VT, bool isTarget = false);
+  SDOperand getConstant(const APInt &Val, MVT VT, bool isTarget = false);
   SDOperand getIntPtrConstant(uint64_t Val, bool isTarget = false);
-  SDOperand getTargetConstant(uint64_t Val, MVT::ValueType VT) {
+  SDOperand getTargetConstant(uint64_t Val, MVT VT) {
     return getConstant(Val, VT, true);
   }
-  SDOperand getTargetConstant(const APInt &Val, MVT::ValueType VT) {
+  SDOperand getTargetConstant(const APInt &Val, MVT VT) {
     return getConstant(Val, VT, true);
   }
-  SDOperand getConstantFP(double Val, MVT::ValueType VT, bool isTarget = false);
-  SDOperand getConstantFP(const APFloat& Val, MVT::ValueType VT, 
-                          bool isTarget = false);
-  SDOperand getTargetConstantFP(double Val, MVT::ValueType VT) {
+  SDOperand getConstantFP(double Val, MVT VT, bool isTarget = false);
+  SDOperand getConstantFP(const APFloat& Val, MVT VT, bool isTarget = false);
+  SDOperand getTargetConstantFP(double Val, MVT VT) {
     return getConstantFP(Val, VT, true);
   }
-  SDOperand getTargetConstantFP(const APFloat& Val, MVT::ValueType VT) {
+  SDOperand getTargetConstantFP(const APFloat& Val, MVT VT) {
     return getConstantFP(Val, VT, true);
   }
-  SDOperand getGlobalAddress(const GlobalValue *GV, MVT::ValueType VT,
+  SDOperand getGlobalAddress(const GlobalValue *GV, MVT VT,
                              int offset = 0, bool isTargetGA = false);
-  SDOperand getTargetGlobalAddress(const GlobalValue *GV, MVT::ValueType VT,
+  SDOperand getTargetGlobalAddress(const GlobalValue *GV, MVT VT,
                                    int offset = 0) {
     return getGlobalAddress(GV, VT, offset, true);
   }
-  SDOperand getFrameIndex(int FI, MVT::ValueType VT, bool isTarget = false);
-  SDOperand getTargetFrameIndex(int FI, MVT::ValueType VT) {
+  SDOperand getFrameIndex(int FI, MVT VT, bool isTarget = false);
+  SDOperand getTargetFrameIndex(int FI, MVT VT) {
     return getFrameIndex(FI, VT, true);
   }
-  SDOperand getJumpTable(int JTI, MVT::ValueType VT, bool isTarget = false);
-  SDOperand getTargetJumpTable(int JTI, MVT::ValueType VT) {
+  SDOperand getJumpTable(int JTI, MVT VT, bool isTarget = false);
+  SDOperand getTargetJumpTable(int JTI, MVT VT) {
     return getJumpTable(JTI, VT, true);
   }
-  SDOperand getConstantPool(Constant *C, MVT::ValueType VT,
+  SDOperand getConstantPool(Constant *C, MVT VT,
                             unsigned Align = 0, int Offs = 0, bool isT=false);
-  SDOperand getTargetConstantPool(Constant *C, MVT::ValueType VT,
+  SDOperand getTargetConstantPool(Constant *C, MVT VT,
                                   unsigned Align = 0, int Offset = 0) {
     return getConstantPool(C, VT, Align, Offset, true);
   }
-  SDOperand getConstantPool(MachineConstantPoolValue *C, MVT::ValueType VT,
+  SDOperand getConstantPool(MachineConstantPoolValue *C, MVT VT,
                             unsigned Align = 0, int Offs = 0, bool isT=false);
   SDOperand getTargetConstantPool(MachineConstantPoolValue *C,
-                                  MVT::ValueType VT, unsigned Align = 0,
+                                  MVT VT, unsigned Align = 0,
                                   int Offset = 0) {
     return getConstantPool(C, VT, Align, Offset, true);
   }
   SDOperand getBasicBlock(MachineBasicBlock *MBB);
-  SDOperand getExternalSymbol(const char *Sym, MVT::ValueType VT);
-  SDOperand getTargetExternalSymbol(const char *Sym, MVT::ValueType VT);
+  SDOperand getExternalSymbol(const char *Sym, MVT VT);
+  SDOperand getTargetExternalSymbol(const char *Sym, MVT VT);
   SDOperand getArgFlags(ISD::ArgFlagsTy Flags);
-  SDOperand getValueType(MVT::ValueType);
-  SDOperand getRegister(unsigned Reg, MVT::ValueType VT);
+  SDOperand getValueType(MVT);
+  SDOperand getRegister(unsigned Reg, MVT VT);
+  SDOperand getDbgStopPoint(SDOperand Root, unsigned Line, unsigned Col,
+                            const CompileUnitDesc *CU);
+  SDOperand getLabel(unsigned Opcode, SDOperand Root, unsigned LabelID);
 
   SDOperand getCopyToReg(SDOperand Chain, unsigned Reg, SDOperand N) {
     return getNode(ISD::CopyToReg, MVT::Other, Chain,
@@ -233,7 +237,7 @@
   // null) and that there should be a flag result.
   SDOperand getCopyToReg(SDOperand Chain, unsigned Reg, SDOperand N,
                          SDOperand Flag) {
-    const MVT::ValueType *VTs = getNodeValueTypes(MVT::Other, MVT::Flag);
+    const MVT *VTs = getNodeValueTypes(MVT::Other, MVT::Flag);
     SDOperand Ops[] = { Chain, getRegister(Reg, N.getValueType()), N, Flag };
     return getNode(ISD::CopyToReg, VTs, 2, Ops, Flag.Val ? 4 : 3);
   }
@@ -241,13 +245,13 @@
   // Similar to last getCopyToReg() except parameter Reg is a SDOperand
   SDOperand getCopyToReg(SDOperand Chain, SDOperand Reg, SDOperand N,
                          SDOperand Flag) {
-    const MVT::ValueType *VTs = getNodeValueTypes(MVT::Other, MVT::Flag);
+    const MVT *VTs = getNodeValueTypes(MVT::Other, MVT::Flag);
     SDOperand Ops[] = { Chain, Reg, N, Flag };
     return getNode(ISD::CopyToReg, VTs, 2, Ops, Flag.Val ? 4 : 3);
   }
   
-  SDOperand getCopyFromReg(SDOperand Chain, unsigned Reg, MVT::ValueType VT) {
-    const MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other);
+  SDOperand getCopyFromReg(SDOperand Chain, unsigned Reg, MVT VT) {
+    const MVT *VTs = getNodeValueTypes(VT, MVT::Other);
     SDOperand Ops[] = { Chain, getRegister(Reg, VT) };
     return getNode(ISD::CopyFromReg, VTs, 2, Ops, 2);
   }
@@ -255,9 +259,9 @@
   // This version of the getCopyFromReg method takes an extra operand, which
   // indicates that there is potentially an incoming flag value (if Flag is not
   // null) and that there should be a flag result.
-  SDOperand getCopyFromReg(SDOperand Chain, unsigned Reg, MVT::ValueType VT,
+  SDOperand getCopyFromReg(SDOperand Chain, unsigned Reg, MVT VT,
                            SDOperand Flag) {
-    const MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other, MVT::Flag);
+    const MVT *VTs = getNodeValueTypes(VT, MVT::Other, MVT::Flag);
     SDOperand Ops[] = { Chain, getRegister(Reg, VT), Flag };
     return getNode(ISD::CopyFromReg, VTs, 3, Ops, Flag.Val ? 3 : 2);
   }
@@ -266,12 +270,12 @@
 
   /// getZeroExtendInReg - Return the expression required to zero extend the Op
   /// value assuming it was the smaller SrcTy value.
-  SDOperand getZeroExtendInReg(SDOperand Op, MVT::ValueType SrcTy);
+  SDOperand getZeroExtendInReg(SDOperand Op, MVT SrcTy);
   
   /// getCALLSEQ_START - Return a new CALLSEQ_START node, which always must have
   /// a flag result (to ensure it's not CSE'd).
   SDOperand getCALLSEQ_START(SDOperand Chain, SDOperand Op) {
-    const MVT::ValueType *VTs = getNodeValueTypes(MVT::Other, MVT::Flag);
+    const MVT *VTs = getNodeValueTypes(MVT::Other, MVT::Flag);
     SDOperand Ops[] = { Chain,  Op };
     return getNode(ISD::CALLSEQ_START, VTs, 2, Ops, 2);
   }
@@ -287,32 +291,29 @@
     Ops.push_back(Op2);
     Ops.push_back(InFlag);
     return getNode(ISD::CALLSEQ_END, NodeTys, &Ops[0],
-                   Ops.size() - (InFlag.Val == 0 ? 1 : 0));
+                   (unsigned)Ops.size() - (InFlag.Val == 0 ? 1 : 0));
   }
 
   /// getNode - Gets or creates the specified node.
   ///
-  SDOperand getNode(unsigned Opcode, MVT::ValueType VT);
-  SDOperand getNode(unsigned Opcode, MVT::ValueType VT, SDOperand N);
-  SDOperand getNode(unsigned Opcode, MVT::ValueType VT,
-                    SDOperand N1, SDOperand N2);
-  SDOperand getNode(unsigned Opcode, MVT::ValueType VT,
+  SDOperand getNode(unsigned Opcode, MVT VT);
+  SDOperand getNode(unsigned Opcode, MVT VT, SDOperand N);
+  SDOperand getNode(unsigned Opcode, MVT VT, SDOperand N1, SDOperand N2);
+  SDOperand getNode(unsigned Opcode, MVT VT,
                     SDOperand N1, SDOperand N2, SDOperand N3);
-  SDOperand getNode(unsigned Opcode, MVT::ValueType VT,
+  SDOperand getNode(unsigned Opcode, MVT VT,
                     SDOperand N1, SDOperand N2, SDOperand N3, SDOperand N4);
-  SDOperand getNode(unsigned Opcode, MVT::ValueType VT,
+  SDOperand getNode(unsigned Opcode, MVT VT,
                     SDOperand N1, SDOperand N2, SDOperand N3, SDOperand N4,
                     SDOperand N5);
-  SDOperand getNode(unsigned Opcode, MVT::ValueType VT,
+  SDOperand getNode(unsigned Opcode, MVT VT, SDOperandPtr Ops, unsigned NumOps);
+  SDOperand getNode(unsigned Opcode, std::vector<MVT> &ResultTys,
                     SDOperandPtr Ops, unsigned NumOps);
-  SDOperand getNode(unsigned Opcode, std::vector<MVT::ValueType> &ResultTys,
-                    SDOperandPtr Ops, unsigned NumOps);
-  SDOperand getNode(unsigned Opcode, const MVT::ValueType *VTs, unsigned NumVTs,
+  SDOperand getNode(unsigned Opcode, const MVT *VTs, unsigned NumVTs,
                     SDOperandPtr Ops, unsigned NumOps);
   SDOperand getNode(unsigned Opcode, SDVTList VTs);
   SDOperand getNode(unsigned Opcode, SDVTList VTs, SDOperand N);
-  SDOperand getNode(unsigned Opcode, SDVTList VTs,
-                    SDOperand N1, SDOperand N2);
+  SDOperand getNode(unsigned Opcode, SDVTList VTs, SDOperand N1, SDOperand N2);
   SDOperand getNode(unsigned Opcode, SDVTList VTs,
                     SDOperand N1, SDOperand N2, SDOperand N3);
   SDOperand getNode(unsigned Opcode, SDVTList VTs,
@@ -326,26 +327,34 @@
   SDOperand getMemcpy(SDOperand Chain, SDOperand Dst, SDOperand Src,
                       SDOperand Size, unsigned Align,
                       bool AlwaysInline,
-                      const Value *DstSV, uint64_t DstOff,
-                      const Value *SrcSV, uint64_t SrcOff);
+                      const Value *DstSV, uint64_t DstSVOff,
+                      const Value *SrcSV, uint64_t SrcSVOff);
 
   SDOperand getMemmove(SDOperand Chain, SDOperand Dst, SDOperand Src,
-                      SDOperand Size, unsigned Align,
-                      const Value *DstSV, uint64_t DstOff,
-                      const Value *SrcSV, uint64_t SrcOff);
+                       SDOperand Size, unsigned Align,
+                       const Value *DstSV, uint64_t DstOSVff,
+                       const Value *SrcSV, uint64_t SrcSVOff);
 
   SDOperand getMemset(SDOperand Chain, SDOperand Dst, SDOperand Src,
                       SDOperand Size, unsigned Align,
-                      const Value *DstSV, uint64_t DstOff);
+                      const Value *DstSV, uint64_t DstSVOff);
 
   /// getSetCC - Helper function to make it easier to build SetCC's if you just
   /// have an ISD::CondCode instead of an SDOperand.
   ///
-  SDOperand getSetCC(MVT::ValueType VT, SDOperand LHS, SDOperand RHS,
+  SDOperand getSetCC(MVT VT, SDOperand LHS, SDOperand RHS,
                      ISD::CondCode Cond) {
     return getNode(ISD::SETCC, VT, LHS, RHS, getCondCode(Cond));
   }
 
+  /// getVSetCC - Helper function to make it easier to build VSetCC's nodes
+  /// if you just have an ISD::CondCode instead of an SDOperand.
+  ///
+  SDOperand getVSetCC(MVT VT, SDOperand LHS, SDOperand RHS,
+                      ISD::CondCode Cond) {
+    return getNode(ISD::VSETCC, VT, LHS, RHS, getCondCode(Cond));
+  }
+
   /// getSelectCC - Helper function to make it easier to build SelectCC's if you
   /// just have an ISD::CondCode instead of an SDOperand.
   ///
@@ -357,35 +366,52 @@
   
   /// getVAArg - VAArg produces a result and token chain, and takes a pointer
   /// and a source value as input.
-  SDOperand getVAArg(MVT::ValueType VT, SDOperand Chain, SDOperand Ptr,
+  SDOperand getVAArg(MVT VT, SDOperand Chain, SDOperand Ptr,
                      SDOperand SV);
 
   /// getAtomic - Gets a node for an atomic op, produces result and chain, takes
-  // 3 operands
+  /// 3 operands
   SDOperand getAtomic(unsigned Opcode, SDOperand Chain, SDOperand Ptr, 
-                      SDOperand Cmp, SDOperand Swp, MVT::ValueType VT);
+                      SDOperand Cmp, SDOperand Swp, const Value* PtrVal,
+                      unsigned Alignment=0);
 
   /// getAtomic - Gets a node for an atomic op, produces result and chain, takes
-  // 2 operands
+  /// 2 operands
   SDOperand getAtomic(unsigned Opcode, SDOperand Chain, SDOperand Ptr, 
-                      SDOperand Val, MVT::ValueType VT);
+                      SDOperand Val, const Value* PtrVal,
+                      unsigned Alignment = 0);
+
+  /// getMergeValues - Create a MERGE_VALUES node from the given operands.
+  /// Allowed to return something different (and simpler) if Simplify is true.
+  SDOperand getMergeValues(SDOperandPtr Ops, unsigned NumOps,
+                           bool Simplify = true);
+
+  /// getMergeValues - Create a MERGE_VALUES node from the given types and ops.
+  /// Allowed to return something different (and simpler) if Simplify is true.
+  /// May be faster than the above version if VTs is known and NumOps is large.
+  SDOperand getMergeValues(SDVTList VTs, SDOperandPtr Ops, unsigned NumOps,
+                           bool Simplify = true) {
+    if (Simplify && NumOps == 1)
+      return Ops[0];
+    return getNode(ISD::MERGE_VALUES, VTs, Ops, NumOps);
+  }
 
   /// getLoad - Loads are not normal binary operators: their result type is not
   /// determined by their operands, and they produce a value AND a token chain.
   ///
-  SDOperand getLoad(MVT::ValueType VT, SDOperand Chain, SDOperand Ptr,
+  SDOperand getLoad(MVT VT, SDOperand Chain, SDOperand Ptr,
                     const Value *SV, int SVOffset, bool isVolatile=false,
                     unsigned Alignment=0);
-  SDOperand getExtLoad(ISD::LoadExtType ExtType, MVT::ValueType VT,
+  SDOperand getExtLoad(ISD::LoadExtType ExtType, MVT VT,
                        SDOperand Chain, SDOperand Ptr, const Value *SV,
-                       int SVOffset, MVT::ValueType EVT, bool isVolatile=false,
+                       int SVOffset, MVT EVT, bool isVolatile=false,
                        unsigned Alignment=0);
   SDOperand getIndexedLoad(SDOperand OrigLoad, SDOperand Base,
                            SDOperand Offset, ISD::MemIndexedMode AM);
   SDOperand getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType,
-                    MVT::ValueType VT, SDOperand Chain,
+                    MVT VT, SDOperand Chain,
                     SDOperand Ptr, SDOperand Offset,
-                    const Value *SV, int SVOffset, MVT::ValueType EVT,
+                    const Value *SV, int SVOffset, MVT EVT,
                     bool isVolatile=false, unsigned Alignment=0);
 
   /// getStore - Helper function to build ISD::STORE nodes.
@@ -394,7 +420,7 @@
                      const Value *SV, int SVOffset, bool isVolatile=false,
                      unsigned Alignment=0);
   SDOperand getTruncStore(SDOperand Chain, SDOperand Val, SDOperand Ptr,
-                          const Value *SV, int SVOffset, MVT::ValueType TVT,
+                          const Value *SV, int SVOffset, MVT TVT,
                           bool isVolatile=false, unsigned Alignment=0);
   SDOperand getIndexedStore(SDOperand OrigStoe, SDOperand Base,
                            SDOperand Offset, ISD::MemIndexedMode AM);
@@ -427,20 +453,27 @@
   /// operands.  Note that target opcodes are stored as
   /// ISD::BUILTIN_OP_END+TargetOpcode in the node opcode field.  The 0th value
   /// of the resultant node is returned.
-  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT);
-  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, 
-                       SDOperand Op1);
-  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, 
+  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT);
+  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT, SDOperand Op1);
+  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT,
                        SDOperand Op1, SDOperand Op2);
-  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, 
+  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT,
                        SDOperand Op1, SDOperand Op2, SDOperand Op3);
-  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
+  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT,
+                       SDOperandPtr Ops, unsigned NumOps);
+  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT1, MVT VT2);
+  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT1,
+                       MVT VT2, SDOperandPtr Ops, unsigned NumOps);
+  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT1,
+                       MVT VT2, MVT VT3, SDOperandPtr Ops, unsigned NumOps);
+  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT1,
+                       MVT VT2, SDOperand Op1);
+  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT1,
+                       MVT VT2, SDOperand Op1, SDOperand Op2);
+  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT VT1,
+                       MVT VT2, SDOperand Op1, SDOperand Op2, SDOperand Op3);
+  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, SDVTList VTs,
                        SDOperandPtr Ops, unsigned NumOps);
-  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, 
-                       MVT::ValueType VT2, SDOperand Op1, SDOperand Op2);
-  SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1,
-                       MVT::ValueType VT2, SDOperand Op1, SDOperand Op2,
-                       SDOperand Op3);
 
 
   /// getTargetNode - These are used for target selectors to create a new node
@@ -449,41 +482,30 @@
   /// Note that getTargetNode returns the resultant node.  If there is already a
   /// node of the specified opcode and operands, it returns that node instead of
   /// the current one.
-  SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT);
-  SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT,
-                        SDOperand Op1);
-  SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT,
-                        SDOperand Op1, SDOperand Op2);
-  SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT,
+  SDNode *getTargetNode(unsigned Opcode, MVT VT);
+  SDNode *getTargetNode(unsigned Opcode, MVT VT, SDOperand Op1);
+  SDNode *getTargetNode(unsigned Opcode, MVT VT, SDOperand Op1, SDOperand Op2);
+  SDNode *getTargetNode(unsigned Opcode, MVT VT,
                         SDOperand Op1, SDOperand Op2, SDOperand Op3);
-  SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT,
+  SDNode *getTargetNode(unsigned Opcode, MVT VT,
                         SDOperandPtr Ops, unsigned NumOps);
-  SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
-                        MVT::ValueType VT2);
-  SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
-                        MVT::ValueType VT2, SDOperand Op1);
-  SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
-                        MVT::ValueType VT2, SDOperand Op1, SDOperand Op2);
-  SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
-                        MVT::ValueType VT2, SDOperand Op1, SDOperand Op2,
-                        SDOperand Op3);
-  SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, 
-                        MVT::ValueType VT2,
+  SDNode *getTargetNode(unsigned Opcode, MVT VT1, MVT VT2);
+  SDNode *getTargetNode(unsigned Opcode, MVT VT1, MVT VT2, SDOperand Op1);
+  SDNode *getTargetNode(unsigned Opcode, MVT VT1,
+                        MVT VT2, SDOperand Op1, SDOperand Op2);
+  SDNode *getTargetNode(unsigned Opcode, MVT VT1,
+                        MVT VT2, SDOperand Op1, SDOperand Op2, SDOperand Op3);
+  SDNode *getTargetNode(unsigned Opcode, MVT VT1, MVT VT2,
                         SDOperandPtr Ops, unsigned NumOps);
-  SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
-                        MVT::ValueType VT2, MVT::ValueType VT3,
+  SDNode *getTargetNode(unsigned Opcode, MVT VT1, MVT VT2, MVT VT3,
                         SDOperand Op1, SDOperand Op2);
-  SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
-                        MVT::ValueType VT2, MVT::ValueType VT3,
+  SDNode *getTargetNode(unsigned Opcode, MVT VT1, MVT VT2, MVT VT3,
                         SDOperand Op1, SDOperand Op2, SDOperand Op3);
-  SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, 
-                        MVT::ValueType VT2, MVT::ValueType VT3,
+  SDNode *getTargetNode(unsigned Opcode, MVT VT1, MVT VT2, MVT VT3,
                         SDOperandPtr Ops, unsigned NumOps);
-  SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1, 
-                        MVT::ValueType VT2, MVT::ValueType VT3,
-                        MVT::ValueType VT4,
+  SDNode *getTargetNode(unsigned Opcode, MVT VT1, MVT VT2, MVT VT3, MVT VT4,
                         SDOperandPtr Ops, unsigned NumOps);
-  SDNode *getTargetNode(unsigned Opcode, std::vector<MVT::ValueType> &ResultTys,
+  SDNode *getTargetNode(unsigned Opcode, std::vector<MVT> &ResultTys,
                         SDOperandPtr Ops, unsigned NumOps);
 
   /// getNodeIfExists - Get the specified node if it's already available, or
@@ -497,7 +519,12 @@
   class DAGUpdateListener {
   public:
     virtual ~DAGUpdateListener();
-    virtual void NodeDeleted(SDNode *N) = 0;
+
+    /// NodeDeleted - The node N that was deleted and, if E is not null, an
+    /// equivalent node E that replaced it.
+    virtual void NodeDeleted(SDNode *N, SDNode *E) = 0;
+
+    /// NodeUpdated - The node N that was updated.
     virtual void NodeUpdated(SDNode *N) = 0;
   };
   
@@ -562,11 +589,12 @@
   void dump() const;
 
   /// CreateStackTemporary - Create a stack temporary, suitable for holding the
-  /// specified value type.
-  SDOperand CreateStackTemporary(MVT::ValueType VT);
+  /// specified value type.  If minAlign is specified, the slot size will have
+  /// at least that alignment.
+  SDOperand CreateStackTemporary(MVT VT, unsigned minAlign = 1);
   
   /// FoldSetCC - Constant fold a setcc to true or false.
-  SDOperand FoldSetCC(MVT::ValueType VT, SDOperand N1,
+  SDOperand FoldSetCC(MVT VT, SDOperand N1,
                       SDOperand N2, ISD::CondCode Cond);
   
   /// SignBitIsZero - Return true if the sign bit of Op is known to be zero.  We
@@ -599,6 +627,10 @@
   /// isVerifiedDebugInfoDesc - Returns true if the specified SDOperand has
   /// been verified as a debug information descriptor.
   bool isVerifiedDebugInfoDesc(SDOperand Op) const;
+
+  /// getShuffleScalarElt - Returns the scalar element that will make up the ith
+  /// element of the result of the vector shuffle.
+  SDOperand getShuffleScalarElt(const SDNode *N, unsigned Idx);
   
 private:
   void RemoveNodeFromCSEMaps(SDNode *N);
@@ -612,16 +644,15 @@
   void DeleteNodeNotInCSEMaps(SDNode *N);
   
   // List of non-single value types.
-  std::list<std::vector<MVT::ValueType> > VTList;
+  std::list<std::vector<MVT> > VTList;
   
   // Maps to auto-CSE operations.
   std::vector<CondCodeSDNode*> CondCodeNodes;
 
   std::vector<SDNode*> ValueTypeNodes;
-  std::map<MVT::ValueType, SDNode*> ExtendedValueTypeNodes;
-  std::map<std::string, SDNode*> ExternalSymbols;
-  std::map<std::string, SDNode*> TargetExternalSymbols;
-  std::map<std::string, StringSDNode*> StringNodes;
+  std::map<MVT, SDNode*, MVT::compareRawBits> ExtendedValueTypeNodes;
+  StringMap<SDNode*> ExternalSymbols;
+  StringMap<SDNode*> TargetExternalSymbols;
 };
 
 template <> struct GraphTraits<SelectionDAG*> : public GraphTraits<SDNode*> {

Modified: llvm/branches/non-call-eh/include/llvm/CodeGen/SelectionDAGISel.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/SelectionDAGISel.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/SelectionDAGISel.h (original)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/SelectionDAGISel.h Sun Jul  6 15:45:41 2008
@@ -41,13 +41,13 @@
   SelectionDAG *CurDAG;
   MachineBasicBlock *BB;
   AliasAnalysis *AA;
-  std::vector<SDNode*> TopOrder;
-  unsigned DAGSize;
   CollectorMetadata *GCI;
+  bool FastISel;
+  std::vector<SDNode*> TopOrder;
   static char ID;
 
-  explicit SelectionDAGISel(TargetLowering &tli) : 
-    FunctionPass((intptr_t)&ID), TLI(tli), DAGSize(0), GCI(0) {}
+  explicit SelectionDAGISel(TargetLowering &tli, bool fast = false) : 
+    FunctionPass((intptr_t)&ID), TLI(tli), GCI(0), FastISel(fast), DAGSize(0) {}
   
   TargetLowering &getTargetLowering() { return TLI; }
 
@@ -55,10 +55,12 @@
 
   virtual bool runOnFunction(Function &Fn);
 
-  unsigned MakeReg(MVT::ValueType VT);
+  unsigned MakeReg(MVT VT);
 
   virtual void EmitFunctionEntryCode(Function &Fn, MachineFunction &MF) {}
-  virtual void InstructionSelectBasicBlock(SelectionDAG &SD) = 0;
+  virtual void InstructionSelect(SelectionDAG &SD) = 0;
+  virtual void InstructionSelectPostProcessing(SelectionDAG &DAG) {}
+  
   virtual void SelectRootInit() {
     DAGSize = CurDAG->AssignTopologicalOrder(TopOrder);
   }
@@ -158,11 +160,12 @@
     MachineBasicBlock *Default;
     BitTestInfo Cases;
   };
-protected:
-  /// Pick a safe ordering and emit instructions for each target node in the
-  /// graph.
-  void ScheduleAndEmitDAG(SelectionDAG &DAG);
   
+protected:
+  /// DAGSize - Size of DAG being instruction selected.
+  ///
+  unsigned DAGSize;
+
   /// SelectInlineAsmMemoryOperands - Calls to this are automatically generated
   /// by tblgen.  Others should not call it.
   void SelectInlineAsmMemoryOperands(std::vector<SDOperand> &Ops,
@@ -183,6 +186,12 @@
                          FunctionLoweringInfo &FuncInfo);
   void CodeGenAndEmitDAG(SelectionDAG &DAG);
   void LowerArguments(BasicBlock *BB, SelectionDAGLowering &SDL);
+  
+  void ComputeLiveOutVRegInfo(SelectionDAG &DAG);
+
+  /// Pick a safe ordering and emit instructions for each target node in the
+  /// graph.
+  void ScheduleAndEmitDAG(SelectionDAG &DAG);
 
   /// SwitchCases - Vector of CaseBlock structures used to communicate
   /// SwitchInst code generation information.

Modified: llvm/branches/non-call-eh/include/llvm/CodeGen/SelectionDAGNodes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/SelectionDAGNodes.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/SelectionDAGNodes.h (original)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/SelectionDAGNodes.h Sun Jul  6 15:45:41 2008
@@ -22,7 +22,7 @@
 #include "llvm/Value.h"
 #include "llvm/ADT/FoldingSet.h"
 #include "llvm/ADT/GraphTraits.h"
-#include "llvm/ADT/iterator"
+#include "llvm/ADT/iterator.h"
 #include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/APInt.h"
 #include "llvm/CodeGen/ValueTypes.h"
@@ -37,6 +37,7 @@
 class MachineBasicBlock;
 class MachineConstantPoolValue;
 class SDNode;
+class CompileUnitDesc;
 template <typename T> struct DenseMapInfo;
 template <typename T> struct simplify_type;
 template <typename T> struct ilist_traits;
@@ -48,7 +49,7 @@
 /// SelectionDAG::getVTList(...).
 ///
 struct SDVTList {
-  const MVT::ValueType *VTs;
+  const MVT *VTs;
   unsigned short NumVTs;
 };
 
@@ -82,7 +83,7 @@
     AssertSext, AssertZext,
 
     // Various leaf nodes.
-    STRING, BasicBlock, VALUETYPE, ARG_FLAGS, CONDCODE, Register,
+    BasicBlock, VALUETYPE, ARG_FLAGS, CONDCODE, Register,
     Constant, ConstantFP,
     GlobalAddress, GlobalTLSAddress, FrameIndex,
     JumpTable, ConstantPool, ExternalSymbol,
@@ -193,16 +194,16 @@
     CALL,
 
     // EXTRACT_ELEMENT - This is used to get the lower or upper (determined by
-    // a Constant, which is required to be operand #1) half of the integer value
-    // specified as operand #0.  This is only for use before legalization, for
-    // values that will be broken into multiple registers.
+    // a Constant, which is required to be operand #1) half of the integer or
+    // float value specified as operand #0.  This is only for use before
+    // legalization, for values that will be broken into multiple registers.
     EXTRACT_ELEMENT,
 
     // BUILD_PAIR - This is the opposite of EXTRACT_ELEMENT in some ways.  Given
     // two values of the same integer value type, this produces a value twice as
     // big.  Like EXTRACT_ELEMENT, this can only be used before legalization.
     BUILD_PAIR,
-    
+
     // MERGE_VALUES - This node takes multiple discrete operands and returns
     // them all as its individual results.  This nodes has exactly the same
     // number of inputs and outputs, and is only valid before legalization.
@@ -332,6 +333,14 @@
     // (op #2) as a CondCodeSDNode.
     SETCC,
 
+    // Vector SetCC operator - This evaluates to a vector of integer elements
+    // with the high bit in each element set to true if the comparison is true
+    // and false if the comparison is false.  All other bits in each element 
+    // are undefined.  The operands to this are the left and right operands
+    // to compare (ops #0, and #1) and the condition code to compare them with
+    // (op #2) as a CondCodeSDNode.
+    VSETCC,
+
     // SHL_PARTS/SRA_PARTS/SRL_PARTS - These operators are used for expanded
     // integer shift operations, just like ADD/SUB_PARTS.  The operation
     // ordering is:
@@ -473,14 +482,11 @@
     //   Operand #last: Optional, an incoming flag.
     INLINEASM,
     
-    // LABEL - Represents a label in mid basic block used to track
-    // locations needed for debug and exception handling tables.  This node
-    // returns a chain.
-    //   Operand #0 : input chain.
-    //   Operand #1 : module unique number use to identify the label.
-    //   Operand #2 : 0 indicates a debug label (e.g. stoppoint), 1 indicates
-    //                a EH label, 2 indicates unknown label type.
-    LABEL,
+    // DBG_LABEL, EH_LABEL - Represents a label in mid basic block used to track
+    // locations needed for debug and exception handling tables.  These nodes
+    // take a chain as input and return a chain.
+    DBG_LABEL,
+    EH_LABEL,
 
     // DECLARE - Represents a llvm.dbg.declare intrinsic. It's used to track
     // local variable declarations for debugging information. First operand is
@@ -539,11 +545,11 @@
     // HANDLENODE node - Used as a handle for various purposes.
     HANDLENODE,
 
-    // LOCATION - This node is used to represent a source location for debug
-    // info.  It takes token chain as input, then a line number, then a column
-    // number, then a filename, then a working dir.  It produces a token chain
-    // as output.
-    LOCATION,
+    // DBG_STOPPOINT - This node is used to represent a source location for
+    // debug info.  It takes token chain as input, and carries a line number,
+    // column number, and a pointer to a CompileUnitDesc object identifying
+    // the containing compilation unit.  It produces a token chain as output.
+    DBG_STOPPOINT,
     
     // DEBUG_LOC - This node is used to represent source line information
     // embedded in the code.  It takes a token chain as input, then a line
@@ -576,17 +582,17 @@
     // and produces an output chain.
     MEMBARRIER,
 
-    // Val, OUTCHAIN = ATOMIC_LCS(INCHAIN, ptr, cmp, swap)
+    // Val, OUTCHAIN = ATOMIC_CMP_SWAP(INCHAIN, ptr, cmp, swap)
     // this corresponds to the atomic.lcs intrinsic.
     // cmp is compared to *ptr, and if equal, swap is stored in *ptr.
     // the return is always the original value in *ptr
-    ATOMIC_LCS,
+    ATOMIC_CMP_SWAP,
 
-    // Val, OUTCHAIN = ATOMIC_LAS(INCHAIN, ptr, amt)
+    // Val, OUTCHAIN = ATOMIC_LOAD_ADD(INCHAIN, ptr, amt)
     // this corresponds to the atomic.las intrinsic.
     // *ptr + amt is stored to *ptr atomically.
     // the return is always the original value in *ptr
-    ATOMIC_LAS,
+    ATOMIC_LOAD_ADD,
 
     // Val, OUTCHAIN = ATOMIC_SWAP(INCHAIN, ptr, amt)
     // this corresponds to the atomic.swap intrinsic.
@@ -594,6 +600,25 @@
     // the return is always the original value in *ptr
     ATOMIC_SWAP,
 
+    // Val, OUTCHAIN = ATOMIC_LOAD_SUB(INCHAIN, ptr, amt)
+    // this corresponds to the atomic.lss intrinsic.
+    // *ptr - amt is stored to *ptr atomically.
+    // the return is always the original value in *ptr
+    ATOMIC_LOAD_SUB,
+    
+    // Val, OUTCHAIN = ATOMIC_L[OpName]S(INCHAIN, ptr, amt)
+    // this corresponds to the atomic.[OpName] intrinsic.
+    // op(*ptr, amt) is stored to *ptr atomically.
+    // the return is always the original value in *ptr
+    ATOMIC_LOAD_AND,
+    ATOMIC_LOAD_OR,
+    ATOMIC_LOAD_XOR,
+    ATOMIC_LOAD_NAND,
+    ATOMIC_LOAD_MIN,
+    ATOMIC_LOAD_MAX,
+    ATOMIC_LOAD_UMIN,
+    ATOMIC_LOAD_UMAX,
+    
     // BUILTIN_OP_END - This must be the last enum value in this list.
     BUILTIN_OP_END
   };
@@ -614,8 +639,7 @@
   bool isScalarToVector(const SDNode *N);
 
   /// isDebugLabel - Return true if the specified node represents a debug
-  /// label (i.e. ISD::LABEL or TargetInstrInfo::LABEL node and third operand
-  /// is 0).
+  /// label (i.e. ISD::DBG_LABEL or TargetInstrInfo::DBG_LABEL node).
   bool isDebugLabel(const SDNode *N);
   
   //===--------------------------------------------------------------------===//
@@ -808,12 +832,12 @@
 
   /// getValueType - Return the ValueType of the referenced return value.
   ///
-  inline MVT::ValueType getValueType() const;
+  inline MVT getValueType() const;
 
-  /// getValueSizeInBits - Returns MVT::getSizeInBits(getValueType()).
+  /// getValueSizeInBits - Returns the size of the value in bits.
   ///
   unsigned getValueSizeInBits() const {
-    return MVT::getSizeInBits(getValueType());
+    return getValueType().getSizeInBits();
   }
 
   // Forwarding methods - These forward to the corresponding methods in SDNode.
@@ -972,12 +996,12 @@
 
   SDOperandPtr(SDUse * use_ptr) { 
     ptr = &use_ptr->getSDOperand(); 
-    object_size = sizeof(SDUse); 
+    object_size = (int)sizeof(SDUse); 
   }
 
   SDOperandPtr(const SDOperand * op_ptr) { 
     ptr = op_ptr; 
-    object_size = sizeof(SDOperand); 
+    object_size = (int)sizeof(SDOperand); 
   }
 
   const SDOperand operator *() { return *ptr; }
@@ -1019,22 +1043,22 @@
   
   /// ValueList - The types of the values this node defines.  SDNode's may
   /// define multiple values simultaneously.
-  const MVT::ValueType *ValueList;
+  const MVT *ValueList;
 
   /// NumOperands/NumValues - The number of entries in the Operand/Value list.
   unsigned short NumOperands, NumValues;
   
-  /// Prev/Next pointers - These pointers form the linked list of of the
-  /// AllNodes list in the current DAG.
-  SDNode *Prev, *Next;
-  friend struct ilist_traits<SDNode>;
-
   /// UsesSize - The size of the uses list.
   unsigned UsesSize;
 
   /// Uses - List of uses for this SDNode.
   SDUse *Uses;
 
+  /// Prev/Next pointers - These pointers form the linked list of of the
+  /// AllNodes list in the current DAG.
+  SDNode *Prev, *Next;
+  friend struct ilist_traits<SDNode>;
+
   /// addUse - add SDUse to the list of uses.
   void addUse(SDUse &U) { U.addToList(&Uses); }
 
@@ -1107,7 +1131,7 @@
     /// getOperandNum - Retrive a number of a current operand.
     unsigned getOperandNum() const {
       assert(Op && "Cannot dereference end iterator!");
-      return (Op - Op->getUser()->OperandList);
+      return (unsigned)(Op - Op->getUser()->OperandList);
     }
 
     /// Retrieve a reference to the current operand.
@@ -1190,7 +1214,7 @@
 
   /// getValueType - Return the type of a specified result.
   ///
-  MVT::ValueType getValueType(unsigned ResNo) const {
+  MVT getValueType(unsigned ResNo) const {
     assert(ResNo < NumValues && "Illegal result number!");
     return ValueList[ResNo];
   }
@@ -1198,10 +1222,10 @@
   /// getValueSizeInBits - Returns MVT::getSizeInBits(getValueType(ResNo)).
   ///
   unsigned getValueSizeInBits(unsigned ResNo) const {
-    return MVT::getSizeInBits(getValueType(ResNo));
+    return getValueType(ResNo).getSizeInBits();
   }
 
-  typedef const MVT::ValueType* value_iterator;
+  typedef const MVT* value_iterator;
   value_iterator value_begin() const { return ValueList; }
   value_iterator value_end() const { return ValueList+NumValues; }
 
@@ -1223,8 +1247,8 @@
   
   /// getValueTypeList - Return a pointer to the specified value type.
   ///
-  static const MVT::ValueType *getValueTypeList(MVT::ValueType VT);
-  static SDVTList getSDVTList(MVT::ValueType VT) {
+  static const MVT *getValueTypeList(MVT VT);
+  static SDVTList getSDVTList(MVT VT) {
     SDVTList Ret = { getValueTypeList(VT), 1 };
     return Ret;
   }
@@ -1318,7 +1342,7 @@
 inline unsigned SDOperand::getOpcode() const {
   return Val->getOpcode();
 }
-inline MVT::ValueType SDOperand::getValueType() const {
+inline MVT SDOperand::getValueType() const {
   return Val->getValueType(ResNo);
 }
 inline unsigned SDOperand::getNumOperands() const {
@@ -1395,7 +1419,13 @@
   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
   SDUse Op;
 public:
+  // FIXME: Remove the "noinline" attribute once <rdar://problem/5852746> is
+  // fixed.
+#ifdef __GNUC__
+  explicit __attribute__((__noinline__)) HandleSDNode(SDOperand X)
+#else
   explicit HandleSDNode(SDOperand X)
+#endif
     : SDNode(ISD::HANDLENODE, getSDVTList(MVT::Other)) {
     Op = X;
     InitOperands(&Op, 1);
@@ -1404,56 +1434,127 @@
   SDUse getValue() const { return Op; }
 };
 
-class AtomicSDNode : public SDNode {
+/// Abstact virtual class for operations for memory operations
+class MemSDNode : public SDNode {
   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
-  SDUse Ops[4];
-  MVT::ValueType OrigVT;
+
+private:
+  //! SrcValue - Memory location for alias analysis.
+  const Value *SrcValue;
+
+  //! Alignment - Alignment of memory location in bytes.
+  unsigned Alignment;
+
 public:
+  MemSDNode(unsigned Opc, SDVTList VTs, const Value *srcValue,
+            unsigned alignment)
+    : SDNode(Opc, VTs), SrcValue(srcValue), Alignment(alignment) {}
+  
+  virtual ~MemSDNode() {}
+
+  /// Returns alignment and volatility of the memory access
+  unsigned getAlignment() const { return Alignment; }
+  virtual bool isVolatile() const = 0;
+  
+  /// Returns the SrcValue and offset that describes the location of the access
+  const Value *getSrcValue() const { return SrcValue; }
+  virtual int getSrcValueOffset() const = 0;
+  
+  /// getMemOperand - Return a MachineMemOperand object describing the memory
+  /// reference performed by operation.
+  virtual MachineMemOperand getMemOperand() const = 0;
+
+  // Methods to support isa and dyn_cast
+  static bool classof(const MemSDNode *) { return true; }
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::LOAD  ||
+           N->getOpcode() == ISD::STORE ||
+           N->getOpcode() == ISD::ATOMIC_CMP_SWAP  ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_ADD  ||
+           N->getOpcode() == ISD::ATOMIC_SWAP      ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_SUB  ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_AND  ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_OR   ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_XOR  ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_NAND ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_MIN  ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_MAX  ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_UMIN ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_UMAX;
+  }  
+};
+
+/// Atomic operations node
+class AtomicSDNode : public MemSDNode {
+  virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
+  SDUse Ops[4];
+  
+ public:
+  // Opc:   opcode for atomic
+  // VTL:    value type list
+  // Chain:  memory chain for operaand
+  // Ptr:    address to update as a SDOperand
+  // Cmp:    compare value
+  // Swp:    swap value
+  // SrcVal: address to update as a Value (used for MemOperand)
+  // Align:  alignment of memory
   AtomicSDNode(unsigned Opc, SDVTList VTL, SDOperand Chain, SDOperand Ptr, 
-               SDOperand Cmp, SDOperand Swp, MVT::ValueType VT)
-    : SDNode(Opc, VTL) {
+               SDOperand Cmp, SDOperand Swp, const Value* SrcVal,
+               unsigned Align=0)
+    : MemSDNode(Opc, VTL, SrcVal, Align) {
     Ops[0] = Chain;
     Ops[1] = Ptr;
     Ops[2] = Swp;
     Ops[3] = Cmp;
     InitOperands(Ops, 4);
-    OrigVT=VT;
   }
   AtomicSDNode(unsigned Opc, SDVTList VTL, SDOperand Chain, SDOperand Ptr, 
-               SDOperand Val, MVT::ValueType VT)
-    : SDNode(Opc, VTL) {
+               SDOperand Val, const Value* SrcVal, unsigned Align=0)
+    : MemSDNode(Opc, VTL, SrcVal, Align) {
     Ops[0] = Chain;
     Ops[1] = Ptr;
     Ops[2] = Val;
     InitOperands(Ops, 3);
-    OrigVT=VT;
   }
-  MVT::ValueType getVT() const { return OrigVT; }
-  bool isCompareAndSwap() const { return getOpcode() == ISD::ATOMIC_LCS; }
-};
+  
+  const SDOperand &getChain() const { return getOperand(0); }
+  const SDOperand &getBasePtr() const { return getOperand(1); }
+  const SDOperand &getVal() const { return getOperand(2); }
 
-class StringSDNode : public SDNode {
-  std::string Value;
-  virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
-protected:
-  friend class SelectionDAG;
-  explicit StringSDNode(const std::string &val)
-    : SDNode(ISD::STRING, getSDVTList(MVT::Other)), Value(val) {
-  }
-public:
-  const std::string &getValue() const { return Value; }
-  static bool classof(const StringSDNode *) { return true; }
+  bool isCompareAndSwap() const { return getOpcode() == ISD::ATOMIC_CMP_SWAP; }
+
+  // Implementation for MemSDNode
+  virtual int getSrcValueOffset() const { return 0; }
+  virtual bool isVolatile() const { return true; }   
+  
+  /// getMemOperand - Return a MachineMemOperand object describing the memory
+  /// reference performed by this atomic load/store.
+  virtual MachineMemOperand getMemOperand() const;
+  
+  // Methods to support isa and dyn_cast
+  static bool classof(const AtomicSDNode *) { return true; }
   static bool classof(const SDNode *N) {
-    return N->getOpcode() == ISD::STRING;
+    return N->getOpcode() == ISD::ATOMIC_CMP_SWAP  ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_ADD  ||
+           N->getOpcode() == ISD::ATOMIC_SWAP      ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_SUB  ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_AND  ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_OR   ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_XOR  ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_NAND ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_MIN  ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_MAX  ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_UMIN ||
+           N->getOpcode() == ISD::ATOMIC_LOAD_UMAX;
   }
-};  
+};
 
 class ConstantSDNode : public SDNode {
   APInt Value;
   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
 protected:
   friend class SelectionDAG;
-  ConstantSDNode(bool isTarget, const APInt &val, MVT::ValueType VT)
+  ConstantSDNode(bool isTarget, const APInt &val, MVT VT)
     : SDNode(isTarget ? ISD::TargetConstant : ISD::Constant, getSDVTList(VT)),
       Value(val) {
   }
@@ -1463,13 +1564,13 @@
   uint64_t getValue() const { return Value.getZExtValue(); }
 
   int64_t getSignExtended() const {
-    unsigned Bits = MVT::getSizeInBits(getValueType(0));
+    unsigned Bits = getValueType(0).getSizeInBits();
     return ((int64_t)Value.getZExtValue() << (64-Bits)) >> (64-Bits);
   }
 
   bool isNullValue() const { return Value == 0; }
   bool isAllOnesValue() const {
-    return Value == MVT::getIntVTBitMask(getValueType(0));
+    return Value == getValueType(0).getIntegerVTBitMask();
   }
 
   static bool classof(const ConstantSDNode *) { return true; }
@@ -1484,7 +1585,7 @@
   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
 protected:
   friend class SelectionDAG;
-  ConstantFPSDNode(bool isTarget, const APFloat& val, MVT::ValueType VT)
+  ConstantFPSDNode(bool isTarget, const APFloat& val, MVT VT)
     : SDNode(isTarget ? ISD::TargetConstantFP : ISD::ConstantFP,
              getSDVTList(VT)), Value(val) {
   }
@@ -1510,7 +1611,7 @@
   }
   bool isExactlyValue(const APFloat& V) const;
 
-  bool isValueValidForType(MVT::ValueType VT, const APFloat& Val);
+  bool isValueValidForType(MVT VT, const APFloat& Val);
 
   static bool classof(const ConstantFPSDNode *) { return true; }
   static bool classof(const SDNode *N) {
@@ -1525,8 +1626,7 @@
   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
 protected:
   friend class SelectionDAG;
-  GlobalAddressSDNode(bool isTarget, const GlobalValue *GA, MVT::ValueType VT,
-                      int o = 0);
+  GlobalAddressSDNode(bool isTarget, const GlobalValue *GA, MVT VT, int o = 0);
 public:
 
   GlobalValue *getGlobal() const { return TheGlobal; }
@@ -1546,7 +1646,7 @@
   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
 protected:
   friend class SelectionDAG;
-  FrameIndexSDNode(int fi, MVT::ValueType VT, bool isTarg)
+  FrameIndexSDNode(int fi, MVT VT, bool isTarg)
     : SDNode(isTarg ? ISD::TargetFrameIndex : ISD::FrameIndex, getSDVTList(VT)),
       FI(fi) {
   }
@@ -1566,7 +1666,7 @@
   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
 protected:
   friend class SelectionDAG;
-  JumpTableSDNode(int jti, MVT::ValueType VT, bool isTarg)
+  JumpTableSDNode(int jti, MVT VT, bool isTarg)
     : SDNode(isTarg ? ISD::TargetJumpTable : ISD::JumpTable, getSDVTList(VT)),
       JTI(jti) {
   }
@@ -1591,22 +1691,20 @@
   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
 protected:
   friend class SelectionDAG;
-  ConstantPoolSDNode(bool isTarget, Constant *c, MVT::ValueType VT,
-                     int o=0)
+  ConstantPoolSDNode(bool isTarget, Constant *c, MVT VT, int o=0)
     : SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool,
              getSDVTList(VT)), Offset(o), Alignment(0) {
     assert((int)Offset >= 0 && "Offset is too large");
     Val.ConstVal = c;
   }
-  ConstantPoolSDNode(bool isTarget, Constant *c, MVT::ValueType VT, int o,
-                     unsigned Align)
+  ConstantPoolSDNode(bool isTarget, Constant *c, MVT VT, int o, unsigned Align)
     : SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool, 
              getSDVTList(VT)), Offset(o), Alignment(Align) {
     assert((int)Offset >= 0 && "Offset is too large");
     Val.ConstVal = c;
   }
   ConstantPoolSDNode(bool isTarget, MachineConstantPoolValue *v,
-                     MVT::ValueType VT, int o=0)
+                     MVT VT, int o=0)
     : SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool, 
              getSDVTList(VT)), Offset(o), Alignment(0) {
     assert((int)Offset >= 0 && "Offset is too large");
@@ -1614,7 +1712,7 @@
     Offset |= 1 << (sizeof(unsigned)*8-1);
   }
   ConstantPoolSDNode(bool isTarget, MachineConstantPoolValue *v,
-                     MVT::ValueType VT, int o, unsigned Align)
+                     MVT VT, int o, unsigned Align)
     : SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool,
              getSDVTList(VT)), Offset(o), Alignment(Align) {
     assert((int)Offset >= 0 && "Offset is too large");
@@ -1728,7 +1826,7 @@
   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
 protected:
   friend class SelectionDAG;
-  RegisterSDNode(unsigned reg, MVT::ValueType VT)
+  RegisterSDNode(unsigned reg, MVT VT)
     : SDNode(ISD::Register, getSDVTList(VT)), Reg(reg) {
   }
 public:
@@ -1741,12 +1839,59 @@
   }
 };
 
+class DbgStopPointSDNode : public SDNode {
+  SDUse Chain;
+  unsigned Line;
+  unsigned Column;
+  const CompileUnitDesc *CU;
+  virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
+protected:
+  friend class SelectionDAG;
+  DbgStopPointSDNode(SDOperand ch, unsigned l, unsigned c,
+                     const CompileUnitDesc *cu)
+    : SDNode(ISD::DBG_STOPPOINT, getSDVTList(MVT::Other)),
+      Line(l), Column(c), CU(cu) {
+    Chain = ch;
+    InitOperands(&Chain, 1);
+  }
+public:
+  unsigned getLine() const { return Line; }
+  unsigned getColumn() const { return Column; }
+  const CompileUnitDesc *getCompileUnit() const { return CU; }
+
+  static bool classof(const DbgStopPointSDNode *) { return true; }
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::DBG_STOPPOINT;
+  }
+};
+
+class LabelSDNode : public SDNode {
+  SDUse Chain;
+  unsigned LabelID;
+  virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
+protected:
+  friend class SelectionDAG;
+  LabelSDNode(unsigned NodeTy, SDOperand ch, unsigned id)
+    : SDNode(NodeTy, getSDVTList(MVT::Other)), LabelID(id) {
+    Chain = ch;
+    InitOperands(&Chain, 1);
+  }
+public:
+  unsigned getLabelID() const { return LabelID; }
+
+  static bool classof(const LabelSDNode *) { return true; }
+  static bool classof(const SDNode *N) {
+    return N->getOpcode() == ISD::DBG_LABEL ||
+           N->getOpcode() == ISD::EH_LABEL;
+  }
+};
+
 class ExternalSymbolSDNode : public SDNode {
   const char *Symbol;
   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
 protected:
   friend class SelectionDAG;
-  ExternalSymbolSDNode(bool isTarget, const char *Sym, MVT::ValueType VT)
+  ExternalSymbolSDNode(bool isTarget, const char *Sym, MVT VT)
     : SDNode(isTarget ? ISD::TargetExternalSymbol : ISD::ExternalSymbol,
              getSDVTList(VT)), Symbol(Sym) {
   }
@@ -1882,19 +2027,19 @@
   }
 };
 
-/// VTSDNode - This class is used to represent MVT::ValueType's, which are used
+/// VTSDNode - This class is used to represent MVT's, which are used
 /// to parameterize some operations.
 class VTSDNode : public SDNode {
-  MVT::ValueType ValueType;
+  MVT ValueType;
   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
 protected:
   friend class SelectionDAG;
-  explicit VTSDNode(MVT::ValueType VT)
+  explicit VTSDNode(MVT VT)
     : SDNode(ISD::VALUETYPE, getSDVTList(MVT::Other)), ValueType(VT) {
   }
 public:
 
-  MVT::ValueType getVT() const { return ValueType; }
+  MVT getVT() const { return ValueType; }
 
   static bool classof(const VTSDNode *) { return true; }
   static bool classof(const SDNode *N) {
@@ -1904,25 +2049,20 @@
 
 /// LSBaseSDNode - Base class for LoadSDNode and StoreSDNode
 ///
-class LSBaseSDNode : public SDNode {
+class LSBaseSDNode : public MemSDNode {
 private:
   // AddrMode - unindexed, pre-indexed, post-indexed.
   ISD::MemIndexedMode AddrMode;
 
   // MemoryVT - VT of in-memory value.
-  MVT::ValueType MemoryVT;
+  MVT MemoryVT;
 
-  //! SrcValue - Memory location for alias analysis.
-  const Value *SrcValue;
-
-  //! SVOffset - Memory location offset.
+  //! SVOffset - Memory location offset. Note that base is defined in MemSDNode
   int SVOffset;
 
-  //! Alignment - Alignment of memory location in bytes.
-  unsigned Alignment;
-
-  //! IsVolatile - True if the store is volatile.
+  //! IsVolatile - True if the load/store is volatile.
   bool IsVolatile;
+
 protected:
   //! Operand array for load and store
   /*!
@@ -1932,15 +2072,14 @@
    */
   SDUse Ops[4];
 public:
-  LSBaseSDNode(ISD::NodeType NodeTy, SDOperand *Operands, unsigned NumOperands,
-               SDVTList VTs, ISD::MemIndexedMode AM, MVT::ValueType VT, 
+  LSBaseSDNode(ISD::NodeType NodeTy, SDOperand *Operands, unsigned numOperands,
+               SDVTList VTs, ISD::MemIndexedMode AM, MVT VT,
                const Value *SV, int SVO, unsigned Align, bool Vol)
-    : SDNode(NodeTy, VTs),
-      AddrMode(AM), MemoryVT(VT),
-      SrcValue(SV), SVOffset(SVO), Alignment(Align), IsVolatile(Vol) {
-    for (unsigned i = 0; i != NumOperands; ++i)
+    : MemSDNode(NodeTy, VTs, SV, Align), AddrMode(AM), MemoryVT(VT),
+      SVOffset(SVO), IsVolatile(Vol) {
+    for (unsigned i = 0; i != numOperands; ++i)
       Ops[i] = Operands[i];
-    InitOperands(Ops, NumOperands);
+    InitOperands(Ops, numOperands);
     assert(Align != 0 && "Loads and stores should have non-zero aligment");
     assert((getOffset().getOpcode() == ISD::UNDEF || isIndexed()) &&
            "Only indexed loads and stores have a non-undef offset operand");
@@ -1954,12 +2093,8 @@
     return getOperand(getOpcode() == ISD::LOAD ? 2 : 3);
   }
 
-  const Value *getSrcValue() const { return SrcValue; }
-  int getSrcValueOffset() const { return SVOffset; }
-  unsigned getAlignment() const { return Alignment; }
-  MVT::ValueType getMemoryVT() const { return MemoryVT; }
-  bool isVolatile() const { return IsVolatile; }
-
+  MVT getMemoryVT() const { return MemoryVT; }
+    
   ISD::MemIndexedMode getAddressingMode() const { return AddrMode; }
 
   /// isIndexed - Return true if this is a pre/post inc/dec load/store.
@@ -1968,11 +2103,15 @@
   /// isUnindexed - Return true if this is NOT a pre/post inc/dec load/store.
   bool isUnindexed() const { return AddrMode == ISD::UNINDEXED; }
 
+  // Implementation for MemSDNode
+  virtual int getSrcValueOffset() const { return SVOffset; }
+  virtual bool isVolatile() const { return IsVolatile; }  
+  
   /// getMemOperand - Return a MachineMemOperand object describing the memory
   /// reference performed by this load or store.
-  MachineMemOperand getMemOperand() const;
+  virtual MachineMemOperand getMemOperand() const;
 
-  static bool classof(const LSBaseSDNode *N) { return true; }
+  static bool classof(const LSBaseSDNode *) { return true; }
   static bool classof(const SDNode *N) {
     return N->getOpcode() == ISD::LOAD ||
            N->getOpcode() == ISD::STORE;
@@ -1990,7 +2129,7 @@
 protected:
   friend class SelectionDAG;
   LoadSDNode(SDOperand *ChainPtrOff, SDVTList VTs,
-             ISD::MemIndexedMode AM, ISD::LoadExtType ETy, MVT::ValueType LVT,
+             ISD::MemIndexedMode AM, ISD::LoadExtType ETy, MVT LVT,
              const Value *SV, int O=0, unsigned Align=0, bool Vol=false)
     : LSBaseSDNode(ISD::LOAD, ChainPtrOff, 3,
                    VTs, AM, LVT, SV, O, Align, Vol),
@@ -2017,7 +2156,7 @@
 protected:
   friend class SelectionDAG;
   StoreSDNode(SDOperand *ChainValuePtrOff, SDVTList VTs,
-              ISD::MemIndexedMode AM, bool isTrunc, MVT::ValueType SVT,
+              ISD::MemIndexedMode AM, bool isTrunc, MVT SVT,
               const Value *SV, int O=0, unsigned Align=0, bool Vol=false)
     : LSBaseSDNode(ISD::STORE, ChainValuePtrOff, 4,
                    VTs, AM, SVT, SV, O, Align, Vol),
@@ -2102,71 +2241,82 @@
   //static SDNode *createNode(const SDNode &V) { return new SDNode(V); }
   
   
-  void addNodeToList(SDNode *NTy) {}
-  void removeNodeFromList(SDNode *NTy) {}
-  void transferNodesFromList(iplist<SDNode, ilist_traits> &L2,
-                             const ilist_iterator<SDNode> &X,
-                             const ilist_iterator<SDNode> &Y) {}
+  void addNodeToList(SDNode *) {}
+  void removeNodeFromList(SDNode *) {}
+  void transferNodesFromList(iplist<SDNode, ilist_traits> &,
+                             const ilist_iterator<SDNode> &,
+                             const ilist_iterator<SDNode> &) {}
 };
 
 namespace ISD {
   /// isNormalLoad - Returns true if the specified node is a non-extending
   /// and unindexed load.
   inline bool isNormalLoad(const SDNode *N) {
-    if (N->getOpcode() != ISD::LOAD)
-      return false;
-    const LoadSDNode *Ld = cast<LoadSDNode>(N);
-    return Ld->getExtensionType() == ISD::NON_EXTLOAD &&
+    const LoadSDNode *Ld = dyn_cast<LoadSDNode>(N);
+    return Ld && Ld->getExtensionType() == ISD::NON_EXTLOAD &&
       Ld->getAddressingMode() == ISD::UNINDEXED;
   }
 
   /// isNON_EXTLoad - Returns true if the specified node is a non-extending
   /// load.
   inline bool isNON_EXTLoad(const SDNode *N) {
-    return N->getOpcode() == ISD::LOAD &&
+    return isa<LoadSDNode>(N) &&
       cast<LoadSDNode>(N)->getExtensionType() == ISD::NON_EXTLOAD;
   }
 
   /// isEXTLoad - Returns true if the specified node is a EXTLOAD.
   ///
   inline bool isEXTLoad(const SDNode *N) {
-    return N->getOpcode() == ISD::LOAD &&
+    return isa<LoadSDNode>(N) &&
       cast<LoadSDNode>(N)->getExtensionType() == ISD::EXTLOAD;
   }
 
   /// isSEXTLoad - Returns true if the specified node is a SEXTLOAD.
   ///
   inline bool isSEXTLoad(const SDNode *N) {
-    return N->getOpcode() == ISD::LOAD &&
+    return isa<LoadSDNode>(N) &&
       cast<LoadSDNode>(N)->getExtensionType() == ISD::SEXTLOAD;
   }
 
   /// isZEXTLoad - Returns true if the specified node is a ZEXTLOAD.
   ///
   inline bool isZEXTLoad(const SDNode *N) {
-    return N->getOpcode() == ISD::LOAD &&
+    return isa<LoadSDNode>(N) &&
       cast<LoadSDNode>(N)->getExtensionType() == ISD::ZEXTLOAD;
   }
 
-  /// isUNINDEXEDLoad - Returns true if the specified node is a unindexed load.
+  /// isUNINDEXEDLoad - Returns true if the specified node is an unindexed load.
   ///
   inline bool isUNINDEXEDLoad(const SDNode *N) {
-    return N->getOpcode() == ISD::LOAD &&
+    return isa<LoadSDNode>(N) &&
       cast<LoadSDNode>(N)->getAddressingMode() == ISD::UNINDEXED;
   }
 
+  /// isNormalStore - Returns true if the specified node is a non-truncating
+  /// and unindexed store.
+  inline bool isNormalStore(const SDNode *N) {
+    const StoreSDNode *St = dyn_cast<StoreSDNode>(N);
+    return St && !St->isTruncatingStore() &&
+      St->getAddressingMode() == ISD::UNINDEXED;
+  }
+
   /// isNON_TRUNCStore - Returns true if the specified node is a non-truncating
   /// store.
   inline bool isNON_TRUNCStore(const SDNode *N) {
-    return N->getOpcode() == ISD::STORE &&
-      !cast<StoreSDNode>(N)->isTruncatingStore();
+    return isa<StoreSDNode>(N) && !cast<StoreSDNode>(N)->isTruncatingStore();
   }
 
   /// isTRUNCStore - Returns true if the specified node is a truncating
   /// store.
   inline bool isTRUNCStore(const SDNode *N) {
-    return N->getOpcode() == ISD::STORE &&
-      cast<StoreSDNode>(N)->isTruncatingStore();
+    return isa<StoreSDNode>(N) && cast<StoreSDNode>(N)->isTruncatingStore();
+  }
+
+  /// isUNINDEXEDStore - Returns true if the specified node is an
+  /// unindexed store.
+  inline bool isUNINDEXEDStore(const SDNode *N) {
+    return isa<StoreSDNode>(N) &&
+      cast<StoreSDNode>(N)->getAddressingMode() == ISD::UNINDEXED;
   }
 }
 

Modified: llvm/branches/non-call-eh/include/llvm/CodeGen/ValueTypes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/CodeGen/ValueTypes.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/CodeGen/ValueTypes.h (original)
+++ llvm/branches/non-call-eh/include/llvm/CodeGen/ValueTypes.h Sun Jul  6 15:45:41 2008
@@ -24,368 +24,429 @@
 namespace llvm {
   class Type;
 
-/// MVT namespace - This namespace defines the SimpleValueType enum, which
-/// contains the various low-level value types, and the ValueType typedef.
-///
-namespace MVT {  // MVT = Machine Value Types
-  enum SimpleValueType {
-    // If you change this numbering, you must change the values in ValueTypes.td
-    // well!
-    Other          =   0,   // This is a non-standard value
-    i1             =   1,   // This is a 1 bit integer value
-    i8             =   2,   // This is an 8 bit integer value
-    i16            =   3,   // This is a 16 bit integer value
-    i32            =   4,   // This is a 32 bit integer value
-    i64            =   5,   // This is a 64 bit integer value
-    i128           =   6,   // This is a 128 bit integer value
-
-    FIRST_INTEGER_VALUETYPE = i1,
-    LAST_INTEGER_VALUETYPE  = i128,
-
-    f32            =   7,   // This is a 32 bit floating point value
-    f64            =   8,   // This is a 64 bit floating point value
-    f80            =   9,   // This is a 80 bit floating point value
-    f128           =  10,   // This is a 128 bit floating point value
-    ppcf128        =  11,   // This is a PPC 128-bit floating point value
-    Flag           =  12,   // This is a condition code or machine flag.
-
-    isVoid         =  13,   // This has no value
-
-    v8i8           =  14,   //  8 x i8
-    v4i16          =  15,   //  4 x i16
-    v2i32          =  16,   //  2 x i32
-    v1i64          =  17,   //  1 x i64
-    v16i8          =  18,   // 16 x i8
-    v8i16          =  19,   //  8 x i16
-    v3i32          =  20,   //  3 x i32
-    v4i32          =  21,   //  4 x i32
-    v2i64          =  22,   //  2 x i64
-
-    v2f32          =  23,   //  2 x f32
-    v3f32          =  24,   //  3 x f32
-    v4f32          =  25,   //  4 x f32
-    v2f64          =  26,   //  2 x f64
-
-    FIRST_VECTOR_VALUETYPE = v8i8,
-    LAST_VECTOR_VALUETYPE  = v2f64,
-
-    LAST_VALUETYPE =  27,   // This always remains at the end of the list.
-
-    // fAny - Any floating-point or vector floating-point value. This is used
-    // for intrinsics that have overloadings based on floating-point types.
-    // This is only for tblgen's consumption!
-    fAny           =  253,
-
-    // iAny - An integer or vector integer value of any bit width. This is
-    // used for intrinsics that have overloadings based on integer bit widths.
-    // This is only for tblgen's consumption!
-    iAny           =  254,
-
-    // iPTR - An int value the size of the pointer of the current
-    // target.  This should only be used internal to tblgen!
-    iPTR           =  255
-  };
+  struct MVT { // MVT = Machine Value Type
+  public:
+
+    enum SimpleValueType {
+      // If you change this numbering, you must change the values in
+      // ValueTypes.td well!
+      Other          =   0,   // This is a non-standard value
+      i1             =   1,   // This is a 1 bit integer value
+      i8             =   2,   // This is an 8 bit integer value
+      i16            =   3,   // This is a 16 bit integer value
+      i32            =   4,   // This is a 32 bit integer value
+      i64            =   5,   // This is a 64 bit integer value
+      i128           =   6,   // This is a 128 bit integer value
+
+      FIRST_INTEGER_VALUETYPE = i1,
+      LAST_INTEGER_VALUETYPE  = i128,
+
+      f32            =   7,   // This is a 32 bit floating point value
+      f64            =   8,   // This is a 64 bit floating point value
+      f80            =   9,   // This is a 80 bit floating point value
+      f128           =  10,   // This is a 128 bit floating point value
+      ppcf128        =  11,   // This is a PPC 128-bit floating point value
+      Flag           =  12,   // This is a condition code or machine flag.
+
+      isVoid         =  13,   // This has no value
+
+      v8i8           =  14,   //  8 x i8
+      v4i16          =  15,   //  4 x i16
+      v2i32          =  16,   //  2 x i32
+      v1i64          =  17,   //  1 x i64
+      v16i8          =  18,   // 16 x i8
+      v8i16          =  19,   //  8 x i16
+      v3i32          =  20,   //  3 x i32
+      v4i32          =  21,   //  4 x i32
+      v2i64          =  22,   //  2 x i64
+
+      v2f32          =  23,   //  2 x f32
+      v3f32          =  24,   //  3 x f32
+      v4f32          =  25,   //  4 x f32
+      v2f64          =  26,   //  2 x f64
+
+      FIRST_VECTOR_VALUETYPE = v8i8,
+      LAST_VECTOR_VALUETYPE  = v2f64,
+
+      LAST_VALUETYPE =  27,   // This always remains at the end of the list.
+
+      // fAny - Any floating-point or vector floating-point value. This is used
+      // for intrinsics that have overloadings based on floating-point types.
+      // This is only for tblgen's consumption!
+      fAny           =  253,
+
+      // iAny - An integer or vector integer value of any bit width. This is
+      // used for intrinsics that have overloadings based on integer bit widths.
+      // This is only for tblgen's consumption!
+      iAny           =  254,
+
+      // iPTR - An int value the size of the pointer of the current
+      // target.  This should only be used internal to tblgen!
+      iPTR           =  255
+    };
+
+    /// MVT - This type holds low-level value types. Valid values include any of
+    /// the values in the SimpleValueType enum, or any value returned from one
+    /// of the MVT methods.  Any value type equal to one of the SimpleValueType
+    /// enum values is a "simple" value type.  All others are "extended".
+    ///
+    /// Note that simple doesn't necessary mean legal for the target machine.
+    /// All legal value types must be simple, but often there are some simple
+    /// value types that are not legal.
+    ///
+    /// @internal
+    /// Extended types are either vector types or arbitrary precision integers.
+    /// Arbitrary precision integers have iAny in the first SimpleTypeBits bits,
+    /// and the bit-width in the next PrecisionBits bits, offset by minus one.
+    /// Vector types are encoded by having the first SimpleTypeBits+PrecisionBits
+    /// bits encode the vector element type (which must be a scalar type, possibly
+    /// an arbitrary precision integer) and the remaining VectorBits upper bits
+    /// encode the vector length, offset by one.
+    ///
+    /// 32--------------16-----------8-------------0
+    ///  | Vector length | Precision | Simple type |
+    ///  |               |      Vector element     |
+    ///
+
+  private:
+
+    static const int SimpleTypeBits = 8;
+    static const int PrecisionBits  = 8;
+    static const int VectorBits     = 32 - SimpleTypeBits - PrecisionBits;
+
+    static const uint32_t SimpleTypeMask =
+      (~uint32_t(0) << (32 - SimpleTypeBits)) >> (32 - SimpleTypeBits);
+
+    static const uint32_t PrecisionMask =
+      ((~uint32_t(0) << VectorBits) >> (32 - PrecisionBits)) << SimpleTypeBits;
+
+    static const uint32_t VectorMask =
+      (~uint32_t(0) >> (32 - VectorBits)) << (32 - VectorBits);
+
+    static const uint32_t ElementMask =
+      (~uint32_t(0) << VectorBits) >> VectorBits;
+
+    uint32_t V;
+
+  public:
+
+    MVT() {}
+    MVT(SimpleValueType S) { V = S; }
+
+    inline bool operator== (const MVT VT) const { return V == VT.V; }
+    inline bool operator!= (const MVT VT) const { return V != VT.V; }
+
+    /// getIntegerVT - Returns the MVT that represents an integer with the given
+    /// number of bits.
+    static inline MVT getIntegerVT(unsigned BitWidth) {
+      switch (BitWidth) {
+      default:
+        break;
+      case 1:
+        return i1;
+      case 8:
+        return i8;
+      case 16:
+        return i16;
+      case 32:
+        return i32;
+      case 64:
+        return i64;
+      case 128:
+        return i128;
+      }
+      MVT VT;
+      VT.V = iAny | (((BitWidth - 1) << SimpleTypeBits) & PrecisionMask);
+      assert(VT.getSizeInBits() == BitWidth && "Bad bit width!");
+      return VT;
+    }
+
+    /// getVectorVT - Returns the MVT that represents a vector NumElements in
+    /// length, where each element is of type VT.
+    static inline MVT getVectorVT(MVT VT, unsigned NumElements) {
+      switch (VT.V) {
+      default:
+        break;
+      case i8:
+        if (NumElements == 8)  return v8i8;
+        if (NumElements == 16) return v16i8;
+        break;
+      case i16:
+        if (NumElements == 4)  return v4i16;
+        if (NumElements == 8)  return v8i16;
+        break;
+      case i32:
+        if (NumElements == 2)  return v2i32;
+        if (NumElements == 3)  return v3i32;
+        if (NumElements == 4)  return v4i32;
+        break;
+      case i64:
+        if (NumElements == 1)  return v1i64;
+        if (NumElements == 2)  return v2i64;
+        break;
+      case f32:
+        if (NumElements == 2)  return v2f32;
+        if (NumElements == 3)  return v3f32;
+        if (NumElements == 4)  return v4f32;
+        break;
+      case f64:
+        if (NumElements == 2)  return v2f64;
+        break;
+      }
+      MVT Result;
+      Result.V = VT.V | ((NumElements + 1) << (32 - VectorBits));
+      assert(Result.getVectorElementType() == VT &&
+             "Bad vector element type!");
+      assert(Result.getVectorNumElements() == NumElements &&
+             "Bad vector length!");
+      return Result;
+    }
+
+    /// getIntVectorWithNumElements - Return any integer vector type that has
+    /// the specified number of elements.
+    static inline MVT getIntVectorWithNumElements(unsigned NumElts) {
+      switch (NumElts) {
+      default: return getVectorVT(i8, NumElts);
+      case  1: return v1i64;
+      case  2: return v2i32;
+      case  3: return v3i32;
+      case  4: return v4i16;
+      case  8: return v8i8;
+      case 16: return v16i8;
+      }
+    }
+
+
+    /// isSimple - Test if the given MVT is simple (as opposed to being
+    /// extended).
+    inline bool isSimple() const {
+      return V <= SimpleTypeMask;
+    }
+
+    /// isExtended - Test if the given MVT is extended (as opposed to
+    /// being simple).
+    inline bool isExtended() const {
+      return !isSimple();
+    }
+
+    /// isFloatingPoint - Return true if this is a FP, or a vector FP type.
+    inline bool isFloatingPoint() const {
+      uint32_t SVT = V & SimpleTypeMask;
+      return (SVT >= f32 && SVT <= ppcf128) || (SVT >= v2f32 && SVT <= v2f64);
+    }
+
+    /// isInteger - Return true if this is an integer, or a vector integer type.
+    inline bool isInteger() const {
+      uint32_t SVT = V & SimpleTypeMask;
+      return (SVT >= FIRST_INTEGER_VALUETYPE && SVT <= LAST_INTEGER_VALUETYPE) ||
+        (SVT >= v8i8 && SVT <= v2i64) || (SVT == iAny && (V & PrecisionMask));
+    }
+
+    /// isVector - Return true if this is a vector value type.
+    inline bool isVector() const {
+      return (V >= FIRST_VECTOR_VALUETYPE && V <= LAST_VECTOR_VALUETYPE) ||
+             (V & VectorMask);
+    }
+
+    /// is64BitVector - Return true if this is a 64-bit vector type.
+    inline bool is64BitVector() const {
+      return (V==v8i8 || V==v4i16 || V==v2i32 || V==v1i64 || V==v2f32 ||
+              (isExtended() && isVector() && getSizeInBits()==64));
+    }
+
+    /// is128BitVector - Return true if this is a 128-bit vector type.
+    inline bool is128BitVector() const {
+      return (V==v16i8 || V==v8i16 || V==v4i32 || V==v2i64 ||
+              V==v4f32 || V==v2f64 ||
+              (isExtended() && isVector() && getSizeInBits()==128));
+    }
+
+    /// isByteSized - Return true if the bit size is a multiple of 8.
+    inline bool isByteSized() const {
+      return (getSizeInBits() & 7) == 0;
+    }
+
+    /// isRound - Return true if the size is a power-of-two number of bytes.
+    inline bool isRound() const {
+      unsigned BitSize = getSizeInBits();
+      return BitSize >= 8 && !(BitSize & (BitSize - 1));
+    }
 
-  /// MVT::ValueType - This type holds low-level value types. Valid values
-  /// include any of the values in the SimpleValueType enum, or any value
-  /// returned from a function in the MVT namespace that has a ValueType
-  /// return type. Any value type equal to one of the SimpleValueType enum
-  /// values is a "simple" value type. All other value types are "extended".
-  ///
-  /// Note that simple doesn't necessary mean legal for the target machine.
-  /// All legal value types must be simple, but often there are some simple
-  /// value types that are not legal.
-  ///
-  /// @internal
-  /// Extended types are either vector types or arbitrary precision integers.
-  /// Arbitrary precision integers have iAny in the first SimpleTypeBits bits,
-  /// and the bit-width in the next PrecisionBits bits, offset by minus one.
-  /// Vector types are encoded by having the first SimpleTypeBits+PrecisionBits
-  /// bits encode the vector element type (which must be a scalar type, possibly
-  /// an arbitrary precision integer) and the remaining VectorBits upper bits
-  /// encode the vector length, offset by one.
-  ///
-  /// 31--------------16-----------8-------------0
-  ///  | Vector length | Precision | Simple type |
-  ///  |               |      Vector element     |
-  ///
-  /// Note that the verifier currently requires the top bit to be zero.
-
-  typedef uint32_t ValueType;
-
-  static const int SimpleTypeBits = 8;
-  static const int PrecisionBits  = 8;
-  static const int VectorBits     = 32 - SimpleTypeBits - PrecisionBits;
-
-  static const uint32_t SimpleTypeMask =
-    (~uint32_t(0) << (32 - SimpleTypeBits)) >> (32 - SimpleTypeBits);
-
-  static const uint32_t PrecisionMask =
-    ((~uint32_t(0) << VectorBits) >> (32 - PrecisionBits)) << SimpleTypeBits;
-
-  static const uint32_t VectorMask =
-    (~uint32_t(0) >> (32 - VectorBits)) << (32 - VectorBits);
-
-  static const uint32_t ElementMask =
-    (~uint32_t(0) << VectorBits) >> VectorBits;
-
-  /// MVT::isExtendedVT - Test if the given ValueType is extended
-  /// (as opposed to being simple).
-  static inline bool isExtendedVT(ValueType VT) {
-    return VT > SimpleTypeMask;
-  }
-
-  /// MVT::isInteger - Return true if this is an integer, or a vector integer
-  /// type.
-  static inline bool isInteger(ValueType VT) {
-    ValueType SVT = VT & SimpleTypeMask;
-    return (SVT >= FIRST_INTEGER_VALUETYPE && SVT <= LAST_INTEGER_VALUETYPE) ||
-      (SVT >= v8i8 && SVT <= v2i64) || (SVT == iAny && (VT & PrecisionMask));
-  }
-
-  /// MVT::isFloatingPoint - Return true if this is an FP, or a vector FP type.
-  static inline bool isFloatingPoint(ValueType VT) {
-    ValueType SVT = VT & SimpleTypeMask;
-    return (SVT >= f32 && SVT <= ppcf128) || (SVT >= v2f32 && SVT <= v2f64);
-  }
-
-  /// MVT::isVector - Return true if this is a vector value type.
-  static inline bool isVector(ValueType VT) {
-    return (VT >= FIRST_VECTOR_VALUETYPE && VT <= LAST_VECTOR_VALUETYPE) ||
-           (VT & VectorMask);
-  }
-
-  /// MVT::getVectorElementType - Given a vector type, return the type of
-  /// each element.
-  static inline ValueType getVectorElementType(ValueType VT) {
-    assert(isVector(VT) && "Invalid vector type!");
-    switch (VT) {
-    default:
-      assert(isExtendedVT(VT) && "Unknown simple vector type!");
-      return VT & ElementMask;
-    case v8i8 :
-    case v16i8: return i8;
-    case v4i16:
-    case v8i16: return i16;
-    case v2i32:
-    case v3i32:
-    case v4i32: return i32;
-    case v1i64:
-    case v2i64: return i64;
-    case v2f32:
-    case v3f32:
-    case v4f32: return f32;
-    case v2f64: return f64;
-    }
-  }
-
-  /// MVT::getVectorNumElements - Given a vector type, return the
-  /// number of elements it contains.
-  static inline unsigned getVectorNumElements(ValueType VT) {
-    assert(isVector(VT) && "Invalid vector type!");
-    switch (VT) {
-    default:
-      assert(isExtendedVT(VT) && "Unknown simple vector type!");
-      return ((VT & VectorMask) >> (32 - VectorBits)) - 1;
-    case v16i8: return 16;
-    case v8i8 :
-    case v8i16: return 8;
-    case v4i16:
-    case v4i32:
-    case v4f32: return 4;
-    case v3i32:
-    case v3f32: return 3;
-    case v2i32:
-    case v2i64:
-    case v2f32:
-    case v2f64: return 2;
-    case v1i64: return 1;
-    }
-  }
-
-  /// MVT::getSizeInBits - Return the size of the specified value type
-  /// in bits.
-  ///
-  static inline unsigned getSizeInBits(ValueType VT) {
-    switch (VT) {
-    default:
-      assert(isExtendedVT(VT) && "ValueType has no known size!");
-      if (isVector(VT))
-        return getSizeInBits(getVectorElementType(VT)) *
-               getVectorNumElements(VT);
-      if (isInteger(VT))
-        return ((VT & PrecisionMask) >> SimpleTypeBits) + 1;
-      assert(0 && "Unknown value type!");
-    case MVT::i1  :  return 1;
-    case MVT::i8  :  return 8;
-    case MVT::i16 :  return 16;
-    case MVT::f32 :
-    case MVT::i32 :  return 32;
-    case MVT::f64 :
-    case MVT::i64 :
-    case MVT::v8i8:
-    case MVT::v4i16:
-    case MVT::v2i32:
-    case MVT::v1i64:
-    case MVT::v2f32: return 64;
-    case MVT::f80 :  return 80;
-    case MVT::v3i32:
-    case MVT::v3f32: return 96;
-    case MVT::f128:
-    case MVT::ppcf128:
-    case MVT::i128:
-    case MVT::v16i8:
-    case MVT::v8i16:
-    case MVT::v4i32:
-    case MVT::v2i64:
-    case MVT::v4f32:
-    case MVT::v2f64: return 128;
-    }
-  }
-
-  /// MVT::getStoreSizeInBits - Return the number of bits overwritten by a
-  /// store of the specified value type.
-  ///
-  static inline unsigned getStoreSizeInBits(ValueType VT) {
-    return (getSizeInBits(VT) + 7)/8*8;
-  }
-
-  /// MVT::is64BitVector - Return true if this is a 64-bit vector type.
-  static inline bool is64BitVector(ValueType VT) {
-    return (VT==v8i8 || VT==v4i16 || VT==v2i32 || VT==v1i64 || VT==v2f32 ||
-            (isExtendedVT(VT) && isVector(VT) && getSizeInBits(VT)==64));
-  }
-
-  /// MVT::is128BitVector - Return true if this is a 128-bit vector type.
-  static inline bool is128BitVector(ValueType VT) {
-    return (VT==v16i8 || VT==v8i16 || VT==v4i32 || VT==v2i64 || 
-            VT==v4f32 || VT==v2f64 ||
-            (isExtendedVT(VT) && isVector(VT) && getSizeInBits(VT)==128));
-  }
-
-  /// MVT::getIntegerType - Returns the ValueType that represents an integer
-  /// with the given number of bits.
-  ///
-  static inline ValueType getIntegerType(unsigned BitWidth) {
-    switch (BitWidth) {
-    default:
-      break;
-    case 1:
-      return MVT::i1;
-    case 8:
-      return MVT::i8;
-    case 16:
-      return MVT::i16;
-    case 32:
-      return MVT::i32;
-    case 64:
-      return MVT::i64;
-    case 128:
-      return MVT::i128;
-    }
-    ValueType Result = iAny |
-      (((BitWidth - 1) << SimpleTypeBits) & PrecisionMask);
-    assert(getSizeInBits(Result) == BitWidth && "Bad bit width!");
-    return Result;
-  }
-
-  /// MVT::RoundIntegerType - Rounds the bit-width of the given integer
-  /// ValueType up to the nearest power of two (and at least to eight),
-  /// and returns the integer ValueType with that number of bits.
-  ///
-  static inline ValueType RoundIntegerType(ValueType VT) {
-    assert(isInteger(VT) && !isVector(VT) && "Invalid integer type!");
-    unsigned BitWidth = getSizeInBits(VT);
-    if (BitWidth <= 8)
-      return MVT::i8;
-    else
-      return getIntegerType(1 << Log2_32_Ceil(BitWidth));
-  }
-
-  /// MVT::getVectorType - Returns the ValueType that represents a vector
-  /// NumElements in length, where each element is of type VT.
-  ///
-  static inline ValueType getVectorType(ValueType VT, unsigned NumElements) {
-    switch (VT) {
-    default:
-      break;
-    case MVT::i8:
-      if (NumElements == 8)  return MVT::v8i8;
-      if (NumElements == 16) return MVT::v16i8;
-      break;
-    case MVT::i16:
-      if (NumElements == 4)  return MVT::v4i16;
-      if (NumElements == 8)  return MVT::v8i16;
-      break;
-    case MVT::i32:
-      if (NumElements == 2)  return MVT::v2i32;
-      if (NumElements == 3)  return MVT::v3i32;
-      if (NumElements == 4)  return MVT::v4i32;
-      break;
-    case MVT::i64:
-      if (NumElements == 1)  return MVT::v1i64;
-      if (NumElements == 2)  return MVT::v2i64;
-      break;
-    case MVT::f32:
-      if (NumElements == 2)  return MVT::v2f32;
-      if (NumElements == 3)  return MVT::v3f32;
-      if (NumElements == 4)  return MVT::v4f32;
-      break;
-    case MVT::f64:
-      if (NumElements == 2)  return MVT::v2f64;
-      break;
-    }
-    // Set the length with the top bit forced to zero (needed by the verifier).
-    ValueType Result = VT | (((NumElements + 1) << (33 - VectorBits)) >> 1);
-    assert(getVectorElementType(Result) == VT &&
-           "Bad vector element type!");
-    assert(getVectorNumElements(Result) == NumElements &&
-           "Bad vector length!");
-    return Result;
-  }
-
-  /// MVT::getIntVectorWithNumElements - Return any integer vector type that has
-  /// the specified number of elements.
-  static inline ValueType getIntVectorWithNumElements(unsigned NumElts) {
-    switch (NumElts) {
-    default: return getVectorType(i8, NumElts);
-    case  1: return v1i64;
-    case  2: return v2i32;
-    case  3: return v3i32;
-    case  4: return v4i16;
-    case  8: return v8i8;
-    case 16: return v16i8;
-    }
-  }
-
-
-  /// MVT::getIntVTBitMask - Return an integer with 1's every place there are
-  /// bits in the specified integer value type.
-  static inline uint64_t getIntVTBitMask(ValueType VT) {
-    assert(isInteger(VT) && !isVector(VT) && "Only applies to int scalars!");
-    return ~uint64_t(0UL) >> (64-getSizeInBits(VT));
-  }
-  /// MVT::getIntVTSignBit - Return an integer with a 1 in the position of the
-  /// sign bit for the specified integer value type.
-  static inline uint64_t getIntVTSignBit(ValueType VT) {
-    assert(isInteger(VT) && !isVector(VT) && "Only applies to int scalars!");
-    return uint64_t(1UL) << (getSizeInBits(VT)-1);
-  }
-
-  /// MVT::getValueTypeString - This function returns value type as a string,
-  /// e.g. "i32".
-  std::string getValueTypeString(ValueType VT);
-
-  /// MVT::getTypeForValueType - This method returns an LLVM type corresponding
-  /// to the specified ValueType.  For integer types, this returns an unsigned
-  /// type.  Note that this will abort for types that cannot be represented.
-  const Type *getTypeForValueType(ValueType VT);
-
-  /// MVT::getValueType - Return the value type corresponding to the specified
-  /// type.  This returns all pointers as MVT::iPTR.  If HandleUnknown is true,
-  /// unknown types are returned as Other, otherwise they are invalid.
-  ValueType getValueType(const Type *Ty, bool HandleUnknown = false);
-}
+    /// bitsGT - Return true if this has more bits than VT.
+    inline bool bitsGT(MVT VT) const {
+      return getSizeInBits() > VT.getSizeInBits();
+    }
+
+    /// bitsGE - Return true if this has no less bits than VT.
+    inline bool bitsGE(MVT VT) const {
+      return getSizeInBits() >= VT.getSizeInBits();
+    }
+
+    /// bitsLT - Return true if this has less bits than VT.
+    inline bool bitsLT(MVT VT) const {
+      return getSizeInBits() < VT.getSizeInBits();
+    }
+
+    /// bitsLE - Return true if this has no more bits than VT.
+    inline bool bitsLE(MVT VT) const {
+      return getSizeInBits() <= VT.getSizeInBits();
+    }
+
+
+    /// getSimpleVT - Return the SimpleValueType held in the specified
+    /// simple MVT.
+    inline SimpleValueType getSimpleVT() const {
+      assert(isSimple() && "Expected a SimpleValueType!");
+      return (SimpleValueType)V;
+    }
+
+    /// getVectorElementType - Given a vector type, return the type of
+    /// each element.
+    inline MVT getVectorElementType() const {
+      assert(isVector() && "Invalid vector type!");
+      switch (V) {
+      default: {
+        assert(isExtended() && "Unknown simple vector type!");
+        MVT VT;
+        VT.V = V & ElementMask;
+        return VT;
+      }
+      case v8i8 :
+      case v16i8: return i8;
+      case v4i16:
+      case v8i16: return i16;
+      case v2i32:
+      case v3i32:
+      case v4i32: return i32;
+      case v1i64:
+      case v2i64: return i64;
+      case v2f32:
+      case v3f32:
+      case v4f32: return f32;
+      case v2f64: return f64;
+      }
+    }
+
+    /// getVectorNumElements - Given a vector type, return the number of
+    /// elements it contains.
+    inline unsigned getVectorNumElements() const {
+      assert(isVector() && "Invalid vector type!");
+      switch (V) {
+      default:
+        assert(isExtended() && "Unknown simple vector type!");
+        return ((V & VectorMask) >> (32 - VectorBits)) - 1;
+      case v16i8: return 16;
+      case v8i8 :
+      case v8i16: return 8;
+      case v4i16:
+      case v4i32:
+      case v4f32: return 4;
+      case v3i32:
+      case v3f32: return 3;
+      case v2i32:
+      case v2i64:
+      case v2f32:
+      case v2f64: return 2;
+      case v1i64: return 1;
+      }
+    }
+
+    /// getSizeInBits - Return the size of the specified value type in bits.
+    inline unsigned getSizeInBits() const {
+      switch (V) {
+      default:
+        assert(isExtended() && "MVT has no known size!");
+        if (isVector())
+          return getVectorElementType().getSizeInBits()*getVectorNumElements();
+        if (isInteger())
+          return ((V & PrecisionMask) >> SimpleTypeBits) + 1;
+        assert(false && "Unknown value type!");
+        return 0;
+      case i1  :  return 1;
+      case i8  :  return 8;
+      case i16 :  return 16;
+      case f32 :
+      case i32 :  return 32;
+      case f64 :
+      case i64 :
+      case v8i8:
+      case v4i16:
+      case v2i32:
+      case v1i64:
+      case v2f32: return 64;
+      case f80 :  return 80;
+      case v3i32:
+      case v3f32: return 96;
+      case f128:
+      case ppcf128:
+      case i128:
+      case v16i8:
+      case v8i16:
+      case v4i32:
+      case v2i64:
+      case v4f32:
+      case v2f64: return 128;
+      }
+    }
+
+    /// getStoreSizeInBits - Return the number of bits overwritten by a store
+    /// of the specified value type.
+    inline unsigned getStoreSizeInBits() const {
+      return (getSizeInBits() + 7)/8*8;
+    }
+
+    /// getRoundIntegerType - Rounds the bit-width of the given integer MVT up
+    /// to the nearest power of two (and at least to eight), and returns the
+    /// integer MVT with that number of bits.
+    inline MVT getRoundIntegerType() const {
+      assert(isInteger() && !isVector() && "Invalid integer type!");
+      unsigned BitWidth = getSizeInBits();
+      if (BitWidth <= 8)
+        return i8;
+      else
+        return getIntegerVT(1 << Log2_32_Ceil(BitWidth));
+    }
+
+    /// getIntegerVTBitMask - Return an integer with 1's every place there are
+    /// bits in the specified integer value type. FIXME: Should return an apint.
+    inline uint64_t getIntegerVTBitMask() const {
+      assert(isInteger() && !isVector() && "Only applies to int scalars!");
+      return ~uint64_t(0UL) >> (64-getSizeInBits());
+    }
+
+    /// getIntegerVTSignBit - Return an integer with a 1 in the position of the
+    /// sign bit for the specified integer value type. FIXME: Should return an
+    /// apint.
+    inline uint64_t getIntegerVTSignBit() const {
+      assert(isInteger() && !isVector() && "Only applies to int scalars!");
+      return uint64_t(1UL) << (getSizeInBits()-1);
+    }
+
+    /// getMVTString - This function returns value type as a string,
+    /// e.g. "i32".
+    std::string getMVTString() const;
+
+    /// getTypeForMVT - This method returns an LLVM type corresponding to the
+    /// specified MVT.  For integer types, this returns an unsigned type.  Note
+    /// that this will abort for types that cannot be represented.
+    const Type *getTypeForMVT() const;
+
+    /// getMVT - Return the value type corresponding to the specified type.
+    /// This returns all pointers as iPTR.  If HandleUnknown is true, unknown
+    /// types are returned as Other, otherwise they are invalid.
+    static MVT getMVT(const Type *Ty, bool HandleUnknown = false);
+
+    /// getRawBits - Represent the type as a bunch of bits.
+    uint32_t getRawBits() const { return V; }
+
+    /// compareRawBits - A meaningless but well-behaved order, useful for
+    /// constructing containers.
+    struct compareRawBits {
+      bool operator()(MVT L, MVT R) const {
+        return L.getRawBits() < R.getRawBits();
+      }
+    };
+  };
 
 } // End llvm namespace
 

Modified: llvm/branches/non-call-eh/include/llvm/Constant.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Constant.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Constant.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Constant.h Sun Jul  6 15:45:41 2008
@@ -39,8 +39,8 @@
   void operator=(const Constant &);     // Do not implement
   Constant(const Constant &);           // Do not implement
 protected:
-  Constant(const Type *Ty, ValueTy vty, Use *Ops, unsigned NumOps)
-    : User(Ty, vty, Ops, NumOps) {}
+  Constant(const Type *ty, ValueTy vty, Use *Ops, unsigned NumOps)
+    : User(ty, vty, Ops, NumOps) {}
 
   void destroyConstantImpl();
 public:
@@ -115,13 +115,6 @@
            "implemented for all constants that have operands!");
     assert(0 && "Constants that do not have operands cannot be using 'From'!");
   }
-
-  /// getStringValue - Turn an LLVM constant pointer that eventually points to a
-  /// global into a string value.  Return an empty string if we can't do it.
-  /// Parameter Chop determines if the result is chopped at the first null
-  /// terminator.
-  ///
-  std::string getStringValue(bool Chop = true, unsigned Offset = 0);
 };
 
 } // End llvm namespace

Modified: llvm/branches/non-call-eh/include/llvm/Constants.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Constants.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Constants.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Constants.h Sun Jul  6 15:45:41 2008
@@ -22,8 +22,10 @@
 
 #include "llvm/Constant.h"
 #include "llvm/Type.h"
+#include "llvm/OperandTraits.h"
 #include "llvm/ADT/APInt.h"
 #include "llvm/ADT/APFloat.h"
+#include "llvm/ADT/SmallVector.h"
 
 namespace llvm {
 
@@ -233,9 +235,6 @@
 public:
   /// get() - Static factory methods - Return objects of the specified value
   static ConstantFP *get(const APFloat &V);
-  static ConstantFP *get(const Type *Ty, const APFloat &V) {
-    return get(V);
-  }
 
   /// get() - This returns a constant fp for the specified value in the
   /// specified type.  This should only be used for simple constant values like
@@ -263,6 +262,9 @@
   bool isExactlyValue(const APFloat& V) const;
 
   bool isExactlyValue(double V) const {
+    // convert is not supported on this type
+    if (&Val.getSemantics() == &APFloat::PPCDoubleDouble)
+      return false;
     APFloat FV(V);
     FV.convert(Val.getSemantics(), APFloat::rmNearestTiesToEven);
     return isExactlyValue(FV);
@@ -282,8 +284,8 @@
   void *operator new(size_t, unsigned);                      // DO NOT IMPLEMENT
   ConstantAggregateZero(const ConstantAggregateZero &);      // DO NOT IMPLEMENT
 protected:
-  explicit ConstantAggregateZero(const Type *Ty)
-    : Constant(Ty, ConstantAggregateZeroVal, 0, 0) {}
+  explicit ConstantAggregateZero(const Type *ty)
+    : Constant(ty, ConstantAggregateZeroVal, 0, 0) {}
 protected:
   // allocate space for exactly zero operands
   void *operator new(size_t s) {
@@ -318,7 +320,6 @@
   ConstantArray(const ConstantArray &);      // DO NOT IMPLEMENT
 protected:
   ConstantArray(const ArrayType *T, const std::vector<Constant*> &Val);
-  ~ConstantArray();
 public:
   /// get() - Static factory methods - Return objects of the specified value
   static Constant *get(const ArrayType *T, const std::vector<Constant*> &);
@@ -336,6 +337,9 @@
   /// null termination. 
   static Constant *get(const std::string &Initializer, bool AddNull = true);
 
+  /// Transparently provide more efficient getOperand methods.
+  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant);
+
   /// getType - Specialize the getType() method to always return an ArrayType,
   /// which reduces the amount of casting needed in parts of the compiler.
   ///
@@ -374,6 +378,11 @@
   }
 };
 
+template <>
+struct OperandTraits<ConstantArray> : VariadicOperandTraits<> {
+};
+
+DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS(ConstantArray, Constant)
 
 //===----------------------------------------------------------------------===//
 // ConstantStruct - Constant Struct Declarations
@@ -384,7 +393,6 @@
   ConstantStruct(const ConstantStruct &);      // DO NOT IMPLEMENT
 protected:
   ConstantStruct(const StructType *T, const std::vector<Constant*> &Val);
-  ~ConstantStruct();
 public:
   /// get() - Static factory methods - Return objects of the specified value
   ///
@@ -396,6 +404,9 @@
     return get(std::vector<Constant*>(Vals, Vals+NumVals), Packed);
   }
   
+  /// Transparently provide more efficient getOperand methods.
+  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant);
+
   /// getType() specialization - Reduce amount of casting...
   ///
   inline const StructType *getType() const {
@@ -419,6 +430,12 @@
   }
 };
 
+template <>
+struct OperandTraits<ConstantStruct> : VariadicOperandTraits<> {
+};
+
+DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS(ConstantStruct, Constant)
+
 //===----------------------------------------------------------------------===//
 /// ConstantVector - Constant Vector Declarations
 ///
@@ -428,7 +445,6 @@
   ConstantVector(const ConstantVector &);      // DO NOT IMPLEMENT
 protected:
   ConstantVector(const VectorType *T, const std::vector<Constant*> &Val);
-  ~ConstantVector();
 public:
   /// get() - Static factory methods - Return objects of the specified value
   static Constant *get(const VectorType *T, const std::vector<Constant*> &);
@@ -438,6 +454,9 @@
     return get(std::vector<Constant*>(Vals, Vals+NumVals));
   }
   
+  /// Transparently provide more efficient getOperand methods.
+  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant);
+
   /// getType - Specialize the getType() method to always return a VectorType,
   /// which reduces the amount of casting needed in parts of the compiler.
   ///
@@ -475,6 +494,12 @@
   }
 };
 
+template <>
+struct OperandTraits<ConstantVector> : VariadicOperandTraits<> {
+};
+
+DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS(ConstantVector, Constant)
+
 //===----------------------------------------------------------------------===//
 /// ConstantPointerNull - a constant pointer value that points to null
 ///
@@ -529,8 +554,8 @@
   friend struct ConvertConstantType<ConstantExpr, Type>;
 
 protected:
-  ConstantExpr(const Type *Ty, unsigned Opcode, Use *Ops, unsigned NumOps)
-    : Constant(Ty, ConstantExprVal, Ops, NumOps) {
+  ConstantExpr(const Type *ty, unsigned Opcode, Use *Ops, unsigned NumOps)
+    : Constant(ty, ConstantExprVal, Ops, NumOps) {
     // Operation type (an Instruction opcode) is stored as the SubclassData.
     SubclassData = Opcode;
   }
@@ -551,6 +576,11 @@
                                       Constant *Elt, Constant *Idx);
   static Constant *getShuffleVectorTy(const Type *Ty, Constant *V1,
                                       Constant *V2, Constant *Mask);
+  static Constant *getExtractValueTy(const Type *Ty, Constant *Agg,
+                                     const unsigned *Idxs, unsigned NumIdxs);
+  static Constant *getInsertValueTy(const Type *Ty, Constant *Agg,
+                                    Constant *Val,
+                                    const unsigned *Idxs, unsigned NumIdxs);
 
 public:
   // Static methods to construct a ConstantExpr of different kinds.  Note that
@@ -573,6 +603,9 @@
   static Constant *getIntToPtr(Constant *C, const Type *Ty);
   static Constant *getBitCast (Constant *C, const Type *Ty);
 
+  /// Transparently provide more efficient getOperand methods.
+  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant);
+
   // @brief Convenience function for getting one of the casting operations
   // using a CastOps opcode.
   static Constant *getCast(
@@ -624,6 +657,10 @@
   /// @brief Return true if this is a compare constant expression
   bool isCompare() const;
 
+  /// @brief Return true if this is an insertvalue or extractvalue expression,
+  /// and the getIndices() method may be used.
+  bool hasIndices() const;
+
   /// Select constant expr
   ///
   static Constant *getSelect(Constant *C, Constant *V1, Constant *V2) {
@@ -662,6 +699,8 @@
   static Constant *getXor(Constant *C1, Constant *C2);
   static Constant *getICmp(unsigned short pred, Constant *LHS, Constant *RHS);
   static Constant *getFCmp(unsigned short pred, Constant *LHS, Constant *RHS);
+  static Constant *getVICmp(unsigned short pred, Constant *LHS, Constant *RHS);
+  static Constant *getVFCmp(unsigned short pred, Constant *LHS, Constant *RHS);
   static Constant *getShl(Constant *C1, Constant *C2);
   static Constant *getLShr(Constant *C1, Constant *C2);
   static Constant *getAShr(Constant *C1, Constant *C2);
@@ -677,6 +716,10 @@
   static Constant *getExtractElement(Constant *Vec, Constant *Idx);
   static Constant *getInsertElement(Constant *Vec, Constant *Elt,Constant *Idx);
   static Constant *getShuffleVector(Constant *V1, Constant *V2, Constant *Mask);
+  static Constant *getExtractValue(Constant *Agg,
+                                   const unsigned *IdxList, unsigned NumIdx);
+  static Constant *getInsertValue(Constant *Agg, Constant *Val,
+                                  const unsigned *IdxList, unsigned NumIdx);
 
   /// Floating point negation must be implemented with f(x) = -0.0 - x. This
   /// method returns the negative zero constant for floating point or vector
@@ -694,6 +737,10 @@
   /// not an ICMP or FCMP constant expression.
   unsigned getPredicate() const;
 
+  /// getIndices - Assert that this is an insertvalue or exactvalue
+  /// expression and return the list of indices.
+  const SmallVector<unsigned, 4> &getIndices() const;
+
   /// getOpcodeName - Return a string representation for an opcode.
   const char *getOpcodeName() const;
 
@@ -709,15 +756,6 @@
   virtual void destroyConstant();
   virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U);
 
-  /// Override methods to provide more type information...
-  inline Constant *getOperand(unsigned i) {
-    return cast<Constant>(User::getOperand(i));
-  }
-  inline Constant *getOperand(unsigned i) const {
-    return const_cast<Constant*>(cast<Constant>(User::getOperand(i)));
-  }
-
-
   /// Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const ConstantExpr *) { return true; }
   static inline bool classof(const Value *V) {
@@ -725,6 +763,11 @@
   }
 };
 
+template <>
+struct OperandTraits<ConstantExpr> : VariadicOperandTraits<1> {
+};
+
+DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS(ConstantExpr, Constant)
 
 //===----------------------------------------------------------------------===//
 /// UndefValue - 'undef' values are things that do not have specified contents.

Modified: llvm/branches/non-call-eh/include/llvm/Debugger/Debugger.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Debugger/Debugger.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Debugger/Debugger.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Debugger/Debugger.h Sun Jul  6 15:45:41 2008
@@ -67,7 +67,9 @@
     void setProgramArguments(It I, It E) {
       ProgramArguments.assign(I, E);
     }
-    unsigned getNumProgramArguments() const { return ProgramArguments.size(); }
+    unsigned getNumProgramArguments() const {
+      return static_cast<unsigned>(ProgramArguments.size());
+    }
     const std::string &getProgramArgument(unsigned i) const {
       return ProgramArguments[i];
     }

Modified: llvm/branches/non-call-eh/include/llvm/Debugger/SourceFile.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Debugger/SourceFile.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Debugger/SourceFile.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Debugger/SourceFile.h Sun Jul  6 15:45:41 2008
@@ -74,7 +74,7 @@
     ///
     unsigned getNumLines() const {
       if (LineOffset.empty()) calculateLineOffsets();
-      return LineOffset.size();
+      return static_cast<unsigned>(LineOffset.size());
     }
 
   private:

Modified: llvm/branches/non-call-eh/include/llvm/DerivedTypes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/DerivedTypes.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/DerivedTypes.h (original)
+++ llvm/branches/non-call-eh/include/llvm/DerivedTypes.h Sun Jul  6 15:45:41 2008
@@ -67,7 +67,7 @@
   void dump() const { Type::dump(); }
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
-  static inline bool classof(const DerivedType *T) { return true; }
+  static inline bool classof(const DerivedType *) { return true; }
   static inline bool classof(const Type *T) {
     return T->isDerivedType();
   }
@@ -127,7 +127,7 @@
   bool isPowerOf2ByteWidth() const;
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
-  static inline bool classof(const IntegerType *T) { return true; }
+  static inline bool classof(const IntegerType *) { return true; }
   static inline bool classof(const Type *T) {
     return T->getTypeID() == IntegerTyID;
   }
@@ -154,6 +154,10 @@
     const std::vector<const Type*> &Params, ///< The types of the parameters
     bool isVarArg  ///< Whether this is a variable argument length function
   );
+  
+  /// isValidReturnType - Return true if the specified type is valid as a return
+  /// type.
+  static bool isValidReturnType(const Type *RetTy);
 
   inline bool isVarArg() const { return isVarArgs; }
   inline const Type *getReturnType() const { return ContainedTys[0]; }
@@ -175,7 +179,7 @@
   virtual void typeBecameConcrete(const DerivedType *AbsTy);
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
-  static inline bool classof(const FunctionType *T) { return true; }
+  static inline bool classof(const FunctionType *) { return true; }
   static inline bool classof(const Type *T) {
     return T->getTypeID() == FunctionTyID;
   }
@@ -193,10 +197,12 @@
   /// the element.
   ///
   virtual const Type *getTypeAtIndex(const Value *V) const = 0;
+  virtual const Type *getTypeAtIndex(unsigned Idx) const = 0;
   virtual bool indexValid(const Value *V) const = 0;
+  virtual bool indexValid(unsigned Idx) const = 0;
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
-  static inline bool classof(const CompositeType *T) { return true; }
+  static inline bool classof(const CompositeType *) { return true; }
   static inline bool classof(const Type *T) {
     return T->getTypeID() == ArrayTyID ||
            T->getTypeID() == StructTyID ||
@@ -241,15 +247,17 @@
   /// getTypeAtIndex - Given an index value into the type, return the type of
   /// the element.  For a structure type, this must be a constant value...
   ///
-  virtual const Type *getTypeAtIndex(const Value *V) const ;
+  virtual const Type *getTypeAtIndex(const Value *V) const;
+  virtual const Type *getTypeAtIndex(unsigned Idx) const;
   virtual bool indexValid(const Value *V) const;
+  virtual bool indexValid(unsigned Idx) const;
 
   // Implement the AbstractTypeUser interface.
   virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy);
   virtual void typeBecameConcrete(const DerivedType *AbsTy);
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
-  static inline bool classof(const StructType *T) { return true; }
+  static inline bool classof(const StructType *) { return true; }
   static inline bool classof(const Type *T) {
     return T->getTypeID() == StructTyID;
   }
@@ -284,16 +292,22 @@
   inline const Type *getElementType() const { return ContainedTys[0]; }
 
   virtual bool indexValid(const Value *V) const;
+  virtual bool indexValid(unsigned) const {
+    return true;
+  }
 
   /// getTypeAtIndex - Given an index value into the type, return the type of
   /// the element.  For sequential types, there is only one subtype...
   ///
-  virtual const Type *getTypeAtIndex(const Value *V) const {
+  virtual const Type *getTypeAtIndex(const Value *) const {
+    return ContainedTys[0];
+  }
+  virtual const Type *getTypeAtIndex(unsigned) const {
     return ContainedTys[0];
   }
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
-  static inline bool classof(const SequentialType *T) { return true; }
+  static inline bool classof(const SequentialType *) { return true; }
   static inline bool classof(const Type *T) {
     return T->getTypeID() == ArrayTyID ||
            T->getTypeID() == PointerTyID ||
@@ -324,7 +338,7 @@
   virtual void typeBecameConcrete(const DerivedType *AbsTy);
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
-  static inline bool classof(const ArrayType *T) { return true; }
+  static inline bool classof(const ArrayType *) { return true; }
   static inline bool classof(const Type *T) {
     return T->getTypeID() == ArrayTyID;
   }
@@ -345,6 +359,16 @@
   ///
   static VectorType *get(const Type *ElementType, unsigned NumElements);
 
+  /// VectorType::getInteger - This static method gets a VectorType with the
+  /// same number of elements as the input type, and the element type is an
+  /// integer type of the same width as the input element type.
+  ///
+  static VectorType *getInteger(const VectorType *VTy) {
+    unsigned EltBits = VTy->getElementType()->getPrimitiveSizeInBits();
+    const Type *EltTy = IntegerType::get(EltBits);
+    return VectorType::get(EltTy, VTy->getNumElements());
+  }
+
   /// @brief Return the number of elements in the Vector type.
   inline unsigned getNumElements() const { return NumElements; }
 
@@ -358,7 +382,7 @@
   virtual void typeBecameConcrete(const DerivedType *AbsTy);
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
-  static inline bool classof(const VectorType *T) { return true; }
+  static inline bool classof(const VectorType *) { return true; }
   static inline bool classof(const Type *T) {
     return T->getTypeID() == VectorTyID;
   }
@@ -393,7 +417,7 @@
   virtual void typeBecameConcrete(const DerivedType *AbsTy);
 
   // Implement support type inquiry through isa, cast, and dyn_cast:
-  static inline bool classof(const PointerType *T) { return true; }
+  static inline bool classof(const PointerType *) { return true; }
   static inline bool classof(const Type *T) {
     return T->getTypeID() == PointerTyID;
   }
@@ -414,7 +438,7 @@
   }
 
   // Implement support for type inquiry through isa, cast, and dyn_cast:
-  static inline bool classof(const OpaqueType *T) { return true; }
+  static inline bool classof(const OpaqueType *) { return true; }
   static inline bool classof(const Type *T) {
     return T->getTypeID() == OpaqueTyID;
   }

Modified: llvm/branches/non-call-eh/include/llvm/ExecutionEngine/ExecutionEngine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/ExecutionEngine/ExecutionEngine.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/ExecutionEngine/ExecutionEngine.h (original)
+++ llvm/branches/non-call-eh/include/llvm/ExecutionEngine/ExecutionEngine.h Sun Jul  6 15:45:41 2008
@@ -50,12 +50,12 @@
 
 public:
   std::map<const GlobalValue*, void *> &
-  getGlobalAddressMap(const MutexGuard &locked) {
+  getGlobalAddressMap(const MutexGuard &) {
     return GlobalAddressMap;
   }
 
   std::map<void*, const GlobalValue*> & 
-  getGlobalAddressReverseMap(const MutexGuard& locked) {
+  getGlobalAddressReverseMap(const MutexGuard &) {
     return GlobalAddressReverseMap;
   }
 };
@@ -65,6 +65,7 @@
   const TargetData *TD;
   ExecutionEngineState state;
   bool LazyCompilationDisabled;
+  bool SymbolSearchingDisabled;
 
 protected:
   /// Modules - This is a list of ModuleProvider's that we are JIT'ing from.  We
@@ -126,7 +127,7 @@
   /// addModuleProvider - Add a ModuleProvider to the list of modules that we
   /// can JIT from.  Note that this takes ownership of the ModuleProvider: when
   /// the ExecutionEngine is destroyed, it destroys the MP as well.
-  void addModuleProvider(ModuleProvider *P) {
+  virtual void addModuleProvider(ModuleProvider *P) {
     Modules.push_back(P);
   }
   
@@ -137,7 +138,8 @@
 
   /// removeModuleProvider - Remove a ModuleProvider from the list of modules.
   /// Release module from ModuleProvider.
-  Module* removeModuleProvider(ModuleProvider *P, std::string *ErrInfo = 0);
+  virtual Module* removeModuleProvider(ModuleProvider *P,
+                                       std::string *ErrInfo = 0);
 
   /// FindFunctionNamed - Search all of the active modules to find the one that
   /// defines FnName.  This is very slow operation and shouldn't be used for
@@ -174,6 +176,10 @@
   /// use in dynamic compilation scenarios when you want to move globals
   void clearAllGlobalMappings();
   
+  /// clearGlobalMappingsFromModule - Clear all global mappings that came from a
+  /// particular module, because it has been removed from the JIT.
+  void clearGlobalMappingsFromModule(Module *M);
+  
   /// updateGlobalMapping - Replace an existing mapping for GV with a new
   /// address.  This updates both maps as required.  If "Addr" is null, the
   /// entry for the global is removed from the mappings.  This returns the old
@@ -238,13 +244,22 @@
   }
   
   /// DisableLazyCompilation - If called, the JIT will abort if lazy compilation
-  // is ever attempted.
-  void DisableLazyCompilation() {
-    LazyCompilationDisabled = true;
+  /// is ever attempted.
+  void DisableLazyCompilation(bool Disabled = true) {
+    LazyCompilationDisabled = Disabled;
   }
   bool isLazyCompilationDisabled() const {
     return LazyCompilationDisabled;
   }
+  /// DisableSymbolSearching - If called, the JIT will not try to lookup unknown
+  /// symbols with dlsym.  A client can still use InstallLazyFunctionCreator to
+  /// resolve symbols in a custom way.
+  void DisableSymbolSearching(bool Disabled = true) {
+    SymbolSearchingDisabled = Disabled;
+  }
+  bool isSymbolSearchingDisabled() const {
+    return SymbolSearchingDisabled;
+  }
   
   
   /// InstallLazyFunctionCreator - If an unknown function is needed, the

Modified: llvm/branches/non-call-eh/include/llvm/Function.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Function.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Function.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Function.h Sun Jul  6 15:45:41 2008
@@ -170,6 +170,9 @@
   bool paramHasAttr(unsigned i, ParameterAttributes attr) const {
     return ParamAttrs.paramHasAttr(i, attr);
   }
+
+  /// addParamAttr - adds the attribute to the list of attributes.
+  void addParamAttr(unsigned i, ParameterAttributes attr);
   
   /// @brief Extract the alignment for a call or parameter (0=unknown).
   unsigned getParamAlignment(unsigned i) const {
@@ -201,6 +204,10 @@
     return paramHasAttr(1, ParamAttr::StructRet);
   }
 
+  /// copyAttributesFrom - copy all additional attributes (those not needed to
+  /// create a Function) from the Function Src to this one.
+  void copyAttributesFrom(const GlobalValue *Src);
+
   /// deleteBody - This method deletes the body of the function, and converts
   /// the linkage to external.
   ///

Modified: llvm/branches/non-call-eh/include/llvm/GlobalAlias.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/GlobalAlias.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/GlobalAlias.h (original)
+++ llvm/branches/non-call-eh/include/llvm/GlobalAlias.h Sun Jul  6 15:45:41 2008
@@ -16,6 +16,7 @@
 #define LLVM_GLOBAL_ALIAS_H
 
 #include "llvm/GlobalValue.h"
+#include "llvm/OperandTraits.h"
 
 namespace llvm {
 
@@ -42,17 +43,19 @@
         GlobalAlias *getPrev()       { return Prev; }
   const GlobalAlias *getPrev() const { return Prev; }
 
-  Use Aliasee;
 public:
-  // allocate space for exactly zero operands
+  // allocate space for exactly one operand
   void *operator new(size_t s) {
-    return User::operator new(s, 0);
+    return User::operator new(s, 1);
   }
   /// GlobalAlias ctor - If a parent module is specified, the alias is
   /// automatically inserted into the end of the specified module's alias list.
   GlobalAlias(const Type *Ty, LinkageTypes Linkage, const std::string &Name = "",
               Constant* Aliasee = 0, Module *Parent = 0);
 
+  /// Provide fast operand accessors
+  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
+
   /// isDeclaration - Is this global variable lacking an initializer?  If so, 
   /// the global variable is defined in some other translation unit, and is thus
   /// only a declaration here.
@@ -95,6 +98,12 @@
   }
 };
 
+template <>
+struct OperandTraits<GlobalAlias> : FixedNumOperandTraits<1> {
+};
+
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(GlobalAlias, Value)
+
 } // End llvm namespace
 
 #endif

Modified: llvm/branches/non-call-eh/include/llvm/GlobalValue.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/GlobalValue.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/GlobalValue.h (original)
+++ llvm/branches/non-call-eh/include/llvm/GlobalValue.h Sun Jul  6 15:45:41 2008
@@ -38,7 +38,8 @@
     DLLImportLinkage,   ///< Function to be imported from DLL
     DLLExportLinkage,   ///< Function to be accessible from DLL
     ExternalWeakLinkage,///< ExternalWeak linkage description
-    GhostLinkage        ///< Stand-in functions for streaming fns from BC files    
+    GhostLinkage,       ///< Stand-in functions for streaming fns from BC files
+    CommonLinkage       ///< Tentative definitions
   };
 
   /// @brief An enumeration for the kinds of visibility of global values.
@@ -49,9 +50,9 @@
   };
 
 protected:
-  GlobalValue(const Type *Ty, ValueTy vty, Use *Ops, unsigned NumOps,
+  GlobalValue(const Type *ty, ValueTy vty, Use *Ops, unsigned NumOps,
               LinkageTypes linkage, const std::string &name = "")
-    : Constant(Ty, vty, Ops, NumOps), Parent(0),
+    : Constant(ty, vty, Ops, NumOps), Parent(0),
       Linkage(linkage), Visibility(DefaultVisibility), Alignment(0) {
     if (!name.empty()) setName(name);
   }
@@ -100,6 +101,7 @@
   bool hasExternalLinkage()   const { return Linkage == ExternalLinkage; }
   bool hasLinkOnceLinkage()   const { return Linkage == LinkOnceLinkage; }
   bool hasWeakLinkage()       const { return Linkage == WeakLinkage; }
+  bool hasCommonLinkage()     const { return Linkage == CommonLinkage; }
   bool hasAppendingLinkage()  const { return Linkage == AppendingLinkage; }
   bool hasInternalLinkage()   const { return Linkage == InternalLinkage; }
   bool hasDLLImportLinkage()  const { return Linkage == DLLImportLinkage; }
@@ -108,6 +110,10 @@
   void setLinkage(LinkageTypes LT) { Linkage = LT; }
   LinkageTypes getLinkage() const { return Linkage; }
 
+  /// copyAttributesFrom - copy all additional attributes (those not needed to
+  /// create a GlobalValue) from the GlobalValue Src to this one.
+  virtual void copyAttributesFrom(const GlobalValue *Src);
+
   /// hasNotBeenReadFromBitcode - If a module provider is being used to lazily
   /// stream in functions from disk, this method can be used to check to see if
   /// the function has been read in yet or not.  Unless you are working on the

Modified: llvm/branches/non-call-eh/include/llvm/GlobalVariable.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/GlobalVariable.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/GlobalVariable.h (original)
+++ llvm/branches/non-call-eh/include/llvm/GlobalVariable.h Sun Jul  6 15:45:41 2008
@@ -21,6 +21,7 @@
 #define LLVM_GLOBAL_VARIABLE_H
 
 #include "llvm/GlobalValue.h"
+#include "llvm/OperandTraits.h"
 
 namespace llvm {
 
@@ -44,26 +45,32 @@
 
   bool isConstantGlobal : 1;           // Is this a global constant?
   bool isThreadLocalSymbol : 1;        // Is this symbol "Thread Local"?
-  Use Initializer;
 
 public:
-  // allocate space for exactly zero operands
+  // allocate space for exactly one operand
   void *operator new(size_t s) {
-    return User::operator new(s, 0);
+    return User::operator new(s, 1);
   }
   /// GlobalVariable ctor - If a parent module is specified, the global is
   /// automatically inserted into the end of the specified modules global list.
   GlobalVariable(const Type *Ty, bool isConstant, LinkageTypes Linkage,
                  Constant *Initializer = 0, const std::string &Name = "",
-                 Module *Parent = 0, bool ThreadLocal = false, 
+                 Module *Parent = 0, bool ThreadLocal = false,
                  unsigned AddressSpace = 0);
   /// GlobalVariable ctor - This creates a global and inserts it before the
   /// specified other global.
   GlobalVariable(const Type *Ty, bool isConstant, LinkageTypes Linkage,
                  Constant *Initializer, const std::string &Name,
-                 GlobalVariable *InsertBefore, bool ThreadLocal = false, 
+                 GlobalVariable *InsertBefore, bool ThreadLocal = false,
                  unsigned AddressSpace = 0);
-  
+
+  ~GlobalVariable() {
+    NumOperands = 1; // FIXME: needed by operator delete
+  }
+
+  /// Provide fast operand accessors
+  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
+
   /// isDeclaration - Is this global variable lacking an initializer?  If so, 
   /// the global variable is defined in some other translation unit, and is thus
   /// only a declaration here.
@@ -79,24 +86,24 @@
   /// illegal to call this method if the global is external, because we cannot
   /// tell what the value is initialized to!
   ///
-  inline Constant *getInitializer() const {
+  inline /*const FIXME*/ Constant *getInitializer() const {
     assert(hasInitializer() && "GV doesn't have initializer!");
-    return reinterpret_cast<Constant*>(Initializer.get());
+    return static_cast<Constant*>(Op<0>().get());
   }
   inline Constant *getInitializer() {
     assert(hasInitializer() && "GV doesn't have initializer!");
-    return reinterpret_cast<Constant*>(Initializer.get());
+    return static_cast<Constant*>(Op<0>().get());
   }
   inline void setInitializer(Constant *CPV) {
     if (CPV == 0) {
       if (hasInitializer()) {
-        Initializer.set(0);
+        Op<0>().set(0);
         NumOperands = 0;
       }
     } else {
       if (!hasInitializer())
         NumOperands = 1;
-      Initializer.set(CPV);
+      Op<0>().set(CPV);
     }
   }
 
@@ -105,11 +112,15 @@
   /// leads to undefined behavior.
   ///
   bool isConstant() const { return isConstantGlobal; }
-  void setConstant(bool Value) { isConstantGlobal = Value; }
+  void setConstant(bool Val) { isConstantGlobal = Val; }
 
   /// If the value is "Thread Local", its value isn't shared by the threads.
   bool isThreadLocal() const { return isThreadLocalSymbol; }
-  void setThreadLocal(bool Value) { isThreadLocalSymbol = Value; }
+  void setThreadLocal(bool Val) { isThreadLocalSymbol = Val; }
+
+  /// copyAttributesFrom - copy all additional attributes (those not needed to
+  /// create a GlobalVariable) from the GlobalVariable Src to this one.
+  void copyAttributesFrom(const GlobalValue *Src);
 
   /// removeFromParent - This method unlinks 'this' from the containing module,
   /// but does not delete it.
@@ -141,6 +152,12 @@
   const GlobalVariable *getPrev() const { return Prev; }
 };
 
+template <>
+struct OperandTraits<GlobalVariable> : OptionalOperandTraits<> {
+};
+
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(GlobalVariable, Value)
+
 } // End llvm namespace
 
 #endif

Modified: llvm/branches/non-call-eh/include/llvm/InstrTypes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/InstrTypes.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/InstrTypes.h (original)
+++ llvm/branches/non-call-eh/include/llvm/InstrTypes.h Sun Jul  6 15:45:41 2008
@@ -17,6 +17,7 @@
 #define LLVM_INSTRUCTION_TYPES_H
 
 #include "llvm/Instruction.h"
+#include "llvm/OperandTraits.h"
 
 namespace llvm {
 
@@ -78,22 +79,23 @@
   }
 };
 
+
 //===----------------------------------------------------------------------===//
 //                          UnaryInstruction Class
 //===----------------------------------------------------------------------===//
 
 class UnaryInstruction : public Instruction {
-  void *operator new(size_t, unsigned); // Do not implement
-  Use Op;
-  
-  // avoiding warning: 'this' : used in base member initializer list
-  UnaryInstruction* this_() { return this; }
+  void *operator new(size_t, unsigned);      // Do not implement
+  UnaryInstruction(const UnaryInstruction&); // Do not implement
+
 protected:
-  UnaryInstruction(const Type *Ty, unsigned iType, Value *V, Instruction *IB =0)
-    : Instruction(Ty, iType, &Op, 1, IB), Op(V, this_()) {
+  UnaryInstruction(const Type *Ty, unsigned iType, Value *V, Instruction *IB = 0)
+    : Instruction(Ty, iType, &Op<0>(), 1, IB) {
+    Op<0>() = V;
   }
   UnaryInstruction(const Type *Ty, unsigned iType, Value *V, BasicBlock *IAE)
-    : Instruction(Ty, iType, &Op, 1, IAE), Op(V, this_()) {
+    : Instruction(Ty, iType, &Op<0>(), 1, IAE) {
+    Op<0>() = V;
   }
 public:
   // allocate space for exactly one operand
@@ -104,16 +106,8 @@
   // Out of line virtual method, so the vtable, etc has a home.
   ~UnaryInstruction();
 
-  // Transparently provide more efficient getOperand methods.
-  Value *getOperand(unsigned i) const {
-    assert(i == 0 && "getOperand() out of range!");
-    return Op;
-  }
-  void setOperand(unsigned i, Value *Val) {
-    assert(i == 0 && "setOperand() out of range!");
-    Op = Val;
-  }
-  unsigned getNumOperands() const { return 1; }
+  /// Transparently provide more efficient getOperand methods.
+  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
   
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const UnaryInstruction *) { return true; }
@@ -123,6 +117,8 @@
            I->getOpcode() == Instruction::Free ||
            I->getOpcode() == Instruction::Load ||
            I->getOpcode() == Instruction::VAArg ||
+           I->getOpcode() == Instruction::GetResult ||
+           I->getOpcode() == Instruction::ExtractValue ||
            (I->getOpcode() >= CastOpsBegin && I->getOpcode() < CastOpsEnd);
   }
   static inline bool classof(const Value *V) {
@@ -130,13 +126,18 @@
   }
 };
 
+template <>
+struct OperandTraits<UnaryInstruction> : FixedNumOperandTraits<1> {
+};
+
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(UnaryInstruction, Value)
+
 //===----------------------------------------------------------------------===//
 //                           BinaryOperator Class
 //===----------------------------------------------------------------------===//
 
 class BinaryOperator : public Instruction {
   void *operator new(size_t, unsigned); // Do not implement
-  Use Ops[2];
 protected:
   void init(BinaryOps iType);
   BinaryOperator(BinaryOps iType, Value *S1, Value *S2, const Type *Ty,
@@ -150,52 +151,44 @@
   }
 
   /// Transparently provide more efficient getOperand methods.
-  Value *getOperand(unsigned i) const {
-    assert(i < 2 && "getOperand() out of range!");
-    return Ops[i];
-  }
-  void setOperand(unsigned i, Value *Val) {
-    assert(i < 2 && "setOperand() out of range!");
-    Ops[i] = Val;
-  }
-  unsigned getNumOperands() const { return 2; }
+  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
 
-  /// create() - Construct a binary instruction, given the opcode and the two
+  /// Create() - Construct a binary instruction, given the opcode and the two
   /// operands.  Optionally (if InstBefore is specified) insert the instruction
   /// into a BasicBlock right before the specified instruction.  The specified
   /// Instruction is allowed to be a dereferenced end iterator.
   ///
-  static BinaryOperator *create(BinaryOps Op, Value *S1, Value *S2,
+  static BinaryOperator *Create(BinaryOps Op, Value *S1, Value *S2,
                                 const std::string &Name = "",
                                 Instruction *InsertBefore = 0);
 
-  /// create() - Construct a binary instruction, given the opcode and the two
+  /// Create() - Construct a binary instruction, given the opcode and the two
   /// operands.  Also automatically insert this instruction to the end of the
   /// BasicBlock specified.
   ///
-  static BinaryOperator *create(BinaryOps Op, Value *S1, Value *S2,
+  static BinaryOperator *Create(BinaryOps Op, Value *S1, Value *S2,
                                 const std::string &Name,
                                 BasicBlock *InsertAtEnd);
 
-  /// create* - These methods just forward to create, and are useful when you
+  /// Create* - These methods just forward to Create, and are useful when you
   /// statically know what type of instruction you're going to create.  These
   /// helpers just save some typing.
 #define HANDLE_BINARY_INST(N, OPC, CLASS) \
-  static BinaryOperator *create##OPC(Value *V1, Value *V2, \
+  static BinaryOperator *Create##OPC(Value *V1, Value *V2, \
                                      const std::string &Name = "") {\
-    return create(Instruction::OPC, V1, V2, Name);\
+    return Create(Instruction::OPC, V1, V2, Name);\
   }
 #include "llvm/Instruction.def"
 #define HANDLE_BINARY_INST(N, OPC, CLASS) \
-  static BinaryOperator *create##OPC(Value *V1, Value *V2, \
+  static BinaryOperator *Create##OPC(Value *V1, Value *V2, \
                                      const std::string &Name, BasicBlock *BB) {\
-    return create(Instruction::OPC, V1, V2, Name, BB);\
+    return Create(Instruction::OPC, V1, V2, Name, BB);\
   }
 #include "llvm/Instruction.def"
 #define HANDLE_BINARY_INST(N, OPC, CLASS) \
-  static BinaryOperator *create##OPC(Value *V1, Value *V2, \
+  static BinaryOperator *Create##OPC(Value *V1, Value *V2, \
                                      const std::string &Name, Instruction *I) {\
-    return create(Instruction::OPC, V1, V2, Name, I);\
+    return Create(Instruction::OPC, V1, V2, Name, I);\
   }
 #include "llvm/Instruction.def"
 
@@ -203,16 +196,16 @@
   /// Helper functions to construct and inspect unary operations (NEG and NOT)
   /// via binary operators SUB and XOR:
   ///
-  /// createNeg, createNot - Create the NEG and NOT
+  /// CreateNeg, CreateNot - Create the NEG and NOT
   ///     instructions out of SUB and XOR instructions.
   ///
-  static BinaryOperator *createNeg(Value *Op, const std::string &Name = "",
+  static BinaryOperator *CreateNeg(Value *Op, const std::string &Name = "",
                                    Instruction *InsertBefore = 0);
-  static BinaryOperator *createNeg(Value *Op, const std::string &Name,
+  static BinaryOperator *CreateNeg(Value *Op, const std::string &Name,
                                    BasicBlock *InsertAtEnd);
-  static BinaryOperator *createNot(Value *Op, const std::string &Name = "",
+  static BinaryOperator *CreateNot(Value *Op, const std::string &Name = "",
                                    Instruction *InsertBefore = 0);
-  static BinaryOperator *createNot(Value *Op, const std::string &Name,
+  static BinaryOperator *CreateNot(Value *Op, const std::string &Name,
                                    BasicBlock *InsertAtEnd);
 
   /// isNeg, isNot - Check if the given Value is a NEG or NOT instruction.
@@ -236,10 +229,8 @@
 
   /// swapOperands - Exchange the two operands to this instruction.
   /// This instruction is safe to use on any binary instruction and
-  /// does not modify the semantics of the instruction.  If the
-  /// instruction is order dependent (SetLT f.e.) the opcode is
-  /// changed.  If the instruction cannot be reversed (ie, it's a Div),
-  /// then return true.
+  /// does not modify the semantics of the instruction.  If the instruction
+  /// cannot be reversed (ie, it's a Div), then return true.
   ///
   bool swapOperands();
 
@@ -251,8 +242,61 @@
   static inline bool classof(const Value *V) {
     return isa<Instruction>(V) && classof(cast<Instruction>(V));
   }
+
+  /// Backward-compatible interfaces
+  /// @deprecated in 2.4, do not use, will disappear soon
+  static BinaryOperator *create(BinaryOps Op, Value *S1, Value *S2,
+                                const std::string &Name = "",
+                                Instruction *InsertBefore = 0) {
+    return Create(Op, S1, S2, Name, InsertBefore);
+  }
+  static BinaryOperator *create(BinaryOps Op, Value *S1, Value *S2,
+                                const std::string &Name,
+                                BasicBlock *InsertAtEnd) {
+    return Create(Op, S1, S2, Name, InsertAtEnd);
+  }
+#define HANDLE_BINARY_INST(N, OPC, CLASS) \
+  static BinaryOperator *create##OPC(Value *V1, Value *V2, \
+                                     const std::string &Name = "") {\
+    return Create(Instruction::OPC, V1, V2, Name);\
+  }
+#include "llvm/Instruction.def"
+#define HANDLE_BINARY_INST(N, OPC, CLASS) \
+  static BinaryOperator *create##OPC(Value *V1, Value *V2, \
+                                     const std::string &Name, BasicBlock *BB) {\
+    return Create(Instruction::OPC, V1, V2, Name, BB);\
+  }
+#include "llvm/Instruction.def"
+#define HANDLE_BINARY_INST(N, OPC, CLASS) \
+  static BinaryOperator *create##OPC(Value *V1, Value *V2, \
+                                     const std::string &Name, Instruction *I) {\
+    return Create(Instruction::OPC, V1, V2, Name, I);\
+  }
+#include "llvm/Instruction.def"
+  static BinaryOperator *createNeg(Value *Op, const std::string &Name = "",
+                                   Instruction *InsertBefore = 0) {
+    return CreateNeg(Op, Name, InsertBefore);
+  }
+  static BinaryOperator *createNeg(Value *Op, const std::string &Name,
+                                   BasicBlock *InsertAtEnd) {
+    return CreateNeg(Op, Name, InsertAtEnd);
+  }
+  static BinaryOperator *createNot(Value *Op, const std::string &Name = "",
+                                   Instruction *InsertBefore = 0) {
+    return CreateNot(Op, Name, InsertBefore);
+  }
+  static BinaryOperator *createNot(Value *Op, const std::string &Name,
+                                   BasicBlock *InsertAtEnd) {
+    return CreateNot(Op, Name, InsertAtEnd);
+  }
 };
 
+template <>
+struct OperandTraits<BinaryOperator> : FixedNumOperandTraits<2> {
+};
+
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(BinaryOperator, Value)
+
 //===----------------------------------------------------------------------===//
 //                               CastInst Class
 //===----------------------------------------------------------------------===//
@@ -290,7 +334,7 @@
   /// constructor has insert-before-instruction semantics to automatically
   /// insert the new CastInst before InsertBefore (if it is non-null).
   /// @brief Construct any of the CastInst subclasses
-  static CastInst *create(
+  static CastInst *Create(
     Instruction::CastOps,    ///< The opcode of the cast instruction
     Value *S,                ///< The value to be casted (operand 0)
     const Type *Ty,          ///< The type to which cast should be made
@@ -303,7 +347,7 @@
   /// to automatically insert the new CastInst at the end of InsertAtEnd (if
   /// its non-null).
   /// @brief Construct any of the CastInst subclasses
-  static CastInst *create(
+  static CastInst *Create(
     Instruction::CastOps,    ///< The opcode for the cast instruction
     Value *S,                ///< The value to be casted (operand 0)
     const Type *Ty,          ///< The type to which operand is casted
@@ -312,7 +356,7 @@
   );
 
   /// @brief Create a ZExt or BitCast cast instruction
-  static CastInst *createZExtOrBitCast(
+  static CastInst *CreateZExtOrBitCast(
     Value *S,                ///< The value to be casted (operand 0)
     const Type *Ty,          ///< The type to which cast should be made
     const std::string &Name = "", ///< Name for the instruction
@@ -320,7 +364,7 @@
   );
 
   /// @brief Create a ZExt or BitCast cast instruction
-  static CastInst *createZExtOrBitCast(
+  static CastInst *CreateZExtOrBitCast(
     Value *S,                ///< The value to be casted (operand 0)
     const Type *Ty,          ///< The type to which operand is casted
     const std::string &Name, ///< The name for the instruction
@@ -328,15 +372,23 @@
   );
 
   /// @brief Create a SExt or BitCast cast instruction
-  static CastInst *createSExtOrBitCast(
+  static CastInst *CreateSExtOrBitCast(
     Value *S,                ///< The value to be casted (operand 0)
     const Type *Ty,          ///< The type to which cast should be made
     const std::string &Name = "", ///< Name for the instruction
     Instruction *InsertBefore = 0 ///< Place to insert the instruction
   );
 
+  /// @brief Create a SExt or BitCast cast instruction
+  static CastInst *CreateSExtOrBitCast(
+    Value *S,                ///< The value to be casted (operand 0)
+    const Type *Ty,          ///< The type to which operand is casted
+    const std::string &Name, ///< The name for the instruction
+    BasicBlock *InsertAtEnd  ///< The block to insert the instruction into
+  );
+
   /// @brief Create a BitCast or a PtrToInt cast instruction
-  static CastInst *createPointerCast(
+  static CastInst *CreatePointerCast(
     Value *S,                ///< The pointer value to be casted (operand 0)
     const Type *Ty,          ///< The type to which operand is casted
     const std::string &Name, ///< The name for the instruction
@@ -344,7 +396,7 @@
   );
 
   /// @brief Create a BitCast or a PtrToInt cast instruction
-  static CastInst *createPointerCast(
+  static CastInst *CreatePointerCast(
     Value *S,                ///< The pointer value to be casted (operand 0)
     const Type *Ty,          ///< The type to which cast should be made
     const std::string &Name = "", ///< Name for the instruction
@@ -352,7 +404,7 @@
   );
 
   /// @brief Create a ZExt, BitCast, or Trunc for int -> int casts.
-  static CastInst *createIntegerCast(
+  static CastInst *CreateIntegerCast(
     Value *S,                ///< The pointer value to be casted (operand 0)
     const Type *Ty,          ///< The type to which cast should be made
     bool isSigned,           ///< Whether to regard S as signed or not
@@ -361,7 +413,7 @@
   );
 
   /// @brief Create a ZExt, BitCast, or Trunc for int -> int casts.
-  static CastInst *createIntegerCast(
+  static CastInst *CreateIntegerCast(
     Value *S,                ///< The integer value to be casted (operand 0)
     const Type *Ty,          ///< The integer type to which operand is casted
     bool isSigned,           ///< Whether to regard S as signed or not
@@ -370,7 +422,7 @@
   );
 
   /// @brief Create an FPExt, BitCast, or FPTrunc for fp -> fp casts
-  static CastInst *createFPCast(
+  static CastInst *CreateFPCast(
     Value *S,                ///< The floating point value to be casted 
     const Type *Ty,          ///< The floating point type to cast to
     const std::string &Name = "", ///< Name for the instruction
@@ -378,23 +430,15 @@
   );
 
   /// @brief Create an FPExt, BitCast, or FPTrunc for fp -> fp casts
-  static CastInst *createFPCast(
+  static CastInst *CreateFPCast(
     Value *S,                ///< The floating point value to be casted 
     const Type *Ty,          ///< The floating point type to cast to
     const std::string &Name, ///< The name for the instruction
     BasicBlock *InsertAtEnd  ///< The block to insert the instruction into
   );
 
-  /// @brief Create a SExt or BitCast cast instruction
-  static CastInst *createSExtOrBitCast(
-    Value *S,                ///< The value to be casted (operand 0)
-    const Type *Ty,          ///< The type to which operand is casted
-    const std::string &Name, ///< The name for the instruction
-    BasicBlock *InsertAtEnd  ///< The block to insert the instruction into
-  );
-
   /// @brief Create a Trunc or BitCast cast instruction
-  static CastInst *createTruncOrBitCast(
+  static CastInst *CreateTruncOrBitCast(
     Value *S,                ///< The value to be casted (operand 0)
     const Type *Ty,          ///< The type to which cast should be made
     const std::string &Name = "", ///< Name for the instruction
@@ -402,7 +446,7 @@
   );
 
   /// @brief Create a Trunc or BitCast cast instruction
-  static CastInst *createTruncOrBitCast(
+  static CastInst *CreateTruncOrBitCast(
     Value *S,                ///< The value to be casted (operand 0)
     const Type *Ty,          ///< The type to which operand is casted
     const std::string &Name, ///< The name for the instruction
@@ -491,6 +535,40 @@
   static inline bool classof(const Value *V) {
     return isa<Instruction>(V) && classof(cast<Instruction>(V));
   }
+  /// Backward-compatible interfaces
+  /// @deprecated in 2.4, do not use, will disappear soon
+  static CastInst *create(Instruction::CastOps Op,Value *S,const Type *Ty,
+    const std::string &Name = "",Instruction *InsertBefore = 0) {
+    return Create(Op,S,Ty,Name,InsertBefore);
+  }
+  static CastInst *create(Instruction::CastOps Op,Value *S,const Type *Ty,
+    const std::string &Name,BasicBlock *InsertAtEnd) {
+    return Create(Op,S,Ty,Name,InsertAtEnd);
+  }
+
+#define DEFINE_CASTINST_DEPRECATED(OP)                                  \
+  static CastInst *create ## OP ## Cast(Value *S, const Type *Ty,       \
+    const std::string &Name = "", Instruction *InsertBefore = 0) {      \
+    return Create ## OP ## Cast(S, Ty, Name, InsertBefore);             \
+  }                                                                     \
+  static CastInst *create ## OP ## Cast(Value *S, const Type *Ty,       \
+    const std::string &Name, BasicBlock *InsertAtEnd) {                 \
+    return Create ## OP ## Cast(S, Ty, Name, InsertAtEnd);              \
+  }
+  DEFINE_CASTINST_DEPRECATED(ZExtOrBit)
+  DEFINE_CASTINST_DEPRECATED(SExtOrBit)
+  DEFINE_CASTINST_DEPRECATED(Pointer)
+  DEFINE_CASTINST_DEPRECATED(FP)
+  DEFINE_CASTINST_DEPRECATED(TruncOrBit)
+#undef DEFINE_CASTINST_DEPRECATED
+  static CastInst *createIntegerCast(Value *S, const Type *Ty, bool isSigned,
+    const std::string &Name = "", Instruction *InsertBefore = 0) {
+    return CreateIntegerCast(S, Ty, isSigned, Name, InsertBefore);
+  }
+  static CastInst *createIntegerCast(Value *S, const Type *Ty, bool isSigned,
+    const std::string &Name, BasicBlock *InsertAtEnd) {
+    return CreateIntegerCast(S, Ty, isSigned, Name, InsertAtEnd);
+  }
 };
 
 //===----------------------------------------------------------------------===//
@@ -499,19 +577,60 @@
 
 /// This class is the base class for the comparison instructions. 
 /// @brief Abstract base class of comparison instructions.
+// FIXME: why not derive from BinaryOperator?
 class CmpInst: public Instruction {
   void *operator new(size_t, unsigned);  // DO NOT IMPLEMENT
   CmpInst(); // do not implement
 protected:
-  CmpInst(Instruction::OtherOps op, unsigned short pred, Value *LHS, Value *RHS,
-          const std::string &Name = "", Instruction *InsertBefore = 0);
+  CmpInst(const Type *ty, Instruction::OtherOps op, unsigned short pred,
+          Value *LHS, Value *RHS, const std::string &Name = "",
+          Instruction *InsertBefore = 0);
   
-  CmpInst(Instruction::OtherOps op, unsigned short pred, Value *LHS, Value *RHS,
-          const std::string &Name, BasicBlock *InsertAtEnd);
-
-  Use Ops[2]; // CmpInst instructions always have 2 operands, optimize
+  CmpInst(const Type *ty, Instruction::OtherOps op, unsigned short pred,
+          Value *LHS, Value *RHS, const std::string &Name,
+          BasicBlock *InsertAtEnd);
 
 public:
+  /// This enumeration lists the possible predicates for CmpInst subclasses.
+  /// Values in the range 0-31 are reserved for FCmpInst, while values in the
+  /// range 32-64 are reserved for ICmpInst. This is necessary to ensure the
+  /// predicate values are not overlapping between the classes.
+  enum Predicate {
+    // Opcode             U L G E    Intuitive operation
+    FCMP_FALSE =  0,  /// 0 0 0 0    Always false (always folded)
+    FCMP_OEQ   =  1,  /// 0 0 0 1    True if ordered and equal
+    FCMP_OGT   =  2,  /// 0 0 1 0    True if ordered and greater than
+    FCMP_OGE   =  3,  /// 0 0 1 1    True if ordered and greater than or equal
+    FCMP_OLT   =  4,  /// 0 1 0 0    True if ordered and less than
+    FCMP_OLE   =  5,  /// 0 1 0 1    True if ordered and less than or equal
+    FCMP_ONE   =  6,  /// 0 1 1 0    True if ordered and operands are unequal
+    FCMP_ORD   =  7,  /// 0 1 1 1    True if ordered (no nans)
+    FCMP_UNO   =  8,  /// 1 0 0 0    True if unordered: isnan(X) | isnan(Y)
+    FCMP_UEQ   =  9,  /// 1 0 0 1    True if unordered or equal
+    FCMP_UGT   = 10,  /// 1 0 1 0    True if unordered or greater than
+    FCMP_UGE   = 11,  /// 1 0 1 1    True if unordered, greater than, or equal
+    FCMP_ULT   = 12,  /// 1 1 0 0    True if unordered or less than
+    FCMP_ULE   = 13,  /// 1 1 0 1    True if unordered, less than, or equal
+    FCMP_UNE   = 14,  /// 1 1 1 0    True if unordered or not equal
+    FCMP_TRUE  = 15,  /// 1 1 1 1    Always true (always folded)
+    FIRST_FCMP_PREDICATE = FCMP_FALSE,
+    LAST_FCMP_PREDICATE = FCMP_TRUE,
+    BAD_FCMP_PREDICATE = FCMP_TRUE + 1,
+    ICMP_EQ    = 32,  /// equal
+    ICMP_NE    = 33,  /// not equal
+    ICMP_UGT   = 34,  /// unsigned greater than
+    ICMP_UGE   = 35,  /// unsigned greater or equal
+    ICMP_ULT   = 36,  /// unsigned less than
+    ICMP_ULE   = 37,  /// unsigned less or equal
+    ICMP_SGT   = 38,  /// signed greater than
+    ICMP_SGE   = 39,  /// signed greater or equal
+    ICMP_SLT   = 40,  /// signed less than
+    ICMP_SLE   = 41,  /// signed less or equal
+    FIRST_ICMP_PREDICATE = ICMP_EQ,
+    LAST_ICMP_PREDICATE = ICMP_SLE,
+    BAD_ICMP_PREDICATE = ICMP_SLE + 1
+  };
+
   // allocate space for exactly two operands
   void *operator new(size_t s) {
     return User::operator new(s, 2);
@@ -521,7 +640,7 @@
   /// instruction into a BasicBlock right before the specified instruction.  
   /// The specified Instruction is allowed to be a dereferenced end iterator.
   /// @brief Create a CmpInst
-  static CmpInst *create(OtherOps Op, unsigned short predicate, Value *S1, 
+  static CmpInst *Create(OtherOps Op, unsigned short predicate, Value *S1, 
                          Value *S2, const std::string &Name = "",
                          Instruction *InsertBefore = 0);
 
@@ -529,7 +648,7 @@
   /// two operands.  Also automatically insert this instruction to the end of 
   /// the BasicBlock specified.
   /// @brief Create a CmpInst
-  static CmpInst *create(OtherOps Op, unsigned short predicate, Value *S1, 
+  static CmpInst *Create(OtherOps Op, unsigned short predicate, Value *S1, 
                          Value *S2, const std::string &Name, 
                          BasicBlock *InsertAtEnd);
 
@@ -538,29 +657,43 @@
     return static_cast<OtherOps>(Instruction::getOpcode());
   }
 
-  /// The predicate for CmpInst is defined by the subclasses but stored in 
-  /// the SubclassData field (see Value.h).  We allow it to be fetched here
-  /// as the predicate but there is no enum type for it, just the raw unsigned 
-  /// short. This facilitates comparison of CmpInst instances without delving
-  /// into the subclasses since predicate values are distinct between the
-  /// CmpInst subclasses.
   /// @brief Return the predicate for this instruction.
-  unsigned short getPredicate() const {
-    return SubclassData;
-  }
+  Predicate getPredicate() const { return Predicate(SubclassData); }
 
-  /// @brief Provide more efficient getOperand methods.
-  Value *getOperand(unsigned i) const {
-    assert(i < 2 && "getOperand() out of range!");
-    return Ops[i];
-  }
-  void setOperand(unsigned i, Value *Val) {
-    assert(i < 2 && "setOperand() out of range!");
-    Ops[i] = Val;
-  }
+  /// @brief Set the predicate for this instruction to the specified value.
+  void setPredicate(Predicate P) { SubclassData = P; }
+  
+  /// For example, EQ -> NE, UGT -> ULE, SLT -> SGE,
+  ///              OEQ -> UNE, UGT -> OLE, OLT -> UGE, etc.
+  /// @returns the inverse predicate for the instruction's current predicate. 
+  /// @brief Return the inverse of the instruction's predicate.
+  Predicate getInversePredicate() const {
+    return getInversePredicate(getPredicate());
+  }
+
+  /// For example, EQ -> NE, UGT -> ULE, SLT -> SGE,
+  ///              OEQ -> UNE, UGT -> OLE, OLT -> UGE, etc.
+  /// @returns the inverse predicate for predicate provided in \p pred. 
+  /// @brief Return the inverse of a given predicate
+  static Predicate getInversePredicate(Predicate pred);
+
+  /// For example, EQ->EQ, SLE->SGE, ULT->UGT,
+  ///              OEQ->OEQ, ULE->UGE, OLT->OGT, etc.
+  /// @returns the predicate that would be the result of exchanging the two 
+  /// operands of the CmpInst instruction without changing the result 
+  /// produced.  
+  /// @brief Return the predicate as if the operands were swapped
+  Predicate getSwappedPredicate() const {
+    return getSwappedPredicate(getPredicate());
+  }
+
+  /// This is a static version that you can use without an instruction 
+  /// available.
+  /// @brief Return the predicate as if the operands were swapped.
+  static Predicate getSwappedPredicate(Predicate pred);
 
-  /// @brief CmpInst instructions always have 2 operands.
-  unsigned getNumOperands() const { return 2; }
+  /// @brief Provide more efficient getOperand methods.
+  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
 
   /// This is just a convenience that dispatches to the subclasses.
   /// @brief Swap the operands and adjust predicate accordingly to retain
@@ -593,13 +726,35 @@
   static inline bool classof(const CmpInst *) { return true; }
   static inline bool classof(const Instruction *I) {
     return I->getOpcode() == Instruction::ICmp || 
-           I->getOpcode() == Instruction::FCmp;
+           I->getOpcode() == Instruction::FCmp ||
+           I->getOpcode() == Instruction::VICmp ||
+           I->getOpcode() == Instruction::VFCmp;
   }
   static inline bool classof(const Value *V) {
     return isa<Instruction>(V) && classof(cast<Instruction>(V));
   }
+  /// Backward-compatible interfaces
+  /// @deprecated in 2.4, do not use, will disappear soon
+  static CmpInst *create(OtherOps Op, unsigned short predicate, Value *S1, 
+                         Value *S2, const std::string &Name = "",
+                         Instruction *InsertBefore = 0) {
+    return Create(Op, predicate, S1, S2, Name, InsertBefore);
+  }
+  static CmpInst *create(OtherOps Op, unsigned short predicate, Value *S1, 
+                         Value *S2, const std::string &Name, 
+                         BasicBlock *InsertAtEnd) {
+    return Create(Op, predicate, S1, S2, Name, InsertAtEnd);
+  }
 };
 
+
+// FIXME: these are redundant if CmpInst < BinaryOperator
+template <>
+struct OperandTraits<CmpInst> : FixedNumOperandTraits<2> {
+};
+
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CmpInst, Value)
+
 } // End llvm namespace
 
 #endif

Modified: llvm/branches/non-call-eh/include/llvm/Instruction.def
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Instruction.def?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Instruction.def (original)
+++ llvm/branches/non-call-eh/include/llvm/Instruction.def Sun Jul  6 15:45:41 2008
@@ -161,12 +161,17 @@
 HANDLE_OTHER_INST(45, UserOp1, Instruction)  // May be used internally in a pass
 HANDLE_OTHER_INST(46, UserOp2, Instruction)  // Internal to passes only
 HANDLE_OTHER_INST(47, VAArg  , VAArgInst  )  // vaarg instruction
-HANDLE_OTHER_INST(48, ExtractElement, ExtractElementInst)// extract from vector.
+HANDLE_OTHER_INST(48, ExtractElement, ExtractElementInst)// extract from vector
 HANDLE_OTHER_INST(49, InsertElement, InsertElementInst)  // insert into vector
 HANDLE_OTHER_INST(50, ShuffleVector, ShuffleVectorInst)  // shuffle two vectors.
 HANDLE_OTHER_INST(51, GetResult, GetResultInst) // Extract individual value 
                                                 //from aggregate result
-  LAST_OTHER_INST(51)
+HANDLE_OTHER_INST(52, ExtractValue, ExtractValueInst)// extract from aggregate
+HANDLE_OTHER_INST(53, InsertValue, InsertValueInst)  // insert into aggregate
+HANDLE_OTHER_INST(54, VICmp  , VICmpInst  )  // Vec Int comparison instruction.
+HANDLE_OTHER_INST(55, VFCmp  , VFCmpInst  )  // Vec FP point comparison instr.
+
+  LAST_OTHER_INST(55)
 
 #undef  FIRST_TERM_INST
 #undef HANDLE_TERM_INST

Modified: llvm/branches/non-call-eh/include/llvm/Instruction.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Instruction.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Instruction.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Instruction.h Sun Jul  6 15:45:41 2008
@@ -20,7 +20,6 @@
 namespace llvm {
 
 struct AssemblyAnnotationWriter;
-class BinaryOperator;
 
 template<typename ValueSubClass, typename ItemParentClass>
   class SymbolTableListTraits;
@@ -50,6 +49,10 @@
   ///
   bool mayWriteToMemory() const;
 
+  /// mayReadFromMemory - Return true if this instruction may read memory.
+  ///
+  bool mayReadFromMemory() const;
+  
   /// clone() - Create a copy of 'this' instruction that is identical in all
   /// ways except the following:
   ///   * The instruction has no parent
@@ -99,6 +102,10 @@
   ///
   void eraseFromParent();
 
+  /// insertBefore - Insert an unlinked instructions into a basic block
+  /// immediately before the specified instruction.
+  void insertBefore(Instruction *InsertPos);
+
   /// moveBefore - Unlink this instruction from its current basic block and
   /// insert it into the basic block that MovePos lives in, right before
   /// MovePos.

Modified: llvm/branches/non-call-eh/include/llvm/Instructions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Instructions.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Instructions.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Instructions.h Sun Jul  6 15:45:41 2008
@@ -21,10 +21,11 @@
 #include "llvm/InstrTypes.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/ParameterAttributes.h"
+#include "llvm/BasicBlock.h"
+#include "llvm/ADT/SmallVector.h"
 
 namespace llvm {
 
-class BasicBlock;
 class ConstantInt;
 class PointerType;
 class VectorType;
@@ -288,11 +289,11 @@
 ///
 class StoreInst : public Instruction {
   void *operator new(size_t, unsigned);  // DO NOT IMPLEMENT
-  Use Ops[2];
   
-  StoreInst(const StoreInst &SI) : Instruction(SI.getType(), Store, Ops, 2) {
-    Ops[0].init(SI.Ops[0], this);
-    Ops[1].init(SI.Ops[1], this);
+  StoreInst(const StoreInst &SI) : Instruction(SI.getType(), Store,
+                                               &Op<0>(), 2) {
+    Op<0>() = SI.Op<0>();
+    Op<1>() = SI.Op<1>();
     setVolatile(SI.isVolatile());
     setAlignment(SI.getAlignment());
     
@@ -329,15 +330,7 @@
   }
 
   /// Transparently provide more efficient getOperand methods.
-  Value *getOperand(unsigned i) const {
-    assert(i < 2 && "getOperand() out of range!");
-    return Ops[i];
-  }
-  void setOperand(unsigned i, Value *Val) {
-    assert(i < 2 && "setOperand() out of range!");
-    Ops[i] = Val;
-  }
-  unsigned getNumOperands() const { return 2; }
+  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
 
   /// getAlignment - Return the alignment of the access that is being performed
   ///
@@ -363,6 +356,11 @@
   }
 };
 
+template <>
+struct OperandTraits<StoreInst> : FixedNumOperandTraits<2> {
+};
+
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(StoreInst, Value)
 
 //===----------------------------------------------------------------------===//
 //                             GetElementPtrInst Class
@@ -380,16 +378,10 @@
 /// access elements of arrays and structs
 ///
 class GetElementPtrInst : public Instruction {
-  GetElementPtrInst(const GetElementPtrInst &GEPI)
-    : Instruction(reinterpret_cast<const Type*>(GEPI.getType()), GetElementPtr,
-                  0, GEPI.getNumOperands()) {
-    Use *OL = OperandList = new Use[NumOperands];
-    Use *GEPIOL = GEPI.OperandList;
-    for (unsigned i = 0, E = NumOperands; i != E; ++i)
-      OL[i].init(GEPIOL[i], this);
-  }
-  void init(Value *Ptr, Value* const *Idx, unsigned NumIdx);
-  void init(Value *Ptr, Value *Idx);
+  GetElementPtrInst(const GetElementPtrInst &GEPI);
+  void init(Value *Ptr, Value* const *Idx, unsigned NumIdx,
+            const std::string &Name);
+  void init(Value *Ptr, Value *Idx, const std::string &Name);
 
   template<typename InputIterator>
   void init(Value *Ptr, InputIterator IdxBegin, InputIterator IdxEnd,
@@ -397,50 +389,42 @@
             // This argument ensures that we have an iterator we can
             // do arithmetic on in constant time
             std::random_access_iterator_tag) {
-    typename std::iterator_traits<InputIterator>::difference_type NumIdx = 
-      std::distance(IdxBegin, IdxEnd);
+    unsigned NumIdx = static_cast<unsigned>(std::distance(IdxBegin, IdxEnd));
     
     if (NumIdx > 0) {
-      // This requires that the itoerator points to contiguous memory.
-      init(Ptr, &*IdxBegin, NumIdx);
+      // This requires that the iterator points to contiguous memory.
+      init(Ptr, &*IdxBegin, NumIdx, Name); // FIXME: for the general case
+                                     // we have to build an array here
     }
     else {
-      init(Ptr, 0, NumIdx);
+      init(Ptr, 0, NumIdx, Name);
     }
-
-    setName(Name);
   }
 
   /// getIndexedType - Returns the type of the element that would be loaded with
   /// a load instruction with the specified parameters.
   ///
-  /// A null type is returned if the indices are invalid for the specified
+  /// Null is returned if the indices are invalid for the specified
   /// pointer type.
   ///
   static const Type *getIndexedType(const Type *Ptr,
-                                    Value* const *Idx, unsigned NumIdx,
-                                    bool AllowStructLeaf = false);
+                                    Value* const *Idx, unsigned NumIdx);
 
   template<typename InputIterator>
   static const Type *getIndexedType(const Type *Ptr,
                                     InputIterator IdxBegin, 
                                     InputIterator IdxEnd,
-                                    bool AllowStructLeaf,
                                     // This argument ensures that we
                                     // have an iterator we can do
                                     // arithmetic on in constant time
                                     std::random_access_iterator_tag) {
-    typename std::iterator_traits<InputIterator>::difference_type NumIdx = 
-      std::distance(IdxBegin, IdxEnd);
+    unsigned NumIdx = static_cast<unsigned>(std::distance(IdxBegin, IdxEnd));
 
-    if (NumIdx > 0) {
+    if (NumIdx > 0)
       // This requires that the iterator points to contiguous memory.
-      return(getIndexedType(Ptr, (Value *const *)&*IdxBegin, NumIdx,
-                            AllowStructLeaf));
-    }
-    else {
-      return(getIndexedType(Ptr, (Value *const*)0, NumIdx, AllowStructLeaf));
-    }
+      return getIndexedType(Ptr, (Value *const *)&*IdxBegin, NumIdx);
+    else
+      return getIndexedType(Ptr, (Value *const*)0, NumIdx);
   }
 
   /// Constructors - Create a getelementptr instruction with a base pointer an
@@ -448,34 +432,21 @@
   /// instruction, the second appends the new instruction to the specified
   /// BasicBlock.
   template<typename InputIterator>
-  GetElementPtrInst(Value *Ptr, InputIterator IdxBegin, 
-                    InputIterator IdxEnd,
-                    const std::string &Name = "",
-                    Instruction *InsertBefore = 0)
-      : Instruction(PointerType::get(
-                      checkType(getIndexedType(Ptr->getType(),
-                                               IdxBegin, IdxEnd, true)),
-                      cast<PointerType>(Ptr->getType())->getAddressSpace()),
-                    GetElementPtr, 0, 0, InsertBefore) {
-    init(Ptr, IdxBegin, IdxEnd, Name,
-         typename std::iterator_traits<InputIterator>::iterator_category());
-  }
-  template<typename InputIterator>
-  GetElementPtrInst(Value *Ptr, InputIterator IdxBegin, InputIterator IdxEnd,
-                    const std::string &Name, BasicBlock *InsertAtEnd)
-      : Instruction(PointerType::get(
-                      checkType(getIndexedType(Ptr->getType(),
-                                               IdxBegin, IdxEnd, true)),
-                      cast<PointerType>(Ptr->getType())->getAddressSpace()),
-                    GetElementPtr, 0, 0, InsertAtEnd) {
-    init(Ptr, IdxBegin, IdxEnd, Name,
-         typename std::iterator_traits<InputIterator>::iterator_category());
-  }
+  inline GetElementPtrInst(Value *Ptr, InputIterator IdxBegin, 
+                           InputIterator IdxEnd,
+                           unsigned Values,
+                           const std::string &Name,
+                           Instruction *InsertBefore);
+  template<typename InputIterator>
+  inline GetElementPtrInst(Value *Ptr,
+                           InputIterator IdxBegin, InputIterator IdxEnd,
+                           unsigned Values,
+                           const std::string &Name, BasicBlock *InsertAtEnd);
 
   /// Constructors - These two constructors are convenience methods because one
   /// and two index getelementptr instructions are so common.
-  GetElementPtrInst(Value *Ptr, Value *Idx,
-                    const std::string &Name = "", Instruction *InsertBefore = 0);
+  GetElementPtrInst(Value *Ptr, Value *Idx, const std::string &Name = "",
+                    Instruction *InsertBefore = 0);
   GetElementPtrInst(Value *Ptr, Value *Idx,
                     const std::string &Name, BasicBlock *InsertAtEnd);
 public:
@@ -484,28 +455,40 @@
                                    InputIterator IdxEnd,
                                    const std::string &Name = "",
                                    Instruction *InsertBefore = 0) {
-    return new(0/*FIXME*/) GetElementPtrInst(Ptr, IdxBegin, IdxEnd, Name, InsertBefore);
+    typename std::iterator_traits<InputIterator>::difference_type Values = 
+      1 + std::distance(IdxBegin, IdxEnd);
+    return new(Values)
+      GetElementPtrInst(Ptr, IdxBegin, IdxEnd, Values, Name, InsertBefore);
   }
   template<typename InputIterator>
-  static GetElementPtrInst *Create(Value *Ptr, InputIterator IdxBegin, InputIterator IdxEnd,
-                                   const std::string &Name, BasicBlock *InsertAtEnd) {
-    return new(0/*FIXME*/) GetElementPtrInst(Ptr, IdxBegin, IdxEnd, Name, InsertAtEnd);
+  static GetElementPtrInst *Create(Value *Ptr,
+                                   InputIterator IdxBegin, InputIterator IdxEnd,
+                                   const std::string &Name,
+                                   BasicBlock *InsertAtEnd) {
+    typename std::iterator_traits<InputIterator>::difference_type Values = 
+      1 + std::distance(IdxBegin, IdxEnd);
+    return new(Values)
+      GetElementPtrInst(Ptr, IdxBegin, IdxEnd, Values, Name, InsertAtEnd);
   }
 
-  /// Constructors - These two constructors are convenience methods because one
-  /// and two index getelementptr instructions are so common.
+  /// Constructors - These two creators are convenience methods because one
+  /// index getelementptr instructions are so common.
   static GetElementPtrInst *Create(Value *Ptr, Value *Idx,
-                                   const std::string &Name = "", Instruction *InsertBefore = 0) {
-    return new(2/*FIXME*/) GetElementPtrInst(Ptr, Idx, Name, InsertBefore);
+                                   const std::string &Name = "",
+                                   Instruction *InsertBefore = 0) {
+    return new(2) GetElementPtrInst(Ptr, Idx, Name, InsertBefore);
   }
   static GetElementPtrInst *Create(Value *Ptr, Value *Idx,
-                                   const std::string &Name, BasicBlock *InsertAtEnd) {
-    return new(2/*FIXME*/) GetElementPtrInst(Ptr, Idx, Name, InsertAtEnd);
+                                   const std::string &Name,
+                                   BasicBlock *InsertAtEnd) {
+    return new(2) GetElementPtrInst(Ptr, Idx, Name, InsertAtEnd);
   }
-  ~GetElementPtrInst();
 
   virtual GetElementPtrInst *clone() const;
 
+  /// Transparently provide more efficient getOperand methods.
+  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
+
   // getType - Overload to return most specific pointer type...
   const PointerType *getType() const {
     return reinterpret_cast<const PointerType*>(Instruction::getType());
@@ -514,17 +497,16 @@
   /// getIndexedType - Returns the type of the element that would be loaded with
   /// a load instruction with the specified parameters.
   ///
-  /// A null type is returned if the indices are invalid for the specified
+  /// Null is returned if the indices are invalid for the specified
   /// pointer type.
   ///
   template<typename InputIterator>
   static const Type *getIndexedType(const Type *Ptr,
                                     InputIterator IdxBegin,
-                                    InputIterator IdxEnd,
-                                    bool AllowStructLeaf = false) {
-    return(getIndexedType(Ptr, IdxBegin, IdxEnd, AllowStructLeaf, 
+                                    InputIterator IdxEnd) {
+    return getIndexedType(Ptr, IdxBegin, IdxEnd,
                           typename std::iterator_traits<InputIterator>::
-                          iterator_category()));
+                          iterator_category());
   }  
   static const Type *getIndexedType(const Type *Ptr, Value *Idx);
 
@@ -572,36 +554,61 @@
   }
 };
 
+template <>
+struct OperandTraits<GetElementPtrInst> : VariadicOperandTraits<1> {
+};
+
+template<typename InputIterator>
+GetElementPtrInst::GetElementPtrInst(Value *Ptr,
+                                     InputIterator IdxBegin, 
+                                     InputIterator IdxEnd,
+                                     unsigned Values,
+                                     const std::string &Name,
+                                     Instruction *InsertBefore)
+  : Instruction(PointerType::get(checkType(
+                                   getIndexedType(Ptr->getType(),
+                                                  IdxBegin, IdxEnd)),
+                                 cast<PointerType>(Ptr->getType())
+                                   ->getAddressSpace()),
+                GetElementPtr,
+                OperandTraits<GetElementPtrInst>::op_end(this) - Values,
+                Values, InsertBefore) {
+  init(Ptr, IdxBegin, IdxEnd, Name,
+       typename std::iterator_traits<InputIterator>::iterator_category());
+}
+template<typename InputIterator>
+GetElementPtrInst::GetElementPtrInst(Value *Ptr,
+                                     InputIterator IdxBegin,
+                                     InputIterator IdxEnd,
+                                     unsigned Values,
+                                     const std::string &Name,
+                                     BasicBlock *InsertAtEnd)
+  : Instruction(PointerType::get(checkType(
+                                   getIndexedType(Ptr->getType(),
+                                                  IdxBegin, IdxEnd)),
+                                 cast<PointerType>(Ptr->getType())
+                                   ->getAddressSpace()),
+                GetElementPtr,
+                OperandTraits<GetElementPtrInst>::op_end(this) - Values,
+                Values, InsertAtEnd) {
+  init(Ptr, IdxBegin, IdxEnd, Name,
+       typename std::iterator_traits<InputIterator>::iterator_category());
+}
+
+
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(GetElementPtrInst, Value)
+
+
 //===----------------------------------------------------------------------===//
 //                               ICmpInst Class
 //===----------------------------------------------------------------------===//
 
 /// This instruction compares its operands according to the predicate given
-/// to the constructor. It only operates on integers, pointers, or packed 
-/// vectors of integrals. The two operands must be the same type.
+/// to the constructor. It only operates on integers or pointers. The operands
+/// must be identical types.
 /// @brief Represent an integer comparison operator.
 class ICmpInst: public CmpInst {
 public:
-  /// This enumeration lists the possible predicates for the ICmpInst. The
-  /// values in the range 0-31 are reserved for FCmpInst while values in the
-  /// range 32-64 are reserved for ICmpInst. This is necessary to ensure the
-  /// predicate values are not overlapping between the classes.
-  enum Predicate {
-    ICMP_EQ  = 32,    ///< equal
-    ICMP_NE  = 33,    ///< not equal
-    ICMP_UGT = 34,    ///< unsigned greater than
-    ICMP_UGE = 35,    ///< unsigned greater or equal
-    ICMP_ULT = 36,    ///< unsigned less than
-    ICMP_ULE = 37,    ///< unsigned less or equal
-    ICMP_SGT = 38,    ///< signed greater than
-    ICMP_SGE = 39,    ///< signed greater or equal
-    ICMP_SLT = 40,    ///< signed less than
-    ICMP_SLE = 41,    ///< signed less or equal
-    FIRST_ICMP_PREDICATE = ICMP_EQ,
-    LAST_ICMP_PREDICATE = ICMP_SLE,
-    BAD_ICMP_PREDICATE = ICMP_SLE + 1
-  };
-
   /// @brief Constructor with insert-before-instruction semantics.
   ICmpInst(
     Predicate pred,  ///< The predicate to use for the comparison
@@ -609,7 +616,17 @@
     Value *RHS,      ///< The right-hand-side of the expression
     const std::string &Name = "",  ///< Name of the instruction
     Instruction *InsertBefore = 0  ///< Where to insert
-  ) : CmpInst(Instruction::ICmp, pred, LHS, RHS, Name, InsertBefore) {
+  ) : CmpInst(Type::Int1Ty, Instruction::ICmp, pred, LHS, RHS, Name,
+              InsertBefore) {
+    assert(pred >= CmpInst::FIRST_ICMP_PREDICATE &&
+           pred <= CmpInst::LAST_ICMP_PREDICATE &&
+           "Invalid ICmp predicate value");
+    assert(getOperand(0)->getType() == getOperand(1)->getType() &&
+          "Both operands to ICmp instruction are not of the same type!");
+    // Check that the operands are the right type
+    assert((getOperand(0)->getType()->isInteger() || 
+            isa<PointerType>(getOperand(0)->getType())) &&
+           "Invalid operand types for ICmp instruction");
   }
 
   /// @brief Constructor with insert-at-block-end semantics.
@@ -619,41 +636,19 @@
     Value *RHS,     ///< The right-hand-side of the expression
     const std::string &Name,  ///< Name of the instruction
     BasicBlock *InsertAtEnd   ///< Block to insert into.
-  ) : CmpInst(Instruction::ICmp, pred, LHS, RHS, Name, InsertAtEnd) {
+  ) : CmpInst(Type::Int1Ty, Instruction::ICmp, pred, LHS, RHS, Name,
+              InsertAtEnd) {
+    assert(pred >= CmpInst::FIRST_ICMP_PREDICATE &&
+           pred <= CmpInst::LAST_ICMP_PREDICATE &&
+           "Invalid ICmp predicate value");
+    assert(getOperand(0)->getType() == getOperand(1)->getType() &&
+          "Both operands to ICmp instruction are not of the same type!");
+    // Check that the operands are the right type
+    assert((getOperand(0)->getType()->isInteger() || 
+            isa<PointerType>(getOperand(0)->getType())) &&
+           "Invalid operand types for ICmp instruction");
   }
 
-  /// @brief Return the predicate for this instruction.
-  Predicate getPredicate() const { return Predicate(SubclassData); }
-
-  /// @brief Set the predicate for this instruction to the specified value.
-  void setPredicate(Predicate P) { SubclassData = P; }
-  
-  /// For example, EQ -> NE, UGT -> ULE, SLT -> SGE, etc.
-  /// @returns the inverse predicate for the instruction's current predicate. 
-  /// @brief Return the inverse of the instruction's predicate.
-  Predicate getInversePredicate() const {
-    return getInversePredicate(getPredicate());
-  }
-
-  /// For example, EQ -> NE, UGT -> ULE, SLT -> SGE, etc.
-  /// @returns the inverse predicate for predicate provided in \p pred. 
-  /// @brief Return the inverse of a given predicate
-  static Predicate getInversePredicate(Predicate pred);
-
-  /// For example, EQ->EQ, SLE->SGE, ULT->UGT, etc.
-  /// @returns the predicate that would be the result of exchanging the two 
-  /// operands of the ICmpInst instruction without changing the result 
-  /// produced.  
-  /// @brief Return the predicate as if the operands were swapped
-  Predicate getSwappedPredicate() const {
-    return getSwappedPredicate(getPredicate());
-  }
-
-  /// This is a static version that you can use without an instruction 
-  /// available.
-  /// @brief Return the predicate as if the operands were swapped.
-  static Predicate getSwappedPredicate(Predicate pred);
-
   /// For example, EQ->EQ, SLE->SLE, UGT->SGT, etc.
   /// @returns the predicate that would be the result if the operand were
   /// regarded as signed.
@@ -714,6 +709,22 @@
   /// @brief Determine if the predicate is signed.
   static bool isSignedPredicate(Predicate pred);
 
+  /// @returns true if the specified compare predicate is
+  /// true when both operands are equal...
+  /// @brief Determine if the icmp is true when both operands are equal
+  static bool isTrueWhenEqual(ICmpInst::Predicate pred) {
+    return pred == ICmpInst::ICMP_EQ  || pred == ICmpInst::ICMP_UGE ||
+           pred == ICmpInst::ICMP_SGE || pred == ICmpInst::ICMP_ULE ||
+           pred == ICmpInst::ICMP_SLE;
+  }
+
+  /// @returns true if the specified compare instruction is
+  /// true when both operands are equal...
+  /// @brief Determine if the ICmpInst returns true when both operands are equal
+  bool isTrueWhenEqual() {
+    return isTrueWhenEqual(getPredicate());
+  }
+
   /// Initialize a set of values that all satisfy the predicate with C. 
   /// @brief Make a ConstantRange for a relation with a constant value.
   static ConstantRange makeConstantRange(Predicate pred, const APInt &C);
@@ -725,7 +736,7 @@
   /// @brief Swap operands and adjust predicate.
   void swapOperands() {
     SubclassData = getSwappedPredicate();
-    std::swap(Ops[0], Ops[1]);
+    Op<0>().swap(Op<1>());
   }
 
   virtual ICmpInst *clone() const;
@@ -750,31 +761,6 @@
 /// @brief Represents a floating point comparison operator.
 class FCmpInst: public CmpInst {
 public:
-  /// This enumeration lists the possible predicates for the FCmpInst. Values
-  /// in the range 0-31 are reserved for FCmpInst.
-  enum Predicate {
-    // Opcode        U L G E    Intuitive operation
-    FCMP_FALSE = 0, ///<  0 0 0 0    Always false (always folded)
-    FCMP_OEQ   = 1, ///<  0 0 0 1    True if ordered and equal
-    FCMP_OGT   = 2, ///<  0 0 1 0    True if ordered and greater than
-    FCMP_OGE   = 3, ///<  0 0 1 1    True if ordered and greater than or equal
-    FCMP_OLT   = 4, ///<  0 1 0 0    True if ordered and less than
-    FCMP_OLE   = 5, ///<  0 1 0 1    True if ordered and less than or equal
-    FCMP_ONE   = 6, ///<  0 1 1 0    True if ordered and operands are unequal
-    FCMP_ORD   = 7, ///<  0 1 1 1    True if ordered (no nans)
-    FCMP_UNO   = 8, ///<  1 0 0 0    True if unordered: isnan(X) | isnan(Y)
-    FCMP_UEQ   = 9, ///<  1 0 0 1    True if unordered or equal
-    FCMP_UGT   =10, ///<  1 0 1 0    True if unordered or greater than
-    FCMP_UGE   =11, ///<  1 0 1 1    True if unordered, greater than, or equal
-    FCMP_ULT   =12, ///<  1 1 0 0    True if unordered or less than
-    FCMP_ULE   =13, ///<  1 1 0 1    True if unordered, less than, or equal
-    FCMP_UNE   =14, ///<  1 1 1 0    True if unordered or not equal
-    FCMP_TRUE  =15, ///<  1 1 1 1    Always true (always folded)
-    FIRST_FCMP_PREDICATE = FCMP_FALSE,
-    LAST_FCMP_PREDICATE = FCMP_TRUE,
-    BAD_FCMP_PREDICATE = FCMP_TRUE + 1
-  };
-
   /// @brief Constructor with insert-before-instruction semantics.
   FCmpInst(
     Predicate pred,  ///< The predicate to use for the comparison
@@ -782,7 +768,15 @@
     Value *RHS,      ///< The right-hand-side of the expression
     const std::string &Name = "",  ///< Name of the instruction
     Instruction *InsertBefore = 0  ///< Where to insert
-  ) : CmpInst(Instruction::FCmp, pred, LHS, RHS, Name, InsertBefore) {
+  ) : CmpInst(Type::Int1Ty, Instruction::FCmp, pred, LHS, RHS, Name,
+              InsertBefore) {
+    assert(pred <= FCmpInst::LAST_FCMP_PREDICATE &&
+           "Invalid FCmp predicate value");
+    assert(getOperand(0)->getType() == getOperand(1)->getType() &&
+           "Both operands to FCmp instruction are not of the same type!");
+    // Check that the operands are the right type
+    assert(getOperand(0)->getType()->isFloatingPoint() &&
+           "Invalid operand types for FCmp instruction");
   }
 
   /// @brief Constructor with insert-at-block-end semantics.
@@ -792,41 +786,17 @@
     Value *RHS,     ///< The right-hand-side of the expression
     const std::string &Name,  ///< Name of the instruction
     BasicBlock *InsertAtEnd   ///< Block to insert into.
-  ) : CmpInst(Instruction::FCmp, pred, LHS, RHS, Name, InsertAtEnd) {
+  ) : CmpInst(Type::Int1Ty, Instruction::FCmp, pred, LHS, RHS, Name,
+              InsertAtEnd) {
+    assert(pred <= FCmpInst::LAST_FCMP_PREDICATE &&
+           "Invalid FCmp predicate value");
+    assert(getOperand(0)->getType() == getOperand(1)->getType() &&
+           "Both operands to FCmp instruction are not of the same type!");
+    // Check that the operands are the right type
+    assert(getOperand(0)->getType()->isFloatingPoint() &&
+           "Invalid operand types for FCmp instruction");
   }
 
-  /// @brief Return the predicate for this instruction.
-  Predicate getPredicate() const { return Predicate(SubclassData); }
-
-  /// @brief Set the predicate for this instruction to the specified value.
-  void setPredicate(Predicate P) { SubclassData = P; }
-
-  /// For example, OEQ -> UNE, UGT -> OLE, OLT -> UGE, etc.
-  /// @returns the inverse predicate for the instructions current predicate. 
-  /// @brief Return the inverse of the predicate
-  Predicate getInversePredicate() const {
-    return getInversePredicate(getPredicate());
-  }
-
-  /// For example, OEQ -> UNE, UGT -> OLE, OLT -> UGE, etc.
-  /// @returns the inverse predicate for \p pred.
-  /// @brief Return the inverse of a given predicate
-  static Predicate getInversePredicate(Predicate pred);
-
-  /// For example, OEQ->OEQ, ULE->UGE, OLT->OGT, etc.
-  /// @returns the predicate that would be the result of exchanging the two 
-  /// operands of the ICmpInst instruction without changing the result 
-  /// produced.  
-  /// @brief Return the predicate as if the operands were swapped
-  Predicate getSwappedPredicate() const {
-    return getSwappedPredicate(getPredicate());
-  }
-
-  /// This is a static version that you can use without an instruction 
-  /// available.
-  /// @brief Return the predicate as if the operands were swapped.
-  static Predicate getSwappedPredicate(Predicate Opcode);
-
   /// This also tests for commutativity. If isEquality() returns true then
   /// the predicate is also commutative. Only the equality predicates are
   /// commutative.
@@ -849,7 +819,7 @@
   /// @brief Swap operands and adjust predicate.
   void swapOperands() {
     SubclassData = getSwappedPredicate();
-    std::swap(Ops[0], Ops[1]);
+    Op<0>().swap(Op<1>());
   }
 
   virtual FCmpInst *clone() const;
@@ -865,6 +835,118 @@
 };
 
 //===----------------------------------------------------------------------===//
+//                               VICmpInst Class
+//===----------------------------------------------------------------------===//
+
+/// This instruction compares its operands according to the predicate given
+/// to the constructor. It only operates on vectors of integers.
+/// The operands must be identical types.
+/// @brief Represents a vector integer comparison operator.
+class VICmpInst: public CmpInst {
+public:
+  /// @brief Constructor with insert-before-instruction semantics.
+  VICmpInst(
+    Predicate pred,  ///< The predicate to use for the comparison
+    Value *LHS,      ///< The left-hand-side of the expression
+    Value *RHS,      ///< The right-hand-side of the expression
+    const std::string &Name = "",  ///< Name of the instruction
+    Instruction *InsertBefore = 0  ///< Where to insert
+  ) : CmpInst(LHS->getType(), Instruction::VICmp, pred, LHS, RHS, Name,
+              InsertBefore) {
+    assert(pred >= CmpInst::FIRST_ICMP_PREDICATE &&
+           pred <= CmpInst::LAST_ICMP_PREDICATE &&
+           "Invalid VICmp predicate value");
+    assert(getOperand(0)->getType() == getOperand(1)->getType() &&
+          "Both operands to VICmp instruction are not of the same type!");
+  }
+
+  /// @brief Constructor with insert-at-block-end semantics.
+  VICmpInst(
+    Predicate pred, ///< The predicate to use for the comparison
+    Value *LHS,     ///< The left-hand-side of the expression
+    Value *RHS,     ///< The right-hand-side of the expression
+    const std::string &Name,  ///< Name of the instruction
+    BasicBlock *InsertAtEnd   ///< Block to insert into.
+  ) : CmpInst(LHS->getType(), Instruction::VICmp, pred, LHS, RHS, Name,
+              InsertAtEnd) {
+    assert(pred >= CmpInst::FIRST_ICMP_PREDICATE &&
+           pred <= CmpInst::LAST_ICMP_PREDICATE &&
+           "Invalid VICmp predicate value");
+    assert(getOperand(0)->getType() == getOperand(1)->getType() &&
+          "Both operands to VICmp instruction are not of the same type!");
+  }
+  
+  /// @brief Return the predicate for this instruction.
+  Predicate getPredicate() const { return Predicate(SubclassData); }
+
+  virtual VICmpInst *clone() const;
+
+  // Methods for support type inquiry through isa, cast, and dyn_cast:
+  static inline bool classof(const VICmpInst *) { return true; }
+  static inline bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::VICmp;
+  }
+  static inline bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+//===----------------------------------------------------------------------===//
+//                               VFCmpInst Class
+//===----------------------------------------------------------------------===//
+
+/// This instruction compares its operands according to the predicate given
+/// to the constructor. It only operates on vectors of floating point values.
+/// The operands must be identical types.
+/// @brief Represents a vector floating point comparison operator.
+class VFCmpInst: public CmpInst {
+public:
+  /// @brief Constructor with insert-before-instruction semantics.
+  VFCmpInst(
+    Predicate pred,  ///< The predicate to use for the comparison
+    Value *LHS,      ///< The left-hand-side of the expression
+    Value *RHS,      ///< The right-hand-side of the expression
+    const std::string &Name = "",  ///< Name of the instruction
+    Instruction *InsertBefore = 0  ///< Where to insert
+  ) : CmpInst(VectorType::getInteger(cast<VectorType>(LHS->getType())),
+              Instruction::VFCmp, pred, LHS, RHS, Name, InsertBefore) {
+    assert(pred <= CmpInst::LAST_FCMP_PREDICATE &&
+           "Invalid VFCmp predicate value");
+    assert(getOperand(0)->getType() == getOperand(1)->getType() &&
+           "Both operands to VFCmp instruction are not of the same type!");
+  }
+
+  /// @brief Constructor with insert-at-block-end semantics.
+  VFCmpInst(
+    Predicate pred, ///< The predicate to use for the comparison
+    Value *LHS,     ///< The left-hand-side of the expression
+    Value *RHS,     ///< The right-hand-side of the expression
+    const std::string &Name,  ///< Name of the instruction
+    BasicBlock *InsertAtEnd   ///< Block to insert into.
+  ) : CmpInst(VectorType::getInteger(cast<VectorType>(LHS->getType())),
+              Instruction::VFCmp, pred, LHS, RHS, Name, InsertAtEnd) {
+    assert(pred <= CmpInst::LAST_FCMP_PREDICATE &&
+           "Invalid VFCmp predicate value");
+    assert(getOperand(0)->getType() == getOperand(1)->getType() &&
+           "Both operands to VFCmp instruction are not of the same type!");
+  }
+
+  /// @brief Return the predicate for this instruction.
+  Predicate getPredicate() const { return Predicate(SubclassData); }
+
+  virtual VFCmpInst *clone() const;
+
+  /// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
+  static inline bool classof(const VFCmpInst *) { return true; }
+  static inline bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::VFCmp;
+  }
+  static inline bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+//===----------------------------------------------------------------------===//
 //                                 CallInst Class
 //===----------------------------------------------------------------------===//
 /// CallInst - This class represents a function call, abstracting a target
@@ -902,13 +984,7 @@
   /// @brief Construct a CallInst from a range of arguments
   template<typename InputIterator>
   CallInst(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd,
-           const std::string &Name = "", Instruction *InsertBefore = 0)
-      : Instruction(cast<FunctionType>(cast<PointerType>(Func->getType())
-                                       ->getElementType())->getReturnType(),
-                    Instruction::Call, 0, 0, InsertBefore) {
-    init(Func, ArgBegin, ArgEnd, Name, 
-         typename std::iterator_traits<InputIterator>::iterator_category());
-  }
+           const std::string &Name, Instruction *InsertBefore);
 
   /// Construct a CallInst given a range of arguments.  InputIterator
   /// must be a random-access iterator pointing to contiguous storage
@@ -917,32 +993,31 @@
   /// incur runtime overhead.
   /// @brief Construct a CallInst from a range of arguments
   template<typename InputIterator>
-  CallInst(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd,
-           const std::string &Name, BasicBlock *InsertAtEnd)
-      : Instruction(cast<FunctionType>(cast<PointerType>(Func->getType())
-                                       ->getElementType())->getReturnType(),
-                    Instruction::Call, 0, 0, InsertAtEnd) {
-    init(Func, ArgBegin, ArgEnd, Name,
-         typename std::iterator_traits<InputIterator>::iterator_category());
-  }
+  inline CallInst(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd,
+                  const std::string &Name, BasicBlock *InsertAtEnd);
 
-  CallInst(Value *F, Value *Actual, const std::string& Name = "",
-           Instruction *InsertBefore = 0);
+  CallInst(Value *F, Value *Actual, const std::string& Name,
+           Instruction *InsertBefore);
   CallInst(Value *F, Value *Actual, const std::string& Name,
            BasicBlock *InsertAtEnd);
-  explicit CallInst(Value *F, const std::string &Name = "",
-                    Instruction *InsertBefore = 0);
+  explicit CallInst(Value *F, const std::string &Name,
+                    Instruction *InsertBefore);
   CallInst(Value *F, const std::string &Name, BasicBlock *InsertAtEnd);
 public:
   template<typename InputIterator>
-  static CallInst *Create(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd,
-                          const std::string &Name = "", Instruction *InsertBefore = 0) {
-    return new(ArgEnd - ArgBegin + 1) CallInst(Func, ArgBegin, ArgEnd, Name, InsertBefore);
+  static CallInst *Create(Value *Func,
+                          InputIterator ArgBegin, InputIterator ArgEnd,
+                          const std::string &Name = "",
+                          Instruction *InsertBefore = 0) {
+    return new((unsigned)(ArgEnd - ArgBegin + 1))
+      CallInst(Func, ArgBegin, ArgEnd, Name, InsertBefore);
   }
   template<typename InputIterator>
-  static CallInst *Create(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd,
+  static CallInst *Create(Value *Func,
+                          InputIterator ArgBegin, InputIterator ArgEnd,
                           const std::string &Name, BasicBlock *InsertAtEnd) {
-    return new(ArgEnd - ArgBegin + 1) CallInst(Func, ArgBegin, ArgEnd, Name, InsertAtEnd);
+    return new((unsigned)(ArgEnd - ArgBegin + 1))
+      CallInst(Func, ArgBegin, ArgEnd, Name, InsertAtEnd);
   }
   static CallInst *Create(Value *F, Value *Actual, const std::string& Name = "",
                           Instruction *InsertBefore = 0) {
@@ -956,13 +1031,17 @@
                           Instruction *InsertBefore = 0) {
     return new(1) CallInst(F, Name, InsertBefore);
   }
-  static CallInst *Create(Value *F, const std::string &Name, BasicBlock *InsertAtEnd) {
+  static CallInst *Create(Value *F, const std::string &Name,
+                          BasicBlock *InsertAtEnd) {
     return new(1) CallInst(F, Name, InsertAtEnd);
   }
 
   ~CallInst();
 
   virtual CallInst *clone() const;
+
+  /// Provide fast operand accessors
+  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
   
   bool isTailCall() const           { return SubclassData & 1; }
   void setTailCall(bool isTailCall = true) {
@@ -982,6 +1061,9 @@
 
   /// setParamAttrs - Sets the parameter attributes for this call.
   void setParamAttrs(const PAListPtr &Attrs) { ParamAttrs = Attrs; }
+  
+  /// addParamAttr - adds the attribute to the list of attributes.
+  void addParamAttr(unsigned i, ParameterAttributes attr);
 
   /// @brief Determine whether the call or the callee has the given attribute.
   bool paramHasAttr(unsigned i, unsigned attr) const;
@@ -1046,6 +1128,36 @@
   }
 };
 
+template <>
+struct OperandTraits<CallInst> : VariadicOperandTraits<1> {
+};
+
+template<typename InputIterator>
+CallInst::CallInst(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd,
+                   const std::string &Name, BasicBlock *InsertAtEnd)
+  : Instruction(cast<FunctionType>(cast<PointerType>(Func->getType())
+                                   ->getElementType())->getReturnType(),
+                Instruction::Call,
+                OperandTraits<CallInst>::op_end(this) - (ArgEnd - ArgBegin + 1),
+                (unsigned)(ArgEnd - ArgBegin + 1), InsertAtEnd) {
+  init(Func, ArgBegin, ArgEnd, Name,
+       typename std::iterator_traits<InputIterator>::iterator_category());
+}
+
+template<typename InputIterator>
+CallInst::CallInst(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd,
+                   const std::string &Name, Instruction *InsertBefore)
+  : Instruction(cast<FunctionType>(cast<PointerType>(Func->getType())
+                                   ->getElementType())->getReturnType(),
+                Instruction::Call,
+                OperandTraits<CallInst>::op_end(this) - (ArgEnd - ArgBegin + 1),
+                (unsigned)(ArgEnd - ArgBegin + 1), InsertBefore) {
+  init(Func, ArgBegin, ArgEnd, Name, 
+       typename std::iterator_traits<InputIterator>::iterator_category());
+}
+
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CallInst, Value)
+
 //===----------------------------------------------------------------------===//
 //                               SelectInst Class
 //===----------------------------------------------------------------------===//
@@ -1053,54 +1165,47 @@
 /// SelectInst - This class represents the LLVM 'select' instruction.
 ///
 class SelectInst : public Instruction {
-  Use Ops[3];
-
   void init(Value *C, Value *S1, Value *S2) {
-    Ops[0].init(C, this);
-    Ops[1].init(S1, this);
-    Ops[2].init(S2, this);
+    Op<0>() = C;
+    Op<1>() = S1;
+    Op<2>() = S2;
   }
 
   SelectInst(const SelectInst &SI)
-    : Instruction(SI.getType(), SI.getOpcode(), Ops, 3) {
-    init(SI.Ops[0], SI.Ops[1], SI.Ops[2]);
+    : Instruction(SI.getType(), SI.getOpcode(), &Op<0>(), 3) {
+    init(SI.Op<0>(), SI.Op<1>(), SI.Op<2>());
   }
-  SelectInst(Value *C, Value *S1, Value *S2, const std::string &Name = "",
-             Instruction *InsertBefore = 0)
-    : Instruction(S1->getType(), Instruction::Select, Ops, 3, InsertBefore) {
+  SelectInst(Value *C, Value *S1, Value *S2, const std::string &Name,
+             Instruction *InsertBefore)
+    : Instruction(S1->getType(), Instruction::Select,
+                  &Op<0>(), 3, InsertBefore) {
     init(C, S1, S2);
     setName(Name);
   }
   SelectInst(Value *C, Value *S1, Value *S2, const std::string &Name,
              BasicBlock *InsertAtEnd)
-    : Instruction(S1->getType(), Instruction::Select, Ops, 3, InsertAtEnd) {
+    : Instruction(S1->getType(), Instruction::Select,
+                  &Op<0>(), 3, InsertAtEnd) {
     init(C, S1, S2);
     setName(Name);
   }
 public:
-  static SelectInst *Create(Value *C, Value *S1, Value *S2, const std::string &Name = "",
-             Instruction *InsertBefore = 0) {
+  static SelectInst *Create(Value *C, Value *S1, Value *S2,
+                            const std::string &Name = "",
+                            Instruction *InsertBefore = 0) {
     return new(3) SelectInst(C, S1, S2, Name, InsertBefore);
   }
-  static SelectInst *Create(Value *C, Value *S1, Value *S2, const std::string &Name,
-             BasicBlock *InsertAtEnd) {
+  static SelectInst *Create(Value *C, Value *S1, Value *S2,
+                            const std::string &Name, BasicBlock *InsertAtEnd) {
     return new(3) SelectInst(C, S1, S2, Name, InsertAtEnd);
   }
 
-  Value *getCondition() const { return Ops[0]; }
-  Value *getTrueValue() const { return Ops[1]; }
-  Value *getFalseValue() const { return Ops[2]; }
+  Value *getCondition() const { return Op<0>(); }
+  Value *getTrueValue() const { return Op<1>(); }
+  Value *getFalseValue() const { return Op<2>(); }
 
   /// Transparently provide more efficient getOperand methods.
-  Value *getOperand(unsigned i) const {
-    assert(i < 3 && "getOperand() out of range!");
-    return Ops[i];
-  }
-  void setOperand(unsigned i, Value *Val) {
-    assert(i < 3 && "setOperand() out of range!");
-    Ops[i] = Val;
-  }
-  unsigned getNumOperands() const { return 3; }
+  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
 
   OtherOps getOpcode() const {
     return static_cast<OtherOps>(Instruction::getOpcode());
@@ -1118,6 +1223,12 @@
   }
 };
 
+template <>
+struct OperandTraits<SelectInst> : FixedNumOperandTraits<3> {
+};
+
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(SelectInst, Value)
+
 //===----------------------------------------------------------------------===//
 //                                VAArgInst Class
 //===----------------------------------------------------------------------===//
@@ -1160,17 +1271,16 @@
 /// element from a VectorType value
 ///
 class ExtractElementInst : public Instruction {
-  Use Ops[2];
   ExtractElementInst(const ExtractElementInst &EE) :
-    Instruction(EE.getType(), ExtractElement, Ops, 2) {
-    Ops[0].init(EE.Ops[0], this);
-    Ops[1].init(EE.Ops[1], this);
+    Instruction(EE.getType(), ExtractElement, &Op<0>(), 2) {
+    Op<0>() = EE.Op<0>();
+    Op<1>() = EE.Op<1>();
   }
 
 public:
   // allocate space for exactly two operands
   void *operator new(size_t s) {
-    return User::operator new(s, 2); // FIXME: unsigned Idx forms of constructor?
+    return User::operator new(s, 2); // FIXME: "unsigned Idx" forms of ctor?
   }
   ExtractElementInst(Value *Vec, Value *Idx, const std::string &Name = "",
                      Instruction *InsertBefore = 0);
@@ -1188,15 +1298,7 @@
   virtual ExtractElementInst *clone() const;
 
   /// Transparently provide more efficient getOperand methods.
-  Value *getOperand(unsigned i) const {
-    assert(i < 2 && "getOperand() out of range!");
-    return Ops[i];
-  }
-  void setOperand(unsigned i, Value *Val) {
-    assert(i < 2 && "setOperand() out of range!");
-    Ops[i] = Val;
-  }
-  unsigned getNumOperands() const { return 2; }
+  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const ExtractElementInst *) { return true; }
@@ -1208,6 +1310,12 @@
   }
 };
 
+template <>
+struct OperandTraits<ExtractElementInst> : FixedNumOperandTraits<2> {
+};
+
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ExtractElementInst, Value)
+
 //===----------------------------------------------------------------------===//
 //                                InsertElementInst Class
 //===----------------------------------------------------------------------===//
@@ -1216,7 +1324,6 @@
 /// element into a VectorType value
 ///
 class InsertElementInst : public Instruction {
-  Use Ops[3];
   InsertElementInst(const InsertElementInst &IE);
   InsertElementInst(Value *Vec, Value *NewElt, Value *Idx,
                     const std::string &Name = "",Instruction *InsertBefore = 0);
@@ -1231,20 +1338,24 @@
     return new(IE.getNumOperands()) InsertElementInst(IE);
   }
   static InsertElementInst *Create(Value *Vec, Value *NewElt, Value *Idx,
-                                   const std::string &Name = "",Instruction *InsertBefore = 0) {
+                                   const std::string &Name = "",
+                                   Instruction *InsertBefore = 0) {
     return new(3) InsertElementInst(Vec, NewElt, Idx, Name, InsertBefore);
   }
   static InsertElementInst *Create(Value *Vec, Value *NewElt, unsigned Idx,
-                                   const std::string &Name = "",Instruction *InsertBefore = 0) {
-    return new(3/*FIXME*/) InsertElementInst(Vec, NewElt, Idx, Name, InsertBefore);
+                                   const std::string &Name = "",
+                                   Instruction *InsertBefore = 0) {
+    return new(3) InsertElementInst(Vec, NewElt, Idx, Name, InsertBefore);
   }
   static InsertElementInst *Create(Value *Vec, Value *NewElt, Value *Idx,
-                                   const std::string &Name, BasicBlock *InsertAtEnd) {
+                                   const std::string &Name,
+                                   BasicBlock *InsertAtEnd) {
     return new(3) InsertElementInst(Vec, NewElt, Idx, Name, InsertAtEnd);
   }
   static InsertElementInst *Create(Value *Vec, Value *NewElt, unsigned Idx,
-                                   const std::string &Name, BasicBlock *InsertAtEnd) {
-    return new(3/*FIXME*/) InsertElementInst(Vec, NewElt, Idx, Name, InsertAtEnd);
+                                   const std::string &Name,
+                                   BasicBlock *InsertAtEnd) {
+    return new(3) InsertElementInst(Vec, NewElt, Idx, Name, InsertAtEnd);
   }
 
   /// isValidOperands - Return true if an insertelement instruction can be
@@ -1261,15 +1372,7 @@
   }
 
   /// Transparently provide more efficient getOperand methods.
-  Value *getOperand(unsigned i) const {
-    assert(i < 3 && "getOperand() out of range!");
-    return Ops[i];
-  }
-  void setOperand(unsigned i, Value *Val) {
-    assert(i < 3 && "setOperand() out of range!");
-    Ops[i] = Val;
-  }
-  unsigned getNumOperands() const { return 3; }
+  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const InsertElementInst *) { return true; }
@@ -1281,6 +1384,12 @@
   }
 };
 
+template <>
+struct OperandTraits<InsertElementInst> : FixedNumOperandTraits<3> {
+};
+
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(InsertElementInst, Value)
+
 //===----------------------------------------------------------------------===//
 //                           ShuffleVectorInst Class
 //===----------------------------------------------------------------------===//
@@ -1289,7 +1398,6 @@
 /// input vectors.
 ///
 class ShuffleVectorInst : public Instruction {
-  Use Ops[3];
   ShuffleVectorInst(const ShuffleVectorInst &IE);
 public:
   // allocate space for exactly three operands
@@ -1315,19 +1423,7 @@
   }
 
   /// Transparently provide more efficient getOperand methods.
-  const Value *getOperand(unsigned i) const {
-    assert(i < 3 && "getOperand() out of range!");
-    return Ops[i];
-  }
-  Value *getOperand(unsigned i) {
-    assert(i < 3 && "getOperand() out of range!");
-    return Ops[i];
-  }
-  void setOperand(unsigned i, Value *Val) {
-    assert(i < 3 && "setOperand() out of range!");
-    Ops[i] = Val;
-  }
-  unsigned getNumOperands() const { return 3; }
+  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
   
   /// getMaskValue - Return the index from the shuffle mask for the specified
   /// output result.  This is either -1 if the element is undef or a number less
@@ -1344,6 +1440,383 @@
   }
 };
 
+template <>
+struct OperandTraits<ShuffleVectorInst> : FixedNumOperandTraits<3> {
+};
+
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ShuffleVectorInst, Value)
+
+//===----------------------------------------------------------------------===//
+//                                ExtractValueInst Class
+//===----------------------------------------------------------------------===//
+
+/// ExtractValueInst - This instruction extracts a struct member or array
+/// element value from an aggregate value.
+///
+class ExtractValueInst : public UnaryInstruction {
+  SmallVector<unsigned, 4> Indices;
+
+  ExtractValueInst(const ExtractValueInst &EVI);
+  void init(const unsigned *Idx, unsigned NumIdx,
+            const std::string &Name);
+  void init(unsigned Idx, const std::string &Name);
+
+  template<typename InputIterator>
+  void init(InputIterator IdxBegin, InputIterator IdxEnd,
+            const std::string &Name,
+            // This argument ensures that we have an iterator we can
+            // do arithmetic on in constant time
+            std::random_access_iterator_tag) {
+    unsigned NumIdx = static_cast<unsigned>(std::distance(IdxBegin, IdxEnd));
+    
+    // There's no fundamental reason why we require at least one index
+    // (other than weirdness with &*IdxBegin being invalid; see
+    // getelementptr's init routine for example). But there's no
+    // present need to support it.
+    assert(NumIdx > 0 && "ExtractValueInst must have at least one index");
+
+    // This requires that the iterator points to contiguous memory.
+    init(&*IdxBegin, NumIdx, Name); // FIXME: for the general case
+                                         // we have to build an array here
+  }
+
+  /// getIndexedType - Returns the type of the element that would be extracted
+  /// with an extractvalue instruction with the specified parameters.
+  ///
+  /// Null is returned if the indices are invalid for the specified
+  /// pointer type.
+  ///
+  static const Type *getIndexedType(const Type *Agg,
+                                    const unsigned *Idx, unsigned NumIdx);
+
+  template<typename InputIterator>
+  static const Type *getIndexedType(const Type *Ptr,
+                                    InputIterator IdxBegin, 
+                                    InputIterator IdxEnd,
+                                    // This argument ensures that we
+                                    // have an iterator we can do
+                                    // arithmetic on in constant time
+                                    std::random_access_iterator_tag) {
+    unsigned NumIdx = static_cast<unsigned>(std::distance(IdxBegin, IdxEnd));
+
+    if (NumIdx > 0)
+      // This requires that the iterator points to contiguous memory.
+      return getIndexedType(Ptr, &*IdxBegin, NumIdx);
+    else
+      return getIndexedType(Ptr, (const unsigned *)0, NumIdx);
+  }
+
+  /// Constructors - Create a extractvalue instruction with a base aggregate
+  /// value and a list of indices.  The first ctor can optionally insert before
+  /// an existing instruction, the second appends the new instruction to the
+  /// specified BasicBlock.
+  template<typename InputIterator>
+  inline ExtractValueInst(Value *Agg, InputIterator IdxBegin, 
+                          InputIterator IdxEnd,
+                          const std::string &Name,
+                          Instruction *InsertBefore);
+  template<typename InputIterator>
+  inline ExtractValueInst(Value *Agg,
+                          InputIterator IdxBegin, InputIterator IdxEnd,
+                          const std::string &Name, BasicBlock *InsertAtEnd);
+
+  // allocate space for exactly one operand
+  void *operator new(size_t s) {
+    return User::operator new(s, 1);
+  }
+
+public:
+  template<typename InputIterator>
+  static ExtractValueInst *Create(Value *Agg, InputIterator IdxBegin, 
+                                  InputIterator IdxEnd,
+                                  const std::string &Name = "",
+                                  Instruction *InsertBefore = 0) {
+    return new
+      ExtractValueInst(Agg, IdxBegin, IdxEnd, Name, InsertBefore);
+  }
+  template<typename InputIterator>
+  static ExtractValueInst *Create(Value *Agg,
+                                  InputIterator IdxBegin, InputIterator IdxEnd,
+                                  const std::string &Name,
+                                  BasicBlock *InsertAtEnd) {
+    return new ExtractValueInst(Agg, IdxBegin, IdxEnd, Name, InsertAtEnd);
+  }
+
+  /// Constructors - These two creators are convenience methods because one
+  /// index extractvalue instructions are much more common than those with
+  /// more than one.
+  static ExtractValueInst *Create(Value *Agg, unsigned Idx,
+                                  const std::string &Name = "",
+                                  Instruction *InsertBefore = 0) {
+    unsigned Idxs[1] = { Idx };
+    return new ExtractValueInst(Agg, Idxs, Idxs + 1, Name, InsertBefore);
+  }
+  static ExtractValueInst *Create(Value *Agg, unsigned Idx,
+                                  const std::string &Name,
+                                  BasicBlock *InsertAtEnd) {
+    unsigned Idxs[1] = { Idx };
+    return new ExtractValueInst(Agg, Idxs, Idxs + 1, Name, InsertAtEnd);
+  }
+
+  virtual ExtractValueInst *clone() const;
+
+  // getType - Overload to return most specific pointer type...
+  const PointerType *getType() const {
+    return reinterpret_cast<const PointerType*>(Instruction::getType());
+  }
+
+  /// getIndexedType - Returns the type of the element that would be extracted
+  /// with an extractvalue instruction with the specified parameters.
+  ///
+  /// Null is returned if the indices are invalid for the specified
+  /// pointer type.
+  ///
+  template<typename InputIterator>
+  static const Type *getIndexedType(const Type *Ptr,
+                                    InputIterator IdxBegin,
+                                    InputIterator IdxEnd) {
+    return getIndexedType(Ptr, IdxBegin, IdxEnd,
+                          typename std::iterator_traits<InputIterator>::
+                          iterator_category());
+  }  
+  static const Type *getIndexedType(const Type *Ptr, unsigned Idx);
+
+  typedef const unsigned* idx_iterator;
+  inline idx_iterator idx_begin() const { return Indices.begin(); }
+  inline idx_iterator idx_end()   const { return Indices.end(); }
+
+  Value *getAggregateOperand() {
+    return getOperand(0);
+  }
+  const Value *getAggregateOperand() const {
+    return getOperand(0);
+  }
+  static unsigned getAggregateOperandIndex() {
+    return 0U;                      // get index for modifying correct operand
+  }
+
+  unsigned getNumIndices() const {  // Note: always non-negative
+    return (unsigned)Indices.size();
+  }
+
+  bool hasIndices() const {
+    return true;
+  }
+  
+  // Methods for support type inquiry through isa, cast, and dyn_cast:
+  static inline bool classof(const ExtractValueInst *) { return true; }
+  static inline bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::ExtractValue;
+  }
+  static inline bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+template<typename InputIterator>
+ExtractValueInst::ExtractValueInst(Value *Agg,
+                                   InputIterator IdxBegin, 
+                                   InputIterator IdxEnd,
+                                   const std::string &Name,
+                                   Instruction *InsertBefore)
+  : UnaryInstruction(checkType(getIndexedType(Agg->getType(),
+					      IdxBegin, IdxEnd)),
+		     ExtractValue, Agg, InsertBefore) {
+  init(IdxBegin, IdxEnd, Name,
+       typename std::iterator_traits<InputIterator>::iterator_category());
+}
+template<typename InputIterator>
+ExtractValueInst::ExtractValueInst(Value *Agg,
+                                   InputIterator IdxBegin,
+                                   InputIterator IdxEnd,
+                                   const std::string &Name,
+                                   BasicBlock *InsertAtEnd)
+  : UnaryInstruction(checkType(getIndexedType(Agg->getType(),
+					      IdxBegin, IdxEnd)),
+		     ExtractValue, Agg, InsertAtEnd) {
+  init(IdxBegin, IdxEnd, Name,
+       typename std::iterator_traits<InputIterator>::iterator_category());
+}
+
+
+//===----------------------------------------------------------------------===//
+//                                InsertValueInst Class
+//===----------------------------------------------------------------------===//
+
+/// InsertValueInst - This instruction inserts a struct field of array element
+/// value into an aggregate value.
+///
+class InsertValueInst : public Instruction {
+  SmallVector<unsigned, 4> Indices;
+
+  void *operator new(size_t, unsigned); // Do not implement
+  InsertValueInst(const InsertValueInst &IVI);
+  void init(Value *Agg, Value *Val, const unsigned *Idx, unsigned NumIdx,
+            const std::string &Name);
+  void init(Value *Agg, Value *Val, unsigned Idx, const std::string &Name);
+
+  template<typename InputIterator>
+  void init(Value *Agg, Value *Val,
+            InputIterator IdxBegin, InputIterator IdxEnd,
+            const std::string &Name,
+            // This argument ensures that we have an iterator we can
+            // do arithmetic on in constant time
+            std::random_access_iterator_tag) {
+    unsigned NumIdx = static_cast<unsigned>(std::distance(IdxBegin, IdxEnd));
+    
+    // There's no fundamental reason why we require at least one index
+    // (other than weirdness with &*IdxBegin being invalid; see
+    // getelementptr's init routine for example). But there's no
+    // present need to support it.
+    assert(NumIdx > 0 && "InsertValueInst must have at least one index");
+
+    // This requires that the iterator points to contiguous memory.
+    init(Agg, Val, &*IdxBegin, NumIdx, Name); // FIXME: for the general case
+                                              // we have to build an array here
+  }
+
+  /// Constructors - Create a insertvalue instruction with a base aggregate
+  /// value, a value to insert, and a list of indices.  The first ctor can
+  /// optionally insert before an existing instruction, the second appends
+  /// the new instruction to the specified BasicBlock.
+  template<typename InputIterator>
+  inline InsertValueInst(Value *Agg, Value *Val, InputIterator IdxBegin, 
+                         InputIterator IdxEnd,
+                         const std::string &Name,
+                         Instruction *InsertBefore);
+  template<typename InputIterator>
+  inline InsertValueInst(Value *Agg, Value *Val,
+                         InputIterator IdxBegin, InputIterator IdxEnd,
+                         const std::string &Name, BasicBlock *InsertAtEnd);
+
+  /// Constructors - These two constructors are convenience methods because one
+  /// and two index insertvalue instructions are so common.
+  InsertValueInst(Value *Agg, Value *Val,
+                  unsigned Idx, const std::string &Name = "",
+                  Instruction *InsertBefore = 0);
+  InsertValueInst(Value *Agg, Value *Val, unsigned Idx,
+                  const std::string &Name, BasicBlock *InsertAtEnd);
+public:
+  // allocate space for exactly two operands
+  void *operator new(size_t s) {
+    return User::operator new(s, 2);
+  }
+
+  template<typename InputIterator>
+  static InsertValueInst *Create(Value *Agg, Value *Val, InputIterator IdxBegin,
+                                 InputIterator IdxEnd,
+                                 const std::string &Name = "",
+                                 Instruction *InsertBefore = 0) {
+    return new InsertValueInst(Agg, Val, IdxBegin, IdxEnd,
+                               Name, InsertBefore);
+  }
+  template<typename InputIterator>
+  static InsertValueInst *Create(Value *Agg, Value *Val,
+                                 InputIterator IdxBegin, InputIterator IdxEnd,
+                                 const std::string &Name,
+                                 BasicBlock *InsertAtEnd) {
+    return new InsertValueInst(Agg, Val, IdxBegin, IdxEnd,
+                               Name, InsertAtEnd);
+  }
+
+  /// Constructors - These two creators are convenience methods because one
+  /// index insertvalue instructions are much more common than those with
+  /// more than one.
+  static InsertValueInst *Create(Value *Agg, Value *Val, unsigned Idx,
+                                 const std::string &Name = "",
+                                 Instruction *InsertBefore = 0) {
+    return new InsertValueInst(Agg, Val, Idx, Name, InsertBefore);
+  }
+  static InsertValueInst *Create(Value *Agg, Value *Val, unsigned Idx,
+                                 const std::string &Name,
+                                 BasicBlock *InsertAtEnd) {
+    return new InsertValueInst(Agg, Val, Idx, Name, InsertAtEnd);
+  }
+
+  virtual InsertValueInst *clone() const;
+
+  /// Transparently provide more efficient getOperand methods.
+  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
+
+  // getType - Overload to return most specific pointer type...
+  const PointerType *getType() const {
+    return reinterpret_cast<const PointerType*>(Instruction::getType());
+  }
+
+  typedef const unsigned* idx_iterator;
+  inline idx_iterator idx_begin() const { return Indices.begin(); }
+  inline idx_iterator idx_end()   const { return Indices.end(); }
+
+  Value *getAggregateOperand() {
+    return getOperand(0);
+  }
+  const Value *getAggregateOperand() const {
+    return getOperand(0);
+  }
+  static unsigned getAggregateOperandIndex() {
+    return 0U;                      // get index for modifying correct operand
+  }
+
+  Value *getInsertedValueOperand() {
+    return getOperand(1);
+  }
+  const Value *getInsertedValueOperand() const {
+    return getOperand(1);
+  }
+  static unsigned getInsertedValueOperandIndex() {
+    return 1U;                      // get index for modifying correct operand
+  }
+
+  unsigned getNumIndices() const {  // Note: always non-negative
+    return (unsigned)Indices.size();
+  }
+
+  bool hasIndices() const {
+    return true;
+  }
+  
+  // Methods for support type inquiry through isa, cast, and dyn_cast:
+  static inline bool classof(const InsertValueInst *) { return true; }
+  static inline bool classof(const Instruction *I) {
+    return I->getOpcode() == Instruction::InsertValue;
+  }
+  static inline bool classof(const Value *V) {
+    return isa<Instruction>(V) && classof(cast<Instruction>(V));
+  }
+};
+
+template <>
+struct OperandTraits<InsertValueInst> : FixedNumOperandTraits<2> {
+};
+
+template<typename InputIterator>
+InsertValueInst::InsertValueInst(Value *Agg,
+                                 Value *Val,
+                                 InputIterator IdxBegin, 
+                                 InputIterator IdxEnd,
+                                 const std::string &Name,
+                                 Instruction *InsertBefore)
+  : Instruction(Agg->getType(), InsertValue,
+                OperandTraits<InsertValueInst>::op_begin(this),
+                2, InsertBefore) {
+  init(Agg, Val, IdxBegin, IdxEnd, Name,
+       typename std::iterator_traits<InputIterator>::iterator_category());
+}
+template<typename InputIterator>
+InsertValueInst::InsertValueInst(Value *Agg,
+                                 Value *Val,
+                                 InputIterator IdxBegin,
+                                 InputIterator IdxEnd,
+                                 const std::string &Name,
+                                 BasicBlock *InsertAtEnd)
+  : Instruction(Agg->getType(), InsertValue,
+                OperandTraits<InsertValueInst>::op_begin(this),
+                2, InsertAtEnd) {
+  init(Agg, Val, IdxBegin, IdxEnd, Name,
+       typename std::iterator_traits<InputIterator>::iterator_category());
+}
+
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(InsertValueInst, Value)
 
 //===----------------------------------------------------------------------===//
 //                               PHINode Class
@@ -1380,7 +1853,8 @@
                          Instruction *InsertBefore = 0) {
     return new PHINode(Ty, Name, InsertBefore);
   }
-  static PHINode *Create(const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd) {
+  static PHINode *Create(const Type *Ty, const std::string &Name,
+                         BasicBlock *InsertAtEnd) {
     return new PHINode(Ty, Name, InsertAtEnd);
   }
   ~PHINode();
@@ -1395,6 +1869,9 @@
 
   virtual PHINode *clone() const;
 
+  /// Provide fast operand accessors
+  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
+
   /// getNumIncomingValues - Return the number of incoming edges
   ///
   unsigned getNumIncomingValues() const { return getNumOperands()/2; }
@@ -1416,10 +1893,10 @@
   /// getIncomingBlock - Return incoming basic block number x
   ///
   BasicBlock *getIncomingBlock(unsigned i) const {
-    return reinterpret_cast<BasicBlock*>(getOperand(i*2+1));
+    return static_cast<BasicBlock*>(getOperand(i*2+1));
   }
   void setIncomingBlock(unsigned i, BasicBlock *BB) {
-    setOperand(i*2+1, reinterpret_cast<Value*>(BB));
+    setOperand(i*2+1, BB);
   }
   unsigned getOperandNumForIncomingBlock(unsigned i) {
     return i*2+1;
@@ -1437,8 +1914,8 @@
       resizeOperands(0);  // Get more space!
     // Initialize some new operands.
     NumOperands = OpNo+2;
-    OperandList[OpNo].init(V, this);
-    OperandList[OpNo+1].init(reinterpret_cast<Value*>(BB), this);
+    OperandList[OpNo] = V;
+    OperandList[OpNo+1] = BB;
   }
 
   /// removeIncomingValue - Remove an incoming value.  This is useful if a
@@ -1451,7 +1928,7 @@
   ///
   Value *removeIncomingValue(unsigned Idx, bool DeletePHIIfEmpty = true);
 
-  Value *removeIncomingValue(const BasicBlock *BB, bool DeletePHIIfEmpty =true){
+  Value *removeIncomingValue(const BasicBlock *BB, bool DeletePHIIfEmpty=true) {
     int Idx = getBasicBlockIndex(BB);
     assert(Idx >= 0 && "Invalid basic block argument to remove!");
     return removeIncomingValue(Idx, DeletePHIIfEmpty);
@@ -1463,7 +1940,7 @@
   int getBasicBlockIndex(const BasicBlock *BB) const {
     Use *OL = OperandList;
     for (unsigned i = 0, e = getNumOperands(); i != e; i += 2)
-      if (OL[i+1] == reinterpret_cast<const Value*>(BB)) return i/2;
+      if (OL[i+1].get() == BB) return i/2;
     return -1;
   }
 
@@ -1488,6 +1965,13 @@
   void resizeOperands(unsigned NumOperands);
 };
 
+template <>
+struct OperandTraits<PHINode> : HungoffOperandTraits<2> {
+};
+
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(PHINode, Value)  
+
+
 //===----------------------------------------------------------------------===//
 //                               ReturnInst Class
 //===----------------------------------------------------------------------===//
@@ -1497,7 +1981,6 @@
 /// does not continue in this function any longer.
 ///
 class ReturnInst : public TerminatorInst {
-  Use RetVal;
   ReturnInst(const ReturnInst &RI);
   void init(Value * const* retVals, unsigned N);
 
@@ -1506,20 +1989,19 @@
   // ReturnInst()                  - 'ret void' instruction
   // ReturnInst(    null)          - 'ret void' instruction
   // ReturnInst(Value* X)          - 'ret X'    instruction
-  // ReturnInst(    null, Inst *)  - 'ret void' instruction, insert before I
+  // ReturnInst(    null, Inst *I) - 'ret void' instruction, insert before I
   // ReturnInst(Value* X, Inst *I) - 'ret X'    instruction, insert before I
-  // ReturnInst(    null, BB *B)   - 'ret void' instruction, insert @ end of BB
-  // ReturnInst(Value* X, BB *B)   - 'ret X'    instruction, insert @ end of BB
+  // ReturnInst(    null, BB *B)   - 'ret void' instruction, insert @ end of B
+  // ReturnInst(Value* X, BB *B)   - 'ret X'    instruction, insert @ end of B
   // ReturnInst(Value* X, N)          - 'ret X,X+1...X+N-1' instruction
-  // ReturnInst(Value* X, N, Inst *)  - 'ret X,X+1...X+N-1', insert before I
-  // ReturnInst(Value* X, N, BB *)    - 'ret X,X+1...X+N-1', insert @ end of BB
+  // ReturnInst(Value* X, N, Inst *I) - 'ret X,X+1...X+N-1', insert before I
+  // ReturnInst(Value* X, N, BB *B)   - 'ret X,X+1...X+N-1', insert @ end of B
   //
   // NOTE: If the Value* passed is of type void then the constructor behaves as
   // if it was passed NULL.
   explicit ReturnInst(Value *retVal = 0, Instruction *InsertBefore = 0);
   ReturnInst(Value *retVal, BasicBlock *InsertAtEnd);
-  ReturnInst(Value * const* retVals, unsigned N);
-  ReturnInst(Value * const* retVals, unsigned N, Instruction *InsertBefore);
+  ReturnInst(Value * const* retVals, unsigned N, Instruction *InsertBefore = 0);
   ReturnInst(Value * const* retVals, unsigned N, BasicBlock *InsertAtEnd);
   explicit ReturnInst(BasicBlock *InsertAtEnd);
 public:
@@ -1529,31 +2011,30 @@
   static ReturnInst* Create(Value *retVal, BasicBlock *InsertAtEnd) {
     return new(!!retVal) ReturnInst(retVal, InsertAtEnd);
   }
-  static ReturnInst* Create(Value * const* retVals, unsigned N) {
-    return new(N) ReturnInst(retVals, N);
-  }
-  static ReturnInst* Create(Value * const* retVals, unsigned N, Instruction *InsertBefore) {
+  static ReturnInst* Create(Value * const* retVals, unsigned N,
+                            Instruction *InsertBefore = 0) {
     return new(N) ReturnInst(retVals, N, InsertBefore);
   }
-  static ReturnInst* Create(Value * const* retVals, unsigned N, BasicBlock *InsertAtEnd) {
+  static ReturnInst* Create(Value * const* retVals, unsigned N,
+                            BasicBlock *InsertAtEnd) {
     return new(N) ReturnInst(retVals, N, InsertAtEnd);
   }
   static ReturnInst* Create(BasicBlock *InsertAtEnd) {
     return new(0) ReturnInst(InsertAtEnd);
   }
   virtual ~ReturnInst();
+  inline void operator delete(void*);
 
   virtual ReturnInst *clone() const;
 
-  Value *getOperand(unsigned n = 0) const {
-    if (getNumOperands() > 1)
-      return TerminatorInst::getOperand(n);
-    else
-      return RetVal;
-  }
+  /// Provide fast operand accessors
+  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
 
+  /// Convenience accessor
   Value *getReturnValue(unsigned n = 0) const {
-    return getOperand(n);
+    return n < getNumOperands()
+      ? getOperand(n)
+      : 0;
   }
 
   unsigned getNumSuccessors() const { return 0; }
@@ -1572,6 +2053,18 @@
   virtual void setSuccessorV(unsigned idx, BasicBlock *B);
 };
 
+template <>
+struct OperandTraits<ReturnInst> : VariadicOperandTraits<> {
+};
+
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ReturnInst, Value)
+void ReturnInst::operator delete(void *it) {
+  ReturnInst* me(static_cast<ReturnInst*>(it));
+  Use::zap(OperandTraits<ReturnInst>::op_begin(me),
+           OperandTraits<ReturnInst>::op_end(me),
+           true);
+}
+
 //===----------------------------------------------------------------------===//
 //                               BranchInst Class
 //===----------------------------------------------------------------------===//
@@ -1583,7 +2076,6 @@
   /// Ops list - Branches are strange.  The operands are ordered:
   ///  TrueDest, FalseDest, Cond.  This makes some accessors faster because
   /// they don't have to check for cond/uncond branchness.
-  Use Ops[3];
   BranchInst(const BranchInst &BI);
   void AssertOK();
   // BranchInst constructors (where {B, T, F} are blocks, and C is a condition):
@@ -1603,28 +2095,26 @@
   static BranchInst *Create(BasicBlock *IfTrue, Instruction *InsertBefore = 0) {
     return new(1) BranchInst(IfTrue, InsertBefore);
   }
-  static BranchInst *Create(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond,
-                            Instruction *InsertBefore = 0) {
+  static BranchInst *Create(BasicBlock *IfTrue, BasicBlock *IfFalse,
+                            Value *Cond, Instruction *InsertBefore = 0) {
     return new(3) BranchInst(IfTrue, IfFalse, Cond, InsertBefore);
   }
   static BranchInst *Create(BasicBlock *IfTrue, BasicBlock *InsertAtEnd) {
     return new(1) BranchInst(IfTrue, InsertAtEnd);
   }
-  static BranchInst *Create(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond,
-                            BasicBlock *InsertAtEnd) {
+  static BranchInst *Create(BasicBlock *IfTrue, BasicBlock *IfFalse,
+                            Value *Cond, BasicBlock *InsertAtEnd) {
     return new(3) BranchInst(IfTrue, IfFalse, Cond, InsertAtEnd);
   }
 
-  /// Transparently provide more efficient getOperand methods.
-  Value *getOperand(unsigned i) const {
-    assert(i < getNumOperands() && "getOperand() out of range!");
-    return Ops[i];
-  }
-  void setOperand(unsigned i, Value *Val) {
-    assert(i < getNumOperands() && "setOperand() out of range!");
-    Ops[i] = Val;
+  ~BranchInst() {
+    if (NumOperands == 1)
+      NumOperands = (unsigned)((Use*)this - OperandList);
   }
 
+  /// Transparently provide more efficient getOperand methods.
+  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
+
   virtual BranchInst *clone() const;
 
   bool isUnconditional() const { return getNumOperands() == 1; }
@@ -1644,12 +2134,12 @@
   // targeting the specified block.
   // FIXME: Eliminate this ugly method.
   void setUnconditionalDest(BasicBlock *Dest) {
+    Op<0>() = Dest;
     if (isConditional()) {  // Convert this to an uncond branch.
+      Op<1>().set(0);
+      Op<2>().set(0);
       NumOperands = 1;
-      Ops[1].set(0);
-      Ops[2].set(0);
     }
-    setOperand(0, reinterpret_cast<Value*>(Dest));
   }
 
   unsigned getNumSuccessors() const { return 1+isConditional(); }
@@ -1661,7 +2151,7 @@
 
   void setSuccessor(unsigned idx, BasicBlock *NewSucc) {
     assert(idx < getNumSuccessors() && "Successor # out of range for Branch!");
-    setOperand(idx, reinterpret_cast<Value*>(NewSucc));
+    setOperand(idx, NewSucc);
   }
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -1678,6 +2168,15 @@
   virtual void setSuccessorV(unsigned idx, BasicBlock *B);
 };
 
+template <>
+struct OperandTraits<BranchInst> : HungoffOperandTraits<> {
+  // we need to access operands via OperandList, since
+  // the NumOperands may change from 3 to 1
+  static inline void *allocate(unsigned); // FIXME
+};
+
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(BranchInst, Value)
+
 //===----------------------------------------------------------------------===//
 //                               SwitchInst Class
 //===----------------------------------------------------------------------===//
@@ -1686,6 +2185,7 @@
 /// SwitchInst - Multiway switch
 ///
 class SwitchInst : public TerminatorInst {
+  void *operator new(size_t, unsigned);  // DO NOT IMPLEMENT
   unsigned ReservedSpace;
   // Operand[0]    = Value to switch on
   // Operand[1]    = Default basic block destination
@@ -1694,6 +2194,10 @@
   SwitchInst(const SwitchInst &RI);
   void init(Value *Value, BasicBlock *Default, unsigned NumCases);
   void resizeOperands(unsigned No);
+  // allocate space for exactly zero operands
+  void *operator new(size_t s) {
+    return User::operator new(s, 0);
+  }
   /// SwitchInst ctor - Create a new switch instruction, specifying a value to
   /// switch on and a default destination.  The number of additional cases can
   /// be specified here to make memory allocation more efficient.  This
@@ -1708,16 +2212,19 @@
   SwitchInst(Value *Value, BasicBlock *Default, unsigned NumCases,
              BasicBlock *InsertAtEnd);
 public:
-  static SwitchInst *Create(Value *Value, BasicBlock *Default, unsigned NumCases,
-                            Instruction *InsertBefore = 0) {
-    return new(NumCases/*FIXME*/) SwitchInst(Value, Default, NumCases, InsertBefore);
-  }
-  static SwitchInst *Create(Value *Value, BasicBlock *Default, unsigned NumCases,
-                            BasicBlock *InsertAtEnd) {
-    return new(NumCases/*FIXME*/) SwitchInst(Value, Default, NumCases, InsertAtEnd);
+  static SwitchInst *Create(Value *Value, BasicBlock *Default,
+                            unsigned NumCases, Instruction *InsertBefore = 0) {
+    return new SwitchInst(Value, Default, NumCases, InsertBefore);
+  }
+  static SwitchInst *Create(Value *Value, BasicBlock *Default,
+                            unsigned NumCases, BasicBlock *InsertAtEnd) {
+    return new SwitchInst(Value, Default, NumCases, InsertAtEnd);
   }
   ~SwitchInst();
 
+  /// Provide fast operand accessors
+  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
+
   // Accessor Methods for Switch stmt
   Value *getCondition() const { return getOperand(0); }
   void setCondition(Value *V) { setOperand(0, V); }
@@ -1790,7 +2297,7 @@
   }
   void setSuccessor(unsigned idx, BasicBlock *NewSucc) {
     assert(idx < getNumSuccessors() && "Successor # out of range for switch!");
-    setOperand(idx*2+1, reinterpret_cast<Value*>(NewSucc));
+    setOperand(idx*2+1, NewSucc);
   }
 
   // getSuccessorValue - Return the value associated with the specified
@@ -1814,12 +2321,17 @@
   virtual void setSuccessorV(unsigned idx, BasicBlock *B);
 };
 
+template <>
+struct OperandTraits<SwitchInst> : HungoffOperandTraits<2> {
+};
+
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(SwitchInst, Value)  
+
+
 //===----------------------------------------------------------------------===//
 //                               InvokeInst Class
 //===----------------------------------------------------------------------===//
 
-//===---------------------------------------------------------------------------
-
 /// InvokeInst - Invoke instruction.  The SubclassData field is used to hold the
 /// calling convention of the call.
 ///
@@ -1851,15 +2363,10 @@
   ///
   /// @brief Construct an InvokeInst from a range of arguments
   template<typename InputIterator>
-  InvokeInst(Value *Func, BasicBlock *IfNormal, BasicBlock *IfException,
-             InputIterator ArgBegin, InputIterator ArgEnd,
-             const std::string &Name = "", Instruction *InsertBefore = 0)
-      : TerminatorInst(cast<FunctionType>(cast<PointerType>(Func->getType())
-                                          ->getElementType())->getReturnType(),
-                       Instruction::Invoke, 0, 0, InsertBefore) {
-    init(Func, IfNormal, IfException, ArgBegin, ArgEnd, Name,
-         typename std::iterator_traits<InputIterator>::iterator_category());
-  }
+  inline InvokeInst(Value *Func, BasicBlock *IfNormal, BasicBlock *IfException,
+                    InputIterator ArgBegin, InputIterator ArgEnd,
+                    unsigned Values,
+                    const std::string &Name, Instruction *InsertBefore);
 
   /// Construct an InvokeInst given a range of arguments.
   /// InputIterator must be a random-access iterator pointing to
@@ -1869,33 +2376,36 @@
   ///
   /// @brief Construct an InvokeInst from a range of arguments
   template<typename InputIterator>
-  InvokeInst(Value *Func, BasicBlock *IfNormal, BasicBlock *IfException,
-             InputIterator ArgBegin, InputIterator ArgEnd,
-             const std::string &Name, BasicBlock *InsertAtEnd)
-      : TerminatorInst(cast<FunctionType>(cast<PointerType>(Func->getType())
-                                          ->getElementType())->getReturnType(),
-                       Instruction::Invoke, 0, 0, InsertAtEnd) {
-    init(Func, IfNormal, IfException, ArgBegin, ArgEnd, Name,
-         typename std::iterator_traits<InputIterator>::iterator_category());
-  }
+  inline InvokeInst(Value *Func, BasicBlock *IfNormal, BasicBlock *IfException,
+                    InputIterator ArgBegin, InputIterator ArgEnd,
+                    unsigned Values,
+                    const std::string &Name, BasicBlock *InsertAtEnd);
 public:
   template<typename InputIterator>
-  static InvokeInst *Create(Value *Func, BasicBlock *IfNormal, BasicBlock *IfException,
+  static InvokeInst *Create(Value *Func,
+                            BasicBlock *IfNormal, BasicBlock *IfException,
                             InputIterator ArgBegin, InputIterator ArgEnd,
-                            const std::string &Name = "", Instruction *InsertBefore = 0) {
-    return new(ArgEnd - ArgBegin + 3) InvokeInst(Func, IfNormal, IfException, ArgBegin, ArgEnd, Name, InsertBefore);
+                            const std::string &Name = "",
+                            Instruction *InsertBefore = 0) {
+    unsigned Values(ArgEnd - ArgBegin + 3);
+    return new(Values) InvokeInst(Func, IfNormal, IfException, ArgBegin, ArgEnd,
+                                  Values, Name, InsertBefore);
   }
   template<typename InputIterator>
-  static InvokeInst *Create(Value *Func, BasicBlock *IfNormal, BasicBlock *IfException,
+  static InvokeInst *Create(Value *Func,
+                            BasicBlock *IfNormal, BasicBlock *IfException,
                             InputIterator ArgBegin, InputIterator ArgEnd,
                             const std::string &Name, BasicBlock *InsertAtEnd) {
-    return new(ArgEnd - ArgBegin + 3) InvokeInst(Func, IfNormal, IfException, ArgBegin, ArgEnd, Name, InsertAtEnd);
+    unsigned Values(ArgEnd - ArgBegin + 3);
+    return new(Values) InvokeInst(Func, IfNormal, IfException, ArgBegin, ArgEnd,
+                                  Values, Name, InsertAtEnd);
   }
 
-  ~InvokeInst();
-
   virtual InvokeInst *clone() const;
 
+  /// Provide fast operand accessors
+  DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
+  
   /// getCallingConv/setCallingConv - Get or set the calling convention of this
   /// function call.
   unsigned getCallingConv() const { return SubclassData; }
@@ -1913,6 +2423,9 @@
 
   /// @brief Determine whether the call or the callee has the given attribute.
   bool paramHasAttr(unsigned i, ParameterAttributes attr) const;
+  
+  /// addParamAttr - adds the attribute to the list of attributes.
+  void addParamAttr(unsigned i, ParameterAttributes attr);
 
   /// @brief Extract the alignment for a call or parameter (0=unknown).
   unsigned getParamAlignment(unsigned i) const {
@@ -1965,11 +2478,11 @@
     return cast<BasicBlock>(getOperand(2));
   }
   void setNormalDest(BasicBlock *B) {
-    setOperand(1, reinterpret_cast<Value*>(B));
+    setOperand(1, B);
   }
 
   void setUnwindDest(BasicBlock *B) {
-    setOperand(2, reinterpret_cast<Value*>(B));
+    setOperand(2, B);
   }
 
   BasicBlock *getSuccessor(unsigned i) const {
@@ -1979,7 +2492,7 @@
 
   void setSuccessor(unsigned idx, BasicBlock *NewSucc) {
     assert(idx < 2 && "Successor # out of range for invoke!");
-    setOperand(idx+1, reinterpret_cast<Value*>(NewSucc));
+    setOperand(idx+1, NewSucc);
   }
 
   unsigned getNumSuccessors() const { return 2; }
@@ -1998,6 +2511,40 @@
   virtual void setSuccessorV(unsigned idx, BasicBlock *B);
 };
 
+template <>
+struct OperandTraits<InvokeInst> : VariadicOperandTraits<3> {
+};
+
+template<typename InputIterator>
+InvokeInst::InvokeInst(Value *Func,
+                       BasicBlock *IfNormal, BasicBlock *IfException,
+                       InputIterator ArgBegin, InputIterator ArgEnd,
+                       unsigned Values,
+                       const std::string &Name, Instruction *InsertBefore)
+  : TerminatorInst(cast<FunctionType>(cast<PointerType>(Func->getType())
+                                      ->getElementType())->getReturnType(),
+                   Instruction::Invoke,
+                   OperandTraits<InvokeInst>::op_end(this) - Values,
+                   Values, InsertBefore) {
+  init(Func, IfNormal, IfException, ArgBegin, ArgEnd, Name,
+       typename std::iterator_traits<InputIterator>::iterator_category());
+}
+template<typename InputIterator>
+InvokeInst::InvokeInst(Value *Func,
+                       BasicBlock *IfNormal, BasicBlock *IfException,
+                       InputIterator ArgBegin, InputIterator ArgEnd,
+                       unsigned Values,
+                       const std::string &Name, BasicBlock *InsertAtEnd)
+  : TerminatorInst(cast<FunctionType>(cast<PointerType>(Func->getType())
+                                      ->getElementType())->getReturnType(),
+                   Instruction::Invoke,
+                   OperandTraits<InvokeInst>::op_end(this) - Values,
+                   Values, InsertAtEnd) {
+  init(Func, IfNormal, IfException, ArgBegin, ArgEnd, Name,
+       typename std::iterator_traits<InputIterator>::iterator_category());
+}
+
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(InvokeInst, Value)
 
 //===----------------------------------------------------------------------===//
 //                              UnwindInst Class
@@ -2550,24 +3097,17 @@
 /// GetResultInst - This instruction extracts individual result value from
 /// aggregate value, where aggregate value is returned by CallInst.
 ///
-class GetResultInst : public /*FIXME: Unary*/Instruction {
-  void *operator new(size_t, unsigned);  // DO NOT IMPLEMENT
-  Use Aggr;
+class GetResultInst : public UnaryInstruction {
   unsigned Idx;
   GetResultInst(const GetResultInst &GRI) :
-    Instruction(GRI.getType(), Instruction::GetResult, &Aggr, 1) {
-    Aggr.init(GRI.Aggr, this);
-    Idx = GRI.Idx;
+    UnaryInstruction(GRI.getType(), Instruction::GetResult, GRI.getOperand(0)),
+    Idx(GRI.Idx) {
   }
 
 public:
-  // allocate space for exactly one operand
-  void *operator new(size_t s) {
-    return User::operator new(s, 1);
-  }
-  explicit GetResultInst(Value *Aggr, unsigned index,
-                         const std::string &Name = "",
-                         Instruction *InsertBefore = 0);
+  GetResultInst(Value *Aggr, unsigned index,
+                const std::string &Name = "",
+                Instruction *InsertBefore = 0);
 
   /// isValidOperands - Return true if an getresult instruction can be
   /// formed with the specified operands.
@@ -2587,8 +3127,6 @@
     return Idx;
   }
 
-  unsigned getNumOperands() const { return 1; }
-
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const GetResultInst *) { return true; }
   static inline bool classof(const Instruction *I) {

Modified: llvm/branches/non-call-eh/include/llvm/IntrinsicInst.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/IntrinsicInst.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/IntrinsicInst.h (original)
+++ llvm/branches/non-call-eh/include/llvm/IntrinsicInst.h Sun Jul  6 15:45:41 2008
@@ -28,7 +28,6 @@
 #include "llvm/Function.h"
 #include "llvm/Instructions.h"
 #include "llvm/Intrinsics.h"
-#include "llvm/System/IncludeFile.h"
 
 namespace llvm {
   /// IntrinsicInst - A useful wrapper class for inspecting calls to intrinsic
@@ -39,12 +38,6 @@
     IntrinsicInst(const IntrinsicInst&);  // DO NOT IMPLEMENT
     void operator=(const IntrinsicInst&); // DO NOT IMPLEMENT
   public:
-
-    /// StripPointerCasts - This static method strips off any unneeded pointer
-    /// casts from the specified value, returning the original uncasted value.
-    /// Note that the returned value is guaranteed to have pointer type.
-    static Value *StripPointerCasts(Value *Ptr);
-    
     /// getIntrinsicID - Return the intrinsic ID of this intrinsic.
     ///
     Intrinsic::ID getIntrinsicID() const {
@@ -103,8 +96,8 @@
       return unsigned(cast<ConstantInt>(getOperand(2))->getZExtValue());
     }
     
-    std::string getFileName() const;
-    std::string getDirectory() const;
+    Value* getFileName() const;
+    Value* getDirectory() const;
 
     // Methods for support type inquiry through isa, cast, and dyn_cast:
     static inline bool classof(const DbgStopPointInst *) { return true; }
@@ -190,7 +183,7 @@
     /// getDest - This is just like getRawDest, but it strips off any cast
     /// instructions that feed it, giving the original input.  The returned
     /// value is guaranteed to be a pointer.
-    Value *getDest() const { return StripPointerCasts(getRawDest()); }
+    Value *getDest() const { return getRawDest()->stripPointerCasts(); }
 
     /// set* - Set the specified arguments of the instruction.
     ///
@@ -241,7 +234,7 @@
     /// getSource - This is just like getRawSource, but it strips off any cast
     /// instructions that feed it, giving the original input.  The returned
     /// value is guaranteed to be a pointer.
-    Value *getSource() const { return StripPointerCasts(getRawSource()); }
+    Value *getSource() const { return getRawSource()->stripPointerCasts(); }
 
 
     void setSource(Value *Ptr) {
@@ -271,7 +264,7 @@
     /// getSource - This is just like getRawSource, but it strips off any cast
     /// instructions that feed it, giving the original input.  The returned
     /// value is guaranteed to be a pointer.
-    Value *getSource() const { return StripPointerCasts(getRawSource()); }
+    Value *getSource() const { return getRawSource()->stripPointerCasts(); }
 
     void setSource(Value *Ptr) {
       assert(getRawSource()->getType() == Ptr->getType() &&
@@ -316,8 +309,4 @@
 
 }
 
-// Ensure that the IntrinsicInst.cpp file gets added as a dependency of any 
-// file that includes this header
-FORCE_DEFINING_FILE_TO_BE_LINKED(IntrinsicInst)
-
 #endif

Modified: llvm/branches/non-call-eh/include/llvm/Intrinsics.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Intrinsics.h?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Intrinsics.h (original)
+++ llvm/branches/non-call-eh/include/llvm/Intrinsics.h Sun Jul  6 15:45:41 2008
@@ -16,6 +16,8 @@
 #ifndef LLVM_INTRINSICS_H
 #define LLVM_INTRINSICS_H
 
+#include <string>
+
 namespace llvm {
 
 class Type;

Modified: llvm/branches/non-call-eh/include/llvm/Intrinsics.td
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/non-call-eh/include/llvm/Intrinsics.td?rev=53163&r1=53162&r2=53163&view=diff

==============================================================================
--- llvm/branches/non-call-eh/include/llvm/Intrinsics.td (original)
+++ llvm/branches/non-call-eh/include/llvm/Intrinsics.td Sun Jul  6 15:45:41 2008
@@ -48,6 +48,9 @@
 // default if the intrinsic has no other Intr*Mem property.
 def IntrWriteMem : IntrinsicProperty;
 
+// Commutative - This intrinsic is commutative: X op Y == Y op X.
+def Commutative : IntrinsicProperty;
+
 //===----------------------------------------------------------------------===//
 // Types used by intrinsics.
 //===----------------------------------------------------------------------===//
@@ -267,22 +270,67 @@
 def int_memory_barrier : Intrinsic<[llvm_void_ty, llvm_i1_ty, llvm_i1_ty, 
                                     llvm_i1_ty, llvm_i1_ty, llvm_i1_ty], []>;
 
-def int_atomic_lcs  : Intrinsic<[llvm_anyint_ty,
-                                 LLVMPointerType<LLVMMatchType<0>>,
-                                 LLVMMatchType<0>, LLVMMatchType<0>],
-                                [IntrWriteArgMem]>,
-                      GCCBuiltin<"__sync_val_compare_and_swap">;
-def int_atomic_las  : Intrinsic<[llvm_anyint_ty,
-                                 LLVMPointerType<LLVMMatchType<0>>,
-                                 LLVMMatchType<0>],
+def int_atomic_cmp_swap : Intrinsic<[llvm_anyint_ty,
+                                  LLVMPointerType<LLVMMatchType<0>>,
+                                  LLVMMatchType<0>, LLVMMatchType<0>],
+                                 [IntrWriteArgMem]>,
+                           GCCBuiltin<"__sync_val_compare_and_swap">;
+def int_atomic_load_add : Intrinsic<[llvm_anyint_ty,
+                                  LLVMPointerType<LLVMMatchType<0>>,
+                                  LLVMMatchType<0>],
+                                 [IntrWriteArgMem]>,
+                           GCCBuiltin<"__sync_fetch_and_add">;
+def int_atomic_swap     : Intrinsic<[llvm_anyint_ty,
+                                  LLVMPointerType<LLVMMatchType<0>>,
+                                  LLVMMatchType<0>],
                                 [IntrWriteArgMem]>,
-                      GCCBuiltin<"__sync_fetch_and_add">;
-def int_atomic_swap : Intrinsic<[llvm_anyint_ty,
-                                 LLVMPointerType<LLVMMatchType<0>>,
-                                 LLVMMatchType<0>],
-                               [IntrWriteArgMem]>,
-                      GCCBuiltin<"__sync_lock_test_and_set">;
-
+                           GCCBuiltin<"__sync_lock_test_and_set">;
+def int_atomic_load_sub : Intrinsic<[llvm_anyint_ty,
+                                  LLVMPointerType<LLVMMatchType<0>>,
+                                  LLVMMatchType<0>],
+                                 [IntrWriteArgMem]>,
+                           GCCBuiltin<"__sync_fetch_and_sub">;
+def int_atomic_load_and : Intrinsic<[llvm_anyint_ty,
+                                  LLVMPointerType<LLVMMatchType<0>>,
+                                  LLVMMatchType<0>],
+                                 [IntrWriteArgMem]>,
+                           GCCBuiltin<"__sync_fetch_and_and">;
+def int_atomic_load_or   : Intrinsic<[llvm_anyint_ty,
+                                  LLVMPointerType<LLVMMatchType<0>>,
+                                  LLVMMatchType<0>],
+                                 [IntrWriteArgMem]>,
+                           GCCBuiltin<"__sync_fetch_and_or">;
+def int_atomic_load_xor : Intrinsic<[llvm_anyint_ty,
+                                  LLVMPointerType<LLVMMatchType<0>>,
+                                  LLVMMatchType<0>],
+                                 [IntrWriteArgMem]>,
+                           GCCBuiltin<"__sync_fetch_and_xor">;
+def int_atomic_load_nand : Intrinsic<[llvm_anyint_ty,
+                                  LLVMPointerType<LLVMMatchType<0>>,
+                                  LLVMMatchType<0>],
+                                 [IntrWriteArgMem]>,
+                           GCCBuiltin<"__sync_fetch_and_nand">;
+def int_atomic_load_min  : Intrinsic<[llvm_anyint_ty,
+                                   LLVMPointerType<LLVMMatchType<0>>,
+                                   LLVMMatchType<0>],
+                                  [IntrWriteArgMem]>,
+                           GCCBuiltin<"__sync_fetch_and_min">;
+def int_atomic_load_max  : Intrinsic<[llvm_anyint_ty,
+                                   LLVMPointerType<LLVMMatchType<0>>,
+                                   LLVMMatchType<0>],
+                                  [IntrWriteArgMem]>,
+                           GCCBuiltin<"__sync_fetch_and_max">;
+def int_atomic_load_umin : Intrinsic<[llvm_anyint_ty,
+                                   LLVMPointerType<LLVMMatchType<0>>,
+                                   LLVMMatchType<0>],
+                                  [IntrWriteArgMem]>,
+                           GCCBuiltin<"__sync_fetch_and_umin">;
+def int_atomic_load_umax : Intrinsic<[llvm_anyint_ty,
+                                   LLVMPointerType<LLVMMatchType<0>>,
+                                   LLVMMatchType<0>],
+                                  [IntrWriteArgMem]>,
+                           GCCBuiltin<"__sync_fetch_and_umax">;
+                                  
 //===-------------------------- Other Intrinsics --------------------------===//
 //
 def int_flt_rounds : Intrinsic<[llvm_i32_ty]>,





More information about the llvm-commits mailing list